Math.TAU

Jan Keromnes jan at mozilla.com
Mon Jun 30 07:27:28 PDT 2014


> I'd just like to add that "joke requests" like Math.TAU that have no
> place in the language specification itself generate a considerable
> amount of overhead for those of us who keep up with the mailing list.

I don't think asking for Math.TAU was a "joke request". It's rather a 
request for a convenient short-cut to the value `Math.PI * 2`, of which 
the utility and judiciousness can be debated. Sorry if I'm adding noise 
to this less-interesting thread, but I feel the issue is being 
dismissed without adequate consideration. I'm looking forward to 
Brendan championning it at the next TC39 meeting, so that we can accept 
or dismiss it with a proper review.

My take is that having Math.TAU would end this kind of madness: 
https://github.com/search?q=%22Math.PI*2%22&ref=searchresults&type=Code

The gains would admittedly be small:
- Using `Math.TAU` instead of `Math.PI * 2` is only slightly more 
handy, and would benefit a limited number of developers,
- The unnecessary constant multiplications are trivial to optimize,
- We would save 50 KB of code across all GitHub repositories,
- Or 16 bytes in the minified version of the popular http://threejs.org 
library.

But they might be worth the negligible implementation and maintenance 
costs.

Here is a proposed implementation of Math.TAU in the Firefox runtime: 
https://bugzilla.mozilla.org/show_bug.cgi?id=1032203

Jan


On Mon 30 Jun 2014 03:16:18 PM CEST, Benjamin (Inglor) Gruenbaum wrote:

>
> Especially since the other topics discussed are interesting (e.g.
> ModuleImport ). I think it would be best if we refrain from them in
> the future as this mailing list is already noisy.
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list