4 ms·
I may be the only one not familiar, but nom refers to https://github.com/rust-bakery/nom https://github.com/rust-bakery/nom which looks like a pretty handy way
by benmanns 3y ago
I may be the only one not familiar, but nom refers to https://github.com/rust-bakery/nom https://github.com/rust-bakery/nom which looks like a pretty handy way to parse binary data in Rust.
- brundolf 3y agoIt's a pretty handy way to parse any sequence of things in Rust! I'm using it to write a compiler for a toy language and it's been a delight
- karelpeeters 3y agoCould you share the repo? I've been curious what nontrivial parsers look like woth nom, I always lose the overview pretty quickly.
- TimWolla 3y agoI'm using nom to parse a simple access control DSL in https://github.com/wbbaddons/Tims-PackageServer/blob/master/src/auth/acl/ruleset.rs https://github.com/wbbaddons/Tims-PackageServer/blob/master/.... You can see how it looks in the tests of the linked file. The DSL supports comparison operators, '&&', '||' and nested expressions, while preventing mixing of '&&' and '||' without making precedence clear using parentheses. This DSL should fit 'non-trivial', but it still should be simple enough to easily understand it.
- IshKebab 3y agoI would consider Chumsky for a programming language. It has recoverable parsing which is important for IDE support.
- deleted 3y ago[deleted]
- epage 3y agoFor a very rough comparison of parsers, see https://github.com/rosetta-rs/parse-rosetta-rs https://github.com/rosetta-rs/parse-rosetta-rs (which both includes a full json parser for each parser)