Hacker News new | past | comments | ask | show | jobs | submit login
Rust 1.72.0 (rust-lang.org)
234 points by thatxliner on Aug 24, 2023 | hide | past | favorite | 95 comments



> To avoid having long compilations without feedback, the compiler will always emit a message after your compile-time code has been running for a while, and repeat that message after a period that doubles each time.

Is this "period" measured in statements or computer time?

> By default, the compiler will also emit a deny-by-default lint (const_eval_long_running) after a large number of steps to catch infinite loops, but you can allow(const_eval_long_running) to permit especially long const evaluation.

So the default behaviour now is to nonetheless "catch" infinite loops by default? Why not make the default behaviour to just notify a user by emitting a message after some time (as described)? If rustc "catches" infinite loops by default, how is backwards compatibility preserved with respect to `const` functions? If I split one statement into two in `const fn`, do I break BC?


> Is this "period" measured in statements or computer time?

It sounds like computer time is used now.

> So the default behaviour now is to nonetheless "catch" infinite loops by default? Why not make the default behaviour to just notify a user by emitting a message after some time (as described)?

Because lots of builds don't have a user. Having the user have to time out rustc because of this would be frustrating.

> If rustc "catches" infinite loops by default, how is backwards compatibility preserved with respect to `const` functions?

As long as the time is much larger than it takes to handle the old statement limit it is preserved.

> If I split one statement into two in `const fn`, do I break BC?

The old version might have prevented your code from compiling as mentioned in the notes.

The new version should in theory allow it if the unsplit version worked since it is based off compilation time.

Also there is an opt flag where it will go infinite


> As long as the time is much larger than it takes to handle the old statement limit it is preserved.

As a library developer, how can I know that?

> The old version might have prevented your code from compiling as mentioned in the notes.

Does it mean that rustc tracks function BC? I think I've misunderstood you.


Rustc guarantees code that compile before continues to compile.

In this case they modified the old hard error that you could opt out of into a deny by default lint.

Additionally if you opt out of the lint you get progress notifications of how much work has been done.

Looks like the whole thing is still statement based to avoid slow machines breaking on a timer.


It's backwards compatible because the old behavior was to simply make long evaluations an error every time. The new system gives you the option to allow a long evaluation if you opt in


I think OP is looking at backward compatibility with respect to libraries. For example today I make a library that does a lot of computations in `const` functions and it works with rust 1.72.0; tomorrow I slightly change function by splitting a statement into two, and now suddently the evaluation becomes too long and my dependents don't compile anymore.

Though to be honest this problem existed even before rust 1.72.0 and likely can't be solved while preventing infinite computations.


> it works with rust 1.72.0; tomorrow I slightly change function by splitting a statement into two, and now suddently the evaluation becomes too long and my dependents don't compile anymore.

Just to be clear, this was the case before the new changes in 1.72. They already had that limit, and code could break in exactly that way. There were two problems with that beyond the simple backwards compatibility break. One is that there was no opt out, so if you broke you were kinda hosed at the library level. The second is that the limit was relatively low and so it was very possible to hit it.

Now if you end up running too long and the compiler fails, you’ve at least got an opt out, and the limit before failure is much higher.


Exactly. The point is that most Rust libraries use semantic versioning, which actually forces you to determine if the change you've made to your library is backwards-compatible or not. I think it's a good practice but it's unclear to me how it should be applied to `const` functions.


> Why not make the default behaviour to just notify a user by emitting a message after some time (as described)?

Presumably for the sake of people who blindly upgrade an automated Rust build toolchain and wouldn't be aware that this would be signing them up for potentially-unbounded build times (and therefore potentially-unbounded CI/CD service fees.)


> Rust reports potentially useful cfg-disabled items in errors

The Rust compiler error team keeps delivering feature to make the developer experience more pleasant. Thank you so much!


This is huge for embedded rust where cargo Features are used heavily. One of those trial and error things that can be frustrating when learning a new library with missing notes about features.


They should enable the nightly-only "auto cfg" feature to also help out

e,g, https://docs.rs/clap/latest/clap/macro.command.html

To enable

- Add a `cfg`: https://github.com/clap-rs/clap/blob/master/Cargo.toml#L48

- Enable the nightly feature when the `cfg` is present: https://github.com/clap-rs/clap/blob/master/src/lib.rs#L79


