Hackers News

jasonjmcghee/basic-treesitter-cranelift-jit: Simple live calculator in tree-sitter + cranelift jit

A basic working example of tree-sitter + cranelift jit.

There’s really one core file – I could break it up, but wanted it to be in one place for this basic example.

The one core file

Here’s the grammar.


calc-demo.mp4


You can run the repl (using crossterm)

Or do a little stress test (using cross term)

cargo run --example stress

Also some simple benchmarks.

Very similar to the “stress” test

 cargo bench --bench calculator_random_bench

And a more basic, non-random one

 cargo bench --bench calculator_bench

If you modify the grammar, cargo build in the main project will update everything as needed.

The main binary uses syntax highlighting as an example of that.

admin

The realistic wildlife fine art paintings and prints of Jacquie Vaux begin with a deep appreciation of wildlife and the environment. Jacquie Vaux grew up in the Pacific Northwest, soon developed an appreciation for nature by observing the native wildlife of the area. Encouraged by her grandmother, she began painting the creatures she loves and has continued for the past four decades. Now a resident of Ft. Collins, CO she is an avid hiker, but always carries her camera, and is ready to capture a nature or wildlife image, to use as a reference for her fine art paintings.

Related Articles

Leave a Reply