dlang / project-ideas

Collection of impactful projects in the D ecosystem
36 stars 12 forks source link

Improve DMD as a library and integrate it with existing tools #68

Closed RazvanN7 closed 12 months ago

RazvanN7 commented 4 years ago

Description

D's tooling ecosystem has been a major pain point during the last decade. To address this, steps have been taken into packaging the D compiler as a library [1], however the interface is still lacking. This project aims at improving the situation by refactoring the dmd frontend as to offer a nice interface into the compiler. For more information see [1].

What are rough milestones of this project?

  1. Strip AST nodes of all the semantic information.
  2. Get rid of ASTBase
  3. Develop an interface that is capable of overwriting any part of the compiler
  4. Integrate dmd as a lib in existing tools

How does this project help the D community?

This project will ease the development of tools that surround the D language. Alternatively, tools that use dmd as a lib have the guarantee that the latest version of the language is used.

Recommended skills

C++/C/D/Java Experience with OOP Basic understanding of compiler internals Experience with writing LLVM passes is not mandatory, but considered a plus

What can students expect to get out of doing this project?

Real life experience with compiler internals, understanding how a compiler is written, experience with a key project in a real life ecosystem

Point of Contact

@RazvanN7 @edi33416

References

[1] https://forum.dlang.org/thread/dsjtyvsympgjzzpnokcc@forum.dlang.org

mdparker commented 2 years ago

This may not be suitable as a SAOC project anymore, given that work is currently being done on this. @RazvanN7?

maxhaton commented 2 years ago

I'm also pretty skeptical of this as a long term approach for anything other than parsing code.

Improving the library interface is good (don't close this, it's still bad) but dmd needs to act more like a server or at least have a database than be a subcomponent of other tools.

RazvanN7 commented 2 years ago

This should remain open given the amount of work that is necessary to make dmd-as-a-lib compatible with some of the existing tooling.

@maxhaton I don't think that dmd-as-a-lib is going to ever be able to provide what an LSP requires. That is simply because it is impossible to do incremental compilation. I would leave that up to SDC and try to bring dmd-as-a-lib in a position where it offers a decent interface for some of the existing tools.

RazvanN7 commented 12 months ago

Closing as this particular project is actually a direction that we already have under our organization project.

It's far more useful to put in specific cases where dmd-as-a-lib should be used with existing tools (such as https://github.com/dlang/project-ideas/issues/103) tha keeping this open.