The error messages were the first thing that really impressed me, and not only have they improved a lot over the years but clippy is a thing to add even more guidance to writing better code. Really impressive stuff.


Yeah, I can think of a few times this would have been super helpful. Great feature!


I don't understand why compilers drop old Windows compatibility. It makes no sense to me. They emit executable code which looks the same on Windows XP or on Windows 11.


Rust platform support is tiered[0]. Tier 1 targets are automatically tested, tier 2 targets are automatically built, and tier 3 targets are best-effort. Windows 7 is tier 1 and Windows XP is tier 3; what they're going to do is change the tier 1 Windows build to 10, but the Windows XP support isn't going anywhere.

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


The tier 3 Windows XP target is no_std only, which makes it useless for the vast majority of developers.

For all intents and purposes Rust is dropping support for anything below Windows 10.

It is suggested in the MCP that a new target can be created for older versions of Windows if members of the community will step up to support it.

https://github.com/rust-lang/compiler-team/issues/651


> The tier 3 Windows XP target is no_std only, which makes it useless for the vast majority of developers.

Windows XP has been EOL for 9 year already[1], the vast majority of developer don't care about it. And if you happen to be a Rust developer who care about Windows XP you can either stick to an older version of the Rust compiler that still supports it. If you can afford to use a 22-years old OS that hasn't received patches for the past decade, you can probably afford to use an older Rust compiler…

[1]: https://learn.microsoft.com/en-us/lifecycle/products/windows...


Developers writing XP-compatible software today aren't the ones choosing to use XP, our clients are doing that.


They're probably not forcing you to use Rust, let alone the latest compiler…


> For all intents and purposes Rust is dropping support for anything below Windows 10.

And that's perfectly fine. Windows 8.1 is unsupported by Microsoft since early this year, and all older releases were already unsupported.


The question is why do newer versions of Windows break compatibility so badly?


It's not that new versions break compatibility. It's that old versions are missing features that new versions have.

Windows is actually astonishingly backwards compatible but the older you want to support in Windows, the more jank your code has to be.

Like for example, in the zulip chat (linked in the issue for this change) they mention that the next versions they may drop are those Windows 10 releases prior to May 2019 as that release finally made UTF-8 the standard text encoding and being able to generally assume UTF-8 simplifies a lot of things for developers.


> that release finally made UTF-8 the standard text encoding

This is a bit of a reach unfortunately. UTF-16 (most often broken WTF-16) is still the standard text encoding on NT. The manifest change only makes A-suffixed functions always do a "UTF-8 to UTF-16" conversion, instead of the unhelpful "local codepage to UTF-16" conversion. Sure, that's better, but:

- Microsoft has expressed no interest in switching the actual underlying encoding to UTF-8, they will likely never do so in NT.

- A-suffixed functions only exist for some Win32 API. Newer Win32 functions are defined only taking Unicode strings. All COM, WinRT and native (Rtl/Nt) APIs use Unicode strings as well. The UTF-8 API surface is actually quite small - one might have to step out of the UTF-8 comfort zone in practice.

- Performance is being left on the table. Transcoding still has to be done, it would be more beneficial to at least keep it local for optimization purposes. The most trivial, yet still important use case: constant string conversions can't be optimized across DLL boundaries.

- Unlike, say, DPI awareness mode, there is no official API to change this behavior at runtime. It has to be done through the manifest, a compiler implicitly embedding such a manifest into every executable it produces is not ideal.

TL;DR: It's an improvement, but just barely, so bumping the minimum version just for this "feature" is not worth it IMO. Just bite the bullet and convert to UTF-16 if you have to, it's conceptually simpler and likely faster, too.


> A-suffixed functions only exist for some Win32 API. Newer Win32 functions are defined only taking Unicode strings. All COM, WinRT and native (Rtl/Nt) APIs use Unicode strings as well. The UTF-8 API surface is actually quite small - one might have to step out of the UTF-8 comfort zone in practice.

Unicode is not a binary encoding, perhaps you meant UTF-16/WTF-16, which are binary encoding of Unicode?


Yes and no.

My post specifically mentions UTF-16 and WTF-16, too. The term "Unicode string" exists and is well established: https://unicode.org/glossary/#unicode_string.

