←back to thread

218 points signa11 | 3 comments | | HN request time: 0.575s | source
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 #
grandempire ◴[] No.43682322[source]
> but that'a not what computers are

Which language more accurately represents hardware then?

replies(3): >>43682445 #>>43682466 #>>43682491 #
1. 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 #
2. grandempire ◴[] No.43682642[source]
C++ better represents the machine?
3. uecker ◴[] No.43683141[source]
C has the same atomics and concurrency model as C++.