Comment

Comment by hollowsolve

We built Match, a pattern matching language that compiles to WASM and replaces regex with readable grammars.

Instead of this: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

You write this:

email: username then "@" then domain

username: one or more of (letter, digit, ".", "_", "-")

domain: one or more of (letter, digit, "-") then "." then between 2 and 6 letters

Match features:

- WASM JIT + JS JIT: matches or beats native regex on most patterns

- Linear-time parsing, no backtracking, no ReDoS, ever

- Full parse trees with named extractions, not just match/no-match

- Zero dependencies, ~7KB, MIT licensed

- Composable grammars via modules

Website: https://matchlang.com

Performance: https://matchlang.com/docs/api/performance

GitHub: https://github.com/hollowsolve/Match

parent hollowsolve 8 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton