comp.lang.ada
 help / color / mirror / Atom feed
* Newbee question
@ 2002-12-14 15:16 Eric Robert
  2002-12-14 20:10 ` Jeffrey Carter
  0 siblings, 1 reply; 19+ messages in thread
From: Eric Robert @ 2002-12-14 15:16 UTC (permalink / raw)


Hi,

I'm new to Ada (2nd day almost) and I'm trying to save an array of record in
a file. So far so goood. I save an integer first to know how many items they
are in the array. But how can I possibly read it back? I don't know the size
of the array yet. It seems to me that I need to use unconstrained arrays. If
so, I can't get the syntax right or a proper example explaining how to
enlarge the array...

Thanks!!

Eric Robert





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-14 15:16 Newbee question Eric Robert
@ 2002-12-14 20:10 ` Jeffrey Carter
  2002-12-15  1:49   ` Eric Robert
  0 siblings, 1 reply; 19+ messages in thread
From: Jeffrey Carter @ 2002-12-14 20:10 UTC (permalink / raw)


Eric Robert wrote:
> 
> I'm new to Ada (2nd day almost) and I'm trying to save an array of record in
> a file. So far so goood. I save an integer first to know how many items they
> are in the array. But how can I possibly read it back? I don't know the size
> of the array yet. It seems to me that I need to use unconstrained arrays. If
> so, I can't get the syntax right or a proper example explaining how to
> enlarge the array...

So, is this a homework problem?

You might want to look at block statements. You can declare an array 
variable in a block statement using values determined at run time.

-- 
Jeff Carter
"Why don't you bore a hole in yourself and let the sap run out?"
Horse Feathers




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-14 20:10 ` Jeffrey Carter
@ 2002-12-15  1:49   ` Eric Robert
  2002-12-15  4:04     ` James S. Rogers
                       ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Eric Robert @ 2002-12-15  1:49 UTC (permalink / raw)


Well, yes and no. I am not a student anymore and I know quite a few
languages. But not ADA even if I hear of it when I was a student at the
University. But one student came to me and ask me to do a little thing in
ADA. So, I read the Lovelace tutorial from the start to the end and still, I
wasn't quite able to do anything usefull.

I must say that, being a senior C++ programmer, ADA seems to me like a
language that isn't very usefull & efficient. Sorry to say but it seems like
a languages for dummies! I when to the library to get a book and now I can
do usefull stuff. The web is not crowded with ADA samples & resources so I
needed a book! I can't belive this... The community is much smaller than
what I'm used to (C and C++). But still : it was worth to learn. It maybe
good for learning and research (i.e. when you're NOT a experienced
programmmer) but not for real life usage when CPU & ressources are critical.
Sorry but learning it doesn't make me a believer ;-)

Thanks anyways!

