3 ms·
For modern compiler and a more direct approach I recommend https://www.cs.cornell.edu/~asampson/blog/llvm.html https://www.cs.cornell.edu/~asampson/blog/llvm.ht
by hashtag-til 10mo ago
For modern compiler and a more direct approach I recommend https://www.cs.cornell.edu/~asampson/blog/llvm.html https://www.cs.cornell.edu/~asampson/blog/llvm.html
- mutkach 10mo agoLLVM makes it so much easier to build a compiler - it's not even funny. Whenever I use it, I feel like I'm just arranging some rocks on a top of a pyramid.
- pjmlp 10mo agoA trend started with tools like the Amsterdam Compiler Toolkit, LLVM happens to be the more famous one. https://en.wikipedia.org/wiki/Amsterdam_Compiler_Kit https://en.wikipedia.org/wiki/Amsterdam_Compiler_Kit
- tester756 10mo agoYet if only it wasnt that huge, so compilation takes this much time :/
- norir 10mo agoUsing LLVM is an indirect approach that will limit the quality of your compiler. When one looks at languages that use LLVM as a backend, there is one consistent property: slow compilation. Because of how widespread LLVM is, we often seem to accept this as a fact of life and that we are forced to make a choice between fast runtime code and a fast compiler. This is a false choice. Look at two somewhat recent languages that use LLVM as a backend: zig and rust. The former has acknowledged that LLVM is an albatross and are in the process of writing their own backends to escape its limitations. The latter is burdened with ridiculous compilation times that will never get meaningfully better so long as they avoid writing their own backend. Personally, I find LLVM a quite disempowering technology. It creates the impression that its complexity is necessary for quality and performance and makes people dependent on it instead of developing their own skills. This is not entirely dissimilar to another hot technology with almost the same initials.
- cxr 10mo agoAdrian Sampson (the author of that now 10-year old blog post) has a online course for actually teaching compilers: <https://web.archive.org/web/20210208162458/https://www.cs.cornell.edu/information/news/newsitem11474/adrian-sampsons-advanced-compilers-made-open-source-self-guided https://web.archive.org/web/20210208162458/https://www.cs.co...> Discussed several times on HN: <https://hn.algolia.com/?query=cs6120%20advanced%20compilers https://hn.algolia.com/?query=cs6120%20advanced%20compilers> (And discussion about the blog post from last year about the IL used in the course: <https://news.ycombinator.com/item?id=41084318 https://news.ycombinator.com/item?id=41084318>.)