Live data from Hacker News

Lisp in Dart 2.0

github.com

21–22 of 22 posts

Re: Lisp in Dart 2.0

#21

Earlier quoted context omitted.

There are three distinct concepts that are often conflated: 1) The syntactic construct of a tail call. 2) Abstract space efficiency properties that guarantee asymptotic space usage of programs using tail calls. 3) The implementation techniques used to guarantee 2). Even though the implementation techniques of 3) apply to all calls, the space efficiency properties in 2) are asymptotic and thus are only meaningful when…

If so, can a purely functional language require no more than one stack frame?

It depends on what you mean by purely functional, the lambda calculus certainly doesn't require stack frames. Even better, you can implement any programming language without a stack. Stack frames are only a convenience feature for programmers after all (well, and many architectures probably do some hardware optimizations when using the stack related registers for stack things).

Re: Lisp in Dart 2.0

#22
post #19
post #16

Earlier quoted context omitted.

That's co-recursion, rather than strict recursion. It's plausible that a compiler might catch the tail recursion case but ignore non-recursive and co-recursive tail calls. Consider: def even(x, useless, arguments); return x == 0 or odd(abs(x) - 1) def odd(x): return x == 1 or even(abs(x) - 1, 6, 9) There are two more formal parameters to even(), which means the stack frame when calling even from odd() includes two mo…

Do you have a source where co-recursion is used to describe mutual recursion as above? I'm under the impression it refers to a different concept, see e.g. https://softwareengineering.stackexchange.com/questions/1442...

I misused the term, yes: it should be "mutual recursion" not "corecursion", sorry.
Post reply on HN