Live data from Hacker News

Let's write a compiler, part 5: A code generator

briancallahan.net

31–32 of 32 posts

Re: Let's write a compiler, part 5: A code generator

#31

Hi all, I have a bit off topic question but seems related. I'm trying to write sort of a SQL compiler. The current goal is to analyze queries and find similarities, later maybe to translate between sql dialects. I found Uber's QueryParser[1] but it's in haskell, so I started wrapping the python sqlparse[2] library and implement a Visitor to traverse their weird AST. 1. How close is it to implementing a compiler? 2. I…

ZetaSQL[1] seems like it could be a fit for your use case. I've worked with Apache Calcite in the past and found it to be very complex to work with. I found ZetaSQL to be a little easier to use.

[1] https://github.com/google/zetasql

Re: Let's write a compiler, part 5: A code generator

#32
post #30

Earlier quoted context omitted.

No, it’s not beside the point at all. It disproves your statement for any real language.

Sigh. My point was that it _feels_ like this because the tutorial does not actually do an actual compiler's work. It is a quite simple rewrite to a very similar language with the same level of abstraction. No language constructs have to be compiled , i.e., to be automatically reimplemented in a target language which doesn't have this. Now, if your only concern is that everything that people feel and express have to b…

Here you go: https://code.up8.edu/-/snippets/3
Post reply on HN