Re: Compiler Branch

2011-12-13 Thread Andy Wingo
On Tue 13 Dec 2011 05:39, Noah Lavine noah.b.lav...@gmail.com writes: Following up on my last email, I am nervously announcing a new branch, 'wip-compiler'. I hope that in a few months this branch will contain a working compiler. For now, it contains a few new data structures and a function

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Mon 12 Dec 2011 19:29, Mark H Weaver m...@netris.org writes: You are using Guile in a very unusual way. You have constructed a hybrid language of both Scheme and Lilypond, where each can be nested within the other (so far so good), but -- and here's the

What's the point to keep mmaped objectfile opened?

2011-12-13 Thread rixed
I'm a little worried by the amount of file descriptors left opened after the objcode is mmaped. I saw this note to self from objcodes.c: /* FIXME: we leak ourselves and the file descriptor. but then again so does dlopen(). */ So apparently the author was well aware of

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: Did you see my implementation of `local-eval' [1]? It leverages (hah!) Guile's macro expander, but otherwise is a straightforward interpreter. If you find it slow, there are some simple, classic optimizations that can be made. With some work, it could

Re: What's the point to keep mmaped objectfile opened?

2011-12-13 Thread Andy Wingo
On Tue 13 Dec 2011 11:15, ri...@happyleptic.org writes: I'm a little worried by the amount of file descriptors left opened after the objcode is mmaped. I saw this note to self from objcodes.c: /* FIXME: we leak ourselves and the file descriptor. but then again so does

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread Andy Wingo
On Tue 13 Dec 2011 10:02, David Kastrup d...@gnu.org writes: Lilypond's input language is not David's current strategy. I was referring to your implementation strategy. Mark describes another implementation strategy. It does not help because it requires _advance_ knowledge of when you are

Re: What's the point to keep mmaped objectfile opened?

2011-12-13 Thread rixed
-[ Tue, Dec 13, 2011 at 01:42:35PM +0100, Andy Wingo ] If you close the fd, isn't the memory unmapped? Isn't that a bad thing? Maybe I was just under a big misconception here :) That's a common misconception. The mapping of VM space to disk storage is unrelated to the file descriptor set

Re: Compiler Branch

2011-12-13 Thread Noah Lavine
Cool.  As a quick reaction, I have some doubts about this project.  But, I guess a WIP branch would be a good thing to have, and it would make the discussion more concrete. Probably so. But if you have time, what are your doubts? I would much rather talk about problems now than after I've

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Tue 13 Dec 2011 10:02, David Kastrup d...@gnu.org writes: Lilypond's input language is not David's current strategy. I was referring to your implementation strategy. It's not a strategy. Merely the least painful way to do things at a given point of

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread Andy Wingo
Hello David, Let us focus on solutions. If the this realm does have a coin, it is good-will. All participants start with ample deposits, but yours is draining fast. Please listen to what people are saying; they are trying to help you. Specifically: On Tue 13 Dec 2011 14:56, David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: Hello David, Let us focus on solutions. If the this realm does have a coin, it is good-will. All participants start with ample deposits, but yours is draining fast. Please listen to what people are saying; they are trying to help you. Lilypond already

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread Andy Wingo
On Tue 13 Dec 2011 16:27, David Kastrup d...@gnu.org writes: It sounds like `current-bindings' is the thing you need. It will at least be a year before any solution that does not work with Guile 1.8 will be accepted into Lilypond. It is possible to have similar interfaces with different

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
David Kastrup d...@gnu.org writes: So I don't think that throwing out _distinguishing_ selling points of Guile is necessarily doing you a favor. And the transparency with which it integrates with its language environment and the fact that one can continue to use its evaluator and debugger

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Tue 13 Dec 2011 16:27, David Kastrup d...@gnu.org writes: It sounds like `current-bindings' is the thing you need. It will at least be a year before any solution that does not work with Guile 1.8 will be accepted into Lilypond. It is possible to have

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread Andy Wingo
On Tue 13 Dec 2011 17:08, David Kastrup d...@gnu.org writes: The current implementation wraps scraps of code into (lambda () ...) and executes them on-demand. So the expectation is that embedded Scheme code can have side-effects on the lexical environment like with (let ((xxx 2)) #{

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Tue 13 Dec 2011 17:08, David Kastrup d...@gnu.org writes: The current implementation wraps scraps of code into (lambda () ...) and executes them on-demand. So the expectation is that embedded Scheme code can have side-effects on the lexical environment

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread Mark H Weaver
Hi Andy, Andy Wingo wi...@pobox.com writes: Am I missing something? It has been a long thread :) In case you haven't carefully read my earlier thread with David, I wanted to briefly explain the difficulties as I understand them, from a Schemer's perspective. If I have misunderstood something,

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread Andy Wingo
On Tue 13 Dec 2011 17:54, David Kastrup d...@gnu.org writes: Am I missing something? Performance, space, simplicity, robustness. Compiling five closures that do nothing except accessing a single variable each is a bit wasteful. Sure. Let me see if I finally understand the issue here: You

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread Mark H Weaver
Andy Wingo wi...@pobox.com writes: On Tue 13 Dec 2011 18:28, Mark H Weaver m...@netris.org writes: (let ((xxx 2)) #{ #(set! xxx (1+ xxx)) #}) In the general case, Lilypond needs to _execute_ the outer Scheme code before the parser/evaluator is able to even _see_ the inner Scheme code,

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Tue 13 Dec 2011 17:54, David Kastrup d...@gnu.org writes: Am I missing something? Performance, space, simplicity, robustness. Compiling five closures that do nothing except accessing a single variable each is a bit wasteful. Sure. Let me see if I

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread Noah Lavine
Hello, I haven't really been contributing to this thread, so please take my opinion with a grain of salt. But it does appear to me that we should support capturing a lexical environment, as Mark and David describe. So I took a look at ice-9/eval.scm to see how difficult it would be to implement.

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Noah Lavine noah.b.lav...@gmail.com writes: Hello, I haven't really been contributing to this thread, so please take my opinion with a grain of salt. But it does appear to me that we should support capturing a lexical environment, as Mark and David describe. So I took a look at

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Wed 14 Dec 2011 00:00, Noah Lavine noah.b.lav...@gmail.com writes: I haven't really been contributing to this thread, so please take my opinion with a grain of salt. But it does appear to me that we should support capturing a lexical environment, as Mark