Thread overview
Help me get GDC as a syntax checker option for Flycheck
Nov 15, 2014
Koz Ross
Nov 15, 2014
ketmar
Nov 15, 2014
ketmar
Nov 15, 2014
Iain Buclaw
Nov 16, 2014
Koz Ross
Nov 16, 2014
Iain Buclaw
Nov 16, 2014
Koz Ross
Nov 16, 2014
Iain Buclaw
Nov 16, 2014
Koz Ross
Nov 15, 2014
Iain Buclaw
November 15, 2014
First-off, I would like to thank everyone who made GDC - as a supporter of free software, it's good to have a compiler that doesn't have a proprietary back-end for a language I like as much as D.

Now, I'm an avid Emacs user, and as part of that, I use Flycheck for syntax checking. The default syntax checker for Flycheck (which relies on external programs) is DMD. Not being happy with this state of affairs, I decided to write some Elisp to allow GDC to be used instead, and I'm happy to say that it works.

Obviously, in the spirit of sharing and helping others, I would like my checker code to be included into Flycheck. However, the maintainer of Flycheck basically said that, unless given concrete reasons *other* than licensing, he would not include it.

Now, I'm not too familiar with the linting/error reporting capabilities of GDC as opposed to DMD, and would like some help in this regard. If any of you could tell me any benefits to linting, error-checking or anything similar in GDC as opposed to DMD, I would be very grateful, and it would help support a free software compiler in a very good Emacs package.

Thank you in advance.
November 15, 2014
On Sat, 15 Nov 2014 13:39:52 +0000
"Koz Ross via D.gnu" <d.gnu@puremagic.com> wrote:

> First-off, I would like to thank everyone who made GDC - as a supporter of free software, it's good to have a compiler that doesn't have a proprietary back-end for a language I like as much as D.
> 
> Now, I'm an avid Emacs user, and as part of that, I use Flycheck for syntax checking. The default syntax checker for Flycheck (which relies on external programs) is DMD. Not being happy with this state of affairs, I decided to write some Elisp to allow GDC to be used instead, and I'm happy to say that it works.
> 
> Obviously, in the spirit of sharing and helping others, I would like my checker code to be included into Flycheck. However, the maintainer of Flycheck basically said that, unless given concrete reasons *other* than licensing, he would not include it.
> 
> Now, I'm not too familiar with the linting/error reporting capabilities of GDC as opposed to DMD, and would like some help in this regard. If any of you could tell me any benefits to linting, error-checking or anything similar in GDC as opposed to DMD, I would be very grateful, and it would help support a free software compiler in a very good Emacs package.
> 
> Thank you in advance.
as GDC and DMD both using the same backend (despite the version differences, of course), there is nothing that one of them doing better than other.

but the license issue *matters*. there is no fsckin' chance, for example, for DMD to be included in something except "non-free" repository for distro. so not allowing GDC is a blocker for those who prefers only FOSS software. if flycheck author can't grok this, it's a perfect reason to drop flycheck, as a tool that is hostile to FOSS.


November 15, 2014
On Sat, 15 Nov 2014 13:39:52 +0000
"Koz Ross via D.gnu" <d.gnu@puremagic.com> wrote:

s/backend/frontend/ of course. sorry.


November 15, 2014
On 15 November 2014 13:39, Koz Ross via D.gnu <d.gnu@puremagic.com> wrote:
> First-off, I would like to thank everyone who made GDC - as a supporter of free software, it's good to have a compiler that doesn't have a proprietary back-end for a language I like as much as D.
>
> Now, I'm an avid Emacs user, and as part of that, I use Flycheck for syntax checking. The default syntax checker for Flycheck (which relies on external programs) is DMD. Not being happy with this state of affairs, I decided to write some Elisp to allow GDC to be used instead, and I'm happy to say that it works.
>
> Obviously, in the spirit of sharing and helping others, I would like my checker code to be included into Flycheck. However, the maintainer of Flycheck basically said that, unless given concrete reasons *other* than licensing, he would not include it.
>

Ask him why there is support for gcc and clang in flycheck then?  I mean if you support one c++ compiler, it's pointless to support another...
November 15, 2014
On 15 November 2014 13:47, ketmar via D.gnu <d.gnu@puremagic.com> wrote:
> On Sat, 15 Nov 2014 13:39:52 +0000
> "Koz Ross via D.gnu" <d.gnu@puremagic.com> wrote:
>
>> First-off, I would like to thank everyone who made GDC - as a supporter of free software, it's good to have a compiler that doesn't have a proprietary back-end for a language I like as much as D.
>>
>> Now, I'm an avid Emacs user, and as part of that, I use Flycheck for syntax checking. The default syntax checker for Flycheck (which relies on external programs) is DMD. Not being happy with this state of affairs, I decided to write some Elisp to allow GDC to be used instead, and I'm happy to say that it works.
>>
>> Obviously, in the spirit of sharing and helping others, I would like my checker code to be included into Flycheck. However, the maintainer of Flycheck basically said that, unless given concrete reasons *other* than licensing, he would not include it.
>>
>> Now, I'm not too familiar with the linting/error reporting capabilities of GDC as opposed to DMD, and would like some help in this regard. If any of you could tell me any benefits to linting, error-checking or anything similar in GDC as opposed to DMD, I would be very grateful, and it would help support a free software compiler in a very good Emacs package.
>>
>> Thank you in advance.
> as GDC and DMD both using the same backend (despite the version differences, of course), there is nothing that one of them doing better than other.
>

