Ask HN: What's a starting point for learning how to write programming languages?
101–105 of 105 posts
Re: Ask HN: What's a starting point for learning how to write programming languages?
#102Chris Lattner, the creator of Swift has a nice walkthrough for making a small language called Kaleidoscope http://web.cs.ucla.edu/classes/spring08/cs259/llvm-2.2/docs/...
This is a better link: https://llvm.org/docs/tutorial/ That page is using a 10+ year old version of LLVM
Re: Ask HN: What's a starting point for learning how to write programming languages?
#103Learn the mechanics of compiler construction first - that'll inform everything about your language, and is a prerequisite to actually building something other people can use. I'd recommend The Dragon Book [1], SICP [2], and Modern Compiler Implementation in ML [3] for this. After that, it's a question of where you want to go with your language, and what distinguishing features you'd like it to have relative to other…
> Languages which just change some syntax and keywords but otherwise look like C are common, but they tend not to get usage beyond their creators Considering c++ is one of the most widely-used languages out there, I would question this.
Re: Ask HN: What's a starting point for learning how to write programming languages?
#104Put that flex & bison book away. Don't think about compilers. Design your own litte interpreted language. Write a lexer by hand (not that hard). Write a recursive descent parser by hand. It's a bit tricky to get infix operator parsing stuff right, but an important learning experience. Once you got the basic parsing algorithm right you can probably add lot's of fun stuff to your language just with general programming…
Re: Ask HN: What's a starting point for learning how to write programming languages?
#105-1. You need to actively set aside time each day for this task. -2. Leave time for this to last a long time, two months, minimum. -3. Plan every step out. -4. Repeat, repeat, REPEAT!! As in, repeat your training tasks. People have to repeat something seven times to burn it into permanent memory, and you need to remind yourself of it at least once a month for a year, then once every six months after this.
If you do those four things, which are surely no easy task, you should be an excellent programmer in no time. Good luck :)