comp.lang.ada
 help / color / mirror / Atom feed
From: "Ekkehard Morgenstern" <ekkehard.morgenstern@onlinehome.de>
Subject: Re: [announcement] SYSAPI and SYSSVC for Windows
Date: Sun, 21 Dec 2003 11:34:39 +0100
Date: 2003-12-21T11:34:39+01:00	[thread overview]
Message-ID: <bs3t1u$tkn$1@online.de> (raw)
In-Reply-To: br7Fb.2922$eE3.2907@nwrdny03.gnilink.net


"Hyman Rosen" <hyrosen@mail.com> wrote:
> "hundreds of classes that use pointers" doesn't just happen,
> someone bad was responsible for creating them.

Some concepts require the use of pointers, such as linked lists,
and pointers to instances of objects.

That's not a bad design to create a pointer to a instance of an object.
It's a perfectly normal C++ way of programming.

I don't know what kind of programs you deal with, but you seem
somehow detached from the real world of programming.

> Say what? An access type is a pointer, nothing more. Ada doesn't keep
> track of anything! (Well, if the storage pool goes out of scope, or
> soemthing like that, I think Ada frees all the memory in the pool, but
> I don't think that's what you're talking about.)

Well, some documents say that access types can be garbage collected by
the runtime system.

> Your classes should not depend upon pointers (unless none of them own
> the memory, so that simply copying the pointer is OK).

That's not true. When a pointer points to an object that has been
allocated away from those classes, and the memory associated with it
disappears gets returned to the free pool, then the pointer is invalid
too. Copying a pointer value is about the worst thing you can do, 
unless you know exactly what you're doing.

> If an object owns the memory that its member pointer is addressing, 
> then the pointer should be wrapped up in a smart pointer that will 
> orchestrate the copying policy. 

> Then the class containing that smart pointer doesn't need a
> copy constructor or assignment operator to be user-written. 

That really depends on what kind of class you're dealing with.
Not all pointers can be held in smart pointers, nor be copied.

> The compiler-
> generated one will work properly. And you don't have to write your own
> smart pointers. Just go to Boost and use one of theirs.

As if that would be a major software-engineering task.
 
> Template parameters can be expressions. Allowing floating point
> parameters would require discussing the issue of whether x<1.0>
> and x<1.0/3.0 + 1.0/3.0 + 1.0/3.0> are the same type or not. 

They're not the same. The value might be the same, but it depends
on floating-point accuracy. But to prevent such problems, one
could postulate they aren't the same.

The compiler would simply take those parameters as a string literal,
(which most compilers do for constants in templates anyway).

> Template parameters which are addresses are supposed to be of
> objects with external linkage, which string literals are not.
> Instead of x<"joe"> you can do char joe[] = "joe"; x<joe>;

A string literal becomes an address only in the code generation
phase of the compiler.

For the compiler, it doesn't matter if a string literal is
postulated to be taken literally into the template type signature.

If a programmer would instantiate a template on a pointer then,
the compiler could complain that this special case would imply
using string literals.

> Think of what you're asking - you want people to devote time to
> complicated rules about when jumping into the middle of a scope
> is legal. If you push them enough, they would just outlaw it
> altogether!

There are cases in which gotos into the middle of some context
would be useful.

Sometimes the clarity of code can suffer if the programmer is 
forced to write a work-around for something like that.

That's what programming constructs are for: ease programming.

> > 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.
> 
> Well, there's already a free-software Ada compiler. Why don't you just
> use it as a base for your work instead of trying to recreate all the
> knowledge that has gone into making it what it is? 

GNAT is based on the GNU Compiler Collection, which in turn depends on
a lot of libraries. If I want an Ada compiler that generates code for my
own virtual machine, I would have to port and modify them all.

This would definitely take more time (understanding all that code,
plus modifying and porting it), than writing an all-new compiler.

I like writing compilers and so that will not be a major effort for me.

> A fundamental mistake
> made by many programmers is to believe that they can "do it better". 

Sometimes they can, it depends on the programmer. I often reinvent the
wheel and get better, smaller, faster, and more reliable results.

That's what programming's all about: creating software.

> They
> fail to realize that an existing system may be large and complicated
> because it has been modified to handle complex issues and problems that
> they do not know about. 

A software that is large and complicated oftentimes is not good software. 
Seemingly complex issues can often be simplified greatly when you 
re-think and rework your concepts and designs.

Many algorithms are like "from the back thru the chest into the eye",
unnecessarily complicated, because the programmer used only existing
algorithms that are not feasible for the problem at hand, or because
s/he couldn't think of a better one.

> It's like evolution. The process of modifying
> software breeds instincts and behavior into the code which represents
> internalized and implicit knowledge of the world. A new project won't
> have that.

Can I quote you on that? ;)

