Thread overview
Rethinking the default class hierarchy: Milestone 2, Week 1
Oct 24, 2021
Robert Aron
Oct 25, 2021
Tejas
Oct 25, 2021
rikki cattermole
Oct 25, 2021
Tejas
October 24, 2021

Project description
SAOC projects

Hello!

Last week I managed to do the following tasks for #SAOC2021:

  • started to reorganize the code
  • implemented interfaces and mixins for toHash
  • decided the order of PRs I must make next week (first I will add the ProtoObject class in druntime and after that I will add the code that makes ProtoObject the root of Object in dmd)

The plan for the next week:

  • make PRs to druntime and dmd repos
  • continue to reorganize the code
  • prepare the next PRs - remove __monitor from ProtoObject and add a new class SynchronizedProtoObject (with __monitor)
October 25, 2021

On Sunday, 24 October 2021 at 19:57:05 UTC, Robert Aron wrote:

>

Project description
SAOC projects

Hello!

Last week I managed to do the following tasks for #SAOC2021:

  • started to reorganize the code
  • implemented interfaces and mixins for toHash
  • decided the order of PRs I must make next week (first I will add the ProtoObject class in druntime and after that I will add the code that makes ProtoObject the root of Object in dmd)

The plan for the next week:

  • make PRs to druntime and dmd repos
  • continue to reorganize the code
  • prepare the next PRs - remove __monitor from ProtoObject and add a new class SynchronizedProtoObject (with __monitor)

Sorry, I haven't been up to date with this project, but is one of the goals of this project making classes available in betterC mode? I think that will remove the need for extern(C++) classes and also factor into making std.v2 betterC compatible and help make the entire D ecosystem more coherent.

October 25, 2021
On 25/10/2021 6:48 PM, Tejas wrote:
> Sorry, I haven't been up to date with this project, but is one of the goals of this project making classes available in `betterC` mode? I think that will remove the need for extern(C++) classes and also factor into making std.v2 betterC compatible and help make the entire D ecosystem more coherent.

No.

The reason extern(C++) classes work with -betterC and extern(D) does not, has to do with vtable's, not what members is in Object.

Anyway, even if extern(D) classes did work with -betterC, you won't get the standard library working with -betterC as a whole. Simply because it wouldn't be compiled in.

Of course one of the big issues with getting phobos working with -betterC is exceptions. There is no alternative and they require runtime stuff that just can't exist without a runtime.
October 25, 2021

On Monday, 25 October 2021 at 05:56:19 UTC, rikki cattermole wrote:

>

On 25/10/2021 6:48 PM, Tejas wrote:

>

Sorry, I haven't been up to date with this project, but is one of the goals of this project making classes available in betterC mode? I think that will remove the need for extern(C++) classes and also factor into making std.v2 betterC compatible and help make the entire D ecosystem more coherent.

No.

The reason extern(C++) classes work with -betterC and extern(D) does not, has to do with vtable's, not what members is in Object.

Anyway, even if extern(D) classes did work with -betterC, you won't get the standard library working with -betterC as a whole. Simply because it wouldn't be compiled in.

Of course one of the big issues with getting phobos working with -betterC is exceptions. There is no alternative and they require runtime stuff that just can't exist without a runtime.

:(

Was hoping this would help consolidate D and betterC a little so that newcomers don't get confused between the many options.

That @nogc exceptions DIP really is in the abandoned pile now, eh
;(