Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Clojure-CLR on Unity3d?

How can I use Clojure-CLR on Unity3d?

like image 913
damon-kwok Avatar asked Jul 30 '13 05:07

damon-kwok


2 Answers

People in the Clojure community have gotten something working.

From @swannodette "Looks like @ra and @timsgardner got Clojure running inside Unity last night"

http://f.cl.ly/items/2T2d340o0k0W2d44212G/clj2.gif

like image 21
adamhill Avatar answered Nov 12 '22 19:11

adamhill


The complex answer is "maybe you can", the pragmatic answer is "no, you can't".

Sylwester suggested this is a duplicate of using it with Mono, which isn't really true, because Unity uses its own fork of Mono(one that's very old...2.6?), so something that's compatible with Mono won't necessarily have compatibility with Unity.

ClojureCLR requires the DLR(though they've been moving away from it), which means it's incompatible with Unity, since the DLR requires Mono 2.8+.

That said it's possible to add the DLR as a dependency, and to compile ClojureCLR to .dlls and access it from Unity, this is what I did, however my experience was that I could get a lot of my code to run fine in the development environment, but when I'd build the game, everything would break, it'd just ignore the Clojure stuff.

If Unity moves to a higher version of Mono, or ClojureCLR gets rid of dependence on the DLR, I don't see any reason Unity couldn't support it, and I actively look forward to it. But for the moment, it's not practical.

If a work-around exists(and it probably does), I never managed to figure it out.

like image 133
VFe Avatar answered Nov 12 '22 18:11

VFe