|
1 | 1 | # Universal Expression Tree |
2 | 2 |
|
3 | | -## Overview |
| 3 | +Expressions parse to minimal lispy tree. Opposed to [ESTree](https://github.com/estree/estree): |
| 4 | + |
| 5 | +- language-agnostic, can be compiled to different targets |
| 6 | +- reflects execution sequence, rather than code layout |
| 7 | +- has minimal overhead, directly maps to operators |
| 8 | +- simplifies manual evaluation and debugging |
| 9 | +- has conventional form and one-liner docs |
| 10 | +- JSON-compatible, sparse arrays |
4 | 11 |
|
5 | | -Expressions parse to trees. Minimal, JSON-compatible, and portable across languages. |
6 | 12 |
|
7 | 13 | ``` |
8 | 14 | [operator, ...operands] operation |
@@ -375,20 +381,14 @@ Implementations SHOULD accept both forms on input. |
375 | 381 |
|
376 | 382 |
|
377 | 383 |
|
378 | | -## Acknowledgments |
379 | | - |
380 | | -Inspiration: |
| 384 | +## Inspiration |
381 | 385 |
|
382 | | -- **Pratt parsing** — Pratt, 1973. [Top Down Operator Precedence](https://tdop.github.io/). Elegant precedence-driven parsing. |
383 | | -- **S-expressions** — McCarthy, 1960. Code as nested lists. |
384 | 386 | - **[frisk](https://www.npmjs.com/package/frisk)** — Porsager. Evaluable arrays as function calls. |
385 | 387 | - **[nisp](https://github.com/ysmood/nisp)** — Ysmood. JSON-compatible lisp. |
| 388 | +- **Pratt parsing** — Pratt, 1973. [Top Down Operator Precedence](https://tdop.github.io/). Elegant precedence-driven parsing. |
| 389 | +- **S-expressions** — McCarthy, 1960. Code as nested lists. |
386 | 390 | - **JSON** — Crockford, 2001. Minimal format, universal adoption. |
387 | | - |
388 | | -Counter-examples: |
389 | | - |
390 | | -- **[ESTree](https://github.com/estree/estree)** — Verbose, JS-specific, layout-oriented rather than semantic. What not to do. |
391 | | - |
| 391 | +- **[ESTree](https://github.com/estree/estree)** – opposite example |
392 | 392 |
|
393 | 393 |
|
394 | 394 | ## License |
|
0 commit comments