Re: dmd gdc

2012-01-26 Thread Jerome BENOIT
There is also gdmd : dmd front end that use gdc On 26/01/12 13:34, Trass3r wrote: On Thursday, 26 January 2012 at 11:46:19 UTC, sami wrote: my question is if there thing i can do with dmd only and visa versa? what the feature of one of them over the other? what the different between them in

Re: dmd gdc

2012-01-26 Thread Trass3r
There is also gdmd : dmd front end that use gdc It's nothing but a perl script that translates dmd command line options into gdc ones.

Re: dmd gdc

2012-01-26 Thread Jerome BENOIT
actually is a d source file that does more than a simple translation ... as dmd On 26/01/12 13:59, Trass3r wrote: There is also gdmd : dmd front end that use gdc It's nothing but a perl script that translates dmd command line options into gdc ones.

Re: inout constructor?

2012-01-26 Thread Steven Schveighoffer
On Wed, 25 Jan 2012 23:08:01 -0500, bearophile bearophileh...@lycos.com wrote: In this bug report I've seen an inout struct constructor: http://d.puremagic.com/issues/show_bug.cgi?id=7369 struct TestStruct { this(int data) inout {} } Do you know what's the usage of this? I would say

Re: GC and void*

2012-01-26 Thread Steven Schveighoffer
On Wed, 25 Jan 2012 19:11:36 -0500, Nicolas Silva nical.si...@gmail.com wrote: Hi, I need to be sure: would the GC collect an object that is still reachable through a void* pointer ? No. The current GC does not know anything about type information. It blindly assumes if a pointer

Re: dmd gdc

2012-01-26 Thread H. S. Teoh
On Thu, Jan 26, 2012 at 01:34:39PM +0100, Trass3r wrote: On Thursday, 26 January 2012 at 11:46:19 UTC, sami wrote: my question is if there thing i can do with dmd only and visa versa? what the feature of one of them over the other? what the different between them in term of inline assembly,

Re: dmd gdc

2012-01-26 Thread xancorreu
Al 26/01/12 17:15, En/na H. S. Teoh ha escrit: On Thu, Jan 26, 2012 at 01:34:39PM +0100, Trass3r wrote: On Thursday, 26 January 2012 at 11:46:19 UTC, sami wrote: my question is if there thing i can do with dmd only and visa versa? what the feature of one of them over the other? what the

Re: dmd gdc

2012-01-26 Thread H. S. Teoh
On Thu, Jan 26, 2012 at 06:06:38PM +0100, xancorreu wrote: [...] I note that gdc is completely free software but dmd runtime is not. You mean free as in freedom, not as in price. An alternative is ldc, also free. I looked up ldc recently, and it seems that it hasn't been updated for years.

Re: dmd gdc

2012-01-26 Thread Alex Rønne Petersen
On 26-01-2012 18:06, xancorreu wrote: Al 26/01/12 17:15, En/na H. S. Teoh ha escrit: On Thu, Jan 26, 2012 at 01:34:39PM +0100, Trass3r wrote: On Thursday, 26 January 2012 at 11:46:19 UTC, sami wrote: my question is if there thing i can do with dmd only and visa versa? what the feature of one

Re: dmd gdc

2012-01-26 Thread xancorreu
Al 26/01/12 18:43, En/na H. S. Teoh ha escrit: On Thu, Jan 26, 2012 at 06:06:38PM +0100, xancorreu wrote: [...] I note that gdc is completely free software but dmd runtime is not. You mean free as in freedom, not as in price. Yes, both An alternative is ldc, also free. I looked up ldc

Re: dmd gdc

2012-01-26 Thread xancorreu
Al 26/01/12 19:48, En/na Alex Rønne Petersen ha escrit: On 26-01-2012 18:06, xancorreu wrote: Al 26/01/12 17:15, En/na H. S. Teoh ha escrit: On Thu, Jan 26, 2012 at 01:34:39PM +0100, Trass3r wrote: On Thursday, 26 January 2012 at 11:46:19 UTC, sami wrote: my question is if there thing i can

