Discussion:
Porting read-only record fields to Ada 95
(too old to reply)
Craig Carey
2004-04-07 19:08:14 UTC
Permalink
Oberon has read-only record fields and Ada 95 has not. So it could be
shift into Ada 95. It didn't seem that the Ada community had an
interest in adding this feature of Oberon. Due to the inevitable
predicted decline in the popularity of Oberon, diffusing bits of
Oberon into other languages might be of interest.

The GCC GNAT Ada 95 compiler could be modified. The developers would
not object to having the language forked up just to get read-only
record fields (I got a message from Mr D of ACT).

This seems to be an option for Ada in the task of actually making
some fields be read-only. It seems to be too complex.

E.g.
---------------------------------
package A is
type RD is
record
P, Q : Integer;
end record;

type RD_Constptr is access constant RD;
U : RD_Constptr; -- So U.all.P is constant/read-only
type Integer_All_Ptr is access all Integer;

function P_Of (X : RD_Constptr) return Integer_All_Ptr;
-- Unchecked conversion on a pointer to go from Const to All
pragma Inline (P_Of);
...
end package A
-------------
with A;
procedure Main_Prog is
X_Dont_Use_Me : aliased RD; -- aliased means 'pointed to'
X : constant RD_Constptr := X_Data'Access;
begin
-- Now fields X.all.P (i.e. X.P) is read-only.

-- Security is imperfect since this can be done:
X_Dont_Use_Me.P := 22;

-- The record-wide read-only status can be bypassed with
-- pointer functions:
P_Of (X).all := 33; -- Do X.all.P := 33.

-- this produces a syntax error since P,Q are read-only:
X.all.Q := 11; -- Can omit the ".all"
---------------------------------

Maybe writing one of these would be a worthwhile improvement that
achieves the same but replaces inlined 1-line functions with syntax
errors:

type RD is
record
P, Q : in Integer;
end record;

type RD is
record
P, Q : constant Integer;
end record;

The words "read-only" imply 'no hidden no caching done by the compiler'.

Also, in Ada 95, a record could contain pointers to private/hidden parts
of itself. That gets rid of the pointer functions.

The "in out" mode that uses copying has to be disabled using:
* the limited word (which disables "=", "/=", ":="), or
* the tagged keyword (which uses up 32 bits and maybe does nothing), or
* pragma Volatile (which really does not run OK in GNAT), or
* Convention C (but only effective if the procedures are coded in C.

Filling up records with short-distance pointers is messy. Also changes
may have to be made all throughout the code. E.g. this:
if X.P /= 3 then ...
may need to be changed into this (which makes it seem better to improve
the language)
if X.P.all /= 3 then ...

However they might guess reject the feature saying that it is not
important.

Is there some research into the usefulness and/or importance of
Oberon's read-only record field feature ?. Ada Core Technologies says
that I can modify the compiler (for myself) and add in features.

I have not been following the developments in Oberon.


+-- Craig Carey

Ada-Comment list, REST_AIS.ZIP considerations: http://www.ada-auth.org/
Chris Burrows
2004-04-07 23:53:52 UTC
Permalink
Post by Craig Carey
Due to the inevitable
predicted decline in the popularity of Oberon,
What leads you to say this? Are you not aware of the recent developments
with respect to Oberon / Component Pascal in the Microsoft .NET environment?
The future is looking very good from our perspective.

Chris Burrows
CFB Software
http://www.cfbsoftware.com
WLad
2004-04-08 09:54:03 UTC
Permalink
Post by Craig Carey
Due to the inevitable
predicted decline in the popularity of Oberon,
:o)))))))))))))))))))))))))))))))))))))))))))))))))))))

I have returned to Oberon systems from Ada.
Due to their features.
You ask "how to" transform the feature from declining in the popularity
Oberon to "new rising star" Ada? What for? Use Active Oberon or Zonnon.
And you won't "have to" _emulate_ features. It concerns AO multitasking
features too. In Ada we have so much "if then" cases of multitasking
use. But in Active Oberon all this cases can be expressed through
combinations of activities, exclusive blocks and awaits. Of course you
have to think more about disign of you systems but not about use of
"usual" approaches (so called processes, threads, tasks, rendezvous,
mutexes, semaphores and other trumpery)...
Ondrej Hrabal
2004-04-08 12:29:03 UTC
Permalink
Post by Craig Carey
Due to the inevitable
predicted decline in the popularity of Oberon,
I am not such a pessimist...
Post by Craig Carey
diffusing bits of
Oberon into other languages might be of interest.
In my opinion, the better way might be to use Oberon as the base,
enrich it with useful concepts from elsewhere, and still keep it
simple. There are a few promising examples of this kind - Component
Pascal, Luna, Active Oberon, Zonnon...
Post by Craig Carey
Is there some research into the usefulness and/or importance of
Oberon's read-only record field feature ?.
Read-only fields vs. getter methods:
-saves coding
-more efficient (unless you have a pretty smart compiler)
-the fields are designators, the function calls aren't
(e.g f.reader.Read(...) is OK, but f.GetReader().Read(...) is not
allowed in Oberon-2)

Regards, Andy
Craig Carey
2004-04-12 02:17:06 UTC
Permalink
Craig Carey <research-at-ijs.co.nz> wrote:...
...
In my opinion, the better way might be to use Oberon as the base,
enrich it with useful concepts from elsewhere, and still keep it
simple. There are a few promising examples of this kind - Component
Pascal, Luna, Active Oberon, Zonnon...
Retaining backward compatibility is very suspect given how fast and
successful a program to automatically port Oberon body files into
Ada 95 body files, would be.

The begin-end syntax of Oberon syntax seems worse than Ada 95's syntax.

The Zonnon website lists a first aim as this: "[Zonnon] Preserves the
spirit of Oberon.". Why didn't they instead take the view that porting
to Ada 95 would become easier in every area where the issue is caused
by Ada 95 being more precise and better designed.

A troublesome area for automatic translation when porting Modula and
whatnot, to Ada 95, is the topic of getting the new procedure parameter
passing modes correct.

I.e. converting from "var" to "in out" or else to "out" involves a
study of the (Pascal/etc) source code which is time consuming.

Why is Zonnon not a project that adds new features to Oberon that
enhance the ease fo replacing Zonnon with Ada 95 ?.

It is so much more material to design Oberon to be the easiest
language to quit from. The more it misses out on features then the
harder it is to quit it. C++ is worse.

Porting from Pascal to Ada 95 can be done at great speed:

NewP2Ada: http://homepage.sunrise.ch/mysunrise/gdm/gsoft.htm

We could simply post up proof that Ada can be mixed with
Oberon.

E.g. some examples: (1) Ada is in the executable and Oberon is in a DLL,
and only C-compatible parameter passing modes are used.

If Ada might be worse then develop a project using both languages.
It does not seem that Ada would lose that sort of material unbiased
fair and factual sound and credible evaluation.

However the Ada GDB debugger is able to be a way to get Ada to compare
worse. Quite bad results can be obtained when different versions of
GNU C (ditto C++) are mixed with Ada 95. Actually a comparison between
Ada and Oberon could start with the debuggers when the code is mix
of different languages all linked into a single EXE file.

--

Oberon's multitasking is not promoted as better than Ada's
protected objects, by this webpage:
http://bluebottle.ethz.ch/languagereport/node8.html
"Synchonization Examples"

It seems that Oberon is a simple language.
Post by Craig Carey
Is there some research into the usefulness and/or importance of
Oberon's read-only record field feature ?.
-saves coding
-more efficient (unless you have a pretty smart compiler)
-the fields are designators, the function calls aren't
(e.g f.reader.Read(...) is OK, but f.GetReader().Read(...) is not
allowed in Oberon-2)
Ada is failed under the read-only record field check up.

(In Ada 95, the "out" mode is also partly "in", since default
initializations of "out" mode parameters have occurred before the
procedure is called.)

Any research on read-only record fields ?.

Ada 95: ftp://ftp.cs.nyu.edu/pub/gnat (a comparison with Java)
Reference manual in Adagide and the annotated version at ada-auth.org.

Craig Carey
Ondrej Hrabal
2004-04-13 20:59:38 UTC
Permalink
Post by Craig Carey
The Zonnon website lists a first aim as this: "[Zonnon] Preserves the
spirit of Oberon.". Why didn't they instead take the view that porting
to Ada 95 would become easier in every area where the issue is caused
by Ada 95 being more precise and better designed.
Why is Zonnon not a project that adds new features to Oberon that
enhance the ease fo replacing Zonnon with Ada 95 ?.
So you would tell the designers: "Design the language in such a way
that the users can easily move to Ada 95 as soon as they become fed up
with your product." It would be quite cruel... :) And frustrating... I
wouldn't be very happy with such a task. ;-)
I think it's very important that NEW programming languages are being
designed. Why criticize them for incompatibility with Ada or with
something else?

Regards, Andy
Craig Carey
2004-04-16 17:44:34 UTC
Permalink
Post by Ondrej Hrabal
Post by Craig Carey
The Zonnon website lists a first aim as this: "[Zonnon] Preserves the
spirit of Oberon.". Why didn't they instead take the view that porting
to Ada 95 would become easier in every area where the issue is caused
by Ada 95 being more precise and better designed.
Why is Zonnon not a project that adds new features to Oberon that
enhance the ease fo replacing Zonnon with Ada 95 ?.
So you would tell the designers: "Design the language in such a way
that the users can easily move to Ada 95 as soon as they become fed up
with your product." It would be quite cruel... :) And frustrating... I
wouldn't be very happy with such a task. ;-)
Surely it would be more rational to document the problem in a bug
report. Alternatively the user could quit Oberon adn port code out
to Ada 95. HAve you got actual real data?.

Swiss psychologists could be hired to resolve a problem.

Ada is used in projects of rocketry, railway, space, military and
so on. Lists of major users are at Mr Feldman's website:
http://www.seas.gwu.edu/~mfeldman/

Pehaps you can extract evidence of emotions but it is not really
possible for Ada 95 users.

A>I think it's very important that NEW programming languages are being
Post by Ondrej Hrabal
designed. Why criticize them for incompatibility with Ada or with
something else?
Oberon has some features that Algo 60 has and that Ada lacks.

Oberon uses the 1st of these two styles:

(1) "IF ... THEN BEGIN ... END ELSE ... END;" <--- [Algol and Oberon]
(2) "if ... then ... elsif ... elsif ... else ... end if" <--- [Ada]

The "if" of Pascal (and C) is worse. After using Ada for a while, it
would be figured out that the BEGIN ... END of Oberon is substandard.
I don't know who exactly it was was in the 1970s that made the
fine decision to quite the track the Oberon and Mr Wirth took. I would
not myself drop back to a the design of the 60s and/or early 70s.
Post by Ondrej Hrabal
Regards, Andy
I see that Zonnon was not really offering new and major improvements
to Oberon.


-- Craig Carey
Stefan Salewski
2004-04-16 18:26:30 UTC
Permalink
Post by Craig Carey
(1) "IF ... THEN BEGIN ... END ELSE ... END;" <--- [Algol and Oberon]
(2) "if ... then ... elsif ... elsif ... else ... end if" <--- [Ada]
If I remember correctly, "THEN BEGIN" is old PASCAL. I have never used this
in Modula2, Oberon, and Active-Oberon.

Lets look at http://www.oberon.ethz.ch/EBNF.html

IfStatement = IF expression THEN StatementSequence
{ELSIF expression THEN StatementSequence}
[ELSE StatementSequence] END.

This is fine for me.

Regards

Stefan Salewski
Craig Carey
2004-04-16 23:44:22 UTC
Permalink
On Fri, 16 Apr 2004 20:26:30 +0200, Stefan Salewski
Post by Stefan Salewski
Post by Craig Carey
(1) "IF ... THEN BEGIN ... END ELSE ... END;" <--- [Algol and Oberon]
(2) "if ... then ... elsif ... elsif ... else ... end if" <--- [Ada]
If I remember correctly, "THEN BEGIN" is old PASCAL. I have never used this
in Modula2, Oberon, and Active-Oberon.
Lets look at http://www.oberon.ethz.ch/EBNF.html
IfStatement = IF expression THEN StatementSequence
{ELSIF expression THEN StatementSequence}
[ELSE StatementSequence] END.
I got that wrong (by guessing...).

Lots of *old* Oberon compilers:
http://www.math.tau.ac.il/~guy/Oberon/compilers.html ;

Maybe .NET is bundled with Visual Basic.

These Oberon compiler files are now out of date:
ftp://ftp.inf.ethz.ch/pub/ETHOberon/Native/StdAlone/

Nothing at the new Shootout website on the Oberon language:
http://dada.perl.it/shootout/



Thanks for the advocacy.

Craig Carey
Marc Martin
2004-04-19 18:06:19 UTC
Permalink
Post by Craig Carey
I got that wrong (by guessing...).
http://www.math.tau.ac.il/~guy/Oberon/compilers.html ;
ftp://ftp.inf.ethz.ch/pub/ETHOberon/Native/StdAlone/
http://dada.perl.it/shootout/
So what exactly is your point?

If it is that Oberon has already died, it appears that you're just looking
in the wrong places.

Blackbox Component builder is a commercial Oberon-2 compiler (they call it
Component Pascal, but it is essentially Oberon-2 with minor extensions) for
Microsoft Windows. It still exists, and has it's own mailing list discussion
group:

http://www.oberon.ch/prod/blackbox/

Garden's Point Component Pascal is an open-source, free compiler which is in
active development (the most recent update was less than a month ago). This
generates code for Microsoft's .NET platform and also for the Java Virtual
machine. Again, this is essentially Oberon-2 with minor extensions (plus a
few more extensions to interface with the frameworks). There's also a IDE
version which plugs into Visual Studio 2003. Again, this compiler has it's
own mailing list discussion group:

http://groups.yahoo.com/group/GPCP/

There is also Active Oberon and Zonnon for .NET, but I'm not sure what the
status is with these ETHZ projects. From their website, it appears that
Active Oberon has been abandoned in favor of Zonnon, but Zonnon is not
available to the public. Not a very good situation here, but it doesn't
appear that Oberon has been abandoned... just "improved":

http://zonnon.ethz.ch/

Also, there was recently an "Oberon Day" meeting at CERN, where Wirth was a
guest speaker.

http://ftkachov.home.cern.ch/ftkachov/

So it seems that things are still happening with Oberon...

Marc
Craig Carey
2004-04-20 16:38:21 UTC
Permalink
On Mon, 19 Apr 2004 18:06:19 GMT, "Marc Martin" <**@boeing.com> wrote:
...
Post by Marc Martin
If it is that Oberon has already died, it appears that you're just looking
in the wrong places.
These Oberon compilers seem unsatisfactory or old.

GNAT Ada for embedded CPUs: http://www.rtems.com/
Post by Marc Martin
Blackbox Component builder is a commercial Oberon-2 compiler...
http://www.oberon.ch/prod/blackbox/
It is expensive (US$1450, 1900CHF) for Blackbox 1.4 Classic.

...
Post by Marc Martin
Garden's Point Component Pascal is an open-source, free compiler which is in
active development (the most recent update was less than a month ago). This
generates code for Microsoft's .NET platform and also for the Java Virtual
machine. [...]
http://groups.yahoo.com/group/GPCP/
I could compare the speed of their Oberon compiler against the speed of
GNAT. But sadly there is not really a actively updated Oberon compiler
tagetting Microsoft's Win32 subsystem. Ada mixes with any langauge that
mixes with GCC C, and some version number problems could recede now that
MinGW Ada runs OK.

Also Ada can target .NET. The A# compiler is probably used very much
less than the traditional executable-producing compiler:
A-sharp: http://www.usafa.af.mil/dfcs/bios/mcc_html/ada_stuff.html

...
Post by Marc Martin
There is also Active Oberon and Zonnon for .NET, but I'm not sure what the
[...] but it doesn't appear that Oberon has been abandoned... [...]
http://zonnon.ethz.ch/
Java is argued to be harder for university students to learn, in
Mr Brosgol's PDF's online here:
ftp://ftp.cs.nyu.edu/pub/gnat/jgnat/papers/

Does anybody know why pages promoting Mr Wirth's Oberon don't mention
Ada 95 ?. That

----

AT&T fired people in a mess-up with wireless software upgrade.
[was mentioned at comp.lang.ada, 18-Apr-2004]:
http://www.cio.com/archive/041504/wireless.html

This webpage

http://www.inr.ac.ru/~info21/info/fvtjmlc2003.htm

does not actually have real numbers indicating a lot of enthusiasm
of ... 'cash-strapped' schools in Russia for the sharply expensive
'BlackBox' Oberon compiler. Oberon is supposed to a simple language.
Which seems to be a wrong objective since Ada users don't have a
problem with Ada code taking up 28MB in a directory from gcc.gnu.org.
Excerpt from the URL:

| There has formed a board of advisors representing the aerospace
| industry, the Russian Academy of Sciences, and the Moscow State
| University. The project is being helped by volunteer coordinators in
| Siberia (Dr. A.I.Popkov) where a considerable pool of engineering
| talent is located, and in Central Asia (Prof. Kubanychbek Tajmamat
| oolu) where the education problems are similar to Russia’s if somewhat
| exacerbated by demographics but there is more freedom for
| experimentation due to less bureaucracy. Several dozen copies of the
| russification package designed specifically for schools have been
| downloaded from the Informatika-21 site (taking into account that a
| similar package for professional developers is also available, this
| gives an estimate for the number of teachers familiarizing themselves
| with the BlackBox Oberon). Starting the Fall of 2003, new programming
| courses based on Oberon are due to begin, and another web site is to be
| put up

What is the "package for professional developers"?.
Craig Carey
2004-04-20 19:49:51 UTC
Permalink
On Wed, 21 Apr 2004 04:38:21 +1200, Craig Carey wrote:
...
Post by Craig Carey
Post by Marc Martin
Blackbox Component builder is a commercial Oberon-2 compiler...
http://www.oberon.ch/prod/blackbox/
Correction: Blackbox is free for schools [incl in Russia].

...
Post by Craig Carey
| There has formed a board of advisors representing the aerospace
There was formed, a board of advisors ...

There are about 150 Universities teaching Ada 95 in computer
science courses, says this URL:
http://www.seas.gwu.edu/%7Emfeldman/ada-foundation.html

I could not find any Russian university that teaches Ada 95.
Maybe they are not well indexed by search engines.

My aim here is to stop writing to comp.lang.oberon.

-- Craig Carey
WLad
2004-04-23 12:21:33 UTC
Permalink
Post by Craig Carey
I see that Zonnon was not really offering new and major improvements
to Oberon.
At first I guess you didn't even read any doc devoted Zonnon.

new features (not only for Pascal-Modula(2)-Oberon(2) family!):

FIRST OF ALL - ACTIVE OBJECTS
This is not yet one "multitasking features -> objects" BUT "objects
-> multitasking". That is at Active Oberon and Zonnon we can see not
just another attempt to express "processes", "threads", "semaphores",
"locks" and other multitasking trumpery through objects! But quite the
contrary! We get features to build active structures, where "processes"
ARE result of cooperation of such structures. I think such way is more
natural to model things of real world...

more general and simplier multitasking features:
activities
exclusive blocks
awaits
channels (and corresponding operations)
syntax specification of a communication protocol in EBNF (between
object activities)

And after all these you can say: "I see that Zonnon was not really
offering new and major improvements to Oberon."? :o)))))
I think these features are new and major improvements not only to
Oberon... :o)
Craig Carey
2004-04-24 14:05:31 UTC
Permalink
Post by WLad
Post by Craig Carey
I see that Zonnon was not really offering new and major improvements
to Oberon.
At first I guess you didn't even read any doc devoted Zonnon.
FIRST OF ALL - ACTIVE OBJECTS
This is not yet one "multitasking features -> objects" BUT "objects
-> multitasking". That is at Active Oberon and Zonnon we can see not
just another attempt to express "processes", "threads", "semaphores",
"locks" and other multitasking trumpery through objects! But quite the
contrary! We get features to build active structures, where "processes"
ARE result of cooperation of such structures. I think such way is more
natural to model things of real world...
activities
exclusive blocks
awaits
channels (and corresponding operations)
syntax specification of a communication protocol in EBNF (between
object activities)
And after all these you can say: "I see that Zonnon was not really
offering new and major improvements to Oberon."? :o)))))
I think these features are new and major improvements not only to
Oberon... :o)
I used the words "not really". I assume people are not going to use
Zonnon and I am not sure, but is that the Swiss government writing
Zonnon, or some university students?.

The improvment might have considered already by the Ada language
authority (ARG). All 5 of the e-mails gunning out the mistake that
was made in Java (similarly Zonnon) are copied in below for the
pleasure of the readers.

|
| Date: Sun, 09 Jun 2002 09:16:42 -0400
| From: Tucker Taft <***@avercom.net>
| To: Ada-Comment List <ada-***@ada-auth.org>
| List-Server: DOLIST Server Custom 3.4 B2110
| List-Help: <mailto:***@ada-auth.org?body=help%20ada-comment>
| Subject: Re: [Ada-Comment] Language extension proposals (Non API).
|
| An important principle of the protected type is that
| all synchronization associated with a given set of
| data is gathered into a single module. This is the
| so-called "monitor" concept introduced many many years
| ago, to almost universal acclaim. It dramatically
| improves the structuring of multi-tasking systems,
| in my view.
|
| Also in my view, Java's "synchronized" blocks are a real
| step backward. They approximate your suggestion, though
| as Ted Baker points out, they have an associated object,
| which is critical. Java has synchronized methods, which
| are associated with the enclosing class (or an instance
| thereof), but Java's synchronized blocks can be scattered
| anywhere, with no modularity whatsoever, and no scoping
| relation to the associated object. This makes any kind
| of analysis of potential deadlocks and race conditions
| much more difficult.
|
| -Tucker Taft ***@yaletaft.com
|
| Robin P. Reagan <***@reagans.org> wrote:
| >
| > Ada community,
| >
| > I would like to propose the addition of a protected block to the Ada
| > language standard. Like a protected object, a protected block would
| > allow the sequence of statements to be executed atomically without the
| > overhead of a separate object.
| > This would allow an uninterruptable (atomic) sequence of statements to
| > be executed without the OS context switching or responding to
| > interrupts. This construct is meant to be used as a means of accessing
| > hardware in an uninterruptable fashion without the overhead of a
| > separately declared protected object. This could be accomplished using
| > dynamic priorities, but I think a language specified construct would be
| > more portable and easier to read.
| >
| > ex:
| >
| > begin -- procedure, function, block ...
| >
| > declare protected
| > -- Implied declaration
| > -- pragma priority( System.Any_Priority'last );
| > begin
| > -- process hw access statements atomically.
| > end; -- protected block.
| >
| > end; -- procedure, function, block ...
| >
|

-------------------------------------------------------------------------

At 2002-05-25 17:55 -0400 Saturday, Ted Baker <***@cs.fsu.edu> wrote:
| The proposed construct would be dangerously confusing, because:
|
| 1) Because of the similar keyword to protected objects, people
| are likely to think it is related to a protected operation,
| but it cannot be, because:
|
| 2) It lacks an associated object or other means to specify the other blocks
| with respect to which mutual exclusion required. Such specification
| is necessary if you are going to provide any kind of guaranteed
| mutual exclusion, because:
|
| 3) Priority alone does not guarantee there will be no interleaved
| or parallel (multi-cpu) execution of other similarly protected blocks.
|
| Depending on what you really want, there seem to be two reasonable
| alternative proposals possible:
|
| A) Something we considered in the Ada 9X process as an alternative
| to the current protected objects, e.g., a special lock object.
|
| mylock : Protection (System.Any_Priority'last);
| ...
|
| declare
| protected mylock
| begin
| -- process hw access statements atomically.
| end mylock;
|
| This provides mutual exclusion and all the other semantics of
| protected objects (priority, atc protection). It does not seem
| there should be any huge challenge to implement it, since it
| amounts (more or less) to a protected object with anonymout
| in-line procedures.
|
| B) If you just want the priority effect, without mutual exclusion
| and protection from ATC, then the syntax should spell it out,
| e.g., a pragma
|
| declare
| pragma Priority (System.Any_Priority'last);
| begin
| ...
| end;
|
| --Ted Baker
| .

-------------------------------------------------------------------------

At 2002-06-09 09:27 -0400 Sunday, Robert Dewar wrote:
| > > begin -- procedure, function, block ...
| > >
| > > declare protected
| > > -- Implied declaration
| > > -- pragma priority( System.Any_Priority'last );
| > > begin
| > > -- process hw access statements atomically.
| > > end; -- protected block.
| > >
| > > end; -- procedure, function, block ...
|
| One important aspect of protected operations is that abort is deferred. Since
| Ada 95 (very foolishly in my opinon :-) made abort a first class citizen by
| the introduction of asynchronous transfer of control, all code has to worry
| about being aborted.
|
| It is quite hard work to make stuff safe with respect to abort. For example,
| if you have an in place sort that works with exchanges, and you want the
| sort to be safe from abort in the sense that if an abort occurs, you want
| the data intact, just possibly not sorted yet.
|
| This means that the exchange has to be protected from abort. There is no nice
| way in the language to do this right now. The two tecniques are to introduce
| a protected type, or to do the exchange in a dummy finalization routine.
| Both of these solutions are really heavy and ugly.
|
| In GNAT, we have introduced pragma Abort_Defer to respond to this need, but
| the above proposal would also solve this. Nevertheless I agree with Tuck
| that it is certainly open to serious abuse.
|

-------------------------------------------------------------------------

At 2002-06-09 21:33 +0200 Sunday, Michael Erdmann <***@snafu.de> wrote:
| Tucker Taft wrote:
|
| >An important principle of the protected type is that
...
| >of analysis of potential deadlocks and race conditions
| >much more difficult.
| >
| I guess this feature may makes sense when you have to control external
| hardware, e.g. if you are doing polling for some reason and you want
| to avoid beeing interrupted while your polling loop run. In such a case
| the overhead of declaring a protected type which represents the
| external hardware i some way can be to costly.
| But i am not sure if this rare problem should be handled in the
| language, since this problem could be solved by an extension
| of RM C.3, which does not provide a way to mask off interrupt
| of a certain priority.
|
| The feature makes no sense when you intend to protect data, for this
| purpose protected types are available.
|

-------------------------------------------------------------------------

(The Ada-Comment messages are edited a lot and then archived at
the AIS_REST.ZIP file that is linked to from an 'Issues' page at this
website: http://www.ada-auth.org/ )

I found some Zonnon syntax that shows that there is blocking
BEGIN-END blocks:

http://zonnon.ethz.ch/papers/Zonnon_Syntax_Final_Comments.pdf
(extracted from the Russian text)
-------------------------------------------------------------
BlockStatement = BEGIN [ BlockModifiers ]
StatementSequence
{ ExcHandler }
[ CommonExcHandler ]
END

BlockModifiers =
"{" Ident { "," Ident } "}". // ACTIVE or EXCLUSIVE

Statement = [ Assignment
| ProcedureCall
| IfStatement
| CaseStatement
| WhileStatement
| RepeatStatement
| LoopStatement
| ForStatement
| EXIT
| RETURN [ Expression ]
| BlockStatement ]

StatementSequence = Statement { ";" Statement }
-------------------------------------------------------------

The Ada 95 Annotated Reference Manual part on Protected objects:
http://www.adaic.org/standards/95aarm/html/AA-9-4.html

----

Creating threads isn't. Here is a Zonnon example:
http://zonnon.ethz.ch/ZonnonTestSuite/11_Activities_Behavior_And_Interaction/T01-x.znn.html

-------------------------------------------------------------------------
DEFINITION TALKPARTICIPANT;
ACTIVITY TALK;
(* THE SIMPLEST TALKING PROTOCOL BETWEEN SENDER AND RECEIVER. *)
TYPE { TALK = { INTEGER ?INTEGER }. }.
END TALK;
END TALKPARTICIPANT
...
RECEIVING := NEW RECEIVER.RECEIVING; (* CREATE RECEIVING
ACTIVITY INSTANCE FOR THE OBJECT. *)
-------------------------------------------------------------------------

What is that "?" is inside of that activity ?. At least in Ada 95, the
familiar procedure syntax is reused for the protected objects.
Procedure calls are fast. The protected objects are not instanteous
to get through, with the reevaluating of the barriers as non-global
varables change. Having them conspicuous (and not nested is OK).
Zonnon lacks the equivalent of guards blocking tasks ??.

---

Can Zonnon allow a program to excecute a background task?. In Ada I'd
have a protected object implement a (maybe-multiway) flip-flop. I'd
code up the barrier expression.

I have not got time to understand Zonnon.

Here is an example of what Zonnon might not be able to handle well but
Ada could easily:
A call to a task (thread) can be accepted and examined and then
requeued and parked onto a protected object inside of the task, or
sent back to the same task. An aim is to avoid accepting the callers
procedure parameters and putting them onto a queue since:
* then the caller would be unblocked
* the task can't later raise an exception and cause the caller to
drop out to the nearest exception handler of a begin-end block
* in done differently, then Ada 95 will manage the queue containing
parameters of calling tasks (indifferently onto a task or
protected object)

Though that is an argument for the requeue statement, it can be
replaced with the entry_index (of RM95 9.5.2) (a 2nd parameter list,
that is 1 parameter long).

I searched a Google's domain on [ "ada 95" oberon ethz.ch ] and found
little. About 2 e-mails only since since 1999 matching, though there
are more that are older.

Here is that other Usenet message:

http://groups.google.com/groups?selm=mailman.1041721989.14159.comp.lang.ada%40ada.eu.org

| From: "Robert C. Leif" <rleif-@-rleif.com>
| Newsgroups: comp.lang.ada
| Subject: RE: advantages or disadvantages of ADA over pascal or modula
| Date: Sat, 4 Jan 2003 15:12:39 -0800
| List-Subscribe: <http://ada.eu.org/mailman/listinfo/comp.lang.ada>,
|
|
| To be fair, Ada should be compared to Wirth's latest creation, Oberon.
| Oberon is available as a .NET compiler. While the Ada community has
| talked
| incessantly about writing an operating system, Wirth and Gutknecht did.
| Oberon and its operating system are described in Project Oberon,
| Addison-Wesley ACM Press ISBN 0-201-54428-8. http://www.oberon.ethz.ch/.
| Some of the Oberon software could be translated into Ada.
| Bob Leif
|
| -----Original Message-----
| From: comp.lang.ada-admin-@-ada.eu.org
| [mailto:comp.lang.ada-admin-@-ada.eu.org]
| On Behalf Of Adrian Knoth
| Sent: Friday, January 03, 2003 6:36 PM
| To: comp.lang.ada-@-ada.eu.org
| Subject: Re: advantages or disadvantages of ADA over pascal or modula
|
| karl bowl <karl.bowl-@-gmx.de> wrote:
|
| > I would like to ask anybody to tell me about advantages or
| disadvantages
| of
| > ADA(95) over pascal or modula(2).
|
| Pascal is mainly for learning purpose. Modula-(3) is a successor of
| Pascal, so the properties are similar.
|
| Ada95 (watch the spelling) looks like a Pascal-alike language but is
| not the 7th million ugly language from N. Wirth :)
|
| Ada is one of the clearest, most consequent languages at all, it
| focusses on readability, portability and security. The last fact
| is important. By detecting the maximum of errors at compile-time
| running the program is improved right from the beginning. And even
| at runtime, a lot of checks guarantee you the right result of
| operations, so limiting the amount of surprises.
|
| There was an article about Ada and an Australian satellite some weeks
| ago, you should read it. It clearly states why Ada was used, because
| there is no possibility to reset the computer in space.
|
| And a common joke in language-discussion is that C++-programmers should
| go on debugging while the Ada-programmers have spare time. This is
| because
| if Ada-code compiles it is less buggy than other.
|
| I've done all, Pascal, Ada and Modula. You have a lot limitations in
| Pascal. You have identical limitations in Modula, but Modula is better
| in some cases than Pascal. At least, the PM3-compiler is bad. I've
| found two serious bugs in the P-Modula3-compiler within the first two
| weeksof use and several other bugs afterwards. There are even error
| in the documentation, the runtime-environment and, worst, in the
| implementation of the language definition.
|
| Ada has a widely discussed language definition and compilers are forced
| to it in order to call itself an Ada-compiler. There are some features
| that are COULDs, that's for sure.
|
| With Ada95 you have the power of a well-designed modern language with
| (parallel-)tasking-capabilities, OOP, security and so on. I guess you
| won't miss anything if you're used to Pascal-alike languages.
|
| P.S.: By posting with gmx.de, do you know toh?
|
| --
| mail: adi-@-thur.de http://adi.thur.de/ PGP: v2-key via keyserver


For satellites running GNAT RTEMS Ada, the CPU speeds can be 16 MHz.


-- Craig Carey,
Ada mailing lists: http://www.ijs.co.nz/ada_95.htm
Craig Carey
2004-04-25 07:12:34 UTC
Permalink
A rewritten fragment piece from a private e-mail to Mr Tkachov yesterday:

: There are 2 major Ada compilers:
:
: (1) ObjectAda of www.aonix.com
: It has a limit of 2000 lines so it use useful for explaining error
: messages of GNAT by providing references to the Reference Manual
:
: (2) GNAT of ACT (www.gnat.com)
: Download:
: ftp://ftp.cs.nyu.edu/pub/gnat/
: the Java Ada compiler is faulty.
: the v3.14p Gdb for NT could be preferred over the 3.15p Gdb.
:
: GNAT is also available from http://gcc.gnu.org/ via SSH CVS. I can get
: it using WinCVS 1.3 (could need Cygwin OpenSSH and Minires). To download
: I enter this "command" into the GUI box (with no ASCII 10 at the end):
: cvs -d :ext:***@savannah.gnu.org:/cvsroot/gcc -tz9 checkout -P gcc
:
: ACT's option for a debugger and IDE is GPS: http://libre.act-europe.fr
: Visual Slickedit with Gvd could be better.
:
: Also available from http://www.mingw.org/ (a Gvd 3.15 debugger GUI might
: get used with a GNAT 3.14 Gdb [Cygwin paths not understood bug].
:
: For Linux, the CVS GCC 3.x Ada is just as good (though failing tests as
: reported at the gcc mailing list). It seems to run well. Gdb tends to not
: compile if the public tries it.
:

I found a PDF file explaining the Zonnon does have blocking barriers
in the procedures in objects and in BEGIN-END blocks?.

In procedures of (protected) objects, they can be preceded with
statements, so the compiler has to do guess and execute and then try
another.

-------------
This PDF I found (from a URL I don't have at the moment):

| Active Oberon Language Report, Patrik Reali
| File Active Oberon Language Report, ActiveReport.pdf
...
| 3.3 Synchronization
|
| The built-in procedure AWAIT is used to synchronize an activity with
| a state of the system. AWAIT can take any boolean condition; the
| activity is allowed to continue execution only when condition is
| true.
| ... The conditions inside an object instance are re-evaluated
| whenever some activity leaves a protected block inside the same
| object instance.
|
|
| B.3 Re-entrant Locks
| REENTRANTLOCK* = OBJECT
| VAR
| LOCKEDBY: Ptr;
| DEPTH: LONGINT;
|
| PROCEDURE LOCK*;
| VAR ME: Ptr;
| BEGIN {EXCLUSIVE}
| ME := AOSACTIVE.CURRENTTHREAD();
| AWAIT(((LOCKEDBY = NIL) OR (LOCKEDBY = ME))
| AND Debug_1); -- **
| LOCKEDBY := ME;
| INC(DEPTH)
| END LOCK;
|
| PROCEDURE UNLOCK*;
| BEGIN {EXCLUSIVE}
| Delayed_Here; -- **
| AWAIT(Debug_Constraint_2); -- **
| DEC(DEPTH);
| IF DEPTH = 0 THEN LOCKEDBY := NIL END
| END UNLOCK;
|
| END REENTRANTLOCK;

Comment:

* Still no trailing semicolon in Oberon on the final lines.

* Why is there a semicolon instead of an "is" at the end of the
procedure lines. What follows those procedure lines is the body that
the procedure owns. What was the designer of Oberon thinking of when
(and when) when making a ";" denote ownership ?.

* No error indication if the number of unlocks exceeds the number of
locks. In Ada, the "Depth" would tend to be of type Natural instead
of type Integer. It is surprising to see the check missing.

* Due to the lack of comments in '3.3' of the ActiveReport.pdf
document, it seems that Zonnon may make an arbitrary decision on
whether to start UNLOCK or LOCK. Both of them do not make their first
line be that "AWAIT" barrier.

I would not call that mutual exclusion: above the Oberon compiler can
proceed somewhat into any one of the mutually exclusive procedures,
before deciding it had selected the wrong procedure.

In Ada 95 the barrier is right at the start of the procedure. (There is
a *.hlp reference in Adagide of the A# URL earlier in the thread).

Here is what could perghaps occur: Suppose the exclusive Zonnon object
is inside of a record that is on the heap. Suppose tasks (threads)
were queuing on it, and suppose the object got deallocated while
queues still existed, and maybe callers were terminated and dropped
from the queue.

Suppose the AWAIT statements were deep inside of the procedure (which
does not happen in Ada 95).

Then the deallocating of the Zonnon protected object could occur while
inside of nested BEGIN-END exception handling blocks. Some deallocating
may be needed.

THere might not be a good reason for that. Certainly Zonnon shows that
the design is possible.

The compiler has to guess on the procedure and then execute code,
and then find out if the guess is wrong. No reason for it to not
get 8 guesses all wrong in a sequence.

I assume there is no reason for that. The reason for that design
would include the problems Ada 95 programmers had, and I had not seen
problems (with putting the barrier at the start).

Can someone post up the documents of the Zonnon designer's reasoning?.

It does not like Zonnon is devising a design that would be easy to
analyze using program correctness proving software. Increasingly the
Internet is displaying webpages on proving the correctness of
computer programs; e.g. at the website of IRISA making languages for
Airbus planes and nuclear power plants:
http://www.irisa.fr/accueil/projets/index-eng.htm
Post by Craig Carey
Post by WLad
Post by Craig Carey
I see that Zonnon was not really offering new and major improvements
to Oberon.
At first I guess you didn't even read any doc devoted Zonnon.
...
A specific problem?.
Post by Craig Carey
Though that is an argument for the requeue statement, it can be
replaced with the entry_index (of RM95 9.5.2) (a 2nd parameter list,
that is 1 parameter long).
I had there refered to Ada 95 Annotated Reference Manual 9.5.2(2),
which shows this:

| accept entry_direct_name [(entry_index)] parameter_profile [do
| handled_sequence_of_statements
| end [entry_identifier]];

That is an accept that is inside of a task [thread thing].
A requeue statement might be in a select statement inside of a loop
inside of a task. Requeing onto another select statement entry in the
family fixes the problem of sending the first caller to the end of
the list when only 1 caller is queued.

--

Here is a checkkup item for Zonnon advocates:

In Ada 95, two threads can be locked together by putting code into the
accept statement (inside of a task). E.g.:
----------------------------------------------------------
loop
select
accept Xyz (B : Boolean) do
Allocate a new task onto the heap, etc.
Maybe raise an exception, e.g. if memory error.
Local_B := B;
end X seq_of_statements; end Xyz;
Accept_Num := 1;
or
----------------------------------------------------------

The Zonnon nested AWAIT lines do not have a matching "END" so they
are so sereiously crippled that maybe it could be better to delete
that from the syntax.

I

...
Post by Craig Carey
-- Craig Carey,
Zonnon, described as a language for some of Russia (which seems to be
wrong):

http://ftkachov.home.cern.ch/ftkachov/
Craig Carey
2004-04-25 13:21:22 UTC
Permalink
Advocacy of Oberon is restricted to the Blackbox which is not
free for non-commercial research uses. However it appears to be free for
schools. Advocacy of Oberon in Russia, seems (to me) to be constrained.

he Darkbox project at sourceforge seems to have 0 uploaded files and
about no messages.

On Sun, 25 Apr 2004 19:12:34 +1200, Craig Carey wrote:
...
Post by Craig Carey
Zonnon, described as a language for some of Russia (which seems to be
http://ftkachov.home.cern.ch/ftkachov/
That is not the best URL. This is better:

http://babelfish.altavista.com/babelfish/trurl_pagecontent?url=
http%3A%2F%2Fwww.inr.ac.ru%2F%7Einfo21%2Fwelcome.html&lp=ru_en

The word "zonnon" is missing from the 1.66MB Russian/Swiss website
at http://www.inr.ac.ru/~info21/welcome.html
(It says that Blackbox Oberon can be used by Russian schools, perhaps
by physics students).

Also, here is the information on that (uninteresting) Professional
Russification package.

The zip file contains some encoded files that go into the Blackbox
compiler directory:

http://www.inr.ac.ru/~ftkachov/rsrc/info21/info21pro.zip (mentioned on:)

http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=ru_en&url=
http%3a%2f%2fwww.inr.ac.ru%2f%7einfo21%2finstall%2frusifikacyja2.htm

To quote from the webpage (I would have deleted this):

| The project Of oberon has a powerful effect on the world industry of
| the programming: it is outlined in mega-project Java and .NET of
| corporations Sun and Microsoft (in Sun were studied the codes Of
| Oberon as early as 1991, long before declaration of Java, and
| the essential characteristic languages Java and C# [are] nearer to
| Oberon than to its syntactic predecessors). This makes it possible to
| speak about the formation under the effect of Oberon of [on?] the standard
| paradigm of programming.


Selected Russian language Ada websites:
http://vagul.chat.ru/
http://groups.yahoo.com/group/ada_ru/messages
http://www.ada-ru.org/

-- Craig Carey
WLad
2004-04-26 11:35:44 UTC
Permalink
Post by Craig Carey
Advocacy of Oberon is restricted to the Blackbox which is not
free for non-commercial research uses. However it appears to be free for
schools. Advocacy of Oberon in Russia, seems (to me) to be constrained.
When I say "Oberon", I mean all family.
As I can see last actions, Active Oberon and Zonnon became two main
things at ETHZ. First is used in embeded systems, second - Win32 apps
and some implementation is planned (for example for QNX).
Post by Craig Carey
he Darkbox project at sourceforge seems to have 0 uploaded files and
about no messages.
It iniative of private person. As you can imagine most of us has
responsibilities at our main work...
Post by Craig Carey
Post by Craig Carey
Zonnon, described as a language for some of Russia (which seems to be
http://ftkachov.home.cern.ch/ftkachov/
http://babelfish.altavista.com/babelfish/trurl_pagecontent?url=
http%3A%2F%2Fwww.inr.ac.ru%2F%7Einfo21%2Fwelcome.html&lp=ru_en
Especially translation of names at
http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=ru_en&url=http%3a%2f%2fwww.inr.ac.ru%2f%7einfo21%2finfo%2fkoordinatory.htm
:o)))))))))))))))))))))))))
I was transformed not only into MOOSE, but at my work I became MOOSE
EXPLOSIVE!!! Be careful!!! :o))))))))
Post by Craig Carey
The word "zonnon" is missing from the 1.66MB Russian/Swiss website
at http://www.inr.ac.ru/~info21/welcome.html
(It says that Blackbox Oberon can be used by Russian schools, perhaps
by physics students).
Of course you are assured that newcomers have to begin from C... And we
will get yet another generation having brains distorted... ;o)
Post by Craig Carey
Also, here is the information on that (uninteresting) Professional
Russification package.
I think for Russians it is not so "uninteresting"... :o)
Post by Craig Carey
http://vagul.chat.ru/
http://groups.yahoo.com/group/ada_ru/messages
http://www.ada-ru.org/
The last one specaially placed a refference to my article about Ada, AO
& Z... :o)
WLad
2004-04-26 10:25:47 UTC
Permalink
Post by Craig Carey
I found a PDF file explaining the Zonnon does have blocking barriers
in the procedures in objects and in BEGIN-END blocks?.
In procedures of (protected) objects, they can be preceded with
statements, so the compiler has to do guess and execute and then try
another.
May be I do not able to understand your English right.
What do you mean "the compiler has to do guess and execute and then try
another."???
Post by Craig Carey
* Still no trailing semicolon in Oberon on the final lines.
And what?
Post by Craig Carey
* Why is there a semicolon instead of an "is" at the end of the
procedure lines.
Design decision.
Post by Craig Carey
What follows those procedure lines is the body that
the procedure owns. What was the designer of Oberon thinking of when
(and when) when making a ";" denote ownership ?.
Ask Gutknecht or Zueff why ";" never means "ownership". :o)
Post by Craig Carey
* No error indication if the number of unlocks exceeds the number of
locks.
You have your own regulations for an alien cloister? (when in Rome, do
as the Romans do).
As I can see you even do not understand the "nature" and "roots" of
AWAIT and EXCLUSIVE blocks in Active Oberon and Zonnon and even try to
argue about "disadvatages" of them... :o))))
I already said you that in Zonnon old "mechanisms" of multitasking mean
almost nothing.
In Zonnon we DO NOT MODEL the sound of a river! We go further and deeper
- we BUILD riverbed. Due to this riverbed the river itself IS secondary
(with its sound of stream and brightness of the sun on the water).
Post by Craig Carey
In Ada, the "Depth" would tend to be of type Natural instead
of type Integer. It is surprising to see the check missing.
Check missing of what? From the time of Oberon we have runtime checking
(switchable off) of all operations over all "natural" types...
Post by Craig Carey
* Due to the lack of comments in '3.3' of the ActiveReport.pdf
document, it seems that Zonnon may make an arbitrary decision on
whether to start UNLOCK or LOCK. Both of them do not make their first
line be that "AWAIT" barrier.
Of course if any condition is not TRUE - your thread will be blocked.
What did frighten you? Please explain what do you mean saing "Both of
them do not make their first line be that "AWAIT" barrier"?
Post by Craig Carey
I would not call that mutual exclusion: above the Oberon compiler can
proceed somewhat into any one of the mutually exclusive procedures,
before deciding it had selected the wrong procedure.
?????????
Post by Craig Carey
In Ada 95 the barrier is right at the start of the procedure. (There is
a *.hlp reference in Adagide of the A# URL earlier in the thread).
OK. And what if I must wait any condition not only at the begining of
"procedure"? Just due to design of my system...
Post by Craig Carey
Here is what could perghaps occur: Suppose the exclusive Zonnon object
is inside of a record that is on the heap. Suppose tasks (threads)
were queuing on it, and suppose the object got deallocated while
queues still existed, and maybe callers were terminated and dropped
from the queue.
Read about such cases in dissertation of Peter Muller. These are the basics.
Post by Craig Carey
Suppose the AWAIT statements were deep inside of the procedure (which
does not happen in Ada 95).
What depth? :o)
Post by Craig Carey
Then the deallocating of the Zonnon protected object could occur while
inside of nested BEGIN-END exception handling blocks. Some deallocating
may be needed.
What does it mean "protected" object? For Zonnon.
Deallocationg COULDN'T occur while one refference to object exists.
Post by Craig Carey
The compiler has to guess on the procedure and then execute code,
and then find out if the guess is wrong. No reason for it to not
get 8 guesses all wrong in a sequence.
The compiler DOES NOT guess. The checking of condition (AWAIT) is done
at the exit of EXCLUSIVE block (where this condition is resided).
Post by Craig Carey
I assume there is no reason for that. The reason for that design
would include the problems Ada 95 programmers had, and I had not seen
problems (with putting the barrier at the start).
The main problems is hardship of old approach for new ideology
implementations.
I repeat once more: Do not think about processes and threads. They ARE
NOT first class citizens in Active Oberon and Zonnon. Think about ACTIVE
(COOPERATING) ENTITIES. Processes and threads appears DUE TO active
objects collaborating, but not contrary! The typical old approach is to
create such objects as "processes", "threads", "mutexes", "locks" and so
on. But using such approach (as I said earlier) you try to model sound
of scream, but not throat itself... :o))))))
Post by Craig Carey
Can someone post up the documents of the Zonnon designer's reasoning?.
Look at http://www.zonnon.ethz.ch
Post by Craig Carey
It does not like Zonnon is devising a design that would be easy to
analyze using program correctness proving software. Increasingly the
Internet is displaying webpages on proving the correctness of
computer programs; e.g. at the website of IRISA making languages for
http://www.irisa.fr/accueil/projets/index-eng.htm
OF COURSE!!!
It is something different. Including new features in the languages,
desiners tried (and try) to advance AO & Z to lenguages of designing
systems not only coding.
And yet one thing. Instrument used exerts influence on programmers. And
they begin not too implement system desin decisions in languages, but
contrary - they truncate the problem because of features and approaches
offered by a language. In real life we think about things and
interractions between them secondary. Actions do not appear themselves
from nothing. Actions ("processes" and "threads") ARE result of schemes
of involving different objects in a common work.

