5 ms·
Which other popular language more accurately represents a random access machine of fixed word length?
by grandempire 2y ago
Which other popular language more accurately represents a random access machine of fixed word length?
- alexvitkov 2y agoNone, 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.
- grandempire 2y ago> but that'a not what computers are Which language more accurately represents hardware then?
- pjmlp 2y agoAssembly language from the hardware vendor.
- oguz-ismail 2y agoisn't it translated to microcode before being executed?
- pjmlp 2y agoDepends on the hardware design.
- acka 2y ago[flagged]
- sugrado 2y agobro just quoted a chatbot
- alexvitkov 2y agoC++ 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.
- grandempire 2y agoC++ better represents the machine?
- uecker 2y agoC has the same atomics and concurrency model as C++.
- pjmlp 2y agoI don't know, Ada, Modula-2, Object Pascal, PL/I, NEWP, PL.8, D, Zig, Mesa, ATS,.... But then again, you booby trapped the question with popular language.
- guywithahat 2y agoIf a language is unpopular, people won't want to work for you and you'll run into poor support. Rewriting a library may take months of dev time, whereas C has an infinite number of libraries to work with and examples to look at.
- pjmlp 2y agoMoving goalposts regarding systems programming languages features, some on the group predate C by a decade.
- guywithahat 2y agoBeing old doesn't mean anyone knows the language. I mean if the language predates C significantly and nobody uses is then there's probably a really good for it. The goalposts aren't moving they're just missing the shot
- OCASMv2 2y agoPopularity isn't a measure of quality. Never has been and certainly not in the case of programming languages.
- grandempire 2y agoThere is unpopular - and then there is can I get a working toolchain for modern OS that’s not emulated.
- OCASMv2 2y agoStill not a measure of quality.
- kryptiskt 2y agoC lacks sympathy with nearly all additions to hardware capabilities since the late 80s. And it's only with the addition of atomics that it earns the qualification of "nearly". The only thing that makes it appear as lower level than other languages is the lack of high-level abstraction capabilities, not any special affinity for the hardware. For one, would expect that a low level language wouldn't be so completely worthless at bit twiddling. Another thing, if C is so low level, why can't I define a new calling convention optimized for my use case? Why doesn't C have a rich library for working with SIMD types that has been ubiquitous in processors for 25 years?
- kryptiskt 2y agoLike, say I have a data structure that is four bits wide (consisting of a couple of flags or something) and I want to make an array of them and access them randomly. What help do I get from C to do this? C says "fuck you".
- grandempire 2y agoIt also has pointers which are absent from most languages but essential to instruction sets.
- pjmlp 2y agoLots of languages since the 1950's have pointers.
- codr7 2y ago