"Jeffrey Carter" <jrcarter@acm.org> wrote in message
news:3DFB9067.2040600@acm.org...
> Eric Robert wrote:
> >
> > I'm new to Ada (2nd day almost) and I'm trying to save an array of
record in
> > a file. So far so goood. I save an integer first to know how many items
they
> > are in the array. But how can I possibly read it back? I don't know the
size
> > of the array yet. It seems to me that I need to use unconstrained
arrays. If
> > so, I can't get the syntax right or a proper example explaining how to
> > enlarge the array...
>
> So, is this a homework problem?
>
> You might want to look at block statements. You can declare an array
> variable in a block statement using values determined at run time.
>
> --
> Jeff Carter
> "Why don't you bore a hole in yourself and let the sap run out?"
> Horse Feathers
>





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-15  1:49   ` Eric Robert
@ 2002-12-15  4:04     ` James S. Rogers
  2002-12-16 10:32       ` John McCabe
  2002-12-15  7:57     ` Pascal Obry
                       ` (3 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: James S. Rogers @ 2002-12-15  4:04 UTC (permalink / raw)


"Eric Robert" <synapzzz@hotmail.com> wrote in message
news:0dRK9.37601$xH3.400905@weber.videotron.net...
> Well, yes and no. I am not a student anymore and I know quite a few
> languages. But not ADA even if I hear of it when I was a student at the
> University. But one student came to me and ask me to do a little thing in
> ADA. So, I read the Lovelace tutorial from the start to the end and still,
I
> wasn't quite able to do anything usefull.
>
> I must say that, being a senior C++ programmer, ADA seems to me like a
> language that isn't very usefull & efficient. Sorry to say but it seems
like
> a languages for dummies! I when to the library to get a book and now I can
> do usefull stuff. The web is not crowded with ADA samples & resources so I
> needed a book! I can't belive this... The community is much smaller than
> what I'm used to (C and C++). But still : it was worth to learn. It maybe
> good for learning and research (i.e. when you're NOT a experienced
> programmmer) but not for real life usage when CPU & ressources are
critical.
> Sorry but learning it doesn't make me a believer ;-)
>

It does not sound like you have learned it yet.
If you really read the information about Ada you would know that Ada
arrays are not resizable. This is the same as with C and C++.

Ada arrays are not the same as C++ vectors.
This does not mean that you cannot create the equivalent of a C++
vector. It is done pretty much the same way it was done in C++.
You would need to dynamically allocate the array you need.
To enlarge the array you need to dynamically allocate the new
array, copy the old elements into the new array, and deallocate
the old array. This is, after all, what C++ does for its vector
class. Why is it not reasonable that Ada would need a similar
solution?

Did you look at www.adapower.com ?
It has a reasonable number of examples, as well as links to
online text books and tutorials.

When you learn Ada you will also learn how to manage CPU and
resource usage. Admittedly, it does not have the feel of C or C++.
You are not programming in a glorified assembler language.
You have at least as much control over data representations as
you have in C or C++. You have the ability to control code
complexity. You have the ability to call assembler routines.

Just what is missing from Ada that you think makes it not
useful for professional work? Just for grins, how many lines
of Ada code do you guess are running in real systems
around the world today?

To be truthful, your posting quoted above sounds like the
efforts of a troll rather than a report of an honest effort to
learn a language.

Jim Rogers





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-15  1:49   ` Eric Robert
  2002-12-15  4:04     ` James S. Rogers
@ 2002-12-15  7:57     ` Pascal Obry
  2002-12-15 10:06     ` Jerry van Dijk
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 19+ messages in thread
From: Pascal Obry @ 2002-12-15  7:57 UTC (permalink / raw)



"Eric Robert" <synapzzz@hotmail.com> writes:

> what I'm used to (C and C++). But still : it was worth to learn. It maybe
> good for learning and research (i.e. when you're NOT a experienced
> programmmer) but not for real life usage when CPU & ressources are critical.

Yep we all know that. All codes written for safety critical systems like power
plant, space craft, TGV, etc. are made by NOT experienced programmers!

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-15  1:49   ` Eric Robert
  2002-12-15  4:04     ` James S. Rogers
  2002-12-15  7:57     ` Pascal Obry
@ 2002-12-15 10:06     ` Jerry van Dijk
  2002-12-15 19:04       ` Michal Nowak
  2002-12-16  0:47     ` Eric Robert
  2002-12-16 10:28     ` John McCabe
  4 siblings, 1 reply; 19+ messages in thread
From: Jerry van Dijk @ 2002-12-15 10:06 UTC (permalink / raw)



"Eric Robert" <synapzzz@hotmail.com> writes:

> I must say that, being a senior C++ programmer, ADA seems to me like a
> language that isn't very usefull & efficient. Sorry to say but it seems like
> a languages for dummies!

See, that's why I always advise our competitors to use C++ and Assembler...

:-)

-- 
--  Jerry van Dijk   | email: jvandyk@attglobal.net
--  Leiden, Holland  | web:   users.ncrvnet.nl/gmvdijk



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-15 10:06     ` Jerry van Dijk
@ 2002-12-15 19:04       ` Michal Nowak
  2002-12-16 10:33         ` John McCabe
  0 siblings, 1 reply; 19+ messages in thread
From: Michal Nowak @ 2002-12-15 19:04 UTC (permalink / raw)


"Eric Robert" <synapzzz@hotmail.com> writes:

> I must say that, being a senior C++ programmer, ADA seems to me like a
> language that isn't very usefull & efficient. Sorry to say but it
> seems like a languages for dummies!

Gee, Boeing and TGV programmed by dummies! I wonder what are the profi
doing?

:-)

Michal


"Beyond 100,000 lines of code you
should probably be coding in Ada"
   - P. J. Plauger






^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-15  1:49   ` Eric Robert
                       ` (2 preceding siblings ...)
  2002-12-15 10:06     ` Jerry van Dijk
@ 2002-12-16  0:47     ` Eric Robert
  2002-12-17  3:23       ` Bill Findlay
  2002-12-16 10:28     ` John McCabe
  4 siblings, 1 reply; 19+ messages in thread
From: Eric Robert @ 2002-12-16  0:47 UTC (permalink / raw)


Haha...! I new this would bring more attention to my thread ;-)
Sorry to have offended you guys...

Ah, I know quite a few language now : Ada. I won't criticise it - this first
time was mostly to get the attention. I don't really like it but there are
things that are nice. The langugage you choose is from the scale of the
problem you want to solve and how much abstraction you need. Anyways, Ada is
not for me... I might be too old now. You now...

"Eric Robert" <synapzzz@hotmail.com> wrote in message
news:0dRK9.37601$xH3.400905@weber.videotron.net...
> Well, yes and no. I am not a student anymore and I know quite a few
> languages. But not ADA even if I hear of it when I was a student at the
> University. But one student came to me and ask me to do a little thing in
> ADA. So, I read the Lovelace tutorial from the start to the end and still,
I
> wasn't quite able to do anything usefull.
>
> I must say that, being a senior C++ programmer, ADA seems to me like a
> language that isn't very usefull & efficient. Sorry to say but it seems
like
> a languages for dummies! I when to the library to get a book and now I can
> do usefull stuff. The web is not crowded with ADA samples & resources so I
> needed a book! I can't belive this... The community is much smaller than
> what I'm used to (C and C++). But still : it was worth to learn. It maybe
> good for learning and research (i.e. when you're NOT a experienced
> programmmer) but not for real life usage when CPU & ressources are
critical.
> Sorry but learning it doesn't make me a believer ;-)
>
> Thanks anyways!
>
> "Jeffrey Carter" <jrcarter@acm.org> wrote in message
> news:3DFB9067.2040600@acm.org...
> > Eric Robert wrote:
> > >
> > > I'm new to Ada (2nd day almost) and I'm trying to save an array of
> record in
> > > a file. So far so goood. I save an integer first to know how many
items
> they
> > > are in the array. But how can I possibly read it back? I don't know
the
> size
> > > of the array yet. It seems to me that I need to use unconstrained
> arrays. If
> > > so, I can't get the syntax right or a proper example explaining how to
> > > enlarge the array...
> >
> > So, is this a homework problem?
> >
> > You might want to look at block statements. You can declare an array
> > variable in a block statement using values determined at run time.
> >
> > --
> > Jeff Carter
> > "Why don't you bore a hole in yourself and let the sap run out?"
> > Horse Feathers
> >
>
>





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-15  1:49   ` Eric Robert
                       ` (3 preceding siblings ...)
  2002-12-16  0:47     ` Eric Robert
@ 2002-12-16 10:28     ` John McCabe
  2002-12-17  2:36       ` Eric Robert
  4 siblings, 1 reply; 19+ messages in thread
From: John McCabe @ 2002-12-16 10:28 UTC (permalink / raw)


On Sat, 14 Dec 2002 20:49:02 -0500, "Eric Robert"
<synapzzz@hotmail.com> wrote:

>Well, yes and no. I am not a student anymore and I know quite a few
>languages. But not ADA even if I hear of it when I was a student at the
>University.

You mightlike to call it Ada ;-)

>I must say that, being a senior C++ programmer, ADA seems to me like a
>language that isn't very usefull & efficient. Sorry to say but it seems like
>a languages for dummies!

