From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: Compiling Elisp to a native code with a GCC plugin Date: Tue, 14 Sep 2010 14:55:01 -0600 Message-ID: References: <87bp805ecr.fsf@gmail.com> <874ods5ctf.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1284497720 5626 80.91.229.12 (14 Sep 2010 20:55:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 14 Sep 2010 20:55:20 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 14 22:55:19 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 1OvcX9-0006bQ-8m for ged-emacs-devel@m.gmane.org; Tue, 14 Sep 2010 22:55:19 +0200 Original-Received: from localhost ([127.0.0.1]:38532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvcX8-0001LD-Jt for ged-emacs-devel@m.gmane.org; Tue, 14 Sep 2010 16:55:18 -0400 Original-Received: from [140.186.70.92] (port=35039 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvcWx-0001JP-O5 for emacs-devel@gnu.org; Tue, 14 Sep 2010 16:55:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvcWu-0003TQ-8o for emacs-devel@gnu.org; Tue, 14 Sep 2010 16:55:07 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:1029) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvcWu-0003TI-2d for emacs-devel@gnu.org; Tue, 14 Sep 2010 16:55:04 -0400 Original-Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8EKt30D029111 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 Sep 2010 16:55:03 -0400 Original-Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8EKt2Dr009753; Tue, 14 Sep 2010 16:55:02 -0400 Original-Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o8EKt1x4015262; Tue, 14 Sep 2010 16:55:01 -0400 Original-Received: by opsy.redhat.com (Postfix, from userid 500) id 2E82B3784BE; Tue, 14 Sep 2010 14:55:01 -0600 (MDT) X-Attribution: Tom In-Reply-To: (Lars Magne Ingebrigtsen's message of "Tue, 14 Sep 2010 22:17:42 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:130151 Archived-At: >>>>> "Lars" == Lars Magne Ingebrigtsen writes: Lars> Just imagine what that would be in native code, as opposed to byte code. Lars> In either case, it'd just be a lot of calls to Fcar, Fcons, Fsetcar and Lars> so on. Would the byte-interpreter call those functions a lot slower Lars> than native code would? I kinda doubt it. Actually, in this case it might be faster, since there are special opcodes like Bcar, Bcons, Bsetcar, etc. Whether it is "faster enough" is hard to guess; lexbind comes into play because with lexbind, the various local bindings can just be C local variables, as opposed to much more expensive elisp bindings. Lars> Now, the same code in native C would of course be a lot faster, because Lars> you'd use other data types, and you wouldn't do the code by straight Lars> list manipulation at all. Possibly. IIUC, yeah, if you're willing to have a new pure-C data structure with a new read and write syntax, you can do even better. Tom