4 ms·
Would you use this for compiling database queries on the fly? I worked on a query engine once, written in Scala and Java, where we’d generate Java from a query
by jpcooper 6y ago
Would you use this for compiling database queries on the fly? I worked on a query engine once, written in Scala and Java, where we’d generate Java from a query and then compile and load the bytecode into a single flat function. I wonder how that would compare with your solution. I suppose it could even be called quite nicely from Java. This thing was working on memory mapped data after all (using sun.misc.Unsafe). The idea was to avoid the indirection caused by lambdas for the separate query operations.
- codr7 6y agoI would like to, but finding the optimal set of foundational building blocks is sort of an ongoing adventure, some of the needed pieces would probably be generally useful enough to fit in the core while you would need to add custom operations and types that are specific to your language. Some would object to even calling this bytecode, as I'm using structs for operations. But serializing code down the level the VM operates on still has value, and adding encoding/decoding of operations is definitely possible.