From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Boyer Newsgroups: gmane.emacs.bugs Subject: bug#69249: bug in native-compile? Date: Sun, 18 Feb 2024 17:46:09 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000177afe0611b097cc" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4208"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69249@debbugs.gnu.org, rms@gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 19 04:20:25 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rbuCe-0000ue-Oj for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Feb 2024 04:20:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbuC0-0003SM-QO; Sun, 18 Feb 2024 22:19:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbuBz-0003RE-50 for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2024 22:19:43 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rbuBy-0007ZY-Sf for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2024 22:19:42 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rbuCJ-0008LL-Me for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2024 22:20:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Boyer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Feb 2024 03:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69249 X-GNU-PR-Package: emacs Original-Received: via spool by 69249-submit@debbugs.gnu.org id=B69249.170831277331999 (code B ref 69249); Mon, 19 Feb 2024 03:20:03 +0000 Original-Received: (at 69249) by debbugs.gnu.org; 19 Feb 2024 03:19:33 +0000 Original-Received: from localhost ([127.0.0.1]:40090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbuBo-0008Jz-MH for submit@debbugs.gnu.org; Sun, 18 Feb 2024 22:19:33 -0500 Original-Received: from mail-ed1-f43.google.com ([209.85.208.43]:45477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbqtK-0002lP-1h for 69249@debbugs.gnu.org; Sun, 18 Feb 2024 18:48:17 -0500 Original-Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-56439b7c7a9so1140739a12.3 for <69249@debbugs.gnu.org>; Sun, 18 Feb 2024 15:47:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708300007; x=1708904807; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=e8SqAKweCRr9sxK6zKxwltekeMC57zdU0XvSoMIEACw=; b=VWD2g7NVkj+KdHVcszeccZkx8EgyutYImvQqd8K0KwHAgA4mVGs73M9JEPc7GKMKdq Ff1uZBBDZu+NrvA+QkBgFne0OJ2rUXnP0wi45eCzgXp0O6q/q/jtASzGlYx+5Pfce/8O 3f2Ibhp+viI7qiTA17kWTVA7Z2ll4jI7u97LxgOuI3tPGYuV5vElkhEv6b1X6fnYRq6W tejpLL/jj6iHAnGY+0oM3fY5GB7HmD69IXhtOyIFgPz/2kHK0lxuFWo0eSvy+jCtMAls SZbf/nSk/BG7T1OLOrAeQgx7sUxY9T4rh+OtZjzLfdXp3Wuy3sCrR/t0KB/xhOnFdVV8 Z/Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708300007; x=1708904807; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=e8SqAKweCRr9sxK6zKxwltekeMC57zdU0XvSoMIEACw=; b=MFoyzP5In7BF/fe0cGsgjaY9XeZ3YQixsIYkoybMpZnctljgxhiKeB9Fq2kf/ZNJ4G 5BXbmCquazmYTk/4hkS60oSzoUGMeB9zYxkuUvcyIsNBM4AVowle3op657zNec5eoZXr UuZlp+WEn6ZxP1y8AM0AD1FhSOZuEqjbiQztkbo6577coPuZUfzXif/L0Ri6/kMdMUTx eDLlUMGHX0hOb5M/qtLF6+2ZxCm2Bws0hd0TBuzPKtnPJaGf6RwhhH+KoAH+VD+H949H n0YnWrCM8XwCAWhcFkdAy5d8PsiWNYEK7SZ5wqLBxIG4yRwfDFRF8txxFPalGZxZ9DeN HB8A== X-Gm-Message-State: AOJu0Yzo4pwo1wjUpIkK1McF8UXyIOLTTCKWe5JiU+4e9p0FgLcE6P3t FYe+9H/8+qVLjVSizkX2q+h3t++G21kjOOSA6TUf+TSxxqvNB3Vn0xkdysxU5fDDvaFhbACGVYV Ekk0VPe+pRn1ncCQuD5/SYuHUWB2yLYmPV0+a/A== X-Google-Smtp-Source: AGHT+IGnyf8Np+lYEzkMz6/Ssh67R7A5gRPoNq93gIu4G3qIFrNCljXjTlQlisU8iw7bT5GWR+HTHvN4PhhhMR/TY04= X-Received: by 2002:aa7:c610:0:b0:564:5ec4:9692 with SMTP id h16-20020aa7c610000000b005645ec49692mr1915463edq.42.1708300007077; Sun, 18 Feb 2024 15:46:47 -0800 (PST) In-Reply-To: X-Mailman-Approved-At: Sun, 18 Feb 2024 22:19:27 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280228 Archived-At: --000000000000177afe0611b097cc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Robert Boyer 4:39=E2=80=AFPM (1 hour ago) Reply to all to Andreas, Eli, 69249, Andrea, Stefan, rms Look out, here it comes, as Tracy Schwarz says. The following DISASSEMBLE might tell you what you need to do for native-compile. Speaking with the utmost sincerity, I know less about the following than I do about what Proust called the greatest painting in the world, the View of Delft by Vermmer. Check it out. https://www.mauritshuis.nl/en/our-collection/artworks/92-view-of-delft/ Again, this is in SBCL on my $100 Lenovo Chromebook. * (disassemble 'foo-with-declare) ; disassembly for FOO-WITH-DECLARE ; Size: 60 bytes. Origin: #x52A4AF19 ; FOO-WITH-DECLARE ; 19: 4883EC10 SUB RSP, 16 ; 1D: BA14000000 MOV EDX, 20 ; 22: B904000000 MOV ECX, 4 ; 27: 48892C24 MOV [RSP], RBP ; 2B: 488BEC MOV RBP, RSP ; 2E: B842BD3550 MOV EAX, #x5035BD42 ; # ; 33: FFD0 CALL RAX ; 35: 31C0 XOR EAX, EAX ; 37: 31C9 XOR ECX, ECX ; 39: EB0C JMP L1 ; 3B: 0F1F440000 NOP ; 40: L0: 4801C1 ADD RCX, RAX ; 43: 4883C002 ADD RAX, 2 ; 47: L1: 4839D0 CMP RAX, RDX ; 4A: 7EF4 JLE L0 ; 4C: 488BD1 MOV RDX, RCX ; 4F: 488BE5 MOV RSP, RBP ; 52: F8 CLC ; 53: 5D POP RBP ; 54: C3 RET NIL * On Sun, Feb 18, 2024 at 5:42=E2=80=AFPM Robert Boyer wrote: > If so, we'd be interested to see your code to try and improve our > compiler. > > I hope this helps. If not, please let me know. > > > > Robert Boyer > 4:19=E2=80=AFPM (1 hour ago) > Reply to all > to Andreas, Eli, 69249, Andrea, Stefan, rms > This message is about how important DECLARE and THE are. If you do not > handle DECLARE and THE right, people will laugh at native-compile. > > Here is an SBCL transcript. I am running on a $100 Lenovo Chromebook. > > I got SBCL with the command sudo apt-get install sbcl. > > * (declaim (optimize (safety 0) (speed 3) (debug 0))) > NIL > * (defun foo-with-declare (n) > (let ((i 0) > (sum 0) > (max (expt 10 n))) > (declare (fixnum i sum max)) > (loop (cond ((<=3D i max) > (setq sum (the fixnum (+ sum i)))) > (t (return sum))) > (incf i)))) > FOO-WITH-DECLARE > * (time (foo-with-declare 8)) > Evaluation took: > 0.125 seconds of real time > 0.123203 seconds of total run time (0.123193 user, 0.000010 system) > 98.40% CPU > 135,905,516 processor cycles > 0 bytes consed > 5000000050000000 > * (defun foo-without-declare (n) > (let ((i 0) > (sum 0) > (max (expt 10 n))) > (loop (cond ((<=3D i max) > (setq sum (+ sum i))) > (t (return sum))) > (incf i)))) > WARNING: redefining COMMON-LISP-USER::FOO-WITHOUT-DECLARE in DEFUN > FOO-WITHOUT-DECLARE > * (time (foo-without-declare 8)) > Evaluation took: > 1.080 seconds of real time > 1.072932 seconds of total run time (1.072932 user, 0.000000 system) > 99.35% CPU > 1,181,369,303 processor cycles > 0 bytes consed > 5000000050000000 > > People go wow about 8X. How does native-compile do? > > There is a great song by Alabama 'If you gonna play in Texas, you gotta > have a fiddle in the band'. Check it out! > > https://www.youtube.com/watch?v=3Dw6r4E514nJg > > Bob > > > Bob > > > On Sun, Feb 18, 2024 at 3:28=E2=80=AFPM Andreas Schwab > wrote: > >> On Feb 18 2024, Robert Boyer wrote: >> >> > Furthermore, such declare forms are necessary for life as we know it >> > in the free world, so that fixnum arithmetic can be used where >> > appropriate! >> >> If you are programming in Emacs Lisp, you need to follow the rules of >> Emacs Lisp. >> >> -- >> Andreas Schwab, schwab@linux-m68k.org >> GPG Key fingerprint =3D 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AE= C1 >> "And now for something completely different." >> > > > -- > Anything I seem to state should be taken as a question. I am at least 77 > and feeble. > Attachments area > Preview YouTube video If You're Gonna Play In Texas > If You're Gonna Play In Texas > > Reply allReplyForward > Add reaction > > On Sun, Feb 18, 2024 at 5:32=E2=80=AFPM Stefan Monnier > wrote: > >> > ;; However, (native-compile "compile-bug.el") results in the following >> > error message: >> > >> > ;; Compiling file >> > /mnt/chromeos/GoogleDrive/MyDrive/Linux/working/compile-bug.el at Fri >> Feb >> > 16 08:25:19 2024 >> > ;; compile-bug.el:2:45: Warning: Unknown defun property =E2=80=98fixnu= m=E2=80=99 in foo >> > ;; compile-bug.el:2:45: Warning: Unknown defun property =E2=80=98vecto= r=E2=80=99 in foo >> >> First thing: these are not error messages! They're *warnings*! >> >> `batch-byte-compile` also gives those warnings, because ELisp does not >> know those declarations. The native compiler does support some type >> annotations, but they do not take this shape. >> >> I presume you took those from some other Lisp dialect, but that won't do >> you much good. Scheme is not Clojure is not Common Lisp is not ELisp ..= . >> >> BTW, A more recent Emacs would give you an additional warning: >> >> Warning: file has no =E2=80=98lexical-binding=E2=80=99 directive on = its first line >> >> So, I see no bug. Did the resulting native-compile misbehave in >> any way? I presume you're worried about its performance. >> If so, do you have concrete code where you measured the performance and >> were disappointed and where you have good reasons to believe that type >> annotations would make a difference? If so, we'd be interested to see >> your code to try and improve our compiler. >> >> >> Stefan >> >> > > -- > Anything I seem to state should be taken as a question. I am at least 77 > and feeble. > --=20 Anything I seem to state should be taken as a question. I am at least 77 and feeble. --000000000000177afe0611b097cc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Robert Bo= yer=C2=A0<robert= stephenboyer@gmail.com>

