treepipes
incremental tree transformers
status
concept
example
┌──────────┐ ┌──────────┐
│ TSX Text │ ── Parse ──► │ TSX Tree │
└──────────┘ └──────────┘
|
Compile
│
▼
┌──────────┐
│ JSX Tree │
└──────────┘
|
Compile
│
▼
┌──────────┐ ┌──────────┐
│ JS Text │ ◄── Print ── │ JS Tree │
└──────────┘ └──────────┘
every arrows is an incremental transformer, aka “pipe”
compiler 1 is typescript (tsc)
compiler 2 is a web framework like svelte, solid, qwik …
goal: low latency between input and output
incremental parsing
term rewriting
incremental computing
incremental compilers
incremental compiler generators
- https://github.com/nfomon/shok/tree/master/statik - http://statik.rocks/ - https://doi.org/10.1145/2814189.2817278 at https://sci-hub.ru/ - Statik: an incremental compiler generator, Michael Biggs, 2015. Statik allows you to write a compiler as a sequence of “phases” of parsing. Each phase incrementally translates an input list to an output list. For example, your compiler might be constructed as the pipeline: lexer -> parser -> code-generator. The lexer incrementally translates source-code characters to tokens. The parser translates incremental changes to the token list, to an incrementally-updating parse tree. The code-generator responds to the changing parse tree by generating the bytecode for those changes, and emits the bytecode changes incrementally.
incremental code generators
aka: incremental codegen
differential dataflows
focus on GraphQL
reactive programming
functional reactive programming
source to source compilers
- https://github.com/topics/source-to-source
- https://github.com/topics/transpiler
- https://github.com/topics/refactoring-tools
- https://github.com/onelang/OneLang - 1K stars - javascript - TypeScript, C#, Ruby → C++, C#, Go, Java, JS, Perl, PHP, Python, Ruby, Swift, TypeScript
- https://github.com/jarble/transpiler - 400 stars - javascript - A universal translator for programming languages
- https://github.com/usethesource/rascal - 300 stars - java
- https://haxe.org - haxe → AS2, AS3, C++, C#, Java, JS, Lua, Neko, PHP, Python
- https://www.progsbase.com/ - java → Java, C, C++, JavaScript, C#, R, PHP, Python, Visual Basic
- https://github.com/pfusik/cito - cito → C, C++, C#, Java, JavaScript, Python, Swift, TypeScript, OpenCL C
- https://github.com/oven-sh/bun - 40K stars - Zig - JavaScript runtime, bundler, transpiler, package manager. TS, TSX, JSX, MJS, CJS → JS
- https://github.com/pseudo-lang/pseudo - 700 stars - python - Pseudo → JS, Go, C#, Ruby
- https://github.com/jtransc/jtransc - Java, Kotlin, Scala → X
- https://github.com/akameco/s2s - 300 stars - javascript - based on Babel
- https://github.com/LangTrans/LangTrans - 20 stars - python
hot module reload
incremental printing
TODO
electrical engineering
“durchgriff” is a german term in electrical engineering
in english: reachthrough, punchthrough, passthrough, passage, control ratio, penetration factor
we can reduce complex (non-linear) systems to simple (linear) systems,
by limiting the range of input parameters
example: amplifier
for high-fidelity signal amplfication,
you want to run the amplifier in its linear range
if you make it too loud then you get clipping,
if you make it too silent then you get no output
in the linear range, the amplifier has a linear “durchgriff” from input to output:
a small change on the input will produce a small change on the output
see also
评论