Spurious imports in Phobos ?

2011-11-09 Thread Somedude
Hello, When I display the dependencies with dmd -deps=depends, I see that simply importing std.stdio imports dozens of modules, among which std.ranges, std.datetime, std.c.windows.winsock, std.regex, etc In fact, the depends file is 433 lines long. I noticed that std.string imports quite a lot

Re: Spurious imports in Phobos ?

2011-11-09 Thread Somedude
Le 09/11/2011 10:14, Somedude a écrit : My question is: how do we know if std.range, std.regex, std.traits and std.algorithm are spurious imports or if we can (and threfore should) remove them safely from std.string ? Dude I meant: how do we know if std.range, std.regex, std.traits and

Re: assert(obj) is a mystery

2011-11-09 Thread Jonathan M Davis
On Tuesday, November 08, 2011 21:51:46 Davidson Corry wrote: OK. Not addressing Alex's objections at all, it's not clear to me why anyone would *need* to test the invariant of an object. I wouldn't expect it to be something that you'd need to do very often. However, if you give access to the

Internal error: e2ir.c 1242

2011-11-09 Thread Tobias Pankrath
I'd say, I found another compiler bug. - import std.stdio; template Struct(alias bar) { struct S { void foo() { FancyFunc!(this, bar).fn(); } } } template FancyFunc(alias context, alias f) { void fn() {

Re: Fake global associative array literals

2011-11-09 Thread sergk
On Fri, Oct 28, 2011 at 5:53 PM, bearophile bearophileh...@lycos.com wrote: What do you think about a rewrite rule that changes code like: int[int] aa = [1:2, 3:4]; void main() {} Into: int[int] aa; static this() {    aa = [1:2, 3:4]; } void main() {} Its not quite same case, but

Re: web development in D programming

2011-11-09 Thread Dejan Lekic
bioinfornatics wrote: I am a little disapointed, so if you have many request for a web page this lib http://arsdnet.net/dcode/ is usable or not ? I am developing an implementation of the FastCGI protocol (http://www.fastcgi.com) in D2 with the main goal go have multiplexing support.

Re: Spurious imports in Phobos ?

2011-11-09 Thread Jacob Carlborg
On 2011-11-09 10:14, Somedude wrote: Hello, When I display the dependencies with dmd -deps=depends, I see that simply importing std.stdio imports dozens of modules, among which std.ranges, std.datetime, std.c.windows.winsock, std.regex, etc In fact, the depends file is 433 lines long. I

Re: web development in D programming

2011-11-09 Thread simendsjo
On 09.11.2011 12:58, Dejan Lekic wrote: bioinfornatics wrote: I am a little disapointed, so if you have many request for a web page this lib http://arsdnet.net/dcode/ is usable or not ? I am developing an implementation of the FastCGI protocol (http://www.fastcgi.com) in D2 with the main

.Net

2011-11-09 Thread Reklen
Is there a project to export D in .Net world? I see this http://dnet.codeplex.com/ but it seems dead. I don't think D could be a rival to C# but i'm sure it may be interesting if it works in such enviroment.

Re: Spurious imports in Phobos ?

2011-11-09 Thread Somedude
Le 09/11/2011 13:15, Jacob Carlborg a écrit : Phobos contains a lot of templates and if a template isn't instantiated it won't be compiled. Meaning there can be hidden compile errors if you start to remove imports and they will not show until a template that uses something from the import is

Re: web development in D programming

2011-11-09 Thread Trass3r
I am a little disapointed, so if you have many request for a web page this lib http://arsdnet.net/dcode/ is usable or not ? If they are any other method to do a web application in D2 programming do not hesitate and tell to me which lib used. There's also a project named Serenity

Re: .Net

2011-11-09 Thread Trass3r
Am 09.11.2011, 13:39 Uhr, schrieb Reklen rek...@mymaill.com: Is there a project to export D in .Net world? I see this http://dnet.codeplex.com/ but it seems dead. Feel free to continue that project ;) Apart from that you are left with C interface dlls.

Re: Spurious imports in Phobos ?

2011-11-09 Thread Trass3r
2. what is your opinion about public import ? In C++, hidden or implicit #includes is a common source of compilation problems (order of #includes), I tend to think it's a bad thing. It can be quite useful. I use it often for C library wrappers. As soon as you import the wrapper code you

Impure static

2011-11-09 Thread bearophile
This little D2 program, a pure function contains static variables initialized with calls to not pure functions: int foo() { return 1; } pure int bar() { enum int x1 = foo(); static immutable int x2 = foo(); return x1; } void main() {} The latest DMD gives: test.d(5): Error:

Re: Spurious imports in Phobos ?

2011-11-09 Thread Trass3r
Phobos contains a lot of templates and if a template isn't instantiated it won't be compiled. Meaning there can be hidden compile errors if you start to remove imports and they will not show until a template that uses something from the import is instantiate. Wouldn't it be possible/better

Re: web development in D programming

2011-11-09 Thread Andrea Fontana
SCGI is a lot easier to implement than FASTCGI and is well-supported too from webservers. I've just developed a SCGI web-service in D over lighttpd. Il giorno mer, 09/11/2011 alle 11.58 +, Dejan Lekic ha scritto: bioinfornatics wrote: I am a little disapointed, so if you have many

Re: assert(obj) is a mystery

2011-11-09 Thread Alex Rønne Petersen
On 09-11-2011 11:33, Jonathan M Davis wrote: On Tuesday, November 08, 2011 21:51:46 Davidson Corry wrote: OK. Not addressing Alex's objections at all, it's not clear to me why anyone would *need* to test the invariant of an object. I wouldn't expect it to be something that you'd need to do

