December 20
None of that would be an issue if we had a c++ dump backend.

After that its just a matter of distribution for druntime/phobos, rather than a hard problem that has to be solved on a case by case basis.

But alas, that wasn't how D was built or structured.
December 20
On Tuesday, 19 December 2023 at 18:37:47 UTC, H. S. Teoh wrote:
> I'm a heavy Phobos user, and std.algorithm / std.range are among the best parts of Phobos.  Among the better modules are std.datetime, std.path, std.bigint, std.regex (I'm a regex addict). std.process is awesomely convenient for dealing with processes; one of the better-designed APIs in Phobos IMO.  std.math / std.numeric are pretty standard, with a few nice things in there, though there's that strangeness with real vs. double. std.stdio is also pretty standard, but could be improved (replace with I/O pipes?). I'm addicted to std.format for its convenience but the implementation really could use some improvement, same goes for std.conv. std.uni's implementation could also use some improvement, but what's there is pretty serviceable for dealing with Unicode (main missing features: Unicode line-breaking algorithm and grapheme width -- I have an incomplete implementation of the latter but never got around to finishing it).
>
> std.meta / std.traits / std.typecons are good for metaprogramming, though there are some weird bits.
>
> Other parts of Phobos are meh, like std.container (I use it from time to
> time but the API is klunky and rough around the edges), std.digest
> (never used it, kinda random why it's in Phobos), std.encoding (hardly
> ever use it), std.experimental (when it is coming out of deep freeze?),
> std.json (meh), std.xml (bleh).  std.getopt gets the job done, but has
> weird differences with standard Posix getopt() for no good reason, which
> made me write my own getopt on at least 3 separate occasions.
> std.signals - never used it, std.socket (meh), std.bitmanip (sometimes
> useful), std.base64 (kinda random, used it once or twice but that's
> about it -- honestly could just go in a dub library), std.csv (meh - my
> fastcsv alternative runs way faster, though with no validation).
> std.net.curl - weird API, std.net.isemail - seems like a totally random
> thing to put in Phobos.  A lot of this stuff honestly could do better as
> dub packages / external repos.

A great list and analysis!

-Steve
December 19
On 12/19/2023 5:26 PM, Richard (Rikki) Andrew Cattermole wrote:
> None of that would be an issue if we had a c++ dump backend.

I don't know what that is.

December 20
All it means is to convert D to C++ mechanically.

We have a partial implementation for C++ headers already.
December 20

On Wednesday, 20 December 2023 at 02:18:15 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

All it means is to convert D to C++ mechanically.

We have a partial implementation for C++ headers already.

GDC 11 is a C++ implementation. If somebody labelled it as a "2017 edition" of D language and kept this implementation in maintenance mode in future GCC releases, then it (together with its Phobos) could be used for bootstrapping any modern D compiler.

December 20
That isn't going to work long term.

We already have at least one more release in between that one and current versions.

Using the C++ dump approach is significantly better, you go immediately to the latest version. With the old bootstrap approach you have to maintain N frontends with their glue code indefinitely. It doesn't scale.
December 20

On Wednesday, 20 December 2023 at 00:34:18 UTC, Walter Bright wrote:

>

On 12/19/2023 12:59 PM, Steven Schveighoffer wrote:

> >

I spent a whole afternoon carefully reviewing the DIP, only to be told that wasn't what was implemented and I should read the code. That was a waste of time.

No, no you weren't. You were told exactly what the spec is. What you did was take the examples of things that are possible with the DIP (not the specification),

The dip was not the specification? The whole point of a dip is to be a specification. Where is the specification, then? Why is Atila reading the code and reverse engineering a specification for it?

Clarifying here. I said you were arguing against the examples, which were in the DIP. Not the specification which also was in the DIP. Examples are examples, not specification. They use the feature to demonstrate its utility. They aren't intended to be part of the language additions.

The DIP has 2 parts:

part 1: Description (specification), and it is complete
part 2: Use Cases <= you are here, looking for the specification.

It would be like looking at this part of DIP1010 and saying "where is the specification for the type Base? We can't add Base to the language, because it would be a breaking change for users who have made a type named Base! I can't continue review until this is resolved".

Which is not, of course, what happened. It was accepted. I don't know what the difference is or how to make you recognize it.

-Steve

December 20

On Tuesday, 19 December 2023 at 21:52:01 UTC, Adam D Ruppe wrote:

>

On Tuesday, 19 December 2023 at 21:42:40 UTC, jmh530 wrote:

>

I understand that. My point was just that still hasn't been resolved.

Steve suggested a separate import path flag for C imports. He explained

I still say the best thing to do is to ditch the overloading of the import keyword and instead embrace the mixin keyword.

mixinC;

you can now use the full file name, with .h or .c or whatever you want. And you can do this in context of D, meaning you can do things like :

@nogc {
mixinC;
}

And potentially use macros:

enum C_Context = mixin[C](#define foo bar);
mixin[C, C_Context](use foo here);

or something like that.

ImportC is a cool idea. It’s just got limitations right now that prevent it from being great. If rethinking it as mixin makes it smoother to use (does your idea resolve the duplicate symbol issue?), then it could make some sense.

I don’t know if it’s an either/or sort of thing, but I think you would need to introduce this with some sort of way to migrate existing importC code since importC wasn’t put behind a preview switch.

While you’re at it, a hypothetical D3 could have mixin[asm] and remove the asm block. You could also have mixin[C/asm] template {}.

December 20

On Wednesday, 20 December 2023 at 02:31:58 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

That isn't going to work long term.

We already have at least one more release in between that one and current versions.

It's only one frontend, which is frozen at version 2.076 of language features. However it's good enough to develop software. It could be probably kept alive and updated just enough to keep compatible with the current and future GCC backends.

>

Using the C++ dump approach is significantly better, you go immediately to the latest version.

This approach sounds super fragile and restrictive. Compared to a full fledged GDC 11 with a complete arsenal of its features and Phobos.

>

With the old bootstrap approach you have to maintain N frontends with their glue code indefinitely. It doesn't scale.

Only the "edition 2017" frontend. There's no need for N frontends. But yes, maintaining even one frontend is not free and somebody needs to take care of it.

December 20
On 20/12/2023 3:49 PM, Siarhei Siamashka wrote:
> However it's good enough to develop software.

But not good enough to compile current releases of the frontend.

We currently have a chain of compilers if you want to bootstrap latest compiler from C++.

That chain can only get longer.