I think it false view that immutable/functional constructs are slow by
default. Instead, a lot of it comes down to lack of support in the popular
VMs for these constructs. For example the following code:

(defn add-fn [& args]
  (reduce -add 0 args))

(loop [x 0]
  (if (eq x 10000)
    x
    (recur (add-fn x 1))))

Is never going to be super fast in Clojure, but it compiles down to a loop
with 4 assembly operations in Pixie (https://github.com/pixie-lang/pixie)
all while remaining fully dynamic. But that's because the VM is tuned to
optimize things like varargs and reduce. You can't really tap into the VM
at that level on the CLR or the JVM.

That's not to say that Pixie is always faster than these platforms, on the
contrary, it's often much slower on GC heavy operations. But hopefully
someday we'll reach the holy grail of a VM that aggressively optimizes
dynamic languages without requiring hinting or rewriting into less
idiomatic forms.

Timothy

On Thu, May 14, 2015 at 12:36 PM, Raoul Duke <rao...@gmail.com> wrote:

> Ditto F# vs. C#.
>
> One has to wonder when / where / if functional-pure-immutable
> approaches will ever under the covers get "fast enough"?
>
> --
> 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/d/optout.
>



-- 
“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/d/optout.

Reply via email to