News for hackers. Stuff that matters.
Re:From Julia to Rust by hexane360 on Monday June 07, 2021 @11:45PM (#27430447)
>small union which julia handles efficiently at runtime

Oh! I didn't realize Julia already optimized small unions.

https://julialang.org/blog/2018/08/union-splitting/ https://docs.julialang.org/en/v1/devdocs/isbitsunionarrays/

I wasn't quite sure whether something like this was possible given the semantics of Julia.

Personally, I'd still prefer something more explicit, so it would be more obvious when a union is being handled efficiently. But given that small unions are optimized, I can see why Julia would make the opposite decision.

This makes me feel a lot better about writing Julia code with union types. Thanks

Re:From Julia to Rust by eigenspace on Tuesday June 08, 2021 @12:50PM (#27437639)
Yep, small union optimizations are a godsend!