From: Wojciech Meyer <wojciech.meyer@googlemail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Wojciech Meyer <wojciech.meyer@googlemail.com>, emacs-devel@gnu.org
Subject: Re: Compiling Elisp to a native code with a GCC plugin
Date: Tue, 14 Sep 2010 23:37:50 +0100 [thread overview]
Message-ID: <87bp802bpd.fsf@gmail.com> (raw)
In-Reply-To: <m3d3sg3s15.fsf@fleche.redhat.com> (Tom Tromey's message of "Tue, 14 Sep 2010 15:59:50 -0600")
Tom Tromey <tromey@redhat.com> writes:
>>>>>> "Wojciech" == Wojciech Meyer <wojciech.meyer@googlemail.com> writes:
>
> Tom> So, lots of grunge work, just to get the point where you could start
> Tom> actually working on the GC. I would look at automated rewriting to
> Tom> make this work -- that worked out great on the concurrent branch.
>
> Wojciech> Maybe that work should be actually done even without thinking
> Wojciech> currently about GC. AFAIR MT Emacs rewriting was in Elisp,
> Wojciech> ideally maybe using GCC would be better at some point.
>
> You would have to hack GCC a little bit, because most of the code
> locations you want to change arise from macro expansion, and GCC does
> not keep all that information. (Though there's a WIP patch for this.)
Yes, I am aware about impreciseness of this. Currently I may not think
about this for some other unrelated reasons as well...
>
> Maybe it could be done more simply using a simple parser in elisp that
> recognizes just the needed forms. Or maybe something based on clang.
>
> This would get you most of the way there, though there are still some
> bad things you have to fix up by hand.
>
>
> For the concurrency stuff, we did two kinds of automated rewriting.
If you could point me out with the tools you used for this job, I would
be grateful, any points to git?
>
> One was just pure elisp that searched the .c for DEFVAR_LISP and then
> made various changes.
>
> The other one modified the source (in a compile-breaking way), then ran
> the compiler, then visited each error to perform a rewrite. This
> approach might also work for the GC problem, I am not certain.
That is clever and cheap to do, and it is worth to try (and it looks a
bit like humans do re-factoring). However clang error messages are
currently are more precise than GCC (yes, we can match-replace regex,
and it will work fine in most cases).
>
> These scripts are both in src/ on the concurrency branch.
>
> One problem with any compiler-based approach is that it only works on
> the sources it sees. That is, the not-taken #if branches won't get
> rewritten. This argues for trying some kind of custom parser.
Yes, this is a major problem, different configurations, different
systems, and you are never sure if it will not break something, on some
machine (assuming that the changes are required to generate correct code).
>
> Another problem we ran into is that this approach doesn't work if the
> problem code itself appears in a macro. There were a few spots that we
> had to fix by hand -- no big deal, the automation is still worthwhile
> even if it only does 85% of the work.
Definitely it is worthwhile, however I need to know what to rewrite at
first...
>
>
> My advice is to try to do this bulk rewriting work on head, so that it
> doesn't rot. I think that's been a problem for the concurrency work
> :-(
Any chances to get it back to life? It would be nice to push it back...
If you would like to get it back, I would volunteer with any help.
If the maintainers are happy to accept patches with incremental
improvements then it is OK, however I still think in terms `I want - but
it will be hard and even nobody started it before'. If there will be any
progress on this I will just let everybody know. (anyway starting such
project is even OK for just *learning* about internals).
Shall we setup a public repo somewhere then?
I can commit there my generational gc as a sub-module, straight away.
(however it is not the best starting point, as was said).
>
> Tom
Thanks,
Wojciech
next prev parent reply other threads:[~2010-09-14 22:37 UTC|newest]
Thread overview: 97+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-14 19:12 Compiling Elisp to a native code with a GCC plugin Wojciech Meyer
2010-09-14 19:32 ` Tom Tromey
2010-09-14 19:45 ` Wojciech Meyer
2010-09-14 20:17 ` Lars Magne Ingebrigtsen
2010-09-14 20:52 ` Wojciech Meyer
2010-09-14 20:55 ` Tom Tromey
2010-09-14 21:05 ` Wojciech Meyer
2010-09-14 20:44 ` Tom Tromey
2010-09-14 21:00 ` Wojciech Meyer
2010-09-14 21:16 ` Tom Tromey
2010-09-14 21:29 ` Wojciech Meyer
2010-09-14 21:59 ` Tom Tromey
2010-09-14 22:37 ` Wojciech Meyer [this message]
2010-09-14 22:55 ` Tom Tromey
2010-09-14 23:33 ` Wojciech Meyer
2010-09-15 1:38 ` Tom Tromey
2010-09-14 22:49 ` Wojciech Meyer
2010-09-14 23:13 ` Thomas Lord
2010-09-14 23:42 ` Wojciech Meyer
2010-09-15 10:47 ` Leo
2010-09-15 11:41 ` Andreas Schwab
2010-09-15 12:10 ` Wojciech Meyer
2010-09-15 14:07 ` Stefan Monnier
2010-09-15 14:27 ` Helmut Eller
2010-09-15 14:59 ` Stefan Monnier
2010-09-15 15:09 ` Lars Magne Ingebrigtsen
2010-09-15 15:31 ` Andreas Schwab
2010-09-15 15:35 ` Lars Magne Ingebrigtsen
2010-09-15 16:28 ` Andreas Schwab
2010-09-16 16:57 ` Lars Magne Ingebrigtsen
2010-09-15 15:42 ` Stefan Monnier
2010-09-15 15:51 ` Lars Magne Ingebrigtsen
2010-09-15 15:57 ` Leo
2010-09-15 16:01 ` Lars Magne Ingebrigtsen
2010-09-15 16:05 ` David Kastrup
2010-09-15 16:23 ` Leo
2010-09-15 16:37 ` David Kastrup
2010-09-16 16:58 ` Lars Magne Ingebrigtsen
2010-09-16 21:11 ` Andreas Schwab
2010-09-16 23:17 ` Lars Magne Ingebrigtsen
2010-09-17 8:13 ` Eli Zaretskii
2010-09-17 13:17 ` Lars Magne Ingebrigtsen
2010-09-17 13:30 ` Eli Zaretskii
2010-09-17 13:34 ` Lars Magne Ingebrigtsen
2010-09-16 17:35 ` Lars Magne Ingebrigtsen
2010-09-16 2:57 ` Stephen J. Turnbull
2010-09-16 6:54 ` David Kastrup
2010-09-16 8:10 ` Stephen J. Turnbull
2010-09-16 8:31 ` David Kastrup
2010-09-16 17:01 ` Lars Magne Ingebrigtsen
2010-09-17 6:52 ` Stephen J. Turnbull
2010-09-17 13:09 ` Lars Magne Ingebrigtsen
2010-09-17 13:31 ` David Kastrup
2010-09-17 13:39 ` Lars Magne Ingebrigtsen
2010-09-17 13:55 ` David Kastrup
2010-09-17 14:18 ` Lars Magne Ingebrigtsen
2010-09-17 14:57 ` David Kastrup
2010-09-17 15:06 ` Lars Magne Ingebrigtsen
2010-09-17 15:24 ` Lars Magne Ingebrigtsen
2010-09-17 16:11 ` Eli Zaretskii
2010-09-17 16:33 ` David Kastrup
2010-09-17 16:41 ` Andreas Schwab
2010-09-17 17:17 ` David Kastrup
2010-09-17 18:24 ` David Kastrup
2010-09-17 20:30 ` David Kastrup
2010-09-17 20:49 ` Lars Magne Ingebrigtsen
2010-09-18 4:31 ` David Kastrup
2010-09-17 18:53 ` Stephen J. Turnbull
2010-09-17 20:57 ` Eli Zaretskii
2010-09-18 14:19 ` Stephen J. Turnbull
2010-09-18 15:46 ` Eli Zaretskii
2010-09-18 15:58 ` Stefan Monnier
2010-09-17 17:24 ` Lars Magne Ingebrigtsen
2010-09-17 16:11 ` David Kastrup
2010-09-17 16:18 ` Eli Zaretskii
2010-09-17 16:24 ` Lars Magne Ingebrigtsen
2010-09-17 16:39 ` Eli Zaretskii
2010-09-17 17:30 ` Lars Magne Ingebrigtsen
2010-09-17 18:49 ` Eli Zaretskii
2010-09-17 16:39 ` Eli Zaretskii
2010-09-17 13:49 ` Andreas Schwab
2010-09-17 13:55 ` Lars Magne Ingebrigtsen
2010-09-17 14:31 ` Wojciech Meyer
2010-09-17 14:40 ` Andreas Schwab
2010-09-17 14:47 ` Lars Magne Ingebrigtsen
2010-09-17 15:10 ` Andreas Schwab
2010-09-17 15:16 ` Lars Magne Ingebrigtsen
2010-09-17 15:39 ` Andreas Schwab
2010-09-17 15:42 ` Lars Magne Ingebrigtsen
2010-09-17 16:04 ` Andreas Schwab
2010-09-17 16:14 ` Eli Zaretskii
2010-09-17 19:22 ` James Cloos
2010-09-17 17:40 ` Stephen J. Turnbull
2010-09-17 19:40 ` Lars Magne Ingebrigtsen
2010-09-15 15:46 ` Helmut Eller
2010-09-15 16:28 ` Thomas Lord
2010-09-15 21:04 ` Leo
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=87bp802bpd.fsf@gmail.com \
--to=wojciech.meyer@googlemail.com \
--cc=emacs-devel@gnu.org \
--cc=tromey@redhat.com \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.