Windows Unicode strings happen to fit this definition, but of course, so would UTF-8 strings. Either way, in Windows's version of reality the definition is narrowed to mean "potentially ill-formed UTF-16LE encoded string", but that doesn't exactly roll off the tongue, so for better or for worse, "Unicode string" is the consistently and widely used Windows-specific nomenclature.


UTF-8 is still not the standard on Windows, it’s opt-in.


It seems like the Rust team isn't saying that compatibility is broken, just that there is no testing or effort to ensure compatibility. In the end it's similar, but like any project, it comes down to allocation of time and resources. For something like Windows XP, I'd guess the pool of folks interested in targeting it is extremely small.


You can still write code that targets Windows XP and it will run on Windows 11 just fine. There's no compatibility break.

The problem is that newer versions of Windows offer plenty of features which make library implementation simpler and/or give better performance. Someone else mentioned some threading/synchronization APIs, which is also the most common non-XP feature I've found in use in various C++ libraries.


Given that XP is no_std, it seems plausible that they want to use some newer APIs in the standard library that didn't exist in older versions of Windows?


But why not test? If we don't expect compatibility to break, then it will be little extra effort surely?


If you were in this situation yourself, what would you do if you saw a test failure? Is it different from what you'd do if you found it to be a success?

If you put it into a tier of support that states "I won't be proactively maintaining compatibility and fixing issues here", then your answer is "nothing." A failing test won't spur you to action, because of the support level.

So if the test result doesn't change your behavior, why run the test in the first place?


It's quite a lot of extra effort.

The Rust test job is to compile every single public open-source package on the crates.io registry. This is an amazing way to test. But it's also expensive, because that actually takes a lot of machine time.


CI jobs cost money, and every new target has a multiplicative effect on the number of job configurations that need running.


This is very naive.


That makes much more sense and wasn't really obvious from the announcement, thanks!


Because newer versions of kernels add new userspace APIs that can be hard to work around if it's not present. For example, Linux 3.7 added getrandom, which is a much easier way to get CSPRNG data from the kernel than /dev/urandom. With regards to Windows, I believe Windows 7 added some multithreading helpers that make mutex support much more performant compared to what you would have to do on XP or Vista.

So, no, the executable code is not the same on XP or 11.


> Currently Windows 7 and 8 are listed as Tier 1 supported platforms. However, this has not been true for a long long time. We simply do not have the testing infrastructure. And with so much software now abandoning Windows 7 and 8 (everything from Git to Go to every major browser), continuing to provide the little support that we do is only getting more difficult. There is also a lack of vendor support for these targets.

The main effect is to split out Windows 7 and Windows 8 as their own targets, such that

> it also leaves open the door for new targets that can commit to broader support

And thus

> Individuals or organisation(s) who can commit to providing some level of legacy testing and support should go through the normal process for creating new targets.

Feel free to apply.


Likely it's not a statement about true compatibility.

More likely it's that they have to keep running CI pipelines on those machines, and that's painful the older the OS gets.


Because those people can just keep using older versions of the compiler if they need binaries to run on those platforms (easier than ever with tools like rustup), and because actually maintaining things like build farms and testing a platform takes a lot of work.


Rust also has a standard library. They may want to use new API for threads, file system access, and other things provided by the std.


Saying you're compatible with a target means that you're testing new changes against that target so it doesn't break.

I don't think they always emit code that looks the same, otherwise Windows wouldn't have that awesome compatibility mode in their binaries, where you could run a Win10 binary as if it's a WinXP one.


Call it partial support then


Well, they're talking about "officially support", which sounds like it's sufficient.

The MCP they're referring to goes into some detail about what's likely to happen. Older versions of Windows could still be community-supported if someone is willing to do so.


I think support implies a lot that I guess they don’t want to imply.


I'd recommend reading the MCP[1] they linked regarding the decision as well as their target tier policy [2].

They are dropping tier 1 support for Win 7 and Win 8. That means they are no longer going to guarantee that the project builds on those platforms and passes all tests via CI.

As long as it is feasible they will probably keep CI runs for those platforms and if interested parties step up and provide sufficient maintenance support, it will remain tier 2. i.e a guarantee that it builds on those platforms via CI but not necessarily that all features are supported and guaranteed via passing tests.

If interested parties can provide sufficient maintenance that all tests continue passing, it will be tier 1 in all but name. However the rest of the development community won't waste their time with issues like Win 7 and 8's partial support for UTF-8.