Re: Spurious imports in Phobos ?

2011-11-09 Thread Jacob Carlborg
On 2011-11-09 14:16, Trass3r wrote: Phobos contains a lot of templates and if a template isn't instantiated it won't be compiled. Meaning there can be hidden compile errors if you start to remove imports and they will not show until a template that uses something from the import is instantiate.

Re: Spurious imports in Phobos ?

2011-11-09 Thread Jacob Carlborg
On 2011-11-09 13:45, Somedude wrote: Le 09/11/2011 13:15, Jacob Carlborg a écrit : Phobos contains a lot of templates and if a template isn't instantiated it won't be compiled. Meaning there can be hidden compile errors if you start to remove imports and they will not show until a template that

Re: Looking for documentation of D's lower-level aspects.

2011-11-09 Thread Marco Leise
Am 23.10.2011, 06:04 Uhr, schrieb Jonathan M Davis jmdavisp...@gmx.com: I'd have to go digging through the newsgroup archives to give all of the reasons but it basically comes down to the fact that people very rarely want to pass containers by value, and the fact that C++ makes it so that

Re: Looking for documentation of D's lower-level aspects.

2011-11-09 Thread Marco Leise
Am 24.10.2011, 03:57 Uhr, schrieb Sean Silva chisophu...@gmail.com: For example, if you look in the LLVM source tree, you'll see that they bend over backwards to avoid heap allocations. For example, in some cases, std::vector causes too much heap traffic so they have SmallVector which

Re: .Net

2011-11-09 Thread Kagamin
Reklen Wrote: Is there a project to export D in .Net world? I see this http://dnet.codeplex.com/ but it seems dead. I don't think D could be a rival to C# but i'm sure it may be interesting if it works in such enviroment. AFAIK the author tried to preserve D string semantics which is

Re: Impure static

2011-11-09 Thread Timon Gehr
On 11/09/2011 02:16 PM, bearophile wrote: This little D2 program, a pure function contains static variables initialized with calls to not pure functions: int foo() { return 1; } pure int bar() { enum int x1 = foo(); static immutable int x2 = foo(); return x1; } void main()

Is there a portable way to limit memory/cpu usage of a D application?

2011-11-09 Thread Dejan Lekic
I would be satisfied with something like POSIX.1-2001 setrlimit() . Sure nothing prevents me from using setrlimit() in my D app, but perhaps it is something to think about a portable way of doing that. One thing I like about my Java apps is that I can always specify (in the argument list) how

Re: assert(obj) is a mystery

2011-11-09 Thread Jonathan M Davis
On Wednesday, November 09, 2011 05:39 Alex Rønne Petersen wrote: On 09-11-2011 11:33, Jonathan M Davis wrote: On Tuesday, November 08, 2011 21:51:46 Davidson Corry wrote: OK. Not addressing Alex's objections at all, it's not clear to me why anyone would *need* to test the invariant of an

Re: AI Challenge - Ants

2011-11-09 Thread maarten van damme
dmd: glue.c:719: virtual void FuncDeclaration::toObjFile(int): Assertion `!vthis-csym' failed. Not able to reduce the code that causes it as it compiles fine here and it takes 10 minutes to upload new code and let it compile/play. 2011/11/8 bearophile bearophileh...@lycos.com maarten van

Re: Spurious imports in Phobos ?

2011-11-09 Thread Jonathan M Davis
On Wednesday, November 09, 2011 05:42 Jacob Carlborg wrote: On 2011-11-09 14:16, Trass3r wrote: Phobos contains a lot of templates and if a template isn't instantiated it won't be compiled. Meaning there can be hidden compile errors if you start to remove imports and they will not show

Re: AI Challenge - Ants

2011-11-09 Thread Marco Leise
Am 09.11.2011, 18:52 Uhr, schrieb maarten van damme maartenvd1...@gmail.com: dmd: glue.c:719: virtual void FuncDeclaration::toObjFile(int): Assertion `!vthis-csym' failed. Not able to reduce the code that causes it as it compiles fine here and it takes 10 minutes to upload new code and

Re: AI Challenge - Ants

2011-11-09 Thread Marco Leise
Looks like issue #6395 or any of the issues linked in there: http://d.puremagic.com/issues/show_bug.cgi?id=6395 It could actually depend on the order the source files are found and appended to the command line by the server's compile script. :-/

Re: assert(obj) is a mystery

2011-11-09 Thread Davidson Corry
On 11/9/2011 9:35 AM, Jonathan M Davis wrote: On Wednesday, November 09, 2011 05:39 Alex Rønne Petersen wrote: On 09-11-2011 11:33, Jonathan M Davis wrote: On Tuesday, November 08, 2011 21:51:46 Davidson Corry wrote: OK. Not addressing Alex's objections at all, it's not clear to me why anyone

Re: assert(obj) is a mystery

2011-11-09 Thread Jonathan M Davis
On Wednesday, November 09, 2011 16:36 Davidson Corry wrote: On 11/9/2011 9:35 AM, Jonathan M Davis wrote: On Wednesday, November 09, 2011 05:39 Alex Rønne Petersen wrote: On 09-11-2011 11:33, Jonathan M Davis wrote: On Tuesday, November 08, 2011 21:51:46 Davidson Corry wrote: OK. Not

Re: Spurious imports in Phobos ?

2011-11-09 Thread Jacob Carlborg
On 2011-11-09 19:14, Jonathan M Davis wrote: On Wednesday, November 09, 2011 05:42 Jacob Carlborg wrote: On 2011-11-09 14:16, Trass3r wrote: Phobos contains a lot of templates and if a template isn't instantiated it won't be compiled. Meaning there can be hidden compile errors if you start to