I am really impressed with Objective-J, and then I'm really impressed again with Cappuccino. They have made it onto my list of things that I know, which I assiduously trim down to the absolute minimum. I don't have a lot of room in my mind for struggling with how to do something, and I really want to get on with what I can do before my limited time and/or attention moves me onto the next thing.
My list is:
* Objective C
* OpenGL
* Cocoa
* GNUstep
* Nu
* Flash
and now
* Objective J
* Cappuccino
That's a list where the items have a great deal in common with each other. They share the same language, concepts, libraries and constructs. They can communicate with each other in the same dialect or in JSON.
This combination of tools allows the following platforms:
* Mac
* Windows
* Linux
* iPhone
* Browser
without needing to port code to other languages, libraries, runtimes, or the need for bridging. On each platform, the code has native access to libraries and the ability to drop down to other levels. It is not cross platform, but it is maximally cross platform in preserving code as much as possible. The differences needed attention anyway.
So if the above tools don't solve the problem, there are other escapes. You can shift into directions like:
* Cilk - parallel programming
* Objective C++ - peeking into Hell
* OpenCL - herds of turtles
* Javascript
Again, all of these are based on C (+ Objective). For knowing C and Smalltalk, that's a lot of results and options for only two simple languages! OK, Nu throws in a little bit of Lisp, and that's coming to the point of this post.
I started on C, then I moved to Ruby, then I saw Objective-C had the same programming model, so I bought a Mac. I then found Ruby's bridging to be awkward (and realise in hindsight that I was using Tim Burks' libraries!), moved onto Objective-C, and then moved to Nu a year ago.
I started chasing down this rabbit hole when I saw "Joy" by AAA+ in action. Not that one, the one that had a runtime Objective-C console. You could cut/paste from source code, fix it up, and paste it back. Objective-J is almost back there, and JSCocoa brings it to just a bridge away.
But it is a bridge. And Tim Burks, who created the Nu in my list, had already been down that path. Read http://programming.nu/rubycocoa-and-rubyobjc to see some of the problems with that approach. Then throw in the things that Lisp can do that Javascript can't.
That's actually not many things, as Javascript is almost Lisp when ignoring syntax. However, I want the additional escape of being able to define a DSL where needed. For example, if I need a bit of logic programming, then Nu lets me define Prolog in a few lines and run my problem through it.
(thankfully that need hasn't happened yet)
Nu also doesn't have much conceptual overhead as it closely models Objective-C. The additional rule is "use lots of ()'s instead of []'s", which was pretty much a given anyway! The visual difference is large, as one screen is full of []'s and the other one is full of ()'s. And that one is full of ;'s...
So while I wonder about automatic conversion between Nu and Objective-C for that Joy-like cut/pasteability, I do actually want to write my code in Ruby flavoured Lisp with Smalltalk infix! It sounds like a crazy combination but it does work!
I am wondering about a C parser in Nu, eg. something like:
(C
int align = (*ptr)->alignment;
if (align > 4) align = 4;
if ((align - 1) & bytes)
bytes = ALIGN(bytes, align);
bytes += STACK_ARG_SIZE((*ptr)->size);
)
or, to also nicely sugar syntax over the math side of things:
(C 45 * (5 + i) / 3)
I'd like to have a go at hooking it up to the ObjC runtime and Nu, so that I can achieve that Joy(!) of working with my Objective-C code in a runtime (with no bridge!). I figure that Nu is the minimum amount of code that makes the ObjC runtime workable as an interpreted environment.
I have no idea what I'm doing, but I'll find out. :)