January 08, 2017
On Saturday, 7 January 2017 at 19:55:30 UTC, Martin Nowak wrote:
> On 01/05/2017 11:00 AM, Basile B. wrote:
>> I don't known what did you decide in intern but when the discussion
>> between users was hot (just after version 2.071.1 I think) I've proposed
>> that:
>> https://github.com/BBasile/DIPs/blob/3d5e3f81c541c6e23c69555a230b4d42a7bb6de6/DIPs/DIP8484.md
>
> This is superfluous by now. We figured that allowing access to private
> fields wouldn't clash with important optimizations, so it can be allowed
> via traits.
> The visibility of allMembers was adjusted in
> https://github.com/dlang/dmd/pull/6078.
> All access checks will go away once the visibility changes have been
> fully deprecated. So far those changes were adopted fairly slow (not
> even phobos has fixed them all), hence we haven't yet switched over to
> the new visibility semantics.
>
> -Martin

Awesome!

I tried to write a whole-module reflection tool, but was unable to finish satisfactorily due to the requirement that code actually be included in the module itself in order to reflect all it's members.
January 08, 2017
On Wednesday, 4 January 2017 at 19:22:33 UTC, Andrei Alexandrescu wrote:
> We release a brief Vision document summarizing the main goals we plan to pursue in the coming six months. This half we are focusing on three things: safety, lifetime management, and static introspection.
>
> https://wiki.dlang.org/Vision/2017H1
>
>
> Andrei

Dlang should strive to improve the standard library, such as Python, go, rust.
January 08, 2017
On Wednesday, 4 January 2017 at 19:22:33 UTC, Andrei Alexandrescu wrote:
> We release a brief Vision document summarizing the main goals we plan to pursue in the coming six months. This half we are focusing on three things: safety, lifetime management, and static introspection.
>
> https://wiki.dlang.org/Vision/2017H1
>
>
> Andrei

I hope dlang can support QT5 binding
January 08, 2017
On Sunday, January 08, 2017 18:06:53 Brian via Digitalmars-d-announce wrote:
> On Wednesday, 4 January 2017 at 19:22:33 UTC, Andrei Alexandrescu
>
> wrote:
> > We release a brief Vision document summarizing the main goals we plan to pursue in the coming six months. This half we are focusing on three things: safety, lifetime management, and static introspection.
> >
> > https://wiki.dlang.org/Vision/2017H1
> >
> >
> > Andrei
>
> I hope dlang can support QT5 binding

Binding to Qt in general is really nasty in comparison to a lot of C++ code, since Qt does stuff like have its own preprocessor to generate additional code so that signals and slots work. We had qtd (which did Qt4), but it seems to have lost all its contributors and died off a few years ago, and it seems to have used Qt Jambi stuff (or at least been based on it) and Qt Jambi doesn't seem to have ever made the transition to Qt5. So, I don't know how possible it would be to get qtd to work with Qt5, even if the original contributors were still working on it (but it doesn't seem to compile now, so it's not even currently viable for Qt4). I think that someone put up a solution on code.dlang.org that involves QML, but I have no idea how well it works or how complete it is (personally, I have less than zero interest in QML).

I've actually started work on a solution for binding Qt5 to D, because I have something I'm working on that uses Qt, and I'm sick of doing the GUI portion in C++. So, I may end up releasing a Qt5 bindings project at some point here, but I'm making no promises.

- Jonathan M Davis

January 09, 2017
> - tagging instead of hierarchical categories

The categories are in fact just a form of hierarchical tags. This is quite useful, because applying a tag will bring in the ancestor tags for free. The UI for both, applying tags and filtering, could be better, though. And some form of crowd sourced management of available tags could also be interesting to think about.
January 12, 2017
On Sunday, 8 January 2017 at 00:15:23 UTC, Seb wrote:
> On Saturday, 7 January 2017 at 23:33:45 UTC, Benjiro wrote:
>> Maybe something to add ( for new users ) is something similar to:
>>
>> http://rustbyexample.com/
>>
>> Easy to use, lots of information, simple tasks that involve interaction for the user, feedback on success.
>
> Do you know about the existing Dlang Tour?
>
> https://tour.dlang.org
>
> PRs/Issues to improve it are welcome
>
> Its translation into a couple of languages is WIP:
>
> https://github.com/dlang-tour

