Re: DScanner is ready for use

2013-07-28 Thread qznc

On Saturday, 27 July 2013 at 22:27:35 UTC, Brian Schott wrote:
DScanner is a tool for analyzing D source code. It has the 
following features:


* Prints out a complete AST of a source file in XML format.
* Syntax checks code and prints warning/error messages
* Prints a listing of modules imported by a source file
* Syntax highlights code in HTML format
* Provides more meaningful line of code count than wc
* Counts tokens in a source file

The lexer/parser/AST are located in the std/d directory in 
the repository. These files should prove useful to anyone else 
working on D tooling.


https://github.com/Hackerpilot/Dscanner

Aside: the D grammar that I reverse-engineered can be located 
here: 
https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html


Great! :)

I do not understand the LoC count, though. The description sounds 
like Number of Statements?


Re: Article: Increasing the D Compiler Speed by Over 75%

2013-07-28 Thread jerro

I've not run across anyone who says my program got
faster! It went from 0.05 Hz to 0.08 Hz!.


People do say my program does 10 X per second, though.


Re: DScanner is ready for use

2013-07-28 Thread Dicebot

On Saturday, 27 July 2013 at 22:27:35 UTC, Brian Schott wrote:
DScanner is a tool for analyzing D source code. It has the 
following features:


* Prints out a complete AST of a source file in XML format.
* Syntax checks code and prints warning/error messages
* Prints a listing of modules imported by a source file
* Syntax highlights code in HTML format
* Provides more meaningful line of code count than wc
* Counts tokens in a source file

The lexer/parser/AST are located in the std/d directory in 
the repository. These files should prove useful to anyone else 
working on D tooling.


https://github.com/Hackerpilot/Dscanner

Aside: the D grammar that I reverse-engineered can be located 
here: 
https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html


Awesome! I hope it won't be forgotten by the time I need it :)

By the way, how far is that std.d.* stuff from ongoing Phobos 
inclusion review?


I suppose currently it does not do any semantical analysis? How 
hard it would be to implement dmd warnings on top of dscanner 
instead?


Re: DScanner is ready for use

2013-07-28 Thread Jacob Carlborg

On Sunday, 28 July 2013 at 12:49:34 UTC, Dicebot wrote:


Awesome! I hope it won't be forgotten by the time I need it :)

By the way, how far is that std.d.* stuff from ongoing Phobos 
inclusion review?


I suppose currently it does not do any semantical analysis? How 
hard it would be to implement dmd warnings on top of dscanner 
instead?


I don't think it's necessary for semantic analysis to be included 
in Phobos. It's enough to start with a lexer, then later add a 
parser and semantic analysis.


--
/Jacob Carlborg


Re: DScanner is ready for use

2013-07-28 Thread Kagamin

On Saturday, 27 July 2013 at 22:27:35 UTC, Brian Schott wrote:
Aside: the D grammar that I reverse-engineered can be located 
here: 
https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html


Does arrayLiteral support stray comma?


Re: DScanner is ready for use

2013-07-28 Thread Kagamin
Also looks like enumBody supports multiple commas with nothing 
between them, but dmd doesn't support it. Sould be

'{' enumMember (',' enumMember)* ','? '}'


Re: DScanner is ready for use

2013-07-28 Thread Kagamin

And arrayLiteral should be
'[' (assignExpression (',' assignExpression)* ','?)? ']'


Re: DScanner is ready for use

2013-07-28 Thread Kagamin

The same for arrayInitializer:
'[' (arrayMemberInitialization (',' arrayMemberInitialization)* 
','?)? ']'


Re: DScanner is ready for use

2013-07-28 Thread Kagamin

Like typedef alias supports multiple declarators.
aliasDeclaration:
'alias' (aliasInitializer (',' aliasInitializer)* | type 
declarator (',' declarator)*) ';'


Also declarator supports initializer, but alias doesn't.
declarator:
Identifier ('=' initializer)?
;

alias int a=1;
Error: alias cannot have initializer


Re: DScanner is ready for use

2013-07-28 Thread Kagamin
Well, knowing the lean and mean way dmd is written, alias 
initializer can be a semantical error rather than syntactical.


Re: DScanner is ready for use

2013-07-28 Thread Dicebot

On Sunday, 28 July 2013 at 13:44:03 UTC, Jacob Carlborg wrote:
I don't think it's necessary for semantic analysis to be 
included in Phobos. It's enough to start with a lexer, then 
later add a parser and semantic analysis.


Those were 2 separate not related questions ;)


Re: phobosx.signal ready

2013-07-28 Thread Kagamin

On Sunday, 21 July 2013 at 11:24:42 UTC, David wrote:
window.single_key_down[JUMP].strongConnect({ physics.jump(); 
});
physics is a class variable, this will blow up once the class 
holding it

is gone


You ask for the weak ref semantics, but as the name suggests, 
strongConnect has the strong ref semantics. In this case the 
closure keep a strong ref to the object with the physics field 
and the signal keeps a strong ref to the closure, so the window 
keeps a strong ref to the object, so it won't be collected.


Re: phobosx.signal ready

2013-07-28 Thread David
Am 28.07.2013 18:39, schrieb Kagamin:
 On Sunday, 21 July 2013 at 11:24:42 UTC, David wrote:
 window.single_key_down[JUMP].strongConnect({ physics.jump(); });
 physics is a class variable, this will blow up once the class holding it
 is gone
 
 You ask for the weak ref semantics, but as the name suggests,
 strongConnect has the strong ref semantics. In this case the closure
 keep a strong ref to the object with the physics field and the signal
 keeps a strong ref to the closure, so the window keeps a strong ref to
 the object, so it won't be collected.

Yeah I noticed that shortly after I wrote that... the connect method
should just work.


Re: DScanner is ready for use

2013-07-28 Thread dennis luehring

Am 28.07.2013 00:27, schrieb Brian Schott:

DScanner is a tool for analyzing D source code. It has the
following features:

* Prints out a complete AST of a source file in XML format.
* Syntax checks code and prints warning/error messages
* Prints a listing of modules imported by a source file
* Syntax highlights code in HTML format
* Provides more meaningful line of code count than wc
* Counts tokens in a source file

The lexer/parser/AST are located in the std/d directory in the
repository. These files should prove useful to anyone else
working on D tooling.

https://github.com/Hackerpilot/Dscanner

Aside: the D grammar that I reverse-engineered can be located
here:
https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html



would be nice to habe some sort of binary output (beside xml and json)
to ease (and maybe speed-up) the usage


Re: Getting Started with the D Programming Language

2013-07-28 Thread Mike Parker

On Saturday, 27 July 2013 at 18:24:11 UTC, Walter Bright wrote:

http://www.gamedev.net/page/resources/_/technical/general-programming/getting-started-with-the-d-programming-language-r3306

By Mike Aldacron Parker


One guy was holding it up, but the peer review process is finally 
completed. As of now, it's officially published.