nickel icon indicating copy to clipboard operation
nickel copied to clipboard

[RFC007] First step: AST representation

Open yannham opened this issue 1 year ago • 4 comments

This is a draft implementation of the first step of RFC007: define the first AST representation, supposed to be output by the parser.

The whole RFC007 is a big chunk of work; we don't want to implement it all at once and make it the default. This PR creates a new module, which is only enabled under the bytecode-experimental feature, so that mainline Nickel is left unchanged, and we can experiment step by step on the side.

yannham avatar Oct 16 '24 17:10 yannham

🐰 Bencher Report

Branch2072/merge
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
fibonacci 10📈 view plot
⚠️ NO THRESHOLD
479,890.00
foldl arrays 50📈 view plot
⚠️ NO THRESHOLD
1,681,600.00
foldl arrays 500📈 view plot
⚠️ NO THRESHOLD
6,524,600.00
foldr strings 50📈 view plot
⚠️ NO THRESHOLD
7,072,100.00
foldr strings 500📈 view plot
⚠️ NO THRESHOLD
61,949,000.00
generate normal 250📈 view plot
⚠️ NO THRESHOLD
43,954,000.00
generate normal 50📈 view plot
⚠️ NO THRESHOLD
2,051,300.00
generate normal unchecked 1000📈 view plot
⚠️ NO THRESHOLD
3,300,300.00
generate normal unchecked 200📈 view plot
⚠️ NO THRESHOLD
745,310.00
pidigits 100📈 view plot
⚠️ NO THRESHOLD
3,200,600.00
pipe normal 20📈 view plot
⚠️ NO THRESHOLD
1,482,900.00
pipe normal 200📈 view plot
⚠️ NO THRESHOLD
10,459,000.00
product 30📈 view plot
⚠️ NO THRESHOLD
817,510.00
scalar 10📈 view plot
⚠️ NO THRESHOLD
1,493,100.00
sum 30📈 view plot
⚠️ NO THRESHOLD
815,220.00
🐰 View full continuous benchmarking report in Bencher

github-actions[bot] avatar Oct 16 '24 17:10 github-actions[bot]

For my understanding, do you actually intent the flat AST to be an output of the parser?

aspiwack avatar Oct 17 '24 00:10 aspiwack

If I understood this correctly, there's no flat AST: just a tree AST and a bytecode format. This PR is the simplified tree AST produced by the parser. It's simplified compared to current nickel because it doesn't have to support evaluation.

jneem avatar Oct 17 '24 02:10 jneem

Ah. That's the point I'd missed. Thanks @jneem .

aspiwack avatar Oct 17 '24 02:10 aspiwack