If your goal is to 100% type check a project, then my experience and
observing the experience of
others says core.typed isn't there yet for various reasons.
1. It's likely any given project uses a handful of lesser-used Clojure
idioms not handled by core.typed (eg. metadata, transducers)
2. Type checking performance does not scale nicely depending on the kind of
code you check.
(Considering the nature of what core.typed is doing -- effectively chasing
the tail of Clojure and its current fashions ---
the implementation will probably never be "ready" in this sense).
However, core.typed has been designed (or, enough backdoors have been
exposed) to be flexible to
many situations.
It's sometimes feasible to pick a few namespaces that could benefit from
type checking for various reasons:
1. Eliminate particularly expensive runtime contracts
2. Clarify and check functions signatures that cannot be easily expressed
as contracts, eg. `map` wrappers
3. More often than not the process of statically typing code is a very
powerful code review mechanism. Even
if you throw away the result, you'll often find inconsistencies just
staring at the code figuring out how to check it.
Out of the more common Clojure idioms, core.typed handles code that uses
keyword maps and
complicated control flow surprisingly well. If you're also throwing around
higher-order functions, core.typed can often help.
It's also interesting to note, writing typed code from scratch results in a
consistently better type checking experience
than porting untyped code, however the development experience suffers
somewhat in the important experimental/design
phases of coding. The tradeoff is flexibility for correctness, sometimes
the "optional" nature of core.typed makes it feasible
to temporarily elide type checking to experiment and get back to typed code
at some later point (I almost always do this,
static type checking sometimes just isn't the right debugging/design tool.
And sometimes I don't care what core.typed thinks).
In conclusion, core.typed has successfully checked tens of thousands of
real lines of Clojure. But results wildly vary; some
projects just suit core.typed better than others.
Thanks,
Ambrose
On Sun, Sep 20, 2015 at 5:41 AM, Colin Yates <[email protected]> wrote:
> Thanks Ambrose for a succinct and honest reply. I am not sure this can
> be answered, but how long do you estimate before core.typed reaches
> sufficiency for use in a production (Clojure) project?
>
> On 20 September 2015 at 10:34, Ambrose Bonnaire-Sergeant
> <[email protected]> wrote:
> > ClojureScript development has definitely stalled since GSoC 2014. I have
> no
> > immediate plans to fix this myself,
> > but am eager to guide others into getting it up to date.
> >
> > More generally, we're working on the design of gradual typing for
> core.typed
> > (Strangeloop talk coming),
> > and I've fallen behind on day-to-day work due to other commitments.
> >
> > Thanks,
> > Ambrose
> >
> > On Sun, Sep 20, 2015 at 5:25 AM, Colin Yates <[email protected]>
> wrote:
> >>
> >> Hi all,
> >>
> >> first, this really isn't intended to be flame bait! but I wondered about
> >> the status of core.typed. Is it still 'live'? And secondly, is its
> >> ClojureScript support sufficient enough to be practical?
> >>
> >> As I said, no flame bait at all, but when it first appeared a few years
> >> ago it was a pretty big deal but in recent times it seems to have
> stalled.
> >>
> >> All of this is my perception and I ask only because of my desire to use
> >> it! :-).
> >>
> >> Thanks,
> >>
> >> Colin
> >>
> >> --
> >> Note that posts from new members are moderated - please be patient with
> >> your first post.
> >> ---
> >> You received this message because you are subscribed to the Google
> Groups
> >> "ClojureScript" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to [email protected].
> >> To post to this group, send email to [email protected].
> >> Visit this group at http://groups.google.com/group/clojurescript.
> >
> >
> > --
> > Note that posts from new members are moderated - please be patient with
> your
> > first post.
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "ClojureScript" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to [email protected].
> > To post to this group, send email to [email protected].
> > Visit this group at http://groups.google.com/group/clojurescript.
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/clojurescript.
>
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.