October 20, 2021

On 10/20/21 10:40 AM, Mathias LANG wrote:

>

On Wednesday, 20 October 2021 at 13:39:22 UTC, Steven Schveighoffer wrote:

>

Naming conflicts with other package names is not the problem. It's the fact that the no-package module conflicts with anything else in your namespace, including imports from other modules.

IMO it is also a problem. As the number of packages grow, so will the risk of conflict.

Yes, but it's more of a garden variety naming conflict that can happen in any ecosystem. Not the same as the weird status of top-level module or package names in D.

-Steve

October 20, 2021

On Wednesday, 20 October 2021 at 13:39:22 UTC, Steven Schveighoffer wrote:

>

e.g. try to name a function std, then import std.stdio. You will get a failure.

Whereas if you name your function stdio, then everything works fine.

Huh. Yep, it sure does:

import std.stdio;

// Error: variable `onlineapp.std` conflicts with import `onlineapp.std` at onlineapp.d(1)
int std;

void main()
{
    writeln("Hello world!");
}

Honestly I would classify this as a straight-up bug. According to the spec on Symbol Name Lookups, this program should work fine.

October 27, 2021

On Tuesday, 19 October 2021 at 15:15:29 UTC, newbie wrote:

>

Hi Mathias LANG,

I use your alpine LDC package and it work well, but the version is 1.26 and now 1.28 will release anytime.

Are your plan to upgrade it to 1.28?

Hi Mathias LANG,

It has been 6 month since latest alpine LDC release, and now alpine LLVM already upgrade to LLVM12. I hope there is any plan or roadmap to share with community.

October 28, 2021

On Wednesday, 27 October 2021 at 06:30:43 UTC, newbie wrote:

>

It has been 6 month since latest alpine LDC release, and now alpine LLVM already upgrade to LLVM12. I hope there is any plan or roadmap to share with community.

LDC v1.28.0 just hit edge today and will be part of 3.15.
Dub and rdmd have been rebuilt too. Currently working on DMD.

October 29, 2021

On Thursday, 28 October 2021 at 09:18:51 UTC, Mathias LANG wrote:

>

On Wednesday, 27 October 2021 at 06:30:43 UTC, newbie wrote:

>

It has been 6 month since latest alpine LDC release, and now alpine LLVM already upgrade to LLVM12. I hope there is any plan or roadmap to share with community.

LDC v1.28.0 just hit edge today and will be part of 3.15.
Dub and rdmd have been rebuilt too. Currently working on DMD.

Thanks for the great work, now I am able to remove a lot workaround to keep backward compatible.

October 29, 2021

On Tuesday, 19 October 2021 at 04:03:38 UTC, Mathias LANG wrote:

>

I was looking at a few packages recently, and noticed a bothering trend: Single-module libraries ending up at the top level.

Why is it bothering ? Well, here's a little puzzle: Does the following code compile?

import std.stdio;

void main ()
{
    writeln(foo.stringof);
}

The answer is "maybe". In most case, it will not. However, if the file this resides in is named foo.d, it will compile. Because the module name accounts for an identifier that can be addressed in the scope of the module (and other modules that import it).

This is ultimately because D modules just reuse the notion of import paths from C. I had to find a better way in my language in order to handle self-rebuilds, where there's name collisions between compiler runtime and compiled runtime packages, but the same approach would also solve the issue in D, so let me outline it.

Basically, we replace import paths (-I~/.dub/packages/bla/src) with package paths:

-Pbla:~/.dub/packages/bla/src

As you can see, each package is named. This allows us to explicitly specify which packages a package can see and access:

-Pmain:src:bla,bla2

As it walks imports, the compiler tracks each module's package. When evaluating an import statement, only files in the current package or a direct dependency of the current package are considered.

Thus, your 'foo' problem will only happen if you directly depend on package "foo" in your dub.json.

This approach is fully backwards compatible with include paths. It also allows other funky things, such as per-package settings (-i, -deps, -g, -debug etc) which solves a whole host of problems with dub. For instance, a static library can safely be used, even if the main program's source is being built with different flags.

1 2
Next ›   Last »