←back to thread

Type checking is a symptom, not a solution

(programmingsimplicity.substack.com)
67 points mpweiher | 1 comments | | HN request time: 0.001s | source
Show context
jameshart ◴[] No.45142572[source]
All programmers need to try assembly programming just once.

Just a program counter, a stack, a flat addressable block of memory, and some registers.

You’ll very quickly learn how hard it is to program when you have complete responsibility for making sure that the state of the system is exactly as expected before a routine is called, and that it’s restored on return.

Every language tool we’ve built on top of that is to help programmers keep track of what data they stored where, what state things should be in before particular bits of code are run, and making it harder to make dumb mistakes like running some code that will only work on data of one sort on data of a totally different structure.

Of course types are a solution. You just have no idea what the problem was.

replies(7): >>45142961 #>>45143148 #>>45143298 #>>45143430 #>>45143718 #>>45145214 #>>45145436 #
ratelimitsteve ◴[] No.45143148[source]
https://computersystemsbook.com/

If anyone is interested in learning assembly, this was the book and simulator I used as an undergrad. It's not exactly bytecode that will run on an actual processor but it will help you understand the bare metal things a CPU has to do in order to actually operate upon data and it's kinda eye opening when compared to what modern coding is actually like nowadays.

replies(1): >>45143230 #
1. jameshart ◴[] No.45143230[source]
I’ll always recommend Ben Eater’s YouTube series - one where he constructs a CPU and then one where he builds a working system around a 6502. Full of amazing insights into the things that a computer has to do just to accomplish the simplest tasks. And if you work your way up from the very bottom you have such an appreciation for why 6502 assembly language is the way it is when it’s introduced.

https://eater.net/