comp.lang.ada
 help / color / mirror / Atom feed
* Application Size in ADA
@ 2004-04-15 16:54 Simon Lewis
  2004-04-15 18:13 ` Application Size in Ada Ludovic Brenta
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Simon Lewis @ 2004-04-15 16:54 UTC (permalink / raw)


Dear All,

Why do the binaries that I built seem to be huge? I know this is a bit 
of an open ended question... (no "how long is a piece of string" related 
answers please)

I'm using tasks in my application.  Does this add extra code into the 
binary to ensure time slicing?.  I was just wondering where all the 
bloat is coming from.

On a separate issue... I have found an IDE called GPS (GNAT Programming 
System)  Is this considered the 'thing to use' or are you all writing 
your ADA in emacs (or equivalent)?  (No flames Please ;) )

Thanks for your responses
-- 
Simon Lewis

Can you believe this, Marge? They're paying me to eat! -- Homer Simpson



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

* Re: Application Size in Ada
  2004-04-15 16:54 Application Size in ADA Simon Lewis
@ 2004-04-15 18:13 ` Ludovic Brenta
  2004-04-15 18:34   ` Simon Lewis
  2004-04-15 18:13 ` Application Size in ADA Georg Bauhaus
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Ludovic Brenta @ 2004-04-15 18:13 UTC (permalink / raw)


Simon Lewis writes:
> Dear All,
> 
> Why do the binaries that I built seem to be huge? I know this is a
> bit of an open ended question... (no "how long is a piece of string"
> related answers please)

It depends.

The compiler normally inserts run-time checks in the code; this can be
turned on or off.

The Ada run-time may be linked statically into your application, or
not.  This would be the biggest contributor to the size of your
executables.

The executable file may contain debugging information.

The executable file may contain instrumentation code to perform
coverage analysis with unit tests.

If you can be more specific about your compiler and target platform,
perhaps we can answer your question more precisely.

> I'm using tasks in my application.  Does this add extra code into
> the binary to ensure time slicing?.  I was just wondering where all
> the bloat is coming from.

Tasking may add some overhead, if you link the Ada run-time library
statically into your executable.

> On a separate issue... I have found an IDE called GPS (GNAT
> Programming System)  Is this considered the 'thing to use' or are you
> all writing your ADA in emacs (or equivalent)?  (No flames Please ;) )
> 
> Thanks for your responses

Emacs.

But I packaged GPS for Debian, so I won't discourage you from using
it.  GPS is pretty good, it even has some features not in emacs
(gasp!)

BTW, at 11 Mb or so, the executable file for GPS is the largest I know
of in Debian, even when stripped and linked dynamically with the Ada
run-time and GtkAda.  On GNU/Linux, object code produced by GNAT does
tend to be larger than in some other languages.  Do you consider this
a problem?

P.S. In the subject line, I have corrected the spelling of Ada.  It is
not an acronym, it is a lady's name.

-- 
Ludovic Brenta.



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

* Re: Application Size in ADA
  2004-04-15 16:54 Application Size in ADA Simon Lewis
  2004-04-15 18:13 ` Application Size in Ada Ludovic Brenta
@ 2004-04-15 18:13 ` Georg Bauhaus
  2004-04-15 18:42 ` Martin Krischik
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 18+ messages in thread
From: Georg Bauhaus @ 2004-04-15 18:13 UTC (permalink / raw)


Simon Lewis <sheepboy69uk@nospamyahoo.com> wrote:

 
: Why do the binaries that I built seem to be huge?
Statically or dynamically bound?
If you search the archives, you will find hints.
Executable size is also addressed in compiler docs.

 
: I'm using tasks in my application.  Does this add extra code into the 
: binary to ensure time slicing?.

Most likely there is an Ada run time system to go with the
application.

 
: On a separate issue... I have found an IDE called GPS (GNAT Programming 
: System)  Is this considered the 'thing to use' or are you all writing 
: your ADA in emacs (or equivalent)?  (No flames Please ;) )

You may choose one or both. There is another one (usually used
with another Ada compiler) called ObjectAda.


-- Georg



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

* Re: Application Size in Ada
  2004-04-15 18:13 ` Application Size in Ada Ludovic Brenta
@ 2004-04-15 18:34   ` Simon Lewis
  2004-04-15 19:49     ` chris
  2004-04-15 20:12     ` Ludovic Brenta
  0 siblings, 2 replies; 18+ messages in thread
From: Simon Lewis @ 2004-04-15 18:34 UTC (permalink / raw)


How is dynamic linking achieved in Ada?

Are the Ada specific DLL's or can a DLL be used by any language as long 
as you have the right 'bindings' (You will have to excuse my ignorance, 
i am not very familiar with linking in Ada).

Thanks

-- 
Simon Lewis

Can you believe this, Marge? They're paying me to eat! -- Homer Simpson



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

* Re: Application Size in ADA
  2004-04-15 16:54 Application Size in ADA Simon Lewis
  2004-04-15 18:13 ` Application Size in Ada Ludovic Brenta
  2004-04-15 18:13 ` Application Size in ADA Georg Bauhaus
@ 2004-04-15 18:42 ` Martin Krischik
  2004-04-15 19:26   ` Simon Lewis
                     ` (2 more replies)
  2004-04-15 22:16 ` Robert I. Eachus
  2004-04-16 16:31 ` Jano
  4 siblings, 3 replies; 18+ messages in thread
From: Martin Krischik @ 2004-04-15 18:42 UTC (permalink / raw)


Simon Lewis wrote:

> Dear All,
> 
> Why do the binaries that I built seem to be huge? I know this is a bit
> of an open ended question... (no "how long is a piece of string" related
> answers please)
> 
> I'm using tasks in my application.  Does this add extra code into the
> binary to ensure time slicing?.  I was just wondering where all the
> bloat is coming from.

It does indeed. The compiler invisible draws libraries in.

i.E.

raise Some_Exeption;

is mapped to

Ada.Exceptions.Raise_Exception (
    E       => Some_Exeption,
    Message => "");

As you can see the library give you the benefit of message. Why there is no

raise Some_Exeption with "Some Message";

I don't know.

But that is beside the point. As for Tasking: Look at Annex D to see the
libs used for Tasking.

Reduction? With GNAT: yes - use "-shared" and the base libs come out of a
DLL.

> On a separate issue... I have found an IDE called GPS (GNAT Programming
> System)  Is this considered the 'thing to use' or are you all writing
> your ADA in emacs (or equivalent)?  (No flames Please ;) )

For beginners: Yes - you would have found a checkbox called "shared
library" ;-).

With Regards

Martin.

-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com




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

* Re: Application Size in ADA
  2004-04-15 18:42 ` Martin Krischik
@ 2004-04-15 19:26   ` Simon Lewis
  2004-04-15 19:54   ` Martin Dowie
  2004-04-15 21:22   ` Randy Brukardt
  2 siblings, 0 replies; 18+ messages in thread
From: Simon Lewis @ 2004-04-15 19:26 UTC (permalink / raw)


Martin Krischik wrote:

> For beginners: Yes - you would have found a checkbox called "shared
> library" ;-).

I found it! right next to the instructions about where to find the 'ANY' 
key.

:D

Thanks for your help.
-- 
Simon Lewis

Can you believe this, Marge? They're paying me to eat! -- Homer Simpson



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

* Re: Application Size in Ada
  2004-04-15 18:34   ` Simon Lewis
@ 2004-04-15 19:49     ` chris
  2004-04-15 19:52       ` chris
  2004-04-15 20:12     ` Ludovic Brenta
  1 sibling, 1 reply; 18+ messages in thread
From: chris @ 2004-04-15 19:49 UTC (permalink / raw)


Simon Lewis wrote:
> How is dynamic linking achieved in Ada?

It's not.  It's the compiler that deals with this and it depends on the 
compiler.  Assuming you're using GNAT, it has instructions on how to use 
compiler to produce libraries in the user guide.  I'm having some 
difficulty with this on Linux but am in the process of sorting it out.

