Hacker News new | ask | show | jobs
by takeoutweight 4548 days ago
I took a different tack with clojure-scheme by compiling via Gambit Scheme, which can target Objective-C. https://github.com/takeoutweight/clojure-scheme. This approach made it easier to provide self-hosted compilation, enabling niceties like an on-device repl.
1 comments

I recently wanted to try out clojure-scheme for a simple Mac OS X or iOS app, but I couldn't easily find an example app that shows how to set up a project to target Objective-C and compile correctly, and what to import to call the Apple frameworks.

Is that even possible? If yes, is there some sort of sample that I didn't see?

The best place to start is actually the scheme iOS repl that comes packaged with the Gambit source. Take a look at the misc/build-gambit-iOS script (mentioned on slide 39,40 of my linked talk slides). It's a bit of a hairy build process (and clojure-scheme only adds more hair into the mix) but once you have the repl working it's easier to see where to slide in the .scm/.m files that clojure-scheme and Gambit generate. Some kind of CMake script would probably ease this pain in setting up all this Xcode stuff.