4:39=E2=80=AFPM (1 hour ago)
3D""
3D""Reply to all
3D""
= to=C2=A0Andreas,=C2=A0Eli,=C2=A069249,=C2=A0Andrea,=C2=A0Stefan,= =C2=A0rm= s
3D""
<= div class=3D"gmail-qQVYZb">
Look out, here it comes, as Tracy Schwarz says.
=
The= =C2=A0following=C2=A0DISASSEMBLE=C2=A0might= tell you what you need to do for native-compile.=C2=A0

Speaking with the utmost sincerity, I know less about = the following than I do about what=C2=A0Proust called the greatest painting= in the world, the View of Delft=C2=A0by Vermmer.=C2=A0 Check it out.

https://www.mauritshu= is.nl/en/our-collection/artworks/92-view-of-delft/

Again, this is in SBCL on my $100 Lenovo Chro= mebook.

* (disassemble=C2=A0&= #39;foo-with-declare)
;=C2=A0disassembly= =C2=A0for FOO-WITH-DECLARE
; Size: 60 bytes. Origin: #x52A4AF19 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0; FOO-WITH-DECLARE
; 19: =C2=A0 =C2=A0 =C2=A0 4883EC10 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 SUB RSP, 16
; 1D: =C2=A0 =C2=A0 =C2=A0 BA14000000 = =C2=A0 =C2=A0 =C2=A0 MOV EDX, 20
; 22: =C2=A0 =C2=A0 =C2=A0 B904000000 = =C2=A0 =C2=A0 =C2=A0 MOV ECX, 4
; 27: =C2=A0 =C2=A0 =C2=A0 48892C24 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 MOV [RSP], RBP
; 2B: =C2=A0 =C2=A0 =C2=A0 488BE= C =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MOV RBP, RSP
; 2E: =C2=A0 =C2=A0 = =C2=A0 B842BD3550 =C2=A0 =C2=A0 =C2=A0 MOV EAX, #x5035BD42 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0; #<FDEFN EXPT>
; 33: =C2=A0 =C2= =A0 =C2=A0 FFD0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 CALL RAX
; 35:= =C2=A0 =C2=A0 =C2=A0 31C0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 XOR EA= X, EAX
; 37: =C2=A0 =C2=A0 =C2=A0 31C9 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 XOR ECX, ECX
; 39: =C2=A0 =C2=A0 =C2=A0 EB0C =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 JMP L1
; 3B: =C2=A0 =C2=A0 =C2=A0 0F1F440000= =C2=A0 =C2=A0 =C2=A0 NOP
; 40: L0: =C2=A0 4801C1 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 ADD RCX, RAX
; 43: =C2=A0 =C2=A0 =C2=A0 4883C002 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 ADD RAX, 2
; 47: L1: =C2=A0 4839D0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 CMP RAX, RDX
; 4A: =C2=A0 =C2=A0 =C2=A0 7EF4 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 JLE L0
; 4C: =C2=A0 =C2=A0 =C2=A0 48= 8BD1 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MOV RDX, RCX
; 4F: =C2=A0 =C2=A0= =C2=A0 488BE5 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MOV RSP, RBP
; 52: =C2= =A0 =C2=A0 =C2=A0 F8 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 CLC; 53: =C2=A0 =C2=A0 =C2=A0 5D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 POP RBP
; 54: =C2=A0 =C2=A0 =C2=A0 C3 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 RET
NIL
*=C2=A0


On= Sun, Feb 18, 2024 at 5:42=E2=80=AFPM Robert Boyer <robertstephenboyer@gmail.com> wrote:
=
= =C2=A0If so, we'd be interested to see your code to try and improve our= compiler.

I hope this helps.=C2=A0 If not, please let m= e know.



Robert Boyer=C2=A0<robertstephenboy= er@gmail.com>

<= span id=3D"m_-2497710890071307433gmail-:1ac" title=3D"Feb 18, 2024, 4:19=E2= =80=AFPM" alt=3D"Feb 18, 2024, 4:19=E2=80=AFPM" role=3D"gridcell" style=3D"= vertical-align:top;margin:0px;font-size:0.75rem;color:rgb(94,94,94);display= :block;line-height:20px">4:19=E2=80=AFPM (1 hour ago)
3D""=
3D""Reply to all
3D""
to=C2= =A0Andreas,=C2= =A0Eli,=C2=A069249,=C2=A0Andrea,=C2=A0Stefan,=C2=A0rms
3D""
This message is about how important DECLARE and T= HE are.=C2=A0 If you do not
handl= e DECLARE and THE right, people will laugh=C2=A0at native-compile.

Here is=C2=A0an SBCL tra= nscript.=C2=A0 I am running on a $100 Lenovo Chromebook.
<= span style=3D"font-family:monospace">
I got SBCL with the command=C2=A0sudo apt-get install sbcl.=

* (declaim (optimize (safety 0) (speed 3) (debug 0)))
NIL
* (defun= foo-with-declare (n)
=C2=A0 (let ((i 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = (sum 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (max (expt 10 n)))
=C2=A0 =C2=A0 = (declare (fixnum i sum max))
=C2=A0 =C2=A0 (loop (cond ((<=3D i max)<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq sum = (the fixnum (+ sum i))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (t (return sum)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (incf i)= )))
FOO-WITH-DECLARE
* (time=C2=A0(foo-with-declare 8))<= br>Evaluation took:
=C2=A0 0.125 seconds of real=C2=A0time<= br>=C2=A0 0.123203 seconds of total run=C2=A0time=C2=A0(0.1231= 93 user, 0.000010 system)
=C2=A0 98.40% CPU
=C2=A0 135,905,516 proces= sor cycles
=C2=A0 0 bytes consed
5000000050000000
* (defun foo-wit= hout-declare (n)
=C2=A0 (let ((i 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (sum = 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (max (expt 10 n)))
=C2=A0 =C2=A0 (loop= (cond ((<=3D i max)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0(setq sum (+ sum i)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (t (return sum)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (incf i))))
WARNING: redefining COMMON-LISP-USER::FOO-WITHOUT-DECLAR= E in DEFUN
FOO-WITHOUT-DECLARE
* (time=C2=A0(foo-without= -declare 8))
Evaluation took:
=C2=A0 1.080 seconds of real=C2=A0time
=C2=A0 1.072932 seconds of total run=C2=A0time= =C2=A0(1.072932 user, 0.000000 system)
=C2=A0 99.35% CPU
=C2=A0 1,181= ,369,303 processor cycles
=C2=A0 0 bytes consed
5000000050000000
<= /font>

People go wow about 8X.=C2=A0 How does native-com= pile do?

There is a great song by Alabama 'If you gonna= =C2=A0play in Texas, you gotta have a fiddle in the band'. Check it out= !


Bob


Bob

=
On Sun, Feb 18, 2024 at 3:28=E2=80=AFPM Andreas S= chwab <schwab= @linux-m68k.org> wrote:
On Feb 18 2024, Robert Boyer= wrote:

> Furthermore, such declare forms are necessary for life = as we know it
> in the free world, so that fixnum arithmetic can be u= sed where
> appropriate!

If you are programming in Emacs Lisp,= you need to follow the rules of
Emacs Lisp.
=
--
Andreas Schwab,=C2=A0schwab@linux-m68k.org
GPG Key fingerprint =3D 7578 EB= 47 D4E5 4D69 2510=C2=A0 2552 DF73 E780 A9DA AEC1
"And now for somet= hing completely different."


--
Anything I seem = to state should be taken as a question.=C2=A0 I am at least 77 and feeble.<= /font>
Reply allReplyForward
=
<= /div>
O= n Sun, Feb 18, 2024 at 5:32=E2=80=AFPM Stefan Monnier <monnier@iro.umontreal.ca&g= t; wrote:
> ;= ; However, (native-compile "compile-bug.el") results in the follo= wing
> error message:
>
> ;; Compiling file
> /mnt/chromeos/GoogleDrive/MyDrive/Linux/working/compile-bug.el at Fri = Feb
> 16 08:25:19 2024
> ;; compile-bug.el:2:45: Warning: Unknown defun property =E2=80=98fixnu= m=E2=80=99 in foo
> ;; compile-bug.el:2:45: Warning: Unknown defun property =E2=80=98vecto= r=E2=80=99 in foo

First thing: these are not error messages!=C2=A0 They're *warnings*!
`batch-byte-compile` also gives those warnings, because ELisp does not
know those declarations.=C2=A0 The native compiler does support some type annotations, but they do not take this shape.

I presume you took those from some other Lisp dialect, but that won't d= o
you much good.=C2=A0 Scheme is not Clojure is not Common Lisp is not ELisp = ...

BTW, A more recent Emacs would give you an additional warning:

=C2=A0 =C2=A0 Warning: file has no =E2=80=98lexical-binding=E2=80=99 direct= ive on its first line

So, I see no bug.=C2=A0 Did the resulting native-compile misbehave in
any way?=C2=A0 I presume you're worried about its performance.
If so, do you have concrete code where you measured the performance and
were disappointed and where you have good reasons to believe that type
annotations would make a difference?=C2=A0 If so, we'd be interested to= see
your code to try and improve our compiler.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan



--
Anything I seem to state should be taken as a question.=C2= =A0 I am at least 77 and feeble.


--
Anything I seem to state should be taken as a question.=C2= =A0 I am at least 77 and feeble.
--000000000000177afe0611b097cc--