> Are the Ada specific DLL's or can a DLL be used by any language as long 
> as you have the right 'bindings' (You will have to excuse my ignorance, 
> i am not very familiar with linking in Ada).

You can import DLLs written in many other compilers/languages fairly 
easily, providing they don't require any special runtime be setup prior 
to accessing them.  Going the other way, say from GNAT to C (gcc) is a 
little more difficult because you have to initialise the Ada runtime and 
the C won't necessarily understand the Ada types.  You have to provide a 
mapping between the Ada and C types using something like the package 
Interfaces.C as part of the library or a separate library wrapped around 
the Ada one.

The GNAT User Guide details this as well as how to create/use dlls.  Not 
sure exactly what section in the manual it is on Windows, but for Linux 
it's section 16 (gnat 3.15p).


Chris



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

* Re: Application Size in Ada
  2004-04-15 19:49     ` chris
@ 2004-04-15 19:52       ` chris
  0 siblings, 0 replies; 18+ messages in thread
From: chris @ 2004-04-15 19:52 UTC (permalink / raw)


chris wrote:

> 
> You can import DLLs written in many other compilers/languages fairly 
> easily, providing they don't require any special runtime be setup prior 
> to accessing them.  Going the other way, say from GNAT to C (gcc) is a 
> little more difficult because you have to initialise the Ada runtime and 
> the C won't necessarily understand the Ada types.

Doh!  Me stupid!

I should have said you to deal with elaboration for the library, not the 
Ada runtime.  Where's my brain been the past 6 weeks?



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

* Re: Application Size in ADA
  2004-04-15 18:42 ` Martin Krischik
  2004-04-15 19:26   ` Simon Lewis
@ 2004-04-15 19:54   ` Martin Dowie
  2004-04-15 21:26     ` Luke A. Guest
  2004-04-15 21:22   ` Randy Brukardt
  2 siblings, 1 reply; 18+ messages in thread
From: Martin Dowie @ 2004-04-15 19:54 UTC (permalink / raw)


"Martin Krischik" <krischik@users.sourceforge.net> wrote in message
>
> As you can see the library give you the benefit of message. Why there is
no
>
> raise Some_Exeption with "Some Message";

wait for Ada0Y - from memory that's one that looks likely to go in.





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

* Re: Application Size in Ada
  2004-04-15 18:34   ` Simon Lewis
  2004-04-15 19:49     ` chris
@ 2004-04-15 20:12     ` Ludovic Brenta
  2004-04-16  9:00       ` Simon Lewis
  1 sibling, 1 reply; 18+ messages in thread
From: Ludovic Brenta @ 2004-04-15 20:12 UTC (permalink / raw)


Simon Lewis writes:
> How is dynamic linking achieved in Ada?

This depends on your compiler and linker.  These in turn depend on
your host platform.

> Are the Ada specific DLL's or can a DLL be used by any language as
> long as you have the right 'bindings' (You will have to excuse my
> ignorance, i am not very familiar with linking in Ada).

Libraries consist of object code and are theoretically independent of
the high-level language used to create them.  So yes, with the right
bindings (it is the appropriate word) you can use libraries produced
from any language.  However, compilers for object-oriented or very
high-level languages use obscure constructs like name mangling and
virtual tables.  You need detailed knowledge about them if you want to
use such a library.

Libraries produced from C are easy to use, because C does not need
name mangling or any funny structure.  C is the least common
denominator.  Libraries written in other languages may be more
difficult to use from other languages.

If you write a library in Ada, you can selectively export subprograms
and types using the same convention as C.  This makes such libraries
very easy to use from any other language.  The details of how to do
this depend somewhat on the compiler and target platform, but you can
have a look at the Ada Reference Manual [1], annex B "Interface to
Other Languages"; of particular interest are sections B.1 "Interfacing
Pragmas" and B.3 "Interfacing with C".

The Big Online Book of Linux Ada Programming [2] will also help you
even if you use another platform.

[1] http://www.adaic.org/standards/95lrm/html/RM-TTL.html
[2] http://www.vaxxine.com/pegasoft/homes/book.html

-- 
Ludovic Brenta.




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

* Re: Application Size in ADA
  2004-04-15 18:42 ` Martin Krischik
  2004-04-15 19:26   ` Simon Lewis
  2004-04-15 19:54   ` Martin Dowie
