On Thu, Jul 3, 2014 at 11:55 PM, Pascal Germroth <funkyco...@gmail.com>
wrote:

> Hi Atamert,
>
> Here's a gist with the example code:
> https://gist.github.com/neapel/4e502a14e3738b709672
>
> I tried replacing a closure with a dynamically built and evaluated
>>> metafunction but discovered that it was actually slower.
>>>
>>
>> If evaluating code during run is slower than AOT compiling it, it
>> wouldn't surprise me.
>>
>
> I didn't actually try AOT compiling it, just using the REPL. As far as I
> understand there shouldn't be a difference in speed, since (eval) runs the
> same compiler as AOT does, and even writes out a .class file.
>
>
OK, perhaps I could have phrased it better. I'm not an expert but I believe
REPL does compile the forms you enter to bytecode. It compiles an fn form
into a JVM class that implements IFn. It also compiles a quoted form (such
as `(fn ...) ) but this time it takes the form of a list (as in (list ...)
), IOW it's still data after it is compiled. The latter is executed
directly and the former is evaluated (turned into bytecode and then
executed perhaps).

If I'm wrong on any of these, I'd like to be corrected. I also realize AOT
means something slightly different. Something compiled before REPL is
started, right?


-- 
Kind Regards,
Atamert Ölçgen

-+-
--+
+++

www.muhuk.com

-- 
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