From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Lightning Bindings Date: Thu, 27 May 2010 17:03:48 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1275079460 3448 80.91.229.12 (28 May 2010 20:44:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 28 May 2010 20:44:20 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri May 28 22:44:19 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 1OI6Pi-0006Vg-K5 for guile-devel@m.gmane.org; Fri, 28 May 2010 22:44:18 +0200 Original-Received: from localhost ([127.0.0.1]:37313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OI6Pi-0006Ke-2k for guile-devel@m.gmane.org; Fri, 28 May 2010 16:44:18 -0400 Original-Received: from [140.186.70.92] (port=49101 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHkF7-0008AK-CP for guile-devel@gnu.org; Thu, 27 May 2010 17:03:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHkF5-0007nc-Ti for guile-devel@gnu.org; Thu, 27 May 2010 17:03:53 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:46676) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHkF5-0007nK-Pu for guile-devel@gnu.org; Thu, 27 May 2010 17:03:51 -0400 Original-Received: by iwn39 with SMTP id 39so22610iwn.0 for ; Thu, 27 May 2010 14:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=5k0F6dsDlcDLwLW2SzaL51vzI1jXv+dzQgqSlNDp1AY=; b=PYwZ+aqB/VGya1o0jCxCDGfCkvRueXGcXCmUuciJk/+puCN9BV5USDN9lQMaUtFimF RI8u/HGoBZZvl3La2TDC6xMk/XTbdfCaZ5JGt4eHTrfuPmZY0xCxo5Zf+kPp3MJvH2Bx taKf/wPWvuP3MLLscZfopkjh4I4az1GDTb9G0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=k/oWFG7iJDXEcuzZCS6J5+IOT8jh0dkvptBsBs3arZj2oTGvvcVi2ZOnWGQY9HQ/8H IY/080M2ETCjovkX4w7LNbsalrPwuDtAWCIZggoCufOb607S8rJ+LNeBctuvNwdh72Sl B29juW2G6cJ0hglwkcJSAZZKgwH+sDSp4ovJw= Original-Received: by 10.231.187.29 with SMTP id cu29mr279472ibb.70.1274994228931; Thu, 27 May 2010 14:03:48 -0700 (PDT) Original-Received: by 10.231.32.13 with HTTP; Thu, 27 May 2010 14:03:48 -0700 (PDT) X-Google-Sender-Auth: BcbrTUP7gv1ZGHaJPn2jvleUsAo X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Fri, 28 May 2010 16:44:10 -0400 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:10393 Archived-At: Dear Guile Developers, After watching the discussion of native code generation on this list a few weeks ago, I decided I'd like to help. I looked at several possibilities, but it seemed like the easiest and most sure way of making *something* work was writing bindings to GNU Lightning. I now have a start at working bindings for Lightning, which you can see at http://github.com/noahl/guile-lightning. Currently it can only use a few Lightning instructions, but I have enough to verify that it generates executable code and that code interfaces with Guile. At this point I could fairly easily go through the Lightning manual and add more functions, command-by-command, until I had a complete interface to the Lightning API. My thought was to do enough of the Lightning API that it could call C functions, and then implement a compiler from Guile VM code to native Lightning-generated code that just called a series of VM functions. There wouldn't be any inlining or cool things like that, but it would be a start. You could then add inlining support for individual VM functions as it seemed important. At that point I would also want to wrap the rest of the Lightning API, both so that inlined VM functions could use it and so that other Guile programs could use Lightning like any other module. However, I would like to ask two questions before I do that, to make sure the result is ultimately useful. - 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. (I can clean up and post my notes on different code generation systems if you'd like them.) - 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? Thank you Noah Lavine