>
> A toy project I've worked intermittently on makes heavy use of *partial* 
> to dynamically build complex functions.  I wish that *partial* was smart 
> enough to recompile its first argument, maybe taking advantage of whatever 
> type inference the compiler can make, but partial 
> <https://github.com/clojure/clojure/blob/028af0e0b271aa558ea44780e5d951f4932c7842/src/clj/clojure/core.clj#L2460>
>  
> only returns a function wrapper.  Ohwell.
>

This raises a different question with me...  Does clojure have the same 
scope for code optimization that other languages, eg C++, have?  Ie, even 
though a C++ compiler has to deal with all sorts of complicated syntax, it 
is able to perform a whole lot of at-compile-time optimizations based on 
the C++ semantics.  Is the clojure compiler free to do a similar thing?  Or 
is it bound to adhere to the straightforward evaluation rules?

My understanding is that one of the roles of macros is to perform 
at-compile-time optimizations.  Sometimes a macro can do something clever 
to transform less performant code into optimized code.  But is this the 
only way of improving compiled code - ie introducing code-optimizing macros 
- or does the clojure compiler itself have scope to elide certain things 
and make other performance optimizations?

I know the java JIT optimization reduces the need for this, but my guess is 
that there is still a role for at-compile-time code optimization.

Cheers,

Mark.

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