Live data from Hacker News

Re: Integrating "safe" languages into OpenBSD? (2017)

marc.info

241–250 of 400 posts

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#241
post #82

> Adding such a toolchain would take make build time from 40 minutes to hours. I don't see how that would happen. This should have been at the top of the email because this is the main issue (along with the i386 one). As other people have noted in this thread some people have already re-written basic utilities in Rust (and other languages). Unless someone manage to make the Rust compiler much much faster then it is c…

Yes, but are those rewrites really 100% drop-in replacements? That's a key bit here.

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#242
Admittedly it's not much of an opinion on Rust as a language but rather the size and performance of its compiler. And I can understand why Rust advocates would see it as a criticism of the language...because the language and the compiler are heavily intertwined. I can also see that there are extremely valid use cases for small and simple over big and complex, and in those use cases, Rust is absolutely a bad fit.

I do, however, think it is odd that OpenBSD would value compiler size over security, given the philosophical values of the OpenBSD project. I would expect that sort of opinion (and agree with it) in the NetBSD project, but I would think that OpenBSD would be willing to put up with big compiler binaries and slow compile times in exchange for even small improvements in memory safety. Strongly and statically typed languages in the ML tradition (like Rust, SML, OCaml, Haskell) all have big bloaty compilers, but that is for a specific reason: the type system that prevents you from compiling invalidly-typed programs is in essence a test suite. And for rust, a language with a type system that covers memory safety bugs, that test suite is massive.

OpenBSD is pretty famous for the comprehensiveness of its test suite, perhaps only superseded in depth by applications that lack its breadth (such as SQLite). I've never run the full OpenBSD test suite in a development cycle, but I've heard stories about running it that perhaps parallel the frustration newbies have with getting rust programs to compile.

What would an OpenBSD test suite look like if it could conclusively prove the absence of all memory safety bugs? Would Theo De Raadt be willing to put up with a test suite that ran for two hours longer and required more memory than could be allocated on i386 systems if it could do so? I think he would...because that is something in line with the OpenBSD philosophical values. So why is it that it needs to compile code so efficiently, if you're gonna turn around and run tests for 3 days to make sure nothing breaks?

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#243

Earlier quoted context omitted.

Was this true in 2017, when the statement was written?

Both redox's grep and ripgrep (which trivially demonstrates that a grep can be implemented in rust even if it's not a POSIX grep implementation) were created / started in early 2016, so yes. Not to mention Theo's statement is so much weaker than actually successful implementations the existence of these two completely blows through the goal: > There has been no attempt to move the smallest parts of the ecosystem, to…

What matters is when they were feature complete, not when the project started. I can't plausibly claim that a program I wrote some code for but isn't at the state of being a viable substitute yet is a "replacement."

(And yes, Theo, like many hackers, is prone to exaggeration.)

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#244
post #8

> I wasn't implying. I was stating a fact. There has been no attempt to move the smallest parts of the ecosystem, to provide replacements for base POSIX utilities. This is in fact incorrect--there is a project aiming to build all of the coreutils in Rust ( https://github.com/uutils/coreutils ). More to the point: while I do concur in the conclusion that Rust shouldn't be a part of the OpenBSD base system, the gatekee…

There is no gatekeeping. To actually achieve POSIX-compliance is not an easy task and requires lots of testing. If you don't do it then your replacement will break everyone's scripts. A distro maintainer will also want to retain compatibility with their supported GNU/BSD extensions so that's more work to add on. I would still agree with his statement at least as far as BSD is concerned. Outside of Redox I haven't see…

[deleted]

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#245
post #5

All the core utils have been ported to rust for the redox project, and there are actually superior alternatives in some cases available like ripgrep.

For this to be valid those would have to be 100% drop in replacements, and they are not. 'superior alternatives' are almost by definition not drop-in replacements.

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#246

Earlier quoted context omitted.

I was going to say, all this discussion of whether you can make OS utilities in rust seems to be ignoring the entire OS that’s actually being written in rust!

How long until it will have the same kind of reputation that OpenBSD has?

