←back to thread

Java Hello World, LLVM Edition

(www.javaadvent.com)
200 points ingve | 2 comments | | HN request time: 0s | source
Show context
Octoth0rpe ◴[] No.46181969[source]
I've been playing with a very basic compiler for a language that looks a bit like go -> llvm ir, but I'm finding myself constantly revising my AST implementation as I progressively add more things that it needs to represent. Is anyone aware of any kind of vaguely standardized AST implementation used by more than one project? I've been searching this morning for one and am coming up empty. My thinking is that if I can find some reasonably widely used implementation, then hopefully that implementation has thought out lots of the corner cases that I haven't gotten to yet.
replies(2): >>46181985 #>>46182043 #
znkr ◴[] No.46181985[source]
LISP ;-)
replies(2): >>46181992 #>>46182066 #
1. xnacly ◴[] No.46181992[source]
This, lisp is perfect for representing arbitrary data, nesting is just another sexpr, easy to produce, easy to parse and easy to debug / reason about
replies(1): >>46183282 #
2. pjmlp ◴[] No.46183282[source]
When I did my degree, the years prior to mine had some flexibility choosing the implementation language for compilers class.

Lisp and Prolog were forbidden due to how easy the whole exercise would be.