And once CI stops being feasible for the compiler team to host, it'll drop down to tier 3. If there's sufficient interest from the community towards maintaining these targets, in practice you should see comparable support to with tiers 1 or 2 however now any CI will be managed externally by the community and the compiler team will stop worrying about changes that could break compilation on those targets.

TLDR: They aren't saying "it'll no longer work" but rather "if you want it to stay maintained for these targets, you have to pitch in dev hours to maintain it and eventually support the infrastructure to do this because we don't see a reason to continue doing this". So if you care for these targets, you'll have to contribute to keep it maintained.

[1]: https://github.com/rust-lang/compiler-team/issues/651

[2]: https://doc.rust-lang.org/rustc/target-tier-policy.html


Thanks for that clarification. Wasn't obvious for everybody at first read.


Tier 1 Rust Targets run all CI tests, and block tools - so it's about CI infrastructure and maintenance of that I think


I've worked pretty extensively with the Win32 API and Go. I needed to target Windows XP and had to use an older version of Go for stuff like reading/writing files, networking, etc. From what I could gather, newer versions of the Win32 API add abstractions that make common operations require less API calls. I remember needing to use 9 separate Win32 API calls just to bring a window to the foreground and set focus to it. So I think part of the reason Go drops support for older versions of Windows is they were able to simplify code on _their_ end by leveraging these new abstractions. I imagine Rust might be doing the same thing? This is all pure speculation and my memory is fuzzy on this, so take this with a grain of salt.


No they don't, Visual C++ and .NET JIT take advantage of CPU instructions as per minimal supported CPU.

There also a couple of Win32 APIs used alongside the related frameworks.


I bet that's mainly for stdlib features.


It will be interesting in the future to read the "oh, Windows 10 is no longer tier-1 !!" when the bell arrives at their windows.

PS: Good job Microsoft, receive our acknowledgment. Say hello to the busy telemetry guys. /s


> It will be interesting in the future to read the "oh, Windows 10 is no longer tier-1 !!" when the bell arrives at their windows.

It's certainly bound to happen someday. Rust has a lower bound on official support for every OS, not just Windows. For example, Rust doesn't support compiling for Linux kernels older than 2012.


> "Rust previously limited the maximum number of statements run as part of any given constant evaluation. However, especially creative Rust code could hit these limits and produce a compiler error" [my emphasis]

Steve Klabnik one said he hoped Rust would be more like Ruby, and have some more weird projects. Maybe with this improvement, Rust can be more weird.


I like Rust. It adapts a lot of nice features that C++ is lacking.

However it doesn’t solve any problems I have at work. I routinely deploy very large C++ applications to large international companies around the world.

And I haven’t had a memory or multi-threading problem causing any production issues for as long as I remember. I routinely use Valgrind and Helgrind to make sure it stays that way.

However I do have 9000+ auto tests that push the code way beyond any possible real life customer use cases. Enabling me to make major changes and optimizations to the code and drop it into production with confidence. I haven’t had a production bug for 5+ years.

Switching to Rust won’t change that. I would still need those 9000+ tests to make sure my Rust deployment would be error free.

So my point is this: No programming language will magically make your code bug free or eradicate the need for you to use sound software engineering practices like comprehensive auto tests.

There are of course languages more powerful than Rust that will allow you to write proven correct bug free code (Agda/Idris/Coq/..) However those languages won’t prove that your code has the performance and latency needed in a real world environment for example.

So I would rather spend more time polishing and improving my auto test skills rather than investing in switching languages. My ROI will be way higher.

If reading this makes you angry and eager to defend the honour of Rust and discredit what I am saying, please understand that I have nothing against Rust. This is more a summary of my current thinking on Rust and any other new programming language wanting to take over from C++.

I would love to hear the thoughts of other experienced C++ developers who are responsible for very large C++ applications used by real customers.


Dying for async traits to someday come true


AFAIK it's just waiting on the fix in https://github.com/rust-lang/rust/pull/114489 to land, I don't know of any other blockers.


Coming in 1.74 apparently but it seems to be behind schedule by what the plan was in the Gantt chart.

It's a feature I'm eagerly keeping tabs on as it have so many hacks in my active work that will [just work] once I can use async traits.


Serious question: is the crate that fakes it with box dyn future really not performant enough for you?


Not ergonomic for use by providing a public trait API in a library when step one is [also] import this other hack library to get up and running.