unittests running before static ctors??

2012-01-26 Thread H. S. Teoh
I just noticed that unittests are running before static class ctors. Is this a bug?? I suppose the intention is for unittests to make sure the class implementation is OK before using it, but this makes it impossible to use unittests to make sure that static ctors are setting up the initial states

Re: unittests running before static ctors??

2012-01-26 Thread Jonathan M Davis
On Thursday, January 26, 2012 10:08:24 H. S. Teoh wrote: I just noticed that unittests are running before static class ctors. Is this a bug?? I suppose the intention is for unittests to make sure the class implementation is OK before using it, but this makes it impossible to use unittests

Re: unittests running before static ctors??

2012-01-26 Thread H. S. Teoh
On Thu, Jan 26, 2012 at 01:10:28PM -0500, Jonathan M Davis wrote: On Thursday, January 26, 2012 10:08:24 H. S. Teoh wrote: I just noticed that unittests are running before static class ctors. Is this a bug?? [...] I would definitely think that that's a bug. If you're seeing that happen,

TypeTuple of functions

2012-01-26 Thread bearophile
I'm asking questions all the time :-) I have just closed this bug report as fixed: http://d.puremagic.com/issues/show_bug.cgi?id=5695 Using that idiom I've seen a difference: template TypeTuple(TList...) { alias TList TypeTuple; } double f1(in double x) pure nothrow { return x; } alias

Re: TypeTuple of functions

2012-01-26 Thread H. S. Teoh
On Thu, Jan 26, 2012 at 01:32:35PM -0500, bearophile wrote: [...] template TypeTuple(TList...) { alias TList TypeTuple; } double f1(in double x) pure nothrow { return x; } alias TypeTuple!(f1) funcs1; alias TypeTuple!(function(in double x) pure nothrow { return x; }) funcs2; void

Re: dmd gdc

2012-01-26 Thread Trass3r
Building gcc in general is a pain. It's just a little less painful on *nix systems, but still painful. I can't agree. The build instructions contain everything. Has been straightforward for me right from the beginning.

Re: dmd gdc

2012-01-26 Thread Trass3r
I looked up ldc recently, and it seems that it hasn't been updated for years. Seems that gdc is the only other D compiler that's still actively maintained. Please don't spread such misinformation. https://github.com/ldc-developers/ldc/commits/master

Re: dmd gdc

2012-01-26 Thread Jonathan M Davis
On Thursday, January 26, 2012 19:56:22 Trass3r wrote: I looked up ldc recently, and it seems that it hasn't been updated for years. Seems that gdc is the only other D compiler that's still actively maintained. Please don't spread such misinformation.

Re: unittests running before static ctors??

2012-01-26 Thread Era Scarecrow
I just noticed that unittests are running before static class ctors. Is this a bug?? [...] I would definitely think that that's a bug. If you're seeing that happen, please report it. [...] Hmm. It appears that I'm misunderstanding D syntax. What does a static {...} block in a

Re: Singleton question (shared class)

2012-01-26 Thread Ali Çehreli
On 01/25/2012 06:35 AM, Mars wrote: I have a few classes which I want to implement as singletons (like configuration, database connection, etc.), because I have to access them throughout my whole program, and from different threads. You haven't asked, so I shouldn't be commenting on your

Re: Using Clang with D

2012-01-26 Thread Jacob Carlborg
On 2012-01-26 10:29, Jacob Carlborg wrote: I'm trying to port a simple example that uses Clang from C to D but for some reason the D version results in a segmentation fault. This is the C code: http://pastebin.com/4B2JGz9n This is the D code: http://pastebin.com/XPBsSVup The stacktrace from

Re: Using Clang with D

2012-01-26 Thread Timon Gehr
On 01/26/2012 08:44 PM, Jacob Carlborg wrote: On 2012-01-26 10:29, Jacob Carlborg wrote: I'm trying to port a simple example that uses Clang from C to D but for some reason the D version results in a segmentation fault. This is the C code: http://pastebin.com/4B2JGz9n This is the D code:

Re: Singleton question (shared class)

2012-01-26 Thread Mars
On Thursday, 26 January 2012 at 19:13:11 UTC, Ali Çehreli wrote: You haven't asked, so I shouldn't be commenting on your design, but singleton is accepted as an anti-pattern for a long time now. It is more like a solution in search of a problem. For example, in your case, you can solve your

newbie confusion with arrays and structs

2012-01-26 Thread Robert Bernecky
Hi. I am trying to write my first D program, and am quite stuck in several areas. This is on Ubuntu 10.10 with the dmd DMD64 D Compiler v2.055. I want to create a generic struct for multi-dimensional arrays, in which the value parts can be shared. E.g., an array comprises a vector of its raveled

Re: newbie confusion with arrays and structs

2012-01-26 Thread H. S. Teoh
On Thu, Jan 26, 2012 at 08:34:12PM +, Robert Bernecky wrote: Hi. I am trying to write my first D program, and am quite stuck in several areas. This is on Ubuntu 10.10 with the dmd DMD64 D Compiler v2.055. [...] However, none of this stuff works. Here's what I get: dmd prd.d -unittest

Re: newbie confusion with arrays and structs

2012-01-26 Thread Jesse Phillips
The important mangled message here is: prd.o:(.data+0x250): undefined reference to `_D5Array12__ModuleInfoZ' This is a linker error, your code compiled fine. The English translation: There is an undefined reference to module Array You are compiling without including all files you need

Re: newbie confusion with arrays and structs

2012-01-26 Thread Robert Bernecky
Awesome! I feel much better now; thank you both for your instant help! dmd prd.d Array.d -unittest rbe@rattler:~/plural$ prd [0] [0, 1, 2, 3, 4] Created int iota shape is %d [0] iota value is %d [0, 1, 2, 3, 4] got to unittest for Array.d [0] [0, 1, 2, 3, 4] Created int [0] [0, 1, 2, 3, 4]

Re: newbie confusion with arrays and structs

2012-01-26 Thread Justin Whear
On Thu, 26 Jan 2012 21:53:39 +, Robert Bernecky wrote: Awesome! I feel much better now; thank you both for your instant help! dmd prd.d Array.d -unittest rbe@rattler:~/plural$ prd [0] [0, 1, 2, 3, 4] Created int iota shape is %d [0] iota value is %d [0, 1, 2, 3, 4] got to

Re: newbie confusion with arrays and structs

2012-01-26 Thread Jesse Phillips
On Thursday, 26 January 2012 at 22:10:23 UTC, Justin Whear wrote: If you want your Array code to be a separate library/project, you can compile it like so: dmd Array.d -lib Then when you compile your other project: dmd prd.d -I/location/of/Array.d -L/location/of/Array.so Justin It is

Re: dmd gdc

2012-01-26 Thread Jerome BENOIT
Sorry I made a mistake here: I confused gdmd with rdmd :-) On 26/01/12 14:08, Jerome BENOIT wrote: actually is a d source file that does more than a simple translation ... as dmd On 26/01/12 13:59, Trass3r wrote: There is also gdmd : dmd front end that use gdc It's nothing but a perl

Re: TypeTuple of functions

2012-01-26 Thread Daniel Murphy
Differing part: FNaNb xdZ d6 PFNaNbNfxdZxd6 P - pointer Nf - @safe x - const The second one is a function pointer not a function, is inferred to be @safe, and inferred to return const(double). bearophile bearophileh...@lycos.com wrote in message news:jfs683$2mqh$1...@digitalmars.com...

Re: GC and void*

2012-01-26 Thread Nicolas Silva
Ok thanks! You said the current GC, do you mean that this behavior might change in the future? Well, first of all, what is T? If T is a class, you would not cast void * to T*, you almost never use T* since T is already a reference. You could cast void * to T. I am making a sort of