Regards
Craig Carey
2004-04-26 20:07:43 UTC
Permalink
Post by WLad
Of course if any condition is not TRUE - your thread will be blocked.
What did frighten you? Please explain what do you mean saing "Both of
them do not make their first line be that "AWAIT" barrier"?
That contains the word "thread". In Ada the word "thread" really can
be always avoided unless describing something beneath Ada code. Here is
some text you wrote:

| This is not yet one "multitasking features -> objects" BUT "objects
| -> multitasking". That is at Active Oberon and Zonnon we can see not
| just another attempt to express "processes", "threads", "semaphores",
| "locks" and other multitasking trumpery through objects!

Why don't you use the Ada terminonolgy instead of saying you do not
recognize "protected object", ?.
Post by WLad
OK. And what if I must wait any condition not only at the begining of
"procedure"? Just due to design of my system...
Ada is looking more complex. Whatever can be done in Zonnon can be done
in Ada since Zonnon language that possibly hasn't got it all.

Here is some made up code that would pause for 6 seconds:
--------------------------------------------------
Record_Of_Task.Zombie.How_Blocked := eBlocked_By_Delay;
select
-- Hang on protected object barrier until Unix Ctrl-C signal
Low_Level.OS_Exit_Mngr.Delay_Until_Program_Abort;
raise OS_Exit_Exception; -- Some other task is doing a shutdown
or
delay 6.0;
end select;
--------------------------------------------------

