From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_ZEN_BLOCKED_OPENDNS, URIBL_DBL_BLOCKED_OPENDNS,URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.4 Received: from txout-a2-smtp.messagingengine.com (txout-a2-smtp.messagingengine.com [103.168.172.225]) by inbox.vuxu.org (Postfix) with ESMTP id 15DCC22B4C for ; Wed, 17 Dec 2025 14:30:38 +0100 (CET) Received: from localhost.localdomain (phl-topicbox-02.internal [10.202.2.220]) by mailtxout.phl.internal (Postfix) with ESMTP id 0546E1C0135 for ; Wed, 17 Dec 2025 08:30:37 -0500 (EST) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=skeeve.com; spf=pass smtp.mailfrom=arnold@skeeve.com smtp.helo=freefriends.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=from:message-id:date:to:subject:references :in-reply-to:mime-version:content-type:content-transfer-encoding :list-help:list-id:list-post:list-subscribe:reply-to :list-unsubscribe; s=sysmsg-1; t=1765978237; bh=kshy3qMpZ447lMAT OwQiP7STq/pu5Y9uwmOCRI2/+WE=; b=VMwqTTn853jFaNiBUQ1O0pYeSjwJMyDv FBgEKSNw1Aoy1A4JBwtFiSrTLTEJAXvEO4jFxv27UZUhN4vkPx6104DoOyVCCW8F lL+IW8JJwF0fsWXRPSuo3vlhmV/nxhE410+G9prBVpeCF14I53bBHNqKbmgind53 0RKhqT8SR/Y= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1765978237; b=ZWuSf1mufBxsFsxCfC0XGs86kLJVXzNTfBkZerbdsgNZ3uxBPv p41qW0kPXx9yi4Rf42i3CKdFzGpF93mwi4H3EEhpTzKC8MFSUrSaotbeImhldMG7 xoI1QROQC14pGoE2vP9BWKwuMTsNQilGCqT15nYg5PyIREL8fZAZbqwuM= Authentication-Results: topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=skeeve.com; spf=pass smtp.mailfrom=arnold@skeeve.com smtp.helo=freefriends.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: authmilter.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC did not pass); dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=skeeve.com; iprev=pass smtp.remote-ip=198.99.81.75 (frenzy.freefriends.org); spf=pass smtp.mailfrom=arnold@skeeve.com smtp.helo=freefriends.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=fail smtp.helo=freefriends.org policy.ptr=frenzy.freefriends.org; x-return-mx=pass header.domain=skeeve.com policy.is_org=yes (MX Records found: skeeve.com); x-return-mx=pass smtp.domain=skeeve.com policy.is_org=yes (MX Records found: skeeve.com); x-tls=pass smtp.version=TLSv1.3 smtp.cipher=TLS_AES_256_GCM_SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=from :message-id:date:to:subject:references:in-reply-to:mime-version :content-type:content-transfer-encoding:list-help:list-id :list-post:list-subscribe:reply-to:list-unsubscribe; s=dkim-1; t=1765978237; x=1766064637; bh=GgwfAcW2cf88y1KEbvsgRxAQ20Lwfa7M otyYFy5cn6g=; b=VP2OUcWeRPtIrypx4dYatPxzotfGOeGI+i7DYnEyb/BNM7CI Mq9YYKwBofjKv1NigjYJmokfLopcSTQvv3ojAvFctJ4hn1cSsbaT1jjsJcV8fz8s KyMGsw3VZpmxJJJFQw5TT/P4EQy5ntHTj11Wu494tbVgn8Uv2PAeDDOtwi0= Received: from authmilter.topicbox.com (unknown [172.17.0.1]) by mx.topicbox.com (Postfix) with ESMTP id AC4B835CC5C4 for <9fans@9fans.net>; Wed, 17 Dec 2025 07:03:23 -0500 (EST) Received: from mx.topicbox.com (172.17.0.1 [172.17.0.1]) by authmilter.topicbox.com (Authentication Milter) with ESMTP id 608788A8E3C; Wed, 17 Dec 2025 07:03:23 -0500 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1765973003; b=GZoLCF1O6JtT+oaolbktvWwjKrN3PIjKFk+YRi+PEI3v0wnlbi TuQzNM1/Y48klV/MRZ4GLPQtswpwuRpjCNSZW612gKApy5fbThAjDmCZg09wwA/a gW8d6Uf3v22pqarGLmDv696NfoYjZpQgWem6nehek8VOFMyJscRUDQw5M0IrR5xv wFBGL29kBSrSrT8E+Ul/wnWEr4xPOCG4exjDncZxwaYGFUSdZxSLMWmaaiqqiDfS 2XUusdDfeKFL5N9qjl+ioURF7l0qZgznIVZkXkoUsxZpYQKBvaF9DXwPQk3sT7ir RhLU3zY9QvWfapyjsz3aNYfITVPIAMxH7u0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=from:message-id:date:to:subject:references :in-reply-to:mime-version:content-type :content-transfer-encoding; s=arcseal; t=1765973003; bh=aderyhi4 PG0ouiiJF8KSyjBUbjRMnzrAGM3+23sG12g=; b=EEUrcHtHLV41m9m0YidDVb0L ZHT+LcGHNsAt1uWIKFdepwdwy4ugmh9bePkS6gehVD4ko+U/j16I7/mg6zGnUSRA n0QqOoSe3vGCMgWVIG0ri6goTEamwclhbCZvXU9NgXskVglX2i+uFtUvbvRX0ei+ AFz4zQeWjzkLtT7a0WBS7LT3hc5s1q8fkxZWGtlTpQ/Smn/EK8TvnLjy3L5ULwL9 83em7CTnukU9mg9WAsqT7+aVIikEmYQuZ4+xd49XWZXM6U0bFqxhTMppKYMSRSQS s2naGX5bZlXzoOPETPHNJ7D+8Diej7kLscPG+2/1OCXemFu4qEZ9m97ckGCEjQ== ARC-Authentication-Results: i=1; authmilter.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC did not pass); dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=skeeve.com; iprev=pass smtp.remote-ip=198.99.81.75 (frenzy.freefriends.org); spf=pass smtp.mailfrom=arnold@skeeve.com smtp.helo=freefriends.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=fail smtp.helo=freefriends.org policy.ptr=frenzy.freefriends.org; x-return-mx=pass header.domain=skeeve.com policy.is_org=yes (MX Records found: skeeve.com); x-return-mx=pass smtp.domain=skeeve.com policy.is_org=yes (MX Records found: skeeve.com); x-tls=pass smtp.version=TLSv1.3 smtp.cipher=TLS_AES_256_GCM_SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdegvdehudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffkff fvufhfjggfgggtgfesthektddttderjeenucfhrhhomheprghrnhholhgusehskhgvvghv vgdrtghomhenucggtffrrghtthgvrhhnpefffffgvdelffeggeekgfekffffgeehfeehve elteeggfeufeeikeevuefhheeiueenucffohhmrghinhepghhithhhuhgsrdgtohhmpdht hihpvghsthhrrdhmugdpthhophhitggsohigrdgtohhmnecukfhppeduleekrdelledrke durdejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleek rdelledrkedurdejhedphhgvlhhopehfrhgvvghfrhhivghnughsrdhorhhgpdhmrghilh hfrhhomhepoegrrhhnohhlugesshhkvggvvhgvrdgtohhmqedpnhgspghrtghpthhtohep uddprhgtphhtthhopeeolehfrghnsheslehfrghnshdrnhgvtheq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (skeeve.com: 198.99.81.75 is authorized to use 'arnold@skeeve.com' in 'mfrom' identity (mechanism 'a' matched)) receiver=authmilter.topicbox.com; identity=mailfrom; envelope-from="arnold@skeeve.com"; helo=freefriends.org; client-ip=198.99.81.75 Received: from freefriends.org (frenzy.freefriends.org [198.99.81.75]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Wed, 17 Dec 2025 07:03:22 -0500 (EST) X-Envelope-From: arnold@skeeve.com X-Envelope-To: <9fans@9fans.net> Received: from freefriends.org (localhost [127.0.0.1]) by freefriends.org (8.16.1/8.16.1) with ESMTPS id 5BHC3LXa008219 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for <9fans@9fans.net>; Wed, 17 Dec 2025 05:03:21 -0700 Received: (from arnold@localhost) by freefriends.org (8.16.1/8.14.7/Submit) id 5BHC3LWT008218 for 9fans@9fans.net; Wed, 17 Dec 2025 05:03:21 -0700 From: arnold@skeeve.com Message-Id: <202512171203.5BHC3LWT008218@freefriends.org> X-Authentication-Warning: frenzy.freefriends.org: arnold set sender to arnold@skeeve.com using -f Date: Wed, 17 Dec 2025 05:03:21 -0700 To: 9fans@9fans.net Subject: Re: [9fans] Typestr usage (inspired by libgeometry) References: <624d190a-c592-49db-8223-67802389697e@sirjofri.de> <9B381DFBBE425AD6AD846363E0251600@eigenstate.org> In-Reply-To: User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Topicbox-Policy-Reasoning: moderate: sender is a member; group holds all messages Topicbox-Message-UUID: 63eb5dae-db40-11f0-9176-65540fc0285f Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UN2VlMjQyOTFhZjk1N2RiNy1NNDc1YTYzMjQ5ZTJmNDE0ZGIyMDQ3?= =?UTF-8?B?M2JkPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M475a63249e2f414db20473bd:1:pMvVxbAA6DhF_OCe1GQuNqMzTVOYlUM72x_F4mwOsis Down this path lies C++ constructors and destructors, and likely additional mess. For example, stack allocation of a point - who initializes the members? Etc, etc. It's probably best not to mess with it, as it's a non-standard extension. My two cents. Skip Tavakkolian wrote: > if you restricted the typestr to integral types (or composition of > integral types), would there be any garbage collection issues? > > On Tue, Dec 16, 2025 at 8:19=E2=80=AFAM wrote: > > > > Quoth sirjofri via 9fans <9fans@9fans.net>: > > > Hi, > > > > > > I just had a quick thought about using typestr in libgeometry. Howeve= r, I noticed that typestr is nowhere used in 9front at all (besides the com= piler that implements it as a feature). > > > > > > Thinking about how typestr provides pretty cool syntactic sugar, I wa= s wondering why that's the case? Is there a goal to maintain the C standard= as far as it makes sense, or is it compatibility between plan 9 systems? > > > > > > Before thinking about it too much, I just ask here. > > > > > > I personally only use it in some cases where it makes sense, in cases= similar to the complex number example I was able to find online[1]. I don'= t think it should be used to hide things, just to provide the ability to wr= ite code that's easier to read and understand. For example, instead of comb= ining matrices using functions, I could just type S * R * S, or to add vect= ors, I can just V + W. For plan 9, adding Points would be trivial. > > > > > > Note that I'm _not_ proposing to update all of the routines to use th= is feature. I'd just like to know your thoughts about using it (or not usin= g it). > > > > > > sirjofri > > > > > > [1] https://github.com/henesy/plan9-typestr/blob/master/typestr.md > > > > >=20 > > It's a subtly wrong feature -- it looks cute, but doesn't > > generalize well in C. Finishing it would imply garbage > > collection (or at least destructors), which have their > > own disadvantages. > >=20 > > It may work for some things. This, for example, is fine: > >=20 > > typestr mpint ...; > >=20 > > mpint *x =3D mpnew(42); > > mpint *y =3D mpnew(123); > > mpint *z =3D x * y; //ok, fine > > mpfree(x); > > mpfree(y); > >=20 > > but what about: > >=20 > > mpint *x =3D mpnew(42); > > mpint *y =3D mpnew(123); > > mpint *z =3D x * (y - x) * (y - x); > > mpfree(x); > > mpfree(y); > >=20 > > There are intermediate expressions along the way > > which would need to be allocated; who frees them? > >=20 ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T7ee24291af957db7-M475a6= 3249e2f414db20473bd Delivery options: https://9fans.topicbox.com/groups/9fans/subscription