Arc Forumnew | comments | leaders | submitlogin
5 points by almkglor 6097 days ago | link | parent

Hmm. Idea, idea.

How about co-opting bits of Haskell type system.... Hmm.

Basically 'num here would be a specific "is-a" type, not necessarily the "has-a" type I was thinking. But it should be doable. Basically you just need to redefine 'defm to put stuff in a table as well as into the symbol, and have type-declaration scan through the code for stuff in the table that's declared with specific types.

But we need to figure out first how to handle types: "is-a" or "has-a". Does 'defm dispatch off a "is-a" relationship or "has-a" relationship? Possibly as in Haskell, with a "is-a" type having "has-a" set of interfaces/typeclasses/baseclasses.



6 points by nex3 6097 days ago | link

Oh please no! Static typing and Lisp - especially a Lisp like Arc that puts even more emphasis on being as dynamic as possible - don't mix. If we want performance improvements like this, that's what type annotations are for. Those work fine in CL for gaining performance, and integrate well into dynamic languages.

If we add Haskell's type system, we'll just end up with an ad hoc, informally-specified, bug-ridden, slow implementation of half of Haskell. That's not what anyone wants.

-----

3 points by almkglor 6097 days ago | link

Err. The idea is that these are the "type annotations" you are looking for. I never said anything about making this mandatory; it's merely the implementation layer for type annotations.

-----

2 points by dido 6096 days ago | link

I wonder if some of the work in optimizing Self, such as polymorphic inline caches [1] might be applicable for non-object oriented dynamically-typed languages such as Arc.

[1] http://research.sun.com/self/papers/pics.html

-----