Skip to content

Latest commit

 

History

History
48 lines (29 loc) · 1019 Bytes

README.md

File metadata and controls

48 lines (29 loc) · 1019 Bytes

Basic 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.

Video

calc-demo.mp4

Testing things

You can run the repl (using crossterm)

cargo run --release

Or do a little stress test (using cross term)

cargo run --example stress

Benchmarks

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

Modifying things

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.