That’s really hard to say. Creating an OS that actually sees usage is hard, and involves a huge number of non-technical hurdles to adoption. It’s entirely possible that Redox will technically work, but never gain any following because it doesn’t solve any problem well enough to justify the switching cost.

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#247
post #89
post #8

> I wasn't implying. I was stating a fact. There has been no attempt to move the smallest parts of the ecosystem, to provide replacements for base POSIX utilities. This is in fact incorrect--there is a project aiming to build all of the coreutils in Rust ( https://github.com/uutils/coreutils ). More to the point: while I do concur in the conclusion that Rust shouldn't be a part of the OpenBSD base system, the gatekee…

> the gatekeeping implied here [...] is really toxic It's Theo de Raadt, toxic rhetoric is sort of his brand. But... he has a real point here. It's not about grep or cat or whatever really, those are just the use cases for which OpenBSD would care. It's that as Rust is reaching the second decade of its history, and despite some outrageous wins in press, evangelism, and general developer mindshare... Rust just hasn't…

I agree UNIX base is not its niche.

But take a look on Firefox:

* Video and audio codecs - MP4 metadata parser, Audio backend

* Database engines - key-value storage backed by LMDB

* Network stacks - A QUIC implentation, SDP parsing in WebRTC

* PKI and encryption stacks - TLS certificate store

* And more https://wiki.mozilla.org/Oxidation

Just five years since first stable release.

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#248

Earlier quoted context omitted.

> There's "no reason" why the rustc build should depend on cargo, rustc is a Rust project. Cargo is a build system for Rust projects. > this makes it way harder than it should be to keep rustc support up-to-date in any distro I am not aware of distro maintainers complaining about this, or at least, not any time in the last few years. Do you have some context to share? We want distros to have a good experience.

Debian unstable (IIRC) updated Firefox a couple weeks late because cargo got a couple of new dependencies and nobody added them to the Debian repos. This is because they forbid static linking, so there are hundreds of packages of popular Rust crates compiled as shared libraries. Even worse, some of them have multiple variants, for various combinations of features.

Sure. This is one instance of this happening, and it was fixed, it just took some work. Nobody even filed an upstream bug. This isn’t something exclusive to Rust. It’s almost arguably more due to the way that browsers are treated as an exemption from distro packaging policies (which I appreciate, personally.)

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#249
post #157
post #127

Earlier quoted context omitted.

> Developers in particular don't generally care about security, so selling Rust as a "secure" language is not going to be enough. You do realize that OpenBSD is, by far, the most secure general purpose operating system specifically due to decades of thankless work by people like Theo de Raadt, right? I don’t think healthy skepticism of Rust is strong enough evidence to conclude that they don’t care about security.

I thought it was the most secure general purpose operating system because it's so rarely used - especially for use cases like running untrusted code in unprivileged accounts - that it's a low-value target. Sure, OpenBSD doesn't have exploitable security holes when used as e.g. a packet router, but when was the last time Linux did? OpenBSD's website says things like "Only two remote holes in the default install, in a…

> Sure, OpenBSD doesn't have exploitable security holes when used as e.g. a packet router, but when was the last time Linux did?

didn’t linux move a packet routing vm into the kernel in the last ten years? I’d say chances are high there are multiple exploitable holes just based on time and surface area alone.

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#250

Earlier quoted context omitted.

Agreed on a hundred thousand. I used to feel sheepish defending npm and the whole node package ecosystem against its critics, but once I started trying to run deep learning applications or WebRTC media servers I quickly realized that some of the critics are probably coming from a much worse package management system that they’ve merely grown familiar with. Want to have two pieces of software on one computer that rely…

> Want to have two pieces of software on one computer that rely on... idk, two different versions of libwebsockets? You've pointed this out yourself, but this works just fine in any sensible OS. You just have two or more versioned instances of libwebsockets in your /usr/lib directory, and a symlink (or multiple symlinks with different partial-semvers) that points to some appropriate default. I think even Windows is d…

Why does a "default" need to exist at all at the system level? Why not just have various versions available and have version decisions be local to the software being developed/used.
Post reply on HN