comp.lang.ada
 help / color / mirror / Atom feed
From: Keith Thompson <kst@cts.com>
Subject: Re: New to ada, a few questions
Date: 05 Aug 2002 16:56:20 -0700
Date: 2002-08-05T16:56:20-07:00	[thread overview]
Message-ID: <yec8z3koo63.fsf@king.cts.com> (raw)
In-Reply-To: B9743731.1E78%s.jol@jol-tech.net

Stephane Jolicoeur <s.jol@jol-tech.net> writes:
> *** post for FREE via your newsreader at post.newsfeed.com ***
> 
> Hello,
> I am a strong python programmer that is looking for a compiled language to
> complement my tool chest. I tried C but those pointers are an annoyance, I
> tried C++ but there to the pointers and it's OO weirdness kicked in. Then  I
> stumbled on an Ada tutorial, I dislike the Pascal-like coding style but
> there seems to be no pointer and it can be compiled to native byte code !
>  I would like to know, what good books are there for learning ada ( some
> sort of tutorial/reference book). How "fast" is compiled Ada code by this I
> mean is it like C/C++ or more like Java? I read that it is possible to
> interface Ada with C? How is this done? Can I use say stdio.h in an Ada
> program? How about interfacing with C++ or objective C? Are there any GUI
> librairies (windows, BSD, Mac OS X)? Has any Ada compiler been made to
> compile code for microcontrollers ( PIC, 68hc11, etc )? How does the
> threading work? I think this should suffice for a first post.

Ada does have pointers; it calls them access types.  They're not
needed nearly as often as they are in C.  For example, if you want to
pass a parameter by reference, you just pass it; there's no need to
use a pointer type.  Array types are array types.  The bounds of an
array are fixed when the object is created, but they can be determined
at run time; again, there's no need to use pointers.  Even when you do
use pointers, it's much easier to do so safely.  Pointer arithmetic, a
major source of undefined behavior in C, is not built into the
language, and is almost never necessary.  <metaphor>Of course you can
shoot yourself in the foot, but it's harder to do so; the safety is on
by default and you have to say "I want to turn off the safety now, and
I know it's dangerous." before you disable it.</metaphor>

No, you can't use <stdio.h> directly (Ada doesn't grok C syntax), but
Ada does have good facilities for interfacing to other languages, with
predefined support for C, Fortran, and Cobol, and compiler-specific
support for C++.  Of course, Ada has its own I/O packages, so there's
seldom any need to interface to the facilities defined in <stdio.h>.

-- 
Keith Thompson (The_Other_Keith) kst@cts.com  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"



  parent reply	other threads:[~2002-08-05 23:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-05 18:07 New to ada, a few questions Stephane Jolicoeur
2002-08-05 20:38 ` Jim Rogers
2002-08-05 22:27   ` akhar
2002-08-05 22:33     ` chris.danx
2002-08-05 23:25     ` Larry Kilgallen
2002-08-06  3:37     ` Adrian Hoe
2002-08-05 23:56 ` Keith Thompson [this message]
2002-08-06  2:31   ` David C. Hoos, Sr.
replies disabled

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