guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Associate type information to tree-il expansions


From: Stefan Israelsson Tampe
Subject: Re: Associate type information to tree-il expansions
Date: Thu, 24 Nov 2011 14:55:45 +0100



On Wed, Nov 23, 2011 at 11:04 PM, Andy Wingo <address@hidden> wrote:
Stefan,

I must apologize for not responding to your mails!  Or rather, for
responding so late.  Apologies in any case.

np
 
On Sat 14 May 2011 20:57, Stefan Israelsson Tampe <address@hidden> writes:

> (macroexpand '(let ((A : integer 1)) A))
> $2 = #<tree-il (let (A) (#{A 110}#) ((const 1)) (lexical A #{A 110}#) (integer))>

Obviously we'd need to type everything else, but OK.  I guess my overall
reaction here is one of fear.  This is really hard to get right.  Though
I am not against types in tree-il in principle, I have a hard time
thinking how this can be a win for Guile.

There are two reasons that I know of to use types: one, to avoid
run-time type checks.  This could be useful to Guile in the future, but
we are not fast enough yet for it to matter.  Secondly, types can prove
things about programs.  But I have a hard time thinking how this relates
to the untyped parts of Guile, which will always be there.  The best
work in this area that I know of is Typed Racket, and their treatment of
types and contracts.
 
So, to get the advantages of types, I think it needs to be in a context
of stealing from Racket.  That, in itself, is quite an effort; doable,
but it takes commitment.  It does not seem to me that half-way
approaches are useful.

But I really don't know.  What do you think?

Regards,

Andy
--
http://wingolog.org/

Entering type information associated with various tree-il constructs is probably not nessesary
when the speed increase is so small relative the baseline. So I would postpone any of this
until jit/native compilation is available as you say.

I would use the same interface as typed racket has for a typed guile. And in the first inkarnation use it
just to statically prove something about correctness for those who want that.

Then if any oppertunity comes to take advantage of type information for speed increase we could start an
activity to enable storage if the type infromation for codegen's

Also, maybe more usefull, contracts is something people here ask for so I think that we should start an
activity to port that over as well. I'm a bit ignorant myself about contracts but I will read about it and see if
I can do anything about it for guile.

So would it be ok, to have Racket's type system ported. The question for me is if we should use the interface or if we should steel the whole shebang of system e.g. the inferential engine as well.

Regards
Stefan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]