Re: shared vs __gshared

2013-06-10 Thread Steven Schveighoffer
On Mon, 10 Jun 2013 22:33:03 -0400, Sergei Nosov wrote: So, is my understanding correct? If yes, why the path with memory barriers was "announced", but not taken? Having recently acquired (no pun intended) new knowledge on how hard memory races are to solve with language syntax and primi

Re: shared vs __gshared

2013-06-10 Thread Sergei Nosov
Thank you for answers. Let me check if I got this right. On Monday, June 10, 2013 13:23:26 Steven Schveighoffer wrote: shared was supposed to infer memory barriers, but AFAIK, it doesn't do that. Not sure it ever will. So, my first impression about what shared should do (no low-level races a

Re: dispatch table; symbolic references

2013-06-10 Thread Emil
did you mean Object.factory() ? It almost does it, but still have to cast the object to the right class (where I can't use a string variable it seems) to use it or make all the classes I want to instantiate this way inherit from the same interface. thank you bearophile for pointing me in the r

Re: shared vs __gshared

2013-06-10 Thread Steven Schveighoffer
On Mon, 10 Jun 2013 15:46:27 -0400, Jonathan M Davis wrote: On Monday, June 10, 2013 13:23:26 Steven Schveighoffer wrote: shared was supposed to infer memory barriers, but AFAIK, it doesn't do that. Not sure it ever will. I believe that things are definitely leaning towards shared not addi

Re: shared vs __gshared

2013-06-10 Thread Jonathan M Davis
On Monday, June 10, 2013 13:23:26 Steven Schveighoffer wrote: > shared was supposed to infer memory barriers, but AFAIK, it doesn't do > that. Not sure it ever will. I believe that things are definitely leaning towards shared not adding memory barriers. There _might_ be something that happens wit

Re: GtkD not working

2013-06-10 Thread Daemon
Do you get any error messages? None that I know of. It compiles and starts to launch, then just throws an exception.

Re: GtkD not working

2013-06-10 Thread Mike Wey
On 06/10/2013 04:51 PM, Daemon wrote: Hello, I'd appreciate any help. I downloaded the GtkD sources and built the GtkD.lib using rdmd, so far so good. I have followed the instructions in "Installing on Windows" (editing sc.ini and copying contents of the src folder of GtkD into DMD's src folder,

Re: shared vs __gshared

2013-06-10 Thread Steven Schveighoffer
On Mon, 10 Jun 2013 09:38:43 -0400, Sergei Nosov wrote: Hi! I'm puzzled with what's the difference between shared and __gshared. shared is part of the type, __gshared is not. The danger of __gshared is that the compiler treats it as if it were not shared. You better know what you are d

Re: can we detect at compile time module ctor/dtor cycles ?

2013-06-10 Thread Steven Schveighoffer
On Sun, 09 Jun 2013 23:15:42 -0400, Timothee Cour wrote: On Fri, Jun 7, 2013 at 11:41 PM, Jonathan M Davis wrote: On Friday, June 07, 2013 23:23:25 Timothee Cour wrote: > Why can't we detect at compile time module ctor/dtor cycles (instead of > runtime) ? At minimum, separate compilat

Re: shared vs __gshared

2013-06-10 Thread bearophile
Dmitry Olshansky: Now there was a discussion on it recently which indicates that shared data might lose it's built-in ops to prevent confusion and require folks to just use core.atomic directly for lock-free or alternatively cast+mutex for lock-based. Looks like a good idea. Bye, bearophjil

GtkD not working

2013-06-10 Thread Daemon
Hello, I'd appreciate any help. I downloaded the GtkD sources and built the GtkD.lib using rdmd, so far so good. I have followed the instructions in "Installing on Windows" (editing sc.ini and copying contents of the src folder of GtkD into DMD's src folder, etc.). I also installed the Gtk 3.

Re: shared vs __gshared

2013-06-10 Thread Dmitry Olshansky
10-Jun-2013 17:38, Sergei Nosov пишет: Hi! I'm puzzled with what's the difference between shared and __gshared. Until now I've (mistakenly) considered that shared variables are free from low-level data races. I.e. the operations with shared data are atomic. And that __gshared is the "usual" (in

Re: How to implement this?

2013-06-10 Thread Kenji Hara
On Monday, 10 June 2013 at 09:42:56 UTC, Elvis wrote: class A { enum TypeID = 1; } class B : A { enum TypeID = 2; } class C : A { enum TypeID = 3; } class D : B { enum TypeID = 4; } ... Could anybody shed some light on how to make these TypeIDs auto increment at compile time

Re: shared vs __gshared

2013-06-10 Thread bearophile
Sergei Nosov: Is this how shared is supposed to work? If so, how is the __gshared different from it? Does it not guarantee that the result of a write is instantly visible to all threads? If so, does this difference really matter? shared and __gshared are very different things. __gshared gua

shared vs __gshared

2013-06-10 Thread Sergei Nosov
Hi! I'm puzzled with what's the difference between shared and __gshared. Until now I've (mistakenly) considered that shared variables are free from low-level data races. I.e. the operations with shared data are atomic. And that __gshared is the "usual" (in C++ sense) shared data. So, in my

Re: How to implement this?

2013-06-10 Thread Benjamin Thaut
Am 10/06/2013 11:42, schrieb Elvis: class A { enum TypeID = 1; } class B : A { enum TypeID = 2; } class C : A { enum TypeID = 3; } class D : B { enum TypeID = 4; } ... Could anybody shed some light on how to make these TypeIDs auto increment at compile time? Thats not

Re: decimal to binary

2013-06-10 Thread John Colvin
On Monday, 10 June 2013 at 09:46:42 UTC, snow wrote: Hello, I searched a lot in the docs and search, but couldn't find anything so far. Is there a funtion, which converts my decimal number into a binary? I presume your decimal is in a string? use std.conv.parse or std.conv.to

Re: decimal to binary

2013-06-10 Thread Infiltrator
On Monday, 10 June 2013 at 09:46:42 UTC, snow wrote: Hello, I searched a lot in the docs and search, but couldn't find anything so far. Is there a funtion, which converts my decimal number into a binary? http://dlang.org/phobos/std_string.html#.format with format string "%b". Or if you're

decimal to binary

2013-06-10 Thread snow
Hello, I searched a lot in the docs and search, but couldn't find anything so far. Is there a funtion, which converts my decimal number into a binary?

How to implement this?

2013-06-10 Thread Elvis
class A { enum TypeID = 1; } class B : A { enum TypeID = 2; } class C : A { enum TypeID = 3; } class D : B { enum TypeID = 4; } ... Could anybody shed some light on how to make these TypeIDs auto increment at compile time?

Re: Constants doesn't have UDA's?

2013-06-10 Thread Temtaime
Oh, i see, thanks. P.S. туй васю нигодяй.

Re: Constants doesn't have UDA's?

2013-06-10 Thread Jack Applegame
http://forum.dlang.org/thread/htuakrtvoyymappje...@forum.dlang.org

Re: best way to handle UFCS with ambiguous names: using std.typetuple.Alias!

2013-06-10 Thread John Colvin
On Monday, 10 June 2013 at 02:02:09 UTC, Timothee Cour wrote: UFCS chains are problematic when a symbol is ambiguous (eg after import std.stdio:write;import std.file:write); I previously suggested to add the syntax 'arg1.(std.file.write)(arg2)' (see 'support UFCS with fully qualified function n