[Openmcl-devel] sharing data between fortran and OpenMCL

Hamilton Link hamlink at comcast.net
Sat Oct 2 10:40:49 PDT 2004


> Just as it's nice to have, at times, a lowest-common-denominator 
> function interface, it might be nice to have LCD memory models that 
> can facilitate this sort of interoperability.
>
> Thanks again,
>
> Cyrus

Well I think Gary said as much that if you want 
least-common-denominator memory management, what that _means_ locally 
is no automatic memory management, allocating stuff by hand and putting 
stuff in C space where the GC won't free it. OpenMCL has that. Does 
that mean you have to be substantially more careful? Yeah, especially 
because that's not the 99% case and so lisp isn't really designed to 
handle it gracefully. But it's doable.

Different implementations interface to different languages. ObjC was 
low-hanging fruit under OS X because it's introspective enough to make 
things easier and there's lots of useful ObjC APIs in OS X. Franz 
Allegro CL has Java interfaces that supposedly work reasonably well, 
and most systems have C FFIs.

One thing Gary and I have talked about is the possibility of doing a 
.net port of openmcl. That would solve the FFI problem in one fell 
swoop to a LOT of languages. Send Gary a big wad of money in a contract 
and when he's free I'm sure he'll jump right on it.

I suppose one additional dangerous answer would arise from the 
following analysis: C programs can be made with garbage collection, 
albeit conservative collection. One potentially interesting approach 
would be to have a hybrid GCer that collected standardly-allocated 
objects in the current way, and did conservative collection of C space. 
Then you wouldn't leak memory and it would be safer to allocate things 
in C space. The big problem I see with this is that if it's in the 
service of 2% of what people want, it could cause massive problems 
until the new GCer was fully debugged for the other 98% of what people 
do.


Normally I'm on the being-lectured side of things, having C++ 
programmers and/or managers who don't know any language but one 
lecturing me on language choice when I've used a dozen and know a great 
deal about their implementation, so I'll relax my normally 
defensivestance in the interests of discourse. Is lisp the only 
language? Of course not. It's not even "the" single best one. The big 
advantage of C, FORTRAN, etc. and the main reason many languages still 
exist (like Cobol and fortran) is that there's a million monkeys on 
typewriters generating or maintaining libraries we lisp programmers 
should really be able to easily exploit --  that, and sometimes for 
various reasons what you really need to do is program in assembly or 
write a library that some .jar-head (heh) can maintain... both of which 
happened to have happened to me in the last two weeks. So as far as 
that goes, I think we're on the exact same page.

h




More information about the Openmcl-devel mailing list