Earlier quoted context omitted.
This is all true, for sure, but I'd like to point out that PEGs are a formalism that isn't much harder to learn than regular expressions, and totally appropriate for parsing a fairly large class of languages. I've also seen PEG-based (pakrat) parser generators for just about every programming language (some better than others, of course). Again, these tend to be not much harder to learn than regular expressions, and…
Thanks for addending :-) I wasn't aware of PEGs. That definitely does look promising for a lot of cases.
How to implement a programming language in JavaScript
31–39 of 39 posts
Re: How to implement a programming language in JavaScript
#32Re: How to implement a programming language in JavaScript
#33Earlier quoted context omitted.
Parsing is the smallest part of writing a compiler.
It's also one of the most conceptually difficult parts, which makes it a good learning opportunity.
Re: How to implement a programming language in JavaScript
#34Re: How to implement a programming language in JavaScript
#35If anyone is interested in making a language in JS I can recommend the "Nearley" parser/lexer: http://nearley.js.org Very easy parser/lexer to use, accepts a larger class of grammars than yacc/lex and is reasonably fast. I use it for the language in my project: http://emunotes.com and Nearley is fast enough to parse stuff as the user is entering text. It may be tempting to see if you can get away with not using a par…
Re: How to implement a programming language in JavaScript
#36Re: How to implement a programming language in JavaScript
#37Re: How to implement a programming language in JavaScript
#38The new hotness seems to be transpiling, turning an enhanced language into Javascript. Any good resources for this?
Re: How to implement a programming language in JavaScript
#39If anyone is interested in making a language in JS I can recommend the "Nearley" parser/lexer: http://nearley.js.org Very easy parser/lexer to use, accepts a larger class of grammars than yacc/lex and is reasonably fast. I use it for the language in my project: http://emunotes.com and Nearley is fast enough to parse stuff as the user is entering text. It may be tempting to see if you can get away with not using a par…
Emunotes is really cool. A magical word processor. Is there a way to make functions that connect to expanded services?