Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Jacob Carlborg
On 2011-08-07 21:28, dsimcha wrote: Yeah, I was trying to wrap my head around the whole "key" concept. I wasn't very successful. I also tried out Orange and filed a few bug reports. It may be that Orange isn't the right tool for the job for MPI, though modulo some bug fixing and polishing it coul

Re: What library functionality would you most like to see in D?

2011-08-07 Thread Nick Sabalausky
"Mehrdad" wrote in message news:j1lh84$2n2j$1...@digitalmars.com... >A readText() function that would read a text file (**and** autodetect its >encoding from its BOM) would be of great help. > http://www.dsource.org/projects/semitwist/browser/trunk/src/semitwist/util/io.d#L24 I agree a functio

Re: Post-ctor ctor

2011-08-07 Thread Andrei Alexandrescu
On 8/7/11 1:16 PM, Andrej Mitrovic wrote: Just throwing an idea.. structs are great since you don't have to make a special constructor just to initialize its fields. E.g.: struct Foo { int a; int b; int c; int d; } void main() { auto foo = Foo(1, 2, 3, 4); } But what

Forcing closures to come on the stack

2011-08-07 Thread Mehrdad
I just made something I thought I'd share. It's great for those times when the compiler decides to randomly put a closure on the heap. The usage is pretty simple: int x = 5; auto adder5 = mixin(closure!x(q{(int a) { return a + x; }})); assert(adder5(10) == 15); It returns a calla

Re: From a C++/JS benchmark

2011-08-07 Thread Eric Poggel (JoeCoder)
On 8/6/2011 8:34 PM, bearophile wrote: Walter: On 8/6/2011 4:46 PM, bearophile wrote: Walter is not a lover of that -ffast-math switch. No, I am not. Few understand the subtleties of IEEE arithmetic, and breaking IEEE conformance is something very, very few should even consider. I have rea

Re: path tracing benchmark

2011-08-07 Thread bearophile
Trass3r: > I ported smallpt to D some time ago and now that I've working versions of > LDC2 and GDC2 I did a quick comparison: I have converted to D many of the commonly found benchmarks, this is my version: http://codepad.org/ZbmSfseY If I compile it with with LDC1 with Link Time Optimization

Re: Two bugs found: GC bug as well as scope delegate bug

2011-08-07 Thread Mehrdad
OK so apparently the GC was working fine, my bad. I'm not sure about the compiler, though. When I have this code: void foo(int a, scope void delegate(int) sink) { sink(a); } void main() { int tmp; foo(5, delegate(int c) { tmp = c; }); } I get a he

Re: Does the 'package' protection attribute not work?

2011-08-07 Thread Jonathan M Davis
On Sunday 07 August 2011 23:29:26 Robert Clipsham wrote: > On 07/08/2011 22:18, Jonathan M Davis wrote: > > Personally, I don't see much point in using the package specifier when > > you're not actually using a package hierarchy (you're just making it so > > that everything but stuff which actually

Re: Does the 'package' protection attribute not work?

2011-08-07 Thread Jonathan M Davis
On Monday 08 August 2011 00:19:56 Stijn Herreman wrote: > On 7/08/2011 23:18, Jonathan M Davis wrote: > > On Sunday 07 August 2011 18:58:53 Stijn Herreman wrote: > >> module main; > >> > >> import std.stdio; > >> import my_module; > >> > >> int main() > >> { > >> > >>my_method(); > >>ret

path tracing benchmark

2011-08-07 Thread Trass3r
I ported smallpt to D some time ago and now that I've working versions of LDC2 and GDC2 I did a quick comparison: Original code: http://kevinbeason.com/smallpt/explicit.cpp D version: https://bitbucket.org/trass3r/smallptd/src C++ -- g++ -O3 explicit.cpp: Rendering (4 spp) 100.00% real0

Re: std.path review: final version(?)

2011-08-07 Thread Lars T. Kyllingstad
On Sat, 06 Aug 2011 14:25:40 -0700, Jonathan M Davis wrote: > On Thursday 04 August 2011 10:55:31 Lars T. Kyllingstad wrote: >> Since the voting is supposed to start today (not in this thread; >> dsimcha will annouce it), here is the (hopefully) final version of >> std.path: >> >> https://githu

Re: macro keyword taken?

2011-08-07 Thread Robert Clipsham
On 07/08/2011 23:59, Andrej Mitrovic wrote: So I wanted to make myself a template called "macro", but it turns out it's a keyword: template macro() { } test.d(7): TemplateIdentifier expected following template test.d(7): Declaration expected, not 'macro' Is there something planned with this ke

macro keyword taken?

2011-08-07 Thread Andrej Mitrovic
So I wanted to make myself a template called "macro", but it turns out it's a keyword: template macro() { } test.d(7): TemplateIdentifier expected following template test.d(7): Declaration expected, not 'macro' Is there something planned with this keyword?

Re: CTFE writeln again (__ctfeWriteln)

2011-08-07 Thread bearophile
KennyTM~: > __ctfeWrite is not complex, but I don't see the need for it. I don't understand your point. Given __ctfeWrite you are able to create a __ctfeWriteln but you can't do the opposite. If I have to print something complex, like something tree-shaped, and I have just __ctfeWriteln, to cr

Re: CTFE writeln again (__ctfeWriteln)

2011-08-07 Thread Dmitry Olshansky
On 08.08.2011 1:38, KennyTM~ wrote: Pull request: https://github.com/D-Programming-Language/dmd/pull/296 Previous discussion: http://www.digitalmars.com/d/archives/digitalmars/D/CTFE_writeln_140241.html This is the 2nd try to add a compile-time printing facility to D. The previous pull reque

Re: CTFE writeln again (__ctfeWriteln)

2011-08-07 Thread KennyTM~
On Aug 8, 11 05:56, bearophile wrote: KennyTM~: So I go for my 2nd alternative, which is to add a magic function __ctfeWriteln that does the same. In my implementation, __ctfeWriteln will print the interpreted arguments to stdmsg when CTFE-ed, and is a no-op in runtime (it can be configured to

Re: Does the 'package' protection attribute not work?

2011-08-07 Thread Robert Clipsham
On 07/08/2011 22:18, Jonathan M Davis wrote: Personally, I don't see much point in using the package specifier when you're not actually using a package hierarchy (you're just making it so that everything but stuff which actually uses a hierarchy can use the function - it would be a really weird d

Re: Does the 'package' protection attribute not work?

2011-08-07 Thread Stijn Herreman
On 7/08/2011 23:18, Jonathan M Davis wrote: On Sunday 07 August 2011 18:58:53 Stijn Herreman wrote: module main; import std.stdio; import my_module; int main() { my_method(); return 0; } module my_module; import std.stdio; package void my_method() { writeln("Hello

Re: Tagging of arguments ref/out, or just out

2011-08-07 Thread bearophile
Max Klyga: > So this feature has to be either mandatory or not. Making it optional > leads to confusion as Jonathan mentioned. On this, what I have suggested it not the same thing that the original proposal says. In the original proposal the "ref" and "out" are optional. In my alternative pro

Re: CTFE writeln again (__ctfeWriteln)

2011-08-07 Thread bearophile
KennyTM~: > So I go for my 2nd alternative, which is to add a magic function > __ctfeWriteln > that does the same. > > In my implementation, __ctfeWriteln will print the interpreted arguments > to stdmsg when CTFE-ed, and is a no-op in runtime (it can be configured > to throw an exception or

CTFE writeln again (__ctfeWriteln)

2011-08-07 Thread KennyTM~
Pull request: https://github.com/D-Programming-Language/dmd/pull/296 Previous discussion: http://www.digitalmars.com/d/archives/digitalmars/D/CTFE_writeln_140241.html This is the 2nd try to add a compile-time printing facility to D. The previous pull request uses std.stdio.writeln which cause

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Sean Kelly
This would probably work with the protobuf format. Sent from my iPhone On Aug 7, 2011, at 12:28 PM, dsimcha wrote: > On 8/7/2011 2:27 PM, Jacob Carlborg wrote: >> On 2011-08-07 17:45, dsimcha wrote: >>> On 8/7/2011 11:36 AM, Jacob Carlborg wrote: Currently, the only available format is XM

Re: Does the 'package' protection attribute not work?

2011-08-07 Thread Jonathan M Davis
On Sunday 07 August 2011 18:58:53 Stijn Herreman wrote: > module main; > > import std.stdio; > import my_module; > > int main() > { > my_method(); > return 0; > } > > > module my_module; > > import std.stdio; > > package void my_method() > { >writeln("Hello D-World!"); > }

Re: Tagging of arguments ref/out, or just out

2011-08-07 Thread Max Klyga
One the main reasons c# has mandatory out and ref at call site is code versioning. If some function took an argument by value but was changed to take if by reference, without annotations compiler would treat this as an error, preventing a potential bug. So this feature has to be either mandato

Tagging of arguments ref/out, or just out

2011-08-07 Thread bearophile
This is a recently opened (not by me) enhancement request thread: http://d.puremagic.com/issues/show_bug.cgi?id=6442 It proposes something that I remember was discussed and refused two times in past: to require (but only optionally!) "ref" and "out" at the calling point, as C#4 instead always re

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread bearophile
Vladimir Panteleev: > Done: > http://dump.thecybershadow.net/b1e4cb6ef0a8d3c5f54d5cb09ddd1a9e/DMD.log There are only 10 NULL deference warnings left: s2ir.c(1043): warning C6011: Dereferencing NULL pointer 'pu++' s2ir.c(980): warning C6011: Dereferencing NULL pointer 'cases' statement.c(3666):

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Vladimir Panteleev
On Sun, 07 Aug 2011 22:11:35 +0300, Vladimir Panteleev wrote: On Sun, 07 Aug 2011 21:45:45 +0300, bearophile wrote: Vladimir Panteleev: http://thecybershadow.net/d/vcanalysis/ As with (first report of) Clang I see that assert(p); p->foo... are marked as "Dereferencing NULL pointer"

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread dsimcha
On 8/7/2011 2:27 PM, Jacob Carlborg wrote: On 2011-08-07 17:45, dsimcha wrote: On 8/7/2011 11:36 AM, Jacob Carlborg wrote: Currently, the only available format is XML. Ok, I'll look into writing a binary archiver that assumes that the CPU architecture on the deserializing end is the same as t

Re: Post-ctor ctor

2011-08-07 Thread bearophile
Trass3r: > > this(int this.a, int this.b, int this.c, int this.d) { > > sum = a + b + c + d; > > average = (a + b + c + d) / 4; > > } > > Can't express how awkward this is. Why don't you try to express how awkward it is? Well, code like this is shorter than what the OP h

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread KennyTM~
On Aug 8, 11 03:08, KennyTM~ wrote: On Aug 8, 11 02:45, bearophile wrote: Vladimir Panteleev: http://thecybershadow.net/d/vcanalysis/ As with (first report of) Clang I see that assert(p); p->foo... are marked as "Dereferencing NULL pointer". Do you know the purpose of this? os->name = strd

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Vladimir Panteleev
On Sun, 07 Aug 2011 21:45:45 +0300, bearophile wrote: Vladimir Panteleev: http://thecybershadow.net/d/vcanalysis/ As with (first report of) Clang I see that assert(p); p->foo... are marked as "Dereferencing NULL pointer". Ah, that would probably be in files that #include instead of

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread KennyTM~
On Aug 8, 11 02:45, bearophile wrote: Vladimir Panteleev: http://thecybershadow.net/d/vcanalysis/ As with (first report of) Clang I see that assert(p); p->foo... are marked as "Dereferencing NULL pointer". Do you know the purpose of this? os->name = strdup(name); warning C4996: 'str

Re: Post-ctor ctor

2011-08-07 Thread Trass3r
this(int this.a, int this.b, int this.c, int this.d) { sum = a + b + c + d; average = (a + b + c + d) / 4; } Can't express how awkward this is.

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread KennyTM~
On Aug 7, 11 22:23, Vladimir Panteleev wrote: On Sun, 07 Aug 2011 13:29:20 +0300, Walter Bright wrote: It's less complex (!) if you are not trying to make a working dmd. It just needs to compile. OK, that wasn't actually too bad. https://github.com/CyberShadow/dmd/tree/compile-on-vs10 2979

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Vladimir Panteleev
On Sun, 07 Aug 2011 21:47:07 +0300, bearophile wrote: Vladimir Panteleev: Could you please elaborate? The list of links is sorted alphabetically, so files under "root" are lower down the list. What do you see if you click on a link like "root\root.c"? Ah! I didn't reproduce the proble

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread bearophile
Vladimir Panteleev: > http://thecybershadow.net/d/vcanalysis/ As with (first report of) Clang I see that assert(p); p->foo... are marked as "Dereferencing NULL pointer". Do you know the purpose of this? os->name = strdup(name); warning C4996: 'strdup': The POSIX name for this item is dep

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread bearophile
Vladimir Panteleev: > Could you please elaborate? The list of links is sorted alphabetically, so > files under "root" are lower down the list. What do you see if you click on a link like "root\root.c"? Bye, bearophile

Re: Post-ctor ctor

2011-08-07 Thread bearophile
> With that idea your struct becomes: Or just: struct Foo { int a, b, c, d, sum, average; this(this.a, this.b, this.c, this.d) { sum = a + b + c + d; average = (a + b + c + d) / 4; } } Bye, bearophile

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Jacob Carlborg
On 2011-08-07 18:01, Lutger Blijdestijn wrote: dsimcha wrote: On 8/7/2011 11:36 AM, Jacob Carlborg wrote: Currently, the only available format is XML. Ok, I'll look into writing a binary archiver that assumes that the CPU architecture on the deserializing end is the same as that on the seria

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Jacob Carlborg
On 2011-08-07 17:58, dsimcha wrote: On 8/7/2011 11:36 AM, Jacob Carlborg wrote: Good to know, but what flavor? As I see it there is a three-way tradeoff in serialization. In order of importance for distributed parallelism, the qualities are: I can answer these tradeoff for the Orange serializa

Re: Post-ctor ctor

2011-08-07 Thread bearophile
Andrej Mitrovic: > Good idea / bad idea? I prefer a solution that to me looks simpler, discussed a bit here: http://d.puremagic.com/issues/show_bug.cgi?id=3878 With that idea your struct becomes: struct Foo { int a, b, c, d, sum, average; this(int this.a, int this.b, int this.c, int th

Re: What library functionality would you most like to see in D?

2011-08-07 Thread Mehrdad
On 8/7/2011 3:21 AM, Jonathan M Davis wrote: On Sunday 07 August 2011 14:08:06 Dmitry Olshansky wrote: On 07.08.2011 12:09, Mehrdad wrote: A readText() function that would read a text file (**and** autodetect its encoding from its BOM) would be of great help. Well the name is here, dunno if it

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Vladimir Panteleev
On Sun, 07 Aug 2011 21:28:18 +0300, bearophile wrote: Vladimir Panteleev: http://thecybershadow.net/d/vcanalysis/ I don't see the pages in inner directories like "root\root.c". Could you please elaborate? The list of links is sorted alphabetically, so files under "root" are lower down

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Vladimir Panteleev
On Sun, 07 Aug 2011 21:17:30 +0300, Walter Bright wrote: Try the All Rules. Ah, my mistake. The rulesets only apply to managed (.NET) code. It looks like C/C++ code analysis is just an on/off switch. http://msdn.microsoft.com/en-us/library/d3bbz7tz(v=vs.80).aspx -- Best regards, Vladi

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread bearophile
Vladimir Panteleev: > http://thecybershadow.net/d/vcanalysis/ I don't see the pages in inner directories like "root\root.c". Bye, bearophile

Re: Two bugs found: GC bug as well as scope delegate bug

2011-08-07 Thread Mehrdad
On 8/7/2011 1:15 AM, KennyTM~ wrote: On Aug 7, 11 14:47, Mehrdad wrote: Everyone, apologies for this in hindsight, it's quite ridiculous. x_x In trying to reproduce a similar bug I saw in my code, I made a completely stupid example which made no sense. I'll proofread better next time, hop

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Jacob Carlborg
On 2011-08-07 17:45, dsimcha wrote: On 8/7/2011 11:36 AM, Jacob Carlborg wrote: Currently, the only available format is XML. Ok, I'll look into writing a binary archiver that assumes that the CPU architecture on the deserializing end is the same as that on the serializing end. If it works, may

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Jacob Carlborg
On 2011-08-07 18:15, Sean Kelly wrote: I was mostly wondering if the serialized was all template code or if the archived portion used some form of polymorphism. Sounds like its the latter. The serializer uses template methods, the archive uses interfaces and virtual methods. Sent from my i

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Walter Bright
On 8/7/2011 10:43 AM, bearophile wrote: and there's that cast to float he overlooked, sabotaging his upgrade. Even worse, suppose the type of f or d or both is changed to some user defined type, like BigFloat? That cast is just going to *cause* a bug, not fix it. Requiring the programmer to load

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Walter Bright
On 8/7/2011 11:06 AM, Vladimir Panteleev wrote: I'll see if I can get it in a more readable format (something like the HTML files clang's scan-build outputs). http://thecybershadow.net/d/vcanalysis/ Very nice!

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Walter Bright
On 8/7/2011 11:13 AM, Vladimir Panteleev wrote: On Sun, 07 Aug 2011 20:11:49 +0300, bearophile wrote: Later a higher level will show other warnings. I have the following levels to choose from: Microsoft All Rules Microsoft Basic Correctness Rules Microsoft Basic Design Guideline Rules Micro

Post-ctor ctor

2011-08-07 Thread Andrej Mitrovic
Just throwing an idea.. structs are great since you don't have to make a special constructor just to initialize its fields. E.g.: struct Foo { int a; int b; int c; int d; } void main() { auto foo = Foo(1, 2, 3, 4); } But what if I add an extra couple of fields that have to b

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Vladimir Panteleev
On Sun, 07 Aug 2011 20:11:49 +0300, bearophile wrote: Later a higher level will show other warnings. I have the following levels to choose from: Microsoft All Rules Microsoft Basic Correctness Rules Microsoft Basic Design Guideline Rules Microsoft Extended Correctness Rules Microsoft Exten

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Vladimir Panteleev
On Sun, 07 Aug 2011 17:23:48 +0300, Vladimir Panteleev wrote: I'll see if I can get it in a more readable format (something like the HTML files clang's scan-build outputs). http://thecybershadow.net/d/vcanalysis/ Created with: https://github.com/CyberShadow/ColorerVCLog -- Best regards,

Re: From a C++/JS benchmark

2011-08-07 Thread Trass3r
Anyways, I've tweaked the GDC codegen, and program speed meets that of C++ now (on my system). Implementation: http://ideone.com/0j0L1 Command-line: gdc -O3 -mfpmath=sse -ffast-math -march=native -frelease g++ bench.cc -O3 -mfpmath=sse -ffast-math -march=native Best times: G++-32bit: 114

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Robert Clipsham
On 07/08/2011 18:34, Walter Bright wrote: On 8/7/2011 7:23 AM, Vladimir Panteleev wrote: 2979 warnings with code analysis with the "Microsoft Minimum Recommended Rules" ruleset. http://dump.thecybershadow.net/2e0571641194d945869a1b12b29aacdc/DMD.log Thanks, this is what I was looking for! I

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread bearophile
Walter: > and there's that cast to float he overlooked, sabotaging his upgrade. Even > worse, suppose the type of f or d or both is changed to some user defined > type, > like BigFloat? That cast is just going to *cause* a bug, not fix it. > > Requiring the programmer to load up on casts is no

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Walter Bright
On 8/7/2011 7:23 AM, Vladimir Panteleev wrote: 2979 warnings with code analysis with the "Microsoft Minimum Recommended Rules" ruleset. http://dump.thecybershadow.net/2e0571641194d945869a1b12b29aacdc/DMD.log Thanks, this is what I was looking for! I'll see if I can get it in a more readable

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Walter Bright
On 8/7/2011 10:11 AM, bearophile wrote: It contains FP warnings like the one I have asked for D too. DMD doesn't perform certain unsafe FP operations because they and break IEEE conformance, but casting a double to float is accepted and regarded "safe" (I am not sure of this): lexer.c(2500): warn

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread bearophile
Vladimir Panteleev: > 2979 warnings with code analysis with the "Microsoft Minimum Recommended > Rules" ruleset. Thank you. Info about this minimum level: http://msdn.microsoft.com/en-us/library/dd264893.aspx Later a higher level will show other warnings. > http://dump.thecybershadow.net/2e05

Does the 'package' protection attribute not work?

2011-08-07 Thread Stijn Herreman
module main; import std.stdio; import my_module; int main() { my_method(); return 0; } module my_module; import std.stdio; package void my_method() { writeln("Hello D-World!"); } Error: function my_module.my_method is not accessible from main

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread dsimcha
On 8/6/2011 12:32 PM, Sean Kelly wrote: I'd love to be able to send classes between processes, but first we need a good serialization/deserialization mechanism. The more I think about it, the more I think that std.concurrency isn't quite the right interface for cluster parallelism. I'm think

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Sean Kelly
I was mostly wondering if the serialized was all template code or if the archived portion used some form of polymorphism. Sounds like its the latter. Sent from my iPhone On Aug 7, 2011, at 8:19 AM, Jacob Carlborg wrote: > On 2011-08-07 02:24, Sean Kelly wrote: >> Is the archive formatter dyna

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Sean Kelly
Nope. It would represent an external destination and defines the protocol. Sent from my iPhone On Aug 6, 2011, at 6:57 PM, dsimcha wrote: > On 8/6/2011 8:26 PM, Sean Kelly wrote: >> I'm hoping to simply extend the existing API. The crucial portion will be >> the addition of a Node (base) type

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread dsimcha
On 8/7/2011 12:01 PM, Lutger Blijdestijn wrote: dsimcha wrote: On 8/7/2011 11:36 AM, Jacob Carlborg wrote: Currently, the only available format is XML. Ok, I'll look into writing a binary archiver that assumes that the CPU architecture on the deserializing end is the same as that on the seri

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Lutger Blijdestijn
dsimcha wrote: > On 8/7/2011 11:36 AM, Jacob Carlborg wrote: >> Currently, the only available format is XML. > > Ok, I'll look into writing a binary archiver that assumes that the CPU > architecture on the deserializing end is the same as that on the > serializing end. If it works, maybe Orange

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Lutger Blijdestijn
link for the D implementation: https://bitbucket.org/repeatedly/msgpack4d/

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread dsimcha
On 8/7/2011 11:36 AM, Jacob Carlborg wrote: Good to know, but what flavor? As I see it there is a three-way tradeoff in serialization. In order of importance for distributed parallelism, the qualities are: I can answer these tradeoff for the Orange serialization library, http://dsource.org/proj

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread dsimcha
On 8/7/2011 11:36 AM, Jacob Carlborg wrote: Currently, the only available format is XML. Ok, I'll look into writing a binary archiver that assumes that the CPU architecture on the deserializing end is the same as that on the serializing end. If it works, maybe Orange is a good choice.

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Jacob Carlborg
On 2011-08-07 00:09, dsimcha wrote: On 8/6/2011 5:38 PM, jdrewsen wrote: AFAIK David Nadlinger is handling serialization in his GSOC Thrift project that he is working on currently. /Jonas Good to know, but what flavor? As I see it there is a three-way tradeoff in serialization. In order of im

Re: const assignments problem again

2011-08-07 Thread Jacob Carlborg
On 2011-08-07 03:19, bearophile wrote: I have discussed about this topic once in past, but in the meantime I have seen this is a quite common problem, so I think it doesn't harm to touch this topic again. This is a direct D translation of the original C or C++ code: // version #1 double foo;

Re: std.concurrency wrapper over MPI?

2011-08-07 Thread Jacob Carlborg
On 2011-08-07 02:24, Sean Kelly wrote: Is the archive formatter dynamically pluggable? I'm not exactly sure what you mean but you can create new archive types and use them with the existing serializer. When creating a new serializer it takes an archive (as an interface) as a parameter. Sen

Re: Template struct literals should infer template parameters

2011-08-07 Thread Ali Çehreli
On Sat, 06 Aug 2011 20:19:06 +, Sean Eskapp wrote: > If I have something like > > struct S(T) > { > T data; > } > > > I can't make a struct literal with > > int mystuff; > someFunc(S(mystuff)); It has been the same in C++. The reason is that the syntax above wo

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Marco Leise
Am 07.08.2011, 16:23 Uhr, schrieb Vladimir Panteleev : On Sun, 07 Aug 2011 13:29:20 +0300, Walter Bright wrote: It's less complex (!) if you are not trying to make a working dmd. It just needs to compile. OK, that wasn't actually too bad. https://github.com/CyberShadow/dmd/tree/compi

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Vladimir Panteleev
On Sun, 07 Aug 2011 13:29:20 +0300, Walter Bright wrote: It's less complex (!) if you are not trying to make a working dmd. It just needs to compile. OK, that wasn't actually too bad. https://github.com/CyberShadow/dmd/tree/compile-on-vs10 2979 warnings with code analysis with the "Mic

Re: like types

2011-08-07 Thread Adam D. Ruppe
bearophile: > Is this the same thing you are saying? Yeah, though in D you'd have to use objects and interfaces rather than primitives. Casting to the interface would return null if it doesn't match, so it compiles but then errors at runtime.

Re: What library functionality would you most like to see in D?

2011-08-07 Thread Andrei Alexandrescu
On 8/7/11 5:08 AM, Dmitry Olshansky wrote: On 07.08.2011 12:09, Mehrdad wrote: A readText() function that would read a text file (**and** autodetect its encoding from its BOM) would be of great help. Well the name is here, dunno if it meets your expectations: http://d-programming-language.org/

Re: const assignments problem again

2011-08-07 Thread Lutger Blijdestijn
Timon Gehr wrote: > Lutger Blijdestin wrote: >> I like the ternary operator the best for this, as it is the simplest. I >> always write them like this though, liberally include parenthesis and >> never nest: >> (condition) >> ? (truth value) >> : (false value) > > What is the benefit of

Re: like types

2011-08-07 Thread bearophile
Adam D. Ruppe Wrote: > This seems to be to be nothing more than applying the same > idea behind objects and interfaces to other types... if all > variables were typed Object and you had: > > interface Int {} > interface String {} > > void whatever(Int lineno, String rawdata) {} > > it'd be the

Re: const assignments problem again

2011-08-07 Thread Timon Gehr
Lutger Blijdestin wrote: > I like the ternary operator the best for this, as it is the simplest. I > always write them like this though, liberally include parenthesis and never > nest: > (condition) > ? (truth value) > : (false value) What is the benefit of this, compared to leaving paren

Re: const assignments problem again

2011-08-07 Thread Lutger Blijdestijn
bearophile wrote: ... > In my precedent post about this topic I have discussed "nested constness" > and another partially silly idea. Recently I have seen a language that > suggests me this: > > // version #6 > const foo; > if (abs(e.x - v.x) > double.min) > foo = (v.y - e.y) / (v.x - e.x); >

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Walter Bright
On 8/7/2011 3:24 AM, Vladimir Panteleev wrote: Before that, someone first needs to get dmd to even compile with Visual C++. It's not a trivial task - there is no complex number support, lots of compiler-dependent defines are outdated, and there seem to be tons of regular compiler warnings (mostly

Re: Run Microsoft Analyzer over dmd source code

2011-08-07 Thread Vladimir Panteleev
On Sat, 06 Aug 2011 22:38:15 +0300, Walter Bright wrote: http://www.reddit.com/r/programming/comments/jar93/john_carmack_gives_his_thoughts_on_static/c2akmf8 If someone has this on their system, I think it'd be great if you could run the dmd source code through it and see if it finds any b

Re: What library functionality would you most like to see in D?

2011-08-07 Thread Jonathan M Davis
On Sunday 07 August 2011 14:08:06 Dmitry Olshansky wrote: > On 07.08.2011 12:09, Mehrdad wrote: > > A readText() function that would read a text file (**and** autodetect > > its encoding from its BOM) would be of great help. > > Well the name is here, dunno if it meets your expectations: > http://

Re: const assignments problem again

2011-08-07 Thread Jonathan M Davis
On Sunday 07 August 2011 06:02:36 Kagamin wrote: > Jonathan M Davis Wrote: > > Being able to use const can be very valuable. For instance, what if you > > were using std.algorithm.copy and got the arguments backwards? If the > > source is const, then the compiler will complain, and you'll quickly >

Re: What library functionality would you most like to see in D?

2011-08-07 Thread Dmitry Olshansky
On 07.08.2011 12:09, Mehrdad wrote: A readText() function that would read a text file (**and** autodetect its encoding from its BOM) would be of great help. Well the name is here, dunno if it meets your expectations: http://d-programming-language.org/phobos/std_file.html#readText -- Dmitry Ol

Re: const assignments problem again

2011-08-07 Thread Kagamin
Jonathan M Davis Wrote: > Being able to use const can be very valuable. For instance, what if you were > using std.algorithm.copy and got the arguments backwards? If the source is > const, then the compiler will complain, and you'll quickly find the bug. If > the > source isn't const, then you

Re: const assignments problem again

2011-08-07 Thread Kagamin
bearophile Wrote: > - You can't use "auto" there, so if the type of e.x changes, you have to > change the foo type manually (double.min is replaceable with typeof(e.x).min). This is a bad idea too. The code assumes the values are double. If this assumption is not true, the code is broken.

Re: const assignments problem again

2011-08-07 Thread Jonathan M Davis
On Sunday 07 August 2011 04:40:52 Kagamin wrote: > bearophile Wrote: > > - And foo can't be const or immutable, I don't like this. > > I suppose accidental overwrite bugs are overrated. I have never seen them > even from evil programmers. If you write random code, overwrite is not your > only prob

Re: like types

2011-08-07 Thread Kagamin
Walter Bright Wrote: > On 8/6/2011 7:24 PM, bearophile wrote: > > C#4 has "dynamic" type, it allows to perform dynamic typing style code in > > C#: > > http://en.wikipedia.org/wiki/C_sharp_4#Dynamic_member_lookup > > D has opDispatch which fills that role nicely. opDispatch doesn't work with in

Re: const assignments problem again

2011-08-07 Thread Kagamin
bearophile Wrote: > - And foo can't be const or immutable, I don't like this. I suppose accidental overwrite bugs are overrated. I have never seen them even from evil programmers. If you write random code, overwrite is not your only problem, you can as well read wrong variable or call wrong fun

Re: const assignments problem again

2011-08-07 Thread Kagamin
P.S. you would make a better point if it were a const instance of a class.

Re: Two bugs found: GC bug as well as scope delegate bug

2011-08-07 Thread KennyTM~
On Aug 7, 11 14:47, Mehrdad wrote: Everyone, apologies for this in hindsight, it's quite ridiculous. x_x In trying to reproduce a similar bug I saw in my code, I made a completely stupid example which made no sense. I'll proofread better next time, hopefully I can isolate it then. Next ti

Re: What library functionality would you most like to see in D?

2011-08-07 Thread Mehrdad
A readText() function that would read a text file (**and** autodetect its encoding from its BOM) would be of great help.

Re: Template struct literals should infer template parameters

2011-08-07 Thread Philippe Sigaud
On Sat, Aug 6, 2011 at 22:19, Sean Eskapp wrote: > If I have something like > >    struct S(T) >    { >        T data; >    } > > I can't make a struct literal with > >    int mystuff; >    someFunc(S(mystuff)); > > I have to use > >    int mystuff; >    someFunc(S!(int)(mystuff)); > > Why is th

Re: const assignments problem again

2011-08-07 Thread Marco Leise
Am 07.08.2011, 06:31 Uhr, schrieb Adam D. Ruppe : bearophile: I agree, that's why I have added two more points The precedence of the ternary is pretty easy to handle - if there's more than one thing in there, just use parenthesis. That's the only thing I can think of that would make it any