From owner-freebsd-hackers Wed Nov 6 12:31:35 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id MAA23129 for hackers-outgoing; Wed, 6 Nov 1996 12:31:35 -0800 (PST) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id MAA23109; Wed, 6 Nov 1996 12:31:29 -0800 (PST) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.7.6/8.7.3) with ESMTP id MAA11245; Wed, 6 Nov 1996 12:31:27 -0800 (PST) Message-Id: <199611062031.MAA11245@austin.polstra.com> To: sos@FreeBSD.org cc: gene@starkhome.cs.sunysb.edu, hackers@FreeBSD.org Subject: Re: SUP on sup.freebsd.org In-reply-to: Your message of "Wed, 06 Nov 1996 20:29:52 +0100." <199611061929.UAA02640@ravenock.cybercity.dk> References: <199611061929.UAA02640@ravenock.cybercity.dk> Date: Wed, 06 Nov 1996 12:31:26 -0800 From: John Polstra Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > Erhm, why on earth did you chose Modula3 ?? I newer got the warm > fuzzies by mr. Wirth's languages Modula-3 came out of DEC's Systems Research Center, and as far as I know, Wirth had nothing to do with it. > they are maybe good educational tools, but for real world apps, > nah.... :) I've used the original Wirth Pascal and Algol-W, and that's certainly true of both of them. I've never used Wirth's Modula, so I can't comment on it. Modula-3 really is a different language, designed specifically for systems programming by some extremely competent and experienced people who knew what they were doing. > Oh and yes I have seen apps written in modula3, all of which was > horrible performers, and impossible to port to new platforms, so > the management decide a complete rewrite in, guess what, C! Are you sure it was Modula-3 and not something else with "Modula" in the name? The SRC Modula-3 compiler supports about 25 different platforms. (See "http://www.research.digital.com/SRC/modula-3/html/platforms.html".) Plenty of real world apps (*big* ones) have been written in Modula-3, and they perform pretty well. There's also the SPIN OS project at University of Washington, in which the kernel was written in Modula-3. It performs well, too. (See "http://www.cs.washington.edu/research/projects/spin/www/".) Now, you can always argue that a program would be somewhat faster and somewhat smaller if it had been written in C. Hey, guess what? I was around when Unix V6 came out, and the same stuff was written about it. Just substitute "C" for "Modula-3" and "assembly language" for "C". The answer is the same in both cases: Unix would not exist as we know it today if it had been written in assembly language. CVSup would not exist as we know it today if it had been written in C (or C++, for that matter). OK, so why on earth did I choose Modula-3? In no particular order: 1. I needed application level threads, and threads are an integral part of the Modula-3 language. About the only reasonable alternative was to use pthreads with C or C++. But pthreads was not well supported under FreeBSD at that time. 2. I needed a graphical display during development so that I could monitor the 3 client threads as they were running, debug them, appraise their relative performance, and find the bottlenecks. Modula-3 has a very nice toolkit for creating GUIs quickly and painlessly. (OK, so the scrollbars are as ugly as sin.) 3. Modula-3 is a compiled language that is reasonably efficient. 4. I needed to use some low level system functions, e.g., mapping files into memory. Modula-3 provides good access to such functions, and it is quite easy to add interfaces to foreign libraries such as "libz". 5. Modula-3 has good support for networking. 6. It is a mature and stable language that has been used in a number of serious, large projects. The language and compiler have been stable for about 5 years, which is more than you can say for C++. 7. It has nice support for object oriented programming, including a good type system, a nice exception model, and a modern high-performance garbage collector. These traits, IMHO, contribute powerfully to producing well-structured, maintainable programs. Now before you label me an unstudly OO weenie, please consider this. I've been programming in C professionally for 19 years. I made my living for many years writing C compilers and related tools such as assemblers, linkers, and disassemblers. I still use C and C++ when I feel they are appropriate for a project, not to mention when I have to because that's what the client wants to use. I have experience programming in many many different languages. Different languages are good for different things. I still like programming in C (and C++ for some things), but I'm glad I didn't use it for CVSup. 8. I had just come off a huge 3+ year C++ project. During that time, I learned just how much C++ sucks. I did not feel like doing it again right away "for fun." 9. I have spent my entire professional career getting paid to use the wrong tools, because, e.g., the manager read that C++ was "popular." For once, just once, on a _hobby_ project, I decided I was going to use the tool I felt was the best for the job at hand. I thought about it long and hard, evaluated several options (C and C++ among them), and eventually chose Modula-3. I have never regretted that decision. Any questions? :-) John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth