Jump to page: 1 2
Thread overview
How to use D on M2 macOS?
5 days ago
Albert
5 days ago
Luna
5 days ago
Luna
5 days ago
Serg Gini
5 days ago
Luna
5 days ago
Albert
5 days ago
Luna
5 days ago
Albert
5 days ago
Albert
5 days ago
Albert
5 days ago
Sergey
5 days ago
Albert
5 days ago
Mike Parker
3 days ago
Brian Callahan
3 days ago
Serg Gini
5 days ago

Hi all,

I am completely new to D, wished to try it out and write a small app in it. However, for the last couple hours I am ready to pull my hair out as I have no idea how to compile even a simplest hello world app.

I installed ldc and dub (nowhere on the download page did it even mention that dub should be installed separately!) from home-brew, installed code-d for vscode, used the plugin to create a new project and that is as far as I've gotten.

For example the plugin prompts me to "Compile serve-d", however doing so just fails with:

Error Command failed with exit code 127: rdmd "/Users/albert/.dub/packages/dfmt/0.14.1/dfmt/dubhash.d"
Failed to install serve-d (Error code 2)

And so on and so forth. Am I missing something obvious?

5 days ago

On Monday, 21 July 2025 at 13:29:23 UTC, Albert wrote:

>

Hi all,

I am completely new to D, wished to try it out and write a small app in it. However, for the last couple hours I am ready to pull my hair out as I have no idea how to compile even a simplest hello world app.

I installed ldc and dub (nowhere on the download page did it even mention that dub should be installed separately!) from home-brew, installed code-d for vscode, used the plugin to create a new project and that is as far as I've gotten.

For example the plugin prompts me to "Compile serve-d", however doing so just fails with:

Error Command failed with exit code 127: rdmd "/Users/albert/.dub/packages/dfmt/0.14.1/dfmt/dubhash.d"
Failed to install serve-d (Error code 2)

And so on and so forth. Am I missing something obvious?

I highly recommend using LDC2 from the official packages
https://github.com/ldc-developers/ldc/releases/tag/v1.41.0

I've additionally written a script that installs LDC 1.41 + various tools and the latest main branch dub you can use here
https://gist.github.com/LunaTheFoxgirl/3e14a3aa977c14398c902023e567268a

5 days ago

On Monday, 21 July 2025 at 13:52:52 UTC, Luna wrote:

>

On Monday, 21 July 2025 at 13:29:23 UTC, Albert wrote:

>

Hi all,

I am completely new to D, wished to try it out and write a small app in it. However, for the last couple hours I am ready to pull my hair out as I have no idea how to compile even a simplest hello world app.

I installed ldc and dub (nowhere on the download page did it even mention that dub should be installed separately!) from home-brew, installed code-d for vscode, used the plugin to create a new project and that is as far as I've gotten.

For example the plugin prompts me to "Compile serve-d", however doing so just fails with:

Error Command failed with exit code 127: rdmd "/Users/albert/.dub/packages/dfmt/0.14.1/dfmt/dubhash.d"
Failed to install serve-d (Error code 2)

And so on and so forth. Am I missing something obvious?

I highly recommend using LDC2 from the official packages
https://github.com/ldc-developers/ldc/releases/tag/v1.41.0

I've additionally written a script that installs LDC 1.41 + various tools and the latest main branch dub you can use here
https://gist.github.com/LunaTheFoxgirl/3e14a3aa977c14398c902023e567268a

Also as a sidenote, the homebrew release of the compiler is not maintained by the D Language Foundation and in general is relatively far behind upstream.

I recommend uninstalling any D tools you've installed via homebrew and install using the upstream methods.

The crashes you encounter are due to a change Apple made to their dynamic linker and thread local variable support in macOS 15.4. LDC 1.41 fixes this issue; and unlike DMD can compile for arm64.

5 days ago

On Monday, 21 July 2025 at 13:29:23 UTC, Albert wrote:

>

Hi all,

I am completely new to D, wished to try it out and write a small app in it. However, for the last couple hours I am ready to pull my hair out as I have no idea how to compile even a simplest hello world app.

I installed ldc and dub (nowhere on the download page did it even mention that dub should be installed separately!) from home-brew, installed code-d for vscode, used the plugin to create a new project and that is as far as I've gotten.

For example the plugin prompts me to "Compile serve-d", however doing so just fails with:

Error Command failed with exit code 127: rdmd "/Users/albert/.dub/packages/dfmt/0.14.1/dfmt/dubhash.d"
Failed to install serve-d (Error code 2)

And so on and so forth. Am I missing something obvious?

I agree with Luna that installing from official GitHub Releases are the easiest way.
There is also this project: https://code.dlang.org/packages/ldcup

regarding serve-d - you need to download the code from the github and build it locally with the latest LDC compiler.
It should fix the issue.

Also don't forget to switch the version of the "code-d" extension to "beta/nightly". Stable is very old and not updating properly.

5 days ago

On Monday, 21 July 2025 at 14:10:44 UTC, Serg Gini wrote:

>

On Monday, 21 July 2025 at 13:29:23 UTC, Albert wrote:

>

[...]

I agree with Luna that installing from official GitHub Releases are the easiest way.
There is also this project: https://code.dlang.org/packages/ldcup

regarding serve-d - you need to download the code from the github and build it locally with the latest LDC compiler.
It should fix the issue.

Also don't forget to switch the version of the "code-d" extension to "beta/nightly". Stable is very old and not updating properly.

The script I posted automates some of these steps by the way; so you'll just have to set the paths correctly in the plugin (/opt/SDKs/serve-d/bin/serve-d, /opt/SDKs/dcd/bin/dcd-server, /opt/SDKs/dcd/bin/dcd-client); then set the serve-d version as frozen.

5 days ago

On Monday, 21 July 2025 at 14:10:44 UTC, Serg Gini wrote:

>

Also don't forget to switch the version of the "code-d" extension to "beta/nightly". Stable is very old and not updating properly.
Thanks, how do I get the beta/nightly version? Only one I see is 0.23.1 from 2021. Thanks

5 days ago

On Monday, 21 July 2025 at 14:16:29 UTC, Luna wrote:

>

The script I posted automates some of these steps by the way; so you'll just have to set the paths correctly in the plugin (/opt/SDKs/serve-d/bin/serve-d, /opt/SDKs/dcd/bin/dcd-server, /opt/SDKs/dcd/bin/dcd-client); then set the serve-d version as frozen.

Thank you. This seems to have worked better! Though I am still getting errors:

Could not initialize DCD for

and in the output get a lot of:

2025-07-21T15:30:59.455 [warning] first.d:474:visit Could not resolve location of module 'std/stdio'
2025-07-21T15:30:59.455 [warning] first.d:474:visit Could not resolve location of module 'std/getopt'
2025-07-21T15:30:59.455 [warning] first.d:474:visit Could not resolve location of module 'std/json'
2025-07-21T15:30:59.455 [warning] first.d:474:visit Could not resolve location of module 'config'
2025-07-21T15:30:59.455 [warning] first.d:474:visit Could not resolve location of module 'std/file'
5 days ago

On Monday, 21 July 2025 at 14:32:49 UTC, Albert wrote:

>

On Monday, 21 July 2025 at 14:16:29 UTC, Luna wrote:

>

[...]

Thank you. This seems to have worked better! Though I am still getting errors:

Could not initialize DCD for

and in the output get a lot of:

2025-07-21T15:30:59.455 [warning] first.d:474:visit Could not resolve location of module 'std/stdio'
2025-07-21T15:30:59.455 [warning] first.d:474:visit Could not resolve location of module 'std/getopt'
2025-07-21T15:30:59.455 [warning] first.d:474:visit Could not resolve location of module 'std/json'
2025-07-21T15:30:59.455 [warning] first.d:474:visit Could not resolve location of module 'config'
2025-07-21T15:30:59.455 [warning] first.d:474:visit Could not resolve location of module 'std/file'

The script works by adding a special startup script to your shell session; as such you may need to restart your mac for it to fully work.

5 days ago

On Monday, 21 July 2025 at 14:25:57 UTC, Albert wrote:

>

Thanks, how do I get the beta/nightly version? Only one I see is 0.23.1 from 2021. Thanks

It's an option in the code-d extension settings.

5 days ago

On Monday, 21 July 2025 at 16:24:31 UTC, Luna wrote:

>

The script works by adding a special startup script to your shell session; as such you may need to restart your mac for it to fully work.

I've tried everything I can think of, now getting the following errors:

Could not initialize dub for /Users/albert/Developer/lbc-d. Falling back to limited functionality! Cannot use dub with invalid configuration, cannot list import paths needed for build and auto-complete. Selected config: '' (targetType: autodetect) - available: ["application", "library"] Try selecting a different configuration.

Sorry to be blunt, but not great first impression so far. I'm still trying to make this work, but stuck with no clue...

« First   ‹ Prev
1 2