I love using Rust in my toy projects (and wish my job was more open to anything but C++, but oh well). With its functional-style iterators, sum types and pattern matching, Rust lets me write code in a way that just feels natural. And the borrow checker stopped bothering me once I embraced reference-counted pointers for those cases where lifetimes are not obvious. Compilation time also hasn't been much of an issue once I moved to using dylibs for dependencies [1]. So if you want to use Rust but are wary of those problems, don't be! :)

With that said, I can't help but feel that Rust development has noticeably slowed down over the years. Don't get me wrong, I appreciate the hard work behind each release! It's just that, from my totally uninformed bystander perspective, there's been a sharp drop in people working on the language and compiler full-time since around Mozilla layoffs, and Rust still hasn't recovered from that. It's surprising and quite disappointing to see no significant manpower commitment from other corporations using Rust, like Microsoft [2] and Google [3].

As a result, while there's definitely new exciting things happening, more and more issues are piling up, many sitting unaddressed for years. Granted, it's mostly the small things that you can live without, but they all add up. Here are some examples just off the top of my head:

1. If-let chains [4] and if-let guards [5], proposed back in 2018, are still not there. I constantly encounter cases where having them would make the code much shorter and clearer. I guess that depends on what you do, though. My code is heavy on state machines and pattern matching, otherwise this may be less of an issue.

2. Const generics are still very limited (no const trait impls [6], no enums as const generic parameters [7], no float arithmetic in const [8], etc.). I understand those are hard problems, but most are known for 3-5 years by now, and there's no finishing line in sight. Comparing const in Rust to constexpr in modern C++ will leave you disappointed.

There's definitely more problems that I hit less frequently, but each compiler error linking me to some stabilization issue with years-long discussion takes away a bit of joy...

And yet I heartily recommend trying out Rust if you haven't done so yet! Behind those papercuts hides a very practical and empowering language that gives you functional constructs at high performance and with much lower chance of shooting yourself in the foot as a newbie compared to C++.

[1] https://robert.kra.hn/posts/2022-09-09-speeding-up-increment... [2] https://blogs.windows.com/windows-insider/2023/07/12/announc... [3] https://security.googleblog.com/2021/04/rust-in-android-plat... [4] https://github.com/rust-lang/rust/issues/53667 [5] https://github.com/rust-lang/rust/issues/51114 [6] https://github.com/rust-lang/rust/issues/67792 [7] https://github.com/rust-lang/rust/issues/95174 [8] https://github.com/rust-lang/rust/issues/57241


> from my totally uninformed bystander perspective, there's been a sharp drop in people working on the language and compiler full-time since around Mozilla layoffs, and Rust still hasn't recovered from that

In terms of number of commits to the rust-lang/rust repo, activity peaked in late 2019/early 2020, whereas the Mozilla layoffs took place in late 2020. Activity since late 2020 has mostly stayed stable, and remains well above where it was at any point prior to 2018: https://github.com/rust-lang/rust/graphs/contributors

In addition, I know of several former Mozillians who remain employed to work on Rust, including one who heads the Rust team at Amazon.

As far as the number of contributors to each release, it's currently hovering around an all-time average high (although a handful of past releases have anomalously high peaks): https://thanks.rust-lang.org/

The reason that progress appears slower these days is because the low-hanging feature fruit has mostly been plucked, and what's left are the harder problems. Maintenance tasks don't make for very interesting release notes. In addition, as the language matures much of the interesting feature work has shifted from the compiler/stdlib to tooling like Cargo, rust-analyzer, etc. (whose activity might not be reflected in the above graphs).


I regularly come across sensible features that are sadly nightly-on. Corresponding features on the issue tracker tend to be years old and still open. For example, the Error trait in core as opposed to only std.


Agree with many of your points. And would add to that a frustration that allocator-api and simd are still not in stable, after so many years. Two things that impact the things I do.


> With that said, I can't help but feel that Rust development has noticeably slowed down over the years. Don't get me wrong, I appreciate the hard work behind each release! It's just that, from my totally uninformed bystander perspective, there's been a sharp drop in people working on the language and compiler full-time since around Mozilla layoffs, and Rust still hasn't recovered from that. It's surprising and quite disappointing to see no significant manpower commitment from other corporations using Rust, like Microsoft [2] and Google [3].

They brought this on themselves being Leadership By Community rather than forming a working group to get a standard out. The reason C and C++ got incredibly popular was two fold:

