News for hackers. Stuff that matters.
Re:The Python Paradox by creata on Friday January 27, 2023 @01:29AM (#34543250)
> Tag structs are laborious... Rust should rebase its type system to have union types, i.e., foo: i32 | f32.

Rust has ADTs, so I'm not sure what you're saying here. Can you expand on how you think unions would make code nicer than disjoint unions? They definitely make generics much harder to think about for me.

Re:The Python Paradox by komadori on Friday January 27, 2023 @04:27AM (#34544222)
Perhaps they mean anonymous (discriminated) unions of some kind with that syntax?
Re:The Python Paradox by consilient on Friday January 27, 2023 @08:04AM (#34545517)
ADTs = discriminated unions + tuples. They likely mean undiscriminated unions, as in typescript.
Re:The Python Paradox by nephanth on Saturday January 28, 2023 @11:40AM (#34559030)
But since rust is compiled, in practice that would be like C unions, right? A pain to work with

I mean typescript has those because the underlying runtime is Javascript, which tracks the types of stuff and handles some kind of polymorphism, so you can get away with undiscriminated unions because the runtime is doing the job of discriminating them