www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Phobos and the Tools repo are now on DUB

reply Seb <seb wilzba.ch> writes:

It's now possible to access the latest version of Phobos's 
experimental packages through dub:

#!/usr/bin/env dub
dependency "phobos:checkedint" version="~master"

void main(string[] args)
     import stdx.checkedint; // From latest Phobos
     import std.stdio; // DMD's Phobos
     writeln("checkedint: ", 2.checked + 3);


For now, only checkedint and allocator are exposed as subpackages.


1) Why stdx and not std.experimental?

Otherwise the linker would run into symbol conflicts.

2) Why ~master?

D's versioning doesn't conform with SemVer yet. There are plans 
to change it soon though.

3) What's the purpose?

Allow usage of experimental packages like 
std.experimental.allocator for Dub packages.
For example, at the moment the upcoming collections library 
(https://github.com/dlang-stdx/collections),  doesn't compile 
with stable dmd or ldc as it depends on very recent changes in 
the std.experimental.allocator.

4) What are the next steps?

At the moment the "allocator" sub package doesn't fully work as 
some parts of the allocator module depend on package(std) parts 
of Phobos (e.g. std.conv.emplaceRef). So fixing this is of course 
the next step. However, for now, there are no plans to expose the 
more stable parts of Phobos on dub.

5) Wait. Aren't Phobos and DMD supposed to be built in sync?

It's certainly true that Druntime has a lot of dependencies on 
DMD, but most modules in Phobos (except e.g. std.traits or 
std.math) don't have such a strong dependence. This especially 
applies to the experimental modules which were originally 
developed as dub packages (and probably should have stayed on 

6) What are your guarantees for stability?

None. This is experimental.


Almost all tools in the tools repo 
(https://github.com/dlang/tools) can be built & run with dub now.
For example, this converts your Windows files to Posix file 

dub fetch dtools
dub run dtools:tolf -- mywindowsfile.d

The long-term goal here is to replace the win32.mak with a pure 
D/Dub build file.
Jun 25 2018
parent Seb <seb wilzba.ch> writes:
On Monday, 25 June 2018 at 21:34:43 UTC, Seb wrote:
I forgot the links to the DUB registry: https://phobos.dub.pm https://dtools.dub.pm
Jun 25 2018