January 01, 2021
On Thursday, 31 December 2020 at 19:57:53 UTC, Ola Fosheim Grøstad wrote:
> On Thursday, 31 December 2020 at 19:27:23 UTC, Sebastiaan Koppe wrote:
>> On Thursday, 31 December 2020 at 16:03:54 UTC, Ola Fosheim Grøstad wrote:
>>> What would you like to see?
>>
>> For shared to mean something.
>> Stackless coroutines.
>> Compile-time lifetime management, i.e. better ways to define ownership.
>
> I second that. At least some way to know whether a pointer takes ownership (GC/RC) or just is an auxiliary reference.

i agree with this, C++ has GC, smart pointer and even some facilities for ownership via various move semantic

that is an area where D could improve, but that would be catch up with C++..

one big move would be to finally put the allocators out of std.experimental, and finally embrace this everywhere (just like ziglang)
January 01, 2021
On Friday, 1 January 2021 at 15:01:15 UTC, RSY wrote:
> one big move would be to finally put the allocators out of std.experimental, and finally embrace this everywhere (just like ziglang)

I am bit torn on this, the less the compiler knows about allocation strategies, the less opportunity there are for the compiler to be smart about allocations. So, those things ought to be language constructs, not library constructs.

At least if D is going to stay in the lane of high level programming. (Zig is firmly staking ground in the manual-labour department, as far as I can tell.)

January 01, 2021
On Friday, 1 January 2021 at 15:12:43 UTC, Ola Fosheim Grøstad wrote:
> On Friday, 1 January 2021 at 15:01:15 UTC, RSY wrote:
>> one big move would be to finally put the allocators out of std.experimental, and finally embrace this everywhere (just like ziglang)
>
> I am bit torn on this, the less the compiler knows about allocation strategies, the less opportunity there are for the compiler to be smart about allocations. So, those things ought to be language constructs, not library constructs.
>
> At least if D is going to stay in the lane of high level programming. (Zig is firmly staking ground in the manual-labour department, as far as I can tell.)

Slightly off but also on topic but, has there been any general consensus yet around standard pointer types (e.g. shared_ptr) and standard allocator-aware data structures, or just in general any discussions around non-GC memory management as part of Phobos/core parts of D outside of "use/write a library"?

(And for completely off-topic: What are the plans for std.experimental packages right now? Is std.experimental.logging just going to sit there until the end of time?)
January 01, 2021
On Friday, 1 January 2021 at 16:23:45 UTC, SealabJaster wrote:
> Slightly off but also on topic but, has there been any general consensus yet around standard pointer types (e.g. shared_ptr) and standard allocator-aware data structures, or just in general any discussions around non-GC memory management as part of Phobos/core parts of D outside of "use/write a library"?

I don't know anything about any official positions other than the fact that Walter dislikes having more than one pointer type and is working on some kind of "liveness" verification for a C-style free/malloc regime, which is rather rare in other languages these days. Not really sure how that fits with modern code bases.

Isn't there some work on move-semantics to make C++ interfacing better? But shared_ptr is only for C++ interop, perhaps? Or is it meant for D-code?

To me it looks like things are a bit up-in-the-air at the moment.

And well, having many options that are incompatible would not be good for library interop, so choices have to be made to avoid "tower of Babel".

*shrugs*

January 01, 2021
On Thursday, 31 December 2020 at 07:17:45 UTC, RSY wrote:
> On Wednesday, 30 December 2020 at 21:03:36 UTC, Paulo Pinto wrote:
>> On Thursday, 24 December 2020 at 08:36:54 UTC, RSY wrote:
>>> On Wednesday, 23 December 2020 at 19:00:14 UTC, evilrat wrote:
>>>> [...]
>>>
>>> C++ you need to write duplicate code (.h and .cpp)
>>>
>>> C++ you need to care about header include order
>>>
>>> C++ you need to forward declare everything you gonna use if it is not included before
>>>
>>> C++ you need to waste time waiting for compile
>>>
>>
>> Fixed with C++20 modules.
>>
>> I am already playing with the experimental support on VC++.
>>
>>> C++ you need to fight to get proper reflection
>>>
>>
>> Coming in C++23, and partially available already with a mix of type traits and constexpr.
>>
>>
>> I am all good for D vs C++, but one needs to update their knowledge specially when the audience is up to date with latest ISO C++'s capabilities.
>
> It's like the story with the GC
>
> You want everyone to like D because it has a GC despite it being not updated in ages, and proved to not scale well
>
> You do the same with modules and reflections now, D is clearly better but for some reasons you don't want people to believe that, worse you want people to see them as inferior to the poor C++ one, because you clearly didn't mention any of that poor 1 phase compilation model
>
> What is your goal here? you for sure don't want D to take off

It would be nice to see D taking off, I just happen not to be blind to the competition.

That is the beauty of being an enterprise polyglot consultant, I get to pick what customers want, and they want eco-systems and platforms.

Which not only use GC in domains that D fails to, also get to catch up with almost every feature that made D a better choice 10 years ago.

Blind advocacy won't get new users.
January 01, 2021
On Friday, 1 January 2021 at 16:45:16 UTC, Ola Fosheim Grøstad wrote:
> I don't know anything about any official positions other than the fact that Walter dislikes having more than one pointer type and is working on some kind of "liveness" verification for a C-style free/malloc regime, which is rather rare in other languages these days. Not really sure how that fits with modern code bases.
>
> Isn't there some work on move-semantics to make C++ interfacing better? But shared_ptr is only for C++ interop, perhaps? Or is it meant for D-code?
>
> To me it looks like things are a bit up-in-the-air at the moment.

Unsurprising answers unfortunately :(

As for the move-semantics, I know that DIP 1014 was accepted, but I don't know anything beyond that (haven't really looked into it at all tbh).

> And well, having many options that are incompatible would not be good for library interop, so choices have to be made to avoid "tower of Babel".

This is a concern of mine, especially when D touts about the GC being optional, but I do have doubts about any ground being made on this front, either in discussions, decisions, or implementations, within the next year or two.

Meanwhile I believe C++ (keep in mind I very rarely touch or look at C++) already has a standard allocator interface that parts of the STL (and I assume libraries, when/if they care) are able to use? I'm unaware of the issues it might have in C++, but that's mostly because of my lack of use and knowledge of the language. It has standard pointer types, etc.

I wonder what problems D faces in comparison to C++ and other languages in this regard, since it's been in a limbo, fragmented state for a while now.
January 01, 2021
On Friday, 1 January 2021 at 18:00:57 UTC, SealabJaster wrote:
> Meanwhile I believe C++ (keep in mind I very rarely touch or look at C++) already has a standard allocator interface that parts of the STL (and I assume libraries, when/if they care) are able to use? I'm unaware of the issues it might have in C++, but that's mostly because of my lack of use and knowledge of the language. It has standard pointer types, etc.

So, C++ had the same issues as D prior to C++11, that you had many many different options, but none of them were standard... Which was ok if you used one big framework, but if you wanted to mix libraries... yuck. Since C++11 things are looking better although it obviously takes time for frameworks/libraries to catch up.

In C++ everything is up to the library/programmer so there is basically no way for the compiler to be particularly clever with heap allocations, although it can be clever with values (e.g. stack allocations).  So, that is an area where D could be bold make the compiler smart, and do better than C++, but that takes some courage.

C++ smart pointers do allow for custom allocators, but then the owning pointers will have an extra field for referencing it, which is used for deallocation. I suspect most people don't use it, but it might be important for creating nice C++ wrappers for C libraries?

> I wonder what problems D faces in comparison to C++ and other languages in this regard, since it's been in a limbo, fragmented state for a while now.

Mostly a lack of strategic decision making? Just map out the various alternatives and pick a combination that is "wholesome".

(Do you want to be a bird and fly or a fish that can swim? Being neither bird nor fish isn't working in the long run, I don't think so.)

1 2 3 4 5
Next ›   Last »