D perfomance

random random at spaml.de
Wed Apr 29 10:32:33 UTC 2020


On Friday, 24 April 2020 at 19:27:40 UTC, Arine wrote:
> On Thursday, 23 April 2020 at 15:57:01 UTC, drug wrote:
>> And your statement that Rust assembly output is better is 
>> wrong.
>
> There most definitely is a difference and the assembly 
> generated with rust is better. This is just a simple example to 
> illustrate the difference. If you don't know why the difference 
> is significant or why it is happening. There are a lot of great 
> articles out there, sadly there are people such as yourself 
> spreading misinformation that don't know what a borrow checker 
> is and don't know Rust or why it is has gone as far as it has. 
> This is why the borrow checker for D is going to fail. Because 
> the person designing it, such as yourself, doesn't have any 
> idea what they are redoing and have never even bothered to 
> touch Rust or learn about it. Anyways I'm not your babysitter, 
> if you don't understand the above, as most people seem to not 
> bother to learn assembly anymore, you're on your own.

A competent C Programmer could just write something like this. Or 
use restrict...

int test(int* x, int* y) {
     int result = *x = 0;
     *y = 1;
     return result;
}

Produce this with gcc -O

test(int*, int*):
         mov     DWORD PTR [rdi], 0
         mov     DWORD PTR [rsi], 1
         mov     eax, 0
         ret

https://godbolt.org/z/rpM_eK

So the statement rust produces better assembly is wrong.
I it's on my todo-list to learn rust. What is really off-putting 
are those random fanatic rust fanboys.
In your language:
"If you don't know why the difference is significant or why it is 
happening",
you should probably learn C before you start insulting people in 
a programming forum ;)



More information about the Digitalmars-d mailing list