Thread overview
Is there a GDC solution that can substitute rdmd ? Something like #!/usr/bin/gdc
Jun 27, 2019
wjoe
Jun 30, 2019
Johannes Pfau
Jul 02, 2019
wjoe
June 27, 2019
Hi,

since D is now a GCC built-in D appears as a nice replacement for shell scripts.

I'm *not* looking for a dub solution as dub is something that needs to be installed.

A web search found a wrapper script for GCC which imitates rdmd for C but something like that still isn't out of the box experience.

So, is there a GDC solution that can substitute rdmd ?

Something like:

#!/usr/bin/gdc

int main()
{
//...
}

June 30, 2019
Am Thu, 27 Jun 2019 17:11:36 +0000 schrieb wjoe:

> Hi,
> 
> since D is now a GCC built-in D appears as a nice replacement for shell scripts.
> 
> I'm *not* looking for a dub solution as dub is something that needs to be installed.
> 
> A web search found a wrapper script for GCC which imitates rdmd for C but something like that still isn't out of the box experience.
> 
> So, is there a GDC solution that can substitute rdmd ?
> 
> Something like:
> 
> #!/usr/bin/gdc
> 
> int main()
> {
> //...
> }

Shouldn't rdmd somehow work with other compilers as well? Maybe you'll also need gdmd though, so that rdmd calls gdmd which then calls gdc. But I think more recent dmd versions also support #!/bin/dmd without rdmd, so maybe our gdmd should also support #!/bin/gdmd usage.

Neither gdmd nor rdmd are shipped with gdc though in most distributions, so none of these solutions are out-of-the-box. I think we need to make sure that gdmd gets cleaned up and packaged by all linux distributions. Iit will likely still be in a different package in most linux distributions though.

-- 
Johannes
July 02, 2019
On Sunday, 30 June 2019 at 09:38:01 UTC, Johannes Pfau wrote:
> Am Thu, 27 Jun 2019 17:11:36 +0000 schrieb wjoe:
>
>> Hi,
>> 
>> since D is now a GCC built-in D appears as a nice replacement for shell scripts.
>> 
>> I'm *not* looking for a dub solution as dub is something that needs to be installed.
>> 
>> A web search found a wrapper script for GCC which imitates rdmd for C but something like that still isn't out of the box experience.
>> 
>> So, is there a GDC solution that can substitute rdmd ?
>> 
>> Something like:
>> 
>> #!/usr/bin/gdc
>> 
>> int main()
>> {
>> //...
>> }
>
> Shouldn't rdmd somehow work with other compilers as well? Maybe you'll also need gdmd though, so that rdmd calls gdmd which then calls gdc. But I think more recent dmd versions also support #!/bin/dmd without rdmd, so maybe our gdmd should also support #!/bin/gdmd usage.
>
> Neither gdmd nor rdmd are shipped with gdc though in most distributions, so none of these solutions are out-of-the-box. I think we need to make sure that gdmd gets cleaned up and packaged by all linux distributions. Iit will likely still be in a different package in most linux distributions though.

Hello,

On Gentoo, all of those are in the dlang overlay. But I was trying to avoid that.
I guess a --run option for gcc wouldn't be too bad, so this would be supported by all the languages gcc supports :)

anyways, thanks for your reply.