new Clojure Compiler...

9 views
Skip to first unread message

Fabio Kaminski

unread,
May 13, 2010, 3:46:51 PM5/13/10
to clo...@googlegroups.com
Hi all,

since clojure-dev its a managed list.. the question goes here..

i read somewhere that protocols was implemented thinking (inclusive) for natively clojure the compiler, at this moment implemented in java.

so, my question is, is this gonna happen?
and if so, in what version of clojure we will see a native compiler...

can some api clojure sources implemented in java turns native, and maintain a reasonable performance?

Thanks,

Fabio Kaminski

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Tom Faulhaber

unread,
May 16, 2010, 1:26:22 AM5/16/10
to Clojure
Fabio,

Yes, there is a plan to implement Clojure in Clojure and protocols, et
al., are part of this.

This biggest part from a performance point of view is not the compiler
itself, but rather Clojure's persistent data structures (maps,
vectors, etc.).

You can find more of the discussion around this by searching the group
for "Clojure in Clojure" of "CinC"

HTH,

Tom

Fabio Kaminski

unread,
May 16, 2010, 1:51:06 AM5/16/10
to clo...@googlegroups.com
Yes, it was what i think seeing the sources... 

for the compiler part, its a good decision since lisps are the best tool for it.. but i dont think its a priority 
and even dont need to be.. sure there more importants things to be done...

for the persistent data.. well all this "laziness" and dinamic types, and on top of that immutability should not perform well in pure clojure.... at least well as native with types..

all this purity :) has high costs... 

but if theres a port for data structures, please let me know.. cause im very interested in implementing my data sources(planing to have big data) in clojure, instead of third part databases...  (clojure is state of the art for data and concurrency)

Thanks for replying,

Fabio

Rob Lachlan

unread,
May 17, 2010, 1:08:43 AM5/17/10
to Clojure
> for the persistent data.. well all this "laziness" and dinamic types, and on
> top of that immutability should not perform well in pure clojure....

Why?

Fabio Kaminski

unread,
May 17, 2010, 2:48:43 AM5/17/10
to clo...@googlegroups.com
first that dinamic languages are better for developers, but you loose some performance compared to typed languages.. and jvm was created with types in mind.. so right now clojure data structures are implemented in java and typed, when you get it in the clojure runtime its boxed already.

theres some good approaches for dinamic languages like trace-jits(notably the new mozilla-javascript and luajit) .. but we are not there yet.. (JSR's was created as lazy sequences .. rsrs)

for the immutability you could see you can see the performance gains when you use transients against the immutable data..

i guess it cant compare in with mutable data when you use it sequentially(thats why transients get in the game)... but when you add concurrency to that scenario.. things get better and simpler for us.. :)

Steven Devijver

unread,
May 17, 2010, 3:53:58 AM5/17/10
to Clojure


On 17 mei, 08:48, Fabio Kaminski <fabiokamin...@gmail.com> wrote:
> first that dinamic languages are better for developers, but you loose some
> performance compared to typed languages.. and jvm was created with types in
> mind.. so right now clojure data structures are implemented in java and
> typed, when you get it in the clojure runtime its boxed already.
>
> theres some good approaches for dinamic languages like trace-jits(notably
> the new mozilla-javascript and luajit) .. but we are not there yet.. (JSR's
> was created as lazy sequences .. rsrs)
>

This is the typical confusion about "dynamic languages". Actually,
Clojure is not a dynamic language, it's a dynamically typed language.
Dynamic typing on the JVM generally doesn't suffer from a performance
impact, unless you're in the camp of people who believe reflection is
"slow".

Real dynamic languages like Ruby or Groovy do suffer from a gigantic
performance impact due to the feature that distinguish dynamic
languages from other languages: the meta protocol. In Ruby and Groovy
a method call is never really a method call, it's a message that's
sent through the meta protocol. It's this feature that gives you the
findByYourGrandMothersBirthDate() "dynamic" methods in Ruby on Rails
and Grails. These are not calls to methods at all, they are calls that
get parsed and converted into database query statements.

Clojure does not have a meta protocol and thus is not a dynamic
language, and thus does not have the associated performance impact.
You might have heard about Groovy++ which is branded as the new new
thing these days. Groovy++ is simply Groovy without the meta protocol,
hence fast Groovy.
Reply all
Reply to author
Forward
0 new messages