On 26/09/2009, at 4:20 PM, Erick Tryzelaar wrote:

>
> It's been quite some time since I last posted, but I've been pretty  
> busy. I only wasted 2 days this time wandering down the depths of  
> the felix type system and name binding... *shudder*.

Yep, it's quite tricky and also somewhat complicated and messy.

The basic idea is simple enough: evaluate everything by recursive  
descent,
with tracing the descent to stop recursions. Recursions usually trigger
a hard to decipher error, although occasionally they're legal (eg  
recursive
types). It's tricky because at the point recursions are detected it
isn't known which is which, so an exception is thrown and is trapped
if the recursion is legal.

It is also trapped if it is NOT legal, in order to give a sane error
message. This means one has to decide where in the descent
to detect recursions AND where to trap them. There are always
two choices with different boundary conditions: when you have

        possibly_recurive_call()

you can either flag and trap the recursion at the call point
or on entry to the function.

The type system is further complicated by an incomplete
and broken meta-typing system. However it can't be got
rid of because type functions really exist, and get overloaded,
similarly, type constructors.

The overload resolution algorithm is also quite hard. Quite apart
from choosing a matching overload, it has to chose the best match
when there are several (most specialised) and also has to
discard candidates which don't meet constraints. As output
it not only returns the chosen function, it also has to return
any type variable bindings.


--
john skaller
[email protected]





------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to