#import "ReplClient.h"
#import "clojure/lang/ObjC.h"
....
[ClojureLangObjC setObjC];
[ClojureLangRT load__WithNSString:@"clojure/core"];
[ReplClient connect:@"localhost"]; // Localhost for the simulator, your IP if you're running on a device
3) Do stuff
Here's how it works:
Everything runs on the JVM, less when you call an objc interop function. That's sent to the objc runtime and executed there. There's a remote references system that allows objc to handle jvm instances and backwards. The tricky part was that when you call an objc selector, I need to do a synchronous call, and all UI selectors have to run on the main thread, so it's really easy to get into permanent blocks.
Right now I'm using dispatch_async to run the calls on the main thread without blocking the socket, and that adds a delay to every call, making the whole thing very slow. The new design uses 2 sockets and a sync dispatch, it should be many times faster.
The other problem I need to fix is memory usage. The ObjC side of the REPL is not releasing any memory for remote references now, but thats not something hard to fix.
The REPL is the last thing stopping the next release. The project is much more stable, my startup goes live next week with 2 iOS apps fully written in clojure :)
--
You received this message because you are subscribed to the Google Groups "clojure-objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-objc-dis...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.