endojs / Jessie

Tiny subset of JavaScript for ocap-safe universal mobile code
Apache License 2.0
284 stars 16 forks source link

Proposed `jessie-std` standard library #29

Closed michaelfig closed 2 years ago

michaelfig commented 5 years ago

This issue is to track a proposed standard library for Jessie, which can be relied on for any Jessie environment (such as sufficiently-advanced plain Javascript implementations, SES and jessica), to allow Jessie code to run unmodified across platforms.

Following the example of SES's magical treatment of import harden from '@agoric/harden', I would like to propose that Jessie environments provide a magical jessie-std library with a fallback implementation actually hosted in NPM for code not running in a Jessie-specific interpreter or SES.

So, each Jessie module would do something like:

import { makeCompartment,.... makeWeakSet} from 'jessie-std';

The following is a checklist of the endowments that jessica would need. They will be checked off when they're implemented in the standard library.

Thoughts?

michaelfig commented 4 years ago

Note: I renamed @agoric/jessie to just jessie-std, as we don't want Jessie to be wedded to the Agoric implementation.

@coder-mike especially, take note.

michaelfig commented 2 years ago

Done and implemented as packages/stdlib.