Slashdot Mirror


C with Safety - Cyclone

Paul Smith writes: "New Scientist is carrying a story about a redesigned version of the programming language C called Cyclone from AT&T labs. "The Cyclone compiler identifies segments of code that could eventually cause such problems using a "type-checking engine". This does not just look for specific strings of code, but analyses the code's purpose and singles out conflicts known to be potentially dangerous.""

392 comments

  1. Just what we need by Saint · · Score: 0, Troll

    Yet another language...

  2. In related news.... by jandrese · · Score: 2

    AT&T has solved the traveling salesman problem by translating it into an input their program understands...

    wasn't this supposed to be an NP-Complete problem?

    --

    I read the internet for the articles.
    1. Re:In related news.... by Moblaster · · Score: 1

      Actually Al Gore solved the traveling salesman problem by inventing the Internet.

    2. Re:In related news.... by DestructioN · · Score: 1

      The traveling salesman problem is NP-Hard. Sorry. :)

    3. Re:In related news.... by da_bza_420 · · Score: 1

      Uhhh, do you even know what the travelling salesman problem is?

    4. Re:In related news.... by jandrese · · Score: 2

      Dang, I couldn't remember which were NP-Hard vs. NP-Complete. Well, just substitute any NP-Complete problem in there.

      Dang, now I'm unsure if the Halting problem is NP-Complete.

      --

      I read the internet for the articles.
    5. Re:In related news.... by Anonymous Coward · · Score: 0

      If it werent for pants, you'd all be at the mercy of my unbridled loins.

    6. Re:In related news.... by Anonymous Coward · · Score: 0

      The halting problem is actually uncomputable. NP-Hard and NP-Complete problems just might as well be.

    7. Re:In related news.... by ENOENT · · Score: 1

      Dang, now I'm unsure if the Halting problem is NP-Complete.


      Nope, the Halting Problem is undecidable.

      --
      That's "Mr. Soulless Automaton" to you, Bub.
    8. Re:In related news.... by Anonymous Coward · · Score: 0

      Yeah, it's the problem of finding the most efficient route that your mom can use to stop by and satisfy each and every Slashdotter.

    9. Re:In related news.... by Anonymous Coward · · Score: 0

      How about next time you don't open your stupid mouth!

    10. Re:In related news.... by Cato+the+Elder · · Score: 2, Interesting

      A quick summary for everyone who hasn't taken or has forgotten their TheoComp: An NP problem: one that can be solved non-deterministically in polynomial time (NP=Nondeterministic polynomial). Therefore it can be solved deterministically in exponential time. An NP-complete problem: If any NP-complete problem can be solved in polynomial time, every NP-complete problem can be solved in polynomial time. An NP-hard problem: If any NP-hard problem can be solved in polynomial time all NP-complete problems can be solved in polynomial time, but not (necessarily) vice-versa. Undecidable: The problem can not be solved deterministically in finite time. NP-(hard/complete) problems are ususually solved by approximation or brute force. Or by restricting the problem--Euclidean travelling salesman can be solved in polynomial time. Undecidable problems are usually approached by restricting the problem--Halting, for instance, can be solved if you bound the number of states. Getting back to the original topic, that's what languages try to do. By restricting the operations you can perform, they can make garuntees like "These two variables will never reference the same area of memory"

    11. Re:In related news.... by __aasmho4525 · · Score: 1

      heheheh

      we at work almost all busted a gut reading your reply...

      HILARIOUS!

      that commercial was awesome!

      Peter

    12. Re:In related news.... by __aasmho4525 · · Score: 1

      ok, just to make sure you understand, my reply was to the anonymous-coward, so you have to be browsing at the correct level to get the humour here, but i decided to include a link to the original commercial....

      it's available here.

    13. Re:In related news.... by MarkCC · · Score: 2, Informative
      Grrr... You're making one of my least favorite ignorant twit mistakes.

      Back in grad school, I used to read comp.theory, and at least once a month, we'd have some jerk post to the newsgroup "NP solved!", followed by some stupid, exponential time algorithm for 3-SAT or something. Invariably, the poster would spend thousands of lines defending his supreme genius in being the person who solved an NP complete problem!

      NP complete does not mean unsolvable. It means slow.

      Roughly speaking, NP problems are problems for which their is no non-exponential time solution known, but for which solutions can be tested for correctness in polynomial time. (To translate, exponential time means that the time to compute the solution for a problem of size n is bounded by x^n for some n. Polynomial time means that the time for a problem of size n can be bounded by some polynomial of n.)

      The travelling salesman is a classic example of an NP problem. Given a set of cities, and the distance between any two cities, compute the shortest route that visits each city once. It's a trivial problem, but as far as anyone knows, it's not possible to write a program that quickly determines the correct shortest route in every case.

      NP complete problems are problems which have the fascinating problem that *if* you found a polynomial time solution for that problem, then you would have found a polynomial time solution for all NP problems.

      The travelling salesman is, if I recall correctly, slightly *worse* than NP complete. Again, if I recall correctly, if you have a P-time solution to the TSP, then you provably have a P-time solution to any NP-complete problem; but if you have a P-time solution for an NP-complete problem, that doesn't mean that you have a P-time solution to the TSP. The proof is actually quite interesting, so go get an algorithm textbook, and read it. I'd suggest the Corman, Leiserson and Rivest text, which is my personal favorite.

      There are perfect, well known solutions for all of the classic NP complete problems. They're just exponential time. (For instance, for the travelling salesman: enumerate all possible routes; compute the length of each route; and pick the shortest one.)

    14. Re:In related news.... by MarkCC · · Score: 1
      Aaargggggghhhh!!!!!

      The Halting problem is not NP complete. It's
      unsolvable.

      Why is it so friggin' hard to see the difference? It's it totally obvious that the travelling salesman problem is simple to solve?

    15. Re:In related news.... by zatz · · Score: 2, Informative

      Be careful pointing the finger about ignorant mistakes.

      TSP cannot be worse than NP-complete, because it is obviously in NP. Phrased as a decision problem (is there a Hamilton path through this graph shorter than length y?) it is trivial to verify a solution in polynomial time. If you can verify in P, you can solve in NP.

      Note that rephrasing as a decision problem doesn't change the order much, because you can just do a binary search with O(log N) steps where each is a decision subproblem. Also note that transforming it into a decision problem is *necessary* to discuss its NP-completeness, because the very concept is only defined for decision problems.

      --

      Java: the COBOL of the new millenium.
  3. Isn't that called "Java"? by dave-fu · · Score: 4, Informative

    Not a flame, but more "modern" languages such as Java and C# have constructs explicitly built to avoid the buffer overflow/pointer gone insane problems.
    For the rest of the world, secure C programing is far from a secret.

    --
    Easy does it!
    This comment has been submitted already, 276865 hours , 59 minutes ago. No need to try again.
    1. Re:Isn't that called "Java"? by actappan · · Score: 1

      I think the key here is the "With the power of C" statments. I think we can assume that this won't need the ugliness of the Virtual Machine (Maybe Sun or IBM can be convinced to re-write the Java VMS in Cyclone :) )

      It's a nice idea - that the compilers themselves would do the bug checking . . .

      --
      \Drew National Data Director, John Edwards for President
    2. Re:Isn't that called "Java"? by The_egghead · · Score: 5, Informative

      There's a key difference here though. Java requires a run-time stack to do all of it's safety checking. This project aims to all of it's checking at compile time, so it's static, rather than dynamic. This is _VERY_ hard problem, and is where virtually all of the programming languages research is centered today. However, you're instinct that this is not a new concept is correct. Microsoft is actually doing very similar research in the form of a project called Vault.

    3. Re:Isn't that called "Java"? by DaoudaW · · Score: 2, Interesting

      Here it is from the User's Manual

      There are other safe programming languages, including Java, ML, and Scheme. Cyclone is novel because its syntax, types, and semantics are based closely on C. This makes it easier to interface Cyclone with legacy C code, or port C programs to Cyclone. And writing a new program in Cyclone ``feels'' like programming in C: Cyclone tries to give programmers the same control over data representations, memory management, and performance that C has.

    4. Re:Isn't that called "Java"? by dynoman7 · · Score: 1

      No no...they call it ADA.

      Ahhhhhhhhhhhhhhhhhhhhh!!!!!!!!!!!!!

      --
      Blarf.
    5. Re:Isn't that called "Java"? by roca · · Score: 3, Insightful

      You are wrong.

      Java does not rely on a "run time stack" for its type checking, whatever that means. Java does plenty of checks at compile time (and load time, if you're using dynamic loading/linking).

      Java, like Cyclone, Vault and every other language you'd ever want to use (and many you wouldn't), relies on a combination of static and dynamic checks to ensure safety. Cyclone does move more checks over to the static side than Java does, so it might get higher performance. But no compiler, and certainly not Cyclone's, will be able to eliminate all dynamic checks (for array bounds and null pointers, for example). Vault moves even more over than Cyclone.

      There is a spectrum that describes the amount of dynamic checks that have to be performed for safe execution of a language. It looks a bit like this:
      Vault ... ML ... Cyclone ... Java ... Perl ... Scheme

      (C and C++ aren't on there because they don't have any concept of "safe execution" :-).)

    6. Re:Isn't that called "Java"? by Anonymous Coward · · Score: 0

      Very hard? Try very impossible. Shouldn't a programmer know about the halting problem and it's implications?

    7. Re:Isn't that called "Java"? by tb3 · · Score: 2

      Interesting, but the 'Vault' page hasn't been updated in almost a year. I guess Microsoft doesn't think that buffer over-runs are a serious problem.

      --

      www.lucernesys.comHorizon: Calendar-based personal finance

    8. Re:Isn't that called "Java"? by V.P. · · Score: 1
      You don't really need a virtual machine to run Java. If you just use Java in its "C-like OO language with garbage collection" role, you can just use GCJ (part of GCC).

      Most of the Java 1.2 standard libraries are available for GCJ (but not AWT/Swing unfortunately)

      P.S. Also, the converse is true: You don't have to code in Java to run programs in a JVM (see languages for the Java VM for a list of languages that can be compiled into Java bytecode)

    9. Re:Isn't that called "Java"? by patniemeyer · · Score: 2, Insightful

      This is a misconception - The only runtime phenomenon that Java requires is array bounds checking. Everything else - including all of its safety rules are performed in a static verification pass. This is what allows Java to be "jit'd" to native code and run at full speed.

      However because Java has so much more structure by virtue of the intermediate byte code language a runtime profiler can dynamically optimize sections of code based on their behavior, not just their static characteristics.

      Ask yourself - what can I do at compile time that I can't do better with more information at runtime? The answer is nothing... The only trade off is in start up performance and it's just a matter of time before the OSs handle that better.

      Pat Niemeyer,
      Author of Learning Java, O'Reilly & Associates

    10. Re:Isn't that called "Java"? by Anonymous Coward · · Score: 0

      The thing is Java is most certainly NOT a systems programming language and C is. They address two very different domains.

      At some level you need C or fourth or assembly, etc .

    11. Re:Isn't that called "Java"? by Anonymous Coward · · Score: 0

      > Very hard? Try very impossible. Shouldn't a
      > programmer know about the halting problem and
      > it's implications?

      To be precise, the halting problem doesn't apply to finite tape length Turing machines. Since there are a finite number of states, if you're willing to wait long enough (for a large program, time> 1 billion years), you should be able to solve the halting problem precisely.

      But precision isn't too important in the real world. You can solve any NP-complete problem in polynomial time, if you define success as being off the optimal solution by at most a factor of two.

      I'm sure you solve the halting problem for any application within 4 standard deviations without waiting too long.

    12. Re:Isn't that called "Java"? by shani · · Score: 1

      Actually, this is not 100% true. When you cast a reference to a subclass type, the interpreter performs a necessary runtime check not required in C:

      import java.util.*;

      class foo {
      public static void int main(String args[]) {
      Vector bar = new Vector();
      bar.add(new Integer(666));
      Integer x = (Integer)bar.elementAt(0); // pesky run-time check
      }

      IIRC, there are a couple of other run-time checks as well. A quick look through the opcodes in the Java virtual machine should help you spot them.

      And as for optimzations you can do better at compile time, try register allocation!!! I know Java people don't think about this, since they think they live in a stack-based world, but last time I checked, picking optimal registers was still an NP-complete problem, which is expensive on CPU's with lots of registers (meaning everything except the x86).

      It may seem like compilers don't need static optimizations, but I think that has more to do with the lack of high-performance compilers for anything other than FORTRAN than the worthlessness static compilation.

    13. Re:Isn't that called "Java"? by T-Ranger · · Score: 1

      Its probabaly more likely that the page is maintained by a bunch of hackers, and they have better things to do then maintain it. They talk to /each other/ in there office, and the rest of the world realy dosent care.

    14. Re:Isn't that called "Java"? by Anonymous Coward · · Score: 0

      The thing is Java is most certainly a big bag of shit - whatever domain you choose to use it in.

    15. Re:Isn't that called "Java"? by jrockway · · Score: 1

      Obviously not, judging by some certain IIS exploits last summer :)

      --
      My other car is first.
    16. Re:Isn't that called "Java"? by john@iastate.edu · · Score: 2
      I just wished they'd used keywords instead of that horrid looking * ? @ pointer mess - ick.

      --
      Shut up, be happy. The conveniences you demanded are now mandatory. -- Jello Biafra
    17. Re:Isn't that called "Java"? by Anonymous Coward · · Score: 0

      Nah, not really. The language itself isn't bad if you're doing applications programming *snickers at apps programmers*.

      Now it's libraries, well, you're right they're enough to give any C programmer nightmares. The worst prablem is that TheyHaveVeryLongIncomprehensibleMethodNames
      ThatLook_ALotlike_This. You really have to wonder if they recruited a bunch of COLBOL programmers to write them or what.

    18. Re:Isn't that called "Java"? by ahde · · Score: 2

      Specifically to flame, but...

      Java and C# aren't programming languages. They are scripting languages for an application (JVM, CLR) that is not a true virtual machine

  4. I have an idea... by rnd() · · Score: 0, Troll

    I have an idea, let's call it C#.

    --

    Amazing magic tricks

    1. Re:I have an idea... by genkael · · Score: 1

      How about C## or we could call it D or E flat flat.

      --
      GeneralKael -- Slacker Extraordinaire
    2. Re:I have an idea... by the_2nd_coming · · Score: 1

      naw, C#-- denotes a lower level than C# but still some features ;-)

      --



      I am the Alpha and the Omega-3
    3. Re:I have an idea... by Anonymous Coward · · Score: 0

      are you saying that "C#" LOWERS a note from C? Or that "C#--" is a lower level than C#?

    4. Re:I have an idea... by Anonymous Coward · · Score: 0


      the latter.

    5. Re:I have an idea... by Bradee-oh! · · Score: 1

      How about C## or we could call it D or E flat flat.

      2 things - First off, to point out to all the non-musical types out there - in music notation, C##, D, and E flat flat are all tonally equivalent (ie, the same note.) Very funny :)

      Second, that's a moot point anyway because as reported on slashdot the D programming language is already on its way. :)

      --
      "This is Zombo Com, and welcome to you who have come to Zombo Com" - www.zombo.com
  5. But, I like being unsafe! by mberman · · Score: 0, Flamebait

    one of the main things i use C for is when i want to be unsafe. C lets you fuck with the system in completely arbitrary ways. i program in C because i'm smarter than the compiler, so i want it to let me do whatever i want, and assume i know what i'm doing. when you need to write code that needs to be safe, and you want the compiler to double check everything you do, use java or ML or something...

    --

    This is a self-referential sig

    1. Re:But, I like being unsafe! by ekrout · · Score: 1
      when you need to write code that needs to be safe, and you want the compiler to double check everything you do, use java or ML or something...

      When does code not need to be safe? With the frequency that source code is shared today, you never know when your insecure "C" code that you wrote a "hobby" application with gets re-used in a modern mission-critical GPL'd application. I see where you're coming from, though.

      Just a thought, not a sermon.

      --

      If you celebrate Xmas, befriend me (538
    2. Re:But, I like being unsafe! by Anonymous Coward · · Score: 0

      could you point me to a single program you've written or helped write? you sound like you know what you're talking about, i'm just wondering where the proof that you're such an excellent coder lies?

    3. Re:But, I like being unsafe! by forgetmenot · · Score: 1

      Heh heh. You and me both. But the problem is with the people who aren't smarter than the compiler but "think" they are and manage to convince the management that they are. When the bad things happen it gets blamed on the language and consequently good programmers get forced into using VB.

    4. Re:But, I like being unsafe! by Jerf · · Score: 2

      A lot of communication-based programming can involve taking a stream from some device, like a network, and simply saying casting that data into some struct, so C can access the chunks.

      There are also some nice tricks you can sometimes play with integer-based data by casting them into integers, and doing something with them. "Going through channels" can take too much time, if you know what you're doing.

      Almost everything comes down to a C or C++ base, which takes care of the dirty bits. Somebody needs to take care of the dirty bits.

      That said, some people underestimate the value of staying in the channels. Whether or not the person you replied to is one of them is not something we could determine without knowing what kind of programs he writes.

    5. Re:But, I like being unsafe! by kyz · · Score: 2

      A lot of communication-based programming can involve taking a stream from some device, like a network, and simply saying casting that data into some struct, so C can access the chunks.

      No no no no no!!!!!!! Do you know how many archivers I've had to rewrite because they just cast a struct over the top of a data stream?

      The only fixed size in C is the BYTE (unsigned char). Everything else will change. Never use direct memory dumps of structs for on-disk or over-net structures! When reading a data stream, read _bytes_ and convert them at runtime to the structures you desire. Now your code is not only portable across platforms, but portable across compilers, too.

      --
      Does my bum look big in this?
    6. Re:But, I like being unsafe! by Anonymous Coward · · Score: 0

      I think we can safely guess he pretty much just sticks to mIRC scripts.

    7. Re:But, I like being unsafe! by Emil+Brink · · Score: 2

      Bzzzt, but that's wrong too. Hint: #include <stdlib.h>, then take a look at CHAR_BIT. The number of bits per char (and "char" equals "byte" in C terminology; it's the smallest addressable piece of memory) is not specified in the language. CHAR_BIT is typically eight, but that's not certain. In practice, you can come a long way by assuming CHAR_BIT to be eight, but it's not generically true, which is why I feel the need to object a bit.

      --
      main(O){10<putchar(4^--O?77-(15&5128 >>4*O):10)&&main(2+O);}
    8. Re:But, I like being unsafe! by Jerf · · Score: 2

      You'll forgive me if I didn't write a tome on the subject :-) There's a trillion other dangers too, but somebody, at some point, when reading from the disk, has to do this, and it's probably C/C++.

    9. Re:But, I like being unsafe! by saider · · Score: 1

      If somebody is writing mission-critical software, I hope they inspect imported code as closely (if not closer) than the code they write themselves. Anyone who reuses code designed for another application without reviewing it deserves every bug they encounter.

      I agree that a strong compiler is a good tool, but it is still a tool. This may be good for inexperienced programmers, but an experienced programmer should be able to avoid most of the errors with vigilance.

      Most of the code I produce today is not radically different from code I wrote 4 years ago. I'm just doing different things with different data. The same good programming principles still apply and are adequate for my needs.

      --


      Remember, You are unique...just like everyone else.
    10. Re:But, I like being unsafe! by Wumpus · · Score: 1

      Your sig doesn't compile:

      parse error before `;'

    11. Re:But, I like being unsafe! by Emil+Brink · · Score: 1

      I know. Embarassing for someone playing the C advocate, huh? Truth is, it's a bug in Slashcode that won't allow me to quote it correctly. I can correct it, but it gets mangled immediately. Haven't bothered to report it, either, since... Well, the update pace of Slash isn't exactly impressive, so it feels like too much trouble.

      --
      main(O){10<putchar(4^--O?77-(15&5128 >>4*O):10)&&main(2+O);}
    12. Re:But, I like being unsafe! by kyz · · Score: 1

      Hint: #include , then take a look at CHAR_BIT.

      True, but you do have to admit that if you can't address data on byte boundaries, you are basically incapable of writing multi-platform software. All C compilers for general-purpose computers I have seen use 8 bits for an unsigned char.

      The C specification has to be intentionally vague, so embedded systems can tweak these sorts of things to their purposes. Embedded systems don't care about byte-ordering anyway, because they're never going to meet a file format from another system.

      --
      Does my bum look big in this?
  6. Just what I need... by mshomphe · · Score: 5, Funny

    buggy code to tell me when my code is buggy.

    --
    She sat at the window watching the evening invade the avenue.
  7. I am against this by Anonymous Coward · · Score: 5, Funny

    C is *supposed* to be dangerous, damnit.

    1. Re:I am against this by wrinkledshirt · · Score: 1

      C is *supposed* to be dangerous, damnit.

      Heh. Reminds me of a problem I had coding my tackle-handball game for Linux. Every now and then a computer player would go on a breakaway, and then another player would get in his way, and so the original player would reset to his regular offence. Only problem was that from that time forth whenever that player threw the ball, he did it at lightning speed.

      Took me forever to figure out what I was doing. That bit about it always seeming to happen after a breakaway ended up being the key difference, though, because whenever the breakaway conditions came up, I was writing to player->movelist[6].x and player->movelist[6].y when I'd only declared the arrays to have 6 movelist elements to begin with. Not too far down on the player struct was player->strength, so that turned ou to be the problem.

      Now, if I could only figure out how to stop them from running into the walls...

      I never did learn how to use ddd...

      --

      --------
      Bleah! Heh heh heh... BLEAH BLEAH!!! Ha ha ha ha...

    2. Re:I am against this by johnjones · · Score: 2

      yep

      in C you can access memory

      and so you have to to write to hardware mmaped locations to control devices

      how do you think low level manimpulation of devices is done in java/scheme

      the point is they use very little and it provides a generic functionality its easy to audit and keep clean of bugs

      so kludgeing stuff to make things typesafe seems to me at least silly
      but remember Wickedness is a myth invented by good people to account for the curious attractiveness of others

      regards

      john jones

    3. Re:I am against this by shani · · Score: 1

      Took me forever to figure out what I was doing. That bit about it always seeming to happen after a breakaway ended up being the key difference, though, because whenever the breakaway conditions came up, I was writing to player->movelist[6].x and player->movelist[6].y when I'd only declared the arrays to have 6 movelist elements to begin with. Not too far down on the player struct was player->strength, so that turned ou to be the problem.

      Um... all because you're using C doesn't mean you can't use abstraction, and the use of 6 is pretty inexcusable. Even K&R had #define!!

      My advice: if this is how you code, stay away from Perl.

    4. Re:I am against this by wrinkledshirt · · Score: 1

      Please let us all know when you're through flexing your geek.

      --

      --------
      Bleah! Heh heh heh... BLEAH BLEAH!!! Ha ha ha ha...

    5. Re:I am against this by greenrd · · Score: 2
      It may sound petty to you, but actually, this is a good example of what not to do. Don't look a gift horse in the mouth. Unnecessary hard-coding means unnecessary "crosscutting", which means higher maintenance costs. It may seem like a small thing on its own, but these little things add up. And maintainability tips such as this really aren't given the importance they deserve in many programming courses and books, because they usually just teach you the basic tools and never get around to teaching you how (and why) to use them really effectively; thus these things come with experience or (if you're very lucky) through mentoring.

      The trouble is we teach students to code in totally artificial environments (i.e. universities etc.), and then throw them into real projects and, not surprisingly, they often make all the classical mistakes (write-only code, last-minute rushes, underestimating schedules, etc. etc.). It's quite depressing to see easily-preventable mishaps repeat themselves over and over (students saving as Foo.java~ not Foo.java and then wondering why all their work seems to have vanished next session! NOO! Learn to fucking READ!). Then again many of them just don't take it in when you tell them about these things.

    6. Re:I am against this by wrinkledshirt · · Score: 1

      Sigh.

      I'm a programming instructor myself. Notwithstanding the fact that I don't need to be told about abstracting or arrogantly warned to steer clear of specific languages, the OP was about how C was dangerous, and I just thought I'd share a story from A LONG TIME AGO in a proof-of-concept endevour about how I personally found out the hard way just how dangerous C could be.

      That said, even using data abstraction at that stage, in a brain fart I might have forgotten to subtract 1 to get at the last element and make the same mistake...

      #define MOVELISTCOUNT 6
      struct movenode movelist[MOVELISTCOUNT];
      ...
      movelist[MOVELISTCOUNT].x = ball.x;
      etc.

      ...and as a result end up overwriting other memory anyway.

      My mistake was thinking that this story might be amusing to some. Obviously, the need to criticize here is more important than the need to laugh.

      --

      --------
      Bleah! Heh heh heh... BLEAH BLEAH!!! Ha ha ha ha...

    7. Re:I am against this by SpeelingChekka · · Score: 2

      the use of 6 is pretty inexcusable. Even K&R had #define!!

      Uh, WTF would that have helped? The bug would have been the same:

      #define MOVELISTSIZE 6

      struct player
      {
      coord movelist[MOVELISTSIZE];
      };

      player->movelist[MOVELISTSIZE].x = foo;

      Its a 'simple' sort of mistake to make, most C/C++ coders with any reasonable amount of experience are likely to have similar stories to tell (myself included).

      And WTF has "using abstraction" got to do with it? Could you explain how "using abstraction" could have avoided a little mistake like that? Lets see:


      class Player
      {
      public:
      void SetMovelistValue(int nIndex, float x, float y);

      private:
      coord movelist[MOVELISTSIZE];
      };

      ...

      // Doh!
      Player->SetMovelistValue(MOVELISTSIZE, x, y);

      Oops! Bug still there! I guess "using abstraction" had nothing to do with it then. What are you trying to say?

      As the other poster said, all you're doing is "flexing your geek", and its pretty lame. Does it make you feel better about yourself to assert that you are some sort of Perl God who allegedly could code rings around the C/C++ programmers? Get over yourself. Perl does a lot of dirty work for you.

    8. Re:I am against this by SpeelingChekka · · Score: 2

      My mistake was thinking that this story might be amusing to some. Obviously, the need to criticize here is more important than the need to laugh

      Don't let it bother you, shani is obviously just an idiot who, it would seem, doesn't actually have any non-academic experience coding C or C++. It was amusing to me simply because of the recognition of my own experiences :). As someone with (currently) about six years C++ experience and about ten years programming experience, I've got plenty of similar stories myself :) Writing out of array bounds onto other class members isn't always as obvious as it was in your case either, sometimes the index is derived in a complicated manner, and you obviously can't bounds-check every single time. Sometimes its just a cut-n-paste problem, e.g. duplicating the for-loop initialization for one array for another array of a different size, forgetting to change it in the for-loop etc. C++ has lots of potential pitfalls and room for these easy mistakes to make. Derived classes redefining a member already defined in a parent class, forgetting to initialize a member, modifying the parameters of a virtual function in the base class and forgetting to change overridden versions of the function in derived classes, so the derived versions don't get called, typecasting incorrectly etc etc. Some of these have produced some pretty hilarious results, like some really bizarre missile flight paths in our simulations, but you probably sorta had to be there :).

    9. Re:I am against this by Chainsaw · · Score: 1

      The bug is NOT there. You implement the method like this:

      void Player::SetMovelistValue(int nIndex, float x, float y)
      {
      if (nIndex >= MOVELISTSIZE || nIndex < 0) {
      // This programmer sucks.
      return;
      }
      // TODO
      }

      This is what abstraction is for: to help the programmer doing stupid things that might crash the application or some other stupid thing.

      --
      War is one of the most horrible things a human can be exposed to. And one of the worlds largest industries.
    10. Re:I am against this by ChadN · · Score: 2

      I agree with what you're saying (the protestations of the original poster to your suggestion indicate that he needs to OPEN HIS PROGRAMMING MIND, and be open to different techniques.)

      That said, I would simply use assertions to catch these preconditions in debugging, ie:

      assert(nIndex 0) // or use unsigned index

      --
      "It's overkill, of course. But you can never have too much overkill." - Anonymous Slashdot Coward
  8. Just add wrapper libraries by MikeBabcock · · Score: 2

    It seems to me that much of what this does could be easily implemented in a C library directly or with #define'd replacements of the C library functions in question. The type issues seem to be all that is unique here.

    --
    - Michael T. Babcock (Yes, I blog)
    1. Re:Just add wrapper libraries by Anonymous Coward · · Score: 0

      Wow. Brilliant, sir.

      I think there's a reason that they're PhD researchers at AT&T labs and you're just a slashdrone wasting company time at work.

    2. Re:Just add wrapper libraries by MikeBabcock · · Score: 2

      And a reason that you posted AC maybe?

      I don't know about you but PhDs at IBM invented CD software that almost nobody can use and other PhDs have done many other totally impractical or redundant things with their time as well.

      Just because you're good at doing research and writing long papers (which I've proof-read on occasion for people) doesn't mean you're good at coming up with unique or necessary solutions.

      The fact that dmalloc and other such tools already handle the memory issues in some ways, or that other C library extensions are available to do memory segmenting differently at the malloc/free level is irrelevant to you? The fact that adding two lines to all the string.h functions that don't check for NULLs is stupidly simple doesn't make half their announcement redundant?

      Sorry then ...
      ... slash drone ... bah.

      --
      - Michael T. Babcock (Yes, I blog)
  9. No No No by VFVTHUNTER · · Score: 5, Funny

    We had C, then C++, then C#. So shouldn't the next logical step be C followed by three vertical lines and three horizontal lines (that'd be C-tic-tac-toe)?

    1. Re:No No No by treellama · · Score: 1

      # = tic-tac-toe Eventually we'll have 7 vertical and 7 horizontal, it will be C-chess.

    2. Re:No No No by Flakeloaf · · Score: 1

      Since this new compiler is forcing you to make moves you may not want to make, perhaps C checkers is more appropriate?

      --

      Am I the only one who heard Roxette to sing "I'm gonna get blitzed for some sex"?

    3. Re:No No No by jeffy124 · · Score: 1

      or C-connect4 !!

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    4. Re:No No No by treellama · · Score: 1

      But every time I play chess I'm forced to move my king even though I may not want to :-(

    5. Re:No No No by BigBir3d · · Score: 1

      Isn't tic-tac-toe 2 vertical and horizontal lines??
      _|_|_
      _|_|_
      | |
      ...more stuff added to get around lameness filter regarding ascii art/junk characters...

      blech!!!

    6. Re:No No No by forgetmenot · · Score: 1

      Oh come on people. Be original. Think outside your little world of strictly horizontal and vertical lines. C-snakes-and-ladders anyone?

    7. Re:No No No by Anonymous Coward · · Score: 0

      You mean 3 vertical lines an two horizontal lines:

      Notice:
      ++
      #

      # is just one horizontal line more than ++
      as to how we would draw

      _|_|_|_
      _|_|_|_
      | | |(note: I give up, stipid ASCII art filter! you
      get the idea anyway)

      with one keystroke is beyond me, new key time??

    8. Re:No No No by Anonymous Coward · · Score: 0

      How about CD? It sounds good, though some
      audiophiles might whine.

    9. Re:No No No by Anonymous Coward · · Score: 0

      here in germany it's Shits-and-Bladders

  10. Great Idea by Malbosia · · Score: 0, Redundant
    A very good idea if it can be tested thoroughly, and have all of the bugs worked out of it. I could definately see something like this causing havoc because of several bugs in the compiler itself.

    On a lighter note, prehaps they should just come out with a piece of hardware that will reach out and slap you if you make a stupid mistake.

  11. "C with safety," or C with trigger locks? by Tsar · · Score: 5, Funny
    I like the notion of building protection against common, insidious errors, but why did they have to create a new language to accomplish it? I didn't quite understand that point.

    And isn't a cyclone an infinite loop?
    "Our ultimate goal is to have something as humongous as the Linux operating system built in Cyclone," says Morrisett.
    You have to like a scientist who uses the word humongous.
    1. Re:"C with safety," or C with trigger locks? by John+Whitley · · Score: 3, Informative
      I like the notion of building protection against common, insidious errors, but why did they have to create a new language to accomplish it? I didn't quite understand that point.
      The problem lies in the difficulty of reasoning about the semantics (and therefore the correctness) of the program being analyzed. Put simply, C is a disaster for semantic analysis. In newer languages whose design is informed by modern PL research, a goal is often to avoid the sorts of design pitfalls that make analysis difficult.

      Ever had an agressive optimizer break code, such that you had to use a lower optimization setting? This can be a symptom of weakness in the compiler's ability to statically analyze the program. Not just a garden variety "bug", but rather the optimization is correct only for a subset of valid input source code! I.e. it can be difficult to impossible to prove that a given optimization is safe, aka "semantics preserving".

      Many modern PL researcher/designers thus aim to give compiler writers a head start by ensuring that the language design permits increasingly powerful forms of static program analysis. Functional language work in particular has focused heavily on utilizing language and type system design to enable more powerful analysis support. (cf. the various published papers on the Haskell and OCaml languages as a starting point).

  12. party like its (Simula) 1962 by kaisyain · · Score: 3, Funny

    Someone created a language the enforces types and does bounds checking! It's news!

  13. except Java doesn't have by kaisyain · · Score: 3, Informative
    • Tagged unions
    • Parametric polymorphism
    • Pattern matching
    • Anonymous structs equivalent by structure
    • Parameterized typedefs


    (right on the web page detailing the language)
    1. Re:except Java doesn't have by addaon · · Score: 1

      You'd be surprised how little you miss 'em. And, for the record, parametric polymorphism (generics, for the less buzzword-compliant) is on the way.

      --

      I've had this sig for three days.
    2. Re:except Java doesn't have by angel'o'sphere · · Score: 0
      Java does not have:

      Tagged unions
      yes, because it makes programs latently unrobust. Place a pointer and a double on the same adress and you never realy know where the pointer points to. Java just don't likes that, so it does not have unions.

      Parametric Polymorphism
      err.... so don't has C. And: next version of Java has it, look a JSR 14, on java.sun.com. Also there are a lot of extended java compilers out there, having it for years: pizza, kiev, gj are only three of them.

      Pattern Matching
      again: so don't has C nor C++.

      Anonymous structs equivalent by structure
      It hasn't :-). For the same reasons as with unions.

      Parameterized typedefs.
      Errr.... so don't has C.
      If you try to compare JAVA with C, IMHO you should stick to well understood C properties .... and not mix in stuff not even C has.
      Regards,
      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:except Java doesn't have by Anonymous Coward · · Score: 0

      He was comparing Java to Cyclone (wait, this article was about Cyclone, right?). From the page referenced in the article:
      Cyclone also provides modern features for convenient programming:
      Tagged unions
      Parametric polymorphism
      Pattern matching
      Exceptions
      Anonymous structs equivalent by structure
      Parameterized typedefs
      An extensive library for container types and other common utilities
      A lexer generator and parser generator
      Function-level debugging with gdb and profiling with gprof

    4. Re:except Java doesn't have by augustss · · Score: 2, Informative

      > Java does not have:
      > * Tagged unions
      > yes, because it makes programs latently
      > unrobust. Place a pointer and a double on the
      > same adress and you never realy know where the
      > pointer points to. Java just don't likes that,
      > so it does not have unions.
      You obviously have no clue what tagged unions mean. Thay are *tagged* which means that you can
      tell which variety of union you have so it is
      perfectly safe to use, e.g., in pattern matching.

    5. Re:except Java doesn't have by Anonymous Coward · · Score: 0

      If you can't change the tag on an instance, that's just an unusual implementation of ordinary objects.
      If you can, there's no safety.

    6. Re:except Java doesn't have by Lozzer · · Score: 1

      Could you explain how tagged unions differ in concept from subclasses? I'm just a clueless non C developer. TIA

      --
      Special Relativity: The person in the other queue thinks yours is moving faster.
    7. Re:except Java doesn't have by Tom7 · · Score: 2


      I dunno man, when I write java code I really do miss pattern matching and generics. Casts and "instanceof" are a real pain.

    8. Re:except Java doesn't have by kaisyain · · Score: 1

      Regular expressions are not pattern matching.

    9. Re:except Java doesn't have by shani · · Score: 1

      And all I want is const, so I don't have to worry about all arguments being passed by value.

      Those other things seem kind of pointless relatively speaking.

    10. Re:except Java doesn't have by Ozx · · Score: 0

      Are you illiterate, or do you just pretend to be? Also, all of the previous generic implementing Java compilers generate code that isn't type-checked at runtime in instances where it should be (where you load the code dynamically or use reflection).

    11. Re:except Java doesn't have by Ozx · · Score: 0

      Type safe collections and multi-dispatch functions certainly seem pointless to me when compared to the almighty const.

    12. Re:except Java doesn't have by scrytch · · Score: 2
      Add these things java lacks:

      • named args
      • signature overloading
      • first class functions
      • closures
      • currying
      • lazy evaluation
      • tail call elimination


      Just those off the top of my head, I'm sure there's more.

      > Anonymous structs equivalent by structure

      I'm not entirely sure this is really appropriate for a strongly statically typed language. Perhaps some kind of explicit syntax to state that two interfaces are equivalent? (and while we're at it, how about anonymous interface constructor syntax that isn't so ugly)
      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    13. Re:except Java doesn't have by angel'o'sphere · · Score: 1

      Silly you :-)

      *I* can tell if I have currently a double inside and not a pointer.

      But can the compiler tell at any point in the program if a double is stored or a pointer?

      If the compiler can tell that, what does it do if the union is used as a pointer but a double is stored there?

      Regards,
      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  14. Uhh... but, the name? by red_dragon · · Score: 1

    Quite trivial, mind you, but wouldn't it be confused with this Cyclone?

    --
    In Soviet Russia, Jesus asks: "What Would You Do?"
  15. The wrong starting point? by Anonymous+Brave+Guy · · Score: 4, Troll

    I'm a professional software developer, and all for anything that makes my code safer without unduly compromising it. But I can't help thinking that starting from C is probably a mistake.

    C is a fundamentally unsafe language. It has some easy fixes (remove the always-unsafe gets() function from the library, for example). It has some fundamental "flaws" (pointer arithmetic and the use of void*, for example). I quoted "flaws" because, while these features make the language necessarily unsafe, they are also very helpful in the low-level programming that got C to where it is today.

    The underlying problem here has never been with C, it's been with using C for the wrong jobs. Application code, and certainly high-level code where security is essential, just aren't C's strong suits. I can't see how even the geniuses we're talking about can start from such a broken language (in the context we're discussing) and successfully make a non-broken language out of it.

    I would expect a much better solution to be that followed by later C-like languages. C++ retains the low-level control, but other languages (Java, C#, etc) are available to those willing to sacrifice some of that control in exchange for added safety, and consequently may be better tools for different types of project. The biggest problem at the moment is that none of these "safer" languages has yet developed the same raw expressive power of C++. As they evolve, and catch up on the 20-odd year head start, hopefully we'll see programmers given a genuine choice between "safe but somewhat limited" and "somewhat safe but unlimited".

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:The wrong starting point? by Black+Parrot · · Score: 4, Insightful

      > The biggest problem at the moment is that none of these "safer" languages has yet developed the same raw expressive power of C++.

      Take a look at Ada. Extremely safe, extremely powerful, extremely unpopular. Go figure.

      It's object-oriented, it supports generic classes ("packages", in Ada terminology), it has built-in support for multitasking and distributed programming, it lets you (optionally) specify even such details as numeric representations for the ultimate in portability, and it has a set of first-class and well-documented bindings for GTK+.

      There's a free compiler called GNAT, which is built on gcc and will actually be rolled in to gcc 3.1 or thereabouts. There's also a Linux-specific site for gathering and distributing component packages.

      And pace ESR, it wasn't designed by a committee.

      --
      Sheesh, evil *and* a jerk. -- Jade
    2. Re:The wrong starting point? by Fortmain · · Score: 1

      Hear!Hear!

      I fell in love with Ada some years ago. Before that, I would have sworn you couldn't get better than C. Now, when my employer sends me to classes on C++/java/etc., my most frequent comment in class is "Oh, that's like (blank) in Ada," which usually gets me strange looks from my classmates (and instructors).

      OT, but I think its unpoularity stems from the fact it was designed for DoD use, who then made it MANDATORY for all new projects. No programmer I've ever met likes to be told "you WILL use this language," and they will fight tooth and nail to use a language they are more comfortable with (usually C/C++). After all everybody knows that C is the only REAL language 8-) (Except for us geeks who have been programming down to the bare metal so long we think Assembler is a Higher Order Language).

      --

      We gotta make democracy safe for the world! -- Pogo
    3. Re:The wrong starting point? by Black+Parrot · · Score: 2


      > Now, when my employer sends me to classes on C++/java/etc., my most frequent comment in class is "Oh, that's like (blank) in Ada," which usually gets me strange looks from my classmates (and instructors).

      Yes, it looks like C --> C++ --> Java --> C# is on a trajectory that is converging toward Ada. Oldtimers grouse that some of the things people rave about in Java are the same things people used to whinge about in Ada, back before Illuvatar changed the world.

      > OT, but I think its unpoularity stems from the fact it was designed for DoD use, who then made it MANDATORY for all new projects.

      You may be right. Interestingly, now that the DoD is letting it wither it is actually expanding its market a bit, particularly in Europe. (Or so I understand.)

      --
      Sheesh, evil *and* a jerk. -- Jade
    4. Re:The wrong starting point? by AnotherBlackHat · · Score: 1

      But I can't help thinking that starting from C is probably a mistake.

      You seem to be missing the fundamental point.

      C isn't the choice C is the reality.
      C is what people already program in.

    5. Re:The wrong starting point? by pfavr · · Score: 2, Interesting

      I have worked in an ADA shop for 4 months. I started out by being very positive towards ADA - being told that "in ADA you write a little more than in C, but basically you just write what you mean".

      Then why is an array written in the same way as a function call? Without [] I have to write:

      i(j) -- i is the function which returns bla
      x(j) -- x is a table lookup which is used for bla

      I don't get it.

      An ADA compiler writer told me that also made it much harder to make the ADA compiler.

      I quit the job and is now back doing C.

    6. Re:The wrong starting point? by Anonymous+Brave+Guy · · Score: 2
      C isn't the choice C is the reality.
      C is what people already program in.

      You make my point for me, I think. As long as we insist on sticking to basing new things on what is currently popular, instead of what is currently good for the task in question, we will be hampered.

      This is the fundamental problem with things like C#. C++ is still the most powerful language on the block in that family. Java provides a similar language for those who prefer that extra level of safety and don't need the low-level power. The market is saturated at that point; there is no room for a third contender in the middleground. I don't think anyone will ever produce a language in that family that is genuinely significantly better than either C++ or Java for any given job.

      I know it's hard to get people to take up a new language, and hard to develop a new language without popular support. No doubt C++ wouldn't be where it is today if it hadn't been based on C, and yet now the C heritage is behind most of the biggest flaws in C++. What we need is to educate people enough to break this paradox, not to come up with ever more "slightly better" languages.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    7. Re:The wrong starting point? by dollargonzo · · Score: 1

      just about every language i know of that copies strings, does not check the length for yuo, and the language is therefore unsafe. c is as safe as the code yuo write in it. in terms of pointer arithmetic: yes there is a potential for mistakes, but it will just segfault if that is the case. void * and the such is what makes C so powerful. the security should lie in the code yuo write and HOW yuo write it, not the language yuo use. every language has flaws and gross insecurities. all they are suggesting is a type checking system.

      there is also a problem with that though, too! if i do anything unkosher or different than what cyclone expects of me, then it wont even compile. i WANT to be able to shoot myself in the foot when i want to: it adds enormous yet unharnessed power to those who do not know how to harness it. but to those that DO....yuo get the point.

      --
      BSD is for people who love UNIX. Linux is for those who hate Microsoft.
    8. Re:The wrong starting point? by Pr0xY · · Score: 1

      I am sorry to say that while you make some interesting arguments, I have to dissagree. You mention that C is "broken" because of functions like gets, but any programming worth hiring should know that they shoudl use fgets, plus many modern compilers give a warning about this unsafe function.

      A agree that this particular library function is poorly designed, but there is a simple replacment that fixes the problem. One of the nice things about languages that are built on previous work are is that they are diverse and you only need to use the features you need. For example, one of the most ingenious features of C++ is that it is almost entirely backwards compatible with C, this made the adoption of C++ very quick because programmers werent intimidated by having the learn a new language.

      Me on the other hand, I welcome new languages, and I agree that you must use the right tool for the right job (PHP for web based mySQL work, perl for unix shell scripting, java for binary portability)...and have spent time learning to program in more or less every language I have heard of. But the beauty of languages like C is that they can be used for ANYTHING. The only time the language is unsafe is when the programmer is unsafe. In my opinion, if you are smart enough to write programs, you shouldn't need a language that holds your hand as you go.

      My Java professor loved to brag about how he could make "crash proof" programs in Java, but of course he failed to mention that a properly coded program in ANY language can be "crash proof".

      C/C++ are safe languages by any definition, there is no reason why "security related" projects cannot be handled by them, most hacks I find are buffer overflow problems, well check your buffers! it isn't too hard. Or if you are really THAT lazy, use a pre-fab class in C++ that wil do some extra error checking for you.

      it is easy to code right, but easier to be just plain lazy.

    9. Re:The wrong starting point? by Fortmain · · Score: 1

      I never even noticed that.(!) Maybe it's my background using so many different languages over the years (I started in the '70s) and I've used () for arrays so often it didn't strike me as confusing. Of couse, I never said Ada was perfect, just that I prefer it.

      FWIW, I haven't worked with Ada for >2 years. My company landed a new contract, and I got moved to the new side, where I write Powerbuilder (Aauugghh!!!) PC programs for a customer who would rather do all his work on his Unix box!? (Note, the programs are legacy from the previous contractor. Part of our plan is to rewrite things to be platform independant -- probably in Java.)

      --

      We gotta make democracy safe for the world! -- Pogo
    10. Re:The wrong starting point? by voncheesebiscuit · · Score: 1

      I can't see how starting from a *very* popular programming language can be a bad thing. Sure C has its faults, but its also powerful and flexible enough for just about any task. IMO it makes perfect sense to start with C, then attempt to patch its weaknesses (as these guys are attempting).

      If they had written an entirely new language from scratch, the result may have been better, but it also would have had a much bigger chance of being ignored by everyone. The development and evolution of C++ is a good example of how leveraging off an existing language makes alot of sense.

    11. Re:The wrong starting point? by Black+Parrot · · Score: 2

      > I started out by being very positive towards ADA - being told that "in ADA you write a little more than in C, but basically you just write what you mean".

      More on this further below.

      > Then why is an array written in the same way as a function call?

      I would also like to have brackets for the array indices, and have even considered writing my own preprocessor to allow that and some other syntactic sugar. But don't confuse a language's choice of syntactic structures with "not saying what you mean". If you want to "say what you mean", you have to do it in the syntax provided by the language in question. None of the syntax for any language "means" anything at all, except by the conventions established by the language specification. So if you do write something in language X, don't assume that the syntax should "mean" what it does in language Y.

      > An ADA compiler writer told me that also made it much harder to make the ADA compiler.

      That's a rather curious claim. All you have to do is look up the identifier in a table (which you have to do anyway, in any language) and have a peek at its properties (which you have to do anyway, in any type-safe language), and then spill some code depending on what you have found.

      The static type-checking and overloading capabilities of Ada will make the compiler more challenging to write than some other compilers would be, but the difference between "(" and "[" is trivial for a parser. (Heck, some implementations of Scheme even let you use them interchangably.)

      But back to the "basically you just write what you mean". I say the same thing, almost, but I mean it much differently than your interloqutor apparently did. I phrase it something like -
      When you first start Ada you'll hate it, because it makes you say what you mean and mean what you say.
      Notice that I left out the word "just". Saying what you mean is a very demanding requirement, and those of us who haven't been through a software engineering program don't take to the requirement too kindly. We'd rather slop together whatever our language of choice allows us to get away with, and pay the price for it later if we're so unfortunate to still be around when the bug reports start coming in.

      By analogy, the difference between "saying what you mean" and the way we program when we can get away with it is like the difference, for mathematicians, between a proof and a proof sketch. One is formal and rigorous; the other makes a convincing show, but might not actually be correct.

      But its a very sensible requirement if you have safety in mind. And if you bite the bullet and get used to doing it in a "safe" language that expects is, you'll start reaping rewards for it. The whole point of using a language like Ada is, IMO, that it moves bug-catching earlier in the product's life cycle. The GNAT compiler will catch a lot of things at compile time that most other languages will "catch" by blowing up at run time. And it will catch other things by raising an exception at run time when most other languages would not catch them at all, leaving them to be caught by humans noticing that the program isn't producing the expected results.

      Don't get me wrong; Ada (or any other langage, past or future) isn't a magic bullet that's going to kill all the world's software bugs. But it is a language designed for software engineering, and if you have the patience to learn to "say what you mean" they you'll spend way less time chasing bugs, and the time you do spend on debugging will almost always be a matter of making sure your higher-level algorithm is correct.
      --
      Sheesh, evil *and* a jerk. -- Jade
    12. Re:The wrong starting point? by mselmeci · · Score: 1

      You have a point. After all, good programmers should be able to write code in 'unsafe' languages without fault. However, if one is on a project with people who are crappy programmers and has to root through their code to find a bug because they can't handle the raw power C/C++ give them, that would get trying. The solution shouldn't be to restrict the language, but try to work on the people.

    13. Re:The wrong starting point? by Anonymous Coward · · Score: 0

      Well an array is a function from an index to a piece of data. Actually I guess its a partial function, undefined outside its range of valid indices. sounds like indexing an array looking the same as a function call is more correct;-)

    14. Re:The wrong starting point? by dasunt · · Score: 2


      I don't know jack about programming (just doing a bit here and there), but isn't there a simple work around to treat all arrays as a function whose only purpose is to store and retrieve an array?

    15. Re:The wrong starting point? by Anonymous+Brave+Guy · · Score: 2
      You mention that C is "broken" because of functions like gets, but any programming worth hiring should know that they shoudl use fgets, plus many modern compilers give a warning about this unsafe function.

      And yet, in the last survey I saw, careless use of gets and fgets was responsible for more security flaws in Internet-facing software than any other single vulnerability. Don't make the mistake of assuming that because a language provides a safe way to do things, the programmers will be smart enough to use it. If all programmers were that smart, instead of just the exceptional few, then most programmers would still be using C++ instead of Java or C#.

      C/C++ are safe languages by any definition, there is no reason why "security related" projects cannot be handled by them, most hacks I find are buffer overflow problems, well check your buffers! it isn't too hard. Or if you are really THAT lazy, use a pre-fab class in C++ that wil do some extra error checking for you.

      We'll have to agree to disagree on that one, I'm afraid. C and C++ can be safe languages when used by skilful programmers, but they do not actively promote safety the way many other languages do. For example, with the introduction of templates, void* is not needed in C++ at all, yet it was inherited from C and remains. Hell, all the defaults in both languages are the "unsafe" alternatives. For example, note that using [] with a vector in C++ is the unsafe array access. A range-checked access is trivially available via vector::at(), but because it's "hard work" to get at it, most programmers use the unsafe one by default, when it should be the other way around.

      The sad fact is that, when considering a language for general use, I think you have to look at what the language promotes and supports for the average programmer. C++ is an exceptional tool in the hands of an expert, lightyears ahead of any other language in its family. But Java and C# offer garbage collection, range-checked arrays by default, string classes and limited or no pointer arithmetic. Those changes alone would remove the majority of implementation bugs (as opposed to design errors) in every C++ program I have ever seen.

      I agree that it is perfectly possible to write safe code in C or C++. It just requires a significantly higher level of skill to do it than it does in a language that actively promotes safety. As you say, any programmer worth hiring should know how to do this. Unfortunately, I'd estimate that only 10% of professional programmers are actually worth hiring for that kind of job.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    16. Re:The wrong starting point? by Anonymous+Brave+Guy · · Score: 2
      I can't see how starting from a *very* popular programming language can be a bad thing. Sure C has its faults, but its also powerful and flexible enough for just about any task. IMO it makes perfect sense to start with C, then attempt to patch its weaknesses (as these guys are attempting).

      Unfortunately, popular != good. The world is full of examples where the product that won the competition for popularity was obviously technically inferior to the product that no-one remembers any more.

      As for C being powerful, you might like to do a little more research about that. It's flexible, certainly, but not that powerful. Programs written using dialects of ML routinely come in a tenth the size and development time of the equivalent C program for some types of problem, for example. No amount of "patching" would give C that level of power; you'd have written a new language by the time you finished. C was a great language in its time, but let's not put it in a pedestal.

      The development and evolution of C++ is a good example of how leveraging off an existing language makes alot of sense.

      Agreed entirely. C++ wouldn't be where it is without that intense influence from C. But as I said before, the popularity of a language is rarely based on its technical merits. I'm not going to knock C++; I'm a professional programmer and it is my tool of choice. But you have to remain objective if you're going to move forward in the right direction. There are plenty of other languages out there that are, in their element, far superior to C++. The fact that some are not more widely used is more due to managerial incompetence and the laziness of the average software development professional in researching their craft than anything else.

      If people genuinely want to produce safer programming, I personally feel that the only way forward is to educate managers to look beyond mass-market tools, including languages, or at least to listen when their senior developers suggest them. In my experience, precious few managers do this, yet it would make far more difference to the quality of code written than any choice of language.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    17. Re:The wrong starting point? by voncheesebiscuit · · Score: 1

      As for C being powerful, you might like to do a little more research about that

      Well it depends on your definition of powerful, to me the power of the language lies its flexibility, adaptability, and even learning curve. C does pretty well on those tests, even though, as you pointed out, those attributes can come at the costs of development time.

      There are plenty of other languages out there that are, in their element, far superior to C++. The fact that some are not more widely used is more due to managerial incompetence and the laziness of the average software development professional in researching their craft than anything else.

      I agree that there are better languages (in terms of pure design), but I don't think the blame lies with incompetant managers or lazy programmers. I'm a C++ developer and when I tried to switch over to Java during a job last year, I found the tools and general support for the language were no where near what they were/are for C++. A good debugger and compiler is just as valuable in the development process as the language IMO.

    18. Re:The wrong starting point? by acroyear · · Score: 2
      And pace ESR, it wasn't designed by a committee.

      Um, read entry 2.5 of the Ada FAQ. Ada was designed by a committee for the Department of Defense, based on an original design by Jean Ichbiah, with modifications made throughout the period from 1978 to 1983, then the later committees that modified and approved it to what became Ada95. It has DOD and Committeeness written all over it...makes me barf every time I have to look at it.

      --
      "But remember, most lynch mobs aren't this nice." (H.Simpson)
      -- Joe
    19. Re:The wrong starting point? by acroyear · · Score: 2
      Actually, to follow up, entry 2.6 answers the question "Was Ada designed by a committee?" with the short answer "Ada was designed by a team, not a committee, and any sports fan knows there is a big difference."

      To which my response is that when the military or the government are involved, there is no difference -- the government is not a sports organization in the slightest.

      --
      "But remember, most lynch mobs aren't this nice." (H.Simpson)
      -- Joe
    20. Re:The wrong starting point? by mj6798 · · Score: 2
      Yes, it looks like C --> C++ --> Java --> C# is on a trajectory that is converging toward Ada.

      Ada may still be a good language for its intended application domain, but it is rather off on the sidelines when it comes to language evolution.

      Java has many features Ada lacks, including reflection, dynamic code generation, garbage collection, sandboxing, and dynamic loading. OTOH, Java does not permit untraced pointers or unsafe code. And Ada's genericity, module system, and process model are rather outdated.

    21. Re:The wrong starting point? by Florian+Weimer · · Score: 2

      When Ada was designed, there where machines in frequent use which were not able to deal with the "[]" characters (and there are still such machines, most of them embedded devices using ISO 646-IRV, though), so other characters would have to be used. However, I don't know why the designers decided to unify function calls and array indexing. The Ada 83 Rationale refers to research papers on this issue, but I haven't read them.

      Of course, using "[]" or "()" doesn't make writing an Ada compiler much harder. Of course, it adds an interesting twist to the name resolution rules, but even without this unification, they would still be rather complex.

      By the way, the correct spelling is "Ada", it's not an abbreviation, but a woman's name.

    22. Re:The wrong starting point? by Florian+Weimer · · Score: 2

      Ada supports garbage collection, but doesn't mandate it in the language standard.

      The genericity model (which uses explicit instantiation) makes it a bit easier to write good generics than other approaches (for example, implicit instantiation used by C++). In addition, non of the other languages you cited support generics at all.

      The module system is rather unique in its facilities to ensure that all modules are initialized in the correct oder. Most programming languages do not address the problem of initialization at all.

    23. Re:The wrong starting point? by hereticmessiah · · Score: 1

      To be honest, I've never had a problem with this kind of syntax. Then again, I tend to make my function names and variable names in any language look different. I've never quite understood why people use the same style for both...

      --
      I don't like trolls and mod against me if you like, but I'd prefer if you'd reply.
    24. Re:The wrong starting point? by mj6798 · · Score: 2
      Ada supports garbage collection, but doesn't mandate it in the language standard.

      That's a meaningless statement--in that sense, every language supports garbage collection.

      The genericity model (which uses explicit instantiation) makes it a bit easier to write good generics than other approaches (for example, implicit instantiation used by C++). In addition, non of the other languages you cited support generics at all. The module system is rather unique in its facilities to ensure that all modules are initialized in the correct oder. Most programming languages do not address the problem of initialization at all.

      This is 2001, not 1980. Genericity and modules in languages like ML are far more advanced and better designed than in Ada.

      Implicit instantiation in C++ and its interaction with overloading is a very powerful facility that goes far beyond genericity. It's a bit related to classes in Haskell. It has some problems the way it is implemented in C++, but the facility will likely become more prevalent in modern languages.

      Ada isn't bad for what it is. But it is showing its age and programming language technology has moved on--we really do know how to design better languages by now.

    25. Re:The wrong starting point? by Florian+Weimer · · Score: 2
      That's a meaningless statement--in that sense, every language supports garbage collection.
      No, garbage collection cannot work even for C programs. Perhaps for strictly conforming C programs, but this would be an accident.
      This is 2001, not 1980. Genericity and modules in languages like ML are far more advanced and better designed than in Ada.
      Ada 95 extended the package system over Ada 83. Could you give me a reference for the ML module system, in particular, it's elaboration handling?
    26. Re:The wrong starting point? by pfavr · · Score: 1
      I would also like to have brackets for the array indices, and have even considered writing my own preprocessor to allow that and some other syntactic sugar.

      I considered that as well. I saw somebody else in this thread write that he always used different names for arrays and functions, so that wouldn't be a problem. I'm lazy. And doing something in Ada requires about 3 times as much writing as in C. It is probably just because the standard Ada library is too basic.

      Saying what you mean is a very demanding requirement, and those of us who haven't been through a software engineering program don't take to the requirement too kindly.

      I have been through some courses, but only learned to program by looking at and writing lots of code (some of the code I looked at was very very bad).

      The Ada code I was working with was about the worst thing I have ever seen. A word for it is: typeghetti, i.e. too many type declarations which is redundant, and all dependant on eachother. No modularity whatsoever.

      We'd rather slop together whatever our language of choice allows us to get away with, and pay the price for it later if we're so unfortunate to still be around when the bug reports start coming in.

      When I write something short, it contains fewer bugs. IMHO one of the important things when learning to program is to learn to use the right subset of a language. Not every construct is worth using. I *always* use for-loops with index counting from 0 while it is less than the max-value (usually a #define'd constant).

      IMHO some engineers are not able to distinguish "advanced" from "complicated".

    27. Re:The wrong starting point? by ahde · · Score: 2

      semicolons and brackets doth not a language-family make.

      C# and Java bear no other relation to C & C++ than puctuation.

  16. Cyclone Beta Testing by Anonymous Coward · · Score: 2, Funny

    I have been beta testing the cyclone development environment for some time now. For mature cyclone development, the amount of code output generated is equal to that being dissipated due to bug tracking. The dissipation rate per unit area is code density times the lag coefficient times the CPU speed cubed (See Emanuel 1999 for details). One could either integrate a typical code profile over a range of radii from the projects center to the outer radius encompassing the core, or assume an average CPU speed for the inner core of the system. Doing the latter and using 40 m/s (90 mph) coding on a scale of radius 60 km (40 n.mi.), one gets a code dissipation rate (bug generation rate) of 1.5 x 1012 Watts. This is equivalent to about half the world-wide script generating capacity - also an amazing amount of bugs being produced!

    Either method is an enormous amount of overhead being generated by Cyclone. However, one can see that the amount of lines of code released in a release (by creating overflows) that actually goes to maintaining the Cyclone System spiraling bugs is a huge ratio of 400 to 1.

    Stick with C++ I think.

  17. The REAL traveling salesman problem... by Anonymous Coward · · Score: 0

    ...is getting cheap pussy in all the cities he visits.

  18. Pre-processor better?? by DaoudaW · · Score: 2, Interesting

    The Cyclone compiler will rewrite the code or suggest fixes to avoid potential bugs

    I don't mind suggestions, but I'm not sure I like the idea of having my code rewritten.

    Couldn't the same error-checking be incorporated into a pre-processor rather than developing an entirely new compiler/language?

    1. Re:Pre-processor better?? by Bob+McCown · · Score: 2, Insightful
      I don't mind suggestions, but I'm not sure I like the idea of having my code rewritten.

      In the early 90's, we were using one of the C compilers at the time (dont remember which, sorry, we quickly dumped it when Borland came out) one of the error messages was "Need semicolon here" with a ^ to show where. My reaction, every time, was "Shit howdy, if you know that, put it in, and make it a warning!"

    2. Re:Pre-processor better?? by Anonymous Coward · · Score: 0

      Because even a computer has better things to do than clean up after your sloppy messes over and over and over!

    3. Re:Pre-processor better?? by gorilla · · Score: 3, Insightful

      If you're using an optimizing compiler, then your code is being rewritten. Unrolling loops, storing of computed values, register assignment etc.

    4. Re:Pre-processor better?? by trilucid · · Score: 1


      This will probably result in a Karma hit, but what the hell :).

      For all of you who don't know Bob, check out his site: SlashDuh.org. Pretty decent stuff over there, generally.

  19. Re:Survival Guide for Taking a Dump at Work by Anonymous Coward · · Score: 0

    this is quite possibly the funniest thing i've seen all day! it's so true, i never came up with names for any of this phenomena, but i think it has all happened here at work!

  20. Vision of the future by Pemdas · · Score: 4, Funny
    The Cyclone compiler will rewrite the code or suggest fixes to avoid potential bugs. Even if a bug still occurs, the compiled system will lead the program to halt safely, not crash.

    Am I the only one to whom this sounds like potentially a really bad idea? I mean, think about it, coding along one day:

    #include

    int main() {
    printf("He

    At this point, small, cute cartoon versions of Kernighan and Ritchie pop onto the screen and say "It looks like you're writing a Hello World program! Click here to check this program for bugs automatically..."

    I'm just shuddering at the thought...

    1. Re:Vision of the future by Embedded+Geek · · Score: 1

      You just sent me to a very scary mental place... I think I'll go underneath my desak and cry for a while.

      --

      "Prepare for the worst - hope for the best."

    2. Re:Vision of the future by pbf · · Score: 1

      The day that this feature is available in vi, I will quit software design for good...

      --
      et les Shadoks pompaient...
    3. Re:Vision of the future by Alan · · Score: 2

      You've never heard of Vigor?

    4. Re:Vision of the future by SirTreveyan · · Score: 1

      Damn that sounds like that annoying paper clip POS the microcrap had/has(?? dunno...dont use microcrap office any more ). Who ever thought of that one should have been put up against the nearest wal and shot!!!.

      --

      SELECT * FROM User WHERE Clue > 0

      0 rows returned

    5. Re:Vision of the future by Anonymous Coward · · Score: 0

      You haven't seen Vigor yet, have you?

      Ten times worse...

    6. Re:Vision of the future by Anonymous Coward · · Score: 0
    7. Re:Vision of the future by ethereal · · Score: 1
      --

      Your right to not believe: Americans United for Separation of Church and

    8. Re:Vision of the future by markana · · Score: 1

      Don't even *think* this - remember what happened the last time someone joked about adding a paperclip to vi!

    9. Re:Vision of the future by adamy · · Score: 1

      It came from Userfriendly. I could make a link directly to the comic, but I think I will just destroy you day's productivity by pointing to the site and suggesting you find it...

      --
      Open Source Identity Management: FreeIPA.org
    10. Re:Vision of the future by SpeelingChekka · · Score: 2

      Or when people laughed at the notion of an email message that could automatically invoke executable code and install a virus just by being read (a la "good times" hoax :( ).

  21. Run-time checking is slow by mangu · · Score: 2

    It can be done in C, if necessary:

    if (!infile) { perror("input file"); exit(1); }

    The advantage of C is that you are allowed to not use it, if you think it's not recommended in that case.

    1. Re:Run-time checking is slow by anshil · · Score: 1

      nitpicking tip 1:
      Generally do not use the 0 is zero everything else is true if avoidable. We all now how it works, but it makes stuff harder to read/understand/maintain for coders beside yourself.

      nitpicking tip 2:
      use assert, it's easier / less to type:
      assert(infile != NULL && "infile is NULL.");

      --

      --
      Karma 50, and all I got was this lousy T-Shirt.
    2. Re:Run-time checking is slow by Anonymous Coward · · Score: 0
      Escape hatches are occasionally useful, provided the user knows (for security reasons!) when they might be in use.

      The problem with C is that the default is not to check. C has so much "undefined behavior" that adding the checks takes a lot of thought and effort, so of course hardly anyone bothers, with well-known tragic consequences.

    3. Re:Run-time checking is slow by sporty · · Score: 2
      well, when function names are a little more towards production quality names, such as shape->put(), it can be quite readable.


      if(!shape->put())


      though i know of people who bitch about things like (in perl)


      if(!$x=)
      { ... }

      --

      -
      ping -f 255.255.255.255 # if only

  22. Seeking Cmdr Taco's taco by Anonymous Coward · · Score: 0

    Why didn't they name it d?

    IF you know where I can get
    a taste of cmdr TACO's device,
    then by all means tell me.

  23. Just one thing to say by joenobody · · Score: 2

    I'm sorry, Dave, I can't compile that.

    I know it's cliche, but really, do we expect it to be as smart as another competent programmer reviewing code?

    --

    1. Re:Just one thing to say by angel'o'sphere · · Score: 1

      I once wrote a compiler for a toy language controlling robots in an areana.

      The idea was to have a replacement for the ancient "Robot Wars" on Apple ][ for Macs.

      I let the compiler repare all syntax errors I found easy to repair, like missing ';' and stuff like that.

      Also I placed all errors and warning as DOC comments into the source code.

      The compiler striped later the fixed error and warnigns from the sourcecode again.

      As the language only used type less variables (basicly only longs where used) I also placed declarations for undeclared variables into the appropriated places but commented tehm away and placed an error comment behind it.

      The final step: inferring variabels which where misstyped from known identifiers I never finsihed.

      Well,
      it was quite convenient to have all the errors popping up in the source code. And to have them FIXED automaticaly.

      In case of a missing ';' you just do nothing but compiling twice. (The ; is allready inserted and the error comment is stripped by the second compile step)

      *I* wrote it, sure *I* liked it :-)

      Regards,
      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:Just one thing to say by Tom7 · · Score: 2


      Sure.
      Lots of us have been programming in statically-typed, safe languages for a long time. We do it not because we're poor, weak-minded programmers but because we don't have time to spend tracking down aliasing bugs and memory leaks. Though the compilers are not as "smart" (in a very strong sense) as people, they are much much more patient, and are actually very good at finding or preventing exactly these kinds of boring bugs.
      Most of these languages are very abstract. (ie, SML). Cyclone is actually a project to bring some of these ideals to the systems world, where concern over data layout and memory usage are more pronounced. They've added a few useful features to C, too (polymorphism! datatypes! pattern matching!)... so I think this is a good thing, even for hardcore C cowboys.

    3. Re:Just one thing to say by gorilla · · Score: 2
      Maybe not as smart, but more constant. When C compilers started warning about things like

      if(a=b){
      }

      then we found code which had been reviewed by many different eyes without seeing these mistakes. We're just not good at doing repetative tasks, especially if we think we know what should be there. It's the the same reason we run a spell checker to check for the same word in a row, we're just not good at looking for that sort of mistake.

    4. Re:Just one thing to say by Anonymous Coward · · Score: 0

      however, that could very well be what the programmer intended, shorthand for a=b; if (a){...}

      there's a *lot* of skanky code out there like that (look at the linux source code some day)

  24. Lclint by Ed+Avis · · Score: 5, Informative

    A lot of the static checking made possible by Cyclone can be done for ordinary C with lclint, which lets you add annotations to C source code to express things like 'this pointer may not be null', 'this is the only pointer to the object' and so on. You write these assertions as special comments, for example /*@notnull@*/. These are checked by lclint but (of course) ignored by a C compiler so you compile as normal. (If you weaken the checking done, lclint can also act as a traditional 'lint' program.)

    Also C++ provides a lot of the Cyclone features, not all of them, but it certainly has a stronger type system than C. I'd like to see something which combines all three: an lclint-type program that lets you annotate C++ code to provide the extra checks that Cyclone (and lclint) have over C++.

    --
    -- Ed Avis ed@membled.com
    1. Re:Lclint by mvw · · Score: 2
      A lot of the static checking made possible by Cyclone can be done for ordinary C with lclint

      Apparently neither the poster nor the 5 folks who modded this up read the project page carefully otherwise they would have noted this link on it, where they compare their project to other similiar efforts and discuss the approaches behind. One of them lclint.

  25. Cyclone can solve C++ wrapper problems? by N3P1u5U17r4 · · Score: 1

    The interesting thing here is that Cyclone may be able to solve C++ wrapper problems. This is not a new problem in the C/C++ world.

    When programmers started using C++ to enhance systems written in C, they needed some way to allow C functions (functions that had no knowledge of C++ calling conventions) to call the methods of C++ objects. They wrote wrapper functions to do this. A wrapper functions is a C function that is compiled as if it were a C++ function. Because the wrapper is compiled as a C++ function, it understands the C++ calling conventions. Since it is a C function, other C functions can call it. Anytime a non-wrapper C function needs to call a C++ class method, it calls the wrapper function and requests the wrapper to make the call for it.

    Cyclone allows you to permiate your code with wrapperless sub functions which demand redundancy. You can't ask for better than thay when dealing with wrappers!

    --
    You're Just Jealous Because The Voices Are Talking To Me.
    1. Re:Cyclone can solve C++ wrapper problems? by Anonymous Coward · · Score: 0

      you'll love .net then.

      VB, C#, C, C++, Perl, etc can all call each other, override each other's classes, and more.

  26. Why.... by jd · · Score: 2
    ...is this any better than the Semantic Validating Compiler that Stanford University developed?


    Other than "new" and "improved" sell products better than "useful".

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    1. Re:Why.... by ethereal · · Score: 1

      Is that the one that was used to track down a bunch of errors in the Linux kernel sources? It kind of sounds like the same thing.

      --

      Your right to not believe: Americans United for Separation of Church and

    2. Re:Why.... by jd · · Score: 2

      Yes, that's the one.

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  27. New language? by LinuxDeckard · · Score: 5, Interesting

    I always let out a bit of a grumble when a new programming language comes out; they seldom add anything truly new to programming. When I read that Cyclone was strikingly similar to C, I was intrigued enough to skim through the docs.

    Put bluntly, Cyclone seems to be little more than C for lazy programmers. Fat pointers for those who can't follow the logic of pointer arithmetic and *`H for those intimidated by malloc() is not a beneficial service.

    --

    UNIX *is* user-friendly. Its just more selective on who its friends are. --Scott Adams
    1. Re:New language? by Hard_Code · · Score: 2

      Yeah, just safety switches on firearms and nuclear weapons are for "lazy" gunmen and silo missile controllers, traffice lights and airbags are for "lazy" automobilists?

      There is a ring in the Inferno dedicated to people like you.

      --

      It's 10 PM. Do you know if you're un-American?
    2. Re:New language? by Panaflex · · Score: 2

      Well, I've been programming C for a long while.. I don't think you read far past the first paragraph..

      ? pointers know their bounds
      Garbage collection (no explicit freeing - suddenly malloc becomes easy)
      try/catch exceptions (Whoa.. that's way way not C)
      tunion (Unions that know what it is - unions are USEFUL now!)

      I would say that exception checking in itself is going to go a LONG way for this. Also, the GC seems very fascinating and will probably make programs alot faster.

      Things like array.size, memory management, and no int pointer casting are very welcome.

      When you're like me and just finished a 100k line custom server written in C, you might appreciate these things.

      My only hope is that they robustly support multi-threading (in a smart way - no global locking whenever you strcpy like in pthreads).

      Pan

      --
      I said no... but I missed and it came out yes.
  28. I wish by Anonymous Coward · · Score: 0

    I wish it could figure out my code base here, at least them someone would know WTF is up with this mess.

  29. The right starting point! by Anonymous Coward · · Score: 0

    I'm a professional software developer, and all for anything that makes my code safer without unduly compromising it. But I can't help thinking that not starting from C is probably a mistake.

    C is a fundamentally safe language. It has some easy fixes (remove the always-unsafe gets() function from the library, for example). It has some fundamental "bonuses" (pointer arithmetic and the use of void*, for example). I quoted "bonuses" because, while these features make the language necessarily safe, they are also very helpful in the low-level programming that got C to where it is today.

    The underlying problem here has never been with C, it's been with using C for the wrong jobs. Application code, and certainly high-level code where security is essential, are C's strong suits. I can see how even the geniuses we're talking about can start from such a great language (in the context we're discussing) and successfully make a broken language out of it.

    I would not expect a much better solution to be that followed by later C-like languages. C++ retains the low-level control, but other languages (Java, C#, etc) are available to those willing to sacrifice some of that control in exchange for added safety, and consequently may be better tools for different types of project. The biggest problem at the moment is that none of these "safer" languages has yet developed the same raw expressive power of C++. As they evolve, and catch up on the 20-odd year head start, hopefully we'll see programmers given a genuine choice between "safe but somewhat limited" and "somewhat safe but unlimited".

  30. It's nothing more than built-in PC-LINT! by BenJeremy · · Score: 2, Informative

    Seems to me PC-LINT gives you the same contextual checking... but I could be mistaken.

    1. Re:It's nothing more than built-in PC-LINT! by kaoshin · · Score: 1

      This is addressed in the related projects documentation.

      http://www.research.att.com/projects/cyclone/rel at ed.html

  31. Actually Java does have by jeffy124 · · Score: 2, Informative

    you're not up-to-date on some bullets

    the 1.4 jdk (currently in beta) has pattern matching

    parametric polymorphism (iow - templates) are in development and being called generics

    --
    The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    1. Re:Actually Java does have by Anonymous Coward · · Score: 0

      Are you referring to some kind of crummy regexp library or function set when you speak of pattern matching, or the "real" kind which is rather often found in functional languages such as ML and Haskell?

      I for one have a hard time imagining the syntax horrors created by pattern matching in Java.... int (x, y) = object.returnTuple(); - hyörgh!

    2. Re:Actually Java does have by jeffy124 · · Score: 2
      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    3. Re:Actually Java does have by lcrocker · · Score: 1

      ...and what the hell is a tagged union if not a class? That's just good old non-parametric polymorphism, which all OO language have.

      --
      --Lee Daniel Crocker : http://www.etceterology.com My life is in the public domain.
    4. Re:Actually Java does have by kaisyain · · Score: 2

      I said pattern matching, not regular expressions. I don't think you know the difference, cause I've been using 1.4 jdk for a while now and haven't seen anything suggesting it has pattern matching.

    5. Re:Actually Java does have by jeffy124 · · Score: 1, Redundant

      i think this is the 3rd time i've posted this link in this thread:
      http://java.sun.com/j2se/1.4/docs/api/java/util/re gex/package-summary.html

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    6. Re:Actually Java does have by Anonymous Coward · · Score: 0

      that's because, as other posters have pointed out, there is a BIG fucking difference between regular expressions and the kinda pattern matching you get in a modern functiional languages.

  32. Clint++ by CheapScott · · Score: 0

    This sounds like an enhancement on C++ and Lint atop C, so why not "clint++". (I really am kidding...don't flame). As long as the unsafe "C" is around, many will be happy (so that we can play with the system). Otherwise, significant/robust applications should use these features to strive to be non-Microsoftian (i.e. buggy).

    Perhaps Cyclone will be open. Can they at least allow for add-on modules so that we can increase the rules that it follows?

  33. Safety in C and C++ by Animats · · Score: 4, Insightful
    Cyclone is a long way from C. It requires garbage collection, has exceptions, and quite a bit of new syntax. Bell Labs has generated quite a few C derivatives. C++ is the only one to catch on, but Cyclone is at least the fifth C derivative to come from There was also C+@ (a Smalltalk-like variant) and two others previously discussed on Slashdot.

    I'd like to see Cyclone's kind of safety, but if you're going to require garbage collection and forbid pointer arithmetic, you may as well use Java.

    I've proposed "Strict Mode" for C++, a compatible retrofit to C++ that uses reference counts like Perl, but with some optimizations to get the overhead down.

    A basic decision is whether to have garbage collection. If you have garbage collection, C++ destructors don't fit well. (Java finalizers, called late, during garbage collection, can't be used for things like closing files and windows. Microsoft's C' has destructors, but the semantics are confusing and ugly, and we don't have much mileage yet on how well that will work.)

    Reference counts work reasonably well. There's a problem with not releasing circular structures, but that doesn't keep Perl from being useful. Perl now has "weak" pointers (they won't keep something around, and turn to null when their target goes away), and if you use weak pointers for back pointers, most of the circularity problem goes away. True rings of peer objects are rare, and they're the main case where weak pointers won't solve the problem.

    If you don't have garbage collection or reference counts, programs obsess on who owns what. A basic problem of C and C++ is that it's essential to track who owns which objects and when they're supposed to be released, yet the language offers no help whatsoever in doing so. This is the fundamental cause of most crashes in C and C++ programs. Almost every core dump, "bus error", or "general protection fault" comes from that problem. So it's worth fixing.

    It's the right time to address this. We're in a period of consolidation, now that the dot-com boom has collapsed. Our task as programmers over the next few years is to make all the stuff that sort of works now work 100%.

    1. Re:Safety in C and C++ by zCyl · · Score: 2

      One day a student came to Moon and said: "I understand how to make a better garbage collector. We must keep a reference count of the pointers to each cons."

      Moon patiently told the student the following story:
      "One day a student came to Moon and said: `I understand how to make a better garbage collector...

      -- Jargon File

    2. Re:Safety in C and C++ by calumr · · Score: 1
      If you don't have garbage collection or reference counts, programs obsess on who owns what. A basic problem of C and C++ is that it's essential to track who owns which objects and when they're supposed to be released, yet the language offers no help whatsoever in doing so.

      Objective-C (used in NeXTStep and Cocoa frameworks) has been around for quite some time now.

      The documentation clearly states that if an object allocates another object, it must either release it explicitly or autorelease it, using the reference-counting features that NeXTStep/Cocoa provides.

      I can tell you, its a lot easier than any other language I've used.

    3. Re:Safety in C and C++ by gorilla · · Score: 2
      Reference counts are only one way to implement garbage collectors, and seen as one of the simplest, but not the best.

      A better way is to do reference tracing, where you trace all the objects which are currently in scope, and follow all their references. Anything which is not followed, is obviously collectable.

    4. Re:Safety in C and C++ by elflord · · Score: 3, Interesting
      Reference counts work reasonably well. There's a problem with not releasing circular structures, but that doesn't keep Perl from being useful.

      It doesn't prevent perl from being useful, but no language which uses reference counts is ever going to replace C or C++. The problem with reference counts is that sometimes they cause more problems than they solve. A good example is in GUI programs, where a lot of objects might be mutually aware of each other. That's not to say that reference counts are not useful. Rather, forcing programmers to use reference counting to manage memory whether appropriate or not is problematic.

      If you don't have garbage collection or reference counts, programs obsess on who owns what. A basic problem of C and C++ is that it's essential to track who owns which objects and when they're supposed to be released, yet the language offers no help whatsoever in doing so.

      C++ givas the programmer the flexibility to choose a memory management strategy that suits the problem at hand. Sometimes pool allocation works. Sometimes reference counting works. Sometimes, parent/child management works. It's very simple to implement reference counted classes in C++. It's certainly not necessary to exclusively use an "exclusive ownership" model in C++.

      Almost every core dump, "bus error", or "general protection fault" comes from that problem.

      They come down to a lot of problems -- library incompatibilities, bounds errors, and other things can cause these problems. I think it's naive to assume that using reference counting for everything will just make the problem "go away". Writing reference counted code without memory leaks gets quite difficult when the data structures are more complex.

      The URL you have is interesting, and I think for some types of problems, using an object system where you just reference count everything is probably a good idea. But I question its value as a cure-all.

    5. Re:Safety in C and C++ by OddWeapon · · Score: 1
      This is just not true. Cyclone give the programmer the _option_ to use a garbage collector. However the collector can also be excluded from the executable entirely.


      Cyclone also provides provides region-based memory allocation. This is an explicit allocation/deallocation scheme where the user specifies object lifetimes in a compiler-verifiable way.


      In general it should be kept in mind what Cyclone seems to be targeted at. That is: C code is still used to write important systems code where other languages (eg Java, etc) just won't do for many reasons. These other languages mostly suck because they don't give the programmer direct control over memory layout (essential for systems programming) and often also sacrifice perdictable performance (read garbage collection). Cyclone seems intended to remedy this. You get a much safer C with all the good features left in and a bunch of cool extra's from ML thrown in for good measure, since the author is an ex-ML guy.


      Cyclone seems to address a real need in the systems programming community, which is that we still have idiots writing software that everyone uses...

    6. Re:Safety in C and C++ by nick-less · · Score: 1


      We're in a period of consolidation, now that the dot-com boom has collapsed. Our task as programmers over the next few years is to make all the stuff that sort of works now work 100%.


      nah, leave that old stuff - I have a cool new idea...

      *g*

  34. Re:Survival Guide for Taking a Dump at Work by Anonymous Coward · · Score: 0

    When I take a dump at work, I go to the Marketing bathroom.

    Let them smell my shit, it serves them good!

  35. Done that by ch-chuck · · Score: 1

    I've already identified, singled out and deleted code known to be potentially dangerous and installed Linux instead.

    --
    try { do() || do_not(); } catch (JediException err) { yoda(err); }
  36. This could... by nll8802 · · Score: 1

    This could save a whole lot of time if it worked correctly... I spend more time tracking down stupid errors Ive made compared to that of tracking down missing semi-colins; 8-) -- FearLinux.com

  37. Error 0 by VA+Software · · Score: 2, Funny

    Compiling...
    test.c
    C:\stuff\test.c(3) : 'int main(void) {' : Error 0. Program is in C. This section of code could cause problems.

    --

    ---
    http://slashdot.org/moderation.shtml
  38. Legacy Savior? A culture fix would be better... by Embedded+Geek · · Score: 5, Insightful
    In my shop, we do everything on a shoestring, kludging together tons of C legacy code from multiple generations of our products. We take an application that ran on a homebrewed executive and stick it on an RTOS, spoofing it so it doesn't know the difference. We grab code written on an 8 bit microcontroller and port it to our 32 bit x86 with minimal testing. Given all this, my first thought at reading the article was to raise three cheers. The idea of making a system already written a lot safer... I can hardly find the words.

    Then I got chewing on it and realized something: when I came on board and suggested running lint on our code, I was shot down by both the rank & file and by management (who each blamed the other). When I suggested a concerted effort to rewrite our code to eliminate or justify (in comments) every warning our compiler spewed on a build, I got a similar reaction.

    Don't get me wrong. I think cyclone still sounds great, especially the pattern matching and polymorphism indicated on its home site. If it can gain some momentum, it stands to have a real place (niche?) in dealing with legacy systems. For my shop, though, I fear much of the value would be wasted. Until we change our motto from "There's never time to do it right, but always time to do it over" we're going to continue repeating our mistakes.

    --

    "Prepare for the worst - hope for the best."

  39. there has been tool similar in purpose by zoftie · · Score: 2, Informative

    lint - is name of it. And it was made 20 years ago.
    p.

  40. anal compilers by Performer+Guy · · Score: 2

    This sounds even more annoying than lint. :-)

  41. What about PC-Lint? by unformed · · Score: 2

    (I'm not associated with this at all, but I read about it in Game Developer once, and it's really interesting.) @ Gimpel software.

    I generally don't like internal type-checking within a language, because it results in slowness, and some los of power. (Sometimes there are times you want to do things that you normally shouldn't be doing, in order to speed up routines.) A language which prevents "bad programming practice" ends up screwing itself over. However, having an external source-code checking utility that tests for bad programming, while still allowing complete power would be much more useful, to me, at least....

    1. Re:What about PC-Lint? by Anonymous Coward · · Score: 0

      Runtime type checking slows down a language. Static type checking does not. This language does static type checking.

      In other words: read the damn article before spouting off your ignorant mouth

    2. Re:What about PC-Lint? by affenmann · · Score: 1

      > I generally don't like internal type-checking
      > within a language, because it results in
      > slowness, and some los of power

      What they use here is static type checking at compile time. The type information is thrown away before running, since the type-checker has already proved that nothing bad can happen...

      Hence, your program will rather be faster than slower.

  42. Are we're looking at the future? by The+Bungi · · Score: 1
    MSVC++ 7 (when used along with the .NET framework) has something called managed extensions that do this, except better.

    Plus, it works. Kewl, actually. It's not Java or C# by any stretch of the imagination, but it does boost productivity quite a lot, and it's not a speed hog, either.

    I think we're going to see more of this in the future -- semi-low level languages such as C/C++ with some sort of extensions or "plug-ins" that not only encapsulate a lot of functionality but also save us from our own mistakes. Think of STL with a GC'ed memory space.

    I would tend to say loading up the whole of .NET is a bit much just to keep me from reading three bytes outside of a memory buffer but it's an interesting idea nonetheless. How far can this go on before we start complaining about someone turning C++ into a scripting language...? Hmmm.

  43. Rasterman and a pile of poo by Anonymous Coward · · Score: 0

    Maybe Raster can use it to code E 17...after all e16 was a buggy

  44. No, it's called "Pascal"! :-P by Surak · · Score: 2

    I heard those groans of disgust!

    Seriously, modern Pascal compilers like Delphi/Kylix are capable of some compile-time checking...Pascal already has strict var type checking, and all you have to do is make sure its turned on when you compile.

    This also includes bounds checking for arrays. Pointers are handled better than most C compilers, too.

    The key difference here is that it sounds as if Cyclone checks the code for *intent* rather than just checking the types and such. That IS a hard problem. :-)

  45. Cannot cast? by drcannaba · · Score: 2

    Cannot cast what I want? Oh, I feel cast-rated!!

  46. Ways to crash a program by SolidCore · · Score: 1

    Another potential way to crash a program or violate security is to dereference a dangling pointer---a pointer to storage that has been deallocated. These are particularly insidious bugs because the error might not manifest itself immediately.The way that Cyclone fixes this is by assigning each object a symbolic region that corresponds to the lexical block in which the object is declared, and each pointer type reflects the region into which a pointer points.

  47. Smarter than the compiler? by iBod · · Score: 2, Insightful
    i program in C because i'm smarter than the compiler

    Well, that's not too difficult. Compilers are just a bunch of algorythms.

    Question is - are you smarter than the person that wrote the compiler?

    1. Re:Smarter than the compiler? by macpeep · · Score: 1

      "algorythms"

      The word is "algorithm".

    2. Re:Smarter than the compiler? by dakoda · · Score: 1

      Its not a matter of being smarter than the compiler's programmer, but being smarter than the writer was willing to be.

      There are _many_ times when one does indeed know that they are smarter than the compiler, and using C to circumvent this provides a program with a faster execution speed, a smaller executable size, or both.

      The benefits (imho) outweigh the added cost of going thru your code and making sure its good on your own. for the record, there is no excuse for bad code, the coder was simply lazy, or didnt both to check their code. automated checking might have its uses, but there are still many places where this type of autmoation will trip and call you a bad coder.

    3. Re:Smarter than the compiler? by iBod · · Score: 1
      I know, I know - it was just a typo! Did you really have to be so nit-picky as to point it out?

      Anyway, maybe I meant 'Al Gore-isms'. Didn't he invent compilers?

    4. Re:Smarter than the compiler? by macpeep · · Score: 1

      :) Well, I didn't mean to come off sounding like an asshole. I'm from Finland and english is only my 3rd language so I don't pretend I'm the grammar police but "algorythm" really rubbed me the wrong way. :)

    5. Re:Smarter than the compiler? by krs · · Score: 1

      Karma whore!

      :-)

  48. Probably about as effective as Grammar Check by Phrogz · · Score: 2

    Microsoft Word's grammar check has suggested to me in the past that "do it for the greater good" should probably be "do it for the greater well ".

    It's sometimes helpful in helping my catch my grammar mistakes. But more often than not, it's a PITA, and the act of wading through its incorrect suggestions is more work than I think it's worth. And that's when it's SO easy to figure out if the suggestion is right or wrong...the sentence is on the screen, standing alone, and I can instantly decide if it's right or not.

    Now, imagine wading through a bunch of suggestions and warnings on your code. Imagine having to figure out the context for the flagged code segnments, and having to review the code and all code which references it to see if it's correct or not.

    Sure, if you've got free time or resources to throw at it, using computer heuristics to attempt to help out humans is nice. But you have to realize that at this stage in the game, it often takes a lot of work to vet those results in order to glean any gain.

    1. Re:Probably about as effective as Grammar Check by krlynch · · Score: 2

      Of course, there is a huge difference between a language that can be described by mathematical logic (well, almost :-), ie. Cyclone, which is supposedly designed for intent checking, and natural language, which isn't even consistent, much less mathematically consistent and describable. The restricted domain and expression structure of Cyclone may enable it to do a much better job than any rules based, context ignoring, english grammar checker ever could.

  49. Too bad you still have to rewrite... by Anonymous Coward · · Score: 0

    ...if only they could do this with the current C code!

  50. Re:How linux is an inferior desktop OS by BigBir3d · · Score: 1

    "Hello, as an experienced MCSE"

    uhhh... minesweeper certified solitaire expert...

    "1) Remove the bloat. Most linux distro?s ship with way to many useless programs. Desktop users do not need 10 different text editors. Give them one or two good ones and that will be enough."

    Truth.

    "2) Dump the command line. Desktop users do not use command lines. Windows is light-years ahead in this regard. Even their server OS has a great gui, and it is not necessary to use the command line. Linux needs to follow Microsoft?s lead and get rid of the command line. You could maybe include an option for advanced users, like how windowsXP has an ms-dos prompt, if you really want to use it."

    I thought the idea of Linux was to not follow Microsoft's lead. Great gui?? Please define great. The MS-DOS prompt is fairly neutered, and has been for some time. Make up your mind, gui or not.

    "3) Dump open-source. Normal desktop users do not care about source code, they care about good programs. They do not want to compile anything. Linux needs real companies that actually know how to make good interfaces. Right now they are few and far between."

    ...good programs...good interfaces, truth. Obviously users do care about source-code.

    "4) A universal gui system. Linux needs ONE gui. Perhaps people should focus on developing KDE into a competitive platform. Forget about gnome and everything else."

    Why? KDE and Gnome and all the others are fairly distinct, giving different types of users different types of gui's. *gasp*

    "5) Make upgrading the software easier. Desktop users need an easy way to upgrade the kernel."

    Have you used a recently released distro lately? This is one of the concerns being addressed (ie Red Hat, Debian, Mandrake etc.).

    "6) Get a good web browser. Linux has no good web browsers right now. Netscape is old and bloated. Opera cost extra and lacks some features. Mozilla is still beta and isn?t even up to version 1.0 yet, so it doesn?t count. Linux needs a browser that is competitive with IE, and right now IE is light-years ahead of anything for linux."

    What happens in 6 months when there are numerous browsers available that are better than IE? Of course "better" is a rather ambiguous term...

    "7) Proper office programs. If you want Linux to be used in offices, you need decent applications. These programs should be able to import all MS formats, past and present. Microsoft is still light years ahead when it comes to their office programs. "

    MS Office can't open older Office formatted documents properly either. Are K-Office and/or Star Office so horrible?

    "8) Backward compatibility. WindowsXP can run dos programs, windows 3.11 programs, windows9x programs, windowsNT programs, ect? Linux is barely backward compatible."

    Not true! The NT/2000 kernel is different than the 9x kernel, and alot of the older programs don't work on the "other" kernel.

    "Right now I would recommend windowsXP for any sensible desktop user."

    Right now, I would stick with something that is known to be stable, like Windows 2000 Professional. If I was not using Linux that is...

  51. Humongous... by fiftyfly · · Score: 1

    Actaully the word was coined/invented by Lewis Caroll (of Alice in Wonderland fame). Lewis Carol, of course being a pen name for Charles Lutwidge Dodgson. Chuck was, as you may know, a bit of a mathematician and published many works on the subject - usually text & guides. In short, "a scientist who uses the word humongous" may not be as rare as you think :)

    --
    "Sanity is not statistical", George Orwell, "1984"
  52. Re:IMPORTANT WARNING: Avoid CmdrTaco's "special ta by Anonymous Coward · · Score: 0

    What a rubbish troll. It is neither funny or clever, and thus it's blantant vulgarity tarnishes it with the "stupid brush". And learn to spell - bad spelling gives an air of incompetence and reduces chances of people taking your (seemingly inferior) intellect seriously.

  53. Jesus is coming by Anonymous Coward · · Score: 0

    I have not been saved through your website. I however have been saved on my own at my church. I spent 21 years living the ways of the world, the ways of satan. I'm not proud of this, but I committed almost every sin known to man (except murder and rape and incest and reading slashdot). I lied, cheated, stole, condemned, cursed, even cursed God, I had so much hatred in me I even scared myself, I even hated myself. I was for myself and nobody else, drank, took drugs, thought the whole world owed me something. But in November 2001 my whole world crashed around me, I almost lost my wife, kids, lively hood due to my ignorance. I went to God in prayer in front of family and friends, and accepted the Lord as my own personal savior, I gave my life to him. I left him in my heart and soul. My life has changed greatly from this, its still not "peaches and cream", but things are so much better. God never promised uncloudy days in our lives, but he makes it much, much easier when times are troubled because when we accept him and turn our lives over to him he stands and walks with us every step of the way. And I know he's with me, I know it!!! And I'm PROUD of it, and feel much better. My life has changed, and its for the better. I found your website by accident actually, and it has been a great inspiration to me. I am not a man of means (not much money) and cannot send a donation right now, but I've touched the hand of God and I know he will make it possible for me to do things like that soon. In the mean time, keep up the great website, May God Bless and the farts stay silenced!!

  54. bad idea by istartedi · · Score: 2

    get safety from the vm like java does. that way you don't have to re-write all your code. even java still has null pointer exceptions at runtime and it is regarded as very safe.

    i'd say more but i cut my right hand today and typing sucks.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    1. Re:bad idea by omnirealm · · Score: 2

      even java still has null pointer exceptions at runtime and it is regarded as very safe

      Speaking of which... how can you have a null pointer exception in a language that doesn't have pointers?

      --
      An unjust law is no law at all. - St. Augustine
    2. Re:bad idea by Anonymous Coward · · Score: 0

      objects are actually pointers to objects, which is why you need to new them before using them.

    3. Re:bad idea by Anonymous Coward · · Score: 0

      You haven't done much with Java, huh?

  55. Re:IMPORTANT WARNING: Avoid CmdrTaco's "special ta by Anonymous Coward · · Score: 0

    Damn, I used "it's" rather than "its". DAMN IT.

  56. -I ? by Norbert+de+Jonge · · Score: 0

    I tried it out on my software packages... and -I does not seem to be totally working. Or is it just me?

  57. Didn't Bill Joy announce C+++=-- in the 80's? by SimHacker · · Score: 2
    Some time during the roaring 80's, Bill Joy made the following two predictions at a Sun Users Group talk:

    a) Computers would increase in speed, to the tune of 2^(year-1984) MIPS. [That would put us at 131,072 MIPS today, and 262,144 MIPS in a few months.]

    b) He predicted the rise of a safe system programming language he called C+++=-- (pronounced "see plus plus, plus equals, minus minus), which is a safe subset of a C++ superset.

    Java hadn't been invented yet, but Gosling (who was busy inventing NeWS at the time) wrote Oak aka Java several years later, and it fit the description to a tee, but just had a different name or two.

    [I'll never forgive Bill Joy for writing VI and CSH. Ewwww icky yucko!]

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  58. Cyclone beats BASIC by Anonymous Coward · · Score: 0

    These tips might give you a good start as you conduct your own research, reflection and dialogue about how Cyclone can beat BASIC. There are many other approaches, based on the organization, regulatory or collective researching requirements, and programmer perceptions. Often, the coders that channel information (including recognition) to managers also need the same exhibited by their leaders/managers, so there isn't a quick fix; a systemic approach is most effective in the long-term. But if you begin with the simple "thank you" messages, particularly if you've not been doing it regularly already, you'll be making an improvement and off to a positive start.

  59. Re:How linux is an inferior desktop OS by Anonymous Coward · · Score: 0

    Oh man, it hurts to read sometimes...

  60. C is just PEEK and POKE with syntactic sugar. by SimHacker · · Score: 1
    Yet another Bill Joy quote from long ago.

    I guess that means csh is just cat and echo with syntactic syrup of ipicac.

    And vi is just insert and delete with semantic anthrax.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  61. No, Java is for writing applications by bill_mcgonigle · · Score: 2, Flamebait

    Java is great for applications, but you'd never want to start writing device drivers or a virtual memory system in Java. For that you need c, which is basically just a step up from assembly language. Still, people make mistakes, and this will help them.

    Of course, if you're still writing applications in c, you're just asking for it. Cyclone might help, but you probably have other issues anyway.

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    1. Re:No, Java is for writing applications by Anonymous Coward · · Score: 0

      Would someone explain why this is moderated as a flamebait?

      Is it because it offends people stupid enough to write a virtual memory system in Java? Or because it offends people anal enough to write a typical GUI or web-based application in C?

  62. better yet, get away from von Neumann by Norge · · Score: 2, Interesting

    There is a whole host of languages more "modern" than C, Java, C++, C#, Pascal, Ada, Perl, or any other of the essentially von Neumann-style languages out there. I highly recommend that anyone out there who is interested in advanced type-safe languages take a look at SML, O'Caml, Haskell or Clean. Most of these languages have more or less formalized language semantics (as in mathematically precise). Formal descriptions and strong type systems allow the compiler to *prove* (again, in a mathematically precise sense) that a program can not go wrong at run time.

    Benjamin

    1. Re:better yet, get away from von Neumann by V.P. · · Score: 1
      Careful there, "von Neumann" is a term that applies to computer architectures, not programming languages. (AFAIK there weren't many programming languages when John von Neumann was around)

      The distinction you're making is between imperative and functional or declarative languages.

    2. Re:better yet, get away from von Neumann by Lozzer · · Score: 1

      <troll>Of course the program won't go wrong at run time (baring hardware failure). The computer will do exactly what you tell it. Proving that the computer will do exactly what you tell it is not interesting.&lt/troll&gt.

      More seriously could you expand on the kind stuff that can be proven at compile time using the languages you mention.

      --
      Special Relativity: The person in the other queue thinks yours is moving faster.
    3. Re:better yet, get away from von Neumann by derwagner · · Score: 1

      First of all, all the languages he mentioned are functional programming languages, whereas C, C++, C# and so on are imperative or object-oriented. OO being more similar to imperative programming than to functional.

      Functional languages tend to have very strict type-checking at compile-time, making type-errors more or less impossible.

      Unfortunately, functional programming never made it into mainstream, it's popular only in universities. It's a very clean coding style, encourages to produce very well-structured programs and is way simpler than OO.

    4. Re:better yet, get away from von Neumann by Norge · · Score: 1

      I was blending the architectural and linguistic domains, the way John Backus did in his seminal paper "Can programming be liberated from the von Neumann style?:a functional style and its algebra of programs". A small excerpt from that paper's abstract:

      Conventional programming languages are growing ever more enormous, but not stronger. Inherent defects at the most basic level cause them to be both fat and weak: their primitive word-at-a-time style of programming inherited from their common ancestor--the von Neumann computer, their close coupling of semantics to state transitions, their division of programming into a world of expressions and a world of statements, their inability to effectively use powerful combining forms for building new programs from existing ones, and their lack of useful mathematical properties for reasoning about programs.

      So you are correct; I was primarily talking about programming languages, not architectures. However, the two domains are closely related and most programmers use programming languages that are still primarily based on the semantics of the architecture on which they run.

      Benjamin

    5. Re:better yet, get away from von Neumann by Lozzer · · Score: 1

      Thanks for your response.

      I would be interested in a concrete example of an Englishy style statement that you you could prove by virtue of using one of these languages.

      Would type errors would be impossible in Java or C++ if you refrained from using the cast operators? I guess also that its more than just being a functional language, as I can quite easily cause some Lisp (or Scheme) to blow up with the equivalent of a type exception (in emacs (* 2 (2 3)) C-M-x).

      Do the Haskell style languages also have something to say on null pointer style errors - I'd guess maybe the language is constructed to make these impossible.

      --
      Special Relativity: The person in the other queue thinks yours is moving faster.
    6. Re:better yet, get away from von Neumann by Norge · · Score: 1

      Some examples of what many "type-safe" language compilers can prove:

      -A variable will always contain a value of the correct type. This contrasts with any language that allows casting from one type to another.
      -Unallocated memory will never be accessed. This contrasts with any language that requires manual memory allocation.
      -Given a particular input, a function will always return the same value. This contrasts with any language that allows memory store effects.

      In addition to low level things that a compiler can prove about your program, formal languages also permit higher level proofs about the functionality of your program. A programmer can prove correct functionality for her program, as opposed to just testing it with lots of data and hoping that it will work in the future. If you are interested I highly recommend reading Bob Harper's Introduction to SML. His web page is http://www.cs.cmu.edu/~rwh. Scroll down to the bottom to his books section.

      Benjamin

    7. Re:better yet, get away from von Neumann by Norge · · Score: 1

      Very simple example of proving that a program meets a high level spec, using SML:

      {* pre-condition: n >= 0 *}
      fun factorial 0 = 1
      | factorial n = n * factorial(n - 1)

      Proof that factorial correctly implements the factorial function, by mathematical induction on n:
      base case (n = 0):
      1) factorial 0 =? 0!
      2) 1 =? 1 (good)

      Inductive hypothesis: factorial (n - 1) correctly computes (n - 1)!.

      Inductive step: prove that factorial(n) correctly computes n!.
      1) factorial(n) =? n!
      2) n * factorial(n - 1) =? n!
      3) n * (n - 1)! =? n!
      4) n! =? n! (good)

      It might seem that you can do this sort of thing in any programming language. However, there are some important features of SML that make this a nearly complete proof, as opposed to just a good argument. To get from step 1 to step 2 we had to replace factorial(n) with n * factorial(n - 1). We can do this, because every call to a function with a given argument in purely functional code will return the same result. To get from step 3 to step 4, we should invoke the multiplication semantics from the Definition of Standard ML (I'm just too lazy to look up the page number). Most languages do not have such a formal definition.

      I am currently working on a new circuit description language (in the same vein as Verilog and VHDL) for which I am implementing a compiler/simulator in SML. I plan on proving certain nice features -- like the simulation can never spin off into infinity -- that would be impossible to prove in most programming languages.

      There are many functional-style languages that are not statically type safe. LISP is the most popular one. Java is a nearly type-safe language. There are some flaws in the Java type system that require runtime checks to ensure that the program doesn't go wrong. There is no such thing as a null pointer in any statically type safe language.

      Benjamin

    8. Re:better yet, get away from von Neumann by V.P. · · Score: 1
      Backus wouldn't classify any of the languages you mentioned (ML, Haskell...) as functional, but rather as "applicative", since they're all derivatives of the lambda calculus

      A quarter of a century (almost) after that Turing award paper, I'm not sure anyone has written any non-toy program in Backus's FP. People like naming their function arguments!

    9. Re:better yet, get away from von Neumann by j+h+woodyatt · · Score: 1

      I think the main reason functional programming never quite made it out of L'Academe is that imperative programming has its merits too, and what you want is a language that easily permits both approaches within the same program.

      Purely functional languages like Haskell are probably not a good place to start if you've only ever been exposed to derivatives of C and Pascal. I'd also recommend choosing a language with strict evaluation rather than lazy evaluation, which is extra work to learn to use effectively. SML or an ML-derivative is what I would suggest.

      I've had a good experience with Objective Caml. The compilers are stable, they can produce reasonably fast portable bytecode as well as satisyingly faster native object code on most platforms, the user community is still small enough that the developers at INRIA occasionally have time to help beginners with problems.

      --

      --
      jhw
    10. Re:better yet, get away from von Neumann by greenrd · · Score: 2
      Assignment-statement-free languages are a nice idea for certain kinds of tasks (I find XSLT useful for simple data manipulation, for example). However, I haven't found many papers on object-oriented databases (or long-term persistence) in functional languages. That's probably because object-oriented databases really need imperative programming.

      Yes you can dump and reload RAM, and yes you can use virtual memory. But that just brings out the main gripe I have against the idea of an assignment-free language - it seems to me that there is lack of sufficient control over performance, which is important. (If something is going to page in and out for 5 minutes before doing anything useful, like my installation of VMWare used to do sometimes before I upgraded my RAM, it's simply unacceptable.)

      That and the lack of flexibility. I would rather try to formalise contracts in imperative languages, building on things like Eiffel's Design by Contract, even though it might be perceived as more "dangerous" than assignment-free languages in some theoretical, ivory-tower sense. (Which I don't believe because the most important fact about programming is that it is a human activity, and if the human beings involved don't understand the code, it's unlikely to work - and not everyone can understand all the intracies of even say Java, so I don't hold out much hope for even more counterintuitive languages!)

  63. The whole point of C by Anonymous Coward · · Score: 0

    is the ability to write "unsafe" code. There are plenty of bondage and discipline languages out there if you need that kind of thing.

    This goes in the same incomprehensible category of pointless inventions as decaffinated coffee and N/A beer.

    What's next, object bash?

  64. Static verification vs. type-safe languages by jdfekete · · Score: 5, Interesting

    Hi,

    In 1999, the Ariane 5 launcher exploded a few seconds after leaving the ground. The faulty program, written in type-safe Ada, has been submited to a static program analyzer developped by Alain Deutsch at INRIA in France. The analyzer spotted the error right away!
    It was a number going out of range after too many iterations and wrapping back to 0.

    The verification technique used was based on abstract interpretation.
    This is just to say that even a strongly type-checked language can fail and that type checks, whether static or dynamic, are not the only way to catch bugs.

    Alain Deutsch has started a company called Polyspace that sells static verifiers for Ada and C (See www.polyspace.com). The idea is not to rewrite C or Ada but to spot potential bugs inside programs.
    I have no special interest in this company, (I know Alain Deutsch), but I mean that improving C does not imply removing the type-unsafe onstructs.

    1. Re:Static verification vs. type-safe languages by dvdeug · · Score: 2

      > It was a number going out of range after too many iterations and wrapping back to 0.

      Which is impossible in Ada - wrap around semantics only happen if you specifically ask for them. The actual bug, as I've heard it told, was that the code wigged out when the physical environment became impossible for the Ariane 4 (since the code was written and designed soley for the Ariane 4.) Nothing could have found this bug without taking into consideration the differing enviroments of the Ariane 4 and 5, and that alone would have prevented the bug.

    2. Re:Static verification vs. type-safe languages by Anonymous Coward · · Score: 0

      Well I did CS at the university that developed the software and was told that it was indeed a wrap around bug,

    3. Re:Static verification vs. type-safe languages by Anonymous Coward · · Score: 0

      Actually the Ariane 5 exploded in 1996. See James Gleick's article for a lucid explanation.

      random'

    4. Re:Static verification vs. type-safe languages by Black+Parrot · · Score: 2


      > The actual bug, as I've heard it told, was that the code wigged out when the physical environment became impossible for the Ariane 4

      That's correct. Something like this happened:

      A: Let's build a new rocket!
      B: Okay!
      A: Let's reuse this "smart part" from the old one!
      B: Okay!
      A: Let's don't review the smart part's code, or even test it on a simulator, since it worked flawlessly on the Ariane IV!
      B: Okay!
      AV: Crash!
      A&B: Ooops!

      Hopefully everyone can spot where the plan went awry.

      Here's a short from-memory explanation of what happened; you can find the official report on the Web pretty easily with a search engine:

      The part in question looked at acceleration/velocity/displacement (I forget which), made some decisions about them, and put some appropriate commands on the control bus. Alas, the Ariane V was so much powerful than the IV that the acceleration/velocity/displacement soon ran up to a number that was physically impossible for the Ariane IV, so the module concluded (correctly, according to its original design) that it was getting garbage in, so it started dumping debug info on the control bus. The engines tried to interpret the debug info as control commands, with predictable results.

      In lots of programs you could branch to some failsafe mode rather than dumping debug info on the bus, though it's not clear what the "failsafe mode" is for a rocket during launch. (If there were such a mode, you would just use that for your control logic to begin with!)

      There's not a language, compiler, static analyzer, or theorem prover on the planet that can catch this kind of problem, though the engineers should have "caught it" during the earliest phases of the design by specifying appropriate reviews/tests for the software and software specs on the reused part.

      --
      Sheesh, evil *and* a jerk. -- Jade
    5. Re:Static verification vs. type-safe languages by e-Motion · · Score: 1

      In 1999, the Ariane 5 launcher exploded a few seconds after leaving the ground. The faulty program, written in type-safe Ada, has been submited to a static program analyzer developped by Alain Deutsch at INRIA in France. The analyzer spotted the error right away! It was a number going out of range after too many iterations and wrapping back to 0.

      Google is your friend:
      Ariane 5 link one
      Ariane 5 link two

      Both of those indicate a conversion problem from a larger value type to a smaller value type. If that is what happened, then a "type checking engine" should find that. Perhaps indications of the problem were ignored (one of those links suggests that it was possible).

      I doubt anyone would suggest that static typing is a panacea. It is not the answer to everyone's problems, but it does help every now and then.

  65. Function pointers by Hard_Code · · Score: 2

    What about function pointers? What "region" do they live in? Say I create a struct with a bunch of function pointers (dur, to emulate OO), and the struct goes out of scope, what about the functions? I guess my question is, are all functions in global scope?

    --

    It's 10 PM. Do you know if you're un-American?
  66. Re:Legacy Savior? A culture fix would be better... by Anonymous Coward · · Score: 0

    Microsoft?

  67. Mind.c in the AI Future by Mentifex · · Score: 1

    The workhorse C programming language must remain robust and "close to the iron" in preparation for its role in Public Domain Artificial Intelligence.

    A special Mind-to-C liaison page has been updated to direct your attention to Open Source AI-in-C projects on SourceForge.

    The bulletproof nature of C makes it a major avenue towards Technological Singularity.

    1. Re:Mind.c in the AI Future by Anonymous Coward · · Score: 0

      You really believe this crap, don't you?

    2. Re:Mind.c in the AI Future by Anonymous Coward · · Score: 0

      Shut up! Mentifex fucking rules!

  68. let's fix the org before fixing the lang by iskander · · Score: 2, Insightful
    ``The underlying problem here has never been with C, it's been with using C for the wrong jobs. [...] The biggest problem at the moment is that none of these "safer" languages has yet developed the same raw expressive power of C++.''

    You seem to have assumed, for the purpose of the above exposition, that implementation languages are chosen by well-informed people, and substantially on the basis of technical merit. That's not always the case. Well, outside your shop in any case. ;-)

    In my opinion, acceptably safe languages that are quite expressive do already exist. I do not believe that the alleged deficiencies of safe languages explains the continued use of "unsafe" languages in domains for which the latter are not a good fit; I believe that, on the average, ill-conceived implementation strategies are more likely at fault. How many projects struggle with inadequate languages as a result of misinformed (or even uninformed) managers' inconsiderate (and uncontestable) decrees? Too many. :-(

    I am happy to learn that smart people are busy inventing the next great programming language, but I think that, collectively, we need to spend less time improving our tools and more time addressing the organizational deficiencies that result in our having to use the wrong tools when we know better.

  69. Re:How linux is an inferior desktop OS by Anonymous Coward · · Score: 0

    why are you here then??

  70. C isn't for the faint of heart by jamoke · · Score: 0, Troll

    If I can't write things like:

    ( * ( void ( * ) ( ) ) 0 ) ( ) ;

    Then I don't want C anymore.

    C is not for dummies.

  71. Re:Legacy Savior? A culture fix would be better... by Anonymous Coward · · Score: 0

    Where do you work? I want to short your stock.

  72. Too Bad by gaudior · · Score: 2, Insightful
    If you are using ANY modern compiler, targetted for a modern CPU, your code is getting re-written without you knowing about it. It's getting re-arranged for pipeline efficiency, loops are getting unrolled, common sub-expressions are getting stripped. The notion held by some C programmers that they are smarter than the compiler is quite silly.

    I am not sure of the usefulness of this particular language/compiler/etc, but I like the direction they are going. DWIM(Do What I Mean) programming is becoming more and more possible, with this kind of language research. We want programmers to solve problems in the macro world, not be bothered with the minutia of the language they are using. This has been one of the appeals of perl over the years.

  73. Re:How linux is an inferior desktop OS by Anonymous Coward · · Score: 0

    YHBT, HAND.

  74. You've been trolled. by Macrobat · · Score: 1

    This guy's a troll. He's dissing C because it punishes people who don't know what they're doing. (Unlike other languages we won't mention, which reward people for not knowing what they're doing.)

    --
    "Hardly used" will not fetch you a better price for your brain.
    1. Re:You've been trolled. by Anonymous Coward · · Score: 0

      C'mon, don't be shy...
      OK, I'll say it for you: 'Perl'

      Feel better?

    2. Re:You've been trolled. by Anonymous Coward · · Score: 0



      I think he was talking about "Visual Basic". Yeah, you know he was.

  75. In defense of type systems by Tom7 · · Score: 3, Insightful


    I think you must have had bad experiences with safe languages (Java?). Static checking doesn't result in slowness (in fact, it can make compiled code faster in many cases, for instance by enabling alias analysis).

    Static typing and safety also allow for *more* power than a "do anything you like" language. One kind of power I get when I write in a language like this is the ability to enforce invariants without runtime checks. So if I am writing a program with several other people (or by myself across several evenings, except I am drunk some of those evenings), I can arrange my code such that bugs in one part of the program can NEVER affect other parts of the program. Thus, it is easier to figure out who to blame and where the bug is. This is impossible in a language like C, where any code can write over another module's memory, free its data structures more than once, or cast, etc.

    Speeding up routines with hacks is pretty overrated; there are very few places where this is necessary, and even fewer where it is desirable. In those cases, we can always fall back to C or assembly.

  76. just a note by Faust7 · · Score: 1

    # is enough for tic-tac-toe, and is probably what's usually used... I used it... but what do I know?

    1. Re:just a note by Anonymous Coward · · Score: 0

      the tic tac toe board looks just like this... #

      Only usually larger.

      Why the fuck are all of you retards trying to add extra lines.... duh!

  77. Congratulations! by Anonymous Coward · · Score: 0

    You have successfully Trolled, as evidenced by the response from BigBir3d. Did you write that yourself? If so, bravo, it's a well-crafted and effective Troll.

    Canada #2 The greatest imitation of the USA in the world

  78. Re:unix only by Tom7 · · Score: 2

    Microsoft is working on a programming language called Vault that is very similar. They'll probably be using it in a future operating system to ensure that key parts of the OS, as well as first and third party drivers, behave well. If they do this, I sure hope that linux jumps on some automated technology too, because then I think they will have quite a leg up on us as far as security and stability go.

    I think your second paragraph is totally bullshit. If it's not hard, why do some of the most well known linux network daemons have multiple remote buffer overflows in them? Do the people who wrote BIND, wu_ftpd, xinetd, apache, telnetd, Quake 3, Half-Life, etc. not know what they're doing? No, they know what they're doing, it's just very hard to manually secure large C programs.

    The simple fact is that C encourages a style of programming that leads to these kinds of bugs. This has been a solved problem in many other languages for dozens of years now. Using a safe language, for instance, makes you totally immune to buffer overflows and format string attacks, the two most common sources of security holes in unix.

  79. Legacy Code by Anonymous Coward · · Score: 0

    I don't imagine that the primary use of this is
    going to be to create new programs. This compiler
    can be used to compile old legacy C code (and
    there is a lot of that around) to correct bugs
    in already existing programs.

  80. Lacks one thing by sharkey · · Score: 2

    A mascot. It needs a little animated tornado, maybe named Cyclonius, to pop up and interact with the user.

    "You appear to be coding with Visual Studio. Please stop!"

    --

    --
    "Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next.
  81. 30 years of innovation have passed us by by ka9dgx · · Score: 2
    Here it is, 2001, and we're still typing text in flat ascii files, remembering all of the arcane syntax and rules of the compiler, then submitting our attempts to it, awaiting it's response. Things haven't changed at all in 30+ years, what makes this different?

    We need to apply some of the innovations that have been built for everyone else, such as text with attributes, letting the compiler keep track of certain details, etc. Why do I have to track down every instance of a variable if I decide to change it's name? Why can't I simply change the value in the symbol table, and have the compiler spit it out with that new name when it saves it?

    Why not integrate the compiler, editor, runtime, all into an effecient kernel of an environment, similar to FORTH, but with the added benefits of type checking?

    It's been a long time, yet nothing has changed... what a waste.

    --Mike--

    1. Re:30 years of innovation have passed us by by statusbar · · Score: 2

      hear hear!!!

      --
      ipv6 is my vpn
    2. Re:30 years of innovation have passed us by by mamba-mamba · · Score: 1

      Your criticism is incorrect. There are all sorts of IDE's with the features you seem to want. These IDE's are not specified in any ANSI or ISO documents (as far as I know), so they are not part of the C language, but they do exist. For example, some text editors are C context aware and will (if you want them to) try to finish any variable or function names you start to type. Scope aware search and replace features exist, also.

      MM
      --

      --
      By including this sig, the copyright holders of this work or collection unreservedly place it in the public domain.
    3. Re:30 years of innovation have passed us by by be-fan · · Score: 2

      Here it is, 2001, and we're still typing text in flat ascii files, remembering all of the arcane syntax and rules of the compiler, then submitting our attempts to it, awaiting its response.
      >>>>>>>>>>>
      Actually, a good many people now type text in flat unicode files.

      --
      A deep unwavering belief is a sure sign you're missing something...
  82. English safety. by harangutan · · Score: 2, Funny
    The researchers say C programmers can often create code that will results in a serious bug when the application is fully implemented.

    Clearly what's needed is a new version of English that doesn't permit grammatical errors.

  83. Pattern Matching in java? by Tom7 · · Score: 1

    Sounds good -- do you have any links to docs on Java pattern matching? I can't find anything on sun's site.

    1. Re:Pattern Matching in java? by jeffy124 · · Score: 2
      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
  84. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  85. Satan is already here by Anonymous Coward · · Score: 0

    Bwahahahahahaha!

    All your souls are belong to Satan.

  86. how many times do I have to say it? by kaisyain · · Score: 3, Informative

    REGULAR EXPRESSIONS ARE NOT PATTERN MATCHING (in this context)

    Please read what pattern matching means when Safe-C (and ML and Prolog and Erlang and...) says "pattern matching" before you post your irrelevant link anymore.

    1. Re:how many times do I have to say it? by jeffy124 · · Score: 2

      regexps are used to do pattern matching. regexps describe the pattern you wish to match.

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    2. Re:how many times do I have to say it? by Tom7 · · Score: 2

      This is totally wrong!!
      The feature they are talking about has nothing to do with matching strings, but matching data structures. It is NOT REGULAR EXPRESSION PATTERN MATCHING. That is something different.

    3. Re:how many times do I have to say it? by Romeozulu · · Score: 1

      Rather than shouting, why don't you tell us what Pattern Matching is? Obviously some people don't know.

      RZ

    4. Re:how many times do I have to say it? by jeffy124 · · Score: 2

      good lord, you're gonna cause yourself a heart attack if you dont calm down

      when people say pattern matching, most think of regexp pattern matching. it's what perl (and some other languages) is known and famous for.

      datastruct pattern matching is something that's used a LOT less often (and something I have seen little about in my many years, of course I've never done functional languages)

      so that's why people will think of perl-like regexps when people talk about pattern matching

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    5. Re:how many times do I have to say it? by jeffy124 · · Score: 2

      sorry pal. been through grad school. work in industry. never came across functional languages where that stuff is probably prominent. I see people referring to ML, but Idont use it nor have the desire to learn it.

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    6. Re:how many times do I have to say it? by Anonymous Coward · · Score: 0

      Pattern matching is something that would appear in a functional language like ML or Haskell, basically for overloading functions based on not only the types of arguments, but the values of the arguments when the function is called. There is a similar feature in C++: overloaded functions:

      int foo( int a ) { ... }
      int foo( float a ) { ... }
      (ie a function that you want to behave differently depending on the type of its argument)
      The C++ compiler internally has a "pattern matcher" of sorts that decides, when you write:

      foo( 5.0 ); //call foo() with a float arg

      whether to use the first definition or the second. This happens at compile time, but possibly at run time in functional languages. (Don't know if you purists would call this pattern matching, but for explanatory purposes...) In short, it doesn't have much to do with regular expressions, no matter how convinced you are that regular expressions are "pattern matching".

    7. Re:how many times do I have to say it? by Anonymous Coward · · Score: 0

      well said.

    8. Re:how many times do I have to say it? by Kalani · · Score: 1

      University of Ignorance and Retardation ... that's clever.

      BTW, I do like functional languages.

      --
      ___
      The ends are ape-chosen, only the means are man's. -- Aldous Huxley
    9. Re:how many times do I have to say it? by jeffy124 · · Score: 2

      you obviously dont know how to hold an argument without backing up your opinion or without insulting people.

      you keep saying "that aint it" without saying why. OTOH, I keep saying "here's my opinion - yada yada" which keeps getting the reply "nope"

      and lastly - in the real working world, if you were to argue wth someone by telling them to take things out the ass - you may as well be out on your ass.

      so until you say why i should learn ML and why my opinion of pattern matching/regexps/etc is wrong, you aint hearin from me.

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    10. Re:how many times do I have to say it? by Ozx · · Score: 0

      Apparently in your working world they promote talking about things that you have no understanding of, and then instead of taking the time to learn, demand that they enlighten you as to why you're wrong... I never said, and don't give two shits if you learn ML, however if you spent five minutes out of your life to actually learn. That is take your web client (if they taught you how to use one), and go and research why your definition of "pattern matching" isn't general enough to reply to people, "Of course it does! Here, have regular expressions!"
      Excuse me? Is it my job to think for you? Did they do that in the University of Ignorance and Retardation?
      I'm glad I'm not in your industry, or I'd probably be unemployed...

    11. Re:how many times do I have to say it? by jeffy124 · · Score: 1

      fuck you

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    12. Re:how many times do I have to say it? by ahde · · Score: 2

      I wonder what chapter he's studying this week?
      ...at CMU, I'd guess.

  87. Not the Same Pattern Matching! by Tom7 · · Score: 2


    haha... oh.
    Regular Expression matching is not the kind of pattern matching they mean here. Check out the language docs or a language like ML that has datatypes and pattern matching to see what they mean.

    1. Re:Not the Same Pattern Matching! by jeffy124 · · Score: 2

      that link IS the language doc. sure looks like regexp matching to me.

      regexps are used to describe the pattern you wish to match. hence i see both as pretty much the same thing because they go hand-in-hand.

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    2. Re:Not the Same Pattern Matching! by Ozx · · Score: 0

      That's because you have no idea how ML pattern matching works...

    3. Re:Not the Same Pattern Matching! by Tom7 · · Score: 1


      I am talking about the language spec for Cyclone. If you don't know what a language feature is, you ought to read about it before claiming that another language has that feature!

      In this case, the pattern matching they are talking about is the Programming Languages community's "pattern matching", which is different from the perl community's "pattern matching" which just means "regular expressions".

    4. Re:Not the Same Pattern Matching! by lars · · Score: 1

      Good luck trying to explain this to the Slashdot crowd. :)

      It's a shame that most University computer science programs don't have a mandatory lower year introductory course on programming languages. Waterloo is supposed to be an okay CS school and I didn't learn anything about programming languages until I took an optional 4th year course (that almost nobody takes).

  88. Re:How linux is an inferior desktop OS by CakerX · · Score: 1

    thats a joke right?? I seriously hope that is a joke.

    If that was a joke, its one of the best trolls I have ever seen(natalie portman nude petrified non-distributable open source is getting kinda old).

    If it was serious, you really need to do you research before you post. MCSE certifies you as an idiot with an ego. an MCSE makes sure you know how to wipe your ass without calling techsupport but not much else.

  89. Re:Legacy Savior? A culture fix would be better... by daniel2000 · · Score: 1

    I wish i could point at you and laugh and laugh and laugh... and think to myself in a self satisfied way- thats not how **WE** do it!

  90. Re:Let it go by RedGuard · · Score: 0, Offtopic

    The recounts showed Gore won in most scenarios.
    THe media just didn't report it, no doubt because
    to reveal GWB stole the election by the mass
    disenfranchisment of black voters would have
    rather undercut his claim to be defending
    democracy against terrorism.

  91. Re:Consolidation of technologies by vulg4r_m0nk · · Score: 1

    We're in a period of consolidation, now that the dot-com boom has collapsed. Our task as programmers over the next few years is to make all the stuff that sort of works now work 100%.

    Are we? I think we could be, and should be, but thanks to a lot of folks' insistence upon reinventing the wheel, we aren't going to be in the forseeable future. Every month there's a new language that offers miniscule advantages over existing languages (i.e., Ruby, the "two thirds Perl, one third Python" language), and of course MS wants to duplicate in C# and .NET all the work that went into Java and the advances we've seen in distributed computing, such as CORBA. Say what you will about Java and CORBA (here, I'll say it for you: "If it's not C or Perl it's shite!", "CORBA's a bloated standard!"), but they have the advantage of being mature technologies. MS is pulling their usual bullshit tactic of releasing a product that offers nothing new except the new bugs introduced in unproven rewrites.

    And given the current state of the economy, telling developers to go learn yet another language is not a very prudent expenditure of resources. Nonetheless, a great many PHB's will give precisely that directive.

  92. And C++ is even more dangerous... by aquarian · · Score: 1

    ...which is why they call it "C++."

    1. Re:And C++ is even more dangerous... by jrockway · · Score: 1

      gotta love reinterpret_cast(expression) :-D

      --
      My other car is first.
  93. Gee, Saber-C twelve years later by jimfrost · · Score: 1
    We've already had C programming environments that did this kind of thing. Saber-C was doing it as early as 1988, and there were at least three different object code runtime analysis tools on the market for Sparc by 1994 -- Purify, TestCenter, and a tool from Sun (whose name escapes me at the moment). Also by 1994 there were at least two source-to-source compilers that would inject runtime error checking into C code, and a myriad of heap debugging tools. I never used it, but I understand that SoftICE was similar for the PC.

    It's nice to see this kind of thing come around again, but it's not like it's new technology. Still, it'll be a godsend to have it again. Gdb and Visual C++ suck as debugging tools.

    --
    jim frost
    jimf@frostbytes.com
  94. C with safety. reminds me of a story... by retrosteve · · Score: 3, Funny
    Back in the days when "speed" meant catching a train with a full head of steam, railroad repair engineers were a brave bunch, and many sported stumps of arms and legs as mute witness to their bravery in repairing moving trains.

    One day, a city slicker with a spotless seersucker suit and a perfectly pointy moustache was reported travelling from station to station, selling his new technology suite. It included remote manipulators for making repairs from a higher level, without having to go under the trains. It also came equipped with "parking brakes" for trains, to prevent them accidentally moving while they were under repair.

    This new "high level" technology was a hit in many towns, where the young repair technicians were unenthusiastic about life with missing limbs. In addition, the new technology came with many interlocking "safeguard" mechanisms to make sure that no fittings were left unsecured when the repair was completed. This saved many a "crash".

    But there remained many towns with older engineers, who had grown up doing things the "fast" way, repairing the trains on the fly (because things went faster that way!), and of course having the scars and stumps to show for it. They were also unenthusiastic about the "safeguards", declaring that they were "smarter than any newfangled machine", and could remember to close the latches and fittings themselves.

    In one of these Ancient Telegraph Towns, one of the older engineers, Cyclone Bob, came up with his answer to the newfangled "high-level machines" -- special steel braces to wear over arms and legs while repairing the moving trains. "In most every case, these braces will protect your precious limbs from the hazards of moving wheels!", enthused Cyclone Bob.

    The older engineers, who, when all was said and done, actually enjoyed mucking about under trains, and who had already paid their dues in missing limbs, were rather proud of the new braces, and wore them proudly. "My trains hardly ever crash now", they would say, "and now I don't always have to lose a leg to prove it!".

    The younger, smarter engineers continued using their "high-level" machines, and were happy that they still had arms so they could snigger up their sleeves.

  95. Undecidedability by vlad_petric · · Score: 1

    Just wanted to remind you that deciding at compile time if a given program will go wrong (division by zero, memory faults, infinite loops) or not is an undecidable problem for any Turing-complete language. That certainly limits the "smartness" of a compiler. Detecting typos is an useful feature, but certainly you can't rely on the compiler to find higher level bugs.

    Runtime checking is useful, however I'd rather use a tool like Purify/CheckerGcc/Insure++ with gcc and standard C/C++ than switch to a new language.

    --

    The Raven

    1. Re:Undecidedability by affenmann · · Score: 1

      > Just wanted to remind you that deciding at
      > compile time if a given program will go wrong
      > (division by zero, memory faults, infinite loops)
      > or not is an undecidable problem

      Good point, but nevertheless a type-checker can do a fair bit for you. That's why people programming in staticly typed languages, such as ML or Haskell, rarely ever (need to) use a debugger.
      In my opinion we should let the machine do as much as possible.

    2. Re:Undecidedability by hugg · · Score: 2

      Crap... I guess I'd better start writing programs, then, because I can't tell if they are going to end or not! :>

      Point well taken, but you can still have alot more safety in conventional languages without encountering the Halting problem. I foresee languages in the future being linked to automatic theorem provers, and even having humans assist in doing the tricky bits of the proofs.

      Really, doing a formal proof of your program is the ultimate CYA. :)

  96. Safety by Anonymous Coward · · Score: 0

    One of my complaints about C (my principal language) is that there is no way to check if a pointer is valid. That is, if it points to a place that I'm not allowed to access, I get a segfault, and am not supposed to return from that. So it becomes impossible to check if the data structures have become corrupted. Oog.

  97. Re:Legacy Savior? A culture fix would be better... by shani · · Score: 1

    I feel your pain.

    What I did was perform a coup on the release process, and now I look at every warning before I release a new version. Sure, I end up doing the work, but at least I don't foist crap on the world.

  98. Re:How linux is an inferior desktop OS by dark_panda · · Score: 2

    Trolling, but I'll bite...

    experienced MCSE

    See: oxymoron

    Remove the bloat. Most linux distro's ship with way to many useless programs. These "useless" programs must be useful to someone. Maybe not everyone, but certainly someone. If you don't want to use them, don't install them. The option is a checkbox away in most distro installs.

    Dump the command line.

    Granted, most users don't give a shit about the command line, or even know such a thing exists for that matter. Most of linux's power comes from the shell, though. Once you get used to it, you start to feel kind of God like.

    And if you're admining a system, I'll take a shell any day over some Windows manager snap-ins or whatever the hell they're called. I don't want to be restricted to what some UI designer's whimsey.

    Dump open-source.

    Once the source is out there it can really be taken back, so dumping OSS is kind of impossible. Even if, for whatever imaginary reason, the Linux kernel suddenly became closed-source, all of the previous versions would still be OSS, and development would just continue along another fork.

    [Desktop users] do not want to compile anything.

    If a setup process involved compiling but the user couldn't see it, would that make it better? What would be the difference? In Windows, a setup.exe file unpacks some stuff, moves it around, writes some registry settings. What if some executable in linux unpacked some source code, compiled it and put it where it should go? Would that make things better for you, MCSE?

    A universal gui system. Linux needs ONE gui.

    First of all, choice is a good thing. Unlike Microsoft, where you're stuck with the GUI they give you, at least with UNIX-like systems you're free to choose from any number of GUIs, then proceed to configure them exactly how you want them. Right now I'm using KDE with Mosfet's Liquid engine, some NeXT-ish stuff and a bit of quartz thrown in. I like it. Other people might not, but they can roll their own. Choice.

    Now, about having ONE GUI -- you mean like Windows 2000 and XP? (Okay, so can modify XP to look like 2000, but I doubt most users even know that option exists.)

    Make upgrading the software easier. Desktop users need an easy way to upgrade the kernel.

    This depends on the distro you're using (or if you've rolled your own), but it really isn't that hard. Here's what I do (yes, I do run Red Hat, 'cause I'm kind of attached to it. Bite me.):

    1. Download a new kernel.
    2. # rpm -ivh kernel*.rpm
    3. Reboot.

    If you're still clammoring for a GUI to do that for you, KDE and Gnome have nice package managers that will let you click your way through it. If you're using Grub, you don't even really have to do any config editing, especially with RH 7.2's kernel upgrades...

    Get a good web browser.

    What's wrong with Konqueror? (I don't use Gnome, so I don't know how it's browser is.) Back in the day, we used lynx and we liked it.

    And that Mozilla version number stab is utter bull shit. Version numbers are arbitrary. If MSFT released their next version of IE as IE 2002, would that suddenly mean it was 2002 times better than IE 1.0? Would you compare SuSE 7.3 to RH 7.2 based on version numbers?

    Proper office programs

    Indeed. They're getting there. KOffice isn't terrible, and OpenOffice is okay.

    These programs should be able to import all MS formats

    Oh, right, you mean those MS formats that Microsoft doesn't provide specs for? Reverse engineering those things doesn't happen overnight. And I can't see MSFT suddenly opening that sort of thing up. (I can, however, see MSFT making arbitrary changes to the formats whenever reverse engineers get close...)

    Backward compatibility

    Not all Win16, DOS and even Win32 apps run on WinNT, 2000 and XP.

    And Linux is backwardly compatible. Stuff that worked on kernel 2.2 and older work fine on 2.4. Just get the source and re-compile it. Oh, wait, source code is useless, I forgot.

    J

  99. Cyclone is good, but check out SPARK... by r_c_chapman · · Score: 2, Informative

    Cyclone is a remarkable achievement, given they
    started with C...

    MISRA-C is also a good effort, although somewhat
    built on sand.

    The safety-critical community over here in Europe,
    and also a few projects in the USA use SPARK
    though, which is a high-integrity, annotated
    subset of Ada. It's static analysis tool
    is really remarkable - anyone for static proof
    of exception freedom? (e.g. static proof of
    no buffer overflow for all input data)

    Eiffel is also very good from a high-integrity
    point of view, and well worth a look. It amazes
    me how much effort goes into researching static
    analysis of langauges that are simple not designed
    for that purpose at all...ah well...

    - Rod Chapman

    1. Re:Cyclone is good, but check out SPARK... by Anonymous Coward · · Score: 0

      Eiffel is truly an elegant tool but is beyond the capabilities of most developers out there.

  100. How about Pascal ? by Betcour · · Score: 1

    C with type checking and safety.... yep it is Pascal. Why reinvent the wheel ?

    1. Re:How about Pascal ? by Anonymous Coward · · Score: 0

      ture enough. Beats me why so many people ignore it.

    2. Re:How about Pascal ? by Anonymous Coward · · Score: 0

      That's what I thought when learning C++ :)

  101. Re:Let it go by Reality+Master+101 · · Score: 1

    When you have to go to the lengths of thinking in conspiracies, that should be a signal to you that your thought processes have gone out of control.

    Bush won. He won by every measure, even the unreasonable ones.

    And thank God he did. If Gore had ended up winning, we would still be whining at Afghanistan to please stop letting the bullies pick on us.

    --
    Sometimes it's best to just let stupid people be stupid.
  102. Why? by photon317 · · Score: 2


    First off, good programming practices will resolve 99% of these problems. They aren't unavoidable, they're just the result of being careless. Of the few that any good programmer will let slip through once in a while, most could probably caught with an advanced lint-like tool that checks for things in the source code, or for that matter just a little bit of peer code review. I can't see much in the way of difficult-to-avoid problems that require runtime support to adequately detect in plain old C.

    In any case, a programmer's failure to be able to adequately program in C is no excuse for moving to a whole new language, compilers, runtime, libraries, standards, etc. The cost associated with migrating to the new language is excessive. It's like buying $10,000 gold-plated titanium training wheels for your sportsbike to solve your initial problem of being unable to ride the thing without falling over.

    --
    11*43+456^2
  103. Where does this poor sap work... by Embedded+Geek · · Score: 1
    Since you were wondering...

    I won't name my company (you'll have to go to my site for that), but I'm stuck in a very weird industry: In Flight Entertainment. Our customers (airlines) expect our products to perform to the level of reliability that they are used to in the cockpit (99.99% seat availability - a simple stuck cord retractor on a game controller will mark the seat as dead), but they aren't willing to pay the price for mil-spec level engineering ($20K for a single barometer guage in a cockpit is acceptable, but $5Kx400 seats is not). When we try to explain that it can't be done, they just keep pointing out how cheap a VCR/DVD/whatever consumer product is. We never even get to discuss consumer products' EMI risks (the attendant asks you to kill your cellphone on a flight not because it will crash the plane but because no one's spent the $2-4M for each product to prove it won't) or weight or power, because our chief competitor is a subsidiary of a Japanese conglomerate. For more than a decade they've sold their product at a loss to drive us under and dominate the industry (to be fair, same as we'd try if we had deep enough pockets). But we're like a cockroach, hanging on by sheer force of will... and the occasional stellar product (hey, I've got some pride left).

    The thing is, I hear similar tales from friends in other companies in this industry and in other industries. The common factors are these:

    • The customer demands quality, but is willing to sacrifice it for price.
    • The supplier is unwilling to stand up and tell the customer the hard facts (here, out of fear of a competitor but also on the mistaken belief that we'll make it up on the maintainance contracts).
    • The customer doesn't have a lot of insight into what's "under the hood," allowing the supplier to provide flash over substance.
    IMHO, it is the industry that allows this kind of behavior. In a military shop, we'dve been eliminated years ago. In a consumer shop, the occasional hiccup isn't noticed. And, just like an abusive/codependant relationship, as long as the same destructive factors remain in place, the same results will occur.
    --

    "Prepare for the worst - hope for the best."

  104. Re:How linux is an inferior desktop OS by Anonymous Coward · · Score: 0

    From another MCSE (of many years)....Windows 2000 is DEFINATELY NOT stable. In short, NT stability is heading in the wrong direction!

  105. Whoa, call the fact police! by Anonymous+Brave+Guy · · Score: 2
    A basic problem of C and C++ is that it's essential to track who owns which objects and when they're supposed to be released, yet the language offers no help whatsoever in doing so.

    C++ provides plenty of support for resource managements issues. The standard library includes vector, string, auto_ptr and many other related tools, all of which assist with guaranteeing memory is released properly. The fact that ill-trained C++ programmers continue to use raw arrays and pointers, when they should almost never be used beyond low-level code, is not C++'s fault.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:Whoa, call the fact police! by Animats · · Score: 2
      auto_ptr is about as close as C++ gets to supporting an explicit concept of "ownership". auto_ptr, though, has several severe problems:
      • You can't have collections of auto_ptr, which is a very reasonable thing to want.
      • auto_ptr has wierd assignment semantics. Assignment is destructive; if you assign one auto_ptr to another, the source is changed to point to NULL. This maintains the single-owner rule, but leads to confusing code. The C++ standard for auto_ptr has been through three major revisions so far, and they all suck.
      • In order to do anything with an auto_ptr, you have to take a raw pointer from it, which you can then misuse. Conversely, you have to be able to make an auto_ptr from a raw pointer, because "new" returns a raw pointer.
      auto_ptr is a great concept, but C++ and the STL make it almost unusable.
    2. Re:Whoa, call the fact police! by Anonymous+Brave+Guy · · Score: 2
      auto_ptr is about as close as C++ gets to supporting an explicit concept of "ownership". auto_ptr, though, has several severe problems: [...] auto_ptr is a great concept, but C++ and the STL make it almost unusable.

      And yet, the version they have still solves a significant class of ownership problems, where someone gets a pointer back from some other function and then forgets to release it. If you want more advanced semantics, I recommend a visit to the Boost website, and a look at their shared pointers.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  106. Re:Survival Guide for Taking a Dump at Work by Anonymous Coward · · Score: 0



    I think I have a bathroom phobia.

  107. It's funny because it's true. by Anonymous Coward · · Score: 0
    (Score:3, Funny)

    Or should that be that it would be funny if it weren't true? As was once said of Lisp, those who forget Pascal are doomed to recreate it ... eventually.

  108. A fancy way of saying "guess" by MarkusQ · · Score: 2
    But precision isn't too important in the real world. You can solve any NP-complete problem in polynomial time, if you define success as being off the optimal solution by at most a factor of two.

    I'm sure you solve the halting problem for any application within 4 standard deviations without waiting too long.

    While I agree with most of your post, I have to point out that coming within a factor of two is not very impressive for the halting problem. Since a given program on a given input will in fact either halt in finite time or it won't, your statement boils down to the assertion that it is possible to say either the word "true" or the word "false" (at random) in polynomial time. If you do this, you will either be right-within-a-factor-of-two (what most people would call wrong) or you will be exactly right. In the industry, this algorithm is called "guessing" and can be proven to be within a factor of two of correct on all binary choices.

    -- MarkusQ

  109. "C with safety" and UNIX by Anonymous Coward · · Score: 0
    "Our ultimate goal is to have something as Humongous as the Linux operating system built in Cyclone," says Morrisett.
    A big deal is being made out of Cyclone's type safety, an idea which is at least as old as Pascal. If type safety is key, then I think this has been done. Wasn't there already a UNIX or Linux kernel built in Modula-2? Oh, but M2 wasn't cool. I forgot.
  110. Potentially Dangerous Purpose by cburley · · Score: 1
    [...]analyses the code's purpose and singles out conflicts known to be potentially dangerous[...]

    Like invoking a script written in Perl?

    ;-)

    --
    Practice random senselessness and act kind of beautiful.
  111. Ada experience / gnu Ada? by acomj · · Score: 2

    I've been using ada at a job for 6 months now. It is a "safe" language.

    I didn't like it at first. Now I find I'm liking it more and more. It does a lot that make it really usefull in the "very very high" reliability programing.

    It does have very strong type checking al la jave. You can make you own range constraints on types you create ..Y is an it between -360 and 360.
    If you try to make Y bigger or smaller that that range you throw a contraint exception

    You pay a little in performance for this, but although I hear that if you did all that checking manually in another language it would be even slower.

    It has some other nice features that other programming languages have in various forms, including enumeration types , records types (like a struct) and you can specify down to the bit level the arrangement of the struct..ie which fields go where. It even has "packages" which are a bit like objects.

    Ada isn't as powerful as C though and it lacks a lot of the tools and libraries . Its also hard to find good books on it too.

    One joke at work is that Ada actually more powerfull because you can bind it to C code.

    We hear stories about other projects having problems with C and bigger problems with C++. Ada although slow to program in does nice for systems that require very high reliability.

    There is a Gnatt compiler which is free and open source too... Try it.

  112. Got lint? by rice_burners_suck · · Score: 2

    I wonder if this Cyclone makes programming "safer" by making it more difficult. What I mean by this is that some languages out there don't let you use pointers at all, or perform all sorts of checks on array bounds before each access. I like to call this "broken programming" simply because it isn't right in my opinion.

    A programmer should have all tools available to him, and should choose the best tool for the job when solving any given problem. Taking away tools doesn't make programming safer--it makes programming messier.

    I didn't read the article or the language description or anything, so I don't know if this is the case with Cyclone. But it certainly is with many languages. I thought this is what Lint is for. Lint is a program which performs source-level sanity checks on your code. You write your program in C and/or C++, and whenever you compile, you first run Lint to make sure everything's ok. Sure, it's not perfect, and probably won't find all problems, but it will find quite a few things wrong that you didn't even know about. (There are free and commercial implementations of various source-level things like this.)

    I think that careful programming and use of a tool like Lint can make a better improvement than taking away some of the most powerful tools in programming just because some people don't know how to use them. Oh well.

    1. Re:Got lint? by cheezehead · · Score: 1

      I wonder if this Cyclone makes programming "safer" by making it more difficult. What I mean by this is that some languages out there don't let you use pointers at all, or perform all sorts of checks on array bounds before each access. I like to call this "broken programming" simply because it isn't right in my opinion.

      I disagree. Take for example Java, which does not have pointers. That hardly makes programming harder, it's easier if anything. An enormous amount of bugs are related to poor memory management. Most programmers make mistakes here. Array bound checks are pretty useful. Most compilers let you switch them off, so you can develop with array bound checks enabled, and disable them once you're convinced that everything is working right(...).
      I like to compare pointers to a chain saw: a powerful tool in the hands of an expert, but most people should not even touch it...

      A programmer should have all tools available to him, and should choose the best tool for the job when solving any given problem. Taking away tools doesn't make programming safer--it makes programming messier.

      Seems to me that Cyclone is adding a tool rather than taking something away.

      I thought this is what Lint is for.

      Yes, lint is an excellent tool. Problem is that nobody uses it, unless forced by some project guideline. Worse, I have seen plenty of fools who disable all compiler warnings. Seems like Cyclone is building lint-like capabilities into the compiler, so you're forced to use it. Does not seem like a bad idea to me. My experience is that if you give programmers the opportunity to hose themselves, they will invariably do so.

      I think that careful programming and use of a tool like Lint can make a better improvement than taking away some of the most powerful tools in programming just because some people don't know how to use them.

      Unfortunately, most people don't know how to use them, or are unwilling to spend the extra effort. Careful programming requires discipline, something that most free spirits in software development are lacking.

      Having said all this, I don't think Cyclone will cause a major revolution in programming. Most people are not waiting for Yet Another Language...

      --

      MSN 8: Now Microsoft even has bugs in their ad campaigns.

  113. have you Hurd? by Ratso+Baggins · · Score: 1
    I like security... especially when it's inherent.

    Would there be any validity in compiling hurd with this cycylone thing to in effect double up in some areas?

    --

    --
    "we live in a post-ideological world..." - Billy Bragg.

  114. Re:Let it go by Anonymous Coward · · Score: 0

    In most places the person getting the most votes is generally known as the winner. Face it, democracy in the US is finished. Some of us are patriotic enough to let us go. The others are going to give up their rights and slip towards fascism. You won't talk me into being a good German.

  115. Cyclone *is* Ada by Julian+Morrison · · Score: 2, Interesting

    Take a look... it basically is Ada, redone with C syntax and without the built in tasking niftiness.

    [Ada => Cyclone]
    type checking => type checking
    exceptions => exceptions
    discriminated types => tagged unions
    parameterized types => polymorphic data structures
    access types => * pointers
    polymorphism => polymorphic functions
    private sections in package spec => abstract types
    array slices => subtypes

    Ada has a lot more features, the only ones Cyclone boasts over Ada are: garbage collection as the norm not the exception, and tuples.

    1. Re:Cyclone *is* Ada by Florian+Weimer · · Score: 2

      Ada lacks pattern matching, but it supports garbage collection.

  116. C only has 2 problems. by Duncan3 · · Score: 1
    1. To use C you have to understand how a computer actually works, unlike scripting languages like Python or Java.
    2. libc - which was designed by complete morons who obviously didn't.

    Now granted, noone knows the first much any more, because "Learn XXX in 30 minutes" doesn't cover it. I wouldn't teach someone C unless they were really a computer geek, and anyone who doesn't know what a register and MMU are should NOT be using C.

    But if you do know how a computer works, and can avoid the traps in libc, you'll be fine and have nearly 100% portable code as well.

    --
    - Adam L. Beberg - The Cosm Project - http://www.mithral.com/
  117. For Cripes sake! by McDoobie · · Score: 1

    Ada95 has supported all these features, both staticly and dynamicly, for the last six years. 20 years if you consider Ada83 before that.

    People keep fiddling with this Java/C#/language dejour bullshit for safety critical systems, when theres already a tool out there(Ada95) that does 100 times what these other tools only grasp at.

    Hey, C,C++,Java, et... are all nice tools, but for the love of G-d, dont write anything critical using them.

    http://www.adapower.com
    comp.lang.ada
    http://www.adaic.org

    1. Re:For Cripes sake! by Anonymous Coward · · Score: 0

      linux is written in C.

      I'm glad we agree it's not critical!

  118. run-time, compile-time, and typing-time detection by Grape+Asterisk · · Score: 1
    To help side-step the "change code, compile, read parse errors, change code" loop, there's something called incremental compilation. As you type your code, the compile-time effects are computed and compile-time errors are clearly indicated at typing-time.

    The only IDE that I know of that does this is CodeGuide, by Omnicore, and they've only applied it to Java. (free 30 day trial!) I've been using it professionally and at home for years, and it's an absolute joy.

    The sooner you can detect a problem, the better. Cyclone pushes some run-time defect detection into compile-time. CodeGuide pushes compile-time defect detection to typing-time. Maybe someday soon our development environments will be able to automatically detect many run-time defects as we type our code.

  119. I agree, but... by mj6798 · · Score: 2
    Pointer arithmetic and similar features of C were introduced under some pretty tight constraints. After all, C compilers needed to run on the PDP-11 and work in 64k of address space.

    But on modern architectures, many of these design decisions are not that sensible anymore. For example, pointer arithmetic is more of a burden to modern optimizers. Languages that don't have pointer arithmetic but use array notation instead usually do as well as C in terms of performance, and often better. Similarly, the many unsafe operations in C, like "*(double *)&x" are better expressed using something that is syntactically distinguishable from a safe operation, say, "unsafe_get_bits(x,double)"; doing so involves no loss of functionality.

    But language success involves a lot of psychology. Java is much more like Lisp than like C++, yet people think of it differently because of its syntax. And if it takes Cyclone to get C programmers to program in what amounts to Modula-3, so be it--the world will be better off for it.

  120. Ada is not a good poster child by mj6798 · · Score: 2
    I find Ada to be pretty awful for what I am doing, even compared to C++: it just takes too damned long to get anything done in it. Maybe that works for very expensive, very slow-moving defense projects, but I think it doesn't work well for fast-paced industrial or open source projects.

    But just because Ada is like that doesn't mean every safe systems programming language has to be like that. Modula-3 is a whole lot nicer than Ada. Sather is a whole lot nicer than Ada. And there are other examples of safe systems programming languages.

    I think Cyclone has a good chance to deliver safer systems programming to C programmers in a package that they find palatable.

    1. Re:Ada is not a good poster child by Florian+Weimer · · Score: 2

      It is often said that Ada favors the reader over the writer. Most programmers don't like this because most programmers hate to write.

    2. Re:Ada is not a good poster child by Anonymous Coward · · Score: 0
      First, you got your logic backwards.

      Second, Ada may favor the naive reader by having lots of verbiage. That does not mean that it favors a skill reader.

  121. what--no Debian package yet? by mj6798 · · Score: 2
    Cyclone doesn't seem to be a Debian package yet--it can't be real :-)

    Seriously, I hope they'll start packaging Cyclone for Debian as well. That's a good way to get more exposure for it.

  122. Talk about ugly and inconsistent ... by tdelaney · · Score: 1

    I think I'll stick to Python and Jython.

  123. I don't think it IS a new language by catbutt · · Score: 1

    From their description, it just sounds like an improvement on C. So you don't need to "rewrite" your C code, just modify and recompile it.

  124. for the same reason... by mj6798 · · Score: 2
    For the same reason, you can't create a valid URL reliably (see your posting), other people can't write correct pointer code: people make mistakes. And C software is full of such mistakes--just take a look at the various bug trackers.

    Your assertion that this is for "lazy" programmers recognizes that avoiding or fixing pointer bugs takes time and effort. Programmers spend a certain number of hours per day programming. They can spend those hours avoiding or fixing pointer bugs, or they can spend those hours improving the UI, fixing other bugs, or creating entirely new applications. I find the latter much more useful than the former.

    The whole purpose of computers is to automate repetitive operations, and ensuring pointer safety seems like a very repetitive operation to me, and one that everybody makes mistakes on.

  125. Hold on there, pardner by cje · · Score: 2

    C is a fundamentally unsafe language.

    Nonsense. It's more appropriate to say "there's a lot of poorly-written C code that is fundamentally unsafe." It's true that C has some lower-level capabilities that can potentially be used in an unsafe manner. That doesn't mean that they have to be used in an unsafe manner. A well-written C program can be just as "safe" as its Ada counterpart in terms of array bounds checking and exception handling and things of that nature .. it'll be a bit more work, of course, but blaming the C language for the incompetency of some of the people that use it seems a tad unfair. It doesn't take a whole lot of effort to innoculate C code from the type of buffer overrun attacks and memory errors that have been seen in the past. Unfortunately, a lot of people learned this lesson about 10 years too late.

    Furthermore, a flawed and insecure algorithm is going to be flawed and insecure regardless of what language is used to implement it. A "safe" language like Ada might prevent you from trashing the stack and/or writing to arbitrary regions of memory, but it's not going to prevent you from implementing a mathematically weak encryption scheme, and it won't warn you if a programmer forgets to take out a debugging back door before a piece of code is released to production. You can write poor code in any language. You can write great code in any language.

    Application code, and certainly high-level code where security is essential, just aren't C's strong suits.

    And yet C works well enough to implement what is perhaps the world's most secure operating system (OpenBSD.) I'm not sure what you mean by "application code" (that's an awfully wide brush you're using there.) If I wanted to write, for example, a GUI application for Unix with database access, I'd most likely use C++ and Qt. However, this choice would be based on the fact that it's a lot less work to use C++ and Qt than it would be to use something like C and GTK+. Security and safety have nothing to do with it.

    I can't see how even the geniuses we're talking about can start from such a broken language ..

    C is not a broken language. A lot of code written in C is broken. When you make this distinction, you are on the road to understanding why this bias against C is completely unjustified.

    --
    We're going down, in a spiral to the ground
    1. Re:Hold on there, pardner by Anonymous+Brave+Guy · · Score: 2
      C is a fundamentally unsafe language.

      Nonsense. It's more appropriate to say "there's a lot of poorly-written C code that is fundamentally unsafe."

      That's true as well, but I stand by what I said before. C is fundamentally unsafe in two ways.

      1. It provides potentially unsafe language features (void*, unchecked pointer arithmetic, etc.).
      2. It actively encourages the use of unsafe programming practices.
      The latter is by far the more serious problem.

      I think we're all in agreement that a skilled programmer should not fall victim to unsafe programming practices often. However, even the most skilled programmer makes mistakes from time to time (if he is allowed to do so). More significantly, from a real-world point of view, the vast majority of programmers are "so-so" and not highly skilled with their language of choice. It is a rare development house indeed where this is not the case; if you work in one, perhaps your rules are different, and I envy you.

      For the rest of the world, and even the expert on an off-day, a language that prevents him making an error will be safest (though obviously it may have other disadvantages). A language that at least discourages unsafe practises is still safer than one that does not. A language that leads to undefined behaviour if you forget to append '\0' to the end of some data you just read, or that lets you forget to leave space for the '\0' at the end of your string, is dangerous.

      It's easy to defend a language you find useful. I hate it when people make ill-informed criticisms of the tools I use. But this is not ill-informed criticism, nor is it subjective. Comparing C and C++ with other languages, you can find dozens of examples where a potential safety problem is simply not possible in the other languages (e.g., "pointer-to-nowhere" can't happen in a declarative language like ML) or where other languages make it significantly harder to do something unsafe (e.g., new/malloc() require a matching delete/free(), whereas in a garbageed-collected environment, you have to do something more Machiavellian to leak memory).

      A well-written C program can be just as "safe" as its Ada counterpart [...] it'll be a bit more work, of course, but blaming the C language for the incompetency of some of the people that use it seems a tad unfair.

      I agree, it's somewhat unfair to have a go at a language based purely on its average programmer. But is that really what I'm doing here? C (and, to a lesser extent, C++) do unquestionably have features open to unsafe use that are absent in other languages. Furthermore, the very nature of the languages leads the programmer towards that unsafe use. (If you really want, I'll rattle off a list of the first dozen dangerous things that come to mind where I've seen at least one resulting bug in real code.) This isn't a fault in the languages; they have always been designed and used with efficiency and low-level control in mind. However, from a safety point of view, this is a fundamental flaw.

      Moreover, sometimes it really is reasonably to consider a language based on its average programmer. In particular, this is the case if you're evaluating how a project using that language and mostly average programmers will perform. Given that most projects are of this nature...

      C is not a broken language. A lot of code written in C is broken. When you make this distinction, you are on the road to understanding why this bias against C is completely unjustified.

      From a safety point of view, C is a broken language, and that is the issue in question. It has other strengths, certainly; C is not a bad tool per se. But that's not what we're talking about. Ultimately, a lot of code written in C is broken, and a lot of it demonstrably wouldn't have been if it had been written in a safer language, QED.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    2. Re:Hold on there, pardner by cje · · Score: 2

      It provides potentially unsafe language features (void*, unchecked pointer arithmetic, etc.).

      What's unsafe about void pointers? You can do potentially perform bogus pointer arithmetic and dereferences with any pointer type. void pointers provide a much-needed generic pointer type that vastly simplifies the interfaces to facilities such as malloc(). It's true that the automatic type conversion between void pointers and pointers to other object types can be problematic if abused, but an explicit cast can be used to do the same thing to any two pointer-to-object types, and that is just as easily abused.

      It actively encourages the use of unsafe programming practices.

      I'm not sure what you mean here. C is a language, not a person. It doesn't encourage anything. C gives you the capability to shoot yourself in the foot, but it also tells you (in very specific terms) how to avoid doing so.

      A language that leads to undefined behaviour if you forget to append '\0' to the end of some data you just read, or that lets you forget to leave space for the '\0' at the end of your string, is dangerous.

      Languages don't lead to undefined behavior. Code does. Properly-written code doesn't invoke undefined behavior. Actually, I take that back .. there are plenty of examples of acceptable undefined behavior, such as #including a header that is not specifically addressed by the C standard. Let me rephrase: Properly-written code does not invoke unwanted undefined behavior.

      Ultimately, a lot of code written in C is broken, and a lot of it demonstrably wouldn't have been if it had been written in a safer language, QED.

      I would submit that there is a lot of code that you wouldn't want to have written in a safer language. You wouldn't argue (at least I hope you wouldn't) that Linux or OpenBSD (again, a shining example of an extremely secure collection of C code) be rewritten in Ada. People are not going to be impressed when their already-secure operating system loses 35% of its runtime efficiency to become "super-duper" secure. You (correctly) point out that a lot of the pitfalls that await bad C code can be avoided with more authoritarian languages, but all of that safety comes at a price. You cannot implement run-time array bounds checking without negatively affecting run-time performance; this is perfectly obvious.

      I would rephrase your above-quoted statement thusly: "Ultimately, a lot of code written in C is broken, and a lot of it demonstrably wouldn't have been if it had been written correctly." Now, it is a fact of life that nobody writes correct code the first time through, or any iteration thereafter. This applies to newbies as well as seasoned veterans. It is also true that bad C code can manifest itself in far worse ways than bad Ada code can. But good C code is just as safe as good Ada code. And, let's face it .. when you look at the current crop of high-level languages (if you consider C to be a HLL, which many do not), it is nearly impossible to beat a typical C implementation in terms of speed and compactness.

      Now, in this era of big RAM and big clock speeds, maybe this is less important than it used to be .. but I wouldn't bet on it. C, if used improperly, allows programmers to do some really stupid things .. but using this to label the language as wholesale "unsafe" is like calling a sports car unsafe because it allows a reckless driver to accelerate from 0 to 60 MPH in 4.5 seconds and slam into a streetlight pole doing 150. There's a huge difference between what a facility allows to be done with it and what a responsible user actually does with it.

      --
      We're going down, in a spiral to the ground
    3. Re:Hold on there, pardner by Anonymous+Brave+Guy · · Score: 2

      I'm not going to reply to everything here, since I've already addressed a lot of it. However...

      What's unsafe about void pointers?

      You have a pointer to you-don't-know-what in your language, and you're asking me what's unsafe about it? There must be a potentially dangerous casting operation to make any real use of such a pointer. Other languages simply don't offer this dangerous facility, instead providing alternatives such as compile-time polymorphism (e.g., templates in C++) or run-time type identification, which are inherently not subject to the same possible abuses as the C approach. This is a simple comparison. One language lets you do something dangerous. Another doesn't. Which is safer?

      It actively encourages the use of unsafe programming practices.
      I'm not sure what you mean here. C is a language, not a person. It doesn't encourage anything. C gives you the capability to shoot yourself in the foot, but it also tells you (in very specific terms) how to avoid doing so.

      And yet, the vast majority of programmers, even good professionals, do make mistakes and do use the language unsafely on a regular basis. If it's not their training that's encouraging that, then it must be the way the language itself works. You're confusing theory, where every programmer is perfect, with practice, where most programmers don't even know that undefined behaviour is a technical term, never mind its implications, and everyone makes mistakes (if they're allowed to).

      Just looking at the use of arrays, pointers and strings in C, there are dozens of ways in which the language's method of doing things almost requires the programmer to do something potentially unsafe. There is no built-in string type, so every time someone wants to use a string, they have to mess around with low-level details like adding '\0' (and allowing space for it in the first place). How many times have you seen someone try to compare two strings in C using == instead of strcmp()?

      Languages don't lead to undefined behavior. Code does.

      Only in languages that allow you to lead to it.

      Properly-written code doesn't invoke undefined behavior. Actually, I take that back .. there are plenty of examples of acceptable undefined behavior, such as #including a header that is not specifically addressed by the C standard.

      That's absolutely well-defined behaviour. "Undefined behaviour" is a technical term in the C standard, and means your program is allowed to do anything at that point. It doesn't mean you can get the wrong value in your float, it means assigning the wrong bytes to your float is allowed to crash your system (and, on some architectures, it would).

      I would submit that there is a lot of code that you wouldn't want to have written in a safer language. [...] You cannot implement run-time array bounds checking without negatively affecting run-time performance; this is perfectly obvious.

      Of course; I agree entirely. Giving up safety for some other benefit may be entirely reasonable. But you're still giving up safety, and safety is what we're talking about here.

      As you point out, in today's systems, low-level, high-performance coding is not as important as it used to be. It's easy to lose track of the bloat introduced by too much enforced safety (or an OO design, or...) and that's a Bad Thing(TM). But the simple fact is that in today's world, almost nothing needs the balance of safety vs. performance to be where C (and, to a lesser degree, C++) puts it. An OS, device driver or truly mathematically demanding routine are about the only things that still justify that. Surely in that case, a language used for anything else should put the balance further towards safety by default?

      If we can agree on that, then I stand by my original claim: C may not be the best starting point to achieve the balance we now seek. Its whole low-level nature, the very existence of pointers and pointer arithmetic in that form, is not a firm foundation on which to build a safe approach. IMHO, it would be better to have adjustable references (more like Java's than C's) and do away with pointer arithmetic (which is an anachronism that has little place in any code today, even high-performance stuff, since it tries to out-smart the optimiser and often gets it wrong). For low-level access to a particular area of memory, you can provide a separate API, so that the user can still do it, but has to do it deliberately and carefully, and only when it's actually necessary. Obviously I'm principally using pointers, strings and arrays as my example of unsafe features here, but you could make similar arguments for various parts of the library, the use of "..." to provide functions with extensible parameter lists, and more besides.

      I think the really key thing here is that you can have two languages, capable of the same levels of performance and control, but where one uses high-performance, unsafe things by default, and the other uses safer but lower-performance options. In today's world, even for writing an OS, I don't see why the latter isn't a better option. As long as you don't stop the programmer from doing what he needs to do, defaulting to a safe version is just good software engineering.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    4. Re:Hold on there, pardner by cje · · Score: 2

      You have a pointer to you-don't-know-what in your language, and you're asking me what's unsafe about it?

      This is tenuous at best. Under very few circumstances will you be passed a void * and have "no idea" what it's pointing to. I can write a function that (for example) retrieves parameters of various type from a configuration file, and set up the function such that the first argument is a void * and the second argument is an enumeration that specifies the type of the argument to be retrieved. On the basis of that argument, I can write the retrieved value through the pointer using an appropriate cast, knowing perfectly well what the pointer is pointing to.

      Now, this can obviously be abused and misused. I could accidentally specify the wrong argument type when calling this function, at which all hell could break loose. But this would be my fault, not the language's fault .. and furthermore, it would be quickly detected. Other memory errors are not as quickly detected, but tools such as Purify go a long way in fighting these battles for you.

      You're confusing theory, where every programmer is perfect, with practice, where most programmers don't even know that undefined behaviour is a technical term, never mind its implications, and everyone makes mistakes (if they're allowed to).

      No, I think my exact words were "nobody writes correct code the first time through, or any iteration thereafter."

      Just looking at the use of arrays, pointers and strings in C, there are dozens of ways in which the language's method of doing things almost requires the programmer to do something potentially unsafe. There is no built-in string type, so every time someone wants to use a string, they have to mess around with low-level details like adding '\0' (and allowing space for it in the first place). How many times have you seen someone try to compare two strings in C using == instead of strcmp()?

      The string handling facilities in C are well-documented and if somebody tries to compare strings with ==, it indicates that the developer has virtually no understanding of the language. This is not the kind of "oops" error that even seasoned veterans let slip by on a Monday morning. This is the kind of error that would be made by somebody who really needs to learn the language that he or she is going to be using, or perhaps choose a different career.

      You're right .. the string-handling facilities in C are dreadful compared to those offered by other languages, particularly those that have a built-in string type. But your claim that the language requires developers to write unsafe code is completely without basis in fact.

      I've got to run off .. I don't have a lot to add to the rest of your post (I think we know where we agree and where we disagree.) It is possible to write safe code in C, and it's actually quite easy if you know what you're doing. It's possible to completely screw the pooch in C, as well. But as I noted earlier, code safety is not violated exclusively by bad pointer arithmetic and the other observations that you've made about C. No amount of built-in safety is going to prevent you from implementing a shoddy algorithm or slipping in an undocumented back door. These are important issues as well .. at least as important as the tomfoolery that the underlying language allows you to get away with.

      With that, I've only one thing to add:

      That's absolutely well-defined behaviour. "Undefined behaviour" is a technical term in the C standard, and means your program is allowed to do anything at that point.

      No, the inclusion of a header that is not specifically addressed by the C standard most certainly does invoke undefined behavior (at least, it did in ISO 9899:1990, though I'm not sure if C99 says anything different.) I'm not sure what else the standard could reasonably do with this situation other than leaving the behavior undefined. The net effect is that it is not possible to write a strictly-conforming C program that uses nonstandard facilities, which is perfectly reasonable.

      --
      We're going down, in a spiral to the ground
    5. Re:Hold on there, pardner by ahde · · Score: 2

      If you consider java from the perspective of the average programmer, you'd have to admit that java is a fundamentally flawed language and it is impossible to implement efficient algorithms in it because its low barrier to entry, automatic garbage collection, etc. mean that the average java programmer does not have the skill set necessary to formulate efficient algorithms, and a statistical sample of code bears this out.

  126. Bravo by Anonymous Coward · · Score: 0
    The whole purpose of computers is to automate repetitive operations, and ensuring pointer safety seems like a very repetitive operation to me, and one that everybody makes mistakes on.

    It's amazing the attitude of some people. I'm curious to know what kind of jobs these programmers who think they're too good for modern techniques actually have. Do they spend all day writing code in machine language?

    1. Re:Bravo by Kymermosst · · Score: 1

      Well, actually, I have spent days and days and days writing machine language. You should try it sometime.

      --
      "Alcohol, Tobacco, Firearms, and Explosives" should be a convenience store, not a government agency.
  127. Get into gambling systems by Animats · · Score: 2
    If you're in in-flight entertainment systems, it would be an easy move to casino and gambling systems. That industry has a tradition - "if it breaks and loses us money, you pay". Systems in casinos, at racetracks, and lottery systems typically have provisions where the lottery system contractor is financially liable for all errors. There are often downtime penalties as well.

    So lottery systems tend to have redundant communications links, Tandem Non-Stop hosts, and lots of error and sanity checking. In the Mexico City earthquake, the lottery system stayed up, using its own backup radio links.

    This doesn't kill the systems vendors. GTech, which runs many state lottery systems, reports that they pay out about 0.3% of revenue in penalties. Of course, they spend more than that avoiding trouble. And it works.

  128. Re:Flat unicode by ka9dgx · · Score: 2
    It's still a flat text file, just a string of characters with line delimiters (unless it's Obfuscated C, APL, PERL, etc., then there aren't line delimiters). We're using white space to separate tokens, so you can't have variables with spaces in them. You have to manually escape string sequences, so that "\n" is a new line, etc. This isn't a great burden in itself, but all of these little innefficiencies and peculiarities add up.

    There are lots of cool things you just can't do easily with flat text, like tagging sections of code, perhaps to facilitate aspect oriented programming. You could show all related code in one text face, color, or whatever.

    The overhead doesn't have to be great, it doesn't even have to imply a GUI, you could do it under MS-DOS (or use CURSES in GNU/Linux systems).

    --Mike--

  129. disappointing speed, too complex by mj6798 · · Score: 3, Insightful
    I pulled it over and installed it. Running their own benchmarks, it seems 5-10x slower than C on most benchmarks. Also, looking more at the documentation, this is not merely a "safe version of C", it's a pretty complex language with C-like syntax but many ML-style features.

    Cyclone could be a winner if it gave you C-like performance with safety and minimal changes to your programs. But it doesn't match C performance as it is and I don't think large, existing C programs will port to it easily, despite superficial similarities.

    The way it is, I think you are better off using O'CAML or MLton. They are probably easier to learn and give you better performance. O'CAML, in particular, has already been used for a number of UNIX/Linux utilities. And Java is probably as C-like as Cyclone and runs faster (although programs have a bigger footprint).

  130. Re:Let it go by Pete · · Score: 1
    This thread is completely offtopic of course, but what the hell. :)

    RealityMaster101 said, among other things: "Bush won. He won by every measure, even the unreasonable ones." To which the only response is to say, well, that's just not true. I'm sure there are lots of unreasonable measures by which Bush didn't win (I think you forget just how unreasonable humans can be :), but there are a couple of very good reasonable measures.

    First, Gore had the most votes of any candidate across the US, winning narrowly but clearly in what is often referred to as the "popular vote" measure.

    Second, there was a small but extremely signficant minor left-wing player (Ralph Nader) participating in the election, and I believe it may be reasonable to assume that most of the Nader-voters would have preferred Gore over Bush. If the US had a preferential voting system instead of this ludicrous first-past-the-post crap, Gore should (probably :) have won quite clearly. And hell, Bush senior might well have beaten Clinton in '92, assuming most of that very large number voting for Perot would have preferred Bush.

    Third, and this (probably) being the one that the guy's sig referred to, there were a number of quite major fuckups in the Florida election (and possibly elsewhere, but Florida was the most significant). I don't think there was any simple way to solve this - probably the only really viable solution would have been to hold another election (for the whole country, not just Florida) and that would be way too embarrassing for the USA as a country. "Look! we're the leaders of the free world, the richest and most powerful country in the world, and champions of Democracy(tm)... and we still managed to screw up our presidential election so badly that we had to do it again!"

    *grin* Actually, that would be pretty funny. But at least it would be admirable that you (the US as a country, not RealityMaster101 personally :) had the balls to admit the mistake and actually fix it, even if it was embarrassing to do so. Instead, you ended up with a situation that was more sad and pathetic than funny, as a classic demonstration of the PHB ethos of "it's more important to get something done on time, even if it's wrong!" rather than being willing to take the time to be sure you got it right.

    There was one significant positive to come out of that election though - it can now be almost the canonical example of what is wrong with the first-past-the-post voting system. Though I don't have any great hopes of the US changing their system anytime soon, at least there's now something that people can point to and say "This is why we should change."

    Pete.

  131. Re:Flat unicode by be-fan · · Score: 2

    I was kidding. The point was that we do the same things we've always done, except we use nifty new stuff to do it.

    --
    A deep unwavering belief is a sure sign you're missing something...
  132. Re:Let it go by hereticmessiah · · Score: 1

    Agreed. There are an immense number of ways the US voting system could be improved. FPTP is just a bad system. For the likes of presidential elections and congress elections, implementing a STV (Single Transferrable Vote) system would be a huge improvement. That way, those who wanted to vote for a candidate, yet protest dissatisfation with them in some way could give their first preference to a different candidate and their second to the candidate they wanted elected. A much better system.

    --
    I don't like trolls and mod against me if you like, but I'd prefer if you'd reply.
  133. Aren't we forgetting something? by dreamsinter · · Score: 1

    What about C+-?

    I doubt you can beat a subject-oriented language!!!

    Getting facetious, Cyclone sounds like an interesting idea - I just wish they'd released an open source edition of C+@, and let Unir be the little fish in the big pond that that would've provided, instead of letting Unir be the extra-size fish in the tiny little pond that resulted - yes, we've read DJJ, and no we can't afford C+@!!! What more can you want?

    --
    "I his bow, and spun and wove, likes you." Vere de Vere out of my mould's mouth dragged me of the voluntary apes.
  134. Re:Consolidation of technologies by Anonymous Coward · · Score: 0

    Whoa, troll! I'll bite on youir ruby comment!

    I'm not conversant with python beyond a quick peruse of a basic primer, but the more I look at ruby the less like perl it seems. Now, if you had mentioned smalltalk you might have been right in your description of the ancestry of ruby.

    Not that I'm a ruby zealot, I use 1/2 a dozen languages all the time - its always a case of tools for the job.

    Anyway, the big difference between perl and ruby is that I can understand what I wrote 3 months ago in ruby without commenting it to death :-)

    Regards

    da frog

  135. Language families by Anonymous+Brave+Guy · · Score: 2
    C# and Java bear no other relation to C & C++ than puctuation.

    And the basic procedural programming mechanisms they use, right down to the almost identical grammar for structured programming constructs and right up to their use of exceptions to transfer control up to higher level code.

    And large parts of their OO system, including the way they model with classes, objects, members, access modifiers and inheritance.

    And even, if the near future unfolds as expected, such support as they have for generic types.

    In other words, the underlying underlying models for each of these languages are pretty similar. There are some truly significant differences: the garbage collected memory management in Java and C#, the use of templates in C++, the use of multiple inheritance in C++ vs. interfaces elsewhere, and the standard libraries. But even these still fit into similar basic programming frameworks.

    Of course, Java and C# are each used differently, idiomatically, from C++, and this is where most of the differences lie. But, when compared to the field of programming languages as a whole, they are small differences. Java and ML have big differences. C++ and Visual Basic have big differences. Java, C# and C++ are a family.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.