From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: On elisp running native Date: Fri, 06 Mar 2020 17:51:38 +0000 Message-ID: References: <87eeu5txxw.wl-all_but_last@163.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="63919"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: emacs-devel@gnu.org To: Zhu Zihao Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 06 18:52:29 2020 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 1jAH9B-000GUj-4D for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Mar 2020 18:52:29 +0100 Original-Received: from localhost ([::1]:40480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAH9A-0001s2-6K for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Mar 2020 12:52:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42700) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAH8e-0001QU-J7 for emacs-devel@gnu.org; Fri, 06 Mar 2020 12:51:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jAH8c-0002fB-04 for emacs-devel@gnu.org; Fri, 06 Mar 2020 12:51:56 -0500 Original-Received: from mx.sdf.org ([205.166.94.20]:57124) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jAH8b-0002cn-Oo for emacs-devel@gnu.org; Fri, 06 Mar 2020 12:51:53 -0500 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 026HpdJM019719 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 6 Mar 2020 17:51:39 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 026HpcqR019959; Fri, 6 Mar 2020 17:51:38 GMT In-Reply-To: <87eeu5txxw.wl-all_but_last@163.com> (Zhu Zihao's message of "Fri, 06 Mar 2020 21:28:11 +0800") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 205.166.94.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:245291 Archived-At: Zhu Zihao writes: > Hi Andrea! I noticed that you said type annotation is important for speed. Can > we do static analysing after macro-expansion to infer types? Hi Zhu, yes this is how it works already both for types and values. > Maybe we can just write types for function arg... I think just some macro would be required to expand in something like: (defun foo (x y) (let ((x (comp-hint-fixnum y)) (y (comp-hint-fixnum y))) ...)) I suspect somebody could already have some ideas on the subject... :) That said bare in mind that this is most likely non sufficent to exploit all possible optimization because you likely want to hint the compiler that the result of some additions in the body is still a fixnum and does not overflow in the integers (this is just and example). For the return value and type currently we don't do interprocedural analysis but is a good suggestion and should not be hard to add. That said I think would be fair to apply it only at speed 3. Andrea -- akrl@sdf.org