Thread overview
dmd as a library
Nov 08, 2022
vushu
Nov 08, 2022
max haughton
Nov 08, 2022
vushu
Nov 08, 2022
Mike Parker
Nov 08, 2022
vushu
Nov 08, 2022
Tejas
Nov 08, 2022
vushu
Nov 09, 2022
Dennis
Nov 10, 2022
vushu
November 08, 2022

Any where to find learning material for using dmd as a library?

thanks.

November 08, 2022

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.

November 08, 2022

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

November 08, 2022

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.

November 08, 2022

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.

November 08, 2022

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

November 08, 2022

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 :)

November 09, 2022

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

November 10, 2022

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 😊