Vulkan. You know what it is. But why isn't it out yet?
Oh, what do you know, it's because Rust programmers are complaining it's difficult to interface with their FFI because of Rust's lack of unions, so these SJWs are bitching about it to try to change Vulkan's data structures to be less optimized in order to favour Rust.
Rust is fucking garbage and these rustcucks are fucking up what could be a good API.
>>35 After defining a function ('magical') to consume the values, which were computed as booleans depending on the variant, rustc produced this which is better than I feared:
I'm confident passing on the actual data in the variant would be efficient too but I don't want to read what the optimizer has to say about that, not after seeing the optimized output for calling printf!().
Name:
Anonymous2015-09-19 22:48
>>37 If that was true inheritance would already be in Rust, and it would look like C++. You might want to look into it, and the proposed solutions before making up nonsense like this.
>>44 What purpose would inheritance solve in Rust that isn't already covered by structs, enums and traits?
Name:
Anonymous2015-09-21 17:18
>>45 You're just going to post a question to a thread on page 2 and not bump it?
The big issue is keeping space conserved without blowing up the code or blowing the performance. A canonical, Servo-relevant example: https://gist.github.com/jdm/9900569
There are so many proposals because people don't want to see it all go to shit like C++. If C unions were that pressing we would see more proposals for it too, but I haven't found any. The only use of unions in Rust would be to interface with C. Variant types are covered by enums and type punning can be done with mem::transmute.
I did, but only because I was wondering what happened to the thread.
Name:
Anonymous2015-09-24 22:18
Swift goes the other way, using structs:
Named C unions now import as structs with fields corresponding to each field of the union. By using a struct Swift presumably preserves the ability to use a union to project a different view on the same underlying bits but I have yet to verify that Swift really does make the struct's fields use the same underlying storage.
When the union's inspiration through the workers' blood shall run, There can be no power greater anywhere beneath the sun; Yet what force on earth is weaker than the feeble strength of one, But the union makes us strong.
CHORUS: Solidarity forever, Solidarity forever, Solidarity forever, For the union makes us strong.
Is there aught we hold in common with the greedy parasite, Who would lash us into serfdom and would crush us with his might? Is there anything left to us but to organize and fight? For the union makes us strong.
Chorus
It is we who plowed the prairies; built the cities where they trade; Dug the mines and built the workshops, endless miles of railroad laid; Now we stand outcast and starving midst the wonders we have made; But the union makes us strong.
Chorus
All the world that's owned by idle drones is ours and ours alone. We have laid the wide foundations; built it skyward stone by stone. It is ours, not to slave in, but to master and to own. While the union makes us strong.
Chorus
They have taken untold millions that they never toiled to earn, But without our brain and muscle not a single wheel can turn. We can break their haughty power, gain our freedom when we learn That the union makes us strong.
Chorus
In our hands is placed a power greater than their hoarded gold, Greater than the might of armies, multiplied a thousand-fold. We can bring to birth a new world from the ashes of the old For the union makes us strong.
Name:
Anonymous2015-09-25 0:47
Ironically, C doesn't actually have unions either.
Name:
Anonymous2015-09-25 2:28
>>51 If you use Rust, you're either gay, or a feminists, or both.
Rust is bad for systems programming and I don't mean ``bad'' in the Michael Jackson sense.
Name:
Anonymous2015-09-28 16:19
the great thing about rust is it has this complicated "region" type system which ensures correctness... there is no proof or even a formal model of the type system but why would you want that?