comp.lang.ada
 help / color / mirror / Atom feed
* Re: Just a question...
  1996-04-17  0:00 Just " patrick lacheny
@ 1996-04-17  0:00 ` Carl Bowman
  1996-04-17  0:00   ` Michael F Brenner
  1996-04-17  0:00 ` Ian Ward
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Carl Bowman @ 1996-04-17  0:00 UTC (permalink / raw)


In article <4l32nn$mqn@boson.epita.fr>,
patrick lacheny <lachen_p@photon.epita.fr> wrote:
>Thanks for ansering this question about Ada:
>
>" What are the 3 or 4 advices you would tell to a C programmer who
>  wants to use Ada ?"
>
>-- 
>-------------------------------------------------------------------
>|    Je ne savais pas que c'etait impossible quand je l'ai fait.  |
>|                                                                 |
>|  Patrick LACHENY         Email: Patrick.Lacheny@epita.fr        |
>-------------------------------------------------------------------

My first advice would be to stop thinking of oneself as a C programmer
and start thinking of oneself as a programmer currently using C! :)

This information is geared toward Mr. Lacheny and anyone else gettting
started in Ada.  I hope experienced readers will add to this
information.  A lot of this information is in the Ada FAQ.

There is a lot of online information about Ada.  I would aquaint
myself with all of the sources of Ada information possible.  The Ada
Information Clearinghouse maintains the Software Engineering host.
There are online tutorials and information, the Reference Manual and
Rationale, links to other online information, and a lot more.  The URL
is http://sw-eng.falls-church.va.us.

I would acquaint myself with the Public Ada Library (PAL), a
repository of reusable Ada components and Ada information.  There you
can find examples of Ada code to help you get a quicker feel for how
problems are solved using Ada.  It is also avalable on various
CD-ROMs.  The URL is http://web.cnam.fr/Languages/Ada/PAL/.

GNAT is a free Ada 95 compiler available for many hardware platforms.
Both the PAL and the Software Engineering host have links for GNAT.


Carl Bowman
Ada Information Clearinghouse
adainfo@sw-eng.falls-church.va.us

Here's a flyer the AdaIC distributes:

Accessing Ada Information on the Internet 

A wealth of Ada information and source code is accessible on the 
electronic "information  superhighway".  The primary sources for 
on-line Ada information are on various Internet Hosts located  
throughout the world.  In addition, some institutions provide 
dial-up access to Ada information via electronic bulletin boards. 
This flyer points you to the Ada Information Clearinghouse's 
(AdaIC) on-line sources for Ada information, which in turn will 
provide pointers and links to other on-line Ada information 
repositories. If the "information superhighway" is new to you, 
don't hesitate to call the AdaIC at 1/800-AdaIC-11(232-4211) or 
703/681-2466 for help in getting connected. 

What's Available?   

Ada Internet Host_sw-eng.falls-church.va.us.

The AdaIC provides the latest news about the Ada program as well 
as copies of the Ada Language Reference Manual, Ada Rationale, 
and documents to  help you in a transition to Ada.   More than 
6,000  files, covering virtually every aspect of Ada programming, 
are available on the AdaIC's Internet host: sw-eng.falls-
church.va.us.  If you are looking  for any of the following Ada 
information, be sure to connect to the AdaIC host: 

What's New with Ada:
Weekly news summaries, a quarterly newsletter, and hot off-the-
press announcements from commercial vendors and users 

Current Ada Events:
Information about upcoming Ada conferences 

Resources:
Information about freely available Ada resources,such as other 
on-line sources for Ada source code and information, the Ada 
trade association, and Ada professional societies Publications 
Documents, reports, and bibliographies related to Ada, including 
the Ada Standard, Ada Rationale, Ada Adoption Handbook, Ada Style 
Guide 

Compilers and Tools:
Pointers to FREE and commercially available Ada  
compilers, tools, and development environments. 

Validation and Evaluation Test Suites:
Everything you need to evaluate an Ada compiler for  
your application or to learn about how to obtain  
validated status for your compiler.

Education and Training Resources:
Pointers to Universities and commercial trainers  
that offer Ada as well as Ada books, videotapes,  
computer-aided instruction. 

Policy and History:
The latest policies from the US Government related  
to Ada usage as well as historical information  
about the making of Ada 

Ada Working Groups:
Reports, meeting minutes, and everything you need  
to know about the technical working groups that  
address Ada issues.

Getting Connected:
The Ada Internet host is available to all Internet users 24-hours 
a day via the following utilities: anonymous file transfer 
protocol (ftp):ftp sw-eng.falls-church.va.us 

login: anonymous 
password: <your email address> 
ftpmail: Send Email to: ftpmail@sw-eng.falls-church.va.us with 
the word "help" in the subject line to obtain complete 
intructions 

Gopher:  gopher sw-eng.falls-church.va.us 
Wide Area Information Server (WAIS):  sw-eng.falls-church.va.us 
World Wide Web (WWW):  http://sw-eng.falls-church.va.us/ 

The AdaIC's Internet host is sw-eng.falls-church.va.us; its IP 
address is 199.75.54.2.  Direct any questions concerning access 
to action@sw-eng.falls-church.va.us or to the AdaIC telephone  
helpdesk staff at 1/800-AdaIC-11 (232-4211).

Getting Connected Without Internet Access:
Computer users who don't have Internet access may access Ada 
information on the AdaIC Internet host via our bulletin board 
system.  The phone number is: 703/681-2845.  Set your 
communications parameters as follows: 

Baud Rate:	300-28,800 
Data bits:	8 
Parity:	None 
Stop Bits:	1 
Flow Control:	XOn/XOff 
Once a connection is achieved,  
	login: guest 
	password: Ada4sw-eng 

Direct any questions concerning access to the AdaIC  
telephone helpdesk staff at  
1/800-AdaIC-11 (232-4211). 
. 
 
The views, opinions, and findings contained in this report are 
those of the author(s) and should not be construed as an official 
Agency position, policy, or decision, unless so designated by 
other official documentation. 
 
Copyright 1995.  IIT Research Institute.  All rights 
assigned to the U.S. Government (Ada Joint Program Office).  
Permission to reprint this flyer, in whole or in part, is 
granted, provided the AdaIC is acknowledged as the source. 
Ada Information Clearinghouse (AdaIC) 
P.O. Box 1866 
Falls Church, VA  22204 
Telephone:  1-800-AdaIC-11 (1-800/232-4211) or  
703/681-2466 
Fax:  703/681-2869 
E-mail:  adainfo@sw-eng.falls-church.va.us 
 
The AdaIC is sponsored by the Ada Joint Program Office and 
operated by IIT Research Institute. 





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

* Re: Just a question...
  1996-04-17  0:00 Just " patrick lacheny
  1996-04-17  0:00 ` Carl Bowman
  1996-04-17  0:00 ` Ian Ward
@ 1996-04-17  0:00 ` Bob Kitzberger
  1996-04-29  0:00 ` Roga Danar
  3 siblings, 0 replies; 12+ messages in thread
From: Bob Kitzberger @ 1996-04-17  0:00 UTC (permalink / raw)


: " What are the 3 or 4 advices you would tell to a C programmer who
:   wants to use Ada ?"

- When defining types, learn to think in terms of the problem domain
  (range, precision, enumeration, etc.) rather than the predefined
  types (integer, character, etc.).  Try to avoid using predefined
  types directly; define new types that match the problem domain

- Forget about the preprocessor, at least initially.  Think of
  alternate ways to solve the problem that you are used to using
  the preprocessor for (Ada has idioms to handle almost every
  macro processor usage)

- Start thinking in terms of the contract model of programming,
  i.e. Ada's separation of specification and implementation (body).
  In C at it's best, a header file is equivalent to the specification,
  and the .c file is equivalent to the body (I _rarely_ see C code
  with that high level of quality!)

- Use the contract model to hide implementation details: avoid placing
  type definitions in package specifications (at least for ADTs)
  instead use private types to defer implementation details to the
  body.
  
- Do _not_ use the USE clause until you feel comfortable knowing
  when it's appropriate.

These are not intended to ease the transition -- but rather help you
learn to program in Ada the way I like it ;-)  If you try to program
"C in Ada" you will be frustrated, but if you learn the idioms
things will be much easier... (holds true for any language, IMHO).

--
Bob Kitzberger	      Rational Software Corporation       rlk@rational.com




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

* Re: Just a question...
  1996-04-17  0:00 ` Carl Bowman
