Re: extern(C++, ns) is wrong

2018-09-14 Thread Danni Coy via Digitalmars-d
On Fri, Sep 14, 2018, 06:01 Jonathan M Davis via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Thursday, September 13, 2018 5:45:56 AM MDT Danni Coy via Digitalmars-d > wrote: > > On Thu, Sep 13, 2018 at 5:14 PM Jonathan M Davis via Digitalmars-d < > > >

Re: extern(C++, ns) is wrong

2018-09-14 Thread Danni Coy via Digitalmars-d
On Fri, Sep 14, 2018, 08:47 Manu via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Thu, 13 Sep 2018 at 04:46, Danni Coy via Digitalmars-d > wrote: > > > > On Thu, Sep 13, 2018 at 5:14 PM Jonathan M Davis via Digitalmars-d < > digitalmars-d@puremagic.co

Re: extern(C++, ns) is wrong

2018-09-13 Thread Danni Coy via Digitalmars-d
On Thu, Sep 13, 2018 at 5:14 PM Jonathan M Davis via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > > > The entire point of having extern(C++, "NS") would be to make it so that > the > _only_ thing that it would affect would be the name mangling. Everything > else is exactly the same behavi

Re: extern(C++, ns) is wrong

2018-09-12 Thread Danni Coy via Digitalmars-d
On Thu, Sep 13, 2018, 07:06 Manu via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Tue, 11 Sep 2018 at 20:59, Danni Coy via Digitalmars-d > wrote: > > > > > > > > So my understanding is that the main issue with extern(C++,"ns") is &

Re: extern(C++, ns) is wrong

2018-09-11 Thread Danni Coy via Digitalmars-d
So my understanding is that the main issue with extern(C++,"ns") is functions that have different C++ name-spaces overriding each other in unexpected ways. How feasible is to simply disallow functions/variables/objects/... with the same name but a different "ns" being in the same module?

Re: Is there any good reason why C++ namespaces are "closed" in D?

2018-08-06 Thread Danni Coy via Digitalmars-d
Outside perspective here and possibly stupid question. Is there any way we could have our cake and eat it too? One of the thinks I like is that it tends to be much more readable than C++, more code than necessary hurts readability of that code. Can the compiler warn when a function is called that

Re: CTFE ^^ (pow)

2018-03-18 Thread Danni Coy via Digitalmars-d
The volunteer line is fine for big picture stuff that is going to require a lot of work and planing to get right. Using that for smaller feature requests is going to give the impression that D is lacking in the technical expertise to get anything done, It's often a sign that an open source project

Re: Anybody still using the chm docs

2018-02-17 Thread Danni Coy via Digitalmars-d
On Sun, Feb 18, 2018 at 11:10 AM, Manu wrote: > On 17 February 2018 at 16:52, Danni Coy wrote: > >> Is the reason for favouring chm as a format that it fits in with the >> visual studio ecosystem better? >> Having used both pdf and chm help on Linux I don't see a huge amount of >> difference bet

Re: Anybody still using the chm docs

2018-02-17 Thread Danni Coy via Digitalmars-d
Is the reason for favouring chm as a format that it fits in with the visual studio ecosystem better? Having used both pdf and chm help on Linux I don't see a huge amount of difference between competent reading applications. On Sun, Feb 18, 2018 at 7:23 AM, Manu via Digitalmars-d < digitalmars-d@pu

Re: Vulkan

2018-02-16 Thread Danni Coy via Digitalmars-d
On Wed, Feb 14, 2018 at 2:26 PM, rikki cattermole via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On 13/02/2018 10:54 PM, Danni Coy wrote: > >> >> On Wed, Feb 14, 2018 at 8:20 AM, Ivan Trombley via Digitalmars-d < >> digitalmars-d@puremagic.com > wrote

Re: Vulkan

2018-02-13 Thread Danni Coy via Digitalmars-d
On Wed, Feb 14, 2018 at 8:20 AM, Ivan Trombley via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > I wanted to do some experimentation with Vulkan using D. None of the > projects that I found (derelict-vulkan, d-vulkan and erupted) work. > > Are there D bindings to Vulkan that actually work?

Re: @safe(bool)

2017-08-20 Thread Danni Coy via Digitalmars-d
> For instance, as it stands, it's relatively easy to figure out whether > @safe > has been explicitly applied. You can look on the function and look for > @safe: or @safe {} which affects it. The same goes for other attributes. > But > as soon as you can do stuff like create new attributes that co

Re: How do you use D?

2017-07-29 Thread Danni Coy via Digitalmars-d
On Sat, Jul 29, 2017 at 12:58 AM, Ali via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > While the Orgs using D page is very nice ... I hoping to hear more > personal stories ... > > So > > How do you use D > In work, (key projects or smaller side projects) > As a replacement for Python fo

Re: struct constructors and destructors.

2017-07-20 Thread Danni Coy via Digitalmars-d
On Thu, Jul 20, 2017 at 12:19 AM, SrMordred via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Wednesday, 19 July 2017 at 14:09:32 UTC, SrMordred wrote: > >> On Wednesday, 19 July 2017 at 09:09:40 UTC, Stefan Koch wrote: >> >>> On Wednesday, 19 July 2017 at 07:48:28 UTC, Danni Coy wrote:

Re: struct constructors and destructors.

2017-07-19 Thread Danni Coy via Digitalmars-d
Yeah somehow I read that as a question -- must be getting tired. That makes more sense. is there any way to On Wed, Jul 19, 2017 at 10:34 PM, Stefan Koch via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Wednesday, 19 July 2017 at 12:23:06 UTC, Danni Coy wrote: > >> On Wed, Jul 19, 2

Re: struct constructors and destructors.

2017-07-19 Thread Danni Coy via Digitalmars-d
On Wed, Jul 19, 2017 at 7:09 PM, Stefan Koch via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > > What happens is this. > > void open() > { > foo = () { > Foo _tmp = Foo.__ctor("test"); > return _tmp; > } (); > } > > > Error: need 'this' for 'this' of type 'ref Foo(string s)'

struct constructors and destructors.

