comp.lang.ada
 help / color / mirror / Atom feed
From: "Ekkehard Morgenstern" <ekkehard.morgenstern@onlinehome.de>
Subject: Re: [announcement] SYSAPI and SYSSVC for Windows
Date: Sat, 20 Dec 2003 02:17:20 +0100
Date: 2003-12-20T02:17:20+01:00	[thread overview]
Message-ID: <bs08rt$16h$1@online.de> (raw)
In-Reply-To: 1071852533.241196@master.nyc.kbcfp.com


"Hyman Rosen" <hyrosen@mail.com> wrote:
>      struct also_uncopyable
>      {
>          uncopyable u;
>      };

That's a really good idea! I haven't thought of that yet! 
(*hides in shame*) ;)

If "uncopyable" has zero members, it doesn't even affect structure 
layout. :)

> False. Using the following idiom, no class can be derived from Joe.
>      class JoeF { friend class Joe; JoeF() { } };
>      class Joe : virtual JoeF { ... };

OK. Noted! :)

> > I used this since 1995, and called it "AutoPointer". It is still wrong
> > to omit the declaration of a copy constructor or copy assignment,
> > because someone could try to copy or assign the object being pointed to.
> 
> Huh? If you omit declaring your own, you get the language-specified
> default ones, and then attempts to use them will cause compilation
> errors, just as you want. Perhaps you have an example which you think
> demonstrates the issue?

Yeah, say, you have hundreds of classes that use pointers. 

Like,

    class X {
        A*     a;
        B*     b;
        C*     c;
        ...
    };

If the object needs to be copied, then you have to provide a copy 
constructor and copy assignment, right?

This is something that is elegantly solved in Ada with the access type.
You simply assign and Ada keeps track of the reference.

In C++, you either have to have your own reference counting scheme,
or do a full copy of all enclosed objects.

Or are there other ways to do that that I'm unaware of?

> > Work over work over work that really need not be.
> 
> I don't see it. Perhaps you have examples?

Like, the one I mentioned before. Don't you agree that with Ada access 
types, you have much less overhead than with C++?

> Those objects should be held by smart pointers, and only the
> smart pointers need to implement the assignment operator and
> copy constructor. The holding classes will then use these
> operations without having to mention them explicitly.

But if all your classes depend on pointers, then you have to write
copy assignment and copy constructor for all of your classes,
no matter whether you use smart pointers.

> > String literal template parameters could be very useful, for example.
> > And floating-point template parameters as well, for numerics, for example.
> 
> There's no argument that they can be useful, but the restrictions
> are not "nonsensical". There are valid reasons for them, even if
> it's possible to envision the restrictions being lifted.

For not permitting string literals or floating-point values in
templates, there's no excuse, really.

These values are not uncomparable per se, a distinct string constant
or a distinct floating-point value is still distinct.

In many compilers, template instantiation identifiers are strings
anyway, so that should really be no problem.

Ada for example permits variant records on those kinds of values, right? :)

> > And template classes CAN have virtual methods, or are you referring
> > to something else?
> 
> Template methods of a class cannot be virtual.

What is a "template method of a class" for you?

Something like

    class X {

        template <int a, int b> void func( ... );
    };

?
 
> > I haven't tried with Ada yet, but in C++, it seems nonsensical to 
> > disallow skipping a declaration block with goto, especially since you 
> > can simulate it using break / continue, where it works!!
> 
> I don't know what you think you can do, but you are wrong.
> You cannot ever bypass the initialization of objects in a
> scope, except by bypassing that scope entirely. Care to post
> examples?

That's true. Break and Continue bypass _entire_ scopes. 

As in

    while (1) {
        int a = 5, b = 6;
        if ( cond ) break;
        int c = a + b;
        ...
    }
 
> > Going over an object instantiation could be implemented very easily
> > by calling the initialization block(s) being skipped first, and then
> > jumping to the target location. That's a no-brainer, really, requiring
> > only little extra code in the compiler.
> 
> No, because declarations can appear anywhere in a block,
> and initialization can therefore depend on other things
> computed earlier.