It is a language that is designed to be safe and readable. It is more
often than not used on large scale programs where many developers may
be involved and which require high reliability. With staff turnover
etc, its readability ensures that maintenance of the code doesn't pose
too many problems.

> I when to the library to get a book and now I can
>do usefull stuff

>The web is not crowded with ADA samples & resources so I
>needed a book!

What's wrong with http://www.adapower.com for example? Have you looked
at http://www.adaic.org? Where can you download the ANSI C++ Standard?

>I can't belive this... The community is much smaller than
>what I'm used to (C and C++).

Of course it is, but you'll probably find it is much more helpful
towards someone with the right attitude, and there is far less noise
than in any of the C/C++ based newsgroups.

>But still : it was worth to learn. It maybe
>good for learning and research (i.e. when you're NOT a experienced
>programmmer) but not for real life usage when CPU & ressources are critical.

In fact it is very good where CPU & resources are critical. When was
the last time you built a system in C++ based on a Mil-Std-1750A
processor (1.3MIPS) using 48kBytes of RAM and requiring an action to
be performed in response to an interrupt within 8us?

>Sorry but learning it doesn't make me a believer ;-)

Only experience can do that, but you'll get there.


Best Regards
John McCabe

To reply by email replace 'nospam' with 'assen'



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-15  4:04     ` James S. Rogers
@ 2002-12-16 10:32       ` John McCabe
  2002-12-16 13:28         ` Marin David Condic
  0 siblings, 1 reply; 19+ messages in thread
From: John McCabe @ 2002-12-16 10:32 UTC (permalink / raw)


On Sun, 15 Dec 2002 04:04:14 GMT, "James S. Rogers"
<jimmaureenrogers@worldnet.att.net> wrote:

>You have at least as much control over data representations as
>you have in C or C++.

I wouldn't have put it that way - you have far more control over data
representations than you have in C or C++. Record representation
clauses (as long as the compiler supports them) are very well defined.
In C and C++ bit-fields are a bit of a hit and miss affair.

Ada's enumerated types are also far superior to those of C/C++ (except
they have to be in order!).

> You have the ability to call assembler routines.

And any other language that may come in useful (even C if you must :-)

>To be truthful, your posting quoted above sounds like the
>efforts of a troll rather than a report of an honest effort to
>learn a language.

Some of it. Some of it sounds like he has a genuine interest.

Best Regards
John McCabe

To reply by email replace 'nospam' with 'assen'



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-15 19:04       ` Michal Nowak
@ 2002-12-16 10:33         ` John McCabe
  0 siblings, 0 replies; 19+ messages in thread
From: John McCabe @ 2002-12-16 10:33 UTC (permalink / raw)


On Sun, 15 Dec 2002 20:04:47 +0100, Michal Nowak <vinnie@inetia.pl>
wrote:

>"Eric Robert" <synapzzz@hotmail.com> writes:
>
>> I must say that, being a senior C++ programmer, ADA seems to me like a
>> language that isn't very usefull & efficient. Sorry to say but it
>> seems like a languages for dummies!
>
>Gee, Boeing and TGV programmed by dummies! I wonder what are the profi
>doing?

There's lots of Ada in Ariane V isn't there? ;-)

Best Regards
John McCabe

To reply by email replace 'nospam' with 'assen'



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-16 10:32       ` John McCabe
@ 2002-12-16 13:28         ` Marin David Condic
  2002-12-17  0:31           ` Randy Brukardt
  0 siblings, 1 reply; 19+ messages in thread
From: Marin David Condic @ 2002-12-16 13:28 UTC (permalink / raw)


John McCabe <john@nospam.demon.co.uk> wrote in message
news:3dfdab08.5187148@news.demon.co.uk...
>
> I wouldn't have put it that way - you have far more control over data
> representations than you have in C or C++. Record representation
> clauses (as long as the compiler supports them) are very well defined.
> In C and C++ bit-fields are a bit of a hit and miss affair.
>
Yes, but when the compiler rejects valid representation clauses simply
because it doesn't want to do it that way, you're back to picking the bits
apart out of a byte array just like you would with C or C++. Or if the
language doesn't give you a means of expressing a representation for some of
the features (How do you control where the tag goes in a tagged record so
you can effectively control the placement of everything else?) you're stuck
once again.

