16 releases (5 breaking)

new 0.11.1 Sep 2, 2024
0.10.1 Jun 28, 2024
0.8.2 Feb 15, 2024
0.8.0 Dec 9, 2023
0.7.3 Nov 8, 2023

#1189 in Database interfaces

Download history 77/week @ 2024-05-16 304/week @ 2024-05-23 50/week @ 2024-05-30 15/week @ 2024-06-06 120/week @ 2024-06-13 1/week @ 2024-06-20 142/week @ 2024-06-27 9/week @ 2024-07-04 47/week @ 2024-07-25 120/week @ 2024-08-01 25/week @ 2024-08-08 12/week @ 2024-08-15 6/week @ 2024-08-22 134/week @ 2024-08-29

207 downloads per month
Used in 4 crates (via spacetimedb-core)

Custom license

145KB
3K SLoC

Abstract Virtual Machine for execution of end-user logic

It optimizes the code & include a more general "query planner"

The execution is split in 3 "phases":

1- AST formation

Generate the AST (that could be invalid according to the semantics).

This step is outside the [vm] and can be done, for example, by the SQL layer.

Use [dsl] to build the [expr:Expr] that build the AST.

2- AST validation

Calling eval::optimize verify the code has the correct semantics (ie: It checks types, schemas, functions are valid, etc.), and "desugar" the code in a more optimal form for later execution.

This build expr::Expr that is what could be stored in the database, ie: Is like bytecode.

3- Execution

Run the AST build from expr::Expr. It assumes is correct.

Dependencies

~8.5MB
~145K SLoC