Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Esmangle: mangling tool for Mozilla Parser AST
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Yusuke Suzuki  
View profile  
 More options Aug 31 2012, 12:42 pm
From: Yusuke Suzuki <utatane....@gmail.com>
Date: Sat, 1 Sep 2012 01:42:20 +0900
Local: Fri, Aug 31 2012 12:42 pm
Subject: Esmangle: mangling tool for Mozilla Parser AST

Hello all,

Last night, I decided to implement some AST modifying pass, and created
esmangle : mangling tool for Mozilla Parser AST.
http://constellation.github.com/esmangle/

This is created yesterday and test cases are very few, so it is still
experimental. :)

We can use it like this,

var first = esprima.parse(code);
var tree =esmangle.mangle(first);
var res = escodegen.generate(first, { format: { compact: true, semicolons:
false, renumber: true, hexadecimal: true, escapeless: true } });

You can try this on the demo page.

To get more compression ratio, we should create AST modifying pass like

+ remove wasted block. (`if (cond) { stmt; }` => `if (cond) stmt;)
+ reordering declarations
+ concat multiple var declarations into one

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ariya Hidayat  
View profile  
 More options Aug 31 2012, 11:42 pm
From: Ariya Hidayat <ariya.hida...@gmail.com>
Date: Fri, 31 Aug 2012 20:42:29 -0700
Local: Fri, Aug 31 2012 11:42 pm
Subject: Re: Esmangle: mangling tool for Mozilla Parser AST

Quite impressive!

I'd assume you would look into comparing the result with UglifyJS, or even
its new UglifyJS 2.

As for non-mangling syntax simplification, should this be another
(micro)library? It could be still useful for pure optimization purposes,
even without further mangling step.

--
Ariya


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yusuke Suzuki  
View profile  
 More options Sep 2 2012, 10:49 am
From: Yusuke Suzuki <utatane....@gmail.com>
Date: Sun, 2 Sep 2012 23:48:48 +0900
Local: Sun, Sep 2 2012 10:48 am
Subject: Re: Esmangle: mangling tool for Mozilla Parser AST

Thanks!

I'd assume you would look into comparing the result with UglifyJS, or even

> its new UglifyJS 2.

I'm planning to compare results with them and refactor (or implement better
compressing optimization fix) esmangle and escodegen.

As for non-mangling syntax simplification, should this be another

> (micro)library? It could be still useful for pure optimization purposes,
> even without further mangling step.

Sounds good. So I'll implement them as another `pass` module, thanks for
your advice :)

Regards,
Yusuke Suzuki

On Sat, Sep 1, 2012 at 12:42 PM, Ariya Hidayat <ariya.hida...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »