News for hackers. Stuff that matters.
Re:CappCon 2011 On the Fringe - Pushing the Web to its Limits by tlrobinson on Friday August 05, 2011 @04:00PM (#2851491)
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.

Re:CappCon 2011 On the Fringe - Pushing the Web to its Limits by DanielRibeiro on Friday August 05, 2011 @05:15PM (#2851800)
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...

[2] http://stackoverflow.com/questions/3811408/node-js-overloadi...

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

[4] http://akka.io/

[5] http://metaphysicaldeveloper.wordpress.com/2010/12/16/high-l...

Re:CappCon 2011 On the Fringe - Pushing the Web to its Limits by tlrobinson on Friday August 05, 2011 @06:56PM (#2852144)
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?

Re:CappCon 2011 On the Fringe - Pushing the Web to its Limits by DanielRibeiro on Friday August 05, 2011 @07:27PM (#2852225)
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/