Why create something like Objective-J
I'm guessing that it started back a while, when there was no clue as to when ECMA Script 4 would actually get deployed; and they wanted something that they could work with immediately; as well as run on older browsers.
It's also got some usability advantages, in that it uses the Objective-C messaging style, which can be much more readable.
[aNode configureWithWidth:100 height:200 style:ROUND connectionDepth:50 pin:37];
is better than
aNode.configure(100, 200, ROUND, 50, 37);
A more real world example might be from QuickTime -- I just pulled this line of code from one of my apps, if you didn't already know what you were looking at reading it without looking up the function would be impossible:
err=AddMediaSample2(audio, (UInt8 *)data, length, 1, 0, (SampleDescriptionHandle)soundDescription, samples, 0, NULL);
Supporting the DOM of a webbrowser is also not a small task.
Well, definitely not if you are starting from scratch... I was thinking of just imbedding WebKit to do the job as being easier than re-writing Cappuccino. I wouldn't consider either, however, to be trivial.
But the main problem here is that many web browser DOM classes and functions simply make no sense in the context of a 3D app.
Not quite sure I follow here? The DOM would be restricted to the user interface of the JavaScripts... it wouldn't have any broader scope than that.
(note that I'm not neccessarally
advocating for this; I can think of a lot of other things I'd rather see you spend your coding time on than that! :smile: )
But I nevertheless prefer writing the binding manually. So I have full control on what I do.
Yeah... I think that the approach that I'm going to take is to create some "keywords" that a preprocessor can sniff out of the source code, and use that in a class map structure to determine what gets mapped over how (I've already got most of the infrastructure for this in place; that's how my object persistence engine works). If I put the binding resolution code in an instance method, any object would have the opportunity to override how it's exposed to the scripting engine.
:smile: