Proposal: not polyfilling Math.imul any more


#1

Hi all, I plan to remove the polyfill to Math.imul in next release.
Note Math.imul was an ES6 feature, it should be available in most reasonable JS runtime, you can still make your code work by providing a third party polyfill, let us know if it has any impact on your code


#2

That should be fine as long as you have a way to tell users which polyfill they need to provide automatically. We can’t keep track of changes like this


#3

I din’t even know BuckleScript polyfilled ES6 features. And it’s probably not its job.


#4

Previously we are only targeting ES5, now ES6 is almost 4~5 years ago, maybe it is great time to use some of its features


#5

I’m no expert, but I expect polyfilling methods to be relatively trivial: you just need some code that monkey patches prototypes in runtime. You can more or less just bundle some third-party polyfills, and there’s no need for BuckleScript to take on that responsibility.

Now, if we were talking about language features that would require AST transformations (like Regenerator or even destructuring), that would mean either support from BuckleScript itself or going through Babel, which would slow things down immensely. So maybe BuckleScript shouldn’t support those either just yet, and instead, wait for IE to die out :slight_smile: