Slashdot Mirror


Ask Slashdot: Is it Practical To Replace C With Rust?

interval1066 writes: I've heard of rust from various sources around the net for a few years and never paid it much mind, there are so many new languages out now since my early days doing C programming, which what I've stuck to and made me my career. Now I'm heading a project that uses a RoR application to control a large series of sensors and controls in a manufacturing process. Naturally I want to talk to the hardware using a GEM extension written in C, as I've done before.

But another engineer who is not a fan of C (seems few younger engineers are) said he could write the extensions needed easily in Rust. Seems like this is a thing. I took a closer look at rust and it looks to me like another attempt at "C" without pointers, except rust does have a kind of pointer, it appears. I like its ranking on a list of fastest languages, and it seems pretty simple with an initial tool footprint that is quite small.

But what are the trade offs? Another language, and one that few engineers know (much like Vala, which I like very much but has the same small user base). What if I need another engineer to work on the code? I pretty much know what I can expect from C/C++, rust is a huge unknown, what if I run onto a roadblock? The engineer pushing for rust is emphatic, should I bulldoze him or take the plunge?

437 comments

  1. You know the old saying... by __aaclcg7560 · · Score: 5, Insightful

    No one ever got fired for using C.

    1. Re:You know the old saying... by cruff · · Score: 5, Funny

      No one ever got fired for using C.

      Someone at Volkswagen might.

    2. Re:You know the old saying... by transfire · · Score: 2

      There is always risk with embracing new tech, but I would be willing to bet you won't be disappointed with Rust.

    3. Re:You know the old saying... by Anonymous Coward · · Score: 0

      No one ever got fired for using C.

      In a well disciplined manner anyway ...

    4. Re:You know the old saying... by Tablizer · · Score: 1

      No one ever got fired for using C.

      That phrase has also been used for heyday IBM and Microsoft. But both sucked.

      Sometimes you have to choose between money and sanity.

    5. Re:You know the old saying... by __aaclcg7560 · · Score: 2

      I don't think you can blame the programming language for that one.

    6. Re:You know the old saying... by Mirar · · Score: 2

      I thought Bosch wrote that code and told WV not to use it like that. Anyway, it's probably written in Simulink.

    7. Re:You know the old saying... by hawguy · · Score: 4, Insightful

      No one ever got fired for using C.

      That phrase has also been used for heyday IBM and Microsoft. But both sucked.

      Sometimes you have to choose between money and sanity.

      It used to be true of IBM -- as long as you were willing to pay, you could get near perfect uptime and nearly unlimited scalability. But you definitely had to pay for it -- we had a dedicated IBM service rep with an office in our data center, that sort of service doesn't come cheap. But we had no significant downtime in my 4 years there. Sure we had some jobs fail here or there due to DASD failures, but the core mainframe never had a hiccup and we completed several online hardware upgrades with no downtime.

      Of course, I can get even better scalability and uptime with a distributed system (geographically distributed) on commodity hardware today, but that wasn't always a viable option.

    8. Re:You know the old saying... by shaitand · · Score: 5, Insightful

      C has it's ups and downs but sucking isn't one of its properties.

    9. Re:You know the old saying... by DutchUncle · · Score: 5, Insightful

      No one ever got fired for using C.

      That phrase has also been used for heyday IBM and Microsoft. But both sucked.

      Heydey IBM didn't suck. You whippersnappers just don't appreciate what we had to do on mainframes to lay the groundwork for distributed computing. A lot of the ultra-modern pipelining in processors can be traced directly to Cray and Amdahl and other designers from the golden age, and if they could have had as much spare hardware and memory as a modern system-on-chip without blowing up both a bank and the power grid, who knows how much further we'd already be.

    10. Re:You know the old saying... by Tablizer · · Score: 1

      IBM hardware was indeed reliable. However, from a software developer's perspective, it was known to have awkward tools. JCL alone drove some insane.

    11. Re:You know the old saying... by willworkforbeer · · Score: 3, Funny

      Heydey IBM didn't suck. You whippersnappers just don't appreciate what we had to do on mainframes to lay the groundwork for distributed computing.

      And in those day, laying groundwork was uphill. Both ways.

      --
      Pretending this is my office full of bitter coworkers..
    12. Re:You know the old saying... by Beck_Neard · · Score: 2

      I know that's a joke, but it's of course nonsense. Plenty of people have gotten fired for using C, especially when their code had dangerous security vulnerabilities (which it ALWAYS does).

      --
      A fool and his hard drive are soon parted.
    13. Re:You know the old saying... by BigMattyC · · Score: 1

      I thought Bosch wrote that code and told WV not to use it like that. Anyway, it's probably written in Simulink.

      "written"

    14. Re:You know the old saying... by Anonymous Coward · · Score: 0

      Nobody got fired for using C. People got fired for being bad programmers. Different.

    15. Re:You know the old saying... by Anonymous Coward · · Score: 0

      Well it appears that there are no good programmers using c, then, what with all the defects.

    16. Re:You know the old saying... by DickBreath · · Score: 1

      Was modern mental health treatment unable to help those individuals who suffered from having used JCL?

      --

      I'll see your senator, and I'll raise you two judges.
    17. Re:You know the old saying... by Beck_Neard · · Score: 1

      I'm going to invent a gun that 1/10 of the time shoots the bullet out from the back, towards the user's face. I will call anyone who can't use my gun safely a bad gun user.

      --
      A fool and his hard drive are soon parted.
    18. Re:You know the old saying... by Anonymous Coward · · Score: 1

      BS. I got fired for not being a C++ Uber-Alles weenie.
      Dumb, but as I was not a Tel-Aviv-based-developer@AMD working on the OpenCL debugger, and being intolerant of Mho-Rhons who (seem to persist to this day) that "pretty" is better than "correct" at AMD, I got let go in the great software purge of 201x. Yes, the same one when Ben Bar-Haim got rewarded for his ineptitude.

    19. Re:You know the old saying... by iplayfast · · Score: 1

      point the end where the bullets come out away from you!

    20. Re:You know the old saying... by Megane · · Score: 1

      They were given training in MUMPS to help them recover from the effects of JCL.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    21. Re:You know the old saying... by TapeCutter · · Score: 1

      The phrase came from an IBM marketing campaign.

      --
      And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
    22. Re:You know the old saying... by vtcodger · · Score: 1

      JCL -- described by one early user as the world's first syntax free language. See https://en.wikipedia.org/wiki/...

      --
      You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
    23. Re:You know the old saying... by pdxtabs · · Score: 2

      This is very true, but...

      I am a Senior Embedded Software Engineer at a Fortune 500 company. I work on a code-base of millions of lines of C with 300 of my closest development buddies who are located all over the world. The distribution of abilities is as you would expect with this statistically significant sample of developers. I spend a lot of my time tracking down tricky memory corruption bugs in C by hand that would have been caught by the Rust compiler. What's more, dangling pointers and buffer overflows are the worst kinds of bugs because they often lead to security vulnerabilities.

      An excellent engineer can write excellent C, but a poor engineer can overflow buffers and leave dangling pointers hanging around... but not in Rust.

    24. Re:You know the old saying... by pdxtabs · · Score: 1

      It takes work to write safe code in C. Your worst developers will use uninitialized variables, pointers to previously freed memory, and overflow buffers. But not in Rust.

    25. Re:You know the old saying... by Anonymous Coward · · Score: 0

      I've known programmers fired for insisting on using a language which wasn't a company standard.

    26. Re:You know the old saying... by maharvey · · Score: 1

      Obviously you should just hold the gun sideways, or over your shoulder. So yeah, bad gun user.

    27. Re: You know the old saying... by Demena · · Score: 1

      Sarcasm is invisible to you? Ok, so why do YOU think the remark was made?

    28. Re:You know the old saying... by Tablizer · · Score: 3, Insightful

      It think it's safe to say that C as a language is optimized for speed, size, and hardware issues instead of software engineering issues.

    29. Re:You know the old saying... by gweihir · · Score: 2

      On the minus side, a poor engineer will not even be able to do Rust at this time, so Rust benefits form that you likely get better people as you either have to get one of the very few people that can do Rust or get one that can learn it fast.

      That said, do not mix languages on a large project unless you have to. And of you really go Rust, make sure you have more than one engineer who can work with it. Also counting against Rust is that it is too new.

      I would also say that the person insisting on Rust is acting hugely unprofessional and trying to push his personal agenda on the project. That alone would be a valid reason to "bulldoze" him.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    30. Re:You know the old saying... by Anonymous Coward · · Score: 0

      Well, in that case C would be a gun with enough stopping power for tanks, that can shoot down airplanes, and be part of pretty much every other weapon system created. Yes, you'll just have to call the ones who stooh themselves a bad gun users, but they will learn. And there are other guns that are built on top of your powerfull gun, they take away half the power but also remove the easiness with which you can shoot yourself to the face. They are very good guns in their own way, and when used where the enormous stopping power of C-Gun isn't needed. C-Gun usage should be reserved for cases where you need absolute control of the gun, need the heavy stoping power, are prepared for the needed learning curve, need to hide the tiny gun inside a tiny box and work it from there, and know how to handle the backfires.

    31. Re:You know the old saying... by ziggystarsky · · Score: 1

      It takes as much work to write safe code in Rust.

      The upside is that the unsafe code will not compile under Rust.

    32. Re:You know the old saying... by michelcolman · · Score: 1

      I can imagine what that e-mail was like. "Here's the code to cheat on emissions tests, only for 'testing' purposes, don't use it in production cars, wink wink..."

      "O, and how many millions of licenses did you want?"

    33. Re:You know the old saying... by Anonymous Coward · · Score: 0

      No, your analogy is flawed.
      You see, the gun only shoots towards the user's face only if he holds it wrong ever so slightly, and even then it might just randomly shoot the right way regardless (Or shoot in a different direction altogether).
      You can't deny that this is obviously the user's fault for holding the gun wrong. He could just always hold it perfectly right every time and it wouldn't shoot him in the face.

    34. Re:You know the old saying... by TheRaven64 · · Score: 3, Interesting

      It's optimised for speed, as long as your target is basically a fast PDP-11. C does not allow the compiler to rearrange data layouts, which makes it hard to take advantage of SIMD or to avoid false sharing. C makes it very hard to statically reason about memory ownership, requiring a defensive programming style with redundant operations when writing multithreaded code. C only recently had a memory model for concurrent accesses at all and so most multithreaded C programs contain undefined behaviour.

      --
      I am TheRaven on Soylent News
    35. Re:You know the old saying... by TheRaven64 · · Score: 2

      An excellent engineer can write excellent C, but a poor engineer can overflow buffers and leave dangling pointers hanging around... but not in Rust.

      A poor developer will write C code that doesn't work at all. A mediocre developer will write C code that works, but is rife with security vulnerabilities. An excellent developer will write C code that needs an excellent attacker to exploit. Unfortunately, the world has quite a lot of excellent attackers in it.

      --
      I am TheRaven on Soylent News
    36. Re:You know the old saying... by T.E.D. · · Score: 1

      C has it's ups and downs but sucking isn't one of its properties.

      This is true only in the case where you are writing the code for a vacuum cleaner.

    37. Re:You know the old saying... by __aaclcg7560 · · Score: 1

      Pity the fool who has to write C for an appliance that truly sucks.

    38. Re:You know the old saying... by luis_a_espinal · · Score: 4, Informative

      It takes work to write safe code in C.

      Same with Java and even Ruby - Null refs, running out of mem, not closing database connections, etc - things that also characteristics of unsafe code. I've done the lot of it, C, C++, Assembly, Java, Python, what have you. For e-commerce as well as low level stuff.

      And I've seen unsafe code written in all of them. Treating pointers as ohhh-chupacabara! is just ridiculous. People who program with discipline avoid those problems, whether they program in C or Python or what have you.

      Your worst developers will use uninitialized variables, pointers to previously freed memory, and overflow buffers. But not in Rust.

      Don't worry. Your worst developers will find ways to create unsafe code in Rust in one way or another.

    39. Re:You know the old saying... by TemporalBeing · · Score: 3, Insightful

      I know that's a joke, but it's of course nonsense. Plenty of people have gotten fired for using C, especially when their code had dangerous security vulnerabilities (which it ALWAYS does).

      Wrong.

      Yes, people have been fired for being bad programmers. I doubt many have been fired over security vulnerabilities, most likely because either (a) the vulnerability was discovered after the programmer already voluntarily left or (b) was rooted in standard operating procedures (e.g you just don't do that) - most due to people not realizing the consequences of network computers. (Prior to networking, security didn't really matter too much outside of specialized environments.)

      Further more, C-based software probably runs about 99+% of devices out there - most notably everyone's favorite OS kernel - Linux - is entirely written in C, as is the Windows NT Kernel, the BSD Kernels, etc. Most all operating systems use it at the core, and many applications use it - IOW, the world runs on C; aside from Assembly is it probably the most used programming language out there when you look at all aspects of software (even C++ doesn't compare). It only bites you if, like with any tool (including Java), you mis-use it. Best practices will save you from 99.99% of issues.

      Oh, and the OS's that don't use C in their kernel? They're all research or hobby stuff that more or less proves you could do it, but the performance is so abysmal (compared to the same thing in C) that no one would really use it, or they use C to bootstrap and load into their alternative language - typical of C++ OS Kernels. (Yes, there have been Java-based Operating Systems; they also relied on specialized hardware-based JVMs and no one uses them outside of small research projects.)

      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    40. Re: You know the old saying... by Anonymous Coward · · Score: 0

      bingo. hpux ping of death for one expert cybernetic exploit.

    41. Re: You know the old saying... by Anonymous Coward · · Score: 0

      false dichotomy, muppet. algol, fortran and modula2 prove otherwise.

      look up the burroughs computers and the work of cray and kuck.

      but that goes against world domination complex of some warmongers. it must be shittily bad for purposes of control.

    42. Re: You know the old saying... by Anonymous Coward · · Score: 0

      while with c, your best software engineers will create plenty of exploitable bugs. bugs which would be benign if they used a memory safe language like rust or swift.

      the sooner c lands on the scrap heap, the better. we have sufficient war domains alteady and i dont want people to stop using computers, as this would make my life less pleasurable.

      we KNOW how to make secure IT, it is juat the leader muppets who do not yet cooperate.

      me ? grandfather of rust and swift.

    43. Re: You know the old saying... by Anonymous Coward · · Score: 0

      bullshit. mpe and the burroughs os was heavy duty. mpe was killed by corrupt leaders while customers wanted it.

      neither is os 360 done in c. c is just the cheap nasty kebap trying to squeeze out the leberkaes and the rinderoulade.

      cheap, cheaper, c.

      happy digestion when the day of strategic relevance comes.

    44. Re:You know the old saying... by Mike+Van+Pelt · · Score: 1

      Well, let's put it this way... using JCL is sort of like reading The Necronomicon.... until you understand it

    45. Re:You know the old saying... by Anonymous Coward · · Score: 0

      Yes, it takes a very competent software engineer/computer scientist to properly develop a software solution to the available hardware using C. If you can throw enough horsepower at it (and in these days, you easily can), any of the newer, softer languages are capable enough for the plebes to bang out workable code.

    46. Re:You know the old saying... by Tablizer · · Score: 1

      What's an existing language that can and does (practically) take advantage of the tricks you mention? And if so, how come it's not replacing C in any noteworthy quantity for hardware-centric uses?

    47. Re:You know the old saying... by Anonymous Coward · · Score: 0

      Nope, Bosch uses ETAS ASCET (I get a lot of their powertrain designs so I can verify this)

    48. Re:You know the old saying... by Anonymous Coward · · Score: 0

      Bad programmers will write bad code in any language. That doesn't mean we shouldn't aim to improve the quality of our tools.

      The thing is, bad programming practices can be mitigated by improving our languages, at the very least making them more infrequent. A lot of null reference problems can be mitigated by using better languages where nullable references must be marked explicitly. Resource management will eventually become obsolete (or relegated to low-level system programming) just like manual memory management, so things like having to manually close database connections will be considered a relic of the past. Even resource misuse (getting out of memory) can be mitigated with static analysis, which will eventually be part of the standard compilation loop.

      Bad programmers will find their way around those measures, but the issue here is the frequency and amount of fuck ups per unit of time. Managing a large C codebase written by bad programmers is a massive nightmare. I've had much better experiences with scripting languages. Sure, they produce excruciatingly slow, bloated, and buggy software, but comparatively it is a lot harder to have the C codebase simply start without crashing.

      Better tools also improve the code quality even when disciplined programmers write it. Automating things like memory management means they can focus on the important stuff, while making the languages more aware and explicit also makes its behavior more apparent.

    49. Re:You know the old saying... by Anonymous Coward · · Score: 0

      And:
      JAVA:
      - A poor developer will write code that is full of security-vunerabilities and works to some degree.
      - A mediocre developer will write code that that is full of security-vunerabilities.
      - A excellent developer will write code that needs a good attacker to exploit.

      PHP:
      - A poor developer will write code that is full of security-vunerabilities and works to some degree.
      - A mediocre developer will write code that that is full of security-vunerabilities.
      - A excellent developer will write code that needs a good attacker to exploit.

      C++
      JAVA:
      - A poor developer will write code that is full of security-vunerabilities and works to some degree.
      - A mediocre developer will write code that that is full of security-vunerabilities.
      - A excellent developer will write code that needs a good attacker to exploit.

      C++:
      - A poor developer will write code that is full of security-vunerabilities and may work to some degree.
      - A mediocre developer will write code that that is full of security-vunerabilities.
      - A excellent developer will write code that needs a good attacker to exploit.

      One big problem with making languages easier to use is also that you pull in developers that can get things to work, but that still have huge vulnerabilities. One thing they do help with is making some types of issues, like memory-leaks, less troublesome to handle.

      Security is something that people needs to be trained in, does not matter what language you develop in.. And one major issue with getting more and more developers is that managers only sees it as more resources they can use and they do not really have a good understanding of security... a "bug" or a "security-issue" is looked at the same but are in fact completely different. A bug can, and usually do, cause a application to crash.. A security-issue can exist without ever crashing the application but when custom-crafted data is injected it can compromise the system... Most companies tries to get around this by refusing review's of their code, but that's just obscuring the issue making it a little bit harder to be abused.

    50. Re:You know the old saying... by pohl · · Score: 1

      Rust. Because it's relatively new.

      --

      The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...

    51. Re:You know the old saying... by Nubbywubwub · · Score: 1

      Rust has pointers. Rust has pointers all over the place. What sets Rust apart is that the compiler checks code for improper pointer usage and disallows it unless you explicitly tell it to chill out using the "unsafe" keyword. It trivializes code auditing by making it so you just need to grep for the word "unsafe" to know where the source of any segfault (or any other memory error) must lie. So no, it's not a silver bullet (nothing is), but it's a hell of a lot easier to write low-level memory-safe code in Rust than it is in C.

    52. Re:You know the old saying... by Anonymous Coward · · Score: 0

      That wasn't because they used C, but because they used it wrongly. These people would have made bad code in another language too.

    53. Re:You know the old saying... by TheRaven64 · · Score: 1

      In 2012, around 80% of all security vulnerabilities exploited in the wild came from some memory safety error. If you use Java, or you use C++ with strict discipline about the use of shared_ptr / unique_ptr, then you immediately remove the possibility of these kinds of vulnerability. You may still fail to sanitise inputs and allow other kinds of high-level vulnerability, but at least eliminating 80% of vulnerabilities would be a nice start.

      --
      I am TheRaven on Soylent News
    54. Re:You know the old saying... by TheRaven64 · · Score: 1

      Java can take advantage of some, though most existing JVMs don't. A few research projects do. If we're talking about the language, rather than the language implementation (on the basis that the latter can improve without changing the source), then any language that makes field order undefined can take advantage of these things. If the language has primitive integer types, then exploiting SIMD in its equivalent of structs is much easier.

      For concurrency, you want a language that either has garbage collection, or one that strictly enforces the shared xor mutable rule. Garbage collection means that you can have concurrent mutation with no synchronisation, though you pay a penalty when it comes to actually running the collection. Pony takes the latter route (as does Erlang, though via a degenerate case of having no mutable state other than the process dictionary).

      A modern language should be designed from the ground up with three primary concerns:

      • Security and, in particular, compartmentalisation. It should be easy to take a program and split a part of it into a separate process with limited rights (i.e. all communication between parts of the program must be explicit). Erlang meets this requirement, few other languages do.
      • Error handling must be easy. This is really hard to get right. Common Lisp had some nice models for error handling, but most later languages have been fairly horrible. Maybe types are one mechanism for this, but they're only part of the solution. It should be obvious when reading code in the language that error handling has been omitted and the error-handing paths should be easy to test (because a huge number of bugs end up there if they're not).
      • Concurrency. With modern systems (even cache-coherent SMP systems), this means minimising sharing of mutable data and providing primitives for explicit communication. A few languages (Erlang, Go, and even Rust) manage this to a degree.

      I look forward to someone developing a modern language (I have some sketches of a design, but nothing concrete - hopefully someone with more free time than me will get to it before I do). Aside from these goals, the language should be designed for modern tools (e.g. static analysis should be part of the normal development cycle), should have some form of static elaboration (more in the Bluespec style than C++ templates) and should interface cleanly with legacy code in C/C++ (though should have the option of running this code in a separate process, for security).

      --
      I am TheRaven on Soylent News
    55. Re:You know the old saying... by Tablizer · · Score: 1

      But you seem to be talking about changes in developer behavior and design approach. That complicates the hardware-centric comparison. As far as existing and typical programs (as currently done), C-compiled programs usually beat their competitors.

    56. Re:You know the old saying... by Anonymous Coward · · Score: 0

      No one ever got fired for using C.

      C is what assembly language used to be: very simple and straightforward way of writing system programs. There have been many pushes to replace C with some OO language , but those pushes have never been successful. The truth of the matter is that machine architecture, which is the primary thing that C language deals with, does not follow OO paradigm. OO is very much misused, in my opinion.

  2. Cant we just talk directly instead? by Anonymous Coward · · Score: 5, Funny

    Im just 2 cubicles away from you, sad i read about it here

    1. Re:Cant we just talk directly instead? by __aaclcg7560 · · Score: 1

      Don't feel bad. On the day I was appointed as an assistant lead for a video game title, management decided to kill the title. I didn't find out until I saw a news item posted on an industry gossip website a month later. The QA manager didn't know. No wonder the new build was late.

    2. Re:Cant we just talk directly instead? by Anonymous Coward · · Score: 0

      Im just 2 cubicles away from you, sad i read about it here

      Pics or it didn't happen. The very fact that you're both on slashdot could bode well for a pint discussion.

      Beer summit.

    3. Re:Cant we just talk directly instead? by Anonymous Coward · · Score: 0

      It's the corrosion of human relationships that is the cause for many ills in this world. A shining example of a well oiled workplace can turn into a rust bucket of conflicting interests.

    4. Re:Cant we just talk directly instead? by Anonymous Coward · · Score: 0

      I don't think the OP was trying to undermine you, I think they just wanted to get a wider perspective on things. I mean I could be wrong, but I don't think you should take it personally. Rather, be happy that you prompted some free advertising/open discussion for Rust! (I hope to become a rustacean someday, when I find the time for a personal project)

    5. Re:Cant we just talk directly instead? by Anonymous Coward · · Score: 0

      ...oh, sure, there were the warning signs. The daily free cola and doughnut supply tapered off, then stopped. Next, the kitchen fridge and microwave were gone. Some of the upper management were frantically having closed-door meetings. The next Monday, trying to get in the building, my keycard wouldn't register. Security guard was nice enough to let me get into the building. I got to our suite and found that the place was gutted of all the computers and office furniture. How am I supposed to work in this kind of environment? Apparently, they went out of business over the weekend and just left it up to the employees to spread the word amongst themselves.

    6. Re:Cant we just talk directly instead? by Anonymous Coward · · Score: 0

      Im just 2 cubicles away from you, sad i read about it here

      Lol I just watched a GA at my college rat on a bunch of loud students to the Dean without even asking them to be quiet. Lol the art of communication is lost

  3. Is it practical to keep developing in C? by Anonymous Coward · · Score: 5, Informative

    You should definitely investigate rust. It's very well designed. It has great support to call into C code and C libraries. It compiles fast. The standard library is much more convenient than C/C++. You have complete memory safety by default, without garbage collection. It has great support for safe multithreading. Over time, your speed will increase because you won't be spending weeks tracking a heisenbug due to memory corruption. There is some learning overhead, but it's worth it.

    The biggest issue is that you won't have as big of an ecosystem around rust. You won't find good support for all of the libraries that you might want to use. But those problems aren't insurmountable.

    1. Re:Is it practical to keep developing in C? by Anonymous Coward · · Score: 0

      >It compiles fast.

      That's a total lie. Only JVM languages, Haskell, and C++ compile slower than Rust.

    2. Re:Is it practical to keep developing in C? by Anonymous Coward · · Score: 0

      It's not a total lie. Rust isn't known for compiling fast. But when comparing it C and C++, it's a drastic improvement. C and C++ have header files that can bloat each of your files to possibly millions of lines of code once the preprocessor finishes. Rust has real module support which puts it into an entirely different class of compilation speed. You'll never have to wait 15 minutes for a large code base to compile because you touched a header file.

      Compilation speed is currently a huge focus for the rust development team. They're also currently working on incremental compilation for nice IDE support. The point is, they're not stuck with terrible compilation speed like C and C++.

    3. Re:Is it practical to keep developing in C? by D.McG. · · Score: 1

      You, my friend, need to learn about precompiled headers. If your modules have more than one include statement, you're doing it wrong. Large projects can compile quickly if set up correctly. Also, modern compilers can compile 8 files from a single project in parallel on an I7. I don't know if it's still true, but Visual Studio is / was terrible at this; only compiling single files from multiple projects in parallel. This caused bloat in the solution with multiple projects to get any kind of speed improvement in build times, at the cost of complexity.

    4. Re:Is it practical to keep developing in C? by Anonymous Coward · · Score: 0

      Yeah. precompiled headers are great when you're working on a project in Visual Studio. But as soon as your large team goes off and creates a large complex build systems for a c++ project that compiles on multiple operating systems, it's really hard to continue using precompiled headers. Gcc has support for precompiled headers but it appears almost no one uses it.

      C++ is supposed to have real module support one day. It was going to be in C++14 but it was delayed. Maybe that'll be nice. But knowing C++, it'll end up being a hugely complex beast.

    5. Re: Is it practical to keep developing in C? by TekPolitik · · Score: 1

      This strikes me as a complete answer. If it has good support for calling out to (native) C ( and you have the skills to do that when needed) and does not have the memory blowout of Java, you are losing nothing by basing the project on Rust instead of C.

    6. Re:Is it practical to keep developing in C? by jellomizer · · Score: 1

      It depends, I don't see Rust replacing C any time soon. And if you are trying to do applications of any particular depth, it may not be the best choice. A lot of the extra libraries/crates vie Cargo are not so mature yet, and finding the best one for you needs is really a crapshoot, as well some of them that is available seem rather questionable.
      I expect over time there will be some weeding out the junk and building on and expanding the core libraries.

      Yes you can go alone without using extra libraries, but other than learning how to do it yourself, you are just duplicating work that some one else has done, and probably put a little more time to fix many of its issues.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    7. Re:Is it practical to keep developing in C? by david_thornley · · Score: 1

      The standard library is much more convenient than C/C++.

      C and C++ are two different languages. I was going to ignore it, but you mentioned the standard libraries. Those aren't really similar, except that C90 library facilities are in the C++ standard library.

      How does the Rust standard library compare with the C++ standard library?

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    8. Re:Is it practical to keep developing in C? by TapeCutter · · Score: 1

      compiling single files from multiple projects in parallel

      Yes it still does that, recent versions of visual studio (2013 in my case) run two or more compile/link threads, one sub-project per thread. We had been stuck on 2008 for a long time (due to itanium support) so it confused the hell out of me until I realised what it was doing.I have not noticed any significant speed increase using the threaded compiler, disc speed still appears to be the main determinant of build time.

      I did find I had to explicitly state every sub-project's build order dependencies after visual studio upgraded the project files. With a single thread you can build your libraries first and simply ignore the build order dependencies. I don't understand why the user has to specify build order dependencies in the first place, surely the tool could work it out from the linker dependencies that the user has already defined? Also when opening a large project to make a small change, 'intellisense' is working its arse off in the background and slowing down the GUI response time, so much so that I now prefer notepad for minor changes to the project/solution files.

      Having said that, I still think VS is the best (free and proprietary) IDE for developing C/C++ code on windows. Eclipse is comparable to the free version of VS but you are very likely to find VS is already mandated in a commercial setting. In most places this is simply inertia, ie: there is nothing about Eclipse that is worth the migration/integration effort.

      --
      And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
    9. Re: Is it practical to keep developing in C? by D.McG. · · Score: 1

      Not true, the same header can be compiled on multiple platforms. We're doing it on Mac, iOS, and Android. Our full build time from clean on Mac for our very large project is 90 seconds.

    10. Re:Is it practical to keep developing in C? by TapeCutter · · Score: 1

      [On] a c++ project that compiles on multiple operating systems, it's really hard to continue using precompiled headers

      In practice, not so much...

      #ifdef OS_WINDOWS
      This is where you specify windows eccentricities
      #else
      This is where you specify *nix eccentricities.
      #endif

      --
      And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
    11. Re:Is it practical to keep developing in C? by NotInHere · · Score: 1

      This. The two biggest rust projects rustc and servo don't even compile with stable rust. And both get developed by those who really know rust. Yes, it makes sense to have unstable intrinsics for a compiler, but not even a slower compat mode??

      And the language itself may be guaranteed to be stable, but many many libraries aren't, and lots of the language's features are only available as unstable. It happens that crates break their API, because their devs don't care or don't know.

    12. Re:Is it practical to keep developing in C? by balajeerc · · Score: 1

      You'll never have to wait 15 minutes for a large code base to compile because you touched a header file.

      Then that large code base was written by incompetent people. Using forward declarations wherever possible greatly cuts down compilation time due to touching a header. Or using good design practices such as programming to an interface (where the implementation header won't be included directly in client code and the implementation header is where most of the changes will be happening most of the time).

    13. Re:Is it practical to keep developing in C? by interval1066 · · Score: 1

      I still think VS is the best (free and proprietary) IDE for developing C/C++ code on windows.

      It was written by the same beast that created Windows. Small wonder.

      --
      Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
    14. Re:Is it practical to keep developing in C? by gweihir · · Score: 1

      The biggest issues are actually that it is immature and that it is yet another language attempting to fix bad coders, which is something a language cannot do. Hence it was created for all the wrong reasons and it shows.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    15. Re:Is it practical to keep developing in C? by jannewmarch · · Score: 1

      The Go programming language was invented partly to get rid of hour-long compile times of C/C++ programs. Rob Pile and co know what they are doing - naive solutions don't work with million line programs made up of thousands of files

    16. Re:Is it practical to keep developing in C? by TheRaven64 · · Score: 1
      The total time to parse about 5-10MB of C includes, on a modern machine, is a few tens of milliseconds. It has almost no impact on a modern C program - if you're compiling with optimisation, you'll spend far longer in the optimisers than in the parser.

      C++ is different, because it's not just the parsing, it's also the template instantiation. This is where you burn time. You also lose a lot if you have definitions in the headers where you have generate code, then you'll spend time parsing, more time generating your compiler's intermediate representation, more time optimising it, more time generating code, and then even more time in the linker throwing it away.

      --
      I am TheRaven on Soylent News
    17. Re:Is it practical to keep developing in C? by TemporalBeing · · Score: 1

      You, my friend, need to learn about precompiled headers. If your modules have more than one include statement, you're doing it wrong. Large projects can compile quickly if set up correctly. Also, modern compilers can compile 8 files from a single project in parallel on an I7. I don't know if it's still true, but Visual Studio is / was terrible at this; only compiling single files from multiple projects in parallel. This caused bloat in the solution with multiple projects to get any kind of speed improvement in build times, at the cost of complexity.

      I avoid pre-compiled headers at all cost. They only cause problems with builds, and typically don't save me anything since to correct those problems you have to blow away the pre-compiled headers any way.

      There are different methods of being able to manage the header bloat you mentioned. On method (in C++) is forward declarations - e.g. you don't include any classes, etc; you just forward declare them, which works wonderfully when you keep the implementation out of the headers. The other big method (my favorite) is keeping you headers clean and well separated - including only what you have to and not everything under the sun (e.g no "#include " type stuff).

      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    18. Re:Is it practical to keep developing in C? by luis_a_espinal · · Score: 1

      Yeah. precompiled headers are great when you're working on a project in Visual Studio. But as soon as your large team goes off and creates a large complex build systems for a c++ project that compiles on multiple operating systems, it's really hard to continue using precompiled headers. Gcc has support for precompiled headers but it appears almost no one uses it.

      C++ is supposed to have real module support one day. It was going to be in C++14 but it was delayed. Maybe that'll be nice. But knowing C++, it'll end up being a hugely complex beast.

      This tells me your experience with C/C++ is rather shallow.

    19. Re:Is it practical to keep developing in C? by Anonymous Coward · · Score: 0

      Look, I love Rust as much as the next Rustecean, but it's compile speed isn't really something to brag about or at least until MIR and incremental compilation lands.

    20. Re:Is it practical to keep developing in C? by Nubbywubwub · · Score: 1

      yet another language attempting to fix bad coders, which is something a language cannot do

      Phew, glad to hear it! I'll inform the telcos that they can rewrite their infra from Erlang to PHP, since you've handily disproven the notion of safety benefits that are intrinsic to a language.

    21. Re:Is it practical to keep developing in C? by gweihir · · Score: 1

      In case you do not know it already: You are of these with a far bigger opinion of themselves than they can support by any actual skill and insight.

      Maybe read up on what Erlang is? And why it was created? Here is a hint: You do not have bad coders working on telephone-switch software or your infrastructure comes crashing down on you. What you do, for example, is patching it at run-time without stopping the software. That is what Erlang makes possible. Of course this is orders of magnitude more complicated and risky than normal software-engineering and hence Erlang supports all the domain-specific help it can. But it most decidedly does not attempt to be a language for the incompetent like Rust.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  4. pointers & C by Skewray · · Score: 4, Insightful

    The whole point of C is to be close to the hardware. The hardware has pointers. Why obfuscate?

    1. Re:pointers & C by serviscope_minor · · Score: 4, Informative

      Sigh.

      Rust does have pointers and it is close to the hardware. It has a very similar machine model to C and of course C++. It also has an advanced, modern type system that disappears during compilation which makes large classes of error which are easy in C flat out impossible.

      It's not obfuscation. You're telling the compiler what your intent is and the compiler checks that you're doing what you say.

      To the OP: it might not be a bad idea. Though if you're considering C and Rust, you really ought to have C++ on the table. It's got the same resource footprint as the other two. You can be much less foot-shooty in C++ than C if you use modern style (no loss of efficiency either), and the tooling is much more mature than Rust.

      There's really no reason ever to use C over C++ if you have a C++ compiler available.

      --
      SJW n. One who posts facts.
    2. Re:pointers & C by Anonymous Coward · · Score: 2, Informative

      Obviously C has abstraction to some degree from the hardware, or you'd just use assembly. So you're basically arguing "C has what C has, so why wouldn't you use C?"

      The answer is because there are problems with C, including pointers. If you pass a pointer to a child thread in C, what happens when you write through that pointer in the main thread? You're not required to use locks, and you're not required to remember that you don't own the pointer any more, so it's very easy to make a mistake and use a pointer when you're not supposed to. That's not so in Rust.

      Just like static typing eliminates an entire class of error that you find in dynamic typing, Rust's borrow checker eliminates an entire class of error that you find in other languages. To pretend that there's no reason to look for an alternative to C is pretty ridiculous.

    3. Re:pointers & C by lgw · · Score: 1

      To the OP: it might not be a bad idea. Though if you're considering C and Rust, you really ought to have C++ on the table. It's got the same resource footprint as the other two. You can be much less foot-shooty in C++ than C if you use modern style (no loss of efficiency either), and the tooling is much more mature than Rust.

      There's really no reason ever to use C over C++ if you have a C++ compiler available.

      So many bad books on C++ make this very hard for people to learn. I haven't yet found a good site for explaining why and how to have empty destructors for all but a few carefully-reviewed library classes (this is more than just RAII, or perhaps it's the golden version of it). Heck, it'd be nice to find a good guide to the latest standard, with a bunch of new anti-foot-shooting tools, plus "concepts" to allow much more sane templating for performance.

      Heck, even explaining how to use std::strings and vectors with no performance loss vs C would be a wonderful thing in a "learn C" website or book. 9plus a nudge to switch to hashmaps instead of the old maps) This stuff isn't complicated in practice, and it belongs in introductory works.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    4. Re:pointers & C by Anonymous Coward · · Score: 1

      Rust basically has pointers, but it's modeled in a nicer and safer way. There is a lot to be desired from raw pointers. Memory safety is a huge problem for stability and security. So are dangling pointers and dereferencing null pointers. These are huge maintainability headaches for large C and C++ code bases like Firefox. If they could be modeled in a nice way with zero overhead, it would be a huge win. This is exactly what rust does. It has "Optional" support for nullable pointers, references for non-null pointers, and fat pointers and slices to handle bounds checking. The ownership model on top of it provides excellent protection against dangling pointers and the ability to use multithreading in a fearless and safe way. Rust is a huge win for maintainability and security.

    5. Re:pointers & C by Anonymous Coward · · Score: 0

      You can be much less foot-shooty in C++ than C if you use modern style

      You can also be a lot more foot-shooty in C++.
      I wouldn't recommend anyone to switch to C++, if they transition doesn't come naturally to them it is very likely that they will shoot themselves in the foot.

    6. Re:pointers & C by Darinbob · · Score: 1

      I wish I could have C++, but stuck with C. I don't want the ugly parts of C++, but the simple stuff like slightly better typing, simple non-virtual classes, etc. Most of the people who objected to it are gone now though, so...

    7. Re:pointers & C by Anonymous Coward · · Score: 0

      The whole point of C is to be close to the hardware. The hardware has pointers. Why obfuscate?

      The hardware also uses gotos as it's main control flow mechanism. "Do it like the hardware does" doesn't always make for better code.

    8. Re:pointers & C by Beck_Neard · · Score: 1

      The whole point of assembly is to be close to the hardware. The hardware has registers. Why obfuscate?

      --
      A fool and his hard drive are soon parted.
    9. Re:pointers & C by Anonymous Coward · · Score: 1

      C is much less foot-shooty if you use "modern styles", too.

      The only benefit C++ arguably has over C in terms of avoiding common pitfalls is the STL and automatic destructors. But BSD's queue.h and tree.h provide robust, type-safe implementations of lists and balanced trees. Anything more sophisticated and you usually want to implement it yourself so it integrates closely with your data model--if context-specific optimization didn't matter you'd just stick with a red-black tree and queues. And if you follow a strict RAII pattern in C code, the lack of automatic destructors is much less of a burden.

      What you get with C instead of C++ is priceless--simplicity. Once you go beyond toy programs, C++ projects become very difficult to reason about because of C++'s complex syntax, semantics, infrastructure, and dependencies.

      Actually, the #1 reason not to use C++ is because if using C seems too tedious, then you should really consider using a higher level language altogether. Even if C++ were better than C, there are so many widely available, popular, and easily integrated languages out there with immensely more powerful language constructs that you're missing the forest for the trees by justifying using C++ over C. Use Python or Lua or Scheme and implement any specialized, performance-critical data structures in C (or C++ if you must).

    10. Re:pointers & C by angel'o'sphere · · Score: 1

      Your classes don't need empty constructors, especially if they have nothing to destroy.
      However in most cases a 'base class' should have a virtual destructor!
      If that one is empty depends on the class.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    11. Re:pointers & C by Anonymous Coward · · Score: 0

      empty destructors

      But this gets obvious once you look into the code generated for a class that has (a bunch) of members that have non-trivial destructors. I believe the issue is that people want to code some high level language without caring how it translates to the actual machine code. It is a nice dream, but we know the consequences.

    12. Re:pointers & C by mwvdlee · · Score: 1

      Seems you just want to get rid of the C++ library, which is pretty easy; simply don't use it.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    13. Re:pointers & C by ADRA · · Score: 1

      Hardware has registers / stacks and jumps. Pointers are just too high level...

      --
      Bye!
    14. Re:pointers & C by Anonymous Coward · · Score: 0

      There's really no reason ever to use C over C++ if you have a C++ compiler available.

      Only if you believe that simplicity is something to strive for.

    15. Re:pointers & C by lgw · · Score: 5, Interesting

      The reason for empty destructors is that destructors that actually clean up resources are usually a bad idea. (Debugging-related stuff in destructors is different.) The "allocate in the constructor, clean up in the destructor" pattern was a natural evolution from well-written C code. If you were used to "allocate at the top of the function, clean up at the bottom", it was the obvious better approach. But it's still just as error-prone (just fewer places for errors), and the fact that the destructor doesn't get called if the constructor throws isn't broadly internalized by coders (and is my least-favorite intermittent resource leak to run down).

      Having very small resource-specific classes, similar in functionality to auto_ptr or unique_ptr (just managing a file handle or whatever instead of memory allocation) is the better answer. Only clean up a resource in a class whose only purpose is to clean up a resource. Using those primitives as members in other classes, or as local variables, is as idiot-proof as C++ gets.

      The resource-leak headaches saved by difference in approach is amazing when junior coders are involved, it's really a difference in kind. And it's dead easy to police in code-reviews. The last time I did C++ we had a single, templated class in library code, and nowhere else in the code base was a non-trivial destructor allowed. (Odd cases like adding an object to a global list, and removing it on destruction could be managed within this system.)

      --
      Socialism: a lie told by totalitarians and believed by fools.
    16. Re:pointers & C by Anonymous Coward · · Score: 0

      Where can I get the Obviously C compiler or runtime ? Is Obviously C compatible with LLVM ?

    17. Re:pointers & C by Darinbob · · Score: 1

      I just want the better-C-than-C. The problem is people are worried that once you make a switch to C++ that you're on the slippery slope to bloatware. Which is why C++ is much less common in the embedded systems world.

    18. Re:pointers & C by serviscope_minor · · Score: 3, Informative

      The only benefit C++ arguably has over C in terms of avoiding common pitfalls is the STL and automatic destructors.

      That's like saying the only thing we have better than the 1500s is electricity and internal combustion engines.

      And if you follow a strict RAII pattern in C code, the lack of automatic destructors is much less of a burden.

      But why bother? Do it in C++ and you get the same resource usage but with 1/10 of the typing and 1/10 of the bugs.

      Every line of code you write is a potential bug. In C++ you can program the compiler to write them automatically for you bug free every single time.

      Actually, the #1 reason not to use C++ is because if using C seems too tedious, then you should really consider using a higher level language altogether.

      The lack of resource management makes C very tedious. C++ does it better than many other languages.

      --
      SJW n. One who posts facts.
    19. Re:pointers & C by serviscope_minor · · Score: 1

      The last time I did C++ we had a single, templated class in library code, and nowhere else in the code base was a non-trivial destructor allowed.

      Are you sure? If you aggregate (say) an int with a string in a simple struct, the struct will have an automatically generated non trivial destructor, since it needs it to clean up the string. But you don't, of course, have to write a single line of code to make it work properly.

      --
      SJW n. One who posts facts.
    20. Re:pointers & C by DickBreath · · Score: 1

      Ah, but assembly uses labels as targets of jump and subroutine instructions. And data memory references.

      You should do it like the hardware does. Use numeric memory addresses as targets of instructions that address memory.

      --

      I'll see your senator, and I'll raise you two judges.
    21. Re:pointers & C by lgw · · Score: 1

      To many, the phrase "non-trivial destructor" informally means "no interesting code written in the destructor definition", not the formal meaning in the standard, which is I think what you're talking about? In any case, I was talking about the former.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    22. Re:pointers & C by Win0ver · · Score: 1

      There's really no reason ever to use C over C++ if you have a C++ compiler available.

      Hehehe. Tell that to Linus. ;)

    23. Re:pointers & C by Anonymous Coward · · Score: 0

      The whole point of C is to be close to the hardware. The hardware has pointers. Why obfuscate?

      Most people don't understand pointers. At least that is my experience. This makes people aim towards something where they can avoid pointers rather than figure out what they are actually all about.

      My personal experience regarding learning pointers kind of tells the whole issue, which is lack of proper teachers. I passed several programming courses at the university with decent/good grades and when I was done with all the mandatory ones, I decided to attend C programming course despite (at least one paper) master C/C++. That was the best professor I ever encountered and at some point he gave one lecture on memory management and pointers and that's when I figured out pointers. Looking back, I can't see why they were so hard to learn in the first place.

      Now that I'm in full control of what pointers are doing, I kind of fear what will happen if I use some language with automatic pointers. If I have a class in a scripting langauge and pass the class as an argument, will it be a pointer to the same class or a copy of the class? This loss of complete control has caused me to make more bugs than "pointer magic" ever caused in my C/C++ code.

      In short: learn pointers rather than develop ways to avoid them.

    24. Re:pointers & C by angel'o'sphere · · Score: 1

      The reason for empty destructors is that destructors that actually clean up resources are usually a bad idea.
      There is absolutely no reason for an empty destructor at all, except as I mentioned before as an virtual destructor in the base class of an hierarchy.
      Reason: those destructors are generated by the compiler!

      The reason for empty destructors is that destructors that actually clean up resources are usually a bad idea.
      At some point someone has to write a destructor that actually does some cleaning up: e.g. as in all the library classes you are so fond of using. If the "file abstraction" class there had not a a hand written non trivial destructor, the file handle would not be released, the file not closed ...
      So yes: there are plenty of reasons to have a hand written destructor that actually does something.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    25. Re:pointers & C by HiThere · · Score: 2

      I'd settle for something good on how to use unicode with C OR C++. Saying "use ICU" doesn't help when there's no decent documentation on using ICU. After looking over the C++11 standard carefully, it looks as if it *is* possible to use unicode with C++, but it's still not clear how. Were I already an experienced C++ programmer, perhaps the discussion of facets would make sense. As it is...no. And there don't even seem to be any decent examples.

      Most of the libraries for using unicode aren't sufficient for my needs. I need to be able to determine the general character class of each codepoint. (Actually, I only need the first letter of the general character class.) Every library seems to do this differently, and none do it intelligibly. This was easy in python, and feasible in Java (there were other reasons why those weren't preferred) but doing it in C++ *seems* not to be supported. The documentation says that it actually *is* suported, but how to do it is not obvious.

      In Rust getting the character code is fairly easy, but walking a file directory seems to be unsupported. (Well, I think they supply all the pieces needed to build a directory path walker, but I'm not real sure. I keep ending up on paged marked "experimental" or "deprecated".)

      That said, and if I can work my way past a few problems, Rust looks better than C because it allows owned data to be moved between threads. (Well, I think it does, and does it relatively simply.) C and C++ don't even have the concept of data dynamically becoming immutable. Thread local isn't the concept I'm after, though I need for all mutable data to be thread local...which is easy in Rust and difficult in C and C++. (Yes, I know you can do it. But you need to keep careful track of what needs to be marked thread local.)

      OTOH, I haven't written anything original in Rust yet. I'm still studying to be sure that all the pieces I need are actually present. I haven't yet checked database access, or whether I can actually transfer immutable structs between threads easily, or whether I'll need to Box them, etc. And I'm certainly making no comment on either its compilation speed or its execution speed. (I've only run small test programs that I copied.)

      This got a bit too long, and I'm not THAT experienced with C++, much less Rust, but my current evaluation is that for certain classes of programs Rust is a superior choice, and for other classes C++ is superior.

      P.S.: Rust has just been released at 1.0, and I think prematurely. The absence of a directory walker program (that isn't marked either experimental or deprecated) is on reason why. But it still looks like a very good language for certain classes of program, even though it needs considerable development.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    26. Re:pointers & C by caseih · · Score: 1

      Certainly in the hobby embedded space, dominated by Arduino, C++ is exclusively used. Sometimes it's just C compiled with a C++ compiler, but often basic classes are used. Never the C++ standard library though.

      There are certainly reasons why people eschew C++, some are better than others. The bloat argument is probably one of the poorer arguments.

      Personally I avoid C++ primarily because it's so hard to access C++ classes from other languages without fairly complicated thunk layers.

    27. Re:pointers & C by Anonymous Coward · · Score: 0

      There is an old saying - program in the problem domain not the machine domain.

    28. Re:pointers & C by david_thornley · · Score: 1

      In modern C++, ownership is typically expressed by unique_ptr and shared_ptr. shared_ptr can be a performance issue, but unique_ptr is a raw pointer with functions attached.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    29. Re:pointers & C by lgw · · Score: 1

      so yes: there are plenty of reasons to have a hand written destructor that actually does something

      Yes, but my point is, only do it in a narrow set of carefully-reviewed library primitives. You don't really need very many - various OS "handles" and anything specific to the code base that needs unique handling (can't be built from other primitives, e.g., you're doing slab allocation and have a special "free" action).

      For example, if you have a rich "file" class with many methods, it should have an empty destructor. But it should have as a member a primitive that wraps a FILE or Windows HANDLE object that only knows how to call fclose or CloseHandle.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    30. Re:pointers & C by lgw · · Score: 1

      Oh, I agree completely: Unidoce isn't made easy by C++, and it damn well should be. Especially, I want extremely optimized library code for getting Unicode meta-data about codepoints, and for validation. I'm sure ICU is good and all, but this deserves to be part of the language (with fully-baked support for std::algorithms working codepoint-wise, since std::algorithms has some great stuff hidden inside).

      --
      Socialism: a lie told by totalitarians and believed by fools.
    31. Re:pointers & C by garethjrowlands · · Score: 1

      Congratulations on learning pointers! Welcome to the inner circle of people-who-know-pointers.

      You suggested the following as if it's an either-or:

      > learn pointers rather than develop ways to avoid them.

      But it's not: one can learn pointers *and* develop ways to avoid them - pointers are a bit like GOTO in this respect. On the subject of learning things, have you learned Rust yet? Do you know why you should?

    32. Re:pointers & C by interval1066 · · Score: 1

      C++ adds gives the writer the ability to use virtual methods very easily, you're kind of tying one hand behind your back if you don't use polymorphism, so then you start getting bloat with your virtual tables, which can become quite massive. I don't think C++ is appropriate in many embedded applications.

      --
      Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
    33. Re:pointers & C by Ateocinico · · Score: 3, Informative

      Since C++11 the destructor invocation in case of an exception is guaranteed. http://www.stroustrup.com/bs_f...

    34. Re:pointers & C by As_I_Please · · Score: 1

      The "allocate in the constructor, clean up in the destructor" pattern ... is still just as error-prone (just fewer places for errors), and the fact that the destructor doesn't get called if the constructor throws isn't broadly internalized by coders (and is my least-favorite intermittent resource leak to run down).

      I've come up with my own pattern (probably not original) for dealing with throwing constructors and I've been wondering if it's effective. Basically, write a separate cleanup() method that gets called by the destructor and the catch() block of a constructor:

      Foo::Foo()
      {
          try
          { // ... do stuff and acquire resources
          }
          catch(...)
          {
              cleanup();
              throw; // to prevent Foo instance from being used
          }
      }

      Foo::~Foo()
      {
          cleanup()
      }

      Foo::cleanup()
      { // release any acquired resources
      }

    35. Re:pointers & C by ZeroConcept · · Score: 1

      That is entirely correct, in Windows OS resources need to be wrapped in classes that are guaranteed to properly release an acquired resource at time of destruction regardless of context (stack or heap).
      Otherwise you leak OS resources and WILL freeze the box after you exceed the maximum handle limit.

    36. Re:pointers & C by Spazmania · · Score: 1

      ought to have C++ on the table. It's got the same resource footprint as the other two.

      If you think C++, when used for more than "C with classes," has the same resource footprint as C, you don't understand either language very well.

      --
      Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
    37. Re:pointers & C by gweihir · · Score: 1

      There's really no reason ever to use C over C++ if you have a C++ compiler available.

      You must be one of these "modern" coders that never have heard of simplicity or all the problems still C++ has. I do not think taking advice from you is wise.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    38. Re:pointers & C by Anonymous Coward · · Score: 0

      There's really no reason ever to use C over C++ if you have a C++ compiler available.

      Code inspection is a very good reason. What exactly does this do in C++?

      FooInstance_A = FooInstance_B;

      In order to know what it does you have to comb through the header files and hope that the original programmer commented all the side-effects of the copy constructor. You might even have to read the implementation, browsing up the class hierarchy until you find the copy constructor (which may or may not be inherited).

      I can tell you what that does in C; it implements a bitwise copy.

      You're very stupidly underestimating the value of visual inspections: you can't very well reason about code if every second line has invisible side-effects.

      You are what we old-timers call 'write-only programmers'... You choose the easiest path when writing code. Since you're too young to have read much code written by others you don't value readability and simplicity.

      It's easy to write C++. It's difficult to reason about C++ code that you are reading for the first time. The position you take is not uncommon amongst programmers who have never had to debug someone else's code.

    39. Re:pointers & C by serviscope_minor · · Score: 1

      Er, yes, I was referring to the formal meaning. That's excellent, of course. I'm a fan of getting the compiler to write all the boilerplate for me. I tend to write code like that: it has the feel of simple code with lots of structs, but the compiler takes care of all the annoying bits.

      --
      SJW n. One who posts facts.
    40. Re:pointers & C by serviscope_minor · · Score: 2

      C++ adds gives the writer the ability to use virtual methods very easily, you're kind of tying one hand behind your back if you don't use polymorphism

      That's one of the easier things in C: just put a function pointer in the class, one function pointer for each method. Of course then you need a whole vTable per class, where as C++ has a single pointer to the vTable and then one copy of the vtable. The idiomatic C way is much more bloated.

      so then you start getting bloat with your virtual tables, which can become quite massive.

      Not a problem I've ever had, but I'm not a fan of deriving everything from everything else as was popular at one time. My code has very few virtual methods.

      I don't think C++ is appropriate in many embedded applications.

      Name one. It runs just fine on an ATTiny. Doesn't get much smaller than that.

      --
      SJW n. One who posts facts.
    41. Re:pointers & C by serviscope_minor · · Score: 1

      You must be one of these "modern" coders that never have heard of simplicity or all the problems still C++ has. I do not think taking advice from you is wise.

      I'd prefer that the C++ compiler developers cram all the complexity into one place (the compiler) rather than me having to spread it out over every single program I write. With my way, the very smart compiler writers do the complex stuff, and I get to write nice, simple clear code.

      But good ad-hom.

      The stuff I write on now has less RAM than the BBC micro I grew up with.

      --
      SJW n. One who posts facts.
    42. Re:pointers & C by Anonymous Coward · · Score: 0

      That's retarded. Do you even know how to use C??

      You set a pointer in your structure to a single instance of a struct which contains pointers to functions. That is the idiomatic way to do polymorphism in C.

    43. Re:pointers & C by serviscope_minor · · Score: 1

      If you think C++, when used for more than "C with classes," has the same resource footprint as C, you don't understand either language very well.

      Clearly I understand them better than you because I know you're talking out of your arse.

      If you think templates hog more resources than macros, you don't understand templates.

      If you thing operator overloading hogs resources, you don't understand operator overloading.

      If you think virtual functions hog more resoures than function pointers, you don't understand virtual functions.

      If you think lambdas hog more resources than a simple struct, then you don't understand lambdas.

      If you think std::sort is worse than qsort() then you are blatantly ignoring almost every behcnmark on the subject matter.

      If you thing you can beat std::priority queue backed by a static array, then either you're a guru level expert or you don't understand the STL at all.

      And so on and so forth.

      --
      SJW n. One who posts facts.
    44. Re:pointers & C by serviscope_minor · · Score: 1

      Code inspection is a very good reason. What exactly does this do in C++?

      Oh, not this idiotic comment again.

      Tell me, what does the following do in C:

      do_copy(foo_a, foo_b);

      In order to know what it does you have to comb through the header files and hope that the original programmer commented all the side-effects of the function. You might even have to read the implementation, browsing up the file hierarchy until you find the function.

      = in C++ means operator=(A, B).

      That's all. It's just a function with a funny name. If you don't know that then you don't know C++. No language prevents you from creating deceptively named functions where do_copy() does something stupid, e.g. modifies some global state and switches the computer off.

      --
      SJW n. One who posts facts.
    45. Re:pointers & C by TemporalBeing · · Score: 1

      There's really no reason ever to use C over C++ if you have a C++ compiler available

      Well, unless your bootstrapping an OS. C is the easiest language to move to from Assembly as there are zero things to setup to move into C. You can move into C++, but then you have to be extremely careful of new/delete support - which has to get setup almost immediately if you did not before you moved into C++ land. This is why most embedded and kernel stuff only uses C as even C++ adds enough bloat due to those supports that when every byte counts it's just not useful. I expect Rust would be more like C++ in that respect.

      So as always, it's depends on what you do. In most cases, it probably won't make a difference. But there are some vital cases out there - especially in the embedded world - that the small differences have huge impacts.

      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    46. Re:pointers & C by Anonymous Coward · · Score: 0

      foot-shooty

      The parent is NOT Kenny Loggins approved....

    47. Re:pointers & C by TemporalBeing · · Score: 1

      But it's still just as error-prone (just fewer places for errors), and the fact that the destructor doesn't get called if the constructor throws isn't broadly internalized by coders (and is my least-favorite intermittent resource leak to run down).

      Well, there is another (better) solution - stop using Exceptions! They cause more headaches than anything else, including leaving programs in unrecoverable states.

      I know, I know - everyone loves Exceptions. But in all honestly, they should never be used. Functions/ClassMethods/etc should all be explicit in their error handling, and errors should always be handled as close to what generated the error as possible. This one little thing saves all of the headaches of trying to track down bad pointers, incorrect states, etc - e.g 99% of what people complain about in C and C++ code.

      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    48. Re:pointers & C by TemporalBeing · · Score: 2

      The only benefit C++ arguably has over C in terms of avoiding common pitfalls is the STL and automatic destructors.

      I probably do more C and than C++ when writing C++ code. I typically use C++ classes (abstract, etc), namespaces, and (now) STL. This just helps with segregating the code into their logical parts so structure X doesn't get used on functions only meant to manage structure Y or data type Z.

      new/delete? Well, I'll use them for classes only. Structures get allocated with malloc/free. Yes, a class is only use for data+functions and structures are only used for pure data; allocation patterns follow this same methodology which enables easy transition between pure C and C/C++ code when necessary. If a class allocates data, then I also provide an API in the class (typically instance agnostic) to clean it up to ensure that there is one-place that cleans it up, ensuring that the same allocator/destructor methods are used.

      I also stay away from streams when I have a choice, and prefer C-style printf/scanf processing.

      So there are useful bits in C++; you just have to find the right balance. Doing so makes for very easy to maintain code.

      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    49. Re:pointers & C by JesseMcDonald · · Score: 1

      The difference is overloading—not operator overloading, just overloading in general. In C there can only be one function named do_copy() in the entire program. In C++, whether we're talking about do_copy() or operator=(), there can be many, and you can't know which one will be called without knowing the types involved, and in many cases the conversion rules which the compiler will apply; some of these rules can even be user-defined.

      In some ways the do_copy() case is worse, since there are at least some semi-formal conventions regarding the implementation of operator=(). Your program could link against two libraries which both provide an implementation of do_copy(), with little in common besides the name.

      Other languages (e.g. Haskell) tend to solve this by requiring names to be unique within a given scope. Overloading is handled by making the name part of a polymorphic interface, with one of many available implementations is selected according to the type parameter(s). The interface represents a contract which the implementers are expected to follow, so that users of the interface can reason about the parameters, results, and side-effects in a generic way without worrying about the implementation details for whichever specific type is in use.

      --
      "The state is that great fiction by which everyone tries to live at the expense of everyone else." - Bastiat
    50. Re:pointers & C by Grishnakh · · Score: 1

      Use the Qt toolkit (with C++); it handles Unicode just fine.

    51. Re:pointers & C by serviscope_minor · · Score: 1

      You can move into C++, but then you have to be extremely careful of new/delete support

      How much more careful do you have to be of new/delete support than malloc/free support?

      Not much I'll wager.

      And it's not like you have to support it. None of my Atmel code uses new or delete. Static allocation all the way.

      This is why most embedded and kernel stuff only uses C as even C++ adds enough bloat due to those supports that when every byte counts it's just not useful.

      C++ does not add bloat. That's an old, false meme which needs to die.

      --
      SJW n. One who posts facts.
    52. Re:pointers & C by Grishnakh · · Score: 1

      It's always wrong to use gotos. So if the hardware is using gotos, you just shouldn't use the hardware....

    53. Re:pointers & C by HiThere · · Score: 1

      We've got a different definition of "just fine", but I admit that Qt handling of unicode is much better documented, and can be made to do the job.

      Of course unicode inherently has a problem because this idea of a single character doesn't map to codepoint...but Java, Python, Ruby (with a library), and D, at least, can handle the job. The language that I actually prefer is D, but it's lacking support for most libraries. E.g., to use SQLite one needs to use a very thin wrapper around the C header files. Java, Python, and Ruby lack even the concept of structs, however, and I want to directly read/write a struct to a binary file. In all of them there are ways to do this, but those ways are nearly as clumsy as the way unicode is handled in C. Rust appears to have the potential to handle all of this gracefully, and a large enough support team to quickly bring libraries on board. I just don't feel it's there yet, despite the current release being labeled 1.0. (They did say, however, as a part of the release announcement that what this meant was that now the language interface was stabilized I can sort of see why a language designer might designate that as 1.0, but as someone who is a user rather than a designer of languages that seems premature before the standard libraries are stabilized.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    54. Re:pointers & C by angel'o'sphere · · Score: 1

      Sigh, now for the third time: no, you do not need an empty destructor!
      Either you write a non empty destructor you write none at all, the compiler generates one automatically for you!

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    55. Re:pointers & C by lgw · · Score: 1

      You've seem to have missed my point.

      My point is that non-empty destructors are an error-prone, repetitive, boilerplate process that you can just stop doing (aside from a small bit of library code). Your code will, as a result, be shorter and more clear, and stop leaking resources, even when junior coders are involved.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    56. Re:pointers & C by TemporalBeing · · Score: 1

      You can move into C++, but then you have to be extremely careful of new/delete support

      How much more careful do you have to be of new/delete support than malloc/free support?

      Not much I'll wager.

      You actually have to completely avoid it until you setup the functions necessary to support it. It's been a while since I've looked at doing it, but it's non-trivial, as is much functionality at that early boot stage.

      And it's not like you have to support it. None of my Atmel code uses new or delete. Static allocation all the way.

      This is why most embedded and kernel stuff only uses C as even C++ adds enough bloat due to those supports that when every byte counts it's just not useful.

      C++ does not add bloat. That's an old, false meme which needs to die.

      True, you can avoid stuff by following best practices for embedded and using pure stack allocation. But that only goes so far. You can also run into issues with Exceptions. For instance http://wiki.osdev.org/Bare_Bon... documents several issues.

      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    57. Re:pointers & C by flargleblarg · · Score: 1

      In C there can only be one function named do_copy() in the entire program.

      Obviously you don't know C.

      If you declare do_copy() as static, you can have as many as you like -- one per compilation unit.

    58. Re:pointers & C by khellendros1984 · · Score: 1

      Loop constructs and jump tables are just syntactic sugar on top of gotos. Function calls are just gotos with side effects (and we all know, if there's one thing worse than goto, it's unrelated side effects!). Clearly we just need to ditch the whole operational model and start over from scratch with CPUs that natively support modern programming practices.

      --
      It is pitch black. You are likely to be eaten by a grue.
    59. Re:pointers & C by Chibi+Merrow · · Score: 1

      In C there can only be one function named do_copy() in the entire program.

      And that is objectively awful.

      --
      Maxim: People cannot follow directions.
      Increases in truth directly with the length of time spent explaining them
    60. Re:pointers & C by angel'o'sphere · · Score: 1

      No, I did not miss your point.

      Our small discussion started 3 or 4 posts back, with your words "I wished one would explain clearly, for what empty destructors are needed".

      I explained now three times: not at all.

      That you as an "application developer" like to use libraries that free you from the burdon to have "non empty" destructors is another topic and clearly understandable :D

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    61. Re:pointers & C by JesseMcDonald · · Score: 1

      Actually, I write C code every day for my job (embedded software for avionics) and have for the last ten years. My overall experience with C is roughly twice that. But obviously I "don't know C". Or perhaps I just abused the term "program" as shorthand for "compilation unit". In any case there is never more than one function of a given name in scope, which is the important part.

      --
      "The state is that great fiction by which everyone tries to live at the expense of everyone else." - Bastiat
    62. Re:pointers & C by JesseMcDonald · · Score: 1

      In C there can only be one function named do_copy() in the entire program.

      And that is objectively awful.

      It causes problems, sure. Either your names become unreasonably long or you risk link errors (or worse) due to name conflicts. I'm not holding C up as some kind of perfect language here, just pointing out that C++'s approach to overloading creates ambiguity. I mentioned Haskell, which has a reasonable module system. Even C++ supports namespaces, and "C with namespaces" would be fine (provided one omitted C++'s "argument-dependent lookup" rules). The problem is the ability to define multiple unrelated functions with the same name in the same scope, distinguished only by the argument type(s).

      --
      "The state is that great fiction by which everyone tries to live at the expense of everyone else." - Bastiat
    63. Re:pointers & C by Anonymous Coward · · Score: 0

      The whole point of C is to be close to the hardware. The hardware has pointers. Why obfuscate?

      Well successive layers of abstraction make it easier to write the code and Marvels Agents of Shield is on Tuesdays a 9pm!

    64. Re:pointers & C by Nubbywubwub · · Score: 1

      walking a file directory seems to be unsupported

      Here's a lovely lib for that that has a good chance of appearing in the standard lib someday: https://crates.io/crates/walkd...

    65. Re:pointers & C by Anonymous Coward · · Score: 0

      Or if you want your code to be easy to understand, debug and maintain. C++ adds a lot of features compared to C, but I've hardly ever come accross a use of one of those features that made the code easier to understand than the plain C alternative would be. Simplicity is important, especially when what the code does is already complex enough. There is no need for the language to add additional complexity.

    66. Re:pointers & C by Anonymous Coward · · Score: 0

      The only way to write "nice, simple clear code" in C++ is by writing code that is essentially plain C.

    67. Re:pointers & C by Anonymous Coward · · Score: 0

      Good idea, but that option is rarely available. Usually, one can choose between the machine domain and the computer science hypothetical universe domain. I'll take the former over the latter any day. It's easier to write, easier to read and it often performs better in the real world.

    68. Re:pointers & C by Anonymous Coward · · Score: 0

      (wandering further off-topic, but triggered by "informative" tag for uninformative post)

      Since C++11 the destructor invocation in case of an exception is guaranteed.

      If this was a response to

      and the fact that the destructor doesn't get called if the constructor throws

      then it is not true.

      See the answers to http://stackoverflow.com/questions/14386840/destructor-called-after-throwing-from-a-constructor

    69. Re:pointers & C by Anonymous Coward · · Score: 0

      Since C++11 the destructor invocation in case of an exception is guaranteed.

      Um... no. See http://stackoverflow.com/questions/14386840/destructor-called-after-throwing-from-a-constructor

    70. Re:pointers & C by Spazmania · · Score: 1

      About half of that is correct. That you don't know which half makes my point for me.

      --
      Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
  5. It's not already rusted? by bluefoxlucid · · Score: 3, Funny

    C is pretty rusty.

    1. Re:It's not already rusted? by gstoddart · · Score: 5, Funny

      One might say 'crusty'.

      --
      Lost at C:>. Found at C.
    2. Re:It's not already rusted? by YellowElf · · Score: 1

      I wish I could upvote you.

      --
      Insert witty saying or aphorism here.
    3. Re:It's not already rusted? by Dog-Cow · · Score: 1

      Or busty. Wait, that would be D(D?).

    4. Re:It's not already rusted? by Anonymous Coward · · Score: 0

      I know it;s already rated 5 but that was brilliant.

    5. Re:It's not already rusted? by Anonymous Coward · · Score: 0

      Hey! Hey Kids!! Hua hua hua hua hua hua hua

  6. No. by Anonymous Coward · · Score: 2, Informative

    No.

    1. Re:No. by phantomfive · · Score: 2, Insightful

      Rust has been developed by Mozilla for a specific problem they have, and their specific coding style. As far as I can tell it, works well for them and is a fine language.

      Unfortunately, it's still in the "growing" stage of languages, and may never make it out of Mozilla world, and Mozilla themselves might even drop support, which means you're in trouble.

      When you're choosing a language, you have to look at the entire ecosystem surrounding the language. It's not enough to look only at the language itself.

      --
      "First they came for the slanderers and i said nothing."
    2. Re:No. by DuckDodgers · · Score: 1

      With that attitude, we'd all be using Fortran, Cobol, Lisp (okay, I like that idea) and Pascal instead of the newfangled stuff.

      If you have to sell some relatively obscure language to a big team, or to a corporation or whatever, then yes I agree with you - go with the tried and true (even if it's also painful and tedious) unless you have a hell of a specific killer feature as a reason for using the new tool instead of the old one.

      But for smaller side projects, personal projects, experimenting - why not?

    3. Re:No. by ClickOnThis · · Score: 2, Interesting

      No one expects an obscure new language to gain mind-share without a good reason.

      There is one crucial element to a new language gaining support: expressive power. Does it let you to express the solution to a problem in a better way than others?

      Actually, there are two elements: expressive power and viable cross-platform support. Compilers and/or interpreters must perform well and be available for all platforms that matter.

      Well, really there are three elements ... uh ...

      I'll come in again.

      --
      If it weren't for deadlines, nothing would be late.
    4. Re:No. by phantomfive · · Score: 1

      With that attitude, we'd all be using Fortran, Cobol, Lisp (okay, I like that idea) and Pascal instead of the newfangled stuff.

      There are some big projects already using Rust. If it works out for them, then great. Otherwise, I don't want to rewrite all my stuff when language support is dropped.

      --
      "First they came for the slanderers and i said nothing."
    5. Re:No. by NotInHere · · Score: 1

      Rust does have search results, but rust had a really unstable past, if a search result is before stabilisation with 1.0, its usually deprecated. And most results are from that time. But since stabilisation things got better, at least I hope, and everybody says. Just ask your question anew, people are usually very helpful.

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

      Maybe this is what we should indeed do. Just relying on Pascal (and his variations, with Pascal Object) would probably have been sufficient for all my needs. Sadly, Delphi has died, the Linux port was a total failure, and the opensource alternative (Lazarus IIRC) never gain enough attention.

      So since 10 years I have switched to Java, .Net and other horrors.

    7. Re:No. by DuckDodgers · · Score: 1

      Thanks for the laugh. I do think Rust has those features.

    8. Re:No. by DuckDodgers · · Score: 1

      It's open source under the MPL license, so unless there's some serious bitrot you should be safe to keep using the last stable release for a very long time.

    9. Re:No. by phantomfive · · Score: 1

      bitrot happens.

      --
      "First they came for the slanderers and i said nothing."
    10. Re:No. by Nubbywubwub · · Score: 1

      Rust is dual-licensed under Apache 2/MIT, not MPL.

  7. Just learn it via experience. by Anonymous Coward · · Score: 0

    Just learn some practical Rust, then make your choice. I mean, it's hardly difficult. The Rust community is a great one, and the language itself can (when utilized properly) save you a lot of development effort. It has for me in my smaller projects, and my confidence in it is growing on an almost daily basis. In fact if more of my team would get the sticks out of their hindquarters and learn a more modern language, we wouldn't have to bitch so much about C. Someone has to buck that trend or you'll just be a bunch of old farts stuck in perpetual snark limbo, while people who know better languages will enjoy their time more.

  8. Depends by Anonymous Coward · · Score: 0

    If there is lots of concurrency going on in the component try Rust, since it was built from the group up with that in mind. If not stick with the tried and true C.

  9. kids these days... by Anonymous Coward · · Score: 4, Insightful

    They don't like C because they haven't been taught it properly and instead go for things that are just trying to re-invent the wheel. Tell this guy to STFU, read a copy of the K&R book, and then get back to work using the native language of *nix.

    1. Re:kids these days... by fahrbot-bot · · Score: 4, Insightful

      They don't like C because they haven't been taught it properly and instead go for things that are just trying to re-invent the wheel.

      ... and C is hard and makes you have to think and stuff.

      --
      It must have been something you assimilated. . . .
    2. Re:kids these days... by superwiz · · Score: 1

      K&R leaves a lot to imagination when it comes to describing C. Even if you are living back in the 90's, you won't be proficient in C until you've read "C: A Reference Manual" by Harrison & Steele.

      --
      Any guest worker system is indistinguishable from indentured servitude.
    3. Re:kids these days... by Beck_Neard · · Score: 0

      Has anyone ever been 'taught C properly'? Look at the code from the 'good ole days' of unix that you probably masturbate to... the code is terrible. I mean just flat out horrible. And K&R openly endorses obfuscatory and insane coding practices. Throw it in the trash bin and read stuff that will actually make you a better programmer, like Knuth or Sussman.

      You're probably someone who considers themselves and 'old school hacker' and have been out of a programming job for twenty years. Things have changed, dude.

      --
      A fool and his hard drive are soon parted.
    4. Re:kids these days... by phantomfive · · Score: 1

      Specifically, K&R doesn't really teach you how to deal with memory leaks. It's good for learning the language, and one of my favorite programming books, but it's also an introduction, not a complete tutorial.

      --
      "First they came for the slanderers and i said nothing."
    5. Re:kids these days... by Austerity+Empowers · · Score: 1

      You're probably someone who considers themselves and 'old school hacker' and have been out of a programming job for twenty years

      Or he's doing a different job than you. I've got a pile of C code I'm staring at now, which is going in to active products that ship in the tens of millions. I have both never been unemployed longer than I wanted to be, nor had any issues selling my "dinosaur" C skills. I've never worked anywhere that C skills aren't a job requirement, nor that replacing C would get you anything but a funny look, it's solving a problem we don't have.

      C isn't going anywhere, it's a perfectly safe choice. It may not be the optimal choice for all situations. Smart people don't put one tool in their toolbox and call themselves an expert, they learn how to use a small but complementary set of tools really well, and then experiment with some new ones here and there but leave them on the wall for that niche situation that needs them. C is a hammer, you should always have a hammer in your toolbox. Most problems can be made to look like nails, with the proper combination of desperation and alcohol.

    6. Re:kids these days... by Anonymous Coward · · Score: 0

      It's hard and makes you think and literally no one gets it right and the internet is a roiling vortex of shit because of that fact. But go on believing that you're the special one who doesn't fuck it up, just "the kids" who don't want to work hard.

    7. Re:kids these days... by Beck_Neard · · Score: 1

      More power to you, but AC's tone was quite different.

      --
      A fool and his hard drive are soon parted.
    8. Re:kids these days... by LynnwoodRooster · · Score: 0

      K&R tells you to match a free() with every malloc(). Do so - no memory leaks. Yes, K&R doesn't teach you how to debug your code - it teaches you how to avoid the bug in the first place.

      --
      Browsing at +1 - no ACs, I ignore their posts. So refreshing!
    9. Re:kids these days... by fahrbot-bot · · Score: 1

      It's hard and makes you think and literally no one gets it right and the internet is a roiling vortex of shit because of that fact. But go on believing that you're the special one who doesn't fuck it up, just "the kids" who don't want to work hard.

      Right, because no piece of software can ever be changed once delivered and/or in service.

      --
      It must have been something you assimilated. . . .
    10. Re:kids these days... by Anonymous Coward · · Score: 0

      You're probably someone who considers themselves and 'old school hacker' and have been out of a programming job for twenty years. Things have changed, dude.

      Yes and no. I've been doing this stuff professionally since 1988. My current employer has a few million lines of C and it's not going away for a while. We have some Java/Spring stuff and even tried to use it to replace our core systems for a few markets. Unfortunately, it's slower, more resource hungry, and requires a lot more baby sitting by the on-call staff. So, they're getting replaced by the C systems. :D Yes, it's boring, old, and doesn't have the frameworks or libraries named after random things like Java, but it works. We're also going to be ripping more of the Java stuff out and replacing it with C++. The support staff won't have to tell the users to wait 3-5 minutes while all the bloody jars are getting loaded up by apache when something has a problem and needs to be restarted.

    11. Re:kids these days... by pr0nbot · · Score: 1

      Why do you draw the line at C rather than at assembler, or at Rust?

      I'm quite happy programming in C, but to declare that some moment in the 1970s was the pinnacle of programming language design seems somewhat... Amish.

    12. Re:kids these days... by Eythian · · Score: 1

      "We can fix it later" is no excuse for delivering shit to start with.

    13. Re:kids these days... by Eythian · · Score: 2

      Rust is probably harder to get to grips with then C. The difference is that when you screw up in rust, it usually yells at you. When you screw up in C, it blithely goes on doing what it thinks you want.

    14. Re:kids these days... by Anonymous Coward · · Score: 0

      C is not a perfect nor the greatest language.

      1. Header files and preprocessor. WTF? That's a 1972 solution to a 1960's problem.
      2. Awful declaration syntax. Google the c spiral rule to see what I mean. const int * Constant2 and int const * Constant are the same. WTF?

      That being said, C is still a great language.

    15. Re:kids these days... by Eythian · · Score: 1

      Attitudes like this is a large part of what causes us to need a security industry.

      You are part of the problem.

    16. Re:kids these days... by Anonymous Coward · · Score: 0

      ... and C is hard and makes you have to think and stuff.

      If by stuff you mean "turn of your brain and write down boilerplate after boilerplate" then yes I find it hard to write. Just look at qsort, in any other language the standard sort function knows how to sort any array of int - C went the way of type erasure ( see Java ) without having a sane way to pass along basic information like the size of an array ( its just a pointer to some memory anyway ) or the size of an element ( computers use bytes ).

    17. Re:kids these days... by TapeCutter · · Score: 1

      You're probably someone who considers themselves and 'old school hacker' and have been out of a programming job for twenty years. Things have changed, dude.

      I'm not the GP but I have been coding in C/C++ for a living for the past 25yrs, I even spent a couple of years teaching it to CS undergrads. IMO K&R is every bit as elegant an informative as Knuth, with the added advantage that the examples are in a real code rather than pseudo-code, the shell sort example is still one of the best examples of beautifully simple code I have ever seen. Swallow your pride, retrieve the book from the trash and take another look, virtually every example has all the good bits of modern OO design, before the term "OO design" was even invented.

      In short you sound like a freshly minted "hacker" that has never seen the inside of a commercial software house.

      --
      And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
    18. Re:kids these days... by Anonymous Coward · · Score: 0

      K&R has outdated syntax and some of it has been deprecated for a quarter of a century.
      I would try to recommend a better reference, but to be honest I haven't found one that doesn't make them have problems with pointers later on.
      They should probably start with some assembly. Never encountered someone that started with assembly that had problems with pointers.

    19. Re:kids these days... by Anonymous Coward · · Score: 0

      Wow, so that's what I was doing wrong all the time. It was just as simple as freeing memory after allocating it.
      So the strategy to avoid memory leaks is to avoid memory leaks

    20. Re:kids these days... by T.E.D. · · Score: 1

      Tell this guy to STFU, read a copy of the K&R book

      In what universe is that a good idea? It has been about 20 years since I last encountered a C compiler that used the K&R variety of the language. Even C fans realized early on that version of the language was utterly shitty.

      This must be from someone who feels like you haven't lived until you've tracked down a runtime bug due to a routine spec not being available when used, thus silently assumed to be returning int with all parameters int, and then silently casting the float parameters in and out of int accordingly (but treated as float inside the implementation of the routine).

      The various versions of ANSI C were created for a reason. They were attempts to bash into some reasonable kind of shape a language that, even its own designers admitted (when asked by the DoD as part of the Tinman effort), was unsuitable for serious software development.

    21. Re:kids these days... by TemporalBeing · · Score: 1

      K&R tells you to match a free() with every malloc(). Do so - no memory leaks. Yes, K&R doesn't teach you how to debug your code - it teaches you how to avoid the bug in the first place.

      Mod parent up.

      One of my first programmer reads was Elements of C by Morton H. Lewin (1986) which covered K&R C. I read it in 2004. It made me realize just how much C I actually do (I learned C/C++). even when doing C++. And yes, simple things like matching every malloc() call with an equivalent free() call is some of the essentials of programming without memory leaks.

      Though in the C++ world if you're using a parenting model like Qt does, then the delete matching the new is usually (except in special well documented and obvious cases) handled by the parenting model - e.g. all objects have a parent; on destruction of an object, it automatically cleans up all its children; you have to clean up the ones that don't have parents, most of which can be managed by allocating them on the stack. While I'm sure you can figure out a similar approach in C, I'm not sure their is really any framework that does that in C.

      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    22. Re:kids these days... by Anonymous Coward · · Score: 0

      it blithely goes on doing WHAT YOU TOLD IT

      so either figure out how to say what you want to say, or use java

  10. Why not have the best of both worlds? by Anonymous Coward · · Score: 0

    Announcing my new language, Crust.

  11. Community Support by freak0fnature · · Score: 5, Insightful

    Where I am they chose SpineJS a few years ago, looked like a great language, easy, etc. After a few years, one thing we noticed was the lack of online help when you run into issues. It's just not that widely used. Rust is ranked 49th on Tiobe. Maybe it will be the next best thing, but if it isn't, you'll be stuck with something that has little community support.

    1. Re:Community Support by Anonymous Coward · · Score: 0

      He was responding with a similar overall scenario but you're far to pretentious and above everyone to have seen that I suppose.

    2. Re:Community Support by shaitand · · Score: 1

      The problem he is pointing out isn't js specific.

      If languages have poor adoption and support you have to reinvent every wheel.

    3. Re:Community Support by RelaxedTension · · Score: 1

      Actually you're the idiot for completely missing the context of what he was referring to. He is drawing an analogy to the situation, not making a suggestion for that language.

    4. Re:Community Support by dmoen · · Score: 4, Informative

      The SpineJS repository has 4 contributors. The Rust/Lang repository has 1,188 contributors. (on github)

      --
      I have written a truly remarkable program which this sig is too small to contain.
    5. Re:Community Support by Anonymous Coward · · Score: 0

      The difference is that the Rust community is very accommodating and helpful; one of the nicest communities I've met when it comes to questions about their language. Even their SubReddit is a genuinely pleasant and helpful place, and that's saying a lot.

    6. Re:Community Support by Anonymous Coward · · Score: 0

      You're an idiot if you think that was the point. You're also an ass.

    7. Re:Community Support by Anonymous Coward · · Score: 0

      A good metric of the adoption of a software language is, printed books (not ebooks, but real paper printed ones - and not the Amazon "fake" monocromatic print-on-request ones).

      Just check how many printed titles exist for what you want to adopt, and compare.

      That will give you a very good picture of the actual community size (because editors will not print books that have no audience).

  12. It's not the language itself... by DrTJ · · Score: 5, Insightful

    ... that determines its success or not in a non-nieche segment.

    It's the mass of developers that already know it, it's the accumulated code base (both locally and globally) and most importantly: the eco system of tools surrounding it: the compilers, the IDEs, the debuggers, the static/dynamic code analysis, build systems, code generators, mock tools, coverage tools etc.

    The new kids on the block have a lot of catching up to do in areas which are not directly language related.

  13. New by ardmhacha · · Score: 1

    According to wikipedia
    https://en.wikipedia.org/wiki/...
    "Rust 1.0, the first stable release, was released on May 15, 2015."

    So it's five months old.

    1. Re:New by Anonymous Coward · · Score: 0

      Yet it is already shows signs of rust? That's not promising - all my cars have gone far longer than that before the first signs of rust appeared.

    2. Re:New by Anonymous Coward · · Score: 1

      That's not promising - all my cars have gone far longer than that before the first signs of rust appeared.

      Before you recommend Lisp, how far have your cdrs gone?

    3. Re:New by Anonymous Coward · · Score: 0

      It's already showing signs of dead. It's stillborn, sorry, but the rushed C-section saved the mother.

    4. Re:New by Anonymous Coward · · Score: 0

      Just as far, obviously; car/cdr symmetry is a basic principle of atomic physics.

    5. Re:New by HiThere · · Score: 1

      As languages go, that's right out of the door. And I think they rushed the 1.0 release, because the standard libraries have some unpleasant holes...and not entirely in the documentation.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    6. Re:New by Anonymous Coward · · Score: 0

      That's really not how version numbers work. Having said that, this is from the project FAQ:

      Is any part of this thing production-ready?
      No. Feel free to play around, but don't expect completeness or stability yet. Expect incompleteness and breakage.

  14. Portability by Locke2005 · · Score: 3, Interesting

    If you're ever going to be porting it to another platform, then do it in C; there are C compilers available for almost every piece of hardware out there. If you're certain it only needs to run on a single, unchanging platform for the lifetime of the code, then using Rust might be a good idea.

    --
    I've abandoned my search for truth; now I'm just looking for some useful delusions.
    1. Re:Portability by Trepidity · · Score: 2

      Yeah, for now this is one of the bigger drawbacks. The officially supported platforms are:

      Windows (7, 8, Server 2008 R2)

      Linux (2.6.18 or later, various distributions), x86 and x86-64

      OSX 10.7 (Lion) or greater, x86 and x86-64

      There is supposed to be ARM support in the works.

    2. Re:Portability by Anonymous Coward · · Score: 0

      I think the OP was talking about the compiler. Your links point to the development software, not the CPU architectures that can be compiled for.

      There are C compiler tool chains for just about every 8, 16, 32, and 64 bit CPU/MCU architecture out there.

      If you want to be able to move your code from a PPC to a AMD processor with a high certainty that a tool chain exists for your target then C is the way to go.

    3. Re:Portability by ras · · Score: 1

      there are C compilers available for almost every piece of hardware out there.

      There are. But most of those CPU arches targeted by LLVM, which is what the current Rust compiler uses as it's back end. And then there are some targeted by LLVM, but not but C - like asm.js.

      You were right, once. If you were targeting some random arch the only thing you could rely on was a C compiler being available for some definition of "C". If you were lucking they might even provide something that looked vaguely like the POSIX library. But LLVM has broken that rule of thumb. The odds are very good that LLVM will also target your machine, and if it does all compilers and languages that use LLVM can produce code for it. And this isn't for some random implementation of the language like you got with C, it is typically the reference implementation of the language, and you get all this bits of it standard library that are written in itself as well.

      After 40 so years, they world has finally moved on.

    4. Re:Portability by nateman1352 · · Score: 0

      Speaking as someone who writes firmware for a living, Rust will never be a replacement for C in its current state. C has one property that sets it apart from every other language that is higher level than assembly. It is possible to write a C program that does not need *ANY* C run-time library support. Our firmware runs on the bare metal without any OS whatsoever, so running Rust in firmware requires building all the services that the Rust run-time requires (heap, threads, etc.) and porting the Rust run-time to it.

      So unless we want to write heap, threads, etc. in assembly... C is our only option for bootstrapping Rust. Since we are using C for that part of our code base... why not use it for all? The firmware I work on doesn't do a bunch of string manipulation of other things that makes a higher level language like Rust nice. Why add all that additional complexity to support Rust? By the way, anyone writing an operating system kernel is going to run in to the same thing with Rust.

      It would be possible to bootstrap Rust on top of a basic kernel written in C and maybe even use it for some of the kernel code (drivers for example, like how OSX uses C++ for I/O Kit drivers), but Rust will never replace C. It would be nice if someone designed a new **Systems Programming Language** that can run without a run-time and had some of the features that newer languages do... but it seems the only thing people think about when designing new languages these days is the web and/or cloud computing.

      Despite what the Rust developers claim, Rust is not a real Systems Programming Language in its current state since it requires a run-time. Its OK to have an optional run-time and for some features to stop working when its not there... but it must be optional not required.

    5. Re:Portability by garethjrowlands · · Score: 5, Informative

      What you say was true of early releases of Rust. But they removed all traces of any kind of runtime for exactly this reason. It was a breaking change but it happened quite a long time before the 1.0 release. Here's the documentation for the change: https://github.com/rust-lang/r...

      Here's a blog entry on using Rust for embedded. It dates from February and uses 1.0-alpha but of course 1.0 is out now:

      http://spin.atomicobject.com/2...

      In these days of LLVM, the portability story is good, even relative to C. No C portability gotchas.

    6. Re:Portability by nateman1352 · · Score: 1

      What you say was true of early releases of Rust. But they removed all traces of any kind of runtime for exactly this reason.

      Oh cool. I'll have to give Rust a second look then!

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

      C tends to require runtime support for integer division and variable shifts, even if you eschew long integers, floating point, and struct copies.

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

      Despite what the Rust developers claim, Rust is not a real Systems Programming Language in its current state since it requires a run-time. Its OK to have an optional run-time and for some features to stop working when its not there... but it must be optional not required.

      Run-time is an adjective. You are missing a noun. Did you mean run-time library?

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

      C has one property that sets it apart from every other language that is higher level than assembly. It is possible to write a C program that does not need *ANY* C run-time library support.

      *ahem* FORTH. No required run-time library, and I would rather use FORTH for embedded systems, than hope there is a C cross-compiler available for it.

    10. Re:Portability by Nubbywubwub · · Score: 1

      Rust already has a whole lot of ARM support, not all of it official. Lots of tentative embedded work being done with Rust at the moment. Here's a more updated version of the page you linked with much more detailed support information: https://github.com/alexcrichto...

  15. Consider more than just the implementation by quietwalker · · Score: 4, Insightful

    How many other engineers are going to be expected to know and maintain this? Ones you have on staff? Are you making sure to hire for folks who know Rust? If you have one, is your ops team up to supporting applications written in Rust, familiar with the errors and can handle it? What's the life expectancy of the app? Ever going to need to port it in the future?

    Don't forget to factor in the bus factor, when you lose a whole engineer.

    Lots of folks end up missing these and you end up with mysterious legacy code the business completely depends on for day to day ops that no one knows or understands. Heck, the other day, I was asked to unlock a windows NT laptop because it was the only known repository of source code for an app that was written over a decade ago - hopefully.

    1. Re:Consider more than just the implementation by Anonymous Coward · · Score: 1

      It is shit like this that makes my field worse every year and has ruined /.

      Any decently educated programmer can pick up any language quickly and easily.

      Hire polyglots not language end-users.

      Shit, I wouldn't hire a Java programmer if he was not competent in multiple languages, for a Java-only project.

      Fuck API monkeys and the retards that hire them.

    2. Re:Consider more than just the implementation by Anonymous Coward · · Score: 1

      It's not picking up a language that's important. It's being expert in it that really matters. And becoming an expert in a language, and being able to hack something in it is not the same thing.
      Sure, I can pick up any language fast. I've programmed in Haskell and brainfuck for fun. I've picked up C, and LISPs, I know AWK and Python, I've hacked Perl, and played with clojurescript and even some vimscript. I think that if You woke me up at night I'd be capable to write in any of these languages at a minutes notice. But my code will be shit. And I dare say, even if I pickup the language of COBOL, java or C# fast, I won't get the nuances. The code that I will write will be broken by edgecases that are known only through thorough experience. It won't be optimal to deal with the inputs that I have to support.
      If You don't mind paying me for not earning You money for at least 6 months while I work to become an expert on a language I don't know, sure. Go ahead, hire me. If not, then go ahead and fuck off.

      Oh, and by the way, hire 50 polyglots to write tests.
      For the same money.

    3. Re:Consider more than just the implementation by Anonymous Coward · · Score: 0

      Knowing the grammar enough to get by and being proficient are two very different things.

      I never learned Python, and I can write really cool things in it given a couple hours, but ask me to write more than a couple klocs and it'll turn into a huge unmaintainable mess of mashed together stackoverflow answers and first results on Google.

      Now in C++ or C, it might be an awful language for quick prototyping, but I'll happily maintain your MLOC build and do wonderful things with it, because I actually have a decade of experience.

    4. Re:Consider more than just the implementation by Austerity+Empowers · · Score: 3, Insightful

      Any decently educated programmer can pick up any language quickly and easily.

      Hire polyglots not language end-users.

      I'm torn on this one. On one hand, yes, anyone with a CS background who didn't cheat through school can learn a new language quickly.

      The issue is whether they can learn to write idiomatically correct code in that language, and whether they "think" in terms of how that language was designed. That usually requires a bit of time, not to mention some patience. Python is my usual example for this, it breaks a lot of (in my opinion) sensible conventions that people over 10 are used to: no need for semicolons (sneered at if you use them), mandatory white space, duck-typing, etc. Yes, you can learn python in a few hours, but to write "good" python that other python people can/want to support, and generally don't waste time fighting the language, you need to spend some time.

      Generally when I see a language like this I want to barf, but it's hard not to run in to something like this a few times in life, and if you're on the hiring side and you have a pile of (say) Python, you probably want to hire someone that can do it properly, versus someone from say, C, who is going to be very upset with almost everything.

    5. Re:Consider more than just the implementation by garethjrowlands · · Score: 1

      Looks like GP touched a nerve.

    6. Re:Consider more than just the implementation by Anonymous Coward · · Score: 0

      Hiring polyglots can be a problem.

      When engineering runs amok and writes s/w for a single product in C, C++, java, perl, python, make, cons, TCL/Tk, shell scripts, and a few more obscure things for good measure, it also means that anyone trying to debug subtle problems between communicating programs *has* to be a polyglot... and a glutton for punishment. It also means the learning curve for bringing new programmers into the fold is unreasonably long if they don't already have a lot of experience in multiple languages. It also means you get a lot of crappy code written by people writing code in languages they're not entirely comfortable in.

      Pick your tools and languages carefully. You -- or your engineering descendants -- will have to live with them for as long as the product lives.

    7. Re:Consider more than just the implementation by gweihir · · Score: 1

      Becoming a language expert is a huge wast of time. If a language is so difficult that you have to become an expert in it to use it efficiently, stay away from it. If it does not, then picking it up is quite enough. Sure, you have to understand things like algorithms and datastructures (a thing most coders already fail at), the machine, etc. But these do not really change from language to language. You also have to understand the main language paradigms. But a need to "get nuances" just means you are using a bad tool.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    8. Re:Consider more than just the implementation by Anonymous Coward · · Score: 0

      I agree. Being able to pick up a language and write some code on your spare time is different to mastering a language and being able to write robust, release quality code.

      I've learned several languages on the job, because it is true, a decent programmer can pick up new languages. But it is also true that I cringe every time I go back and look at code that I wrote in those early stages when I go back a few years later.

    9. Re:Consider more than just the implementation by Anonymous Coward · · Score: 0

      Dumbass

      Being a polyglot doesn't mean that you have to use all the languages that you know in a project.

      Being a polyglot gives you the ability to properly choose languages.

      Numbnuts

    10. Re:Consider more than just the implementation by Anonymous Coward · · Score: 0

      Python is my usual example for this, it breaks a lot of (in my opinion) sensible conventions that people over 10 are used to: no need for semicolons (sneered at if you use them), mandatory white space, duck-typing, etc.

      While I'd mostly agree with your list, I'd state that the point of a lack of semicolons and mandatory white space falls very much in line with basically C code following a style guide to the point of absolute strictness instead of merely a guide. And honestly, with rare exception I'd much prefer a more mandatory guide to such things precisely because too often I've seen C code that does in fact break good sensible conventions mostly as a hack to the various shortcomings of C (do {} while in macros and macros in general tend to fall into this camp).

      As for duck-typing...yeah, that to me is more of a "this is why we need extensive QA testing" more than anything. In most other C-like languages (Java, C#, etc) you'll end up catching at compile time such issues but honestly if you're at the point that you're violating some convention that duck-typing is an issue, you've probably got more inrooted that probably need worked on more generally--and honestly, there never seems to be a really good way to deal with this in OO languages* so <shrug>.

      * By this I mean is that you end up doing things like either trying to pass around stuff as generic objects and then recasting them later (which has the same fundamental issue with duck typing), you end up creating a super type (birds) and then that really violates the whole point of having a specific type (ducks), and you end up writing a lot of excess boilerplate object definitions to compensate for the fact that the compiler needs to be explicitly instructed on what you're trying to define which invariably results in having to go back later and fix possibly multiple definitions every time you make a change in one of the definitions in one of the subtypes. So, overall, you feel less like you're making objects and more like you're playing a documentation game where no one but the compiler is going to actually read your documentation because you're only documenting so one small part of your program works in a certain way with a certain set of objects and your compiler can confirm that you defined everything right. Yet the motion of going through documenting tends to mean you'll make the rote errors that miss any core design issues that started you down that path in the first place. So, you're really no better off except that you now have really good documentation on why your program is crap.

  16. wouldn't hold my breath by NostalgiaForInfinity · · Score: 1

    The problem with languages like Rust is that, in addition to addressing important issues in the languages they intend to replace, their designers also go off on an ego-trip, introducing numerous gratuitous syntactic changes, overlooking important features in their predecessor language they didn't understand, and adding features few people actually need. It's possible that a language like Rust will eventually replace C, but I wouldn't put my money on any particular one.

    More likely, ideas from Rust will simply make it into a future C release. For example, C may end up having both "safe" and "unsafe" modules, with "safe" modules having more Rust-like semantics and restrictions, and "unsafe" modules supporting full traditional C. Fortran managed such a transition from Fortran-77 to Fortran-90 pretty successfully.

    Of course, the other threat to Rust-like languages (as well as future extensions to C) is that whatever they come up with can probably be emulated fairly well in C++ anyway. In fact, looking down the list of Rust features, they are pretty much identical to what C++ offers people already today, and C++ has tons more libraries and compilers, interoperates better with C, and has a huge community of programmers.

    1. Re:wouldn't hold my breath by dmoen · · Score: 4, Informative

      1st paragraph is false, due to the rather extraordinary design process that Rust went through.

      designers also go off on an ego-trip, introducing numerous gratuitous syntactic changes, overlooking important features in their predecessor language they didn't understand

      The Rust community is quite large, including many skilled language designers. The Rust github repository has ~1200 contributers. With that pool of talent,
      there are no features of C/C++ that the designers don't understand. With this kind of community, and a formal change review/feature addition process, there's not much danger of a single ego-tripping designer messing up the language.

      adding features few people actually need

      The project transitioned from a hobby project to an official Mozilla project in 2009. During the 6 years from 2009 to 2015 (when the Rust 1.0 design was stabilized and released), a lot of Rust code was written. Features that seemed like a good idea at the time, but which had little practical use, were removed before 1.0.

      3rd paragraph is also incorrect. The main feature of Rust is guaranteed memory safety, without a garbage collector, enforced by compile time type checking rather than by introducing run-time overhead. This memory safety includes a guarantee that shared global data can't be corrupted by simultaneous writes from different threads, something that no other language offers. C++ doesn't offer this today, no other language does.

      I agree that Rust will influence future languages, but I don't think it will have much effect on C. The C++ community is already looking at Rust and trying to figure out how to compete with what it offers.

      --
      I have written a truly remarkable program which this sig is too small to contain.
    2. Re:wouldn't hold my breath by istartedi · · Score: 2

      This. C can be fixed. It takes time, and compilers are usually ahead of the standard. How long did it take for C to get the restrict keyword? That allows us to control pointer aliasing in a portable way. The impetus for that was that FORTRAN could outperform C because, AFAIK, it assumes no aliasing.

      There are already a lot of static checkers for C. I'm willing to wager they can catch just as many bugs at compile-time as Rust. Having such tools is almost as good as having checks integrated into a standard implementation. If you go ahead in C, the standard may catch up to you without you having to worry about the risk of a new language.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    3. Re:wouldn't hold my breath by TheDarkMaster · · Score: 1

      This. I would not have said it better

      --
      Religion: The greatest weapon of mass destruction of all time
    4. Re:wouldn't hold my breath by NotInHere · · Score: 2

      Even if templates are already present in C++, they are a PITA to use. Rust is really really easy to use for those.

    5. Re:wouldn't hold my breath by DuckDodgers · · Score: 2

      The interesting feature of new programming languages is often not what they make possible - you can write any program in the world in assembler, after all - it's what they make default.

      Rust doesn't allow null values or null pointers. The Rust compiler automatically frees memory when the last reference to it goes out of scope. Variables are immutable by default. You can't use pointer arithmetic by default. Only one mutable reference to any piece of memory is permitted to exist at any one time by the compiler.

      You don't need a new programming language for those features, you can write code in any existing language that follows those conventions. But by making good software development practices the default and having the developer jump through extra hurdles to do things in a way that might be dangerous, the general level of code quality is improved. C or C++ might evolve to the same defaults in 20 or 30 years - but if you want to write low defect systems code quickly today, Rust deserves a look.

      Also, the language designers list most of the features they listed and what they drew them from, and some features in the 0.x releases were dropped when they found few practical uses for them.

    6. Re:wouldn't hold my breath by NostalgiaForInfinity · · Score: 0

      The C++ community is already looking at Rust and trying to figure out how to compete with what it offers.

      Like what? Presumably, the rust-lang.org home page gives it its best shot advertising Rust language features, and I see nothing there that as a killer feature compared to C++.

      The Rust community is quite large, including many skilled language designers. The Rust github repository has ~1200 contributers. With that pool of talent, there are no features of C/C++ that the designers don't understand.

      If brilliant language designers were what makes a language successful, C++ would never have succeeded and lots of other languages would have. The "understanding" I'm talking about isn't knowing what a language feature does according to the standard; that's trivial. The understanding I'm talking about is how people use language features in billions of lines of real world C++ code; not even the C++ designers themselves understand that for C++.

    7. Re:wouldn't hold my breath by NostalgiaForInfinity · · Score: 1

      But by making good software development practices the default and having the developer jump through extra hurdles to do things in a way that might be dangerous, the general level of code quality is improved

      Rust attempts to strike a particular compromise between safety, complexity, and performance, and it's not clear that the particular compromise it makes is something anybody really needs. That is, when I want language support for good software development practices and huge software systems, there are better, higher-level languages than Rust. On the other hand, for embedded and real time systems and other low-level programming, C++ is more flexible and far better supported without being much worse than Rust. Rust to me seems like building a dump truck with a luxury car interior.

    8. Re:wouldn't hold my breath by gweihir · · Score: 1

      This seems very likely. Of course the Rust fanatics (in themselves a valid reason to stay away from that language) will claim differently on all points, but that is just propaganda.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    9. Re:wouldn't hold my breath by gweihir · · Score: 1

      Sounds very much like Rust is a huge pain for those of us that actually know what we are doing. Suddenly we need to work around an authoritarian compiler that thinks we are children and it knows best. Not desirable unless your coders are monkeys because you pay peanuts.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    10. Re:wouldn't hold my breath by Anonymous Coward · · Score: 0

      With this kind of community, and a formal change review/feature addition process, there's not much danger of a single ego-tripping designer messing up the language.

      Rebuttal requires only one word: Pottering

    11. Re:wouldn't hold my breath by Tailhook · · Score: 2

      The C++ community is already looking at Rust and trying to figure out how to compete with what it offers.

      Like what?

      Here is Stroustrup talking for over and hour and a half just three weeks ago about how to both narrow and enhance C++ to achieve, among other things, a degree of memory safety, pervasive ownership semantics (std::owner<>) and enabling the compiler do a better job of detecting faulty code. The parallels with Rust are impossible to miss.

      It has been a long time since anything challenged the C/C++ paradigm. In that time a large number of non-"systems" languages have emerged, leaving the low-level stuff to C/C++, and a smaller number of systems languages (Objective C, D, etc.) have also emerged, but nothing so far has provided enough value to motivate broad adoption. I think Rust is a language that does bring sufficient value. I am certain it is inspiring people to use and advocate it, as evidenced by this story.

      It's disappointing to see the sheer number of Rust haters emerging from among C/C++ programmers. You can pan around the comments in this story yourself and read an abundant supply of irrational, ignorant and petulant comments. If Rust disappeared tomorrow it wouldn't cause a ripple, yet it's hated like Java or SQL. Sad.

      --
      Maw! Fire up the karma burner!
    12. Re:wouldn't hold my breath by ziggystarsky · · Score: 1

      Sounds very much like Rust is a huge pain for those of us that actually know what we are doing.

      Honestly, I hope I will never have to work together with someone who "actually knows what he is doing".

    13. Re:wouldn't hold my breath by gweihir · · Score: 1

      The feeling is mutual. Unfortunately, working with nil-whits can usually not be avoided, there are just too many of them.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    14. Re:wouldn't hold my breath by NostalgiaForInfinity · · Score: 0

      Here [msdn.com] is Stroustrup talking for over and hour and a half just three weeks ago about how to both narrow and enhance C++ to achieve, among other things, a degree of memory safety, pervasive ownership semantics (std::owner) and enabling the compiler do a better job of detecting faulty code. The parallels with Rust are impossible to miss.

      Of course there are "parallels to Rust"; these are old ideas after all. I don't see the C++ community "looking at Rust" for anything significant though. At best, Stroustrup may occasionally mention Rust and Go as validation for some ideas that have been on the drawing board for many years anyway.

      I think Rust is a language that does bring sufficient value. [...] It's disappointing to see the sheer number of Rust haters emerging from among C/C++ programmers.

      Instead of wasting your breath on insults, try to improve your arguments. A paper with an in-depth analysis comparing Rust, C#, Go, and modern C++ would be a good start. Case studies and comparisons on large, real-world software systems in areas like gaming, 3D computer graphics, artificial intelligence, neural networks, protein dynamics, astrophysics, distributed computation, GPU programming, kernels, embedded hardware, etc. would also be good.

    15. Re:wouldn't hold my breath by angel'o'sphere · · Score: 1

      I guess that is because you rarely have to write your own templates, as the libraries provide already so many.

      Using existing templates should be easy, best habit is to use typedefs to hide them.

      I usually simply do stuff like:
      typedef list[Person] PersonList; // brakets should be pointed brackets ofc

      However to really learn how simple templates are and how powerfull they are you need to start writing your own ones!

      I loved writing templates, the only things I hate about Java is the lack of multiple inheritence and the missing templates (generics are not very close to templates).

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    16. Re:wouldn't hold my breath by DuckDodgers · · Score: 1

      Every language is a particular compromise between safety, complexity, and performance. Rust clearly puts safety first, performance second, and complexity third but the result isn't that complex and the performance is - no hyperbole - on the level with well written C or C++. Considering the volume of disclosed security vulnerabilities even coming from high profile projects with brilliant teams like the OpenSSL project or the Linux kernel, I think that's a useful target.

    17. Re:wouldn't hold my breath by Anonymous Coward · · Score: 0

      The Rust compiler automatically frees memory when the last reference to it goes out of scope.

      Pretty sure it's not the compiler that automatically does that, but instead the run-time system.

    18. Re:wouldn't hold my breath by NostalgiaForInfinity · · Score: 1

      Considering the volume of disclosed security vulnerabilities even coming from high profile projects with brilliant teams like the OpenSSL project or the Linux kernel, I think that's a useful target.

      Neither the Linux kernel nor OpenSSL are written in C++, let alone modern C++, so their bug count tells you nothing about how modern C++ compares to Rust. And I don't think you have thought through what replacing OpenSSL or the Linux kernel in Rust actually would mean.

      but the result isn't that complex

      In fact, my concern is the opposite: Rust looks too simple; that is, it looks like it hasn't come to terms with many of the real-world issues that other languages have had to address.

    19. Re:wouldn't hold my breath by Anonymous Coward · · Score: 0

      Any complex system with 1200 designers is an automatic failure. How many of those designers disagree on any particular feature, and what kind of compromises are made in order to cater to all of the opinions in the pool? There is such a thing as having too many cooks.

      In the real world every language has just one or a few core designers, and the language conforms to their specific views, for better or worse. The only alternative is design by committee, and we all know how that turns out.

    20. Re:wouldn't hold my breath by DuckDodgers · · Score: 1

      I know those projects aren't written in C++. I'm not suggesting they be rewritten in Rust, either. I'm just saying that you have some developers highly skilled at writing secure code working on both projects, and mistakes are still made. Even superb developers benefit from improved tools.

      If you feel like going into it, what is Rust lacking?

    21. Re:wouldn't hold my breath by DuckDodgers · · Score: 1

      You're right, of course. Sorry for the incorrect statement.

    22. Re:wouldn't hold my breath by Anonymous Coward · · Score: 0

      It's disappointing to see the sheer number of Rust haters emerging from among C/C++ programmers. You can pan around the comments in this story yourself and read an abundant supply of irrational, ignorant and petulant comments. If Rust disappeared tomorrow it wouldn't cause a ripple, yet it's hated like Java or SQL. Sad.

      Sadly, this is in part because of over-enthusiastic members of Rust community, who submit "my language is better than yours" type of posts to C++ forums. I think this has turned quite a few C++ devs against Rust. People don't like when stuff is forced upon them...

    23. Re:wouldn't hold my breath by NostalgiaForInfinity · · Score: 1

      I'm just saying that you have some developers highly skilled at writing secure code working on both projects, and mistakes are still made.

      Of course they make mistakes; those projects are written in C, which lacks pretty much all features needed to create safe abstractions. But that's why "Rust is better than C" is not particularly interest. The interesting question is: is Rust substantially better than C++14, and that seems doubtful. Rust is cleaner and simpler, but not by enough to make up for the huge practical advantages C++ has.

      My second point is that if you view those as examples of the application areas where Rust would be good, well, they aren't good examples. There are so few kernels being written that a new language for it doesn't make sense. And OpenSSL is primarily a library to be used inside other runtimes, something Rust doesn't seem designed for and isn't particularly good at.

      If you feel like going into it, what is Rust lacking?

      Many carefully analyzed use cases.

      Many examples of large and successful applications.

      About half a dozen independent implementations, including a Rust-to-C compiler.

      A lot more tools and tool support.

      Far better C integration, including automatic C header file generation for Rust-implemented libraries, so that Rust code can be used as a drop-in replacement for C libraries with essentially no effort on the part of the programmer.

      (There are probably also language features that are problematic, but that's secondary to these other issues.)

    24. Re:wouldn't hold my breath by DuckDodgers · · Score: 1

      Thanks for taking the time to answer. I do appreciate it.

      I think the carefully analyzed use case and maybe someday successful application is the Mozilla Servo project. Otherwise I agree with your points. I was more curious whether you thought the language design itself was flawed, and if so, how. I'm not a language design expert, this is just curiosity.

    25. Re:wouldn't hold my breath by NostalgiaForInfinity · · Score: 1

      I was more curious whether you thought the language design itself was flawed

      I don't think there is such a thing as "the language design itself" without reference to use cases. That's why I think the Rust designers first need to be clear about what use cases they are designing for.

    26. Re:wouldn't hold my breath by strikethree · · Score: 1

      I was starting to become interested in Rust but then you said this:

      The project transitioned from a hobby project to an official Mozilla project in 2009.

      After seeing what they did to Firefox, I can only shudder to think what Rust version 42.3 will look like.

      --
      "Someone needs to talk to the tree of liberty about its ghoulish drinking problem." by ohnocitizen
    27. Re:wouldn't hold my breath by DuckDodgers · · Score: 1

      It seems to me that Servo is the use case. They wanted to start a Firefox redesign from the very beginning, and built a tool that they thought could give them the development experience and software results in a way better than just plain C++11 (since I think Servo was envisioned before the C++14 spec existed).

    28. Re:wouldn't hold my breath by NostalgiaForInfinity · · Score: 1

      Servo source code doesn't look all that different to me from C++11 source code: it's lots of messy functions over a jumble of data structures. The lack of pointers and the increased safety would seem to be pretty easy to accomplish in C++.

      In my view, C++'s biggest problem is with template metaprogramming. Template metaprogramming has turned out to be extremely useful, but the way it is done in C++ is a mess. A C++ successor should replace C++'s combination of overlading, templates, special case methods, and multiple inheritance with better explicit metaprogramming support, limited AOP, and a module system with type parameters; none of those have any runtime overhead. Such facilities might also be used to enforce the use of, say, safe programming styles.

      (Another area where C++ is lacking functionality is reflection; but it looks like that's going to be addressed with the addition of static reflection.)

    29. Re:wouldn't hold my breath by DuckDodgers · · Score: 1

      As I've said elsewhere, I think the interesting and - to my knowledge, unique - feature of Rust is that you get compile time errors if you try to use a pointer after it would have been freed or maintain more than one mutable reference to an object at any time in one thread or across threads. Also variable declarations are immutable by default and must be explicitly marked mutable. I haven't worked with C++ since 2005 and I haven't followed the standard changes, but as far as I know, C++11 and C++14 don't have an equivalent mechanism. So while you can write equally safe and stable C++ code, it requires a lot more careful concentration by the developer.

    30. Re:wouldn't hold my breath by NostalgiaForInfinity · · Score: 1

      I think the interesting and - to my knowledge, unique - feature of Rust is that you get compile time errors if you...

      There are lots of ways of doing compile time checking for memory and concurrency issues. If you impose certain restrictions on how variables are used, you can check at compile time for memory and data races, that's been known for decades. Baking those sorts of restrictions into the type system of a language, however, has never worked well (and people have tried before) because there is really no right answer, only lots of compromises. That's one of the reason the Rust type system keeps changing and why they have dropped a lot of those checks.

      I haven't worked with C++ since 2005 and I haven't followed the standard changes, but as far as I know, C++11 and C++14 don't have an equivalent mechanism. So while you can write equally safe and stable C++ code, it requires a lot more careful concentration by the developer.

      C++'s smart pointers are a superset of what Rust offers. C++ also has excellent static and dynamic analysis and testing tools available. Writing safe and stable C++ just doesn't seem to be a problem in practice, and I see little difference between Rust and modern C++ in practice.

      The only claim to fame for Rust is that it avoid garbage collection, like C++. Once you drop that requirement, there are plenty of excellent languages for general purpose programming (Scala, C#, Java, Swift, Clojure, D, Go, etc.) that offer runtime safety and (often) better concurrency primitives than either Rust or C++.

    31. Re:wouldn't hold my breath by Tailhook · · Score: 1

      ideas that have been on the drawing board for many years

      Letting these ideas languish on the C++ drawing board isn't acceptable to the creators and users of Rust.

      A paper with an in-depth analysis comparing Rust, C#, Go, and modern C++ would be a good start. Case studies and comparisons on large, real-world software systems in areas like gaming, 3D computer graphics, artificial intelligence, neural networks, protein dynamics, astrophysics, distributed computation, GPU programming, kernels, embedded hardware, etc. would also be good.

      Neither C nor C++ started that way. Why must its competitors? Where is that written?

      Rust will not succeed by convincing the haters to love it. It will succeed through those who use it in the real world for gaming, 3D computer graphics, artificial intelligence, neural networks, protein dynamics, astrophysics, distributed computation, GPU programming, kernels, embedded hardware, etc.

      And the haters will go on hating regardless.

      --
      Maw! Fire up the karma burner!
    32. Re:wouldn't hold my breath by Anonymous Coward · · Score: 0

      Letting these ideas languish on the C++ drawing board isn't acceptable to the creators and users of Rust.

      They haven't been "languishing", most of them have been implemented in C++.

      Neither C nor C++ started that way. Why must its competitors? Where is that written?

      When C and C++ came on the scene, there were essentially no serious competitors (any of the "good" languages were proprietary). These days, Rust is competing with C++ and a lot of other new languages. So you better make a compelling argument if you want people to invest time in it.

      Rust will not succeed by convincing the haters to love it.

      So asking for more information makes me a "hater" according to you?

      Rust will not succeed by convincing the haters to love it. It will succeed through those who use it in the real world for...

      That's great! I expect once you have a thriving user community and rich set of libraries, I'll give Rust as second look. Good luck.

    33. Re:wouldn't hold my breath by Tailhook · · Score: 1

      They haven't been "languishing", most of them have been implemented in C++.

      Apparently Stroustrup doesn't agree, which is why he is proposing sweeping changes to the language. His actions are more compelling than your claims.

      These days, Rust is competing with C++ and a lot of other new languages. So you better make a compelling argument if you want people to invest time in it.

      The arguments have been made, and many have found it compelling. You're free to think otherwise. The compelled do not care.

      So asking for more information makes me a "hater" according to you?

      You didn't ask any questions. Not one question mark. You argued about the meaning of Stroustrup's proposals and falsely accused me of insulting someone. Anyhow, there is ample information publicly available to you about the rational, design, implementation and flaws of Rust, published by the Rust creators, including why they did not choose to try and adapt C++, if you're actually interested. If you have not bothered to examine this — as I suspect — then I'm left to conclude you're just another irrational hater.

      --
      Maw! Fire up the karma burner!
    34. Re:wouldn't hold my breath by DuckDodgers · · Score: 1

      Thanks. I really should give C++ itself another look. The last time I used the language professionally the people were nice and they had the best of intent but the code was a mess. It was spaghetti when I arrived, and as a fresh graduate (fifteen years ago) my best efforts made the problem worse. The whole experience left me sour on the language. I've always known the problem was more the team - especially me, I'm not trying to pass the blame - but I haven't given the language a serious look since.

      I appreciate the discussion.

    35. Re:wouldn't hold my breath by NostalgiaForInfinity · · Score: 1

      Yeah, I know where you're coming from. Other problems were that compilers used to be quite buggy, there weren't a lot of tools, and libraries were a mess. Besides language improvements, new tools like clang and the Boost libraries have made a big difference. C++ is still not my favorite language, but it's become a usable and fairly mature systems programming language.

  17. One year from now, expect the post: by Anonymous Coward · · Score: 0

    "Is it Practical To Replace Rust With C?"

  18. Why not to use Rust by Anonymous Coward · · Score: 0

    Here is a list of reasons not to use Rust:

    1) It is controlled by a single entity (Mozilla). People will scream about that, but it is true. Just like Java is owned by Oracle, C# is Microsoft, Rust is one corporate entity.
    2) There is a "Legal" link on the Rust main website. That is never a good sign, and is related to #1.
    3) If you look at the pictures of the Rust team members you will see that they are all cisgender white males. And we all know what THAT means.

    Stick with C/C++. There are ZERO legal issues involved and isn't controlled by a corporate entity governed exclusively by cisgender white males.

    1. Re:Why not to use Rust by Anonymous Coward · · Score: 0

      How do you tell if someone is cisgender from a picture?

    2. Re:Why not to use Rust by jedidiah · · Score: 1

      You can't.

      I believe that point 3 is what humans call humor.

      --
      A Pirate and a Puritan look the same on a balance sheet.
    3. Re:Why not to use Rust by Anonymous Coward · · Score: 0

      #3 is spot on. We should all be switching to C+=!

    4. Re:Why not to use Rust by Anonymous Coward · · Score: 0

      There are legal issues with using C or C++, C/C++ isn't a language numbuts.

      The toolchains and libraries all have licenses, which are *gasp* legal issues.

      Retard

    5. Re:Why not to use Rust by Anonymous Coward · · Score: 0

      Cisgendar

    6. Re:Why not to use Rust by Fwipp · · Score: 2

      Isn't humor supposed to be funny?

    7. Re:Why not to use Rust by Anonymous Coward · · Score: 0

      How dare you suggest that I am not funny. You need to check your privilege. You are creating a toxic environment.

    8. Re:Why not to use Rust by Anonymous Coward · · Score: 0

      Anybody that uses the word "cisgender" in a serious way cannot possibly be funny.
      It's like a crippled person insisting on calling other people "two-leggers".

    9. Re:Why not to use Rust by dmoen · · Score: 2

      1) The Rust project is not controlled by Mozilla. Just look at the copyrights on the rust source code. It's permissive open source, with copyright shared by ~1200 individuals, and Mozilla is not on that list. So this is like spreading FUD by warning people that Linux is controlled by the Linux Foundation (Linus's employer)--hint, it isn't.

      2) Mozilla and Oracle are quite different. The Mozilla Foundation is a non-profit, open source organization that exists to provide a public benefit through the creation of open source software. The Mozilla Corporation (employer of some of the Rust developers) is a wholly owned subsidiary that donates all of its profit to the foundation. By contrast, Oracle is known for being one of the most rapaciously greedy software organizations in existence: just consider the Oracle article on Slashdot right now, about how Oracle rips off customers via "traps" in the opaque licencing terms.

      3) How can you be sure that Rachael Craig and Nicolette Verlinden are cisgender males? They have female names and photos.

      So yeah, I'm pretty sure the parent is a troll, and I fell for the bait.

      --
      I have written a truly remarkable program which this sig is too small to contain.
    10. Re:Why not to use Rust by Anonymous Coward · · Score: 0

      I really thought the lameness filter would have caught that one.

    11. Re:Why not to use Rust by Anonymous Coward · · Score: 0

      Does C or C++ link to legal department on their front page?

      p.s. To avoid looking like a 'Retard' don't leave a sign off with a pejorative that resembles a signature.

    12. Re:Why not to use Rust by Anonymous Coward · · Score: 0

      You are right. Caught you hook, line and sinker!

    13. Re:Why not to use Rust by Anonymous Coward · · Score: 0

      Recent events have exposed that the Mozilla people and Larry Ellision are on the same level of evil.

      At my company, recommending Rust is a first offense warning, second offense firing.

    14. Re:Why not to use Rust by tigersha · · Score: 1

      I would be more worried about the fact that the team also has one gorilla, a werewolf, something that looks like a walking dildo, a female hentai character that seems to be getting some action from behind off-screen, a kitten, a cat and a penguin.

      On the other hand, Yehuda Katz is there. He is a very major Ruby on Rails contributor. As a dedicated RoR fan that worries me because if he jumped ship RoR lost a very valuable contributor.

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
    15. Re:Why not to use Rust by Grishnakh · · Score: 1

      Sounds like a micro-aggression to me.

  19. Use C by menkhaura · · Score: 3, Insightful

    Show him this story to indicate your attention to him and use C instead of this new-fangled and still-evolving language anyway.

    You'll get better debugging tools, more productivity (since you know C better) and a wider pool of replacement developers should the need arise.

    --
    Stupidity is an equal opportunity striker.
    Fellow slashdotter Bill Dog
    1. Re:Use C by Anonymous Coward · · Score: 0

      These things aren't givens. I'm productive as hell in C, but that doesn't mean I won't make big mistakes that Rust could easily catch, or that Rust wouldn't end up making me even more productive in relatively short order. Tooling is also not much of a case if you're a competent coder working in a language that's close to the hardware, unless of course your hardware is obscure enough to have only one or two specific toolchain(s). Rust might already do more for you as a relatively advanced compiler than your given toolchain, depending on what you rely on. C is relatively simple, after all, so it needs more tooling support. Not to mention that a wider pool of replacement developers is also not a given, because just knowing C isn't enough in a given domain. It might be better to get a specialist who knows Haskell or Scala and train them in Rust, since they would likely be less error-prone using Rust than C.

    2. Re:Use C by ras · · Score: 1

      You'll get better debugging tools

      Rust targets LLVM, and LLVM outputs the same debugging info as the GNU compilers. So gdb, for example, works as well with Rust as it does with C.

      more productivity (since you know C better)

      For a short while. (OK, maybe not so sort in Rust's case as borrow checker is a bitch.) But in the end no, a Rust programmer will beat C with the same inevitability a newbie C programmer will eventually beat an experienced assembly programmer. The reason is the same too. You need far less lines of Rust to do the same thing. Programmers tend to produce the same number of lines of code per day, regardless of language.

    3. Re:Use C by NotInHere · · Score: 1

      Its very simple to get a backtrace for a panic in rust. Just set the RUST_BACKTRACE environment variable to 1 before executing the program. This is something far more easier to explain to your users than to explain the long process how to download a version with debug symbols of the program and use gdb.

    4. Re:Use C by pdxtabs · · Score: 1

      I'm one of those widely available replacement developers that spends a lot of time tracking down bugs in C that would have been caught at compile time in Rust.

    5. Re:Use C by menkhaura · · Score: 1

      This too :) C language helps good developers to keep their jobs.

      --
      Stupidity is an equal opportunity striker.
      Fellow slashdotter Bill Dog
    6. Re:Use C by Anonymous Coward · · Score: 0

      For a short while. (OK, maybe not so sort in Rust's case as borrow checker is a bitch.) But in the end no, a Rust programmer will beat C with the same inevitability a newbie C programmer will eventually beat an experienced assembly programmer. The reason is the same too. You need far less lines of Rust to do the same thing. Programmers tend to produce the same number of lines of code per day, regardless of language.

      I call BS, especially on the last sentence. Lines of code is not the measure of productivity when two thirds of them require debugging or rewriting because the idiot didn't know what they were doing and used a hammer to drive a screw. If you think that programmer productivity is the result of lines of code per day, then you're an idiot. It's like judging a tech support group by the number of tickets per day. It's a bad metric and has been proven so in practice.

    7. Re:Use C by ras · · Score: 1

      Lines of code is not the measure of productivity

      I didn't say lines of code is good way to measure productivity. Using it as such a measure is counter productive because programmers find ways to bloat the code. Not only doesn't it increase real productivity, it creates a maintenance nightmare.

      What I said was programmers produce the similar lines of code per day, regardless of language. If you are doubt this, you need to go study some more. It's been demonstrated over and over again. There are many things that do effect lines of code delivered of course - the biggest one being project size. Most programmers can deliver a 200 line debugged, working program in a day. Put the same programmer in a large project, and that can drop to 10 lines of code per day, which is far larger effect than language.

      You are right in that lines produced per day by a programmer is effected by language - but It's nothing like 20 to 1. This page shows 4 to 1 at the extreme; Smalltalk vs Assembler, with the assembler programmer producing 4 times as many lines of code as the smalltalk programmer. I guess that's to be expected give how much a meaning a smalltalk programmer can put into one line vs an assembler programmer. If you look at languages that are more similar - eg curly brace languages, you see a difference of only 2 to 1.

      If you look closely, you notice another odd thing. The less lines the programmers write, the more productive they are in delivering function points in general. Now if I had of said because the C programmer writes code faster than Rust productive, he will be less productive I'm sure you would have jumped on me from an even greater height and you would have managed to be more wrong than you are now. I don't know whether it's true for C and Rust, but "the more code a language lets you write in a day, the less productive you will be in it" is definitely a good rule of thumb. In the smalltalk vs assembler case, the smalltalk programmer delivers 3 times as many function points as the assembler program per unit time, while writing 1/4 of the amount of code! If it is true for C and Rust, it annihilates your suggestion that over the life of a project C would be more productive that a Rust.

      Lines of code is not the measure of productivity when two thirds of them require debugging or rewriting because the idiot didn't know what they were doing and used a hammer to drive a screw.

      True. Which is why it isn't measured that way. The usual measure is the total non comment lines delivered over the total time it took to deliver the project, divided by the number of people employed to do it - and that doesn't just include programmers. Here "delivered" means debugged and in production. Which is how a large project ends with with abysmal figures like 10 lines per day. If a language encourages buggy code, which is thrown away that counts against it, not for it.

  20. C like languages by angel'o'sphere · · Score: 1

    What if I need another engineer to work on the code?
    If we are talking about 'C-like' languages, Rust, D, Java, C# ...mI would guess such an engeneer is in the wrong profession, no? Implying he can not cope with Rust, as I understood you.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  21. Rust is nice, but rough around the edges by Anonymous Coward · · Score: 0

    I tried going head first into using Rust, and it has a lot of strong things going for it. It's built on a solid LLVM foundation and it's community is really friendly and helpful. The problem I had was that the abstractions provided by rust often made to many assumptions on behalf of the programmer, sometimes entirely hiding features that I've come to expect, like being able to set the listen backlog size for a TCP socket. This is something Go also hides from the programmer but more mature languages like Python expose these parameters to tweak as you'd like. I'm averse to any abstractions that take away power from the developer or require strange workarounds.

    1. Re:Rust is nice, but rough around the edges by zAPPzAPP · · Score: 1

      I am struggling to understand how the 'listen backlog size for a TCP socket' could be a feature of a 'C like' language.
      Are TCP sockets a fundamental variable type in Rust?

    2. Re:Rust is nice, but rough around the edges by fnj · · Score: 1

      Are TCP sockets a fundamental variable type in Rust?

      No. But std::net in the standard library implements socket support. Presumably it is assumed that the user who needs a socket is going to use this, although of course calls to a C socket libraries could be made if std::net is not sufficiently flexible.

    3. Re:Rust is nice, but rough around the edges by mwvdlee · · Score: 1

      Sounds more like a library issue to me. It is a hallmark of a badly designed library though. Making common things easy is good, making common things easy while making uncommon things impossible is bad.

      The default TCP settings may be perfect for 99% of the time. For the remaining 1%, this library is useless.
      If you think this may be fine, let me ask you this; have you ever created a program which didn't have atleast one uncommon "1%" thing in it?

      A programmer who believes there is no possible way some particular feature would ever need to be used, is a programmer who is too unexperienced and entirely unqualified for his job.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    4. Re:Rust is nice, but rough around the edges by Anonymous Coward · · Score: 0

      The uncommon things are totally possible, as Rust has simple FFI to C, making it capable of calling through to the system and having all the fun times you need.

      Rust is unusual for a language in that they are on a 6 week release cadence. Because new features land regularly, stability of the API is more important than jamming in every possible feature from the beginning.

      Basically, when it comes to Rust, all of your instincts from other systems languages are wrong, because Rust makes them all look like shit.

  22. Being a Pioneer by JustChapman · · Score: 1

    It might be exciting to be a pioneer. But just remember, pioneers sometimes got their wagons burned.

  23. Is Rust written in Rust? by Mirar · · Score: 1

    If Rust, the compiler and everything is written in Rust, then I would trust it.

    It looks like it's written in big parts in C and C++.

    Don't know if it's glue to the rest of the system or that Rust wasn't good enough.
    Maybe someone can elaborate?

    1. Re:Is Rust written in Rust? by Anonymous Coward · · Score: 0

      The rust compiler is written in rust.

      https://github.com/rust-lang/rust

    2. Re:Is Rust written in Rust? by angel'o'sphere · · Score: 1

      I'm not aware of a 'compiler compiler' aka parser and scanner generator, that generates Rust code.
      So bootstrapping the language with itself requires a parser generator that emits Rust ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:Is Rust written in Rust? by UnknownSoldier · · Score: 1

      * https://github.com/rust-lang/r...

      Building from Source

      Make sure you have installed the dependencies:

      * g++ 4.7 or clang++ 3.x

      Notes:

      Since the Rust compiler is written in Rust, it must be built by a precompiled "snapshot" version of itself (made in an earlier state of development). As such, source builds require a connection to the Internet, to fetch snapshots, and an OS that can execute the available snapshot binaries.

    4. Re:Is Rust written in Rust? by dmoen · · Score: 1

      The Rust compiler and runtime system are written in Rust.

      The compiler uses the LLVM library for code generation, which is a C++ library, so there is a bit of C++ glue code to interface the compiler to LLVM.

      The runtime uses parts of the C library to make system calls, so there is a bit of C glue code to interface the runtime to the C library.

      --
      I have written a truly remarkable program which this sig is too small to contain.
    5. Re:Is Rust written in Rust? by Anonymous Coward · · Score: 0

      The rust compiler is written fully in Rust. It emits LLVM bytecode which is then compiled by LLVM. The requirement of gcc or clang is for LLVM.

  24. Talk to hardware? by selectspec · · Score: 1

    A lot depends on where and how you want to talk to the hardware. Last time I checked, the kernel (or kernel driver) is the only thing directly writing to memory space mapped to actual hardware and the kernel is the only space where you are catching CPU interrupts. Depending on your platform, the kernel is very likely going to be written in C.

    If you are making calls to the kernel drivers from userspace via kernel file interface, ioctls, or some other user-to-kernel API, then you can do that in just about any language that you want.

    Maybe I am missing something here.

    --

    Someone you trust is one of us.

  25. Newer is rarely better by Anonymous Coward · · Score: 1, Insightful

    C may be old, but it's a known entity, you can get plenty of help, it will around in 10 years whereas Rust may not be in use then. The level of C knowledge out there is very high, and should you need help with anything, you can get that help. Not so with Rust.

    I constantly fight the "newer is better" crowd at work, and I refuse to budge. If it works, it doesn't need fixing. I dislike change for the sake of change. I refuse, for example, to ever use Windows Server when my Linux machines work. I refuse to use IIS for anything. Compared to nginx, it sucks, and there is nothing to gain by my going there. DItto Python over Perl, when I have stuff that is working under Perl, there is little point in writing it in Python just because it's more modern.

    C has warts, but its track record is impressive. I refuse to use something that doesn't have years of a good track record. I need to be able to see the mistakes others have made, their fixes, their ideas, what worked for them. Talk with them if possible. Cannot do this with new stuff.

    1. Re: Newer is rarely better by Anonymous Coward · · Score: 0

      Nginx is significantly newer than IIS.
      It's also newer than Apache.

    2. Re: Newer is rarely better by Anonymous Coward · · Score: 0

      And we just started using it last year after vetting it. Apache is good, but we needed fast. nginx is orders of magnitude faster than Apache and when you are running online auctions, you need the speed because when the auction snipers hit at the last 15 seconds, Apache was getting bogged down under the load, whereas nginx under FreeBSD just doesn't even notice. It's amazing how much faster it really is on the same hardware, even.

      nginix as developed well to begin with. It's much better designed than Apache. Have a look for yourself.

    3. Re: Newer is rarely better by garethjrowlands · · Score: 1

      GP didn't say nginx wasn't good, merely that it was newer than IIS.

      You're right that apache is slow and nginx is much faster. But did you know lots of web servers are as fast as nginx? Notably, that includes IIS (no, I'm not saying you should use IIS).

    4. Re: Newer is rarely better by Anonymous Coward · · Score: 0

      [Mature > Immature] != [Older > Newer]

  26. Use the right tool for the job by krazdon · · Score: 1

    Most problems you need to solve already have libraries to make it easy. So figure out what your specific problem is, find the right library and language combination that best supports you. If you really care about performance, or some other specific metric, then you might need to use another language, but in general, I'd say use the your favorite language that supports the library you need to achieve your goal. I am currently using C#, javascript, java, C++, shellscript, and a couple other languages. And for each additional feature, I ask myself what is the best tool for the job. There are many ways for different languages to inter-operate, so don't feel that you are confined for just one language. If you think that rust is the best language for a particular task, use it and integrate it with the rest of your code. And if later you decide that another language is better at doing that task, someone can port that one task without having to rewrite your whole stack.

  27. Long-term support by Anonymous Coward · · Score: 1

    You're writing software for the embedded/industrial market. Someone will have to deal with your pile of poo in 10 years. Will Rust be around in 10 years?

    1. Re:Long-term support by Anonymous Coward · · Score: 0
      I routinely do code maintenance for embedded systems designed and built in the 1970's.

      It works (and has for decades), does exactly what it's supposed to, has billions of dollars invested in it, cost a billion dollars to get it certified the first time. It's not in C, and costs more to maintain than if it were C (or rust or whatever), but any potential benefits of converting to anything else would be orders of magnitude lower than the risk of replacing it with something new. Why place billions of dollars of hardware and lives at risk in order for whatever? And FWIW, I can usually knock out sensor driver in a few hours in C or asm. That shouldn't be a big deal in any language if you understand what you are doing.

    2. Re:Long-term support by dmoen · · Score: 1

      Rust has already been around for 10 years. The project started in 2006 as a hobby project, and "went big" in 2009 when people could play with a working Rust compiler, and Mozilla sponsored it. There are currently 1200 contributers to the Rust project. Given all the momentum, it will likely be around 10 years from now.

      --
      I have written a truly remarkable program which this sig is too small to contain.
    3. Re:Long-term support by Anonymous Coward · · Score: 0

      Then I definitely wouldn't allow him to use it. Any project that has been around for 10 years and has such poor penetration is a loser.

  28. Rust = Rustic Sandbox Environment by Anonymous Coward · · Score: 0

    As long as you gather your needed resources, know how to craft any additional tools you may need, you should do just fine. If you are a pro however, all you need is a Rock!

  29. Rust Lacks OOM Handling by Anonymous Coward · · Score: 0

    You can't catch out-of-memory errors in Rust, which presumably is important in long-running embedded projects, and with possibly constrained memory.

    Of course, Rust developers will tell you that that's not true; that only the standard library panics on OOM; that the language itself allows writing code which handles OOM.

    The problem with that claim is that you can't use any boxed types if you want to handle OOM. Because Rust doesn't have pointers, and without boxed types and the Rust analyzer optimizing away copy-by-value, you're stuck using mutable references everywhere.

    But Rust was _intentionally_ designed to make using mutable references _very_ tedious. So, yes, you can handle OOM in Rust, if you don't actually care about writing any idiomatic Rust code at all And because mutable references are so constrained, you might even find yourself resorting to using the unsafe code mode of Rust the majority of the time, which pretty much defeats the entire purpose of using Rust.

    Rust was designed by GUI and game developers. GUIs and games will happily crash or, at best, exit when they run out of resources. (At worse they may play games with emergency memory pools, which is a bad idea without compiler help because it's difficult to test and make robust.) But in the embedded and server side you can't always be so carefree about those things, especially when you're not implementing a stateless service on a huge cluster. Crashing a thread that's juggling thousands of sessions just because the thousandth-and-one session happened to trigger OOM (maybe because of malicious input parameters, or because the process was in a sandbox with a constrained memory allotment) isn't how you write quality code. You could implement hacks, like keeping a watchdog thread around to resume event handling, but that's not _composable_; you can't hide hacks like that behind an interface.

    That said, if handling OOM doesn't matter to you, then Rust is definitely a solid choice.

    Rust should add rudimentary support for exceptions, something like Go's defer/panic, to be able to catch a stack unwind.

    FWIW, the Lua scripting language might also be an option. It's better than Python in terms of language abstractions--true coroutines, full lexical closures--and faster to boot. It integrates with C better than any other scripting language around, either embedded within C or driving C code. And it actually permits catching and recovering from OOM, both from Lua script and from C code. (OOM is just an exception that can be caught anywhere.) The mainline implementation might even work for you out-of-the-box. If not there are quality forks (like eLua) geared toward smaller embedded systems, down to environments with just 32 kilobytes of memory and no FPU.

    1. Re:Rust Lacks OOM Handling by 0123456 · · Score: 1

      If your embedded system can't be allowed to crash, you shouldn't be calling malloc(). At least, not once you've booted up and started running the main code.

      The embedded software I work with typically has fixed-size arrays allocated at startup, and explicitly handles cases where it doesn't have enough space in the array.

    2. Re:Rust Lacks OOM Handling by fnj · · Score: 1

      If your embedded system can't be allowed to crash, you shouldn't be calling malloc().

      That's more dogmatic than I would accept. I worked on a highly successful system that was full of malloc and free calls, which had to work autonomously for greater than one month submerged in the ocean with only brief surfacings with very low bandwidth RF connection. We had a lot of discipline and applied a lot of care and testing. There were times that in-service instances did crash, reboot, and continue operating, but these were rare. We did forensics to identify what happened and correct the error. I was highly impressed by the operation.

    3. Re:Rust Lacks OOM Handling by 0123456 · · Score: 1

      There were times that in-service instances did crash, reboot, and continue operating, but these were rare.

      Like I said... if your embedded system can't be allowed to crash.

      Clearly, yours could. For other systems, people die when they crash.

    4. Re:Rust Lacks OOM Handling by Anonymous Coward · · Score: 0

      These days embedded can mean anything from an OpenWRT router to a tiny microcontroller with a few bytes of memory, and everything in between.

      Yes, many embedded projects require fixed resource allocation upfront, including constraints on maximum stack size.

      But many embedded projects require dynamic resource allocation, because the inputs, outputs, and number of requests can be highly variable.

      Increasingly embedded is often the latter because the tasks required of many modern devices are much more complex and low-power hardware is becoming more powerful.

      Furthermore, when you write libraries and other reuseable components you often want to be agnostic about these things. For example, I always try to write my libraries 1) to propogate OOM cleanly up the stack, like any other error; 2) not assume a threaded model or even a reactor/callback model--instead the library is usually written with a stepping function that resumes an internal state machine so it's useable from threaded code, readiness notification callbacks, completion callbacks, etc.

      If the calling application only panics on OOM, good. If it handles OOM, good. If it's threaded, good. If it's using epoll, good. If it's using libevent buffers or Windows completion ports, good.

      Writing code carefully this way also makes unit testing much easier, BTW, because one of the most difficult tasks in unit testing is bootstrapping an execution context. For example, how do you test an HTTP server? The naive way is by firing up the HTTP server and sending requests on a socket, but your code coverage will be horrible. If all the subcomponents can be exercised individually without having to mimic a live environment (event loops, etc), testing and debugging is infinitely easier, especially testing failure paths and difficult to reach corners.

    5. Re:Rust Lacks OOM Handling by ras · · Score: 1

      Rust should add rudimentary support for exceptions

      It does have exactly that, rudimentary being the operative word. It has panic(), which doesn't kill the program but does kill a much larger unit of it (a thread actually) then try/except/finally normally controls. Still, it's enough to recover from things like out of memory, because it guarantees the memory will be freed.

      The reason it has only rudimentary exceptions is because it can do the by combining it's type inference engine with it's spectacularly powerful macroing system. The type system allows you return arbitrary stuff with the caller really having to know or care (because it has an implicit type generation), and they have provided a "try!" macro in the standard library. So it's all there, just not done in the conventional way.

      And in case you are wondering why force you to learn this newfangled way when the old way worked perfectly well - it's because the old way imposed run time over heads on everything. The new way handles it in the type system so overheads disappear at compile time.

      It's just a repeat of Rust's memory handling solution, really. In C you handle memory allocation and exceptions manually, with all sorts of nasty consequences like dangling pointers and people dereferencing NULL. Java/C#/YouNameIt eliminates the nasty consequences using run time solutions like gc and exceptions - but they impose a runtime overhead. Rust brings something totally new to the table - the programmer handles it, but the language eliminates all the nasty consequences. So it's fast like C, and safe like Java/C#/YouNameIt. But there is nothing free in this world. Rust's extracts it's pound of programmer flesh with it's borrow checker.

    6. Re:Rust Lacks OOM Handling by garethjrowlands · · Score: 1

      Looks to me like the problem with OOM is the standard library. You probably want to avoid the Rust standard library when doing safety critical embedded.

      https://users.rust-lang.org/t/...

    7. Re:Rust Lacks OOM Handling by Anonymous Coward · · Score: 0

      Or you could just do what a competent programmer is supposed to do - check the fucking return value, and write code with commit-or-rollback semantics. We're not all so sloppy as to just dereference NULL pointers. You have no idea what you're talking about.

    8. Re:Rust Lacks OOM Handling by Anonymous Coward · · Score: 0

      Because Rust dropped coroutines, a task in Rust is a kernel thread. If you dedicate a kernel thread to each context where you might want to contain an OOM, then your application won't be very scalable. It's also much more difficult to implement fine-grained commit/rollback semantics this way.

      There are workarounds (e.g. global queue of "jobs"), but as I mentioned before they're not composable. They're hacks. They don't allow you to hide these details behind an interface, but require the entire application stack to follow your execution model. That's not a good prescription for writing reuseable, robust code.

      All Rust needs is a way to catch a panic without destroying the thread. If it panics again, then unwind again. Lua manages to do this, very cleanly I might add. And Rust _already_ does this, because it's carefully unwinding the stack so it can release objects.

      Telling people to simply avoid using the standard library and resort to mutable references and raw pointers is _stupid_. Rust is a horrible language if you're using raw pointers. C is much more powerful once you strip away Rust's constraint checker and optimizer. Large parts of Rust syntax and design are just ugly and very NIH, but one can look past them because of what makes it unique. Take that uniqueness way and it's an atrocious language.

    9. Re:Rust Lacks OOM Handling by Grishnakh · · Score: 1

      That's more dogmatic than I would accept.

      Then you're completely unqualified to work on avionics code under DO-178B. Freeing memory is strictly forbidden. If you have to free memory, you're doing something wrong.

  30. It depends... by JustAnotherOldGuy · · Score: 1

    Now I'm heading a project that uses a RoR application...

    To quote an old Irishman I knew once, "Oh boy, now yez' inna helluva fix!" :)

    But seriously, as for what language to use, that would be one that you know and are familiar with that can do what you need it to do.

    In other words, I have no idea because there wasn't really enough specific info in your post for me to take a good guess. Sometimes it's best to work backwards and figure out what tools or languages won't work or aren't suited to the task. That can often help narrow down the list of possible choices, of which there are many.

    --
    Just cruising through this digital world at 33 1/3 rpm...
  31. Use C by Anonymous Coward · · Score: 0

    Tell your young punk to learn C and like it. If he can't work with C, fire him and find someone who can.

  32. It's just a gem by Anonymous Coward · · Score: 0

    Why bother with anything other than C (or C++)? I've written lots of gems in both C and C++ and they're typically on the short side and usually only contain just enough to talk to whatever library you need to. It's not worth bothering with another language.

    You can also consider using FFI but that also has its pros and cons.

    1. Re:It's just a gem by dargaud · · Score: 1

      I'm a C hardware programmer and I have no idea what a GEM extension is. I tried to look it up, but it seems to be a term relevant to the Ruby world. So, I'm interested in this thread, but I have no idea what Rust or Gem are.

      --
      Non-Linux Penguins ?
    2. Re:It's just a gem by NotInHere · · Score: 1

      I think this is somebody trolling. FFI and gem are common fanboy words.

    3. Re:It's just a gem by phantomfive · · Score: 1

      A gem extension is a way to call into C from Ruby. I think that's what the GP is referring to.

      --
      "First they came for the slanderers and i said nothing."
    4. Re:It's just a gem by Anonymous Coward · · Score: 0

      A Gem is a Ruby package.

  33. No by Anonymous Coward · · Score: 0

    If your junior dev wants to play with Rust on a project, he should do it on his own time, not the company's. A language that's just went to 1.0 this year has no business being used in a production environment. Junior devs never understand that.

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

      Yes, the junior devs should beta test compilers/languages on their own time. After 3 to 5 years of free labor by thousands of programmers, most companies will be able to determine if Rust is worthy of production. It's called free testing.

  34. He could by DarkOx · · Score: 1

    said he could write the extensions needed easily in Rust.

    This is probably true but its also aggressively stupid. Ruby, Matz Ruby anyway, is a C program, Rubinius is a C++ program, JRuby is Java. The point of writing Ruby extensions obviously is so that you can leverage the expressive power of the high level interpreted language to get stuff done fast and safely while interfacing whatever it is you need to interface.

    Your extensions should not be complex. They really should allocate a little memory to store what needs to be stored, and do some type conversions from Ruby's more primitive types to whatever you interface needs to see and not much more. The thinking should happen in Ruby. If you are writing all kinds of smarts and logic into extension itself you are probably doing it wrong.

    So why would you introduce a third language technology to the stack? A C extension should be quick to audit and verify. There are also lots and lots of people familiar with writing ruby extensions in C, few in Rust.

    I think Rust is cool but this isn't a Job for Rust. Now implementing RRuby might be!

    --
    Repeal the 17th Amendment TODAY! Also Please Read http://www.gnu.org/philosophy/right-to-read.html
  35. Rust is cool by radish · · Score: 3, Insightful

    But it's still immature. I wouldn't personally use it for anything important.

    --

    ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

    1. Re:Rust is cool by Anonymous Coward · · Score: 0

      I wouldn't personally use it for anything important.

      What about impersonally using it for something important?

  36. GO has more production use by Anonymous Coward · · Score: 0

    I can't believe, in a world being transformed by various GO-based projects, that Rust is the question which surfaces.

  37. Have you considered replacing C with DevOps? by Anonymous Coward · · Score: 0

    DevOps solves all problems!

  38. Maybe? by jandrese · · Score: 1

    I've heard Rust mentioned a few times so I decided to give the manual a once over to see what it is all about. First impression is that it is a very C like language, except that the memory model is highly regulated. This is good in some ways, it should be nearly impossible to screw up your memory handling with normal code making it safer by default. However, in my brief glance over I can't see any way to allocate a block of memory at runtime, which seems like a significant drawback. The language appears to have "C Programmers Disease" baked into the specification. There is a brief mention in the vector section that they are growable and live on the heap, but doesn't give the syntax for this (nor the syntax to shrink them later!). The docs also make a huge dance around "borrowing" that smells a lot like someone avoiding the dreaded "P word".

    It looks like a neat language and I'm willing to give it a shot but I don't see this exploding in popularity anytime soon. There is always the chicken and egg problem with new languages that people don't want to learn it until it has a decent ecosystem, but it won't grow an ecosystem until people start using it.

    --

    I read the internet for the articles.
    1. Re:Maybe? by ras · · Score: 1

      However, in my brief glance over I can't see any way to allocate a block of memory at runtime

      Jeezze, you weren't kidding when you said brief. An Overview of Memory Management in Rust.

    2. Re:Maybe? by NotInHere · · Score: 1

      Some things rust guarantees, others it doesn't:
      https://doc.rust-lang.org/nigh...

      Rust considers it "safe" to:
              Deadlock
              Have a race condition (https://doc.rust-lang.org/nightly/nomicon/races.html)
              Leak memory
              Fail to call destructors
              Overflow integers
              Abort the program
              Delete the production database

    3. Re:Maybe? by jandrese · · Score: 1

      Would have been nice if the official manual mentioned some of this...

      It also doesn't mention the one thing I wasn't clear on. Can you go:
      let size :u32 = readbytes(protocolStream, 4);
      if makes_sense(size)
      let data :protocolstruct = readbytes(protocolStream, size);


      I know I made a total hash of the syntax there, but you get the idea I hope.

      --

      I read the internet for the articles.
    4. Re:Maybe? by jandrese · · Score: 1

      Well, I guess we can't be too hard on the Rust developers for not solving the halting problem.

      --

      I read the internet for the articles.
    5. Re:Maybe? by ras · · Score: 1

      Can you go:

      Of course you can, syntax notwithstanding. But asking questions here is an awful way to learn the capabilities of Rust given they have published a free online book to teach you just that. It would only take you a day to work through the entire thing. It being open source and all, once you have done that next step would be to look up the code for the standard libraries for that that does something like you want. There is nothing like studying the work of an expert in the field to get you up to speed fast. They even give an example that looks like yours in the standard library doco.

    6. Re:Maybe? by jandrese · · Score: 1

      That book is what I was reading (and linked to in my post).

      --

      I read the internet for the articles.
  39. Not if you need to suspend code by sconeu · · Score: 1

    If your code has to suspend itself for a specified period of time, then I would not recommend using Rust. Remember...

    Rust never sleeps.

    --
    General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    1. Re:Not if you need to suspend code by mmmmbeer · · Score: 1

      I should've seen that coming, but it was out of the blue.

    2. Re:Not if you need to suspend code by Anonymous Coward · · Score: 0

      Is that you, Neil?

  40. Another Option by Feneric · · Score: 1

    Alternatively you could try using a modern language like Nim that'll give you the same sorts of benefits as Rust, but allows compilation into C so you have the same expectations and performance as you would with C.

  41. Concentrate on the Employee by TechyImmigrant · · Score: 4, Insightful

    The engineer pushing for rust is emphatic, should I bulldoze him or take the plunge?

    Take yourself out of the loop. Give it to the engineer. He/she wants to push it. Let him/her. Make the engineer responsible for pushing it, training people, documenting the procedures. Provide room to enable it to happen.

    This is how the engineer grows and an engineer and how you grow as a manager, learning to trust the technical opinion of those doing to technical work.

    --
    I should use this sig to advertise my book ISBN-13 : 978-1501515132.
    1. Re:Concentrate on the Employee by Anonymous Coward · · Score: 0

      Indeed.
      After 20 years of work, many programming languages and many projects I realized the tech you choose doesn't matter. People matter way more. If you deny his toy(Rust), he will hate you forever.

    2. Re:Concentrate on the Employee by Anonymous Coward · · Score: 0

      I usually play it similar to the above.
      If the engineer wants Rust so badly, let them use it. But that engineer will be responsible for that software until another engineer voluntarily accepts responsibility.
      That usually happens in one of two ways:
      a) The new engineer is properly mentored and understands the software well enough to take it
      b) The new engineer is just as passionate to "fix" the situation that has been created by using this odd language by rewriting it in...

  42. That'll work well. by Anonymous Coward · · Score: 0

    A replacement for C without pointers, for stupid people? That'll work well. How does one use memory mapped registers and write device drivers without them? C is hear to stay. I only wish more effort was made to make C and C++ completely upwardly compatible.

    1. Re:That'll work well. by Anonymous Coward · · Score: 0

      Rust has pointers, dumbass

  43. Not a real engineer if you can't program in C by Anonymous Coward · · Score: 0

    Obviously your not a real engineer if you can't program in C

  44. Consider this by Anonymous Coward · · Score: 0

    It's part of the rugged manifesto that I have on the wall of my cube:

    "my code will be used in ways i cannot anticipate, in ways it was not designed, and for longer than it was ever intended."

    Does it still seem like a good idea?

    1. Re:Consider this by Anonymous Coward · · Score: 0

      And maintained by people who are not as smart and or experienced as I am.

  45. Perhaps a compromise? by Anonymous Coward · · Score: 0

    You want to use C because you're familiar with C. He wants to use Rust because he's familiar with Rust. You should compromise and use Scheme instead.

  46. Good software engineers can learn new languages. by bezenek · · Score: 1

    A good software engineer should be able to learn a new language in a week or so. If there is something inherent in the language which makes this not possible, e.g. pointers, generics, functional v. procedural, etc., then the software engineer has a gaping hole in his/her knowledge and may need some additional training.

    That point aside, I think the discussion here makes the decision C, mostly because of unknown future support for Rust--it is too new to know.

    Unless C has an easily describable deficiency which will be covered by a different language, there is no argument here.

    An engineer not being willing/able to learn C does not count as a deficiency in C. The same is true for Rust.

    Also, if one particular engineer has a strong preference for Rust, for the preference to be an informed decision, the engineer must already be familiar with C, so there should be no problem for that engineer to work in C if the decision goes that way.

    --
    Omne ignotum pro magnifico.
  47. C does not need replacement by flarflue · · Score: 1

    it is not the C language that is the problem, it is the programmers who are using it that are the problem. they are not educated in good programming practices. most people who want to be programmers should never be allowed to become programmers. unfortunately right now lots of narcissistic nerds want to become programmers because they think it's glamorous somehow.

    1. Re: C does not need replacement by Anonymous Coward · · Score: 0

      The same could be said of PHP or JavaScript, so I don't know what your point is. Use the right language for the job, don't try to shoe-horn C into everything. That's the first rule you should have learned if you feel so much further up the ivory tower compared to other developers.

    2. Re: C does not need replacement by Anonymous Coward · · Score: 0

      Sure, that's one way of looking at it. Maybe you're one of the handful of programmers in the world that can write complicated C code with no bugs. Maybe you've never had to debug a memory corruption bug in your C code. Maybe all of your resources like memory are always allocated and freed correctly and never have dangling references. Maybe all of your mulithreaded code never has race conditions.

      History shows us that some of the best teams in the world aren't as good as a programmer as you. Auditing the security of a multi-million line C code base is a daunting task. Look at the constant security problems from large C and C++ code bases.

      https://www.mozilla.org/en-US/security/known-vulnerabilities/firefox/

      It's 2015 and we're still constantly dealing with buffer overflows and dangling pointers causing real security problems. Garbage collected memory safe languages have shown that we can do better. Do they solve ever security problem? No. But preventing large classes of security problems from the beginning has VALUE. It protects your users. It makes security auditing easier.

    3. Re: C does not need replacement by rrr00bb5454 · · Score: 1

      Actually, the environment has changed since C was created. C is still wonderful for programs that are small. It's perfect for an environment of static allocation. It gets its speed *precisely* from assuming that undefined behavior does not happen. This alone makes it terrible a terrible choice for large programs that must stand up to malicious input (let alone bad coding - and even sabotage that slips past code review). The world's cryptography libraries are a fantastic case in point, where the best developers in the world are constantly having their security broken The input that modern programs must consume generally requires Turing Complete recognition. It asks the code to solve NP-complete problems and Undecidable problems at the time the code is written, and at runtime. On Windows systems, more CPU time is wasted running Virus scanners and ad-hoc security checkers than would be consumed by simply having applications just be written in more verifiable languages. This mostly boils down to having type systems which can be verified. https://web.eecs.umich.edu/~pr... Rust has issues in embedded settings, but it's not a fat and lazy language. You can run Valgrind on Rust binaries, as its output is essentially the same as C. There is a lot wrong with C from the point of verification. At the moment, you can't simply assert to the compiler (in C) that if there are type system violations that you don't even want the binary to be produced. Not even for small programs. The software industry needs to grow the hell up and start making systems that can be certified for safety.

    4. Re: C does not need replacement by rrr00bb5454 · · Score: 1

      I would also add other things that changed since Unix/C came out: 1) The whole Unix design is the bottleneck in large servers. Read about "Data Planes" and the 10MillionConnection problem. 2) Physical memory protection and Kernel/Userspace split impose horrible costs. There is a reason that extremely high end server systems essentially run as userspace processes that binds some cores and some ethernets together and basically disables the kernel -- which puts every single thing into one gigantic process. 3) If something needs to be produced, there is a dollar amount that can be sunk into it. If it requires a large group of the most expensive developers, it will simply never be built for economic reasons. Therefore, we see a lot of half-baked stuff get built instead.

    5. Re: C does not need replacement by hey! · · Score: 1

      Well, you have to work with the programmers that there are; not the programmers you wish there were.

      I learned C in 1980; it was a thing of beauty, a work of genius that transformed the industry. That doesn't mean it has to be all things to all people. In fact that's C's great strength; it's just enough of the very most useful things to enough people to make important systems programs like interpreters for other languages portable across many environments. The flip side of that is that for certain scenarios there's bound to be languages that are a better fit than C.

      So if C's reliance on pointers or programmer managed memory allocation creates problems with the pool of programmers you have ready access to, the answer isn't to stamp your foot and wish all programmers were like they were back into the good old days of Unix 7; it's to use something else.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    6. Re: C does not need replacement by flarflue · · Score: 1

      This is an industry that knowingly and liberally discriminates against older workers who use the C language more wisely. Could it be that you've been involved in downsizing older workers?

    7. Re: C does not need replacement by Grishnakh · · Score: 1

      Exactly. So if your programming team aren't all experts in C, you need to just fire them all, and hire ones who are. Expert-level C programmers are everywhere these days, and can be hired cheaply. Your company's upper management will have no problem with you taking extra time to find enough expert-level C programmers and get them hired and started in the company.

    8. Re: C does not need replacement by flarflue · · Score: 1

      Unless of course
      (1) if upper management is evangelical about outsourcing, in which case they utterly refuse to hire local citizens, [ this happens in the USA but I have also seen it in the Netherlands] or
      (2) if hiring managers are of one certain ethnicity and refuse to hire anyone outside that one narrow ethnicity, like you might see at Samsung, Oracle, Cisco, Infosys, Tata, Ebay, etc.. [ speaking from experience ] or
      (3) the hiring managers are all 20- somethings who view older workers as being like primitive cave dwellers because they use the command line on occasion instead of Xcode.

  48. Embedded by Anonymous Coward · · Score: 0

    Unless you might want to switch architectures in 2 years, and you don't want to only choose from architectures with good C++ compilers.

    1. Re:Embedded by serviscope_minor · · Score: 1

      Unless you might want to switch architectures in 2 years, and you don't want to only choose from architectures with good C++ compilers.,

      At this point, it's segmented PICs (? maybe) and obscure DSPs without C++ compilers. Just about everything else is supported by GCC a or IAR, both of which compile C++, though IAR is about 5 years out of date in that regard.

      In any case if you're that deep embedded, porting is basically a rewrite anyway.

      --
      SJW n. One who posts facts.
    2. Re:Embedded by Anonymous Coward · · Score: 0

      Why change something that works

    3. Re:Embedded by Anonymous Coward · · Score: 0

      GP here.

      Unless you might want to switch architectures in 2 years, and you don't want to only choose from architectures with good C++ compilers.,

      At this point, it's segmented PICs (? maybe) and obscure DSPs without C++ compilers. Just about everything else is supported by GCC a or IAR, both of which compile C++, though IAR is about 5 years out of date in that regard.

      I'll have to take your word for that. I've used IAR compilers, but not with C++.

      In any case if you're that deep embedded, porting is basically a rewrite anyway.

      That is simply not true.

    4. Re:Embedded by serviscope_minor · · Score: 1

      That is simply not true.

      I was referring to the tiny micros, not the DSPs, though that's not clear. When fiddling with those tiny micros, the majority of the code is register tweaking to set up the peripherals correctly. None of that's portable to a different manufacturer.

      --
      SJW n. One who posts facts.
  49. What is that project for? by janoc · · Score: 1

    If it is just for fun, go ahead and play with Rust. You can write C-compatible libraries with it no problem.

    If it is for work, however ... Stay with your C.

    Rust is nice and everything, but the ecosystem is incredibly small. There are few libraries for it, many are already unmaintained and/or not working. Also the tooling (IDEs, compiler, the cargo build tool, etc.) are fairly immature. I have been looking at it recently with the goal of writing some extension modules for Node.js & .NET, but I went back to regular C for this reason.

  50. I don't know about replacing C by morgauxo · · Score: 1

    I don't know about replacing C but my car certainly seems to think that replacing Fe with rust is a practical thing to do!

  51. No. by cowtamer · · Score: 1

    C has probably been around longer than you have. Rust probably isn't even a blip on the radar.

    Be very wary of embracing immature technology for anything that matters. There are good reasons to do it, but they have to be EXTREMELY good reasons.

    Otherwise, even if the tech succeeds, you will be stuck with a code base with immature and deprecated idioms. (Note the very old Java applets you sometimes see on the web that modern versions of Java make nearly impossible to run. So much for "write once run anywhere". There are no such programs written in ANSI C -- unless they involve 3rd party libraries).

    You will also have to deal with buggy and immature developer tools and will spend weeks debugging problems that might be resolved with a simple Google search in C.

    I have learned this the hard way, unfortunately..

  52. Don't rewrite the extensions! by Anonymous Coward · · Score: 0

    Sounds like the C extensions already exist and are proven to work. Rewriting them in ANY language is just making work for yourselves.

  53. The phrase heard prior to many disasters.. by Anonymous Coward · · Score: 0

    Cool story bro. Here.. hold my beer and watch this... *CRASH*

  54. The "Ownership Is Theft" paper on Embedded Rust by Anonymous Coward · · Score: 0

    This is an attempt, with some credible gripes about what Rust is not doing correctly in this respect. Rust's type system is too tight for sections of code that are guaranteed to be single threaded.

    https://web.eecs.umich.edu/~prabal/pubs/papers/levy15ownership.pdf

    1. Re:The "Ownership Is Theft" paper on Embedded Rust by Anonymous Coward · · Score: 0

      The restrictions aren't only useful in multithreaded code. They also prevent things like iterator invalidation.

  55. Obvious solution... by LynnwoodRooster · · Score: 1

    Let the new engineer write in Rust, and you write a Rust interpreter in C! Both sides win, right?

    --
    Browsing at +1 - no ACs, I ignore their posts. So refreshing!
  56. Compilers by Anonymous Coward · · Score: 0

    I've heard the comments that C/C++ have compilers and toolchains for every architecture out there; however when you factor in Rust's support for the Ono-Sendax 7 I think its a win.

  57. Rust may actually be a safer choice by raboofje · · Score: 1

    Rust's type system provides protections against some problems that can be quite hard to debug in C.

    Between having a programmer that is inexperienced in C writing C code and having a programmer inexperienced in Rust writing Rust code, arguably you might be better off with the latter.

    This sounds like a reasonably small component, so what is the worst that could happen? That you would have to rewrite it some day? I'd say go for it.

  58. Heading a project? by wnfJv8eC · · Score: 1

    OK. The answer is very simple. Does Rust buy you something, timing, memory space, cheaper architecture, that C doesn't. What the language buys is critical.

    You are producing code for a business that must maintain it going forward, after you are gone and your young enthusiastic engineer has gone off to find a better job. He will.

    Realtime control has limits that must be observed. After that the choice of languages is all about long term support. So check the hire boards and see how easy it will be to replace your young enthusiastic engineer. If easy, make sure the next hire or two has Rust under their belt. Or go with C. The next hire will know that language.

    What I 'like' is not relevant. I liked bash for most system level scripting, but often python is a better choice. So I use python.

    Last. Talk your choice out with the young engineer. Let him know you took him seriously, did your homework. He's follow your lead easier with that example.

  59. "What if I need someone to work on the code?" by Applehu+Akbar · · Score: 1

    No problem. Just tell HR to advertise for someone with ten years of Rust experience.

    1. Re:"What if I need someone to work on the code?" by Anonymous Coward · · Score: 0

      Might as well tell them to get in touch with Graydon Hoare, I think he's the only person with those qualifications until 2019 or so?

  60. I Reckon What You Have There by Greyfox · · Score: 1

    Looks like you have an engineer that wants to play with Rust on your dime. I've seen a lot of projects try to shoehorn a lot of shitty code in a lot of shitty languages into working because some jackass thought he could be more clever in that language. A few months later he's gone and you're stuck trying to maintain some abomination that tries to do asynchronous IO using threads in Ruby or some other goddamn shit. If you have an elevator shaft on hand, I suggest you acquaint him with the bottom of it, and then get on with your project.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  61. Depends on a lot of things, including workplace. by MouseTheLuckyDog · · Score: 1

    First is it really an engineer or is it you?
    If it is you then should have done enough independent rust projects to be able justify it to management without going on slashdot.

    If there is another engineer, ask to see his rust projects. Make sure they are complete and run them under valgrind or similar tool to make sure it's clean.

    Keep in mind he may want to do this project in Rust to put it on his resume and find a job where he does Rust full time.

    Finally keep this in mind. It's always the young engineers that hate C/C++. It was that way twenty years ago. Why?

    Because the young engineers go running to alternatives, and then wind up getting out of programming. Leaving us old timers who don't mind C/C++.

  62. Hold on by Anonymous Coward · · Score: 0

    RoR application to control a large series of sensors and controls in a manufacturing process

    Isn't that like the cart pulling the horse?

  63. So my story is... by Anonymous Coward · · Score: 1

    We had a similar situation. I won't bring up the language for fear of derailing the conversion but a new engineer had a favorite language and pushed for its use in a new project. Even though no one else on the team knew the language, we believed his tales of faster development time and unicorns and rainbows. Sadly, he left the company a few months and we ended up having to rewrite the stupid thing since once we started looking at what he had done, we realized it would be faster to just rewrite it so it ended up being 6 weeks of wasted time. My recommendation is that if you don't know the language, don't put yourself in the position of having to support it. Bulldoze away!

  64. Oblig. Shakespeare by Capt.Albatross · · Score: 1

    Glendower:
    I can call spirits from the vasty deep.

    Hotspur:
    Why, so can I, or so can any man;
    But will they come when you do call for them?

    - Henry IV, Part 1

  65. Assembly? by meburke · · Score: 1

    I suppose that if you want to be close to the hardware and you don't know assembly, C is OK.

    --
    "The mind works quicker than you think!"
  66. I prefer breathing C, thank you by Anonymous Coward · · Score: 0

    I don't know about you, but I prefer breathing in C and breathing out CO2. Somehow I detest the idea of breathing in Fe2O3

  67. Failures with IBM Computers by billstewart · · Score: 1

    The mainframe failed significantly twice that I knew about when I was in college. IIRC, it was a 370/168. Once was because the water-cooling plumbing leaked all over the motherboard. Another time was because it really didn't like it when they added the fourth megabyte.

    The System/34 minicomputer I used for a summer job failed because we were a steel fabricating company, and somebody in the shop was looking for the circuit breaker for his welder, and turned off our power instead. That would be fine, but our data entry clerk had been typing in a list of parts for a bid for six hours, and while the OS had saved where the file started on the disk when she opened it, it wouldn't save where the file ended until she closed it. So I spent about 5 hours on the phone with tech support, walking through the equivalent of fsdb to find all the blocks of the file, store their locations in the inode-equivalent, and write the end-of-file marker on the disk.

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
    1. Re:Failures with IBM Computers by stridebird · · Score: 3, Insightful

      So you spent 5 hours of your time, and 5 hours of tech support time, to avoid the data entry clerk spending 6 hours simply rekeying the data? Why? Doesn't sound like the right choice, unless the clerk had gone home already or something.

    2. Re:Failures with IBM Computers by towermac · · Score: 2

      Reminds me of the time the owner and his wannabe tech friend were poking around the IT closet one night, and mysteriously, our payments database crashed, corrupted, and unrecoverable. I spent all night trying to restore the previous days receipts. Hell, I even tried a hex editor to get something, anything. The file was complete garbage. Probably $100K unaccounted for, I was thinking the bank and investors are not going to like that, the company may be toast.

      The next morning, I told the accounting boss (owner's daughter) I had to use the backup, and all the payment records from the previous day were lost. She got the four accounting clerks to re-enter the previous days payments in about 30 minutes. Dang, no big deal.

      I learned a valuable lesson that day, and hopefully, so did the boss.

    3. Re:Failures with IBM Computers by billstewart · · Score: 1

      This was a summer job in college at a small company, and the data entry clerk probably got paid more than I did, and I was on a later shift than she was (since only one of us could use the computer at a time anyway.) I don't care what it cost IBM to pay their tech support people. And we didn't know it would take 5 hours to fix the thing when we started, or we would have talked about whether to just have her retype it.

      --

      Bill Stewart
      New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
  68. Clearly too early by Anonymous Coward · · Score: 0

    A bad idea, but what the hell, you might get to move on before it bites you. After all, it's other people's money and you can take the blame for this engineer, who will be on to something else as soon as it's time to debug some old rust code.

    Wait until it makes the Tiobe top 20.

  69. Learning pointers is easy - being careful isn't. by billstewart · · Score: 1

    Ok, I'm from a different era, but learning pointers wasn't that hard, though it was pretty much the key to C programming. It took a bit of reading library source code to really understand what K&R was saying about them, by seeing how other people used them, but they were amazingly simple and powerful.

    The problems with pointers were that you always had to be careful that they were pointing to something appropriate, and that you had to know how big the things they pointed to were (in case they were passed to you from somewhere else or you were passing them _to_ somewhere else), so you still had to always always ALWAYS be careful to either do bounds checking, or put sentinels into the data, as well as checking that a pointer that some function handed you wasn't NULL or some other evil value.

    And reading library source code included looking at things like strcpy() doing
      while(*feet++ = *bullets++);
    and noticing that it was much more efficient not to bother checking that "*bullets" would hit a zero before "*feet" ran out of places to store it, because obviously the person doing the function call would have checked that, so you didn't have to worry about shooting anybody else's feet. And then you have to learn not to do that yourself, which way too many people haven't learned over the last 35 years, which is why almost nobody should be allowed to program in C, even though it's my favorite programming language.

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
  70. Go C++ instead. by Chalnoth · · Score: 1

    C++, especially C++14, provides a lot of the nice features of a language like Rust, but will interact well with all of your existing C code. Far, far more engineers understand C++ well, so having somebody else pick up the project will be much less of a burden.

    The main drawback of C++ is that it can be a bit of a tricky language to use properly. There are some unfortunate caveats that require some level of expertise to write code that doesn't blow up once it goes beyond moderate complexity (I highly recommend Effective C++ as a good book to read on the subject).

  71. Learning curve by neoedmund · · Score: 1

    Rust is a language I feel I want to learn it when I saw it the first time after learned C,Java,Python. But as I go on, I found I must "Think in rust" and "Write code in rusty ways" to master it. Then I gave up.

  72. If you are to learn Rust, try Nim instead by Anonymous Coward · · Score: 0

    Rust is robust, but Nim goes many step beyond

    http://nim-lang.org/

    https://en.wikipedia.org/wiki/...

    1. Re: If you are to learn Rust, try Nim instead by Anonymous Coward · · Score: 0

      Nim is garbage-collected. Not really in the same league as C.

  73. what about OS's or small footprint? by Chirs · · Score: 1

    There's really no reason ever to use C over C++ if you have a C++ compiler available.

    What about for something like an OS? Or for tiny little embedded stuff where memory is an issue? (Honestly curious, I'm not current with the latest C++ developments.)

    1. Re:what about OS's or small footprint? by serviscope_minor · · Score: 2

      What about for something like an OS?

      The only coherent argument I've seen for writing an os C rather than C++ is the annoyance of setting up the C++ runtime (it can be done though). The only other arguments I've seen basically assume that the world of computing has not advanced since about 1995. What were valid points then are simply wrong now.

      Or for tiny little embedded stuff where memory is an issue? (Honestly curious, I'm not current with the latest C++ developments.)

      C++ doesn't use more memory than C. In fact because the language is more advanced, idiomatic code is often more efficient and less consuming of memory than C. C++ runs just fine on an ATtiny MCU and things don't get much smaller than that.

      Bear in mind C++ is almost a strict superset of C. Everything you can do in C, you can do in C++. But C++ is a more powerful language and it gives you the power without compromising on size or speed.

      --
      SJW n. One who posts facts.
    2. Re:what about OS's or small footprint? by Chibi+Merrow · · Score: 1

      Bjarne Stroustrup has always maintained that the ability to do systems programming is an essential feature of C++. It was designed that you should be able to write very resource-constrained, performant code when necessary.

      Not too long ago he wrote a very good essay on the benefits of languages like C++ for infrastructure programming, and how it can save memory (and electrical power, even).

      --
      Maxim: People cannot follow directions.
      Increases in truth directly with the length of time spent explaining them
  74. is it simpler for the case or not though. by gl4ss · · Score: 1

    that's actually not that big or long time to been around.

    the question I would pose would be.. would it be the same trouble to do it in C. it's just an interface that they're building so the rust code and C code are likely to be the same size and same complexity, heck they will be c externing the stuff for ruby anyways.

    so go with C. unless you want a pilot project in the company done with rust..

    --
    world was created 5 seconds before this post as it is.
  75. after the hype by Tom · · Score: 1

    There's a reason we still use C after all these years and one million attempts to replace it with something else. Most of the over-hyped C replacements have gone the way of the Dodo bird. Those who are still around bring something new to the table instead of trying to outdo C in its own domain.

    Unless you understand why this is so, don't even think about doing something else.

    --
    Assorted stuff I do sometimes: Lemuria.org
  76. I think this is actually coder incompetence by gweihir · · Score: 1

    There is this large number of younger coders that got into IT not because they love it, but because they thought it was a sure meal-ticket. These people are scared by things like pointer-handling or memory management, because they do not actually understand it. Then they jump on every new thing that comes around just because they hope it will make them appear less incompetent.

    The rabid pro-Rust crowd is an excellent example, because the benefits of Rust are not actually that remarkable and, in addition, both language and libraries are immature and hence should never be used in any production project at this time. Yes, they _can_ be used, but that would be hugely unprofessional and bring more problems with it than the language can solve. The one exception is the Rust developers themselves as they have to accept that drawback in order to get experience with their language. Nobody else has to and nobody else should.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  77. Re:Good software engineers can learn new languages by Anonymous Coward · · Score: 0

    This is so wrong. There are plenty of people using C/C++ who could be considered experts, yet still run up against corner cases in the language all the time. What you learn in a week might be enough for prototyping or exploring ideas, but it's not enough for production - not by a long shot.

  78. Let him rip! by business_kid · · Score: 1

    Ypu're a C programmer, but I gather ypu have stagnated somewhat and have a management function. He is still a programmer at the coal face. Let me hazard a guess that you have stopped working days and studying at night.

    You need to be a programmer OR a manager. If you're a programmer, get up to date( a huge job) and name 6 languages he could do the task in and learn at least three of them. Then stay up to date. If you're a manager, He is the professional. Do you trust his choice? Empower him.

    My son is a Swift (=Apple OS & IOS) programmer. He programs phones, watches, Apple TVs He can program in about 20 languages. He wrote a multitouch project in Chuck. Ever heard of that?

  79. Rust: It has great support to call into C code ?? by fygment · · Score: 1

    .. and so does C ...

    If you're going to call in to C libraries, then why use another language?

    --
    "Consensus" in science is _always_ a political construct.
  80. Probably by Elbows · · Score: 1

    Rust can give you precise control of memory layout, and supports inline assembly as well as calling C functions. So it ought to have everything you need for controlling hardware.

    Rust the language is young but stable (code you write now should continue to work in newer releases). And it sounds like this is a relatively small project that shouldn't need a ton of 3rd-party libraries, so the maturity of the library ecosystem isn't as big a concern.

    My experience was that Rust took a little getting used to but it's a pretty nice language. In addition to the safety guarantees, it gives you a lot of expressiveness compared to C++ and (especially) C -- algebraic datatypes, very nice iterators, lambdas, generics, etc. And I expect that any well-rounded developer with a good grasp of C could learn Rust pretty quickly.

  81. I had to walk 3 miles in the snow by Anonymous Coward · · Score: 0

    every time the paper jammed in the teletype

  82. Ha ha, this is one of my biggest issues... by Anonymous Coward · · Score: 0

    with younger programmers. With each new generation of coders there are new fads, presumably driven by professors pushing their own preferences as "best practices" to the young who do not seem to know when to ask questions. Each new language that comes along and each new set of ideas for what's best takes us further away from how the hardware actually works, adding the need for more memory and more speed to perform the same task.

    I noted this initially when "GOTO" (in any language) was declared EVIL as "structured programming" became all the rage. The microprocessors themselves use GOTO (aka JMP or Bcc, etc) all over the place and would not function without it. Structured programming traded code efficiency for guard-rails-by-practice benefits for less competent coders. Competent coders wrote perfectly good code full of GOTO-equivalent opcodes (google: Apollo Guidance Computer, etc)

    Now the EVIL enemy to be destroyed is the unmanaged pointer. The microprocessors themselves, of course, use such pointers as part of their basic functions. As with GOTO, this adds extra code both at build time and run time to protect against incompetent/lazy coders while actually not improving the performance of the system itself at all. These are just two examples, there have been many others and will certainly be many more in the future.

    We seem to have created several generations of programmers who can code some amazing high-level stuff running on big fat server farms connected to the net, but who can bog-down even the fastest PC with their resource-hungry lazy habits and tools and who are completely lost on any platform that runs at less than a GHz and without a network connection; some seem completely lost when encountering a physical bit of hardware that must be controlled, never apparently never seen an opcode mnemonic, and have no idea what to do with an assembler. Don't get me wrong. I am not asserting that high level languages and new ideas are bad per se. but rather that things we used to teach on top of a foundation of low-level "how it actually works" knowledge seems to be the new foundation of education and the actual foundations seem to be not taught anymore. This is dangerous; it leads to programmers who think they know what's happening on the systems they are building but who actually have no idea how their systems actually work. New ideas/languages/tools/techniques are not good just because they are new, but rather because they are properly understood and then properly used when and where appropriate.

    Now, you kids, Git offa my lawn!!!! [smile]

  83. Re:Good software engineers can learn new languages by SpeedBump0619 · · Score: 1

    Right. In my career I've been taught one language (Pascal) and been tossed face-first into 4 other languages: C/C++, C#, Lisp, and Python. Language learning happens in phases:
    - I can learn the syntax, reserved words, flow control, and basic structure of a language in 3-4 days. At that point I'd be able to take a small block of simple code and figure out what it's doing. I could write very simple programs to do pretty pointless things.
    - Given another week or so I could learn enough of the support libraries to have some exposure to basic things like file access, network APIs, thread and process creation, database access, etc to understand what more general code is supposed to be doing. So about two weeks in I could start contributing to real work by finding and patching certain types of bugs, adding simple feature extensions, or building useful test cases.
    - Given another 2-4 weeks of work I might be knowledgeable enough to create moderately complex subsystems, debug most single factor bugs, or begin commenting on any architectural problems.
    - I won't know enough to make architectural changes for another month or more.

    In the end, I wouldn't trust myself to make big changes on less than three months familiarity with a language. With some projects I'd want that much time just on that project's codebase, *after* the three months getting familiar with the language. At that point I've probably learned enough to know what it is I don't yet understand.

  84. By all means - YES by Progman3K · · Score: 1

    because we WANT our programmers to eventually not understand how a microprocessor works.

    We need to breed a dumber programmer so s/he can write buggy code, fast.

    Make it idiot-proof because eventually the bar will be so low, only idiots will be needed to do the job.

    If we're lucky, this will cause a resurgence in VisualBasic.

    --
    I don't know the meaning of the word 'don't' - J
  85. C to Rust by maclark88 · · Score: 1

    My C got wet and it turned to Rust.

  86. Re:Depends on a lot of things, including workplace by Grishnakh · · Score: 1

    It's always the young engineers that hate C/C++. It was that way twenty years ago. Why?

    WTF are you talking about? 20 years ago I was still in school, and everything was C or C++ (or assembly). We didn't have any alternatives back then, except Java, which at the time was still very new. Of course, there were a bunch of academic languages and older languages: FORTRAN, COBOL, Lisp, Forth, Pascal etc., but most of those are older than C; in fact, in 1995, C++ was a relatively new language.

  87. Re:Depends on a lot of things, including workplace by MouseTheLuckyDog · · Score: 1

    You know what?

    It helps if you know what you are talking about.

    1995 C++ was not "relatively new". The ARM was published in 1990. Meyers and Cope were both published in 1992. I don't know about your potentially inferior schools, but I saw tons of C++ programmers around.

    And there were very many alternatives around. Start with the two you mentioned. Lisp and Pascal. There were three commercial Lisps ( which cost a lot ) out there: Allegro CL, Corman Lisp ( Ok Windows only and very cheap ), I can't remember the name of the third. Pascal-- ever heard of TurboPascal or Delphi? Ok not portable but no one cared. And guess what? A lot of the young engineers were screaming "Let's do it in Lisp" or "Let's do it in Delphi".

    If you were doing, GUI's there was PowerBuilder and VB. Again I heard a lot of engineers say "Let's do it in PowerBuider or VB."

    There were also Smalltalk (at least two commercial compilers ), Eiffel ( again at least two commercial compilers ), Dylan ( ditto ) and Self. Finally there was Ada which was mandated for all military applications without special dispensation.

    What's more Java at that time was more mature then Rust is now.
    So there were plenty of choices and the young engineers were always choosing them. Maybe if you had paid attention to the real world when you were a student.

  88. Re:Rust: It has great support to call into C code by Nubbywubwub · · Score: 1

    Every language under the sun has a foreign function interface for the purpose of calling into C libraries. Does the existence of an FFI from Python obviate the need for Python? Does JNI obviate the need for Java?