comp.lang.ada
 help / color / mirror / Atom feed
* Ada/Java
@ 1997-04-16  0:00 tmoran
  1997-04-20  0:00 ` Ada/Java Tucker Taft
  1997-04-22  0:00 ` Ada/Java David Wheeler
  0 siblings, 2 replies; 14+ messages in thread
From: tmoran @ 1997-04-16  0:00 UTC (permalink / raw)



I'd add an additional problem to the ones mentioned in the recent Ada
Letters article "Experience Programming Java Applets with Ada95" by
Kann, Feldman, and Sibert.  Every record definition becomes a Java
class, which means it becomes a separate file.  I put a very small
application up on a web page hosted on AOL and each of those files,
while small, results to the downloader in 5-10 seconds of "connecting,
waiting for response" messages.  The option of a different web host
site is not always available, and writing a significant program
without using records feels like a return to Fortran.




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

* Re: Ada/Java
  1997-04-16  0:00 Ada/Java tmoran
@ 1997-04-20  0:00 ` Tucker Taft
  1997-04-21  0:00   ` Ada/Java Tom Moran
  1997-04-22  0:00 ` Ada/Java David Wheeler
  1 sibling, 1 reply; 14+ messages in thread
From: Tucker Taft @ 1997-04-20  0:00 UTC (permalink / raw)



tmoran@bix.com wrote:

: I'd add an additional problem to the ones mentioned in the recent Ada
: Letters article "Experience Programming Java Applets with Ada95" by
: Kann, Feldman, and Sibert.  Every record definition becomes a Java
: class, which means it becomes a separate file.  I put a very small
: application up on a web page hosted on AOL and each of those files,
: while small, results to the downloader in 5-10 seconds of "connecting,
: waiting for response" messages.  The option of a different web host
: site is not always available, and writing a significant program
: without using records feels like a return to Fortran.

The newer browsers support downloading an archive of classes as a single file.
You should be able to "zip" the classes up into a zipfile, and then
in your <applet...> tag write:

   <applet code="myclass.class" archive="http://myhost/myfile.zip" ...>

-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




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

* Re: Ada/Java
  1997-04-20  0:00 ` Ada/Java Tucker Taft
@ 1997-04-21  0:00   ` Tom Moran
  0 siblings, 0 replies; 14+ messages in thread
From: Tom Moran @ 1997-04-21  0:00 UTC (permalink / raw)



> newer browsers support downloading an archive
How new, and is there a way to write the HTML so it will use the archive
method if the browser supports it, but the individual files otherwise?




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

* Re: Ada/Java
  1997-04-22  0:00 ` Ada/Java David Wheeler
@ 1997-04-22  0:00   ` Tom Moran
  1997-04-22  0:00     ` Ada/Java Jon S Anthony
  0 siblings, 1 reply; 14+ messages in thread
From: Tom Moran @ 1997-04-22  0:00 UTC (permalink / raw)



> The problem is that each class (record)
> must be in a separate class file.  This is NOT specific to Ada at all.
  Must each record be a class?  Not all Ada records are tagged types.




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

* Re: Ada/Java
  1997-04-22  0:00   ` Ada/Java Tom Moran
@ 1997-04-22  0:00     ` Jon S Anthony
  1997-04-23  0:00       ` Ada/Java Tom Moran
  1997-04-23  0:00       ` Ada/Java Samuel Tardieu
  0 siblings, 2 replies; 14+ messages in thread
From: Jon S Anthony @ 1997-04-22  0:00 UTC (permalink / raw)



In article <335CDAF1.178A@bix.com> Tom Moran <tmoran@bix.com> writes:

> > The problem is that each class (record)
> > must be in a separate class file.  This is NOT specific to Ada at all.
>   Must each record be a class?  Not all Ada records are tagged types.

Java does not support any other kind of first class object which has
structure.  So, yeah, this (currently) must be...

/Jon

-- 
Jon Anthony
Organon Motives, Inc.
Belmont, MA 02178
617.484.3383
jsa@organon.com





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

