Download ADA USER JOURNAL - Ada

Transcript
A d a i n C onte x t
Service:
- Generate new project versions from upstream commits automatically.
- Test new project versions automatically
as they are generated.
- Only release project versions which pass
the tests on at least one host-compilertarget combination.
- It would be nice if it automatically could
test which revisions of the dependencies
of a project result in a working (testpassing) system.
- Should we host copies of the sources of
the projects as a part of the service? J.
Kimball doesn't like to do it, but I like
the idea of fetching sources and build
rules from a single location.
PS: I like a name like "go Ada" better
than "something-CPAN".
From: Björn Persson
<bjorn@xn--rombobjrn-67a.se>
Date: Fri, 13 Dec 2013 19:38:18 +0100
Subject: Re: CPAN style Ada repository
Newsgroups: comp.lang.ada
> I would leave "install" to the packagers;
upstream Makefiles should just build in
place.
I disagree with that for the following
reasons:
- The directory variables aren't used only
for copying files in the installation step.
Some of these pathnames sometimes
need to be embedded in programs so that
they'll know where to find data files or
other programs.
- Some of the directory variables also
need to be embedded in libraries' usage
project files. Packagers will have to
patch usage projects if the upstream
build system doesn't configure them
correctly, and patches are much more of
a maintenance burden than command
line parameters are.
- Libraries need some source files
installed, but usually not all of the
source files. At least some specifications
are always needed, but sometimes
bodies are also needed, if they contain
generic units or inline subprograms.
Manually keeping track of which files
are needed is difficult, especially for a
packager who isn't also an upstream
developer, but the GNAT builders know
which files are needed and can install
them for you.
- Packagers aren't the only ones who will
build your software. Users who
download the source tarball and install
locally won't like to dig files out of the
source tree manually and edit project
files.
> [...] sounds like an Ada-style alternative
to automake, which is very welcome.
Yes, that's a good comparison. The
purpose of Comfignat is similar to that of
Automake, but the way it works is
Ad a User Jo urn al
21
somewhat different. You import a generic
makefile instead of generating a makefile,
and it delegates dependency tracking to
GPRbuild or Gnatmake.
Reason for
Ada.Strings.Bounded not
Being Pure
From: Randy Brukardt
<randy@rrsoftware.com>
Date: Thu, 5 Dec 2013 14:17:05 -0600
Subject: Re: Reason for
'Ada.Strings.Bounded' not being
declared 'pragma Pure' ?
Newsgroups: comp.lang.ada
We re-analyzed all of the existing
packages for Ada 2005, and changed the
categorization of some of them. The
details can be found in AI95-0362-1
(http://www.ada-auth.org/cgibin/cvsweb.cgi/ais/ai-00362.txt).
There is a listing of every predefined
package in that AI. Here's the entry for
Bounded strings:
Ada.Strings.Bounded -- A.4.4;
Preelaborate
This package contains no state, no
dependence on non-pure units, no other
items that prevent the package from being
pure, and does not declare any types that
would be a problem for Annex E, so it
could be declared pure.
But it's large and complex, and many of
the operations are not conceptually pure
(they do in-place updates), so no change
is recommended.
This admittedly does not seem very
satisfying. We didn't redo this exercise for
Ada 2012, the only change we made was
to make Stream_IO preelaborated so that
loggers and the like can be written. (It's
not practical to make the full Text_IO
preelaborated [the obvious approach is
not task-safe], and there was no
agreement on the contents of a
preelaborable subset.) I suppose you
could send a request to reconsider this to
Ada-Comment (but it would probably
have to wait until the next Standard,
whenever that is).
Someone asked about Ada.Tags. The
entry for it says:
Ada.Tags -- 3.9; not categorized
Package Tags has state, so it cannot be
pure. That state is generally either set up
at link-time (before elaboration) or during
the elaboration of tagged types (that is,
during the elaboration of other units). In
either case, no complex state need be
initialized at elaboration time. Thus, this
package can be Preelaborated.
(The "state" that is talked about here is the
table of internal tag <=> external tag
mappings. Distributing that could be a
significant overhead.) Making it Pure is
not practical.
From: Brad Moore
<brad.moore@shaw.ca>
Date: Thu, 05 Dec 2013 20:03:09 -0700
Subject: Re: Reason for
'Ada.Strings.Bounded' not being
declared 'pragma Pure' ?
Newsgroups: comp.lang.ada
> [...]
Actually, this wasn't the only related
change in Ada 2012. We also allowed
Remote_Types packages and
Remote_Call_Interface packages to
depend on preelaborated packages, if that
dependency is via a private with clause.
See http://www.ada-auth.org/
cgi-bin/cvsweb.cgi/ai05/ai05-0206-1.txt
This means that you can build
abstractions that use Ada.Bounded_String
(Or Ada.Tags for that matter), so long as
they are not used in the visible part of a
Remote_Types or Remote_Call_Interface
package. eg.
private with Ada.Strings.Bounded;
package RT is
pragma Remote_Types;
type W is private;
procedure Set (Item : in out W;
Value : in String);
function Get (Item : W) return String;
private
package My_String is new
Ada.Strings.Bounded.
Generic_Bounded_Length
(Max => 100);
type W is
record
D : My_String.Bounded_String;
end record;
function Get (Item : W) return String is
(My_String.To_String (Item.D));
end RT;
package body RT is
procedure Set (Item : in out W;
Value : in String) is
begin
My_String.Set_Bounded_String
(Target => Item.D,
Source => Value);
end Set;
end RT;
Freezing Rules
From: Randy Brukardt
<randy@rrsoftware.com>
Date: Fri, 17 Jan 2014 17:23:55 -0600
Subject: Re: 'Protected' abstract
subprograms
Newsgroups: comp.lang.ada
Robert A Duff wrote:
> The freezing rules make my brain hurt.
Even though I had a hand in writing
them! ;-)
>
Vo lu me 3 5 , Nu mb er 1 , March 2014