GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Potential extension: inline java akin to jbang · Issue #536 · tada/pljava Open DescriptionThis issue is a place to hang a few notes on the issues involved in adding support for stored procedures written in Java instead of plpgsql etc. That means the compilation and storage of bytecode will need to be handled by the backend. I don't expect this to appear anytime soon but thought I should call it out while you're already refactoring the code. If nothing else it's a chance to add notes or possibly even identify places where this functionality would go. BackgroundFor many languages the user can define a stored procedure using that language. This is easy to implement, at least conceptually, when it's a scripting language. The 'CREATE LANGUAGE' implementation just needs to wire up the inputs, outputs, and appropriate library(ies). This is much harder to do with a compiled language like java since you want to keep the compiled object (or bytecode) around. There's also some practical issues like a natural desire to use external libraries - anything simple enough to not require an external library should probably be written in pl/pgsql or the like. Direct approachIf we wanted to bit the bullet anyway:
For performance reasons we would want to retain the bytecode. This could be handled by storing the bytecode in an additional table(s) in the existing pljava schema. We have additional options if we have access to an arbitrary Datum but I suspect anything provided to us will need to be text only. Indirect approachA second approach is to use a Java-to-WASM compiler and then use the WASM extension for storage and execution. WASM is gaining popularity since it's so fast, supported by browsers, and there are cross-compilers from all of the major languages. I know there's also a WASM extension but I don't know any details about its usage. That's a lot of unknowns but it may be a better solution - for standalone stored procedures - since it reduces the amount of work that must be done by this extension. Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |