guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile Summer of Code project


From: Ludovic Courtès
Subject: Re: Guile Summer of Code project
Date: Wed, 26 Mar 2008 21:52:27 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hi,

Overall, I concur with what others have already said.  Just adding my
two cents...

Luis Araujo <address@hidden> 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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]