* Learning Ada
@ 2020-09-15 10:36 Jack Davy
2020-09-15 14:31 ` Anders Wirzenius
2020-09-15 17:01 ` Simon Wright
0 siblings, 2 replies; 51+ messages in thread
From: Jack Davy @ 2020-09-15 10:36 UTC (permalink / raw)
I've just started learning Ada and am using the book "Ada95: The Craft of Object Oriented Programming", by John English. I know there are plenty of other resources such as the one on Adacore, which covers Ada 2012, but I like the style and flow of this book. Anyway, I was wondering whether anyone in the group has the answers to the end of chapter exercises? The author has now retired and the link to them is dead.
Thanks in Advance!
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-15 10:36 Learning Ada Jack Davy
@ 2020-09-15 14:31 ` Anders Wirzenius
2020-09-15 15:07 ` Jack Davy
2020-09-15 17:01 ` Simon Wright
1 sibling, 1 reply; 51+ messages in thread
From: Anders Wirzenius @ 2020-09-15 14:31 UTC (permalink / raw)
Jack Davy <jules1.davy@gmail.com> writes:
> I've just started learning Ada and am using the book "Ada95: The Craft
> of Object Oriented Programming", by John English. I know there are
> plenty of other resources such as the one on Adacore, which covers Ada
> 2012, but I like the style and flow of this book. Anyway, I was
> wondering whether anyone in the group has the answers to the end of
> chapter exercises? The author has now retired and the link to them is
> dead.
> Thanks in Advance!
Maybe this helps:
http://archive.adaic.com/docs/craft/craft.html
--
Anders
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-15 14:31 ` Anders Wirzenius
@ 2020-09-15 15:07 ` Jack Davy
2020-09-15 15:54 ` Ludovic Brenta
0 siblings, 1 reply; 51+ messages in thread
From: Jack Davy @ 2020-09-15 15:07 UTC (permalink / raw)
On Tuesday, September 15, 2020 at 3:32:00 PM UTC+1, Anders Wirzenius wrote:
> Jack Davy <jules...@gmail.com> writes:
>
> > I've just started learning Ada and am using the book "Ada95: The Craft
> > of Object Oriented Programming", by John English. I know there are
> > plenty of other resources such as the one on Adacore, which covers Ada
> > 2012, but I like the style and flow of this book. Anyway, I was
> > wondering whether anyone in the group has the answers to the end of
> > chapter exercises? The author has now retired and the link to them is
> > dead.
> > Thanks in Advance!
> Maybe this helps:
>
> http://archive.adaic.com/docs/craft/craft.html
>
> --
> Anders
Thanks Anders, but I already found that link. The download has the code for the book, but no answers. I guess it's not important, I just thought it would be nice to see some sample solutions.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-15 15:07 ` Jack Davy
@ 2020-09-15 15:54 ` Ludovic Brenta
0 siblings, 0 replies; 51+ messages in thread
From: Ludovic Brenta @ 2020-09-15 15:54 UTC (permalink / raw)
Jack Davy <algojack@tutanota.com> writes:
> On Tuesday, September 15, 2020 at 3:32:00 PM UTC+1, Anders Wirzenius wrote:
>> Jack Davy <jules...@gmail.com> writes:
>>
>> > I've just started learning Ada and am using the book "Ada95: The Craft
>> > of Object Oriented Programming", by John English. I know there are
>> > plenty of other resources such as the one on Adacore, which covers Ada
>> > 2012, but I like the style and flow of this book. Anyway, I was
>> > wondering whether anyone in the group has the answers to the end of
>> > chapter exercises? The author has now retired and the link to them is
>> > dead.
>> > Thanks in Advance!
>> Maybe this helps:
>>
>> http://archive.adaic.com/docs/craft/craft.html
>>
>> --
>> Anders
> Thanks Anders, but I already found that link. The download has the
> code for the book, but no answers. I guess it's not important, I just
> thought it would be nice to see some sample solutions.
I don't have an answer to your exact question but there is no shortage
of "sample solutions" in Ada on https://rosettacode.org/wiki/Category:Ada
HTH
PS. I still consider John English's book to be the best introduction to
Ada.
--
Ludovic Brenta.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-15 10:36 Learning Ada Jack Davy
2020-09-15 14:31 ` Anders Wirzenius
@ 2020-09-15 17:01 ` Simon Wright
2020-09-15 17:07 ` Simon Wright
1 sibling, 1 reply; 51+ messages in thread
From: Simon Wright @ 2020-09-15 17:01 UTC (permalink / raw)
Jack Davy <jules1.davy@gmail.com> writes:
> I've just started learning Ada and am using the book "Ada95: The Craft
> of Object Oriented Programming", by John English. I know there are
> plenty of other resources such as the one on Adacore, which covers Ada
> 2012, but I like the style and flow of this book. Anyway, I was
> wondering whether anyone in the group has the answers to the end of
> chapter exercises? The author has now retired and the link to them is
> dead.
Try here: https://www.dropbox.com/s/8k4xxpj5a67s752/adacraft.tar.gz?dl=0
Nothing like being a pack rat! my hard disk copy is dated 2012-8-25, but
I don't know when I retrieved it, must ahve been several computers
ago. Internal dates up to 2001-07-27. Readme says examples tested with
GNAT 3.13p!
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-15 17:01 ` Simon Wright
@ 2020-09-15 17:07 ` Simon Wright
2020-09-15 19:03 ` Jack Davy
0 siblings, 1 reply; 51+ messages in thread
From: Simon Wright @ 2020-09-15 17:07 UTC (permalink / raw)
Simon Wright <simon@pushface.org> writes:
> Jack Davy <jules1.davy@gmail.com> writes:
>
>> I've just started learning Ada and am using the book "Ada95: The Craft
>> of Object Oriented Programming", by John English. I know there are
>> plenty of other resources such as the one on Adacore, which covers Ada
>> 2012, but I like the style and flow of this book. Anyway, I was
>> wondering whether anyone in the group has the answers to the end of
>> chapter exercises? The author has now retired and the link to them is
>> dead.
>
> Try here: https://www.dropbox.com/s/8k4xxpj5a67s752/adacraft.tar.gz?dl=0
>
> Nothing like being a pack rat! my hard disk copy is dated 2012-8-25, but
> I don't know when I retrieved it, must ahve been several computers
> ago. Internal dates up to 2001-07-27. Readme says examples tested with
> GNAT 3.13p!
Actually, they are at adaic.com:
http://archive.adaic.com/docs/craft/craft.html, see the third bullet point.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-15 17:07 ` Simon Wright
@ 2020-09-15 19:03 ` Jack Davy
2020-09-15 19:28 ` Gautier write-only
` (2 more replies)
0 siblings, 3 replies; 51+ messages in thread
From: Jack Davy @ 2020-09-15 19:03 UTC (permalink / raw)
On Tuesday, September 15, 2020 at 6:07:16 PM UTC+1, Simon Wright wrote:
> Simon Wright <si...@pushface.org> writes:
>
> > Jack Davy <jules...@gmail.com> writes:
> >
> >> I've just started learning Ada and am using the book "Ada95: The Craft
> >> of Object Oriented Programming", by John English. I know there are
> >> plenty of other resources such as the one on Adacore, which covers Ada
> >> 2012, but I like the style and flow of this book. Anyway, I was
> >> wondering whether anyone in the group has the answers to the end of
> >> chapter exercises? The author has now retired and the link to them is
> >> dead.
> >
> > Try here: https://www.dropbox.com/s/8k4xxpj5a67s752/adacraft.tar.gz?dl=0
> >
> > Nothing like being a pack rat! my hard disk copy is dated 2012-8-25, but
> > I don't know when I retrieved it, must ahve been several computers
> > ago. Internal dates up to 2001-07-27. Readme says examples tested with
> > GNAT 3.13p!
> Actually, they are at adaic.com:
> http://archive.adaic.com/docs/craft/craft.html, see the third bullet point.
@ Ludovic, thanks for the link to rosettacode; very good source of examples. And good to hear that you rate the book highly. There don't seem to be many books on Ada, but there is a very recent one for beginners which I will probably get to fill in the gaps not covered by "The Craft". https://www.apress.com/gp/book/9781484254271
@ Simon, thanks, but I already have that file. It contains all the code in the book but not the answers to the end of chapter questions.
By the way, I see the author also wrote a GUI libary for Ada called JEWL, the files for which I have also downloaded. Pity it's for Windows only. I'm a Linux user although I do have Win XP on VirtualBox, but I don't believe the current GNAT compiler will run on it.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-15 19:03 ` Jack Davy
@ 2020-09-15 19:28 ` Gautier write-only
2020-09-15 23:00 ` Jerry Petrey
2020-09-16 1:23 ` Paul Rubin
2 siblings, 0 replies; 51+ messages in thread
From: Gautier write-only @ 2020-09-15 19:28 UTC (permalink / raw)
Other sample sources:
Ada resources:
- https://sourceforge.net/directory/language:ada/
- https://www.adaic.org/ada-resources/
Small samples are embedded in the LEA editor (you can run it from Wine):
https://sourceforge.net/projects/l-e-a/
From the menu: Action / Code sample. Choose your sample. Hit F9 for running.
Some samples stem from Rosetta Code BTW :-)
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-15 19:03 ` Jack Davy
2020-09-15 19:28 ` Gautier write-only
@ 2020-09-15 23:00 ` Jerry Petrey
2020-09-16 1:23 ` Paul Rubin
2 siblings, 0 replies; 51+ messages in thread
From: Jerry Petrey @ 2020-09-15 23:00 UTC (permalink / raw)
On 9/15/20 12:03, Jack Davy wrote:
> By the way, I see the author also wrote a GUI libary for Ada called JEWL, the files for which I have also downloaded. Pity it's for Windows only. I'm a Linux user although I do have Win XP on VirtualBox, but I don't believe the current GNAT compiler will run on it.
>
Yes, his JEWL package is great. I used it many times to create Windows
GUI apps and still use it some. I talked to John a number of times - he
was very helpful. His book is one of the best!
Jerry
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-15 19:03 ` Jack Davy
2020-09-15 19:28 ` Gautier write-only
2020-09-15 23:00 ` Jerry Petrey
@ 2020-09-16 1:23 ` Paul Rubin
2020-09-16 7:13 ` Jack Davy
2 siblings, 1 reply; 51+ messages in thread
From: Paul Rubin @ 2020-09-16 1:23 UTC (permalink / raw)
Jack Davy <algojack@tutanota.com> writes:
> seem to be many books on Ada, but there is a very recent one for
> beginners which I will probably get to fill in the gaps not covered by
> "The Craft". https://www.apress.com/gp/book/9781484254271
I haven't examined that book directly but based on the preview and
blurb, it does seem to be beginner oriented, thus likely to have gaps of
its own. If you're trying to fill gaps, you probably want something
more complete and advanced.
I semi-recently got another book that looks very good, though it's still
sitting around without my having read much of it: Analysable Real-Time
Systems: Programmed in Ada, by Andy Wellings and Alan Burns. It is
basically an updated reprint of an older book by the same authors,
self-published in paperback, so it is a good value.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-16 1:23 ` Paul Rubin
@ 2020-09-16 7:13 ` Jack Davy
2020-09-16 7:32 ` Jack Davy
` (5 more replies)
0 siblings, 6 replies; 51+ messages in thread
From: Jack Davy @ 2020-09-16 7:13 UTC (permalink / raw)
On Wednesday, September 16, 2020 at 2:23:21 AM UTC+1, Paul Rubin wrote:
> Jack Davy <algo...@tutanota.com> writes:
> > seem to be many books on Ada, but there is a very recent one for
> > beginners which I will probably get to fill in the gaps not covered by
> > "The Craft". https://www.apress.com/gp/book/9781484254271
> I haven't examined that book directly but based on the preview and
> blurb, it does seem to be beginner oriented, thus likely to have gaps of
> its own. If you're trying to fill gaps, you probably want something
> more complete and advanced.
>
> I semi-recently got another book that looks very good, though it's still
> sitting around without my having read much of it: Analysable Real-Time
> Systems: Programmed in Ada, by Andy Wellings and Alan Burns. It is
> basically an updated reprint of an older book by the same authors,
> self-published in paperback, so it is a good value.
@ Gautier, thanks for the links. When I get Windows 7 on VirtualBox I'll give the LEA editor a try, I'm not so keen on using Wine, it's a bit hit & miss. Also since I learned Vim a few years ago no other editors really do it for me, unless they have Vim bindings ;).
@ Paul, I was thinking that the beginner's Apress book would fill in the gaps regarding Ada 2012 specifically, which as I understand it has changed from previous versions mainly in regard to OOP; I'm assuming I won't need to unlearn anything if I learn the basics from an Ada 95 book. The real-time stuff would be over my head at this point I think, and not really something I had in mind when considering Ada, although I do have a background in electronics, and see that there is Ada compiler for AVR on adacore.
The more I look at this language the more I wonder why it isn't more popular. Maybe people just don't like the pascalish syntax, but that never put me off because I learned Turbo Pascal at Uni (25 years ago) and more recently Free Pascal/Lazarus. Never was much of a fan of the curly bracket languages.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-16 7:13 ` Jack Davy
@ 2020-09-16 7:32 ` Jack Davy
2020-09-16 9:13 ` Gautier write-only
` (4 subsequent siblings)
5 siblings, 0 replies; 51+ messages in thread
From: Jack Davy @ 2020-09-16 7:32 UTC (permalink / raw)
On Wednesday, September 16, 2020 at 8:13:23 AM UTC+1, Jack Davy wrote:
> On Wednesday, September 16, 2020 at 2:23:21 AM UTC+1, Paul Rubin wrote:
> > Jack Davy <algo...@tutanota.com> writes:
> > > seem to be many books on Ada, but there is a very recent one for
> > > beginners which I will probably get to fill in the gaps not covered by
> > > "The Craft". https://www.apress.com/gp/book/9781484254271
> > I haven't examined that book directly but based on the preview and
> > blurb, it does seem to be beginner oriented, thus likely to have gaps of
> > its own. If you're trying to fill gaps, you probably want something
> > more complete and advanced.
> >
> > I semi-recently got another book that looks very good, though it's still
> > sitting around without my having read much of it: Analysable Real-Time
> > Systems: Programmed in Ada, by Andy Wellings and Alan Burns. It is
> > basically an updated reprint of an older book by the same authors,
> > self-published in paperback, so it is a good value.
> @ Gautier, thanks for the links. When I get Windows 7 on VirtualBox I'll give the LEA editor a try, I'm not so keen on using Wine, it's a bit hit & miss. Also since I learned Vim a few years ago no other editors really do it for me, unless they have Vim bindings ;).
>
> @ Paul, I was thinking that the beginner's Apress book would fill in the gaps regarding Ada 2012 specifically, which as I understand it has changed from previous versions mainly in regard to OOP; I'm assuming I won't need to unlearn anything if I learn the basics from an Ada 95 book. The real-time stuff would be over my head at this point I think, and not really something I had in mind when considering Ada, although I do have a background in electronics, and see that there is Ada compiler for AVR on adacore.
>
> The more I look at this language the more I wonder why it isn't more popular. Maybe people just don't like the pascalish syntax, but that never put me off because I learned Turbo Pascal at Uni (25 years ago) and more recently Free Pascal/Lazarus. Never was much of a fan of the curly bracket languages.
I found an impressive list of 'Things to like about Ada' posted by a C/C++ career programmer on the AVR freaks forum (in reply #13) : https://www.avrfreaks.net/forum/i-didnt-know-you-could-get-ada-avr
My main reason for wanting to learn Ada is the last on his list :
"Promotes a professional, anti-hacker mentality.
By being unforgiving the language promotes the valuable discipline of specifying and writing code more exactly, without the temptations of slipping into bit-twiddling or other programming habits that subvert (and often break) the data or code models. When proper programming discipline is not enforced by the language then it must be voluntary, and in those cases discipline can and inevitably will slip, but when the language enforces much of that discipline then there are no easy ways to avoid it, and the resulting code is higher in quality and faster to develop."
Maybe that's why Ada isn't more popular - being disciplined isn't easy, and hacking is more fun. But I've learned the hard way that it's actually much more satisfying when your programs are bug-free and work properly the first time you run them. Any language which enforces more thinking and less trial-and-error coding is a winner in my book.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-16 7:13 ` Jack Davy
2020-09-16 7:32 ` Jack Davy
@ 2020-09-16 9:13 ` Gautier write-only
2020-09-16 10:55 ` Ludovic Brenta
` (3 subsequent siblings)
5 siblings, 0 replies; 51+ messages in thread
From: Gautier write-only @ 2020-09-16 9:13 UTC (permalink / raw)
On Wednesday, September 16, 2020 at 9:13:23 AM UTC+2, Jack Davy wrote:
> @ Gautier, thanks for the links. When I get Windows 7 on VirtualBox I'll give the LEA editor a try, I'm not so keen on using Wine, it's a bit hit & miss. Also since I learned Vim a few years ago no other editors really do it for me, unless they have Vim bindings ;).
No worries, you can access the same samples (and the same compiler) without LEA, built on your preferred operating system.
-> https://hacadacompiler.sourceforge.io/ (source code here: https://sourceforge.net/p/hacadacompiler/code/HEAD/tree/ , mirrored here: https://github.com/zertovitch/hac )
Mutatis mutandis, you get there the "tpc.exe" equivalent, whereas LEA is the "turbo.exe" :-)
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-16 7:13 ` Jack Davy
2020-09-16 7:32 ` Jack Davy
2020-09-16 9:13 ` Gautier write-only
@ 2020-09-16 10:55 ` Ludovic Brenta
2020-09-16 11:09 ` Dmitry A. Kazakov
2020-09-16 15:01 ` Jeffrey R. Carter
` (2 subsequent siblings)
5 siblings, 1 reply; 51+ messages in thread
From: Ludovic Brenta @ 2020-09-16 10:55 UTC (permalink / raw)
Jack Davy <algojack@tutanota.com> writes:
> The more I look at this language the more I wonder why it isn't more
> popular. Maybe people just don't like the pascalish syntax, but that
> never put me off because I learned Turbo Pascal at Uni (25 years ago)
> and more recently Free Pascal/Lazarus. Never was much of a fan of the
> curly bracket languages.
I wasn't there when it happened but I read that early Ada 83 compilers
were buggy, slow and outrageously expensive because marketed only at one
captive customer, the US DoD. (In their defence, Ada is a prticularly
difficult language to implement well, orders of magnitude more so than
Pascal or C). The vendors never really tried to sell Ada development
tools outside the military, despite hype that Ada was the language of
the future. At around the same time, C++ used the opposite strategy of
selling cheap compilers, with the additional advantage of backward
compatibility with C, so they won market share. Turbo Pascal was a
contender back then but only on DOS and Windows, so it ultimately lost
to C++, possibly in no small part because of Borland's refusal to abide
by any portable standard. And then Sun marketed Java aggressively with
a zero-cost compiler and promises of ultimate portability, and stole the
show.
The Ada landcsape changed dramatically when the first Free Sofwtare Ada
95 compiler, gnat, arrived, but the damage to the reputation of Ada was
very hard to overcome. An entire generation of military and corporate
programmers, frustrated by the early compilers, became managers and
dismissed Ada out of hand for decades. They and their prejudices have
started to retire in the past few years and I think this is one factor
in the current renaissance of Ada.
--
Ludovic Brenta.
The market thinker synergizes the cross-enterprise trends.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-16 10:55 ` Ludovic Brenta
@ 2020-09-16 11:09 ` Dmitry A. Kazakov
2020-10-02 18:43 ` gautier...@hotmail.com
0 siblings, 1 reply; 51+ messages in thread
From: Dmitry A. Kazakov @ 2020-09-16 11:09 UTC (permalink / raw)
On 16/09/2020 12:55, Ludovic Brenta wrote:
> Jack Davy <algojack@tutanota.com> writes:
>> The more I look at this language the more I wonder why it isn't more
>> popular. Maybe people just don't like the pascalish syntax, but that
>> never put me off because I learned Turbo Pascal at Uni (25 years ago)
>> and more recently Free Pascal/Lazarus. Never was much of a fan of the
>> curly bracket languages.
>
> I wasn't there when it happened but I read that early Ada 83 compilers
> were buggy, slow and outrageously expensive because marketed only at one
> captive customer, the US DoD. (In their defence, Ada is a prticularly
> difficult language to implement well, orders of magnitude more so than
> Pascal or C). The vendors never really tried to sell Ada development
> tools outside the military, despite hype that Ada was the language of
> the future. At around the same time, C++ used the opposite strategy of
> selling cheap compilers, with the additional advantage of backward
> compatibility with C, so they won market share. Turbo Pascal was a
> contender back then but only on DOS and Windows, so it ultimately lost
> to C++, possibly in no small part because of Borland's refusal to abide
> by any portable standard. And then Sun marketed Java aggressively with
> a zero-cost compiler and promises of ultimate portability, and stole the
> show.
>
> The Ada landcsape changed dramatically when the first Free Sofwtare Ada
> 95 compiler, gnat, arrived, but the damage to the reputation of Ada was
> very hard to overcome. An entire generation of military and corporate
> programmers, frustrated by the early compilers, became managers and
> dismissed Ada out of hand for decades. They and their prejudices have
> started to retire in the past few years and I think this is one factor
> in the current renaissance of Ada.
I mostly agree with your analysis, except the last part. The problem is
that the culture of programming and overall education became so low that
it is no more a race against C++. C++ itself is in defense and losing
against languages and practices so overwhelmingly bad that even C looks
as a shining beacon. Winter is coming.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-16 11:09 ` Dmitry A. Kazakov
@ 2020-10-02 18:43 ` gautier...@hotmail.com
2020-10-03 6:43 ` Dmitry A. Kazakov
0 siblings, 1 reply; 51+ messages in thread
From: gautier...@hotmail.com @ 2020-10-02 18:43 UTC (permalink / raw)
On Wednesday, September 16, 2020 at 1:09:57 PM UTC+2, Dmitry A. Kazakov wrote:
> I mostly agree with your analysis, except the last part. The problem is
> that the culture of programming and overall education became so low that
> it is no more a race against C++. C++ itself is in defense and losing
> against languages and practices so overwhelmingly bad that even C looks
> as a shining beacon. Winter is coming.
20-30 years ago the pointy haired bosses would warmly recommend a buzzword called C++ (or something spelled "tchavasiblosblos" in some places) for Aïti projects, but now they all want a digital transformation strategy with blockchain and machine learning. I'm not sure if the level is really lower (we tend to make the past nicer in our minds). But clearly the notion of programming language was lost on the way :-) ...
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-10-02 18:43 ` gautier...@hotmail.com
@ 2020-10-03 6:43 ` Dmitry A. Kazakov
2020-10-05 18:36 ` Shark8
2020-10-17 19:28 ` antispam
0 siblings, 2 replies; 51+ messages in thread
From: Dmitry A. Kazakov @ 2020-10-03 6:43 UTC (permalink / raw)
On 02/10/2020 20:43, gautier...@hotmail.com wrote:
> On Wednesday, September 16, 2020 at 1:09:57 PM UTC+2, Dmitry A. Kazakov wrote:
>
>> I mostly agree with your analysis, except the last part. The problem is
>> that the culture of programming and overall education became so low that
>> it is no more a race against C++. C++ itself is in defense and losing
>> against languages and practices so overwhelmingly bad that even C looks
>> as a shining beacon. Winter is coming.
>
> 20-30 years ago the pointy haired bosses would warmly recommend a buzzword called C++ (or something spelled "tchavasiblosblos" in some places) for Aïti projects, but now they all want a digital transformation strategy with blockchain and machine learning. I'm not sure if the level is really lower (we tend to make the past nicer in our minds). But clearly the notion of programming language was lost on the way :-) ...
Well, the method of ML used in these days goes back to an idea from
50's. It was promptly discarded then as too weak to solve elementary
classification problems. The AI of late 80's was far more diversified,
advanced and powerful than this mockery, yet it died peacefully, because
of limitations it had. I don't even know what to think about all this.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-10-03 6:43 ` Dmitry A. Kazakov
@ 2020-10-05 18:36 ` Shark8
2020-10-17 19:28 ` antispam
1 sibling, 0 replies; 51+ messages in thread
From: Shark8 @ 2020-10-05 18:36 UTC (permalink / raw)
On Saturday, October 3, 2020 at 12:43:38 AM UTC-6, Dmitry A. Kazakov wrote:
> I don't even know what to think about all this.
"Marketing Hype."
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-10-03 6:43 ` Dmitry A. Kazakov
2020-10-05 18:36 ` Shark8
@ 2020-10-17 19:28 ` antispam
2020-10-17 22:47 ` Randy Brukardt
1 sibling, 1 reply; 51+ messages in thread
From: antispam @ 2020-10-17 19:28 UTC (permalink / raw)
Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
> On 02/10/2020 20:43, gautier...@hotmail.com wrote:
> > On Wednesday, September 16, 2020 at 1:09:57 PM UTC+2, Dmitry A. Kazakov wrote:
> >
> >> I mostly agree with your analysis, except the last part. The problem is
> >> that the culture of programming and overall education became so low that
> >> it is no more a race against C++. C++ itself is in defense and losing
> >> against languages and practices so overwhelmingly bad that even C looks
> >> as a shining beacon. Winter is coming.
> >
> > 20-30 years ago the pointy haired bosses would warmly recommend a buzzword called C++ (or something spelled "tchavasiblosblos" in some places) for A?ti projects, but now they all want a digital transformation strategy with blockchain and machine learning. I'm not sure if the level is really lower (we tend to make the past nicer in our minds). But clearly the notion of programming language was lost on the way :-) ...
>
> Well, the method of ML used in these days goes back to an idea from
> 50's. It was promptly discarded then as too weak to solve elementary
> classification problems. The AI of late 80's was far more diversified,
> advanced and powerful than this mockery, yet it died peacefully, because
> of limitations it had. I don't even know what to think about all this.
Hmm, I would say that progress from perceptron in 50 to current ANN
is bigger than progress from FORTRAN to Ada. Would you accept
critique of Ada based on experience with FORTRAN? Anyway,
ML researches tried various methods and currently ANN give
best results. Using methods from 80's it would be hard or
impossible to get results obtained by modern methods.
I would very much prefer more principled apprach than ANN,
but arguing against reality is not productive...
--
Waldek Hebisch
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-10-17 19:28 ` antispam
@ 2020-10-17 22:47 ` Randy Brukardt
2020-10-18 6:45 ` Dmitry A. Kazakov
0 siblings, 1 reply; 51+ messages in thread
From: Randy Brukardt @ 2020-10-17 22:47 UTC (permalink / raw)
<antispam@math.uni.wroc.pl> wrote in message
news:rmfglq$dlh$1@z-news.wcss.wroc.pl...
> Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
>> On 02/10/2020 20:43, gautier...@hotmail.com wrote:
>> > On Wednesday, September 16, 2020 at 1:09:57 PM UTC+2, Dmitry A. Kazakov
>> > wrote:
>> >
>> >> I mostly agree with your analysis, except the last part. The problem
>> >> is
>> >> that the culture of programming and overall education became so low
>> >> that
>> >> it is no more a race against C++. C++ itself is in defense and losing
>> >> against languages and practices so overwhelmingly bad that even C
>> >> looks
>> >> as a shining beacon. Winter is coming.
>> >
>> > 20-30 years ago the pointy haired bosses would warmly recommend a
>> > buzzword called C++ (or something spelled "tchavasiblosblos" in some
>> > places) for A?ti projects, but now they all want a digital
>> > transformation strategy with blockchain and machine learning. I'm not
>> > sure if the level is really lower (we tend to make the past nicer in
>> > our minds). But clearly the notion of programming language was lost on
>> > the way :-) ...
>>
>> Well, the method of ML used in these days goes back to an idea from
>> 50's. It was promptly discarded then as too weak to solve elementary
>> classification problems. The AI of late 80's was far more diversified,
>> advanced and powerful than this mockery, yet it died peacefully, because
>> of limitations it had. I don't even know what to think about all this.
>
> Hmm, I would say that progress from perceptron in 50 to current ANN
> is bigger than progress from FORTRAN to Ada. Would you accept
> critique of Ada based on experience with FORTRAN? Anyway,
> ML researches tried various methods and currently ANN give
> best results. Using methods from 80's it would be hard or
> impossible to get results obtained by modern methods.
>
> I would very much prefer more principled apprach than ANN,
> but arguing against reality is not productive...
The reality is that (non-artificial) intelligence seems to no longer exist,
at least where people have power. One can either try to alter that reality,
or accept impending doom. Not sure where I stand anymore on this.
Randy.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-10-17 22:47 ` Randy Brukardt
@ 2020-10-18 6:45 ` Dmitry A. Kazakov
0 siblings, 0 replies; 51+ messages in thread
From: Dmitry A. Kazakov @ 2020-10-18 6:45 UTC (permalink / raw)
On 18/10/2020 00:47, Randy Brukardt wrote:
> The reality is that (non-artificial) intelligence seems to no longer exist,
> at least where people have power. One can either try to alter that reality,
> or accept impending doom. Not sure where I stand anymore on this.
Huh, it is called democracy, egalitarianism, rule of the mob, each vote
counts etc. The aggregated intelligence of a crowd of people is below
the intelligence of its dumbest member. Neither deep hierarchies nor
flat organizations work well. Intelligence is there you need to pick it
up. E.g. perceptron does not work, but you could transform the inputs to
make it working. Transforming inputs, that is the idea, social networks,
media and search engines are working hard on altering the reality, do
not worry... (:-))
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-16 7:13 ` Jack Davy
` (2 preceding siblings ...)
2020-09-16 10:55 ` Ludovic Brenta
@ 2020-09-16 15:01 ` Jeffrey R. Carter
2020-09-18 6:53 ` Mart van de Wege
2020-09-16 21:29 ` Paul Rubin
2020-10-06 4:06 ` andrew...@gmail.com
5 siblings, 1 reply; 51+ messages in thread
From: Jeffrey R. Carter @ 2020-09-16 15:01 UTC (permalink / raw)
On 9/16/20 9:13 AM, Jack Davy wrote:
>
> The more I look at this language the more I wonder why it isn't more popular.
Ada is a language for engineering software. Since 98% of developers are unable
to do that, Ada will never be popular as long as such people are allowed to
develop software.
--
Jeff Carter
"IMHO, Interfaces are worthless."
Randy Brukardt
117
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-16 15:01 ` Jeffrey R. Carter
@ 2020-09-18 6:53 ` Mart van de Wege
2020-09-18 10:00 ` Jeffrey R. Carter
0 siblings, 1 reply; 51+ messages in thread
From: Mart van de Wege @ 2020-09-18 6:53 UTC (permalink / raw)
"Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> writes:
> On 9/16/20 9:13 AM, Jack Davy wrote:
>>
>> The more I look at this language the more I wonder why it isn't more popular.
>
> Ada is a language for engineering software. Since 98% of developers
> are unable to do that, Ada will never be popular as long as such
> people are allowed to develop software.
I use it for hobby stuff, for quick solutions (like generating RPG
characters). Does not feel like engineering to me.
But what I do like is the elegance of the language, and the ability to
describe my problem domain using distinct types.
The 'verbosity' does not bother me. I'm a fluent touch typist, Using the
shift key to type braces slows me more than typing out statements to
delineate blocks.
The only real nit I have with Ada is that it does not have closures.
Mart
--
"We will need a longer wall when the revolution comes."
--- AJS, quoting an uncertain source.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-18 6:53 ` Mart van de Wege
@ 2020-09-18 10:00 ` Jeffrey R. Carter
0 siblings, 0 replies; 51+ messages in thread
From: Jeffrey R. Carter @ 2020-09-18 10:00 UTC (permalink / raw)
On 9/18/20 8:53 AM, Mart van de Wege wrote:
>
> I use it for hobby stuff, for quick solutions (like generating RPG
> characters). Does not feel like engineering to me.
I do similar things, too, but I always have a design in mind, and usually start
with pkg, task, & PO specs and subprogram declarations, so I suspect that after
doing this for so long I can engineer simple problems in my head. Presumably
others with similar experience or who are better than I do the same.
--
Jeff Carter
"Crucifixion's a doddle."
Monty Python's Life of Brian
82
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-16 7:13 ` Jack Davy
` (3 preceding siblings ...)
2020-09-16 15:01 ` Jeffrey R. Carter
@ 2020-09-16 21:29 ` Paul Rubin
2020-10-06 4:06 ` andrew...@gmail.com
5 siblings, 0 replies; 51+ messages in thread
From: Paul Rubin @ 2020-09-16 21:29 UTC (permalink / raw)
Jack Davy <algojack@tutanota.com> writes:
> @ Paul, I was thinking that the beginner's Apress book would fill in
> the gaps regarding Ada 2012 specifically, which as I understand it has
> changed from previous versions mainly in regard to OOP
I think Ada 95 OOP is not really used very much, and the changes in Ada
2012 are things like contracts, and built-in SPARK syntax. You could
also look at the online book "Ada Distilled" which is about Ada 95. I
found it an ok way to get started, though I never really progressed
beyond that.
> I do have a background in electronics, and see that there is Ada
> compiler for AVR on adacore.
I don't know the current state of that, but some years ago it was rather
hard to use or parts were missing or whatever. These days, the AVR is
in decline since it is so limited. Everyone uses ARM or maybe soon
RISC-V processors even for tiny embedded stuff.
> The more I look at this language the more I wonder why it isn't more
> popular. Maybe people just don't like the pascalish syntax
Tooling, libraries, language verbosity, etc. As pure language, though,
it is still mysterious to me what Rust offers that Ada doesn't.
Today, for most programming, "systems languages" including Ada, C, C++,
and Rust are all imho somewhat niche. Unless you are dealing with
specialized problems (such as embedded or OS's), computers have almost
unbounded resources. So it's easier to get your work done using
languages with automatic memory management, unbounded arithmetic, etc.
The main cost is consuming more machine resources and losing some timing
determinism, but most of the time you can live with both of those. Ada
is best for more demanding applications which usually involve realtime
or high reliability constraints.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-09-16 7:13 ` Jack Davy
` (4 preceding siblings ...)
2020-09-16 21:29 ` Paul Rubin
@ 2020-10-06 4:06 ` andrew...@gmail.com
2020-10-06 7:32 ` Jack Davy
5 siblings, 1 reply; 51+ messages in thread
From: andrew...@gmail.com @ 2020-10-06 4:06 UTC (permalink / raw)
On Wednesday, September 16, 2020 at 3:13:23 AM UTC-4, Jack Davy wrote:
> On Wednesday, September 16, 2020 at 2:23:21 AM UTC+1, Paul Rubin wrote:
> > Jack Davy <algo...@tutanota.com> writes:
> > > seem to be many books on Ada, but there is a very recent one for
> > > beginners which I will probably get to fill in the gaps not covered by
> > > "The Craft". https://www.apress.com/gp/book/9781484254271
> > I haven't examined that book directly but based on the preview and
> > blurb, it does seem to be beginner oriented, thus likely to have gaps of
> > its own. If you're trying to fill gaps, you probably want something
> > more complete and advanced.
> >
> > I semi-recently got another book that looks very good, though it's still
> > sitting around without my having read much of it: Analysable Real-Time
> > Systems: Programmed in Ada, by Andy Wellings and Alan Burns. It is
> > basically an updated reprint of an older book by the same authors,
> > self-published in paperback, so it is a good value.
> @ Gautier, thanks for the links. When I get Windows 7 on VirtualBox I'll give the LEA editor a try, I'm not so keen on using Wine, it's a bit hit & miss. Also since I learned Vim a few years ago no other editors really do it for me, unless they have Vim bindings ;).
>
> @ Paul, I was thinking that the beginner's Apress book would fill in the gaps regarding Ada 2012 specifically, which as I understand it has changed from previous versions mainly in regard to OOP; I'm assuming I won't need to unlearn anything if I learn the basics from an Ada 95 book. The real-time stuff would be over my head at this point I think, and not really something I had in mind when considering Ada, although I do have a background in electronics, and see that there is Ada compiler for AVR on adacore.
>
> The more I look at this language the more I wonder why it isn't more popular. Maybe people just don't like the pascalish syntax, but that never put me off because I learned Turbo Pascal at Uni (25 years ago) and more recently Free Pascal/Lazarus. Never was much of a fan of the curly bracket languages.
Beginning Ada Programming is meant to be a gentle and guided introduction to Ada. It does cover Ada 2012 topics and all of the code was compiled on an Ada 2012 compiler to make sure that it worked.
My goal was never to compete with the other more advanced books on Ada, but to provide an easier way to get learn this wonderful language and become more comfortable with writing code in it.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2020-10-06 4:06 ` andrew...@gmail.com
@ 2020-10-06 7:32 ` Jack Davy
2020-10-17 23:02 ` mgr
0 siblings, 1 reply; 51+ messages in thread
From: Jack Davy @ 2020-10-06 7:32 UTC (permalink / raw)
On Tuesday, October 6, 2020 at 5:06:20 AM UTC+1, andrew...@gmail.com wrote:
> On Wednesday, September 16, 2020 at 3:13:23 AM UTC-4, Jack Davy wrote:
> > On Wednesday, September 16, 2020 at 2:23:21 AM UTC+1, Paul Rubin wrote:
> > > Jack Davy <algo...@tutanota.com> writes:
> > > > seem to be many books on Ada, but there is a very recent one for
> > > > beginners which I will probably get to fill in the gaps not covered by
> > > > "The Craft". https://www.apress.com/gp/book/9781484254271
> > > I haven't examined that book directly but based on the preview and
> > > blurb, it does seem to be beginner oriented, thus likely to have gaps of
> > > its own. If you're trying to fill gaps, you probably want something
> > > more complete and advanced.
> > >
> > > I semi-recently got another book that looks very good, though it's still
> > > sitting around without my having read much of it: Analysable Real-Time
> > > Systems: Programmed in Ada, by Andy Wellings and Alan Burns. It is
> > > basically an updated reprint of an older book by the same authors,
> > > self-published in paperback, so it is a good value.
> > @ Gautier, thanks for the links. When I get Windows 7 on VirtualBox I'll give the LEA editor a try, I'm not so keen on using Wine, it's a bit hit & miss. Also since I learned Vim a few years ago no other editors really do it for me, unless they have Vim bindings ;).
> >
> > @ Paul, I was thinking that the beginner's Apress book would fill in the gaps regarding Ada 2012 specifically, which as I understand it has changed from previous versions mainly in regard to OOP; I'm assuming I won't need to unlearn anything if I learn the basics from an Ada 95 book. The real-time stuff would be over my head at this point I think, and not really something I had in mind when considering Ada, although I do have a background in electronics, and see that there is Ada compiler for AVR on adacore.
> >
> > The more I look at this language the more I wonder why it isn't more popular. Maybe people just don't like the pascalish syntax, but that never put me off because I learned Turbo Pascal at Uni (25 years ago) and more recently Free Pascal/Lazarus. Never was much of a fan of the curly bracket languages.
> Beginning Ada Programming is meant to be a gentle and guided introduction to Ada. It does cover Ada 2012 topics and all of the code was compiled on an Ada 2012 compiler to make sure that it worked.
>
> My goal was never to compete with the other more advanced books on Ada, but to provide an easier way to get learn this wonderful language and become more comfortable with writing code in it.
I intend to purchase your book but at the moment I'm working through this one :
https://www2.seas.gwu.edu/~mfeldman/cs1book/
It has many example programs and is clearly written, although it only covers up to Ada 95. I'm not new to programming so I'm getting through it pretty quickly. I've download John English's JEWL library and have successfully compiled a few of the example programs using Wine on Linux. It seems very easy to use compared to most GUI libraries. A Linux port of it would be nice but I wouldn't know where to start with that.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Learning Ada
@ 2010-07-24 14:21 Frederick Williams
2010-07-24 16:21 ` Simon Wright
2010-07-25 20:33 ` mockturtle
0 siblings, 2 replies; 51+ messages in thread
From: Frederick Williams @ 2010-07-24 14:21 UTC (permalink / raw)
I wish to learn Ada(*) so I am looking for a free compiler to run on
Windows XP. Any suggestions?
(* Do you really? Yes, really.)
--
I can't go on, I'll go on.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: unsigned type
@ 2009-06-28 17:56 anon
2009-06-28 19:54 ` tmoran
0 siblings, 1 reply; 51+ messages in thread
From: anon @ 2009-06-28 17:56 UTC (permalink / raw)
with Interfaces ; --
use Interfaces ; --
Unless you need a special type just uses the predefined types in this package.
Such as:
Unsigned_8 ; -- 8 bit
Unsigned_16 ; -- 16 bit
Unsigned_32 ; -- 32 bit
Unsigned_64 ; -- 64 bit
In <eb3f45l5378gipiqeomr67uvtsdan84ihk@4ax.com>, Rob Solomon <usenet@drrob1-noreply.com> writes:
>I am trying to learn Ada. I am very familiar w/ Modula-2.
>
>I am trying to declare a type as unsigned using Ubuntu 9.04 GNAT
>compiler. I know Ada does not have a type CARDINAL, but I thought it
>had a type Unsigned.
>
>How do I declare such a variable?
>
>Thanks
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: unsigned type
2009-06-28 17:56 unsigned type anon
@ 2009-06-28 19:54 ` tmoran
2009-06-29 13:36 ` Rob Solomon
0 siblings, 1 reply; 51+ messages in thread
From: tmoran @ 2009-06-28 19:54 UTC (permalink / raw)
>I am trying to declare a type as unsigned using Ubuntu 9.04 GNAT
>compiler. I know Ada does not have a type CARDINAL, but I thought it
>had a type Unsigned.
Ada's equivalent is Natural. If
Lowest : Natural := 0;
Highest : Natural := Natural'last;
then
Lowest := Lowest-1; -- will raise an exception
Highest := Highest+1; -- ditto
(Note that Gnat by default is not a legal Ada compiler because it doesn't
check for and raise the exception. You need a command line parameter
-gnato to make it act like Ada.)
The standard Ada package Interfaces has hardware-oriented types
Unsigned_8, Unsigned_16, etc but those are modular types so if
Empty_Word : Interfaces.Unsigned_16 := 0;
Full_Byte : Interfaces.Unsigned_8 := 255;
then
Empty_Word-1 will be 65535.
Full_Byte+1 will be 0.
with no exceptions raised.
You can also declare your own application oriented non-negative types
type Ratings is range 1 .. 10;
or modular types
type Degrees is mod 360; -- 0 .. 359 wrapping around
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: unsigned type
2009-06-28 19:54 ` tmoran
@ 2009-06-29 13:36 ` Rob Solomon
2009-06-29 14:18 ` Ludovic Brenta
0 siblings, 1 reply; 51+ messages in thread
From: Rob Solomon @ 2009-06-29 13:36 UTC (permalink / raw)
I was able to use the Natural and Positive.
Now I'm trying to understand Mod types.
I tried this:
type card31 is mod 2_147_483_648;
type card32 is mod 4_294_967_296;
c31 : Card31;
c32: Card32;
LI : Long_Integer;
and
LI := Long_Integer(c32);
How to I output c31 and c32? Modula-2 uses WriteCard or CardToString
and WriteString
I tried using Put, but I got an error saying that correct procedure
could not be found, or something like that.
Put(LI) works until the value of LI > 2**31, even for c32.
Thanks for helping
--rob
On Sun, 28 Jun 2009 19:54:28 +0000 (UTC), tmoran@acm.org wrote:
>>I am trying to declare a type as unsigned using Ubuntu 9.04 GNAT
>>compiler. I know Ada does not have a type CARDINAL, but I thought it
>>had a type Unsigned.
>
>Ada's equivalent is Natural. If
> Lowest : Natural := 0;
> Highest : Natural := Natural'last;
>then
> Lowest := Lowest-1; -- will raise an exception
> Highest := Highest+1; -- ditto
>
>(Note that Gnat by default is not a legal Ada compiler because it doesn't
>check for and raise the exception. You need a command line parameter
>-gnato to make it act like Ada.)
>
>The standard Ada package Interfaces has hardware-oriented types
>Unsigned_8, Unsigned_16, etc but those are modular types so if
> Empty_Word : Interfaces.Unsigned_16 := 0;
> Full_Byte : Interfaces.Unsigned_8 := 255;
>then
> Empty_Word-1 will be 65535.
> Full_Byte+1 will be 0.
>with no exceptions raised.
>
>You can also declare your own application oriented non-negative types
> type Ratings is range 1 .. 10;
>or modular types
> type Degrees is mod 360; -- 0 .. 359 wrapping around
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: unsigned type
2009-06-29 13:36 ` Rob Solomon
@ 2009-06-29 14:18 ` Ludovic Brenta
2009-07-03 1:41 ` Rob Solomon
0 siblings, 1 reply; 51+ messages in thread
From: Ludovic Brenta @ 2009-06-29 14:18 UTC (permalink / raw)
Rob Solomon wrote on comp.lang.ada:
> I was able to use the Natural and Positive.
>
> Now I'm trying to understand Mod types.
>
> I tried this:
> type card31 is mod 2_147_483_648;
> type card32 is mod 4_294_967_296;
> c31 : Card31;
> c32: Card32;
> LI : Long_Integer;
> and
>
> LI := Long_Integer(c32);
>
> How to I output c31 and c32? Modula-2 uses WriteCard or CardToString
> and WriteString
>
> I tried using Put, but I got an error saying that correct procedure
> could not be found, or something like that.
>
> Put(LI) works until the value of LI > 2**31, even for c32.
Ada.Text_IO.Put_Line (Card31'Image (c31));
or
package C31_IO is new Ada.Text_IO.Modular_Text_IO (Num => Card31);
begin
C31_IO.Put (c31);
But I have three suggestions:
- rather than "type card31 is mod 2_147_483_648", write "type card31
is mod 2**31;"
- do not declare machine-oriented types like card31 or card32 in the
first place; instead, define application-oriented types like
"Temperature" or whatever
- before you define modular types, explain to yourself why you need
the wrap-around semantics or the bitwise operators (modular types have
them, signed integer types don't).
--
Ludovic Brenta.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: unsigned type
2009-06-29 14:18 ` Ludovic Brenta
@ 2009-07-03 1:41 ` Rob Solomon
2009-07-03 7:12 ` Learning Ada (Was: unsigned type) Jacob Sparre Andersen
0 siblings, 1 reply; 51+ messages in thread
From: Rob Solomon @ 2009-07-03 1:41 UTC (permalink / raw)
>Rob Solomon wrote on comp.lang.ada:
>> I was able to use the Natural and Positive. �
>>
>> Now I'm trying to understand Mod types.
>>
>> I tried this:
>> type card31 is mod 2_147_483_648;
>> type card32 is mod 4_294_967_296;
>> c31 : Card31;
>> c32: Card32;
>> LI : Long_Integer;
>> and
>>
>> LI := Long_Integer(c32);
>>
>> How to I output c31 and c32? �Modula-2 uses WriteCard or CardToString
>> and WriteString
>>
>> I tried using Put, but I got an error saying that correct procedure
>> could not be found, or something like that.
>>
>> Put(LI) works until the value of LI > 2**31, even for c32.
>
>Ada.Text_IO.Put_Line (Card31'Image (c31));
>
>or
>
> package C31_IO is new Ada.Text_IO.Modular_Text_IO (Num => Card31);
>begin
> C31_IO.Put (c31);
>
>But I have three suggestions:
>
>- rather than "type card31 is mod 2_147_483_648", write "type card31
>is mod 2**31;"
>
>- do not declare machine-oriented types like card31 or card32 in the
>first place; instead, define application-oriented types like
>"Temperature" or whatever
>
>- before you define modular types, explain to yourself why you need
>the wrap-around semantics or the bitwise operators (modular types have
>them, signed integer types don't).
I am trying to learn the language, so that is why I'm playing w/
these. I am very familiar w/ Modula-2 and am trying to extend what I
do know to what I don't.
I bought Programming In Ada 2005 by John Barnes and Ada as a Second
Language by Norman Cohen.
Ada as a Second Language is a far better book to learn from. My
earlier posts were because I first opened the John Barnes book and
that left me w/ more questions than answers. It introduces very
advanced concepts like OOP, pointers, abstract types, etc before loops
are covered. That is, he writes about advanced data structures before
covering more basic control structures. This made it very hard for me
to follow.
So I am going onto the Norman Cohen book. This is much better
organized for a newcomer.
I learned how to program by punching cards; I know how to write
programs. Norm Cohen is much better at instruction than John Barnes.
I will keep reading before I post much more.
--rob
^ permalink raw reply [flat|nested] 51+ messages in thread
* Learning Ada (Was: unsigned type)
2009-07-03 1:41 ` Rob Solomon
@ 2009-07-03 7:12 ` Jacob Sparre Andersen
2009-07-03 8:38 ` Learning Ada Peter Hermann
2009-07-03 22:20 ` Learning Ada (Was: unsigned type) anon
0 siblings, 2 replies; 51+ messages in thread
From: Jacob Sparre Andersen @ 2009-07-03 7:12 UTC (permalink / raw)
Rob Solomon wrote:
> Ada as a Second Language is a far better book to learn from. My
> earlier posts were because I first opened the John Barnes book and
> that left me w/ more questions than answers. It introduces very
> advanced concepts like OOP, pointers, abstract types, etc before
> loops are covered. That is, he writes about advanced data
> structures before covering more basic control structures. This made
> it very hard for me to follow.
I would say that the way Barnes' book is structured points out a very
important aspect of Ada; Types are important!
When you write a program in Ada, you should start out by considering
which data you want to handle, and then declare the appropriate data
types for handling these data. Once you have declared the types, you
can start writing algorithms which handle the data.
It might be to push things a bit too far, but I think it would be
beneficial, if the types Float and Integer were removed from the
language.
> So I am going onto the Norman Cohen book. This is much better
> organized for a newcomer.
Personally I learned Ada (95) from the Language Reference Manual.
Greetings,
Jacob
--
"It is a syntax error to write FORTRAN while not wearing a blue tie."
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-03 7:12 ` Learning Ada (Was: unsigned type) Jacob Sparre Andersen
@ 2009-07-03 8:38 ` Peter Hermann
2009-07-03 9:44 ` Georg Bauhaus
2009-07-03 22:20 ` Learning Ada (Was: unsigned type) anon
1 sibling, 1 reply; 51+ messages in thread
From: Peter Hermann @ 2009-07-03 8:38 UTC (permalink / raw)
Jacob Sparre Andersen <sparre@nbi.dk> wrote:
> It might be to push things a bit too far, but I think it would be
> beneficial, if the types Float and Integer were removed from the
> language.
caveat.
pragmatism needs them due to a lot of reasons:
I would need a full day to list them.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-03 8:38 ` Learning Ada Peter Hermann
@ 2009-07-03 9:44 ` Georg Bauhaus
0 siblings, 0 replies; 51+ messages in thread
From: Georg Bauhaus @ 2009-07-03 9:44 UTC (permalink / raw)
Peter Hermann schrieb:
> Jacob Sparre Andersen <sparre@nbi.dk> wrote:
>> It might be to push things a bit too far, but I think it would be
>> beneficial, if the types Float and Integer were removed from the
>> language.
>
> caveat.
> pragmatism needs them due to a lot of reasons:
> I would need a full day to list them.
I can't help thinking that claiming "pragmatism" to
be a quality of Standard.Integer use is what laziness
would like it to be, no offence intended:
Effects of predefined types will make people debug
and rewrite, sooner or later, as seen. Using C, you
are almost forced to use int from the C standard very
often, if only because C culture makes C programmers
frown upon better types like int wrapped in a struct
or like using enum where appropriate.
You Get Things Done (TM) very quickly this way--it's just
that Things vanish under some carpet to rot and "develop".
Imagine an Ada culture without Float and Integer.
Would Ada programmers (possibly grouped by prior
exposure to other type systems) start writing
package Everywhere is
type Integer is range -(2**31) .. +(2**31) -1 ;
-- be pragmatic
type Float ...;
-- be pragmatic
end Everywhere;
and use only these types in their programs?
Alternatives include Copy&Paset or boiler plate macros: have
your editor prompt for the range bounds of a user defined
integer type when needed, and make it insert the definition.
Done.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada (Was: unsigned type)
2009-07-03 7:12 ` Learning Ada (Was: unsigned type) Jacob Sparre Andersen
2009-07-03 8:38 ` Learning Ada Peter Hermann
@ 2009-07-03 22:20 ` anon
2009-07-04 14:53 ` Georg Bauhaus
1 sibling, 1 reply; 51+ messages in thread
From: anon @ 2009-07-03 22:20 UTC (permalink / raw)
Standards are the way to go.
How would you like to define a Boolean alone with the universal_integer
and universal_real types. Then have to define operations for all of those
types for every program. All you would have to do is rebuild the Standard
specification package and include a body for the operations. Now, if
someone needs to modify the program then they need the new Standard package.
But wait a minute, without the built-in standards and the compiler
understatement of those types (Boolean, universal_integer and universal_real)
the compiler could not understand how to build you new Standard package. The
compiler must have a bases for those standards in order to allow you to
redefine those standard. Even in GNAT you can rewrite the Standard package,
but it still will fall back and use the built-in Standard operations.
Also, Its kind of funny. Other than me not one person here tried to answer the
original person question from "unsigned type".
I saw the title "unsigned type" and stated they are defined in predefined in the
Interface package. But if he looked at the package he would get an example of
what he could do to define a special type.
But no one else tried to define the type he was truly looking for. Some gave a
sentence or two stating that CARDINAL was like a Natural or etc. But no one
posted a statement like
type CARDINAL is ... ;
and filled in the details, which is defined as a special type. Now, if Ludovic
Brenta, was correct that most Ada programmers prefer to create their own
types, then where were those programmers posting that type of statement
for an answer.
In <878wj61bpo.fsf_-_@nbi.dk>, Jacob Sparre Andersen <sparre@nbi.dk> writes:
>Rob Solomon wrote:
>
>> Ada as a Second Language is a far better book to learn from. My
>> earlier posts were because I first opened the John Barnes book and
>> that left me w/ more questions than answers. It introduces very
>> advanced concepts like OOP, pointers, abstract types, etc before
>> loops are covered. That is, he writes about advanced data
>> structures before covering more basic control structures. This made
>> it very hard for me to follow.
>
>I would say that the way Barnes' book is structured points out a very
>important aspect of Ada; Types are important!
>
>When you write a program in Ada, you should start out by considering
>which data you want to handle, and then declare the appropriate data
>types for handling these data. Once you have declared the types, you
>can start writing algorithms which handle the data.
>
>It might be to push things a bit too far, but I think it would be
>beneficial, if the types Float and Integer were removed from the
>language.
>
>> So I am going onto the Norman Cohen book. This is much better
>> organized for a newcomer.
>
>Personally I learned Ada (95) from the Language Reference Manual.
>
>Greetings,
>
>Jacob
>--
>"It is a syntax error to write FORTRAN while not wearing a blue tie."
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada (Was: unsigned type)
2009-07-03 22:20 ` Learning Ada (Was: unsigned type) anon
@ 2009-07-04 14:53 ` Georg Bauhaus
2009-07-05 23:21 ` anon
0 siblings, 1 reply; 51+ messages in thread
From: Georg Bauhaus @ 2009-07-04 14:53 UTC (permalink / raw)
anon wrote:
> Standards are the way to go.
Yes, standards are the way to go.
And this *is* standard Ada:
type T is range 1_000_000 .. 9_999_999;
The type T has the exact same set of operations as Standard.Integer.
It is just as efficient as implementation defined Standard.Integer.
The types Integer or Boolean you mentioned are not needed in
order to define T. Universal_integer is the type of integer
literals like 1_000_000; it is *not* declared in package Standard, it
does not even have a name, it is just a predefined anonymous
type.
> Also, Its kind of funny. Other than me not one person here tried to answer the
> original person question from "unsigned type".
The first answer by Florian Weimer answered the original
question, implying, I guess, that CARDINAL is not a mod
type and so cannot be replaced with a mod type like Unsigned_N
as you seem to suggest: For Modula-2's CARDINAL, there
is overflow check control... So CARDINAL is not the same
as a modular type in Ada.
The second answer, by Albrecht K�fer, in addition
points to modular types and to how they
differ from Modula-2's CARDINAL.
Maybe it is part of Ada culture to explain how
a problem is solved in Ada, not how you can
write Ada in the language you know, even when
that might make some Ada teachers more popular
among those students who do not have the, uhm, time
to really learn Ada.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada (Was: unsigned type)
2009-07-04 14:53 ` Georg Bauhaus
@ 2009-07-05 23:21 ` anon
2009-07-06 0:19 ` Learning Ada Albrecht Käfer
2009-07-06 10:53 ` Learning Ada (Was: unsigned type) Georg Bauhaus
0 siblings, 2 replies; 51+ messages in thread
From: anon @ 2009-07-05 23:21 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 5868 bytes --]
Wrong!
I was not talking about the Ada Statements "Type" or "Subtype" but
true Standards that go beyond Ada.
An example that is listed in the Ada RM, is the standard character sets:
ISO 10646 Universal Multiple-Octet Coded Character Set
ISO 8859-1 (Latin-1)
But Ada also, use standards for it types, "Integer", and "Float', with
their associate subtypes. One reason but not the only reason for the range of
these built-in types are the hardware. If the hardware uses 32-bits integers
then the Ada "Integer" is based on 32-bit. And in todays systems the Ada
"Float" is normally based on the FPU (hardware) range. And the numeric
ranges for the FPU is based on standard that are defined and adopted by the
agencies like IEEE and ISO.
But some people like "Ludovic Brenta, state that most Ada programmers
would prefer to create their own types. In some case, that goes against the RM
because it can create a non-standardize form of an Ada programs, that violate
other RM rules. Plus, the RM states that a number of numeric types are
predefined, such as "Integer", and it subtypes "Natural" and "Positive" as
well the type "Float" and its subtypes. Redefining those predefines types are
legal in Ada, by simply re-defining the type. Like for example, using 24 bit
integer:
type Integer is range -2 ** 24 .. +2 ** ( 24 - 1 ) ;
To use this new definition of "Integer", globally it needs to be define in the
standard package, but for a single package or routine it better to create a new
type or subtype and for the routine or package. But in most programming this
is not necessary. That is, since Ada creation and the DOD dropping it full
support of Ada, the usage for redefining the numeric data types is almost nil,
not the norm any more. Plus, the DOD require full documentation on all new
define types. And no matter what type is defined the compiler will fall back to the
basic standards of the universal-integer and universal-real aka CPU integer
and FPU float and their operations. If you study most of the implementations of
Ada, one can see that the types "Integer" and "Float" that are defined in the
"Standard" package are basically equivalent to the Ada's universal-integer and
universal-real.
Now, "Rob Solomon" stated that he think "it would be beneficial, if
the types Float and Integer were removed from the language".
First, if this could happen the RM would need a MAJOR overhaul.
It would be easier to create a new language. Because both types are used
throughout the RM defined packages.
Second, the predefined types allow for the program to be more portable,
because a users type might not be accepted on the new system. But using the
standards or creating a subtype from the standards is better. An example is:
type Integer is range -2 ** 256 .. +2 ** ( 256 - 1 ) ;
which is a valid Ada statement but in a 32-bit and most 64-bit system this
type is not allowed. You would need to use a special array or record type that
is based on the universal-integer or CPU and define the operations in a math
package or packages. There are a few special scientific projects that could
use that type of maybe even a larger type like 1024-bit, but there's not
enough applications for most to spend their time in creating such a package.
Normally, its the scientist that ask for help that developes such packages for
his project and only for his project and then sets the big price tag for others
that package.
Then third, is without standards types like "Integer" and "Float" how
would the system work. Using Ada, define a "=" or "*" without using the
universal-integer and universal-real types or there operations. You can not!
You must have some basic standard types and operations to define other
operations. Ada calls these types universal-integer and universal-real and uses
their operations to build the predefine types and their operations.
Fourth, is to interface with other languages. which also use standards.
Some Ada programmer prefer pure Ada code. Like using the "Interface"
package to only define the standard unsigned types and to use the low-level
shift and rotate routines for those unsigned types. But there are times when
interfacing is required.
In <4a4f6cce$0$31869$9b4e6d93@newsspool3.arcor-online.net>, Georg Bauhaus <rm.tsoh.plus-bug.bauhaus@maps.futureapps.de> writes:
>anon wrote:
>> Standards are the way to go.
>
>Yes, standards are the way to go.
>
>And this *is* standard Ada:
>
> type T is range 1_000_000 .. 9_999_999;
>
>The type T has the exact same set of operations as Standard.Integer.
>It is just as efficient as implementation defined Standard.Integer.
>The types Integer or Boolean you mentioned are not needed in
>order to define T. Universal_integer is the type of integer
>literals like 1_000_000; it is *not* declared in package Standard, it
>does not even have a name, it is just a predefined anonymous
>type.
>
>> Also, Its kind of funny. Other than me not one person here tried to answer the
>> original person question from "unsigned type".
>
>The first answer by Florian Weimer answered the original
>question, implying, I guess, that CARDINAL is not a mod
>type and so cannot be replaced with a mod type like Unsigned_N
>as you seem to suggest: For Modula-2's CARDINAL, there
>is overflow check control... So CARDINAL is not the same
>as a modular type in Ada.
>
>The second answer, by Albrecht K�fer, in addition
>points to modular types and to how they
>differ from Modula-2's CARDINAL.
>
>Maybe it is part of Ada culture to explain how
>a problem is solved in Ada, not how you can
>write Ada in the language you know, even when
>that might make some Ada teachers more popular
>among those students who do not have the, uhm, time
>to really learn Ada.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-05 23:21 ` anon
@ 2009-07-06 0:19 ` Albrecht Käfer
2009-07-06 2:50 ` anon
2009-07-06 10:53 ` Learning Ada (Was: unsigned type) Georg Bauhaus
1 sibling, 1 reply; 51+ messages in thread
From: Albrecht Käfer @ 2009-07-06 0:19 UTC (permalink / raw)
anon schrieb:
> But some people like "Ludovic Brenta, state that most Ada programmers
> would prefer to create their own types. In some case, that goes against the RM
> because it can create a non-standardize form of an Ada programs, that violate
> other RM rules.
It would be really smashing if you could provide some sort of proof for
this bold claim.
> Plus, the RM states that a number of numeric types are
> predefined, such as "Integer", and it subtypes "Natural" and "Positive" as
> well the type "Float" and its subtypes.
> Redefining those predefines types are
> legal in Ada, by simply re-defining the type.
... no? Standard.Integer et al cannot be redefined. You can change the
underlying compiler, but then you could also change "begin" to "start".
> Like for example, using 24 bit integer:
>
> type Integer is range -2 ** 24 .. +2 ** ( 24 - 1 ) ;
>
> To use this new definition of "Integer", globally it needs to be define in the
> standard package,
Now how would you go around doing that?
> but for a single package or routine it better to create a new
> type or subtype and for the routine or package. But in most programming this
> is not necessary. That is, since Ada creation and the DOD dropping it full
> support of Ada, the usage for redefining the numeric data types is almost nil,
> not the norm any more. Plus, the DOD require full documentation on all new
> define types.
Why should we care about what the DoD requires again?
> Now, "Rob Solomon" stated that he think "it would be beneficial, if
> the types Float and Integer were removed from the language".
That is a personal opinion, not a law of nature.
> Second, the predefined types allow for the program to be more portable,
> because a users type might not be accepted on the new system. But using the
> standards or creating a subtype from the standards is better. An example is:
>
> type Integer is range -2 ** 256 .. +2 ** ( 256 - 1 ) ;
>
> which is a valid Ada statement but in a 32-bit and most 64-bit system this
> type is not allowed.
There's nothing stopping you from creating a special Ada compiler
supporting arbitrary-length integers.
Albrecht
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-06 0:19 ` Learning Ada Albrecht Käfer
@ 2009-07-06 2:50 ` anon
2009-07-06 6:18 ` AdaMagica
0 siblings, 1 reply; 51+ messages in thread
From: anon @ 2009-07-06 2:50 UTC (permalink / raw)
Wrong!
--
-- Just to show how easy it is redefining an Integer. Or the
-- Standard package. Compiled with GNAT < 2010
--
with Ada.Text_IO ;
with Standard ; -- require for redefining Standard package
procedure Temp is
use Ada.Text_IO ;
begin
declare
package Integer_IO is new
Ada.Text_IO.Integer_IO ( Integer ) ;
use Integer_IO ;
begin
New_Line ;
Put_line ( "Integer predefined limits" ) ;
Put ( "Range => ( " ) ;
Put ( Integer'First ) ;
Put ( " .. " ) ;
Put ( Integer'Last ) ;
Put_Line ( " ) " ) ;
New_Line ;
end ;
--
-- Now redefine the type Integer.
--
declare
type Integer is range -2 ** 8 .. 2 ** 8 - 1 ;
package Integer_IO is new Ada.Text_IO.Integer_IO ( Integer ) ;
use Integer_IO ;
begin
New_Line ;
Put_line ( "Integer redefined limits" ) ;
Put ( "Range => ( " ) ;
Put ( Integer'First ) ;
Put ( " .. " ) ;
Put ( Integer'Last ) ;
Put_Line ( " ) " ) ;
New_Line ;
end ;
--
-- Using a new Standard package
--
declare
package Integer_IO is new
Ada.Text_IO.Integer_IO ( Standard.Integer ) ;
use Integer_IO ;
begin
New_Line ;
Put_line ( "Integer limits from a new Standard package" ) ;
Put ( "Range => ( " ) ;
Put ( Standard.Integer'First ) ;
Put ( " .. " ) ;
Put ( Standard.Integer'Last ) ;
Put_Line ( " ) " ) ;
New_Line ;
end ;
end Temp ;
--
-- This will compile under current GNAT < 2010. Package cut down
-- because the complete version is too long and is not needed to
-- make the point. But all other types and operations will fall back to
-- GNAT built-in Standard package aka for GNAT its universal Standard
-- package.
--
package STANDARD is
-- The universal type universal_integer is predefined.
type INTEGER is range - 2 ** 63 .. ( 2 ** 63 ) - 1 ;
end STANDARD ;
In <h2rgg8$blq$1@online.de>, Albrecht =?ISO-8859-1?Q?K=E4fer?= <albrecht_kaefer@yahoo.de> writes:
>anon schrieb:
>> But some people like "Ludovic Brenta, state that most Ada programmers
>> would prefer to create their own types. In some case, that goes against the RM
>> because it can create a non-standardize form of an Ada programs, that violate
>> other RM rules.
>
>It would be really smashing if you could provide some sort of proof for
>this bold claim.
>
>> Plus, the RM states that a number of numeric types are
>> predefined, such as "Integer", and it subtypes "Natural" and "Positive" as
>> well the type "Float" and its subtypes.
>> Redefining those predefines types are
>> legal in Ada, by simply re-defining the type.
>
>.... no? Standard.Integer et al cannot be redefined. You can change the
>underlying compiler, but then you could also change "begin" to "start".
>
>> Like for example, using 24 bit integer:
>>
>> type Integer is range -2 ** 24 .. +2 ** ( 24 - 1 ) ;
>>
>> To use this new definition of "Integer", globally it needs to be define in the
>> standard package,
>
>Now how would you go around doing that?
>
>> but for a single package or routine it better to create a new
>> type or subtype and for the routine or package. But in most programming this
>> is not necessary. That is, since Ada creation and the DOD dropping it full
>> support of Ada, the usage for redefining the numeric data types is almost nil,
>> not the norm any more. Plus, the DOD require full documentation on all new
>> define types.
>
>Why should we care about what the DoD requires again?
>
>> Now, "Rob Solomon" stated that he think "it would be beneficial, if
>> the types Float and Integer were removed from the language".
>
>That is a personal opinion, not a law of nature.
>
>> Second, the predefined types allow for the program to be more portable,
>> because a users type might not be accepted on the new system. But using the
>> standards or creating a subtype from the standards is better. An example is:
>>
>> type Integer is range -2 ** 256 .. +2 ** ( 256 - 1 ) ;
>>
>> which is a valid Ada statement but in a 32-bit and most 64-bit system this
>> type is not allowed.
>
>There's nothing stopping you from creating a special Ada compiler
>supporting arbitrary-length integers.
>
>
>Albrecht
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-06 2:50 ` anon
@ 2009-07-06 6:18 ` AdaMagica
2009-07-06 7:47 ` Jean-Pierre Rosen
2009-07-06 20:21 ` anon
0 siblings, 2 replies; 51+ messages in thread
From: AdaMagica @ 2009-07-06 6:18 UTC (permalink / raw)
Oh my dear anon, you are so wrong again.
> package STANDARD is
>
> -- The universal type universal_integer is predefined.
>
> type INTEGER is range - 2 ** 63 .. ( 2 ** 63 ) - 1 ;
>
> end STANDARD;
You do *not* redefine Standard with this declaration, you simply hide
it.
with Standard;
procedure Temp is -- Here you will get into troubled water.
X: Integer; -- this is still the integer from the predefined
package Standard
Y: STANDARD.Integer; -- this is your INTEGER
use Standard;
Z: Integer := 2; -- oh lord, what's this now?
-- I'm not sure and I'm reluctant to do the RM exegesis to find out.
I *guess* it's your INTEGER;
I: Integer := Z**3; -- subtype of 3 is still the Integer defined in
-- the predefined Standard you've hidden
J: Integer := Z**Z; -- This should then be illegal because the
subtype of the right operand of **
-- must be the one from the hidden Standard.
end Temp;
Point is: You cannot redefine Standard! Full stop.
I invite you to find the relevant paragraphs in the RM which state
what will happen when you define a package named Standard.
And please be careful to not mix up a subtype and the type of the
subtype and the type of numeric literals. They are all different.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-06 6:18 ` AdaMagica
@ 2009-07-06 7:47 ` Jean-Pierre Rosen
2009-07-06 20:21 ` anon
1 sibling, 0 replies; 51+ messages in thread
From: Jean-Pierre Rosen @ 2009-07-06 7:47 UTC (permalink / raw)
AdaMagica a �crit :
> Oh my dear anon, you are so wrong again.
>
>> package STANDARD is
>>
>> -- The universal type universal_integer is predefined.
>>
>> type INTEGER is range - 2 ** 63 .. ( 2 ** 63 ) - 1 ;
>>
>> end STANDARD;
>
> You do *not* redefine Standard with this declaration, you simply hide
> it.
>
> with Standard;
>
> procedure Temp is -- Here you will get into troubled water.
>
> X: Integer; -- this is still the integer from the predefined
> package Standard
> Y: STANDARD.Integer; -- this is your INTEGER
>
> use Standard;
>
> Z: Integer := 2; -- oh lord, what's this now?
>
> -- I'm not sure and I'm reluctant to do the RM exegesis to find out.
> I *guess* it's your INTEGER;
No, it's the one from the real Standard.
The rule is simple: "use" is weak. It comes into play only if nothing
gets in the way (like a similar name that is directly visible, or
declared in another used package).
The regular Standard is always /directly/ visible, therefore a use
clause never brings something in front of something from the regular
Standard.
--
---------------------------------------------------------
J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-06 6:18 ` AdaMagica
2009-07-06 7:47 ` Jean-Pierre Rosen
@ 2009-07-06 20:21 ` anon
2009-07-06 21:08 ` Georg Bauhaus
2009-07-06 22:43 ` Frank J. Lhota
1 sibling, 2 replies; 51+ messages in thread
From: anon @ 2009-07-06 20:21 UTC (permalink / raw)
Yes, I did redefine apart of Standard. Found this out back in the mid 1990
while testing GNAT 3.0x for a number of projects. Its also, one way (not the
best, but it is quick) of porting code from a 32-bit system down to a 16 or
8 bit system. Like using Intel Core i7 system to write code for an Intel
8086 system, which can use the same basic (non-protective mode)
instruction set.
Also, rewriting any Ada package is allowable within the scope of the RM
(in some implementation it maybe required). And if I add a body for the
Standard package and uncommented the an operators I could of made the
operator do what I wanted it to do. Like having all Boolean operators
return FALSE.
This process does not hide the built-in Standard package, its still there for
the system to handle the other types, such as the Character or
Wide_Character set, which can be a headache to define.
In <ba7f8fc3-e386-49cc-a1fb-e53f7e1f04bf@d32g2000yqh.googlegroups.com>, AdaMagica <christoph.grein@eurocopter.com> writes:
>Oh my dear anon, you are so wrong again.
>
>> package STANDARD is
>>
>> =A0 -- The universal type universal_integer is predefined. =A0
>>
>> =A0 type INTEGER is range - 2 ** 63 .. ( 2 ** 63 ) - 1 ;
>>
>> end STANDARD;
>
>You do *not* redefine Standard with this declaration, you simply hide
>it.
>
>with Standard;
>
>procedure Temp is -- Here you will get into troubled water.
>
> X: Integer; -- this is still the integer from the predefined
>package Standard
> Y: STANDARD.Integer; -- this is your INTEGER
>
> use Standard;
>
> Z: Integer :=3D 2; -- oh lord, what's this now?
>
> -- I'm not sure and I'm reluctant to do the RM exegesis to find out.
>I *guess* it's your INTEGER;
>
> I: Integer :=3D Z**3; -- subtype of 3 is still the Integer defined in
> -- the predefined Standard you've hidden
> J: Integer :=3D Z**Z; -- This should then be illegal because the
>subtype of the right operand of **
> -- must be the one from the hidden Standard.
>
>end Temp;
>
>Point is: You cannot redefine Standard! Full stop.
>
>I invite you to find the relevant paragraphs in the RM which state
>what will happen when you define a package named Standard.
>
>And please be careful to not mix up a subtype and the type of the
>subtype and the type of numeric literals. They are all different.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-06 20:21 ` anon
@ 2009-07-06 21:08 ` Georg Bauhaus
2009-07-06 22:43 ` Frank J. Lhota
1 sibling, 0 replies; 51+ messages in thread
From: Georg Bauhaus @ 2009-07-06 21:08 UTC (permalink / raw)
anon wrote:
> Yes, I did redefine apart of Standard. Found this out back in the mid 1990
> while testing GNAT 3.0x for a number of projects. Its also, one way (not the
> best, but it is quick) of porting code from a 32-bit system down to a 16 or
> 8 bit system. Like using Intel Core i7 system to write code for an Intel
> 8086 system, which can use the same basic (non-protective mode)
> instruction set.
So you are proving our point that using Standard.Integer
has created a need to replace Standard.Integer with a
different integer type that helps porting?
Wouldn't it have been better if the programmers
had not used Standard.Integer in the first place,
where possible?
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-06 20:21 ` anon
2009-07-06 21:08 ` Georg Bauhaus
@ 2009-07-06 22:43 ` Frank J. Lhota
2009-07-09 22:28 ` anon
1 sibling, 1 reply; 51+ messages in thread
From: Frank J. Lhota @ 2009-07-06 22:43 UTC (permalink / raw)
anon wrote:
> Yes, I did redefine apart of Standard. Found this out back in the mid 1990
> while testing GNAT 3.0x for a number of projects. Its also, one way (not the
> best, but it is quick) of porting code from a 32-bit system down to a 16 or
> 8 bit system. Like using Intel Core i7 system to write code for an Intel
> 8086 system, which can use the same basic (non-protective mode)
> instruction set.
No, you did not re-define a part of Standard. Keep in mind that all of
the compilation units you write is enclosed in the Standard package. As
a result, every Ada name can be expanded to something of the form
"Standard.*".
When you wrote the package Standard as presented above, what you really
did was add a package named Standard *within* the pre-defined package
Standard, i.e. the result was something like this:
-- Ada LRM Standard
package Standard is
...
type Integer is range ...;
...
-- Your Standard package
package Standard is
type INTEGER is range - 2 ** 63 .. ( 2 ** 63 ) - 1 ;
end Standard;
end Standard;
In other words, you've created the new type Standard.Standard.Integer,
which is a separate type from Standard.Integer.
> Also, rewriting any Ada package is allowable within the scope of the RM
> (in some implementation it maybe required). And if I add a body for the
> Standard package and uncommented the an operators I could of made the
> operator do what I wanted it to do. Like having all Boolean operators
> return FALSE.
LRM A.2 (4) specifically prohibit the compilation of a child of package
Ada in standard mode. I believe that some implementations would squawk
if you tried to replace parts of System, especially since doing so could
break other pre-defined units.
> This process does not hide the built-in Standard package, its still there for
> the system to handle the other types, such as the Character or
> Wide_Character set, which can be a headache to define.
Well, it does create some confusion. I would definitely *not* recommend
naming a unit Standard.
>
> In <ba7f8fc3-e386-49cc-a1fb-e53f7e1f04bf@d32g2000yqh.googlegroups.com>, AdaMagica <christoph.grein@eurocopter.com> writes:
>> Oh my dear anon, you are so wrong again.
>>
>>> package STANDARD is
>>>
>>> =A0 -- The universal type universal_integer is predefined. =A0
>>>
>>> =A0 type INTEGER is range - 2 ** 63 .. ( 2 ** 63 ) - 1 ;
>>>
>>> end STANDARD;
>> You do *not* redefine Standard with this declaration, you simply hide
>> it.
>>
>> with Standard;
>>
>> procedure Temp is -- Here you will get into troubled water.
>>
>> X: Integer; -- this is still the integer from the predefined
>> package Standard
>> Y: STANDARD.Integer; -- this is your INTEGER
>>
>> use Standard;
>>
>> Z: Integer :=3D 2; -- oh lord, what's this now?
>>
>> -- I'm not sure and I'm reluctant to do the RM exegesis to find out.
>> I *guess* it's your INTEGER;
>>
>> I: Integer :=3D Z**3; -- subtype of 3 is still the Integer defined in
>> -- the predefined Standard you've hidden
>> J: Integer :=3D Z**Z; -- This should then be illegal because the
>> subtype of the right operand of **
>> -- must be the one from the hidden Standard.
>>
>> end Temp;
>>
>> Point is: You cannot redefine Standard! Full stop.
>>
>> I invite you to find the relevant paragraphs in the RM which state
>> what will happen when you define a package named Standard.
>>
>> And please be careful to not mix up a subtype and the type of the
>> subtype and the type of numeric literals. They are all different.
>
--
"All things extant in this world,
Gods of Heaven, gods of Earth,
Let everything be as it should be;
Thus shall it be!"
- Magical chant from "Magical Shopping Arcade Abenobashi"
"Drizzle, Drazzle, Drozzle, Drome,
Time for this one to come home!"
- Mr. Wizard from "Tooter Turtle"
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-06 22:43 ` Frank J. Lhota
@ 2009-07-09 22:28 ` anon
2009-07-10 6:23 ` AdaMagica
0 siblings, 1 reply; 51+ messages in thread
From: anon @ 2009-07-09 22:28 UTC (permalink / raw)
If Ada RM A.2 ( 4 ), applied here, then Adacore / GNAT would not allow one
to compile the a Standard package. When compiling the Ada.* you must use
"-gnatpg", command option, but compiling the Standard package is as easy
as compiling any non-vendor or Ada package.
Actually I wrote the complete Standards package for both Ada 83 and 95
including a body that use System.Machine_Code for the routines base on the
Ada 83 and Ada 95 specs.
And these routines could be used for embeded processors, but the main code
would still be generated by the GCC backend.
In <h2tun7$bpp$1@news.albasani.net>, "Frank J. Lhota" <FrankLho.NOSPAM@rcn.com> writes:
>anon wrote:
>> Yes, I did redefine apart of Standard. Found this out back in the mid 1990
>> while testing GNAT 3.0x for a number of projects. Its also, one way (not the
>> best, but it is quick) of porting code from a 32-bit system down to a 16 or
>> 8 bit system. Like using Intel Core i7 system to write code for an Intel
>> 8086 system, which can use the same basic (non-protective mode)
>> instruction set.
>
>No, you did not re-define a part of Standard. Keep in mind that all of
>the compilation units you write is enclosed in the Standard package. As
>a result, every Ada name can be expanded to something of the form
>"Standard.*".
>
>When you wrote the package Standard as presented above, what you really
>did was add a package named Standard *within* the pre-defined package
>Standard, i.e. the result was something like this:
>
>-- Ada LRM Standard
>package Standard is
>
> ...
> type Integer is range ...;
> ...
>
> -- Your Standard package
> package Standard is
> type INTEGER is range - 2 ** 63 .. ( 2 ** 63 ) - 1 ;
> end Standard;
>
>end Standard;
>
>In other words, you've created the new type Standard.Standard.Integer,
>which is a separate type from Standard.Integer.
>
>> Also, rewriting any Ada package is allowable within the scope of the RM
>> (in some implementation it maybe required). And if I add a body for the
>> Standard package and uncommented the an operators I could of made the
>> operator do what I wanted it to do. Like having all Boolean operators
>> return FALSE.
>
>LRM A.2 (4) specifically prohibit the compilation of a child of package
>Ada in standard mode. I believe that some implementations would squawk
>if you tried to replace parts of System, especially since doing so could
>break other pre-defined units.
>
>> This process does not hide the built-in Standard package, its still there for
>> the system to handle the other types, such as the Character or
>> Wide_Character set, which can be a headache to define.
>
>Well, it does create some confusion. I would definitely *not* recommend
>naming a unit Standard.
>
>>
>> In <ba7f8fc3-e386-49cc-a1fb-e53f7e1f04bf@d32g2000yqh.googlegroups.com>, AdaMagica <christoph.grein@eurocopter.com> writes:
>>> Oh my dear anon, you are so wrong again.
>>>
>>>> package STANDARD is
>>>>
>>>> =A0 -- The universal type universal_integer is predefined. =A0
>>>>
>>>> =A0 type INTEGER is range - 2 ** 63 .. ( 2 ** 63 ) - 1 ;
>>>>
>>>> end STANDARD;
>>> You do *not* redefine Standard with this declaration, you simply hide
>>> it.
>>>
>>> with Standard;
>>>
>>> procedure Temp is -- Here you will get into troubled water.
>>>
>>> X: Integer; -- this is still the integer from the predefined
>>> package Standard
>>> Y: STANDARD.Integer; -- this is your INTEGER
>>>
>>> use Standard;
>>>
>>> Z: Integer :=3D 2; -- oh lord, what's this now?
>>>
>>> -- I'm not sure and I'm reluctant to do the RM exegesis to find out.
>>> I *guess* it's your INTEGER;
>>>
>>> I: Integer :=3D Z**3; -- subtype of 3 is still the Integer defined in
>>> -- the predefined Standard you've hidden
>>> J: Integer :=3D Z**Z; -- This should then be illegal because the
>>> subtype of the right operand of **
>>> -- must be the one from the hidden Standard.
>>>
>>> end Temp;
>>>
>>> Point is: You cannot redefine Standard! Full stop.
>>>
>>> I invite you to find the relevant paragraphs in the RM which state
>>> what will happen when you define a package named Standard.
>>>
>>> And please be careful to not mix up a subtype and the type of the
>>> subtype and the type of numeric literals. They are all different.
>>
>
>
>--
>"All things extant in this world,
>Gods of Heaven, gods of Earth,
>Let everything be as it should be;
>Thus shall it be!"
>- Magical chant from "Magical Shopping Arcade Abenobashi"
>
>"Drizzle, Drazzle, Drozzle, Drome,
>Time for this one to come home!"
>- Mr. Wizard from "Tooter Turtle"
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-09 22:28 ` anon
@ 2009-07-10 6:23 ` AdaMagica
0 siblings, 0 replies; 51+ messages in thread
From: AdaMagica @ 2009-07-10 6:23 UTC (permalink / raw)
On 10 Jul., 00:28, a...@anon.org (anon) wrote:
> If Ada RM A.2 ( 4 ), applied here, then Adacore / GNAT would not allow one
> to compile the a Standard package. When compiling the Ada.* you must use
> "-gnatpg", command option, but compiling the Standard package is as easy
> as compiling any non-vendor or Ada package.
A.2(4) In the standard mode, it is illegal to compile a child of
package Ada.
So what on earth are you talking about? Your Standard package is not a
child of Ada nor is the RM package Standard a child of Ada.
Any user-written library unit, so also your Standard, can ve viewed as
a child of the RM Standard, as Frank Lhota has explained. No one
claimed that it was illegal in standard mode to compile a package
called Standard.
Do you ever take the time to understand other's posts?
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada (Was: unsigned type)
2009-07-05 23:21 ` anon
2009-07-06 0:19 ` Learning Ada Albrecht Käfer
@ 2009-07-06 10:53 ` Georg Bauhaus
2009-07-06 19:34 ` anon
1 sibling, 1 reply; 51+ messages in thread
From: Georg Bauhaus @ 2009-07-06 10:53 UTC (permalink / raw)
anon schrieb:
> Wrong!
> I was not talking about the Ada Statements "Type" or "Subtype" but
> true Standards that go beyond Ada.
"Beyond Ada" sounds like wavy escape rhetorics:
Since the inception of what is now Ada, it was
pronouncedly clear that Ada is adressing real
computer systems and their hardware properties and
Ada was and is expressly connected to other standards.
Both, real computer systems and other standards
do *not* *at* *all* suggest the use of predefined
named types from package Standard for all your integer
needs, since Ada is smarter than that---unless teachers
prohibit the use of its extraordinary base type system!
See http://www.stsc.hill.af.mil/crosstalk/2000/08/mccormick.html
for the huge value attributable to a decent base type system:
"It was the accurate modeling of scalar quantities that
contributed the most to Ada's success in this course.
This is consistent with studies done on the nature of
wicked bugs in software [5] where nearly 80 percent
of programming errors in the C/C++ programs studied were
a result of problems with scalars.
"[5] Eisenstadt, M. (1997). My Hairiest Bug War Stories.
Communications of the ACM, 40, 30-37."
where "modeling of scalar quantities" is
"Modeling of scalar objects.
-- Strong typing.
-- Range constraints.
-- Enumeration types."
Aou suggest we should instead use implementation defined
types of unknown sizes?
> But Ada also, use standards for it types, "Integer", and "Float', with
> their associate subtypes. One reason but not the only reason for the range of
> these built-in types are the hardware.
Each user defined integer type, including operations
and objects, is translated giving proper attention to hardware,
> First, if this could happen the RM would need a MAJOR overhaul.
> It would be easier to create a new language. Because both types are used
> throughout the RM defined packages.
As has been said, use types from the Standard package
if and only if using the standard library.
Use package Interfaces.* if and only if interfacing
to language external facilities.
> Second, the predefined types allow for the program to be more portable,
> because a users type might not be accepted on the new system.
Portability through *avoiding* type definitions seems a
simplicissimus' argument, pardon me. Worse, it's a lure,
see Randy Brukardt's report. The statement
S : String (Positive'First .. Positive'Last / 2);
is largely unpredictable as regards portability from one
machine/RTS to another. So where is your portability?
If Positive happens to be a type for adressing 2**15 - 1
components, your program might run fine in one environment.
Once you port it to GNAT, say, you might be experiencing
all kinds of trouble!
If you really want programmers to
(a) use machine properties, or
(b) express maximally extensive types, for example,
then make them say so! Ada has the necessary bounds defined
for this kind of type definitions:
type My_Portability_Type is
range 0 .. Integer'Min(System.Max_Int, System.Memory_Size);
-- use whatever range is possible
This *cannot* be achieved by relying on Standard.Integer.
But using the
> standards or creating a subtype from the standards is better. An example is:
>
> type Integer is range -2 ** 256 .. +2 ** ( 256 - 1 ) ;
>
> which is a valid Ada statement but in a 32-bit and most 64-bit system this
> type is not allowed. You would need to use a special array or record type that
> is based on the universal-integer or CPU and define the operations in a math
> package or packages. There are a few special scientific projects that could
> use that type of maybe even a larger type like 1024-bit, but there's not
> enough applications for most to spend their time in creating such a package.
> Normally, its the scientist that ask for help that developes such packages for
> his project and only for his project and then sets the big price tag for others
> that package.
>
> Then third, is without standards types like "Integer" and "Float" how
> would the system work. Using Ada, define a "=" or "*" without using the
> universal-integer and universal-real types or there operations.
No one *ever* said something about removing the predefined
anonymous types universal_integer and universal_real
*needed* for defining integer types!
This and other claims have been adressed; have the postings
slipped your attention by any chance?
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada (Was: unsigned type)
2009-07-06 10:53 ` Learning Ada (Was: unsigned type) Georg Bauhaus
@ 2009-07-06 19:34 ` anon
2009-07-06 20:29 ` Learning Ada Albrecht Käfer
0 siblings, 1 reply; 51+ messages in thread
From: anon @ 2009-07-06 19:34 UTC (permalink / raw)
Who said remove the "the universal types aka the "universal_integer" and
"universal_real"? Well,
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Learning Ada (Was: unsigned type)
Date: 03 Jul 2009 09:12:51 +0200
"It might be to push things a bit too far, but I think it would be
beneficial, if the types Float and Integer were removed from the
language."
That suggests to anyone that read the statement that he thinks Ada would be
better off if the "Integer" and "Float" types were remove. And like I said
it would cause a MAJOR overhaul of the RM to the point that it would be
easier to create a new language.
A simple reason is that the "Integer" and "Float" are defined in the Standards
package RM A.1 ( 11 .. 12 ) and RM A.1 ( 20 .. 21 ). And the comments declare
the "Integer" basically as the "universal type is universal_integer" and the
"Float" basically as the "universal type is universal_real". So, when
"Jacob Sparre Andersen" suggested removing these types he is in a sense
suggesting pulling the "universal types" aka removing the universal_integer"
and "universal_real" from Ada.
As for Portability!
Portability is easy if you use the built-in standards. Like going from a
CRAY, VAX, IBM and a LLNL super computer (CPU was unknown for the
project) using, a mixer of programs written in Ada 83 and Ada 95
specification, with no modification within the used specification. That is,
using either Ada 83 or 95 a program was written for one vendor and
then compiled for the other 4 system without any Ada statements modifications.
The only allowable change was to programs and its packages file names based
on system to be compiled. The result of project was its all in the way
a person programs with Ada and if they limit the usage of external (non-RM)
packages. But portability can be extended to non-RM packages if Ada
programmer use other standards like, in today programs using openGL
or SDL for a graphic package instead of direct control of the OS window's
environment.
Now, A integer may change it range when switching from a 16-bit system to a
64-bit system, but the 16-bit code will work because the range of a 16-bit
integer is a subrange of a 64-bit integer. Else, throw the CPU and the
programmer out the window. Yes, a programmer can make a misstate that
causes error, but that not Ada fault. it time to replace that bad programmer.
A little food for Randy Brukardt report and something he said a few week
back.
Except for the "gigi" code (a-trans.c) which requires the GCC tree
structures, the complete GNAT system can be compile on Randy Brukardt's
janus Ada. And I mean even the GNAT GPL 2009 can be compiled, that
portability that a programmer can be proud of. And the reason one can do
this is Adacore wrote GNAT initial using Ada 83 specs and later they
might have added a few Ada 95 type statements. It would be true portability
if the GNAT's "gigi" routine was written in Ada and included a few Ada
packages for the tree structures to replace the GCC's C version. Now,
where's that Ada 95/2005 only version of the "c2ada" program, "simon.j.wright"?
So, true portability is up to the programmer. Write the code with portability
in mind. and the programmer can do it! But will he or will he write trashy C
like code. The decision might be away to help keep there job.
In <4a51d78d$0$30227$9b4e6d93@newsspool1.arcor-online.net>, Georg Bauhaus <rm.dash-bauhaus@futureapps.de> writes:
>anon schrieb:
>> Wrong!
>> I was not talking about the Ada Statements "Type" or "Subtype" but
>> true Standards that go beyond Ada.
>
>"Beyond Ada" sounds like wavy escape rhetorics:
>Since the inception of what is now Ada, it was
>pronouncedly clear that Ada is adressing real
>computer systems and their hardware properties and
>Ada was and is expressly connected to other standards.
>
>Both, real computer systems and other standards
>do *not* *at* *all* suggest the use of predefined
>named types from package Standard for all your integer
>needs, since Ada is smarter than that---unless teachers
>prohibit the use of its extraordinary base type system!
>
>See http://www.stsc.hill.af.mil/crosstalk/2000/08/mccormick.html
>for the huge value attributable to a decent base type system:
>
>"It was the accurate modeling of scalar quantities that
> contributed the most to Ada's success in this course.
> This is consistent with studies done on the nature of
> wicked bugs in software [5] where nearly 80 percent
> of programming errors in the C/C++ programs studied were
> a result of problems with scalars.
>
>"[5] Eisenstadt, M. (1997). My Hairiest Bug War Stories.
> Communications of the ACM, 40, 30-37."
>
>where "modeling of scalar quantities" is
>
>"Modeling of scalar objects.
>-- Strong typing.
>-- Range constraints.
>-- Enumeration types."
>
>Aou suggest we should instead use implementation defined
>types of unknown sizes?
>
>
>> But Ada also, use standards for it types, "Integer", and "Float', with
>> their associate subtypes. One reason but not the only reason for the range of
>> these built-in types are the hardware.
>
>Each user defined integer type, including operations
>and objects, is translated giving proper attention to hardware,
>
>
>
>> First, if this could happen the RM would need a MAJOR overhaul.
>> It would be easier to create a new language. Because both types are used
>> throughout the RM defined packages.
>
>As has been said, use types from the Standard package
>if and only if using the standard library.
>Use package Interfaces.* if and only if interfacing
>to language external facilities.
>
>
>> Second, the predefined types allow for the program to be more portable,
>> because a users type might not be accepted on the new system.
>
>Portability through *avoiding* type definitions seems a
>simplicissimus' argument, pardon me. Worse, it's a lure,
>see Randy Brukardt's report. The statement
>
> S : String (Positive'First .. Positive'Last / 2);
>
>is largely unpredictable as regards portability from one
>machine/RTS to another. So where is your portability?
>If Positive happens to be a type for adressing 2**15 - 1
>components, your program might run fine in one environment.
>Once you port it to GNAT, say, you might be experiencing
>all kinds of trouble!
>
>If you really want programmers to
>
>(a) use machine properties, or
>(b) express maximally extensive types, for example,
>
>then make them say so! Ada has the necessary bounds defined
>for this kind of type definitions:
>
> type My_Portability_Type is
> range 0 .. Integer'Min(System.Max_Int, System.Memory_Size);
>
> -- use whatever range is possible
>
>This *cannot* be achieved by relying on Standard.Integer.
>
> But using the
>> standards or creating a subtype from the standards is better. An example is:
>>
>> type Integer is range -2 ** 256 .. +2 ** ( 256 - 1 ) ;
>>
>> which is a valid Ada statement but in a 32-bit and most 64-bit system this
>> type is not allowed. You would need to use a special array or record type that
>> is based on the universal-integer or CPU and define the operations in a math
>> package or packages. There are a few special scientific projects that could
>> use that type of maybe even a larger type like 1024-bit, but there's not
>> enough applications for most to spend their time in creating such a package.
>> Normally, its the scientist that ask for help that developes such packages for
>> his project and only for his project and then sets the big price tag for others
>> that package.
>>
>> Then third, is without standards types like "Integer" and "Float" how
>> would the system work. Using Ada, define a "=" or "*" without using the
>> universal-integer and universal-real types or there operations.
>
>No one *ever* said something about removing the predefined
>anonymous types universal_integer and universal_real
>*needed* for defining integer types!
>This and other claims have been adressed; have the postings
>slipped your attention by any chance?
>
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: Learning Ada
2009-07-06 19:34 ` anon
@ 2009-07-06 20:29 ` Albrecht Käfer
0 siblings, 0 replies; 51+ messages in thread
From: Albrecht Käfer @ 2009-07-06 20:29 UTC (permalink / raw)
anon schrieb:
> Now, A integer may change it range when switching from a 16-bit system to a
> 64-bit system, but the 16-bit code will work because the range of a 16-bit
> integer is a subrange of a 64-bit integer. Else, throw the CPU and the
> programmer out the window. Yes, a programmer can make a misstate that
> causes error, but that not Ada fault. it time to replace that bad programmer.
You're forgetting the embedded market. There may be good reasons to
downgrade from a 32-bit to a 16-bit (or even 8-bit) system. Power
consumption, resistance to radiation or simply the price come to mind.
Albrecht
^ permalink raw reply [flat|nested] 51+ messages in thread
[parent not found: <36841f24.293012@news.ptd.net>]
* Re: learning ada
[not found] <36841f24.293012@news.ptd.net>
@ 1998-12-25 0:00 ` LeakyStain
1998-12-26 0:00 ` David Botton
0 siblings, 1 reply; 51+ messages in thread
From: LeakyStain @ 1998-12-25 0:00 UTC (permalink / raw)
bob wrote:
>
> hey everyone, i am a student learning ADA at college right
> now. i am considering going for a master's degree in software
> engineering to go along with a BA in comp. engineering. i have
> completed a course in ada, and will have one more course this next
> semester. i really want to get a good knowledge of this language, but
> we never do anything like what everyone talks about in here because it
> is more advanced. i was wondering what the best way to go about
> learning more in depth of the language, what is the best way? thanks
> in advance
First, go to www.adahome.com, and browse around a bit, so you know what
sort of resources are available. Work thru the Lovelace tutorial, if you
haven't done that already. Buy one of the recommended books (my favorite
is Cohen's 'Ada as a Second Language').
Then pick a program you'd like to write; a card game, a spreadsheet,
whatever turns you on. Start writing it. You'll do it badly, but you
don't need to show it to anyone. Look up anything you don't know how to
do. When you're done, go back and fix it up, so it's more elegant, or
uses some feature of Ada you didn't use the first time (tagged types or
generics or Finalization). Most of all, keep it fun!
>
> jarrod ross
-- Stephe
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: learning ada
1998-12-25 0:00 ` learning ada LeakyStain
@ 1998-12-26 0:00 ` David Botton
0 siblings, 0 replies; 51+ messages in thread
From: David Botton @ 1998-12-26 0:00 UTC (permalink / raw)
Also check out www.botton.com/ada TheAda Source Code Treasury for examples
of code and join the mail list tehre so you get updates when new code is
added.
David Botton
LeakyStain wrote in message <36845EC8.6795772B@erols.com>...
>bob wrote:
>>
>> hey everyone, i am a student learning ADA at college right
>> now. i am considering going for a master's degree in software
>> engineering to go along with a BA in comp. engineering. i have
>> completed a course in ada, and will have one more course this next
>> semester. i really want to get a good knowledge of this language, but
>> we never do anything like what everyone talks about in here because it
>> is more advanced. i was wondering what the best way to go about
>> learning more in depth of the language, what is the best way? thanks
>> in advance
>
>First, go to www.adahome.com, and browse around a bit, so you know what
>sort of resources are available. Work thru the Lovelace tutorial, if you
>haven't done that already. Buy one of the recommended books (my favorite
>is Cohen's 'Ada as a Second Language').
>
>Then pick a program you'd like to write; a card game, a spreadsheet,
>whatever turns you on. Start writing it. You'll do it badly, but you
>don't need to show it to anyone. Look up anything you don't know how to
>do. When you're done, go back and fix it up, so it's more elegant, or
>uses some feature of Ada you didn't use the first time (tagged types or
>generics or Finalization). Most of all, keep it fun!
>
>>
>> jarrod ross
>
>-- Stephe
^ permalink raw reply [flat|nested] 51+ messages in thread
* Learning ADA
@ 1989-06-15 1:48 Krishan M Nainani
1989-06-15 14:19 ` Rosa Weber
0 siblings, 1 reply; 51+ messages in thread
From: Krishan M Nainani @ 1989-06-15 1:48 UTC (permalink / raw)
I am interested in learning Ada. Can anyone recommend a good book
which is not VERY basic since I do know C and Pascal and have a
good knowledge of multi-processing.
Please reply to: tfrancis@wpi.wpi.edu
Krishan Nainani
^ permalink raw reply [flat|nested] 51+ messages in thread
* Learning Ada
@ 1985-09-06 15:10 Marty Sasaki
0 siblings, 0 replies; 51+ messages in thread
From: Marty Sasaki @ 1985-09-06 15:10 UTC (permalink / raw)
I tried to reply to every message that I received, but the mailer
returned many as undeliverable. Sorry to post this.
Anyway, thanks to everyone for their recommendations and general
advice. I'll wander down to the Coop and look at the recommendations
in the next few days.
Marty Sasaki
--
----------------
Marty Sasaki net: sasaki@harvard.{arpa,uucp}
Havard University Science Center phone: 617-495-1270
One Oxford Street
Cambridge, MA 02138
^ permalink raw reply [flat|nested] 51+ messages in thread
[parent not found: <332@harvard.UUCP>]
* Learning Ada
@ 1985-09-03 2:46 Marty Sasaki
0 siblings, 0 replies; 51+ messages in thread
From: Marty Sasaki @ 1985-09-03 2:46 UTC (permalink / raw)
I've decided that is time to learn Ada. What's the best way to do
this? Which books are interesting and useful?
I don't need to learn to program (I'm semi-fluent in C, Pascal,
FORTRAN, and have dabbled with Modula-2, CLU, and many more that I
can't remember). I need to get an overview of the language, and a
glimpse of some of the paradigms.
--
----------------
Marty Sasaki net: sasaki@harvard.{arpa,uucp}
Havard University Science Center phone: 617-495-1270
One Oxford Street
Cambridge, MA 02138
^ permalink raw reply [flat|nested] 51+ messages in thread
end of thread, other threads:[~2020-10-22 10:32 UTC | newest]
Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 10:36 Learning Ada Jack Davy
2020-09-15 14:31 ` Anders Wirzenius
2020-09-15 15:07 ` Jack Davy
2020-09-15 15:54 ` Ludovic Brenta
2020-09-15 17:01 ` Simon Wright
2020-09-15 17:07 ` Simon Wright
2020-09-15 19:03 ` Jack Davy
2020-09-15 19:28 ` Gautier write-only
2020-09-15 23:00 ` Jerry Petrey
2020-09-16 1:23 ` Paul Rubin
2020-09-16 7:13 ` Jack Davy
2020-09-16 7:32 ` Jack Davy
2020-09-16 9:13 ` Gautier write-only
2020-09-16 10:55 ` Ludovic Brenta
2020-09-16 11:09 ` Dmitry A. Kazakov
2020-10-02 18:43 ` gautier...@hotmail.com
2020-10-03 6:43 ` Dmitry A. Kazakov
2020-10-05 18:36 ` Shark8
2020-10-17 19:28 ` antispam
2020-10-17 22:47 ` Randy Brukardt
2020-10-18 6:45 ` Dmitry A. Kazakov
2020-09-16 15:01 ` Jeffrey R. Carter
2020-09-18 6:53 ` Mart van de Wege
2020-09-18 10:00 ` Jeffrey R. Carter
2020-09-16 21:29 ` Paul Rubin
2020-10-06 4:06 ` andrew...@gmail.com
2020-10-06 7:32 ` Jack Davy
2020-10-17 23:02 ` mgr
2020-10-22 10:32 ` Jeffrey R. Carter
-- strict thread matches above, loose matches on Subject: below --
2010-07-24 14:21 Frederick Williams
2010-07-24 16:21 ` Simon Wright
2010-07-25 20:33 ` mockturtle
2009-06-28 17:56 unsigned type anon
2009-06-28 19:54 ` tmoran
2009-06-29 13:36 ` Rob Solomon
2009-06-29 14:18 ` Ludovic Brenta
2009-07-03 1:41 ` Rob Solomon
2009-07-03 7:12 ` Learning Ada (Was: unsigned type) Jacob Sparre Andersen
2009-07-03 8:38 ` Learning Ada Peter Hermann
2009-07-03 9:44 ` Georg Bauhaus
2009-07-03 22:20 ` Learning Ada (Was: unsigned type) anon
2009-07-04 14:53 ` Georg Bauhaus
2009-07-05 23:21 ` anon
2009-07-06 0:19 ` Learning Ada Albrecht Käfer
2009-07-06 2:50 ` anon
2009-07-06 6:18 ` AdaMagica
2009-07-06 7:47 ` Jean-Pierre Rosen
2009-07-06 20:21 ` anon
2009-07-06 21:08 ` Georg Bauhaus
2009-07-06 22:43 ` Frank J. Lhota
2009-07-09 22:28 ` anon
2009-07-10 6:23 ` AdaMagica
2009-07-06 10:53 ` Learning Ada (Was: unsigned type) Georg Bauhaus
2009-07-06 19:34 ` anon
2009-07-06 20:29 ` Learning Ada Albrecht Käfer
[not found] <36841f24.293012@news.ptd.net>
1998-12-25 0:00 ` learning ada LeakyStain
1998-12-26 0:00 ` David Botton
1989-06-15 1:48 Learning ADA Krishan M Nainani
1989-06-15 14:19 ` Rosa Weber
1985-09-06 15:10 Learning Ada Marty Sasaki
[not found] <332@harvard.UUCP>
1985-09-04 16:07 ` richw
1985-09-03 2:46 Marty Sasaki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox