From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jonathan Bartlett Newsgroups: gmane.lisp.guile.devel Subject: Re: What is Guile? Date: Mon, 8 Sep 2003 14:39:12 -0700 (PDT) Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1063061827 32264 80.91.224.253 (8 Sep 2003 22:57:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Sep 2003 22:57:07 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Sep 09 00:57:04 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19wUwR-0003yy-00 for ; Tue, 09 Sep 2003 00:57:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19wUw0-00019p-WA for guile-devel@m.gmane.org; Mon, 08 Sep 2003 18:56:37 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 19wTrH-0005m5-2c for guile-devel@gnu.org; Mon, 08 Sep 2003 17:47:39 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 19wTr9-0005jh-Rl for guile-devel@gnu.org; Mon, 08 Sep 2003 17:47:34 -0400 Original-Received: from [204.122.16.48] (helo=mx1.eskimo.com) by monty-python.gnu.org with esmtp (Exim 4.22) id 19wTjo-0003Z2-JI for guile-devel@gnu.org; Mon, 08 Sep 2003 17:39:57 -0400 Original-Received: from eskimo.com (johnnyb@eskimo.com [204.122.16.13]) by mx1.eskimo.com (8.9.3/8.8.8) with ESMTP id OAA01564; Mon, 8 Sep 2003 14:39:13 -0700 Original-Received: from localhost (johnnyb@localhost) by eskimo.com (8.9.1a/8.9.1) with ESMTP id OAA02930; Mon, 8 Sep 2003 14:39:12 -0700 (PDT) X-Authentication-Warning: eskimo.com: johnnyb owned process doing -bs Original-To: Thamer Al-Harbash In-Reply-To: X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2769 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2769 > I haven't seen much documentation suggesting why guile can > support other languages better. Has someone written such a > document? It would go a long way to getting the author of a new > language to implement his language's interpreter or compiler > ontop of guile. The idea comes from Scheme itself - it doesn't really have a syntax. It's just a raw parse tree with some primitives. Using a combination of function definitions, macro definitions, etc., you can easily modify scheme to work like any system you want. Then you just need a parser to convert the raw code into a parse tree, and have your scheme interpretter run your parse tree. Basically, what you would need is the following: a) a flag in Guile so that you could specify which parser / language module to use b) the ability to create both macros and definitions within a closed environment which can be applied to a list (i.e. parse tree - I believe this is already there) c) an interface definition for parsers and language providers. Basically, the parser would need to be given an environment for a language, parse the string or input file to a list, and eval that list within the environment it was passed. For examples of Scheme used as a syntaxless representation of multiple languages, see Kamin's "Programming Languages: An INterpretter-Based Approach" and "Essentials of Programming Languages". Now, Kamin had to embed the code for the different languages in the interpretter itself, but this is doable from scheme itself with macros. Jon _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel