Thread overview
short guide on getting started with D
Apr 03, 2023
cgenie
Apr 03, 2023
Salih Dincer
Apr 05, 2023
thinkunix
Apr 06, 2023
cgenie
Apr 18, 2023
Dukc
April 03, 2023

Hello,

I created a short guide on getting started with D: https://blog.mmksoft.uk/#A%20short%20guide%20on%20getting%20started%20with%20D%20programming

This is because I recently I started to explore the language and, having read the forum, I see DUB being discouraged quite often.

I would appreciate any remarks.

Best,
Przemek

April 03, 2023

On Monday, 3 April 2023 at 07:29:01 UTC, cgenie wrote:

Thanks, you got my attention...

It has come to my attention that you talked about this:

https://mesonbuild.com/Dlang-module.html

SDB@79

April 05, 2023
cgenie via Digitalmars-d-learn wrote:
> Hello,
> 
> I created a short guide on getting started with D: https://blog.mmksoft.uk/#A%20short%20guide%20on%20getting%20started%20with%20D%20programming 
> 
> 
> This is because I recently I started to explore the language and, having read the forum, I see DUB being discouraged quite often.
> 
> I would appreciate any remarks.


My observations:
#1 typo:  After that, add this meso.build file:

"meso.build" should be "meson.build"

#2 Does it matter where the dlang = import... block goes in the
meson.build file?  I added it after the "test(..." in the first
block and it seemed to work, but...

#3 where is dep?  Is it a file or do I have to create it?

I could only get you demo to work by removing the line

  dependencies: deps

from meson.build.  Then it created dub.json and dub ran it OK.

No need for a reply, just my obvservations from someone who knows
a little D and less meson.

scot


April 06, 2023
On Wednesday, 5 April 2023 at 05:52:33 UTC, thinkunix wrote:

Thank you for these remarks!

>
>
> My observations:
> #1 typo:  After that, add this meso.build file:
>
> "meso.build" should be "meson.build"

Fixed.

>
> #2 Does it matter where the dlang = import... block goes in the
> meson.build file?  I added it after the "test(..." in the first
> block and it seemed to work, but...
>
> #3 where is dep?  Is it a file or do I have to create it?
>
> I could only get you demo to work by removing the line
>
>   dependencies: deps
>
> from meson.build.  Then it created dub.json and dub ran it OK.
>
> No need for a reply, just my obvservations from someone who knows
> a little D and less meson.
>
> scot

Well, I added sample `deps`. Basically this is something like:

```
phobos = dependency('phobos', version: '2.100.2', method: 'dub', static: true)
boilerplate = dependency('boilerplate', version: '1.9.1', method: 'dub', static: true)
serialized = dependency('serialized', version: '1.9.1', method: 'dub', static: true)

deps = [ phobos, boilerplate, serialized ]
```

I'm new to D and meson as well, this is what I found somewhere on the inernet and it seemed to work for me.
April 18, 2023

On Monday, 3 April 2023 at 07:29:01 UTC, cgenie wrote:

>

Hello,

I created a short guide on getting started with D: https://blog.mmksoft.uk/#A%20short%20guide%20on%20getting%20started%20with%20D%20programming

This is because I recently I started to explore the language and, having read the forum, I see DUB being discouraged quite often.

I would appreciate any remarks.

Best,
Przemek

Sorry for the very late reply. I've been thinking on commenting on this but I'm lazy.

You're saying you don't want to use DUB? In that case, I think you should not add it to your dependencies at all. DUB is both a package manager and a build tool, but here Nix is answering for the package management and Meson is your build system. Have Meson to use LDC directly instead.

Since you're using Nix, in case you change your mind about DUB (maybe to build a third-party package), it needs to be said that using it isn't straightforward since Nix won't let DUB download the dependencies from the Internet on it's own. There's a solution, though: dub2nix. If you're interested, watch it's authors DConf talk for more info.

Anyway, there are not many examples about using D with Nix. Your post is addressing that, so thanks for writing it up.