@ 1996-04-17  0:00   ` Michael F Brenner
  0 siblings, 0 replies; 12+ messages in thread
From: Michael F Brenner @ 1996-04-17  0:00 UTC (permalink / raw)


One piece of advice is to demand the same quality of tools in your
new language as you used in your old language, use the best 
design methods, and the best test methods. 

Second, build a self-test into each package.

Third, follow the Ada methodology of integrating the entire system
together through the package visible parts before hacking more than
about 50% of the code, so that you will gain the benefit of lessened
integration testing later. 

Fourth, avoid the temptation of having too many levels and too many    
incompatible types; there has to be a balance. My current (very humble)
opinion is that the Ada Numerics are very well balanced, and that the
Ada Stream_IO capability has far too many levels, which is a starting
point to defining this Balance. 

Fifth, avoid the nostalgia of doing everything as a pointer, which is
no longer needed since Ada does that for you internally in many cases.

Sixth, buy a commercial Ada compiler to check your gnat execution speed
against, and to keep driving the industry to better optimizations.

Seventh, publish some well-measured results of your experience in 
reducing system integration test and software maintenance times: Keep
a Measurement Record Now.




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

* Just a question...
@ 1996-04-17  0:00 patrick lacheny
  1996-04-17  0:00 ` Carl Bowman
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: patrick lacheny @ 1996-04-17  0:00 UTC (permalink / raw)


