Stories
Slash Boxes
Comments

SoylentNews is people

posted by janrinok on Monday January 16 2017, @08:42PM   Printer-friendly
from the comparing-tools dept.

Eric S Raymond, author of "The Cathedral and the Bazaar", blogs via Ibiblio

I wanted to like Rust. I really did. I've been investigating it for months, from the outside, as a C replacement with stronger correctness guarantees that we could use for NTPsec [a hardened implementation of Network Time Protocol].

[...] I was evaluating it in contrast with Go, which I learned in order to evaluate as a C replacement a couple of weeks back.

[...] In practice, I found Rust painful to the point of unusability. The learning curve was far worse than I expected; it took me those four days of struggling with inadequate documentation to write 67 lines of wrapper code for [a simple IRC] server.

Even things that should be dirt-simple, like string concatenation, are unreasonably difficult. The language demands a huge amount of fussy, obscure ritual before you can get anything done.

The contrast with Go is extreme. By four days in of exploring Go, I had mastered most of the language, had a working program and tests, and was adding features to taste.

Have you tried using Rust, Go or any other language that might replace C in the future? What are your experiences?


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 0, Informative) by Anonymous Coward on Monday January 16 2017, @09:31PM

    by Anonymous Coward on Monday January 16 2017, @09:31PM (#454530)

    What's wrong is there are programs written in C which are older than the average coder. Unix people are old or dead and old code is old and old is bad. It's a new generation of coder people and they need to rewrite everything because no way are they going to maintain dead people's code in a dead language.

    Linux needs a rewrite but Linus just won't die soon enough.

    Starting Score:    0  points
    Moderation   0  
       Troll=1, Informative=1, Total=2
    Extra 'Informative' Modifier   0  

    Total Score:   0  
  • (Score: 0) by Anonymous Coward on Monday January 16 2017, @09:56PM

    by Anonymous Coward on Monday January 16 2017, @09:56PM (#454549)

    "Inspectis ante laminis, tollere de curru equorum."

  • (Score: 4, Insightful) by ledow on Monday January 16 2017, @10:24PM

    by ledow (5567) on Monday January 16 2017, @10:24PM (#454563) Homepage

    Old = stable, targettable, tested.

    From a security perspective, sure, it needs to be maintained but are you suggesting C projects are any less likely to be maintained than a program written in a language only a handful of years old and not deployed in any major project?

    I don't get that people think that "new" languages are any better from this kind of perspective. You have to think of how many people CAN maintain a project. Rust is a niche language, still, C is not. You can find a C programmer with an advert in a newspaper, I've never met anyone who programs in Rust seriously.

    People are attracted to languages they can learn, maintain, and which can extend with them, and if Rust is this tricky to get started in, people aren't going to flock to it. That's a death-knell for such a language.

    • (Score: -1, Flamebait) by Anonymous Coward on Monday January 16 2017, @10:27PM

      by Anonymous Coward on Monday January 16 2017, @10:27PM (#454566)

      I've never met anyone who programs in Rust seriously.

      You're old and young people won't talk to you. Have you considered suicide.

    • (Score: 2) by rleigh on Monday January 16 2017, @10:57PM

      by rleigh (4887) on Monday January 16 2017, @10:57PM (#454583) Homepage

      > I've never met anyone who programs in Rust seriously

      I've never met anyone who programs in Rust *at all*!

      Rust annoys me. It's not the language, it's the incessant hype around it, as though it were the second coming. It's not the only one, Go is almost as bad, and Swift isn't much better. I can't abide the thoughtless fanboyism behind the hype; at least be truly honest about both its advantages and its shortcomings.

      I'm a scientific C++ programmer primarily (and C, Perl, Python, Java, R and others as needed). I'm not averse to new languages and new ways of doing things, but I might just hold off on investigating Rust in detail until a few years have passed. If it's still around, then maybe it might be worth my time. I've never worked in any other field which was so influenced by new and shiny over tried and tested. I wouldn't mind so much if the new and shiny was actually better, but it's often less well designed and implemented than the older stuff.

      • (Score: 3, Insightful) by ledow on Tuesday January 17 2017, @01:04AM

        by ledow (5567) on Tuesday January 17 2017, @01:04AM (#454637) Homepage

        Same for me, but the languages I use are generally a little older.

        I remember PHP coming in and was going to solve all those horrible Perl CGI security problems - yeah, that worked a treat! (What's Soylent running? *cough*)

        I remember Java going to be write-once-run-anywhere. It almost made it too. But the fact is that 90% of the Java programs I see are locked to a platform one way or another. In the last month alone I've had to update Java modules on photocopiers, a library system and an access control system. Because the first was using a feature that not all photocopier's JavaVM's implemented, the second demanded Java 1.8 for some feature or other (prompting JRE updates on 200+ machines) - and incidentally it only uses Java on PC and on other platforms they rewrote in something else entirely, and the third has to stay on ancient-Java if it's to work at all.

        I remember all kinds of "We're going to fix C" languages, whether they were structures in the language itself, or rewrites, or incompatible but similar languages. We still write in C. The languages are mostly dead now but some spawned some of the ones you mention.

        I tried to run a program in Python the other day. It took ages to get a compiler that worked, and then it ran into all kinds of problems (something to do with incompatibilities between Python 2.5 and OpenSSL libraries that had never been fixed?), and then the Python program wouldn't compile anyway, and it would have had required further tweaking to get it working on other platforms.

        C is probably the language that has changed the least. There's not much written in C that won't run on a modern compiler, and if you stick to even C99 (18 years old at least!) you get even better chances of success. That's probably why we stick with it.

        • (Score: 3, Insightful) by NCommander on Tuesday January 17 2017, @07:11AM

          by NCommander (2) Subscriber Badge <michael@casadevall.pro> on Tuesday January 17 2017, @07:11AM (#454777) Homepage Journal

          I'll note for the record if I recoded rehash today, it won't be in Perl, and I would be very hesitant to start any new projects in Perl. Realistically, for performance reasons, I'd consider Ruby, a fast Python implementation, or even possibly Java; I might even consider Rust based on my previous experiences with the language. We've been in a LOT of pain because some of the poor design decisions made for perl web applications; specifically binding the request ($r) object to Apache internal structures. A lot of the codebase changed due to subtle behavior changes in $r, such as the ability write back to form variables, and them later. I had to write a shim to copy the array in initialization to get the old schematics back. It took several weeks of dedicated effort to migrate us to an Apache of this century.

          Because there's no standardized (de-facto or other) way to get fast performance, it's not trivial to migrate an existing application from one framework to another. Right now, the leaning feeling of the staff is the next time we get a breaking API change with Apache, we're going to rip it out and migrate the mess to fastCGI and possibly switch nginx. This creates a process barrier to help reduce crashes, and at least in theory makes our life suck less since FastCGI has been relatively stable API vs. Apache's mod_perl. We still can't use Apache 2.4 due to broken dependencies all over the ecosystem. Even once all the dependencies are available for 2.4, I'm expecting I'm going to have to apply a fresh set of hacks to keep things lumbering on.

          Furthermore, I've had plenty of C code go bang trying to switch compilers. For old K&R or C89 code I could understand it, but I've seen C99 code explode on different versions of GCC when you switch platforms or compilers because someone did something stupid and was depending on uninitialized data. I don't have much issue with C itself though I question the validity of using it for anything beyond system-level programming where you have both experience and the need for direct memory access. Userland applications are a lot harder to justify because a typo is a security hole.

          --
          Still always moving
    • (Score: 2) by NCommander on Tuesday January 17 2017, @07:14AM

      by NCommander (2) Subscriber Badge <michael@casadevall.pro> on Tuesday January 17 2017, @07:14AM (#454779) Homepage Journal

      If you're getting C programmers from a newspaper, you'll end up having to hire someone like me who's made a good part of his living cleaning up people's messes. A recent firmware program was done by very cheap bidding, and the resulting code quality was filled with memory initialization errors, deadlocks, and plenty more issues along that way such as dangling pointers. I've used Rust pretty heavily for a personal project that I may try selling in the future, and I'm all around happy with it as it prevents you from blowing off a foot.

      Even dealing with nearly a decade of C experience I've made mistakes that weren't obvious at first, and a linter sometimes fails to catch. I rather be in a world where I can't make those mistakes than one where something could slip by.

      --
      Still always moving
  • (Score: 2) by Bethany.Saint on Monday January 16 2017, @10:30PM

    by Bethany.Saint (5900) on Monday January 16 2017, @10:30PM (#454568)

    We need to change society so that people only live till 30. Once they reach 30 we give them a big celebration whereupon we kill them. This would truly be a utopia.

    • (Score: 3, Insightful) by bob_super on Monday January 16 2017, @10:41PM

      by bob_super (1357) on Monday January 16 2017, @10:41PM (#454574)

      Considering the number of people under 30 who have mastered the subtleties of advanced analog design, it will soon be a no-tech utopia.

    • (Score: 0) by Anonymous Coward on Monday January 16 2017, @10:42PM

      by Anonymous Coward on Monday January 16 2017, @10:42PM (#454575)

      Referencing a book from 50 years ago? How old of you.

      No, we don't kill people over 30. We don't celebrate them. We ignore them. We exclude them from society. Presumably they kill themselves or starve to death or something. Life doesn't exist after 30.

      • (Score: 2) by BasilBrush on Tuesday January 17 2017, @06:21AM

        by BasilBrush (3994) on Tuesday January 17 2017, @06:21AM (#454764)

        Pedantry mode: Actually he's referencing a film. In the book, the Lastday comes when people reach 21. Take that young programmers!

        --
        Hurrah! Quoting works now!
    • (Score: 0) by Anonymous Coward on Monday January 16 2017, @11:02PM

      by Anonymous Coward on Monday January 16 2017, @11:02PM (#454584)

      We need to change society so that people only live till 30. Once they reach 30 we give them a big celebration whereupon we kill them. This would truly be a utopia.

      That's not a bad idea! We'd need to give the celebration a festive sounding name, what do you think of "Carrousel"?

      We'd also, at least at first, feed them a line about being reincarnated afterwards. That way, they're not going to their deaths, they're going to "renew" themselves. Catchy! Sounds like a decent movie setting, if you can get a decent set of twentysomthing actors involved. Back in her prime, Farrah Fawcett [imdb.com] would have been a great choice for this.

      =P

      • (Score: 2) by Fnord666 on Tuesday January 17 2017, @05:42AM

        by Fnord666 (652) on Tuesday January 17 2017, @05:42AM (#454753) Homepage
        If you get the reference then you must be a runner.
      • (Score: 2) by choose another one on Tuesday January 17 2017, @08:52PM

        by choose another one (515) Subscriber Badge on Tuesday January 17 2017, @08:52PM (#455060)

        > Back in her prime, Farrah Fawcett would have been a great choice for this

        Yeah but in that timeframe, someone like Jenny Agutter would have been really awesome, gotta Walkabout a bit before you run...

    • (Score: 1, Touché) by Anonymous Coward on Tuesday January 17 2017, @04:05AM

      by Anonymous Coward on Tuesday January 17 2017, @04:05AM (#454718)
      It's way past Carousel time for you and me!