ConcernedAnon
Concerned and hopefully anonymous
EXEs and drivers typically contain machine code, machine code being in a sense the language that machines understand, but they require Windows/Linux/an OS to actually get them running. I don't know why exactly why he's grouping this with JITed virtual machines like C#, but whatever. Virtual machine generally means "a program that runs other programs" so I guess you could compare that aspect of an OS to something like the CLI (the virtual machine that C# code runs on).So I was watching this video about assembly code and I encountered something that muddied the waters for me.
He mentions that C++, C# are for virtual machines, exes, and drivers, but he makes no mention of operating systems. Isn't Windows written in those languages? I thought a virtual machine was supposed to be an OS loaded entirely on random access memory as a security feature or for running backwards compatibility on old software, is he saying that operating systems and virtual machines are the same thing?
Here's the deal essentially, you have a language called machine code which computer processors can actually understand, but unfortunately it's literally just a big pile of numbers and is basically unreadable to humans. Heaven forbid you ever have to write some machine code by hand.
So then you have assembly, which is sort of like a human-readable version of machine code, e.g. it's the pinyin to machine code's gook runes. Programs called assemblers turn the assembly into machine code. This is a little better, but it's still not a good way of visualizing or tackling most programming tasks
To assist with that you have languages like C++, which are translated to assembly by compilers. An exe or driver would typically be written in C/C++/assembly or some other language that translates to machine code, because these applications typically require performance and access to machine code features.
C++ and languages like it have a lot of gotchas however, so then you have virtual machines, which are programs written in those same types of "low level" languages typically (C etc.). Virtual machines act as translators between more convenient languages like Python, and machine code.
Finally you get your languages like Python and JavaScript which are read and executed by some virtual machine. They have the advantage of being "abstracted" from machine code which means they can operate in more intuitive ways.
The low level languages are useful when you need speed or fine control, and the high level languages are useful for general tasks.
Consider this though, the js runtime will have to be written in C/C++/Rust/whatever. Unless you are suggesting the diabolical; we start emulating javascript using javascriptI'm at the point where i see no reason to bother with C, C++ or anything else that isn't javascript. I'm pretty sure everything will switch to JS in the future.
Last edited: