Thread overview | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
September 01, 2018 DMD cross compiler | ||||
---|---|---|---|---|
| ||||
I know there's been discussion on this before, I just want a definitive reference. It looks like it would be relatively straight forward for DMD to be a cross-compiler. A few version() statements could be runtime if's, and that's pretty much it. When hacking on parts of DMD, I frequently make hacks that turn such versions into runtime if's to test multiple targets from the one dev workflow. It would be about 100 times more convenient to supply an arg, than make hacks all over the code... so, why not? |
September 02, 2018 Re: DMD cross compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | On Saturday, 1 September 2018 at 20:12:24 UTC, Manu wrote:
> I know there's been discussion on this before, I just want a definitive reference.
>
> It looks like it would be relatively straight forward for DMD to be a
> cross-compiler.
> A few version() statements could be runtime if's, and that's pretty much it.
> When hacking on parts of DMD, I frequently make hacks that turn such
> versions into runtime if's to test multiple targets from the one dev
> workflow.
>
> It would be about 100 times more convenient to supply an arg, than make hacks all over the code... so, why not?
What specifically do you want to cross-compile to, something like Windows to macOS? LDC already does all this, ie the one compiler cross-compiles to every other platform with a single flag, may just want to use it.
|
September 01, 2018 Re: DMD cross compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joakim | On Sat, 1 Sep 2018 at 18:55, Joakim via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> On Saturday, 1 September 2018 at 20:12:24 UTC, Manu wrote:
> > I know there's been discussion on this before, I just want a definitive reference.
> >
> > It looks like it would be relatively straight forward for DMD
> > to be a
> > cross-compiler.
> > A few version() statements could be runtime if's, and that's
> > pretty much it.
> > When hacking on parts of DMD, I frequently make hacks that turn
> > such
> > versions into runtime if's to test multiple targets from the
> > one dev
> > workflow.
> >
> > It would be about 100 times more convenient to supply an arg, than make hacks all over the code... so, why not?
>
> What specifically do you want to cross-compile to, something like Windows to macOS? LDC already does all this, ie the one compiler cross-compiles to every other platform with a single flag, may just want to use it.
Yes, but we're talking about DMD...
|
September 03, 2018 Re: DMD cross compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | On Saturday, 1 September 2018 at 20:12:24 UTC, Manu wrote:
> I know there's been discussion on this before, I just want a definitive reference.
>
> It looks like it would be relatively straight forward for DMD to be a
> cross-compiler.
> A few version() statements could be runtime if's, and that's pretty much it.
> When hacking on parts of DMD, I frequently make hacks that turn such
> versions into runtime if's to test multiple targets from the one dev
> workflow.
>
> It would be about 100 times more convenient to supply an arg, than make hacks all over the code... so, why not?
Yeah, I don't see a reason why DMD should not be a cross-compiler. I've been thinking the same thing as well.
--
/Jacob Carlborg
|
September 03, 2018 Re: DMD cross compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Mon, 3 Sep 2018 at 01:40, Jacob Carlborg via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> On Saturday, 1 September 2018 at 20:12:24 UTC, Manu wrote:
> > I know there's been discussion on this before, I just want a definitive reference.
> >
> > It looks like it would be relatively straight forward for DMD
> > to be a
> > cross-compiler.
> > A few version() statements could be runtime if's, and that's
> > pretty much it.
> > When hacking on parts of DMD, I frequently make hacks that turn
> > such
> > versions into runtime if's to test multiple targets from the
> > one dev
> > workflow.
> >
> > It would be about 100 times more convenient to supply an arg, than make hacks all over the code... so, why not?
>
> Yeah, I don't see a reason why DMD should not be a cross-compiler. I've been thinking the same thing as well.
Not being a cross-compiler makes iteration and testing unnecessarily
hard and slow.
We should try and reduce friction to developing DMD. Not being a
cross-compiler has definitely stopped me on multiple instances on
account of "ah, it's all just too hard!".
|
September 03, 2018 Re: DMD cross compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joakim | On Sunday, 2 September 2018 at 01:52:18 UTC, Joakim wrote:
> On Saturday, 1 September 2018 at 20:12:24 UTC, Manu wrote:
>> I know there's been discussion on this before, I just want a definitive reference.
>>
>> It looks like it would be relatively straight forward for DMD to be a
>> cross-compiler.
>> A few version() statements could be runtime if's, and that's pretty much it.
>> When hacking on parts of DMD, I frequently make hacks that turn such
>> versions into runtime if's to test multiple targets from the one dev
>> workflow.
>>
>> It would be about 100 times more convenient to supply an arg, than make hacks all over the code... so, why not?
>
> What specifically do you want to cross-compile to, something like Windows to macOS? LDC already does all this, ie the one compiler cross-compiles to every other platform with a single flag, may just want to use it.
Not everyone can or want to use LDC.
|
September 03, 2018 Re: DMD cross compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to bauss | On Monday, 3 September 2018 at 09:21:21 UTC, bauss wrote:
> On Sunday, 2 September 2018 at 01:52:18 UTC, Joakim wrote:
>> On Saturday, 1 September 2018 at 20:12:24 UTC, Manu wrote:
>>> [...]
>>
>> What specifically do you want to cross-compile to, something like Windows to macOS? LDC already does all this, ie the one compiler cross-compiles to every other platform with a single flag, may just want to use it.
>
> Not everyone can or want to use LDC.
Why not? If you're not optimizing or iterating on your code, it's a reasonable replacement. If you're optimizing, you should only be using LDC or gdc.
|
September 03, 2018 Re: DMD cross compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joakim | On Mon, 3 Sep 2018 at 02:35, Joakim via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> On Monday, 3 September 2018 at 09:21:21 UTC, bauss wrote:
> > On Sunday, 2 September 2018 at 01:52:18 UTC, Joakim wrote:
> >> On Saturday, 1 September 2018 at 20:12:24 UTC, Manu wrote:
> >>> [...]
> >>
> >> What specifically do you want to cross-compile to, something like Windows to macOS? LDC already does all this, ie the one compiler cross-compiles to every other platform with a single flag, may just want to use it.
> >
> > Not everyone can or want to use LDC.
>
> Why not? If you're not optimizing or iterating on your code, it's a reasonable replacement. If you're optimizing, you should only be using LDC or gdc.
DMD is for iterating on DMD ;)
Making DMD patches in LDC and then pushing upstream is much more of a
hassle. DMD build/iteration time is super fast too.
|
September 03, 2018 Re: DMD cross compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joakim | On Monday, 3 September 2018 at 09:32:29 UTC, Joakim wrote:
> Why not? If you're not optimizing or iterating on your code, it's a reasonable replacement. If you're optimizing, you should only be using LDC or gdc.
What if you want to reproduce a bug that only happens when compiling with dmd for some weird reason ? Or what if you want to use the very latest features from dmd nightlies ?
|
September 03, 2018 Re: DMD cross compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to Laurent Tréguier | On 3 September 2018 at 15:12, Laurent Tréguier via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On Monday, 3 September 2018 at 09:32:29 UTC, Joakim wrote:
>>
>> Why not? If you're not optimizing or iterating on your code, it's a reasonable replacement. If you're optimizing, you should only be using LDC or gdc.
>
>
> What if you want to reproduce a bug that only happens when compiling with dmd for some weird reason ? Or what if you want to use the very latest features from dmd nightlies ?
GDC is kept in sync with dmd nightlies on a weekly or twice-weekly basis.
|
Copyright © 1999-2021 by the D Language Foundation