Thread overview
Initial release of Goldie: GOLD Parser Engine for D
Aug 26, 2009
Nick Sabalausky
Aug 28, 2009
Nick Sabalausky
Aug 28, 2009
Leandro Lucarella
Aug 28, 2009
Nick Sabalausky
Re: Initial release of Goldie: GOLD Parser Engine for D (Now with Prepackaged Downloads)
Sep 01, 2009
Nick Sabalausky
August 26, 2009
First release of Goldie is now available on DSource. http://www.dsource.org/projects/goldie

Goldie (pronounced "goal D") is a GOLD Engine for D. It gives D developers the ability to easily load, lex and parse a text/source file according to any grammar defined using the excellent GOLD Parser Builder tool ( http://www.devincook.com/goldparser/ ).

Alternatively, Goldie can be used to merely load a GOLD .cgt file ("Compiled Grammar Table") if you would like to create your own GOLD lexer/parser.

Goldie is currently at it's first release, v0.01. It is fully-usable and has been tested on both Windows and Linux, although the API is still subject to change. Goldie is licensed under The zlib/libpng License.


August 28, 2009
Nick Sabalausky escribió:
> First release of Goldie is now available on DSource.
> http://www.dsource.org/projects/goldie
> 
> Goldie (pronounced "goal D") is a GOLD Engine for D. It gives D developers the ability to easily load, lex and parse a text/source file according to any grammar defined using the excellent GOLD Parser Builder tool ( http://www.devincook.com/goldparser/ ).
> 
> Alternatively, Goldie can be used to merely load a GOLD .cgt file ("Compiled Grammar Table") if you would like to create your own GOLD lexer/parser.
> 
> Goldie is currently at it's first release, v0.01. It is fully-usable and has been tested on both Windows and Linux, although the API is still subject to change. Goldie is licensed under The zlib/libpng License.

I googled for GOLD vs ANTLR and only found a thread five years ago that stated ANTLR was better if you wanted the full kitchen sink, and GOLD was just a bunch of hacks.

Has somebody a link to a more recent comparison or do I have to write my own homework?
August 28, 2009
"Grzegorz Adam Hankiewicz" <gradha@titanium.sabren.com> wrote in message news:h78ojv$duj$1@digitalmars.com...
>
> I googled for GOLD vs ANTLR and only found a thread five years ago that stated ANTLR was better if you wanted the full kitchen sink, and GOLD was just a bunch of hacks.
>
> Has somebody a link to a more recent comparison or do I have to write my own homework?

You're right, it does seem to be hard to find a good comparison of the two. Here's what I was able to find:

Another one a few years old: http://www.antlr.org/pipermail/antlr-interest/2004-October/009730.html

Newer, but somewhat one-sided in favor of GOLD: http://books.slashdot.org/comments.pl?sid=566251&cid=23579953

Includes a lot of other parser generators: http://en.wikipedia.org/wiki/Comparison_of_parser_generators#Context-free_languages

I have only very limited experience with ANTLR, and I've spent much more time with GOLD (Which I personally prefer, as you can probably tell from the fact that I wrote a GOLD engine ;) ), but here's my best attempt at an accurate neutral comparison:

[Neutral?] - GOLD is LALR and ANTLR is LL(*) (For whatever that information is worth....You could probably find an LALR vs LL(*) comparison somewhere.)

[Pro ANTLR] - ANTLR is open-source and cross-platform (because it runs on the JVM). But, GOLD is only available on Windows (although it might work on wine, I haven't tried) and doesn't have any released source (although it is freeware). However, FWIW, I do intend to make and release an open-source cross-platform equivalent to GOLD (fully-compatible with GOLD, of course).

[Pro ANTLR] - ANTLR's grammar definition syntax includes certain bells and whistles that GOLD doesn't have, like extensive rewrite rules (with GOLD, you have to do rewrites yourself in your app).

[Pro GOLD] - I personally find ANTLR very difficult to learn as it's documentation seems to be quite poor. GOLD has very good documentation (although that's probably to be expected since GOLD seems to be much simpler).

[Pro ANTLR] - ANTLR seems to be much more popular and more heavily used. Sometimes a large user base can be good.

[Pro GOLD] - GOLD has much better support for various host languages (by that I mean languages that can be used to write the programs that will parse/manipulate the generated grammars). GOLD already supports far more host languages than ANTLR, and I'm certain this is because adding support for a host language is far easier in GOLD. Also, there's no ANTLR for D (I tried a while ago, but gave up since it was such a huge painful undertaking, I basically would have had to port an entire production-level Java app to D).

[Neutral] - With GOLD, host language is completely separated from grammar. This allows for far more flexibility (see some of the items below) and it makes the grammars much more reusable, but the cost is that you lose the convenience of being able to embed code directly into your grammar.

[Pro GOLD] - Since ANTLR wants to convert all it's grammars directly to lexer/parser source code, it's not a good choice for programs that need to be able to work with grammars that the *users* of your program generate. For example, I used GOLD to write a program that outputs the parse tree of any source file written in any GOLD grammar. An equivalent ANTLR program would have been far more difficult to create and to use.

[Pro GOLD] - Both GOLD and ANTLR come with GUI tools to help build grammars, but ANTLR's official GUI tool only works with grammars that have embedded Java (ie, grammars that are designed to be generated into a Java app, and not any other host language.) Because of GOLD's language-neutrality, it's GUI tool is helpful regardless of your desired host app.

[Pro ANTLR?] - GOLD's GUI tool *is* GOLD, and so (unless I'm mistaken) you can't use it as a command-line app (but I've found compiling grammars with it to be very painless, anyway). I *think* ANTLR can be used command-line. (But again, FWIW, I do intend to create an GOLD-compatible program that will work on the command line)

[Neutral] - ANTLR's GUI tool is probably a little more fully-featured (although maybe doesn't provide quite as detailed information, but then, maybe it doesn't need to), but in my experience, it's also very sluggish and resource-intensive.


August 28, 2009
Nick Sabalausky, el 28 de agosto a las 16:47 me escribiste:
> [Pro ANTLR?] - GOLD's GUI tool *is* GOLD, and so (unless I'm mistaken) you can't use it as a command-line app (but I've found compiling grammars with it to be very painless, anyway). I *think* ANTLR can be used command-line. (But again, FWIW, I do intend to create an GOLD-compatible program that will work on the command line)

I don't know if you has seen Gazelle. It goal is similar to GOLD, to be able to reuse the grammars easily. It's C and still in development (it doesn't have any tools to write grammars or anything) but looks promising.

http://www.reverberate.org/gazelle/

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Are you nervy, irritable, depressed, tired of life.
Keep it up.
	-- Monty Python
August 28, 2009
"Leandro Lucarella" <llucax@gmail.com> wrote in message news:20090828211541.GA31527@homero.springfield.home...
> Nick Sabalausky, el 28 de agosto a las 16:47 me escribiste:
>> [Pro ANTLR?] - GOLD's GUI tool *is* GOLD, and so (unless I'm mistaken)
>> you
>> can't use it as a command-line app (but I've found compiling grammars
>> with
>> it to be very painless, anyway). I *think* ANTLR can be used
>> command-line.
>> (But again, FWIW, I do intend to create an GOLD-compatible program that
>> will
>> work on the command line)
>
> I don't know if you has seen Gazelle. It goal is similar to GOLD, to be able to reuse the grammars easily. It's C and still in development (it doesn't have any tools to write grammars or anything) but looks promising.
>
> http://www.reverberate.org/gazelle/
>

Interesting, thanks for the link. That does sound similar to what I want to do, just that I'm doing it in D and using GOLD as a starting point and growing from there. Be interesting to see how both turn out.


August 29, 2009
Nick Sabalausky escribió:
> I have only very limited experience with ANTLR, and I've spent much more time with GOLD (Which I personally prefer, as you can probably tell from the fact that I wrote a GOLD engine ;) ), but here's my best attempt at an accurate neutral comparison:  [...]

Thank you very much for the detailed answer. Soon I was going to dive into ANTLR and didn't even know the existance of GOLD. Will take a look at it as I want to favour development in D.
September 01, 2009
"Nick Sabalausky" <a@a.a> wrote in message news:h7341p$id1$1@digitalmars.com...
> First release of Goldie is now available on DSource. http://www.dsource.org/projects/goldie
>
> Goldie (pronounced "goal D") is a GOLD Engine for D. It gives D developers the ability to easily load, lex and parse a text/source file according to any grammar defined using the excellent GOLD Parser Builder tool ( http://www.devincook.com/goldparser/ ).
>
> Alternatively, Goldie can be used to merely load a GOLD .cgt file ("Compiled Grammar Table") if you would like to create your own GOLD lexer/parser.
>
> Goldie is currently at it's first release, v0.01. It is fully-usable and has been tested on both Windows and Linux, although the API is still subject to change. Goldie is licensed under The zlib/libpng License.
>

Prepackaged downloadable archives (that also include the required SemiTwist D Tools) are now available (in .zip, .7z, and .tar.bz2 formats) for anyone who doesn't have or want to use subversion:

http://www.dsource.org/projects/goldie/browser/downloads

The .7z format is highly recommended (for all OSes) because it's roughly one-quarter (!) the size of the others.