That could be an Ada 95 version of the Zonnon AWAIT statement inside of
begin-end blocks.

The equivalent code in Zonnon would show that Zonnon AWAIT delaying
forever, statements, can be unblocked. Linux plus Ada can't always shoot
threads out of memory, and so the language must be able to unblock all
of its blocking statements. Can you say how Zonnon allows that?.
Post by WLad
[...] Please explain what do you mean saying "Both of
them do not make their first line be that "AWAIT" barrier"?
It seems that the Zonnon designers are guided by the appearance of the
[ugly] textual syntax.
Zonnon has a major problem if those ACTIVE statements can go anywhere
and make the automated proving of the absence of deadlocks, difficult,
and there is little inconvenience to programmers to have a more
disciplined design. If it is a university project then the topic of
correctness is of great interest to designers (rather than, extrapolating
from the inferior syntax of Oberon) and if not a university programme
then there could be a lot of public involvement with the designers
answering questions about the reasoning is over facilitating the proving
of the correctness of Zonnon programs.
Post by WLad
Post by Craig Carey
I would not call that mutual exclusion: above the Oberon compiler can
proceed somewhat into any one of the mutually exclusive procedures,
before deciding it had selected the wrong procedure.
?????????
You need to understand when an ACTIVE line is the 1st line of a procedure
or not.
Post by WLad
What does it mean "protected" object? For Zonnon.
Deallocationg COULDN'T occur while one refference to object exists.
In Ada objects always get deallocated as expected. For tasks, the
deallocating would be delayed by user code until T.all'Terminated is
True (otherwise a memory leak occurs). Ada is does not count references
to allocated records.
Post by WLad
Post by Craig Carey
is inside of a record that is on the heap. Suppose tasks (threads)
were queuing on it, and suppose the object got deallocated while
queues still existed, and maybe callers were terminated and dropped
from the queue.
Read about such cases in dissertation of Peter Muller. These are the basics.
Please provide a reference if still of interest.
Post by WLad
Post by Craig Carey
The compiler has to guess on the procedure and then execute code,
and then find out if the guess is wrong. No reason for it to not
get 8 guesses all wrong in a sequence.
The compiler DOES NOT guess. The checking of condition (AWAIT) is done
at the exit of EXCLUSIVE block (where this condition is resided).
If AWAIT statements are not the first line of protected procedures
then the procedure parameters had been read instead of existing in an
entry queue. It could be that Zonnon lacks "entries" inside of its
protected objects. Here some text from the Ada Annotated Reference
Manual:

