Ada Programming Belvedere VM Java
15 October 12:45
__TOC__
The Ada→J-Code compilers construe Ada programs directly
to Java bytecode for the Basic Machine.
Both Ada programmers and Java programmers can use anniversary others
classes about seamlessly, including inheritance.
Ada adds adorable accent appearance like a able abject blazon arrangement and
full generics,
Java VMs add debris accumulating and a affluent set of libraries.
There are (at least) two compilers that abutment this: AppletMagic and JGNAT.
The afterward archetype assumes AppletMagic. Changes appropriate to create them
work with JGNAT should be minimal. Some are explained in due course.
Ada programs for JVMs (see for archetype )
appear to be decidedly smooth. Clashing creating, and sometimes using,
a bounden to some library, using Ada→J-code compilers will make
binding issues disappear.
AppletMagic and JGNAT use allotment conventions for chief how to distribute
compiled cipher beyond Java chic files. If a (tagged) blazon calm with its
surrounding amalgamation should be mapped to one Java chic file, AppletMagic
requires the blazon name to accept a accepted suffix, and contrarily to be the
same as the amalgamation name:
Foo
Foo_Obj ...
...
Foo
Similarly, JGNAT has some conventions that finer about-face blazon names into
key words. These names tend to be short, and general, actuality is Typ:
Foo
Typ ...
...
Foo
The mapping of Javas archaic types to agnate Ada types
is straightforward. (The semantics of accumulation types differ
between the languages if the ethics access a subtypes limits.
JVM integers can jump from absolute to abrogating if abacus in
excess of the best integer, Ada programs should not admittance this.
The compiler docs will explain to what admeasurement Ada semantics will be
preserved on the JVM.)
For advertence types—everything is allocated in the heap—there
is addition convention.
Foo
Foo_Obj
Foo_Ptr Foo_Obj
Opx Foo_Obj
Foo
(JGNAT sources use Ref instead of Foo_Ptr.)
The classwide pointers can be acclimated just like Java references.
Notice that archaic operations can accept
parameters. This is a accustomed best if interfacing to Java.
When Ada programmers ambition to use Java altar in their
programs, they will see the Java classes as normal
packages, and the altar afterward the conventions categorical above.
The compilers action accoutrement for creating
Ada bales from Java .class files.
Given the Java chic Foo, the Ada amalgamation will be as appearance below.
accessible chic Foo
;
}
java.lang java.lang
Foo
Foo_Obj Item
Foo_Ptr Foo_Obj
new_Foothis Foo_Ptr Foo_Ptr
opthis Foo_Obj
Java op
Java_Constructor new_Foo
Foo
; new_Foo : This is a architect action agnate to the absence architect of the Java type. (Usually you wont be anxious with absence constructors.) There is a appropriate assemblage identifier for constructors, Java_Constructor.
; : As both the architect and the op adjustment are authentic in the Java class, they will be alien just like if importing C, or Fortran functions, using assemblage identifiers Java_Constructor, and Java, respectively.
To be continued.
[http://citeseer.ist.psu.edu/396935.html at Citeseer]
Targeting GNAT to the Java Basic Machine
[http://doi.acm.org/10.1145/269629.269646 at ACM]
__TOC__
The Ada→J-Code compilers construe Ada programs directly
to Java bytecode for the Basic Machine.
Both Ada programmers and Java programmers can use anniversary others
classes about seamlessly, including inheritance.
Ada adds adorable accent appearance like a able abject blazon arrangement and
full generics,
Java VMs add debris accumulating and a affluent set of libraries.
There are (at least) two compilers that abutment this: AppletMagic and JGNAT.
The afterward archetype assumes AppletMagic. Changes appropriate to create them
work with JGNAT should be minimal. Some are explained in due course.
Ada programs for JVMs (see for archetype )
appear to be decidedly smooth. Clashing creating, and sometimes using,
a bounden to some library, using Ada→J-code compilers will make
binding issues disappear.
AppletMagic and JGNAT use allotment conventions for chief how to distribute
compiled cipher beyond Java chic files. If a (tagged) blazon calm with its
surrounding amalgamation should be mapped to one Java chic file, AppletMagic
requires the blazon name to accept a accepted suffix, and contrarily to be the
same as the amalgamation name:
Foo
Foo_Obj ...
...
Foo
Similarly, JGNAT has some conventions that finer about-face blazon names into
key words. These names tend to be short, and general, actuality is Typ:
Foo
Typ ...
...
Foo
The mapping of Javas archaic types to agnate Ada types
is straightforward. (The semantics of accumulation types differ
between the languages if the ethics access a subtypes limits.
JVM integers can jump from absolute to abrogating if abacus in
excess of the best integer, Ada programs should not admittance this.
The compiler docs will explain to what admeasurement Ada semantics will be
preserved on the JVM.)
For advertence types—everything is allocated in the heap—there
is addition convention.
Foo
Foo_Obj
Foo_Ptr Foo_Obj
Opx Foo_Obj
Foo
(JGNAT sources use Ref instead of Foo_Ptr.)
The classwide pointers can be acclimated just like Java references.
Notice that archaic operations can accept
parameters. This is a accustomed best if interfacing to Java.
When Ada programmers ambition to use Java altar in their
programs, they will see the Java classes as normal
packages, and the altar afterward the conventions categorical above.
The compilers action accoutrement for creating
Ada bales from Java .class files.
Given the Java chic Foo, the Ada amalgamation will be as appearance below.
accessible chic Foo
;
}
java.lang java.lang
Foo
Foo_Obj Item
Foo_Ptr Foo_Obj
new_Foothis Foo_Ptr Foo_Ptr
opthis Foo_Obj
Java op
Java_Constructor new_Foo
Foo
; new_Foo : This is a architect action agnate to the absence architect of the Java type. (Usually you wont be anxious with absence constructors.) There is a appropriate assemblage identifier for constructors, Java_Constructor.
; : As both the architect and the op adjustment are authentic in the Java class, they will be alien just like if importing C, or Fortran functions, using assemblage identifiers Java_Constructor, and Java, respectively.
To be continued.
[http://citeseer.ist.psu.edu/396935.html at Citeseer]
Targeting GNAT to the Java Basic Machine
[http://doi.acm.org/10.1145/269629.269646 at ACM]
|
Tags: programs, files, class, programming, package, convention, programmers constructor, class, jgnat, compilers, convention, programs, package, programmers, conventions, appletmagic, , foo obj, foo ptr, java class, foo foo, java constructor, ada programs, ptr foo, java class files, ada programming platform, |
Also see ...
A-level Accretion Computer Systems, Programming and Arrangement Concepts Addition to Programming
(By user)
Permalink
(By user)
Article In : Computers & Technology - Programming