@ 2004-04-15 21:22   ` Randy Brukardt
  2004-04-16  6:22     ` Martin Krischik
  2 siblings, 1 reply; 18+ messages in thread
From: Randy Brukardt @ 2004-04-15 21:22 UTC (permalink / raw)


"Martin Krischik" <krischik@users.sourceforge.net> wrote in message
news:1198888.cFZzYPrKut@linux1.krischik.com...
...
> As you can see the library give you the benefit of message. Why there is
no
>
> raise Some_Exeption with "Some Message";
>
> I don't know.

There is, you just have to wait for your compiler vendor to implement Ada
200Y. (See AI-361.)

                 Randy.






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

* Re: Application Size in ADA
  2004-04-15 19:54   ` Martin Dowie
@ 2004-04-15 21:26     ` Luke A. Guest
  2004-04-15 22:25       ` Robert I. Eachus
  2004-04-16  6:26       ` Martin Krischik
  0 siblings, 2 replies; 18+ messages in thread
From: Luke A. Guest @ 2004-04-15 21:26 UTC (permalink / raw)


On Thu, 15 Apr 2004 19:54:08 +0000, Martin Dowie wrote:

> "Martin Krischik" <krischik@users.sourceforge.net> wrote in message
>>
>> As you can see the library give you the benefit of message. Why there is
> no
>>
>> raise Some_Exeption with "Some Message";
> 
> wait for Ada0Y - from memory that's one that looks likely to go in.

Any clue when Ada0Y is going to happen?

Thanks,
Luke.




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

* Re: Application Size in ADA
  2004-04-15 16:54 Application Size in ADA Simon Lewis
                   ` (2 preceding siblings ...)
  2004-04-15 18:42 ` Martin Krischik
@ 2004-04-15 22:16 ` Robert I. Eachus
  2004-04-16 16:31 ` Jano
  4 siblings, 0 replies; 18+ messages in thread
From: Robert I. Eachus @ 2004-04-15 22:16 UTC (permalink / raw)


Simon Lewis wrote:

> Dear All,
> 
> Why do the binaries that I built seem to be huge? I know this is a bit 
> of an open ended question... (no "how long is a piece of string" related 
> answers please)
> 
> I'm using tasks in my application.  Does this add extra code into the 
> binary to ensure time slicing?.  I was just wondering where all the 
> bloat is coming from.

Sounds like you are using GNAT.  Read the GNAT documentation about 
stripping binaries.  There is a lot in there for debugger support that 
can come out once you are finished developing something.

-- 

                                           Robert I. Eachus

"The terrorist enemy holds no territory, defends no population, is 
unconstrained by rules of warfare, and respects no law of morality. Such 
an enemy cannot be deterred, contained, appeased or negotiated with. It 
can only be destroyed--and that, ladies and gentlemen, is the business 
at hand."  -- Dick Cheney




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

* Re: Application Size in ADA
  2004-04-15 21:26     ` Luke A. Guest
@ 2004-04-15 22:25       ` Robert I. Eachus
  2004-04-16  6:26       ` Martin Krischik
  1 sibling, 0 replies; 18+ messages in thread
From: Robert I. Eachus @ 2004-04-15 22:25 UTC (permalink / raw)


Luke A. Guest wrote:

> Any clue when Ada0Y is going to happen?

It is happening now.  Y will probably equal 5, but I expect that all the 
shouting over details will be done by the end this year, and parts of 
the new version have already started to apppear.


-- 

                                           Robert I. Eachus

"The terrorist enemy holds no territory, defends no population, is 
unconstrained by rules of warfare, and respects no law of morality. Such 
an enemy cannot be deterred, contained, appeased or negotiated with. It 
can only be destroyed--and that, ladies and gentlemen, is the business 
at hand."  -- Dick Cheney




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

* Re: Application Size in ADA
  2004-04-15 21:22   ` Randy Brukardt
