Closed cbellone closed 3 years ago
Graal:
Rhino:
for the footprint:
I think the simplest way to evaluate it, is to create a new empty project that include rhino or graaljs with the main that execute a simple script and generate a "fat jar": https://www.baeldung.com/gradle-fat-jar .
This will create a single archive file which include all the dependencies.
Footprint Rhino: 1.6 MB Footprint Graal: 24.2 MB It is a very big difference.. I hope I did it correctly
I think it's correct :).
Some time ago (~1 year) I did a quick check (by following the biggest dependencies on https://repo1.maven.org/maven2/org/graalvm/js/js/20.2.0/ ) and I was around 20-30mb, so thank you for confirming my impression :+1:
Introduction
Alf.io has an Extension engine, which allows organizers to hook additional logic to defined events, and therefore integrate the ticket selling process to their existing infrastructure. One example of this is the integration with a CRM tool: upon confirmation of a reservation, the organizers want to insert/update the contact data of their attendees, in order to send them mailing lists and so on.
At the moment Alf.io uses the Nashorn engine to do this, so extensions must be written in JavaScript. Pros:
Cons:
We are evaluating the Rhino (https://github.com/mozilla/rhino) javascript engine as a possible replacement.
As a condition for letting an arbitrary user implement his own scripts, we need to ensure that:
Subtasks
Evaluate current availability of a java embeddable Javascript engine.
Proposals:
Evaluate alternative replacement
As another option, evaluate the possibility to define a small subset of an existing language, implement the parser and runtime (e.g. like micropython, where they have re-implemented the python language and runtime for their specific requirements).
General Criteria for the evaluation
Proposed initial steps
[ ] Evaluate sandboxing capabilities and implement:
Graal