

Solving the JavaScript Memory Management Problem - tlrobinson
http://cappuccino.org/discuss/2010/03/31/solving-the-javascript-memory-management-problem/

======
gfodor
I know this is a joke, but this seems to be one of those "the truth is
stranger than fiction" things. No, they did not implement manual memory
management in Javascript. But yes, they did in fact _re-implement the Mac
development ecosystem entirely in the browser_.

Extremely powerful or extremely insane, I still can't decide. One things for
sure, I certainly don't think it was _necessary_ to go to the lengths they
have to implement applications for the web well.

~~~
gfodor
One more thing to note, is that at the core of what 280North has done (with a
Herculean effort) is traded something close to lisp for something close to
Smalltalk.

~~~
paulbaumgart
As a strict superset of JavaScript, Objective-J actually lets you have both.

~~~
gfodor
Yes but we all know that, as is the case in Objective-C, your primary mode of
modeling problems becomes message passing and OOP. In Objective-C's case you
drop to C for performance, I have a hard time believing that you'd drop to
Javascript in Objective-J to eek out more performance. (If that's the case,
truly we live in interesting times.)

~~~
paulbaumgart
I'm not going to claim to be an expert here, but I think the relationship is a
little different between Objective-J and JavaScript than between Objective-C
and C. The features of Objective-C pretty much across the board make
operations simpler than they are in C. JavaScript already makes a lot of
things pretty much as simple as it gets, and in some ways makes it too easy to
accidentally do something wrong. So, Objective-J actually serves to impose a
bit of structure on your code (and could even impose strict+static typing).

That's basically how I've used it: Objective-J classes define the larger-scale
architectural components of a project, but for smaller collections of data
that are somehow related, especially for short-lived collections of data, I
usually drop down to JavaScript and use the convenient hashes and arrays.

Performance-wise, some operations will be faster in JavaScript than
Objective-J, because things like message passing have an extra function call.
I haven't found it to be a particularly noticeable difference, but admittedly
I haven't been writing a lot of performance-critical code, so others might
have better insights on that subject.

------
tlrobinson
(don't miss the code:
[http://github.com/280north/cappuccino/commit/6678bba94f7778b...](http://github.com/280north/cappuccino/commit/6678bba94f7778b245d8219292b3a6ac85d31678))

~~~
imajes
that's a lot of code for april fools....

------
pak
Had to laugh at this: "Since $ has become the coolest way to do completely
non-standard lookups in an almost indecipherable way"... It is true that this
has practically become a meme amongst the JavaScript libraries. (did jQuery
start the trend?)

~~~
pkulak
Prototype did.

------
tumult
Oh please, how am I _ever_ supposed to make practical use of this without
NSZombieEnabled?!

~~~
boucher
If you read the post you'll see that we have OBJJ_ZOMBIE_DETECTION. It
actually works :).

~~~
tumult
Holy crap, I spoke too soon, haha

------
madair
TL;DR version: Welcome to April Fools (gah, tomorrow is going to get annoying)

~~~
boucher
Yeah but you have to appreciate an April fools joke that comes with a working
implementation :-).

------
pkulak
It took me nearly to the end to figure out that this was a joke. This idea
just seemed like a logical next step to writig web apps with Objective-C
syntax.

