www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - dmd as a library

reply vushu <danvu.hustle gmail.com> writes:
Any where to find learning material for using dmd as a library?

thanks.
Nov 07 2022
next sibling parent reply max haughton <maxhaton gmail.com> writes:
On Tuesday, 8 November 2022 at 00:05:18 UTC, vushu wrote:
 Any where to find learning material for using dmd as a library?

 thanks.
What do you want to do with it.
Nov 07 2022
parent reply vushu <danvu.hustle gmail.com> writes:
On Tuesday, 8 November 2022 at 02:55:34 UTC, max haughton wrote:
 On Tuesday, 8 November 2022 at 00:05:18 UTC, vushu wrote:
 Any where to find learning material for using dmd as a library?

 thanks.
What do you want to do with it.
Im trying to understand the idiomatic way of using visitors, since I am interested in making some tooling. I tried to understand the code by looking into some bits and bites within dmd. example: ``` auto someFunc() { return "hello"; } ``` I parsed it' using Parser!ASTCodegen created a class which inherits SemanticTimeTransitiveVisitor and parsed it into. I override visit(ASTCodegen.FuncDeclaration fd) Now the question is: If I want to deduce someFunc's return type I look at it's fd.type.nextOf value in this case it's null since it's return type is set to auto. what would be the right way of deducing that it's return type would be fact a string? Should I just keep traversing and that way deduce the return type? or should I use other methods? I see that the ASTCodegen.FuncDeclaration has a function named ``` functionSemantic(); ``` which I thought I should use, but failed to. So I do feel, that I am in need for some learning materials or guidance.
Nov 07 2022
parent reply Mike Parker <aldacron gmail.com> writes:
On Tuesday, 8 November 2022 at 06:21:11 UTC, vushu wrote:

 So I do feel, that I am in need for some learning materials or 
 guidance.
You might find Lucian Danescu's DConf '22 presentation helpful: https://youtu.be/JYkb3PjIn4c
Nov 07 2022
parent vushu <danvu.hustle gmail.com> writes:
On Tuesday, 8 November 2022 at 06:35:43 UTC, Mike Parker wrote:
 On Tuesday, 8 November 2022 at 06:21:11 UTC, vushu wrote:

 So I do feel, that I am in need for some learning materials or 
 guidance.
You might find Lucian Danescu's DConf '22 presentation helpful: https://youtu.be/JYkb3PjIn4c
thanks :)
Nov 07 2022
prev sibling parent reply Tejas <notrealemail gmail.com> writes:
On Tuesday, 8 November 2022 at 00:05:18 UTC, vushu wrote:
 Any where to find learning material for using dmd as a library?

 thanks.
https://github.com/Superbelko/dmdlib-notes This is the only resource I know of
Nov 07 2022
parent reply vushu <danvu.hustle gmail.com> writes:
On Tuesday, 8 November 2022 at 03:11:15 UTC, Tejas wrote:
 On Tuesday, 8 November 2022 at 00:05:18 UTC, vushu wrote:
 Any where to find learning material for using dmd as a library?

 thanks.
https://github.com/Superbelko/dmdlib-notes This is the only resource I know of
Ah thanks that's nice to have some examples.
Nov 07 2022
parent reply Dennis <dkorpel gmail.com> writes:
On Tuesday, 8 November 2022 at 05:48:54 UTC, vushu wrote:
 Ah thanks that's nice to have some examples.
Here's an example of tools using dmd as a library: https://github.com/jacob-carlborg/dlp
Nov 09 2022
parent vushu <danvu.hustle gmail.com> writes:
On Wednesday, 9 November 2022 at 11:45:46 UTC, Dennis wrote:
 On Tuesday, 8 November 2022 at 05:48:54 UTC, vushu wrote:
 Ah thanks that's nice to have some examples.
Here's an example of tools using dmd as a library: https://github.com/jacob-carlborg/dlp
Thanks, much appreciated 😊
Nov 09 2022