Same frontend.  And even then there are some crucial differences on ABI level.
November 16, 2014
On Saturday, 15 November 2014 at 14:53:13 UTC, Iain Buclaw via
D.gnu wrote:
>
>
> Ask him why there is support for gcc and clang in flycheck then?  I
> mean if you support one c++ compiler, it's pointless to support
> another...

His response, quoted verbatim:

> Clang provides better diagnostics than most GCC versions and is the default on > OS X, whereas GCC supports more architectures, which is important when writing > architecture-specific code that would otherwise be hidden behind ifdefs.

I think for the moment, I'm just going put my code on my blog
(which I will link to if anyone is interested), since I'm clearly
not going to convince him.
November 16, 2014
On 16 Nov 2014 21:40, "Koz Ross via D.gnu" <d.gnu@puremagic.com> wrote:
>
> On Saturday, 15 November 2014 at 14:53:13 UTC, Iain Buclaw via
>
> D.gnu wrote:
>>
>>
>>
>> Ask him why there is support for gcc and clang in flycheck then?  I mean if you support one c++ compiler, it's pointless to support another...
>
>
> His response, quoted verbatim:
>
>> Clang provides better diagnostics than most GCC versions and is the
default on > OS X, whereas GCC supports more architectures, which is important when writing > architecture-specific code that would otherwise be hidden behind ifdefs.
>

And he has answered your question for you. :)

Only change C's ifdef with D's version.


November 16, 2014
On Sunday, 16 November 2014 at 21:51:18 UTC, Iain Buclaw via D.gnu wrote:
> On 16 Nov 2014 21:40, "Koz Ross via D.gnu" <d.gnu@puremagic.com> wrote:
>
> And he has answered your question for you. :)
>
> Only change C's ifdef with D's version.

I'll say exactly that - thanks Iain! For the moment, the code to make Flycheck do its thing with GDC is available on my blog at http://www.retro-freedom.nz/blog/2014/11/17/using-gdc-as-a-syntax-checker-for-d-in-flycheck/ for those who are interested.
November 16, 2014
On 16 Nov 2014 22:20, "Koz Ross via D.gnu" <d.gnu@puremagic.com> wrote:
>
> On Sunday, 16 November 2014 at 21:51:18 UTC, Iain Buclaw via D.gnu wrote:
>>
>> On 16 Nov 2014 21:40, "Koz Ross via D.gnu" <d.gnu@puremagic.com> wrote:
>>
>> And he has answered your question for you. :)
>>
>> Only change C's ifdef with D's version.
>
>
> I'll say exactly that - thanks Iain!

It's really not something worth too much bother with if he has already made up his mind.  A software maintainer can't accept everything.  Eg: requests to include support for erlang, vala, dmc++...  You've got to draw the line somewhere.  Just a shame he didn't go for ldc+gdc (being Clang and GCC backed) over dmd.

> For the moment, the code to make Flycheck do its thing with GDC is
available on my blog at http://www.retro-freedom.nz/blog/2014/11/17/using-gdc-as-a-syntax-checker-for-d-in-flycheck/ for those who are interested.

Maybe put it up on github as a spork?

Though it seems quite simple the addition. :)


November 16, 2014
On Sunday, 16 November 2014 at 22:33:31 UTC, Iain Buclaw via D.gnu wrote:
>
> It's really not something worth too much bother with if he has already made
> up his mind.  A software maintainer can't accept everything.  Eg: requests
> to include support for erlang, vala, dmc++...  You've got to draw the line
> somewhere.  Just a shame he didn't go for ldc+gdc (being Clang and GCC
> backed) over dmd.
>

He has said that, given a better reason that licensing alone, he *would* include it, so hence why I'm bothering with this whole thing. I suspect that he doesn't care much about 'free as in freedom' software, though, so I'm only *cautiously* optimistic.

>
> Maybe put it up on github as a spork?
>
> Though it seems quite simple the addition. :)

Yeah - it's basically like 20ish lines of Elisp, so I figure just having it on my blog would be enough for now. Plus, I'm sad to say that I actually don't know the sporking process in Git - my knowledge of programming matters is rather patchy.