3 ms·
- I've had the typescript compiler do WEIRD errors on me, depending on configuration, a zero configuration, no brain environment is a godsent - it makes a ton
by j-pb 6y ago
- I've had the typescript compiler do WEIRD errors on me, depending on configuration, a zero configuration, no brain environment is a godsent
- it makes a ton of sense if you don't want to maintain two different versions of the same library. With WASM there is zero need for Node native modules anymore, so there is no need to have platform specific idiosyncrasies that go beyond Web APS's. Is the fact that it's called "window" a favourite of mine? Certainly not, but when you try to get a library running that you really need, that was originally written for the browser or vice versa, you don't care what the thing is called, as long as it's backwards compatible.
- defense in depth, multiple sandboxes are better than one
- this has to do with the window point, it's a lot easier to make code cross platform compatible if you only have to reference publicly accessible http endpoints
- maybe that's not interesting for you, but I've had to deliver command line tools as binary, and I'm super duper happy that I could do so in JS, the security I gain from controlling the runtime version is also much better than what I'd get from that being the users responsibility, besides that fact that not knowing exactly which runtime your code is gonna end up on is also a big source of security vulnerabilities
-
- ericlewis 6y ago- TS also lets anyone do whatever they want so not a great thing to support, I have always said TS would be better if people couldn't configure it without a PR to TS itself - we have the chance to define a new and better API, we should do it - you are already adopting something different - I agree, but its not a selling point, these things are probably in containers already and my OS should be doing most of the work - window: just no, call it global if you must. perpetuating ideas like this isn't good for anyone but the lazy. - I think the cmd aspect of shipping a whole binary is cool for sure, but lets not conflate this as a "compiled language" its not. you are shipping a runtime and a scripting language together.
- j-pb 6y agoYou go out and fix all the library code that uses window then. The web has been paving the cow paths for good reason. There are hills worth dying on, what the common namespace is called isn't one of them.
- afiori 6y agorelatively speaking the windows vs. global should be a non issue. I believe that every js runtime except for IE supports globalThis such that `globalThis.window === window` in the browser and `globalThis.global === global` in node. Deno's difference from node is the choice to implement web API instead of nodejs stdlib API https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...