From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.albasani.net!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada interacting with Windows 8.1+ GUI Date: Mon, 29 Oct 2018 16:09:29 -0500 Organization: JSA Research & Innovation Message-ID: References: <5fb88cf6-47da-4c28-a660-9ddf06522b12@googlegroups.com><5b897611-5e95-4bc8-b5b9-a8df97299cd6@googlegroups.com><61c2515d-29fd-4b96-8138-88d7f5419fb5@googlegroups.com> Injection-Date: Mon, 29 Oct 2018 21:09:30 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="22398"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:54722 Date: 2018-10-29T16:09:29-05:00 List-Id: "Simon Wright" 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.