Doesn't DMD as a library already exist without an external dub project?

Jacob Carlborg doob at me.com
Thu Sep 10 14:54:01 UTC 2020


On 2020-09-06 15:47, Andrew Edwards wrote:

> That is indeed the goal. I just want to install the compiler and 
> automatically have this capability. I shouldn't need to use dub for this 
> because the source code included with every compiler install.

You can have a look at the Dub file to see how it's built.

> Is there a list 
> somewhere capturing the improvements desired or problems encountered in 
> the as-a-library experience?

Not really. It's kind of spread out over newsgroup posts. Here are some 
of the problems:

* There's a lot of global state in the compiler. This might need to be 
reset when using the compiler in an IDE/editor LSP server

* There's no end location for tokens or AST nodes. This will make source 
code refactorings difficult/impossible

* Some AST nodes don't have location information at all

* Location information does not contain a buffer position/offset

* It's not possible to analyze source code that is only in memory. 
Imports and string imports will be looked up on disk

* The error handling/reporting is difficult to customize

* Information is lost between the various compilation phases

* The semantic analyzer is destructive

[1] https://github.com/dlang/dmd/blob/master/dub.sdl

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list