Re: Lang.NEXT panel (dfix)

2014-06-20 Thread Stefan Koch via Digitalmars-d-announce
On Thursday, 19 June 2014 at 21:28:28 UTC, Brian Schott wrote: On Thursday, 19 June 2014 at 20:37:48 UTC, Stefan Koch wrote: hmm well all string-mixins life at compile-time. So one can print them out at runtime. Dump the source and put it into the AST. Same for the results of static if, and

Re: Lang.NEXT panel (dfix)

2014-06-20 Thread Bruno Medeiros via Digitalmars-d-announce
On 17/06/2014 20:59, Dicebot wrote: On Tuesday, 17 June 2014 at 19:48:42 UTC, Bruno Medeiros wrote: On 17/06/2014 19:10, deadalnix wrote: On Tuesday, 17 June 2014 at 15:45:55 UTC, Bruno Medeiros wrote: Dunno about DScanner, but if it's being used in DCD, I'd guess it can handle the whole

Re: Lang.NEXT panel (dfix)

2014-06-20 Thread Dicebot via Digitalmars-d-announce
On Friday, 20 June 2014 at 13:04:23 UTC, Bruno Medeiros wrote: Rather, simple fix changes that would be useful if the API or syntax of the language changes. That's why I asked for examples of dfix changes (even if for hypothetical language changes) - to see how easily they could be implemented

Re: Lang.NEXT panel (dfix)

2014-06-19 Thread Brian Schott via Digitalmars-d-announce
On Thursday, 19 June 2014 at 20:37:48 UTC, Stefan Koch wrote: hmm well all string-mixins life at compile-time so one can print them out at runtime dump the source and but it into the ast same for the results of static if and the like I imagine that trying to create an automated refactoring

Re: Lang.NEXT panel (dfix)

2014-06-18 Thread Jacob Carlborg via Digitalmars-d-announce
On 17/06/14 22:00, Bruno Medeiros wrote: And perhaps rightly so, one could make a case that string mixins should be used sparsely? We have to realize that string mixins are very useful, but are a dirty hack that is a replacement for AST macros. I fully agree, but that won't stop anyone from

Re: Lang.NEXT panel (dfix)

2014-06-17 Thread Jacob Carlborg via Digitalmars-d-announce
On 16/06/14 15:43, Bruno Medeiros wrote: What's keeping us from having such a tool? It seems that after one has a decent parser (that also keeps tracks of the source ranges of AST nodes), it's easy to write code that does syntactic modifications and then rewrites the source code. And there's

Re: Lang.NEXT panel (dfix)

2014-06-17 Thread Bruno Medeiros via Digitalmars-d-announce
On 16/06/2014 22:10, Stefan Koch wrote: The thing I have in mind should be really easy for simple tasks as in `if constuctor in any class has parameter of type oldRouter change that parameter to type new Router` but i habe yet to find a good notation for that I guess a DSL for simple

Re: Lang.NEXT panel (dfix)

2014-06-17 Thread Bruno Medeiros via Digitalmars-d-announce
On 17/06/2014 07:25, Jacob Carlborg wrote: On 16/06/14 15:43, Bruno Medeiros wrote: What's keeping us from having such a tool? It seems that after one has a decent parser (that also keeps tracks of the source ranges of AST nodes), it's easy to write code that does syntactic modifications and

Re: Lang.NEXT panel (dfix)

2014-06-17 Thread Bruno Medeiros via Digitalmars-d-announce
On 17/06/2014 16:45, Bruno Medeiros wrote: Dunno about DScanner, but if it's being used in DCD, I'd guess it can handle the whole language, or be fairly close to it. Similarly, there is also DParser2 from MonoD and the DDT parser (for the tool I'm working on) And DDT is fairly complete,

Re: Lang.NEXT panel (dfix)

2014-06-17 Thread Bruno Medeiros via Digitalmars-d-announce
On 17/06/2014 16:45, Bruno Medeiros wrote: Similarly, there is also DParser2 from MonoD and the DDT parser (for the tool I'm working on) And the DDT parser is fairly complete, AFAIK, and well covered in tests. There might be some syntax I have missed if I misunderstood the grammar spec, but

Re: Lang.NEXT panel (dfix)

2014-06-17 Thread deadalnix via Digitalmars-d-announce
On Tuesday, 17 June 2014 at 15:45:55 UTC, Bruno Medeiros wrote: Dunno about DScanner, but if it's being used in DCD, I'd guess it can handle the whole language, or be fairly close to it. Similarly, there is also DParser2 from MonoD and the DDT parser (for the tool I'm working on)

Re: Lang.NEXT panel (dfix)

2014-06-17 Thread Jacob Carlborg via Digitalmars-d-announce
On Tuesday, 17 June 2014 at 15:45:55 UTC, Bruno Medeiros wrote: Adding final to every method in certain classes could be done without semantic analysis. Reworking certain constructs to different constructs possibly as well (for example change foreach_reverse to just foreach usage) What

Re: Lang.NEXT panel (dfix)

2014-06-17 Thread Bruno Medeiros via Digitalmars-d-announce
On 17/06/2014 19:10, deadalnix wrote: On Tuesday, 17 June 2014 at 15:45:55 UTC, Bruno Medeiros wrote: Dunno about DScanner, but if it's being used in DCD, I'd guess it can handle the whole language, or be fairly close to it. Similarly, there is also DParser2 from MonoD and the DDT parser (for

Re: Lang.NEXT panel (dfix)

2014-06-17 Thread Bruno Medeiros via Digitalmars-d-announce
On 17/06/2014 20:12, Jacob Carlborg wrote: On Tuesday, 17 June 2014 at 15:45:55 UTC, Bruno Medeiros wrote: Adding final to every method in certain classes could be done without semantic analysis. Reworking certain constructs to different constructs possibly as well (for example change

Re: Lang.NEXT panel (dfix)

2014-06-17 Thread Dicebot via Digitalmars-d-announce
On Tuesday, 17 June 2014 at 19:48:42 UTC, Bruno Medeiros wrote: On 17/06/2014 19:10, deadalnix wrote: On Tuesday, 17 June 2014 at 15:45:55 UTC, Bruno Medeiros wrote: Dunno about DScanner, but if it's being used in DCD, I'd guess it can handle the whole language, or be fairly close to it.

Re: Lang.NEXT panel (dfix)

2014-06-16 Thread Bruno Medeiros via Digitalmars-d-announce
On 12/06/2014 18:53, Andrei Alexandrescu wrote: On 6/12/14, 10:40 AM, Nick Sabalausky wrote: On 6/10/2014 12:35 PM, justme wrote: On Wednesday, 4 June 2014 at 06:13:39 UTC, Andrei Alexandrescu wrote: Of possible interest.

Re: Lang.NEXT panel (dfix)

2014-06-16 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 6/16/14, 6:43 AM, Bruno Medeiros wrote: On 12/06/2014 18:53, Andrei Alexandrescu wrote: I got convinced a dfix tool would be a strategic component of D's offering going forward. Andrei What's keeping us from having such a tool? It seems that after one has a decent parser (that also

Re: Lang.NEXT panel (dfix)

2014-06-16 Thread Stefan Koch via Digitalmars-d-announce
What's keeping us from having such a tool? It seems that after one has a decent parser (that also keeps tracks of the source ranges of AST nodes), it's easy to write code that does syntactic modifications and then rewrites the source code. And there's several D parsers out there already - so

Re: Lang.NEXT panel (dfix)

2014-06-16 Thread Bruno Medeiros via Digitalmars-d-announce
On 16/06/2014 21:43, Stefan Koch wrote: What's keeping us from having such a tool? It seems that after one has a decent parser (that also keeps tracks of the source ranges of AST nodes), it's easy to write code that does syntactic modifications and then rewrites the source code. And there's

Re: Lang.NEXT panel (dfix)

2014-06-16 Thread Stefan Koch via Digitalmars-d-announce
DSL?! You crazy bro? If you are using DScanner, just let people use D itself to write their own custom AST transformation code. With DUB it should be super easy to compile that code and run it on the target D code. This solution is vastly more simple than inventing your own DSL, and scales