On Thu, 2016-01-07 at 15:32 -0500, Andrei Alexandrescu via Digitalmars- d wrote: > On 01/07/2016 02:02 PM, Russel Winder via Digitalmars-d wrote: […] > > Got it, thanks. I took a look at a familiar topic - json grammars. > > I just googled `boost spirit json` and followed through the top > result. > For C++, the grammar definition would be > https://github.com/cierelabs/json_spirit/blob/master/ciere/json/parse > r/grammar_def.hpp. > > Then I googled `pegged json` and the top result led to > https://github.com/PhilippeSigaud/Pegged/blob/master/pegged/examples/ > json.d. > > Which do you like more?
Just a quick look I'm afraid, so very superficial at this stage: The D code as presented is clearly simpler and easy to read. However the D grammar is a string and not code so the anticipation is that errors in the C++ code would be easier to find and correct. I guess the question here is how good the compile time evaluation of strings is in D and does it do good error reporting. I still prefer the concept of Internal DSL explicitly in the code rather than in strings just now, but this may still just be prejudice. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected] 41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected] London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
