Objective-J and it's use cases

74 views
Skip to first unread message

Kevin Ingwersen (Ingwie Phoenix)

unread,
Apr 20, 2015, 7:34:42 AM4/20/15
to objec...@googlegroups.com
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

Aparajita Fishman

unread,
Apr 20, 2015, 7:14:46 PM4/20/15
to objec...@googlegroups.com
The new compiler will be node-based and will be able to run Objective-J standalone. It will be another month or so until I reach that point.

Kevin Ingwersen (Ingwie Phoenix)

unread,
Apr 21, 2015, 1:49:31 AM4/21/15
to objec...@googlegroups.com
That’s great news!

I am not very good in runtime development, but I have been dealing with NodeJS for quite a while now. If you need some help in one way or another, let me know - i’d be willing to hop in. =)

Kind regards, Ingwie

Martin Carlberg

unread,
Apr 21, 2015, 2:59:07 AM4/21/15
to objec...@googlegroups.com
Hi!

I have done a very simple hack to run Objective-J on node. It uses the current parser, compiler and load system. I made it available as a npm module called ’objj-runtime’.

It is not as ambitious as the node project by Aparajita but it can run simple Objective-J applications on node. You can use it until the real project is finished.


Best regards,

- Martin


--
You received this message because you are subscribed to the Google Groups "Cappuccino & Objective-J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectivej+...@googlegroups.com.
To post to this group, send email to objec...@googlegroups.com.
Visit this group at http://groups.google.com/group/objectivej.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages