23 ms·
Rewrite it in Rust
- pxc 4y agoI love Fish, and Rust seems like a good choice for shells. I hope the port is a success!
- yazzku 4y agoWow, hold up. > Nobody really likes C++ or CMake, and there's no clear path for getting off old toolchains. Every year the pain will get worse. I do like C++ and CMake. Get off 'old' toolchains? Why is 'old' here 'bad'? Both are continuously evolving. 'Old' = proven = works. > C++ is becoming a legacy language and finding contributors in the future will become difficult, while Rust has an active and growing community. How is it becoming a legacy language? This is completely false and unsubstantiated. Yeah, finding good C++ devs is hard, the thing takes skill. > Rust is what we need to turn on concurrent function execution. https://en.cppreference.com/w/cpp/language/coroutines https://en.cppreference.com/w/cpp/language/coroutines You don't need Rust here. Good try, though. > Being written in Rust will help fish continue to be perceived as modern and relevant. Rewriting something for no reason will for sure turn mature developers off. I've yet to hear a good reason for why you're proposing this rewrite. I'm sure it'll be perceived as very modern and "relevant" though. > This should be thought of as a "port" instead of a "rewrite" because we would not start from scratch; This is like when your ever-high friend says "I can quit anytime, man." You can call it whatever, but it doesn't change the fact of what this is. Total psyops there.
- drunkenmagician 4y ago[flagged]
- DoctorNick 4y agoThe future is now, old man
- saila 4y agoYour comment is quite unnecessarily vitriolic, but I do love the notion that it's possible to become cool by learning a new programming language. Besides, all the common languages we use now, whether or old or new, have all gone through a phase like this. I bet people made similar commentary about C back in the day too.
- friedman23 4y agoIt's their project so why not...
- legends2k 4y agoSure, write it in anythinf, just don't give _reasons_. Tell that it's what you feel like. This seems to be GP's comment. I agree.
- __jem 4y agoWhy isn't using a language that has a growing community of young developers not a "reason"? They're looking towards the future and making the bet that it will be easier to get new contributors in Rust than in C++. Maybe you disagree with the prospective future of C++, or the feasibility of rewrites, but it hardly seems like "not a reason" to peruse something like this, it seems like a pretty strong one, since as you say "finding good C++ devs is hard" and they're interested in growing the number of contributors in the future.
- dmitrygr 4y agoBecause, while the sequence "100,000 100,000 100,000 100,000" is stable and "1 2 3 4" is growing, that does not mean that the latter will eclipse the former anytime soon - the point being implied by TFA
- __jem 4y agoI seriously doubt there are 5 orders of magnitude more C++ open source contributors actively participating in projects on GitHub than Rust, which is the relevant question. Enthusiasm counts for projects like this that are looking to stay relevant.
- fbdab103 4y agoAt this point, I would love solid numbers on the number of new C++ projects (open source or otherwise) vs Rust. Google just came out indicating how well the transition was working for them with respect to memory vulnerabilities.
- zozbot234 4y agoC++ is simply not intended for new projects in this day and age; even Carbon and cppnew are specifically designed for projects that must interoperate heavily with C++ libraries, and are thus not entirely greenfield in that sense. The Carbon developers have explicitly made it clear that new projects should be written in a safe language if at all viable.
- xyzzyz 4y ago> How is it becoming a legacy language? This is completely false and unsubstantiated. Yeah, finding good C++ devs is hard, the thing takes skill. If getting good developers that know technology X is hard and getting harder over time (which I think is definitely true about C++), this on its own will cause technology X to become legacy.
- sockaddr 4y agoAs an old C/C++ dev I'm beyond excited to re-tool as a Rust dev. It's such a pleasure to use compared to C++. Fish porting itself to Rust makes me more likely to contribute to it in the future. /anecdata
- dbtc 4y agoI agree, yet I think rewriting - even for no reason at all - can make the thing better.
- legends2k 4y agohttps://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/ https://www.joelonsoftware.com/2000/04/06/things-you-should-...
- orf 4y agoIt’s his project. He sees it that way, as do others. You see it differently. The objective truth is probably somewhere in between. Other projects have seen a significant positive impact after switching to rust. I hope fish shell also sees that impact, regardless of any feelings around rust.
- enedil 4y agoAs fish user, I can be concerned that a rewrite like this might ruin a project, and consequently oppose such rewrite. Doesn't matter whose project it is. If you think I should just ignore it and "accept decision" - this is when it's clear, that what you really mean is "you just should not care".
- aldanor 4y agoAs a fish user, I'd be concerned about the opposite - having a burden of a big c++ codebase and all it's build shenanigans to maintain which is not fun at all anymore could lead to the project becoming stale, especially with a low bus factor. Plus, it could gain new external contributors. Heck, I'd consider contributing myself now whereas I wouldn't consider wasting my time on doing c++ for fun unless it was mission critical for some reason
- stcroixx 4y agoMy thoughts exactly. Why would the implementation language bless a piece of software as ‘relevant’? I’d also argue learning how to do for loops in bash, which would let you write them on about any server in any data center on the planet, would serve one much better.
- pxc 4y ago> Rewriting something for no reason will for sure turn mature developers off. I've yet to hear a good reason for why you're proposing this rewrite. I'm sure it'll be perceived as very modern and "relevant" though. Fish has been lovingly maintained by a small group of developers for a long time, and it's an excellent piece of software. The person proposing the Rust port has been the chief maintainer a long time. I don't think you understand the credibility they have with longtime users and contributors.
- legends2k 4y agoNot the GP, but I want to point out that while I respect the chief maintainer and not doubt their credibility with fish's users, no one is immune to mental fallacies. GP's comment points out where there's gaps in thinking/logic in the arguments made to do the port. Personally I think the maintainer would've done well both to the community and oneself if the reason given was > Hey, I'm bored, I want to practice Rust and want to do something fun, so I'm doing this. than cloak it with some weak sauce reasons.
- ZephyrBlu 4y agoSomething being cool and modern matters a lot more than you seem to believe. Rust is a great language and it's growing in popularity. It's a good choice to get experience with Rust, grow their community and improve the codebase.
- Gigachad 4y agoIt would be like trying to run a FOSS project in COBOL. No one wants to do that for fun. The bank manages by paying people a fortune to do something they don't want to do.
- cube2222 4y agoFun stuff! I keep recommending fish whenever I get the chance. It doesn't require any customization, has sane defaults, is simple to use, and provides a great shell experience in general. Additionally, I don't have to google each time I want to write a for loop, because the syntax is "the obvious syntax you'd expect it to be" instead of what bash has. That's absolutely a legit advantage of it. If you didn't read into it, even though the issue looks like just a proposal in the first message, digging deeper it seems to be created by the top contributor, and is basically "happening". Looking forward to seeing how this pans out! Especially any lessons learned about Rust afterwards.
- dmitrygr 4y ago> Especially any lessons learned about Rust afterwards. So far the last few comments appear to be the bucket of cold water that all sane people would hope to see when someone proposes to rewrite $stable_thing (currently written in $stable_sane_common_language) in $new_latest_craze language for no reason - no distros ship recent rust toolchains, while C++ is "mature" and has toolchains that you can count on existing.
- cube2222 4y agoI've seen them. Let's see how they tackle those problems. I don't think fish, as a shell you're probably not using for checked-in scripts, needs too much backwards compat. I know it's a meme, and I don't enjoy Rust that much myself (though definitely more than cpp). At the same time the reasoning is sound, the average open source contributor imo will more likely contribute to a Rust project, rather than a cpp project. I support the whole thing even if it's just for the maintainers to have more fun maintaining the project (not that I'm suggesting this is the reason), after all they're the ones maintaining it.
- deleted 4y ago[deleted]
- saila 4y agoI don't think it's fair to say Rust is a "latest craze" language. Maybe five years ago, but not now. Numerous tools have been (re)written in it and supplanted old tools in at least some cases. Additionally, there are reasons given in the linked issue. I guess you could debate about whether they're good reasons (they sound reasonable to me), but you can't say they're proposing it for no reason just because you don't like or agree with the reasons. To that point, as someone who learned a decent amount of C and C++ a long time ago, I would probably never get involved in a C/C++ project nowadays, but I've been learning Rust these past few years and would definitely get involved in a Rust project if I had the chance. And to be clear, I'm not bashing C/C++ at all. They're venerable and appreciated, but I have little to no interest in working with them, and it seems to me that this is a fairly common sentiment.
- Upvoter33 4y agoIn a post guaranteed to make hacker news ... (I kid, I kid) More seriously, good! Should be a fun exercise. Would love to see thoughts on what went well and what was hard to do.
- forgotpwd16 4y ago>Being written in Rust will help fish continue to be perceived as modern and relevant. And that's basically the reason most projects do it.
- doublepg23 4y agoCool news. “$PKG_MGR fish && chsh -s /usr/bin/fish $USER” is pretty essential after using bash for more than a few minutes.
- fbdab103 4y agoIf only I were that brave. Too many things expect bash that I do not want that potential friction. Instead, I manually switch when I launch a terminal.
- ComputerGuru 4y agoPretty much everything that expects bash will have the #!/bin/bash (or better yet, #!/usr/bin/env bash) shebang in place and will continue to work.
- doublepg23 4y agoAlong with _most_ things having shebangs in 2023 I often run scripts as “bash script.sh” and never even bother doing “./script.sh”.
- Gigachad 4y agoI'd have expected much fewer since macOS switched to zsh a few years ago.
- Macha 4y agozsh is basically bash compatible, especially for the level of bash features that get exercised by 95+% of scripts
- mlindner 4y agoI never got the appeal of zsh. It felt just like bash with all the interesting features of zsh hidden into advanced functionality, whereas with fish lots of things "just work" out of the box without spending a bunch of time configuring it. I'd rather have really good defaults and the option for configurability rather than not great defaults and really advanced configurability.
- torstenvl 4y ago> What I mean is that we wouldn't use e.g. libc's "iswdigit" and friends ... because we use those functions, we're beholden to the libc wchar_t type ... which means the difference between cygwin (2 byte wchar_t) and as best as I can tell any other system (4 byte wchar_t) can appear everywhere. Say what now? You can't use a wchar_t with iswdigit() even if you wanted to. And wint_t (the correct type) is 32-bit on every platform I'm aware of, including Cygwin.
- jmillikin 4y agowint_t represents either a wchar_t or the sentinel value WEOF. You shouldn't pass an arbitrary Unicode codepoint to iswdigit() on platforms with 16-bit wchar_t.
- torstenvl 4y agoPerhaps, but then wouldn't the issue just be that iswdigit() is practically useless, rather than that it 'requires' (it doesn't) using a type that may only be 16-bit? Even on systems where wchar_t is 32-bit, that isn't a guarantee that the extended character set supported by iswxxx() includes Unicode. (It also requires your OS to support a large number of locales, which is unlikely. The vast majority of iswxxx() functions are broken on the vast majority of Linux installs.)
- jmillikin 4y ago> Perhaps, but then wouldn't the issue just be that iswdigit() > is practically useless, rather than that it 'requires' (it doesn't) > using a type that may only be 16-bit? In my opinion yes, though obviously opinions vary. When Unicode expanded beyond the BMP, the decision by some platforms (Windows, Java, JavaScript) to represent "wide characters" as 16-bit integers became a problem. APIs that accept strings rather than "characters" could be adjusted from UCS-2 to UTF-16, but anything shaped like iswdigit() needed to be reconsidered. The thing about iswdigit() and friends is that it does mostly do what people expect so long as (1) they don't need to write cross-platform code and (2) their localization needs are simple (BMP only), which is true of like 95% of software, so it can be hard to convince anyone to stop using it in favor of more robust solutions like libicu.
- pkkm 4y agoI have mixed feelings about this. It's an interesting experiment and I'm curious to see how it'll pan out, but most of the justification boils down to "C++ is established and boring, Rust is trendy". To me, this wouldn't be convincing enough to switch to a language that doesn't even have a spec and in which a lot of libraries depend on very recent versions of the compiler.
- lordofgibbons 4y agoFor a free and opensource project, developer enjoyment and attractiveness to a wider audience of enthusiastic contributors is a very valid justification. They even address this at the begining of the post: >Nobody really likes C++ or CMake, and there's no clear path for getting off old toolchains. Every year the pain will get worse. >C++ is becoming a legacy language and finding contributors in the future will become difficult Dealing with a large C++ code bases and CMake build errors is about as fun as getting kicked in the head. If Fish was a business and their entire focus was the bottom line, then it'd be a different conversation.
- Gigachad 4y agoPersonally I've found trying to set up a dev environment for C/++ projects to be like pulling teeth. I don't want to spend all day tracking down what my distro calls a library package. I want to get stuck in to programming right away if I'm doing it in my own time for fun. Rust projects seem to always be extremely easy to compile, make use of common shared libraries, and shared patterns. Once you learn the language, you need to know little about the individual project like you do with C/++ projects.
- edflsafoiewq 4y agoThis is probably the biggest reason I write new stuff in Rust. It's not as much a problem for existing projects that have already set up all their build infra though. Well, that and you get stuff like fs::read(path) instead of always having to go find the ReadFile function from the last project you worked on like in C++ land.
- tptacek 4y agoThe funniest thing in that thread is the person who jumped in to say that they don't know much about fish, but think the project should seriously consider abandoning the work they've done on Rust to date and instead consider D.
- Gualdrapo 4y agoIn that case they better rename it to "Dish".
- nine_k 4y agoI hope the pure Rust version is going to be named Rush.
- midoridensha 4y ago"Rush" really would have been a much better name for a new programming language than "Rust".
- rdbell 4y agoIt's like Go, but quicker.
- simondotau 4y agoRush sounds slapdash; rust sounds like long-lived structural ironwork.
- DiggyJohnson 4y agoInspiration phrasing right here. I completely agree. - a yaml programmer
- RajT88 4y agoRush, depending on the relative old-geezerishness or nerdiness (or both) of the reader, could sound highly technical and accomplished.
- benreesman 4y agoI’m generally kind of a wet blanket on “rewrite all the things because Rust!”, but… A shell is one of the few pieces of software where the lowered attack surface might legitimately justify a massive effort to achieve feature parity to what you have now. Browsers, ssh servers, stuff like this it’s plausible. I wish them luck!
- nicoburns 4y agoIt isn’t mentioned in the proposal as far as I could see. But for me the huge benefit of Rust over C++ for an open source project is the greatly reduced amount of scrutiny contributions need to be subject too. Unlike C++, you can’t introduce undefined behaviour or memory safety issues in any boring line of code. I imagine this is seen as a big win from the point of view of project maintainers.
- qbasic_forever 4y agoI don't buy that at all though. Logic bugs are far more common, you will still have to carefully review each line and section. C++ isn't inherently unsafe either, you can use it with zero dynamic allocation if you really want or use language tools like ref counted smart pointers. Ultimately you can write unsafe and bad rust code too so reviewers will still have to carefully review every submission.
- foota 4y agoThis is true, but anyone can catch a logic bug, whereas seeing undefined behavior can take someone familiar with it.
- qbasic_forever 4y agoLinters will easily catch undefined behavior, better than humans in my experience.
- steveklabnik 4y agoThis is in fact a large part of why people are so pro Rust. Think of the compiler as a very strict linter, one so strict it can catch things that just aren’t semantically possible in many other languages, including C++.
- jjnoakes 4y agoSome linters catch some undefined behavior, but not all undefined behavior (I'm guessing not even most undefined behavior). And no one runs linters. If they did, a ton of CVEs would just vanish. But they haven't.
- ComputerGuru 4y agoOne of the fish core devs here. You can ask me anything if you like. Happy to forward suggestions to the rest of the team. I've shared my opinions in the linked GitHub thread under the @mqudsi handle.
- doublepg23 4y agoThanks for working on the project! It’s essential on any of my Linux systems :-)
- ComputerGuru 4y agoYou are most welcome! The beautiful thing about fish is that it's truly cross-platform, even on really niche environments, so I can agree with you but change that to "on any *nix system" rather than just Linux alone :)
- doublepg23 4y agoI’ll have to give it a shot on my next OpenBSD install!
- Gigachad 4y agoI've never really looked in to Fish but this seems like some pretty exciting work. I'll be checking it out and considering switching from ZSH when it's done.
- warmwaffles 4y agoWhy not just switch now?
- Gigachad 4y agoFeature wise, I don't have any issues with zsh, but I'm always looking to trim down on the number insecure C components on my system.
- WirelessGigabit 4y ago> Compared to us sticking to C++11 that's a staggering difference in version support. I think this is actually a great point towards Rust. Many more rules are written down since the beginning which makes upgrading easier. Even if the rules break something, a change of rules is easier to detect than a new rule being written down, which had multiple implementations in the past.
- lnxg33k1 4y ago[flagged]
- davidthewatson 4y agoThis is exciting. I've not had problems with latency in fish, but the promise of rust is that there is so little latency that it heralds a close to the metal feeling I've not seen in decades. I think that feeling is visceral and laudable, regardless of the actual runtime profile. It's under-appreciated in the design community. IPC latency is as big a problem in operating systems and programming languages as RPC latency is in cloud systems. I have no experience with rust, but I do depend on helix daily: https://github.com/helix-editor/helix https://github.com/helix-editor/helix and helix is rust. I think this kind of open source experiment is exactly what we should be encouraging because it's forward-looking and straightforward to test. I think the fish community could decide easily by A-B testing the Rust and C++ builds with real users and see how they compare in terms of reliability, performance, regressions, time-to-fix, and so on, assuming the team has the bandwidth to absorb the sideways nature of the work without derailing fish. To me, rust is more than trendy and I can remember the first time I touched Walter Bright's work decades ago, so I'm open-minded about D too. A simple KLOC or cyclomatic complexity as a proxy to abstraction would be an interesting lens.
- zozbot234 4y agoI think this rewrite is driven by the well-known safety challenges and long-term maintainability concerns with C/C++, not performance per se. Of course rewrites from existing high-level languages to Rust can result in huge performance gains.
- mlindner 4y agoThat's different than what they say in their high level planning doc. https://github.com/ridiculousfish/fish-shell/blob/riir/doc_internal/fish-riir-plan.md https://github.com/ridiculousfish/fish-shell/blob/riir/doc_i... > Allowing background functions and concurrent functions has been a goal for many years. I have been nursing a long-lived branch which allows full threaded execution. But though the changes are small, I have been reluctant to propose them, because they will make reasoning about the shell internals too complex: it is difficult in C++ to check and enforce what crosses thread boundaries. > This is Rust's bread and butter: we will encode thread requirements into our types, making it explicit and compiler-checked, via Send and Sync. Rust will allow turning on concurrent mode in a safe way, with a manageable increase in complexity, finally enabling this feature.
- tayo42 4y ago> C++ is becoming a legacy language and finding contributors in the future will become difficult, This is wild to see written down. Am I alone in feeling like there is a huge disconnect between what people online say and what happens I guess in the real world? Developers I actually talk to never seem to have these kinds of opinions about c++ and alot more reserved about using rust
- steveklabnik 4y agoYou can see both sentiments, for and against this idea, play out in this very thread. Lots agree with that post, some agree with you. Time will tell.
- tayo42 4y agoI didn't share an opinion on rust or cpp, just a comment on the difference that I experience between people I have conversations with and the opinion of vocal internet people. Only like 1% of people actually write on the internet. The everyone's doing it argument seems to me, more like a vocal minority.
- tialaramex 4y ago> Only like 1% of people actually write on the internet. The everyone's doing it argument seems to me, more like a vocal minority. Both the US Federal Government and the EU are apparently in the "vocal minority" who think programmers should stop using C++ because it's unsafe. Both have created documents which more or less just outright say that over the past year or so. As a result, two other very significant things have happened which might reasonably cause people to decide that for C++ this is perhaps the beginning of the end rather than just an interesting bump in the road. 1. Several people or groups announced "successor languages" in 2022. Unlike Rust, these aren't merely languages which are sometimes cited as potential safer alternatives to C++ or as languages you might choose instead, yet have an existence all their own - The successor languages are specifically targeting C++ and C++ programmers. In this number we can count Carbon, Val, Circle and Cpp2 / CppFront. 2. Several WG21 ("The C++ Standards Committee") members wrote papers for WG21 either claiming that there's no problem (this is not, in fact, a thing you do when there's no problem, nobody writes US policy papers saying the US is not at risk of attack by Belgium) or offering vague plans for plans to do something about the problem. These are hastily written (Bjarne Stroustrup wrote or co-wrote four of them in as many months, all with numerous typographical errors) and do not in my view make a case that C++ is or will be fine although that's how they're intended.
- jbirer 4y agoRust is a great language but it seems to attract plenty of "tech geek" people who don't really understand programming or CS beyond the surface and act zealot-like over "insert current trendy tech". I think the curse of a complex language like Rust is that it attracts people who make it a part of their identity and develop cult-like behavior because it makes them feel smart and special. I hope a healthier community will develop around Rust overtime.
- beebmam 4y agoI don't understand why people care so much about these online faux-communities. A language or technology should be able stand on its own without a community. Rust can easily do that. It does for me. I couldn't care less about whatever culture war people are trying to inject into this.
- LAC-Tech 4y agoWell to play devils advocate; learning rust was pretty hard for me, definitely needed help from the community (readers may judge that it says more about me than rust if they wish).
- qwertox 4y agoI think his comment goes more in the direction of "Pythonistas" or "Rustaceans". When I coded in C/C++ about 15 years ago I never felt like a part of a "C" community, same the last 15 years I coded with Python (and Java), I'd never consider myself as a "Pythonista", even though I love the language and the effort everybody puts into making this language so useful as well as learnable. The Rust community is also really helpful and well structured in the sense that you know what to expect from a contribution (like a crate), but I'll never label myself as a Rustacean even if I'd start using Rust as my primary language. These "groups" seem strange to me, almost like a cult which I feel is out of place. Like a group of Americans learning and using the Italian language calling themselves "Italians" just to point out that they have a special relation to that language which others don't have. The analogy doesn't really work, because there are no such person's like born "Pythonistas", but it somehow illustrates the vibe these groups apparently want to irradiate. I love the languages for what they are, and the love and effort the communities put into them shows more through the language itself than through a label a community gives itself.
- djha-skin 4y ago> * Nobody really likes C++ or CMake, and there's no clear path for getting off old toolchains. Every year the pain will get worse. Subjective, at best. CMake isn't really more painful than bash scripts, they're both well defined, well-documented and stringly typed. > * C++ is becoming a legacy language and finding contributors in the future will become difficult, while Rust has an active and growing community. Speculation. C++ also has a very large active community. Reminds me of when people said Ruby would die. People are still using Ruby. > * Rust is what we need to turn on concurrent function execution. Why? C++ is just as powerful of a language as Rust, if ergonomically different and providing fewer safety guarantees. > * Being written in Rust will help fish continue to be perceived as modern and relevant. The worst reason given on this list. You're proposing a rewrite for appearance's sake, to keep up with the Jones'? We're talking about tearing down and building all the walls in an entire house here, not just painting the siding. Why not just come out and say "I want to rewrite it and Rust because I want to rewrite it in Rust"? This is such a blatant example of pop culture in development affecting decisions.
- Macha 4y ago> CMake isn't really more painful than bash scripts Feels like damning with faint praise, though I suspect that was not your intention. "hacky pile of bash scripts" is usually the thing build tools get praise for replacing/subsuming.
- Klonoar 4y ago>Subjective, at best. CMake isn't really more painful than bash scripts, they're both well defined, well-documented and stringly typed. I've worked on enough CMake projects to where I won't willingly do it again. Give me Cargo any day.
- pipeline_peak 4y ago“Nobody really likes C++” Not really sure why bold statements like this are so popular. But people read them, blindly assume they’re true and further propagate this mentality that “Rust is faster, more secure, lighter, has 12 pack abs, and a hot blonde gf”. A lot of us are sick of hearing it.
- queuebert 4y agoRust is the worst systems programming language, except for all the others.
- jimbo9991 4y agoI think most C++ programmers would agree with that statement. C++ isn't winning any awards in programming language elegance, ease of use, or innovation. That doesn't mean it's bad, but I don't think very many people who work in C++ wind up evangelizing the language in the same way Rust or C programmers promote their languages.
- rcxdude 4y agoI agree. A lot of C++ programmers may think it's better than the alternatives (especially C) but that still doesn't mean they like it.
- dagmx 4y agoDoes anyone really like C++ and also knows it really well? I’ve never really met anyone who’s actually liked C++ in the form it’s become in the last several years. It’s not that people need to dislike it if they don’t like it. But do people actually have a positive opinion of it? I use C++ daily, and I think I know it well, and the more I get to know it the less I like it. I don’t dislike it but it’s a mess. The same goes for CMake. I think it’s alright. But does anyone like it? It’s the best C++ build system plus ecosystem (please note I mention both, not just build system) but it’s easy to not like. Put another way, if I had three ratings of “like” “dislike” or “meh”, both C++ and CMake are meh.
- 4y ago
- dahfizz 4y ago> Being written in Rust will help fish continue to be perceived as modern and relevant. I have a hard time taking rust seriously because of this. It's the same category of "hype tech" as crypto/Blockchain for me. Maybe the hype will melt away soon and it'll just be a solid, stable tool.
- deleted 4y ago[deleted]
- speed_spread 4y agoI think the hype _has_ melted away in the last year or two, since Rust left Mozilla's basement and started working for Microsoft, Amazon, Apple and others. There are newer shinier languages for the hip crowd; the political aspect has toned down naturally while safeguards have helped the community remain vibrant. I think the strongest signal is the inclusion of Rust in the Linux kernel. Having Linus give his blessing is about the highest level of certification Rust could have hoped for in the public space. The fact that a respected project like fish adopts Rust when they could have stayed with C++ indefinitely is just one more demonstration of this new maturity stage. Expect many more open source projects to follow suit.
- plaguepilled 4y agoI love Rust but man, what a weird way to introduce it. The bashing on C++ was a bit silly - the biggest benefit over C++ IMO is that Rust makes it much easier to avoid certain kinds of memory bugs. Note that I said easier: C++ allows that avoidance of bugs too, especially modern C++, and the ISOs do a lot to encourage the right stuff, but its still a very mixed bag in my personal experience. There are also plenty of bad idioms in the C++ space that people blindly follow, so there is some diligence required. Also, I have to add for that one guy typing a reply to me now: this isn't to say C++ devs are inferior. In fact far from it, there are some seriously smart people in that space that I deeply respect. But its important to distinguish the devs from the tool, and when we are talking JUST about the tool, Rust seems like a good pick here.
- djur 4y agoThe point of the "bashing on C++" is to present a persuasive argument for the rewrite: "the status quo is unworkable, we need a solution, Rust is the best solution". This is a much stronger case for something as drastic as a rewrite than "Rust is better".
- plaguepilled 4y agoRustaceans should evangelise their language with actually relevant points though, not bring up unrelated bloat into their arguments. For example, there is no reason to talk about cmake in a conversation like this. Its childish and sabotages a legitimately good movement: using a safer language. Edit: I have made quite a silly gaffe. This is a lead dev commenting, not a thread started by a visiting user. That changes things quite a bit. My apologies to you and the dev in question.
- detaro 4y agoAs a C++ developer, not having to deal with cmake et al again is not the worst argument for using another language. Not a major one (cmake is servicable after all, just annoying), but one. Don't see how arguing with better tools is "childish" and "sabotaging".
- r2vcap 4y ago"Because this language is cool, let's rewrite it" is not a practical approach. I also think the fact that the number of people who are proficient in C++ is decreasing is a problem. But the intransigence of the Rust zealots keeps me away from it.
- cmrdporcupine 4y agoHonestly, I am not sure how many of the 'Rust zealots' actually write Rust code. when I was working in it for $$, I found the actual community of packages and maintainers to be quite reasonable people, and the language and tooling choices mostly sensible. don't let the zealots scare you off, it's a good dev experience... overall
- deleted 4y ago[deleted]
- fatneckbeard 4y ago"So instead of String, fish will use its own string type," sigh
- steveklabnik 4y ago... as a temporary measure. https://old.reddit.com/r/rust/comments/10pf7m8/fish_shell_porting_to_rust_from_c/j6lct8g/?context=3 https://old.reddit.com/r/rust/comments/10pf7m8/fish_shell_po...
- db48x 4y agoRemember that they’re doing an _incremental_ rewrite. At each step of the way, C++ code will be calling Rust code, and Rust code will be calling C++ code. One function or class at a time, code will be rewritten from C++ into Rust (though not really idiomatic Rust). The string type used by the Rust code must match the semantics and layout of the string type used by the C++ code as much as possible because any infelicity there must be patched up by a run–time conversion each time code in one language calls the other. If you want to change string types, it is best to do it either before or after the rewrite, not during. And I bet doing it afterwards will be easier than doing it beforehand.
- gorgoiler 4y agoNot an easy page to read — the follow up comments evoke that feeling of dread where I’ve tried to move the needle in one direction only to have my thread swamped with people who express their drive-by opinions loudly, in-writing, without taking any responsibility for how they are affecting the overall tone of the conversation and basically derailing it into a discussion about bike shed color. “How about using Zig?” indeed. We talk here a lot about remote work. Open source projects are the ultimate in remote work where only the most disciplined communicators get anything done, usually by collaborating in private, and everyone else twiddles about with flame wars until they next meet up in person at FooConf and finally get some work done.
- brandonmenc 4y agoIf April Fools' wasn't such a long way off, I'd have guessed this guy was doing his best "annoying rust evangelist" impersonation.
- docandrew 4y agoI dunno, they put their money where their mouth is by bringing in code and offering some reasonable justification for the switch. I think this is a great example of how such proposals should be made.
- brandonmenc 4y agoI’m just talking about the content of the message in the post. Like, the “modern and relevant” line is exactly the sort of thing you’d say in a parody. But I agree that they are actually doing the work and not just tossing out a suggestion and that’s great.
- nindalf 4y agoThis post and PR was written by the primary maintainer of the project. It wasn't a drive-by proposal by a rando.
- brandonmenc 4y agoI understand all of that, and that’s great, but it doesn’t change the fact that I chuckled and had to do a double take when I first read the PR message because it looks like someone asked ChatGPT to “write a suggestion to rewrite it in rust in the style of an overzealous rustacean.”
- maximumcomfy 4y ago[flagged]
- speed_spread 4y agoOh, nice. Can we do systemd next? I've started studying the current C implementation and I can't believe my whole system runs on code that feels so _brittle_. Not to disparage experienced C programmers, but the level of hold-my-beerness implied by all that casual raw pointer passing is astounding for a plain strongly-typed-no-malloc Java/Rust guy like me.
- Animats 4y agoThat article is a little too fannish. There are things that should be rewritten in Rust. Mostly libraries with vulnerability reports involving buffer overflows. OpenSSL. Bind. DNS servers. Routers. BusyBox. Low level infrastructure that has to Just Work even when under attack. I've been writing a big project in Rust for two years now, but I'm not fanatical about it. If you're doing web back end, Go is easier and the web-related libraries are well debugged, because Google uses them internally. Also, you get concurrency without the complexity of "async", because goroutines, which are green threads, can block without stalling the system. Rust is complicated. Probably simpler than modern C++, because C++ has acquired sort-of move semantics, sort-of ownership, and sort-of safety without throwing out any of the old stuff which makes those things sort-of. Safety is a tough retrofit. Using Rust is alien to the way many programmers work. You don't debug much. You design, you code, and you get compile errors. Sometimes you get all the way down to one compile error, and then realize you have to do a day or two of rewriting to get the ownership logic right. This is fine if you're doing something hard with extensive concurrency where repeatable debugging is not possible and getting those errors out at compile time is a huge win. It's not fine if you're just doing business logic and desperately need to get some new feature into your program. People who mostly program in a REPL have a hard time in Rust. Too many important Rust crates are still at version 0.x and not yet stable. The language churn of the early days is over. There's still library churn and breaking changes in low-level stuff. That's a classic open-source problem, where nobody wants to do the dull and boring cleanup.
- mlindner 4y ago> That article is a little too fannish. What article? It's a pull request by the maintainer.
- zozbot234 4y agoThe fact that Rust actively guides you towards a simpler and more elegant design is one of the greatest things about the language. And I disagree that this is not useful when you're "just" doing business logic and iteratively adding new features, since any codebase that is not refactored when necessary will quickly become too unwieldly to even iterate on.
- sergiotapia 4y agoMan "rustaceans" really became the vegans of programming languages. It's never "Rust is awesome", it's mostly "Language X is shit so use rust." Anyone else notice this unique phenomenon? I can't think of any other language community that does this.
- mlindner 4y agoVeganism always struck me as focused on people making ethical claims. Whereas the love for Rust comes completely from people trying to get away from existing pain that they're experiencing (at least in my experience).
- arp242 4y agoI've certainly seen people make the claim that not using Rust is unethical. In both cases you only hear/remember loudest and most annoying people anyway. There's definitely some Rust people who are annoying. There are also some vegans who are annoying. It's foolish to focus on only those people.
- timeon 4y ago> It's never Is it really? > Anyone else notice this unique phenomenon? This reminds me quote from Pi movie: "You want to find the number 216 in the world, you will be able to find it everywhere. 216 steps from a mere street corner to your front door. 216 seconds you spend riding on the elevator. When your mind becomes obsessed with anything, you will filter everything else out and find that thing everywhere." > I can't think of any other language community that does this. Comments under this particular PR are mentioning at least two languages like "why don't you us this <lang> instead?" Also what does this have to do with veganism? For every vegan person there is huge amount of people on the internet, like you, that have urge to mention it.
- QuadrupleA 4y agoAll these reasons are variations on "because it's popular."
- docandrew 4y agoPopularity is sometimes a compelling reason - not just to be part of the “in crowd,” but to take advantage of the ecosystem, documentation, tooling and expertise that comes with a popular language or product.
- tw1984 4y ago"C++ is becoming a legacy language" can't agree more. it is a broken language forcing users to focus on the language itself rather than actual problems. it is a museum class language run by trucks load of bureaucracy. 12 years after the release of C++11, think about all those wasted years & opportunties. It has never been a better time to depreciate C++.
- fasterik 4y agoChurchill on democracy: It has been said that democracy is the worst form of government except for all those other forms that have been tried from time to time C++ is the programming language equivalent of democracy. Nobody is thrilled with it, but it's still better than the alternatives.
- tw1984 4y ago> C++ is the programming language equivalent of democracy. No, it is not. It is a language controlled by a small group of elites of the past, aka dinosaurs. How many day to day developers of C++ had a say in its stdlib or core language features? Literally zero. It is the programming language equivalent of autocracy - it works very efficiently when everything is under control, but it can crash in all kinds of unexpected ways when anything is out of control. > Nobody is thrilled with it You are right. That is the exact reason why we are seeing more and more existing projects moving away from such legacy languages while very few new projects are repeating the previous mistakes by using C++ again. > but it's still better than the alternatives. No, that is not true. There are tons of other languages that are far better. People are walking away from C++ to get their codebases completely rewritten in those alternative languages is the best proof. So far, e.g., I've never seen any single major project that switched from golang or rust to C++. Let's be honest, it is time to completely have C++ written off. It is a liability not an asset. Some old folks can keep worshiping it, that is fine, young people are not going to waste their lives on such backward language defined with a 1970s mindset by a close group of dinosaurs who have a combined age of 1 million years.
- hannofcart 4y ago
- hnarn 4y agoThis might be a naive comment, but why post this as a PR on the original project? If this person is willing to put in the work (a PR seems to indicate this), why not just fork the entire repo and call it "rish" or something? This software is available under GPL/BSD/etc so there is nothing stopping it. I don't understand the benefit of replacing an existing piece of software with a complete re-write rather than just re-branding and then attract users and developers by explaining why it's better. Especially when it's something so fundamental as a shell, I would be pretty upset if a jump from major -> major entailed a completely new piece of software with new bugs or previous functionality removed, which to me seems almost certain to happen. When the new project reaches either parity or subjective superiority, presumably people would move over to it and if the theory that attracting C++ developers is really that hard turns out to be correct, then fish would sooner or later be abandoned by developers and users alike.
- spoiler 4y agoThey are the author of the project. So, I guess the idea is that they want to make future development and maintenance easier. It also probably isn't in their interest to split the community (Also, as a fish user, I also personally wouldn't like if the community split) Edit more here: https://github.com/ridiculousfish/fish-shell/blob/riir/doc_internal/fish-riir-plan.md https://github.com/ridiculousfish/fish-shell/blob/riir/doc_i...
- hnarn 4y agoOk, well in that case it makes a lot more sense, thanks for clarifying.
- kup0 4y agoI always shudder a little when PRs get shared on news sites because I know the devs/maintainers are going to get a huge influx of unnecessary noise/commentary on the PR. Nothing like having the internet opinion bee hive swarming on your project, often wasting time. That said, maybe this is too negative a perspective and maybe useful contributions will outweigh the noise
- kahlonel 4y ago[dead]
- jeremychone 4y agoThe "rewrite-it in Rust" is not for all projects, obviously, but for some, it might be a smart move. Time will tell.
- sigmonsays 4y agolook at the users github, not a single repo with any rust. Where does motivation like this come from?
- orf 4y agoThis comment from the core team spells it out: https://github.com/fish-shell/fish-shell/pull/9512#issuecomment-1410820102 https://github.com/fish-shell/fish-shell/pull/9512#issuecomm... > C++ is an old standardized language with multiple implementations, married at the hip to C, an even older even more standardizederer language. Any changes take ages to get to users so we can actually use it. We moved to C++11 in 2016 (some quick calculation shows that's 5 years after the standard was released), and we're still on C++11 because the pain of upgrading is larger than the promises of C++14/17. We needed to backport compilers for our packages until, I believe, 2020. > Having multiple implementations means you always hit the worst of any of them, because you can't dictate which implementation your users use. So we have to deal a lot more with cmake than we would like, sometimes for things as awkward as "which header is this function in". > C++'s string handling is subpar, and it's much too easy to fall into passing raw wchar_t * around (and we don't have access to string_view and that just enables even more use-after-free bugs!). This is annoying, because a shell is almost entirely string handling and unix api wizardry. > The other general issues with C++ (header files, memory safety, undefined behavior, compiler errors are terrible, templates are complicated) are well-known at this point so I'm not going to rehash them. We know them, we have them, we hate them.