From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: guile 3 update, halloween edition Date: Thu, 31 Oct 2019 17:13:52 +0100 Message-ID: <87ftj8j3jz.fsf@pobox.com> References: <87o8xyhtz6.fsf@pobox.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="201032"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: guile-devel To: Mikael Djurfeldt Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Oct 31 17:32:42 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iQDNI-000q1a-0l for guile-devel@m.gmane.org; Thu, 31 Oct 2019 17:32:40 +0100 Original-Received: from localhost ([::1]:52400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQDNG-00034O-Be for guile-devel@m.gmane.org; Thu, 31 Oct 2019 12:32:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36460) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQD5Z-0000S4-O4 for guile-devel@gnu.org; Thu, 31 Oct 2019 12:14:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQD5Y-0001ih-Fc for guile-devel@gnu.org; Thu, 31 Oct 2019 12:14:21 -0400 Original-Received: from fanzine.igalia.com ([178.60.130.6]:49897) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iQD5X-0001cT-Ty for guile-devel@gnu.org; Thu, 31 Oct 2019 12:14:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=G/TFTU3zQXerT3/YRwEUr++WSVwqiKzl8x+FPIoIW/4=; b=hopSK7Nghhu7/nBezHbpMsLXlHddvqo9VXZmXCCishswRsTDT+JuYtQr79eshvh/uC622dqEsLl6LFdgxCzpVXMNeywXsUUOFBnmOUjItwR4JU7I+zUqJUeri+LjlidsNy0N2yLZWW5Y5hbWZjCOVphXyyZfvLYJndh1cpSVuRT4hfluc8sycHHguFZV1Be/2ql51pSOGxsuwByBH7lMb8zNbQFg7ODthWqN0xC4jL0qMNZerJV0neVawwJhMRWMOgl6kRr6F3c9hfhqwuuCcF+NLLjltgsIyoC2uHMp1JQqsR1+xTTSX1Qu8O2vU49pxd4EN8czoJ83F2JTE4ralA==; Original-Received: from lfbn-ann-1-100-21.w86-220.abo.wanadoo.fr ([86.220.73.21] helo=sparrow) by fanzine.igalia.com with esmtpsa (Cipher TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim) id 1iQD5T-0002qI-C7; Thu, 31 Oct 2019 17:14:15 +0100 In-Reply-To: (Mikael Djurfeldt's message of "Thu, 31 Oct 2019 15:17:31 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 178.60.130.6 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.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20136 Archived-At: Hey :) On Thu 31 Oct 2019 15:17, Mikael Djurfeldt writes: > How does the record subtyping relate to GOOPS? I do realize that there > are issues related to keeping bootstrapping lean, but shouldn't record > types and classes share mechanisms? They share the struct layer. Records are simple: their fields are laid out in order, are all unboxed, and can be treated as a simple kind of nominal product type. `match' takes advantage of this. GOOPS is more flexible: it can have different slot allocations, unboxed slots, multiple inheritance, and so on. Because of multiple inheritance its accessors have to do dynamic dispatch; whereas for records, if supertype A allocates slot X to index I, all subtypes will have that slot in the same place. A check whether a record is an instance of A is a simple O(1) check, rather than the CPL search of GOOPS. Exceptions have a kind of multiple inheritance, but it's more about object composition than typing. You can make a compound condition from a heterogeneous collection of other conditions. While you could implement compound conditions with subtyping, it's more straightforward to use composition. I think the current status is close to the sweet spot but your thoughts are welcome :) I would dearly like to be able to subtype records in GOOPS, but having looked at it a few times I haven't found quite the right way to do it. Cheers, Andy