August 29, 2015
On 29/08/15 4:19 PM, deadalnix wrote:
> On Saturday, 29 August 2015 at 04:17:30 UTC, Rikki Cattermole wrote:
>> On 29/08/15 9:59 AM, Walter Bright wrote:
>>> On 8/28/2015 4:18 AM, Temtaime wrote:
>>>> Are you sure that ONE Walter can achieve what they done ?
>>>
>>> People told me I couldn't write a C compiler, then told me I couldn't
>>> write a C++ compiler. I'm still the only person who has ever implemented
>>> a complete C++ compiler (C++98). Then they all (100%) laughed at me for
>>> starting D, saying nobody would ever use it.
>>>
>>> My whole career is built on stepping over people who told me I couldn't
>>> do anything and wouldn't amount to anything.
>>>
>>> LLVM is a fine compiler, but there's nothing magical about it.
>>>
>>> Besides, we have a secret productivity enhancing weapon that LLVM
>>> doesn't have - D!
>>>
>>> Now, if I can only tear myself away from the internet for a while...
>>
>> Humm Walter, wanna start up trash talking banter?
>> I also work better when people say I can't do X.
>
> I bet none of you can implement SROA in DMD.

I'll see what I can do.
Remind me in 10 years please.

August 29, 2015
On 29-Aug-2015 01:05, Walter Bright wrote:
> On 8/28/2015 9:49 AM, Dmitry Olshansky wrote:
>> Have you ever written a backend? What is the evidance?
>>
>> Consider that x86 x64 bit support was done in about one year and a
>> half by
>> Walter single-handedly that is without freezing the other activity on
>> DMD, of
>> course. Aside from emitting different sequences of instructions most
>> IR-based
>> optimizations stay the same.
>
> Doing an ARM back end wouldn't be that hard. It's much less complex than
> x86. Most of the work would be deleting about half of the x86 code
> generator :-)
>

Yeah, I guess the things to provision for is register count + some peculiarities of allowed moves/stores etc.

Doing the first 64-bit codegen was a difficult task, compared to doing another 32-bit one.

-- 
Dmitry Olshansky
August 29, 2015
On 29 Aug 2015 12:10 am, "Walter Bright via Digitalmars-d" < digitalmars-d@puremagic.com> wrote:
>
> On 8/28/2015 9:49 AM, Dmitry Olshansky wrote:
>>
>> Have you ever written a backend? What is the evidance?
>>
>> Consider that x86 x64 bit support was done in about one year and a half
by
>> Walter single-handedly that is without freezing the other activity on
DMD, of
>> course. Aside from emitting different sequences of instructions most
IR-based
>> optimizations stay the same.
>
>
> Doing an ARM back end wouldn't be that hard. It's much less complex than
x86. Most of the work would be deleting about half of the x86 code generator :-)
>

Don't forget you have about a 100_000_000 distinct ABIs, with about 100_000_000 distinct CPUs/Boards to target.

;-)


August 29, 2015
On 8/29/2015 12:30 AM, Dmitry Olshansky wrote:
> Doing the first 64-bit codegen was a difficult task, compared to doing another
> 32-bit one.


The main problem with the 64 bit x86 was the endlessly confusing non-orthogonality of it. The Win64 port was bad because of the bizarro calling convention they invented.

August 29, 2015
On 8/28/2015 9:19 PM, deadalnix wrote:
> I bet none of you can implement SROA in DMD.

I know it's supposed to be advanced technology, but it's pretty simple. Just look for aggregate instances which are only accessed on register boundaries, and don't have the address taken. Then slice them up into separate register-sized variables, and re-run the optimizer. Voila!

August 29, 2015
On Friday, 28 August 2015 at 21:59:57 UTC, Walter Bright wrote:
> On 8/28/2015 4:18 AM, Temtaime wrote:
>> Are you sure that ONE Walter can achieve what they done ?
>
> People told me I couldn't write a C compiler, then told me I couldn't write a C++ compiler. I'm still the only person who has ever implemented a complete C++ compiler (C++98). Then they all (100%) laughed at me for starting D, saying nobody would ever use it.
>
> My whole career is built on stepping over people who told me I couldn't do anything and wouldn't amount to anything.
>
> LLVM is a fine compiler, but there's nothing magical about it.
>
> Besides, we have a secret productivity enhancing weapon that LLVM doesn't have - D!
>
> Now, if I can only tear myself away from the internet for a while...

I really like your attitude! That's, IMHO, one of the strongest selling point for D itself!

---
Paolo
August 29, 2015
On 8/28/2015 8:49 PM, jmh530 wrote:
> You should feel proud. There's something to be said for going forward regardless
> of what others say. I feel like I would have been fired years ago if I just
> disregarded what everyone said and did what I thought was right.

If management won't back you up, you're working for the wrong outfit anyway.
August 29, 2015
On Tuesday, 18 August 2015 at 10:45:49 UTC, Walter Bright wrote:
> I'm interested in ways to reduce that gap.
>
> There are 3 broad kinds of optimizations that compilers do:
>
> 1. source translations like rewriting x*2 into x<<1, and function inlining
>
> So if you're comparing code generated by dmd/gdc/ldc, and notice something that dmd could do better at (1, 2 or 3), please let me know.

One low-hanging fruit coming right up:
https://issues.dlang.org/show_bug.cgi?id=14840
August 29, 2015
You misunderstood me.
It can be definitely done. The question is about rationality and quality.
Okay, you've done a C++ compiler. Nobody uses that compiler in real projects. It cannot even compile curl or another large project.

You done x86 and x64 backends and plans to make an ARM one. Okee, but in benchmarks it will be always behind gcc/llvm, get over it.

That's a reality.
August 29, 2015
On Saturday, 29 August 2015 at 12:38:45 UTC, Temtaime wrote:
> Okay, you've done a C++ compiler. Nobody uses that compiler in real projects.

For about a decade, dmc was outcompeting the efforts of big companies in features, compile speed, code optimization, AND stability.

Sure, it has fallen behind now, but only because Walter sat down for 15 years so they could catch up.... (time he used to get streets ahead by creating this thing called 'Mars', which again the big guys are trying to catch up to).


I'm happy with the codegen the way it is, it is good enough for me, but let's not make mountains out of hills.