Hacker News new | ask | show | jobs
by transactional 998 days ago
A recent blog post about MongoDB's SBE detailed that the purpose behind their VM is that it serves as a way to re-use an execution component between two different query languages. SQLite's claim was just that the strong separation between compilation and execution makes issues easier to debug.

I wouldn't expect VMs to become the default design in databases, but it seems like it's getting increasingly common as an IR for query compilation. The ability to have a (comparatively simpler) interpreter for the VM also means you can apply simple fuzzing to great effect: if the results of interpretation vs compilation ever diverge, there's a bug.

2 comments

MonetDB has been doing this (VM for query execution) since 2002-2004ish.
Another related aspect is that the VM approach can allow JITing only some of the opcodes, which makes it more feasible and maintainable.