1. There was really no other choice

2. They were rapidly adopted by a wide variety of people, competition led to standardization, and eventually convergence on a few good compilers. `mrustc` is basically the only alternative and it's only REAL use is for an alternative bootstrap story since Rust bootstrapping is still a problem.

The entire story for Rust is rather pathetic because it would appear at every turn they made the wrong choice despite having a lookback of over 50 years of compiler evolution. Which is sad, because Rust does bring a lot of very nice things.

Because the Rust team doesn't want this path (as in, they are not even entertaining the idea) you're left with a relatively small group of very brave volunteers trying to do their best to be The Standard (TM). The hope was that with adoption from Cloudflare/Amazon/Google/Facebook you'd see a similar standardization story. But it seems none of these groups are interested in the compiler itself and instead are just interested in promoting its use.

Stabilization will be a long term concern. The inclusion in the linux kernel is minimal at best, there are some limited use cases in Asahi, etc. The success of Rust is largely mythical rather than reality. The community at large is extremely vocal to the point of zealotry which also is likely driving people off of helping with the effort. There are a lot of very smart compiler developers in the C and C++ world that don't want anything to do with Rust strictly because of it's community.

Finally, it's also possible companies that may contribute more are being driven away by the politics of the core team. There was an unbelievable discussion on whether they should allow Palantir to continue to work with them because they Do Bad Things (TM). While I can respect their opinion on the subject I cannot respect the general lack of professionalism that you see from the team. While these things don't matter with small languages they do matter a lot with big ones. This lack of professionalism bleeds into every part of the language. It's time we stop talking about Rust like it's a toy language that can get away with being edgy and hip. If it wants to survive it needs to make drastic changes towards a model used by nearly every successful language for the last 50 years.

