3 ms·
Show HN: Jazzle – An Innovative, Fast Transpiler for ECMAScript 2015 and later
- FailorTwist 9y agoHi. I'm the original (and the only!) author of jazzle. I started working on it around Sep. 2015. I am from a country where I can no longer access npm without tor, and even then it is so excruciatingly slow as to be unusable. As such, aside from the ever essential node and vi, I had to build everything, including the builder and the test framework, not to mention the parser, the emitter, and the transformer, and the bundler, from scratch, by myself. it certainly took some time, but now, it can even build itself! Among its features are: * very fast compilation times (2x faster than babel, with sourcemaps, on my early benchmarks.) * on-the-fly minification * built-in bundling * economic sourcemaps * built-in regex-verifier (and I'm working on a standalone regex-emitter, too) * runtime this-before-super() checks * runtime (rather than parse-time) checks for constant re-assignments * cheap yet full temporal-dead-zone tracker (and everyone thought it is impossible) * non-invasive, arguably more efficient transformation for loops having closures around their lexicals * zero-dependencies, obviously (though I'm not much proud of it; cf. above) * aggressive temporary-variable-reuse (though I have to say there are still some rough edges) * and needless to say, nearly all ES2015 constructs (except for getters/setters and generators; I'm currently working on a cool generator transformer too, but that's at least two months away.) Now, this is a project still in its infancy (and the two years I've been working on it had better be looked at as its embryohood), and I have to confess I'm getting more and more spent working on it, so I'm actively, eagerly looking for collaborators, particularly for receiving real-world feedback and for helping me complete the test suite. Comments, suggestions and any other sort of feedback is most welcome. Thanks a lot reading this far.
- brudgers 9y agoInteresting project, if it meets the guidelines, this might make a good 'Show HN'. The Show HN guidelines are here, https://news.ycombinator.com/showhn.html https://news.ycombinator.com/showhn.html
- FailorTwist 9y agoThanks -- I had no idea 'Show HN' submissions are different! I just finished reading the guide you linked me to; please correct me if I'm wrong, do I have to re-submit this submission, with a leading 'Show HN'?
- brudgers 9y agoThat's one way to do it. Another is using the contact link below to request a title change by the moderators. Obviously, it has additional dependencies.
- FailorTwist 9y agoThanks a lot!
- dang 9y agoWe've added Show HN to the title above.
- sAbakumoff 9y agoHow is it better than babel? Why is it innovative?
- DiThi 9y agoMaybe because it combines the functionality of Babel and UglifyJS (and maybe others) while being faster than all. (I don't really know, I haven't tried it)
- FailorTwist 9y ago> How is it better than babel? Why is it innovative? Just for the record, this submission's original title was "A very fast Ecmascript Transpiler+Bundler+Minifier in less than 80kb minified, gzipped"; There was indeed another submission with the current title, but I actually deleted it, thinking it was somewhat pretentious. I'm not sure how the title got reverted during migrating the submission to show HN. I made no such claims as jazzle being better than babel; I'm not even sure such comparison would be logically true. All I said was that it has performed better than babel on my local benchmarks. As for innovativeness, what I can tell off the top of my head is its advanced tdz tracker, along with its non-invasive transformation strategy for closures containing loop lexicals. Thanks a lot reading this far, and I can't wait for your feedback!
- DiThi 9y ago> I am from a country where I can no longer access npm without tor, and even then it is so excruciatingly slow as to be unusable. Since it seems you can access github, you can install dependencies without touching npmjs, with one of these: npm install git+ssh://git@github.com:<githubname>/<githubrepo.git[#<commit-ish>] npm install git+ssh://git@github.com:<githubname>/<githubrepo.git>[#semver:^x.x] npm install git+https://git@github.com/<githubname>/<githubrepo.git> npm install git://github.com/<githubname>/<githubrepo.git> npm install github:<githubname>/<githubrepo>[#<commit-ish>] (add --save if your npm is old) Why would a country ban npmjs?
- FailorTwist 9y ago> Why would a country ban npmjs? that is also what I keep asking myself. those in charge of censorship are not especially educated people (they are mostly young clerics/government devoutees), and a website's number of visitors along with its background color (yes) is just enough reason for them to take it out of reach. Somewhat appalling, but you get used to it. For the record, npm worked (and worked well),like, ten months ago. But now it doesn't, not easily at least. I tried my luck with polipo/tor, but it was so slow and disconnected so frequently that I gave up. I now only use npm to publish, and that is still something I don't want to think about until the very last minute.
- deleted 9y ago[deleted]
- neilsimp1 9y agoI'll admit, I probably won't ever try this unless it gets some popularity behind it. That said, congrats on a pretty full-featured javascript package that has no dependencies. That's huge, especially in JS land. Mind if I ask which country that you live in that blocks npm? Just curious.
- FailorTwist 9y agoThank you for the kind words! I mean, really -- it feels really cool to be appreciated by someone whom one's work has not brought the slightest benefit to. thanks again! to be honest, yes, by the time (if ever) this project takes off, transpiling has most probably become an obsolete tradition; so I totally agree with you on that. Ah, as for the country I come from, I will be more than glad (and very grateful) to talk to you about it through my public npm email, or my github email, whichever you find more convenient.....
- malloryerik 9y agoI don't know and am just guessing, but... https://medium.com/@evawxiao/death-by-a-thousand-cuts-software-development-behind-chinas-great-firewall-3e7109858cc6 https://medium.com/@evawxiao/death-by-a-thousand-cuts-softwa... "The scope of the Great Firewall has grown along with the internet. Sadly, it’s a highly adaptable and robust system. In terms of software development, it means that a growing number of services are permanently or sporadically blocked. One of those is NPM or Node Package Manager, an important tool for Node.js. To access NPM in mainland China, you’ll have to find workarounds like using a Chinese mirror. Another is Github, a popular version control and source code management tool that is occasionally blocked or at least throttled to be excruciatingly slow."
- stephenr 9y ago> I probably won't ever try this unless it gets some popularity behind it. Wow, the javascript community is militant about who picks flavour of the week and noone else trying other flavours huh?
- FailorTwist 9y ago
- jeffmcmahan 9y agoHow does it compare to buble in terms of speed? (And yes, I realize buble does not support a variety of es2016 features).
- FailorTwist 9y agoThanks for asking! jazzle's feature set is currently roughly that of buble's, so I guess that won't be something jazzle will especially win at. As for speed, jazzle was about 70%-80% slower than buble, at least the buble I installed about a year ago. but please take these into consideration when comparing the two: * jazzle always tracks tdz -- buble doesn't; I'm working on a way to make tdz optional. * jazzle always records source-maps, so any comparison against other transpilers should take this into account. (as an aside, jazzle's sourcemaps are propably much smaller than buble's; there are some other tiny, cool features there too but I havenot yet found time to document them) * jazzle tracks all top-level scopes during name synthesis; buble tracks just the first, which means things like 'var a; { let a; (function() { var a$1; a; })(); }' will not compile the way it should. actually, I created a gist, https://gist.github.com/icefapper/f672b71f569b95c0c1a8e317466c1f41 https://gist.github.com/icefapper/f672b71f569b95c0c1a8e31746..., and sent its link to Rich, but never received a response; it may be that he simply did not get to scroll down enough, as I'm sure he is a very busy man. * jazzle, while fairly up and running (it can build and bundle and minify itself in slightly above 2secs on my 2011 vaio), has still a number of bottlenecks; after all, all these two years were spent to just rush it into production; with enough time (say, two months or so), I am very much confident I can make it run as fast as buble, without making any compromise on its accuracy. * these, and I would be very glad if you could help me with the benchmarking!