Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

who needs types? Types makes code ugly.

251 views
Skip to first unread message

Nasser M. Abbasi

unread,
Jun 1, 2022, 11:21:14 PM6/1/22
to
So Ada had it wrong all the time it seems. From

https://python.land/python-tutorial

------------
In a strongly typed language, you need to specify the exact
type of each variable, like String, int, and float. It
gets even uglier when objects are involved.

Now let’s look at Python variables. In Python, we can do
exactly the same without types:

my_name = "Erik"
my_age = 37
my_salary = 1250.70

As you can see, the Python variant is a lot cleaner and easier on the eyes!
----------------------

And about possible error, they defend this by saying:

--------------------------
In addition, you’ll find out soon enough during testing
and fix the error before the software ever goes to production.
---------------------------

So, I think all what Ada needs is to simply remove all those
ugly types from the language and it will become popular
like Python is now :)

--Nasser

Doctor Who

unread,
Jun 2, 2022, 4:00:44 AM6/2/22
to
On Wed, 1 Jun 2022 22:21:08 -0500, "Nasser M. Abbasi" <n...@12000.org>
wrote:
nonsense.

Dmitry A. Kazakov

unread,
Jun 2, 2022, 4:37:24 AM6/2/22
to
A more deep analysis begs the question, why don't we remove all that
ugly variables and the code itself?

Programming by the emoji is the future!

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Nasser M. Abbasi

unread,
Jun 2, 2022, 6:08:59 AM6/2/22
to
On 6/2/2022 3:37 AM, Dmitry A. Kazakov wrote:

> A more deep analysis begs the question, why don't we remove all that
> ugly variables and the code itself?
>
> Programming by the emoji is the future!
>

I am afraid others have beat you to this brilliant idea !

https://levelup.gitconnected.com/5-most-amusing-programming-languages-you-can-code-using-emojis-4bfd43bc7614

"Well, smart and talented people out there have imagined and
developed full-fledged programming languages that we can use to code
with emojis and emoticons."

I still do not know if they have strong types when using Emoji languages
or not. May be you can not add a smily face to sad face? That will be
type error at compile time?

--Nasser

Dmitry A. Kazakov

unread,
Jun 2, 2022, 6:39:26 AM6/2/22
to
On 2022-06-02 12:08, Nasser M. Abbasi wrote:

> I still do not know if they have strong types when using Emoji languages
> or not. May be you can not add a smily face to sad face? That will be
> type error at compile time?

Emoji programming is emotional paradigm. You stuck in the old hateful
and toxic imperative paradigm of adding stuff... (:-))

Jeffrey R.Carter

unread,
Jun 2, 2022, 6:47:27 AM6/2/22
to
On 2022-06-02 05:21, Nasser M. Abbasi wrote:
> In addition, you’ll find out soon enough during testing
> and fix the error before the software ever goes to production.

Proven beyond a shadow of a doubt by the total absence of security
vulnerabilities in production S/W.

--
Jeff Carter
"If you think you got a nasty taunting this time,
you ain't heard nothing yet!"
Monty Python and the Holy Grail
23

ldries46

unread,
Jun 2, 2022, 7:47:18 AM6/2/22
to
As someone who has been programming since 1966 I used several different
languages, Algol 60, Fortran, Basic, C/C++ and Ada, I like using strong
types because the most ugly faults you can create are the ones where you
by accident use different types in the input or the output of a formula.
Such a fault can work through the complete program an result in very
tough error searching. Even when the basic failure is using an integer
instead of an real.

Stéphane Rivière

unread,
Jun 2, 2022, 9:22:34 AM6/2/22
to
> Programming by the emoji is the future!

I second that.


Ben

unread,
Jun 2, 2022, 11:03:00 AM6/2/22
to
ldries46 <bertus...@planet.nl> writes:

