17 ms·
I was about to say "what, we've had records for decades" but then I read the changelog. Interesting. I wonder if there a world where Elixir starts compiling ma
by sbrother 4mo ago
I was about to say "what, we've had records for decades" but then I read the changelog.
Interesting. I wonder if there a world where Elixir starts compiling maps to "native records"?
- dnautics 4mo agoprobably not maps, but structs yes.
- s3cur3 4mo agoI dunno… it’d break a looooot of code if structs were suddenly not also maps. My bet is this becomes a new option you have to manually migrate to.
- dnautics 4mo agoWould it? I bet you could be very clever with transitional guards and the patching compiler to defensively handle both cases on detection of %{...}
- out_of_protocol 4mo agoProbably going to be replacement rather than direct recompilement of structs. I imagine all sorts of corner cases are lurking around if you swap implementation around, e.g. if someone force-pushed unknown key into a struct at runtime. Would be nice to keep current struct syntax though with the only difference in declaration