News for hackers. Stuff that matters.
Re:“C is not how the computer works” can lead to inefficient... by jpochtar on Friday October 25, 2019 @03:02PM (#21358142)
For many people, "C" means C+{gcc/clang}+{x86/arm}, which has much more specific semantics than the C99 abstract machine.

They'll ask interview questions like "what's sizeof(int)" expecting a number, and will find "it depends on the compiler/architecture" evasive, unless you follow it up with "but it's always 4". To be fair, this is how 99% of people use C in practice, and x86/arm behave pretty similarly to each other in the scheme of things (vs, say, a LISP machine).

Taking into account ABI constraints, including x-{language,module} call safety, threading expectations, and more, a typical C programmer has to have a decent idea of how the machine works, relative to a Python/JS/Ruby programmer.

I don't love that someone "learning C to learn how the machine works" will think malloc()/free() are how the machine works, and will get have wrong expectations ideas about memory when using, say, V8's bump allocated nursery + compacting GC. But it's not a bad first step for someone who doesn't know what a pointer is to the machine.

Re:“C is not how the computer works” can lead to inefficient... by colejohnson66 on Friday October 25, 2019 @08:10PM (#21360501)
> "but it's always 4"

Not on the Arduino. `sizeof(int) == 2` ;)

Re:“C is not how the computer works” can lead to inefficient... by _bxg1 on Friday October 25, 2019 @06:16PM (#21359787)
> in the scheme of things (vs, say, a LISP machine)

Heh

Re:“C is not how the computer works” can lead to inefficient... by jpochtar on Friday October 25, 2019 @06:19PM (#21359812)
;)