News for hackers. Stuff that matters.
Re:Moreutils – Unix tools that nobody thought to write (2012) by feanaro on Saturday August 22, 2020 @04:38AM (#24242706)
What's never going to happen?
Re:Moreutils – Unix tools that nobody thought to write (2012) by saagarjha on Saturday August 22, 2020 @04:40AM (#24242716)
A Rust program being standard on all UNIX systems.
Re:Moreutils – Unix tools that nobody thought to write (2012) by genuinebyte on Saturday August 22, 2020 @04:44AM (#24242730)
I'll bite: Why?
Re:Moreutils – Unix tools that nobody thought to write (2012) by saagarjha on Saturday August 22, 2020 @04:50AM (#24242756)
Rust is designed for a fairly small number of relatively modern systems; there are many close-to-POSIX systems that can’t (and I would guess likely will never) be able to run Rust code in any formal capacity. To the hopeful: even C++ has been unable to win here, despite having many more years of a head start and much more accommodation for stranger platforms. It’s just not going to happen.
Re:Moreutils – Unix tools that nobody thought to write (2012) by MaxBarraclough on Saturday August 22, 2020 @05:28AM (#24242914)
What kind of platforms are you thinking of? People have got Rust running on the Raspberry Pi.

https://old.reddit.com/r/rust/comments/cdcads/

Re:Moreutils – Unix tools that nobody thought to write (2012) by saagarjha on Saturday August 22, 2020 @05:43AM (#24242976)
Linux on ARM is a very mainstream platform from the perspective I’m looking at this from, I’m afraid. I’m talking about strange Unices running on architectures that GCC may or may not maintain a backend for, or maybe a BusyBox available on some debug interface, maybe a school project to build a simple POSIX-compatible OS or a bootstrap for a platform that had been recently jailbroken. In these cases C is almost always the go-to language and I suspect it will remain so for the foreseeable future as this is precisely the long tail of distributions that standards were intended to provide a base set of tooling for.
Re:Moreutils – Unix tools that nobody thought to write (2012) by dividedbyzero on Saturday August 22, 2020 @05:55AM (#24243024)
Could you give some actual examples? This sounds interesting but I'm not sure I've ever seen something like that in the wild.
Re:Moreutils – Unix tools that nobody thought to write (2012) by hvdijk on Saturday August 22, 2020 @07:18AM (#24243365)
This is clearly not one of the examples saagarjha was thinking of, but an actual example where Rust is not an option is the x32 ABI for x86_64 platforms. This ABI works well with GCC, but LLVM suffers from multiple code generation bugs. As Rust is based on LLVM, Rust for the x32 ABI does not work well either. While it's possible to use a mixture of ABIs, so that you have a mostly-x32 system but with some x64 binaries, this requires a multilib setup with multiple copies of system libraries. A pure x32 system cannot currently have Rust utilities.

(I have some patches to improve things but I have not been able to submit them to LLVM yet, and with those patches I did manage to get a working x32 build of rg on my system. I hope to be able to do so in the future.)

Re:Moreutils – Unix tools that nobody thought to write (2012) by pafje on Saturday August 22, 2020 @05:54AM (#24243020)
Rust supports many platforms but only has "tier 1 support" on a handful of mainstream architectures.

https://doc.rust-lang.org/nightly/rustc/platform-support.htm...

Re:Moreutils – Unix tools that nobody thought to write (2012) by dig1 on Saturday August 22, 2020 @06:01AM (#24243049)
MIPS and SPARC to name a few. Almost all routers are on MIPS and most of them are running some form of Linux or BSD.

AFAIK, rust is still marked as "guaranteed to build" on these platforms, but assume only Linux. BSDs, not so much.

Re:Moreutils – Unix tools that nobody thought to write (2012) by fiddlerwoaroof on Saturday August 22, 2020 @06:58AM (#24243274)
In my experience, most consumer routers are ARM?
Re:Moreutils – Unix tools that nobody thought to write (2012) by happycube on Saturday August 22, 2020 @12:10PM (#24245048)
Maybe new ones, but there's a ton of MIPS ones too.
Re:Moreutils – Unix tools that nobody thought to write (2012) by sannee on Saturday August 22, 2020 @06:11AM (#24243087)
The Debian ripgrep binary is 5.1MB. That would consume over 15% of a 32MB flash, which is the common constraint you have to work with in many (actually, discounting Android, it might even be most) Linux deployments.
Re:Moreutils – Unix tools that nobody thought to write (2012) by rcxdude on Saturday August 22, 2020 @07:00PM (#24247972)
You're not likely to even find full-fat grep on such platforms (only busybox)