2017-07-19 Thread Danni Coy via Digitalmars-d
Is there a reason that the following code struct Foo { this (string name) { do_something(name); } ~this() { undo_something(); } } Foo foo = void; void open() { foo = Foo("test"); // <- this line } tries to OpAssign foo to itself then calls foo's destructor?

Re: Let's paint those bikesheds^Werror messages!

2017-06-29 Thread Danni Coy via Digitalmars-d
This times 1000 On Wed, Jun 28, 2017 at 3:11 AM, H. S. Teoh via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Tue, Jun 27, 2017 at 02:32:28PM +, Vladimir Panteleev via > Digitalmars-d wrote: > > As has been announced, DMD now has colorized syntax highlighting in > > error messages:

Re: C++ interop; object destruction

2017-06-22 Thread Danni Coy via Digitalmars-d
On Fri, Jun 23, 2017 at 10:52 AM, Nicholas Wilson via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > >> > I'm pretty sure he manually constructs the vtbl and inserts the virtual > function into it, so it should just be a case of calling the virtual > destructor. > > Have a look at this DCon

Re: What is the right level of abstractions for D?

2016-11-07 Thread Danni Coy via Digitalmars-d
On Sat, Nov 5, 2016 at 5:47 PM, Joakim via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Saturday, 29 October 2016 at 22:38:07 UTC, Danni Coy wrote: > >> The bit that sends group 3 people off screaming is static typing, once >> you have accepted the need to explicitly type everything th

Re: What is the right level of abstractions for D?

2016-10-29 Thread Danni Coy via Digitalmars-d
I am going to talk as a person who mostly works with group 3 languages but will use whatever they need to use to get the job done (tm). > The reason for the split is that there are different levels of software > expertise and performance needs, and each of those groups is geared for a > different

Re: @gc attribute for bypassign @nogc

2016-07-27 Thread Danni Coy via Digitalmars-d
I am not convinced this is the best way to go although it would be a relatively easy solution. What I would personally prefer was if there was a language mechanism to mark theAllocator, processAllocator (iAllocator) to be @nogc as long as the allocator in question is not the GCAllocator. I am thi

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Danni Coy via Digitalmars-d
On Mon, Jun 6, 2016 at 7:13 PM, Ethan Watson via Digitalmars-d wrote: > On Monday, 6 June 2016 at 07:18:56 UTC, Guillaume Piolat wrote: >> >> - well there is an AAA game using it now, > > > Replying solely to highlight that Unreal Engine has garbage collected since > forever; and Unity is a .NET r

Re: std.experimental.allocator and @nogc

2016-05-09 Thread Danni Coy via Digitalmars-d
> It's true but... why do you bother with IAllocator ? Everything can be set a > compile time with a template parameter. As long as the param is a struct > with allocate/deallocate/reallocate it's OK. you can use already a good part > of the package content in a @nogc fashion. > > Do you have an ex

Re: std.experimental.allocator and @nogc

2016-05-09 Thread Danni Coy via Digitalmars-d
On Mon, May 9, 2016 at 3:10 PM, Hildigard Sandyman via Digitalmars-d wrote: > On Monday, 9 May 2016 at 04:50:59 UTC, Danni Coy wrote: > It already mostly works in @nogc block: > - Mallocator and AlignedMallocator are @nogc. I was trying to use BitmappedBlock, AllocatorList and MmapAllocator with

std.experimental.allocator and @nogc

2016-05-08 Thread Danni Coy via Digitalmars-d
It seems to me, that std.experimental.allocator should work with @nogc annotated functions if none of the allocators being used are the gcallocator, though it's not at all clear to me how this would work. Are there plans for this?

Re: Why is separating class ind struct is bad?

2016-03-29 Thread Danni Coy via Digitalmars-d
> Could anybody explain what this mean and why this way is not modern? This is in the context of users migrating from C++, and it is bad in so far as it is not what a C++ programmer who hasn't read all the documentation would expect. The easiest path of migration would be if the programmer can de

Re: avoiding loops, allocation using arrays and ranges

2016-03-28 Thread Danni Coy via Digitalmars-d
> I believe you're able to use > https://dlang.org/phobos/std_algorithm_mutation.html#.copy to achieve this. yes that did the trick and alias copyTo = copy; event makes it unambiguous which direction the copy is going in :)

Re: avoiding loops, allocation using arrays and ranges

2016-03-28 Thread Danni Coy via Digitalmars-d
> writeln(v.array); // everything gets eval by .array .array allocates a new array. I want to store the result of v in a buffer that I have preallocated in my case this just happens to be a[]; This is quite important. This is also the step I would like a more elegant way to deal with. > Ther

avoiding loops, allocation using arrays and ranges

2016-03-28 Thread Danni Coy via Digitalmars-d
Something just clicked in my head in the last week in terms of component based programming. I am currently porting a C++ realtime audio app to D. The app uses jackd. I have a series of float[] buffers I read and write audio data from. lets say I want to crossfade to audio buffers I would do the f

Re: constructing module level immutable variables at runtime?

2016-02-22 Thread Danni Coy via Digitalmars-d
That worked however it seems that you can only do the assignments within the shared static this() and not from functions called by the initialiser which might change how I do things

Re: constructing module level immutable variables at runtime?

2016-02-21 Thread Danni Coy via Digitalmars-d
On Mon, Feb 22, 2016 at 5:29 PM, Sönke Ludwig wrote: > I was wrong, there is obviously a language/compiler bug here. It compiles if > you remove the "= void", but it does so for "shared static this" as well as > for "static this". It really shouldn't in the latter case. Interesting... It definate

Re: constructing module level immutable variables at runtime?

2016-02-21 Thread Danni Coy via Digitalmars-d
On Mon, Feb 22, 2016 at 5:09 PM, Sönke Ludwig wrote: > > This actually works already, if you use "shared static this". "static this" > is invoked for each thread that is started, thus it would overwrite the > existing value of num_triggers, potentially multiple times. module config; shared stati

Re: constructing module level immutable variables at runtime?

2016-02-21 Thread Danni Coy via Digitalmars-d
On Mon, Feb 22, 2016 at 5:14 PM, Ali Çehreli wrote: > There is import() to read a config file at compile time: In my case the config files are there to allow end users to tune the application - therefore config files need to be read at runtime.

constructing module level immutable variables at runtime?

2016-02-21 Thread Danni Coy via Digitalmars-d
I am trying to port a heavily multithreaded C++ application to D. I have a lot of variables that are set once from a config file at runtime and then never change. It seems that something like the following would be a very clean design. module config; static this() { num_triggers = to!int(get

Re: Head Const

2016-02-16 Thread Danni Coy via Digitalmars-d
speaking as a lay user - if this is going to be done maybe it should something like __gconst? similiar to __gshared which is ugly enough to make you concider not using it, but it's there if you really need it. On Wed, Feb 17, 2016 at 5:29 AM, Marc Schütz via Digitalmars-d wrote: > On Tuesday, 16

Re: extern(C++, ns)

2016-01-25 Thread Danni Coy via Digitalmars-d
D generally doesn't allow shadowing of names inside inner scopes. int x; for (int i=0; i wrote: > On 2016-01-21 00:50, David Nadlinger wrote: > >> To add a new feature to the language, the >> onus is on you to provide compelling evidence why it is necessary to >> have. You need to show that there

Re: extern(C++, ns)

2016-01-19 Thread Danni Coy via Digitalmars-d
I have been turning this over in my head for the last week. What about something along the lines of extern (C++,module) { } which keeps code at the module level on the D side and puts code into a namespace that mirrors the D module name. On Wed, Jan 20, 2016 at 3:32 PM, Walter Bright via Digital

Re: D for Game Development

2015-07-30 Thread Danni Coy via Digitalmars-d
Using C code from D is actually a fairly straightforward to do, all you need to do is write a D version of the function signature you want to call and tell D to mangle it as a C function eg extern(C) { int SDL_Init(uint flags); } now you just need to tell the linker to link in libsdl and you are re

Re: std.experimental.color, request reviews

2015-06-30 Thread Danni Coy via Digitalmars-d
Huey (pronounced with an Australian Twang)? HSx works On Fri, Jun 26, 2015 at 7:11 AM, Guillaume Chatelet via Digitalmars-d wrote: > On Thursday, 25 June 2015 at 21:06:59 UTC, Guillaume Chatelet wrote: >> >> On Thursday, 25 June 2015 at 13:36:57 UTC, Manu wrote: >>> >>> How about HSx ? That's t

Re: std.experimental.color, request reviews

2015-06-24 Thread Danni Coy via Digitalmars-d
I would probably go with "perceptual" or something like it On Thu, Jun 25, 2015 at 2:39 PM, Danni Coy wrote: > Wikipedia at least refer to these as cylindrical colour spaces > > > On Thu, Jun 25, 2015 at 2:05 PM, Manu via Digitalmars-d > wrote: >> On 25 June 2015 at 07:14, Guillaume Chatelet vi

Re: std.experimental.color, request reviews

2015-06-24 Thread Danni Coy via Digitalmars-d
Wikipedia at least refer to these as cylindrical colour spaces On Thu, Jun 25, 2015 at 2:05 PM, Manu via Digitalmars-d wrote: > On 25 June 2015 at 07:14, Guillaume Chatelet via Digitalmars-d > wrote: >> On Wednesday, 24 June 2015 at 21:08:03 UTC, Guillaume Chatelet wrote: >>> >>> On Wednesday,

Re: Why aren't you using D at work?

2015-06-02 Thread Danni Coy via Digitalmars-d
I forgot to add that bindings to a UI framework would open the door for D in a lot more projects. Qt is the option that sucks the least by a significant margin. force-inline would also be useful.

Re: Why aren't you using D at work?

2015-05-31 Thread Danni Coy via Digitalmars-d
On Sun, May 31, 2015 at 7:28 PM, Jacob Carlborg via Digitalmars-d wrote: > On 2015-05-31 01:37, Danni Coy via Digitalmars-d wrote: > >> The Standard Library. I want to use D so I can do more with less hours >> writing code and less hours debugging code. Having a high quality &

Re: Why aren't you using D at work?

2015-05-30 Thread Danni Coy via Digitalmars-d
Cattermole via >> Digitalmars-d wrote: >>> >>> On 31/05/2015 11:37 a.m., Danni Coy via Digitalmars-d wrote: >> >> [...] >>>> >>>> The Standard Library. I want to use D so I can do more with less >>>> hours writing code and l

Re: Why aren't you using D at work?

2015-05-30 Thread Danni Coy via Digitalmars-d
I have been doing my first serious attempt at D after convincing other people that it was the way to go quite a few years ago. (My copy of "The D Programming Language" doesn't have Andrei's name on it so it would have been around that time) and these are the things which are fresh for me. I had no

Re: indie game contests

2015-05-25 Thread Danni Coy via Digitalmars-d
@Manu - if by that you mean do game jams without you - that horse has already bolted the stable :p I would be happy to a try the October Game Jam again this year and I thoroughly recommend the global (much more laid back). extrawurst - danni@gmail.com On Mon, May 25, 2015 at 8:06 PM, Manu via

Re: indie game contests

2015-05-22 Thread Danni Coy via Digitalmars-d
Got very close to a year or so ago. Probably something I would be much more capable of doing now. The only downside is that I enjoy doing asset creation more. On Sat, May 23, 2015 at 7:34 AM, Vlad Levenfeld via Digitalmars-d wrote: > On Friday, 22 May 2015 at 17:00:06 UTC, Namespace wrote: >> >>

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-21 Thread Danni Coy via Digitalmars-d
regular expression search FunctionName.*\{ or FunctionName.*$\s*\{ depending on brace style On Wed, Jan 21, 2015 at 4:37 AM, Joakim via Digitalmars-d wrote: > On Tuesday, 20 January 2015 at 00:13:37 UTC, Brian Schott wrote: >> >> On Monday, 19 January 2015 at 22:49:41 UTC, Ary Borenszweig wrote:

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-20 Thread Danni Coy via Digitalmars-d
> So... how do you search for a function definition in D without an IDE? Regular Expression Search for FunctionName.*\n\s*\{ or FunctionName.*\{ depending on brace style being used.

Re: What are the worst parts of D?

2014-10-09 Thread Danni Coy via Digitalmars-d
> While it would be great if there were a company devoted to such D tooling, > it doesn't exist right now. It is completely unrealistic to expect a D > community of unpaid volunteers to work on these features for your paid > projects. If anybody in the community cared as much about these features