Compiler buds, need your opinion —
In @WasmGroundUp, we build a tiny compile-to-Wasm language. To keep the grammar simple, there's no arithmetic precedence.
Also, we match binary ops iteratively, not recursively (see `Expr` in img).
Q: Does the latter seem too non-standard?
In @WasmGroundUp, we build a tiny compile-to-Wasm language. To keep the grammar simple, there's no arithmetic precedence.
Also, we match binary ops iteratively, not recursively (see `Expr` in img).
Q: Does the latter seem too non-standard?
@WasmGroundUp The problem is that doing it recursively in @_ohmjs requires at least a minimal discussion of left recursion.
(Below is a more typical way to handle binary operators in Ohm.)
(Below is a more typical way to handle binary operators in Ohm.)
@WasmGroundUp @_ohmjs Ok, turns out that @ziglang does it exactly this way. That makes me feel better.
(And TIL that the official Zig grammar is a PEG! github.com/ziglang/zig-sp…)
(And TIL that the official Zig grammar is a PEG! github.com/ziglang/zig-sp…)
https://twitter.com/dubroy/status/1767218005488943364 ∙ Archived on 2025-03-28.