Re: [VM] Tail recursion and multiple values

2009-03-04 Thread Clinton Ebadi
l...@gnu.org (Ludovic Courtès) writes: Hello, Andy Wingo wi...@pobox.com writes: The compiler is almost to the point that it can replace the interpreter, semantically. What is needed is to read and compile toplevel definitions one at a time, so we can e.g. change the reader, or the other

Re: [VM] Tail recursion and multiple values

2009-03-03 Thread Ludovic Courtès
Hello, Andy Wingo wi...@pobox.com writes: The compiler is almost to the point that it can replace the interpreter, semantically. What is needed is to read and compile toplevel definitions one at a time, so we can e.g. change the reader, or the other dynamic things that people expect. Then if

Re: [VM] Tail recursion and multiple values

2009-03-02 Thread Andy Wingo
Heya, On Mon 02 Mar 2009 00:48, l...@gnu.org (Ludovic Courtès) writes: 1) It is expected that you don't have tail recursion between interpreted and VM code. 2) This particular problem manifests itself in that call-with-values is VM code (when r5rs.scm is compiled). (The

Re: [VM] Tail recursion and multiple values

2009-03-02 Thread Ludovic Courtès
Hello! Andy Wingo wi...@pobox.com writes: On Mon 02 Mar 2009 00:48, l...@gnu.org (Ludovic Courtès) writes: As for (1), I'm unsure. The issue is that as long as running code with the interpreter is the default, people may hit this kind of problem, which is, well, problematic. Now, I have

Re: [VM] Tail recursion and multiple values

2009-03-02 Thread Andy Wingo
Howdy howdy, On Mon 02 Mar 2009 22:55, l...@gnu.org (Ludovic Courtès) writes: Andy Wingo wi...@pobox.com writes: The compiler recognizes both call-with-values and @call-with-values, so we could just not compile call-with-values; less nasty, but still nasty, and penalizes the vm in the

Re: [VM] Tail recursion and multiple values

2009-03-02 Thread Andreas Rottmann
Andy Wingo wi...@pobox.com writes: I understand. I wish that we lived in a world in which (timewise) compilation + running == interpretation, so we could just do the former, but that is not yet our world. However both Chez and SBCL have the former model, so in a software engineering sense it

Re: [VM] Tail recursion and multiple values

2009-03-01 Thread Andy Wingo
Hey Ludo! On Sat 28 Feb 2009 15:45, l...@gnu.org (Ludovic Courtès) writes: l...@gnu.org (Ludovic Courtès) writes: Use of multiple values breaks tail recursion in VM-compiled code: (let loop ((x 100)) (and ( x 0) (call-with-values (lambda

Re: [VM] Tail recursion and multiple values

2009-03-01 Thread Ludovic Courtès
Hello! Andy Wingo wi...@pobox.com writes: On Sat 28 Feb 2009 15:45, l...@gnu.org (Ludovic Courtès) writes: Actually no: it works with VM-compiled code, but it breaks when using Guile-VM with `,o interp #t' (which appears to be the default, except at the REPL). This is a misunderstanding.

[VM] Tail recursion and multiple values

2009-02-28 Thread Ludovic Courtès
Hello! Use of multiple values breaks tail recursion in VM-compiled code: (let loop ((x 100)) (and ( x 0) (call-with-values (lambda () (values (1+ x) (1- x))) (lambda (next prev) (loop prev) This example yields a stack

Re: [VM] Tail recursion and multiple values

2009-02-28 Thread Ludovic Courtès
l...@gnu.org (Ludovic Courtès) writes: Use of multiple values breaks tail recursion in VM-compiled code: (let loop ((x 100)) (and ( x 0) (call-with-values (lambda () (values (1+ x) (1- x))) (lambda (next prev) (loop