1. 40
  1.  

  2. 14

    Really happy with the field punning (short hands, they call it): it’s something that I used often in OCaml and that I missed in Rust.

    1. -3

      Hands down worst bootstrap of any language

      1. 5

        How so? rustup is pretty easy to use. This is as close to one-button install as you can get I think.

        1. 2

          that’s downloading a binary. for a sane bootstrap process, Go.

          1. 11

            In the absence of any other arguments, I’ll just say that our bootstrapping process is as “sane”(*) as Gos, we just use a different approach.

            (*) I hate ableist language, and this really shows why: it’s insulting and unusable as an argument.

            1. 5

              In addition to being unnecessarily offensive, they lack falsifiability; nothing you could say would prove “sanity” (or disprove it).

              1. 3

                The main differences:

                • Our single, one-time binary blob is a Rust compiler, not a C compiler.
                • Rust 1.x compiles from Rust 1.(x - 1) rather than from Rust 1.y.

                Both of these things have downsides, but are not insurmountable, and fit into the package policies of virtually all Linux distros, even ones like Debian.

                1. 1

                  Piping scripts via curl https://sh.rustup.rs -sSf | sh into a shell is not very elegant. But I know that managing up to date packages for every major Linux distribution and installers for Mac and Windows is a lot of work. Anyways, at least for me this is the only sanereasonable? solution.

                  1. 4

                    Honestly downloading the rustup script is easy. Running it is easy. You download it over ssl. If you want you can view the script first it’s easy to do so. If you want to pipe into sh that’s your choice.

                    If you don’t trust Mozilla why are you trying to install Rust in the first place. I guarantee you can’t tell from reading the source code whether it’s trustworthy or not. Go has you download and run a binary installer as well. Skade is right. Rust has an equivalently easy and validatable process as Go. And both allow you to install from source if you want. Installing from source for both is going to involve multistep build processes if you try to do it by completely avoiding downloading a binary. The boostrap complaint is just silly.

                    1. 1

                      my position isn’t “I want to use rust because it’s a cool language”, it’s “I want to keep using firefox”, or “I want things using a SVG library to keep on working”. curl | sh is convenient for an occasional user, but it isn’t appropriate for a package manager, and this is what rust is requiring package managers to do.

                      go is verifiable in the sense that I can see the source code I just used to build the binary, not the source code claimed to be used to build the binary. I have actually looked at the go code before.

                      there are also practical concerns, like things being hard coded into those binaries: [1] [2] [3].

                      1. 3

                        and this is what rust is requiring package managers to do

                        Archlinux doesn’t use curl | sh: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/rust

                        Can you please explain the difference in more detail, because so far, I don’t think you’ve actually said what’s specifically different between Go’s process and Rust’s process. You can build the Rust compiler from source in the same sense that you can build the Go compiler from source.

                        1. 3

                          You can start with a computer with zero go compilers, and with some modest effort, build a go compiler. Bootstrapping from zero rust is more difficult, to put it mildly.

                          1. 5

                            You can start with a computer with zero go compilers, and with some modest effort, build a go compiler.

                            … but you then need to start with a C compiler, no? (And I think this is some weird C compiler too, not gcc or clang, if memory serves.) And presumably that’s bootstrapped? Why isn’t that the “worst” bootstrap?

                            I guess I just don’t understand what the criticism is here. Are packagers starting with zero Go compilers and building every rev up until the current release? And if they are, will they always do that? And if not, how is it any different than Rust from the perspective of coypoop’s complaint?

                            1. 4

                              Not always, but on occasion. Every few years OpenBSD makes a change to ABI that results in old binaries not running. Everything must be recompiled. It’s fairly complex work just getting libc and a minimal C compiler over the bump, but the end result is a working system with a standard set of utilities like sed and awk and a C compiler and 9000 tar.gz source archives for everything in ports. Somebody types make and 3 days later there’s a pile of packages for all the stuff that can be bootstrapped from C and a pile of smoldering ash for the stuff that can’t. Some languages, those which can be bootstrapped from an older version built from C, survive. Others don’t.

                              If rust 1.0 could be built with rust 0.9 which could be built with ocaml (which can be built with C) that would be one thing. But rust 0.9 is not the version which can be built with ocaml.

                              1. 4

                                That’s wild. Thank you for elaborating. Do other distros do the same thing as OpenBSD?

                                How do you deal with Go though? IIRC, they used a variant of the Plan 9 C toolchain to compile Go before it got bootstrapped, or can Go <1.4 be compiled with a standard C toolchain?

                                Do you expect Rust to ever work at all on OpenBSD given the process you just outlined? (I agree that trying to bootstrap Rust all the way back from Ocaml would be a perilous process, and is only theoretically possible.)

                                1. 6

                                  Most systems are pretty timid about breaking changes. But I’ll note that the situation isn’t so different from bringing up an entirely new system. Whether that be new CPUs like arm64 or what have you.

                                  Rust does now work on openbsd (at least for amd64) but it involved a lot of heroics. Compiling some things on a linux system, copying to openbsd, running linux binaries under emulation on openbsd, compiling some more pieces, etc. I don’t think there’s any way somebody replicate without tremendous effort.

                                  The plan9 c bits of go are all included. Like luajit makes heavy use of dynasm which is itself written in lua, but luajit also includes a mini lua interpreter in the source to bootstrap. Same with ocaml. The main compiler is written in ocaml, but there’s enough of an interpreter written in C to compile itself.

                                  On the other end, there’s ghc, which can only be built with yesterday’s ghc. But if you go back to like 2004, you can find a Haskell interpreter written in c that can build ghc of the same vintage…

                                  1. 2

                                    This is one nice side advantage to languages with multiple implementations. For example the SBCL system is itself implemented in Common Lisp, and while it can bootstrap itself, it’s a native-code compiler, so this only works if you have a working previous binary around. But it can also bootstrap from any other Common Lisp implementation, which means on new platforms you can first compile one of the Lisp interpreters that’s written in C, and use that to bring it up.

                              2. 1

                                Are packagers starting with zero Go compilers and building every rev up until the current release

                                Every BSD package manager I’ve checked has a Go 1.4 package it always uses to build Go 1.8. [1] [2] [3]

                              3. 3

                                Our goal is to introduce a Rust package into all package maintainers, with the guarantee that you can build future Rust with said package. We’re actively supporting package maintainers there. (if this isn’t true for your specific unix, please ping us on community-team@rust-lang.org, we will reach out)

                                Go has a nice bootstrapping process, but I don’t see it happening anytime soon with the amount of work it would entail.

                                Finally, with rustc being a cross-compiler by default, porting is still work, but not necessarily magic.

                        2. 3

                          This reply was a about bootstrapping. In that case, I assume a build environment anyways, in which downloading trusted, older, binaries (whichever way you want) is fully all right, IHMO.

                          Also, rustup is available through package managers.