From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8a402d78988bdf2b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-21 02:35:43 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-09!supernews.com!newsfeed.ision.net!ision!easynews.net!newsfeed3.easynews.net!newsfeed.vmunix.org!npeer.de.kpn-eurorings.net!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: "Ekkehard Morgenstern" Newsgroups: comp.lang.ada Subject: Re: [announcement] SYSAPI and SYSSVC for Windows Date: Sun, 21 Dec 2003 11:34:39 +0100 Organization: 1&1 Internet AG Message-ID: References: <1071846912.728815@master.nyc.kbcfp.com> <1071852533.241196@master.nyc.kbcfp.com> NNTP-Posting-Host: p508c1034.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: online.de 1072002942 30359 80.140.16.52 (21 Dec 2003 10:35:42 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Sun, 21 Dec 2003 10:35:42 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:3658 Date: 2003-12-21T11:34:39+01:00 List-Id: "Hyman Rosen" 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; 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. ;)