I think the "D for C++ programmers" page could use a revamp:

https://dlang.org/cpptod.html

At the moment it mainly explains where and how D differs from C++. Whoever reads it may be ready to write C++ code in D, but this seems pointless and may give the impression that D is just C++ with a different syntax plus a few minor features (strong typedef and the scope statement). The page doesn't mention D's dynamic arrays, associative arrays, ranges, UFCS, function attributes and so on). The tour does mention these features (under "D's gems") so maybe some of its contents can be used to extend the "D for C++" page.

One idea on my mind is providing various (honest, not specifically tailored) examples of C++ code that aims to solve a certain problem, and how the same problem can be solved in D in a better way (in some sense). I've seen this done effectively with Java vs. Scala.
January 12, 2017
On Thursday, 12 January 2017 at 09:54:08 UTC, Mark wrote:
> I think the "D for C++ programmers" page could use a revamp:
>
> https://dlang.org/cpptod.html
>
> At the moment it mainly explains where and how D differs from C++. Whoever reads it may be ready to write C++ code in D, but this seems pointless and may give the impression that D is just C++ with a different syntax plus a few minor features (strong typedef and the scope statement). The page doesn't mention D's dynamic arrays, associative arrays, ranges, UFCS, function attributes and so on).

It's intended to help C++ programmers switch to D, not as a comparison. It also links to:

https://dlang.org/ctod.html

which does mention arrays and various other small things.

(I noticed some minor things to fix and submitted a pull request).

> One idea on my mind is providing various (honest, not specifically tailored) examples of C++ code that aims to solve a certain problem, and how the same problem can be solved in D in a better way (in some sense). I've seen this done effectively with Java vs. Scala.

Sounds good. I think this thread is for big issues that need core focus though, anyone here can and should submit documentation.
January 12, 2017
On Saturday, 7 January 2017 at 15:58:43 UTC, Andrei Alexandrescu wrote:
> On 01/04/2017 08:06 PM, Dibyendu Majumdar wrote:
>> C++ integration has disappeared? Is this now "done"?
>
> We have a student on that. I've added a line for that to the doc. -- Andrei

I did a lot of work on C++ name mangling for D so feel free to introduce me to the student. I can probably save her/him a lot of time.