Thanks for ansering this question about Ada:

" What are the 3 or 4 advices you would tell to a C programmer who
  wants to use Ada ?"

-- 
-------------------------------------------------------------------
|    Je ne savais pas que c'etait impossible quand je l'ai fait.  |
|                                                                 |
|  Patrick LACHENY         Email: Patrick.Lacheny@epita.fr        |
-------------------------------------------------------------------




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

* Re: Just a question...
  1996-04-17  0:00 Just " patrick lacheny
  1996-04-17  0:00 ` Carl Bowman
@ 1996-04-17  0:00 ` Ian Ward
  1996-04-17  0:00 ` Bob Kitzberger
  1996-04-29  0:00 ` Roga Danar
  3 siblings, 0 replies; 12+ messages in thread
From: Ian Ward @ 1996-04-17  0:00 UTC (permalink / raw)


lachen_p@photon.epita.fr (patrick lacheny) writes:
   What are the 3 or 4 pieces of advice you would give to
   a C programmer who wants to use Ada ?

Sorry Patrick, my old son, I've got six.

1. If you try to write Ada in the same manner as 'C'
   then you shall get nowhere, write crap code, and then
   give up. Unless I am writing both every day, it
   takes me a week to switch thinking between the two
   respective languages. (Unlike Lisp which, a week after
   writing something, I think "I can think of a better
   of doing that. Hmmm!" so I rewrite it, and then a 
   month later, the same again, and so on.)

2. As a 'C' programmer you shall get infuriated with the
   way it insists things are done. If you let this get
   to you and say "Why can I not do X?" then see point 1.
   If you start doing things the 'Ada' way, you will be 
   pleasantly surprised at sheer speed of the delivered
   code you turn out. Note that when I say "delivered", 
   I mean that you never hear from the users of your
   application again (at least regarding your little 
   application.) 

   Reading the rationale is a good way to start to think
   in Ada terms.

3. Don't try to run Ada on the ZX-80, or the CBM Pet, or
   any other toy, including toy 'operating systems', because
   you will just get pissed off. That said, anything powerful
   enough to have a hardware multiply will be just fine.

4. When somebody of great experience who you respect, asks
   you "Why do you want to learn that? We used it on a Unix
   project five years ago but all the tasks hung whenever
   any task wanted an I/O service, so we had to use lots of
   small applications in 'C'." ask them why they did not
   write their small applications in Ada. Chances are they
   got stuck on point 1 and gave up, forever hating the
   language, (to be fair here they could have been using one
   of any number of compilers that were moderately crap five
   years ago, but now aren't, that does not mean that new
   Ada 95 compilers coming out from the big houses are going
   to be totally bug free, it is effectively a new language 
   after all.)

   Or if they look as though they are going to really start
   taking the piss, just shine them on with a reply such as:
   "I thought Unix was a truly great operating system, and
   supported loads of languages. Did Unix not support
   asynchronous Tasking_Services and I/O, like VMS, then?"
   :-) <- (Laurence please note.)

5. When you learned it, have a go at Lisp, it will really
   make you think, it is beyond, then TPU.
   
6. Don't forget 'C', ever, because anything you can do in 
   'C' with pointers, that a compliant Ada compiler will
   let you get away with, will stand you in great stead,
   when you have to do any dynamic applications.

