4 ms·
I wonder how good clojure is with soft real-time like graphics rendering/games, or as an embedded script engine.
by chii 8y ago
I wonder how good clojure is with soft real-time like graphics rendering/games, or as an embedded script engine.
- harlanji 8y agoI’ve embedded Nashorn in Clojure and the environment is able to be inspected with Java development tools at runtime. Objects are able to be put into the JS context, hypothetically with native linked libraries without hastle. JS is single threaded so there should be no issue if the native library is not thread safe, and Java makes single thread guarantees. IIRC one can tie the script runtime to a thread, and create several per process and put them in a scheduler like any other thread. Ie. probably as good as native.
- dustingetz 8y agoFor real-time graphics, i think there is an impedance mismatch with the GPU data structures which are basically big mutable array buffers
- agumonkey 8y agomaybe used as a dsl interface for gpu ... I don't know
- dustingetz 8y agoI think you want the same datastructures moving up and down all layers of stack, otherwise you pay a marshalling penalty at each layer which is terrible for perf. If this is true, then we'd need to see fast immutable memory models inside GPUs that could natively represent persistent trees (moving away from pointers to mutable array buffers). Otherwise, the imperative way will always be at least C times faster, which seems a dealbreaker for the trailblazing researchers who forge the path the application layer follows.
- markc 8y agoYes, for example https://neanderthal.uncomplicate.org/ https://neanderthal.uncomplicate.org/
- jwr 8y agoAnd yet Neanderthal seems to have no problem getting it quite right: https://neanderthal.uncomplicate.org https://neanderthal.uncomplicate.org
- dustingetz 8y agofor graphics? show me a graphics tech demo using neanderthal!
- slondr 8y agoClojure compiles to Java bytecode so it's use as an embedded script engine will be limited to programs written in Java, or else you'll have a huge overhead with having to run a JVM next to your application. It's a shame, too, because Scheme/Lisp has proven itself to be a very worthwhile scripting language in its own right.
- jwr 8y agoI really wish people wrote these comments after spending more than three minutes looking at a language. Don't like the JVM startup time? See Clojurescript and planck. Sub-second startup+compilation+execution on my old laptop.
- reutsharabani 8y agoClojure is a language, it is not necessarily bound to the JVM (although the common implementation is the one using the JVM). Like CPython to Python. The JVM also brings with it the entire JVM ecosystem which makes clojure very practical. Finally, there is actually an implementation of clojure for the browser (clojurescript) - which is a better idea than anything I've seen on the front-end (react-redux is OK, but clojurescript wrappers to react are just awesome). There is also an implementation for the CLR. Clojure runs everywhere, it has a rich ecosystem since it utilizes good hosts (JVM, CLR, js engines (with google compiler optimizations)). It is, IMO, the most practical lisp out there.
- markc 8y agoSee Arcadia - Unity 3d programming in Clojure https://arcadia-unity.github.io/ https://arcadia-unity.github.io/