Skip to content

jasonjmcghee/basic-treesitter-cranelift-jit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Contributors