Ada has some really nice syntax for controlling representation - but all of
that is totally useless the instant the compiler starts rejecting it for
even *some* of the cases.

MDC
--
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jast.mil/

Send Replies To: m c o n d i c @ a c m . o r g

    "I'd trade it all for just a little more"
        --  Charles Montgomery Burns, [4F10]
======================================================================






^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-16 13:28         ` Marin David Condic
@ 2002-12-17  0:31           ` Randy Brukardt
  2002-12-17 15:24             ` Marin David Condic
  0 siblings, 1 reply; 19+ messages in thread
From: Randy Brukardt @ 2002-12-17  0:31 UTC (permalink / raw)


Marin David Condic wrote in message ...

>Yes, but when the compiler rejects valid representation clauses simply
>because it doesn't want to do it that way, you're back to picking the
bits
>apart out of a byte array just like you would with C or C++.

If Ada compilers had to support every possible representation clause, I
think it is likely that there wouldn't be any Ada compilers. It is
probably possible to handle every possible bit alignment of every
possible object, but the resulting compiler would be very complex (with
that many more bugs) and/or the results code would be very inefficient.
You can't have everything.

>Or if the language doesn't give you a means of expressing a
representation for some of
>the features (How do you control where the tag goes in a tagged record
so
>you can effectively control the placement of everything else?) you're
stuck once again.


You don't NEED to control where the tag goes. You simply need to be able
to control where everything else goes. Admittedly, some compilers don't
allow moving the tag, but I know that Janus/Ada does and I believe that
Rational Apex does as well. (In practice, it doesn't help much, because
virtually all useful O-O types are controlled, meaning all user types
are extensions, and you can only change the representation of the
extension part of an extension. Without this rule, you can't have
classwide dispatching -- obviously the tag has to be in the same place
in any possible object.)

>Ada has some really nice syntax for controlling representation - but
all of
>that is totally useless the instant the compiler starts rejecting it
for even *some* of the cases.

I strongly disagree. Janus/Ada has rather restrictive limits on
alignment of composite objects (more than GNAT's), yet we were able to
use rep. clauses on virtually all of the types imported from Windows in
Claw. In the few cases where we weren't able to use them directly, we
used solutions like the ones proposed as solutions to the original
poster's question. And, I certainly fail to see how anyone is worse off
with these solutions available than they would be in C. So, people are
usually better off than C/C++ for controlling representation, and
occassionally have the same amount of pain.

            Randy Brukardt.







^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-16 10:28     ` John McCabe
@ 2002-12-17  2:36       ` Eric Robert
  2002-12-17  3:24         ` Bill Findlay
  2002-12-18  9:37         ` John McCabe
  0 siblings, 2 replies; 19+ messages in thread
From: Eric Robert @ 2002-12-17  2:36 UTC (permalink / raw)


Well... Not that long ago: On some new PIC18FXX microprocessors with about
10 time less memory. You say: within 8us... sounds impressive... Wow! I'm
impressed! -- It depends on what you have to do and it depends on your clock
speed! 8us is really bad on some microprocessors. So, state your CPU and its
clock to get me the impression that 8us is impressive. But please... don't
try to impress newbees like me ;-)

I guess my point is Ada is 'restrictive' (NOT more readable -- Why is that?)
and that it can be of some help for big team of people that don't
communicate with each others. But when your CPU have less than 100K of RAM
and you're on a 'big' team: well... I guess the debate over Ada is
useless... How many of you guys are needed to program a chip with less than
100K of RAM? Hope that this doesn't fall in the 'big team' argument.

"John McCabe" <john@nospam.demon.co.uk> wrote in message
news:3dfda848.4482755@news.demon.co.uk...
> On Sat, 14 Dec 2002 20:49:02 -0500, "Eric Robert"
> <synapzzz@hotmail.com> wrote:
>
> >Well, yes and no. I am not a student anymore and I know quite a few
> >languages. But not ADA even if I hear of it when I was a student at the
> >University.
>
> You mightlike to call it Ada ;-)
>
> >I must say that, being a senior C++ programmer, ADA seems to me like a
> >language that isn't very usefull & efficient. Sorry to say but it seems
like
> >a languages for dummies!
>
> It is a language that is designed to be safe and readable. It is more
> often than not used on large scale programs where many developers may
> be involved and which require high reliability. With staff turnover
> etc, its readability ensures that maintenance of the code doesn't pose
> too many problems.
>
> > I when to the library to get a book and now I can
> >do usefull stuff
>
> >The web is not crowded with ADA samples & resources so I
> >needed a book!
>
> What's wrong with http://www.adapower.com for example? Have you looked
> at http://www.adaic.org? Where can you download the ANSI C++ Standard?
>
> >I can't belive this... The community is much smaller than
> >what I'm used to (C and C++).
>
> Of course it is, but you'll probably find it is much more helpful
> towards someone with the right attitude, and there is far less noise
> than in any of the C/C++ based newsgroups.
>
> >But still : it was worth to learn. It maybe
> >good for learning and research (i.e. when you're NOT a experienced
> >programmmer) but not for real life usage when CPU & ressources are
critical.
>
> In fact it is very good where CPU & resources are critical. When was
> the last time you built a system in C++ based on a Mil-Std-1750A
> processor (1.3MIPS) using 48kBytes of RAM and requiring an action to
> be performed in response to an interrupt within 8us?
>
> >Sorry but learning it doesn't make me a believer ;-)
>
> Only experience can do that, but you'll get there.
>
>
> Best Regards
> John McCabe
>
> To reply by email replace 'nospam' with 'assen'





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-16  0:47     ` Eric Robert
@ 2002-12-17  3:23       ` Bill Findlay
  0 siblings, 0 replies; 19+ messages in thread
From: Bill Findlay @ 2002-12-17  3:23 UTC (permalink / raw)


On 16/12/02 00:47, in article 3OvL9.17775$C32.271828@weber.videotron.net,
"Eric Robert" <synapzzz@hotmail.com> wrote:

> Haha...! I new this would bring more attention to my thread ;-)
> Sorry to have offended you guys...
> 
> Ah, I know quite a few language now : Ada. I won't criticise it - this first
> time was mostly to get the attention. I don't really like it but there are
> things that are nice. The langugage you choose is from the scale of the
> problem you want to solve and how much abstraction you need. Anyways, Ada is
> not for me... I might be too old now. You now...

What is your point exactly, apart from gratuitously offensive ageism?

-- 
Bill-Findlay chez blue-yonder.co.uk ("-" => "")





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-17  2:36       ` Eric Robert
@ 2002-12-17  3:24         ` Bill Findlay
  2002-12-18  9:37         ` John McCabe
  1 sibling, 0 replies; 19+ messages in thread