* Re: Ada/Java
  1997-04-16  0:00 Ada/Java tmoran
  1997-04-20  0:00 ` Ada/Java Tucker Taft
@ 1997-04-22  0:00 ` David Wheeler
  1997-04-22  0:00   ` Ada/Java Tom Moran
  1 sibling, 1 reply; 14+ messages in thread
From: David Wheeler @ 1997-04-22  0:00 UTC (permalink / raw)




tmoran@bix.com wrote:
: I'd add an additional problem to the ones mentioned in the recent Ada
: Letters article "Experience Programming Java Applets with Ada95" by
: Kann, Feldman, and Sibert.  Every record definition becomes a Java
: class, which means it becomes a separate file.

This problem applies to anything today using the Java Virtual Machine,
including Java, Eiffel (when translated to Java), and NetRexx
(when translated to Java).  The problem is that each class (record)
must be in a separate class file.  This is NOT specific to Ada at all.

This is a known problem, and the latest version of the JDK and
Netscape include a solution (they support packaging many small files into
a single larger file).  The latest beta version of Netscape
can do this now, but you'll probably have to wait for at least 6-12 months
before the majority of users have this ability (and probably longer if you
want 95%+ of all web users).

--- David A. Wheeler
    dwheeler@ida.org





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

* Re: Ada/Java
  1997-04-22  0:00     ` Ada/Java Jon S Anthony
@ 1997-04-23  0:00       ` Tom Moran
  1997-04-25  0:00         ` Ada/Java Jon S Anthony
  1997-04-23  0:00       ` Ada/Java Samuel Tardieu
  1 sibling, 1 reply; 14+ messages in thread
From: Tom Moran @ 1997-04-23  0:00 UTC (permalink / raw)



> >   Must each record be a class?  Not all Ada records are tagged types.
> 
> Java does not support any other kind of first class object which has
> structure.
  So, at the Jave byte code level there is no structure larger than
"words"?




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

* Re: Ada/Java
  1997-04-22  0:00     ` Ada/Java Jon S Anthony
  1997-04-23  0:00       ` Ada/Java Tom Moran
@ 1997-04-23  0:00       ` Samuel Tardieu
  1997-04-24  0:00         ` Ada/Java Jon S Anthony
  1 sibling, 1 reply; 14+ messages in thread
From: Samuel Tardieu @ 1997-04-23  0:00 UTC (permalink / raw)
  To: Jon S Anthony



>>>>> "Jon" == Jon S Anthony <jsa@alexandria> writes:

Jon> In article <335CDAF1.178A@bix.com> Tom Moran <tmoran@bix.com>
Jon> writes:

>> Must each record be a class?  Not all Ada records are tagged types.

Jon> Java does not support any other kind of first class object which
Jon> has structure.  So, yeah, this (currently) must be...

Well, not exactly. You can always choose to group several Ada records
into one Java class if your goal is to minimize the number of class
files, and then use one part of the class or the other. You can even
use overlapping if you have fields of the same type in several
records.

Note that this approach works well only with non-tagged records since
these Java classes will be deriving from java.lang.Object, it would be
more difficult with tagged records since you don't want to loose the
virtual dispatching capabilities.

  Sam
-- 
Samuel Tardieu -- sam@ada.eu.org




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

* Re: Ada/Java
  1997-04-23  0:00       ` Ada/Java Samuel Tardieu
@ 1997-04-24  0:00         ` Jon S Anthony
  0 siblings, 0 replies; 14+ messages in thread
From: Jon S Anthony @ 1997-04-24  0:00 UTC (permalink / raw)




In article <qw69129gand.fsf@esmeralda.enst.fr> Samuel Tardieu <sam@ada.eu.org> writes:

> >> Must each record be a class?  Not all Ada records are tagged types.
> 
> Jon> Java does not support any other kind of first class object which
> Jon> has structure.  So, yeah, this (currently) must be...
> 
> Well, not exactly. You can always choose to group several Ada records
> into one Java class if your goal is to minimize the number of class
> files, and then use one part of the class or the other. You can even
> use overlapping if you have fields of the same type in several
> records.

Could you say a bit more on how this would work?

/Jon
-- 
Jon Anthony
Organon Motives, Inc.
Belmont, MA 02178
617.484.3383
jsa@organon.com





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

* Re: Ada/Java
  1997-04-23  0:00       ` Ada/Java Tom Moran
@ 1997-04-25  0:00         ` Jon S Anthony
  0 siblings, 0 replies; 14+ messages in thread
From: Jon S Anthony @ 1997-04-25  0:00 UTC (permalink / raw)




In article <335E30E2.1F9@bix.com> Tom Moran <tmoran@bix.com> writes:

> > >   Must each record be a class?  Not all Ada records are tagged types.
> > 
> > Java does not support any other kind of first class object which has
> > structure.
>   So, at the Jave byte code level there is no structure larger than
> "words"?

You've lost me.  The basic point is that you want your Ada to fit in
as transparently as possible with any stuff generated from Java (the
language).

/Jon

-- 
Jon Anthony
Organon Motives, Inc.
Belmont, MA 02178
617.484.3383
jsa@organon.com





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

* Re: Ada/Java
@ 1997-04-25  0:00 tmoran
  1997-04-27  0:00 ` Ada/Java Robert Dewar
  0 siblings, 1 reply; 14+ messages in thread
