TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

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

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

Print Reply
Roger Racine <[log in to unmask]>
Tue, 11 Apr 2000 10:25:57 -0500
text/plain (71 lines)
I admit I do not know Java, but from your description below I have one
question.

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:
>http://developer.java.sun.com/developer/onlineTraining/Security/Fundamentals
>/Security.html#secIntro
>
>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)
>and
>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.
>
>and
>
>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-2489
617-258-3939 Fax

ATOM RSS1 RSS2