From: Bill Findlay @ 2002-12-17  3:24 UTC (permalink / raw)


On 17/12/02 02:36, in article Y4wL9.17854$C32.275536@weber.videotron.net,
"Eric Robert" <synapzzz@hotmail.com> wrote:

> Well... Not that long ago: On some new PIC18FXX microprocessors with about
> 10 time less memory. You say: within 8us... sounds impressive... Wow! I'm
> impressed! -- It depends on what you have to do and it depends on your clock
> speed! 8us is really bad on some microprocessors. So, state your CPU and its
> clock to get me the impression that 8us is impressive. But please... don't
> try to impress newbees like me ;-)

Did you even read the post you replied to? It said:

>> In fact it is very good where CPU & resources are critical. When was
>> the last time you built a system in C++ based on a Mil-Std-1750A
>> processor (1.3MIPS) using 48kBytes of RAM and requiring an action to
>> be performed in response to an interrupt within 8us?

> I guess my point is Ada is 'restrictive' (NOT more readable -- Why is that?)

(a) Wrong and  (b) wrong.

Do you have any constructive purpose in posting here,
or are you simply trying to be disruptive?
-- 
Bill-Findlay chez blue-yonder.co.uk ("-" => "")




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-17  0:31           ` Randy Brukardt
@ 2002-12-17 15:24             ` Marin David Condic
  2002-12-19 10:32               ` Ole-Hjalmar Kristensen
  0 siblings, 1 reply; 19+ messages in thread
From: Marin David Condic @ 2002-12-17 15:24 UTC (permalink / raw)


Randy Brukardt <randy@rrsoftware.com> wrote in message
news:uvssakrf41lvc3@corp.supernews.com...
>
> I strongly disagree. Janus/Ada has rather restrictive limits on
> alignment of composite objects (more than GNAT's), yet we were able to
> use rep. clauses on virtually all of the types imported from Windows in
> Claw. In the few cases where we weren't able to use them directly, we
> used solutions like the ones proposed as solutions to the original
> poster's question. And, I certainly fail to see how anyone is worse off
> with these solutions available than they would be in C. So, people are
> usually better off than C/C++ for controlling representation, and
> occassionally have the same amount of pain.
>

Well, my observations have come about from trying to interface along
communications paths with other things that are not necessarily Ada.
Sometimes things overlap byte, word or longword boundaries. Having a
compiler tell me I can't do that instantly makes the rep-clause useless to
me because the only way I can guarantee that I can handle all the cases that
come up - or ever may come up - is to go to a byte array and start picking
out the bits myself, ala C. Maybe my problems aren't the most common ones,
but it happens enough to make one wish that the rep clause could be used to
arbitrarily overlay a contiguous stream of bits without restrictions - or
you start asking yourself "Why bother having a rep clause?" The C answer is
"We don't have a rep clause - go pick the bits apart yourself." The Ada
answer seems to have been "Here. Let me help you with all that bit
twiddling. But only if you agree not to twiddle all the bits you might want
to twiddle..."

I'll give you the compiler efficiency issues. But that just suggests that
perhaps some other construct is necessary for the language to be able to
express representation and then deal with packing/unpacking. I'd be happy if
I could somehow express the record representation in some manner that let me
put the record on the wire or take the record off the wire and then do some
kind of "Pack/Unpack" operations if I wanted to do anything computational. I
don't have a prepackaged answer, but it is something to think about...

MDC
--
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jast.mil/

Send Replies To: m c o n d i c @ a c m . o r g

    "I'd trade it all for just a little more"
        --  Charles Montgomery Burns, [4F10]
======================================================================





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-17  2:36       ` Eric Robert
  2002-12-17  3:24         ` Bill Findlay
@ 2002-12-18  9:37         ` John McCabe
  1 sibling, 0 replies; 19+ messages in thread
