This is a quick overview of this month’s open source contributions I managed to get in.
xtuc/js-webassembly-interpreter: Implement reinterpret for f64 nans4: This and the next PR were the most fun open source work I did this month I think. The goal of it is to support
infvalues in the
xtuc/js-webassembly-interpreter: Reinterpret inf in f32 and f646: This works on exactly the same problem as above. I split the work into two pull requests because the project moves fast and larger PRs will create too much merging overhead.
Note that js-webassembly-interpreter was renamed to webassemblyjs.
- babel/minify: Use hexadecimal notation for number literals when shorter7:
When looking through the minifier code for other posts89,
I saw how number literals are potentially minified by using exponential representation.
Powers of ten are the canonical example where this applies,
1e9for example. The base is 10 using this notation, but in fact hexadecimal with 16 has a larger base. A larger base generally means shorter representation, so I started searching for numbers whose hexadecimal representation is shorter than the decimal (and exponential) one. As so often, somebody on stackoverflow has already done the hard work and found that these number ranges exist10. My pull request then only contains the easy part which is computing the hexadecimal representation (
Number.prototype.toString(16)) and comparing its length to the others. Why is it not merged? It is about gzip compression which seems to deal better with decimals than hexadecimals. Join the discussion on GitHub if you have any thoughts on this!