> This is great. I think it'll be very valuable to call out to a bunch
> of useful C library functions.

Thank you

> Can this approach also provide a bridge
> to Objective-C?
>
> I'm very interested in using Cocoa to design GUIs for the Mac.  I'd
> really like to be able to have all the business logic encapsulated in
> clojure though. Would this approach be able to glue together Cocoa NIB
> files and Objective-C code to clojure?

I'm not very familiar with what compiled Objective-C code looks like.
But I do know of this project:
https://rococoa.dev.java.net/
And it seems to be using JNA as it's backend so I guess it's possible.
It's probably a matter of decoding Obj-C's name mangling scheme.
It would probably be easier to just wrap rococoa though.
I haven't planned on supporting more languages than C but maybe if I
manage to make my code generic enough (it's currently very messy)
parts of it could be used for other language wrappers via JNA.
But I want to finish at least version 1.0 of clj-native before I even
think of something like that ;)

By the way, clj-native now has support for callbacks so that C code
can call into clojure!
I made a little example here:
http://github.com/bagucode/clj-native/tree/master/src/examples/

I didn't upload the binary for the C lib since that's very platform
specific.
If you are on a mac just do something like
gcc -c c_lib.c
ld -dylib -o libc_lib.dylib c_lib.o
and don't forget to System/setProperty java.library.path or
jna.library.path to include the dir where libc_lib.dylib is.
(for some reason the system properties must be set before the very
first attempt to load a native lib, they will not be re-read if you
change them and try again)



-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to