From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Some Questions Date: Mon, 29 Mar 2010 11:40:55 +0200 Message-ID: References: <52c42c3e1003242253w40bd6447k48e5a42cc1d33a98@mail.gmail.com> <52c42c3e1003251242g1a39b967pfdf5437b953bf054@mail.gmail.com> <52c42c3e1003282318q3f01f575m7bf45342bf520499@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1269856147 4765 80.91.229.12 (29 Mar 2010 09:49:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 29 Mar 2010 09:49:07 +0000 (UTC) Cc: guile-devel@gnu.org To: Michael Lucy Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Mar 29 11:49:02 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NwBaf-0006V9-Gk for guile-devel@m.gmane.org; Mon, 29 Mar 2010 11:49:02 +0200 Original-Received: from localhost ([127.0.0.1]:48715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwBad-00004u-K5 for guile-devel@m.gmane.org; Mon, 29 Mar 2010 05:49:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwBVS-0006CC-Rz for guile-devel@gnu.org; Mon, 29 Mar 2010 05:43:38 -0400 Original-Received: from [140.186.70.92] (port=36586 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwBVQ-0006B9-EW for guile-devel@gnu.org; Mon, 29 Mar 2010 05:43:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwBVN-0003uW-JQ for guile-devel@gnu.org; Mon, 29 Mar 2010 05:43:35 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:39675 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwBVN-0003ig-Fj for guile-devel@gnu.org; Mon, 29 Mar 2010 05:43:33 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 992D3A6A4B; Mon, 29 Mar 2010 05:42:00 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=/sdwNNvsyR61 6dLkVdJlHmFXZns=; b=yeFcicylZJvJP9MSFIKeFxEOVqJg6yCdz3ydqvn75S5d OMMGPfHBFMKOOKJT/8tU0AaR4MQbOmE+XpsYEE2RvzhBDK5jkcJ4KW1M+UYuB59o LFzUPoDA16aZ9c4w3joB9nHymfcyPQI1CNbxAGdZ8rbt9OYLRV1fprmCuAmTvxc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=QDAtaQ fpkawHmaunhHOoWCivfDSqWyB4H1lfZObZsnKSh4fzWSu/KrZBm7r450s2lTdnx4 9069c0oiu+mInrk6FQHXb2M0NjRlg0xpmuoZB0KIJ6hSNKpdL0guy4iRRJqpW5s5 ZvcX5A0qEf8arz8JK88W3lUnlyi603AUS1eqM= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 86ADDA6A4A; Mon, 29 Mar 2010 05:41:59 -0400 (EDT) Original-Received: from unquote (unknown [83.202.33.142]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 56768A6A49; Mon, 29 Mar 2010 05:41:57 -0400 (EDT) In-Reply-To: <52c42c3e1003282318q3f01f575m7bf45342bf520499@mail.gmail.com> (Michael Lucy's message of "Mon, 29 Mar 2010 00:18:28 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: 52496378-3B17-11DF-90A9-D033EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10107 Archived-At: Hi Michael, On Mon 29 Mar 2010 08:18, Michael Lucy writes: > I'll probably apply to work on Python then. Cool. > 1. How fast would you need it to be? (i.e. am I going to be writing C > code or can I stick with straight Scheme?) Scheme! Depending on how it's compiled, the resulting code probably won't run quite as fast as CPython (though it could in the future) -- due to the need for many calls to go through GOOPS dispatch -- but the speed of the compiler is ~unimportant, because the compiler's output will be cached. > 2. I was thinking of compiling Python into Scheme code, but you > suggest in that link compiling to Tree-IL instead. Could you > elaborate on the logic behind that more? Does it just result in > faster programs? Tree-IL is the right thing IMO, mostly because it allows you keep source location information, but it also allows you to express more precisely what you want to compile to. You don't want to run your compiler's output through the Scheme syntax expander, that's unnecessary. Also tree-il is the right place to hook into Guile's compiler infrastructure.=20 >> Hm, another thought, project-wise: have you heard of parsing expression >> grammars before? Here are a couple links: >> >> =C2=A0 http://en.wikipedia.org/wiki/Parsing_expression_grammar >> =C2=A0 http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html >> >> Writing a good PEG parser library, together with docs and example >> grammars, sounds like about a 1.5-2 month project -- just about right >> for the SOC. >> >> We do have a LALR parser generator; I said something else about it in >> the mail to guile-devel. > > A PEG parser seems like a shorter project than two months, but maybe > writing one that's up to GNU standards would take a while. Would you > prefer this over a python compiler? I'd be up for it; I mostly want > to be writing something intellectually interesting in Scheme. Ah, I should have responded to you before I responded to "No Itisnt"; if you're down for this, let's do it then. I suspect that it's a project that would take 2 months to do *well*: * Compile PEG grammars at syntax time using a macro - into state-machine-like lexically-bound closures - see LPEG VM for example http://www.inf.puc-rio.br/~roberto/docs/peg.pdf - potentially augment Guile's VM with needed instructions * Procedural, LPEG-like interface? - run the compiler at runtime? * PEG grammars as text? - Guile PEG language, parsed by PEG itself? * Benchmarking - LPEG benchmarks would be a good first start * Test suite * Docs * Stream parsing? If you finished the first tasks, figuring out an efficient way to do stream parsing could well take all the rest of the time. (The LPEG paper works on strings.) So if you're down with it, perhaps you can do the PEG stuff, and No Itisnt can work on Lua. There's definitely enough work for everyone :) Hopefully the GOOG comes through with funding. > Anyway, sorry I haven't written for the last 3 days. NP! > You said you wanted to see some code so I wrote some, but I kinda got > caught up in it. I hosted things up at > http://people.cs.uchicago.edu/~mlucy/ if you want to take a look. Wow, that's great stuff! Working code is often a precursor to clean working code, so that's great. > peg.scm is a PEG parser. It works on the things I've tested it on, > but I'd be amazed if there weren't any bugs lurking there. It's also > in need of a serious refactoring--please don't think my finished code > looks like parse-expression. It works but I wouldn't consider it > finished by any standard, I just ran out of time (applications open > tomorrow). Ah right, the GOOG moves quickly. I think it's a great starting point, though we really want it to be a PEG compiler rather than (in addition to?) an interpreter, so I think the LPEG paper should be helpful here. > rvector.scm is a resizable vector library--not terribly useful, but I > wrote it to get familiar with guile before writing peg.scm (and as > evidence that I do, in fact, produce reasonably clean code once the > bugs are ironed out). Nice. I'm impressed that you managed to parse the doc sections on structs, they're quite obtuse. FWIW, it's usually clearer to use a higher-level abstraction, like records, as in srfi-9. And excellent that you found a bug, too. So, let me know what you think about PEG, if you think it's the right size for summer. I think it has great potential, and implementing it well (as a compiler and procedurally) will be of great use. Otherwise we can go ahead with Python, if that's to your liking. Cheers, Andy --=20 http://wingolog.org/