Rust vs Dlang

Tyler Jameson Little beatgammit at gmail.com
Sat Aug 17 19:12:02 PDT 2013


On Saturday, 16 March 2013 at 14:42:58 UTC, Suliman wrote:
> Hi folks! I had wrote small article about Rust vs D. I hope 
> that you will like it!
>
> http://versusit.org/rust-vs-d

I don't know if you still follow this, but there's a typo here:

Now, let’s see, how the code, outputting the word "Hello" 10 
times, will look. In Rust it will look like this:

     fn main() {
         for 100.times {
         ...

Should be:

         ...
         for 10.times {
         ...

Also, the formatting still sucks and imports are missing for the 
D code, whereas imports are verbosely stated in Rust. FWIW, 
"std::io::println" can be stated as just "println", since it's 
available by default. Don't know if this was the case when you 
wrote the post though...

Also, you don't mention the difference between D and Rust in 
switch statements (FWIW, Rust doesn't have switch statements, 
they're now "match" statements, which are closer to haskell's 
case statements than D's switch, because D's switch has optional 
fallthrough (goto case;) and Rust has no fallthrough.

Also, I second the objection to your exception example. D does 
have exceptions and there are some very important differences 
between them and Rust's exception handling (which is more like 
Go's recover() than D's catch).


More information about the Digitalmars-d-announce mailing list