peggy
ohm
Our great sponsors
peggy | ohm | |
---|---|---|
8 | 10 | |
806 | 4,882 | |
7.7% | 1.1% | |
8.9 | 6.5 | |
25 days ago | 1 day ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
peggy
- Peggy: Parser Generator for JavaScript
- GitHub - peggyjs/peggy: Peggy: Parser generator for JavaScript
- Peggy: Maintained fork of PEG.js parser generator
-
Creating a custom parser with PEGJS
The PEG.js project got taken over by a new maintainer who locked everyone else out, never shipped a release, and then ignored repeated requests to transfer the project back to the community. So the community forked it to a new project - Peggy, which is where ongoing development happens: https://github.com/peggyjs/peggy
-
How to make your own programming language in JavaScript
NOTE: The original PEG.js project is not maintained anymore, but there is a new fork, Peggy that is maintained and it's backward compatible with PEG.js so it will be easy to switch.
-
Show HN: DTL: a language and JavaScript lib to transform and manipulate data
Thanks. Yes, DTL's core textual syntax is described with PEG. I make use of the Peggy (https://peggyjs.org/) PEG processor to build up the AST that is used to actually process DTL.
There are C based PEG processors, which I've looked at once or twice also, but I haven't sat down to try to convert it. Mostly out of a desire to get the existing module to work well. A working module for one language is better than a partially working module for multiple. :P
-
Parsing in JavaScript: all the tools and libraries you can use
hmm this article is a bit outdated; peg.js (mentioned in the article) has been discountined for a few years now; recently the project was picked up by another team under the name peggy.js https://github.com/peggyjs/peggy
ohm
-
Ohm: A library and language for building parsers, interpreters, compilers, etc.
Building an interpreter or a compiler from a grammar is an interesting idea. I can't immediately see how to go about it - the grammar would need to match on SSA or similar.
The examples have a lisp-like interpreter at https://github.com/ohmjs/ohm/blob/main/examples/simple-lisp/... which definitely uses a grammar for parsing and might use a generic AST representation.
Will have to think more - a grammar might be a worthwhile way to specify a nanopass style compiler pipeline.
-
Is there a generalised, abstract programming language, designed to be specialised to a specific domain?
Look for OMeta and its successor Ohm.
-
[AskJS] Why does our community hate Operator Overloading?
One more suggestion: Maybe create your own scripting-language using Ohm? The project works in JavaScript, so whatever you created would sit on top of your existing APIs.
-
A different / new way to write compilers?
OMeta and its successor ohm might provide some interesting ideas.
-
Ohm – A library and language for building parsers, interpreters, compilers, etc.
Always fun to find the first commit:
https://github.com/harc/ohm/commit/4611bf63c5ecb90d782112d68...
2014
Neat tool. I write parsers by hand though. More fun, and you can be a lot sleazier.
What are some alternatives?
PEG.js - PEG.js: Parser generator for JavaScript
lezer - Dev utils and issues for the Lezer core packages
Pegged - A Parsing Expression Grammar (PEG) module, using the D programming language.
esprima - ECMAScript parsing infrastructure for multipurpose analysis
usfm-grammar - An elegant USFM parser.
purescript - A strongly-typed language that compiles to JavaScript
Chevrotain - Parser Building Toolkit for JavaScript
lens-toml-parser - Lenses for toml-parser
meowlang - Meow Programming Language
jquery.terminal - jQuery Terminal Emulator - JavaScript library for creating web-based terminals with custom commands
pymetaterp - A python parser that builds python ASTs in 502 lines of python without using modules