3 ms·
> I can also say confidently that the #1 method to combat memory safety errors is array bounds checking. The #2 method is guaranteed initialization of variables
by WhereIsTheTruth 1y ago
> I can also say confidently that the #1 method to combat memory safety errors is array bounds checking. The #2 method is guaranteed initialization of variables. The #3 is stop doing pointer arithmetic (use arrays and ref's instead).
#4 safer union/enum, I do hope D gets tagged-union/pattern-matching sometimes in the future, I know about std.sumtype, but that's nowhere close to what Rust offer
- WalterBright 1y agoDoing a sumtype is on the agenda and we'll get to it. BTW, D has always had quite an advanced pattern matcher for types. https://dlang.org/spec/expression.html#is_expression https://dlang.org/spec/expression.html#is_expression https://dlang.org/spec/template.html#template_type_parameters https://dlang.org/spec/template.html#template_type_parameter...
- baranul 1y agoAnother language with such features, including sumtypes, is V (Vlang)[1]. [1] https://github.com/vlang/v/blob/master/doc/docs.md#sum-types https://github.com/vlang/v/blob/master/doc/docs.md#sum-types