Lisp HUG Maillist Archive

What are my options with OSX Cocoa?

Hi,

We are considering our options for a new application we are beginning 
work on. It will be a Cocoa application on OS/X. We are going to be 
building a platform dependant part and a platform independent part, 
which, with any luck will be ported and allow Windows and Linux 
specific versions in the future. The more we put into the platform 
independent part the less we'll have to write and maintain in the 
future... it's Friday and I'm an optimist :-)

I've spent some time trying to use CAPI on OS/X last Fall and Winter. 
While there was some promise shown, there is simply too much to be had 
by just going with ObjectiveC and Cocoa on this platform.

However, the platform independent part of what we are planning is very 
well suited to Lisp and I've more than established that LispWorks can 
handle this.

Lets imagine that there are three parts to the system: 1) GUI stuff in 
Cocoa; 2) OpenGL Stuff; 3) modelling stuff.

LispWorks has been ruled out of 1, is ideal for 3, and I'd kind of like 
to understand what is possible with 2.

Now the questions...

Has anybody written a GUI in Cocoa and a back-end in LispWorks?

Is there any example code out there showing how this might be done? Is 
there any example code out there showing the FFI stuff working in OS/X 
at all (I have not found any -- am I looking in the wrong places?)

Can a LWM program play with OpenGL in an NSOpenGLView created by 
Cocoa/ObjectiveC?

What about Distributed Objects under Cocoa, anybody played with writing 
one of those using LWM?

Is it would be too much to wish for that a Cocoa-LWM bridge might exist?

If I can do this somehow, and if Rich Hickey's jfli happens, I'd be 
very excited.

Thanks,
Bob


Re: What are my options with OSX Cocoa?

For what it's worth... I just got an eMac and installed LWM on it. I've had
it about a week or so now...

I have been using a client connection to AquaTerm
(http://sourceforge.net/projects/aquaterm/) quite successfully from LWM, but
you have to devote a service thread to all such communications. The client
connection does not ostensibly use any Cocoa graphics commands, but it uses
quite a bit of "shared data" (just another way of using RPC under the hood
in ObjC) with the Aquaterm server. The speed is remarkably fast and it works
quiet reliably.

I just created an FLI layer to the C API of AquaTerm and make sure that all
Lisp calls to the server go through a dedicated thread that is the one which
also initiates the connection. Since LWM is itself using Cocoa and it is
multithreaded, the conditions are already established for having additional
threads make use of Cocoa. I happen to use an implementation of my own
interpretation of John Reppy's CML Channels in Lisp, but you don't have to
get that elaborate. All you have to do is launch an LWM thread and then
vector all your AquaTerm FLI calls through a mailbox to that thread.

I find LWM quite usable for Mac development. With that AquaTerm server as my
graphics plotting display, I'm using LWM to perform signal processing
algorithm development in a block diagram oriented signal processing system.
I have Oscilloscopes, Spectrum Analyzers, Waterfall Displays, and other
scientific plotting 2-D and 3-D, color images, etc. All this stuff is live
update in some facsimile of real time (depends on what you claim your sample
rate is...) I extended AquaTerm a bit to support clipping regions and color
alpha channels.

I'm really quite pleased with the results of LWM and the Cocoa connection.

David McClain
Senior Corporate Scientist
Avisere, Inc.

+1.520.390.7738 (USA)
david.mcclain@avisere.com




Updated at: 2020-12-10 08:55 UTC