Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> old code gets automatically compiled by the old version of the compile

That's not what happens. You always use the same version of the compiler. It's just that the newer compiler version also knows several older dialects (known as editions) of the language.



And it remains to be seen how well this approach will work as time passes and the number of versions continues to increase.


That won't be any more of a problem than the support that every existing C or C++ compiler has for targeting different versions of the standard.


Right, it's not considered weird for a C++ compiler to offer C++ 98, C++ 11, C++ 14, C++ 17, C++ 20, C++ 23 and C++ 26 (seven versions) and support its own extra dialects.

It is also usual for the C++ compilers to support all seven standard library versions too. Rust doesn't have this problem, the editions can define their own stdlib "prelude" (the reason why you can just say Vec or println! in Rust rather than their full names, a prelude is a set of use statements offered by default) but they all share the same standard library.

core::mem::uninitialized() is a bad idea and we've known that for many years, but that doesn't mean you can't use it in brand new 2024 Edition Rust code, it just means doing so is still a bad idea. In contrast C++ removes things entirely from its standard library sometimes because they're now frowned on.


Well, there's the 2015, 2018, 2021, and 2024 editions. It's been a decade and it seems to be working pretty well?




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

Search: