EEP-79 native records and structs

Slightly related, Structs allow to match on the module name, but it is not yet possible with native records - there is an issue already Allow pattern matching (or guards) on native records module/name · Issue #10861 · erlang/otp · GitHub

Given that native records will be experimental in Erlang/OTP 29 (and maybe also in Erlang/OTP 30), it seems like this is the time to provide feedback like this :slight_smile:

the more reasonable/sane approach would seem to be 2 (new semantics for records/native-records meaning probably new syntax around it), maybe with converging both in a far future 2.0 elixir version.

I hope converging both, and maybe it’s a good reason for 2.0 to not be that far in the future but as soon as native records are stable, in one or two years? If structs could be implemented as native records, it would improve interoperability with Erlang libraries (and maybe Gleam could adopt them as well?).

1 Like