comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: GNAT and user-defined aspects and pragmas?
Date: Thu, 12 Nov 2015 13:24:26 -0600
Date: 2015-11-12T13:24:26-06:00	[thread overview]
Message-ID: <n22p1b$66h$1@loke.gir.dk> (raw)
In-Reply-To: 87d1vg3mvm.fsf@adaheads.sparre-andersen.dk

"Jacob Sparre Andersen" <sparre@nbi.dk> wrote in message 
news:87d1vg3mvm.fsf@adaheads.sparre-andersen.dk...
...
>> Between the two, one gets the impression that if one uses aspects
>> beyond those defined by the language reference -- ie; using
>> implementation defined aspects -- one accepts that the result is not
>> portable.
>
> That's not the impression I've got from comments from ARG members here
> on comp.lang.ada.  It is my impression that aspects should be open for
> experimentation like pragmas have been, and that aspects are equivalent
> to pragmas which are attached to a specific declaration.

Certain ARG members are highly confused. :-) Nothing that is an aspect ever 
should have been a pragma, and aspects should be considered a replacement 
for pragmas rather than some sort of parallel syntax.

Ignoring an aspect is illegal as it is considered to be a critical part of 
the semantics of the program. Note that this follows the model for 
attributes and representation clauses. Ignoring unknown pragmas is a mistake 
in many instances (as Robert Dewar pointed out on several occasions). He 
gave examples like a pragma that sets up interrupts for some processor. That 
program might compile on some other implementation, but it won't work.

It's better to comment out unknown pragmas and aspects rather than to ignore 
them. Ada 83 got this wrong for pragmas (although one can find 
counter-examples where it's helpful).

> With your interpretation, we wouldn't be able to compile SPARK 2014
> programs with anything but GNAT - even when some of AdaCore's
> competitors release an Ada 2012 compiler.

Definitely. Since the SPARK aspects include some additional syntax, I can't 
see any way that it would be possible for a compiler that doesn't know about 
SPARK (say Janus/Ada) to compile a SPARK program. To the extent that SPARK 
annotations aren't significant to the semantics of the program, they 
probably should have been pragmas. But since AdaCore doesn't 
understand/believe in the difference, you'll have to remove them. That 
should be easy with a tool (it's a simple syntax transformation). [Of 
course, someone has to write the tool.]

                              Randy.




  reply	other threads:[~2015-11-12 19:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 13:28 GNAT and user-defined aspects and pragmas? Jacob Sparre Andersen
2015-11-10 19:53 ` Dennis Lee Bieber
2015-11-11  9:29   ` Jacob Sparre Andersen
2015-11-12 19:24     ` Randy Brukardt [this message]
2015-11-12 20:37       ` Shark8
2015-11-12 21:42         ` Randy Brukardt
2015-11-13 10:03       ` J-P. Rosen
2015-11-11 11:14   ` Simon Wright
2015-11-12 19:27     ` Randy Brukardt
2015-11-13  8:51       ` J-P. Rosen
replies disabled

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