This is probably a good place to ask; I've wanted to build a language myself -- whats the best place to begin learning about parsers and the like? About a decade ago I asked this question and was told to read the "Dragon book" but I was far too young and lacked experience. Now I really want to get stuck into something outside of my day-to-day web stuff.
Parsing: The Solved Problem That Isn't (2011)
21–30 of 71 posts
Re: Parsing: The Solved Problem That Isn't (2011)
#22This is probably a good place to ask; I've wanted to build a language myself -- whats the best place to begin learning about parsers and the like? About a decade ago I asked this question and was told to read the "Dragon book" but I was far too young and lacked experience. Now I really want to get stuck into something outside of my day-to-day web stuff.
If you get through PL101 then picking up the stuff in the dragon book or any other book on parsing and compiling technology will be much easier.
Another resource I like is "Compiler Design: Virtual Machines" (http://smile.amazon.com/Compiler-Design-Machines-Reinhard-Wi...). Still going through that one but it is very readable and if you go through PL101 then you'll have all the tools to implement the virtual machines described in that book. It is much easier to write a compiler to target machine code or some other language like C when you've built a few targets yourself and understand the trade-offs involved.
There's also http://www.greatcodeclub.com/. I think one of the projects is a simple virtual machine and another one is a compiler. Well worth the admission price if you're a beginner and want some help getting started.
Hanselman's rule about finiteness of keystrokes applies and I recently wrote some notes about budding PL enthusiasts: http://www.scriptcrafty.com/tips-for-the-budding-pl-enthusia....
Re: Parsing: The Solved Problem That Isn't (2011)
#23This is probably a good place to ask; I've wanted to build a language myself -- whats the best place to begin learning about parsers and the like? About a decade ago I asked this question and was told to read the "Dragon book" but I was far too young and lacked experience. Now I really want to get stuck into something outside of my day-to-day web stuff.
Parsing Techniques by Dick Grune is THE bible for parsing.
Re: Parsing: The Solved Problem That Isn't (2011)
#24This is probably a good place to ask; I've wanted to build a language myself -- whats the best place to begin learning about parsers and the like? About a decade ago I asked this question and was told to read the "Dragon book" but I was far too young and lacked experience. Now I really want to get stuck into something outside of my day-to-day web stuff.
Start here: http://nathansuniversity.com/ . All the stuff in the dragon book is designed for limited memory and limited computing capability environments. There is no reason to worry about LL(k) parse table size or predict and follow sets when you don't have to. For most practical purposes you can get away with basic recursive descent or PEG parsers. The link I pointed you to starts with peg.js which is PEG parser ge…
Re: Parsing: The Solved Problem That Isn't (2011)
#25This is a really interesting post. The same author recently posted another article that discusses some of the ideas from the conclusion of this post. You can find that article here: http://tratt.net/laurie/blog/entries/an_editor_for_composed_...
Re: Parsing: The Solved Problem That Isn't (2011)
#26Earlier quoted context omitted.
Start here: http://nathansuniversity.com/ . All the stuff in the dragon book is designed for limited memory and limited computing capability environments. There is no reason to worry about LL(k) parse table size or predict and follow sets when you don't have to. For most practical purposes you can get away with basic recursive descent or PEG parsers. The link I pointed you to starts with peg.js which is PEG parser ge…
You're absolutely brilliant. Thanks so much!
Re: Parsing: The Solved Problem That Isn't (2011)
#27This is a really interesting post. The same author recently posted another article that discusses some of the ideas from the conclusion of this post. You can find that article here: http://tratt.net/laurie/blog/entries/an_editor_for_composed_...
The more generic term for a lot of the stuff he talks about in that post falls under projectional editors and programming language workbenches. JetBrains MPS is one of the tools among many that help with building such editors. Here's a good talk by Markus Völter on using tools like JetBrains MPS.
Re: Parsing: The Solved Problem That Isn't (2011)
#28This is probably a good place to ask; I've wanted to build a language myself -- whats the best place to begin learning about parsers and the like? About a decade ago I asked this question and was told to read the "Dragon book" but I was far too young and lacked experience. Now I really want to get stuck into something outside of my day-to-day web stuff.
Re: Parsing: The Solved Problem That Isn't (2011)
#29Earlier quoted context omitted.
Both are based in Bryan Ford's packrat (PEG is Ford's too). OMeta is more like PEGTL in that it's a set of facilities/library at a highish level, more than a particular grammar system (they're all packrat parsers). http://bford.info/packrat/ It's all about descent parsing and memoisation (thus the name).
pegtl is not actually a packrat parser. Not all PEGs and absolutely not all recursive descent parsers are packrats. And actually, my experience with packrat parsers (mostly in ruby) in other languages has been that they actually slow things down on moderately or more complex grammars by massively exploding memory use and thus allocation pressures. Turning it off can make it faster , especially on complex grammars. It…
Of course not, see the link I posted. PEGs are TDPL and recursive descent (not the other way around), and an alternative to CFGs. PEGs were coined by Bryan Ford, who then coined packrat parsing based on them.
You want to do smarter things than just memoising everything, yeah. Especially for complex grammars.
See http://ialab.cs.tsukuba.ac.jp/~mizusima/publications/paste51...
Re: Parsing: The Solved Problem That Isn't (2011)
#30This is a really interesting post. The same author recently posted another article that discusses some of the ideas from the conclusion of this post. You can find that article here: http://tratt.net/laurie/blog/entries/an_editor_for_composed_...
The more generic term for a lot of the stuff he talks about in that post falls under projectional editors and programming language workbenches. JetBrains MPS is one of the tools among many that help with building such editors. Here's a good talk by Markus Völter on using tools like JetBrains MPS.