Live data from Hacker News

A Complete Guide to LLVM for Programming Language Creators

mukulrathi.co.uk

41–47 of 47 posts

Re: A Complete Guide to LLVM for Programming Language Creators

#44
When I studied compilers back in the university, the subject consist in reading understanding and putting in practice the 'dragon book' (not the full book but a big part of it). We all used flex+yacc and a simplified ASM that was interpreted by some educational software which name I cant remember. The project for the year was to implement a basic compiler language: included if/for loops, function calls, recursivity ... basic stuff but enough as starting point to build something.

Trying to get into LLVM, Id love to find an example done in flex+yacc vs the same done in LLVM.

Re: A Complete Guide to LLVM for Programming Language Creators

#45

While we're here, let's not forget about the incredible Kaleidoscope tutorial. They really helped me get a grip with LLVM. https://llvm.org/docs/tutorial/index.html

This is most welcome, as I recently started looking at LLVM, and I was not finding it easy to get a clear picture of the project's organization.

I see that your username resembles that of the entity hosting this guide - I'm guessing that's not a coincidence!

Re: A Complete Guide to LLVM for Programming Language Creators

#46
post #44

When I studied compilers back in the university, the subject consist in reading understanding and putting in practice the 'dragon book' (not the full book but a big part of it). We all used flex+yacc and a simplified ASM that was interpreted by some educational software which name I cant remember. The project for the year was to implement a basic compiler language: included if/for loops, function calls, recursivity .…

Flex+yacc and llvm are for separate steps in the process. The former are for parsing the source code into an AST and the latter for generating executable code from the AST.

That said, somewhere else on this comment thread user "finiteloop" posted the scaffolding for a toy compiler using yacc+llvm. You could check that out.

Post reply on HN