From: John McCabe @ 2002-12-18  9:37 UTC (permalink / raw)


On Mon, 16 Dec 2002 21:36:59 -0500, "Eric Robert"
<synapzzz@hotmail.com> wrote:

>Well... Not that long ago: On some new PIC18FXX microprocessors with about
>10 time less memory. You say: within 8us... sounds impressive... Wow! I'm
>impressed! -- It depends on what you have to do and it depends on your clock
>speed! 8us is really bad on some microprocessors. So, state your CPU and its
>clock to get me the impression that 8us is impressive. But please... don't
>try to impress newbees like me ;-)

I'll copy the bit out from the message you're replying to:

>> In fact it is very good where CPU & resources are critical. When was
>> the last time you built a system in C++ based on a Mil-Std-1750A
>> processor (1.3MIPS) using 48kBytes of RAM and requiring an action to
>> be performed in response to an interrupt within 8us?

I guess the clock speed isn't stated there - to get 1.3MIPS you needed
to run the GPS MA31750 at 10MHz but, being a space app, we weren't
allowed to, so we had to run it at 9MHz.

>I guess my point is Ada is 'restrictive' (NOT more readable -- Why is that?)
>and that it can be of some help for big team of people that don't
>communicate with each others. But when your CPU have less than 100K of RAM
>and you're on a 'big' team: well... I guess the debate over Ada is
>useless... How many of you guys are needed to program a chip with less than
>100K of RAM? Hope that this doesn't fall in the 'big team' argument.

