Example of Rust code

Walter Bright newshound2 at digitalmars.com
Fri Aug 10 16:19:30 PDT 2012


On 8/10/2012 3:46 PM, bearophile wrote:
> Walter's code seems to miss the point, but maybe he's trying to tell me
> something about very small demo programs.

If you want something allocated on the stack, us a struct, not a class.
It's what structs are for.

You can also use templates with overloading to get stack allocated parametric 
polymorphism and zero runtime overhead.

What I mean is:

1. If you write FORTRAN code in D, it will not work as well as writing FORTRAN 
in FORTRAN.

2. If you write C code in D, it will not work as well as writing C in C.

3. If you write Rust code in D, it will not work as well as writing Rust in Rust.

If you want D code to perform, you gotta write it in D. Not in Rust, C, or Java.


More information about the Digitalmars-d mailing list