From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luis Araujo Newsgroups: gmane.lisp.guile.devel Subject: Guile Summer of Code project Date: Thu, 20 Mar 2008 06:12:56 -0400 Message-ID: <47E238A8.5010704@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090806030804060501090108" X-Trace: ger.gmane.org 1206010492 1388 80.91.229.12 (20 Mar 2008 10:54:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Mar 2008 10:54:52 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Mar 20 11:55:21 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 1JcIQY-0002kS-I0 for guile-devel@m.gmane.org; Thu, 20 Mar 2008 11:55:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JcIPy-00089T-C5 for guile-devel@m.gmane.org; Thu, 20 Mar 2008 06:54:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JcIPb-0007sE-HJ for guile-devel@gnu.org; Thu, 20 Mar 2008 06:54:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JcIPa-0007r7-Eb for guile-devel@gnu.org; Thu, 20 Mar 2008 06:54:18 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JcIPa-0007qr-5G for guile-devel@gnu.org; Thu, 20 Mar 2008 06:54:18 -0400 Original-Received: from rs25s9.datacenter.cha.cantv.net ([200.44.33.15]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JcIPZ-0007gR-HC for guile-devel@gnu.org; Thu, 20 Mar 2008 06:54:17 -0400 X-DNSBL-MILTER: Passed Original-Received: from localhost (dBE25A8E9.dslam-01-3-15-01-1-01.smg.dsl.cantv.net [190.37.168.233]) by rs25s9.datacenter.cha.cantv.net (8.13.8/8.13.0/3.0) with ESMTP id m2KAsGY0020899 for ; Thu, 20 Mar 2008 06:24:16 -0430 X-Matched-Lists: [] Original-Received: from localhost ([127.0.0.1]) by localhost with esmtp (Exim 4.69) (envelope-from ) id 1JcHlZ-0000Tl-0A for guile-devel@gnu.org; Thu, 20 Mar 2008 06:12:57 -0400 User-Agent: Thunderbird 2.0.0.12 (X11/20080305) X-Virus-Scanned: ClamAV version 0.92.1, clamav-milter version 0.92.1 on 10.128.1.88 X-Virus-Status: Clean X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:7085 Archived-At: This is a multi-part message in MIME format. --------------090806030804060501090108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello everyone , how are you? Considering that the GNU project is participating on the google summer of code of this year, I am wondering if we could probably get a nice Guile/Scheme project onto it. Here I send a brief and general proposal about my project, a Guile C Parser. A parser written on Scheme hooked up into Guile for parsing C files. As I said, it is a very brief proposal, so, many implementations details would still need to be figured out or might change on the road, but I think it is detailed enough as to show what I am after with it. Please let me know if you are interested on further information, Thanks and Regards, --------------090806030804060501090108 Content-Type: text/plain; name="GCP_guile.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="GCP_guile.txt" -- Title: Guile C Parser (GCP) -- 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. -- Design and Development My initial idea is to give an object representation of a C source code file from Guile, and implement from there on, functions and data types , probably using GOOPS for many of this representation for easy handling of the C code from Guile itself. Briefly and general explained the project will consist initially of the following Scheme modules: c-parser.scm: This module contains the main Scheme procedures for parsing C code. It should be an easy interface from the user point of view, though very powerful in the other hand, because it will implement the core parsing operations. For example, we can have a main entry function for the whole parser called: (define (parser-c ) ...) This function would take a single string value containing a proper C code program or file and will be the responsible of building the complete AST for the code returning either a: a - GCP data structure. Something like an abstract syntax tree wrapped around data structures to ease handle (we could probably use GOOPS here). b - An error message or structure spepcifying failure of parsing. We could also include in this module handy things like for example, different parsing modes for a C standard or language extension. c-lexer.scm: This module could be included in certain extent into c-parser.scm , nevertheless , considering the nature of the project and given the representation I want to give to each components , I will probably have to implement a lexer offering some kind of object representation for tokens, so it probably make it worthy to have it in a different file. It will contain also a main entry function like: (define (lexer-c ) ...) Taking a string of proper C code, and returning lexems probably wrapped in somekind of data types. It could also return a lexical error. This function and module could be also used standalone , but practically will be invoked from c-parser.scm through parse-c. c-syntax.scm: This module will contain the whole ANSI C code abstract syntax described and represented in terms of Scheme structures. For example, we can have here defined objects for the different C statements (if, while ..) , the different structures (struct , enum ...). It will also be the module containing a representation of all the available standard ANSI types. In general, this module will offer the mapping between the C syntax and its Scheme equivalent, among the necessary data structures (abstract data types/objects) to be handled by the rest of the modules. c-pretty.scm: This module will contain the fuctions to 'pretty print' output of the parser and lexer. It might also contain functions for proper visulation of the data structures of the syntax representation on Scheme. c-misc.scm: It will contain extra functions and objects. For example, we can add here routines to extend the parser, like parser-c that instead of taking a string value would take a whole file or C program directory, it can also containg Guile-specific extensions. -- Timeline: Considering the previous brief and general description of this project, I will take a schedule similar to the following: - I would start designing the c-syntax.scm module, this could take big part of the time , probably around 3 weeks, and it should be in my opinion the first module, since it will contain the main design desicions affecting the rest of the modules operations. All the data structures handled by the rest of the program will be described and implemented here. - In 2 weeks could be greatly implemented the whole lexer. - The parser will be the more complex and time consuming task. I expect that its development takes at least 1 month and a half. - The modules c-pretty and c-misc , depending of the needs could take longer than expected, but something basic and usable accomplishing their main functions could be done in around 3 weeks. After this time, we should be able to have a very usable parser and framework, that we can hook into Guile and start using very straight-forward. -- Technical details: I would fully implement this code using latest 1.8 Guile version (by the time of this writing 1.8.4). -- 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. This project can also greatly help with the internals, analyzing and checking proper C code using Guile. --------------090806030804060501090108--