Live data from Hacker News

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

marc.info

341–350 of 400 posts

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

#341

It also doesn't help that Rust keeps on pushing on the idea that "static linking is the only way to go". This is another cargo-cult which I wish didn't end up being engrained so deep in the toolchain because while it has some merits, it also has significant drawbacks of a typical unix distribution. Static linking might be good for folks distributing a single server binary over a fleet of machines (pretty much like Go…

How much do your programs really share? After libc, libm, and pthreads, the most common thing they link to is probably pcre, and I'm sure you can guess how many of your programs are using that. A good linker will shave off the parts of a library you're not using, and the parts which are left over are usually not very big. The problem isn't with static linking, it's that some "developers" think that bundling an entire…

On my computer, there's the standard libraries and frameworks that provide things like GUI widgets, cryptography routines, and access to various user databases.

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

#343

Earlier quoted context omitted.

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…

I don't think you miss anything. POSIX compliance is a headache which is not only hard to get right but also strongly limits your interfaces and internal tooling. Many scripts still will run with non full compliance, but that doesn't help if you try to build for OpenBSD. Also I'm not sure how they ended up with 400 deps for coreutils. I would have expected much less. But yes this means at least until better code sign…

> POSIX compliance is a headache which is not only hard to get right but also strongly limits your interfaces and internal tooling.

Platforms which are POSIX compliant usually offer extensions and then allow for selecting actual POSIX-compliant behavior. It's not a very strong limitation if you're already fairly close to that anyways.

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

#344
post #102
post #94

Earlier quoted context omitted.

I think it was more the implication that requiring more than 2GB of RAM to compile itself was an indication of its profligate resource usage.

How much of that is Indicative of rustc vs llvm? The latter isn't exact a lightweight piece of software.

It seems like a number of *BSD projects are generally in favor of llvm and clang, in part because they dislike GNU/FSF.

I know OpenBSD supports some more esoteric hardware that LLVM probably will not target, however.

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

#345
post #199

Earlier quoted context omitted.

I don’t think Linux or bsd will ever be rewritten in rust nor should they. I do think eventually there will be an os written in rust that surpasses them in popularity, but probably on the time frame of decades.

There are not many CVEs for coreutils anyways: https://www.cvedetails.com/product/5075/GNU-Coreutils.html?v... To improve security, Rust should probably aim to replace libjpeg and other stuff which deals with malicious data a lot.

coreutils are often run on untrusted data.

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

#346
post #250

Earlier quoted context omitted.

> 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.

It doesn't, strictly speaking, and in fact, it barely does.

It's usually just a symlink from libwhatever.latest.version.number to libwhatever.so, on the theory that you probably want the latest version of the library (with all its improvements and bugfixes).

There's sometimes an intermediate symlink to the newest major versions too (libwhatever.latest.so, libwhatever.2.so), to avoid breaking changes.

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

#348
post #271

Earlier quoted context omitted.

...and he's comparing Cargo to Clippy. https://honk.tedunangst.com/u/tedu/h/L213K3jf7r3K1534yQ https://honk.tedunangst.com/u/tedu/h/fDM95Cx9t6g1LqTZb3 https://honk.tedunangst.com/u/tedu/h/mBD3rD9pwnf8wxD6j9

He's not comparing cargo to clippy, he's talking about clippy, a community driven linter that checks your code style beyond what rustc itself does. It is executed with the command `cargo clippy` once it is installed.

Thanks for the context, I would not have expected anyone to name anything after the most-hated piece of software ever written.

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

#349
post #155

Earlier quoted context omitted.

You can check that the source hasn’t been tampered with before starting the build, and know you’re building the right code base. Builds that curl junk and use a dozen language specific package managers don’t have that property.

That is exactly the set of properties you get with Rust and Cargo: that the source hasn't been tampered with, and that you know you're building the right codebase. It would be deeply irresponsible to build a package management system without those properties.

This is one of those things that's strictly true, but is kind of misleading because it doesn't capture the full picture. In particular, there is actually no guarantee that the source code you see on GitHub matches the source code you compile from crates.io. Now, most responsible maintainers tag each release and publish exactly that tag to crates.io. Which is good. But that's just a convention. There's nothing enforcing it.

If you want to actually review the source code, then you'd have to download the crate archive itself and review the code there. There is some tooling for this (notably, cargo-crev), but it's definitely not a normal part of development in the Rust open source ecosystem as it stands right now. For the most part, trust and reputation hold the system together. For example, imagine what would happen if someone found malicious code in one of my crates that I was duplicitous about (i.e., published it on crates.io but kept those code changes off of GitHub).

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

#350
post #322

Earlier quoted context omitted.

Why is number of packages and not package size the relevant metric here? Especially when all the packages live in the same repository, there's practically no more overhead to review each package qua package, versus just a bunch of directories in a package monolith. This "144 times longer" number seems pulled completely out of thin air.

Twelve packages with twelve dependencies each is 144. I’ve seen >10x this level of blow up on multiple products at multiple companies. One company missed installing malware behind all the firewalls of most of the fortune 500 by less than a week. We made a procedural change to the build process of a product that had been shipping for years. The change hit our CI/CD 5 days before one of the big language package manager…

I'm not suggesting that we should stop reviewing dependencies. I'm pushing back against the idea that internally structuring a large repo or project via independent modules necessarily explodes the burden to review.

It may be the case that this preference for well modularized code leads to lots of disparate small packages in the ecosystem, but within the scope of a single project, I see no reason why modularization poses any intrinsic risk.

Post reply on HN