I'm in favour of extreme programming: Something doesn't work, throw it
away, redesign it, rewrite it, recode it. Interestingly, you get a 
better concept every time you do that. Plus, you learn not to cling to
your code as if your life would depend on it. 

In practice, there are often projects you invest a lot of time into,
and then they're thrown away. If you're an extreme programmer, then
you do not only don't care about whether the code is actually used,
but you invest as little time as possible.

Often, when I cannot write something (like a small program or 
component) in two days, I know the concept might be wrong. 

Programming is a form of creative expression and as such subject to
the creative process.

Sometimes you have a great idea and then bam, you write the code 
for it, and it's all good. 

Some ideas evolve over years or decades before they can flow into
a tangible project.
 
> What you will need to do most of all is to start with small projects
> which immediately work and do something useful. If you begin with anything
> huge you will never complete it.

For me that really doesn't matter anymore. I've been programming for,
well, 22 years now (and I began when I was 11).

Like, a compiler might be huge for you, but for me it's just medium-scale.

My OS project is huge, but I'll find a way not only to encapsulate
the hierarchies for it in the simpliest way possible, but also to provide
the simpliest interfaces for it, yet most powerful, for the programmer
as well as the user.

I want to prove someday that is possible that a single person writes
a complete operating system and plenty of applications for it.

(the only compromise I'll have to make is I'll have to make use of
existing hardware drivers, because I cannot own all hardware -- but
my OS will run on top of other OSes, so I can arbitrarily delay the
standalone version) 

> > The programming language isn't what matters. All that matters is the
> > OS concept itself, whether it will be successful.
> 
> All that matters is the execution - the OS must deliver what it promises.
> Microkernels are a great OS concept, but they have failed to be the base
> of a successful OS.

Not true -- AmigaOS had a microkernel (some say picokernel) and it was
wildly successful for almost a decade.

> > Since my project (DELOS) is only my own endeavour so far, I don't think
> > it'll have any impact on the software industry.
> 
> Yeah, that's what Linus thought!

Well, my OS project is still largely vaporware, and I don't know when
I'll find the time to get around to implement all of it.

Unlike Linus, I don't just want to write a kernel, I want to write a
complete OS (possibly sans the HAL in the first phase), and when the
POSIX layer is finished, I can compile and run other GNU projects for
it too.

My OS will be GPL'ed, i.e. in the domain of the GNU project, so if I
actually finish it, others will be able to benefit from it as well,
if they want to. 

> > Well, you'd be surprised how fast I learn. ;)
> 
> No matter how fast you learn, it takes a good long while before it seeps
> into your bones.

Ada is a new programming language to me, and although it seems to be
similar to Pascal or Modula, it has a lot of other intesting concepts.

Yeah, it'll take a while until I fully understand Ada and can take
advantage for it, and rest assured, I won't write a compiler for it
until that happens. ;)





  reply	other threads:[~2003-12-21 10:34 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
2003-12-21  2:19                 ` Hyman Rosen
2003-12-21 10:34                   ` Ekkehard Morgenstern [this message]
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