From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.user Subject: Re: Anniversary hack: Zile editor with Guile support Date: Mon, 25 Mar 2013 06:24:21 +0000 Message-ID: <87mwtsov3e.fsf@Kagami.home> References: <4CB5C160-9728-4784-ABA1-E8BDFC825990@vaughan.pe> <1363920239.82065.YahooMailNeo@web120405.mail.ne1.yahoo.com> <6AE6C7E8-7B28-40FA-B607-1D46FA52EB80@gnu.org> <8738vkqlar.fsf@Kagami.home> <291AEF3E-DF88-421B-AE2E-8FFAD005A39B@gnu.org> <87y5dcp1ba.fsf@Kagami.home> <2BDCB6D4-B5B0-42D5-B5C8-FD0F2BD1D72A@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1364192684 12134 80.91.229.3 (25 Mar 2013 06:24:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Mar 2013 06:24:44 +0000 (UTC) Cc: Guile User , Zile bugs , Reuben Thomas To: "Gary V. Vaughan" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Mar 25 07:25:10 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UK0qA-00070W-SA for guile-user@m.gmane.org; Mon, 25 Mar 2013 07:25:06 +0100 Original-Received: from localhost ([::1]:54429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK0pn-0003Zm-3b for guile-user@m.gmane.org; Mon, 25 Mar 2013 02:24:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK0pd-0003ZC-TC for guile-user@gnu.org; Mon, 25 Mar 2013 02:24:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UK0pc-0005Ey-RB for guile-user@gnu.org; Mon, 25 Mar 2013 02:24:33 -0400 Original-Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:38749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK0pZ-0005EE-Lh; Mon, 25 Mar 2013 02:24:29 -0400 Original-Received: by mail-wi0-f182.google.com with SMTP id hi18so6207144wib.9 for ; Sun, 24 Mar 2013 23:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:to:cc:subject:references:date:message-id:user-agent :mime-version:content-type; bh=8HyMdEsSW1CY6QwguRWcF9arBxVk6+e+AT5rG3F0CrE=; b=cwFfT6Qa3lzYKOhEctXqkp20bqJvzS8B5xy6v1D4DA1vi28YFq1NagE0igHt0hB25C RD/xkkh3XowfItMGEHp8jOtObwl5g7vt9rNEhKO+ms591eqv7OX1ccDHXF4YjIxLsWIB NoCu5uriUn85/3ZoD8kQ96mCre3WnrmoF+1N+OJvYmd0W6h6pniXzyT4pNqBxc0Qo9eT OYrHBdtV5yUKX0ZNXVBxjfNmsW1JnDnZsrVKlRM9K0WhiT+olnZvT8SKHoNzXR/ZTnCe es/Rf1NNS2O5Zixg5uRsYiw4y7NuFa1X+ERUkMRT87nPmWuBXYTZygUBul3hFj7t/2j5 L1dw== X-Received: by 10.180.37.166 with SMTP id z6mr16300010wij.34.1364192668736; Sun, 24 Mar 2013 23:24:28 -0700 (PDT) Original-Received: from Kagami.home (host81-159-127-140.range81-159.btcentralplus.com. [81.159.127.140]) by mx.google.com with ESMTPS id du2sm25939876wib.0.2013.03.24.23.24.25 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 24 Mar 2013 23:24:27 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::236 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10207 Archived-At: "Gary V. Vaughan" writes: > I think we are misunderstanding one another somewhere :( > > I'm talking about this: > > 1. user writes some Guile Scheme, and feeds it to Lua Zile > 2. Lua Zile runs zlc to translate Guile Scheme to Lua > 3. Lua Zile runs luac to compile output of (2) to Lua bytecodes, and > saves the result to disk > 4. Lua runtime executes file of Lua bytecodes. > > I really don't see how Tree-IL fits in here, or makes loading and executing Guile > Scheme sources from Lua Zile any easier. > > What am I missing? Two observations: 1. The frequent references to Guile Scheme (as opposed to just Scheme) imply that Guile compatibility is desirable. 2. The most compatible Scheme implementation with Guile is, quite obviously, Guile. So, then, my advice is quite simply to maximise the use of Guile, and minimise the use of new code when writing this Guile-Scheme->Lua compiler. Since Guile is written as a hierarchy of translators, you don't need to implement Scheme per se, but can instead implement one of the languages to which we can compile Scheme already, and ask Guile to compile Scheme to that for you. e.g. guild compile foo.scm --to=tree-il --output=foo.tree-il Tree-IL is the "default" option, as it is relatively close to Scheme, but you won't have to deal with things like hygienic macro expansion. However, you can pick whichever one you find easiest to translate to Lua or Lua Bytecode. I actually intend to follow a similar approach with a guile-in-the-browser project I would like to write, however, I am probably going to implement a vm, and have it interpret Guile's assembly language directly. I'm not sure I can be clearer than that. If it wasn't enough, well, just pretend I didn't say anything :) -- Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"