@ 2004-04-16  6:22     ` Martin Krischik
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Krischik @ 2004-04-16  6:22 UTC (permalink / raw)


Randy Brukardt wrote:

> "Martin Krischik" <krischik@users.sourceforge.net> wrote in message
> news:1198888.cFZzYPrKut@linux1.krischik.com...
> ...
>> As you can see the library give you the benefit of message. Why there is
> no
>>
>> raise Some_Exeption with "Some Message";
>>
>> I don't know.
> 
> There is, you just have to wait for your compiler vendor to implement Ada
> 200Y. (See AI-361.)

Thanks. It is difficult to keep track of the >>316 AI's.

Martin

-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com




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

* Re: Application Size in ADA
  2004-04-15 21:26     ` Luke A. Guest
  2004-04-15 22:25       ` Robert I. Eachus
@ 2004-04-16  6:26       ` Martin Krischik
  1 sibling, 0 replies; 18+ messages in thread
From: Martin Krischik @ 2004-04-16  6:26 UTC (permalink / raw)


Luke A. Guest wrote:

> On Thu, 15 Apr 2004 19:54:08 +0000, Martin Dowie wrote:
> 
>> "Martin Krischik" <krischik@users.sourceforge.net> wrote in message
>>>
>>> As you can see the library give you the benefit of message. Why there is
>> no
>>>
>>> raise Some_Exeption with "Some Message";
>> 
>> wait for Ada0Y - from memory that's one that looks likely to go in.
> 
> Any clue when Ada0Y is going to happen?

Official date is 2005. gcc 3.5 has some of its features allready. You have
to activate the "extended features".

-gnatX    Language extensions permitted

With Regards

Martin

-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com




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

* Re: Application Size in Ada
  2004-04-15 20:12     ` Ludovic Brenta
@ 2004-04-16  9:00       ` Simon Lewis
  0 siblings, 0 replies; 18+ messages in thread
From: Simon Lewis @ 2004-04-16  9:00 UTC (permalink / raw)


Ludovic Brenta wrote:

> [1] http://www.adaic.org/standards/95lrm/html/RM-TTL.html
> [2] http://www.vaxxine.com/pegasoft/homes/book.html

Thanks very much for your help.


-- 
Simon Lewis

Can you believe this, Marge? They're paying me to eat! -- Homer Simpson



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

* Re: Application Size in ADA
  2004-04-15 16:54 Application Size in ADA Simon Lewis
                   ` (3 preceding siblings ...)
  2004-04-15 22:16 ` Robert I. Eachus
@ 2004-04-16 16:31 ` Jano
  4 siblings, 0 replies; 18+ messages in thread
From: Jano @ 2004-04-16 16:31 UTC (permalink / raw)


> On a separate issue... I have found an IDE called GPS (GNAT Programming 
> System)  Is this considered the 'thing to use' or are you all writing 
> your ADA in emacs (or equivalent)?  (No flames Please ;) )

Vim for me, but if I were into regular keystrokes I would use GPS.



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

end of thread, other threads:[~2004-04-16 16:31 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-15 16:54 Application Size in ADA Simon Lewis
2004-04-15 18:13 ` Application Size in Ada Ludovic Brenta
2004-04-15 18:34   ` Simon Lewis
2004-04-15 19:49     ` chris
2004-04-15 19:52       ` chris
2004-04-15 20:12     ` Ludovic Brenta
2004-04-16  9:00       ` Simon Lewis
2004-04-15 18:13 ` Application Size in ADA Georg Bauhaus
2004-04-15 18:42 ` Martin Krischik
2004-04-15 19:26   ` Simon Lewis
2004-04-15 19:54   ` Martin Dowie
2004-04-15 21:26     ` Luke A. Guest
2004-04-15 22:25       ` Robert I. Eachus
2004-04-16  6:26       ` Martin Krischik
2004-04-15 21:22   ` Randy Brukardt
2004-04-16  6:22     ` Martin Krischik
2004-04-15 22:16 ` Robert I. Eachus
2004-04-16 16:31 ` Jano

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