Hi Daniel, It is unsound to assume we can pass anything to an unannotated, unchecked var.
core.typed makes the user explicitly mark unchecked vars, which is also a source of unsoundness, but an explicit one. Hopefully :no-check is not ambiguous in this regard. Take this example. ;; untyped namespace (defn evil-atom-reset! [a] (reset! a :foo)) ... ;; typed namespace (defn nice-typed-fn [] (let [a (ann-form (atom 1) (Atom1 Number)) _ (evil-atom-reset! a)] (+ @a 2))) If we simply assume evil-atom-reset! is of type [Any -> Any], our atom gets changed underneath us, and any type guarantees do not hold anymore. The answer to this is generating contracts to wrap about our calls to untyped vars. These should probably be driven by user annotations though. Typed Racket automatically does this via macros, which is very cool, but probably impossible in Clojure. So in general, implicitly trusting untyped code can be problematic. core.typed at least makes the user be explicit about unchecked vars so there is some chance the annotation is correct. Thanks, Ambrose On Thu, Aug 29, 2013 at 12:06 PM, Daniel <doubleagen...@gmail.com> wrote: > Excellent work. I noticed that function parameter types default to Any > when not Annotated. What was the reasoning behind not mirroring this > behavior for vars, and instead requiring an annotation? > > > On Wednesday, August 28, 2013 5:28:35 PM UTC-5, Ambrose Bonnaire-Sergeant > wrote: >> >> Hi, >> >> After 10 months and 26 0.1.x releases of transitioning core.typed from an >> ambitious student project, I am finally comfortable recommending core.typed >> for production use. >> >> Production Ready >> >> My interpretation of "production ready" in this context is: >> - core.typed can *find bugs* in real code >> - core.typed will *not slow down* your existing code by loading >> a large library at production. (core.typed does introduce an extra >> "identity-like" >> function call at type annotations, I assume this is a candidate for >> optimisation via >> HotSpot) >> - A basic *tutorial*, API docs and example project exist >> - core.typed is *currently used in production* with success (at CircleCI >> for several months) >> - The core type checking API is mostly *stable*, with only very >> minor removals/breaking changes in the last few months. >> >> There are several outstanding issues, but I am satisfied that core.typed >> can bring real utility to real programs *today* and with *no >> production-time drawbacks*, thus this release. >> >> How to get started >> >> Leiningen dep: >> >> [org.clojure/core.typed "0.2.0"] >> ...; for very recent releases:repositories {"sonatype-oss-public" >> "https://oss.sonatype.org/**content/groups/public/ >> <https://oss.sonatype.org/content/groups/public/>"} >> >> If you like following tutorials try the user/types guide. If you just >> want to get your hands on some typed code, see the Example project. >> >> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide> >> core.typed Types Guide <https://github.com/clojure/core.typed/wiki/Types> >> Example project <https://github.com/frenchy64/core.typed-example> >> API Reference <http://clojure.github.io/core.typed/> >> >> core.typed Github Home <https://github.com/clojure/core.typed> >> core.typed Wiki <https://github.com/clojure/core.typed/wiki> >> >> Please report bugs, ask questions or discuss things on the mailing >> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed> >> . >> >> (FWIW I'm ambrosebs on #clojure.) >> >> Thanks, >> Ambrose >> > -- > -- > 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/groups/opt_out. > -- -- 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/groups/opt_out.