Can anyone comment on the state of Typescript - Google Closure integration ?
Closure Compiler in JavaScript
31–40 of 115 posts
Re: Closure Compiler in JavaScript
#32> How does this work? > > This isn't a rewrite of Closure in JavaScript. Instead, we compile > the Java source to JS to run under Node, or even inside a plain old > browser. Every post or resource you see about Closure Compiler will > also apply to this version. Pretty wild.
Re: Closure Compiler in JavaScript
#33Earlier quoted context omitted.
The advanced compilation mode does some pretty powerful dead code removal and minification [1]. I guess that is available from plugins in Babel as well but Google has been using it for Gmail, Google.com etc, so it's quite battle tested. [1]: https://developers.google.com/closure/compiler/docs/api-tuto...
Dead code removal relies heavily on writing JS in a style that allows for static analysis. Dynamic requires, heavy usage of closures, knowledge of external/global variables are all things that prevent a lot of commonjs code from being removed. https://developers.google.com/closure/compiler/docs/limitati... has more information if you're interested in the assumptions that the compiler makes. Interestingly, we're final…
Re: Closure Compiler in JavaScript
#34> How does this work? > > This isn't a rewrite of Closure in JavaScript. Instead, we compile > the Java source to JS to run under Node, or even inside a plain old > browser. Every post or resource you see about Closure Compiler will > also apply to this version. Pretty wild.
I'm really interested in how they did that. Do they have an internal Emscripten equivalent for Java bytecode? Or would it be more like a source code conversion compiler a la Nim or Haxe?
Re: Closure Compiler in JavaScript
#35> How does this work? > > This isn't a rewrite of Closure in JavaScript. Instead, we compile > the Java source to JS to run under Node, or even inside a plain old > browser. Every post or resource you see about Closure Compiler will > also apply to this version. Pretty wild.
I'm really interested in how they did that. Do they have an internal Emscripten equivalent for Java bytecode? Or would it be more like a source code conversion compiler a la Nim or Haxe?
Re: Closure Compiler in JavaScript
#36not sure if it's just bootup time or actual compilation passes, hopefully the former and does not explode exponentially (or even linearly) with code size.
Re: Closure Compiler in JavaScript
#37Re: Closure Compiler in JavaScript
#38Does anyone know what this means for clojurescript?
Nothing. Zero benefits here for typical usage of ClojureScript. Potentially interesting for 3rd party bootstrap efforts like Planck, Lumo, etc.
"ClojureScript for Skeptics" https://youtu.be/gsffg5xxFQI?t=20m9s
The remaining bit of Java is like "a little piece of kelp that's stuck to the hull, and even though it's little, you don't want anything stuck to the hull" (http://www.tv-quotes.com/shows/the-west-wing/quote_14096.htm...).
Re: Closure Compiler in JavaScript
#39Re: Closure Compiler in JavaScript
#40Earlier quoted context omitted.
I'm really interested in how they did that. Do they have an internal Emscripten equivalent for Java bytecode? Or would it be more like a source code conversion compiler a la Nim or Haxe?
Far less glamorous and way more old school, it's the later case - GWT can compile Java to JavaScript.
EDIT: I'm googling now to learn more but I'm not asking to challenge anybody, I'm asking because probably you guys know more than me and I wanna know how this works.