Yeah, now I can see what you mean.

Something like:

    while (1) {
        int a = 5, b = 6;
        if ( cond ) goto L;
        extern void prepare( int&, int& );
        prepare( a, b );
        int c = a + b;
    L:  func( c );
    }

In this case, "goto" would skip both the "prepare" call and the 
computation of "c".

But what about all the other cases in which that doesn't happen?

Like in:

    while (1) {
        int a = 5, b = 6;
        if ( cond ) goto L;
        int c = a + b;
        if ( c == 4711 ) break;
    L:  int d = b + 9;
        func( d );
    }

In this case, skipping the "c" computation block entirely wouldn't
matter at all. But still, C++ doesn't allow it.

Since the compiler knows the source code, it could decide on
an individual basis whether goto was legal.

Or there could be rules on how to handle the goto in such a case.
Like, all declarations are moved to the beginning of the scope
by the compiler if a goto is used inside a scope block. 

Or some other rule.

> > Your latter statement is true for the core task switching kernel only.
> > For all other parts of the OS, using the concurrency features of Ada
> > can be beneficial.
> 
> I anxiously await AdaOS which will demonstrate this.

Well, if I complete mine, it'll not be the only one! :)
 
> > I'll write an Ada compiler
> 
> Yeah, you and Nick Roberts. Your vaporware does not constitute
> evidence in the debate of programming language suitability.
> 
> In the New York City subway system there's currently a sequence of
> ads running for the School of Visual Arts making fun of people who
> say things like "Is his art better than the stuff I'm always talking
> about doing?" and "She's much too prolific to be any good."

LOL!! :)

It's true, my Ada compiler is still vaporware. But I've written
some compilers already for other languages, so it's not entirely ruled
out. :)

I've also written various compiler-compiler toolkits, and I plan to
use one of these or a new Ada one for my new Ada compiler.

(I think writing my own will be quicker than making an existing one
do what I want)

My Ada development-system will have its own database engine and hence
project management will be a piece of cake. Plus, it will probably be
freeware or shareware or open-source.

> Windows, Unix, and Linux are all wildly successful operating systems
> and are written in C and C++. I disregard all claims that Ada can do
> as well or better until I actually see an operating system written in
> Ada doing as well or better.

The programming language isn't what matters. All that matters is the
OS concept itself, whether it will be successful.

Since my project (DELOS) is only my own endeavour so far, I don't think
it'll have any impact on the software industry. For what it's worth,
even if it's just satisfying my own curiousity and ideas, it might 
serve as an example on how to implement such a system.

If it takes me another couple of years, the software industry will
have overtaken me anyway (unless of course I continue updating its
design).

> > In fact, I learnt about Ada only a couple of weeks ago. Before that,
> > I wanted to create my own programming language for my OS, and then
> > I realized that Ada 95 provides exactly what I wanted. :)
> 
> Sigh.

Well, you'd be surprised how fast I learn. ;)

I bought the book "Programming in Ada 95" (2nd ed.) by Barnes,
and it arrived a couple of days ago, and I'll have to do a lot of 
reading. It's a marvellous book btw, ideal for people like me who
want to get an in-depth look at Ada. :)

I had already designed my own language(s) with constrained data types
and stuff. But if Ada works for my project, I don't need a different
language, and Ada is well-known already.

Some of Ada's concepts seemed weird to me at first, but they do
indeed make sense after you let them seep in deeply enough. ;)

