TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Content-type: text/plain; charset="us-ascii"; format=flowed
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
From: Roger Racine <[log in to unmask]>
Date: Tue, 11 Apr 2000 10:25:57 -0500
In-Reply-To: <001601bfa3b4$f24656c0$30468bca@avis>
MIME-version: 1.0
Reply-To: Roger Racine <[log in to unmask]>
Parts/Attachments: text/plain (71 lines)
I admit I do not know Java, but from your description below I have one

Ada allows pointer arithmetic.  It is difficult (unchecked conversion is
needed) but possible.  Does Java have any means of "breaking" its
references (turning them into integers and back again)?  If not, then their
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
>In fact, Ada does NOT have pointers. It has access types to do the same job,
>but without the insecurity of pointer arithmetic et al.
>In fact, the Java reference construct is the same as Ada's access type.
>You can say that "in effect" Ada has pointers, since it has access types
>(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.
>What you can't do is say that Java doesn't have pointers, but that Ada does.
>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