From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wojciech Meyer Newsgroups: gmane.emacs.devel Subject: Re: Compiling Elisp to a native code with a GCC plugin Date: Wed, 15 Sep 2010 00:42:37 +0100 Message-ID: <87hbhr28pe.fsf@gmail.com> References: <87bp805ecr.fsf@gmail.com> <874ods5ctf.fsf@gmail.com> <877hio3urh.fsf@gmail.com> <1284506033.2446.11.camel@dell-desktop.example.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1284507813 13106 80.91.229.12 (14 Sep 2010 23:43:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 14 Sep 2010 23:43:33 +0000 (UTC) Cc: Tom Tromey , Wojciech Meyer , emacs-devel@gnu.org To: Thomas Lord Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 15 01:43:31 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ovf9v-0003vu-0a for ged-emacs-devel@m.gmane.org; Wed, 15 Sep 2010 01:43:31 +0200 Original-Received: from localhost ([127.0.0.1]:48703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ovf9u-0003Zy-8l for ged-emacs-devel@m.gmane.org; Tue, 14 Sep 2010 19:43:30 -0400 Original-Received: from [140.186.70.92] (port=53810 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ovf9m-0003Zs-IA for emacs-devel@gnu.org; Tue, 14 Sep 2010 19:43:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ovf9k-0007mP-UE for emacs-devel@gnu.org; Tue, 14 Sep 2010 19:43:22 -0400 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:50137) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ovf9k-0007mJ-Oz for emacs-devel@gnu.org; Tue, 14 Sep 2010 19:43:20 -0400 Original-Received: by wwb24 with SMTP id 24so8809314wwb.30 for ; Tue, 14 Sep 2010 16:43:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=QiuBYByIF+uqReMbLgfJxYsmFsJ3Yn3tRY5rRcy+P7k=; b=E43dN8//ZFgNmKpQeUJKB/JG8ccoiT7DkI8MyFXm4iggFq9OSSmcXy+CxL9ep2pkjq tTT1VPWk6ghVF2+9tKOiDj3T6tO0Dk8N6E5Yrc1nilKEvyeHn7AmqWLM3y0M/RY/MzIk 7HWnvUsh9GpEtV0uhHoEwXUx5oUTXiIAW+m0o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=GdQFR+pcQV27HMaJnZkQf27Il01f/QPh8UJW5IhGR7eUw2jv/Kq8mmfWzvIw/xP8WN VvYJ1qlYjleQwxRr69BZL6YlSF7wvqOtGDDIhAYQkAYpWUlr+eCfHCvUCZ20gAmCV7AY GVjSv9Q9SP7ZFzrS1VICQ4+8dkY1VKcqia9jI= Original-Received: by 10.216.138.65 with SMTP id z43mr596267wei.12.1284507799722; Tue, 14 Sep 2010 16:43:19 -0700 (PDT) Original-Received: from spec-desktop.specuu.com (host86-133-35-46.range86-133.btcentralplus.com [86.133.35.46]) by mx.google.com with ESMTPS id w14sm556559weq.33.2010.09.14.16.43.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 14 Sep 2010 16:43:18 -0700 (PDT) In-Reply-To: <1284506033.2446.11.camel@dell-desktop.example.com> (Thomas Lord's message of "Tue, 14 Sep 2010 16:13:53 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130162 Archived-At: Thomas Lord 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