From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9329 invoked from network); 4 Aug 2023 00:24:23 -0000 Received: from minnie.tuhs.org (2600:3c01:e000:146::1) by inbox.vuxu.org with ESMTPUTF8; 4 Aug 2023 00:24:23 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id F0B3D421BE; Fri, 4 Aug 2023 10:24:19 +1000 (AEST) Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by minnie.tuhs.org (Postfix) with ESMTPS id 0F24041CB5 for ; Fri, 4 Aug 2023 10:24:14 +1000 (AEST) Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-447a3d97d77so690812137.1 for ; Thu, 03 Aug 2023 17:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20221208.gappssmtp.com; s=20221208; t=1691108653; x=1691713453; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=y7rNeojr9oQArYsBQ1/i0BHZmMoi1HvlFX2FBucmpnM=; b=LoVfo+UAJQ0aYD5PRcVoHrwSpJ4jVF2O0xOkDYGbAjxG6AhlJL4pKrxaH1HhNMXwFD xnL5o22TjYkwxKeWYjv6SCHrbB7jmkz6hNXOTi4eeGvVsJ9W2Z60fx0rshgoHi5iKU+6 VohAtJHFyBNeZGhpAcj8156upDgDPCJeY9AweUaPleO58/FCRTpVXWgFRwQ0T992iUhg B2fzz+QIfCW/JgeWmQhfNE7OrTLqObfCkjXznO+pyVpnDpDOQg2leedI7HZ+0U3QxF/f iB7fgzQo1G/FHz++90hLKfeBCGBSiKNBIL2tdgiI9fjH7pooposRyb0jU+1bLIOqmUVh yx6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691108653; x=1691713453; 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=y7rNeojr9oQArYsBQ1/i0BHZmMoi1HvlFX2FBucmpnM=; b=ZHwgTwhnNUPaCVMd3ALysGEuMZpvxq6Csmi3eXrdi9JHPywj5CGB+wMY0iUbfXSZR3 ZPTjGmKMPvBHCwOhl3i0sbr9LQSmuE+4hLVjWfWG81xTpltkpVNDiVmfRhXdMsK9XBBe 3SZRUtxokw4jMsT4Iu6HqJ1gr4E8OsgJyfozAz6LyhBuFfyZxYRfBMeW9AQO0dunWk8v XCwJo3OgXTu6cs/i69/AsDccvUNnpsMwBn7+o7CSWKEVtbRFyadTCKE5QYXhD9hfffVn 3GGu39nT1LlCxpJ5wnhEgEaUlOyjVcmqO8dS8JuJ7947tHVcUTRoiTbbvWE8TaP8lXnq 8JrA== X-Gm-Message-State: AOJu0YyUMRINxf94RPewzFyBmD9ugR4RZxy8puTL1tLPxiheLh7Rf9r7 IXuweiHeKcQIwYbY8dAyufp0L00yOTM5+K3oh1ELIA== X-Google-Smtp-Source: AGHT+IHpX8FENBta8BFvn/HO6jU5YPE4TvdPbNH/2vav4tpE4HIQBPNAjhWPtQDd1e6qvy99Vs2tE4LwMYPU1PUUnl8= X-Received: by 2002:a05:6102:e5a:b0:447:4e3f:216b with SMTP id p26-20020a0561020e5a00b004474e3f216bmr307833vst.25.1691108653030; Thu, 03 Aug 2023 17:24:13 -0700 (PDT) MIME-Version: 1.0 References: <8246.1690761540@cesium.clock.org> <29602.1690887524@cesium.clock.org> <20230803005106.GA12652@mcvoy.com> <1f043101-4dbb-34ff-b037-85e7cc707a6e@halwitz.org> <2BF7ADB4-4851-4CF5-A6AC-0F1079D4AF78@gmail.com> In-Reply-To: From: John Cowan Date: Thu, 3 Aug 2023 20:24:01 -0400 Message-ID: To: Dan Cross Content-Type: multipart/alternative; boundary="0000000000008a788006020dea3c" Message-ID-Hash: NSZGRJOE237ZS6NYRRWAEXW7DID6NJSY X-Message-ID-Hash: NSZGRJOE237ZS6NYRRWAEXW7DID6NJSY X-MailFrom: cowan@ccil.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: tuhs@tuhs.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: python List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --0000000000008a788006020dea3c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Aug 3, 2023 at 6:06=E2=80=AFPM Dan Cross wrote: > On Thu, Aug 3, 2023 at 11:21=E2=80=AFAM will.senn@gmail.com > wrote: > > someone had needed to store a > pair of integers, so they used a CONS cell; Of course, that was a bad idea. The pair of integers should have been a struct or a class named after whatever its application-level purpose was: a point, for example. after a while, the pair > needed to be expanded to a triple, so someone converted the single > CONS cell into a (proper) list. In that case, a derived struct or class should have been created. The two classes would use the same accessor methods, just as in C++. this, of course, ran afoul of the type system and > raised a condition, which resulted as an ISE in prod. The fix was > trivial (change CDR to SECOND in the right place) but it really struck > me that if the system were statically typed, this would have been > trivially discovered at compile-time. > Absolutely, and if the failure was intolerable, CL's static type declarations would have caught the use of the wrong type. But you don't have to declare *everything*. For that matter, there is nothing in a fully statically typed system that requires every variable, function, argument, etc. to be *declared*: type inference is powerful. Common Lisp does allow you to declare types in some limited regards; > these are usually hints to the compiler for code generation. > They may or may not be, depending on how you set the OPTIMIZE declaration. > like Rob, I > greatly prefer strong, static typing. > Then why weren't you using mypy? > Incidentally, C is weakly (you can add a pointer to an integer: the > result is another pointer), but statically typed. > That's not weak typing, it's operator overloading, just as when you add an int to a double. C will not let you, e.g., add an int to a function. Weak typing is quite rare in high-level languages: PL/I pointer variables are weakly typed (that is, when you allocate an object you specify the type of the object and then assign it to the pointer variable), but the rest of the language is strongly typed. --0000000000008a788006020dea3c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Th= u, Aug 3, 2023 at 6:06=E2=80=AFPM Dan Cross <crossd@gmail.com> wrote:
On Thu, Aug 3, 2023 at 11:21=E2=80=AFAM will.senn@gmail.com <= will.senn@gmail.co= m> wrote:
=C2=A0
someone had need= ed to store a
pair of integers, so they used a CONS cell;

