July 20, 2022

On Wednesday, 20 July 2022 at 09:35:14 UTC, Templated Person wrote:

>

On Wednesday, 20 July 2022 at 07:23:04 UTC, Nicholas Wilson wrote:

>

We have multiple GC's

Do we really have multiple GCs though? How do you we use them, what are the advantages / disadvantages of each one?

Yes, there is the standard (conservative) GC, there is a Precise GC (which is really the same as the standard GC but with a precise sweep), and there is a fork GC (which is only for linux) which is different to the other two.
I believe you can choose which one with a --DRT flag, and I think you can set some config at runtime in druntime somewhere, but I'm not sure. I've not bothered to change it.

The standard GC is a stop the world, conservative mark and sweep. It treats any value that looks like it could point to valid objects to be pointers (called false pointers). False pointers are only really a problem on 32-bit, which unless you are writing for microcontrollers are going the way of the dodo.
The precise GC is a stop the world, precise mark and sweep. Advantage: should not ever get confused by false pointers. Disadvantage often slower than the conservative GC.
Fork GC forks the current process and uses linux's cheap copy on write pages to mark dead objects asynchronously and then reap them. Advantages: not stop the world, asynchronous, usable in soft (and probably hard) realtime. Disadvantages: Linux only.

> >

there is also std.experimental.allocator

Which is useless until Phobos data types are refactored to use that as a parameter.

Theres not really that many "data" types in the standard library. We should have a better container library that should be parameterised by the allocator that backs it, but the advantages of ranges is most of the code doing computation doesn't care what the memory is that backs it.

>

If you ask me, D is better than most languages out there and it should be the default way of migrating out of C++. But that's not gonna happen until at least multiple of the following happens:

  • The runtime gets leaner and more configurable, gotta have that wasm support.

LDC has (some?) support for WASM, and the runtime is becoming less reliant on TypeInfo, by becoming templated to what is actually used. I'm not sure how far away we are from a no typeinfo runtime being usable.

>
  • Modern features such as sum types & pattern matching, nullables & tuples in the language (not as libraries).

Good tuples would be very nice to have.

>
  • Allocators passed into functions (+ a "garbage collecting allocator" like we have now)

There is nothing stopping you from doing that now. I'm not sure what you mean here.

July 20, 2022

On Wednesday, 20 July 2022 at 12:27:07 UTC, Nicholas Wilson wrote:

>

[snip]
There is nothing stopping you from doing that now. I'm not sure what you mean here.

I think he meant in the standard library. One thing that might be interesting is a blog post that just summarizes some basic information on what in the standard library is compatible with @nogc and what currently isn't usable with @nogc.

July 20, 2022

On Tuesday, 19 July 2022 at 16:57:29 UTC, Ola Fosheim Grøstad wrote:

>

On Tuesday, 19 July 2022 at 16:27:25 UTC, Tejas wrote:

>

There is a new language that claims to be the successor to C++ in town, and it's got Google's funding 😥

It's called carbon

https://github.com/carbon-language/carbon-lang

What do you folk think?

It is v0.1, so I cannot really tell what it will be like, but it my immediate reaction is that this looks like something a Rust programmer being forced to write in C++ would come up with.

Why would I want to write "fn" before functions and "var" in classes? Right now it seems to provide more downsides than upsides and is too close to C++ to be worthwhile, but it is v0.1, so who knows?

It's clearly Rust--.

July 20, 2022

https://github.com/carbon-language/carbon-lang/tree/trunk/docs/design#choice-types

They got tagged union built in! as well as .Enum and pattern matching!

What are we waiting for? We failing behind

July 20, 2022

On Wednesday, 20 July 2022 at 14:31:49 UTC, ryuukk_ wrote:

>

https://github.com/carbon-language/carbon-lang/tree/trunk/docs/design#choice-types

They got tagged union built in! as well as .Enum and pattern matching!

What are we waiting for? We failing behind

We're waiting for someone with the skills and motivation to add all that to dmd while ensuring it doesn't break the compiler in subtle ways, and is willing to go to through the DIP process

Basically, we lack the $$$

