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: Lightning Bindings Date: Tue, 01 Jun 2010 11:15:43 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1275385385 18202 80.91.229.12 (1 Jun 2010 09:43:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Jun 2010 09:43:05 +0000 (UTC) Cc: ludo@gnu.org, guile-devel@gnu.org To: Noah Lavine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jun 01 11:43:03 2010 connect(): No such file or directory 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 1OJNzy-0001L0-6P for guile-devel@m.gmane.org; Tue, 01 Jun 2010 11:43:03 +0200 Original-Received: from localhost ([127.0.0.1]:37954 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJNzw-00072R-4E for guile-devel@m.gmane.org; Tue, 01 Jun 2010 05:43:00 -0400 Original-Received: from [140.186.70.92] (port=36800 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJNms-0005mG-Us for guile-devel@gnu.org; Tue, 01 Jun 2010 05:29:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJNXN-0002YM-MV for guile-devel@gnu.org; Tue, 01 Jun 2010 05:13:38 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:38724 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJNXN-0002YH-G0; Tue, 01 Jun 2010 05:13:29 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id AAF5AB804F; Tue, 1 Jun 2010 05:13:28 -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; s=sasl; bh=gobG1l8hVpurPRjXR7sfo/qozl0=; b=Gdci2c zaOKJeoVjNqLYBdZCPJDMZSeIoqH9A8czEWemePV3LOjmT6Qxv1FwCCkyAa4fpVJ oLKGPvQKEuPNw+6HasDcVNk4yJUVmSgftm2RCaSCcBnr6dBd+78nDpunZUgts9lw Lh0dhaDbh+37tbxjkMcHuSyVXSDv0kzw5w+Rk= 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; q=dns; s=sasl; b=eB9RdxNmxCAW2ZgmMSyZnTYKijin2aA5 TRrcZemaOcO3QJY3UyFQzEjMqfdHHkGY0HqGdVD+isIenpOVszOYS1fG9qa1VCHd mVxEA6YNBmmtk70pCLi189HzYccIQiGXLI5f6hwJm/fj6uVXAW+433jpSMf/S9va EBTJxJfeq9o= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 6CC01B804E; Tue, 1 Jun 2010 05:13:26 -0400 (EDT) Original-Received: from unquote (unknown [83.202.33.251]) (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 B0E81B804D; Tue, 1 Jun 2010 05:13:23 -0400 (EDT) In-Reply-To: (Noah Lavine's message of "Mon, 31 May 2010 18:49:42 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: EFA117F6-6D5D-11DF-AEB7-6730EE7EF46B-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:10407 Archived-At: Hi Noah, On Tue 01 Jun 2010 00:49, Noah Lavine writes: > The approach in [Ludovic's] plan for JIT, as I understand it, is to > implement this completely in the C layer. The machine code would be > stored as part of the representation of a procedure, and would be > invisible from the Scheme side. Well, one should always be able to disassemble that code, architectures permitting :) I do think this is the right way to go FWIW, though perhaps we should only JIT existing procedures after they have been called some number of times. There is also the Rubinius strategy of offloading JIT compilation to a separate thread, but that shouldn't be necessary... > As for doing it all in C, I am concerned about this because if there > were bindings available in Scheme, then it might be possible to write a > nice compiler in Scheme someday, which would do clever things like > inlining and interprocedural optimization. I think we'll have this eventually, yes -- but that's at a level above native code generation. This kind of optimization is best done as source-to-source transformations of Tree-IL, IMO. See e.g. Oscar Waddell's thesis. > What do you think of this? What way should I try to implement this? Are you most interested in AOT compilation or JIT compilation? If it's JIT, I would work on something more like Ludovic's solution; if it's AOT compilation, I would see about making a compiler from one of Guile's intermediat languages to a new "lightning" language. See "Compiler Tower" in the manual. Just my opinion anyway :) Cheers, Andy -- http://wingolog.org/