26 points · by tolmasky · 15y ago · 13 comments
And if the toolkits were language agnostic (meaning you could easily write in haxe, coffeescript, clojurescript, or any other language on top of js [1]), it would have a bigger market.
I know that Cappuccino and GWT are older than node.js, but it is not too late to change.
[1] https://github.com/jashkenas/coffee-script/wiki/List-of-lang...
As far as the other direction is concerned, you can write code on top of the Cappuccino framework in any language you can get running in the browser. The problem with writing in vanilla JavaScript, as opposed to Objective-J, is just that there are missing features which require the use of fairly obnoxious syntax in JavaScript.
A ruby to JavaScript compiler would provide a great language alternative to Objective-J for targeting Cappuccino. In fact, you can build a reasonable subset of ruby on top of Objective-J (see https://github.com/tlrobinson/cappruby, ala MacRuby).
Regarding the missing features on vanilla JS: it is ok. More powerful languages on top of JS might have them, and having a common ground to compile to would make the toolkit more hospitable to a polyglot environment.
Edit: It is also important to note that Javascript supports metaprogramming as powerful as LISP macros. This is because functions implement toString method. Coffeekup [1] is a beautiful DSL for writing web pages in Coffeescript that uses this feature quite successfully. Therefore I'd really like to see which JS missing features can't be supplanted by AST manipulation, like the one you'd do in Scheme, Clojure or Common Lisp.
GWT had this very same issue: by choosing source code compile, languages like Clojure, Scala, Groovy and JRuby were removed from the ecosystem. Which is really harming for open source projects, where the more people you reach, the more help you get.
Heroku's founder Adam Wiggins wrote a lot about this Polyglot environment a couple of days ago on: Polyglot Platform [2]
[2] http://blog.heroku.com/archives/2011/8/3/polyglot_platform/
* Static typed language on client-side
* Allow your Java developers to build complex maintainable UI without advanced JS knowledge
* Reuse existing Java code
* Use Java tools (IDE, Unit testing, Build systems)
It's very hard to build a complex JS app, because even guys who develop for web in dynamic languages like PHP, Python or Ruby - usually produce the "callbacked-jquery-unmaintainable-mess" on the front end. There are tools like Backbone which are becoming more and more popular, but learning them and all new JS patterns is more complex then GWT for a regular Java developer. Supporting other JVM languages is also hard task, AFAIR GWT isn't working with JVM bytecode when converting Java to JS. Microsoft tried this way with Volta, but failed.
Cappuccino brings you a rock solid API and a language that makes this API nicely usable (you can use it without Obj-J, but it will look ugly). Look at other popular frameworks: ExtJS, SproutCore - both changed their vision heavily with latest versions. Cappuccino is aimed for Apple/Cocoa minded developers, and Obj-J seems to be the best fit the same way as GWT is for Java.
I really don't see how you can make products like GWT & Cappuccino without their languages, because the reason why they were built were those languages and tight integration in first place. Otherwise they would become yet another library of widgets.
This could be implemented in a JS-to-JS compiler (which is what you're describing) but it would incur an overhead for every JavaScript method call. Since Objective-J has it's own syntax for method dispatching the overhead is only incurred for Objective-J methods, leaving JS methods untouched.
https://github.com/austinsarner/Frappuccino https://github.com/austinsarner/RunKit
I got CPInvalidArgumentException: attempt to insert nil or undefined