Above all, you have got to love the language. If you don't
you'll get nowhere. However, if you love programming, then
you love all languages. Just bear in mind that no love is
as great as your first.
Blessed are the bigots.

---
Ian Ward's opinions only : ian@rsd.bel.alcatel.be
It's great when all the documents are finally signed off,
is it not?
Ian loves, Zilog Z80, Fiat 126's and Durham City. (Today.)





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

* Re: just a question...
@ 1996-04-18  0:00 W. Wesley Groleau (Wes)
  1996-04-22  0:00 ` Nasser Abbasi
  0 siblings, 1 reply; 12+ messages in thread
From: W. Wesley Groleau (Wes) @ 1996-04-18  0:00 UTC (permalink / raw)


>> ...advices ... to a C programmer who wants to use Ada ?

Carl Bowman's excellent response included the line
> I would acquaint myself with the Public Ada Library ....

Yes, there is a LOT of good stuff in the PAL, but there is also some
garbage.  Some of the stuff in there was written with strange workarounds
for compilers that did not implement the full language (-83) or that had
major bugs.  There are compilation units that were auto-generated by
other tools.  They work, but hand-written code should NEVER look like that!
Finally, some of it--believe it or not--is just plain garbage.

So please: take advantage of the PAL and other re-use repositories
to save work, but don't use "free software" as an example of good coding
style without at least getting a second opinion.

--
---------------------------------------------------------------------------
W. Wesley Groleau (Wes)                                Office: 219-429-4923
Magnavox - Mail Stop 10-40                               Home: 219-471-7206
Fort Wayne,  IN   46808              elm (Unix): wwgrol@pseserv3.fw.hac.com
---------------------------------------------------------------------------




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

* Re: just a question...
  1996-04-18  0:00 just " W. Wesley Groleau (Wes)
@ 1996-04-22  0:00 ` Nasser Abbasi
  0 siblings, 0 replies; 12+ messages in thread
From: Nasser Abbasi @ 1996-04-22  0:00 UTC (permalink / raw)
  To: W. Wesley Groleau (Wes)

In article <9604181853.AA08771@most> wwgrol@PSESERV3.FW.HAC.COM (W. Wesley Groleau (Wes)) writes:

   From: wwgrol@PSESERV3.FW.HAC.COM (W. Wesley Groleau (Wes))

   Carl Bowman's excellent response included the line
   > I would acquaint myself with the Public Ada Library ....

   Yes, there is a LOT of good stuff in the PAL, but there is also some
   garbage.  


Then why does not someone sit down and clean PAL ?

Nasser




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

* Re: Just a question...
@ 1996-04-23  0:00 W. Wesley Groleau (Wes)
  0 siblings, 0 replies; 12+ messages in thread
From: W. Wesley Groleau (Wes) @ 1996-04-23  0:00 UTC (permalink / raw)


:> In article <9604181853.AA08771@most> wwgrol@PSESERV3.FW.HAC.COM (W. Wesley
 Groleau (Wes)) writes:
:>    Yes, there is a LOT of good stuff in the PAL, but there is also some
:>    garbage.

: Nasser responds:
: Then why does not someone sit down and clean PAL ?

One man's garbage is another man's project.  :-)

The manager of the PAL, Prof. Richard Conn, most likely does not have the
time to spend evaluating zillions of lines of source and applying his own
opinions regarding quality.  Notice also that I did not recommend against
re-using code from PAL.  I was merely warning that it should not be taken
as a treasure trove of good style examples.

--
---------------------------------------------------------------------------
W. Wesley Groleau (Wes)                                Office: 219-429-4923
Magnavox - Mail Stop 10-40                               Home: 219-471-7206
Fort Wayne,  IN   46808              elm (Unix): wwgrol@pseserv3.fw.hac.com
---------------------------------------------------------------------------




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

* Re: Just a question...
  1996-04-17  0:00 Just " patrick lacheny
                   ` (2 preceding siblings ...)
  1996-04-17  0:00 ` Bob Kitzberger
@ 1996-04-29  0:00 ` Roga Danar
  1996-04-30  0:00   ` Philip Brashear
                     ` (2 more replies)
  3 siblings, 3 replies; 12+ messages in thread
From: Roga Danar @ 1996-04-29  0:00 UTC (permalink / raw)



Hi,

 1) Ada is strongly typed and 
 2)ya just can't use pointers to just anywhere and change them on 
the fly.
 3) Code will have bigger executables
 4) You can't use pointers to functions.

 Briefly that's it,

 
-- Michael G. Smith

To err is human, to moo, bovine





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

* Re: Just a question...
  1996-04-29  0:00 ` Roga Danar
  1996-04-30  0:00   ` Philip Brashear
  1996-04-30  0:00   ` Robert Dewar
