Low-Level Programming Languages
For those who studied under Sams or some other Dummy, it’s time to lay out some fundamentals.
In computer science, a low-level programming language is a programming language that provides little or no abstraction from a computer’s instruction set architecture.
At this point, we’re either talking machine code or assembly language.
Low-level languages can be converted to machine code without using a compiler or interpreter, and the resulting code runs directly on the processor.
Machine code is the only language a microprocessor can process directly without a previous transformation.
Above is a function in 32-bit x86 machine code to calculate the nth Fibonacci number.
Writing machine code was nutballs because it required memorizing or looking up numerical codes for every instruction that is used. Who the hell ever had the time for that?
Please tell me you’re not doing this for a living?
An assembly language is a low-level programming language for a computer, microcontroller, or other programmable device, in which each statement corresponds to a single machine code instruction:
The same Fibonacci number calculator as above, but in x86 assembly language using MASM syntax.
Each microcontroller had it’s own distinct assembly language instruction set. But, this was a step up because you no longer had to memorize or lookup every single instruction opcode.
A developer could more easily remember commands like move (mov) or compare (cmp) over 8B542408 or FA027706.
Statements like mov ax,0 and add ax,bx are meaningless to the microprocessor. As arcane as these statements appear, they were still human readable forms of computer instructions.
But, at the end-of-the-day, the computer only responds to commands like B80000 and 03C3. An assembly language and its corresponding assembler is a program that converts strings like mov ax,0 to architecture specific machine code like “B80000”.
Surely, you’re not doing this for a living either?
High-Level Programming Langauges
It’s just stinking wrong. Absolutely, unequivocally wrong:
In computer science, a high-level programming language is a programming language with strong abstraction from the details of the computer and it’s machine code.
That abstraction forms the basis of what developers come to expect in a modern programming language:
How did this low-level nonsense get this far?
One of my developer tweeps @HexstreamSoft summarized the madness best:
The problem here is this new definition for “low-level” programming language is simply wrong. It never was and never will be the definition of “low-level”.
Even if it was, when would the madness stop? If I wrote a new language which transpiles to CoffeeScript, would we then say CoffeeScript is a “low-level” programming language?
Folks like to opine the terms high-level and low-level are inherently relative. That for every generation of programming language, the previous is a lower-level.
If you haven’t heard it before, let me be the first to tell you that is complete and utter bullshit. A programming language either has high-level constructs or it doesn’t. This isn’t about feelings or transpiling or anything else.
A programming language is “low-level” if it lacks high-level abstract constructs: Functions, Classes, Inheritance, Polymorphism, etc.
It’s that simple.
Blame The Wave of Designer Languages
I blame the current wave of Designer Languages for our temporary bout with insanity.
In fact, none of these designer languages even add any new abstract constructs. Most, invariably, only add syntactic sugar to what was already an elegant language.
Designer languages are the expensive shoes you wear to impress your date or the Versace dress your girl wore to the prom. They are pomp and circumstance.
Take a deep dive into any designer language. CoffeeScript, TypeScript, Dart, GWT, Sweet, LLJS, Opal, it really doesn’t matter.
What you’ll find is this…
What I am saying is don’t confuse science with fashion.