caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jeff Henrikson" <jehenrik@yahoo.com>
To: "Mark Seaborn" <mrs35@cam.ac.uk>, <caml-list@inria.fr>
Subject: [Caml-list] GCCXML: don't write your own C parser. (WAS: Rewriting UNIX . . .)
Date: Mon, 12 Nov 2001 12:33:47 -0500	[thread overview]
Message-ID: <003701c16ba0$2f562a40$0b01a8c0@mit.edu> (raw)
In-Reply-To: <20011112133937D.mrs35@cam.ac.uk>

> You may be interested in a project I am implementing at the moment:
> The idea is to automatically translate any C program into a
> memory-safe language. . .

You're obviously going to need a parser and I presume you don't want to write one.  Make sure to check out this extenion to GCC
which prints out an XML abstract syntax tree of anything GCC can parse.

http://public.kitware.com/GCC_XML/

Note that this is not _real_ XML, as there is no DTD.  But the file xml.c could be easily hand translated into a recursive set of
variants that would be about 150 lines of caml, along with a simple stream parser could do the task of building the tree.  I'm
going to write such a thing Real Soon Now, as I think it would be especally interestng to do other sorts of C/C++ metalingustic
hacking on account of the vast amount of available code.  (But if you really need it, don't wait for me, as I get busy often)

If anybody reads the GCCXML link and thinks of the most obvious application of stub-code generators for FFI mucking, that's both
why it was written and why I'm playing with GCCXML.  CamlIDL requires too much manual effort; I think the best evidence is
hearing/seeing so many hand written wrappers.  I see no reason for directly handling the raw C code.  I want something like the
SWIG typemap model but cleaner, with an emphasis on not having to edit the original header files.  I went so far as to mostly
implementing a SWIG 1.3.7 module for ocaml, so I see it's strengths and weaknesses.  But SWIG is not probably going to be a correct
or clean program any time soon, so I'd like to clean it up and add some power.  If anybody wants more info I can prodded to write
it down for you.


Jeff Henrikson



-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-11-12 17:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-11  5:17 [Caml-list] Rewriting UNIX in Caml and getting rid of the C disease Berke Durak
2001-11-11  6:11 ` Eric Newhuis
2001-11-11  8:22   ` Tom
2001-11-11 12:47 ` Sven
2001-11-11 13:32 ` Julian Assange
2001-11-12  8:32 ` Jeff Henrikson
2001-11-12 13:39 ` Mark Seaborn
2001-11-12 17:33   ` Jeff Henrikson [this message]
2001-11-13  0:53     ` [Caml-list] GCCXML: don't write your own C parser. (WAS: Rewriting UNIX . . .) Berke Durak
2001-11-13  5:10       ` Julian Assange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003701c16ba0$2f562a40$0b01a8c0@mit.edu' \
    --to=jehenrik@yahoo.com \
    --cc=caml-list@inria.fr \
    --cc=mrs35@cam.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).