| AARM95 9.5.3(17): {entry queuing policy} ... The default entry queuing
| policy is to select calls on a given entry queue in order of arrival.
| If calls from two or more queues are simultaneously eligible for
| selection, the default entry queuing policy does not specify which
| queue is serviced first. Other entry queuing policies can be specified
| by pragmas (see D.4).


---
On Mon, 26 Apr 2004 13:25:47 +0300, WLad <***@hotmail.com> wrote:
...
Post by WLad
interractions between them secondary. Actions do not appear themselves
from nothing. Actions ("processes" and "threads") ARE result of schemes
of involving different objects in a common work.
Writing on how Zonnon allows actions, is not actually advocating Zonnon
since it seems to have too few features allowing threads to be stalled
and stopped. The AWAIT statement is a bit cute: perhaps it could be
a simple subroutine call. But in Ada the viewpoint of the other procedure
being held up is not overlooked.

I now view it as a language that is designed to make the AWAIT statement
easy to use in the hope that persons can then write programs.

What was the rationale for this ugly curly bracket syntax ? (it is not
there to be consistent with earlier languages):

BEGIN { ACTIVE }
X := 1; (* -- Was swapped with next *)
IO.PutL ("! Pascal design bug: nary can compile since semicolon:");
END

Some of the Ada 95 AARM is quoted (my copied text marked by "<<..>>"):

Annotated Reference Manual 95 (online at http://www.ada-auth.org/ )
| D.4 Entry Queuing Policies
...
| (10/1): {<<Defect Report 8652/0075, Qualifier - Error; Priority changes
| in abortable part; Ref - AI95-00205>>...} After a call is first queued,
| changes to the active priority of a task do not affect the priority of
| the call, unless the base priority of the task is set while the task is
| blocked on an entry call.
|
| (11): When the base priority of a task is set (see D.5), if the task is
| blocked on an entry call, and the call is queued, the priority of the
| call is updated to the new active priority of the calling task. This
| causes the call to be removed from and then reinserted in the queue at
| the new active priority.

Is it true that objects do not deallocate in Zonnon if references to
them exist?. Hidden references ?, and hidden slow lockouts of tasks,
etc. (?).


Craig Carey

Sample Ada URL: http://www.adapower.com/
Craig Carey
2004-04-26 20:50:07 UTC
Permalink
The Zonnon project has this aim:

Getting Zonnon designed appropriately so that it
"Maps naturally to the .net framework."

That is said here: http://www.zonnon.ethz.ch/projectGoals.html

Ada seems to map onto .NET so *all* features of Ada would be an option
for the Zonnon language theorists designing the language:

The Ada 95 A# ada to .NET project:
http://www.usafa.af.mil/dfcs/bios/mcc_html/a_sharp.html

The aims of Zonnon are a bit biased as if the aim was to modify an
existing Oberon compiler. It is in Switzerland and I can't comment on
their university projects.


On Mon, 26 Apr 2004 13:25:47 +0300, WLad <***@hotmail.com> wrote:
| It seems that the Zonnon designers are guided by the appearance of the
| [ugly] textual syntax.

Correction: that should have been deleted. I meant putting EXCLUSIVE
inside curly brackets.

PS. What exactly would a Zonnon BEGIN-END block be excluding when not
getting contacted by other threads ?. It is probably something I missed.

...
| [...] If it is a university project then the topic of
| correctness is of great interest to designers (rather than, extrapolating
| from the inferior syntax of Oberon) and if not a university programme
| then there could be a lot of public involvement with the designers

being asked to debug/improve the language.
Delete these two:

| answering questions about the reasoning is over facilitating the proving
| of the correctness of Zonnon programs.

Loading...