Micro C, Part 3: Generating LLVM
blog.josephmorag.com
blog.josephmorag.com
Really enjoying this. For others, here's the series so far:
Part 0: Introduction https://blog.josephmorag.com/posts/mcc0/
Part 1: Parsing https://blog.josephmorag.com/posts/mcc1/
Part 2: Semantic Analysis https://blog.josephmorag.com/posts/mcc2/
Part 3: Generating LLVM https://blog.josephmorag.com/posts/mcc3/
I understand the feeling, that's why it's very necessary to either find a very good teaching resource.
I'm currently reading "A Type of Programming" for fun and it kind of reminds me of "Why's poignant guide to Ruby in presentation (sadly sans artful illustrations)":
https://atypeofprogramming.com/ (do yourself a favor and at least click to read the well-written intro ;) )
The caveat (because there usually is one) being that it's 720 pages long. That's another tradeoff though.. you either get something that gets you all the way from point A to point B and it's very long or you get something very dense that requires lots of hammock time to derive the intuition yourself.
> I often wonder if Haskell is useful for anything
Also, I'll note that I write Haskell for my day job to combat your though of "wonder if Haskell is useful for anything".
> someone must be using it.
Yep :)
And there is a C version of "Modern Compiler Implementation" as well.
I know that this would be related to instruction selection and register allocation (where at some point you map an infinite register architecture - like LLVM - to a finite real-world machine), but I never found a nice example.