dfix is a tool to automatically upgrade code to new features. It uses libdparse - a third party implementation of a D lexer+parser - to obtain an AST which it then uses to generate the fixed code. Since libdparse has a different implementation from the reference D frontend, every time a parser change occurs, libdparse and (likely) its dependencies need to be updated.
The project aims at using the dmd-as-a-library package, which shares its implementation with the reference D compiler, to substitute the use of libdparse in dfix.
What are rough milestones of this project?
Create a fork of dfix and set up a testing pipeline.
Use dmd-as-a-library to obtain the AST.
Rewrite the existing visitors to use the generated AST
Write more potential fixes for existing deprecations.
Integrate the fork in the original dfix repo.
How does this project help the D community?
Ideally, every deprecation or language change should be accompanied by a tool that automatically updates the wrong code to the correct code. Having dfix use the compiler as a library will make it easier for compiler devs to implement the fixes and thus improving the user experience when deprecations/language changes occur.
Recommended skills
Knowledgeable with AST, parsers, compilers.
Prior experience with D/C/C++/Java
OOP
Visitor pattern
Git
Tenacity, patience
Motivated and able to work independently.
Description
dfix is a tool to automatically upgrade code to new features. It uses libdparse - a third party implementation of a D lexer+parser - to obtain an AST which it then uses to generate the fixed code. Since libdparse has a different implementation from the reference D frontend, every time a parser change occurs, libdparse and (likely) its dependencies need to be updated.
The project aims at using the dmd-as-a-library package, which shares its implementation with the reference D compiler, to substitute the use of libdparse in dfix.
What are rough milestones of this project?
How does this project help the D community?
Ideally, every deprecation or language change should be accompanied by a tool that automatically updates the wrong code to the correct code. Having
dfix
use the compiler as a library will make it easier for compiler devs to implement the fixes and thus improving the user experience when deprecations/language changes occur.Recommended skills
Knowledgeable with AST, parsers, compilers. Prior experience with D/C/C++/Java OOP Visitor pattern Git Tenacity, patience Motivated and able to work independently.
Point of Contact
@RazvanN7