TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers


Print Reply
Roger Racine <[log in to unmask]>
Tue, 11 Apr 2000 10:25:57 -0500
text/plain (71 lines)

Ada allows pointer arithmetic.  It is difficult (unchecked conversion is
statements are true.

Roger Racine

At 07:53 AM 4/11/2000 , Alan and Carmel Brain wrote:
>Has one really, really glaring error that's caused significant problems.
>There are 2 statements:
>Java doesn't have pointers (it has references to do the same job)
>Ada has pointers
>but without the insecurity of pointer arithmetic et al.
>In fact, the Java reference construct is the same as Ada's access type.
>(references) which act the same way but are safe
>You can say that Java "in effect" has pointers, since it has references
>(access types) that act the same way but are safe.
>You can say that Ada doesn't have pointers.
>You can say that Java doesn't have pointers.
>It's a both or neither deal.
>Here are the statements on the page:
>For instance, Ada doesn't have the same built-in safety at the language
>level (for example, lack of pointers). If Java technology security was
>simply a language-level construct, then someone programming in Ada would
>circumvent all Java technology security checks.
>Invalid Memory Access
>There are many language features within the Java programming language that
>contribute to this [secure] behavior. First and foremost is the fact that
>the Java programming language does not let you perform pointer arithmetic.
>This is perhaps the most important language feature that contributes to the
>Java language's safety, since it is pointer arithmetic that leads to
>accessing inappropriate memory areas, which leads to runtime crashes.  Not
>permitting pointer arithmetic is not saying the Java programming language
>doesn't support pointers. In fact pointers in the Java programming language
>are called references, and they are fully supported. The existence of
>reference variables allows you to create data structures like linked lists,
>binary trees, or any other where you would normally think of using a pointer
>variable in a language like C or C++.
>These two statements taken together, are just plain untrue.

Roger Racine
Draper Laboratory, MS 31
555 Technology Sq.
Cambridge, MA 02139, USA
617-258-3939 Fax