www.digitalmars.com         C & C++   DMDScript  

D.gnu - Help me get GDC as a syntax checker option for Flycheck

reply "Koz Ross" <koz.ross runbox.com> writes:
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.
Nov 15 2014
next sibling parent "ketmar via D.gnu" <d.gnu puremagic.com> writes:
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=20
 supporter of free software, it's good to have a compiler that=20
 doesn't have a proprietary back-end for a language I like as much=20
 as D.
=20
 Now, I'm an avid Emacs user, and as part of that, I use Flycheck=20
 for syntax checking. The default syntax checker for Flycheck=20
 (which relies on external programs) is DMD. Not being happy with=20
 this state of affairs, I decided to write some Elisp to allow GDC=20
 to be used instead, and I'm happy to say that it works.
=20
 Obviously, in the spirit of sharing and helping others, I would=20
 like my checker code to be included into Flycheck. However, the=20
 maintainer of Flycheck basically said that, unless given concrete=20
 reasons *other* than licensing, he would not include it.
=20
 Now, I'm not too familiar with the linting/error reporting=20
 capabilities of GDC as opposed to DMD, and would like some help=20
 in this regard. If any of you could tell me any benefits to=20
 linting, error-checking or anything similar in GDC as opposed to=20
 DMD, I would be very grateful, and it would help support a free=20
 software compiler in a very good Emacs package.
=20
 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.
Nov 15 2014
prev sibling next sibling parent "ketmar via D.gnu" <d.gnu puremagic.com> writes:
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.
Nov 15 2014
prev sibling next sibling parent reply "Iain Buclaw via D.gnu" <d.gnu puremagic.com> writes:
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...
Nov 15 2014
parent reply "Koz Ross" <koz.ross runbox.com> writes:
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.
Nov 16 2014
parent reply "Iain Buclaw via D.gnu" <d.gnu puremagic.com> writes:
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.
Nov 16 2014
parent reply "Koz Ross" <koz.ross runbox.com> writes:
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-checke -for-d-in-flycheck/ for those who are interested.
Nov 16 2014
parent reply "Iain Buclaw via D.gnu" <d.gnu puremagic.com> writes:
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. :)
Nov 16 2014
parent "Koz Ross" <koz.ross runbox.com> writes:
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.
Nov 16 2014
prev sibling parent "Iain Buclaw via D.gnu" <d.gnu puremagic.com> writes:
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.
Nov 15 2014