Slashdot Mirror


C Alive and Well Thanks to Portable.NET

rhysweatherley writes "So C is dead in a world dominated by bytecode languages, is it? Well, not really. Portable.NET 0.6.4 now has a fairly good C compiler that can compile C to IL bytecode, to run on top of .NET runtimes. We need some assistance from the community to port glibc in the coming months, but it is coming along fast. The real question is this: would you rather program against the pitiful number API's that come with C#, or the huge Free Software diversity that you get with C? The death of C has been greatly exaggerated. It will adapt - it always has."

147 of 582 comments (clear)

  1. FOR THE LAST TIME... by gid13 · · Score: 4, Insightful

    ...stop telling me things are DYING, maybe let me know when they're DEAD.

    1. Re:FOR THE LAST TIME... by MukiMuki · · Score: 4, Funny

      Isn't this the part where a troll brings in the "NetBSD is dying article" with C as the replacement modifier value? C'mon, they HAVE to have an atomatic generator by NOW.

    2. Re:FOR THE LAST TIME... by Anonymous Coward · · Score: 2, Funny

      ...OR wait until Netcraft confirms it.

    3. Re:FOR THE LAST TIME... by jandersen · · Score: 5, Insightful

      Agree!

      It is at best stupid to talk about how 'C is dying' anyway, seeing as it is still the most popular language in many areas, as well as the single biggest inspirator for 'new' languages.

      I can't remember how many times the impending deaths of such things as COBOL, FORTRAN, BASIC, mainframes etc etc have been announced, but they are still going strong all of them.

      Following the same arguments, C# and .net are obsolete and dying too..

    4. Re:FOR THE LAST TIME... by Grizzlysmit · · Score: 3, Funny

      ...stop telling me things are DYING, maybe let me know when they're DEAD.

      Maybe we could have special section on the main page, sort of like a bullet list, only instead of bullets we have either red (dying) or green (getting better/alive again) graphic's, then we could watch them blinking away as various things die and undie :-D
      --
      in my life God comes first.... but Linux is pretty high after that :-D
      Francis Smit
    5. Re:FOR THE LAST TIME... by gauchopuro · · Score: 5, Funny
      It is at best stupid to talk about how 'C is dying' anyway, seeing as it is still the most popular language in many areas, as well as the single biggest inspirator for 'new' languages.

      I agree 100% that C is the biggest inspirator for new languages. One can only take being burned by C's shortcomings so much before deciding that there has to be a better way.

    6. Re:FOR THE LAST TIME... by Ba3r · · Score: 2, Insightful

      This seems like comparing apples & oranges to me. Languages are built around providing the best tool for the situation.

      If i need to develop applications fast, flexible, and portable, I will use an interpreted language, like c#, java, or (if i am a masochist ;) vb.

      On the other hand, if i am coding in a microcontroller, coding OS level stuff, or coding extremely demanding software (i.e. massive simulations), I would choose C, as it gives me a chance to really monitor whats going on in terms of memory, and eliminates the overhead of the interpreter (and chances are i am not so concerned with code reuse).

      Using C in the .NET environment is foolish, .NET is very strongly typed, and C barely knows what type is. Using java on a microcontroller (they have this!!) is also foolish, why waste 50% of the 3kb of memory for the interpreter, or 5% of the clock cycles.

  2. What about C++? by ace123 · · Score: 4, Informative

    Isn't C++ widely portable while giving mast if not all of the features of C# (except for being interpreted)

    1. Re:What about C++? by lpontiac · · Score: 2, Flamebait

      Notice that the KDE camp are humming along quite happily with qt and C++. Everyone clamouring for Mono seems to come from the "just C thanks" GNOME community.

    2. Re:What about C++? by davebrot · · Score: 3, Insightful

      True enough, but that's not really the point of the posting. Lots of people know how to program C and not C++. Regardless of how one feels about procedural vs. OO languages, a .NET runtime for C does demonstrate the hardiness (or maybe just the deep entrenchment) of C.

    3. Re:What about C++? by condensate · · Score: 5, Insightful

      True, and C++ is more than a better C. But how in the world do you do numbercrunching with a bytecode language? Tried to do so once for Java, and I'm NEVER going to do it again. Compilers do exploit the specific processor, VMs can do so, too, but why should I introduce a level of complexity, when I just want my processor to calculate things for me? It doesn't get easier, just more portable, but then, C++ seems fairly portable, using templates all along and letting the compiler do the nasty stuff. This means for C it's going to be macros. But hell, isn't it great when you actually know what happens? If you start out on some byte code language, you actually have no idea about the basics of your system. How can you program this system then? And for the anti-FORTRAN fraction. It is still the fastest thing out there!!! Anyone who tried solving a system of linear equations containing 1000 equations knows what I mean. My eyes still pop out when I see a FORTRAN subroutine at work that will do the job in seconds on a normal PIII desktop. So please stop this thing about dying languages which are in fact not dying but a little hard to cope with. This doesn'd make them old. It's just that some people don't want to go through the trouble of learning them, yet they are simply too good to be left out.

      --
      Black holes were created when god tried to divide by zero
    4. Re:What about C++? by H4x0r+Jim+Duggan · · Score: 3, Informative

      One of the design goals of GNOME was to support as many programming languages as possible.

      I'm not very familiar with KDE's language binding availability right now, but I know that being written in C++ would make it more difficult to provide alternate bindings. C, being the lowest portable denomiator of programming languages is simple to create alternate bindings for.

    5. Re:What about C++? by condensate · · Score: 3, Informative

      Ever compared LAPACK to some other oonumeric library? I mean one that does NOT rely on LAPACK by itself. Check oonumerics again. Most of the linear algebra libraries rely in some way on the basic linear algebra subprograms, which are of course FORTRAN subroutines. There are ports to C++ that are as fast, but you have to code quite efficiently to actually top FORTRAN. Personally, I prefer C++ and link against the subroutines by the extern "C" directive. This involves finding the appropriate libraries, but as soon as the whole thing links, no problem. Check Todd Veldhuizens page again, and you will see a graph that shows that his Blitz++ librariy equals FORTRAN. But Blitz++ relies on expression templates in C++ which are widely known to drive you mad when you encounter them the first time. The technique Veldhuizen uses is quite complicated and relies on the fact that C++ templates are evaluated by the compiler and subsequently inlined in the code. Compared to that , even FORTRAN code is very readable.

      --
      Black holes were created when god tried to divide by zero
    6. Re:What about C++? by arivanov · · Score: 2, Interesting
      And for the anti-FORTRAN fraction. It is still the fastest thing out there!!!

      No it is not. Been there. Done it. For ultra fast solving of linear equation systems actually. A good hand coded vector library written in ASM will beat it outright. Been there done it. 12 years ago. Wrote vector libraries for TP which used routines specific to each of the CPUs at the time 286/287 (standard, AMD and Harris), 386/387, 386/IIT and forgot what else (it was just before 486 came out). Took 4 weeks of work to write and optimize instruction ordering to keep the puny 15 byte 286 pipeline always full. The result was 4-5 times faster then fortran for the same platform. And 100 times more usefull because you could use them in a proper high level language with OO.

      --
      Baker's Law: Misery no longer loves company. Nowadays it insists on it
      http://www.sigsegv.cx/
    7. Re:What about C++? by Peorth · · Score: 3, Insightful

      C++ isn't a "better C", really, so I suppose I'm somewhat in agreement. C++ seriously breaks compatibility with C, of course, though uses roughly the same syntax to extend itself over the top.
      Objective C is compatible with the underlying C (it's compatible with C99 too, last time I checked), while using a different "new" syntax for the object orientation, as well as providing a nifty class library and dynamic type checking.
      In some respects, it's like C#, including the decently poor class library API (compared to Java, anyway), but to me, it's basically what C++ should've been. The only real "downside" in my opinion has been that it doesn't have class-local storage, but instead uses the exact same storage as C, which can make tracking data "globally" through an application slightly difficult, since you're either forced with global storage, or function-local storage (and then passing it around through everything via pointers), or some other more "traditional" means of throwing data about. C++ is nice that it's compatible with C libraries in general, and you can keep functions and data together in classes, which makes a decent amount of sense, though I've been told that the way C# does some of the more "trivial" data types (bools, attributes, etc) is a little more efficient relating to class storage.
      But...here I am going on and on, too.

    8. Re:What about C++? by digitalsurgeon · · Score: 2, Insightful

      but c is better suited for embedded applications is it not? where the performance if of utmost importance ?

    9. Re:What about C++? by Deusy · · Score: 2, Insightful

      I'm not very familiar with KDE's language binding availability right now, but I know that being written in C++ would make it more difficult to provide alternate bindings. C, being the lowest portable denomiator of programming languages is simple to create alternate bindings for.

      I cannot believe this tripe is modded as 'insightful'. What ignorant rubbish (both the comment and the moderation of it).

      It is relatively easy (as easy as with C) to create bindings for C++. And even if it wasn't, you can create C bindings for C++, so you could simply then create the bindings for other languages using the C layer.

      --

      Free Gamer - Free games list and commentary

    10. Re:What about C++? by Viol8 · · Score: 3, Funny

      Yes , that optimised x86 assembler will come in *real* useful on a Sparc, PA_RISC, 68000, Power-PC etc etc architecture won't it when you need
      to drop an equation solver into your OO program.

    11. Re:What about C++? by gauchopuro · · Score: 4, Interesting
      It is relatively easy (as easy as with C) to create bindings for C++. And even if it wasn't, you can create C bindings for C++, so you could simply then create the bindings for other languages using the C layer.

      The problem is in trying to make use of C++'s more advanced features, such as templates and classes, from some other language. Many C++ libraries depend upon the use of these features to function correctly. Mapping a C++ class heirarchy to some other language is almost sure to require a large amount of work. While I agree that a C binding can be created for a C++ library, this may not be a trivial task.

      Consider, for example, trying to crate a C binding for STL vectors. Since C does not support templates, the work will not be easy. One option would be to create some kind of C preprocessor that could add generics to C; but this is exactly how C++ started in the first place (as a preprocessor). Another option is to create a pure C interface, then to implement that interface using vectors.

      The problem is that there is a huge semaintic difference between C++ and C. Most languages include some sort of C interface, since C is low-level and an easy target for interoperability. Few languages come with support for interacting with C++. For interoperability, C's semantics are simple: just functions and data structures. Calling C functions from some other language usually boils down to just a wrapper for the function, along with appropriate marshalling code to convert data types. On the other hand, C++'s model of OOP is a one-of-a-kind. Higher level languages simply do not share C++'s view of OOP. While there are definitely similarities that are shared among most object-oriented languages, the differences are so wide as to make a general interface to C++ impossible.

    12. Re:What about C++? by sbrown123 · · Score: 2, Informative

      Ive seen too many benchmarks that show Fortran dusting every other high level language out there when it comes to math. C++ is almost at a tie with Java outside using floating point.

    13. Re:What about C++? by sbrown123 · · Score: 2, Interesting

      I dont think its performance or assembly would be king. Its more of compiled executable size and ease of use where c finds a good place on embedded systems.

    14. Re:What about C++? by sbrown123 · · Score: 2, Interesting


      Yes, it is a more bloated, complex and difficult to learn version of C.


      No, I have always taken it that C++ is good if you dont know C and C is good if you dont know C++. Once you learn the one you become suddendly jaded towards the other.

    15. Re:What about C++? by gauchopuro · · Score: 2, Insightful

      The sad thing is, though it should run fine on a modern x86 processor, it is almost certainly slower than code that a decent C++ compiler with processor specific optimizations would produce. If the code had been written in C, it would be able to take advantage of MMX and SSE instructions with nothing but a recompile. I have seen hand-optimized assembly code for doing 64-bit arithmetic that was written a few years back; replacing this code by using __int64 and normal arithmetic operators resulted in a speedup.

    16. Re:What about C++? by gauchopuro · · Score: 2, Insightful

      I agree that if you want to allow other languages to interface with your C++ code, you write it differently. The thing is, with C++, this must be one of your design goals; if you write in C, your library is much more likely to be usable without an additional interface wrapper layer.

    17. Re:What about C++? by sabre · · Score: 2, Informative

      Check out LLVM: http://llvm.cs.uiuc.edu/

      It gives the advantages of bytecode compilation (linktime & runtime optimization, JIT compilers, etc) to both C and C++ (using the GCC parsers). In addition it has a powerful interprocedural optimizer, so it generates code that truely thwomps GCC in some cases. :)

      -Chris

    18. Re:What about C++? by gte910h · · Score: 3, Insightful

      You're just a little too young. Objective-C is a cross between C and Smalltalk. I would say its a wonderful blend. If you know both of those languages, you pretty much will get most of Obj-C right the first time you try to do anything in it.

      As classes are first class objects, I love it. However since its only used on Macs, I cry.

      --
      Want to see every step I took to start my company? http://www.rowdylabs.com/blogs/pitchtothegods
    19. Re:What about C++? by Fulcrum+of+Evil · · Score: 2, Funny

      Obj-C on the other hand looks like the designers thought to hell with C , we'll design our own new-look language and shoehorn it kicking and screaming into C.

      After meeting the designer, I'm inclined to agree.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    20. Re:What about C++? by Progman3K · · Score: 3, Insightful

      Believe me or not, I've met a few programmers (I can honestly say 3!) that were able to program in C++, but not in C!

      All three were fresh out of school and were working as professional C++ programmers!

      When I say "unable to program in C", I mean that exactly; they were unable to deal with pointers, didn't understand the basic variable types, couldn't write an application without the Visual C++ application-wizard generating a skeleton for them!

      "What's a main?"

      "ints have a range?"

      "why is my unsigned variable never decrementing to -1?"

      "Pass by reference???" *blank stare*

      If I asked any questions like - "How do you think printf is implemented?"

      I'd get a typical response like "dunno"

      OK you say, printf is big, etc...

      But when I'd ask "What does this code you wrote last month do?" and get "dunno" as an answer, it was sort of shocking.

      You see, I think everyone trying to lower the bar by getting rid of C and anything low-level like that will backfire, if these fresh-out-of-school examples are any indication:

      After finding them so useless at getting the job done except when everything was just about completely pre-chewed and put into their mouths, I did what I had to.

      I laid-off one of them.
      Another left out of boredom and apathy because I gave him the task of fixing his own bugs.

      If we lower the bar, it won't prevent problems from existing and needing to be solved, you see, and only the programmers with TRUE aptitude will succeed, and they won't mind C one bit.

      --
      I don't know the meaning of the word 'don't' - J
  3. Er.. by iswm · · Score: 5, Insightful

    C is still alive and kickin' in the NIX community I'd say. It seems it's really just Windows where other languages (C++, C#) seem to be taking over. Just because C isn't being used much in the Windows world doesn't mean it's dying ot is going to die anytime soon.

    --
    Buckethead
    1. Re:Er.. by Graff · · Score: 4, Interesting
      C is still alive and kickin' in the NIX community I'd say.

      C is going strong on Macintosh also. Cocoa programmers use mainly Objective-C which is fully backwards-compatible to C. You get the best of both worlds there. You can use C for the parts of your program where you really need the speed of C and can you use Objective-C where the advantages of object-oriented design best suit your program. Programmers who use the Carbon libraries instead of the Cocoa libraries also mainly program in C or C++.

      There are many other languages available for Mac OS X but I would say that C, C++, and Objective-C are by far the most used. Since C++ and Objective-C are largely supersets of C, I would say that C is doing just fine under Mac OS X!
    2. Re:Er.. by Endive4Ever · · Score: 2, Interesting

      Thank goodness the Pascal on Macintosh has finally (mostly) faded away.

      --
      ---
  4. C?? by Neo-Rio-101 · · Score: 4, Funny

    C?

    Yeah, just kill it off already... I wanna go back to using Commodore 64 BASIC.

    --
    READY.
    PRINT ""+-0
  5. Wow! by stevens · · Score: 4, Funny

    All the advanced language features of C with all the speed of an interpreted VM!

    Can I get them to compile asm to java bytecode next?

    1. Re:Wow! by minus_273 · · Score: 4, Interesting

      "Can I get them to compile asm to java bytecode next?"

      Not as funny as you think. It would be a truly awesome program that can do that. Why? take MS office, disassemble make it java byte code then run it on the platform and OS of your choice.
      dont see anything like that happening for a while, but it certainly is not funny.

      --
      The war with islam is a war on the beast
      The war on terror is a war for peace
    2. Re:Wow! by tupshin · · Score: 4, Informative

      http://www.xwt.org/mips2java/

      Takes compiled mips binaries and converts them to functional java classes.

    3. Re:Wow! by Sivar · · Score: 2, Informative

      Have you used C#?

      C# is not run as interpreted bytecode (which would be slow); it is "compiled" to bytecode and then, when the program is first run, compiled to native code. It is about 10-20% slower than a similar program written in C++, but for most GUI apps on modern machines, this does not matter.
      Of course, for "real programmers", C and C++ still grant you much more power. Function pointers, inline assembly, easy bitwise operations... C# is fine for many programs, but just TRY to implement a network protocol using it! MD5 is another good one. I haven't tried it myself, but have a friend that was forced to by a company thoroughly brainwashed by Microsoft.

      Pain.

      --
      Computer Science is no more about computers than astronomy is about telescopes. --E. W. Dijkstra
    4. Re:Wow! by actiondan · · Score: 4, Informative


      You do know that the .NET runtime uses JIT compiling rather than interpreting to actually execute applications, don't you?

      One the app is running, the processor is dealing with native, optimised machine code rather than the IL bytecode.

      Dan.

    5. Re:Wow! by Caine · · Score: 2, Informative
      Of course, for "real programmers", C and C++ still grant you much more power. Function pointers, inline assembly, easy bitwise operations... C# is fine for many programs, but just TRY to implement a network protocol using it!

      C# gives you access to function pointers, inline assembly and has the same friggin bitwise operators every other language in the world has. I've also implemented sockets encrypted at the sockets level which went just fine.

  6. Weren't you guys beaten to it by CNet? by Ratface · · Score: 3, Funny

    Sorry - someone had to say it!

    --

    A little planning goes a long way...
  7. Because there was no more room in hell? by Anonymous Coward · · Score: 5, Funny

    C lives on; driven by an insatiable unreasoning swarming hunger. Until the day when the seventh seal is broken, the sun dies, and all the languages are at last bound to it's dark will. Then all of man, in the Doom of our time, will writhe in agnoy for a thousand years of darkness until the, strongly typed, Rapture casts the dark empire back into the pits of hell, and scatters the damned to the winds.

  8. Keep it real... by seanmcelroy · · Score: 5, Insightful

    QUOTE: The real question is this: would you rather program against the pitiful number API's that come with C#, or the huge Free Software diversity that you get with C? The death of C has been greatly exaggerated.

    Now what a spin. The .NET API's are by no means 'pitiful in number', and they can be embraced, extended, and overridden as desired. C *can* adapt, but the point of a C# based desktop system or development platform is not solely to exclude C, but to bring the benefits of managed code to other system consumers. C could adapt, but not without a lot of overhead and fundamental changes that really is the point behind C#. I'm sure we'll be in a backwards-compatible, C-friendly world for a long time to come, but there's no reason to bash something new and different because it is new a different. That's just FUD.

    --
    Be very, very careful what you put into that head, because you will never, ever get it out. -Thomas Cardinal Wolsey
    1. Re:Keep it real... by forgoil · · Score: 5, Insightful

      Not to mention the fact that the developers of C# (i.e. the people developing the language, not with the language) made sure that one can easily make use of C and C++ code and binaries already in existance. You can already call all the C/C++ APIs.

      I'm not sure or clear of why one would want to code in C instead of C# when developing for a .NET environment (be in Microsoft or Mono or something else). It can't be because you can't make use of already written APIs (since you easily can call them), so we killed that point. It can't be because of the "speed" of C, since it will be running the same IL on the same CLR. We are basically down to the language of C.

      So is this because someone feels that OO could be too big for very small devices (Java MIDP showed us this very clearly, since it is completely missplaced and awful on mobile phones)? I can buy that.

      Or is it because of some form of hatred towards C#? That makes it sad. The APIs for .NET are far better than any C API I've stumbled upon thus far (win32, POSIX, Solaris, GNU, etc), contains a vast amount of useful things, and easily calls unsafe (.NET terminology, look it up if you don't actually know what it means) C/C++ APIs.

    2. Re:Keep it real... by Anonymous Coward · · Score: 2, Funny

      The real question is this: would you rather program against the pitiful number of security holes that come with C#, or the huge Security Hole diversity that you get with C?

    3. Re:Keep it real... by Sique · · Score: 2, Insightful

      Or is it, because there are lots of work already done in C, and adapting the code to .NET seems more feasable than porting it to C#? Or because the algorithms are given in C, and it makes no sense to reinvent them in C#, because they don't make any usage of an object oriented design? (Think about huge numerical packages.)

      --
      .sig: Sique *sigh*
    4. Re:Keep it real... by TummyX · · Score: 3, Insightful

      Um think about it. P/Invoking involves calling native DLLs (meaning you'd need a different binary DLL for each platform). By compiling your C libraries into IL using Portable .NET's C compiler you can distribute one set of binaries for your applications.

      For example, if you need good JPEG decompression routines in your ".net" application you could recompile libjpeg with pnet's cscc compiler and keep your application 100% "managed".

      Far too many people on this thread know *nothing* and are talking crap.

  9. Punch Cards by Detritus · · Score: 5, Insightful
    Punch cards did not disappear, they just became virtual.

    FORTRAN and COBOL are still in wide use, even if they aren't as popular as they once were.

    --
    Mea navis aericumbens anguillis abundat
  10. C's not dead because nothing better.... by bangular · · Score: 5, Insightful

    C has it's problems. You could complain about C all day, the problem is, it's the best thing we have right now. One of the problem with modern languages is, you can't write an operating system in them. One of the problems is half the new languages are scripting perl/python like langauges and the rest compile to byte code. Maybe C would go away if there was a compiled langauge that wasn't largely controlled by one company that produced fast code and was portable. The closest thing to that besides C is C++.

    1. Re:C's not dead because nothing better.... by Ambassador+Kosh · · Score: 2, Informative

      Python does compile to bytecode. It just does not require a separate step to compile to bytecode like java does. If the bytecode is out of date it will be recompiled and used automatically.

      --
      Computer modeling for biotech drug manufacturing is HARD! :)
    2. Re:C's not dead because nothing better.... by infiniti99 · · Score: 4, Interesting

      The closest thing to that besides C is C++.

      For general purpose programmming, C++ is often overlooked because it suffers from the same problem as C in this scenario, which is that there isn't really much in the standard library to draw from. C#, Java, Perl, Python, etc, all have lots of "foundation" underneath which allow you to build applications quickly.

      However, this is not so much an issue of language as it is of API, and C++ has the language features necessary to build a good API. All that is needed is a good library then, such as the Qt C++ library. With Qt, you get nearly the same foundational API as Java, but with natively compiled code. C++ may not be the end-all be-all of languages (no language can claim this), but it is much more capable than many people think. If you wouldn't touch C/C++ with a 10 foot pole, you haven't tried Qt. You can have your cake (large, well constructed API) and eat it too (native code).

    3. Re:C's not dead because nothing better.... by SpaghettiPattern · · Score: 5, Insightful

      C has it's problems.
      C has no problems. It does exactly what it's supposed to do.

      You create problems when using C for business purposes. Business programmers don't want to waste time chasing memory leaks and array overflows.

      --

      I hadn't the slightest objection to his spending his time planning massacres for the bourgeoisie... (P.G. Wodehouse)
    4. Re:C's not dead because nothing better.... by grumbel · · Score: 3, Interesting

      There is Ada95 which should come pretty close to your requirements, its pretty much like C, just with a whole lot safety added.

      But you are right most of the new languages really don't touch the areas where C is successfully today. I think one of the major problems, at least in the Unix world, is that pretty much every library is written in C, so if another language should take over, you would have either to rewrite all libraries out there or at least create bindings to your new language and since that is a major overtaking it won't happen anytime soon.

    5. Re:C's not dead because nothing better.... by Imperator · · Score: 4, Informative
      at least in the Unix world, is that pretty much every library is written in C

      Actually some of them that look like they're written in C are actually written in C++. They're just careful to make sure that all the public interfaces are extern "C". They can then use whatever fancy C++ features they want in implementing the library.

      I think this is one of the real strengths of C: because the ABI is so simple, pretty much anything can link to C and almost anything can create C bindings.

      --

      Gates' Law: Every 18 months, the speed of software halves.
    6. Re:C's not dead because nothing better.... by be-fan · · Score: 4, Informative

      You could complain about C all day, the problem is, it's the best thing we have right now.
      Hardly.

      One of the problem with modern languages is, you can't write an operating system in them.
      Sure you can, with little more ASM code than is required for a C-based operating system. Heck, lots of OSs have been written in things like Lisp. Actually, C is a terrible language for writing operating systems. Because its not safe, you have to have an MMU to protect programs from each other. This sucks for performance. Not only do you have the hit of memory protection, but you have to have bounderies between userspace and kernelspace, and between programs. That's why it takes 600(!) clock cycles on my P4 to do something trivially simple like gettimeofday()! If you use a safe language, you don't need memory protection, or even a kernel/userspace boundry for that matter. You get completely fine-grained protection for all objects. See this SF project for an OS written in a safe language.

      One of the problems is half the new languages are scripting perl/python like langauges and the rest compile to byte code.
      I don't know what's the current fetish with VMs, but most of the really advanced languages (Lisp, ML) compile to well-optimized native code. Look at the recent comp.lang.lisp thread where they ported Almabench to CMUCL, and got within a few percent the performance of C.

      Maybe C would go away if there was a compiled langauge that wasn't largely controlled by one company that produced fast code and was portable.
      Common Lisp
      Another Common Lisp
      Ocaml
      Scheme
      Dylan
      Another Dylan

      We have lots of languages that are much more powerful than C (hell, they're much more powerful than Java/C#), safer than C, and very close in performance. It is merely a failure of programmers and the software industry that we have not been able to utilize them.

      --
      A deep unwavering belief is a sure sign you're missing something...
    7. Re:C's not dead because nothing better.... by Anonymous Coward · · Score: 2, Interesting

      C has no problems. It does exactly what it's supposed to do.

      Sure it does, parts of its standard library are moronic.

      Business programmers don't want to waste time chasing memory leaks and array overflows.

      C does not inherently cause memory leaks and array overflows. Programmers cause memory leaks and array overflows, C just doesn't prevent them from doing so.

      I use C++ every day, and while it's not the same, it's close enough to fall under the same criticism. I haven't had a memory leak or array overflow in a very long time. It's trivial to avoid them.

      So why are there so many? Lack of skill, lack of attention. This is why you wouldn't use them for business purposes, you have to hire more expensive programmers.

  11. Huh? by drgonzo59 · · Score: 3, Funny
    I wonder if Microsoft can then compile the .NET framework into IL and run .NET (on top of .NET)* ?

    In the meantime I'll just risk being labeled "old-fashioned" and compile C straight to binary

  12. Declaring "X is dead" is just a cheap shot. by Biotech9 · · Score: 5, Insightful

    And its done by someone with a new technology to get people talking about it. Look at all the debates and forum chatter that got sparked off by intels "Bluetooth is dead". "C is dead", "CISC is dead"....
    ,"Apple is dead".
    When technologies really do die, its when noone gives a damn about them, and so noone will be writing a story about it.

  13. Re:Adaption, but.. by jayjaylee · · Score: 2, Funny

    Remember when punch cards went obsolete?

    Yes. :'(

    I'm old enough where my toddler drinks Pediasure, my wife drinks Boost (to give her nutrients during her pregnancy), and I'm on Slimfast.

    I'll cry myself to sleep tonight ...

  14. Re:Adaption, but.. by irokitt · · Score: 2, Insightful

    I still use punch cards, you insensitive clod!
    As for Fortran and COBOL, Fortan is still an entry requirement to the California college system, and COBOL is still everywhere - deeply embedded into the payroll and employment operations of many businesses. And there are still vestiges of punch cards too - Scantrons and the like. So things don't die as easily as you might think. Much as we sometimes wish them away, they hang on.

    --
    If my answers frighten you, stop asking scary questions.
  15. Re:So... by Zardus · · Score: 4, Informative

    Linux is written in C, SDL is written in C, X (I think) is written in C. The gimp is written in C (along with GTK). Gaim is written in C. There are almost 13000 projects on sourceforge that are registered as being written in C.

    C is neither bad nor dead (not that it doesn't have its problems). Whoever wrote this article and the previous one about it on slashdot is a moron.

    --
    You can mod your friends, you can mod your nose, but you can't mod your friend's nose.
  16. Right tool for the right situation. by Slayk · · Score: 2, Insightful

    It seems to me (even with my limited knowledge of programming and software engineering) that when such statements are made about the death (or undeath...mmm...CZombie...."HEADERS....HEADERSSS") , the idea that C# has its place in fitting in with the .NET framework, C has its place in things like...say...stuff like the Linux kernel (though that isn't near its only use), Java and it's being cross platform, etc is totally ignored.

    Just because you can hammer in a screw if you try hard enough doesn't mean the screw driver is dead.

  17. Insightful by SuperKendall · · Score: 5, Interesting

    When you hear someone declare "X is dead" it usually means they have a vested interest in X actually dying, and wish to further that belief. Either that or it's more like a mafia situation where a statement like "X is dead" is more of a prediction with a strong likelihood - it all depends on the power of the speaker.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Insightful by deadlinegrunt · · Score: 2, Funny

      How can C be dead regardless?
      I thought C can't die, it just gets cast to void.

      --
      BSD is designed. Linux is grown. C++ libs
  18. Broader Perspective by VoidEngineer · · Score: 5, Funny

    Summary of argument to date (translated from geek-speak):

    > Queens English is so dead.
    > Yo, it's all about Ebonics.
    > Dude, Southern Drawl is *soo* slow... Surfer speak is a way better language.
    > Like, Valley Speak is, like, the best networking dialect to know!
    > Well, if you want a job with a blue-chip company, go with Chicago Twang.
    > I hear that they're porting the Queens English libraries to Chicago English, btw.
    > See? Queens English is not dead...

    Dialects, people... just dialects. Try to see things in the broader scheme of things. (punny, eh?).

  19. It's not dead. by Teddy+Beartuzzi · · Score: 4, Funny

    It's just pining for the fjords.

  20. *yawn* by sweepkick · · Score: 2, Interesting

    I'll start worrying when I see entire OS's and their requisite device drivers written completely in a bytecode language.

    *shrug*... bring it on.

  21. Yup that exists by Julian+Morrison · · Score: 4, Informative

    http://cat.nyu.edu/~meyer/jasmin/

  22. Re:Adaption, but.. by stephentyrone · · Score: 2, Informative

    "Fortan is still an entry requirement to the California college system"

    where can I get some of whatever you're smoking? there are classes where it's used, for sure, but "entry requirement"? no.

  23. To be sure, check Google News. by Futurepower(R) · · Score: 4, Funny


    However, you should check News.Google.com frequently in case the world ended and no one told you.

  24. Re: C? Dead? by Black+Parrot · · Score: 2, Funny


    > As a Christian, I won't write anything in C (obviously) [...] and do you think that these systems are going to be ported to Java or BASH?

    As a Christian, you should clearly support J4V4 in all things.

    --
    Sheesh, evil *and* a jerk. -- Jade
  25. Re:So... by j-pimp · · Score: 4, Insightful

    When a language has to piggy back on another or come up with these weird combinations you know it is on it's way out. With that logic every language with a .NET version is dead. First of all their are plenty of projects that hanve ane will continue to be written in C and compiled into good old unmanaged binary executables that execute without any of this newfangled bytecode. Also the whole point of .NET and the JVM is compile once, run anywhere. Java and Foo# are just languages well suited for such tasts. Programmmers always find a way to use whatever weird language, library, or methodology with whahtever new technology.

    --
    --- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
  26. It's Dead Jim by myownkidney · · Score: 2, Interesting
    Not it aint!

    I have never used, and will never use this bytecode languages running on VMs. I won't the minimum distance between my program and the machine instructions. Currently, C is the best language for this purpose.

    Unfortunately, a lot of CS courses are teaching people the importance of "managed code" and "strong typing" etc. I say to hell with that. If I feel like messing up with memory at AF345F12:BA231DCE then I shell do so. I don't want to hide behind "type safety". I know what I am doing.

    I have no faith in these OO language crap either. The real world maybe OO, but once your code is compiled, it is going to run us a sequence of statements: i.e., like an imperative language. Not to say that people have not tried to build processors which had OO machine code, but none of them caught on. I work mainly with the Intel architecture. It's not natively OO.

    Long live C

    1. Re:It's Dead Jim by LarsWestergren · · Score: 4, Insightful

      I have no faith in these OO language crap either. The real world maybe OO, but once your code is compiled, it is going to run us a sequence of statements: i.e., like an imperative language.

      Well, DUH. In the end its just ones and zeroes no matter what language you use. OO does not change the way computers operate much, it is a way to help programmers think about the problem domain in a way that hopefully is a bit easier for most of us. Jeez.

      If you don't like it because it cramps your "bursting with geek studliness" style, that's fine. But if you don't even understand what high level languages are for, I doubt you know what you are doing.

      --

      Being bitter is drinking poison and hoping someone else will die

  27. Embedded/Real-time systems still need C by aarondsouza · · Score: 4, Informative

    There are a huge number of applications that have very stringent time constraints, especially in real-time control. Other than coding in assembly, there isn't any other language out there that is as efficient (both size *and* speed count) as well optimized C code.

    As an example, our lab works with humanoid robots that run in a 5ms control loop, which means that the next command (computation of inverse dynamics, etc.) has to be ready in that timeslice. If you want to do fancier stuff like machine learning and AI, you'll have to squeeze in many more operations into that tiny window. Sure, additional processors are a plus, but you still need very fast and memory efficient code.

    --
    "In mathematics, it's not enough to read the words -- you have to hear the music"
    1. Re:Embedded/Real-time systems still need C by spongman · · Score: 2, Insightful
      there isn't any other language out there that is as efficient (both size *and* speed count) as well optimized C code
      Sure there is. C++ (with exceptions and RTTI disabled) is just as efficient as C [1], plus it's type-safe, has nested namespaces, classes & templates.

      [1] as long as you disable exceptions & RTTI and stay away from virtual/multiple inheritance & pointers to member functions.

    2. Re:Embedded/Real-time systems still need C by WARM3CH · · Score: 2, Insightful

      Actually, in many scientific applications thanks to the templates you can have a very efficient code WITHOUT disabling exceptions, RTTI, ... and beat the pure C code simply because you could not write so much inline code that the inline expansion of all sorts of usage of all your template classes would result. In a simple tight loop with simple operations, calling simple function C may beat C++ but in a more complex application C++ can be faster.

  28. Re:So... by mpmansell · · Score: 3, Insightful

    So, by that argument, shouldn't Java and C# both have been stillborn? Both piggy back on VMs and are the same 'weird' combination?? :)

  29. C is Dead by WankersRevenge · · Score: 5, Funny

    I know. I killed him. I ran him down in my PHP-mobile while drag racing with those Ruby punks on their friggin crotch rockets. At least C++ had the sense to step out of the way. I guess they were arguing about how their half-witted brother C# knocked up his half witted twin sister, Java, and produced some hideous premature birth thingy who they called Mono. I would have turned around and hit C++ had I not blown a module and had to stop. Those Ruby punks gave me the bird, but you wait and see. I got this new Zend nitrus which knock the socks of those badboys but I don't know how plug it in. Anyone got the number of a good mechanic?

  30. Re:So... by Foole · · Score: 5, Informative
    Whoever wrote this article and the previous one about it on slashdot is a moron.
    No one in this article or the other one actually said that C is dead. This is another case of a quote being taken out of context. The original quote was "To me C is dead." which has a very different meaning.
    --
    This is not a turnip.
  31. Saying C will be killed by a runtime architecture by StevenMaurer · · Score: 4, Insightful

    ...is like saying too many busses will eliminate sports cars.

    The C design paradigm (low level, varied environment, highly optimized, developer control) is intended to solve an entirely different class of problem than Business runtimes (higher level, standard interface, managed resource, developer handholding). The two aren't in competition much at all.

    Nor do I think much about trying putting a racing-wheel on a bus either. We already have C# and "Managed C++", both which can look quite a bit like C, if you want them to. All you have to do is ignore that they're fundimentally different in the way they treat resources due to the underlying runtime or lack thereof. (Which is like equating a bus to a sports car, ignoring the size and speed issues.)

  32. Didn't RTFA but have some questions anyway :) by idiot900 · · Score: 2, Interesting

    Does this include *all* of C? How do they compile the following C features into VM bytecode?

    - Pointer arithmetic
    - Hardcoded type sizes instead of using sizeof() (i.e. assuming sizeof(int) == 4)
    - Lax rules for casting
    - And so on

    1. Re:Didn't RTFA but have some questions anyway :) by Gopal.V · · Score: 3, Informative

      Does this include *all* of C? How do they compile the following C features into VM bytecode?

      - Pointer arithmetic
      A: YES
      - Hardcoded type sizes instead of using sizeof() (i.e. assuming sizeof(int) == 4)
      A: WTF ? .. C never had that ... C never had a fixed size for integers ... anyway malloc(20) will work
      - Lax rules for casting
      A: YES .. had to work a lot to get those function pointers castable !!
      - And so on
      A: Hey, porting glibc ... remember

  33. Re:Adaption, but.. by blowdart · · Score: 2, Interesting
    Well if producing a CLR version is proof of life (and how exactly do they provide C pointers when every object is supposed to be by reference anyway) then COBOL is alive with Fujitsu COBOL.Net, and Fortran has 2 zombies, with ftn95 and Lahey/Futisju Fortan

    Who would have though that a mainframe manufacturer would keep prompting dead langauges? <g>

    Whilst Algol isn't there, Oberon is, as is Ada, a shareware version of Forth, Haskell, Eifell, Pascal, Perl, Python (twice) and SmallTalk

  34. Re:Let it die! by zalas · · Score: 2, Insightful

    Screw that! We need more programmers aware of vulnerabilities in systems and to be able to deal with it. Dumbing down a language at the expensive of performance is only going to dumb down the programmers. Well, to a point. My ideal programming language would be something that allows me to do practically anything with it and leaving its internals exposed. You can program with a safe subset if you're beginning, but you can then expand to advanced programming without the language limiting what you can do.

  35. Re:Adaption, but.. by csirac · · Score: 5, Insightful

    Saying C will die out is like saying that assembler will die out.

    There will _ALWAYS_ be parts of an Operating System, hardware-oriented realtime or embedded app that _needs_ to be close to the metal. C/ASM is predictable, consistent, flexible and fine-grained in the things you can do with it. You certainly don't want a time critical interrupt handler routine that is supposed to be done in 5ms to suddenly decide that it needs to do some garbage collection or page in some hashing function to access an array of some sort.

    Plus, C is great because it isn't assembly.

    Even then, sometimes you just gotta write some ASM.

    Sure, someone might make a "better" C that has similar goals (structured around ASM-style thinking rather than human-style thinking), but if they did it surely would be some incarnation of C. Compare traditional K&R C with the current features of GNU C (hooray for structure member tags!) or even the ANSI C99 specification.

    Even though there has been no great change in the approach to programming itself (compare to LISP, haskell or Perl), C has nonetheless had continuous improvments along the way, from language and data structure standards to libraries, compilers, debugging tools, code profiling, and so on.

    I find it hard to believe that we're going to have OS-level DMA transaction code written in Java or C#.

    I once read in a visual basic for dummies manual (or was it Delphi?): "Trying to write an Operating System in Basic is like trying to fly to the moon in a hot air balloon".

    At some point, you've _GOT_ to talk to the hardware.

    - Paul

  36. Why C needs help by ttfkam · · Score: 5, Insightful
    The real question is this: would you rather program against the pitiful number API's that come with C#, or the huge Free Software diversity that you get with C?
    Or read a different way, would you rather program to a uniform API for GUIs that are accessible to many languages including C# or the huge Free Software diversity of GUI APIs that are all incompatible but still just make a button and a checkbox.

    Or we can look at it like this: "Wouldn't it be better to have many different toolkits that allow string concatenation and tokenization than one standard library of string functions?"

    Or maybe this: "Isn't it great that we have several different native APIs for threads, processes, and IPC depending on underlying platform, five different and incompatible implementations for cross-platform usage, and no way to easily switch between implementations after the project is underway?"

    And next shall we talk about databases? Or maybe sound processing? Or regular expressions? Hmmm...

    The thing that C zealots fail to recognize is the need for clean, standardized APIs (NOT implementations). If you write code that uses strncmp(...), aren't you glad that you don't have to worry if the C implementation is the BSD libc or glibc or MS Windows' C library? Don't you wish the same could be said for the user interface libraries -- for example being able to swap out the Qt or GTK+ implementations at compile or link time? Or the database libraries? (ODBC? Don't make me laugh.) But you can't because each implementation has its own interface even though a button is a button, a checkbox is a checkbox, a database connect is a database connect, a regexp is a regexp, etc.

    This is what .NET gives; Not the mandated implementation, but much better it gives the recommended interface. If the C folks get it together and standardize more than just things like printf(...) and linked lists, you will get no end of gratitude from me and the gratitude of folks who are tired of reinventing the wheel and solving problems that were adequately solved twenty years ago. Unless that happens, you're gonna see more and more people moving to things like .NET and Java, warts and all.

    POSIX was a good start, but it has stagnated and is showing its age.

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
    1. Re:Why C needs help by Temporal+Outcast · · Score: 2, Informative

      I agree with some of your points, but I will have to disagree on some.

      The thing that C zealots fail to recognize is the need for clean, standardized APIs (NOT implementations).

      Ahh, but this is where you are wrong. C was initially written to be used for writing an Operating System - something above Assembly but a little more sophisticated.

      The basic language needs to adhere to a standard ANSI C, or whatever - that is all. Which it does.

      Now all other frills and bells and whistles cannot really be blamed squarely on C - its like blaming MFC and OWL and STL for being non-standardized in C++. APIs are not platform independent, and hence how can the implementations be different?

      The thing is that, there is no real need for C in enterprise level applications until they have some kind of low-level interface.

      But I do realize that most of your points are valid, however am just offering my 2 cents.

      Just that when you use the wrong tool for the task, some problems are inevitable :)

      --

      Vote for a Man, Vote for Bush!
      Not a liberatarian flipflop hippie.
    2. Re:Why C needs help by Anonymous Coward · · Score: 2, Informative

      DotGNU Portable.NET has a C# compiler and a C# class library which can be called from managed C (and vice-versa). Managed C in pnet is the first step towards a _portable_ managed C++ (MS's managed C++ is completely unportable). DotGNU is all about Free(dom) Software for webservices and fighting against vendor-lockin traps. Portable.NET is DotGNU's way of providing reasonably easy migration away from MS.NET, by providing a compatible C# library and IL runtime system.

      As a GNU project, we also want to make it easy for existing Free(dom) Software to be used with the CLR (common language runtime). At the very least, our portable managed C makes calling out to native C libraries easier. Rhys worked some magic and now the type sizes and layouts match those for the platform it's on, so data marshalling is greatly simplified (i.e. there's no more need to write a C wrapper of the native libs just to write a C# binding to that wrapper for wrapping native libs... cut out the middle man ;).

      As hackers who have had to dig into every corner of the ECMA and MS C# apis in order to implement them, we are very familiar with just how much they suck (e.g. most of the MS api designers seem to be incapable of writing anything even remotely OO).

      By the way, there's absolutely nothing in the ECMA or MS apis related to sound. Rhys mentioned something about providing a portable sound api for managed code, though, not too long ago. He's probably got it on the back burner for now, but since he's a hacker god, it should come out great once he gets to it. ;)

      Rich

      P.S. That whole problem with lots of GUI apis seems to be addressed quite nicely, imo, by the Y Windowing System.

    3. Re:Why C needs help by humankind · · Score: 2, Interesting

      C gives you huge control over your operating environment, without obligatory overhead. This is a tremendous advantage in any scenario where you need stability and performance. Higher-level languages make you much more dependent upon the environment.

      I wrote a shopping cart application that uses 23K of RAM and processes more than $2M in transactions online a week. I can handle more than 300 times the traffic than a comparable Windows server with this application and it's rock solid. I don't worry about bugs in the API; I don't worry about stability issues. Things work the way they should.

      Then again, I get paid to get things done, not by the hour, so that's why I work with C.

  37. language bindings Re:KDE, language support by aaron_pet · · Score: 3, Informative

    There are python bindings for kde, as well as many others.

    --
    Please use [ informative / summarizing ] SUBJECT LINES
    Flame me here
  38. Please stop C++ calling portable by Fuzuli · · Score: 5, Insightful

    Please don't. Yes C++ as a language has compilers for many platforms which are pretty much compatible, but the degree of compatibility of these compilers don't mean much since the compatibility of an application is a totally different story. An application written in C++ will be using some kind of library, for DB access, for GUI, for network operations etc... Most of the times, these libraries are not cross platform. Or they have to be extended with platform spesific code. It has been discussed in /. many times, check it out yourself. Cross platform GUI, cross platform libraries, and there is almost always a catch in all the solutions.
    The story may change if you are writing C++ code that can stay in some kind of boundy, without using much library code, but unfortunately, i did not have that chance.
    IMHO, java is really successfull in cross platform software development, without much work i can make java software work on another platform.
    If C# had the same future, i'd be really glad, since i like it too, but as Microsoft works harder and harder on .NET i just don't believe MONO guys can keep up with it. C# 2.0 and longhorn will be a huge step forward for .NET technologies, and i don't thinkk MONO team can find resources to keep up with MS.
    Don't get me wrong, i loved the work they've done, but the result will be a platform inferior to java 1.5 and .NET.
    So i'll be using C++ for platform spesific, high performance apps, C# for windows apps that require rapid development, and JAVA for cross platform. That's my 2 cents...

    1. Re:Please stop C++ calling portable by tftp · · Score: 2, Interesting

      Qt (commercial license) costs something like $1500 per developer, once in a lifetime. The same developer herself costs you $2000 weekly. Now consider developer's performance increase, and it appears that a good library pays for itself within a week or two!

    2. Re:Please stop C++ calling portable by WARM3CH · · Score: 2, Insightful

      C++ as a programming language is perfectly portable. Now, you may write programs that depend on certain feature of the platform (like many libraries out there) that make them not portable. Surprizingly, Java is very poor when it comes to portabilities. How many of you know of Java programs running on other platforms other than the Java VM?!! The point is in the Java model, you actually port the whole platform to run on top of a different one, not the just the Java complier alone. So portability in C++ is in language level but for Java is in platform level.

    3. Re:Please stop C++ calling portable by ALLXSTHINGS · · Score: 2, Funny

      Silly, your program will never call portable() unless you tell it to.

  39. Not that simple by xswl0931 · · Score: 4, Insightful

    Of course you'd also have to disassembly every library MSOffice uses and every library those libraries use which includes the NT kernel. So by the time you're done, you'd be running Windows in a JVM just to run MS Office.

    1. Re:Not that simple by Tumbleweed · · Score: 4, Funny

      Hey, that might just speed up MS Word enough to be usable! :)

      (it's a _joke_, laugh!)

    2. Re:Not that simple by WARM3CH · · Score: 2, Interesting

      Not really funny. Guess you've never tried to compare the performance of Ms Word and Open Office on the same machine...

  40. Re:So... by GnuVince · · Score: 5, Insightful
    What's more, Miguel de Icaza (the guy who said that) was talking about user applications. Unless someone can explain to me why a garbage collector for an IRC client or a payroll application is a bad thing, why I should fear buffer overflows, problems with pointer arithmetics, etc. in those kind of applications, please tell me. Does the programmer need to spin my hard drive backwards or something? It seems to me that high-level languages will do just fine for those tasks.

    You know the old adage, "Use the right tool for the right job?" Well, use C when you need it. C is probably the most misused language I've ever seen. But of course, this is Slashdot, the land where opinions are forged and are never to change.

  41. Re:Let it die! by Temporal+Outcast · · Score: 5, Interesting

    Flamebait.

    Remember, a language does not cause overflows - careless and stupid programmers do.

    C is built for low-level interface, and its best suited for that purpose. Its lean and mean, and thats how its meant to be.

    If you want complex exception handling and all that, you are probably using the wrong language for the task.

    Blame the people who used C for the wrong task, not the language.

    --

    Vote for a Man, Vote for Bush!
    Not a liberatarian flipflop hippie.
  42. No pointer operations for JVM by Gopal.V · · Score: 2, Informative

    JVM doesn't have any pointer operations ... IL does .
    Which means you get a set of pointers which play nice ...

  43. I would take C++ over Java/C# anytime by iamacat · · Score: 5, Informative

    ... if I had an equivalent set of class libraries. Haven't actually seen one for C++, but Cocoa for Objective C is pretty good and there is an ObjC++ compiler.

    The way I see it, the benefit of garbage collection is nearly canceled by the lack of stack variables and guaranteed destructor calls. I want to just declare a "Socket" variable in the middle of my function and have a guarantee that the socket will be closed when the block is existed in whatever way. finally or with just don't cut it. Say, I use 2 sockets, 1 file, a mutex and a temporary hash table entry at different points in a function. Imagine the mess of nested blocks, especially since Socket.close can actually throw an exception!

    By contrast, memory management problems in C++ can be mitigated by destructors, reference counting and containers that automatically free members. Not ideal, but usually doesn't disfigure your code.

    Now add other things missing from Java and/or C# - preprocessor, templates, multiple inheritence, operator overloading, unsigned types - and the new languages are really not that compeling for large projects that need heavy-duty, "dirty" features to manage complexity and can afford a regression suite that runs under Purify to fix memory corruption or leaks.

    I know Java 1.5 has generics and C# has some more of C++ features compared to Java, but the matter of fact is that both languages are still tradeoffs compared to C++ in terms of productivity and stability rather than a clear step forward.

    I would like to see a language that preserves as many features of C++ as possible while adding garbage collection, memory safety, language-based security and guaranteed binary compatibility between platforms/OSes. I don't think managed C++ is "it". Why can't a VM support multiple inheritence? Any pointers?

    1. Re:I would take C++ over Java/C# anytime by Caine · · Score: 2, Informative
      The way I see it, the benefit of garbage collection is nearly canceled by the lack of stack variables and guaranteed destructor calls.

      In both languages you can force a garbage collection of an object, and also specify code to be run att finalization.

      By contrast, memory management problems in C++ can be mitigated by destructors, reference counting and containers that automatically free members. Not ideal, but usually doesn't disfigure your code.

      Are you kidding me? Ugly hacks like refcounting doesn't make your code ugly? Heh, yeah, sure.

      Now add other things missing from Java and/or C# - preprocessor, templates, multiple inheritence, operator overloading, unsigned types - and the new languages are really not that compeling for large projects that need heavy-duty, "dirty" features to manage complexity and can afford a regression suite that runs under Purify to fix memory corruption or leaks.

      Seriously, do you have any clue what you're talking about? The need for preprocessor and templates are some of the largest faults with C++, introduced to try to keep backwards-compatability with C. A real OO-language as Java or C# doesn't need for example templates since all objects inherit Object as they should. They also both have usigned types. Multiple inheritance is usually seen as A Really Bad Idea and should be done with interfaces.

      To conclude, you're a moron.

  44. languages are tools god dammit by lordholm · · Score: 5, Interesting

    Claiming C is dead is plainly stupid. Languages are tools, not religions or whatever. Languages have their weaknesses and their strengths.

    Fortran is extremely good for producing high performance number crunching code (it forbids array overlapping, and thus several assumptions can be made by the compiler). C is very low level and I would hardly chose another language when writing an operating system, it is also a fairly general purpose language, good for many things. If I am writing a GUI-app I would surely pick an object oriented language such as C++, Java or Objective-C. If I write a 3d engine, I'd like performance and an object oriented approach and I would chose either C (combined with self discipline) or C++.

    The portability of Java and other byte code languages is surely appealing, but they usually produce a terrible user experience since the applications produced tend to have a user interface compliant with the developer's OS (mixed with the language's own HI guidelines). A Java app written by a Windows developer would probably look like a Windows app, even on a Mac, and the other way around. Consistency in user interface is very important I think, so my hope is that people write code according to the MVC principle, and thus ease porting of the application to other platforms. Just to note, I'm not condemning Java, it is a very useful language if you want an internal application that is to be deployed on different systems. Say that the graphics departement (using Macs) and the economics departement (using Windows) both need access to some internal database or application, then clearly Java is the way to go.

    Anyway, select your language after the task at hand and write code with discipline!

    --
    "Civis Europaeus sum!"
  45. c++ by savuporo · · Score: 2, Insightful

    Well, couple years ago i was really keen on becoming a 100% C++ writer and ditch my C habits entirely.

    Due to the nature of most of my projects, like 90% of my time was spent writing wrappers for all sorts of C-style API interfaces.

    Finally i gave up and embraced the zen - pick the right tool for the right job. Being proficient with all sorts of tools helps too.

    --
    http://validator.w3.org/check?uri=http%3A%2F%2Fwww.slashdot.org Errors found while checking this document as HTML5!
  46. Re:Let it die! by mpmansell · · Score: 2, Insightful

    Phew!! Thank god for your comment. It saved me a lot of typing :)

    On the subject of careless and stupid programmers with C, how about starting a movement to execute people who ignore warnings because they are only 'warnings' :)

  47. Mod parent up by Anonymous Coward · · Score: 2, Funny

    C is a gift from the Gods.
    C++ is a gift from the Devil.

  48. C is alive, not becoz of Portable.Net by cyberjessy · · Score: 3, Interesting

    I have been doing Windows development for quite some time now. Both low-level and applications(these days).

    C will not die becoz,
    Most of the real high performance stuff is still written in C. Take Windows drivers for example. The only other option would be C++, but then when it gets down to that level you try to squeeze out every bit of performance. What I have noticed it that when you look at the complexity of writing a Windows device driver, the relative complexity of C versus C++ becomes a non-issue in most cases.

    You cant write OS/drivers in bytecodes.

    But:
    There is no point in a .Net C compiler. If you are writing applications its better to use Java or C# anyday. C code does become unmanageable(pun intented) as the project size increases. You need all of encapsulation and inheritance to avoid nightmares of one huge gorilla staring at you!

    Maybe i exagerated when i said no point. Maybe for small projects, components that need to interoperate with the rest of .Net. But not for anything big.

    --
    Life is just a conviction.
    1. Re:C is alive, not becoz of Portable.Net by jhoger · · Score: 3, Informative

      > You cant write OS/Drivers in bytecodes

      Forth? OpenBoot? The currently alive OpenBIOS project?

      QED

  49. yeah no kidding. by torpor · · Score: 2, Interesting

    even in the windows world, i'm still seeing *FAAAR* more c/c++ work than anything else around.

    of course, i work in embedded, so i'm not necessarily in a position to judge windows. in my world, C still rules the roost, and probably will for a loooong time.

    --
    ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
  50. And how is this going to work? Paradigm clash! by Otis_INF · · Score: 4, Interesting

    C is a procedural language. .NET is an OO platform. Really using .NET in a C program requires a lot of pointerarithmetic, which will make the C source not that readable.

    All languages on .NET have to adapt the OO paradigm set for .NET in one way or the other, OR it requires serious compiler efforts (Eiffel) or just plain slow code (creation of objects behind the scenes and then call the method of choice). Finding static methods which do the same as the methods in stdlib and stdio is doable and will work, the real pain begins when a lookalike method of a stdlib or stdio routine is not static in .net, so a whole object has to be created.

    That will not always work in all cases.

    And what about interlanguage operability? An assembly in IL can be referenced from any .NET language like VB.NET or C#. How is the C program presented to C#? As 1 class with a very big pile of methods?

    --
    Never underestimate the relief of true separation of Religion and State.
    1. Re:And how is this going to work? Paradigm clash! by Gopal.V · · Score: 2, Interesting

      The GNU CPP has been hacked to add namespace support ... so that the following DotGNU.SSL.h can be used in C .

      Read Pnet C ABI ... for the info on all the other questions

  51. Computer languages form an ecosystem by Diomidis+Spinellis · · Score: 5, Insightful
    Judging from some previous comments, I see that some fail to grasp that modern computer languages form a large ecosystem. Each language has its purpose, and one can not easily dismiss a language as dead, just because some other, ostensibly more powerful language has appeared on the block. Monkeys, whales, cockroaches, ants, and plants continue to coexist with humans.

    When I want to solve a program I choose the language I will use, taking into account the abstractions and facilities it offers.

    #include "/dev/tty"

  52. popularity by mpmansell · · Score: 3, Insightful

    I suspect that when people talk about the popularity of a language fading, they are really talking about the percentage of developers using it.

    This doesn't really tell anyone if the number of people using the language has changed. Given the explosion of programmers in recent years, be they professionally trained, or weekend dabblers, it is likely that they are using the current faddy or new languages, like Java, C# or VisualBASIC (not meant as flamebait; I use them myself when engineering requirements suggest them). This for the most part because their emphasis is on making pretty UIs and not any of the more traditional processing or server applications.

    This 'explosion' of users with new languages doesn't mean that the old Fortran, Cobol or C applications will immediately be re-written in BoltsN.Nuts or whatever the latest and greatest is. These people will, quite sensibly, plod along with the tried and tested and will probably even continue developing within these skillsets.

    The requirements for these skills may well have stayed the same, while the requirement for GUI apps and amateur (some calling themselves professional) developers has increased.

    Before anyone can say a language is dying, lets see the figures. For all we know, these dying languages could even be growing (in numbers, if not percentage). Besides which, who should really give a damn?? If it works for you, use it. If it doesn't, but you're not harmed by it, live with the fact that the Borg haven't yet asssimilated us all :)

  53. Re:Let it die! by LarsWestergren · · Score: 2, Insightful

    Remember, a language does not cause overflows - careless and stupid programmers do.

    But why have a language that enables the possibility for careless and stupid programmers like myself to do overflows?

    "Sir, perhaps its the fact that we put the self destruct button next to the light button on our new combat vehicle that causes a large number of them to explode?"
    "Button proximity does not cause explosions! Careless operators cause explosions!!"

    When I subscribed to Bugtraq, it seemed most of the vulnerabilites discovered (a couple per day) was caused by buffer overflows. The number of vulnerabilites discovered in Java systems (for instance) were rather few, and tended to be for things like DOS attacks, not getting your whole system security compromised.

    Not that I think C is going anywhere, it is still going strong in Unix/LInux land and I like the fact that there are many different languages around. Just commenting on that particular sentence above. :-)

    --

    Being bitter is drinking poison and hoping someone else will die

  54. The real question by jandersen · · Score: 3, Insightful

    "The real question is this: would you rather program against the pitiful number API's that come with C#, or the huge Free Software diversity that you get with C? The death of C has been greatly exaggerated. It will adapt - it always has."

    No - that's not the real question; it's: 'Oh no, not yet another C-like language!?'

    What's the point, actually? C# is not something new, it's just an attempt to 'get the colour exactly the right shade of pink'. The truth is - C (the language) is precisely what it should be. So perhaps it would be nice to protect the more inept programmers against themselves, but that is simply a question of the runtime- and development environment, or perhaps some improved libraries.

    As I always say: a good programmer can write good code in any language, and a bad programmer will not write good code in any language; it's as simple as that, really. This is because good programming is about good coding and debugging practice, both of which are independent of whichever language you use.

  55. pitiful number API's by selderrr · · Score: 2, Insightful

    It's a common misconception that you need a ton of API's. up to a few years back, I also fell for the DEVStudio GUI builder, the MFC framework, and the libraries that orbit it. After 5 years of trying to get a hold on the beast, I met someone who had stepped back from all frameworks, and went back to ordinary console C and C++. I walked his footsteps, and my apps got reduced to 15% of their original size. Okay, the dummy users needed a few days more to learn the app, but with solid documentation, this was not an issue. And after 2 months, some RealBasic nutcase wrote a GUI wrapper on top of it in 1 week. Perfect !

  56. Thank God! by jasonditz · · Score: 4, Funny

    I was just wondering where I could get a C compiler.

  57. litmus test for programmers by humankind · · Score: 4, Interesting

    C is a brilliant language. It's beautiful and elegant. I don't need validation from any other entity to legitimize the *world's most successful computer language* that most of the major apps on this planet have been written in.

    This whole story is a big troll, and if you're not a serious programmer, you wouldn't know it.

    Boo hoo... built-in string boundary checking in newer languages. If anything, C is the catalyst for a plethora of invaluable programming habits that today's programmers seem to take for granted.

  58. Languages don't die by DerPflanz · · Score: 5, Insightful

    I know the quote was wrong, and thus the entire discussion is senseless. But still, there are things to say about a language dying: (computer) languages do not die. Period. All of the languages ever invented are still used somewhere. People still use FORTRAN, COBOL, C64 BASIC and all kinds of other weird languages.

    Besides, why would one of the most powerful and widely used and known languages (C) die? It is like saying noone uses a normal screwdriver anymore, just because they own a battery-powered one. Sometimes you just use the normal one, because it is easier, faster and it just works.

    --
    -- The Internet is a too slow way of doing things, you'd never do without it.
  59. C is good but... by polemistes · · Score: 2, Funny

    I used to love C, but then I found something much better: Assembly language; pure and clean machine code. It has lots of advantages:

    • You get full control. Turn off this multi tasking nonsense. Search into the depths of power you never knew existed in your box.
    • Unending possibilities for optimalization of your code. You could use a whole lifetime to figure out the quickest way of calculating the distance the Earth travels during the time you are coding the routine.
    • You can make code that works on your own machine, and no one else's. So if someone likes your program, they have to pay you to create a new one for their machine as well.
    • Nobody but you will understand the code you're making. So you can release your program as Free Open Source, and people still have to pay you to make changes and updates.
  60. Importance of compiling C to portable executables by bizcoach · · Score: 4, Insightful
    the developers of C# (i.e. the people developing the language, not with the language) made sure that one can easily make use of C and C++ code and binaries already in existance. You can already call all the C/C++ APIs.

    Sure, but this helps only if you can assume that those compiled C and C++ binaries are already installed on the user's computer. The main point of "compile once, run anywhere" is to be able to distribute a compiled program that will run anywhere. Of course in DotGNU, we don't define "anywhere" as narrowly as the Microsoft monopolists do:

    Unlike Microsoft's C compiler, whose output will only run on i386-based Microsoft Windows systems, our compiler turns portable ANSI C code into a truly portable executable that will run any platform that has a CLR ("Common Language Runtime"), regardless whether the system is 32-bit or 64-bit, little-endian or big.

    Or is it because of some form of hatred towards C#

    No. It's because there's a lot of C code out there that people might want to use from C# and other modern languages. Throwing that C code away and re-implementing in another language would be a waste of time.

  61. What type of documentation? by edxwelch · · Score: 2, Insightful

    "Most of the times, these libraries are not cross platform"
    Well, duh, the claim is c++ is portible not "all libraries that c++ uses are portable"

    Having said that I would say that there are degrees of cross-platform-ness. Java being much closer to the ideal than c++.

  62. Hi. You don't know what you're talking about. Bye. by hummassa · · Score: 2, Informative

    Uh, you can't run bytecode on a raw machine.
    Yes you can. There are several java-bytecode hardware microprocessors.
    C and Assembler are what make the computer world run.
    false. C and assembler are 20%-100% faster to execute, but 1000%-10000% slower to develop in.
    You can't make Java in Java.
    Yes you can. *and* you can make csc in c# (see here)
    C turns directly into executable binary (or object files then linked into executables). Java cannot.
    Look up gcj.
    I suppose that if you were insane enough, you could make a bytecode to opcode converter, but then you lose 100% of the point of the langauge, probably a lot of the efficiency, and at that point you may as well use C.
    As we were in the subject of python, look up psyco.
    Man, this is the highest density of crap in the same paragraph I have ever read in /.

    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
  63. Re:So... by cpghost · · Score: 2, Insightful

    It has been said many times before, but it's worth reiterating: [nearly] all of those wonderful runtime environments, and interpreters are written in C. Sometimes, language designers try to implement a self-hosting interpreter (like, say, scheme in scheme, ...), but even here, it still has to be bootstrapped somehow. Unless you want to do this in (unportable) asm, you still need C.

    --
    cpghost at Cordula's Web.
  64. Poor Perspective by Mark_MF-WN · · Score: 2, Insightful
    Why would the rampant success of bytecode and interpreted languages have any effect on C? Don't get me wrong -- Java, Python, and PHP are three of the best things to EVER happen to Software Development. But that hardly makes C any less important.

    It's like comparing the importance of your spinal cord to the importance of your kidneys. They both kick ass and serve a particular purpose; in many cases they complement each other wonderfully. And let's not forget that Python and Java both use C as an extending languge.

  65. "the pitiful number API's that come with C#" by gatkinso · · Score: 3, Insightful

    Way to completely miss the point of language independence.

    --
    I am very small, utmostly microscopic.
  66. Language != Libraries by rjshields · · Score: 2, Insightful

    C++ is perfectly portable if you don't use platform dependent libraries. You seem to be blaming the language because people develop platform dependent stuff for it! If your goal is to port stuff to another platform then obviously you start off with that in mind.

    There's plenty of platform dependent Java code out there, or stuff that doesn't port properly.

    --
    In this world nothing is certain but death, taxes and flawed car analogies.
  67. You Sound Like by Mark_MF-WN · · Score: 2, Informative
    You sound like an assembly-language advocate. They too are known for praising the silliest qualities of their chosen language.

    C's only strengths are speed and easy access to hardware.

    String boundary checking SHOULD be a feature of any modern language -- or do you enjoy buffer overflow exploits?

    1. Re:You Sound Like by Mark_MF-WN · · Score: 2, Insightful
      Buffer overflow problems are indicative of a lazy or inattentive programmer. I won't go far as to say that only lazy/inattentive programmers are unhappy with C's lack of string (array, really) boundary checking, but it seems to me that it is really easy to avoid.
      Do you really believe that the developers of Linux, Gaim, Windows, BSD and/or Unix, and basically every other piece of widely used software, were lazy or inattentive? In fact, how many pieces of software can you name that have NEVER had a buffer overflow exploit?

      I bet you don't like seatbelts (only poor drivers need them!) or hospitals (just for people who are careless and don't look after themselves!) either.

  68. This is a weird one by dnoyeb · · Score: 4, Insightful

    On the one hand, the article here is misleading. The slashdot news story it cites claims 'c' is dying, but the article that news story cites does not. So the cited story got twisted on slashdot.

    So now we have a new slashdot story running with the mistake...

    The majority of CPUs in today's world are not running desktops.

    Things with C
    Linux
    compilers
    Automotive
    engine controllers
    ABS controllers
    Airbag controllers
    Memory seat controllers
    etc...
    Calculators
    desktop BIOS and chipsets
    Cell phones
    etc...

    Most code written to run on the hardware is written in C. So the contention being refuted is faulty in the first place.

  69. Java vs C vs C# by jarich · · Score: 5, Informative
    A few thoughts....

    C# whips the tar off of Java (and most non-optimized C code) in most benchmarks. Why? Because it's running on Windows only for these benchmarks. Anyone remember IIS running faster than Apache because of MS taking advantadge of undocumented platform APIs?

    Do you think C# on Linux/BSD/*nix is going to be near as fast as C# on Windows? Think again. It may eventually catch up, but not before it gets a reputation for being dog slow. (See Java as an example).

    C is really fast. If you know how to optimize it, nothing can beat it (except assember or some special Fortran routines, if it works for you project). If you ~don't~ know how to optimize C really well, Java (anywhere) and C# (on Win32) can be as fast or faster. Usually is much faster, these days.

    Java runs, with very little effort, on every major OS and platform out there. (And yes, I do this for a living). I work at SAS (http://www.sas.com) and we ship the same codebase on Win32, HP-UX, HPi, Linux, Solaris, AIX, etc. The advances in the Just In Time compilers has made a huge difference in performance. (There are some differences in the major J2EE environments, but even that is addressable and minor compared to an entire product port).

    Yes, it's still true that a programming guru can write some smoking C code, but Joe Sixpack Programmer usually can't beat Java's performance. And yes, I'm talking big number crunching. At a prior job (at a biotech), we crunched Big Numbers (two month runs on a grid of machines) and Java did a very respectable job. We spent our time improving algorythms (from a bio point of view, not a C/ASM point of view).

    The C#/Mono crowd is spending a lot of mindshare in making sure that MS's latest language will run anywhere, and that's great. I am glad they are doing it and applaud the effort.

    But Java is far and away the fastest true cross platform language out there right now. It's got the best cross platform enterprise environments available. If you are looking the most speed ~and~ portability, the King isn't dead yet. :)

  70. And another apocryphal quote is born... by caudron · · Score: 2, Interesting

    The article is referring to the recent claim that Miguel said that "C is dead". The problem is that it's quoted out of context and is getting rehashed so much that people are gonna forget that it was never actually said.

    This article implies a great deal, but the reality is that Miguel never said C was dead. He said that to him C was dead, meaning that he intended to focus his programming time on C#. Pretty reasonable statement given that he's in charge of a project that's porting it to linux.

    Surprisingly to the language zealots among us, Miguel is allowed to write code in whatever language pleases him.

    --
    -Tom
  71. The point? by DrXym · · Score: 3, Insightful
    What is the point of a C which presumably has been stripped of low level control, pointers etc. to run on .NET? You don't even benefit from any speed advantage because you're running through an interpretter / JIT.


    Having seen side by side comparisons of J#, C# & VB running on .NET it's hard to see why multiple languages exist at all. Any reason for using one language over another has just about disappeared. It is the same code using the same assemblies, with slightly different syntax. The language itself has become an irrelevance.

  72. Please stop JAVA calling portable by CarrionBird · · Score: 2, Insightful
    JAVA only works on one platform, the JVM. And there are so many little differences in JVMs that most java apps of any size I've are anything but "write once, run anywhere".

    Also, if you want protabe C++ code, all you have to do is draw a firm line in your design between platform specfic and the rest of your code.

    --
    Free Mac Mini Yeah, it's
  73. Language Piggy-Backing by SloppyElvis · · Score: 2, Interesting

    Ok, so I think the writing on the wall reads, "M$ will be requiring code to run through the .NET CLR", if it is to run on Windows.

    So, in response, we have C compiling to bytecode. But, Longhorn will require bytecode assemblies to be signed; I suppose that could be built into the compiler as well (else wouldn't we lose portability?)

    I was thinking along these lines a while back, and thought to myself, "What's to stop somebody from writing an interpreter for any language (I was thinking scripting at the time) that will run as a .NET app? [Ruby was on my mind]

    What's the impact of doing this, you ask? Well, if the interpreter itself is the signed certificate-backed secure executable, then any little scriptlet or homebrew app could be run without being digitally signed!

    To me that allows a fairly obvious circumvention of Palladium, and "trustworthy computing" is out the door.

  74. What about LLVM? by sabre · · Score: 2, Interesting

    Check out LLVM: http://llvm.cs.uiuc.edu/

    It gives the advantages of bytecode compilation (linktime & runtime optimization, JIT compilers, etc) to both C and C++ (using the GCC parsers). In addition it has a powerful interprocedural optimizer, so it generates code that truely thwomps GCC in some cases. :)

    -Chris

  75. Pitiful number of APIs? by BRSQUIRRL · · Score: 2, Informative

    would you rather program against the pitiful number API's that come with C#

    Completely ignoring the fact that no APIs could "come with" C# because C# is just a one of many languages that compiles to .NET CLR bytecode (thanks once again for showing your complete ignorance of .NET)...I have written a lot of .NET apps and have yet to find myself needing some functionality not already provided somewhere in the .NET class library. It is (by far) the richest set of application APIs I have ever developed with.

  76. cross platform libraries by hak1du · · Score: 2, Insightful

    Yes C++ as a language has compilers for many platforms which are pretty much compatible, but the degree of compatibility of these compilers don't mean much since the compatibility of an application is a totally different story. An application written in C++ will be using some kind of library, for DB access, for GUI, for network operations etc... Most of the times, these libraries are not cross platform.

    Well, they are cross-platform if you are writing a cross-platform application, and they are not cross-platform if you don't.

    Furthermore, the kind of cross-platform compatibility people primarily worry about with C++ is for libraries: it is things like regexp libraries or XML libraries that are going to be reused across platforms; GUI and I/O parts of applications are best developed in a platform-specific manner.

    Or they have to be extended with platform spesific code.

    For some reason, Java marketing has created the notion that cross-platform development matters a great deal, but that is nonsense. Cross-platform development (and sandboxing) matters for browser applets, a market that Java has largely ceded to Flash. For desktop applications and server-side applications, cross-platform applications don't matter at all.

    Writing in a cross-platform toolkit and adding a small amount of platform-specific code is actually far superior to the 100% cross-platform approach: it is nearly as easy to port the application between platforms, but the application becomes enormously more usable by following platform-specific conventions and offering platform-specific functionality.

    What it comes down to is that C++ is a better language than Java for cross-platform development. C# may eventually supplant C++ in that regard, because C# is simpler and safer, but still offers C++'s access to platform-specific features. But Java's religious insistence on what they incorrectly call "cross-platform" support actually is counterproductive.

  77. Garbage Collection in C by hal2814 · · Score: 2, Interesting

    I've been reading through this post and one thing irritates me. Everyone is acting like C has no garbage collection facilities. While garbage collection is not built into the language, there are several garbage collection libraries that can be linked into C. In fact, most of them merely replace malloc with some garbage collection code and replace free with a do-nothing routine. Linking the garbage collection libraries into the C code automagically sets up garbage collection and will allow you to recompile existing code with garbage collection enabled. Here's a sample library (first result searching 'garbage collector c' in Google):

    http://www.hpl.hp.com/personal/Hans_Boehm/gc/

  78. Java GUI APIs by ttfkam · · Score: 2, Interesting

    Nothing is static. That was my complaint about the standard C library. It is static... stagnant... showing its age.

    This does not diminish the fact that AWT was the first Java GUI API. It had limitations. It was redesigned to be truly cross-platform and dubbed Swing. As far as the API is concerned, I happen to like the Swing library. Is it "THE ONE TRUE GUI API?" Of course not. Nothing is or ever will be. It was the best they could come up with at the time. Now, when someone learns the standard Java GUI API (or just about any other Java API for that matter), they can transfer those skills to other Java projects much more easily than C coders can in C projects.

    SWT? A nice start. It is not as complete, does not run on as many platforms, nor is as widely used as Swing. But it shows promise. In five more years, who knows? That's the point. Right now, there is a standard API that everyone knows and other APIs (that aren't drastically different from the AWT/Swing API by the way) being tried out to find better ways of doing things.

    Mono's choice of GTK# is in my opinion a bad move. It's also unfortunate that Microsoft hasn't opened up the APIs for the Windows GUI libraries. I understand their reasons for doing it (Microsoft patent threats), but the culture of C is too strong. Instead of writing a new, GUI toolkit agnostic interface API, they intimately tied it GTK.

    C and the programming culture it fosters is building on sand; New APIs are constantly (and in my opinion, unnecessarily) being written all of the time, but there's no common base for others to work on nor to use as a base API design reference. Imagine how much more software would be written if folks didn't have to battle over GTK/Qt, MySQL/PostgreSQL/ODBC client libraries, ALSA/OSS, etc.? Would it be so terrible to tell people, "OpenGL is the standard API interface for 2D graphics in C. How you implement the OpenGL layer is up to you, but use the standard header files so that people can just recompile/relink to use a different implementation.

    Don't think it's necessary? Let's look at the history of UNIX, the original C program. The API wasn't standardized and set in stone. Different vendors went their own way in an attempt to lock the others out of their turf. UNIX programs commonly became a mess of #ifdef statements. The Windows came in touting a common API for Windows with COM. Any language (well, the common ones... VB, C, C++, etc.) could use these objects. They had a well-defined API. New implementations (eg. Perl for Windows) could be modified to access these objects as well. It didn't matter what language the COM object was written in. It didn't matter what language you were using. Write to the interface and be done with it. COM had warts. Everything does. .NET fixes many of those warts.

    The C community on the other hand just sticks its head in the sand and collectively says, "Look! They didn't do it perfectly. They suck! We rule!"

    The C community should be saying, "Look! None of us did it perfectly. Let's make our baby better by taking some of their good ideas and incorporating a bunch of our own."

    Mono and Java have warts, but at least they're trying. What's C got show for thirty years? Variable length arrays in function declarations? That is the best thing anyone could come up with for C99? Hey folks! There's an elephant in the corner! It's name is "incomplete standard library." I know no one wants to talk about it, but it's there and taking up too much space at the party!

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
  79. Re: I find C++ very portable by Qwavel · · Score: 3, Informative

    C++ is very portable if you choose compilers and libraries that are standards compliant and portable, which is now easy.

    VC 7.1 (finally), GCC 3.2, the new Intel compiler - these are all very compliant with the standard. And remember that GCC, though not yet well optimized, runs almost everywhere.

    The C++ Standard Library, the boost libraries, wxWindows, Qt, + 100 other libraries are all cross-platform.

    Now compare this to the huge amount of work required to 'port' #develop from Windows to Mono.

    All that's missing with C++ is a processor independent intermediate code, and that's coming in GCC 4. It's called LLVM.

    Tom.

  80. couldn't resist by stephenisu · · Score: 3, Funny

    It is now official - Netcraft has confirmed: C is dying Yet another crippling bombshell hit the beleaguered C community when recently IDC confirmed that C accounts for less than a fraction of 1 percent of all languages. Coming on the heels of the latest Netcraft survey which plainly states that C has lost more market share, this news serves to reinforce what we've known all along. C is collapsing in complete disarray, as fittingly exemplified by failing dead last [samag.com] in the recent Sys Admin comprehensive networking test.

    You don't need to be a Kreskin [amazingkreskin.com] to predict C's future. The hand writing is on the wall: C faces a bleak future. In fact there won't be any future at all for C because C is dying. Things are looking very bad for C. As many of us are already aware, C continues to lose market share. Red ink flows like a river of blood. FreeC is the most endangered of them all, having lost 93% of its core developers.

    Let's keep to the facts and look at the numbers.

    OpenC leader Theo states that there are 7000 users of OpenC. How many users of NetC are there? Let's see. The number of OpenC versus NetC posts on Usenet is roughly in ratio of 5 to 1. Therefore there are about 7000/5 = 1400 NetC users. C/OS posts on Usenet are about half of the volume of NetC posts. Therefore there are about 700 users of C/OS. A recent article put FreeC at about 80 percent of the C market. Therefore there are (7000+1400+700)*4 = 36400 FreeC users. This is consistent with the number of FreeC Usenet posts.

    Due to the troubles of Walnut Creek, abysmal sales and so on, FreeC went out of business and was taken over by CI who sell another troubled OS. Now CI is also dead, its corpse turned over to yet another charnel house.

    All major surveys show that C has steadily declined in market share. C is very sick and its long term survival prospects are very dim. If C is to survive at all it will be among OS hobbyist dabblers. C continues to decay. Nothing short of a miracle could save it at this point in time. For all practical purposes, C is dead.

    Fact: C is dead

    --
    Sigs? We don't need no stinking sigs!
    1. Re:couldn't resist by spudgun · · Score: 2, Insightful

      Fact: C is dead
      Umm Doesn't that Linus guy write his little project thing in C ?

      what is it called again ?

      --
      Type unto others as you would have them type unto you.
  81. He, he. by hummassa · · Score: 2, Interesting

    0. "I assumed he was referring to the x86 platform"... see #4, below.
    1. Bootstraping. The c# compiler in Mono is written in ... c#. And it compiles itself. Take a look and you'll see what I am talking about.
    2. Your argument: "the first Java compiler." Tell you what: sometimes, the first XXX compiler is written in XXX and bootstraps itself. Even some of the first C compilers were written in C. Many assemblers before it were written in assembly language.
    2a. the word bootstrap comes from "lifting onself by steping on it's own boot straps." magic, eh?
    3. (Shrek citation) you and what army? (/Shrek) I was being caustic; you are mentioning being violent. I can dance the dance, too. Just invite me and we'll tango.
    4. ok, so I'll take the discussion again, this time from the beginning, let's see if we understand each ohter.
    4a. bangular complained that many modern languages were either scripting (like perl or python) or bytecode languages, so you could not write an OS kernel in it (unlike C, C++, ...);
    4b. Ambassador Kosh pointed out that python also is a bytecode-language (and altough he did not mention it, perl is a bytecode-language, too)
    4c. you said (assuming he [Kosh?] was talking about x86) bytecode could not run in raw machines ; yes it can't run directly in a x86 machine, but it can run in a specialized processor; but -- a JIT compiler, or an AOT (ahead-of-time) compiler (like gcj) can compile bytecode into machine code easily. You have to remember bytecode is just another representation (direct translation) of (some) assembly language.
    5. Here starts you succession of mistakes, that lead to my header and footer in the response I wrote:
    5a. you wrote "C and Assembler are what make the computer world run". nope. engineering make the computer world run. many applications are still in COBOL, FORTRAN, and lots of it, today is in Java, etc. Down to the wire level, yeah, there is lots of C and assembler, but they are *not* cost-viable to make many commercial systems. just OS-level software (database management systems, etc). And some are not -- SAP DB is written in Pascal; many MacOS programs were, too,...
    5b. you wrote "You can't make Java in Java". bootstraping. bootstraping.
    5c. you wrote "C turns directly into executable binary (...). Java cannot". wrong.
    5d. you wrote "I suppose that if you were insane enough, you could make a bytecode to opcode converter"... no need to be insane; see what's done at transmeta, ikvm, any JIT compiler, etc. etc...
    5e. you continued "but then you lose 100% of the point of the langauge" (sic). wrong, the point of a programming language is to show some abstraction in a clear way. p. ex, C++ classes show the abstraction of classes of real-world objects and the operations that can be effected in those objects belonging to those classes... if you translate it into bytecode, machine language *or* database-description to generate some tables in a RDBMS, it's not differente because of the target language; you did not lose the "point" of C++. So, if you get some JVM bytecode and translate it into .NET bytecode (like IKVM does) you did *not* lose the point of Java. you just translated your abstractions to another platform.
    5f. you went on "probably" (lose) "a lot of the efficiency", yeah, some of the efficiency, maybe; but you gain other knowledge that you can use to profile-and-optimize better than any hand-optimization. This will absorb most of the cost of the translation, and, in some cases, the dynamic translation techniques can make your program run even *faster* than the native/compiled version!
    5g. you ended the phrase with "and at that point you may as well use C". no, you may not, because C is not *very good* at OOP, or functional programming, or whatever other paradigm you need to express the domain of your problem so a compiler can give you an efficient program to run as a response.
    6. as you see, from 5a to 5g, you said seven distinct things in your paragraph, all wrong, all in need

    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
  82. C is "dying", being killed by... C by Kaldaien · · Score: 2, Insightful

    The actual "C" language may be declining in use. However, every single one of the "replacement" languages I've seen mentioned are simply "[subjectively] improved" modifications of C. Personally, I rarely use the higher level versions of C like C# or Java, because my line of work requires me to interface with OpenGL and do very CPU intensive calculations. Pointer math is absolutely required to effectively utilize OpenGL's more advanced extensions such as vertex buffer objects. And you can just forget about optimizing your vector math for CPU vectorization and parallelization, etc... in languages like Java or C#. This is not to say, however, Java and C# do not have their own benefits. When you need to write a small application (perhaps a frontend, or what not) and performance is not important, it's often faster to develop them in a higher level language. It's another instance of "the right tool for the right job". But the low level versions of C won't be dying for a very long time, because there will always be a need for portable, high performance APIs. The APIs that your high level C languages may interface with to perform tasks you simply can't practically accomplish otherwise. And of course the actual system kernel that everything runs would never be practical in a high level language.

  83. Re:Crush Scares Me by be-fan · · Score: 2, Insightful

    What are you talking about?

    Unsafe pointers are for the kernel to use, not userspace apps. Its okay if the kernel can crash the system, not if userspace apps can do so. Userspace apps cannot use unsafe pointers.

    You don't switch between static and dynamic typing. Rather, you have dynamic typing, and optionally add type declarations in places where you want to tighten the interface or improve performance. There will be some runtime type checks, but modern compiler analysis can eliminate most of those checks. And what's wrong with type inferencing in your kernel? Type inferencing all happens at compile-time!

    And the "raw core" they're talking about is not a low-level, close-to-hardware core, but a conceptually primitive core. The idea is that there is a simple base language to which both high and low level features can be added.

    Strictly, Crush will have more overhead than C. However, given a good compiler, and well-written, straight-forward code, it is possible to achieve close to C performance for high-level languages like Crush. In some cases (things like generic data structures, where specializations can be used) performance can be even better.

    Also note that while a kernel written in Crush might be 10-20% slower in raw performance, it makes up for it in other ways. For example, system calls won't have a huge overhead (hundreds of clock cycles on most modern kernels). Data doesn't keep having to be copied around. You don't have to put things like the X server in a seperate process to provide protection.

    --
    A deep unwavering belief is a sure sign you're missing something...
  84. C isn't dead yet. Someone should shoot it. by Un+pobre+guey · · Score: 2, Interesting
    Interesting how there are few or no compelling reasons to choose C over C++ in the above posts. Little more than a reiteration of the same old myths about how C is so much faster, efficient, cleaner, etc.

    Almost all extant C practitioners would benefit greatly if they gradually abandoned C-style and learned multi-paradigm C++. The world would be a better place.

    This is not a troll, and before all of you fundamentalist fanatics pull out your flamethrowers, inform yourselves:

    C++ FAQ

    C vs. C++

    The case for the continued existence of C is tenuous at best.

  85. C isn't dead, but it should be by metal_llama · · Score: 2, Informative

    But it ain't happening any time soon. Nevertheless: D, anybody?

    --

    ~metal_llama out.

    ---
    move every sig!