Perhaps I'll ask those AdaOS guys what they're doing, perhaps we
can combine our concepts. :)





  parent reply	other threads:[~2003-12-20  1:17 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-17 19:17 [announcement] SYSAPI and SYSSVC for Windows amado.alves
2003-12-17 19:56 ` Georg Bauhaus
2003-12-18  9:08 ` Dmitry A. Kazakov
2003-12-18 12:14   ` Ekkehard Morgenstern
2003-12-18 13:31     ` Georg Bauhaus
2003-12-19 10:45       ` Ekkehard Morgenstern
2003-12-19 17:12         ` Georg Bauhaus
2003-12-19 17:22           ` Vinzent 'Gadget' Hoefler
2003-12-20  0:21           ` Ekkehard Morgenstern
2003-12-20  2:18             ` Georg Bauhaus
2003-12-20  4:40               ` Ekkehard Morgenstern
2003-12-21  3:45                 ` Georg Bauhaus
2003-12-21 19:01                   ` Piracy was " Robert I. Eachus
2003-12-18 14:32     ` Dmitry A. Kazakov
2003-12-19 11:11       ` Ekkehard Morgenstern
2003-12-19 15:15         ` Hyman Rosen
2003-12-19 15:50           ` Ekkehard Morgenstern
2003-12-19 16:48             ` Hyman Rosen
2003-12-19 16:57               ` Hyman Rosen
2003-12-20  1:17               ` Ekkehard Morgenstern [this message]
2003-12-21  2:19                 ` Hyman Rosen
2003-12-21 10:34                   ` Ekkehard Morgenstern
2003-12-22  9:02                     ` Hyman Rosen
2003-12-22 15:17                       ` Ekkehard Morgenstern
2003-12-22 15:08                     ` Hyman Rosen
2003-12-22 15:31                       ` Ekkehard Morgenstern
2003-12-22 16:35                         ` Ekkehard Morgenstern
2003-12-23  1:47                           ` Hyman Rosen
2003-12-23  8:40                             ` Ekkehard Morgenstern
2003-12-23  9:05                               ` Stephen Leake
2003-12-19 17:06         ` Dmitry A. Kazakov
2003-12-20  1:49           ` Ekkehard Morgenstern
2003-12-20 11:13             ` Dmitry A. Kazakov
2003-12-20 13:40               ` Ekkehard Morgenstern
2003-12-20 17:21                 ` Dmitry A. Kazakov
2003-12-20 19:52                   ` Ekkehard Morgenstern
2003-12-21  4:24                     ` Georg Bauhaus
2003-12-21 13:42                     ` Dmitry A. Kazakov
2003-12-21 15:48                       ` Ekkehard Morgenstern
2003-12-21 17:46                         ` Michal Morawski
2003-12-21 18:05                           ` Ekkehard Morgenstern
2003-12-22  0:50                             ` Robert I. Eachus
2003-12-23 23:02                       ` Robert A Duff
2003-12-24 11:20                         ` Dmitry A. Kazakov
2003-12-24 16:57                           ` Robert A Duff
2003-12-25 14:00                             ` Dmitry A. Kazakov
2003-12-28  1:49                       ` Dave Thompson
  -- strict thread matches above, loose matches on Subject: below --
2003-12-15 14:18 Ekkehard Morgenstern
2003-12-15 15:10 ` Ekkehard Morgenstern
2003-12-15 17:10 ` Jeffrey Carter
2003-12-15 18:38   ` Ekkehard Morgenstern
2003-12-16  0:25     ` Stephen Leake
2003-12-16  0:56       ` Ekkehard Morgenstern
2003-12-16  2:47         ` Ludovic Brenta
2003-12-16 17:45           ` Ekkehard Morgenstern
2003-12-16 19:54             ` Ludovic Brenta
2003-12-16 22:09               ` Ekkehard Morgenstern
2003-12-17 15:24                 ` Ludovic Brenta
2003-12-17 23:23                   ` Ekkehard Morgenstern
2003-12-19 18:14                   ` Warren W. Gay VE3WWG
2003-12-16  5:36         ` tmoran
2003-12-16 17:30           ` Ekkehard Morgenstern
2003-12-15 20:44 ` David Marceau
2003-12-16  0:34   ` Ekkehard Morgenstern
2003-12-17 12:05 ` Dmitry A. Kazakov
2003-12-17 15:00   ` Ekkehard Morgenstern
2003-12-20 19:24 ` Ekkehard Morgenstern
replies disabled

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