3 ms·
> I asked was about querying data without ever using a SQL language, like tapping directly into the data. I agree (making https://tablam.org https://tablam.org
by mamcx 3y ago
> I asked was about querying data without ever using a SQL language, like tapping directly into the data.
I agree (making https://tablam.org https://tablam.org to try a fix & working on https://github.com/clockworklabs/SpacetimeDB https://github.com/clockworklabs/SpacetimeDB in the SQL conformance).
Before I think SQL was bad. *Now I'm certain*. SQL is absurdly massive for things that could have collapse all the syntax 10x or more with more principled approach (and ACTUALLY doing relational model).
However, working in an RDBM now I also understand why is not desirable to make "raw" calls to the DB: The engine MUST mediate all the calls to make things works (from query optimization, execution, iteration, lock management, transaction management, etc).
Is incredible how much sophistication is in a simple `SELECT * FROM table`.
What I wish is to build a `Wasm-like` IR so that is what anybody target, and `SQL` is not the mediator.
- 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...