
Show HN: Jazzle – An Innovative, Fast Transpiler for ECMAScript 2015 and later - FailorTwist
https://www.github.com/JazzleWare/jazzle
======
FailorTwist
Hi. 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.

~~~
sAbakumoff
How is it better than babel? Why is it innovative?

~~~
FailorTwist
> 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!

------
neilsimp1
I'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.

~~~
stephenr
> 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
he might be partially right, because I have not yet found time to write tests
for certain functions of the transpiler (I have been effectively unemployed
for a few months now and making ends meet is my only priority at the moment.)

that said, I too believe sheer popularity may not always be a great heuristic
to judge the stability of a piece of software with .....

------
jeffmcmahan
How does it compare to buble in terms of speed? (And yes, I realize buble does
not support a variety of es2016 features).

~~~
FailorTwist
Thanks 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/f672b71f569b95c0c1a8e31746...](https://gist.github.com/icefapper/f672b71f569b95c0c1a8e317466c1f41), 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!

