parser | pidgin | |
---|---|---|
4 | 1 | |
5 | 3 | |
- | - | |
7.7 | 0.0 | |
26 days ago | over 1 year ago | |
TypeScript | Rust | |
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.
parser
-
Ramda: A practical functional library for JavaScript programmers
I find straight forward, dedicated combinators much more readable and practical to use ie. for iterables (context where it makes a lot of sense) [0] example [1], runtime assertions (through refutations, which are much faster than combinators over assertions) [2], parser combinators for smallish grammars [3] etc.
In many cases vanilla/imperative js is more readable and terse, no need to bring functional fanaticism everywhere, just in places where it gives true benefits and in form that can be understood by peers.
Functional code can be beautiful and can also be unreadable/undebugable. Same with imperative code. It's great in js/ts you can pick approach where the problem is expressed more naturally and mix it at will.
[0] https://github.com/preludejs/generator
[1] https://observablehq.com/@mirek/project-euler
[2] https://github.com/preludejs/refute
[3] https://github.com/preludejs/parser
-
Parsing Text with Nom
Parser combinators are great, we're using parser combinators in production, they are great ie. for typescript [0].
[0] https://github.com/preludejs/parser
- Parser Combinators in Haskell
- Casual Parsing in JavaScript
pidgin
-
Parsing Text with Nom
I wrote a crate to facilitate this:*
https://github.com/dfhoughton/pidgin
As it says there, you can only build non-recursive grammars this way.
And the reason I wrote that crate:
https://github.com/dfhoughton/two-timer
And the reason I wrote that crate:
https://github.com/dfhoughton/jobrog
And having written these crates, I went back to writing Ruby for my day job. I am not a very experienced rustacean, and what skill I developed writing these things has faded, but I use the last one daily, so the regex-based parser is still working pretty well.
* It's a "parser combinator library" inasmuch as it allows you to write reusable parsing rules that can be components of other rules.
What are some alternatives?
instaparse
two-timer - Rust library for parsing English time expressions into start and end timestamps
pyparsing - Python library for creating PEG parsers
jobrog - A rewrite of JobLog in Rust
assert-combinators - Functional assertion combinators.
three-pass-compiler - Solution to the Three Pass Compiler kata on CodeWars, parsing and manipulating a very simple AST
parser-combinators - Parser combinators.
angstrom - Parser combinators built for speed and memory efficiency
httpaf - A high performance, memory efficient, and scalable web server written in OCaml
ocaml-h2 - An HTTP/2 implementation written in pure OCaml
retro-httpaf-bench - Benchmarking environment for http servers
yieldparser - Parse using JavaScript generator functions — it’s like components but for parsing!