#Essentials of Compilation

1 messages · Page 1 of 1 (latest)

modest drum
#

I’m working (on-stream) my way through the textbook “Essentials of Compilation: An Incremental Approach in Racket” by Jeremy Siek, but writing the compiler in Gleam!

Code: https://github.com/seancribbs/essentials-of-compilation

Videos: https://youtube.com/playlist?list=PL_eVLc-qrivZyj1tGZg3DQeWLE2ThCTzp&si=EuDXSS1vjp1soui2

GitHub

Contribute to seancribbs/essentials-of-compilation development by creating an account on GitHub.

modest drum
modest drum
modest drum
#

h/t @mental fossil for nibble . the greediness issue with token vs. identifier tripped me up though, i expected the former to be fully greedy and it's not 🤷🏻‍♂️

modest drum
modest drum
modest drum
modest drum
#

So. Annoying. My stream went nowhere.

#

Literally selected it in OBS and "went live" and YouTube never saw it. What?

rotund star
#

I've never heard of this book 👀 is this like an hands-on approach to building a programming language from scrat, similar to crafting interpreters ?

modest drum
#

It's a textbook used at Indiana University to teach compilers

rotund star
#

Thank you jigglypuff

modest drum
hollow belfry
#

Oh hey! I took that course from Jeremy and Ryan back in 2019 or so. There was a guy in my class who added borrow checking as his final project which was really cool.

I think their approach of skipping lexing/parsing by virtue of the target language being a lisp (and therefore already in rough AST form) is a smart way to do a compiler course. On the other hand, parsing comes up relatively often in real life. Also that course was the one and only time I used graph coloring.

modest drum
#

This was my first time doing graph coloring! My compilers class (~1998) stopped at semantic analysis and was based on the dragon book. This whole experience has been really valuable to me.

#

Jeremy attended my stream a few times last year, it was great. 😁

modest drum
modest drum
#

AST, interpretation, type-checking and parsing done for L_fun! Thanks for hanging out if you did.

dreamy lily
#

wow! i've been writing my own compiler in Gleam as a near-complete noob to the language LMAO, so this will be very helpful for me, thank you for creating this glorious resource

modest drum
#

Thanks! Do check out the book I'm working from, it's worth the read

hollow belfry
#

Small world, I just saw Jeremy when I went to vote this morning.

modest drum
modest drum
#

Someone called me "unc" on stream, is that some Gen Z slang for "uncle"?

mental fossil
#

yes

dreamy lily
modest drum
modest drum
#

💜 @dusky ether for saving this poor unc from the randos 😂

dusky ether
#

I am unc too, that's why i helped! unc's united

modest drum
#

there are dozens of us! dozens!

modest drum
hollow belfry
#

oh man has_type is giving me painful flashbacks
the code got soooo messy after that was added

hollow belfry
#

I wonder if it would be possible to do that limit_function_op code kinda inside-out like

limit_function_expressions(case op { ...}, indices)
#

to make it more "fun"