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, HEADER_FROM_DIFFERENT_DOMAINS,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-a4-smtp.messagingengine.com (txout-a4-smtp.messagingengine.com [103.168.172.227]) by inbox.vuxu.org (Postfix) with ESMTP id 6E1C320220 for ; Tue, 16 Dec 2025 17:19:25 +0100 (CET) Received: from localhost.localdomain (phl-topicbox-01.internal [10.202.2.219]) by mailtxout.phl.internal (Postfix) with ESMTP id 717E11C0176 for ; Tue, 16 Dec 2025 11:19:24 -0500 (EST) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=pass (1024-bit rsa key sha1) header.d=eigenstate.org header.i=@eigenstate.org header.b=Kqnl7gHh header.a=rsa-sha1 header.s=mail x-bits=1024; dmarc=pass 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=eigenstate.org; spf=pass smtp.mailfrom=ori@eigenstate.org smtp.helo=mimir.eigenstate.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=message-id:to:subject:date:from: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=1765901964; bh=xBtBXnWFuBzqZbgUEPxQmjnnqykEuDxsgz+Ut wTHNIs=; b=mpVwsGIMTOQxTohXsCno3e7sHfm66k0dX0epv9J1e5DL790ERAWJC uZT23raikPt/au2LFyqCa1Y3wTcjCummOciQp5l6yFIfc/ss8ynDA2v5FohF1nJQ 9qxZ+Nu9pd5cTdHnOT2Bvp/uBScNsuRtz/zvzDrgeZKrQraRNkY19M= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1765901964; b=d2d8o6e1nUeuhskCPlVBjVnJ2z+qzsrYDbBtGHcTMNJtIui7oY aoLet0fY3rUqkosaJbLyGWYyfotBTk1nwXwdn05UBRVnWvTou54VN2QtSmqb0z6N 7FVtjywLdzAaI5MPPYgHzCfKgZTHQE1AbhprJSpfVznxJnGsEoHab8Oos= Authentication-Results: topicbox.com; arc=pass; dkim=pass (1024-bit rsa key sha1) header.d=eigenstate.org header.i=@eigenstate.org header.b=Kqnl7gHh header.a=rsa-sha1 header.s=mail x-bits=1024; dmarc=pass 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=eigenstate.org; spf=pass smtp.mailfrom=ori@eigenstate.org smtp.helo=mimir.eigenstate.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 Policy is not at enforcement); dkim=pass (1024-bit rsa key sha1) header.d=eigenstate.org header.i=@eigenstate.org header.b=Kqnl7gHh header.a=rsa-sha1 header.s=mail x-bits=1024; dmarc=pass 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=eigenstate.org; iprev=pass smtp.remote-ip=206.124.132.107 (mimir.eigenstate.org); spf=pass smtp.mailfrom=ori@eigenstate.org smtp.helo=mimir.eigenstate.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mimir.eigenstate.org policy.ptr=mimir.eigenstate.org; x-return-mx=pass header.domain=eigenstate.org policy.is_org=yes (MX Records found: nokogiri.pikopiko.org,kusuri.pikopiko.org,eigenstate.org,mail.pikopiko.org); x-return-mx=pass smtp.domain=eigenstate.org policy.is_org=yes (MX Records found: nokogiri.pikopiko.org,mail.pikopiko.org,eigenstate.org,kusuri.pikopiko.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-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=message-id :to:subject:date:from: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= 1765901964; x=1765988364; bh=A4agudigZhR+TTh7JS6iVGYnSb5kJlNVQIo V43GPao8=; b=MMx0+DwDX1XPrsQzmF+fKCHfQV2A8aVwjpbBdjS7rgtm5SnqMCB C+l5y7kYVXii7+RtsB2xN19nIW4snj2MRqdjLpdy9fkx5CI4yP3lECfITYWRu7Fd uALPb+BVO594ENcgYMnmwBaOUJnlYvYccPzTuLqKW2V23CgvZdPO8pLY= Received: from authmilter.topicbox.com (unknown [172.17.0.1]) by mx.topicbox.com (Postfix) with ESMTP id CE76D4D80531 for <9fans@9fans.net>; Tue, 16 Dec 2025 11:17:54 -0500 (EST) Received: from mx.topicbox.com (172.17.0.1 [172.17.0.1]) by authmilter.topicbox.com (Authentication Milter) with ESMTP id D65B6DD50CE; Tue, 16 Dec 2025 11:17:54 -0500 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1765901874; b=pv4ofoQLG908AIPHfuLIR7DEuWw+BL0xeXqfV0jxRkF82lUiBr sQe7No+szbP+Z3OI/pyx2mfDlrPcJVCCN1HBQC3+ECKJwfUZShcTqcyeNZMjKR7X 3ha77iSJvDhooQ1p3aQY9z57ttnh8OCLZd/wpQnNbdNHwap6ZBNBJE59AUOne6yb CXR+ttxZr4os8dCouWVJrMwOerNoP3uH+QOqkdwsP3JgWo1O2ewNEErUQe4mUieG tFuCjltzqpa0Z0hrDi6d+ryrLEVdozbz/Q+4zcXaV1U8KLN3kP71sxv05r42dMFq zHnxNRJdHZNjenCBKxssPxgiSIo3PBZS02tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=message-id:to:subject:date:from:in-reply-to :mime-version:content-type:content-transfer-encoding; s=arcseal; t=1765901874; bh=4AZYo9mrBMTFKO2yVHWZ6GeZyyHrxTTSp9Cu1Xv/xSU=; b= mdxViRMCXumsx3M4SsWDZn6VlXDW+kCOl9/Qa3Fk2sSukPO55JPwa4H9uo72bHbh 6hBBrM41Xn3KIRDg/9QzqMfbbzzK9JNfF2QZtItQykZt+gxrZZVRV1dSSxaUdn4v nr5ku5Mxr4S1XspBNhIHMeqjRkmUPsmsyxrYBZLpdaLNNrJ9HCUXQ1WrMJS5HDCk RoDKvDMUgH591SS1zgwXsFYECyF/cH7P1W5a4XnlvK9vWoUwEbYkY7tCKxMI8EVg bIHIjyaTknWRXzm5VrXm5TwyLl1M83HsxqEhQR4WXvLxMPbWFufgHxQ1ZMu1/X+1 uHSyR5e8fjxSqKNVsKHdUQ== ARC-Authentication-Results: i=1; authmilter.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (1024-bit rsa key sha1) header.d=eigenstate.org header.i=@eigenstate.org header.b=Kqnl7gHh header.a=rsa-sha1 header.s=mail x-bits=1024; dmarc=pass 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=eigenstate.org; iprev=pass smtp.remote-ip=206.124.132.107 (mimir.eigenstate.org); spf=pass smtp.mailfrom=ori@eigenstate.org smtp.helo=mimir.eigenstate.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mimir.eigenstate.org policy.ptr=mimir.eigenstate.org; x-return-mx=pass header.domain=eigenstate.org policy.is_org=yes (MX Records found: nokogiri.pikopiko.org,kusuri.pikopiko.org,eigenstate.org,mail.pikopiko.org); x-return-mx=pass smtp.domain=eigenstate.org policy.is_org=yes (MX Records found: nokogiri.pikopiko.org,mail.pikopiko.org,eigenstate.org,kusuri.pikopiko.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdegtddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkffvuf ffhfgjgggtgfesthejjedttddtvdenucfhrhhomhepohhrihesvghighgvnhhsthgrthgv rdhorhhgnecuggftrfgrthhtvghrnhepfffgkeegieetueekffeujeehueelvddvffdvhf dvvdegledvkeeltedtteefteetnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpthih phgvshhtrhdrmhgunecukfhppedvtdeirdduvdegrddufedvrddutdejpddutdekrdeird dvgedrvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvtdei rdduvdegrddufedvrddutdejpdhhvghlohepmhhimhhirhdrvghighgvnhhsthgrthgvrd horhhgpdhmrghilhhfrhhomhepoehorhhisegvihhgvghnshhtrghtvgdrohhrgheqpdhn sggprhgtphhtthhopedupdhrtghpthhtohepoeelfhgrnhhsseelfhgrnhhsrdhnvghtqe X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (eigenstate.org: 206.124.132.107 is authorized to use 'ori@eigenstate.org' in 'mfrom' identity (mechanism 'ip4:206.124.132.96/28' matched)) receiver=authmilter.topicbox.com; identity=mailfrom; envelope-from="ori@eigenstate.org"; helo=mimir.eigenstate.org; client-ip=206.124.132.107 Received: from mimir.eigenstate.org (mimir.eigenstate.org [206.124.132.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Tue, 16 Dec 2025 11:17:53 -0500 (EST) Received: from mimir.eigenstate.org (localhost [127.0.0.1]) by mimir.eigenstate.org (OpenSMTPD) with ESMTP id 702f14ed for <9fans@9fans.net>; Tue, 16 Dec 2025 08:17:52 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=eigenstate.org; h=message-id :to:subject:date:from:in-reply-to:mime-version:content-type :content-transfer-encoding; q=dns; s=mail; b=VRMrMoBAvfiCKVGbDCd qG4jAKAxgg/abTbyUBR1zmB96vPPKi9+pqrLrmx2yiiR5BiK+4k+dnOgn/+PsUvU IWKw1MOu3dDZYC5vzMPOZpzwnKNOgHM/30i1rXzFWCL+GI3PHR1EYtaZXQOZyPPX IX4FVkptFvnLcLTSKd08VGBc= Received: from abbatoir.orib.home (pool-108-6-24-2.nycmny.fios.verizon.net [108.6.24.2]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 94c2e3cd (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9fans@9fans.net>; Tue, 16 Dec 2025 08:17:52 -0800 (PST) Message-ID: <9B381DFBBE425AD6AD846363E0251600@eigenstate.org> To: 9fans@9fans.net Subject: Re: [9fans] Typestr usage (inspired by libgeometry) Date: Tue, 16 Dec 2025 11:17:49 -0500 From: ori@eigenstate.org In-Reply-To: <624d190a-c592-49db-8223-67802389697e@sirjofri.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Topicbox-Policy-Reasoning: moderate: sender is an admin; group holds all messages Topicbox-Message-UUID: c7989cbe-da9a-11f0-b3f1-e1546bc11ef0 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UN2VlMjQyOTFhZjk1N2RiNy1NZWQ4ODY3NDMxZTk0MjA3YTg1ZDE3?= =?UTF-8?B?YTA2Pg==?= 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:Med8867431e94207a85d17a06:1:k_rQaoA4Zxgvfz0azrfFb0vTf1DR4b4XYqToH-slq8o Quoth sirjofri via 9fans <9fans@9fans.net>: > Hi, >=20 > I just had a quick thought about using typestr in libgeometry. However, I= noticed that typestr is nowhere used in 9front at all (besides the compile= r that implements it as a feature). >=20 > Thinking about how typestr provides pretty cool syntactic sugar, I was wo= ndering 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? >=20 > Before thinking about it too much, I just ask here. >=20 > I personally only use it in some cases where it makes sense, in cases sim= ilar to the complex number example I was able to find online[1]. I don't th= ink it should be used to hide things, just to provide the ability to write = code that's easier to read and understand. For example, instead of combinin= g matrices using functions, I could just type S * R * S, or to add vectors,= I can just V + W. For plan 9, adding Points would be trivial. >=20 > Note that I'm _not_ proposing to update all of the routines to use this f= eature. I'd just like to know your thoughts about using it (or not using it= ). >=20 > sirjofri >=20 > [1] https://github.com/henesy/plan9-typestr/blob/master/typestr.md > 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. It may work for some things. This, for example, is fine: typestr mpint ...; mpint *x =3D mpnew(42); mpint *y =3D mpnew(123); mpint *z =3D x * y; //ok, fine mpfree(x); mpfree(y); but what about: mpint *x =3D mpnew(42); mpint *y =3D mpnew(123); mpint *z =3D x * (y - x) * (y - x); mpfree(x); mpfree(y); There are intermediate expressions along the way which would need to be allocated; who frees them? ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T7ee24291af957db7-Med886= 7431e94207a85d17a06 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription