Zetawar / zetawar

Zetawar is a turn based tactical strategy game implemented in 100% ClojureScript.
MIT License
169 stars 14 forks source link

Make DataScript compatible with self-hosted ClojureScript #102

Open djwhitt opened 6 years ago

djwhitt commented 6 years ago

Ok, so this isn't exactly a Zetawar issue, but this keeps us from being able to run Zetawar on Lumo, and I really really want to run Zetawar on Lumo. :grin:

tbeddy commented 6 years ago

Is DataScript currently impossible to run outside of a browser or just difficult?

djwhitt commented 6 years ago

I'm pretty sure it'll run outside the browser. I know that it at least loads. However, it won't compile in self-hosted ClojureScript. You have to use JVM Clojure to compile it.

djwhitt commented 6 years ago

I suspect the main problem is macro definitions in :clj blocks. They don't get evaluated in self-hosted ClojureScript.

djwhitt commented 6 years ago

I should probably elaborate a bit on why I want to run on Lumo. One reason is the AI vs AI runner. It would be great to be able to run that from a script without any JVM dependency. The other is as a unit and integration test runner. Both of those are cases where I feel like having an explicit compilation phase that relies on the JVM gets in the way more than it helps.

djwhitt commented 6 years ago

I've made some progress on this here: https://github.com/Zetawar/datascript/tree/self-hosted-cljs

That might be enough to get the game logic running if some other self-hosted-cljs incompatible dependencies are removed. I'll probably tackle logging next.