4 ms·
> C++ code can be compiled into assembly language for direct execution on the OS Honestly it sounds like these guys don't know how a computer works at all.
by jeffbee 4y ago
> C++ code can be compiled into assembly language for direct execution on the OS
Honestly it sounds like these guys don't know how a computer works at all.
- jtsiskin 4y agoThe full quote is “Moreover, C++ code can be compiled into assembly language for direct execution on the OS instead of relying on interpreters or language runtime.”
- deleted 4y ago[deleted]
- PaulDavisThe1st 4y agoBack when I started programming computers for a living, I came across a quote from wise sage that went something like this: "When you first start programming, understanding the difference between a compiled and an interpreted language can be quite hard. After you've been doing it for a while, the difference will seem really obvious, and impossible to miss. When you've been doing it even longer, you'll find that you are no longer sure of what the difference really, and will likely struggle to explain it to a beginner."
- _gabe_ 4y agoI think the parent comment is just insinuating that it's weird that they said assembly gets executed directly by the machine. Instead of saying that the assembly gets assembled into binary machine code that gets executed directly by the machine. And afaik that's what ultimately happens, but maybe I don't know how a computer works either. If that's the case please correct me haha.
- PaulDavisThe1st 4y agoWell, the "binary machine code" in many cases today gets translated into microcode before it is "executed", so there's that.
- johnisgood 4y agoI think that is fine, but maybe I have no clue either. :D
- deilline 4y agoMaybe they meant there’s no VM like w/ Java, so no intermediate bytecode, or no IL like C# iirc
- kaba0 4y agoI’m sure you know it but in the majority of cases JIT-compiled languages run bare-metal machine code just as well.
- pjmlp 4y agoIt is called LLVM, GIMPLE or whatever, depending on the middle layer we are talking about in C and C++ compilers. Likewise there are JIT and AOT compilers for turning those JVM bytecodes or MSIL into machine code as well, including not shipping a VM rather a runtime. So it does show a lack of understanding on how compilers work.
- stingraycharles 4y agoYes but assembly is an intermediary representation and the OS is not doing any “direct execution”, it’s the CPU that does it. I would expect a seasoned C++ database developer to be able to understand these nuances.
- jcelerier 4y ago> Yes but assembly is an intermediary representation there's certainly a technical difference between assembly and machine code, but it's pretty common to use the word "assembly" by metonymy with the latter > the OS is not doing any “direct execution” OSes have native executable formats for which execution most certainly has less steps than executing a .js, a .jar or a .sh, which I would absolutely call "direct execution". The criterion can be defined I would guess as - does the OS / environment need to launch a separate process / specific steps such as setting up an interpreter before getting to the code you want to execute ? but most likely there's a finer distinction to be made.
- vnorilo 4y agoThe charitable interpretation is they mean the code runs without a VM, and interfaces with OS syscalls instead of an inner platform like node, java, .net...