@ 1996-04-30  0:00   ` Greg Bond
  2 siblings, 0 replies; 12+ messages in thread
From: Greg Bond @ 1996-04-30  0:00 UTC (permalink / raw)



Roga Danar wrote:

>  1) Ada is strongly typed and
>  2)ya just can't use pointers to just anywhere and change them on
> the fly.
>  3) Code will have bigger executables
>  4) You can't use pointers to functions.

Ada 95 permits the use of pointers (access types) to subprograms 
(functions, procedures).

--
* Greg Bond                         * Dept. of Electrical Eng.  
* email: bond@ee.ubc.ca             * Univ. of British Columbia      
* voice: (604) 822 0899             * 2356 Main Mall                 
* fax:   (604) 822 5949             * Vancouver, BC              
* web: http://www.ee.ubc.ca/~bond   * Canada, V6T 1Z4




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

* Re: Just a question...
  1996-04-29  0:00 ` Roga Danar
@ 1996-04-30  0:00   ` Philip Brashear
  1996-04-30  0:00   ` Robert Dewar
  1996-04-30  0:00   ` Greg Bond
  2 siblings, 0 replies; 12+ messages in thread
From: Philip Brashear @ 1996-04-30  0:00 UTC (permalink / raw)



In article <4m47pf$stq@news-e2b.gnn.com>, Roga Danar <alphasoft@gnn.com> wrote:
>Hi,
>
> 1) Ada is strongly typed and 
> 2)ya just can't use pointers to just anywhere and change them on 
>the fly.
> 3) Code will have bigger executables
> 4) You can't use pointers to functions.
>
> Briefly that's it,
>
> 
>-- Michael G. Smith
>
>To err is human, to moo, bovine
>


Undoubtedly, others will respond to this, but just in case:
1) Yes, Ada is strongly typed (thank goodness!)
2) Actually, you probably can use pointers to just (about) anywhere and
   change them on the fly, but you have to be very explicit about it.
   That's the Ada philosophy: you can do all sorts of unsafe programming,
   but (unlike some other languages) you have to do it deliberately and
   openly.
3) On what basis do you say that the code will generate bigger executables?
   I've seen papers showing that (with proper optimization switches) Ada
   code can result in smaller executables that assembler written by
   experienced assembler programmers.
4) Of course you can use pointers to functions.  See the Ada 95 RM or
   any good text on Ada 95.

Phil Brashear




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

* Re: Just a question...
  1996-04-29  0:00 ` Roga Danar
  1996-04-30  0:00   ` Philip Brashear
@ 1996-04-30  0:00   ` Robert Dewar
  1996-04-30  0:00   ` Greg Bond
  2 siblings, 0 replies; 12+ messages in thread
From: Robert Dewar @ 1996-04-30  0:00 UTC (permalink / raw)



Roga said

 1) Ada is strongly typed and

     True

 2)ya just can't use pointers to just anywhere and change them on
   the fly.

     You can certainly modify pointers. I don't know any language that
     at the semantic level of the language lets you "use pointers to
     just anywhere.:

 3) Code will have bigger executables

     This (a) a property of implementations, not of languages and (b) not
     in any case true of existing implementations.

 4) You can't use pointers to functions.

     That's just false. Ada has that capability (Ada 83 lacked it, but
     we are in 1996 these days!)





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

end of thread, other threads:[~1996-04-30  0:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-23  0:00 Just a question W. Wesley Groleau (Wes)
  -- strict thread matches above, loose matches on Subject: below --
1996-04-18  0:00 just " W. Wesley Groleau (Wes)
1996-04-22  0:00 ` Nasser Abbasi
1996-04-17  0:00 Just " patrick lacheny
1996-04-17  0:00 ` Carl Bowman
1996-04-17  0:00   ` Michael F Brenner
1996-04-17  0:00 ` Ian Ward
1996-04-17  0:00 ` Bob Kitzberger
1996-04-29  0:00 ` Roga Danar
1996-04-30  0:00   ` Philip Brashear
1996-04-30  0:00   ` Robert Dewar
1996-04-30  0:00   ` Greg Bond

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