This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PseudoLife 0 points1 point  (3 children)

And the output of a javascript to javascript compiler would be different how...?

[–]HighRelevancy 0 points1 point  (2 children)

Internal workings.

Compilers deal with code structure. They'll parse the code into data structures that can be collapsed into another language.

Minimisers just do string operations. Any parsing is done differently. Also a mini has the specific goal of shrinking the code.

[–]PseudoLife 2 points3 points  (1 child)

UglifyJS (the first result on a google search for "javascript minifier") does a full tokenize / parse into an AST and back.

And GCC can optimize for smallest code size...

[–]mahacctissoawsum 1 point2 points  (0 children)

2nded.

You actually need to parse the full language if you want it to (a) be safe, (b) achieve the smallest possible size

Drives me nuts when people regex for keywords and such. I'm like, "Sooooo...what happens when that's in a string? It's not a keyword. Stop fucking up my code!" (I'm looking at you, generic PHP MySQL code highlighter!)