1. 13

    So I would be an “end-developer” in this story? (Well, if I were writing software for Fuchsia.) So I’m down to Dart, C or C++?

    I’m not in these waters, but this could going to slow down adoption by a lot, right? I don’t see many people embracing Dart, and C/C++ has it’s well-known pain points that most people currently developing third-party software don’t have to deal with on their current platforms. I mean, if I were writing a Windows, Android or an iOS app, I would likely not be dealing with memory. And I somehow don’t see a lot of people developing Linux apps jumping to Fuchsia.

    Google is weird.

    1. 23

      These days my reaction to seeing new stuff being developed in unsafe languages (like C/C++) is to shake my head and close the page again.

      • Should we rewrite e. g. Linux in Rust? Maybe, maybe not.

      • Should we start writing new software in C/C++? Absolutely not! (Some exceptions may apply.)

      People who say “you can write safe code in C/C++ if you are careful bla bla bla” are exactly the kind of people whose software I try to actively avoid.

      1. 9

        Should we start writing new software in Rust? Probably not. Very immature ecosystem, a lot of language churn, no established GUI frameworks.

        What other languages are you going to use? I refuse to touch JVM/.NET with a ten foot barge pole, I’m certainly not going to write a desktop application in Go, or a scripting language, or a functional language like Haskell. What’s left other than C?

        1. 17

          C would be my last choice to develop a desktop application among the languages you mentioned. Memory safety is more important than memory usage and performances in my humble opinion.

          1. 3

            I don’t think that memory usage and performance are the big wins for C. I think stability is. C has a stable ABI and is the natural language for interacting with the rest of the Unix platform. There’s no impedance mismatch between C and your operating system like I feel with every other language.

            Plus it’s fun to write.

            1. 3

              C has a stable ABI and is the natural language for interacting with the rest of the Unix platform. There’s no impedance mismatch between C and your operating system like I feel with every other language.

              Rust has first class support for making calls into libraries that conform to those ABIs, and for producing libraries that conform to those ABIs. It also, like C, doesn’t mandate a particular threading model or garbage collection scheme. It’s the first language I’ve seen in a long time that has successfully convinced me that I can have a bunch of extra safety without giving up first class access to even more advanced OS facilities. It also seems to enable an incremental approach to subsystem replacement, being even useful for kernel module development with no_std. It’s not a panacea, but it’s absolutely worth investigating, even if you get started with a thin FFI wrapper around an existing C library.

              1. 6

                I’m not quite sure I’d call Rust’s support here “first class.” If it were first class, then I personally think I’d be able to do things like, “include this C header file and have the obvious things available to me.” Without that, you wind up needing to re-create a lot of the conditional compilation used in C headers for specific platform support. It’s not insurmountable, but there’s a lot of friction there.

                1. 1

                  It feels first class compared to Go, but second class compared to C++.

          2. 6

            I think D is pretty good. It has optional GC, and you can write code which looks a lot like C. In addition, it has some nice sugar like foreach and ranges which make writing common C stuff easier.

            1. 3

              I struggle to see how D really differentiates itself from C++ tbh

              1. 5

                Generics are done differently (no templates) which yields better compile times. It’s less of a kitchen sink language, since it was developed with 15 years of C++ hindsight. There is GC for when you want it.

                1. 2

                  The bad compile times for C++ templates are due to monomorphisation and then optimisations being run for every single template instance basically independently. How does D improve on that? Does it optimise before instantiation?

            2. 14

              Very immature ecosystem, a lot of language churn, no established GUI frameworks.

              Well, I guess that eliminates C then?

              Should we start writing new software in Rust?

              If I have to choose between

              • some old C “experts” being forced to learn something new, and
              • inflicting another 2 decades of broken, unsafe, poor quality software upon innocent users

              I’ll pick the former immediately.

              C developers had almost 50 years to demonstrate that they are able to write acceptable code. They couldn’t.

              Let’s abandon this failed experiment and retrain them in a way that reduces the harm to the outside world, just like we did with the coal miners a few decades ago.

              1. 0

                Well, I guess that eliminates C then?

                I don’t think C has had language churn ever, its ecosystem is very mature, and there are heaps of established stable GUI frameworks.

                I don’t really understand what you’re getting at here.

                inflicting another 2 decades of broken, unsafe, poor quality software upon innocent users

                No language can or will stop people from writing broken, unsafe, poor quality software.

                1. 10

                  No language can or will stop people from writing broken, unsafe, poor quality software.

                  Rust has a good record for stopping some really bad classes of breakage though, which is tremendously valuable. Sure you can still implement something with crypto weaknesses or arithmetic errors, but you’re probably not going to set the program counter to a user-provided buffer unless you really work for it.

                  1. 2

                    It has a good record at preventing some very narrow, specific classes of breakage. It achieves this with some large costs. I don’t like that people talk up the positives of Rust but never seem to remember to mention the downsides, and if anyone does mention those downsides they get downvoted into being hidden by the Rust Evangelism Strike Force.

                    What I said was: “No language can or will stop people from writing broken, unsafe, poor quality software.” I said that in response to “inflicting another 2 decades of broken, unsafe, poor quality software upon innocent users”. I disagree with that because C does not cause software to be broken, unsafe or poor quality. In fact, most of the frustratingly poor quality programmes I’m forced to use are those written in languages other than C. Broken, poor quality software in my experience is mostly big bloated overly complicated programmes that try to do too much. What language they’re written in doesn’t seem to have much impact, with one big exception: C.

                    C is not really designed for writing big programmes, and as a result, people that write C keep their programmes small. As a result, they tend to be of very high quality. This is just my experience, but it’s a very consistent experience. C programmers tend to care about producing good quality code.

                    1. 3

                      I’m not sure I understand the small programme claim: is the Linux kernel a small programme? is the Windows kernel a small programme? is GIMP a small programme? also, about quality, I think it’s hard to discuss, in essence boiling down to a “he said she said” & very subjective argument.

                      As to Rust downsides, I totally agree it has those, but note that C advocates totally don’t mention C downsides in those discussions either :) also, all languages have some downsides, so every choice here is a compromise, question is, what weights one attaches to which pros & cons.

                      1. 1

                        Programming language discussions are always very subjective.

                        1. 6

                          Vulnerabilities (i.e., that get reported, get CVEs) are very much not subjective… and there are still vast numbers that are memory unsafety errors (seems like >50% in most studies I’ve seen), and they are going up. So being blasé that “C is fun to write” seems wildly irresponsible. Humans have empirically been shown to be incapable of writing memory safe code. Starting new projects in memory unsafe languages because of vague ideas about software ecosystem is just plain irresponsible (if you are writing code for a hardware platform where there is literally no other option, that’s a different story…)

                        2. 1

                          Where could one read about Rust downsides? Something relatively objective? Maybe the biggest 3 points fit in a comment here?

                          1. 1

                            Not a Rust user, just interested in the discussion.

                            I’d say they are

                            • difficult concepts to grasp when coming from other languages
                            • lack of broad platform support
                            • slow compile times

                            I’d be happy to be corrected.

                2. 2

                  scripting

                  That vague adjective sure is doing a lot of heavy lifting in this sentence.

              2. 4

                In this situation, I’m kinda thinking Nim could be an interesting option for the “end-developers”, given that it compiles to C. Though I also think some people from the Rust community may try to provide non-Google-backed support for Fuchsia too.

                1. 2

                  “Dart is an object-oriented, class-based, garbage-collected language with C-style syntax.” In other words, if you know Java, you can probably pick it up pretty quickly.

                  The same cannot be said for Rust.