Re: FancyPars
Nice one, thanks for the info. I just used Pegged to generate an API for a JSON REST service at compile time so I'm still geeking out about the power of D at compile time, but I'm always interested in parsers. On Mon, Sep 14, 2015 at 10:50 AM, Bastiaan Veelo via Digitalmars-d-announcewrote: > On Monday, 6 July 2015 at 09:22:51 UTC, Per Nordlöw wrote: > >> >> How does its design and use differ from Pegged? >> > > FWIW, this is what I learned from my first acquaintance with FancyPars > (the OP having signalled not to be available for questions). My conclusions > may be wrong though. > > Running dub produces a vibe.d web server demonstrating the capabilities of > FancyPars. This was a bit confusing at first because being a web-app seemed > central to the design of FancyPars, but I think it is not. Anyway, the > first page shows a large edit field containing an example grammar, and a > button "Generate AST". Clicking this button brings up the second page > containing D code for the lexer and parser for the given grammar, type > definitions for the nodes of the AST, as well as code for printing the AST. > > Understanding the source of FancyPars is challenging because the core > source, example vibe.d application source and supporting code, as well as > generated lexer/parser code are all contained in the same directory and > committed in the repository. > > The syntax for the grammar definition is different from Pegged, and seems > to be inspired by D. It supports a hierarchical structure. It looks > powerful, but is undocumented. The example grammar looks like this: > > ASTNode { > Identifier @internal { > [a-zA-Z_][] identifier > } > > Group @parent { > Identifier name, ? "@" : Identifier[] annotations : "@", "{", > PatternElement[] elements : "," / Group[] groups, > "}" > } > > PatternElement @internal { > > AlternativeElement @noFirst { > PatternElement[] alternatives : "/" > } > > LexerElement { > > StringElement { > "\"", char[] string_, "\"" > } > > NamedChar { > "char", ? "[]" : bool isArray, Identifier name > } > > CharRange @internal { > char rangeBegin, ? "-" : char RangeEnd > } > > RangeElement { > "[", CharRange[] ranges, "]" > } > > LookbehindElement { > "?lb", "(", StringElement str, ")" > } > > NotElement { > "!", LexerElement ce > } > > } > > NamedElement { > Identifier type, ? "[]" : bool isArray, Identifier name, > ? bool isArray : ? ":" : StringElement lst_sep > } > > ParenElement { > "(", PatternElement[] elements : ",", ")" > } > > FlagElement { > "bool", Identifier flag_name > } > > QueryElement { > "?", "bool", Identifier flag_name, ":", PatternElement elem > } > > OptionalElement { > "?", LexerElement[] ce : ",", ":", PatternElement elem > } > > } > } > > > Its announced support for left-recursion is interesting, and I may decide > to play a bit further with it. My objective would be to see if an Extended > Pascal to D translating compiler would be feasible. > > Cheers, > Bastiaan Veelo. >
Beta D 2.068.2-b2
The second beta for the 2.068.2 point release fixes an regression with destroy that could result in a memory leak [¹]. http://downloads.dlang.org/pre-releases/2.x/2.068.2/ -Martin [¹]: https://issues.dlang.org/show_bug.cgi?id=15044
Re: Release D 2.068.1
On Monday, 14 September 2015 at 17:51:59 UTC, Martin Nowak wrote: What platform are you on? I'm on OS X, using the homebrew version of DMD. And homebrew is telling me that I have 2.068.1 installed $ brew install dmd Warning: dmd-2.068.1 already installed $ dmd --version DMD64 D Compiler v2.068 Copyright (c) 1999-2015 by Digital Mars written by Walter Bright And if I check $ which dmd /usr/local/bin/dmd Then if I check the link /usr/local/bin/dmd -> ../Cellar/dmd/2.068.1/bin/dmd
Re: Release D 2.068.1
On Monday, 14 September 2015 at 20:14:45 UTC, Jack Stouffer wrote: On Monday, 14 September 2015 at 17:51:59 UTC, Martin Nowak wrote: What platform are you on? I'm on OS X, using the homebrew version of DMD. And homebrew is telling me that I have 2.068.1 installed $ brew install dmd Warning: dmd-2.068.1 already installed $ dmd --version DMD64 D Compiler v2.068 Copyright (c) 1999-2015 by Digital Mars written by Walter Bright And if I check $ which dmd /usr/local/bin/dmd Then if I check the link /usr/local/bin/dmd -> ../Cellar/dmd/2.068.1/bin/dmd Yeah, I get this too. Same with 2.068.2-b2
Re: Release D 2.068.1
On Monday, 14 September 2015 at 20:14:45 UTC, Jack Stouffer wrote: On Monday, 14 September 2015 at 17:51:59 UTC, Martin Nowak wrote: What platform are you on? I'm on OS X, using the homebrew version of DMD. And homebrew is telling me that I have 2.068.1 installed Well I guess it's a bug in the homebrew script then. Nobody is setting the VERSION file and there is no git repo to query. https://github.com/Homebrew/homebrew/blob/f8b0ff3ef63e60a1da17ec8d8e68d949b1cebc27/Library/Formula/dmd.rb#L50
Re: Release D 2.068.1
On Thursday, 10 September 2015 at 17:46:53 UTC, Jack Stouffer wrote: Well, it's a little too late, but the compiler outputs the wrong version: $ dmd --version DMD64 D Compiler v2.068 Copyright (c) 1999-2015 by Digital Mars written by Walter Bright It does work for me and the build seems fine as well. https://github.com/D-Programming-Language/installer/blob/c6f8648e56ca58e1cad65a441e2d765ca96f1da0/create_dmd_release/build_all.d#L345 What platform are you on?
Re: FancyPars
On Monday, 6 July 2015 at 09:22:51 UTC, Per Nordlöw wrote: How does its design and use differ from Pegged? FWIW, this is what I learned from my first acquaintance with FancyPars (the OP having signalled not to be available for questions). My conclusions may be wrong though. Running dub produces a vibe.d web server demonstrating the capabilities of FancyPars. This was a bit confusing at first because being a web-app seemed central to the design of FancyPars, but I think it is not. Anyway, the first page shows a large edit field containing an example grammar, and a button "Generate AST". Clicking this button brings up the second page containing D code for the lexer and parser for the given grammar, type definitions for the nodes of the AST, as well as code for printing the AST. Understanding the source of FancyPars is challenging because the core source, example vibe.d application source and supporting code, as well as generated lexer/parser code are all contained in the same directory and committed in the repository. The syntax for the grammar definition is different from Pegged, and seems to be inspired by D. It supports a hierarchical structure. It looks powerful, but is undocumented. The example grammar looks like this: ASTNode { Identifier @internal { [a-zA-Z_][] identifier } Group @parent { Identifier name, ? "@" : Identifier[] annotations : "@", "{", PatternElement[] elements : "," / Group[] groups, "}" } PatternElement @internal { AlternativeElement @noFirst { PatternElement[] alternatives : "/" } LexerElement { StringElement { "\"", char[] string_, "\"" } NamedChar { "char", ? "[]" : bool isArray, Identifier name } CharRange @internal { char rangeBegin, ? "-" : char RangeEnd } RangeElement { "[", CharRange[] ranges, "]" } LookbehindElement { "?lb", "(", StringElement str, ")" } NotElement { "!", LexerElement ce } } NamedElement { Identifier type, ? "[]" : bool isArray, Identifier name, ? bool isArray : ? ":" : StringElement lst_sep } ParenElement { "(", PatternElement[] elements : ",", ")" } FlagElement { "bool", Identifier flag_name } QueryElement { "?", "bool", Identifier flag_name, ":", PatternElement elem } OptionalElement { "?", LexerElement[] ce : ",", ":", PatternElement elem } } } Its announced support for left-recursion is interesting, and I may decide to play a bit further with it. My objective would be to see if an Extended Pascal to D translating compiler would be feasible. Cheers, Bastiaan Veelo.