So this is a shameless, inexcusable plug but as it's relevant to the blog post... If you're using Google Closure with Gulp in your work flow, you may find gulp-gjslint useful ( https://github.com/TomSeldon/gulp-gjslint ). It's a gulp wrapper around gjslint, I. E. a Google Closure linter. :)
Closure Compiler in JavaScript
101–110 of 115 posts
Re: Closure Compiler in JavaScript
#102Earlier quoted context omitted.
We are working on this here: https://github.com/angular/tsickle It's already used within Google to effectively optimize TypeScript apps. However, someone still needs to write the integrations between tsickle and the multitude of public JS build systems and there's not a lot of pressure on me to do it (I have lots of other work to do).
Oh yes, I've been following this, at least the bits of information that emerge publicly. But my dream is that this work could make it back into typescript itself - that a future version could possibly be persuaded to emit Closure type limitations without the help of a parallel/postprocessing pass by a tool.
Re: Closure Compiler in JavaScript
#103Earlier quoted context omitted.
Far less glamorous and way more old school, it's the later case - GWT can compile Java to JavaScript.
Wait, how is that a thing? I'm a pure JS developer (for now) but I don't understand how something framed on desktop OSs could compile to JS, a browser language. Does it compile to Node maybe? Which version of JS? 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.
Re: Closure Compiler in JavaScript
#104Earlier quoted context omitted.
It's java source to javascript source compilation(/translation/transpilation), so you only need to follow the semantics of the language, not the actual implementation. As a simple example, if you create an array of numbers in Java, you don't need to worry about how the memory for that is allocated as long as you get an array of numbers in javascript. The difficulties are more in how you get around where the two langu…
>...so you only need to follow the semantics of the language, not the actual implementation. Wouldn't you need to follow the syntax and not the semantics? Aren't the semantics what the syntax is abstracting? (I'm genuinely curious, not trying to flame.)
The syntax is really just one way to express an intention. What you care about are the intensions--the meanings. That's exactly what the semantics are. For example, the semantics of this statement in Java
int foo = 1 / 0;
are very different from the semantics of this statement in JavaScript: var foo = 1 / 0;
even though the two are syntactically rather similar.(In the former, Java will throw an ArithmeticException, whereas in JavaScript it will return Infinity.)
So you want to ensure that your translation is meaning preserving, that is, that the source code and the generated code are semantically the same.
Re: Closure Compiler in JavaScript
#105What's with all these similar and confusing names; Closure Compiler, Clojure, Clozure CL?
So "Closure" is a real comp sci word used to describe variable scope lifetimes in languages includes JavaScript and others. So when google named their project, they basically took a word from JavaScript/CompSci that starts with the same letter as "Compiler" (plus other similar sounds). I don't think there's much more to it than that. "Clojure" is a programming language again based on the regular word "closure" but wi…
In general, I think you should not pick names from the domain where your product/tool operates in. For example, it would be equally confusing if a car manufacturer would brand its cars "Engine" or "Wheel". Such naming is worse than just choosing a fantasy name.
P.S.: As another example, "Java" was a good name. But then Netscape invented a language and called it "JavaScript", which was of course a very poor choice.
Re: Closure Compiler in JavaScript
#106Earlier quoted context omitted.
So "Closure" is a real comp sci word used to describe variable scope lifetimes in languages includes JavaScript and others. So when google named their project, they basically took a word from JavaScript/CompSci that starts with the same letter as "Compiler" (plus other similar sounds). I don't think there's much more to it than that. "Clojure" is a programming language again based on the regular word "closure" but wi…
Thanks for explaining, but it remains confusing! And it seems so unnecessary. In general, I think you should not pick names from the domain where your product/tool operates in. For example, it would be equally confusing if a car manufacturer would brand its cars "Engine" or "Wheel". Such naming is worse than just choosing a fantasy name. P.S.: As another example, "Java" was a good name. But then Netscape invented a l…
Re: Closure Compiler in JavaScript
#107Can anyone comment on the state of Typescript - Google Closure integration ?
This may not be the "integration" some are seeking but it's sure a step ahead.
Re: Closure Compiler in JavaScript
#108Earlier quoted context omitted.
Thanks for explaining, but it remains confusing! And it seems so unnecessary. In general, I think you should not pick names from the domain where your product/tool operates in. For example, it would be equally confusing if a car manufacturer would brand its cars "Engine" or "Wheel". Such naming is worse than just choosing a fantasy name. P.S.: As another example, "Java" was a good name. But then Netscape invented a l…
Right? Keep that in mind when you name your next language or project :)
Re: Closure Compiler in JavaScript
#109Does 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.
Re: Closure Compiler in JavaScript
#110Earlier quoted context omitted.
So "Closure" is a real comp sci word used to describe variable scope lifetimes in languages includes JavaScript and others. So when google named their project, they basically took a word from JavaScript/CompSci that starts with the same letter as "Compiler" (plus other similar sounds). I don't think there's much more to it than that. "Clojure" is a programming language again based on the regular word "closure" but wi…
I heard that Rich Hickey chose Clojure because it has both `CLR` and `J` - initially he thought Clojure will be adopted in both - .Net CLR and JVM