From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Ben Newsgroups: comp.lang.ada Subject: Re: who needs types? Types makes code ugly. Date: Fri, 03 Jun 2022 01:02:27 +0100 Organization: A noiseless patient Spider Message-ID: <87fskmty0c.fsf@bsb.me.uk> References: <87wndzt8f1.fsf@bsb.me.uk> <09683835-f090-47ce-8a39-467e5fb3167an@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="bf467813db502b3686b40d5fd9202a72"; logging-data="8256"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eyoAvui0xsxfmSdFidxptKF8iwZrAiq0=" Cancel-Lock: sha1:Emy7DHkqcqBIICwILKN5M/O02UQ= sha1:nP/g0H4PEUJs4ccj6WSBqBbZMg8= X-BSB-Auth: 1.ca06e6ceb6907e125c7d.20220603010227BST.87fskmty0c.fsf@bsb.me.uk Xref: reader02.eternal-september.org comp.lang.ada:63918 List-Id: John Perry writes: > On Thursday, June 2, 2022 at 10:03:00 AM UTC-5, Ben wrote: >> ldries46 writes: >> >> (I don't know enough about Python's new static type >> syntax to know how strong that is, but it's optional anyway.) > > I think you mean "type hints"? The compiler doesn't check even when > you specify the types. The typing is available for those who want to > use a 3rd party tool to do "stuff" with it. See the note at the top of > this page: https://docs.python.org/3/library/typing.html Thanks. As I said, I haven't looked at this. >> Haskell, for example, has strong static type >> checking, but a lot of Haskell is written without ever using a type >> because of the language's type inference mechanism. > > Correct me if I'm wrong, but do you mean "without ever *specifying* a > type"? "Use" was not at all the right word since writing 1+2 obviously "uses" types, but I don't mean specify either since types can be specified simply by writing literals like "abc". I should have said something more technical like "without writing any type signatures". > Several recent languages have taken this up, including Kotlin > and Rust, though you have to specify some types. Yes, and even C++. > Even Ada 2022 offers it with the "renames" keyword. I don't know much about Ada newer than about 1990. I'll take a look... -- Ben.