3 ms·
Looks really interesting. What do you plan to use this for?
by jpcooper 6y ago
Looks really interesting. What do you plan to use this for?
- codr7 6y agoApplication scripting languages, configuration languages, database query languages, and so on. Lowering the threshold to embedding a custom language has interesting consequences for the choices you make from my experience.
- jpcooper 6y agoWould 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.