digitalmars.D.announce - Lang.NEXT panel
- Andrei Alexandrescu (3/3) Jun 03 2014 Of possible interest.
- Joakim (7/10) Jun 04 2014 Nice panel. Not much really new there, but gives an idea of what
- justme (8/11) Jun 10 2014 IMHO, the coolest thing was when Rob Pike told about the tool
- Nick Sabalausky (5/17) Jun 12 2014 Personally, I wouldn't be comfortable trusting such a tool. Besides, I
- Andrei Alexandrescu (8/28) Jun 12 2014 I very much think the opposite, drawing from many years of hacking into
- Atila Neves (6/46) Jun 12 2014 I thought the same. I was considering writing it, actually.
- John Carter via Digitalmars-d-announce (32/68) Jun 12 2014 Yes!
- Dicebot (6/13) Jun 12 2014 It essentially comes down to persistent compiler-as-a-library
- deadalnix (2/16) Jun 12 2014 If only we had such a tool !
- w0rp (19/59) Jun 12 2014 I am strongly in favour of a 'dfix' tool. There exist historical
- Stefan Koch (5/5) Jun 14 2014 As it happens I am writing a kind of DFIX on top of DScanner
- Bruno Medeiros (14/45) Jun 16 2014 What's keeping us from having such a tool? It seems that after one has a...
- Andrei Alexandrescu (2/20) Jun 16 2014 No magic required. -- Andrei
- Stefan Koch (10/23) Jun 16 2014 Well, my recent efforts lead my to belief that I am in over my
- Bruno Medeiros (11/33) Jun 16 2014 DSL?! You crazy bro?
- Stefan Koch (5/13) Jun 16 2014 The thing I have in mind should be really easy for simple tasks
- Bruno Medeiros (7/12) Jun 17 2014 I guess a DSL for simple manipulations can be ok to have. But for more
- Jacob Carlborg (7/18) Jun 16 2014 * The parser haven't been available for that long (I think)
- Bruno Medeiros (14/31) Jun 17 2014 Dunno about DScanner, but if it's being used in DCD, I'd guess it can
- Bruno Medeiros (7/11) Jun 17 2014 And DDT is fairly complete, AFAIK, and well covered in tests. There
- Bruno Medeiros (7/9) Jun 17 2014 And the DDT parser is fairly complete, AFAIK, and well covered in tests....
- deadalnix (5/20) Jun 17 2014 HAHAHAHAHAHA ! (The author of these actual tools will tell you
- Bruno Medeiros (9/31) Jun 17 2014 I don't understand what point is it you're trying to say here...
- Dicebot (5/23) Jun 17 2014 Parsing D is relatively simple but making any reliable changes
- Bruno Medeiros (12/33) Jun 20 2014 A lot of simple changes could be made with little or no semantic
- Dicebot (9/13) Jun 20 2014 Well I guess most recent example is that `final` by default
- Jacob Carlborg (9/13) Jun 17 2014 What about methods added via template and string mixins? You
- Bruno Medeiros (16/28) Jun 17 2014 Methods added through string mixins would not work. Actually, any AST
- Jacob Carlborg (5/8) Jun 17 2014 I fully agree, but that won't stop anyone from actually using string
- Stefan Koch (4/12) Jun 19 2014 hmm well all string-mixins life at compile-time so one can print
- Brian Schott (4/7) Jun 19 2014 I imagine that trying to create an automated refactoring tool for
- Stefan Koch (7/14) Jun 20 2014 A hypothetical dfix-tool has a diffrent scope compared to a
- Bruno Medeiros (10/16) Jun 20 2014 Well, that's acceptable: the tool could just print a warning when it
- Jacob Carlborg (7/11) Jun 12 2014 I think the complete opposite. I migrated a Rails 2.3 app to Rails 3.x
- Brian Schott (2/3) Jun 12 2014 What makes you say this?
Of possible interest. http://www.reddit.com/r/programming/comments/278twt/panel_systems_programming_in_2014_and_beyond/ Andrei
Jun 03 2014
On Wednesday, 4 June 2014 at 06:13:39 UTC, Andrei Alexandrescu wrote:Of possible interest. http://www.reddit.com/r/programming/comments/278twt/panel_systems_programming_in_2014_and_beyond/ AndreiNice panel. Not much really new there, but gives an idea of what you language designers are thinking about and who you are. I was never much interested in Go, but after seeing Pike for the first time, was a bit more interested in his language. Funny to see Bjarne swinging his legs on the high stool like a kid. :)
Jun 04 2014
On Wednesday, 4 June 2014 at 06:13:39 UTC, Andrei Alexandrescu wrote:Of possible interest. http://www.reddit.com/r/programming/comments/278twt/panel_systems_programming_in_2014_and_beyond/ AndreiIMHO, the coolest thing was when Rob Pike told about the tool they made for automatically upgrading user source code to their next language version. That should be quite easy to implement now in D, and once done, would give much needed room for breaking changes we feel should be done. Pike seemed to be extremely satisfied they did it.
Jun 10 2014
On 6/10/2014 12:35 PM, justme wrote:On Wednesday, 4 June 2014 at 06:13:39 UTC, Andrei Alexandrescu wrote:Personally, I wouldn't be comfortable trusting such a tool. Besides, I find that upgrading a codebase to a newer language version is one of the most trivial tasks I ever face in software development - even in D. It's a cute trick, but not a worthwhile use of development resources.Of possible interest. http://www.reddit.com/r/programming/comments/278twt/panel_systems_programming_in_2014_and_beyond/ AndreiIMHO, the coolest thing was when Rob Pike told about the tool they made for automatically upgrading user source code to their next language version. That should be quite easy to implement now in D, and once done, would give much needed room for breaking changes we feel should be done. Pike seemed to be extremely satisfied they did it.
Jun 12 2014
On 6/12/14, 10:40 AM, Nick Sabalausky wrote:On 6/10/2014 12:35 PM, justme wrote:I very much think the opposite, drawing from many years of hacking into large codebases. I'm completely with Rob here. On a large codebase, even the slightest manual or semi-manual change is painstaking to plan and execute, and almost always suffers of human errors. I got convinced a dfix tool would be a strategic component of D's offering going forward. AndreiOn Wednesday, 4 June 2014 at 06:13:39 UTC, Andrei Alexandrescu wrote:Personally, I wouldn't be comfortable trusting such a tool. Besides, I find that upgrading a codebase to a newer language version is one of the most trivial tasks I ever face in software development - even in D. It's a cute trick, but not a worthwhile use of development resources.Of possible interest. http://www.reddit.com/r/programming/comments/278twt/panel_systems_programming_in_2014_and_beyond/ AndreiIMHO, the coolest thing was when Rob Pike told about the tool they made for automatically upgrading user source code to their next language version. That should be quite easy to implement now in D, and once done, would give much needed room for breaking changes we feel should be done. Pike seemed to be extremely satisfied they did it.
Jun 12 2014
On Thursday, 12 June 2014 at 17:52:59 UTC, Andrei Alexandrescu wrote:On 6/12/14, 10:40 AM, Nick Sabalausky wrote:I thought the same. I was considering writing it, actually. Imagine how having the tool would have influenced the "final by default" discussion. Amongst others, of course. AtilaOn 6/10/2014 12:35 PM, justme wrote:I very much think the opposite, drawing from many years of hacking into large codebases. I'm completely with Rob here. On a large codebase, even the slightest manual or semi-manual change is painstaking to plan and execute, and almost always suffers of human errors. I got convinced a dfix tool would be a strategic component of D's offering going forward. AndreiOn Wednesday, 4 June 2014 at 06:13:39 UTC, Andrei Alexandrescu wrote:Personally, I wouldn't be comfortable trusting such a tool. Besides, I find that upgrading a codebase to a newer language version is one of the most trivial tasks I ever face in software development - even in D. It's a cute trick, but not a worthwhile use of development resources.Of possible interest. http://www.reddit.com/r/programming/comments/278twt/panel_systems_programming_in_2014_and_beyond/ AndreiIMHO, the coolest thing was when Rob Pike told about the tool they made for automatically upgrading user source code to their next language version. That should be quite easy to implement now in D, and once done, would give much needed room for breaking changes we feel should be done. Pike seemed to be extremely satisfied they did it.
Jun 12 2014
Yes! That is only one of the reasons to have that ability. Almost more important is automated reasoning about very large codebases. What are the global properties? Where are the "antipatterns" of use and can we fix them? Can we "lint" away large classes of defects? Even Stroustrup believes such tools would be useful for C++. On Fri, Jun 13, 2014 at 5:53 AM, Andrei Alexandrescu via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> wrote:On 6/12/14, 10:40 AM, Nick Sabalausky wrote:-- John Carter Phone : (64)(3) 358 6639 Tait Electronics PO Box 1645 Christchurch New Zealand -- ------------------------------ This email, including any attachments, is only for the intended recipient. It is subject to copyright, is confidential and may be the subject of legal or other privilege, none of which is waived or lost by reason of this transmission. If you are not an intended recipient, you may not use, disseminate, distribute or reproduce such email, any attachments, or any part thereof. If you have received a message in error, please notify the sender immediately and erase all copies of the message and any attachments. Unfortunately, we cannot warrant that the email has not been altered or corrupted during transmission nor can we guarantee that any email or any attachments are free from computer viruses or other conditions which may damage or interfere with recipient data, hardware or software. The recipient relies upon its own procedures and assumes all risk of use and of opening any attachments. ------------------------------On 6/10/2014 12:35 PM, justme wrote:I very much think the opposite, drawing from many years of hacking into large codebases. I'm completely with Rob here. On a large codebase, even the slightest manual or semi-manual change is painstaking to plan and execute, and almost always suffers of human errors. I got convinced a dfix tool would be a strategic component of D's offering going forward. AndreiOn Wednesday, 4 June 2014 at 06:13:39 UTC, Andrei Alexandrescu wrote:Personally, I wouldn't be comfortable trusting such a tool. Besides, I find that upgrading a codebase to a newer language version is one of the most trivial tasks I ever face in software development - even in D. It's a cute trick, but not a worthwhile use of development resources.Of possible interest. http://www.reddit.com/r/programming/comments/278twt/ panel_systems_programming_in_2014_and_beyond/ AndreiIMHO, the coolest thing was when Rob Pike told about the tool they made for automatically upgrading user source code to their next language version. That should be quite easy to implement now in D, and once done, would give much needed room for breaking changes we feel should be done. Pike seemed to be extremely satisfied they did it.
Jun 12 2014
On Thursday, 12 June 2014 at 17:52:59 UTC, Andrei Alexandrescu wrote:I very much think the opposite, drawing from many years of hacking into large codebases. I'm completely with Rob here. On a large codebase, even the slightest manual or semi-manual change is painstaking to plan and execute, and almost always suffers of human errors. I got convinced a dfix tool would be a strategic component of D's offering going forward.It essentially comes down to persistent compiler-as-a-library issue :( Tools like dscanner can help with some of more simple transition cases but anything more complicated is likely to require full semantic analysis.
Jun 12 2014
On Thursday, 12 June 2014 at 20:48:10 UTC, Dicebot wrote:On Thursday, 12 June 2014 at 17:52:59 UTC, Andrei Alexandrescu wrote:If only we had such a tool !I very much think the opposite, drawing from many years of hacking into large codebases. I'm completely with Rob here. On a large codebase, even the slightest manual or semi-manual change is painstaking to plan and execute, and almost always suffers of human errors. I got convinced a dfix tool would be a strategic component of D's offering going forward.It essentially comes down to persistent compiler-as-a-library issue :( Tools like dscanner can help with some of more simple transition cases but anything more complicated is likely to require full semantic analysis.
Jun 12 2014
On Thursday, 12 June 2014 at 17:52:59 UTC, Andrei Alexandrescu wrote:On 6/12/14, 10:40 AM, Nick Sabalausky wrote:I am strongly in favour of a 'dfix' tool. There exist historical problems with languages, and you really must break them to make things better. Douglas Crockford was pushing for '~' for string concatenation in ECMAScript 6, making '+' do only additon. This would have been very similar to how D handles the two, in an arguably correct manner, but the commity wouldn't agree to it because it would force everyone to change their code. So in the end ES6 is full of features, some useful, most seem nonsensical to me, but it doesn't really fix any of the issues in ES5, because it's almost totally backwards compatible so old code still works. So I think having tools like gofix and deprecation warnings mitigate this issue massively, and it's especially easier when you're using an ahead-of-time compiled language like D. So we can make changes which break code, but just get rid of cruft likely to cause errors. I can't think of nearly as many examples of error-prone things in D that I can think of in ES6, though.On 6/10/2014 12:35 PM, justme wrote:I very much think the opposite, drawing from many years of hacking into large codebases. I'm completely with Rob here. On a large codebase, even the slightest manual or semi-manual change is painstaking to plan and execute, and almost always suffers of human errors. I got convinced a dfix tool would be a strategic component of D's offering going forward. AndreiOn Wednesday, 4 June 2014 at 06:13:39 UTC, Andrei Alexandrescu wrote:Personally, I wouldn't be comfortable trusting such a tool. Besides, I find that upgrading a codebase to a newer language version is one of the most trivial tasks I ever face in software development - even in D. It's a cute trick, but not a worthwhile use of development resources.Of possible interest. http://www.reddit.com/r/programming/comments/278twt/panel_systems_programming_in_2014_and_beyond/ AndreiIMHO, the coolest thing was when Rob Pike told about the tool they made for automatically upgrading user source code to their next language version. That should be quite easy to implement now in D, and once done, would give much needed room for breaking changes we feel should be done. Pike seemed to be extremely satisfied they did it.
Jun 12 2014
As it happens I am writing a kind of DFIX on top of DScanner right at the moment. There are a few details to sort out. But I should have some small demo pretty soon. Regrards, Stefan
Jun 14 2014
On 12/06/2014 18:53, Andrei Alexandrescu wrote:On 6/12/14, 10:40 AM, Nick Sabalausky 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 several D parsers out there already - so it should be too much effort to get there. Even I am working on a tool that can be easily retrofitted for this purpose. Or maybe I am misunderstanding the amount of semantic analysis that would typically be required? Can someone give some examples of modifications that would be useful for such a dfix tool? (I haven't yet had the time to watch the full panel video, if that's relevant) -- Bruno Medeiros https://twitter.com/brunodomedeirosOn 6/10/2014 12:35 PM, justme wrote:I very much think the opposite, drawing from many years of hacking into large codebases. I'm completely with Rob here. On a large codebase, even the slightest manual or semi-manual change is painstaking to plan and execute, and almost always suffers of human errors. I got convinced a dfix tool would be a strategic component of D's offering going forward. AndreiOn Wednesday, 4 June 2014 at 06:13:39 UTC, Andrei Alexandrescu wrote:Personally, I wouldn't be comfortable trusting such a tool. Besides, I find that upgrading a codebase to a newer language version is one of the most trivial tasks I ever face in software development - even in D. It's a cute trick, but not a worthwhile use of development resources.Of possible interest. http://www.reddit.com/r/programming/comments/278twt/panel_systems_programming_in_2014_and_beyond/ AndreiIMHO, the coolest thing was when Rob Pike told about the tool they made for automatically upgrading user source code to their next language version. That should be quite easy to implement now in D, and once done, would give much needed room for breaking changes we feel should be done. Pike seemed to be extremely satisfied they did it.
Jun 16 2014
On 6/16/14, 6:43 AM, Bruno Medeiros wrote:On 12/06/2014 18:53, Andrei Alexandrescu wrote:No magic required. -- AndreiI got convinced a dfix tool would be a strategic component of D's offering going forward. AndreiWhat'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 it should be too much effort to get there. Even I am working on a tool that can be easily retrofitted for this purpose. Or maybe I am misunderstanding the amount of semantic analysis that would typically be required? Can someone give some examples of modifications that would be useful for such a dfix tool? (I haven't yet had the time to watch the full panel video, if that's relevant)
Jun 16 2014
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 it should be too much effort to get there. Even I am working on a tool that can be easily retrofitted for this purpose. Or maybe I am misunderstanding the amount of semantic analysis that would typically be required? Can someone give some examples of modifications that would be useful for such a dfix tool? (I haven't yet had the time to watch the full panel video, if that's relevant)Well, my recent efforts lead my to belief that I am in over my head with this. But ... many sufficiently simple transformations can be done with a complex regex and for me that is faster, given the trouble I have with writing ASTMatchers for Dscanner. BTW. Does anyone know a good approch to a DSL describeing AST-transformation patterns ? What I currently have is SQL-like Syntax and I feel it won't scale to complex selction and/or transformation patterns. Input is welcome.
Jun 16 2014
On 16/06/2014 21:43, Stefan Koch wrote: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 way better as a general purpose language will have much more power that selection/transformation patterns. -- Bruno Medeiros https://twitter.com/brunodomedeirosWhat'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 it should be too much effort to get there. Even I am working on a tool that can be easily retrofitted for this purpose. Or maybe I am misunderstanding the amount of semantic analysis that would typically be required? Can someone give some examples of modifications that would be useful for such a dfix tool? (I haven't yet had the time to watch the full panel video, if that's relevant)Well, my recent efforts lead my to belief that I am in over my head with this. But ... many sufficiently simple transformations can be done with a complex regex and for me that is faster, given the trouble I have with writing ASTMatchers for Dscanner. BTW. Does anyone know a good approch to a DSL describeing AST-transformation patterns ? What I currently have is SQL-like Syntax and I feel it won't scale to complex selction and/or transformation patterns. Input is welcome.
Jun 16 2014
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 way better as a general purpose language will have much more power that selection/transformation patterns.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
Jun 16 2014
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 thatI guess a DSL for simple manipulations can be ok to have. But for more complex stuff better to just use the language the parser is written in. I'd guess most people would just be using pre-written manipulations anyways. -- Bruno Medeiros https://twitter.com/brunodomedeiros
Jun 17 2014
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 several D parsers out there already - so it should be too much effort to get there. Even I am working on a tool that can be easily retrofitted for this purpose. Or maybe I am misunderstanding the amount of semantic analysis that would typically be required? Can someone give some examples of modifications that would be useful for such a dfix tool? (I haven't yet had the time to watch the full panel video, if that's relevant)* The parser haven't been available for that long (I think) * Can they handle whole language? * Semantic analysis is needed. Otherwise as soon as someone uses templates or mixins the tool won't properly work -- /Jacob Carlborg
Jun 16 2014
On 17/06/2014 07:25, Jacob Carlborg wrote:On 16/06/14 15:43, 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)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 it should be too much effort to get there. Even I am working on a tool that can be easily retrofitted for this purpose. Or maybe I am misunderstanding the amount of semantic analysis that would typically be required? Can someone give some examples of modifications that would be useful for such a dfix tool? (I haven't yet had the time to watch the full panel video, if that's relevant)* The parser haven't been available for that long (I think) * Can they handle whole language?* Semantic analysis is needed. Otherwise as soon as someone uses templates or mixins the tool won't properly workI think there would be a lot of modifications that one can do without semantic analysis (or limited analysis). But that's why I asked for examples of dfix scenarios. 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) -- Bruno Medeiros https://twitter.com/brunodomedeiros
Jun 17 2014
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, AFAIK, and well covered in tests. There might be some syntax I have missed if I misunderstood the grammar, but that should be fixable easily. -- Bruno Medeiros https://twitter.com/brunodomedeiros
Jun 17 2014
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 that should be fixable easily. -- Bruno Medeiros https://twitter.com/brunodomedeiros
Jun 17 2014
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)HAHAHAHAHAHA ! (The author of these actual tools will tell you the same).Until you hit a static if. Which is always.* Semantic analysis is needed. Otherwise as soon as someone uses templates or mixins the tool won't properly workI think there would be a lot of modifications that one can do without semantic analysis (or limited analysis). But that's why I asked for examples of dfix scenarios.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)ditto.
Jun 17 2014
On 17/06/2014 19:10, deadalnix wrote:On Tuesday, 17 June 2014 at 15:45:55 UTC, Bruno Medeiros wrote:I don't understand what point is it you're trying to say here... Are you saying it's ludicrous that people have written complete parsers for D?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)HAHAHAHAHAHA ! (The author of these actual tools will tell you the same).How would a static if prevent a tool from adding "final" to every method in a specified class? -- Bruno Medeiros https://twitter.com/brunodomedeirosUntil you hit a static if. Which is always.* Semantic analysis is needed. Otherwise as soon as someone uses templates or mixins the tool won't properly workI think there would be a lot of modifications that one can do without semantic analysis (or limited analysis). But that's why I asked for examples of dfix scenarios.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)ditto.
Jun 17 2014
On Tuesday, 17 June 2014 at 19:48:42 UTC, Bruno Medeiros wrote:On 17/06/2014 19:10, deadalnix wrote:Parsing D is relatively simple but making any reliable changes without full (and mean _full_) semantic analysis is close to impossible because of code generation and interleaving semantic stages.On Tuesday, 17 June 2014 at 15:45:55 UTC, Bruno Medeiros wrote:I don't understand what point is it you're trying to say here... Are you saying it's ludicrous that people have written complete parsers for D?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)HAHAHAHAHAHA ! (The author of these actual tools will tell you the same).
Jun 17 2014
On 17/06/2014 20:59, Dicebot wrote:On Tuesday, 17 June 2014 at 19:48:42 UTC, Bruno Medeiros wrote:A lot of simple changes could be made with little or no semantic analysis. I'm not talking about complex refactorings such as Extract/Inline Function, Introduce/Remove Parameter, Pull Method Up/Down, extract Class/Interface, etc. 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 or not. -- Bruno Medeiros https://twitter.com/brunodomedeirosOn 17/06/2014 19:10, deadalnix wrote:Parsing D is relatively simple but making any reliable changes without full (and mean _full_) semantic analysis is close to impossible because of code generation and interleaving semantic stages.On Tuesday, 17 June 2014 at 15:45:55 UTC, Bruno Medeiros wrote:I don't understand what point is it you're trying to say here... Are you saying it's ludicrous that people have written complete parsers for D?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)HAHAHAHAHAHA ! (The author of these actual tools will tell you the same).
Jun 20 2014
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 or not.Well I guess most recent example is that `final` by default proposal - marking all existing functions as virtual ones explicitly. Problem with dfix is that such tool can't afford to be "best effort" implementation if it is to be used as justification for breaking changes. It needs to provide guaranteed 0-cost transition or someone will be inevitably unhappy about the breakage anyway :(
Jun 20 2014
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 about methods added via template and string mixins? You cannot add "final" to a method in a template, because you don't know if it will be mixed in into a class or struct (does the compiler allow "final" on struct methods?). There's no possible way to handle string mixins, a method can be built up by concatenating strings. -- /Jacob Carlborg
Jun 17 2014
On 17/06/2014 20:12, Jacob Carlborg wrote:On Tuesday, 17 June 2014 at 15:45:55 UTC, Bruno Medeiros wrote:Methods added through string mixins would not work. Actually, any AST modification would probably not work through string mixins. That would be an incredibly difficult problem to solve - in many cases, impossible even. 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. As for methods added via templates, the tool would present the option to add "final" to those templates as well, or just the class. If doing do might break other classes that use the same template, well, that is a problem that transcends whether this transformation is done manually or by a tool. It would not be an issue with "dfix" itself then. -- Bruno Medeiros https://twitter.com/brunodomedeirosAdding "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 about methods added via template and string mixins? You cannot add "final" to a method in a template, because you don't know if it will be mixed in into a class or struct (does the compiler allow "final" on struct methods?). There's no possible way to handle string mixins, a method can be built up by concatenating strings. -- /Jacob Carlborg
Jun 17 2014
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 actually using string mixins ;) -- /Jacob Carlborg
Jun 17 2014
On Wednesday, 18 June 2014 at 06:43:32 UTC, Jacob Carlborg wrote:On 17/06/14 22:00, Bruno Medeiros 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 likeAnd 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 actually using string mixins ;)
Jun 19 2014
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 likeI imagine that trying to create an automated refactoring tool for D is a bit like parsing HTML with regex. http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags
Jun 19 2014
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:A hypothetical dfix-tool has a diffrent scope compared to a compiler. Every sufficiently complex tranformation is very hard to do automaticlly. My goal is just to make simple tasks simple. I hope superficial understanding of D's AST is enough for that.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 the like.I imagine that trying to create an automated refactoring tool for D is a bit like parsing HTML with regex. http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags
Jun 20 2014
On 18/06/2014 07:43, Jacob Carlborg wrote:On 17/06/14 22:00, Bruno Medeiros wrote:Well, that's acceptable: the tool could just print a warning when it finds strings mixins that it can't understand. I think the tool doesn't necessarily have to work on 100% of cases to be useful. If it can work correctly on the changes that it does do, and print a warning to the user to manually change/check the other remaining spots, it should still be useful. -- Bruno Medeiros https://twitter.com/brunodomedeirosAnd 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 actually using string mixins ;)
Jun 20 2014
On 12/06/14 19:40, Nick Sabalausky wrote:Personally, I wouldn't be comfortable trusting such a tool. Besides, I find that upgrading a codebase to a newer language version is one of the most trivial tasks I ever face in software development - even in D. It's a cute trick, but not a worthwhile use of development resources.I think the complete opposite. I migrated a Rails 2.3 app to Rails 3.x and from Ruby 1.8 to 1.9, it was an enormous task. Took probably six months. Also, it doesn't help to not have any tests and Ruby code in the database. -- /Jacob Carlborg
Jun 12 2014
On Tuesday, 10 June 2014 at 16:35:23 UTC, justme wrote:That should be quite easy to implement now in DWhat makes you say this?
Jun 12 2014