Skip to content

Wrote DUB introduction in index page.#84

Merged
WebFreak001 merged 2 commits intodlang:masterfrom
renatoathaydes:better-intro
Sep 3, 2025
Merged

Wrote DUB introduction in index page.#84
WebFreak001 merged 2 commits intodlang:masterfrom
renatoathaydes:better-intro

Conversation

@renatoathaydes
Copy link
Copy Markdown
Contributor

I had trouble understanding where DUB lies in comparison with other build tools as I was learning it, so I decided to write an introduction that would've really helped me (and others like me) understand it quickly.

@netlify
Copy link
Copy Markdown

netlify bot commented Jan 10, 2024

Deploy Preview for dub-registry ready!

Name Link
🔨 Latest commit f6da8df
🔍 Latest deploy log https://app.netlify.com/sites/dub-registry/deploys/65a02c82878e760008509749
😎 Deploy Preview https://deploy-preview-84--dub-registry.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

docs/index.md Outdated
DUB is a build tool similar to other modern languages build tools like Javascript's [npm](https://www.npmjs.com/)
and Rust's [cargo](https://crates.io/).

A file called `dub.sdl` (or `dub.json`) is used to configure a DUB project.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, that is called the "recipe file"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would mention the 3 files that drive dub:

  • Recipe file, per project;
  • Selections file, or lock file, tied to a recipe file;
  • Configuration file, which can be at project, user, or system scope;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configuration file refers to this one? https://dub.pm/dub-reference/settings/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've edited the text to mention all three files.

docs/index.md Outdated

A file called `dub.sdl` (or `dub.json`) is used to configure a DUB project.

> [SDL](https://sdlang.org/) is a "Simple Declarative Language" inspired by D's syntax.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is inspired by D's syntax though

Copy link
Copy Markdown
Member

@PetarKirov PetarKirov Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, SDL is an independent project (possibly, but I don't remember, implemented first in a language other than D). After various community members compared different alternatives to JSON, SDL stood out as the one most fitting Dub.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think I just guessed it :D. I will remove that comment then.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed this passage, let me know if it's ok now.

[DUB Configurations](dub-reference/configurations.md) are used to create different variations of a project.

In the above example, all configurations include a dependency on `libasync` because that's declared at the top-level,
but only the `unittest` configuration includes the dependencies `tested` and `dshould`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for yourself: There is a longstanding bug in dub and that is currently not the case. But we intend to fix it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... but does the test lib actually get included in the compiled binaries?

@Geod24
Copy link
Copy Markdown
Member

Geod24 commented Jan 10, 2024

Thanks for taking the time to do this!

@WebFreak001 WebFreak001 merged commit 54f3bce into dlang:master Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants