245 points · by memexy · 6y ago · 36 comments
Even many higher education IT programs often barely cover the underpinnings anymore.
I'm currently embarking on a fun little "from first principles" challenge:
Imagine a post-apocalyptic world where computers are a relic of the past.
You stumble upon a functioning device with a screen and keyboard. When powered on, all you get is a bare metal "assembly interpreter". You can type in riscv64 assembly instructions and they are executed. You can print to the screen via a UART. So you don't even get an assembler/linker to build on.
From there you have to build up an entire new software stack, with a proper language with compiler/vm, an operating system, a standard library, basic userspace tools, a UI, ...
Simulating the device and console is easy with qemu-system-riscv64 and a a bit of assembly.
It's very challenging, but also rewarding to study up/relearn and implement all the basic underpinnings of computers, all the way from hardware (CPU, memory, IO devices, ISAs) up to a GUI stack.
Hacking together a simple OS isn't actually all that hard when your hardware is constrained to a specific device. And writing a very simple language in assembly also isn't that bad. You can build progressively better languages on top of that.
I'd love to turn this into a somewhat guided, interactive learning experience that runs in the browser via tinyemu [1] or similar, but I won't have time for that.
It's a popular course about building a computer from nand gates and eventually building a Tetris like game on it. All of this is done on a hardware simulator of course.
If you are keen on real hardware, you might find this interesting: https://www.youtube.com/watch?v=HyznrdDSSGM&list=PLowKtXNTBy...
It's a series of videos where Ben Eater explains how to build an 8-bit computer using breadboards and basic elements of circuits. I find that his explanations are quite good as well.
Really? A compiler course seems quite standard in any licence/bachelor CS degree.
I think more common is to have a few courses on it, but as a small part of the curriculum; which is largely forgotten by graduation time.
I guarantee that asking the average application developer about IO ports, out of order execution, cache misses, AST passes, stack machines, how a GC works, or even just how to implement a hash table or tradeoffs between arrays and linked lists will earn you mostly blank, confused stares.
Let's be honest, 90% of everything you "learn" at university is largely forgotten during graduation time. I've seen folks fresh out of uni who couldn't even run a Java program without an IDE, or who forgot how to write a switch statement.
I find it fascinating how inefficient the brain is, and how though it spends huge amount of our resources, it's actually not extremely good at picking up new complex information.
I've always advocated that, if you want to really understand the tools you are using, you need to understand at least one level below the "surface abstraction" that you are working if. Even better if you can understand two or three levels down.
There's a great talk from game developer Jonathan Blow [1] that describes how knowledge is lost "generationally" due to our lack of understanding of the black boxes we build things on top of. Not sure I 100% agree with his thoughts, but it's an interesting take.
I'm self taught (but have been programming 10+ years) so it's been a really interesting experience - I've gotten exposure/actual use of some different data structures and algorithms that I've never used before.
If you're into this kinda thing, I suggest checking out the ProgrammingLanguages subreddit, there's a discord server as well.
(in position f2) (in uv f2) (all sprite tex) (all color f4)
(vert (position 0.0 1.0))
(frag (* (sprite uv) color))
The end result worked out pretty well, and took less time than I expected: