Re: GC vs. Manual Memory Management Real World Comparison

2012-09-13 Thread Paulo Pinto
On Wednesday, 12 September 2012 at 02:37:52 UTC, SomeDude wrote: On Tuesday, 11 September 2012 at 10:28:29 UTC, bearophile wrote: SomeDude: It's a bad solution imho. Monitoring the druntime and hunting every part that allocates until our codebase is correct like Benjamen Thaut is a much

D @ ICFP 2012

2012-09-13 Thread bearophile
Kazuhiro Inaba (Dark Integers Team) has reached position 6 in the prestigious ICFP 2012, it's not bad: http://www.kmonos.net/repos/icfpc12/wiki?name=icfpc12 Code: http://www.kmonos.net/repos/icfpc12/dir?ci=tip Info on the contest and its results: http://www.youtube.com/watch?v=5TCqUU3-GT0

Re: Is anyone able to contribute a Solaris machine to the auto tester infrastructure?

2012-09-13 Thread Paulo Pinto
On Wednesday, 12 September 2012 at 06:09:04 UTC, Alex Rønne Petersen wrote: Hi, I'm currently working on porting the tool chain to Solaris (or rather, updating the existing, bitrotten port). It would be nice if we could add a Solaris machine to the auto tester infrastructure to make sure the

Whether it is possible to produce PURELY statically linked program in D , just like C++

2012-09-13 Thread deeproot
For C++ $ cat hello.cpp #include iostream using namespace std; int main() { cout hello; return 0; } $ g++ hello.cpp -o hello $ ldd hello linux-gate.so.1 = (0xb7703000) libstdc++.so.6 =

Whether it is possible to produce PURELY statically linked program in D , just like C++

2012-09-13 Thread deeproot
For C++ $ cat hello.cpp #include iostream using namespace std; int main() { cout hello; return 0; } $ g++ hello.cpp -o hello $ ldd hello linux-gate.so.1 = (0xb7703000) libstdc++.so.6 =

Re: DMD in distribute of linux

2012-09-13 Thread Andrei Alexandrescu
On 9/12/12 10:34 PM, nazriel wrote: On Wednesday, 12 September 2012 at 17:06:36 UTC, Habibutsu wrote: At now in most distribute of linux contains ldc (LLVM D Compiler) and not contain dmd. Why? Arch Linux has got everything, DMD, LDC, GDC everything up-to-date! :-) Thanks svenstaro! I

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Andrei Alexandrescu
On 9/13/12 1:02 AM, Manuel wrote: If a bigger part of the D community would like to have these annotations added to the language, at least as an optional feature, then that might persuade our benevolent dictators (just joking - you are great!) Walther and Andrei to add them or we could just make

Re: DMD in distribute of linux

2012-09-13 Thread Alex Rønne Petersen
On 13-09-2012 12:23, Andrei Alexandrescu wrote: On 9/12/12 10:34 PM, nazriel wrote: On Wednesday, 12 September 2012 at 17:06:36 UTC, Habibutsu wrote: At now in most distribute of linux contains ldc (LLVM D Compiler) and not contain dmd. Why? Arch Linux has got everything, DMD, LDC, GDC

Re: Whether it is possible to produce PURELY statically linked program in D , just like C++

