4 ms·
> rg Never going to happen because it's written in rust. ag (https://github.com/ggreer/the_silver_searcher https://github.com/ggreer/the_silver_searcher) on th
by beojan 6y ago
> rg
Never going to happen because it's written in rust. ag (https://github.com/ggreer/the_silver_searcher https://github.com/ggreer/the_silver_searcher) on the other hand is written in C.
- feanaro 6y agoWhat's never going to happen?
- saagarjha 6y agoA Rust program being standard on all UNIX systems.
- genuinebyte 6y agoI'll bite: Why?
- saagarjha 6y agoRust 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.
- MaxBarraclough 6y agoWhat kind of platforms are you thinking of? People have got Rust running on the Raspberry Pi. https://old.reddit.com/r/rust/comments/cdcads/ https://old.reddit.com/r/rust/comments/cdcads/
- saagarjha 6y agoLinux 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.
- dividedbyzero 6y agoCould you give some actual examples? This sounds interesting but I'm not sure I've ever seen something like that in the wild.
- hvdijk 6y agoThis 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.)
- pafje 6y agoRust supports many platforms but only has "tier 1 support" on a handful of mainstream architectures. https://doc.rust-lang.org/nightly/rustc/platform-support.html https://doc.rust-lang.org/nightly/rustc/platform-support.htm...
- dig1 6y ago
- sannee 6y agoThe 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.
- rcxdude 6y agoYou're not likely to even find full-fat grep on such platforms (only busybox)
- nindalf 6y agoNever say never :) If Rust being added to the Linux kernel[1] isn't far-fetched, I don't think adding a utility in Rust is crazy either. [1] - https://lore.kernel.org/lkml/CAKwvOdmuYc8rW_H4aQG4DsJzho=F+djd68fp7mzmBp3-wY--Uw@mail.gmail.com/T/#u https://lore.kernel.org/lkml/CAKwvOdmuYc8rW_H4aQG4DsJzho=F+d...
- chalst 6y agoInteresting. Isn't it the case that LLVM doesn't support all architectures that Linux does?
- saagarjha 6y agoI think this is just for kernel modules that you can choose to compile out.
- geofft 6y agoThat's what I expected too (as one of the people on the thread / one of the authors of the farthest-along set of bindings for modules), but Linus and Greg KH both seem fairly inclined for it to be on by default and used for core code (small bits of core code, in the beginning) and not simply modules. I'm not sure how that's going to play out with architecture support, and that's one of the things I want to get out of the Plumbers session this upcoming week. https://github.com/fishinabarrel/linux-kernel-module-rust/issues/112 https://github.com/fishinabarrel/linux-kernel-module-rust/is... is a chart of Linux architectures and whether Rust and LLVM support them.
- saagarjha 6y agoOh, wow, that would be huge. Not just architecture support, but even having a toolchain on some platforms might be problematic as I can imagine making rustc a requirement to build Linux to be fairly controversial in and of itself. And that architecture list is not looking very good…would be very interested to know what they decide on as well!
- saagarjha 6y agobat is Rust too.
- isatty 6y ago+1 for ag (the_silver_searcher)