1. 5

    Stable (even if “preview”) rustfmt!

    1. 1

      Is this a rewrite of the old rustfmt?

      1. 6

        Nah, it’s the same one.

        What happened was that rustfmt was moved into the distribution, but this process made it nightly-only for a while. It’s back now.

    1. 5

      Interesting proposal, though it makes me wonder about something. Full Disclosure up front: my primary languages are C, Haskell and Lua; I’ve tried Rust numerous times and found it annoying/unusable enough that it will likely be a while before I take another serious look at programming in it. Having said that, programming language and library design is still something I find quite interesting.

      I remember early on in Rust’s creation, many of the proponents of the language wanted to clean up some of C++ (and, by extension, C)’s mistakes. One of the things that I heard talked about a lot was #ifdef soup for platform/os support.

      Recgonizing that I do not have a proposal for a better way of doing platform-portability, is this proposal not just a reversal of that stance and an adoption of the equivalent mechanic?

      If not, then what am I missing? Is rust’s cfg somehow inherently better than the CPP’s #ifdef (more than just being in Rust’s macro system rather than a preprocessor)? If so, was this digression just a mistake/red herring (there’s nothing wrong with that, by the way—everyone makes mistakes); or something else?

      1. 11

        I don’t think it’s a reversal of Rust’s previous stance. The current way of achieving portability in Rust is by putting platform-agnostic things in the stdlib, etc. This doesn’t change that.

        I’m not very clear what “digression” you’re talking about.

        Rust has always had cfg, and Rust libs have always used it for portability.

        What this is proposing is that the stdlib should:

        • work well if you turn off certain components (e.g. threads)
        • turn off components which aren’t supported on a given platform.

        Before, you simply couldn’t use the stdlib for these platforms.

      1. 6

        I really need to get around to writing my sum type proposal for Go.

        Instead of introducing an entirely new feature, the idea is to tweak the existing features to support it.

        The bare idea is simple: “closed” interfaces. If you declare an interface as closed, you pre-declare all the types that belong to it, and that’s it. The syntax could be something like

        type Variant1 struct {..}
        type Variant2 struct {..}
        type Foo interface {
            // methods
            for Variant1, Variant2
        }
        

        You continue to use type switches (i love type switches) with these interfaces, except that the default case can’t be used for exhaustive switches (you can also enforce that in non-exhaustive switches).

        It would also be nice to lift the restriction for implementing methods on interfaces; and make it be possible to run interface methods on explicitly-interface (not downcasted) types. There was a proposal for that too..

        Under the hood, these could possibly be implemented as stack-based discriminated unions instead of vtable’d pointers, though there might be tricky GC interaction there.

        I haven’t really written this up properly, but I suspect it might “fit well” in Go and be nicer than directly adding sum types as a new thing.

        1. 4

          I encourage you to make this suggestion on https://github.com/golang/go/issues/19412 which was recently marked as “For Investigation” which suggests someone is collating ideas.

          1. 2

            +1, that’s an excellent thread with a lot of interesting insights about the constraints that the core language devs are battling with when introducing a new feature like this. It’s super long but I’ve found the discussion to be really informative.

            1. 1

              I actually just wrote https://manishearth.github.io/blog/2018/02/01/a-rough-proposal-for-sum-types-in-go/ yesterday

              But I don’t have the time/desire to really push for this. Feel free to use this proposal if you would like to push for it!

          1. 2

            This is huge! It’d be so cool to see the JS community get into rust! Maybe someone needs to write a rust-based jQuery or react?

            1. 9

              WASM isn’t really great for interfacing with the DOM. You can farm out expensive computations to WASM (“calculate this” / “parse this” / “do some string operations”) but doing stuff with tight DOM work will not help performance much (if at all; I’d expect it to slow down), and will have questionable benefits as to typesafety (TypeScript is a better way to get this working well)

              DOM manipulation isn’t slow because JS is slow, it’s slow because it’s inherently slow – it retriggers restyles and relayouts and a lot of other computations in the browser. Rust can’t help with that.

            1. 0

              I have this horrible horrible feeling that Rust is becoming the new Perl. This all reminds me of when Perl added “object orientation” and things became more confusing and hard to understand for passers by like myself.

              1. 5

                Every serious new language needs to be able to solve the c10k problem; we knew Rust would need async I/O sooner or later.

                What is ugly is the proliferation of macros when a proper general-purpose solution is possible. If you look at the final example from the link, async! is fulfilling exactly the same role as the notorious try!; if the language would adopt HKT they could build a single reusable standard form of “do notation” into the language and reuse it for result, async, option, and many other things: https://philipnilsson.github.io/Badness10k/escaping-hell-with-monads/

                1. 6

                  It is extremely unclear that a strongly-typed do notation is possible in Rust. It’s also not clear if we’ll ever get HKT directly; GAT gives us equivalent power, but fits in with the rest of stuff more cleanly.

                  1. 3

                    What is GAT?

                    1. 2

                      generic associated types

                  2. 1

                    I think async! will eventually be made into a language feature (a couple of community members have proposals for this), it’s just that we’re experimenting on it as a proc macro, because we can. It’s way more annoying to experiment with features baked into the language.

                  3. 1

                    The only language feature added here is generators (and possibly, async/await sugar), everything else will be a library. Both things are quite common amongst languages; and shouldn’t be too confusing.

                    Everything else listed here is a library that you only deal with when you are doing async stuff. And the complexities listed are largely internal complexities; tokio should be pretty pleasant to work with.

                  1. 3

                    I’m very inexperienced and new to Rust, but the times I tried to do something I too found it painful that the good stuff is rust-nightly only.

                    1. 2

                      What things do you run into?

                      1. 2

                        One example: Clippy requires nightly. I noticed I could run clippy+nightly on my codebase that aims at stable, but it’s still odd :-)

                        Also, tokio

                        1. 4

                          Cool, thanks!

                          Yeah, developer tools are still on nightly. rustfmt will be on stable as of the next release, with the rls following closely, and clippy at some point.

                          Tokio is in a weird spot; it doesn’t require nightly, but some nightly features make it more ergonomic; impl Trait is almost here!

                          Thanks again for taking the time.

                          1. 3

                            Clippy is a tool, so it’s kinda been low priority. Using it doesn’t force your library to use nightly, it just means you have to locally use nightly when running clippy. But we’re working on making it stable!

                            tokio is pretty new and experimental and some of the stuff relies on experimental new features in the compiler built for tokio (i.e. generators). It’s getting there.

                            There will always be new shiny stuff on nightly :)

                      1. -1

                        I think there’s a question that should be asked. Would this be found if firefox was a GPL project, and should we be primarily contributing to GPL projects since ALL of it must be shared?

                        1. 8

                          That is irrelevant. The Linux kernel is GPL and yet you don’t get immediate access to all development done by companies around it. Most will throw you a tarball of the source code over the wall once in a while (see Google Android). They can develop an auto install feature, use it to distribute a payload and show you the code months later, heck they don’t even have to if the payload is a loadable Linux kernel module.

                          In this specific case, the extension is actually shared and open source. So was the code used to deploy the plugin/shield study. However that doesn’t prevent a valid use-case (deploying opt-in user studies) being misused as an advertising channel (TV show tie-in piggy backing on your consent to help with user studies).

                          1. 2

                            I guess then the answer is don’t contribute to corporate maintained repositories and that we should be using a non-corporate browser.

                            1. 12

                              Firefox is the closest to a non-corporate browser you can get. Essentially there are only 4 serious web rendering engines still in active development:

                              • WebKit (derived from KHTML) maintained & developed mainly by Apple
                              • Blink forked of off WebKit by Google
                              • Gecko maintained & developed by Mozilla
                              • Trident/Edge developed by Microsoft

                              Those companies have the resources to push development and keep up with security updates. Developing a web browser rendering engine is a very resource intensive process. If you switch to a browser that just consumes one of those then you are really not changing anything - that browser is at the mercy of the upstream vendor and will lag with security updates. If you find a browser that actually forks one of the above then you run with the risk of them not keeping up with security & development.

                              1. 5

                                This is true, but it’s very important to note that if you install Firefox or Chromium from a distro like Debian, they will do the work of stripping out the tracking misfeatures while still applying critical security updates from upstream. The whole job of the Debian maintainers in this case is to protect users from exactly this situation, and they do a good job at it.

                                1. 2

                                  Yes, I guess this is the heart of the problem. There really should be a community driven browser just as there is a community driven operating system.

                            2. 2

                              The code was open source (https://github.com/mozilla/addon-wr) and even if it wasn’t addon code is shipped in source form so you can inspect it on your end.

                            1. 21

                              Compiling Firefox on 8 core ryzen targetting the host arch takes between 10 and 15 minutes.

                              1. 10

                                Wow that is fast, takes ~2h on a build server that takes 7 hours for chromium. All the recent rust stuff really slowed it down.

                                1. 6

                                  All the recent rust stuff really slowed it down.

                                  Oof, yeah, I bet. Rust is notoriously slow to compile. Luckily, incremental compilation is in the nightly compiler right now. I’ve been using it wherever I can and it really does make a difference. But I suppose it wouldn’t do much for an initial compilation of a project. :(

                                  1. 4

                                    In this case a large chunk of this is just bindgen; we need to generate bindings so we throw a libclang-based-bindings generator at all of the header files. Twice (complicated reasons for this).

                                    It’s also pretty single threaded (codegen units will help with this, but currently isn’t, and I have to investigate why).

                                    Incremental compilation and working codegen units and cleaning up the bindgen situation will help a lot. Going to take a while, though.

                                    1. 3

                                      But I suppose it wouldn’t do much for an initial compilation of a project.

                                      Also not going to help packagers who use only temporary compilation environments which are discarded after a package is built.

                                      1. 6

                                        Package managers (and regular builds also) should not be starting from scratch every time. Even if we insist on doing all source editing in ASCII, we need to be delivering modules as fully-typed, parsed ASTs.

                                        This insistence on going back to plain source code every chance we get and starting over is easily wasting more energy than the bitcoin bubble.

                                        1. 9

                                          Package managers (and regular builds also) should not be starting from scratch every time.

                                          They should if you want reproducible builds.

                                          1. 3

                                            These are completely orthogonal. There’s nothing stopping reproduceable builds where you run the entire pipeline if you insist on comparing the hash of the source and the hash of the output. And you would still get the same benefit by comparing source<->ast and ast<->binary

                                            1. 1

                                              Yeah, ideally a compiler would take a difference in source to a difference in output. Compiler differentiation?

                                            2. 2

                                              I believe you can do a decent amount of caching in this space? Like MSFT and co. have compile serverse that will store incrementally compiled stuff for a lot of projects so you’re only compiling changes

                                        2. 7

                                          My non-beefy lenovo x series laptop takes ~45 minutes for a complete recompile, ~12min for average changes w/ ccache etc. and ~min for JS-only changes (which you can do as artifact builds, so they’re always 3min unless you need to build C++/Rust components

                                        1. 32

                                          I wasn’t implying. I was stating a fact.

                                          And he’s wrong about that.

                                          https://github.com/uutils/coreutils is a rewrite of a large chunk of coreutils in Rust. POSIX-compatible.

                                          1. 12

                                            So on OpenBSD amd64 (the only arch rust runs on… there are at least 9 others, 8 7 or 6 of which rust doesn’t even support! )… this fails to build:

                                            error: aborting due to 19 previous errors
                                            
                                            error: Could not compile `nix`.
                                            warning: build failed, waiting for other jobs to finish...
                                            error: build failed
                                            
                                            1. 8

                                              Yep. The nix crate only supports FreeBSD currently.

                                              https://github.com/nix-rust/nix#supported-platforms

                                            2. 8

                                              The openbsd guys are stubborn of course, though they might have a point. tbh somebody could just fork a BSD OS to make this happen. rutsybsd or whatever you want to call it.

                                              edit: just tried to build what you linked, does cargo pin versions and verify the downloads? fetching so many dependencies at build time makes me super nervous. Are all those dependencies BSD licensed? It didn’t even compile on my machine, maybe the nixos version of rust is too old - i don’t know if the rust ecosystem is stable enough to base an OS on yet without constantly fixing broken builds.

                                              1. 10

                                                just tried to build what you linked, does cargo pin versions and verify the downloads?

                                                Cargo pins versions in Cargo.lock, and coreutils has one https://github.com/uutils/coreutils/blob/master/Cargo.lock.

                                                Cargo checks download integrity against the registry.

                                                For offline builds, you can vendor the dependencies: https://github.com/alexcrichton/cargo-vendor, downloading them all and working from them.

                                                Are all those dependencies BSD licensed?

                                                Yes. Using: https://github.com/onur/cargo-license

                                                Apache-2.0/MIT (50): bit-set, bit-vec, bitflags, bitflags, block-buffer, byte-tools, cc, cfg-if, chrono, cmake, digest, either, fake-simd, filetime, fnv, getopts, glob, half, itertools, lazy_static, libc, md5, nodrop, num, num-integer, num-iter, num-traits, num_cpus, pkg-config, quick-error, rand, regex, regex-syntax, remove_dir_all, semver, semver-parser, sha2, sha3, tempdir, tempfile, thread_local, time, typenum, unicode-width, unindent, unix_socket, unreachable, vec_map, walker, xattr

                                                BSD-3-Clause (3): fuchsia-zircon, fuchsia-zircon-sys, sha1

                                                MIT (21): advapi32-sys, ansi_term, atty, clap, data-encoding, generic-array, kernel32-sys, nix, onig, onig_sys, pretty-bytes, redox_syscall, redox_termios, strsim, term_grid, termion, termsize, textwrap, void, winapi, winapi-build

                                                MIT OR Apache-2.0 (2): hex, ioctl-sys

                                                MIT/Unlicense (7): aho-corasick, byteorder, memchr, same-file, utf8-ranges, walkdir, walkdir

                                                It didn’t even compile on my machine, maybe the nixos version of rust is too old - i don’t know if the rust ecosystem is stable enough to base an OS on yet without constantly fixing broken builds.

                                                This is one of my frequent outstanding annoyances with Rust currently: I don’t have a problem with people using the newest version of the language as long as their software is not being shipped on something with constraints, but at least they should document and test the minimum version of rustc they use.

                                                coreutils just checks against “stable”, which moves every 6 weeks: https://github.com/uutils/coreutils/blob/master/.travis.yml

                                                Can you give me rustc --version?

                                                Still, “commitment to stability” is a function of adoption. If, say, Ubuntu start shipping a Rust version in an LTS release, more and more people will try to stay backward compatible to that.

                                                1. 2

                                                  rustc 1.17.0 cargo 0.18.0

                                                  1. 11

                                                    You’re probably hitting https://github.com/uutils/coreutils/issues/1064 then.

                                                    Also, looking at it, it is indeed that they use combinatior functionality that became available in Rust 1.19.0. std::cmp::Reverse can be easily dropped and replaced by other code if 1.17.0-support would be needed.

                                                    Thanks, I filed https://github.com/uutils/coreutils/issues/1100, asking for better docs.

                                                    1. 1

                                                      thanks for doing that, great community outreach :P

                                                2. 5

                                                  Rust is “stable” in the sense that it is backwards compatible. However it is evolving rapidly so new crates or updates to crates may require the latest compiler. This won’t mean you’ll have to constantly fix broken builds; just that pulling in new crates may require you to update to the latest compiler.

                                                  1. 4

                                                    Yes, Cargo writes a Cargo.lock file with versions and hashes. Application developers are encouraged to commit it into version control.

                                                    Dependencies are mostly MIT/Apache in the Rust world. You can use cargo-license to quickly look at the licenses of all dependencies.

                                                    Redox OS is fully based on Rust :)

                                                  2. 4

                                                    Although you’re right to point out that project, one of Theo’s arguments had to do with compilation speeds:

                                                    By the way, this is how long it takes to compile our grep:

                                                    0m00.62s real 0m00.63s user 0m00.53s system

                                                    … which is currently quite undoable for any Rust project, I believe. Cannot say if he’s exaggerating how important this is, though.

                                                    1. 10

                                                      Now, at least for GNU coreutils, ./configure runs a good chunk of what rust coreutils needs to compile. (2mins for a full release build, vs 1m20.399 just for configure). Also, the build is faster (coreutils takes a minute).

                                                      Sure, this is comparing apples and oranges a little. Different software, different development states, different support. The rust compiler uses 4 cores during all that (especially due to cargo running parallel builds), GNU coreutils doesn’t do that by default (-j4 only takes 17s). On the other hand: all the crates that cargo builds can be shared. That means, on a build farm, you have nice small pieces that you know you can cache - obviously just once per rustc/crate pairing.

                                                      Also, obviously, build farms will pull all kinds of stunts to accelerate things and the Rust community still has to grow a lot of that tooling, but I don’t perceive the problem as fundamental.

                                                      EDIT: heh, forgot --release. And that for me. Adjusted the wording and the times.

                                                      1. 5

                                                        OpenBSD doesn’t use GNU coreutils, either; they have their own implementation of the base utils in their tree (here’s the implementation of ls, for example). As I understand it, there’s lots of reasons they don’t use GNU coreutils, but complexity (of the code, the tooling, and the utils themselves) is near the top of the list.

                                                        1. 6

                                                          Probably because most(all?) the openBSD versions of the coreutils existed before GNU did, let alone GNU coreutils. OpenBSD is a direct descendant of Berkeley’s BSD. Not to mention the licensing problem. GNU is all about the GPL. OpenBSD is all about the BSD(and it’s friends) license. Not that your reason isn’t also probably true.

                                                        2. 2

                                                          That means, on a build farm, you have nice small pieces that you know you can cache - obviously just once per rustc/crate pairing.

                                                          FWIW sccache does this I think

                                                        3. 7

                                                          I think it would be more fair to look at how long it takes the average developer to knock out code-level safety issues + compiles on a modern machine. I think Rust might be faster per module of code. From there, incremental builds and caching will help a lot. This is another strawman excuse, though, since the Wirth-like languages could’ve been easily modified to output C, input C, turn safety off when needed, and so on. They compile faster than C on about any CPU. They’re safe-by-default. The runtime code is acceptable with it improving even better if outputting C to leverage their compilers.

                                                          Many defenses of not using safe languages is that easy to discount. And OpenBSD is special because someone will point out that porting a Wirth-like compiler is a bit of work. It’s not even a fraction of the work and expertise required for their C-based mitigations. Even those might have been easier to do in a less-messy language. They’re motivated more by their culture and preferences than any technical argument about a language.

                                                          1. 3

                                                            It’s a show stopper.

                                                            Slow compile times are a massive problem for C++, honestly I would say it’s one of the biggest problems with the language, and rustc is 1-2 orders of magnitude slower still.

                                                            1. 12

                                                              It’s a show stopper.

                                                              Hm, yet, last time I checked, C++ was relatively popular, Java (also not the fastest in compilation) is doing fine and scalac is still around. There’s people working on alternatives, but show stopper?

                                                              Sure, it’s an huge annoyance for “build-the-world”-approaches, but well…

                                                              Slow compile times are a massive problem for C++, honestly I would say it’s one of the biggest problems with the language, and rustc is 1-2 orders of magnitude slower still.

                                                              This heavily depends on the workload. rustc is quite fast when talking about rather non-generic code. The advantage of Rust over C++ is that coding in mostly non-generic Rust is a viable C alternative (and the language is built with that in mind), while a lot of C++ just isn’t very useful over C if you don’t rely on templates very much.

                                                              Also, rustc stable is a little over 2 years old vs. C/C++ compilers had ample headstart there.

                                                              I’m not saying the problem isn’t there, it has to be seen in context.

                                                              1. 9

                                                                C++ was relatively popular, Java (also not the fastest in compilation) is doing fine and scalac is still around.

                                                                Indeed, outside of gamedev most people place zero value in fast iteration times. (which unfortunately also implies they place zero value in product quality)

                                                                rustc is quite fast when talking about rather non-generic code.

                                                                That’s not even remotely true.

                                                                I don’t have specific benchmarks because I haven’t used rust for years, but see this post from 6 months ago that says it takes 15 seconds to build 8k lines of code. The sqlite amalgamated build is 200k lines of code and has to compile on a single core because it’s one compilation unit, and still only takes a few seconds. My C++ game engine is something like 80k if you include all the libraries and builds in like 4 seconds with almost no effort spent making it compile fast.

                                                                edit: from your coreutils example above, rustc takes 2 minutes to build 43k LOC, gcc takes 17 seconds to build 270k, which makes rustc 44x slower…

                                                                The last company I worked at had C++ builds that took many hours and to my knowledge that’s pretty standard. Even if you (very) conservatively say rustc is only 10x slower, they would be looking at compile times measured in days.

                                                                while a lot of C++ just isn’t very useful over C if you don’t rely on templates very much.

                                                                That’s also not true at all. Only small parts of a C++ codebase need templates, and you can easily make those templates simple enough that it has little to no effect on compile times.

                                                                Also, rustc stable is a little over 2 years old vs. C/C++ compilers had ample headstart there.

                                                                gcc has gotten slower over the years…

                                                                1. 6

                                                                  Even if you (very) conservatively say rustc is only 10x slower,

                                                                  Rustc isn’t slower to compile than C++. Depends on the amount of generics you use, but the same argument goes for C++ and templates. Rust does lend itself to more usage of generics which leads to more compact but slower-compiling code, which does mean that your time-per-LOC is higher for Rust, but that’s not a very useful metric. Dividing LOCs is not going to get you a useful measure of how fast the compiler is. I say this as someone who has worked on both a huge Rust and a huge C++ codebase and know what the compile times are like. Perhaps slightly worse for Rust but not like a 2x+ factor.

                                                                  The main compilation speed problem of Rust vs C++ is that it’s harder to parallelize Rust compilations (large compilation units) which kind of leads to bottleneck crates. Incremental compilation helps here, and codegen-units already works.

                                                                  Rust vs C is a whole other ball game though. The same ball game as C++ vs C.

                                                                  1. 2

                                                                    That post, this post, my experience, lines, seconds… very scientific :) Hardware can be wildly different, lines of code can be wildly different (especially in the amount of generics used), and the amount of lines necessary to do something can be a lot smaller in Rust, especially vs. plain C.

                                                                    To add another unscientific comparison :) Servo release build from scratch on my machine (Ryzen 7 1700 @ 3.9GHz, SATA SSD) takes about 30 minutes. Firefox release build takes a bit more. Chromium… even more, closer to an hour. These are all different codebases, but they all implement a web browser, and the compile times are all in the same ballpark. So rustc is certainly not that much slower than clang++.

                                                                    Only small parts of a C++ codebase need templates

                                                                    Maybe you write templates rarely, but typical modern C++ uses them all over the place. As in, every STL container/smart pointer/algorithm/whatever is a template.

                                                                    1. 2

                                                                      To add another unscientific comparison :) Servo release build from scratch on my machine (Ryzen 7 1700 @ 3.9GHz, SATA SSD) takes about 30 minutes. Firefox release build takes a bit more. Chromium… even more, closer to an hour. These are all different codebases, but they all implement a web browser, and the compile times are all in the same ballpark. So rustc is certainly not that much slower than clang++.

                                                                      • Firefox 35.9M lines of code
                                                                      • Chromium 18.1M lines of code
                                                                      • Servo 2.25M lines of code

                                                                      You’re saying compiling 2.25M lines of code for a not feature complete browser that takes 30 minutes is comparable to compiling 18-35M lines of code in ‘a bit more’?

                                                                      1. 4

                                                                        Line counters like this one are entirely wrong.

                                                                        This thing only counted https://github.com/servo/servo. Servo code is actually split among many many repositories.

                                                                        HTML parser, CSS parser, URL parser, WebRender, animation, font sanitizer, IPC, sandbox, SpiderMonkey JS engine (C++), Firefox’s media playback (C++), Firefox’s canvas thingy with Skia (C++), HarfBuzz text shaping (C++) and more other stuff — all of this is included in the 30 minutes!

                                                                        plus,

                                                                        the amount of lines necessary to do something can be a lot smaller in Rust

                                                                        1. 2

                                                                          Agreed, it grossly underestimates how much code Chromium contains. You are aware of the horrible depot_tools and the amount of stuff they pull in?

                                                                          My point was, you are comparing a feature incomplete browser that is a smaller code base at least in one order of magnitude but takes 30 minutes compared to “closer to an hour” of Chromium. If think your argument doesn’t hold - you are free to provide data to prove me wrong.

                                                                        2. 3

                                                                          Servo’s not a monolithic codebase. Firefox is monolithic. It’s a bad comparison.

                                                                          Chromium is also mostly monolithic IIRC.

                                                                2. 2

                                                                  Free- and OpenBSD can compile userland from source:

                                                                  So decent compile times are of essence, especially if you are targeting multiple architectures.

                                                                3. 6

                                                                  Well, ls is listed as only semi done, so he’s only semi wrong. :)

                                                                  1. 11

                                                                    The magic words being “There has been no attempt”. With that, especially by saying “attempt”, he’s completely wrong. There have been attempts. At everything he lists. (he lists more here: https://www.youtube.com/watch?v=fYgG0ds2_UQ&feature=youtu.be&t=2112 all of what Theo mentions has been written, in Rust, some even have multiple projects, and very serious ones at that)

                                                                    For a more direct approach at BSD utils, there’s the redox core utils, which are BSD-util based. https://github.com/redox-os/coreutils

                                                                    1. 2

                                                                      Other magic words are “POSIX compatible”. Neither redox-os nor the uutils linked by @Manishearth seem to care particularly about this. I haven’t looked all that closely, but picking some random utils shows that none of them is fully compliant. It’s not even close, so surely they can’t be considered valid replacements of the C originals.

                                                                      For example (assuming that I read the source code correctly) both implementations of cat lack the only POSIX-required option -u and the implementations of pwd lack both -L and -P. These are very simple tools and are considered done at least by uutils…

                                                                      So, Theo may be wrong by saying that no attempts have been made, but I believe a whole lot of rather hard work still needs to be done before he will acknowledge serious efforts.

                                                                      1. 5

                                                                        This rapidly will devolve into a no true scotsman argument.

                                                                        https://github.com/uutils/coreutils#run-busybox-tests

                                                                        uutils is running the busybox tests. Which admittedly test for something other than POSIX compliance, but neither the GNU or BSD coreutils are POSIX-compliant anyway.

                                                                        uutils is based on the GNU coreutils, redox’s ones are based on the BSD ones, which is certainly a step in the right direction and can certainly be counted as an attempt.

                                                                        For example (assuming that I read the source code correctly) both implementations of cat lack the only POSIX-required option -u and the implementations of pwd lack both -L and -P.

                                                                        Nobody said they were complete.

                                                                        All we’re talking about is Theo’s rather strong point that “there has been no attempt”. There has.

                                                                  2. 1

                                                                    I’m curious about this statement in TdR in the linked email

                                                                    For instance, rust cannot even compile itself on i386 at present time because it exhausts the address space.

                                                                    Is this true?

                                                                    1. 15

                                                                      As always with these complaints, I can’t find any reference to exact issues. What’s true is that LLVM uses quite a bit of memory to compile and rustc builds tend not to be the smallest themselves. But not that big. Also, recent improvements have definitely worked here

                                                                      I do regularly build the full chain on a ACER c720p, with FreeBSD, which has a celeron and 2 GB of RAM, I have to shut down the X server and everything before, but it works.

                                                                      As usual, this is probably an issue of the kind “please report actual problems, and we work fixing that”. “We want to provide a build environment for OpenBSD and X Y Z is missing” is something we’d be happy support, some fuzzy notion of “this doesn’t fulfill our (somewhat fuzzy) criteria” isn’t actionable.

                                                                      Rust for Haiku does ship Rust with i386 binaries and bootstrapping compilers (stage0): http://rust-on-haiku.com/downloads

                                                                      1. 10

                                                                        As always with these complaints, I can’t find any reference to exact issues.

                                                                        Only because it’s a thread on the OpenBSD mailing lists, people reading that list have the full context of the recent issues with Firefox and Rust.

                                                                        I’ll assume you just don’t follow the list so here is the relevant thread lang/rust: update to 1.22.1

                                                                        • For this release, I had lot of problem for updating i386 to 1.22.1 (too much memory pressure when compiling 1.22 with 1.21 version). So the bootstrap was initially regenerated by crosscompiling it from amd64, and next I regenerate a proper 1.22 bootstrap from i386. Build 1.22 with 1.22 seems to fit in memory.

                                                                        As I do all this work with a dedicated host, it is possible that ENOMEM will come back in bulk.

                                                                        And if the required memory still grows, rustc will be marked BROKEN on i386 (and firefox will not be available anymore on i386)

                                                                        1. 7

                                                                          Only because it’s a thread on the OpenBSD mailing lists, people reading that list have the full context of the recent issues with Firefox and Rust.

                                                                          Sure, but has this:

                                                                          And if the required memory still grows, rustc will be marked BROKEN on i386 (and firefox will not be available anymore on i386).

                                                                          Reached the Rust maintainers? (thread on the internals mailing list, issue on rust-lang/rust?)

                                                                          I’m happy to be corrected.

                                                                          1. 7

                                                                            Reached the Rust maintainers? (thread on the internals mailing list, issue on rust-lang/rust?)

                                                                            I don’t know. I don’t follow rust development, however the author of that email is a rust contributor like I mentioned to you in the past so I assume that it’s known to people working on the project. Perhaps you should check on that internals mailing list, I checked rust-lang/rust on github but didn’t find anything relevant :)

                                                                            1. 7

                                                                              I checked IRLO (https://internals.rust-lang.org/) and also nothing. (“internals” by the way referring to the “compiler internals”, we have no closed mailing list). The problem on projects of that scale seems to be that information travel is a huge issue and that leads to aggrevation. The reason I’m asking is not that I want to disprove you, I just want to ensure that I don’t open a discussion that’s already happening somewhere just because something is going through social media currently.

                                                                              Thanks for pointing that out, I will ensure there’s some discussion.

                                                                              Reading the linked post, it seems to mostly be a regression when doing the jump between 1.21 to 1.22, so that should probably be a thing to keep an eye out for.

                                                                            2. 2

                                                                              Here’s a current Rust bug that makes life hard for people trying to work on newer platforms.

                                                                        2. 2

                                                                          I’m skeptical; this has certainly worked for me in the past.

                                                                          I used 32 bit lab machines as a place to delegate builds to back when I was a student.

                                                                          1. 4

                                                                            Note that different operating systems will have different address space layout policies and limits. Your effective space can vary from possibly more than 3GB to possibly less than 2GB.

                                                                      1. 4

                                                                        “For a developer, the hardening effort could be a great boon, in that it could show nasty bugs early, it could make them easier to report, and it could add a lot of useful information to that report that makes them easier to fix too.”

                                                                        This is actually one of the point fans of Design-by-Contract have been making since it takes you right to the bug. Memory-safe languages can prevent them. You don’t see Linus adopting many things like that in this quest to squash all the bugs. I say he’s mostly talking.

                                                                        Now, let’s say I tried to commit something with hardening. He wants it to show the bug with a report. It can sometimes be obvious where something was hit but not always. So, a app gets hit with a non-obvious one eventually triggering some containment code. I’m guessing the Linux kernel already has support for pulling the code and data in the app from memory to analyze it in a way that shows where the attack is? Or does he expect me to dump all of that in a file to pull off the machine for manual analysis? Or just the writable parts in memory? I’m just wondering what’s standard in terms of support infrastructure for those doing it his way. There could even be opportunities to design mitigations around it.

                                                                        1. 6

                                                                          You don’t see Linus adopting many things like that in this quest to squash all the bugs. I say he’s mostly talking.

                                                                          I say this a lot whenever the new userspace rant crops up.

                                                                          And not even in the context of memory safe languages. It’s far more basic than that. Linux doesn’t really have an extensive set of API/regression tests or a test infrastructure.

                                                                          Without any of that, “don’t break userspace” is completely hollow. It’s really “don’t let me see you breaking userspace”; if folks actually cared about that that much then they would test for it.

                                                                          This is also why I mostly consider attempts to rewrite linux in a safer language premature; without good testing it’s just not going to be doable.

                                                                          Browsers are quite similar to operating systems in many ways (specifically, that they expose a large API/ecosystem within which you can program, and have a huge base of programs written for them). Browsers have extensive tests which go everywhere from testing the basic behavior of a feature to its million edge cases, including “nobody should write code that relies on this but we’re going to test it anyway” edge cases. When we did the Stylo work for Firefox a large, possibly majority, component of the work was just getting all these tests to pass, because we had lots of edge cases we missed. I can’t even begin to imagine how we’d do it without tests. I can’t even begin to imagine how a project like Linux would do it without tests.

                                                                          1. 3

                                                                            I didn’t know they were lacking a test infrastructure. Yeah, that’s even worse than what I was saying. I especially like your characterization here:

                                                                            “Without any of that, “don’t break userspace” is completely hollow. It’s really “don’t let me see you breaking userspace”; if folks actually cared about that that much then they would test for it.”

                                                                            Yeah, this stuff is Linus’ ego until they get tests or contracts helping ensure that behavior. I also remember CompSci people bug-hunting the API’s had problems due to under or no specification of some components. They had to reverse engineer it a bit while they did the formal specs. They all found bugs, too.

                                                                            1. 2

                                                                              It’s not like the kernel doesn’t get tested, though: https://stackoverflow.com/a/3180642/942130

                                                                              1. 2

                                                                                I expected a little testing like that. Manishearth and I’s point is that this is a huge, critical project with more contributors than most whose leader is supposedly all about protecting the stability of the userspace. Yet, there’s no testing infrastructure for doing that. Yet, smaller projects and startups routinely pull that off for their growing codebases.

                                                                                So, Linus is a hypocrite to not be doing what he can on testing side. There’s also a benefit to submitters where they could run the tests to spot breaks before submitting.

                                                                        1. 5

                                                                          The post in question Big-O: how code slows as data grows

                                                                          The comment by ‘pyon’:

                                                                          You should be ashamed of this post. How dare you mislead your readers? In amortized analysis, earlier cheap operations pay the cost of later expensive ones. By the time you need to perform an expensive operation, you will have performed enough cheap ones, so that the cost of the entire sequence of operations is bounded above by the sum of their amortized costs. To fix your list example: a sequence of cheap list inserts pays the cost of the expensive one that comes next.

                                                                          If you discard the emotion, he gives out a fairly interesting additional note about what amortized analysis means. Instead of giving the information value, Ned reacts on the part that questions his authority. Such a brittle ego that puts you to writing a small novel worth’s of rhetoric instead of shrugging it off. Childish.

                                                                          1. 52

                                                                            If @pyon had just phrased the first part of the comment like “You’re making a number of simpliications regarding “amortization” here that I believe are important…” this would probably not have escalated. This is what Ned means with being toxic - being correct, and being a douche about it.

                                                                            1. 10

                                                                              Indeed; the original article appeared on Lobsters and featured a thoughtful discussion on amortization.

                                                                              1. 2

                                                                                I wonder whether better word choice without changing the meaning would help one step earlier: the original post did include «you may see the word “amortized” thrown around. That’s a fancy word for “average”», which sounds a bit dismissive towards the actual theory. Something like «Notions of ‘‘amortized’’ and ‘‘average’’ complexity are close enough for most applications» would sound much more friendly.

                                                                                (And then the follow-up paints the previous post as if it was a decision to omit a detail, instead of a minor incorrectness in the text as written, which can be (maybe unconsciously) used to paint the situation as «correctness versus politeness», and then options get represented as if they were mutually exclusive)

                                                                                1. 4

                                                                                  I feel like that would have put the author in a more defensible position on this specific point, yes. Being clear about where additional nuance exists and where it doesn’t is something that anyone writing about technical subjects should strive for, simply because it’s useful to the reader.

                                                                                  I don’t think it’s likely that that clarification would have much of an effect on most readers, since the hypothetical reader who’s mislead would have to study complexity theory for some years to get to the point where it’s relevant, and by that time they’ll probably have figured it out some other way. We should all be so lucky as to write things that need several years of study before their imperfections become clear. :)

                                                                                  But more to the point, while I can’t know anything about this specific commenter’s intent, somebody who’s determined to find fault can always do so. Nobody is perfect, and any piece of writing can be nit-picked.

                                                                                  1. 1

                                                                                    Several years sounds like an upper bound for an eventually succesful attempt. A couple months can be enough to reach the point in a good algorithms textbook where this difference becomes relevant and clear (and I do not mean that someone would do nothing but read the textbook).

                                                                                    I would hope that the best-case effect on the readers could be a strong hint that there is something to go find in a textbook. If someone has just found out that big-O notation exists and liked how it allows to explain the practical difference between some algorithms, it is exactly the time to tell them «there is much more of this topic to learn».

                                                                                    These two posts together theoretically could — as a background to the things actually discussed in them — create an opposite impression, but hopefully it is just my view as a person who already knows the actual details and no newbie will actually get the feeling that the details of the theory are useless and not interesting.

                                                                                    As for finding something to nitpick — my question was whether the tone of the original paragraph could have made it not «finding» but «noticing the obvious». And whether the tone may have changed — but probably nobody will ever know, even the participants of the exchange — the desire to put a «well, actually…» comment into the desire to complain.

                                                                                    1. 3

                                                                                      Not having previous familiarity with this subject matter, I was guessing at how advanced the material was. :)

                                                                                      I agree about your best case, and that it’s worth trying for whenever we write.

                                                                                      I’ve never found anything that avoids the occasional “well, actually”, and not for want of trying. This is not an invitation to tell me how to; I think it’s best for everyone if we leave the topic there. :)

                                                                                      1. 1

                                                                                        I consider a polite «well, actually» a positive outcome… (Anything starting with a personal attack is not that, of course)

                                                                              2. 25

                                                                                It’s possible to share a fairly interesting additional note without also yelling at people. Regardless of what Pyon had to say, he was saying it in a very toxic manner. That’s also childish.

                                                                                1. 5

                                                                                  Correct. But I don’t just care about the emotion. I care about the message.

                                                                                  Instead of trying to change web into a safe haven of some kind, why not admire it in its colors? Colors of mud and excrete among the colors of flowers and warmth, madness and clarity. You have very little power over having people get angry or aggressive about petty things. Though you can change a lot yourself and not take up about everything that’s said. Teaching your community this skill is also a pretty valuable in life overall.

                                                                                  1. 32

                                                                                    I don’t want my community to be defined by anger and aggression. I want beginners to feel like they can openly ask questions without being raged or laughed at. I want people to be able to share their knowledge without being told they don’t deserve to program. I want things to be better than they currently are.

                                                                                    Maintaining a welcoming, respectful community is hard work and depends on every member being committed to it. Part of that hard work is calling out toxic behavior.

                                                                                    1. 5

                                                                                      I want beginners to feel like they can openly ask questions without being raged or laughed at.

                                                                                      While I agree this is critically important, it’s not entirely fair to conflate “beginners asking questions” and “people writing authoritative blog posts”.

                                                                                    2. 10

                                                                                      Yeah. That kind of self-regulation and dedication to finding signal in noise are endlessly rewarding traits worth practicing. And to extend your metaphor, we weed the garden because otherwise they’ll choke out some of the flowers.

                                                                                      1. 5

                                                                                        But I don’t just care about the emotion. I care about the message.

                                                                                        I’m with you unless the message includes clear harm. I’ll try to resist its affect on me but advocate such messages are gone. That commenter was being an asshole on top of delivering some useful information. Discouraging the personal attacks increases number of people who will want to participate and share information. As Ned notes, such comment sections or forums also get more beginner friendly. I’m always fine with a general rule for civility in comments for such proven benefits.

                                                                                        Edit: While this is about a toxic @pyon comment, I think I should also illustrate one like I’m advocating for that delivers great information without any attacks. pyon has delivered quite a lot of them in discussions on programming language theory. Here’s one on hypergraphs:

                                                                                        https://lobste.rs/s/cfugqa/modelling_data_with_hypergraphs#c_bovmhr

                                                                                        1. 5

                                                                                          I personally always care about the emotion (as an individual, not as a site moderator), it’s an important component of any communication between humans. But I understand your perspective as well.

                                                                                          1. 3

                                                                                            I may have been unclear. I do too. I was just looking at it from other commenters’ perspective of how Id think if I didnt care about it but wanted good info and opportunities in programming sphere. Id still have to reduce harm/toxicity to other people by ground rules to foster good discussion and bring more people in.

                                                                                            So, whether emotional or not, still cant discount the emotional effect of comments on others. Still should put some thought into that with reducing personal attacks being among easiest compromise as they add nothing to discussions.

                                                                                            1. 2

                                                                                              Ah! Okay. I misunderstood then, and it sounds like we’re in agreement.

                                                                                        2. 4

                                                                                          It’s ridiculous to say that if someone cannot ignore personal attacks, they have a brittle ego and are childish. While also defending personal attacks and vitriol as being the thing that we should celebrate about the internet. Rather, we should critique people for being assholes. The comment was critiquing the manner and tone in which he explained amortized analysis, but he’s not allowed to say that the comment’s manner and tone was bad? It’s ridiculous. The comment was bad, not because of the point it made, but because it made the point badly.

                                                                                      2. 22

                                                                                        Compare this approach:

                                                                                        I believe this post simplifies the idea incorrectly. In amortized analysis, earlier (cheap) operations pay the cost of later (expensive) ones. When you need to perform an expensive operation, you will have performed enough cheap ones that the cost of the entire sequence of operations is bounded by the sum of their amortized costs. In the context of your list example, a sequence of cheap list inserts would pay the cost of the expensive one that comes next.

                                                                                        This is the same content, free of “shame” and accusations of “misleading.” The original comment is a perfect example of the terrible tone that people take, as discussed in this post and in my previous post of Simon Peyton-Jones’ email.

                                                                                        1. 4

                                                                                          Instead of giving the information value, Ned reacts on the part that questions his authority.

                                                                                          The author does give it value. You’ve missed the point. The author isn’t saying it’s incorrect or not valuable; he’s saying that this attitude from experts (who use their expertise as a tool to put others down) is highly toxic.

                                                                                          1. 4

                                                                                            If you discard the emotion, he gives out a fairly interesting additional note about what amortized analysis means. Instead of giving the information value, Ned reacts on the part that questions his authority.

                                                                                            It’s not clear that Ned interprets pyon as questioning his authority. His criticism is of pyon‘s tone, which is histrionic. The cutting intro isn’t bad if we discard it; but what is the effect if we include it? It would be more balanced for Ned to discuss the details and value of pyon’s post, but that does not invalidate Ned’s point.

                                                                                          1. 4

                                                                                            This speaks to the importance of the Test Pilot program for experimental add-ons. It’s a smart way for Mozilla to gather feedback on new UI features like the Multi-Account Containers, so they can make sure they are polished (or on the other hand, not worth releasing at all). I’m happy to see Containers graduate into a full-fledged add-on in AMO.

                                                                                            I thought that they might build a feature like this into the browser itself, rather than an add-on, but I think it’s smart to have some power user features relegated to add-ons, even if they are official Mozilla ones.

                                                                                            1. 2

                                                                                              It’s actually built in – it’s built in to nightly (maybe beta? idk) and will probably be there in the 57 release (maybe 56). They prototyped it in an addon and are sharing the addon since it isn’t built in in the current release, but in a future release it will be built in.

                                                                                            1. 3

                                                                                              Is there a way to figure out the target? It would be useful when I don’t build on the same machine.

                                                                                              1. 0

                                                                                                Just use -Ctarget=cpu=native.

                                                                                                1. 2

                                                                                                  Even if I’m not compiling and running on the same processor?

                                                                                                  1. 1

                                                                                                    Well, you’ll have problems running on older processors (that don’t support some instruction set that’ll be used in the binary).

                                                                                              1. 10

                                                                                                I really want to like Firefox, but it feels increasingly clear that Mozilla doesn’t seem to consider anyone who wants to adapt any of the choices Mozilla made for him/her to be part of their target audience anymore.

                                                                                                I don’t really know what their target audience actually is to which they are trying to pull off a Gnome-like pivot, but given the fall in market-share it’s baffling that retaining existing users doesn’t seem to play a more important role.

                                                                                                Having tried the nightlies of Firefox 57, Mozilla has basically reset my browser usage to a vanilla install. All my extensions will stop working (marked as “legacy” – and I only have three: mouse gestures, an ad-blocker and tree-style tabs) and my theme causes tabs to crash on load (which I only use because the default theme keeps gradually eating more and more screen space).

                                                                                                While I’m positive that a solution can be found for mouse gestures and ad-blocking, it seems that tree-style tabs (or any kind of UI customization) is thoroughly dead. Even if they addressed the dozen of bugs that were filed to get tabs working again, it’s quite clear that the required level of visual integration to avoid making it look like a second-class citizen will not be supported anymore with WebExtensions.

                                                                                                The whole switch to WebExtensions feels like going from a positive, user-empowering stance of helping and encouraging users and extension developers to adapt their browsing experience to their liking, to a model where the possibilities of customization and extension is severely limited to protect the users from potential harm that seems to lurk behind every extension.

                                                                                                1. 21

                                                                                                  It’s not just about protecting users from harm, it’s also about:

                                                                                                  1. Performance. By restricting extensions to APIs we can ensure they will run silky smooth.
                                                                                                  2. Compatibility. Old style extensions broke anytime the random internal thing they depended on changed, so developers would constantly have to be updating their addons. Web extensions are one last major breaking change for addon developers, and then they never have to worry about compatibility again.
                                                                                                  3. Portability. Web extensions can be shared across browsers, so developers don’t need to write multiple versions of their addons anymore just to support Firefox+Chrome. Given a choice between supporting only one of Firefox or Chrome, 95% of developers were already choosing Chrome (I made that number up, but probably). This equalizes the gap.
                                                                                                  4. Security. Like you mentioned, it will be very hard to write malware when that malware is restricted to known APIs.

                                                                                                  There are a lot of really good reasons to make this switch. And while it will be frustrating to a lot of loyal users and developers, I think it will be the right decision in the long term. I’m feeling the pain too, a bunch of my extensions no longer work either. But I’m confident I’ll either find replacements in due time, or adapt my workflow to live without them.

                                                                                                  Btw, u-block origin already has a web extension posted to their AMO dev channel.

                                                                                                  1. 19

                                                                                                    Since I don’t see many people sharing this sentiment, I just want to chime in as a long-time Firefox user and say that I’ve been really pleased with the work in Firefox over the past several years. Performance has improved massively, and it seems like every time I open the developer tools, I find some cool new thing I didn’t know about before. I’ve also gotten a lot of mileage out of several of the experiments in TestPilot. All in all, I’m quite pleased.

                                                                                                    Keep up the great work!

                                                                                                    1. 3

                                                                                                      Thanks! Much appreciated :)

                                                                                                      1. 2

                                                                                                        As another random data point, I don’t remember ever even having a real problem with Firefox.

                                                                                                        But now the new version worries me because there might not be a good mouse gesture plugin available.. soooo if you wouldn’t terribly mind implementing mouse gestures the way Opera v12 had them, that would be nice :)

                                                                                                        1. 2

                                                                                                          As another random data point, I don’t remember ever even having a real problem with Firefox.

                                                                                                          But now the new version worries me

                                                                                                          Likewise, Firefox has always been great for me, but only because I use an extension which allows me to rebind the keys. This extension doesn’t exist for Chrome because Chrome hard-codes ctrl-n to “open a new window” for security theater reasons. (I can’t remember the last time I opened a new browser window on purpose, but it wasn’t in the past decade.) If Firefox starts copying Chrome in that regard I’ll be forced to choose between staying on the old version forever or spending half my day closing those seventeen windows that just opened because I was trying to scroll down.

                                                                                                          1. 1

                                                                                                            I found this: https://addons.mozilla.org/en-US/firefox/addon/foxy-gestures/

                                                                                                            Not sure if it solves your use case or not though.

                                                                                                            1. 2

                                                                                                              Just tried it, doesn’t really work. (In the sense of “fails to save any changes and crashes reproducibly”.)

                                                                                                      2. 2

                                                                                                        Thanks for the note on uBlock. The dev channel thing was quite hidden, but I found it.

                                                                                                        Well, all I can say is that I think it is sad to see that Firefox is switching from the software repository approach popular on Linux distributions to the walled garden approach of app stores (like on Windows/Mac).

                                                                                                        I can understand why it is more convenient for developers this way, but I don’t try to be a developer of every technology I use. (Ok, I’m still sitting on this reproducible Firefox crasher and I installed the debug symbols to figure out where it comes from … but sometimes I just want to be a user.)

                                                                                                        Currently my only hope is that the official roll-out of WebExtension gets delayed just enough for another Firefox ESR release based on the current code. This would give me another few years out of Firefox, but in the long term I really don’t see a future for me on Firefox. That’s kind of sad because I have been an user since it was called Netscape Navigator.

                                                                                                        It’s kind of clear that vertical tabs will never be a first-class citizen with WebExtensions (even under the assumption that all of the dozen current bug reports get sorted out).

                                                                                                        Firefox’ stance reminds me of the saying “if the government is unhappy with its citizens, it should swap out its citizens” and the CADT that happened with Gnome. (XFCE user ever since.)

                                                                                                        1. 1

                                                                                                          Well, all I can say is that I think it is sad to see that Firefox is switching from the software repository approach popular on Linux distributions to the walled garden approach of app stores (like on Windows/Mac).

                                                                                                          Would you mind clarifying? The distribution model for WebExtensions is the same as for non-WebExtensions. Or are you referring to the use of sandboxing?

                                                                                                          1. 1

                                                                                                            Having to beg Firefox developers to allow me to make the changes I want to my browser feels counter to everything Mozilla stood for in the past.

                                                                                                            1. 1

                                                                                                              I see. On the other end, every API exposed to extensions becomes something that Mozilla has to commit to maintaining into the future, imposing architectural constraints. This was most painfully evident in the long process of the e10s (multiprocess) roll-out.

                                                                                                      3. 5

                                                                                                        There is a tree style tabs in “Firefox Testpilot”, that’s not going to break because of the API changes

                                                                                                        1. 2

                                                                                                          Are you talking about Tab Center? That’s sadly not a tree style tabs extension, merely a vertical tabs extension. But yes, the point remains that you can write functional alternative tab bars with the new API.

                                                                                                          1. 3

                                                                                                            From what I have seen, the UI from tab center will not be supported with official WebExtensions.

                                                                                                            For instance, the obnoxious sidebar header will be mandatory: https://github.com/Croydon/vertical-tabs-reloaded/issues/13#issuecomment-294589274 That’s a killer for me, right there.

                                                                                                            This is what I currently have: http://imgur.com/a/OemGy

                                                                                                            This is what I’d like to have: http://imgur.com/a/cWEsE

                                                                                                            This is probably the best I will get with WebExtensions: https://addons.cdn.mozilla.net/user-media/previews/full/185/185415.png

                                                                                                            Thanks, but no, thanks.

                                                                                                          2. 1

                                                                                                            The test pilot has ended, and I can’t find a way to install the add-on now. Which is a shame, because they had one feature that would have actually improved my experience: Tabs taking the whole area on the left side, instead of being under the location bar. https://testpilot.firefox.com/static/images/experiments/tab-center/details/tab-center-1.ceef2f45.jpg

                                                                                                            I’d love to have a tab extension doing that.

                                                                                                          3. 4

                                                                                                            holy hell, another tree-style-tabs-er - people don’t understand us. - I moved to vivaldi cos chrome had no capability to do vertical tabs (and always felt strangely icky on chrome). Vivaldi has vertical tabs but not tree style :(, is all chrome under the hood but with plenty of customizability and most of the “i wish i hads” from firefox. It started out buggy when i was using it but has generally gotten better. not OSS is the only thing that mildly annoys me.

                                                                                                            I personally jumped away from firefox when i eventually got sick of it regularly slowing down after a few hours of use (to the point of barely scrolling while rendering another tab i had just middle clicked on)

                                                                                                            that said, none of the news coming out of the ff camp is making me think “wow i should totally give it another shot”. Your comment only reinforces that - I hate not having control over other people’s stupid decisions on my system.

                                                                                                            1. 6

                                                                                                              There are dozens of us using tree-style-tabs.

                                                                                                            2. 3

                                                                                                              https://addons.mozilla.org/en-US/firefox/addon/tree-tabs/ is the Tree Style Tabs replacement. It’s not as good, but it’s improving.

                                                                                                              I switched to https://addons.mozilla.org/en-US/firefox/addon/tab-center-redux/ and it’s pretty great.

                                                                                                              1. 2

                                                                                                                I tried them all. They are quite restricted in what they can do, and the mandatory tab header makes it pretty clear that stuff like this will always be a second-class citizen under WebExtensions.

                                                                                                                Think about it: Why doesn’t the “official” tab bar get one of these headers, too? Because it is completely jarring and obnoxious. Firefox devs know it sucks, so they don’t follow these rules, but everyone else has.

                                                                                                                1. 4

                                                                                                                  and the mandatory tab header makes it

                                                                                                                  It’s not “mandatory”. There are bugs open for a webextension API for removing it, and Firefox devs seem to be open to adding one. This API doesn’t exist now, but you’re painting it as if it will never exist.

                                                                                                                  This stuff is still new, and will improve over time as new APIs get added. Like I said, “it’s not as good, but it’s improving”.

                                                                                                                  Please assume good faith.

                                                                                                                  1. 3

                                                                                                                    It seems like from Mozilla’s perspective the sidebar header is not a bug, but desired behavior: https://github.com/Croydon/vertical-tabs-reloaded/issues/13#issuecomment-294589274

                                                                                                                    I’d love to see the tickets though, because I couldn’t find anything in the official bug tracker (but maybe I used the wrong search terms).

                                                                                                                    And that’s not the only issue: it seems like the place is fixed to be beneath the location bar, either at the left or right side, falling way short of Tab Center.

                                                                                                            1. 2

                                                                                                              And this is why lacking package namespacing is such a bad idea: https://crates.io/crates/http

                                                                                                              (Told you so, I guess.)

                                                                                                              1. 16

                                                                                                                And this is why lacking package namespacing is such a bad idea: https://crates.io/crates/http

                                                                                                                If you take a look, seanmonstar - one of the authors of http - is a co-owner and the http crate will be published there.

                                                                                                                Not using namespacing is entirely intentional. The other option would be to have a fragmentation of multiple packages called http, all with different prefixes. Especially the http crate is meant to be a center-piece of the ecosystem and wouldn’t live any better in a namespace then somewhere else.

                                                                                                                We’ve been there: Github had a namespaced gem host for a longer time and it lead to fragmentation within the ecosystem very quickly (“which fork of $x are we currently using”?). There are many large ecosystems without namespacing out there (gems, npm) and it is rarely a problem.

                                                                                                                But that discussion has been had - multiple times - and the only thing we could do is rehashing.

                                                                                                                (Told you so, I guess.)

                                                                                                                Let me be as blunt as you are: Your guess is wrong. And smug.

                                                                                                                1. 4

                                                                                                                  Not using namespacing is entirely intentional. The other option would be to have a fragmentation of multiple packages called http, all with different prefixes. Especially the http crate is meant to be a center-piece of the ecosystem and wouldn’t live any better in a namespace then somewhere else.

                                                                                                                  Is there a suggested approach for private crates? For example for companies.

                                                                                                                  1. 7

                                                                                                                    It’s not hard to run your own crate host (currently, that’s a bit of manual work or feasible, but making that better is wanted).

                                                                                                                    crates.io is fully public and not a commercial service.

                                                                                                                    Also, cargo understands git dependencies and can put multiple crates in a repository, which is what I usually use.

                                                                                                                    1. 1

                                                                                                                      It’s not hard to run your own crate host (currently, that’s a bit of manual work or feasible, but making that better is wanted).

                                                                                                                      Would that custom crate host work as a proxy to crates.io? Or just another host? I’m thinking that it’s useful to have access to crates.io but host some crates on custom host…

                                                                                                                      Also, cargo understands git dependencies and can put multiple crates in a repository, which is what I usually use.

                                                                                                                      Just like npm dependencies can use git URLs? Great! That solves a lot of cases for me.

                                                                                                                      Thanks!

                                                                                                                      1. 7

                                                                                                                        Would that custom crate host work as a proxy to crates.io? Or just another host? I’m thinking that it’s useful to have access to crates.io but host some crates on custom host…

                                                                                                                        Mostly, cargo retrieves a flat-file manifest, then does the resolution locally and then hits our download host. So proxying doesn’t make that much sense, unless you want to publish to crates.io, too. I would run a mirror if I had to.

                                                                                                                        The process of setting up a mirror is explained in detail here: http://www.integer32.com/2016/10/08/bare-minimum-crates-io-mirror-plus-one.html

                                                                                                                        1. 1

                                                                                                                          That’s exactly what I needed, thanks.

                                                                                                                          1. 6

                                                                                                                            I should also mention that in general, we’re working towards making this easy, it just takes time to design, like anything else. See https://github.com/rust-lang/rfcs/pull/2006 for example.

                                                                                                                            1. 3

                                                                                                                              Excellent, I’m glad that this is considered. The process transparency with Rust’s RFCs is really impressive.

                                                                                                                  2. 6

                                                                                                                    If you take a look, seanmonstar - one of the authors of http - is a co-owner and the http crate will be published there.

                                                                                                                    I’m kind of surprised that you assume that I haven’t checked this. I did, and the fact Rust team got lucky this time changes absolutely zero about the fundamental issue.

                                                                                                                    • Crates.io prides itself with >10.000 “crates in stock”.
                                                                                                                    • Most English speakers have a vocabulary size of 15.000 to 20.000 words.

                                                                                                                    This means that practically every “obvious” noun that one can think of has already been claimed by someone.

                                                                                                                    What happens the next time the Rust team wants to use some “nice” name?

                                                                                                                    Will Rust devs ask nicely? What happens when the person who claimed the name is not reachable anymore, or doesn’t want to relinquish the name? Will the Rust team just commandeer that person’s crate?

                                                                                                                    fragmentation within the ecosystem […] (“which fork of $x are we currently using”?)

                                                                                                                    That pain is completely manageable compared to the pain of having to change every single file in a project just to swap out one version of a library with some fork of it (for instance to check whether some bug has really been fixed).

                                                                                                                    There are many large ecosystems without namespacing out there (gems, npm) and it is rarely a problem.

                                                                                                                    npm introduced namespaces in 2015.

                                                                                                                    Let me be as blunt as you are: Your guess is wrong. And smug.

                                                                                                                    I think it’s only a matter of time until Rust comes around. I’m happy to remind you when it happens.

                                                                                                                    1. 7

                                                                                                                      | I think it’s only a matter of time until Rust comes around. I’m happy to remind you when it happens.

                                                                                                                      The possibility you might be right in the future doesn’t make you less smug right now.

                                                                                                                      1. 0

                                                                                                                        So as soon as I’m proven right, it’s not considered smug anymore? Following that reasoning, I’d like to settle my smugness debt with prior cases of me making a prediction and being right. :-)

                                                                                                                        1. [Comment removed by author]

                                                                                                                          1. 1

                                                                                                                            No, I’m just kidding. Jesus.

                                                                                                                      2. 6

                                                                                                                        What happens the next time the Rust team wants to use some “nice” name?

                                                                                                                        We play by the same rules as everyone else.

                                                                                                                        That pain is completely manageable compared to the pain of having to change every single file in a project just to swap out one version of a library with some fork of it (for instance to check whether some bug has really been fixed).

                                                                                                                        You don’t need to do this, you use an override or [replace], it’s one/two line(s) in Cargo.toml.

                                                                                                                        1. 2

                                                                                                                          Or an “extern crate foo as bar” in {mod,lib}.rs. Either technique is strictly more flexible than relying on a forked version of a library retaining the same name under a different namespace.

                                                                                                                          1. 1

                                                                                                                            So there is already some half-baked namespacing mechanism, it’s just that everyone has to roll their own when required?

                                                                                                                            1. 4

                                                                                                                              I don’t think of it as having anything to do with namespacing, personally.

                                                                                                                          2. 5

                                                                                                                            I did, and the fact Rust team got lucky this time changes absolutely zero about the fundamental issue.

                                                                                                                            Great job on the timing of the “I told you so”.

                                                                                                                            What happens the next time the Rust team wants to use some “nice” name?

                                                                                                                            If they can’t, they can’t. Meh. The Rust team doesn’t get special privileges here. Like everyone else, they have to come up with a new crate name each time. It’s not hard.

                                                                                                                            If someone goes and squats a million crates there’s a chance the team may undo that, but in general if a crate is taken it’s taken.

                                                                                                                            It’s not really considered a major problem, and really namespacing doesn’t solve that problem much either. It solves it to the extent that Rust gets a namespace for “official” stuff, but not really for anyone else.

                                                                                                                            Most English speakers have a vocabulary size of 15.000 to 20.000 words.

                                                                                                                            Your math assumes single word crates; most crates are two words.

                                                                                                                            Doing a quick grep, only half the crates (almost exactly half actually) use only alphanumeric characters in their names (Rust crates use - or _ often for multiword crates). On top of that there are plenty of two word crates with the names mushed together.

                                                                                                                            When a crate name can be more than just a single noun, you still have plenty of possibilities.

                                                                                                                            the pain of having to change every single file in a project just to swap out one version of a library with some fork of it

                                                                                                                            [replace] and [patch] exist. http://doc.crates.io/manifest.html#the-patch-section

                                                                                                                            1. 2

                                                                                                                              Rust crates use - or _ often for multiword crates

                                                                                                                              I do wish Cargo had disallowed one or the other before the 1.0 ship set sail. The community seems to have standardized on - as a separator in the package name that goes in Cargo.toml and _ for the actual crate name, but it’s not universal.

                                                                                                                              I suppose it wouldn’t be too late to transparently make - and _ equivalent as far as Cargo/Crates.io are concerned, if there are no actual instances of published crates whose names would clash given a global replacement one way or the other.

                                                                                                                              1. 1

                                                                                                                                I thought there was an issue open for this, but cannot find it.

                                                                                                                                I agree wholeheartedly.

                                                                                                                                1. 1

                                                                                                                                  I suppose it wouldn’t be too late to transparently make - and _ equivalent as far as Cargo/Crates.io are concerned,

                                                                                                                                  So:

                                                                                                                                  • Crates.io considers them to be the same when uploading crates
                                                                                                                                  • Rustc will always see crate names with hyphens converted to underscores

                                                                                                                                  (So there are no clashing crate names)

                                                                                                                                  However, I think you still have to get the crate name correct when describing it as a dependency in Cargo.toml.

                                                                                                                                  This is probably a straightforward fix in Cargo itself, with no backwards compatibility risk. I’d be willing to help push this through (or mentor folks who want to work on an rfc for this)

                                                                                                                                2. 1

                                                                                                                                  If someone goes and squats a million crates there’s a chance the team may undo that, but in general if a crate is taken it’s taken.

                                                                                                                                  I know that “a million” is just hyperbole, but it’s already the case that people have claimed dozens of very common names for seemingly no other purpose than “owning” them.

                                                                                                                                  1. 1

                                                                                                                                    Which is fine. Let them have fun.

                                                                                                                              2. 2

                                                                                                                                Github had a namespaced gem host for a longer time and it lead to fragmentation within the ecosystem very quickly (“which fork of $x are we currently using”?).

                                                                                                                                This is just a variation of “Which X are we currently using?” You’ve traded namespaces + common names for no namespaces + creative names. By going with creative names and no namespaces, you’ve made discoverability harder without a lot of benefit.

                                                                                                                                1. 4

                                                                                                                                  Since this was reverted, it has become more common again to contribute back. The problem was that everyone ran their own fix with their own bugfix.

                                                                                                                            1. 1

                                                                                                                              Is there any research about why users switch browsers? I think that reversing the trend for Firefox has two components (that should be considered separately for desktop and mobile):

                                                                                                                              1. Why are users abandoning Firefox?
                                                                                                                              2. What would make users switch to Firefox from another browser?

                                                                                                                              A quick search didn’t return anything meaningful so I’m curious whether you’re aware of any research in this area.

                                                                                                                              1. 7

                                                                                                                                Speaking just for myself – thus this is just an anecdote – but I switched from Firefox to Chrome years ago because the Firefox UI would often become unresponsive for several seconds, which drove me crazy. Also, because of the (perhaps mistaken) perception that Chrome was more secure.

                                                                                                                                That being said, I recently switched back to Firefox at work, and it seems like they’ve fixed a lot of the UI latency issues in Firefox.

                                                                                                                                1. 1

                                                                                                                                  With Electrolysis most of these features should have been fixed. You can also turn on multiple content processes somewhere in the settings which means that one slow site won’t slow down all your tabs.

                                                                                                                                  1. 1

                                                                                                                                    My hidden ricer side wakes up when I think about the potential speedups with multiple processes.

                                                                                                                                    That’s because I use the -ck patches, including the MuQSS scheduler, which goes really well with multiple processes.

                                                                                                                                  2. 4

                                                                                                                                    I have piped up on this subject before and can speak only for myself, but here goes:

                                                                                                                                    Firefox annoys the shit out of me at times. It slows down randomly. Sometimes, after a restart, it forgets I use two windows. It updates so often I don’t know which issue goes with which version, so I give up caring. Sometimes it corrupts its sessions.

                                                                                                                                    Then I look at the competition. No multi-row tabs. No tab groups, lile the FF add-on I like. The Community(tm) gently points me to sub-par alternatives like lists or tree views. Good for you, if that works for you. Not my thing.

                                                                                                                                    I half-way upgraded to Debian Stretch. I know you shouldn’t do that, things break between distro versions. Naturally some dependency unknown to me broke Mozilla’s build. So I tried the ESR build and it was slow. Like a retarded sloth doped on ketamine and stuck in tar.

                                                                                                                                    So I concluded the experiment by upgrading everything. Firefox is usually fast enough, again.

                                                                                                                                    I also learned to live with the various backup methods.

                                                                                                                                    The reason I care about this? I use tabs in tab groups a bit like bookmarks, so I can switch contexts by switching all tabs depending on what I feel like doing.

                                                                                                                                    I estimate there are roughly zero people on the planet who do this like I do.

                                                                                                                                    I also estimate there are less than five people who’d be convinced by a demo of the addons, but they’d have neither the patience nor desire to be convinced.

                                                                                                                                    1. 3

                                                                                                                                      For what is worth this is exactly how I use tab groups :) No idea what I will use once they are gone.

                                                                                                                                    2. 3

                                                                                                                                      I switched off firefox because it’s unbearably slow. I will switch back if they make a browser based on servo.

                                                                                                                                      When I remember that they have a 1000+ employees it makes me really uncomfortable.

                                                                                                                                      1. 2

                                                                                                                                        What did you switch to?

                                                                                                                                        Why do 1000+ employees make you uncomfortable?

                                                                                                                                        1. 1

                                                                                                                                          If all goes well, the first Servo-based components should be in Firefox by the end of the year. Not all of Servo, just bits of it (currently it’s the style system and rendering stack)

                                                                                                                                        2. 2

                                                                                                                                          for desktop usage on linux, first it was lacking flash when it was common, then it was problems with H264 (which is patented), then EME/DRM, and now there’s still issues with netflix filtering it based on browser ID.

                                                                                                                                          looking at windows machines, it took longer to adopt auto updates. users who installed firefox before auto updates and when chrome did update are possibly comparing firefox 20 to the latest chrome. they’re unaware it’s much better if updated.

                                                                                                                                          the big numbers come from mobile. your phone already comes with a browser, and it’s never firefox. why would you get another (assuming you can)?

                                                                                                                                          1. 1

                                                                                                                                            I have a modernish computer with SSD and 16 GB of RAM, every year or so I try to Firefox but it is sluggish with 2 windows with 50-80 tabs each or so (yes I’m a hoarder and probably in the 99 percentile for tabs, but I just can’t find anything that can cope with my usage except Opera, Chrome and Chromium).

                                                                                                                                          1. 3

                                                                                                                                            This limitation is also relevant when you’re trying to serialize and deserialize objects for external crates, like a MySQL row.

                                                                                                                                            Note that Rusts serialization framework, serde, has ways to avoid this issue by specifying how something should be serialized.


                                                                                                                                            Really like D’s compile time introspection though.

                                                                                                                                            1. 1

                                                                                                                                              why does it take so long to build a webpage engine? It seems like servo has been around for quite some time now and it’s still suuuuuper alpha quality. I’m not complaining just curious what it is about it that makes it so difficult.

                                                                                                                                              1. 3

                                                                                                                                                The Web is really, really, really complicated, basically.

                                                                                                                                                We’ve also spent more time experimenting on new ideas than working on getting production quality. And a lot of great ideas have come out of it! Focus is shifting now, but not completely.

                                                                                                                                                A lot of this means that the interesting bits (i.e. where we can do research) of the browser are more complete than a lot of basic stuff in the uninteresting parts. After all, Servo is primarily a research project.

                                                                                                                                              1. 2

                                                                                                                                                I’m sad that we are still building new OSes with C. :-(

                                                                                                                                                1. 7

                                                                                                                                                  If it makes you feel better, half the kernel is in C++?

                                                                                                                                                  https://github.com/fuchsia-mirror/magenta

                                                                                                                                                  1. 14

                                                                                                                                                    Now that makes me sad.

                                                                                                                                                    1. 2

                                                                                                                                                      Also theres some Rust in there (specifically xi-editor, the editing backend for all UI). I don’t think it is in the kernel though. Could be wrong.

                                                                                                                                                    2. 6

                                                                                                                                                      Why?

                                                                                                                                                      1. 3

                                                                                                                                                        About a billion security problems over the last two decades.

                                                                                                                                                        1. 2

                                                                                                                                                          Sorry, not taking the bait. Nice try. :-)

                                                                                                                                                      2. 3

                                                                                                                                                        My understanding from an article I read awhile ago is that a lot of the lower-level code will be Go.

                                                                                                                                                        1. 3

                                                                                                                                                          The network stack is in go. Rust support is getting there.

                                                                                                                                                        2. 2

                                                                                                                                                          What’s the alternative?

                                                                                                                                                          1. 1

                                                                                                                                                            I didn’t say I had an alternative. I’m sad it’s still the only viable choice.

                                                                                                                                                        1. 3

                                                                                                                                                          This reminds me of so many other situations wherein open-source projects have problems with Windows (that would not be problems if more of those devs were Windows devs) and usually people don’t notice right away because no one is testing it. I think this is still a thing when it comes to Python tools on Windows.

                                                                                                                                                          1. 5

                                                                                                                                                            Not all problems can be preempted by tests :)

                                                                                                                                                            In this case it was more like the tests didn’t really do a full registry fetch; since the tests all run without needing internet iirc. Even if the tests did do a registry fetch, this would only be caught the next time someone ran the tests against a modified registry, you can’t preempt this problem until it happens. People did immediately notice however and ping the team so it could be rolled back.

                                                                                                                                                            Last I checked we were testing all platforms for cargo and rustc.

                                                                                                                                                            Many rustc devs use Windows so it’s not that bad. Though it did take a while to get proper debuginfo on windows way back.

                                                                                                                                                            1. 2

                                                                                                                                                              Not all problems can be preempted by tests :)

                                                                                                                                                              Sure they can, if you’re willing to wait long enough on your test suite :)

                                                                                                                                                              (I’m certainly not claiming that this should’ve been tested for. Sounds like it was handled fine.)

                                                                                                                                                            2. 5

                                                                                                                                                              Amen. I’ve personally been Linux-only for about a decade, but I maintain an open source command line tool that purports to work on Linux, Mac and Windows. Windows has been a neverending hole. (And I say that without blame. Perhaps it isn’t Windows fault, and it’s just my unfamiliarity with the platform, or maybe it’s just how end users have adapted their interaction with the platform. Nevertheless, this is my experience.) Just off the top of my head, without looking at my issue tracker:

                                                                                                                                                              • Colors in a terminal are done completely differently than on Unix, and require synchronous interaction with the Windows console. If your tool writes to stdout from multiple threads, this is a problem. (I’ve fixed this.)
                                                                                                                                                              • Windows users are split between cygwin and PowerShell/cmd users, which means Windows actually needs to be able to support ANSI coloring too. (I’ve fixed this.)
                                                                                                                                                              • There’s no portable API for determining, on Windows, whether you’re at a tty or not when you factor in both console and cygwin users. (I’ve fixed this.)
                                                                                                                                                              • Windows programs are responsible for doing their own globbing on arguments given to argv. (Not fixed.)
                                                                                                                                                              • Long file paths require special attention and don’t Just Work. (Not fixed.)
                                                                                                                                                              • Symlinks are a minefield, in general, especially when cygwin gets involved since cygwin has its own “seamless” path translation code. (Not fixed.)
                                                                                                                                                              • Defining “aliases” or “wrapper scripts” is purportedly so hard (according to my users) that a configuration file for including common flags in my tool is a hugely desirable feature. (Not fixed.)

                                                                                                                                                              There are more problems, but I’d have to go look at my issue tracker to remember them. Some of the aforementioned issues would be fixed if I were linking with cygwin and using those APIs, but then Windows users are forced to use two separate binaries based on which environment they’re in. (And there are operational problems with me using cygwin this way anyway, since I’m not using C.)

                                                                                                                                                              I’ve also started getting bug reports from Windows users that are using Bash on Windows. I’m not looking forward to supporting a third environment just from within Windows itself.

                                                                                                                                                              1. 1

                                                                                                                                                                I’m helping an engineer at work setting up better dependency management for his c++ projects, the life of a windows dev is hard… I mean just getting a way to compile libmodbus properly is a challenge we still havent solved (Short of putting the files manually in the project or cross compiling from linux to windows)

                                                                                                                                                                How do win devs get c/c++ libraries outside of the .net ecosystem?

                                                                                                                                                                1. 3

                                                                                                                                                                  How do win devs get c/c++ libraries outside of the .net ecosystem?

                                                                                                                                                                  C/C++ projects usually have way less dependencies and they don’t change that often.

                                                                                                                                                                  Keeping the dependencies inside the source control is effective way of making sure you don’t have to setup dependencies again.

                                                                                                                                                                  1. 2

                                                                                                                                                                    I recently discovered Conan. Maybe that helps?

                                                                                                                                                                    1. 1

                                                                                                                                                                      I like the idea, I’ll see if I can compile a package