ES6 Parser in Dlang

James Lu jamtlu at gmail.com
Mon Mar 2 15:22:37 UTC 2020


On Thursday, 27 February 2020 at 22:22:59 UTC, Sebastiaan Koppe 
wrote:
>
> I dunno. I wrote the es6-grammar library that uses pegged. Then 
> I decided to hand write mine own.
>
> https://github.com/skoppe/jazr
>
> It is a pretty complete and fast JS minifier. It has lots of 
> passes and minifies code pretty well:
>
> https://github.com/skoppe/jazr/blob/master/source/es6/minifier.d#L286
>
> In general it is about 30 times faster than uglify-js (and uses 
> 3-4 times less memory). It parses JS code at about 60 Mb/s. The 
> minifier was a bit slower at 20 Mb/s if I remember correctly.
>
> I fuzzed the lexer and parser, so there are little to no 
> spurious crashes on weird input.
>
> Use it as you please, or just as an indication of the effort 
> involved.

Thanks. I will use this to create wrappers that ensure JS 
closures can be serialized.


More information about the Digitalmars-d mailing list