2012-09-13 Thread Iain Buclaw
On 13 September 2012 10:25, deeproot deeprootdeepr...@gmail.com wrote: For C++ $ cat hello.cpp #include iostream using namespace std; int main() { cout hello; return 0; } $ g++ hello.cpp -o hello $ ldd hello

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Namespace
In D: class A { // or struct A(ref int host) : _host(host) { } private: int* _host; } Since when do we have initialization lists in D? ;) at topic: +1

Re: Whether it is possible to produce PURELY statically linked program in D , just like C++

2012-09-13 Thread Jacob Carlborg
On 2012-09-13 11:26, deeproot wrote: Now, when i compile with -static flag to gdc then i get following warnings $ gdc -static hello.d /usr/lib/gcc/i686-linux-gnu/4.6/libgphobos2.a(path.o): In function `_D3std4path11expandTildeFAyaZAya18expandFromDatabaseFAyaZAya': (.text+0x335): warning:

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Andrei Alexandrescu
On 9/13/12 6:58 AM, Namespace wrote: In D: class A { // or struct A(ref int host) : _host(host) { } private: int* _host; } Since when do we have initialization lists in D? ;) Oops, sorry :o). at topic: +1 One question Walter and I thought about a lot was whether we should disallow

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Mehrdad
On Thursday, 13 September 2012 at 10:34:00 UTC, Andrei Alexandrescu wrote: The thing is, however, that in this matter reasonable people may disagree. Sounds exactly like the C# lambda syntax situation.

Re: LDC

2012-09-13 Thread Don Clugston
On 05/09/12 20:12, Jacob Carlborg wrote: On 2012-09-05 14:32, Piotr Szturmaj wrote: angel wrote: Check out LDC web-page ... In github we see they're up to date - merging 2.060 What's the status of SEH on Windows? It's not looking good, at least not for 32bit. Borland has some kind of

Re: Would like to see ref and out required for function calls

2012-09-13 Thread David Piepgrass
I don't think there would be problems with allowing ref/out optionally at the call site. The thing is, however, that in this matter reasonable people may disagree. I'd be unable to identify any pattern in engineers choosing one preference over the other. Maybe C++ fans prefer pointers or

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Andrei Alexandrescu
On 9/13/12 10:53 AM, David Piepgrass wrote: Walter and I have discussed this for quite a while. We have recently decided to disallow, at least in SafeD, escaping the address of a ref parameter. In the beginning we'll be overly conservative by disallowing taking the address of a ref altogether.

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Jonathan M Davis
On Thursday, September 13, 2012 12:34:34 Andrei Alexandrescu wrote: I don't think there would be problems with allowing ref/out optionally at the call site. The thing is, however, that in this matter reasonable people may disagree. I really think that optionally allowing ref and out at the

Re: Would like to see ref and out required for function calls

2012-09-13 Thread David Piepgrass
On Thursday, 13 September 2012 at 15:01:28 UTC, Andrei Alexandrescu wrote: On 9/13/12 10:53 AM, David Piepgrass wrote: Walter and I have discussed this for quite a while. We have recently decided to disallow, at least in SafeD, escaping the address of a ref parameter. In the beginning we'll

Re: Would like to see ref and out required for function calls

2012-09-13 Thread David Piepgrass
I really think that optionally allowing ref and out at the call site is more damaging than beneficial. _Requiring_ it could be beneficial, since then you know that the arguments are being taken by ref, but if it's optional, it gives you a false sense of security and can be misleading. It

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Andrei Alexandrescu
On 9/13/12 11:47 AM, David Piepgrass wrote: I really think that optionally allowing ref and out at the call site is more damaging than beneficial. _Requiring_ it could be beneficial, since then you know that the arguments are being taken by ref, but if it's optional, it gives you a false sense

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Mehrdad
On Thursday, 13 September 2012 at 16:29:19 UTC, Andrei Alexandrescu wrote: It gives *who* a false sense of security? It's whom. Andrei P.S. All of my life I've been waiting for this moment!!! LOL

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Sean Kelly
On Sep 13, 2012, at 7:21 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: One question Walter and I thought about a lot was whether we should disallow escaping addresses of ref parameters in general or only in @safe code. We decided to go for the latter in order to avoid

Re: DMD in distribute of linux

2012-09-13 Thread mist
dmd2-git is in AUR too, not in main repo.

Re: LDC

2012-09-13 Thread Jacob Carlborg
On 2012-09-13 16:40, Don Clugston wrote: That sounds paranoid to me. I believe the patent is essentially a workaround for the absence of thread-local variables on 16-bit Windows. Yeah, I know. In D we have working thread-local variables even on Windows versions that don't support them,

Re: LDC

2012-09-13 Thread Sean Kelly
On Sep 13, 2012, at 11:21 AM, Jacob Carlborg d...@me.com wrote: On 2012-09-13 16:40, Don Clugston wrote: In D we have working thread-local variables even on Windows versions that don't support them, thanks to Rainer's brilliant work. Which gives very many ways of implementing exception

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Jonathan M Davis
On Thursday, September 13, 2012 17:47:45 David Piepgrass wrote: It gives *who* a false sense of security? If it's optional then I *know* lack of ref/out doesn't imply that the parameter won't change. Only people who don't know the rules would have this false sense of security. More like

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Manuel
On Thursday, 13 September 2012 at 15:18:06 UTC, Jonathan M Davis wrote: On Thursday, September 13, 2012 12:34:34 Andrei Alexandrescu wrote: I don't think there would be problems with allowing ref/out optionally at the call site. The thing is, however, that in this matter reasonable people may

Re: BIg semantic issues with SList DList

2012-09-13 Thread monarch_dodra
On Wednesday, 12 September 2012 at 17:24:57 UTC, monarch_dodra wrote: [SNIP] I did some tests and implementations, and I came with 3 options: 1) Embrace the view of a chain implementation and document it. 2) Use classic reference semantics. However, ranges can still have an out of bonds view

Re: BIg semantic issues with SList DList

2012-09-13 Thread monarch_dodra
On Thursday, 13 September 2012 at 19:37:41 UTC, monarch_dodra wrote: On Wednesday, 12 September 2012 at 17:24:57 UTC, monarch_dodra wrote: [SNIP] [SNIP] I'll just copy paste here the 3 headers which contain examples, to give a quicker idea of what I went for: 111 CHAIN IMPLEMENTATION 111

Re: Would like to see ref and out required for function calls

2012-09-13 Thread Manuel
On Thursday, 13 September 2012 at 10:34:00 UTC, Andrei Alexandrescu wrote: On 9/13/12 1:02 AM, Manuel wrote: If a bigger part of the D community would like to have these annotations added to the language, at least as an optional feature, then that might persuade our benevolent dictators (just

Re: Would like to see ref and out required for function calls

2012-09-13 Thread ixid
Couldn't this easily be supported by an IDE by coloured function arguments based on their type? Then the information is clearly visible without cluttering the code.

Re: [Scons-users] D and SCons

2012-09-13 Thread Rob T
On Thursday, 13 September 2012 at 22:36:23 UTC, Rob T wrote: I just started using your fork of scons and I appreciate the effort. There are a few issues I will report. https://bitbucket.org/russel/scons_d_tooling/issues This repository does not have issue tracking enabled. Is there another

Re: [Scons-users] D and SCons

2012-09-13 Thread Rob T
I just started using your fork of scons and I appreciate the effort. There are a few issues I will report. I definitely would like to see scons build and link both c/c++ objects files together with D, so for that reason alone integration is a good idea imo. Integration is also a good idea for

Re: LDC

2012-09-13 Thread Rob T
On Wednesday, 5 September 2012 at 14:42:25 UTC, Russel Winder wrote: It appears that the LDC website is in need of an overhaul. No kidding. I thought the project was completely dead. Updating a web page is usually very easy, strange ... -rt

Re: [Scons-users] D and SCons

2012-09-13 Thread Russel Winder
On Fri, 2012-09-14 at 00:39 +0200, Rob T wrote: On Thursday, 13 September 2012 at 22:36:23 UTC, Rob T wrote: I just started using your fork of scons and I appreciate the effort. There are a few issues I will report. https://bitbucket.org/russel/scons_d_tooling/issues This repository

Re: LDC

2012-09-13 Thread Russel Winder
On Fri, 2012-09-14 at 00:52 +0200, Rob T wrote: On Wednesday, 5 September 2012 at 14:42:25 UTC, Russel Winder wrote: It appears that the LDC website is in need of an overhaul. No kidding. I thought the project was completely dead. Updating a web page is usually very easy, strange ...

Writing UFCS function for any instance of a templated struct

2012-09-13 Thread Rene Zwanenburg
Hi, I'd like to write a function for a vector template which basically looks like struct Vec(T, size_t size) { T[size] e; } This template has a few properties with very common names like x, y, z, etc. To avoid mistakes I'd like to write a template constraint for UFCS functions so it

Re: Writing UFCS function for any instance of a templated struct

2012-09-13 Thread David
Am 13.09.2012 11:46, schrieb Rene Zwanenburg: Hi, I'd like to write a function for a vector template which basically looks like struct Vec(T, size_t size) { T[size] e; } This template has a few properties with very common names like x, y, z, etc. To avoid mistakes I'd like to write a

Re: Writing UFCS function for any instance of a templated struct

2012-09-13 Thread Rene Zwanenburg
That works, nice trick! Thanks On Thursday, 13 September 2012 at 10:09:08 UTC, David wrote: Am 13.09.2012 11:46, schrieb Rene Zwanenburg: Hi, I'd like to write a function for a vector template which basically looks like struct Vec(T, size_t size) { T[size] e; } This template has a few

Re: Writing UFCS function for any instance of a templated struct

2012-09-13 Thread bearophile
Rene Zwanenburg: How can I do this? One possible solution: struct Vec(T, size_t size) { T[size] e; } void innerProduct(T, size_t n)(const Vec!(T, n) v1, const Vec!(T, n) v2) {} void main() { Vec!(int, 3) v1, v2; innerProduct(v1, v2); } (While

Re: Writing UFCS function for any instance of a templated struct

2012-09-13 Thread Rene Zwanenburg
That's actually quite straightforward. I forgot how well D's type deduction works. Thanks On Thursday, 13 September 2012 at 11:01:18 UTC, bearophile wrote: Rene Zwanenburg: How can I do this? One possible solution: struct Vec(T, size_t size) { T[size] e; } void innerProduct(T,

Re: string vs. const(char)[] on the function signature

2012-09-13 Thread Steven Schveighoffer
I know this is really old, but just catching up on old posts. On Fri, 13 Jul 2012 13:19:34 -0400, Ali Çehreli acehr...@yahoo.com wrote: tl;dr - Please see the conclusion section below. [snip] CONCLUSION: * For parameters of reference types that are not modified in the function, const is

Reading stdout of an external process using pipes under windows

2012-09-13 Thread Danny Arends
I decided to put some code here that allowed me read (via a streamed pipe) the stdout from an external process. I didn't see something like this before and when searching I only found the new std.process in phobos development branch which doesn't have a Windows version. If anyone feels like

member function as template parameter workaround needed

2012-09-13 Thread timotheecour
As part of a larger system (which converts function parameters to a suitable type), I need to solve the following: pass a member function to a run template function, access its ParameterTypeTuple, and actually be able to run the function. I've simplified the problem (see below). Is there a way

Re: member function as template parameter workaround needed

2012-09-13 Thread bearophile
timotheecour: //attempt#2 //also tried to just pass x=a.fun2(x), but then ParameterTypeTuple doesn't work with lambdas. I think x = a.fun2(x) isn't an anonymous function, it's templated. Bye, bearophile

Re: member function as template parameter workaround needed

2012-09-13 Thread Andrej Mitrovic
On 9/14/12, timotheecour thelastmamm...@gmail.com wrote: Also I can't pass a.fun2 as fun2 is not static. Why not pass it as a runtime argument? void run(Fun, T...)(Fun fun, T args) { writeln(typeid(ParameterTypeTuple!(fun))); fun(args); } void test() { auto a = new A;

Re: member function as template parameter workaround needed

2012-09-13 Thread timotheecour
On Friday, 14 September 2012 at 00:31:15 UTC, Andrej Mitrovic wrote: On 9/14/12, timotheecour thelastmamm...@gmail.com wrote: It has issues when the class is defined in a different modules, but not always! This looks like a compiler bug. Feel free to file it in http://d.puremagic.com/issues/

Re: member function as template parameter workaround needed

2012-09-13 Thread timotheecour
I filed 2 bugs: http://d.puremagic.com/issues/show_bug.cgi?id=8653 cannot take address of auto-return function declared in outside module: Error: forward reference http://d.puremagic.com/issues/show_bug.cgi?id=8654 cannot take address of function which is 1)overloaded, 2) templated, and 3)

[Issue 8647] New: Invalid specification of destroy function

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8647 Summary: Invalid specification of destroy function Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: trivial Priority: P2

[Issue 8647] Invalid specification of destroy function

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8647 Alex R�nne Petersen a...@lycus.org changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 8648] New: No error line number with incomplete template

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8648 Summary: No error line number with incomplete template Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: diagnostic Severity: normal

[Issue 8649] New: Not accepted const ref Type in foreach

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8649 Summary: Not accepted const ref Type in foreach Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: minor

[Issue 8649] Not accepted const ref Type in foreach

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8649 --- Comment #1 from Kenji Hara k.hara...@gmail.com 2012-09-13 04:29:38 PDT --- This is a dup of issue 4090. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---

[Issue 8649] Not accepted const ref Type in foreach

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8649 --- Comment #2 from bearophile_h...@eml.cc 2012-09-13 04:55:51 PDT --- (In reply to comment #1) This is a dup of issue 4090. At first sight it doesn't look like the same issue, because here I am listing all the types and modifiers. const ref

[Issue 8627] ICE(cgcs.c): indexing a returned value of type float[1]

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8627 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||ice CC|

[Issue 8627] ICE(cgcs.c): indexing a returned value of type float[1]

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8627 Don clugd...@yahoo.com.au changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 4414] ICE(cgcs.c) Taking item of static array returned by function

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4414 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||blo...@hotmail.com ---

[Issue 8650] New: SLice opOpAssign SLice with overlap does not throw

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8650 Summary: SLice opOpAssign SLice with overlap does not throw Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2

[Issue 8651] New: Slice op Slice throws exceptions (not errors), and nothrow

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8651 Summary: Slice op Slice throws exceptions (not errors), and nothrow Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Severity:

[Issue 8652] New: dmd make calls to _d_assertm

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8652 Summary: dmd make calls to _d_assertm Product: D Version: D1 D2 Platform: All OS/Version: All Status: NEW Severity: minor Priority: P2 Component: DMD

[Issue 8653] New: cannot take address of auto-return function declared in outside module: Error: forward reference

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8653 Summary: cannot take address of auto-return function declared in outside module: Error: forward reference Product: D Version: D2 Platform: All OS/Version: All

[Issue 8654] New: cannot take address of function which is 1)overloaded, 2) templated, and 3) member (static or not): Error: xxx is not an lvalue

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8654 Summary: cannot take address of function which is 1)overloaded, 2) templated, and 3) member (static or not): Error: xxx is not an lvalue Product: D Version: D2

[Issue 8415] Forward reference error with static nested classes

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8415 --- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-09-13 20:17:20 PDT --- Anyone know if this is a hard to fix bug? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this

[Issue 8655] New: bitfields and Typedef don't mix

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8655 Summary: bitfields and Typedef don't mix Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Phobos

[Issue 8422] [CTFE] TypeTuple of tuples can't be read at compile time

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8422 --- Comment #3 from github-bugzi...@puremagic.com 2012-09-13 22:13:42 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/dmd

[Issue 8422] [CTFE] TypeTuple of tuples can't be read at compile time

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8422 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added Status|NEW |RESOLVED