Bit-Nation / panthalassa

Bitnation's Jurisdiction p2p-network backend, plus utils.
MIT License
9 stars 6 forks source link

[engine] new JS VM #81

Open florianlenz opened 6 years ago

florianlenz commented 6 years ago

Feature / Issue

Otto doesn't really work out for us since it doesn't offer the performance we need nor the sandboxing features (like limiting the allocated memory). We should switch to duktape (there are go bindings).

things to figure out:

Acceptance criteria

borjantrajanoski commented 6 years ago

Some sample code on how a call back can be done with duktape

Is there any reason why a map cannot be used in this way?

Callback proof of concept rc1

florianlenz commented 6 years ago

Good question, I didn't look too much into how function should work, but there should be a call method or something like this on a value (you might need to transform it to a function - there should be a toFunction method)

Maps are not supported afaik. But we can go without them :) For e.g. the database we can just export dbPut instead of the object .

borjantrajanoski commented 6 years ago

@kevowevo this will be done at the 28th

borjantrajanoski commented 6 years ago

Finished initial migration from Otto to Duktape PR 94

Needs careful review and potential small fixes to make sure integration is fully compatible