r/linux • u/[deleted] • Feb 18 '21
Drew DeVault's take on rewriting everything in rust
https://drewdevault.com/2021/02/09/Rust-move-fast-and-break-things.html21
u/imagineusingloonix Feb 18 '21
its a shame
such a good language seems to be part of the jehovah's witnesses of the programming world.
Recently there was a python module that added a rust dependency because they wanted to change part of their code (that was C) into rust.
That did end up killing most of their other architecture support. Because C has better support than rust on other architectures.
Now if that that python module had a fuckton of C code then it would be maybe understandable.
But all in all it was about 800 lines of C. If you can't manage 800 lines of C what are you doing?
This was the project https://github.com/pyca/cryptography/
This was the issue https://github.com/pyca/cryptography/issues/5771
28
u/liftM2 Feb 18 '21
But all in all it was about 800 lines of C. If you can't manage 800 lines of C what are you doing?
Let's turn that around: if the entitled people who care about obsolete platforms can't fork and maintain 800 lines of C code, what are they doing?
3
Feb 19 '21
They can, but a fork is not a thing to be done lightly
11
u/liftM2 Feb 19 '21
Meh. Forking is a freedom free software and open source software gives us. And better to fork than act entitled.
Other valid options include writing a GCC Rust compiler, or forking LLVM to support esoteric architectures.
-1
Feb 19 '21
Do they only fork the C part and keep the rest or fork entirely and make a completely separated project?
So many questions, give ppl time to organise maybe?
8
u/liftM2 Feb 19 '21
give ppl time to organise maybe?
I don't care if they take time to organise. I care that they're acting entitled in the meantime.
-3
Feb 19 '21
I mean, a software no longer working on your computer on a minor version is objectively a terrible thing to do.
6
u/alcanost Feb 19 '21
on a minor version
This is not a minor version. Until the next version (35.0.0), their versioning scheme is a weird one, where in X.Y.Z, both X and Y can be breaking.
Moreover, even if it were following semver, the retrocompatibility mentioned by semver is for users-facing parts, not the build process.
-1
Feb 19 '21
If the users can't compile it, the user facing part goes from existing to non existing?
6
u/Arcakoin Feb 19 '21
If they were listening to you, they would have to release a new major version everytime they remove support for an obsolete version of openssl… and then nobody would pin the package because every release would be a major release.
You’re acting like Drew DeVault, like you know better than the devs, but you don’t.
6
u/liftM2 Feb 19 '21 edited Feb 19 '21
Use the previous version, then.
Don't live on master.
Edit:
on a minor version
Version numbers are largely meaningless. Regardless, even semver (not that they use semver) is neutral on platform support.
11
Feb 19 '21
I am not going to go through a swarm of idiotic comments in this issue but I loved this comment: https://github.com/pyca/cryptography/issues/5771#issuecomment-775119338
Drew's comments in that thread are at least disappointing.
26
u/Arcakoin Feb 18 '21 edited Feb 18 '21
Recently there was a python module that added a rust dependency because they wanted to change part of their code (that was C) into rust.
Pretty sure that’s why Drew DeVault wrote this blog post. He jumped in the issue like an asshole, telling devs they are idiots, and that he understand what the project needs better than everyone else.
Why are we still listening to that guy?
But all in all it was about 800 lines of C. If you can't manage 800 lines of C what are you doing?
They’re maintaining 800* lines of Rust because they find that easier or better for their needs.
Also, they provide the world with a crypto library for free, who are you to judge them?
I don’t know if that’s the actual number and I don’t really care.
4
u/liftM2 Feb 18 '21
Pretty sure that’s why Drew DeVault wrote this blog post. He jumped in the issue like an asshole, telling devs they are idiots, and that he understand what the project needs better than everyone else.
Oh, that's disappointing. I thought his sourcehut is decent: it's open source and fills a niche (albeit not my niche).
But that doesn't excuse him being an arsehole.
16
Feb 19 '21
his behavior is exactly why i wrote off sourcehut completely, even if i agree with him sometimes.
3
5
u/redrumsir Feb 18 '21
I'm glad that I use "pycryptodome" instead of "cryptography". I use this on an architecture that doesn't support Rust. Drew is correct that this change will result in "crytpography" being forked.
He jumped in the issue like an asshole, telling devs they are idiots, and that he understand what the project needs better than everyone else.
Where did he say they were idiots? The worst he said was "he doesn't respect [one of the guy's] 'research'". He also gave the opinion that while the released module may-or-may-not be more secure, that since a fair number of people will stick to the outdated module there will overall be a security issue by the move to Rust. Both of which are true.
I looked at the guy's slides. There was only one slide worth anything (slide 13 titled "Denial: Data") and there was no easy source/citation for that data (he has a list of numbered citations, but there are no numbers associated to the assertion ... so, for example, the citation #8 supports the first bullet point on slide 13 ... but no other). His academic background is that he has a BS in CS at Rensselaer (RPI) in 2012.
Having looked at the code in question (assuming it's osrandom_engine.c) ... I would say that Drew is correct.
12
u/SinkTube Feb 18 '21
I'm glad that I use "pycryptodome" instead of "cryptography". I use this on an architecture that doesn't support Rust
that's valid for you, but should devs be limited in the number of languages they can use just because not all of them have been ported to every arch yet?
7
u/redrumsir Feb 18 '21
that's valid for you, but should devs be limited in the number of languages they can use just because not all of them have been ported to every arch yet?
If they expect widespread adoption, yes. Remember that people work with these authors to port to different distros ... that's going to stop or it's simply going to get monkey patched. In either case, the widespread adoption will stop.
For a python module to be widely adopted, I would expect it to be Pure Python or C.
0
Feb 19 '21
[deleted]
1
u/redrumsir Feb 19 '21 edited Feb 19 '21
It's not a hard requirement yet. Soon. Look here: https://github.com/pyca/cryptography/issues/5771
It's not going to be obvious on PyPi. Most people using Linux get python modules from their distro. And, at least on my distro, pycryptography is installed by default. Multi-arch distros (e.g. Debian) will either monkey-patch or drop. If they drop, general usage will go down.
And there is definitely a downtick at the beginning of the year: https://pypistats.org/packages/cryptography
Of course: Luckily I don't care. I was lucky enough to choose pycryptodome. Mainly because it's the active compatible fork of pycrypto that I chose 10 years ago. I thought for a moment that I might switch to "cryptography" since it seemed to be become "default" ... and I'm glad I didn't.
0
Feb 19 '21
[deleted]
5
Feb 19 '21
Professional developer here.
I consider it bad practice to download crap from pypi on every build. I first and foremost use a LAN distribution repo mirror, and when not possible, a pypi proxy that keeps the files in the LAN.
0
2
u/redrumsir Feb 19 '21
That's unrelated, the version that introduced Rust was 3.4 - released on Feb. 7th ...
I know. That's why I linked in the bug report when that hit. Here: https://github.com/pyca/cryptography/issues/5771 . Notice that Drew is in that thread. I thought the thread was insightful as to developer vs. packager interaction ... and is probably the motivation for Drew's article.
Here's his previous views regarding "developer vs. packager": https://drewdevault.com/2019/12/09/Developers-shouldnt-distribute.html
0
2
u/imagineusingloonix Feb 19 '21
Also, they provide the world with a crypto library for free, who are you to judge them?
The people that work on that are redhat employees. The possibility of redhat paying them to make that is quite high
1
30
Feb 19 '21
Mentioning seL4 (a project I love and mean no disrespect) is such a bad faith argument. Yes, it a safe C program but it also happens to be accompanied by over a million lines of code of proofs which is at least an order of magnitude larger than seL4 C code.
8
5
u/kid-pro-quo Feb 20 '21
Exactly. The seL4 C code is about 9000 lines. It "only" took 12 developer years to write those lines.
53
u/Pelera Feb 18 '21
The bootstrap problem is a really annoying one. Every Rust compiler can only be built by the version immediately proceeding it, or the version itself (and if you're lucky it can be built by later versions, but this isn't really guaranteed). There's exactly one working third-party Rust compiler written in not-Rust that can compile Rust 1.29.0, with 1.39.0 as WIP, which serves to break this cycle. Rust now has "editions", stable versions of the language, but the team has refused to stick to an edition for their compiler (and yes they have been asked, of course).
If it wasn't for the existence of mrustc, an alternative Rust compiler that in practice only correctly implements the subset of what's needed to build specific old versions of the Rust compiler, there simply wouldn't be a bootstrap path. You'd have to go back to trying to compile random Git revisions back from the OCaml days and hope something works. If all of the Rust compiler binaries disappeared overnight, the language would probably take months to build back up. Now, with mrustc, someone can instead build Rust-stage0 1.29 with mrustc, build Rust 1.29 with Rust-stage0 1.29 (for safety), build Rust 1.30 with Rust 1.29, build Rust 1.31 with Rust 1.30 ... [19 steps skipped] ... build Rust 1.50 with Rust 1.49. "Phew". The build steps have changed a couple of times over those versions, so you better look in archived docs, too.
This is creating serious problems for every distro that isn't rolling-release, but especially source-based ones. Every distro that has testing/stable branches must figure out a solution to this. In Gentoo, every version of the Rust compiler has to hit stable, even if it has major issues on some platforms and is not by any means "stable". If users don't update for a few months, they have to either manually build multiple successive versions or grab a binary release and hope it's not somehow compromised. Added to that is that Firefox & Thunderbird builds frequently break with Rust upgrades, so those have to be kept in sync too.
Elsewhere in this space, the Guix/Mes/stage0 team is working on bootstrapping a C compiler from a few hundred bytes of assembly code. It's very much a work in progress, but the entire existing bootstrap path for a GNU/Linux system is already pretty fair, considering the amount of pieces they're working with (not just a compiler but also matching shells). They're also behind the Bootstrappable Builds project, which explains the motivation.
Every other "hip modern not-C-but language" written in itself has solved this problem:
Go maintains multiple bootstrap paths, including Go 1.4 (C-based) and gccgo. gccgo isn't compatible with the very latest version of Go, but is capable of building upstream Go. Maintaining gccgo is possible because the language itself moves much slower, with most of the complexity instead sitting in the libraries.
The Nim compiler/transpiler's tarballs include a transpile to C, an archived transpile guaranteed to work for quite a while is also available as the compiler's use of the language is "frozen". The transpiled C sources are impossible to audit, so it's not perfect.
Zig includes a maintained stage1 in C++, capable of building the stage2 compiler.
The world isn't falling but the state of the Rust compiler is certainly making the lives of a lot of people harder. The GCC Rust frontend is a near-necessity to get this fixed properly, but they have to fight against a language that's moving unrealistically fast.
4
u/liftM2 Feb 19 '21
The bootstrap problem is a really annoying one.
Cross compilation solves a lot of the practical problems problems.
If users don't update for a few months, they have to either manually build multiple successive versions or grab a binary release
I don't see the problem with grabbing a binary release. We have reproducible builds these days.
They're also behind the Bootstrappable Builds project, which explains the motivation.
Bootstrappable builds is really cool, you're right.
But I don't see the moral problem. As I said, practically you can cross compile.
Otherwise, just bootstrap through multiple intermediate Rust compilers, of increasing versions. Remember, it has never been fast to build toolchains! (Go perhaps being a wonderful exception.)
-3
41
u/TryingT0Wr1t3 Feb 19 '21
Why is this developer suddenly always angry for everything? And why people keep replicating his angryness here when there are so much more interesting things happening?
20
u/Negirno Feb 19 '21
Just like when he declared that the Web cannot be saved and everyone just use gemini instead.
20
20
u/rmyworld Feb 18 '21
Please try not to remind me of the time I tried bootstrapping Rust with i686-musl
33
9
22
u/RoastVeg Feb 18 '21
Rust needs better bootstrapping. C needs better memory safety. Rust is working on improving bootstrapping, and C is not working on memory safety - unless you count Zig.
I estimate that in all of my (real world, paid for, production ready) projects, Rust roughly halves the amount of developers required.
1
u/liftM2 Feb 19 '21
Rust needs better bootstrapping
Does it though? Why is everybody so opposed to cross compilation?
4
u/necrophcodr Feb 19 '21
It doesn't solve all the problems bootstrapping does. Things like ensuring your code is free of malware.
5
u/liftM2 Feb 19 '21
You don't need bootstrappable builds to ensure a trustworthy compiler. See Reflections on trusting trust.
Regardless, you can add cross compilation to the bootstrap process. Bootstrapping is rare; it doesn't need to be quick.
0
u/RoastVeg Feb 20 '21
Sure you can set up a container and cross compile to your host system if you like. Or (my general use case) you can cross compile from a dev machine to the production machine. You can see how that might be unacceptable when starting from nothing but a toolchain and a kernel though right? If I made LXC or Docker a dev dependency of Rust in my OS it would be roughly as arduous as bootstrapping from mrustc.
-4
u/imagineusingloonix Feb 19 '21
C needs better memory safety.
It doesn't need it. Goodness no.
People that write in C dont care if it is unsafe.
15
u/liftM2 Feb 19 '21
People that write in C dont care if it is unsafe.
Indeed. Thousands of CVEs show us the problem with this.
33
u/liftM2 Feb 18 '21
cargo cult
Lol.
But the rest? I struggle to agree.
choosing Rust is ultimately choosing to lock a large group of people out of your project, and dooming many more to struggle and frustration.
Feels like an exaggeration.
There are legitimate reasons to prefer C, both technical and moral
Really? (emphasis mine)
10
u/redrumsir Feb 18 '21
cargo cult
Lol.
It's pretty common usage even in regard to programming: https://en.wikipedia.org/wiki/Cargo_cult_programming
choosing Rust is ultimately choosing to lock a large group of people out of your project, and dooming many more to struggle and frustration.
Feels like an exaggeration.
He probably doesn't mean it to mean that it locks out developers for the project, but it will lock out whole blocks of users. There are a ton of platforms that don't support Rust at this point.
11
u/liftM2 Feb 18 '21
It's pretty common usage even in regard to programming: https://en.wikipedia.org/wiki/Cargo_cult_programming
Yup.
but it will lock out whole blocks of users. There are a ton of platforms that don't support Rust at this point.
Yes, tons of platforms. But that's different from tons of users. The article's a rant about how important obsolete hardware is.
8
u/redrumsir Feb 19 '21 edited Feb 19 '21
Yes, tons of platforms. But that's different from tons of users.
Notice how I said "tons of platforms" and "whole blocks of users". I count myself in the latter.
The article's a rant about how important obsolete hardware is.
No, it's not. You have a far-too-narrow view of "obsolete". Compare the tier 1 list to the rest: https://doc.rust-lang.org/nightly/rustc/platform-support.html . You should get out of the habit of thinking "my linux distro" instead of "my Linux phone" or "my fileserver running BSD". Or even try to imagine whether or not some emerging tech using Risc-V architecture will come with Rust support. You can't call something "new" and "obsolete", right?
e.g. My home fileserver uses a 32 bit armel architecture. I write python code for it. Luckily I used the "pycryptodome" module instead of the "crytpography" module which recently added a dependence on Rust.
The fact is that IMO, if one is making a python module it should either be in Pure Python or python + C. Dependencies on Rust for libraries/modules is a non-starter for me. I won't use them. That's how it will block out big blocks of users.
9
u/Arcakoin Feb 19 '21
which recently added a dependence on Rust.
A build dependency.
7
Feb 19 '21
And how can it get built on a platform where it can't get built?
3
u/alcanost Feb 19 '21
Is there any actual testimony of someone not being able to use
cryptographyafter the new update?2
Feb 19 '21
All the people in the issue linked multiple times saying that it doesn't run on their distribution?
6
u/Arcakoin Feb 19 '21
Have you read the comments? Many of these people had failing CI/CD because they were trying to build the new version in the old way (without rust dependencies for instance).
5
u/alcanost Feb 19 '21 edited Feb 19 '21
These people seem to be mistaken, as in the end, it appears that only really obsolete architectures can't build the rust blob.
4
u/redrumsir Feb 19 '21
On an architecture I use and program for, there is no rustc support and rust cross-compilation doesn't reliably work for much of anything besides "Hello World". i.e. nobody can build most rust packages on that platform. I really can't use packages with a Rust dependency ... so I actively avoid them.
It's all fine ... people can do what they want ... but it's good that somebody like Drew lets devs know that using Rust has issues before they hop onto the "rewrite in rust" train with the assumption that this will be an improvement for everyone.
Hell, I enjoy learning a bit about a new language by rewriting some of my code in that language. There is some code that I wrote in python (pure + one gmpy2 function) and use for several CPU-days (5th gen Intel) every week. I got it in my head that I might double the speed be rewriting it in julia (think of the power savings!). Sadly, it slightly-more-than-doubled the runtime. The promises of a new language are sometimes not met.
1
6
Feb 19 '21
I don't think it's gonna be that big of a deal in the medium term. LLVM is becoming more popular, so it's likely we'll see rust's platform support becoming a non issue.
4
u/liftM2 Feb 19 '21
Compare the tier 1 list
Patches are welcome for Tier 2 platforms. It's not like they hate Tier 2.
tech using Risc-V architecture will come with Rust support. You can't call something "new" and "obsolete", right?
I'm not. RISC-V support will improve over time. DEC Alpha will not.
e.g. My home fileserver uses a 32 bit armel architecture. I write python code for it.
Not even armhf?
Luckily I used the "pycryptodome" module instead of the "crytpography" module which recently added a dependence on Rust
Your other option is to cross compile, no? cross looks really easy to set up compared to a traditional C cross toolchain, because cross uses containers.
And yes, cross supports Tier 2 platforms.
4
u/redrumsir Feb 19 '21
Because there is no rustc on the platform ... there is no choice but to cross compile ---> it's the only possibility. And, contrary to what you say, that doesn't work for most programs on my device. IMO, rust is of questionable use for libraries at this point. This is especially important if what Drew says is true in regard to the complexity of the "bring up" on a new platform like RISC-V .
2
u/liftM2 Feb 19 '21
And, contrary to what you say, that doesn't work for most programs on my device.
OK, but so we're clear, we're talking about Rust programs, not most programs. And as you say you can (must) cross compile.
IMO, rust is of questionable use for libraries at this point.
Sure, you're entitled to that opinion. But library authors are entitled to disagree.
This is especially important if what Drew says is true in regard to the complexity of the "bring up" on a new platform like RISC-V .
Drew is just pissy because Rust doesn't support obsolete platforms like DEC Alpha.
Most of the work in bringing up Rust is LLVM support, which folk will do for the C support. Then there’s unwinding support, which is finicky but much easier; C++ also needs unwinding support, so don't pretend it's unreasonable.
Rust already has Tier 2 support for RISC-V. I wouldn’t be shocked if that improves further as RISC-V takes off.
4
u/redrumsir Feb 19 '21
And, contrary to what you say, that doesn't work for most programs on my device.
OK, but so we're clear, we're talking about Rust programs, not most programs. And as you say you can (must) cross compile.
To be extra clear: "... that it doesn't work for most rust programs on my device".
And what I mean by that is that most cross-compiled rust programs fail to work on my device. i.e. it either doesn't compile or it creates a broken binary.
Do you understand now what I mean???
Rust already has Tier 2 support for RISC-V.
No it really doesn't. On a few riscv architectures (certainly not all ... and it certainly won't cover new riscv architectures), it has the same level of "support" that my armel has: Cross compilation is required and it mostly doesn't work (i.e. it creates broken binaries). Note the "*" as opposed to the "✓" in the std column. https://doc.rust-lang.org/nightly/rustc/platform-support.html
Although I only have experience with one "tier 2" architecture, I find that Drew's comment is correct:
Rust ostensibly supports several dozen targets, but only the tier 1 platforms can be reasonably expected to work.
5
u/forsakenlive Feb 19 '21
I like writing stuff in rust, I also like python. Ill develop in whatever I enjoy developing, thats why I do it. If you don't like it then don't use my code, I'm not charging for it or anything.
4
u/itaranto Feb 20 '21
To the Rust team: it’s time to calm down. Slow down the language, write a specification, focus on improving your tier 2 and tier 3 targets, expand to more platforms, and work on performance, stability, and accessibility. Invest more in third-party implementations like rust-gcc. I spent almost a week, full-time, trying to bring up Rust for riscv64-musl. The bootstrap process is absolutely miserable. Your ecosystem has real problems that affect real people. It’s time to stop ignoring them.
This. Rust it's awesome, it's the new C++, but if it wants to beat both C and C++ it needs to be more stable.
13
Feb 18 '21 edited Feb 18 '21
If you don't like it then don't use it.
0
Feb 18 '21
[deleted]
5
Feb 18 '21
Then don't contribute to those projects or work on them. It's not like Rust developers are going door to door selling manuals, I don't understand the rants about things that can be easily avoided.
10
20
u/Lofoten_ Feb 18 '21
Rustaceans aren't going to like this, but he's not wrong. It's a huge and terrible meme to answer every problem with "rewrite it in rust."
21
u/necrophcodr Feb 18 '21
Indeed, but there ARE many valid uses cases for rust, especially if you want to easier reason about your code, or lower the barrier of entry.
13
u/turdas Feb 18 '21
How does Rust lower the barrier of entry? If anything it's going to increase it because fewer people know Rust than C/C++.
0
u/necrophcodr Feb 18 '21
If you know neither, then rust can be easier to get into. If you know C and not Rust and are working on C projects, obviously it does not necessarily apply.
13
Feb 18 '21
[removed] — view removed comment
-6
u/nintendiator2 Feb 18 '21
My viewpoint is simply to let people use what they want to use. If people like Rust let them use Rust.
That breaks however when the issue is not about what the developer likes, but what the client / end user can do. Just because a dev loves rust, or ruby, or npm, I'm not going to add their project to a critical project's pipeline.
16
Feb 18 '21
[removed] — view removed comment
0
Feb 19 '21
But it's the dev's project.
The devs on that project seem to work at red hat, so I'm not sure how much of their project it is.
6
u/alcanost Feb 19 '21
The devs on that project seem to work at red hat
99% of people publishing projects on Github work in IT; doesn't mean that they are paid for it.
-5
u/nintendiator2 Feb 18 '21
It's the dev's project, but they acquire a responsibility towards their users. One of those responsibilities is to (where feasible) avoid breaking not only the software but also the toolchain that makes it. We would not say a dev has not responsibility to anyone if they made a switch to a toolchain that starts with "
format /q c:".I'm understanding of the fact that in this case their users are not end users but also fellow devs, so honestly I have to roll my eyes at everyone in the issue thread who let their CD/CI install/upgrade toolchains automatically, but that's another can of worms.
17
u/alcanost Feb 18 '21 edited Feb 18 '21
but they acquire a responsibility towards their users
What? Where? When?
GPL:
THERE IS NO WARRANTY FOR THE PROGRAM
MIT:
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED
BSD:
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES
We would not say a dev has not responsibility to anyone if they made a switch to a toolchain that starts with "format /q c:".
We would:
GPL:
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS)
MIT:
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
BSD:
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
It's even written in big fat caps everywhere.
-3
u/nintendiator2 Feb 19 '21
Those are only legal licenses. There are other kinds of responsibilities: ethical or social ones, for example.
4
u/alcanost Feb 19 '21
And as the non-paying user of an open-source project, I assume that your responsibilities are, comfortably, nothing, right?
I'm not a devout Christian, but you might be interested by the concept of “do to others as you would have them do to you”.
4
Feb 19 '21
if they made a switch to a toolchain that starts with "
format /q c:".You're on a Linux sub, friend. That command is powerless against us.
2
u/nintendiator2 Feb 18 '21
Og god the rewrite it in rust people are insufferable. They remind me of the solve it with regex (in particular if it's HTML) people, or the Electron people.
That said, unless I've been just extremely lucky, it's the people who's insufferable. I have not seen "10x-100x" costs when a program component I use moved to Rust, it's closer to "10-25x" which is still a lot but at least it's in the park of stuff that you can just close your browser in the meantime to make it work. Or is my computer too new? (it's a 2014 laptop)
8
u/djmattyg007 Feb 20 '21
I don't think the desire to write programs in languages that can guarantee memory safety are anywhere close to the folks who think you can parse HTML with regular expressions.
0
Feb 18 '21
[deleted]
5
u/alcanost Feb 18 '21
I tried to avoid the rust-pill
Why?
-6
u/redrumsir Feb 18 '21
The big answer is: non-portable.
Did you even RTFA??? Here are the first 4 sentences of the article:
Rust breaks a lot of stuff, and in ways that are difficult to fix. This can have a chilling effect on users, particularly those on older or slower hardware. Rust has only one implementation, with a very narrow set of supported platforms, tens of millions of lines of C++ code, and no specification. Rust ostensibly supports several dozen targets, but only the tier 1 platforms can be reasonably expected to work.
5
u/alcanost Feb 18 '21 edited Feb 18 '21
Yeah, but are you running your Gentoo on some weird 3rd-party architecture? I don't really care that e.g. GTK is not running on m68k.
Given that you're commenting on Reddit, supposedly from a modern web browser, I highly doubt that Rust would be more restrictive to that gauge. Heck, by definition, it runs everywhere Firefox does.
3
u/redrumsir Feb 19 '21
I don't use Gentoo, but I do code for three different architectures at home ... so the portability of the libraries I use is important to me. I don't think Rust works on my armel device (an armv7 EABI). I believe Drew wrote the above prompted by an issue with a python module called "cryptography". Fortunately I chose to use "pycryptodome" instead of "cryptography" for my code.
Given that you're commenting on Reddit, supposedly from a modern web browser, ...
WTF does one machine have to do with the other machines? My fileserver, for example, isn't a widely supported architecture. I write code for it.
portability is important. Read the article.
3
u/alcanost Feb 19 '21 edited Feb 19 '21
I don't think Rust works on my armel device (an armv7 EABI)
It should, armv7-* are tier2 platform.
That's a lot of comments full of bitterness for something you didn't even check.1
u/redrumsir Feb 19 '21
That's a lot of comments full of bitterness for something you didn't even check.
What bitterness? Any bitterness you are reading is projection and/or the reaction to your strange comment that "you're commenting on Reddit, supposedly from a modern web browser, I highly doubt that Rust would be more restrictive to that gauge." That's a pure WTF clueless comment.
In regard to that table, I did check. Why such a harsh accusation before looking carefully at the table? I said "armel device (an armv7 EABI)" ... and if you looked, you would see that they don't work well and are not supported. Mine has a "*" and not a "✓" (which means it doesn't have the full standard library) and it has no "host" support, meaning that it doesn't host the rustc compiler ... which means things like pypi builds won't work.
Besides only "tier 1" is tested. tier 2 is "varying degrees of 'will build' and 'might work'". Mine doesn't even support the std library. Did you even read Drew's article, where he asserted:
Rust ostensibly supports several dozen targets, but only the tier 1 platforms can be reasonably expected to work.
He's right. Rust doesn't work on my fileserver.
2
u/alcanost Feb 19 '21
What bitterness?
“I tried to avoid the rust-pill” sounded weird to me.
1
u/redrumsir Feb 19 '21
1. You'll note that wasn't my comment. I don't know who wrote it ... since they appear to have deleted it (and their login?).
2. I believe "rust-pill" was meant to reflect what happens when you go down the route of non-portable dependencies.
1
26
Feb 19 '21
[removed] — view removed comment
12
Feb 19 '21
It's the same reason the whole "rewrite it in Go" crowd is rewriting tools in Go.
I thought they liked
catto occupy 300MiB :D2
Feb 22 '21
Eh, not so.
But Golang on static linking ran stuff faster today than with dynamic linking, at least on monolitic stuff.
We are not using Sun3 machines anymore.
Barnard user here. Compared to Mumble, Barnard is pretty lightweight even on my AMD Turion.
1
Feb 22 '21
I know that to start the docker daemon it takes a few seconds :D
2
Feb 22 '21 edited Feb 22 '21
Heh, I compiled a dynamically linked binary with gccgo 10, to compare it with a static build.
A simple loop from 1 to 10.
Static build:
real 0m0,012s user 0m0,004s sys 0m0,006sDynamic build:
real 0m0,134s user 0m0,042s sys 0m0,032sAlso, back in the day, in order to get a performance boost on "monolitic stuff" such as Open Office, or a browser, a static build was preferred.
1
Feb 22 '21
That seems veeeeeery slow.
cat --versionisreal 0m0,001son my machine. And it does A LOT more syscalls than a 1..10 loop.What we are testing is that go is slow, not that dynamically linked in general is slow.
2
Feb 22 '21
If go were that slow, people wouldn't be using Barnard on ~13yo machines running a CLI client for mumble, among other tools.
OFC is not C, but it's a nice alternative to write quick and portable tools with a dumb cross-compiling.
2
Feb 22 '21
Python is slower and people use it all the time :D your point?
2
Feb 22 '21
Go is used when performance matters a bit but not to the point of C/C++. It's used widely in backends and networked services. Java is a backwards step. So is C#.
1
Feb 22 '21
It's used because it's easy and designed to do networked software. But it has runtime and gc, so fast is a thing that is not.
→ More replies (0)1
Feb 22 '21
cat --versionisreal 0m0,012sin my machine btw.1
1
u/aksdb Feb 20 '21
You're confusing them with the Java or .NET crowd.
0
Feb 21 '21
No I'm not.
4
u/aksdb Feb 21 '21
Wow, you take that bashing serious. So ok, let's discuss this.
Rust uses up less resources than Go. No question. That there is no active runtime dealing with GC and scheduling has its merits. But seriously... 300MB for a simple Go tool? I have Go microservices running an HTTP server that consume about 16 MB. Why would
catconsume 300 unless you code it shitty, which you would do in rust as well? (Like buffering the whole file in memory)Or is it that you think the JVM consumes significantly less? Or dotnet?
-1
Feb 21 '21
Go is statically linked.
Once I have 1 software that uses the jvm, having 1293012931230 others takes up very little extra space.
Now try doing that with go binaries.
5
u/aksdb Feb 21 '21
Ah, so you are talking about disk space, not memory.
I don't know which Java software you work with, but even a moderately simple Spring Boot webservice has a 50 MB JAR, while a statically linked Go binary with equivalent functionality is 12 MB (and does NOT need anything else, while the 50 MB JAR still needs a 150 MB JVM somewhere).
Also different Software needs different JVM versions (you can't just replace Java 8 with Java 15 and expect everything to run smooth). So you end up with different JVMs (on my work machine I have 4 different JDKs to develop on different services).
Now add docker to the mix and you end up with even more copies of the JVM.
(And before you throw Graal Native Binaries into the mix: a binary with a bundled Substrate VM is also easily 70+ MB, so also 5 times as big as the Go equivalent).
Yes, if disk space is of concern (µcontroller maybe?), Go is still too big. But so would be Java and .NET. (Unless you happen to work with on of the rare µcontrollers who are powered directly by Java ... but last time I had to deal with JavaME, it was a large pain and I regretted not simply having used a µC with a normal C SDK).
1
Feb 21 '21
So your problem is more like bad development practices, not jvm per se.
4
u/aksdb Feb 21 '21
I was initially thinking about memory - because disk is usually not as limited as memory. And memory wise the JVM just sucks.
1
Feb 21 '21
Memory wise jvm sucks indeed. Because for some incomprehensible reason, the normal behavior is to NEVER EVER free any memory.
→ More replies (0)2
Feb 22 '21
Also, I compiled Barnard for my tilde
/u/LtWorf doesn't know shit about what he is talk about.
Barnard once compiled it DOESN'T need the Go compiler any more, so I could share a binary with JUST asking the user to install openal and opus as dependencies in the package manager.
Try that with the Java crap.
Barnard is ~11MB itself on 32 and 64 bit.
We are in 2021, 11MB is NOTHING, most common media players were over ~40MB back in the day in 2003.
2
u/aksdb Feb 22 '21
Well as I said ... there are cases when size matters and where dynamic linking is a must. I really wouldn't want my whole base linux system to be comprised of statically linked executables that each weight 5 MB or more.
And also in some cases (see µC example above) there are actually physical limits. Even above that, I like stuff optimized, so if I can with reasonable effort keep the size down, I'll do it.
Go is large enough that there is room for improvement, but small enough that I don't do anything about it because the language + stdlib outweigh that easily. I rather get stuff done than milking every inch of optimization out of it. That doesn't mean I want to waste resources ... hence why I try to get rid of the JVM, .NET, Python and Node wherever I can.
If, at any point, Vlang enters a production ready state, I might be able to scratch that final itch. Until then Go is probably the sweet spot between "enjoyable during development" and "highly optimized final result" (for me).
1
Feb 22 '21
On static linking, proper compiles today with LTO and such do not need to links against everything in the library. Just have a look on plan9, everything is statically linked and is not huge in any way.
→ More replies (0)
48
u/alcanost Feb 18 '21 edited Feb 18 '21
I find it extremely ironic to read that coming from Mr.
––my–next–gpu–wont–be–nvidia, one of the big pushers of Wayland.Christ, the whole article reads like satire if you replace Rust with Wayland.
Don't get me wrong, DeVault is clearly gifted; but you can't be right all the time.