November 14, 2023

On Tuesday, 14 November 2023 at 18:24:09 UTC, Paolo Invernizzi wrote:

>

On Tuesday, 14 November 2023 at 18:01:36 UTC, Guillaume Piolat wrote:

>

On Tuesday, 14 November 2023 at 15:05:34 UTC, Steven Schveighoffer wrote:

>

[...]

+1 and only the introduction of edition has this problem, it's a one time cost for the ecosystem.

+1 too

+1 to Steven’s approach

Idk why DLF don’t like KISS approach :(

November 14, 2023

On Tuesday, 14 November 2023 at 17:57:36 UTC, Steven Schveighoffer wrote:

>

[snip]
That's not any better. If you have to opt-in to the language as it exists, people are going to quit immediately. I'm not joking about this. Imagine spending 2 hours trying to figure out why your app that is trying out some new feature doesn't compile, only to find out after posting online that it was looking at some ancient version of phobos.

-Steve

You are describing my first attempt to attempt to use "modern C++" features. Certainly didn't want me to learn any more C++.

November 14, 2023

On Tuesday, 14 November 2023 at 18:40:58 UTC, Adam D Ruppe wrote:

>

[snip]

But for existing libraries, I actually have a potential solution for that: made dub look at the version tag date.

So, suppose dub determines it wants to use abandoned-library version 1.4. It knows version 1.4 was tagged on December 25, 2016.

This could automatically go ahead and add -edition=abandoned.library=2.092 to the build command for that lib.

Notice that build command used a package specifier, if an edition is specified on the command line, it MUST be scoped to a specific module (or D package, just like how -i works) so when it is imported, the compiler can attach the edition tag there without affecting other things in the build.

It would basically work like you pass -edition=abandoned.library=2.092 on the cmd line and the compiler acts exactly the same as if you wrote @edition(2.092) when it sees module abandoned library.

On the other hand, suppose dub sees a new tag, version 2.0, created in 2024. This will be edition 2.107 since it has a date range to version map.

We'd have to work out the exact details, but just since dub knows the tag date it can make a pretty good automatic guess as to the proper version.

To bikeshed a little, dub has the concept of subConfigurations that you use to pass a configuration to a dependency. This is kind of like a subEdition so `subEdition "abandoned.library" 2.092. Or something like that would be a bit more consistent.

November 14, 2023

On Tuesday, 14 November 2023 at 19:13:38 UTC, Steven Schveighoffer wrote:

>

As I understand the current thinking, that is not what D is intending to do.

Additional changes don't require a new edition to be enabled, only breaking changes. I expect editions to mostly subtract code, by turning existing deprecations into errors and enabling preview switches like nosharedaccess, dip1000, fixImmutableConv, systemVariables.

November 14, 2023

On Tuesday, 14 November 2023 at 08:18:20 UTC, Mike Parker wrote:

>

The future of D

Robert had been itching to talk about our long-term plans for D. I think most of us understood that he was talking in terms of language features, but in this session, he explained that's not what he meant. D started as a successor to C and C++, but he doesn't see the language that way. He sees it as the best parts of C, Haskell, and Python. Others may see it differently. So how do we define the language going forward? What role do we want it to play? Are we mostly concerned with C-style stuff where every bit counts? Do we see D as a great tool for one-off scripts that would normally be written in something like Python?

D is not and has never been a c replacement language, your not Zig, there's a very real dependency on gc(and no @nogc/betterc doesn't change that, you have first-class dynamic arrays based on the gc) theres a grand total of 3 platforms where d is stable and it will never be the portable asm of C; no embedded, no gnu, no unix, and no credible aspirations to change that.

D is a c++ replacement, c++ isn't very good at its job, and while I dont know how somehow aa managed to convince walter to merge in lots of quality of life stuff for the template hell. Please focus on making the template hell, survivable and either take it upon yourself to make the stl or enable its conditions.

D isn't haskell, sumtypes aren't even a first-class abstraction I simply don't know what someone could've said that made that on the table.

~~python sucks and is irrelevant ~~

November 15, 2023

On Tuesday, 14 November 2023 at 21:13:34 UTC, monkyyy wrote:

>

On Tuesday, 14 November 2023 at 08:18:20 UTC, Mike Parker wrote:

>

The future of D

Robert had been itching to talk about our long-term plans for D. I think most of us understood that he was talking in terms of language features, but in this session, he explained that's not what he meant. D started as a successor to C and C++, but he doesn't see the language that way. He sees it as the best parts of C, Haskell, and Python. Others may see it differently. So how do we define the language going forward? What role do we want it to play? Are we mostly concerned with C-style stuff where every bit counts? Do we see D as a great tool for one-off scripts that would normally be written in something like Python?

D is not and has never been a c replacement language, your not Zig, there's a very real dependency on gc(and no @nogc/betterc doesn't change that, you have first-class dynamic arrays based on the gc) theres a grand total of 3 platforms where d is stable and it will never be the portable asm of C; no embedded, no gnu, no unix, and no credible aspirations to change that.

D is a c++ replacement, c++ isn't very good at its job, and while I dont know how somehow aa managed to convince walter to merge in lots of quality of life stuff for the template hell. Please focus on making the template hell, survivable and either take it upon yourself to make the stl or enable its conditions.

D isn't haskell, sumtypes aren't even a first-class abstraction I simply don't know what someone could've said that made that on the table.

~~python sucks and is irrelevant ~~

>

Do we see D as a great tool for one-off scripts that would normally be written in something like Python?

D has replaced every single file Python script that I use. Fast build times (DMD), multiple programming paradigms, and concurrency support are huge wins for D over languages like Python.

The major advantage with D (over Python) is building/maintaining scalable applications (i.e. more than one file, but several thousand or hundred thousand lines of code). Talking to several engineers over that past few years in a few big tech companies -- they have spent a significant amount of time rewriting their code from Python to C++ because of issues with Python (performance and dynamic typing being culprits in Python). Too bad they did not start with D to avoid a rewrite! :)

> >

What do we want the first experience with D to be like?

> >

A person trying out D, who writes a one-file simple application using phobos does not care that a lib abandoned in 2018 still compiles. So why should they be the ones paying the penalty?

I just want to echo Steve's sentiment, that it should be easy for new (and old) D users to start up a project without worrying about editions. Reducing friction is incredibly important for adoption and usage. If the library writer specifies the 'edition' within their own module and it's totally encapsulated, that seems fine -- I think that is what I understand from the editions proposal (and if they don't specify the edition, it defaults to whatever the compilers default edition is).

I'd be curious to hear what folks working on tooling (IDE, linters, etc.) concerns are with editions. Having more tooling support is the main request I hear from students (Again, maybe this is already answered with DMD as a library in progress).

November 15, 2023

On Wednesday, 15 November 2023 at 02:27:42 UTC, Mike Shah wrote:

>

I just want to echo Steve's sentiment, that it should be easy for new (and old) D users to start up a project without worrying about editions.

Actually, this brings another question to mind: what about old users who keep up with the language? Do they need to edit dozens or hundreds of files on each and every language update? (Of course, making a script do this for you wouldn't be especially difficult, but I don't trust scripts to edit my code soooooo lol and besides, what about things like ddoc examples, will it edit them too?)

I actually rarely need to edit my code in response to new dmd versions now, and they remain compatible across users with old and new compilers alike. Would be a pity to throw that off.

November 15, 2023

On Tuesday, 14 November 2023 at 17:57:36 UTC, Steven Schveighoffer wrote:

>

That's not any better. If you have to opt-in to the language as it exists, people are going to quit immediately. I'm not joking about this. Imagine spending 2 hours trying to figure out why your app that is trying out some new feature doesn't compile, only to find out after posting online that it was looking at some ancient version of phobos.

You won't have to spend two hours figuring out. If you use a feature from a later edition, the compiler will give you an error and tell you what you need to do.

I think it's much more frustrating to pull down a new version of the compiler and find your current project breaks. You shouldn't have to change your code or adjust your build system to use a new version of the compiler. It should just work.

November 15, 2023

On Wednesday, 15 November 2023 at 02:27:42 UTC, Mike Shah wrote:

>

I just want to echo Steve's sentiment, that it should be easy for new (and old) D users to start up a project without worrying about editions. Reducing friction is incredibly important for adoption and usage. If the library writer specifies the 'edition' within their own module and it's totally encapsulated, that seems fine -- I think that is what I understand from the editions proposal (and if they don't specify the edition, it defaults to whatever the compilers default edition is).

It's just like any other language feature you have to learn. The documentation will be clearly divided by edition. You'll have one section for the base language (the default edition) and one for each subsequent edition. You can jump in an use the default language without caring about editions. Then when you want to learn more, say sumtypes and tuples from edition N, the documentation, tutorials, and example code you see should make it very clear that you need to specify edition N. And the documentation for edition N will explain all the changes that edition makes.

If someone misses all of that and tries to use tuples without specifying edition N, the compiler should be able to tell them what the problem is, how to solve it (annotate your module declaration with @edition(N)), and provide the URL to the relevant documentation.

The problem with changing the default for each compiler version means in effect there is no default, and downloading any new version means potential breakage that requires extra steps to fix, whether you're a beginner or not. We want to eliminate the need for extra steps.

November 15, 2023

On Wednesday, 15 November 2023 at 02:38:38 UTC, Adam D Ruppe wrote:

>

On Wednesday, 15 November 2023 at 02:27:42 UTC, Mike Shah wrote:

>

I just want to echo Steve's sentiment, that it should be easy for new (and old) D users to start up a project without worrying about editions.

Actually, this brings another question to mind: what about old users who keep up with the language? Do they need to edit dozens or hundreds of files on each and every language update? (Of course, making a script do this for you wouldn't be especially difficult, but I don't trust scripts to edit my code soooooo lol and besides, what about things like ddoc examples, will it edit them too?)

The goal is that you will never have to touch those dozens or hundreds of files when you update to a new version of the compiler. That old code will benefit from any bug fixes in the newest compiler versions, but will always compile.

If and when you're ready to make use of a new feature from a newer edition, e.g., tuples from Edition N, then you take three steps:

  1. fork your project
  2. run the fix tool on however many modules/packages you want/need to
  3. manually touch up whatever the fix tool couldn't handle automatically

That should cover any modifications required for changed/removed features, and now you can use tuples in those updated modules.

That's the idea, anyway, as I currently understand it.