Mihaela Chirea - SAOC 2020 Milestone 1 Update 4 - Improving DMD as a Library

Max Haughton maxhaton at gmail.com
Mon Oct 19 16:22:07 UTC 2020


On Sunday, 18 October 2020 at 23:37:04 UTC, Mihaela Chirea wrote:
> Hello!
>
> Here is an update of the progress made during the last week of 
> Milestone 1 as part of #SAOC2020:
> - I mostly worked on the token location offset tests[1]. This 
> included studying the lexer, parser and tokens in more detail 
> to make sure all the tokens are getting the right offset.
> - Updated the list of locations[2] to show the nodes missing 
> the start location more clearly. It currently contains most 
> nodes in attrib.d and DebugCondition and VersionCondition from 
> cond.d.
>
> For next week:
> - Add the start location to the nodes that lack this 
> information, starting with the ones from cond.d
>
> These tasks were mentioned in the previous update[3] and will 
> be done during the second Milestone:
> - Bring all DMD as a library additions hidden behind a version 
> under DMDLIB
> - Add the token size
>
> The initial milestones can be found here[4]. I will post the 
> updated list as a reply to that thread and use that link in 
> future updates.
>
> [1]: https://github.com/dlang/dmd/pull/11823
> [2]: 
> https://drive.google.com/file/d/1lb-eP9Pai713tggud6iuzA1cIetbK4zc/view?usp=sharing
> [3]: 
> https://forum.dlang.org/post/vshahvctwdhrmrjssool@forum.dlang.org
> [4]: 
> https://forum.dlang.org/post/ztbjfjebxtysmugfzkmz@forum.dlang.org

Quick feature suggestion, I've been using DMD to transform code 
to run a safe script inside a game (the details don't matter, 
It's very specific usecase but I may open source it).

It's currently a bit of a pain to do a full semantic analysis 
while also maintaining a compilable buffer i.e. you have to trim 
toPrettyChars() (or whatever it is) to not have the typeinfo 
things (i.e. the mixins from object.d, while also having vanilla 
object.d) for types for when you want to compile your modified 
code. Being able to control this without a flag from a topdown 
view into the compiler (i.e. as a library) could be a big 
stepping stone to fruitful projects.




More information about the Digitalmars-d mailing list