Of course, that was a bad idea.=C2=A0 The pair of int= egers should have been=C2=A0a struct or a class named after whatever its ap= plication-level purpose was: a point, for example.

after a = while, the pair
needed to be expanded to a triple, so someone converted the single
CONS cell into a (proper) list.

In that case, a derived struct or class should have been created.= =C2=A0 The two classes would use the same accessor methods, just as in C++.=

this, of course, ran afoul of the type system and
raised a condition, which resulted as an ISE in prod. The fix was
trivial (change CDR to SECOND in the right place) but it really struck
me that if the system were statically typed, this would have been
trivially discovered at compile-time.

Absolutely, and if the failure was intolerable, CL'= s static type declarations would have caught the use of the wrong type.=C2= =A0 But you don't have to declare *everything*.=C2=A0 For that matter, = there is nothing in a fully statically typed system that requires every var= iable, function, argument, etc. to be *declared*: type inference is powerfu= l.

Common Lisp does allow you to declare types in some limi= ted regards;
these are usually hints to the compiler for code generation.

They may or may not be, dependin= g on how you set the OPTIMIZE declaration.
=C2=A0
like Rob, I
greatly prefer strong, static typing.

Then why weren't you using mypy?
=C2=A0
Incidentally, C is we= akly (you can add a pointer to an integer: the
result is another pointer), but statically typed.

=
That's not weak typing, it's operat= or overloading, just as when you add an int to a double.=C2=A0 C will not l= et you, e.g., add an int to a function.=C2=A0 Weak typing is quite rare in = high-level languages: PL/I pointer variables are weakly typed (that is, whe= n you allocate an object you specify the type of the object and then assign= it to the pointer variable), but the rest of the language is strongly type= d.
--0000000000008a788006020dea3c--