My conclusion is if Rust wants to succeed it needs to standardize, eject every member of the existing team, and aim for a more professional (e.g. not Mozilla's brand of politics) version of itself. Otherwise it's doomed to hobbytown for the rest of its days and C++ will continue to reign supreme.

Side note:

It's nice to see they dropped the politics for this set of release notes. Maybe they're learning.


> They brought this on themselves being Leadership By Community rather than forming a working group to get a standard out.

First of all, the idea that the C++ standards process is some pinnacle of productivity and velocity is endlessly funny to me. Maybe by the time C++26 comes out, all of the features in C++23 might be considered "usable" with more than one compiler. That's saying nothing of the purgatory that certain features have been in for years.

Second, who implements the standards? Google pulled back most of their resources from Clang. Most development on C/C++ compilers is currently done by companies like Microsoft and Red Hat and Intel that have a lot of paying customers relying on those ecosystems. That's a function of time and penetration, not whether there's a "committee" involved.

Third, politics exist in C++ as well. People snipe at each other in public and on private mailing lists and conferences. They are not immune from "unprofessionalism".


I don’t get why c++ has to be bad for rust to be a good language.


I'm not criticizing C++ as such, I'm criticizing the idea that a standards committee is the reason that C++ develops quickly (and that detail isn't even obviously true), or that lack of a standards committee is the reason Rust doesn't (which also isn't obviously true).

The whole line of argument is just absurd. Look at Go or Python or Ruby - none of them are ruled by a standards committee, and all of them are very popular and see plenty of development. And frankly I don't think Rust actually develops slower than C++ does. Rust delivers features every 6 weeks rather than every 3 years, so it can be hard to tell just how much progress has actually been made even when it is actually quite a lot.


Why do people care so much about a "standard?" Multiple implementations are not actually a Good Idea nor does "The Standard" help you on the ground as a programmer.

I also don't really see zealotry anymore. I see new projects being written in Rust left and right, and C++ developers bitching about it because they don't want to learn it or have been so scarred by moderately advanced language features implemented poorly they think Rust does it poorly too.


C++ developers don’t "bitch" about rust, in my experience. They either get interested in rust or ignore it. The drama seems to always come from the rust evengelists, that won’t accept someone who don’t agree c++ should be banned and rust is the savior language…


It's legitimately baffling if you actually believe that.

99% of all programmers just want their chosen tool to succeed.

Consider that you might have been influenced by rage-baiting trolls. That's understandable and it happened to all of us at one point.

Don't judge a community by the 0.1% bad apples. Every community has them.


Sorry, it's baffling if I believe what exactly? That rust supremacists are more than 0.1% of the community? Then I can only speak of what I hear from it, and my experience is that more often than not, the discussion ends up with an implied ultimatum: either you agree that using c++ instead of rust is irresponsible and wrong, either you are being "a part of the problem" and should not be programming. I'd like to be wrong and happened to have came across mostly bad apples.


> The drama seems to always come from the rust evengelists, that won’t accept someone who don’t agree c++ should be banned and rust is the savior language…

This. This is what I find baffling that somebody can believe in. Every community has the 0.1% of insufferable zealots and Rust is no exception.

I worked with absolutely brilliant Rust programmers that made me question if I know anything at all about programming in general -- and I have 21.5 years of experience.

I keep seeing your sentiment expressed in a number of Rust threads which becomes more and more confusing with time because I scarcely see anyone at all advocate zealously for Rust but I am seeing plenty of people like you who keep insisting that Rust fans are torturing them. :D

It gets funny at one point.

I mean, try to be more data-driven. Scan the last 5 big Rust threads and just try to do basic sentiment analysis. I have, and I am mostly seeing very balanced and curious debates. I haven't noticed any zealotry. Last time I noticed people being as annoying was I think somewhere back in 2018.


yes, the language you use to describe something completely wrong is baffling.

you have been tricked into being mad at something that literally doesn't matter.


Me? mad? Hmmm.

What about your language? And his?

"Bitching", "baffling", "rage-baiting trolls", "completely wrong", "literally doesn't matter".

My language: "in my experience", "more often than not", "I'd like to be wrong and happened to have came across mostly bad apples."

So, I'm not the one who is "mad" and "bitching" here. You are the one mad at me.

Who is being tricked? Sounds like you are tricking yourself.


> There was an unbelievable discussion on whether they should allow Palantir to continue to work with them because they Do Bad Things (TM).

Well, since it's community driven, this makes perfect sense. Freedom of association and all.


  politics
That's a lot of words for "I don't like the politics of the people contributing to rust" with a side of "there must be a lot of people like me and they're all very smart". If I'm honest, that doesn't seem terribly professional or realistic.

As someone who's not a compiler guru, I've found contributing to rust (whether rustc or third party crates) to be generally frictionless and overall a pleasant process. It's great to not have to deal with the drama surrounding so many other projects (EGCS anyone?). Quite frankly I'm glad there's no need to hold your nose and put up with RMS' antics.

  eject every member of the existing team
What? Ejecting everyone who's built the tool you like because you don't like their politics is preposterous on its face and wildly unprofessional.

  Rust bootstrapping is still a problem
What?


[dead]


[flagged]


Being "non-political" is in itself an inherently political position in favor of the status quo and against currently disadvantaged people.


it's not a misdirection, that's a direct C++ committee members who routinely attends conferences where female speakers have been forced to step down if they don't want to be in the room of a sex predator


Since I entered Rust (circa 2018-2019) and async/.await was stabilized, I started to lose my expectations on the growth of the language. Almost every language issue I wanted to be resolved is still unresolved (besides GATs, which are great but took a really long time to be shipped). Meanwhile, the community doesn't cease to perpetually endorse the language; you literally see top-scoring posts like "I felt in love with Rust, can't stop loving Rust, it's so wonderful" every month or so on r/rust, a lot of reaffirming articles expounding on the "success" of the language, collective exultation when it's again most loved on SO, etc.

The current situation with the language is somewhat sad.


> Meanwhile, the community doesn't cease to perpetually endorse the language

I can't speak for you, but I endorse Rust because I like the language as it exists, not as it might exist in the future, and it seems safe to assume that the other people endorsing it feel the same way, and that people who feel differently are not (and should not be) endorsing Rust. As far as my use cases are concerned, there's no language feature that Rust is missing or that would significantly improve my life (although I suppose inline const would be nice).

(And as far as tooling features go, the only thing that I want is sandboxed builds.)


Clearly the state of the language post-async/await is good enough that tens of billions of dollars, probably more, are riding on it. There's still lots that needs to be done but the language is in pretty good shape today.

Why shouldn't people fall in love with Rust and post about it? I fell in love with Rust before NLL even.


> you literally see top-scoring posts like "I felt in love with Rust, can't stop loving Rust, it's so wonderful" every month or so on r/rust

That's expected on any forum dedicated to <subject>. People tend to only specifically seek out communities around subjects they like, not dislike.


Could you expand on what language issues you want resolved that the project isn't addressing?


Async traits, async `Drop`, TAITs, variadic generics (unlikely they will every be implemented), generic closures, optional/named parameters, anonymous enums. These are the first that came to my mind.


Thank you for the list! That's useful for me to understand what we might not be actively working on that people find frustrating.

- Async traits: coming soon https://blog.rust-lang.org/inside-rust/2023/05/03/stabilizin..., actively in development (and has been for a while now, please don't confuse "this problem is hard and taking a long time" with "we don't care about this problem" https://github.com/rust-lang/rust/issues?q=is%3Aissue+label%...).

- async `Drop`: there have been multiple "false-starts", trying to come up with an acceptable design. We don't have a good answer for this at the moment. It is unknown to me how long it might take for us to figure it out.

- TAITs: same as async traits. It'll likely land after async fn in traits, but it's part of the same design and implementation effort.

- variadic generics (unlikely they will every be implemented): agree with your assessment, at least in the short to medium term.

- generic closures: same as above.

- optional/named parameters: I believe that this feature as such might never exist in rust but think that a combination of structural structs (`struct { bar: usize, baz: usize }`) and/or struct literal inference (`let x: S = _ { bar: 1, baz: 2 }`) and default const values in structs (`struct S { foo: usize = 42, bar: usize }`/`S { bar: 0, .. }`) would be more generally useful and would nicely cater to this use case (`foo(_ { bar: 42, .. }`).

- anonymous enums: I want this as well, but it interacts poorly with type parameters and automatic type upcasting (if you have `A | B` can you convert it into `A | B | C`? Does it need syntax? What about `Result<(), ()> | Option<()> | Result<i32, ()>`? If you have a function that returns that, what does `return Err(())` do?). Type downcasting could be done by forcing a match expression on the value. Whether `A | B` should `impl T` if `A: T, B: T` is an open question. I want to push for a solution here in the coming year.


> TAITs

I personally find these 4 letter acronyms difficult to lookup and understand. One of the T is probably "trait", but I always forget.


Sorry, the names we use within the team are not meant to be used in user facing communications, but it is easy to forget that not everyone I talk to isn't in the team :)

TAIT stands for `type Alias = impl Trait;`, which would let you do something like

    type Alias = impl Display;
    fn foo() -> Alias {
        42
    }
    fn bar() -> Alias {
        0
    }
    fn main() {
        let x: Alias = if rand() > .5 {
            foo()
        } else {
            bar()
        };
    }
If you changed bar to return a &str, for example, that would be a compile error.

There's also the related

- RPIT, "return position impl trait" (we already have this)

- RPITIT, "return position impl trait in traits" (the foundation for async unctions in traits, `trait T { fn foo() -> impl Trait; }`)

- AFIT, "async functions in traits"

No, you shouldn't need to know what these things mean, beyond them "just working" in terms of what you would expect from writing impl Trait in different places.


Thanks for your comprehensive answer, it's really nice to see that async traits and etc. might be coming soon.


Is it expected that a programming language would have ~9,000 open issues?

~100 issues are either Critical/High/Prioritize

https://github.com/rust-lang/rust/issues


> Const evaluation time is now unlimited

There are few good things in life unlimited. One can add above in that list now.


About String::leak:

> The caller has free choice over the returned lifetime, including 'static. Indeed, this function is ideally used for data that lives for the remainder of the program’s life, as dropping the returned reference will cause a memory leak.

I can see the use case of the function and from reading the commit discussion, it seems it was based on Vec::<u8>::leak() but I'm not able to understand why either of the functions are safe instead of unsafe.


Rust's memory safety model does not prohibit memory leak.

https://doc.rust-lang.org/book/ch15-06-reference-cycles.html


Bjarne Stroustrup is emphatic that prohibiting all leaks must be part of safety, but I have no idea what the logical justification is to distinguish say Box::leak, which this prohibits, from the moral equivalent of freeing resources only on exit, which is fine under such a rule.

It composes (if A doesn't leak and B doesn't leak, then a combination AB also does not leak) which is a property safety also has, but I don't see another connection.


> I'm not able to understand why either of the functions are safe instead of unsafe.

https://cglab.ca/%7Eabeinges/blah/everyone-poops/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: