Hacker News new | past | comments | ask | show | jobs | submit login

The author is against language features implemented as a library. However, the drawbacks he points to are really a lack of community programming conventions. If there were an agreed on standard Javascript way to do things like traditional OO class based inheritance, then there wouldn't be the problems he cites. Having such conventions encoded as syntax would reduce some of the power of Javascript. The fact that you can implement your own domain-specific mini-language is very powerful.

This is really pointing back to the old "Cathedral vs. Bazaar" dichotomy.




There is also the issue that implementing things like method_missing and import are prohibitively difficult without new syntax.

Objective-J's code importer is one of the more complex pieces (as it manages to do so completely asynchronously). All the approaches that use a simple JavaScript function to grab code, like grab_and_eval("file.js") are forced to happen synchronously (since you have to guarantee that the code is evaled before the next line). Without some sort of lexing support, its really not possible to both grab files asynchronously and also be able to continue executing.

Also, as stated in the article, you can't intercept JavaScript method calls, so if you want something like method missing you're forced to do something like:

call_method_or_send_method_missing(object, "method_name")

And again, since Objective-J is a proper superset of JavaScript, it doesn't lose any of its powerful features.


And again, since Objective-J is a proper superset of JavaScript

really? what can it do that js can't do?


Being a superset of JavaScript doesn't mean it can do more, it just means that all valid JavaScript is valid Objective-J.


Read his first sentence again:

"There is also the issue that implementing things like method_missing and import are prohibitively difficult without new syntax."


"difficult" has nothing to do with the power of languages

TeX macros are fundamentally as expressive as java.


"The author is against language features implemented as a library."

I don't understand how you can say that, when the entire article is a defense of why they added a bunch of features to Javascript as a library. That is, as opposed to adding those features as part of a new language specification.

I think the actual argument is "as long as you are adding language features as a library, you might as well introduce new syntax for them while you're at it." They present several arguments in defense of this claim.


That's part of it but equally important is the idea of separating language / syntax changes, Objective-J, from the real goal of the library, Cappuccino. The other frameworks mentioned blend the two together, for example you can't get the JavaScript extensions implemented by Prototype without including all of Prototype.

But, with Objective-J you can write for example, some math library that has nothing to do with Cappuccino and not load Cappuccino.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: