4 ms·
My understanding is that Uglify is just a JS to JS transform, and there isn't a way for Reason to supply type information. At least, I don't see anything about
by alangpierce 9y ago
My understanding is that Uglify is just a JS to JS transform, and there isn't a way for Reason to supply type information. At least, I don't see anything about it in the README: https://github.com/mishoo/UglifyJS https://github.com/mishoo/UglifyJS
Also note that, at least with Flow and TypeScript, type information isn't guaranteed to be correct, so it's a bit dangerous to do type-based optimizations (although tools certainly could try, with the caveat that if your types are wrong, your code may break even more than it otherwise would).
- foota 9y agoI believe reason is a different flavor than typescript and friends, though I could be mistaken.
- djur 9y agoYour second paragraph is important here. Flow, TypeScript, and PureScript all have two-way interop with JavaScript code as a design goal. PureScript also has generating "fast, understandable code" as a design goal. It might be falling short on "fast" here, but it's much more understandable in isolation than the Reason output. This explains pretty much everything the OP notices in the comparison.