From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Ideal performance of ELisp (was: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2)) Date: Fri, 12 Aug 2022 17:50:36 -0400 Message-ID: References: <83o7wuva9o.fsf@gnu.org> <83mtceupbx.fsf@gnu.org> <83lerxvfnu.fsf@gnu.org> <838rnxvdcq.fsf@gnu.org> <83r11ptksn.fsf@gnu.org> <83a68dti6w.fsf@gnu.org> <874jykzvx9.fsf@yahoo.com> <83fsi4sttn.fsf@gnu.org> <838rnws5c7.fsf@gnu.org> <838rntocb8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26257"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Lynn Winebarger , luangruo@yahoo.com, acm@muc.de, emacs-devel@gnu.org, casouri@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 12 23:51:46 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oMcZG-0006fV-Ip for ged-emacs-devel@m.gmane-mx.org; Fri, 12 Aug 2022 23:51:46 +0200 Original-Received: from localhost ([::1]:51994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMcZF-0001Be-Jl for ged-emacs-devel@m.gmane-mx.org; Fri, 12 Aug 2022 17:51:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMcYF-0000Nu-DE for emacs-devel@gnu.org; Fri, 12 Aug 2022 17:50:43 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47859) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMcYC-0006Hf-OS; Fri, 12 Aug 2022 17:50:42 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E1542100134; Fri, 12 Aug 2022 17:50:38 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 59232100118; Fri, 12 Aug 2022 17:50:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1660341037; bh=EX+ylnaMzQkvg0zD/SxgqTbr4OeTti65vWJWsjw+6c0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=mNBPnYvpKA4jOkhHWjbVdrSpFwq8k1+aZLui/ksgoUjGAAUAgVRdjFSPXTGt8Q24n a8wpb6sX1w1SaWX3mncGm5flNEryglupX/Jb28dd/lw7iScOKMPNwUsPvFtxK/Ead1 xkW38Kp46fHe6qJ5rnFoISp1cy0YddkzV/Xd9353erqyb2UQczj/4gNy5U9S6Ttew6 NEDWhdWILYhvs1N4sm0W3DO6r0+heGbWYTuldjUdUumy8G+EwnESMKm228rGem48rx UxxLTk5n+tArYl/Y9IfH9tm/XohLjsbc+hYmLfhxrQL1Bg/0HT3jva/Wizkw6hjmA7 IaPer3Gtn6rtg== Original-Received: from pastel (unknown [45.72.195.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1D83D1200FC; Fri, 12 Aug 2022 17:50:37 -0400 (EDT) In-Reply-To: <838rntocb8.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Aug 2022 15:50:51 +0300") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:293395 Archived-At: >> > I don't have this information. Maybe someone else does. But in >> > general, it is a very small wonder that a parser written in optimized >> > C is much faster than anything written in Emacs Lisp, given that Lisp >> > is an interpreted language that has no special support for writing >> > parsers. >> That can be cured over time, now that the bulk of the core of emacs >> uses lexical scoping. > I very much doubt that. Agreed. > ELisp code cannot match the speed of optimized C code. I suspect it could, to some extent, in theory. Getting there would require a fair bit more work, probably using a different compilation strategy than the AOT compiler we have now. A good reference is JavaScript which shouldn't be noticeably easier to compile efficiently and where many millions of dollars have been poured over several years to speed it up. The result is indeed able to match the performance of C nowadays for several non-trivial examples of code, but it's far from obvious that we have the resources to reproduce this feat for ELisp. Stefan