From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.devel Subject: =?UTF-8?Q?Re:_[PATCH]_Add_tree-il_optimizations_for_equal=3F_on_char_and?= =?UTF-8?Q?_number_literals?= Date: Wed, 13 May 2020 23:16:20 +0200 Message-ID: <7aa1309d-78a8-4cc4-8529-42701e053196@www.fastmail.com> References: <71bf4755-11b0-4211-abe7-677adc14db76@www.fastmail.com> <8736849bxw.fsf@pobox.com> Mime-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="92310"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.3.0-dev0-413-g750b809-fmstable-20200507v1 Cc: guile-devel@gnu.org To: "Andy Wingo" Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed May 13 23:17:30 2020 Return-path: Envelope-to: guile-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 1jYykr-000Num-Tk for guile-devel@m.gmane-mx.org; Wed, 13 May 2020 23:17:30 +0200 Original-Received: from localhost ([::1]:38104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYykq-0007qu-UP for guile-devel@m.gmane-mx.org; Wed, 13 May 2020 17:17:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYykG-0007qU-2H for guile-devel@gnu.org; Wed, 13 May 2020 17:16:52 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37695) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYykE-00084K-9Y for guile-devel@gnu.org; Wed, 13 May 2020 17:16:51 -0400 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 78C7D5C006A; Wed, 13 May 2020 17:16:49 -0400 (EDT) Original-Received: from imap1 ([10.202.2.51]) by compute7.internal (MEProxy); Wed, 13 May 2020 17:16:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veryfast.biz; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type:content-transfer-encoding; s=fm2; bh=JEnuk LX+Z+RHpBQ40O/iN80OTm4fCvAELA37eX5HYGY=; b=kuh8IB965wwbi+NAoiYvH bGufGjvYAZQbn/Vn49f+bRjoakj4RrkK9JfB1jNGAoh6kjptQhr7EySUYCMSOoOy ApzPJVHba4019lYLJxgS+XGCErxpfMbzQn0b3fDJWUNM6Mq9aydOhcNQOjcKMQ9w PZZbkj6GfYsmPxsy/c782VXDEKFWLLa660+hd179FZ2ZTYsWN5BZwBm4X28Vxize 2iuToY6j+ZLkzZFtUmuoO2aavfgJj0l0XGXHWDolS3G4SWWkP20tr/wlwwaJ2TLp jwLgA/GDvuCRRPGjIfzpWRU9yHrJK5lczGpWBZWxV6sDLRtXxULY0HwcN4T9IStJ A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=JEnukLX+Z+RHpBQ40O/iN80OTm4fCvAELA37eX5HY GY=; b=BiIkW9arlD2VWar40urP3b7eldpD4PKUBDnYNDxpcYa+z+vr6E+mnVjcR 6QUwaLGueWMnTiiAxHcTJauFOmN9wt9jiux4KUyTOlncm1nvIK/R4F1PRuw0Jyo3 WHgpoype2M2pKhpdVN0ErjIl2sAELG6MAI8Tvku7QCEJgXZL+syeowzLL2oHeTSY DEOHIrRU7hpsBl+46EU3etfSMjkYd3s6Nv2Fd6VmxLmWKHx2qsubtZ3CEbsJVlOQ 2P2dw3gganBPj0Z3WLKJZH/wX3vmt0BcQEmrgQWHQRbbede82EE6sstt49fdanUG pShPvRQTd9rSa0Fxzv8FvbbJ4U2nA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrleeggdduheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpefnihhn uhhspgeujhpnrhhnshhtrghmuceolhhinhhushdrsghjohhrnhhsthgrmhesvhgvrhihfh grshhtrdgsihiiqeenucggtffrrghtthgvrhhnpeetvdeuteehueektefhuddvjeelteff uedvvdeuudeiuedvtedtueehhedvjeeiffenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehlihhnuhhsrdgsjhhorhhnshhtrghmsehvvghrhihf rghsthdrsghiii X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id E0AA0C200A4; Wed, 13 May 2020 17:16:48 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <8736849bxw.fsf@pobox.com> Received-SPF: pass client-ip=66.111.4.28; envelope-from=linus.bjornstam@veryfast.biz; helo=out4-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/13 17:16:49 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20518 Archived-At: That is indeed a lot prettier! I didn't know guile compared chars using= eq? (The manual states that you should use eqv? For chars and numbers).= =20 On the latest master equal? was not reduced to eq? on chars in the repl = for things like ,opt (define (a b) (equal? b #\b)). Was I using the new = baseline compiler or should it always be triggered? I didn't have time t= o really check it out, and I have about a gazillion little computers tha= t run guile. I do think I was sshing into the right one, though :) Good to hear know that I can (match...) without fear in the future! Betw= een this and the record unification I feel I have very little motivation= to write my own extensible pattern matcher :)=20 --=20 Linus Bj=C3=B6rnstam On Wed, 13 May 2020, at 15:55, Andy Wingo wrote: > Hi :) >=20 > On Wed 13 May 2020 13:20, Linus Bj=C3=B6rnstam writes: >=20 > > Hi there! > > > > Aleix and I noticed that equal? has a lot higher overhead than eqv? = on > > chars, which means using (ice-9 match) for chars was suboptimal. Thi= s > > patch fixes that. >=20 > I think we can be a little more simple here. Scheme doesn't specify > what (eqv? #\a x) is, but in Guile it is equivalent to (eq? #\a x), an= d > our compiler should be free to turn the portable eqv? invocation into > eq?. But as the comment on line 416 says, we should really do this in= > peval and not in the expander. So.... you nerd-sniped me ;) I just > pushed a patch that did this. >=20 > While looking, I found this: >=20 > > + (make-conditional src (make-primcall src prim (list a b)) > > + (make-primcall src prim (cons b rest)) > > + (make-const src #f)))))) >=20 > This was in the original code but is wrong: if "b" has a side-effect, = it > will happen twice. I have fixed it in git. >=20 > Thanks for the debugging and patch! >=20 > Andy >