DEV Community

Discussion on: Is C still a high level language?

 
pentacular profile image
pentacular

Every CPU has a memory model, but other than that you've done a good job of demonstrating why C isn't a portable assembly. :)

Beyond that, if you believe that C has a very strong correspondence to every machine code instruction set, then you believe that every machine code instruction set has a strong correspondence with every other machine code instruction set.

This is simply not true -- let's consider a forth machine.

Or if that's not enough, consider one which runs befunge in hardware.

Now let's consider your example operations.
What do you believe this is required to translate to?

void foo() {
  int i = 0;
  int a[3] = { 1, 2, 3 };
  struct foo { int c; } b;
  b.c = a[i++];
}

When you've done that, let me know what you think this does:

void bar() {
  while (1);
}

And then let's finish up with a more interesting example.
What does calling this do?

void quux() {
  int i = 1;
  printf("%d, %d\n", i++, i);
}