From: tmoran @ 1997-04-25  0:00 UTC (permalink / raw)



> > > >   Must each record be a class?  Not all Ada records are tagged types.
> > >
> > > Java does not support any other kind of first class object which has
> > > structure.
> >   So, at the Jave byte code level there is no structure larger than
> > "words"?
>
> You've lost me.  The basic point is that you want your Ada to fit in
> as transparently as possible with any stuff generated from Java (the
> language).

Consider two ways of making a Point
  type Coordinates is (X,Y);
  type Point is array(Coordinates) of Integer;
vs
  type Point is record
    X : Integer;
    Y : Integer;
  end record;

If I write "Starting_Point(X) := 0;" for the first, or
"Starting_Point.X := 0;" for the second, I would expect rather similar
instructions to be generated at the (virtual) machine code level.  But
in Jave these are very different - the second (record) approach apparently
requires a whole additional file.  My question is "why can't the compiler
recognize that the record approach is similar to the array approach and
use the much less expensive array style?".  I gather the answer is that
the Java byte code for some reason does not allow this.




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

* Re: Ada/Java
  1997-04-25  0:00 Ada/Java tmoran
@ 1997-04-27  0:00 ` Robert Dewar
  1997-04-28  0:00   ` Ada/Java Tom Moran
  0 siblings, 1 reply; 14+ messages in thread
From: Robert Dewar @ 1997-04-27  0:00 UTC (permalink / raw)




tmoran says

<<If I write "Starting_Point(X) := 0;" for the first, or
"Starting_Point.X := 0;" for the second, I would expect rather similar
instructions to be generated at the (virtual) machine code level.  But
in Jave these are very different - the second (record) approach apparently
requires a whole additional file>>

Only on obsolete browsers, and it seems unnecesary to predicate the design
of an Ada to Java translator on an obsolete design. Note that you can still
run on the old broswer, just inefficiently (i.e. you make a version with
separate files), so i don't see this is a big deal at all.





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

* Re: Ada/Java
  1997-04-27  0:00 ` Ada/Java Robert Dewar
@ 1997-04-28  0:00   ` Tom Moran
  1997-04-28  0:00     ` Ada/Java Robert Dewar
  0 siblings, 1 reply; 14+ messages in thread
From: Tom Moran @ 1997-04-28  0:00 UTC (permalink / raw)



> Only on obsolete browsers, and it seems unnecesary to predicate the design
> of an Ada to Java translator on an obsolete design.
  I believe I previously asked just which browsers were not obsolete,
and what fraction of the potential user popultation has them.  I await
even an approximate answer to this question.  
  The particular Java applet where I noticed the problem had to do with
information for Town Hall meetings on our local city budget.  An applet
that will run on everybody's browser next year is not useful.  A
compiler that will create applets that run next year is not useful.  As
Keynes said "In the long run - we will all be dead."




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

* Re: Ada/Java
  1997-04-28  0:00   ` Ada/Java Tom Moran
@ 1997-04-28  0:00     ` Robert Dewar
  0 siblings, 0 replies; 14+ messages in thread
From: Robert Dewar @ 1997-04-28  0:00 UTC (permalink / raw)



iTom Moran says

<<  The particular Java applet where I noticed the problem had to do with
information for Town Hall meetings on our local city budget.  An applet
that will run on everybody's browser next year is not useful.  A
compiler that will create applets that run next year is not useful.>>

Perhaps I misunderstand, but my impression is that this problem is fundamental
to the design of Java and its browsers - nothing special about Ada here!





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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-04-16  0:00 Ada/Java tmoran
1997-04-20  0:00 ` Ada/Java Tucker Taft
1997-04-21  0:00   ` Ada/Java Tom Moran
1997-04-22  0:00 ` Ada/Java David Wheeler
1997-04-22  0:00   ` Ada/Java Tom Moran
1997-04-22  0:00     ` Ada/Java Jon S Anthony
1997-04-23  0:00       ` Ada/Java Tom Moran
1997-04-25  0:00         ` Ada/Java Jon S Anthony
1997-04-23  0:00       ` Ada/Java Samuel Tardieu
1997-04-24  0:00         ` Ada/Java Jon S Anthony
  -- strict thread matches above, loose matches on Subject: below --
1997-04-25  0:00 Ada/Java tmoran
1997-04-27  0:00 ` Ada/Java Robert Dewar
1997-04-28  0:00   ` Ada/Java Tom Moran
1997-04-28  0:00     ` Ada/Java Robert Dewar

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