December 19, 2020
On Friday, 18 December 2020 at 00:13:41 UTC, claptrap wrote:
> On Thursday, 17 December 2020 at 23:16:33 UTC, Walter Bright wrote:
>> On 12/17/2020 2:02 AM, claptrap wrote:
>>> And lets be honest if LLVM doesnt support it, it's pretty small potatoes, who's going to go to that kind of effort to add some niche architecture to DMD?
>>
>> Win64 was never small potatoes.
>
> So some years ago DMD had a single target that LLVM did not, and how does it look today?

For an average D developer, DMD is just the way to go. And the development time is more iterative than release. So DMD speed is a must have for development.

Average Joe needs DMD.

Given enough time, DMD will get ARM support.
December 19, 2020
On Saturday, 19 December 2020 at 14:20:45 UTC, aberba wrote:
> Average Joe needs DMD.

Average Joes tend not to use smaller languages, they use the most used languages for which there are many online tutorials. D has to focus on those bases that are not covered by other languages.

> Given enough time, DMD will get ARM support.

I hope people don't waste resources on adding ARM support, a moving target that has to be maintained. That time would be better spent on writing a clean high level IR.

December 19, 2020
On Saturday, 19 December 2020 at 15:14:04 UTC, Ola Fosheim Grøstad wrote:
> On Saturday, 19 December 2020 at 14:20:45 UTC, aberba wrote:
>> Average Joe needs DMD.
>
> Average Joes tend not to use smaller languages, they use the most used languages for which there are many online tutorials. D has to focus on those bases that are not covered by other languages.
I'm an average Joe BTW. When was the last time you met an average Joe? 😀


>
>> Given enough time, DMD will get ARM support.
>
> I hope people don't waste resources on adding ARM support, a moving target that has to be maintained. That time would be better spent on writing a clean high level IR.

Developing with LDC compile time is a huge pain and a big! time sink. So I rather have it be the default until I don't need it anymore. UX first.

There's nothing wrong with having three alternative compilers. Was that the whole point some time back. DMD for development (mostly), LDC/ GCC for release. Sounds perfect to me.


December 19, 2020
On Saturday, 19 December 2020 at 15:22:34 UTC, aberba wrote:
> I'm an average Joe BTW. When was the last time you met an average Joe? 😀

Nah, you are too dedicated to be average ;-).

> There's nothing wrong with having three alternative compilers.

True, but sinking a lot of time into extending and maintaining an outdated backend does not make a lot of sense. It would make more sense to improve on the interface between frontend/backend. Other languages are moving forward, so this project should try to stay nimble...



December 19, 2020
On Saturday, 19 December 2020 at 14:20:45 UTC, aberba wrote:
> On Friday, 18 December 2020 at 00:13:41 UTC, claptrap wrote:
>> On Thursday, 17 December 2020 at 23:16:33 UTC, Walter Bright wrote:
>>> On 12/17/2020 2:02 AM, claptrap wrote:
>>>> And lets be honest if LLVM doesnt support it, it's pretty small potatoes, who's going to go to that kind of effort to add some niche architecture to DMD?
>>>
>>> Win64 was never small potatoes.
>>
>> So some years ago DMD had a single target that LLVM did not, and how does it look today?
>
> For an average D developer, DMD is just the way to go. And the development time is more iterative than release. So DMD speed is a must have for development.
>
> Average Joe needs DMD.

Average Joe doesnt exist.

Dont get me wrong, I agree 100% that fast compile is a very desirable feature. What I disagree with is the idea that DMD gives people the freedom to add support for new architectures that they wouldn't otherwise have.

1. Arm support is probably the most desirable, and yet DMD doesnt have it, because it's a lot of work, and well I dont know personally but it sounds like doing anything with the DMD backend is a bit of a nightmare. IE. Freedom to do something is not the same as the thing actually being done.

2. People could just add it to LLVM if they want i think. Might even be easier to write a whole new backend from scratch, i dont know. IE. Not having DMD doesnt preclude the benefit that Walter claims DMD gives us.






December 19, 2020
On Saturday, 19 December 2020 at 17:15:40 UTC, claptrap wrote:
> On Saturday, 19 December 2020 at 14:20:45 UTC, aberba wrote:
>> On Friday, 18 December 2020 at 00:13:41 UTC, claptrap wrote:
>>> On Thursday, 17 December 2020 at 23:16:33 UTC, Walter Bright wrote:
>>>> On 12/17/2020 2:02 AM, claptrap wrote:
>>>>> And lets be honest if LLVM doesnt support it, it's pretty small potatoes, who's going to go to that kind of effort to add some niche architecture to DMD?
>>>>
>>>> Win64 was never small potatoes.
>>>
>>> So some years ago DMD had a single target that LLVM did not, and how does it look today?
>>
>> For an average D developer, DMD is just the way to go. And the development time is more iterative than release. So DMD speed is a must have for development.
>>
>> Average Joe needs DMD.
>
> Average Joe doesnt exist.
>
> Dont get me wrong, I agree 100% that fast compile is a very desirable feature. What I disagree with is the idea that DMD gives people the freedom to add support for new architectures that they wouldn't otherwise have.
>
> 1. Arm support is probably the most desirable, and yet DMD doesnt have it, because it's a lot of work, and well I dont know personally but it sounds like doing anything with the DMD backend is a bit of a nightmare. IE. Freedom to do something is not the same as the thing actually being done.
>
> 2. People could just add it to LLVM if they want i think. Might even be easier to write a whole new backend from scratch, i dont know. IE. Not having DMD doesnt preclude the benefit that Walter claims DMD gives us.

Writing a new backend would probably be easier.

You definitely can add new architectures to DMD (they're not all that different these days), i.e. the instruction scheduler isn't particularly unreadable, but the dual benefit of having a generic code generator to use in D and a clean backend in DMD is pretty nice.

It's a huge job, though.
December 19, 2020
On 19.12.20 18:15, claptrap wrote:
> 
> 2. People could just add it to LLVM if they want i think. Might even be easier to write a whole new backend from scratch, i dont know. IE. Not having DMD doesnt preclude the benefit that Walter claims DMD gives us.
> 

Building LLVM from scratch takes multiple hours. Building DMD from scratch (including backend) takes _seconds_.

Why is it so hard to believe that this is a benefit that an actual compiler developer might care for? It's exactly the prevalence of this kind of common sense pragmatics that makes D so convenient to use despite all flaws. You lose that if you start adding dependencies on projects that lack it.

Anyway, I think the solution is not to change the default development compiler, it's to get rid of that concept by improving separation of frontend and backends in the frontend development workflow so that it becomes equally convenient to develop frontend patches against every backend. (Though it may be possible to make the case that this would happen more quickly if LLVM or GCC were made the default backend, as it's plausible that the developers of LDC and GDC are more aware of what needs to be done in that department.)
December 19, 2020
On Saturday, 19 December 2020 at 17:40:28 UTC, Timon Gehr wrote:
> On 19.12.20 18:15, claptrap wrote:
>> 
>> 2. People could just add it to LLVM if they want i think. Might even be easier to write a whole new backend from scratch, i dont know. IE. Not having DMD doesnt preclude the benefit that Walter claims DMD gives us.
>> 
>
> Building LLVM from scratch takes multiple hours. Building DMD from scratch (including backend) takes _seconds_.

Why would you?

Wasting effort on ARM when Apple is doing a best of breed for free for LLVM is just silly. It is going to be a moving target, M1 is just the first iteration. Save the resources for something that matters...
December 19, 2020
On Saturday, 19 December 2020 at 17:40:28 UTC, Timon Gehr wrote:
> Why is it so hard to believe that this is a benefit that an actual compiler developer might care for?

Yes, this is important.

I have done patches to dmd myself. It is very quick and accessible.

I've never even tried to compile the others myself before, it is just intimidating. But out of curiosity, I tried to compile ldc just now.

git clone
git submodule init
cmake

OK, it took a full minute to get to this point, but that's OK, it is just setup.

make

... over a minute later:

/home/me/d/dev/ldc/gen/passes/GarbageCollect2Stack.cpp: In function ‘void RemoveCall(LLCallBasePtr, const {anonymous}::Analysis&)’:
/home/me/d/dev/ldc/gen/passes/GarbageCollect2Stack.cpp:446:35: error: conversion from ‘LLCallBasePtr’ {aka ‘llvm::CallBase*’} to ‘llvm::CallSite’ is ambiguous
  446 |     A.CGNode->removeCallEdgeFor(CB);


yada yada yada.


I have no idea what any of this means, maybe the llvm version on my box (8.0.1) is too old, but with dmd, it USED to be that things would just work. It isn't *that* nice anymore, but it still isn't too hard. Way faster and much less scary = more likely to get new dev work done.

December 19, 2020
On Saturday, 19 December 2020 at 18:23:19 UTC, Ola Fosheim Grostad wrote:
> On Saturday, 19 December 2020 at 17:40:28 UTC, Timon Gehr wrote:
>> On 19.12.20 18:15, claptrap wrote:
>>> 
>>> 2. People could just add it to LLVM if they want i think. Might even be easier to write a whole new backend from scratch, i dont know. IE. Not having DMD doesnt preclude the benefit that Walter claims DMD gives us.
>>> 
>>
>> Building LLVM from scratch takes multiple hours. Building DMD from scratch (including backend) takes _seconds_.
>
> Why would you?
>
> Wasting effort on ARM when Apple is doing a best of breed for free for LLVM is just silly. It is going to be a moving target, M1 is just the first iteration. Save the resources for something that matters...

You realise that that 80% (450k overall, backend is 90k) of the code in has nothing to do with the code generation.

Apple are also pretty reticent to upstream stuff to LLVM but that doesn't really matter because the dmd backend isn't and shouldn't be complicated enough to need that information.