Vladimir Keleshev, a programmer and author of "Compiling to Assembly from Scratch", writes about compilers, ARM, OCaml, and writing tools.
Commenters repeatedly recommend his book on compiling to assembly, noting its TypeScript compiler makes it accessible, and praise his abstract syntax tree article.
Thank you Eatonphil for writing this.
I agree that I would love to see more of this kind and quality this kind of article of technical subjects.
https://blog.jcoglan.com/2017/02/12/the-myers-diff-algorithm-part-1/
https://keleshev.com/abstract-syntax-tree-an-example-in-c/
I don't want to add more work to people who are already working more than everyone else. But when you write software or code that is truly good, I want people to write lots of examples and descriptions of their mental model and how to think of the software.
I'm still trying to understand what the difference between a poller and an awaiter in Rust async.
I use Flask because I find Flask easier to understand than Django. There's even a simple example on the Flask homepage. But Django has a very large tutorial which still doesn't really explain how each component fits together. I don't understand the mental model behind Django but I do with Flask.
For example, I'm still trying to understand C++ coroutines. And I have some code that kind of works and some code someone provided on Stackoverflow I cannot get to work with GCC. There's not large amounts of documentation on C++ coroutines.
I see people post fascinating awesome GitHub projects and have sparse README.md and no screenshots
The code doesnt speak for itself. You can write the perfect code at a company and that code never flourishes because nobody wrote about it. Or you can write the perfect code at home but it doesn't get used.
I would rather…
Man! I actually like half of Golang's error handling practice. Returning errors and dealing with them in a simple case sounds nice, there is no magic required, no need to think "am I forgetting to catch an exception here?"
On the other hand, the fact that we are returning a tuple of (result, err) where by convention err should be nil if everything worked screams as a terrible design to me.
But I might be influenced by reading too much Haskell/ML inspired languages :D
Once you understand applicative validation [1] or exhaustive pattern matching on row-polymorphic sum types [2], other error handling methods just seem so crude :)
[1] https://leanpub.com/purescript/read#leanpub-auto-applicative-validation
[2] http://keleshev.com/composable-error-handling-in-ocaml
As very much a non-expert in compiler design, I found two books to be helpful introductory reads (neither are free though). I'm not sure whether someone proficient in the field would recommend them as my knowledge in the area is small, but I enjoyed them.
- Writing An Interpreter In Go by Thorsten Ball (https://interpreterbook.com)
- Compiling to Assembly from Scratch by Vladimir Keleshev (https://keleshev.com/compiling-to-assembly-from-scratch)
The first produces an interpreter in Go for a custom language, but as simscitizen says there's a lot of crossover with compilers.
The second creates a compiler written in Typescript that compiles from a minimal form of Typescript into ARM assembly. It's not cheap but is good.
Always cool to see people experimenting with languages! I'm doing a similar thing with wheel-lang [0], which started as pretty purely imperative, but is starting to grow some object-oriented features.
Nystrom's Crafting Interpreters is a great resource; I've also liked Compiling to Assembly From Scratch [1] and Write You a Haskell [2].
[0] https://github.com/DylanSp/wheel-lang/
[1] https://keleshev.com/compiling-to-assembly-from-scratch/
[2] http://dev.stephendiehl.com/fun/
Building git
https://shop.jcoglan.com/building-git/
Build a blockchain from scratch in go
https://web3coach.gumroad.com/l/build-a-blockchain-from-scratch-in-go
Compiling to assembly from scratch
https://keleshev.com/compiling-to-assembly-from-scratch/
If anyone knows of similar books, don't hesitate to comment below.
IMHO the worst part of Go errors is that they are strings, so if you propagate them, you can't do anything but print them. You can't handle them properly, since you can't match them in a robust way.
Just compare how good the error handling is in OCaml: http://keleshev.com/composable-error-handling-in-ocaml