News for hackers. Stuff that matters.
Re:Switching from C++ to Rust by kaba0 on Tuesday March 14, 2023 @06:34AM (#35149477)
It didn’t have at 1.1, but it does now: https://news.ycombinator.com/item?id=35133670
Re:Switching from C++ to Rust by the_gipsy on Tuesday March 14, 2023 @07:06AM (#35149677)
You can do that with go too, there are libraries out there. But it's all a joke compared to real support in the language.
Re:Switching from C++ to Rust by kaba0 on Tuesday March 14, 2023 @07:13AM (#35149732)
Real support like what Java has? It literally has sealed classes and interfaces that specify all the possible classes that can subtype it. This is enforced by the language and allows for things like exhaustive switch cases. Pattern matching is a related feature which is also available in Java now, though as of yet only limited to records.
Re:Switching from C++ to Rust by the_gipsy on Tuesday March 14, 2023 @07:36AM (#35149918)
So it's a Frankenstein monster, with no real pattern matching support. Good luck with using it in the real world.