by acuozzo · 1y ago · 0 comments
To take it even further, the language grammar could be a superset of the SQL grammar.
> Would it have to be a scripted language?
Not at all. It's just the first thing which came to mind. I'm tickled by the idea of having the entire program state (stack frames and all!) in SQLite so that you could ship a snapshot of your program around.
> There would be overhead compared to directly managing memory.
Of course, but if the critical queries were pre-compiled via sqlite3_prepare, I doubt the overhead would so greatly exceed the memory management overhead in language runtimes which ship with a GC that it would be a show-stopper.
Because snapshotting is a rather crazy thing which have to be managed by criu or qemu
this could even be faster than a vm shipped.
MY goal with snapshots can be literally anything (yet , I like the idea of extraction snapshots for extremely large files very lucrative idea)
Having an SQL based callstack sounds painfully slow.
Because?
It could be, but this aspect of the idea could also be user-togglable at runtime.
Considering this further... I think Lua might be a good match for this idea. Everything it can do can be pretty easily mapped to SQLite queries and its type system is pretty close to the limited set of types offered by SQLite.
My thought was about arturo lang though https://arturo-lang.io/ since it has https://github.com/arturo-lang/grafito , and it just felt like having a better integration with sql though lua is also fine.
We can also integrate this directly to something like lua running on sqlite compiled by cosmopolitan project to even ship a cross platform single executable sqlite.
The possibilites are endless.
If you are genuinely interested in this project. I am willing to help in my free time. But I am a novice and I don't have experience in low level langauges like C/rust and much prefer golang.