There are a combination of issues all contributing to the lack of response
on this subject. But before I continue let me state that these opinions are
my own. I have worked on Clojure and core.async, but these comments are
going to be personal conjecture and opinions:

1) As mentioned there is a high amount of complexity required to implement
all the interfaces needed for the different variants of functions you want.
Primitive hinted functions currently implement Java interfaces,
implementing every combination of float, double, object, short, int, long,
and byte for arities up to 5 would require the addition of over 16,000
interfaces. With the current config, we only need 81 interfaces. I'm not
saying this couldn't be changed to happen on-the-fly, it would just take
some serious work, and would cause problems with Java Interop

2) The current system works, there are production databases (see Datomic),
neural networks (see the work by Prismatic), and many high performance
libraries (Zach Tellman has a reputation for bending Clojure to his will in
this area), all written in Clojure.

3) Because of #2, some may even go so far as to say that we should drop
everything but longs and doubles. Other dynamic languages (Python for
instance) do this without problems, they simply relegate all the high
performance stuff to highly optimized libraries. This is what Prismatic did
with HipHop (
http://blog.getprismatic.com/blog/2013/7/10/introducing-hiphip-array-fast-and-flexible-numerical-computation-in-clojure
).

4) Writing small functional libraries in Java that interop with Clojure is
actually quite nice. So perhaps the answer is to build the inner kernels of
your system in Java and then wrap them? I know that doesn't sound fun, but
you won't get much faster code than that.

So all the above make me sit back and say "what is it about your problem
that is unique and really requires floats? Why haven't we had problems like
this in the past."

5) And I think the problem really comes down to your API and target
platform (GPU). See, most of us would just typehint to doubles and take the
memory hit. Doubles are fast on modern CPUs and memory is cheap. Not so in
your case, as you mentioned you have concerns about memory size and
performance of certain primitives.

My conclusion is that you'd probably be best looking at the HipHop library,
and figuring out how you can adapt their ideas to your own code. That is,
write a small Java library that contains all the kernel code you need, and
then stitch together these primitives with Clojure.

As it stands, Clojure's support for type hinting floats is poor, but that's
not likely to change soon.

----

TL;DR - The reason you haven't heard back is because no one has a good
answer as to how to fix it, or if it even needs to be fixed. That's not the
answer anyone likes to hear, but I'm afraid that's the truth. Anyone else
on this list can feel free to correct me.

Timothy Baldridge


On Thu, Sep 12, 2013 at 8:38 AM, Alex Fowler <alex.murat...@gmail.com>wrote:

>
> Does somebody from the development team read this user group? Or maybe I
> have addressed my questions to a wrong place?
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to