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:06:15 +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 1275385349 18078 80.91.229.12 (1 Jun 2010 09:42:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Jun 2010 09:42:29 +0000 (UTC) Cc: guile-devel@gnu.org To: Noah Lavine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jun 01 11:42:28 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 1OJNzK-0000iN-IL for guile-devel@m.gmane.org; Tue, 01 Jun 2010 11:42:23 +0200 Original-Received: from localhost ([127.0.0.1]:37567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJNzI-0006h2-KH for guile-devel@m.gmane.org; Tue, 01 Jun 2010 05:42:20 -0400 Original-Received: from [140.186.70.92] (port=37121 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJNmr-00064j-I5 for guile-devel@gnu.org; Tue, 01 Jun 2010 05:29:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJNXU-0002ZX-2c for guile-devel@gnu.org; Tue, 01 Jun 2010 05:13:39 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:38799 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJNXT-0002ZT-VT for guile-devel@gnu.org; Tue, 01 Jun 2010 05:13:36 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id DACF1B8052; Tue, 1 Jun 2010 05:13:35 -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=Rl6bZ/QW7XWPox0SEJed7fazjKs=; b=moNRL9 tx9vppQYIk4rsWPA0ftcaklww+57xyoFzor1RJNVIOUHTI/OOBdgF4sWZMnA4ty8 qOZ9E8/ANd9U7Heys42ftlEC8D9OGmkFqFImxBsE9KknaLR90gWKG4AXZMtOmwEy 04fxl9Gi07tWae4eVjvZGcb8UoPUSi0rFC6NE= 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=t6KgmOZbUyukrIrWTLZGbzFcPhpJrjWz xnoC15NUAiqLmvGaqQW+iZMxWUa4pbijV007f9o++6UESaTmg/YMHuOpZpfOe7jU vskzCQMEgEzzqZsInvAO+YgkTXpDCULpFNIQwLtiKDAnxk+wgdPg8Nd9ClCxSb72 vXD8Uhp2iVU= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id C0892B8051; Tue, 1 Jun 2010 05:13:34 -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 F22EBB8050; Tue, 1 Jun 2010 05:13:32 -0400 (EDT) In-Reply-To: (Noah Lavine's message of "Thu, 27 May 2010 17:03:48 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: F4959020-6D5D-11DF-AE4C-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:10406 Archived-At: Hi Noah, On Thu 27 May 2010 23:03, Noah Lavine writes: > I now have a start at working bindings for Lightning, which you can > see at http://github.com/noahl/guile-lightning. Fascinating! Congrats on getting through the foreign function docs; a high-level interface is really necessary there... But very cool to see that you were able to get something working with so little code! > - Second, what would a good interface to a native code generation > system be? (I'm assuming we'll want Lightning available as a regular > module in addition to using it to speed up the language.) My current > prototype just mimics the Lightning API, but it's not necessarily the > best way to do this. Is there a better way? Second question first :) I collected my general thoughts on native code compilation here: http://thread.gmane.org/gmane.lisp.guile.devel/10234 I feel quite strongly that the calling convention for native code should be the same as that of bytecode, and that it should use the same stack. This way we don't have to maintain separate stack walkers or debuggers or the like. Also this way we get proper tail calls and multiple value handling as well. I tend to think that Ludovic's proposal, or something like it, is the most practical means to get a portable JIT compiler going; though I don't really know. In the end though Guile needs to be generating native code ahead-of-time, I think. Doing that portably is hard; we'll need to leverage some other project. I think that project should be GCC. I was talking to Dodji Seketeli the other day, a GCC dev, and he says that GCC maintainers are willing to allow other programs to use it for code generation, but they don't know yet what abstractions they need to provide. So first we should probably implement a native code compiler directly ourselves, for one architecture, and see how that experience changes our internal language barriers and then go to GCC with a set of requirements. (Since I know the question will come up, possibilities are numerous -- basically we want to emit something on the RTL level, I think, though I'm sure there will be much back-and-forth here; and licensing-wise, it might involve a build server (already planned), or a plugin, or a library. It will take a couple years I think.) > - First, would you like Lightning bindings? As I said, I think it's > the fastest way to get some native code generation going, but I don't > think it'll ultimately be the best. At the very least it's an interesting tool to have! Though I do agree though that it's not ideal. > (I can clean up and post my notes on different code generation systems > if you'd like them.) I would be very interested in your observations, yes :) > Thank you > Noah Lavine Thank you! Andy -- http://wingolog.org/