4 ms·
some features cannot be "polyfilled". You cant magically make proxies , weakmaps ,let , or generators , or even modules(the python way) work just by adding a l
by camus 14y ago
some features cannot be "polyfilled".
You cant magically make proxies , weakmaps ,let , or generators , or even modules(the python way) work just by adding a library to Javascript. You cant change inner workings of the language with functions.
If you could there would be no point creating a future version of the language.
All transpilers that compile down to javascript are basically syntaxic sugar generators , but do not add semantic like ES6 does.
- masklinn 14y agoTechnically you can absolutely implement most of them (the most problematic are probably weakmaps, as weakref require GC cooperation, and "true generators"), since you can implement all of them on e.g. C. However implementing them means a more complex compiler, more low-level resulting JS, and potentially a runtime within the JS runtime (essentially coding a VM in javascript, within which your language runs).