3 ms·
> What I wish is to build a `Wasm-like` IR so that is what anybody target, and `SQL` is not the mediator. Hey Mario, I believe I referenced this when we were w
by cmrdporcupine 3y ago
> What I wish is to build a `Wasm-like` IR so that is what anybody target, and `SQL` is not the mediator.
Hey Mario, I believe I referenced this when we were working together, but one attempt at this was/is MonetDB's "MAL" VM: https://www.monetdb.org/documentation-Jun2023/dev-guide/monetdb-internals/mal_reference/ https://www.monetdb.org/documentation-Jun2023/dev-guide/mone...
It's a fairly minimalistic somewhat assembly-like ("Monet Assembly Language", MAL) virtual machine that executes both program flow and relational algebraic operations (against purely binary relations, from which they are able to compose higher arity relations): https://www.monetdb.org/documentation-Jun2023/dev-guide/monetdb-internals/mal-modules/algebra/ https://www.monetdb.org/documentation-Jun2023/dev-guide/mone...
It's not a bad place to start from as an idea.
SQLite itself has a virtual machine, but it's just too highly specific for its own storage engine and transaction model
Another approach is what Umbra does, which is (in some circumstances) to generate a query plan in the form of LLVM intermediate representation and then compile it down to native code (one could also compile to web assembly, I suppose, if you love the crappy performance :-) ). That works best for longer-running analytical queries, and they have other approaches for shorter, ad-hoc transactional ones
https://link.springer.com/article/10.1007/s00778-020-00643-4 https://link.springer.com/article/10.1007/s00778-020-00643-4 gets into it.
- mamcx 3y agoNice to hear from you :) yes, that is the direction...