logoalt Hacker News

jdw64today at 2:00 PM3 repliesview on HN

Sometimes I see people who design languages and build compilers, and I find them truly amazing. I once tried making a language myself because I was curious, but it was so difficult that I just settled for a simple C backend. The people contributing to LLVM probably know everything down to assembly generation. they're truly incredible.


Replies

tester756today at 5:33 PM

>The people contributing to LLVM probably know everything down to assembly generation. they're truly incredible.

Not really. I was webdev who then switched into compilers job with LLVM being foundation

LLVM itself is huge, it is not trivial to be familiar with every it's areas/mechanisms, but writing not-complex passes, bug fixing, regression fixing does not require some fancy knowledge

show 1 reply
t-3today at 2:12 PM

Assembly generation is actually pretty simple, it's optimizing everything that's difficult. Writing an assembler is a great way to get acquainted with compiler construction, because you don't need to think about optimization and types and the other features that make high level languages complicated aren't needed.

show 2 replies
sethhochbergtoday at 4:03 PM

Honestly whipping up a lexer/parser and a REPL is one of my favorite ways to learn a new language. You can cover a lot of ground in a "real" language by just doing the frontend implementation of your own made-up language grammar and a little eval loop and its great for learning/teaching because you don't get bogged down in trying to solve some actual problem.

Which is to say: no shame in just settling for that simple C backend!