Quite a few probably. I certainly have on a few occasions. I wouldn't
say that the teams were that big, only 4 or 5.


Best Regards
John McCabe

To reply by email replace 'nospam' with 'assen'



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Newbee question
  2002-12-17 15:24             ` Marin David Condic
@ 2002-12-19 10:32               ` Ole-Hjalmar Kristensen
  0 siblings, 0 replies; 19+ messages in thread
From: Ole-Hjalmar Kristensen @ 2002-12-19 10:32 UTC (permalink / raw)


"Marin David Condic" <mcondic.auntie.spam@acm.org> writes:

<snip>

> 
> Well, my observations have come about from trying to interface along
> communications paths with other things that are not necessarily Ada.
> Sometimes things overlap byte, word or longword boundaries. Having a
> compiler tell me I can't do that instantly makes the rep-clause useless to
> me because the only way I can guarantee that I can handle all the cases that
> come up - or ever may come up - is to go to a byte array and start picking
> out the bits myself, ala C. Maybe my problems aren't the most common ones,
> but it happens enough to make one wish that the rep clause could be used to
> arbitrarily overlay a contiguous stream of bits without restrictions - or
> you start asking yourself "Why bother having a rep clause?" The C answer is
> "We don't have a rep clause - go pick the bits apart yourself." The Ada
> answer seems to have been "Here. Let me help you with all that bit
> twiddling. But only if you agree not to twiddle all the bits you might want
> to twiddle..."
> 
> I'll give you the compiler efficiency issues. But that just suggests that
> perhaps some other construct is necessary for the language to be able to
> express representation and then deal with packing/unpacking. I'd be happy if
> I could somehow express the record representation in some manner that let me
> put the record on the wire or take the record off the wire and then do some
> kind of "Pack/Unpack" operations if I wanted to do anything computational. I
> don't have a prepackaged answer, but it is something to think about...
> 
> MDC
> --
> ======================================================================
> Marin David Condic
> I work for: http://www.belcan.com/
> My project is: http://www.jast.mil/
> 
> Send Replies To: m c o n d i c @ a c m . o r g
> 
>     "I'd trade it all for just a little more"
>         --  Charles Montgomery Burns, [4F10]
> ======================================================================
> 
> 

I picked up this on the net by chance, perhaps Lutz could comment if
this could be an answer to such problems? :

        16.00 Workshop 1

        Generic Bidirectional Mapper
        Vorgestellt wird ein Yacc-Nachfolger, der ausreichen komplex ist, 
        um die praktischen externen Datenstrukturen in einem Ritt zu lesen 
        und zu schreiben.
        Lutz Donnerhacke


-- 
Ole-Hj. Kristensen

******************************************************************************
* You cannot consistently believe this sentence.
******************************************************************************



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2002-12-19 10:32 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-14 15:16 Newbee question Eric Robert
2002-12-14 20:10 ` Jeffrey Carter
2002-12-15  1:49   ` Eric Robert
2002-12-15  4:04     ` James S. Rogers
2002-12-16 10:32       ` John McCabe
2002-12-16 13:28         ` Marin David Condic
2002-12-17  0:31           ` Randy Brukardt
2002-12-17 15:24             ` Marin David Condic
2002-12-19 10:32               ` Ole-Hjalmar Kristensen
2002-12-15  7:57     ` Pascal Obry
2002-12-15 10:06     ` Jerry van Dijk
2002-12-15 19:04       ` Michal Nowak
2002-12-16 10:33         ` John McCabe
2002-12-16  0:47     ` Eric Robert
2002-12-17  3:23       ` Bill Findlay
2002-12-16 10:28     ` John McCabe
2002-12-17  2:36       ` Eric Robert
2002-12-17  3:24         ` Bill Findlay
2002-12-18  9:37         ` John McCabe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox