emacs-devel
[Top][All Lists]
Advanced

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

Re: Compiling Elisp to a native code with a GCC plugin


From: Wojciech Meyer
Subject: Re: Compiling Elisp to a native code with a GCC plugin
Date: Wed, 15 Sep 2010 00:42:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50

Thomas Lord <address@hidden> writes:

> Years ago - not for GC but for managing critical
> sections wherein interrupts had to be deferred - 
> we did something similar in a fork of GNU Guile.
>
> In that case, semi-automated ad-hoc rewriting was
> used a tiny bit but the most helpful thing turned
> out to be:
>
> a) rip a C grammar out of GCC (unless we used a 
> different source, I forget).

GCC has a hand written recursive descent parser, so probably I would
need to use some other one (I do have one I think somewhere ;) )
And also macro definitions might be harder to handle.

>
> b) hack the actions to hook up to a scheme (or
> other lisp) run-time system and build an AST
> as a big S-EXP.  Make sure this AST records source
> files and line numbers.

We could get those from Clang XML output (I hope), and transform it with
xsltproc even to Sexp for easy loading.

>
> c) write ad-hoc cheapo static analysis tools to 
> walk the AST and find places where either it was
> obvious fixes were needed, or where it was not obvious
> fixes were not needed --- print those out like compiler
> error messages.
>
> d) Interactively page through those and, as you watch
> each case, apply the ad hoc semi-automated rewrite tools
> (or do it by hand in hard cases).
>
> Step (d) can go very, very fast and, at least in that
> case, steps (a .. c) can go a lot faster than
> you might guess at first glance.
>

Sounds straightforward to me.
Thanks for the tips.

But the worst thing, I still don't know what I will be rewriting! That's
the major problem here. (but I am willing to help improving existing
code base once i got to that point..).

> -t

Wojciech



reply via email to

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