Live data from Hacker News

Ask HN: Resources for building a programming language?

news.ycombinator.com

1–10 of 87 posts

Re: Ask HN: Resources for building a programming language?

#3
post #2

Hi, for the parser and compiler this helped me a lot: https://compilers.iecc.com/crenshaw/ If you are building an interpreter too this was a great inspiration: http://luaforge.net/docman/83/98/ANoFrillsIntroToLua51VMInst...

Your URL is slightly off: https://compilers.iecc.com/crenshaw/

Re: Ask HN: Resources for building a programming language?

#4
I'd probably start by using Racket (Racket is a scheme is a lisp) which has a whole toolkit for language building. Arc is written this way, for instance. Often these are lispy languages but there is no reason they have to be. A starting point: http://beautifulracket.com/stacker/ or https://www.hashcollision.org/brainfudge/

That will get you started rediculously quickly and give you things like GC and JIT for free. You can always implement it outside of racket once it starts to take further shape

Re: Ask HN: Resources for building a programming language?

#5
post #3
post #2

Hi, for the parser and compiler this helped me a lot: https://compilers.iecc.com/crenshaw/ If you are building an interpreter too this was a great inspiration: http://luaforge.net/docman/83/98/ANoFrillsIntroToLua51VMInst...

Your URL is slightly off: https://compilers.iecc.com/crenshaw/

Thanks

Re: Ask HN: Resources for building a programming language?

#6
Using Forth as a substrate lets you focus on the more interesting aspects to an even higher degree than Lisp. The last thing you want is detailed instructions; unless you're just building another whatever, which never really made sense to me. Build the most simple and naive thing possible that works the way you want it to, and go from there. That's how Snabel was born:

https://github.com/andreas-gone-wild/snackis/blob/master/sna...

Re: Ask HN: Resources for building a programming language?

#7
What do you want to do? You could write a LISP interpreter in a high level language in an hour, you could target the JVM/CLR/whatever and get fairly high performance and GC without too much work, you could spend months/years writing a quality language runtime + native compiler, etc.

http://www.craftinginterpreters.com/ is coming along really nicely.

Reading academic papers can give you some excellent ideas once you get into the weeds (e.g. garbage collection, compiler optimization).

Re: Ask HN: Resources for building a programming language?

#9
I would suggest you focus a lot on the design, research the history and design of other languages. Try to understand how they evolved and try to figure out their bad decisions on the way.

Eg.

Pythons PEP, PHP’s RFC, Mailinglists

Building the language itself is the easy part...

Re: Ask HN: Resources for building a programming language?

#10
There are tons of resources on implementing languages (interpreters, JITs, and normal compilers), but I haven't seen that many good resources on PL design. Something like recently discussed Graydon Hoares post[1], but bit more approachable for an outsider and maybe less focused on the very bleeding edge.

[1] https://news.ycombinator.com/item?id=15051645

Post reply on HN