←back to thread

218 points signa11 | 8 comments | | HN request time: 0s | source | bottom
Show context
pjmlp ◴[] No.43681194[source]
> The reason I believe C is and always will be important is that it stands in a class of its own as a mostly portable assembler language, offering similar levels of freedom.

When your computer is a PDP-11, otherwise it is a high level systems language like any other.

replies(7): >>43682173 #>>43682246 #>>43682554 #>>43682928 #>>43683332 #>>43683914 #>>43701871 #
grandempire ◴[] No.43682246[source]
Which other popular language more accurately represents a random access machine of fixed word length?
replies(3): >>43682309 #>>43682371 #>>43682763 #
alexvitkov ◴[] No.43682309[source]
None, but that'a not what computers are. C assumes that in a few places, e.g. variadic functions, and those are the worst parts of the language.
replies(1): >>43682322 #
1. grandempire ◴[] No.43682322[source]
> but that'a not what computers are

Which language more accurately represents hardware then?

replies(3): >>43682445 #>>43682466 #>>43682491 #
2. pjmlp ◴[] No.43682466[source]
Assembly language from the hardware vendor.
replies(1): >>43682533 #
3. alexvitkov ◴[] No.43682491[source]
C++ for one - it has atomics with well defined memory barriers, and guarentees for what happens around them.

The real answer is obviously Assembly - pick a random instruction from any random modern CPU and I'd wager there's a 95% chance it's something you can't express in C at all. If the goal is to model hardware (it's not), it's doing a terrible job.

replies(2): >>43682642 #>>43683141 #
4. oguz-ismail ◴[] No.43682533[source]
isn't it translated to microcode before being executed?
replies(1): >>43682997 #
5. sugrado ◴[] No.43682638[source]
bro just quoted a chatbot
6. grandempire ◴[] No.43682642[source]
C++ better represents the machine?
7. pjmlp ◴[] No.43682997{3}[source]
Depends on the hardware design.
8. uecker ◴[] No.43683141[source]
C has the same atomics and concurrency model as C++.