July 20, 2022
> On Wednesday, 20 July 2022 at 14:31:49 UTC, ryuukk_ wrote:
> > https://github.com/carbon-language/carbon-lang/tree/trunk/docs/design#choice-types
> > 
> > They got tagged union built in! as well as .Enum and pattern matching!
> > 
> > What are we waiting for? We failing behind
[...]

We are waiting for highly-motivated and skilled people like you to submit DIPs and PRs to implement these features in D.


T

-- 
"The number you have dialed is imaginary. Please rotate your phone 90 degrees and try again."
July 20, 2022
On Wednesday, 20 July 2022 at 16:40:14 UTC, H. S. Teoh wrote:
>> On Wednesday, 20 July 2022 at 14:31:49 UTC, ryuukk_ wrote:
>> > https://github.com/carbon-language/carbon-lang/tree/trunk/docs/design#choice-types
>> > 
>> > They got tagged union built in! as well as .Enum and pattern matching!
>> > 
>> > What are we waiting for? We failing behind
> [...]
>
> We are waiting for highly-motivated and skilled people like you to submit DIPs and PRs to implement these features in D.
>
>
> T

Lol! :D
July 20, 2022
On Wednesday, 20 July 2022 at 16:40:14 UTC, H. S. Teoh wrote:
>> On Wednesday, 20 July 2022 at 14:31:49 UTC, ryuukk_ wrote:
>> > https://github.com/carbon-language/carbon-lang/tree/trunk/docs/design#choice-types
>> > 
>> > They got tagged union built in! as well as .Enum and pattern matching!
>> > 
>> > What are we waiting for? We failing behind
> [...]
>
> We are waiting for highly-motivated and skilled people like you to submit DIPs and PRs to implement these features in D.
>
>
> T

Let's not suggest anything then, let's accept your faith and become irrelevant

I'll just use a different language, i'm fine with that personally, what ever empowers me, i'm only just a mere language user after all, who cares about the users when you have compiler developers telling language users to submit PRs to implement their suggestion ;)


July 20, 2022
On Wednesday, 20 July 2022 at 17:19:33 UTC, ryuukk_ wrote:
> On Wednesday, 20 July 2022 at 16:40:14 UTC, H. S. Teoh wrote:
>>> On Wednesday, 20 July 2022 at 14:31:49 UTC, ryuukk_ wrote:
>>> > https://github.com/carbon-language/carbon-lang/tree/trunk/docs/design#choice-types
>>> > 
>>> > They got tagged union built in! as well as .Enum and pattern matching!
>>> > 
>>> > What are we waiting for? We failing behind
>> [...]
>>
>> We are waiting for highly-motivated and skilled people like you to submit DIPs and PRs to implement these features in D.
>>
>>
>> T
>
> Let's not suggest anything then, let's accept your faith and become irrelevant
>
> I'll just use a different language, i'm fine with that personally, what ever empowers me, i'm only just a mere language user after all, who cares about the users when you have compiler developers telling language users to submit PRs to implement their suggestion ;)

Downloads still down btw, sending PRs myself doesn't even work, if nobody left to drive the car

https://github.com/dlang/dlang.org/pull/3344

What's your suggestion for that?

July 20, 2022

On Wednesday, 20 July 2022 at 13:46:25 UTC, Kagamin wrote:

>

It's clearly Rust--.

They already have a bunch of fans that defends poorly thought out aspects of the syntax that a usability analysis ought to have uncovered. So I think we can expect that Google will move ahead with it… as it is already «popular» on social media…

Reminds me of how Google created Dart as dynamic language, then as an afterthought made a U-turn and redesigned it to become more like Java. Or how Go doesn't have exceptions, then added a hackish «panic» solution . How they didn't have generics, then added a weak generics design many years later. Also the Go dynamic arrays uses slices that will split when you extend it, so that you have two arrays instead of one as a surprise. (D also has this flaw).

Designers are often not good at being objective about their own design, so I would expect a large organisation like Google to use usability experts and make sure to get an external usability evaluation and also an external critical examination of semantics before the design is presented to the world.

Makes you wonder what the internal project management is like?