Replies: 6 comments
-
Another hazard of functions vs arrow functions. A Jessie module should only be able to export objects that have no transitively reachable mutable state, i.e., are pure in the sense of Wyvern's module system. With arrow functions, we can require code such as export const foo = def((...args) => body); For export function foo(...args) { body }
def(foo); however, in the context of cyclic imports, export const foo = def(function(...args) { body }); is substantially more verbose than either. Programmers (including myself) will be esthetically repelled by code containing that last form. If Jessie does have |
Beta Was this translation helpful? Give feedback.
-
I am about to transfer this issue from the SES repository to the Jessie repository. Issue transfer is a Github beta feature and I've never done it before, which is why I'm making this note first. |
Beta Was this translation helpful? Give feedback.
-
We are in the midst of designing better rules for writing modules to be used as pure modules. We will require only that the module is purifiable, i.e., that it becomes pure, if all of its imports are pure and all its exports are hardened. We assume that a purity-enforcing loader will do the export function foo(...args) { body } is perfectly fine code for a pure SES module without this module having to explicitly harden The remaining issue with allowing Given this, I think the right thing to do is to include |
Beta Was this translation helpful? Give feedback.
-
Reopening. I forget that Jessie supports only default exports, so the reasoning above is flawed. |
Beta Was this translation helpful? Give feedback.
-
This is very strange. In email I got notified of two messages in this thread from Michael Fig, sent at 8:20pm and 8:21pm Jan 9 2019. But when I refresh this github thread page in my browser, the last message I see in this thread is one from me six days earlier. Any ideas? |
Beta Was this translation helpful? Give feedback.
-
Now I see that Michael also posted these as #19 , so I'll answer there. |
Beta Was this translation helpful? Give feedback.
-
@erights wanted me to file a placeholder ticket, to remind us to think about how Jessie and SES will interact with non-arrow-functions. I think we're still undecided about whether Jessie should provide only arrow functions, or if it should offer traditional
function NAME(ARGS) { }
too. Arrow functions don't provide constructor behavior, so the risk of offering traditional functions is that they could be called from SES withnew
, which might cause surprises (Jessie forbids bothnew
andthis
, so Jessie code couldn't provoke this, but it could happen if SES code is given access to a Jessie-defined object). The fact that Jessie rejectsthis
might limit the surprises to ones that the SES code could have built anyways.I'll leave it to @erights to fill in the details.
Beta Was this translation helpful? Give feedback.
All reactions