1 Nov 2004 02:46
Re: [stack] Some notes on stack effect inference
John Carter <john.carter <at> tait.co.nz>
2004-11-01 01:46:45 GMT
2004-11-01 01:46:45 GMT
On Thu, 28 Oct 2004, Slava Pestov wrote: > http://www.jroller.com/page/slava/20041028#type_inference Ah, I see you fairly rapidly hit that brick wall that all the concatenative languages I have seen so far hit.... Conditional Stack Effects. How do you infer past an "if" statement. The "then" branch can do arbitarily nastily different things to the stack compare to the "else" branch. So what is the 'net stack effect? It gets really messy. Yet compare that to more traditional lambda calculus / call / function environment. All stack effects get rolled up and undone as soon as you as you hit return. Much simpler to analyze. A Lambda calcalus _always_ has a simply functional mapping of [input1, input2, input3,...] => [single output value] Is this a hard trade off? Stack languages are easier than lambda calculus to analyze in that argument binding is not present, but harder to analyze the the return values. One fix may be a stack language where the compiler enforces that(Continue reading)
RSS Feed