Skip to content

Commit dfbf53e

Browse files
committed
Add parle PECL extension proposal
Native C++ LALR(1) (lexertl/parsertl), PHP 7.4+, PECL-only, non-serializable tables (per-cold-worker rebuild). Est. 3-10x where installable; not benchmarked.
1 parent 8d6bedc commit dfbf53e

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# parle PECL extension (proposal)
2+
3+
**Status:** evaluated, not installed/benchmarked. No code. The "3–10×" below is an
4+
estimate, not a measurement.
5+
6+
**Idea:** `parle` is a PECL extension wrapping Ben Hanson's C++ `lexertl`/`parsertl`
7+
template libraries (LALR(1)). Push grammar rules at runtime, build the tables at
8+
startup, then parse with semantic actions in native code.
9+
10+
**Constraints (confirmed):** PHP 7.4+; requires a PECL install (absent on most
11+
shared/managed hosting); the parser tables can't be serialized, so the
12+
table-build cost is paid on every cold worker — significant for a grammar of this
13+
complexity.
14+
15+
**Verdict:** a realistic native fast path (est. 3–10×) WHERE it can be installed,
16+
but shared-hosting reality rules it out as a default. Not prototyped here.

0 commit comments

Comments
 (0)