

CappCon 2011 On the Fringe - Pushing the Web to its Limits - tolmasky
http://blip.tv/cappcon/cappcon-2011-austin-sarner-on-the-fringe-5443476

======
DanielRibeiro
I can't help but think that Cappuccino, and GWT for that matter, would be much
more successful if they decoupled language and toolkit. If objective-j would
run on node.js, like Clojure and Coffeescript, it would probably get more
traction.

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...](https://github.com/jashkenas/coffee-script/wiki/List-of-languages-
that-compile-to-JS)

~~~
boucher
Objective-J is decoupled from Cappuccino. It runs completely independently,
and even has a command line utility available built on top of Narwhal (a
command line JS environment we built before Node was an option). Objective-J
should absolutely be made to run on node, and that's being done as part of our
rewrite, Objective-J 2.0.

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).

~~~
DanielRibeiro
Thanks for the comprehensive overview of what is going on cappuccino land.

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]

[1] <http://coffeekup.org/>

[2] <http://blog.heroku.com/archives/2011/8/3/polyglot_platform/>

~~~
tlrobinson
Here's one: Objective-C's "forwardInvocation:" functionality (or
"method_missing" in Ruby).
<http://en.wikipedia.org/wiki/Objective-C#Forwarding>

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.

~~~
DanielRibeiro
I really like this feature (which actually comes from Smalltalk's
doesNotUnderstand:). It is actually supported on firefox[1][2][3] as
__noSuchMethod__, but it is non standard, and should not be relied when
writing cross platform js.

But then I guess the thread starts getting a bit off track, and I apologize.
The point is:

 _Supporting other languages is good for the framework, and for the community_

GWT took the position: Java source only. Cappuccino can take the same
position: Objective-j only. It is fine. It is also limiting.

I am always happier when great frameworks support multiple languages, when it
opens the doors for more people, instead of shutting down to a smaller
community. It helps create greater value to more people, which I'm always for.
It does have its costs. In the end, it is a trade-off which the creators and
the community have to make.

PS: An example of a framework that does this (written ina more powerful
language, supporting a less powerful one) is Akka[4]. It is written in Scala,
but its Java interface, while more cumbersome, is so good that I could create
a JRuby interface[5] that is even more expressive (thanks to method_missing)
than the original one in Scala.

[1]
[https://developer.mozilla.org/en/JavaScript/Reference/Global...](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/noSuchMethod)

[2] [http://stackoverflow.com/questions/3811408/node-js-
overloadi...](http://stackoverflow.com/questions/3811408/node-js-overloading-
functions)

[3] [http://yehudakatz.com/2008/08/18/method_missing-in-
javascrip...](http://yehudakatz.com/2008/08/18/method_missing-in-javascript/)

[4] <http://akka.io/>

[5]
[http://metaphysicaldeveloper.wordpress.com/2010/12/16/high-l...](http://metaphysicaldeveloper.wordpress.com/2010/12/16/high-
level-concurrency-with-jruby-and-akka-actors/)

~~~
tlrobinson
I actually agree with you (It's not a coincidence I wrote the CappRuby project
mentioned in the boucher's comment).

At some point I'd like to build some nicer pure-JavaScript bindings to the
Objective-J runtime which get you 90% of what you get from Objective-J without
the OMG-WTF-is-this-new-language reactions.

However, I'm not convinced it will make a big difference. Language style and
convention permeate libraries/frameworks, and simple language bindings often
results in a sort of "uncanny valley". Can you name any significant frameworks
that are more commonly used from an alternative language than the one it was
originally written for?

~~~
DanielRibeiro
I also agree that making "lower level" bindings can leave the API a bit shady
(Akka's[1] Java version is a bit uglier due to lack of Anonymous Functions,
which have to be replaced by Interfaces).

About example of frameworks which more popular in another language, I honestly
can't think of few other than Akka. I admit is uncommon for frameworks to
support its host language (in a multi-language platform), and host languages
are usually much more crowded than their sub-language counterparts.

What happens far more frequently is a complete re-implementation on the host
language, example: instead of using JRuby on Rails, people migrate to Play
framework[2]

Hadoop[3], however, seems to be getting really tracktion from its other
language bindings[4], as writing map-reduce tasks in Java is not fun at all.

[1] <http://akka.io/>

[2] <http://www.playframework.org/>

[3] <http://hadoop.apache.org/>

[4] <http://pig.apache.org/>

------
tolmasky
Everything they show here is available as open source at:

<https://github.com/austinsarner/Frappuccino>
<https://github.com/austinsarner/RunKit>

~~~
WingTsun
do you know how run it?

I got CPInvalidArgumentException: attempt to insert nil or undefined

------
joely
Cappuccino really delivers. And you're doing it again here!

