Earlier quoted context omitted.
Absolutely not for a markdown parser, which is what the author is asking about to get started
Parsing is but 1/3 of compiling. Markup languages are not generally thought of as programming languages, but maybe that's an archaic view. At any rate, 90% of the material in this thread is way overkill if all one wants to do is parse Markdown.
Ask HN: What's a starting point for learning how to write programming languages?
31–40 of 105 posts
Re: Ask HN: What's a starting point for learning how to write programming languages?
#32Chris 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/...
Re: Ask HN: What's a starting point for learning how to write programming languages?
#33write a forth or lisp lexer, parser and interpreter.
then write a small language that compiles to a target, like js, make sure your language is close in semantics to the target language to avoid headaches.
Re: Ask HN: What's a starting point for learning how to write programming languages?
#34Re: Ask HN: What's a starting point for learning how to write programming languages?
#35Re: Ask HN: What's a starting point for learning how to write programming languages?
#36A Forth or a Lisp are simple tasks for an experienced programmer, and even basic ones are really satisfying imho. Seeing simple constructs work in an hour of coding really feels great. I implemented more complex languages (with types) for work which were more like DSLs but in languages less suited for the type of DSL we required, but I find most pleasure doing little Forth (like [1]) or Lisp likes when I am waiting f…
Re: Ask HN: What's a starting point for learning how to write programming languages?
#37Ohm [0] is a good place to start. It's a parser generator. If you can understand the math example [1], you can probably realize how things get built upwards. Then you can focus on what you want your language to do, how you'll interpret it, what problems it would express, &c.
[0] https://ohmlang.github.io/
[1] https://github.com/harc/ohm/blob/master/examples/math/index....
Also consider reading about OMeta, if Ohm isn't your thing.
Re: Ask HN: What's a starting point for learning how to write programming languages?
#38I started out just working on a set of linked/cooperating libraries and then decided to offer both the libraries and a custom language. I am writing something for my own use but when I release the MVL, I obviously also hope to get users and pull requests.
Re: Ask HN: What's a starting point for learning how to write programming languages?
#39Re: Ask HN: What's a starting point for learning how to write programming languages?
#40Also I would recommend staying away from lexer and parser generators and just use hand built recursive descent parser and some set of ad-hoc lexical analysis subroutines.