comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada interacting with Windows 8.1+ GUI
Date: Mon, 29 Oct 2018 16:09:29 -0500
Date: 2018-10-29T16:09:29-05:00	[thread overview]
Message-ID: <pr7sua$lru$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: lyin1pjca1.fsf@pushface.org

"Simon Wright" <simon@pushface.org> wrote in message 
news:lyin1pjca1.fsf@pushface.org...
> joakimds@kth.se writes:
>
>> Isn't it easy for the compiler to optimize away/remove the code that
>> is not used?
>
> Not so much in a library package where some subprograms don't have to be
> used by the overall program.

It's definitely not easy, but it is possible.

...
> GNAT provides gnatelim, which analyses your code and (?) regenerates it
> without the unused objects. No idea how well this works.

Janus/Ada has a /T option that keeps extra information with the code so that 
unused library-level subprograms can be eliminated. Since we invented Claw, 
it can even eliminate unused primitive subprograms of tagged types (since 
these are referenced from the type tag, they always appear used; the linker 
has to prove that there are no dispatching calls for a particular "slot" in 
order to remove them). (That reduces the default size of a Claw program from 
1.4MB to about 0.45MB.)

This was on an option because we were concerned about the extra binding time 
required; however, it turns out to work so well that it is the default on 
Windows (and indeed, one can't link a Windows program without it, as 
otherwise one ends up with symbols not defined on whatever version of 
Windows you have - since the basic runtime defines the union of all of those 
versions).

But Janus/Ada can do this because it handles all of the linking/binding for 
the Ada code itself. (That is then fed into the Microsoft linker to link 
with the Win32 API and any foreign language code.) Conventionally linked 
code would make that very hard.

                                        Randy.



      parent reply	other threads:[~2018-10-29 21:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09 14:42 Ada interacting with Windows 8.1+ GUI Donar
2018-10-09 14:56 ` gautier_niouzes
2018-10-10 15:42   ` herbert.glarner
2018-10-10 18:19     ` G. B.
2018-10-25  9:24       ` gautier_niouzes
2018-10-11 14:42     ` gautier_niouzes
2018-10-11 15:26       ` rabbibotton
2018-10-11 18:25         ` rabbibotton
2018-10-11 18:37       ` Björn Lundin
2018-10-13  6:30       ` alby.gamper
2018-10-13 11:50         ` gautier_niouzes
2018-10-13 12:47           ` alby.gamper
2018-10-25 17:19 ` Olivier Henley
2018-10-25 17:33   ` Olivier Henley
2018-10-25 22:30     ` joakimds
2018-10-26  9:19       ` Simon Wright
2018-10-26  9:39         ` gautier_niouzes
2018-10-26 12:52         ` Bill Findlay
2018-10-26 13:42           ` Simon Wright
2018-10-26 21:19             ` Bill Findlay
2018-10-29 21:09         ` Randy Brukardt [this message]
replies disabled

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