digitalmars.D - A comparison between Rust and D
- maik klein (2/2) Jun 24 2016 https://maikklein.github.io/post/cmp-rust-d/
- jmh530 (12/14) Jun 24 2016 On interior mutability in arrays, does this help:
- maik klein (5/20) Jun 24 2016 I should probably be more clearer, I this context I just meant
- Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= (8/10) Jun 24 2016 It is a good thing to have objective comparisons of languages,
- Jacob Carlborg (10/12) Jun 26 2016 It's possible in D to collect multiple functions for one set of
https://maikklein.github.io/post/cmp-rust-d/ https://www.reddit.com/r/programming/comments/4po2j5/a_comparison_between_rust_and_d/
Jun 24 2016
On Friday, 24 June 2016 at 17:26:58 UTC, maik klein wrote:https://maikklein.github.io/post/cmp-rust-d/ https://www.reddit.com/r/programming/comments/4po2j5/a_comparison_between_rust_and_d/On interior mutability in arrays, does this help: void main() { immutable(int)[] x = [1, 2, 3]; x = [2, 3, 4]; //this works x[0] = 1; //this doesn't immutable(int[]) y = [1, 2, 3]; y = [2, 3, 4]; //this doesn't y[0] = 1; //this doesn't }
Jun 24 2016
On Friday, 24 June 2016 at 17:37:20 UTC, jmh530 wrote:On Friday, 24 June 2016 at 17:26:58 UTC, maik klein wrote:I should probably be more clearer, I this context I just meant std.container.Array. And in general stuff like refcounted. I wonder how Andrej handles immutability for the refcounted string.https://maikklein.github.io/post/cmp-rust-d/ https://www.reddit.com/r/programming/comments/4po2j5/a_comparison_between_rust_and_d/On interior mutability in arrays, does this help: void main() { immutable(int)[] x = [1, 2, 3]; x = [2, 3, 4]; //this works x[0] = 1; //this doesn't immutable(int[]) y = [1, 2, 3]; y = [2, 3, 4]; //this doesn't y[0] = 1; //this doesn't }
Jun 24 2016
On Friday, 24 June 2016 at 17:26:58 UTC, maik klein wrote:https://maikklein.github.io/post/cmp-rust-d/ https://www.reddit.com/r/programming/comments/4po2j5/a_comparison_between_rust_and_d/It is a good thing to have objective comparisons of languages, but I think it would be more interesting if you only compared the languages and not the libraries as well. Comparing libraries is very tricky, and comparing standard libraries will usually end up with comparing apples and oranges as some languages intentionally keep their standard libraries small (as they should ;-).
Jun 24 2016
On 24/06/16 19:26, maik klein wrote:https://maikklein.github.io/post/cmp-rust-d/ https://www.reddit.com/r/programming/comments/4po2j5/a_comparison_between_rust_and_d/It's possible in D to collect multiple functions for one set of constraints using a template: template Foo(T) if (is(T : int)) { void a(T x) {} void b(T y) {} } -- /Jacob Carlborg
Jun 26 2016