PPA wrote: >> You need to look at the bigger picture. C didn't become popular >> because of PICs. There are many C programs that compile (and run) on >> any standard-compliant compiler, on quite different platforms. While >> platform differences sometimes need some conditional parts in the >> code, it is possible (and common) to write portable C code that >> compiles on gcc, VC++ (in C mode) and a number of other compilers >> and runs on Linux, Unix, Solaris, Windows, Mac OSX and others (and >> depending on the amount of resources and OS support required for the >> specific program, also on a bare-metal PIC). >> >> Also, while with Pascal you may be able to port your code from one >> Pascal to the other, from one platform to the other, but then you >> have two (or more) code bases. With C, even if you have to make >> adjustments for a specific platform, you usually integrate them into >> the code -- and end up with code that compiles and works on the >> previously supported platforms and on the new platform. >> >> Try that with (any) Pascal. The lack of standardization (and of a >> standard preprocessor, for the sometimes necessary platform >> adjustments) makes this pretty much impossible. > Let me laugh a bit... This is always good, (almost) no matter the cause :) > I jump into this so funny discussion since I'm an ol'Pascal'er among > other activities... Maybe all of this WAS quite true a while ago, but > nowadays we can see that there is a LOT of #IFDEF in C sources to > support multiple platforms. Of course there are. (BTW, it's #ifdef in C.) Even though many things are standardized, many things can't be in order to be able to run on different platforms. For those people have to use the system APIs -- and these are different on different platforms. This has always been this way, back then and is still so. > Nobody (I think) is coding in "pure" C (or "pure" Pascal) - whatever > that means - You might be surprised. Not sure about Pascal, but there are many people who do most of their work in standard C or C++, and in such cases only a small part of an application (if any) deals with the platform differences and encapsulates them. This part, of course, tends to have a lot of preprocessor constructs around the system APIs. But the rest is plain, standard C (or C++) -- which is probably what you call "pure" C (or C++). So yes, lots of people code in this. I currently spend much of my day doing just this. > because everybody want the bells and wistles of the compiler toolchain > they have choosen; if they don't manage toolchain specificities (a > big work), when they want to change there is always a bigest work to > do to adapt their supposed to be "portable" sources... If you don't write with portability in mind, this may be the case. And in some cases, it makes sense not to write with portability in mind -- for example, if you don't anticipate that the code will have to be ported. I can have all the bells and whistles of the VC++ or gcc toolchain and code most of the time in standard C or C++. (When I say "most of the time" I mean in the 99% of the application that are not platform or compiler specific.) I don't see what the toolchain has to do with standard or non-standard code. Of course, if you mean a GUI library, then you're pretty much hosed if the one you chose doesn't support all your target platforms. If you started out with MFC and need Linux support, then all compiler compatibility doesn't help because the GUI support on the different platforms is different enough to make portability a real challenge. That's why there are portable GUI libraries that provide the same interface on different platforms. You better choose one that supports all your target platforms right from the beginning... independently of the language you're programming in. > In Pascal this is the same, a lot of $IFDEF and so on... No less no > more. This is far from "impossible" as you said. I do it every day > since TP3. Some of my old libraries still compiles both in TP3 and > the latest Delphi. So they are "portable". I'm not sure we mean the same thing with "portable". My C and C++ Windows sources, for example, compile on any standard C or C++ compiler for Windows -- and there are a bunch, from different vendors. Same goes for Linux, Unix, Solaris, Apple OSX. For me, being able to compile the program in different versions of a compiler of the same vendor is the lowest level; I wouldn't even call this "portability", it's more like version compatibility. The next level is being able to compile on compilers from different vendors (on the same operating system); this maybe I'd start to call portability. Then come different operating systems and different target processors; here we get into what I call portability. So how does this aspect look for Pascal? (This is not a rhetorical question; I really want to know from someone who uses Pascal portably.) One application I work on has several 100kLOC that compiles fine on gcc and VC++ for Linux and Windows, with a very small and isolated part being compiler and platform specific. Recently we tested the Intel C++ compiler for Windows, and the code compiled without any changes. (We dropped it, though, because the performance advantages were small, and the compile times were horrible.) Is this possible with Pascal -- taking such a complex application, pick another vendor's compiler, and it "just works"? > What you qualify as "Pascal dialects" for me is nothing different than > "C dialects" Besides some odd vendors of small micro compilers, there aren't really any C dialects. The few there are are really niche thingies, mostly restricted to the PIC world (and maybe the one or other small micro, but I think the PIC compilers are worse than most others in this respect). In the great scheme of C, they almost play no role at all. Every compiler that wants to be worth its money has to be standard compatible, and therefore allows programming in standard C (or C++). Which is more common as you seem to think. >> (I'm not trying to say that "C is better than Pascal" :) >> > Just a bit ;-) ... No, I'm not. If you're reading this into my messages, maybe it's because you're defensive about Pascal. Fact is that Pascal is almost dead in the professional world. Another fact is that I started serious PC programming with Pascal. And yet another fact is that I had to give it up because Pascal is almost dead for most professional purposes. And part of this thread is about why this is. I really really didn't like it. Turbo Pascal was miles ahead of anything else. The IDE was snappy and functional, compilation was fast and the executables were, too, it was affordable and powerful. But it didn't make it into the big league, and my guess is that it's about standardization. Microsoft was and is big enough to be able to make a vendor-specific language popular (see VB and C#) without a vendor-independent standard, Borland wasn't and isn't, Delphi notwithstanding. It doesn't help pretending that Pascal isn't dead in the professional world, or make this into yet another "this language is better than that language" pissing contest... It's about finding out why Pascal, with all the perceived advantages, didn't make it -- and, arguably, at this point, has little chance of making it ever. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist