Javier, Nathan +1

I think type systems such as Haskells (and presumably Scala's FP stuff,
don't know anything about that) are really the way to go if you want static
typing. I think the extra safety that it provides you with is really
beneficial and for most things Haskells type system feels pretty light
weight, you basically only have to type the function signature (if that) and
you get algebraic polymorphisms with all the safety and generality.

That said, I read somewhere (can't find the link now, sorry) that
compile-time type checking in Lisps is difficult because they allow code
generation at run time? That would still leave the possibility to apply it
to everything which is evaluated at compile time which I assume is 99.5% of
all clojure code.

cheers
Paul


On Fri, Sep 23, 2011 at 04:47, Nathan Sorenson <n...@sfu.ca> wrote:

> Yes I am very hopeful progress is made on that front! I've been having
> great success with 'Constraint Handling Rules' (CHR), which serves as
> my basis for solving type constraints.
> https://github.com/nsorenson/Clojure-CHR
> contains my very preliminary crack at implementing this system.
>
> The trick with dynamic languages such as Clojure is that the functions
> are extremely lax in what they accept--without a fairly advanced
> inference system, you will simply infer every variable to be type
> Object. I've been using CHR disjunctive branches to offer what's
> called "occurrence typing"--a system where you may assign different
> types to variables depending on the structure of the code. For
> instance, if you have a (map? x) as a predicate on an if clause, you
> know in the 'then' branch that x can be typed to Map.
>
> Nothing to show yet, and I'm not sure how well it will work on large
> programs, but my first few little experiments are looking promising.
>
> On Sep 22, 3:28 am, Javier Neira Sanchez <atreyu....@gmail.com> wrote:
> > i am surprised nobody mentioned gradual/optional typing<
> http://lambda-the-ultimate.org/node/1707>,
> > typed racket <http://docs.racket-lang.org/ts-guide/>  and the possible
> type
> > checker to be built by *some clever hacker* on core.logic<
> https://github.com/clojure/core.logic>some day.
>
> --
> 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