It is my understanding that Typed Racket programs do not run any
faster than their dynamically-typed counterparts, and in fact commonly
run slower because there are a lot of additional runtime checks that
must be inserted to handle various types of unsafe calls that can
cross module boundaries or be executed at the REPL. Typed Racket is
purely about safety, not about speed. My guess is that the Clojure
community would have little interest in any version of static typing
that did not provide performance benefits.
check out the approach Dialyzer takes for Erlang. would be fun to have
something like that for Clojure, i think.
It's a hard problem. Most type-systems forbid the kind of program people write in ClojureFor example (if (keyword? x) ....using the fact that x is a keyword...would not be typable in many languages. (Or there would be hundreds of special cases)
www.ccs.neu.edu/scheme/pubs/popl08-thf.pdf
-Fred
--
Science answers questions; philosophy questions answers.
> --
> 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
> It is my understanding that Typed Racket programs do not run any
> faster than their dynamically-typed counterparts, and in fact
> commonly run slower because there are a lot of additional runtime
> checks that must be inserted to handle various types of unsafe calls
> that can cross module boundaries or be executed at the REPL. Typed
> Racket is purely about safety, not about speed. [...]
1. The dynamic type checks are contracts, which happen only on
interaction between typed and untyped code. The cost is therefore
not larger than the cost of contracts, and if you're talking about
code inside a single module, or involving several typed ones, then
there is no runtime cost at all.
2. Typed Racket used to be only about safety, but there's no intention
to avoid using it for speed. Recently there has been work invested
in making statically-typed code use unsafe operations, which can
make code run significantly faster. It's not publicly advertised,
yet, but it's not too far from it.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!