> As someone who has been programming since 1966 I used several
> different languages, Algol 60, Fortran, Basic, C/C++ and Ada, I like
> using strong types because the most ugly faults you can create are the
> ones where you by accident use different types in the input or the
> output of a formula.

The terms being using in this thread might need to tightened up a bit
because I think you are talking about strong /static/ typing.

Python is strongly typed (though exactly how "strong" is debatable) but
the checking is at run-time, so you have to rely on testing rather than
the compiler. (I don't know enough about Python's new static type
syntax to know how strong that is, but it's optional anyway.)

Also, the OP is talking about removing all those messy types, and that's
not necessarily the same as removing type checking, either static type
checking or at run-time. 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.

--
Ben.

Keith Thompson

unread,
Jun 2, 2022, 1:28:47 PM6/2/22
to
"Nasser M. Abbasi" <n...@12000.org> writes:
> So Ada had it wrong all the time it seems. From
>
> https://python.land/python-tutorial
>
> ------------
> In a strongly typed language, you need to specify the exact
> type of each variable, like String, int, and float. It
> gets even uglier when objects are involved.
>
> Now let’s look at Python variables. In Python, we can do
> exactly the same without types:
>
> my_name = "Erik"
> my_age = 37
> my_salary = 1250.70
>
> As you can see, the Python variant is a lot cleaner and easier on the eyes!
> ----------------------
>
> And about possible error, they defend this by saying:
>
> --------------------------
> In addition, you’ll find out soon enough during testing
> and fix the error before the software ever goes to production.
> ---------------------------

That's just one tutorial. It likely doesn't reflect the views of most
Python programmers. The "python.land" site has no official connection

And for what it's worth, Python 3.5 added support for "type hints".
https://docs.python.org/3/library/typing.html

--
Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

John Perry

unread,
Jun 2, 2022, 6:10:59 PM6/2/22
to
On Thursday, June 2, 2022 at 10:03:00 AM UTC-5, Ben wrote:
> ldries46 <bertus...@planet.nl> 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

The Python runtime does not enforce function and variable type annotations.
They can be used by third party tools such as type checkers, IDEs, linters, etc.

> 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"? Several recent languages have taken this up, including Kotlin and Rust, though you have to specify some types.

Even Ada 2022 offers it with the "renames" keyword.

regards
john perry

Ben

unread,
Jun 2, 2022, 8:02:30 PM6/2/22
to
John Perry <dev...@yahoo.com> writes:

> On Thursday, June 2, 2022 at 10:03:00 AM UTC-5, Ben wrote:
>> ldries46 <bertus...@planet.nl> 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.

Ben

unread,
Jun 3, 2022, 2:13:53 PM6/3/22
to
Dennis Lee Bieber <wlf...@ix.netcom.com> writes:

> On Fri, 03 Jun 2022 01:02:27 +0100, Ben <ben.u...@bsb.me.uk> declaimed
> the following:
>>
>>I don't know much about Ada newer than about 1990. I'll take a look...
>
> My condolences

Thank, but I'm fine. Knowing was not intended to imply forced to use.

> -- taken literally, that means you are working with
> Ada-83 (ANSI/Mil-Std 1815A -- later ISO-8652:1987). The first significant
> update was Ada-95 (and Air Force funded original GNAT).

That was the only Ada I knew, though I knew about the updates of
course. Couldn't find any reference to type inference though. Is there
a good place to go for a "summary of changes" between standards?

--
Ben.

Niklas Holsti

unread,
Jun 3, 2022, 2:34:39 PM6/3/22
to
On 2022-06-03 21:13, Ben wrote:
> Dennis Lee Bieber <wlf...@ix.netcom.com> writes:
>
>> On Fri, 03 Jun 2022 01:02:27 +0100, Ben <ben.u...@bsb.me.uk> declaimed
>> the following:
>>>
>>> I don't know much about Ada newer than about 1990. I'll take a look...
>>
>> My condolences
>
> Thank, but I'm fine. Knowing was not intended to imply forced to use.
>
>> -- taken literally, that means you are working with
>> Ada-83 (ANSI/Mil-Std 1815A -- later ISO-8652:1987). The first significant
>> update was Ada-95 (and Air Force funded original GNAT).
>
> That was the only Ada I knew, though I knew about the updates of
> course. Couldn't find any reference to type inference though.


As far as I know, the only type inferencing that occur in Ada is in
for-loops where the type of the loop parameter variable is inferred from
the range or container over which the loop iterates.


> Is there a good place to go for a "summary of changes" between standards?


Each version of the Reference Manual has an "Introduction" chapter that
contains a subheading "Language Changes", but those are quite terse. If
you can find a "Rationale" document for the version in question that
usually has much more information about the changes.

For Ada 95:
https://www.adaic.org/resources/add_content/standards/95rat/rat95html/rat95-contents.html

For Ada 2005: https://www.adaic.org/ada-resources/standards/ada05/

For Ada 2012: http://www.ada-auth.org/standards/rationale12.html

For Ada 2022, see the Intro in the RM:
http://www.ada-auth.org/standards/ada2x.html

For Ada 2022 I don't think there is any "Rationale" document (yet), but
there are various summaries and introductions, for example
https://learn.adacore.com/courses/whats-new-in-ada-2022/chapters/introduction.html

HTH!

John Perry

unread,
Jun 3, 2022, 4:27:39 PM6/3/22
to
On Friday, June 3, 2022 at 1:34:39 PM UTC-5, Niklas Holsti wrote:
> As far as I know, the only type inferencing that occur in Ada is in
> for-loops where the type of the loop parameter variable is inferred from
> the range or container over which the loop iterates.

FWIW I was referring to the optional specification of type in a renames clause, which I first read about here:

https://blog.adacore.com/ada-202x-support-in-gnat

(section "Renames with type inference").

regards
john perry

Ben

unread,
Jun 3, 2022, 4:57:01 PM6/3/22
to
Niklas Holsti <niklas...@tidorum.invalid> writes:

> On 2022-06-03 21:13, Ben wrote:
<cut>
>> Is there a good place to go for a "summary of changes" between standards?
>
> Each version of the Reference Manual has an "Introduction" chapter that contains a subheading "Language Changes", but those are quite terse. If
> you can find a "Rationale" document for the version in question that usually has much more information about the changes.
>
> For Ada 95: https://www.adaic.org/resources/add_content/standards/95rat/rat95html/rat95-contents.html
>
> For Ada 2005: https://www.adaic.org/ada-resources/standards/ada05/
>
> For Ada 2012: http://www.ada-auth.org/standards/rationale12.html
>
> For Ada 2022, see the Intro in the RM: http://www.ada-auth.org/standards/ada2x.html
>
> For Ada 2022 I don't think there is any "Rationale" document (yet), but there are various summaries and introductions, for example
> https://learn.adacore.com/courses/whats-new-in-ada-2022/chapters/introduction.html

Thanks for the links.

--
Ben.

Randy Brukardt

unread,
Jun 3, 2022, 8:28:28 PM6/3/22
to
"Niklas Holsti" <niklas...@tidorum.invalid> wrote in message
news:jfv2hs...@mid.individual.net...
...
> Each version of the Reference Manual has an "Introduction" chapter that
> contains a subheading "Language Changes", but those are quite terse. If
> you can find a "Rationale" document for the version in question that
> usually has much more information about the changes.
>
....
> For Ada 2022, see the Intro in the RM:
> http://www.ada-auth.org/standards/ada2x.html
>
> For Ada 2022 I don't think there is any "Rationale" document (yet), but
> there are various summaries and introductions, for example
> https://learn.adacore.com/courses/whats-new-in-ada-2022/chapters/introduction.html

It is not likely that there will be an Ada 2022 Rationale, as no one has
stepped up to write it or pay John Barnes write it. The closest thing we
have is the Jeff Cousins overview, which I can't find an on-line reference
to (or my copy, for that matter). I'll check with Jeff and hopefully get
more information.

Randy.


Dirk Craeynest

unread,
Jun 4, 2022, 8:05:57 AM6/4/22
to
In article <t7e8v9$3et$1...@dont-email.me>,
Randy Brukardt <ra...@rrsoftware.com> wrote:
>"Niklas Holsti" <niklas...@tidorum.invalid> wrote in message
>news:jfv2hs...@mid.individual.net...
[...]
>> For Ada 2022, see the Intro in the RM:
>> http://www.ada-auth.org/standards/ada2x.html
>>
>> For Ada 2022 I don't think there is any "Rationale" document (yet), but
>> there are various summaries and introductions, for example
[...]
>It is not likely that there will be an Ada 2022 Rationale, as no one has
>stepped up to write it or pay John Barnes write it. The closest thing we
>have is the Jeff Cousins overview, which I can't find an on-line reference
>to (or my copy, for that matter). I'll check with Jeff and hopefully get
>more information.
> Randy.

Two additional sources of information on Ada 2022 exist:
- the Ada User Journal;
- the new book by John Barnes.

The Ada User Journal (AUJ, http://www.ada-europe.org/auj/home) has
published several articles the last few years about the changes in
Ada 2022 (then called Ada 220x).

The latest contribution was the above mentioned overview by Jeff
Cousins. It is available from the AUJ online archive:

Ada User Journal, Volume 41, Number 3, September 2020
Jeff Cousins: "An Overview of Ada 202x", pp.159-175
http://www.ada-europe.org/archive/auj/auj-41-3-withcovers.pdf?page=43

And then there's of course the new edition of John Barnes' book:

"Programming in Ada 2012 with a Preview of Ada 2022"
https://www.cambridge.org/core/books/programming-in-ada-2012-with-a-preview-of-ada-2022/AD30275F35CCECB97EAB80ABC32B019C

Previews of the various sections are available on the cambridge.org
site mentioned above, such as the first page of the Preface at
https://www.cambridge.org/core/books/abs/programming-in-ada-2012-with-a-preview-of-ada-2022/preface/21277D825A1D24906949F642B4AD8BE8

That page includes:
"[...] the main chapters describe the 2016 updated version of Ada
2012 in detail. The book concludes with a major appendix describing
the key new features of Ada 2022".
(2016 refers to the year of publication by ISO of the Corrigendum
which revised Ada 2012.)

I asked John Barnes about the differences between the original
"Programming in Ada 2012" and this new book, apart from the extra
appendix on Ada 2022. He provided the following info.

"The main changes are twofold.

In the main body, I have updated it to cover all changes introduced
by the 2016 corrigendum. I have corrected all known errors (there
were quite a lot) and many cross references were wrong.

An idea of the amount of change can be gathered by noting that the
original version had just 6 AIs mentioned in the Index. The new
edition mentions 55 AIs in the index.

I also updated the text of the main body to use aspects rather than
pragmas where relevant.

So the body is now Ada 2016 although we don't usually talk about
that.

The new appendix (46 pages) covers all major features of Ada
2022. The associated website also has things such as the full
syntax for Ada 2022 in a style matching the book (that's another
30 pages). Also an updated table of the facilities in containers
(14 pages). And some worked examples using new features especially
using the big integer packages (currently another 14 pages).

Each chapter of the main book ends with a checklist outlining the
new features and referring to the appropriate place in appendix 4
where they are discussed.

-- John Barnes, 14 May 2022, with permission"

I hope this helps.

Dirk Craeynest

Jerry

unread,
Jun 6, 2022, 7:26:45 PM6/6/22
to
On Thursday, June 2, 2022 at 1:37:24 AM UTC-7, Dmitry A. Kazakov wrote:

<snip>
> Programming by the emoji is the future!
>
> --
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

Agreed. Plus, it is more important to express how you feel about your code than it is to have correct code.

Jerry

Wesley Pan

unread,
Jun 17, 2022, 1:33:10 PM6/17/22
to
On Friday, June 3, 2022 at 5:28:28 PM UTC-7, Randy Brukardt wrote:
> It is not likely that there will be an Ada 2022 Rationale, as no one has
> stepped up to write it or pay John Barnes write it. The closest thing we
> have is the Jeff Cousins overview, which I can't find an on-line reference
> to (or my copy, for that matter). I'll check with Jeff and hopefully get
> more information.
>
> Randy.

How much would it likely cost to pay someone to generate the Ada2022 rationale? Maybe the community can join together to help fund the work?

-Wesley

Paul Rubin

unread,
Jun 17, 2022, 4:46:21 PM6/17/22
to
Wesley Pan <wesley...@gmail.com> writes:
> How much would it likely cost to pay someone to generate the Ada2022
> rationale? Maybe the community can join together to help fund the
> work?

Compared to Ada 2012, the 2022 changes look fairly modest.

Randy Brukardt

unread,
Jun 17, 2022, 10:06:19 PM6/17/22
to

"Wesley Pan" <wesley...@gmail.com> wrote in message
news:66a25bd1-e92c-477a...@googlegroups.com...
Dunno, you'd have to ask John.

I did get a copy of Jeff Cousin's overview that I'll put up on Ada-Auth.org
when I get time (probably not until next month).

Randy.


Dirk Craeynest

unread,
Jun 18, 2022, 6:29:05 AM6/18/22
to
>> On Friday, June 3, 2022 at 5:28:28 PM UTC-7, Randy Brukardt wrote:
>>> It is not likely that there will be an Ada 2022 Rationale, as no one
>>> has stepped up to write it or pay John Barnes write it. The closest
>>> thing we have is the Jeff Cousins overview, which I can't find an
>>> on-line reference to (or my copy, for that matter). I'll check with
>>> Jeff and hopefully get more information.

>"Wesley Pan" <wesley...@gmail.com> wrote [...]:
>> How much would it likely cost to pay someone to generate the Ada2022
>> rationale? Maybe the community can join together to help fund the work?

In article <t8jbuo$hov$1...@dont-email.me>,
Randy Brukardt <ra...@rrsoftware.com> wrote:
>
> Dunno, you'd have to ask John.
>
> I did get a copy of Jeff Cousin's overview that I'll put up on
> Ada-Auth.org when I get time (probably not until next month).

See my follow-up to Randy's June 3 posting quoted above, that I
posted on 4 Jun in this newsgroup with subject "What's new in Ada
2022?" (copied below).

Executive summary:

- John Barnes wrote a 46 page overview on what's new in Ada 2022;
it is available as a new appendix in his latest book "Programming
in Ada 2012 with a Preview of Ada 2022";

- Jeff Cousin's overview was published in the Ada User Journal (AUJ),
and is already available in the online AUJ archive.

Recent addition:

Earlier this week, Tucker Taft presented a very interesting half-day
tutorial "Moving up to Ada 2022" at the 26th Ada-Europe International
Conference on Reliable Software Technologies (AEiC 2022), held in
Ghent, Belgium. The event was announced in this newsgroup and via
various mailing lists and social platforms. Tutorial participants
got a nice overview of what's new in Ada 2022 and practical examples
of how to use the new features.
(http://www.ada-europe.org/conference2022/tutorials.html#T1).

To conclude, I repeat below my earlier posting with more information
on, and pointers to, John's and Jeff's contributions:

From: di...@orka.cs.kuleuven.be. (Dirk Craeynest)
Newsgroups: comp.lang.ada
Subject: What's new in Ada 2022? (was: Re: who needs types? Types makes code ugly.)
Date: Sat, 4 Jun 2022 12:05:55 -0000 (UTC)
Organization: Ada-Belgium, c/o Dept. of Computer Science, KU Leuven
Summary: See contributions in Ada User Journal or new book by John Barnes

In article <t7e8v9$3et$1...@dont-email.me>,
Randy Brukardt <ra...@rrsoftware.com> wrote:
>"Niklas Holsti" <niklas...@tidorum.invalid> wrote in message
>news:jfv2hs...@mid.individual.net...
[...]
>> For Ada 2022, see the Intro in the RM:
>> http://www.ada-auth.org/standards/ada2x.html
>>
>> For Ada 2022 I don't think there is any "Rationale" document (yet), but
>> there are various summaries and introductions, for example
[...]
>It is not likely that there will be an Ada 2022 Rationale, as no one has
>stepped up to write it or pay John Barnes write it. The closest thing we
>have is the Jeff Cousins overview, which I can't find an on-line reference
>to (or my copy, for that matter). I'll check with Jeff and hopefully get
>more information.
> Randy.

Paul Rubin

unread,
Jun 18, 2022, 6:16:50 PM6/18/22
to
di...@orka.cs.kuleuven.be. (Dirk Craeynest) writes:
> To conclude, I repeat below my earlier posting with more information
> on, and pointers to, John's and Jeff's contributions: ...
> I hope this helps.

Yes, thanks, those references are useful for understanding the changes
introduced in Ada 2022. I had thought the idea of a formal rationale
was different: not just to explain the changes, but also to explain from
an authoritative standpoint why the decisions were made. I don't know
how important rationales traditionally been in the Ada world. But, Ada
2012 introduced a much larger set of changes than Ada 2022 did. So I
can understand if a rationale was more important in 2012 than in 2022.

I guess if higher-end Ada community thought that a 2022 rationale was
necessary, they would have required it and funded it. As a
not-so-serious user or wannabe user, I don't think I need it, but that's
just me.

I do notice long after reading "Ada Distilled" that most of the
discussions on this group about technical aspects of Ada still baffle
me. So I think a more advanced online tutorial would do some good. I
believe the current Ada Wikibook is nice for beginners but doesn't cover
more advanced topics all that well.

Randy Brukardt

unread,
Jun 20, 2022, 5:47:36 PM6/20/22
to
"Dirk Craeynest" <di...@orka.cs.kuleuven.be.> wrote in message
news:t8k9de$54l$1...@dont-email.me...
>>> On Friday, June 3, 2022 at 5:28:28 PM UTC-7, Randy Brukardt wrote:
>>>> It is not likely that there will be an Ada 2022 Rationale, as no one
>>>> has stepped up to write it or pay John Barnes write it. The closest
>>>> thing we have is the Jeff Cousins overview, which I can't find an
>>>> on-line reference to (or my copy, for that matter). I'll check with
>>>> Jeff and hopefully get more information.
>
In article <t8jbuo$hov$1...@dont-email.me>,
> Randy Brukardt <ra...@rrsoftware.com> wrote:
...
>> I did get a copy of Jeff Cousin's overview that I'll put up on
>> Ada-Auth.org when I get time (probably not until next month).
>
> See my follow-up to Randy's June 3 posting quoted above, that I
> posted on 4 Jun in this newsgroup with subject "What's new in Ada
> 2022?" (copied below).
...
> - John Barnes wrote a 46 page overview on what's new in Ada 2022;
> it is available as a new appendix in his latest book "Programming
> in Ada 2012 with a Preview of Ada 2022";
>
> - Jeff Cousin's overview was published in the Ada User Journal (AUJ),
> and is already available in the online AUJ archive.

Correct. The version of Jeff's overview I have is quite a bit newer than the
version from the AUJ, and has many errors corrected. So I would suggest
reading that version rather than the original AUJ version (but of course,
only once I can get it posted).

Randy.


0 new messages