News for hackers. Stuff that matters.
Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by chii on Sunday January 06, 2019 @06:42PM (#18841526)
I wonder how good clojure is with soft real-time like graphics rendering/games, or as an embedded script engine.
Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by markc on Sunday January 06, 2019 @07:43PM (#18841825)
See Arcadia - Unity 3d programming in Clojure https://arcadia-unity.github.io/
Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by harlanji on Sunday January 06, 2019 @06:54PM (#18841570)
I’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.
Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by dustingetz on Sunday January 06, 2019 @06:58PM (#18841589)
For real-time graphics, i think there is an impedance mismatch with the GPU data structures which are basically big mutable array buffers
Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by jwr on Monday January 07, 2019 @12:03AM (#18842913)
And yet Neanderthal seems to have no problem getting it quite right: https://neanderthal.uncomplicate.org
Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by dustingetz on Monday January 07, 2019 @08:37PM (#18852219)
for graphics? show me a graphics tech demo using neanderthal!
Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by agumonkey on Sunday January 06, 2019 @07:02PM (#18841606)
maybe used as a dsl interface for gpu ... I don't know
Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by dustingetz on Sunday January 06, 2019 @07:35PM (#18841788)
I 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.
Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by markc on Sunday January 06, 2019 @07:38PM (#18841796)
Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by slondr on Sunday January 06, 2019 @07:17PM (#18841684)
Clojure 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.

Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by jwr on Monday January 07, 2019 @12:06AM (#18842925)
I 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.

Re:How innovative is Clojure as a Lisp dialect from Lisp exp... by reutsharabani on Tuesday January 08, 2019 @12:05PM (#18857150)
Clojure 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.