From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Compiling Elisp to a native code with a GCC plugin Date: Tue, 14 Sep 2010 22:17:42 +0200 Organization: Programmerer Ingebrigtsen 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 X-Trace: dough.gmane.org 1284495485 27532 80.91.229.12 (14 Sep 2010 20:18:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 14 Sep 2010 20:18:05 +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:18:04 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 1Ovbx5-0004hn-RG for ged-emacs-devel@m.gmane.org; Tue, 14 Sep 2010 22:18:04 +0200 Original-Received: from localhost ([127.0.0.1]:38885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ovbx5-0002PT-8L for ged-emacs-devel@m.gmane.org; Tue, 14 Sep 2010 16:18:03 -0400 Original-Received: from [140.186.70.92] (port=36405 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ovbx0-0002On-49 for emacs-devel@gnu.org; Tue, 14 Sep 2010 16:17:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ovbwv-0006p4-Pe for emacs-devel@gnu.org; Tue, 14 Sep 2010 16:17:58 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:38386) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ovbwv-0006oq-Em for emacs-devel@gnu.org; Tue, 14 Sep 2010 16:17:53 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ovbws-0004eM-S4 for emacs-devel@gnu.org; Tue, 14 Sep 2010 22:17:50 +0200 Original-Received: from cm-84.215.34.171.getinternet.no ([84.215.34.171]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Sep 2010 22:17:50 +0200 Original-Received: from larsi by cm-84.215.34.171.getinternet.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Sep 2010 22:17:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 31 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cm-84.215.34.171.getinternet.no Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUfHh3AwMAFBAQEAgP/ //8GBQQEAwIDAQG/nq4VAAACFklEQVQ4jV2TwY7jIAyGndFwByl7rxzB3IO250biAVK05L5Uca4j rZS8/tqQTJtySBAfP79tDAQZqS2/MDQGVCoDyoKq6+E26DOAHRgGdR3rkt5PaodbEcQDmDDIuuEt VTDbAxhTJbuD3RUclG5aE7TZLaL9AUGPTavMflTeQRiAl0ajiiK7ifAAQaURQnWYEv07AOemoC1g oojL+gRB81TFC3xgGT/AqIZBgjESpYgWnoJWgGo/Zpvci6LkrmyjP2xKXd8/geSicEyICWd6AaX8 Ule0iP4NRCsAM3Z4AkO0JdTcXc+KoZyErn/4N0WyfEeRLbrfb4CvLsphF3MCt3LbmC3ewxvgWLkc idvpBRhOQ5Lgex3DSaHFAsV/PCnCoEq0/LFjewK/UICVgO9wnC+fm1hjkvzHAgbNbqZtbxGjkzR8 BdIyclNGxVJBRx4vDHT0s23ZWpXNDCIJYP0146fcumz32LlOwKCcX7L7EwyYUiZ0D99zMyiM2fv+ PnAPSki1iAykbJ6uF7bCUpAUK+A2RXpkdtfcajkKcI9eFHwqof0Uc+61FFkhgLIjIsetbiBilqeR OTgLXwXQzLkqdBnn5KrH6hYBZOWB7S9W/vC1bCsx+6sBGgAN8ucJuAU3Wrbtm+ejgucgmrZt2aiO meNgz4wJaN1krAvxt8A0TeKxvQ5evvL+8nDOoLvWE0WxvID1sLLpPwuNGKVrO4y7AAAAAElFTkSu QmCC Mail-Copies-To: never X-Now-Playing: Winston Tong's _Theoretically Chinese_: "The Quotidian" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:+EDAf9nVu2VLnnY2/La6Q1JsM3E= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:130148 Archived-At: Wojciech Meyer writes: > Well Elisp nature is dynamic, plus dynamic scoping makes it hard to > compile, but somewhat C Lispy code *can* work faster. Sure. Compiling to native code will probably yield some benefits, but I think we tend to overestimate the benefits. To take a random example from code I just wrote (part of `gnus-range-nconcat'), which works on lists and numbers and stuff, and is as low-level as Emacs Lisp code gets: (when (numberp (car last)) (setcar last (cons (car last) (car last)))) (if (= (1+ (cdar last)) (caar range)) (progn (setcdr (car last) (cdar range)) (setcdr last (cdr range)))) Just imagine what that would be in native code, as opposed to byte code. In either case, it'd just be a lot of calls to Fcar, Fcons, Fsetcar and so on. Would the byte-interpreter call those functions a lot slower than native code would? I kinda doubt it. Now, the same code in native C would of course be a lot faster, because you'd use other data types, and you wouldn't do the code by straight list manipulation at all. Possibly. -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen