Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-23 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Sunday, 23 May 2021 at 21:02:31 UTC, Gavin Ray wrote: I don't really know anything at all about compilers or low-level code -- but is there any high-level notion of "inheritance" after it's been compiled? Yes, in the structure of the vtable, which is why the spec is so hard to read. If p

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-23 Thread Gavin Ray via Digitalmars-d-learn
On Sunday, 23 May 2021 at 20:16:17 UTC, Ola Fosheim Grostad wrote: On Sunday, 23 May 2021 at 19:44:01 UTC, Gavin Ray wrote: So one of the problems with generating D code for bindings to C++ is that there's no true/direct multiple inheritance. If anyone happens to understand well how vtables wo

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-23 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Sunday, 23 May 2021 at 19:44:01 UTC, Gavin Ray wrote: So one of the problems with generating D code for bindings to C++ is that there's no true/direct multiple inheritance. If anyone happens to understand well how vtables work and the way the compiler treats these things, is there a way to

How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-23 Thread Gavin Ray via Digitalmars-d-learn
So one of the problems with generating D code for bindings to C++ is that there's no true/direct multiple inheritance. If anyone happens to understand well how vtables work and the way the compiler treats these things, is there a way to hackily make semantically-equivalent objects? An exampl

Re: DUB doesn't seem to respect my config, am I doing something wrong?

2021-05-23 Thread rempas via Digitalmars-d-learn
On Sunday, 23 May 2021 at 15:00:37 UTC, Steven Schveighoffer wrote: The "build types" section is saying what the EQUIVALENT build types are when passing on command line. [...] This will do it! Thanks a lot!

Re: DUB doesn't seem to respect my config, am I doing something wrong?

2021-05-23 Thread rempas via Digitalmars-d-learn
On Sunday, 23 May 2021 at 09:45:06 UTC, Guillaume Piolat wrote: On Saturday, 22 May 2021 at 20:28:56 UTC, rempas wrote: [...] Hello, DUB has two separate concepts: [...] Thanks a lot man!

Re: DUB doesn't seem to respect my config, am I doing something wrong?

2021-05-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/23/21 3:17 AM, rempas wrote: On Sunday, 23 May 2021 at 04:56:18 UTC, Mike Parker wrote: I just looked in the dub documentation for "build" and "compiler" entries, which I had never heard of, and I see none now. As Jordan said, those have always been configured on the command line. Did you

Re: ugly and/or useless features in the language.

2021-05-23 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 23 May 2021 at 14:13:36 UTC, Alain De Vos wrote: This one compiles without any problem. Maybe someone can enlighten us on the status of scope(d)-variables and dip-1000. It is not fully clear for me. ``` import std.stdio; void main() @trusted { int *q=null; { int a;

Re: ugly and/or useless features in the language.

2021-05-23 Thread z via Digitalmars-d-learn
On Saturday, 15 May 2021 at 14:31:08 UTC, Alain De Vos wrote: Which parts in dlang don't you use and why ? Auto return types i find dangerous to use. I found `auto` and `ref`(yes just `ref`) return types very useful for bypassing the type system, eg.: ```D ///function requires lvalue and the

Re: ugly and/or useless features in the language.

2021-05-23 Thread Dennis via Digitalmars-d-learn
On Sunday, 23 May 2021 at 14:13:36 UTC, Alain De Vos wrote: This one compiles without any problem. You annotated main `@trusted`, which means you want the compiler to assume it to be `@safe` without checking it. Mark it `@safe` and it reports: Error: address of variable `a` assigned to `q`

Re: ugly and/or useless features in the language.

2021-05-23 Thread Alain De Vos via Digitalmars-d-learn
This one compiles without any problem. Maybe someone can enlighten us on the status of scope(d)-variables and dip-1000. It is not fully clear for me. ``` import std.stdio; void main() @trusted { int *q=null; { int a; q=&a; } *q=5; } ```

Re: ugly and/or useless features in the language.

2021-05-23 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Sunday, 23 May 2021 at 12:08:31 UTC, Alain De Vos wrote: It is sufficient to have a bit complex gui and database access and the @safe annotation can nowhere be used in your program. The compiler misses scopes checks without. I think you are supposed to use @trusted to tell the compiler tha

Re: ugly and/or useless features in the language.

2021-05-23 Thread Alain De Vos via Digitalmars-d-learn
It is sufficient to have a bit complex gui and database access and the @safe annotation can nowhere be used in your program. The compiler misses scopes checks without.

Re: ugly and/or useless features in the language.

2021-05-23 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Sunday, 23 May 2021 at 10:24:53 UTC, Ola Fosheim Grostad wrote: On Sunday, 23 May 2021 at 08:35:31 UTC, Tony wrote: On Saturday, 15 May 2021 at 21:15:01 UTC, Ola Fosheim Grostad wrote: Why is metaprogramming added features better than the same features added in the language? One is standard

Re: ugly and/or useless features in the language.

2021-05-23 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Sunday, 23 May 2021 at 08:35:31 UTC, Tony wrote: On Saturday, 15 May 2021 at 21:15:01 UTC, Ola Fosheim Grostad wrote: Why is metaprogramming added features better than the same features added in the language? One is standard between entities, the other is not. There are many reasons, one i

Re: ugly and/or useless features in the language.

2021-05-23 Thread sighoya via Digitalmars-d-learn
On Sunday, 23 May 2021 at 08:35:31 UTC, Tony wrote: Why is metaprogramming added features better than the same features added in the language? One is standard between entities, the other is not. Some points: - Some features aren't general enough to be added as builtin but make sense to have t

Re: DUB doesn't seem to respect my config, am I doing something wrong?

2021-05-23 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 22 May 2021 at 20:28:56 UTC, rempas wrote: I'm compiling using `dub --config=development` and I'm getting the following line: `Performing "debug" build using /usr/bin/dmd for x86_64`. The same exactly happens when I'm trying to do the release config. If I disable the `targetType`

Re: ugly and/or useless features in the language.

2021-05-23 Thread Tony via Digitalmars-d-learn
On Saturday, 15 May 2021 at 21:15:01 UTC, Ola Fosheim Grostad wrote: On Saturday, 15 May 2021 at 14:31:08 UTC, Alain De Vos wrote: In general it is better to have fewer features and instead improve metaprogramming so that missing features can be done in a library. Why is metaprogramming

Re: DUB doesn't seem to respect my config, am I doing something wrong?

2021-05-23 Thread rempas via Digitalmars-d-learn
On Sunday, 23 May 2021 at 04:56:18 UTC, Mike Parker wrote: I just looked in the dub documentation for "build" and "compiler" entries, which I had never heard of, and I see none now. As Jordan said, those have always been configured on the command line. Did you perhaps see something about those

Re: DUB doesn't seem to respect my config, am I doing something wrong?

2021-05-23 Thread rempas via Digitalmars-d-learn
On Sunday, 23 May 2021 at 00:36:48 UTC, Jordan Wilson wrote: On Saturday, 22 May 2021 at 20:28:56 UTC, rempas wrote: [...] Ignoring the "dubug" typo...normally, I think you pass compiler values directly to dub via the ```--compiler``` flag. For example: ```shell dub --config=development --c