From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: Guile Summer of Code project Date: Wed, 26 Mar 2008 21:52:27 +0100 Message-ID: <87y785tdh0.fsf@gnu.org> References: <47E238A8.5010704@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1206564859 17115 80.91.229.12 (26 Mar 2008 20:54:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Mar 2008 20:54:19 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Mar 26 21:54:46 2008 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.50) id 1Jeccp-00058d-0e for guile-devel@m.gmane.org; Wed, 26 Mar 2008 21:53:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JeccD-0002VO-HM for guile-devel@m.gmane.org; Wed, 26 Mar 2008 16:52:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JeccB-0002V9-Ne for guile-devel@gnu.org; Wed, 26 Mar 2008 16:52:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JeccA-0002Uu-4V for guile-devel@gnu.org; Wed, 26 Mar 2008 16:52:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jecc9-0002Ur-Vc for guile-devel@gnu.org; Wed, 26 Mar 2008 16:52:54 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jecc9-0005SO-Co for guile-devel@gnu.org; Wed, 26 Mar 2008 16:52:53 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Jecc0-0006Ri-BQ for guile-devel@gnu.org; Wed, 26 Mar 2008 20:52:44 +0000 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 26 Mar 2008 20:52:44 +0000 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 26 Mar 2008 20:52:44 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 66 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-Revolutionary-Date: 7 Germinal an 216 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: i686-pc-linux-gnu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:aBUfc5a/abxZucEuY3bh4Qm0PFo= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:7099 Archived-At: Hi, Overall, I concur with what others have already said. Just adding my two cents... Luis Araujo writes: > -- What is GCP? > > GCP as its name stands, it is a parser for ANSI C code written on Scheme > to be included into Guile. > > The main idea is to represent in a structured and modular way all the components > of a C source file into Guile. > > This tool would allow to easily parser C headers files and generate > automatically Guile interfaces for their libraries among other things. Obviously, a parser alone is not going to help much towards this goal: interfacing Scheme code with C libraries is a job on its own (see G-Wrap, Swig, etc.), and parsing headers to help automate things is probably an optional part of such tools (G-Wrap does not support it at all whereas Swig relies on it---the downside is that Swig-generated bindings usually have to be hand-tweaked to provide a nicer Scheme API). > c-parser.scm: Surely, you would want to use `lalr-scm' [0], which is available in Guile-Lib [1] for that purpose. > c-lexer.scm: Likewise, SILex [2] would allow you to generate the lexer, in a way similar to Flex. > -- Community benefits. > > Scheme is a small programming language , with a very loyal community > who has been able to deploy Scheme through many fields. > > Guile is a particular Scheme project intended to make available such a > language as an embeddable library into other applications, mainly > coded on C. > > Therefore, being able to parse and access C code from Scheme/Guile itself, > and handling such a code like any other Scheme object would clearly > benefit the community opening many new possibilities. > > For example, creating Guile bindings through a foreign function generator > using the parser on headers for popular C libraries and applications > would be plain easy. Again, I'm not convinced that such a tool would suffice to make FFI generation "plain easy". Besides, others have already pointed out similar projects/tools such as `eval-c'. While apparently somewhat different, the (old) `ctax' project [3] might also be of interest. Thanks, Ludovic. [0] http://www.iro.umontreal.ca/~boucherd/Lalr/documentation/lalr.html [1] http://home.gna.org/guile-lib/doc/ref/text.parse-lalr/ [2] http://www.iro.umontreal.ca/~dube/ [3] http://cvs.savannah.gnu.org/viewvc/guile/guile/guile-rgx-ctax/