This is basically my approach. I'm performing static analysis a la carte.
Right now I have a "check-namespace" function that performs type checking
transitively for a given namespace. You could imagine performing this at
the REPL, lein plugin, or via an editor shortcut.

And adding types has zero effect on the resulting code, aside from having
to `require` the type system library. Ideally, you would only add top level
annotations as separate forms.

(+T add-two [Number -> Number])
(defn add-two [n]
  (+ 2 n))

I could imagine the results of type checking could offer suggestions for
type hinting, and an editor could automatically fill in the types.

Thanks,
Ambrose

On Fri, Apr 20, 2012 at 8:48 AM, Mark Engelberg <mark.engelb...@gmail.com>wrote:

> On Thu, Apr 19, 2012 at 4:38 PM, Ambrose Bonnaire-Sergeant <
> abonnaireserge...@gmail.com> wrote:
>
>> I am working on an optional type system for Clojure. It looks more like
>> Scala's type system, ie. working on top of existing Java types.
>>
>>
> I saw Gilad Bracha speak a couple weeks ago about the design of Dart.
> Dart's optional type system is based around the philosophy that annotating
> code with types should never cause your code to not compile or in any way
> behave differently than it would in dynamic typing mode.  Adding types just
> causes the compiler to emit warnings if things don't match up right.  In a
> sense, it's a "type assertion" system.
>
> Seems like this would be a good system to draw inspiration from, and would
> fit nicely with Clojure's philosophy.
>
> --
> 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 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

Reply via email to