3 ms·
JS modules can produce side effects on load. Does that present an obstacle to that kind of REPL pattern?
by alexwebb2 4y ago
JS modules can produce side effects on load. Does that present an obstacle to that kind of REPL pattern?
- LAC-Tech 4y agoI don't think so. Most repls use a special in repl keyword to accomplish this. For some reason the JS community can't move past "but modules are special". Ocaml has modules too and the repl can reload stuff from a file no problem.
- stephen 4y agoNaive question, but is that dictated in the spec? Probably? Just wondering that, since Deno is rewriting all of npm anyway, it would have been a great time to revisit some of these historical script-y design decisions, to make JavaScript/TypeScript-at-scale suck less. Granted, probably too late now, but as-is neither of Deno's url-based imports or sandboxed-by-default changes has seemed worth the migration cost. But, if they also made something like "everything hot reloads for free" level ergonomic/platform changes, then yeah, I'd be hopping over.