-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Externalize Eventual Send in Endo Bundles #1625
Comments
cc @mfig for design review |
Why? Generally globals are an anti-pattern. OTOH, if these were global, could we avoid the Eval Twin problem #1583 , and know that |
At #1583 I imagined we could solve the Eval Twin problem with compartments without using globals. Is that as easy? |
Oh, I’ll edit above. The globals are not necessary in this design. Just threading an exit for builtin modules is. Also would degrade gracefully for other environments. |
As for motivation, this would remove a copy of far from every contract bundle and also reduce instances to one. I do not think this is sufficient to completely eliminate the need to mitigate Eval Twins. |
And the reason this is not sufficient to eliminate the need to anticipate encountering eval twins is that Endo is not the only environment we need to support. Eventual Send should work on stock node with npm eval twins as well. |
This solution would certainly be applicable to other cases. The big deal is that these modules would fall thru to making eval twins on other platforms. I think we should still design these modules to anticipate encountering eval twins. |
I'm not sure how
|
I’ve created a general issue for surfacing host modules. #1653 |
Demonstration #2422 |
Most Endo applications currently need to import
@endo/far
to getE
andFar
. The Endo runtime could instead inject these as global variables, but linters, type checkers, and the language server all like these to be imported for various reasons. We can reduce the weight of bundles and also keep these imports, using Compartment Mapper tricks.@endo/bundle-source
uses theendo
tag by default, or create a newendo:far
bundle tag to indicate the external dependency onendo:far
.@endo/import-bundle
importBundle
such that it provides anendo:far
builtin module that exportsE
andFar
and ensure that it uses theendo
tag.@endo/far
’spackage.json
like{ "exports": { "endo": "endo:far" } }
.The text was updated successfully, but these errors were encountered: