Hey folks!
I am currently sitting between two chairs…and I would like to finally put myself on one. There is Objective-J but also OJ, which is also an Objective-C-ish to JavaScript compiler (ojc). I use it in an Express middleware in NodeJS to dynamically convert .oj files to .js files. Sadly, such middleware was not available for Objective-J yet - and won’t be any time soon, since there is no way of running Objective-J in NodeJS. Which is honestly really sad! Substet languages like CoffeeScript are all over the place, but Objective-J does only seem to promote Cappuchino - but I am not even sure if I am fully right.
I would like to point out a few use cases for Objective-J that would be really cool. Despite my use of OJ, I still enjoy looking after Objective-J since it is a way more concrete implementation. OJ is a light variant that works really well for general purpose stuff. I.e.: I wrote my site’s JavaScript mainly using OJ. So calls like
[app emitToBackend:event withObject:obj];
is actually a mapped call to Socket.io, to send something back. In general I enjoy Objective-J/OJ due to their syntax.
Now, I only managed to use OJ for the JS of my site; sadly Objective-J didn’t work the way I hoped it would, for this use case. But the bigger challenge is, to take use of either it or Objective-J within a server-side JS environment. NodeJS is currently the most used platform for that. And that is why I really looked forward to NodeJS support…but I haven’t heared word of this project in a really long time, which gave me a little sad.
The first challenge is to determine if scripts should be pre-compiled or can be compiled on-the-fly like CoffeeScript can. The connect-oj middleware I wrote can either compile one file or a batch of files by using a .d (dependency) file, which is a JSON object listing the needed files. But for this, the Objective-J compiler would have to work under NodeJS. All I can see currently is it only working on Jake. So as a side-question: Is the compiler currently being ported to NodeJS?
But in order to run Objective-J in a non-browser environment, the runtime would have to be made aware of this fact, and taught to work inside a NodeJS environment. And then there is still the thinking of either allowing dynamic compilation of a script file or „static“ files (i.e. compile first, run later).
The browser and a server-side backend are two different sections of JavaScript. Objective-J with Cappuchino works well in the Browser - but does it work stand-alone yet? Can it work under a non-jake JS environment already? And how lively is the NodeJS project?
Kind regards,
Ingwie