After *many* attempts it seems the only way to get this right is to look at how clang does it and replicate the logic (starting point https://github.com/llvm-mirror/clang/blob/google/stable/include/clang/AST/Mangle.h)

The state of my research on mangling so far are summed up here
https://github.com/gchatelet/gcc_cpp_mangling_documentation

I also have a bunch of failed experiments branches:
- https://github.com/gchatelet/dmd/tree/new_cpp_mangle
- https://github.com/gchatelet/dmd/tree/new_cpp_mangle2
- https://github.com/gchatelet/dmd/tree/new_cpp_mangling2
- https://github.com/gchatelet/dmd/tree/more_mangling_tests

Unfortunately I couldn't spend more time on this :(
January 12, 2017
On Wednesday, 4 January 2017 at 19:22:33 UTC, Andrei Alexandrescu wrote:
> We release a brief Vision document summarizing the main goals we plan to pursue in the coming six months. This half we are focusing on three things: safety, lifetime management, and static introspection.
>
> https://wiki.dlang.org/Vision/2017H1
>
>
> Andrei

Is there a design document for how D will achieve safety with nogc?
How does D plan to prevent leaks, use-after-free, double-free bugs when not using the GC?

Will @nogc also have first class support in the language?
Afaik the GC is currently needed for language features like array concatenation. Will features like array concatentation still work with @nogc?
GC allocations have a keyword 'new' (afaik 'new' currently never means anything other than GC allocation). Will we be able to do @nogc allocations by the 'new' keyword?

Is the same code always expected to work with/without @nogc?
January 12, 2017
On Thursday, January 12, 2017 21:57:37 Andrew Browne via Digitalmars-d- announce wrote:
> On Wednesday, 4 January 2017 at 19:22:33 UTC, Andrei Alexandrescu
>
> wrote:
> > We release a brief Vision document summarizing the main goals we plan to pursue in the coming six months. This half we are focusing on three things: safety, lifetime management, and static introspection.
> >
> > https://wiki.dlang.org/Vision/2017H1
> >
> >
> > Andrei
>
> Is there a design document for how D will achieve safety with
> nogc?
> How does D plan to prevent leaks, use-after-free, double-free
> bugs when not using the GC?

Part of the reason that we have the GC in D is because of the safety guarantees that you can have with a GC that you can't have with mechanisms like malloc and free. Some amount of @nogc code can be @safe, but some of it will never be able to be @safe. e.g. the very nature of malloc and free makes @safe impossible in the general case. It's trivial for a piece of code to free something that's currently in use by other code. If they're constrained within a ref-counting system, then @safety becomes more possible, but even then, when you have to start worrying about stuff like weak references in order to get around circular reference problems, it gets dicey if not impossible to make it fully @safe. It might be possible to guarantee safety if you have a whole bunch of extra constraints like Rust does with its borrowing stuff, but we're not going to add something like that to D, because it's too complicated on top of everything else that we already have.

I fully expect that certain idioms will be in place to help maintain @safety in @nogc code, but to some extent, by abandoning the GC, you're abandoning @safety - or at least you're making a lot more of your code need to be @trusted, and you can rely less on the compiler to guarantee @safety for you. Taking the freeing of memory out of the hands of the programmer like happens with the GC is _huge_ in guaranteeing the memory safety of code.

> Will @nogc also have first class support in the language?

And what do you mean my first class support? Some features require the GC, and I wouldn't expect it to ever be otherwise. Giving up the GC means giving up on certain features. We don't want that list to be longer that it needs to be, but some stuff fundamentally needs the GC to do what it does.

> Afaik the GC is currently needed for language features like array concatenation. Will features like array concatentation still work with @nogc?

I don't see how it possibly could given how dynamic arrays work in D. It would have to have some sort of reference counting mechanism, which would likely be a nightmare with slicing and certainly does not at all play well with how low level D arrays are. We may very well get some sort of ref-counted array type that has concatenation, but it would be a library construct rather than in the language, because it doesn't need to be in the language, and the built-in arrays would not be affected by it.

> GC allocations have a keyword 'new' (afaik 'new' currently never means anything other than GC allocation). Will we be able to do @nogc allocations by the 'new' keyword?

I very much doubt it. Constructing objects into memory is done via emplace, which is a library construct, and there's really no need for it to be in the language. As it is, if we were doing things from scratch, new probably wouldn't even be a keyword. It would likely be a library construct in druntime, because D is powerful enough that new doesn't need to be in the language to do what it does. And in general, at this point, Walter and Andrei don't want to put stuff in the language unless it actually needs to be there. If it can be done with a library, it will be done with a library. The only reason that they decided that we needed some sort of ref-counting mechanism in the language is because they decided that it wasn't actually possible to make it fully @safe without it being part of the language. And even then, I'm not sure that the intention is that the ref-counting mechanism use anything other than the GC. It's not yet clear what it's going to look like, but previously, the talk was using the GC to take care of circular references, which would mean that the memory was still GC-allocated even if it were ref-counted. We'll have to wait and see though.

> Is the same code always expected to work with/without @nogc?

That would depend entirely on the code. std.experimental.allocator has a GC allocator. So, code that is designed around it could work with the GC or without. But the whole mechanism of newing something up and then not worrying about ownership which happens by default with the GC doesn't play at all nicely with how memory has to be managed via other mechanisms like malloc and free. I don't think that it's at all reasonable to expect that code that is written with the idea that its memory will be managed by the GC will also work without the GC. Code that isn't managing memory directly shouldn't care - and that's a lot of code (especially once lazy ranges are in the mix) - but I think that it's pretty clear that there's plenty of code that simply can't just swap out its allocation mechanism and still work properly. In general, code needs to be written with that in mind for it to work, and even then, there are limits given how different various memory management mechanisms are.

- Jonathan M Davis