Re: gui libs

2013-02-28 Thread Jacob Carlborg
On 2013-02-28 22:45, rho wrote: thats too bad. you guys do wonderful things, but it the needs of the common user seem to be forgotten by the creators of D. they should change that. I don't understand how you can say that. 32bit applications can run on both 32bit and 64bit platforms. 64bit can

Re: Concurrency and program speed

2013-02-28 Thread jerro
The timings on my (4 core) machine are: sequential: 7.7s concurent : 2.1s Which is about what one would expect. One thing that could be contributing to the timings you are seeing is Turbo Boost (http://en.wikipedia.org/wiki/Intel_Turbo_Boost). Some mobile processors have large (like for examp

Re: Set operation like cartesian product

2013-02-28 Thread H. S. Teoh
On Thu, Feb 28, 2013 at 03:01:48PM -0800, H. S. Teoh wrote: > On Thu, Feb 28, 2013 at 09:20:52PM +0100, Andrea Fontana wrote: > > On Thursday, 28 February 2013 at 18:23:04 UTC, H. S. Teoh wrote: > [...] > > >auto triangularProduct2(R1,R2)(R1 r1, R2 r2) > > > if (isForwardRange!R1) > > >{ > > >

Re: Set operation like cartesian product

2013-02-28 Thread H. S. Teoh
On Thu, Feb 28, 2013 at 09:20:52PM +0100, Andrea Fontana wrote: > On Thursday, 28 February 2013 at 18:23:04 UTC, H. S. Teoh wrote: [...] > >auto triangularProduct2(R1,R2)(R1 r1, R2 r2) > > if (isForwardRange!R1) > >{ > > return map!(function(a) => zip(take(a[1].save, a[0]), > >repeat(a[2]))

Re: Inlining a "pure" ASM function

2013-02-28 Thread Brad Roberts
On Thu, 28 Feb 2013, Simen Kj?r?s wrote: > On Thu, 28 Feb 2013 16:22:49 +0100, D-ratiseur > wrote: > > > Hello, Is it possible for an ASM function to be inlined in D? > > Nope. To be a little more accurate: it's possible in the technical sense. No D compiler today does it automatically. Th

Re: gui libs

2013-02-28 Thread Mike Wey
On 02/28/2013 09:38 PM, rho wrote: do all those work with x64? are they complete? are all tools to build the libs on board the standard D distro? GtkD will work with x64. -- Mike Wey

Re: gui libs

2013-02-28 Thread rho
On Thursday, 28 February 2013 at 21:25:27 UTC, Jacob Carlborg wrote: On 2013-02-28 21:38, rho wrote: do all those work with x64? are they complete? are all tools to build the libs on board the standard D distro? DWT does not work on 64bit. You can run 32bit applications on 64bit systems. th

Re: gui libs

2013-02-28 Thread Jacob Carlborg
On 2013-02-28 21:38, rho wrote: do all those work with x64? are they complete? are all tools to build the libs on board the standard D distro? DWT does not work on 64bit. You can run 32bit applications on 64bit systems. -- /Jacob Carlborg

Re: gui libs

2013-02-28 Thread rho
do all those work with x64? are they complete? are all tools to build the libs on board the standard D distro?

Re: Set operation like cartesian product

2013-02-28 Thread Andrea Fontana
On Thursday, 28 February 2013 at 18:23:04 UTC, H. S. Teoh wrote: On Thu, Feb 28, 2013 at 04:31:59PM +0100, Andrea Fontana wrote: I see cartesianProduct in std.algorithm. I read: auto N = sequence!"n"(0); // the range of natural numbers auto N2 = cartesianProduct(N, N); // the range of all pairs

Re: Make a hash out of two ranges

2013-02-28 Thread Philippe Sigaud
On Thu, Feb 28, 2013 at 4:14 PM, Andrej Mitrovic wrote: > On 2/28/13, Chris Cain wrote: >> Aha, I see now. Here you go: >> >> zip([1,3], [2,4]) >> .map!(e => [e[0] : e[1]])() >> .writeln(); > > Thanks, I figured this out too by now. :) > > But it's definitely nicer having t

Re: Concurrency and program speed

2013-02-28 Thread Joseph Rushton Wakeling
On 02/28/2013 04:03 PM, Sean Kelly wrote: Does the laptop really have 4 cores or is it 2 cores with hyperthreading? My guess is the latter, and that will contribute to the timing you're seeing. You're absolutely right. So I think I know my own laptop ... :-P Do larger jobs show a better or

Re: Set operation like cartesian product

2013-02-28 Thread H. S. Teoh
On Thu, Feb 28, 2013 at 04:31:59PM +0100, Andrea Fontana wrote: > I see cartesianProduct in std.algorithm. I read: > > auto N = sequence!"n"(0); // the range of natural numbers > auto N2 = cartesianProduct(N, N); // the range of all pairs of > natural numbers > > So it gives (0,0) (0,1) (1,0) ...

Re: Best way to handle settings files (ini file syntax or similar)

2013-02-28 Thread Jonathan M Davis
On Thursday, February 28, 2013 18:57:37 Dicebot wrote: > On Thursday, 28 February 2013 at 17:53:08 UTC, Stephan Schiffels > > wrote: > > Am 27.02.13 21:36, schrieb Dicebot: > >> For anything even remotely complex I would have probably > >> chosen JSON, either new std.json pending for review (not >

Re: Best way to handle settings files (ini file syntax or similar)

2013-02-28 Thread Dicebot
On Thursday, 28 February 2013 at 17:53:08 UTC, Stephan Schiffels wrote: Am 27.02.13 21:36, schrieb Dicebot: For anything even remotely complex I would have probably chosen JSON, either new std.json pending for review (not current std.json!) or vibe.data.json from vibed.org project. Which std.

Re: Best way to handle settings files (ini file syntax or similar)

2013-02-28 Thread Stephan Schiffels
Am 27.02.13 21:36, schrieb Dicebot: For anything even remotely complex I would have probably chosen JSON, either new std.json pending for review (not current std.json!) or vibe.data.json from vibed.org project. Which std.json are you referring to? There is no std.json2 or something in the rev

Re: Inlining a "pure" ASM function

2013-02-28 Thread bearophile
D-ratiseur: Maybe the manual could contain a remark about this. I think it's written somewhere in the site. But LDC is able (with a compiler-specific pragma) to inline functions that contain asm. Bye, bearophile

Re: Set operation like cartesian product

2013-02-28 Thread bearophile
Andrea Fontana: Any ideas? I suggested pairwise(): http://d.puremagic.com/issues/show_bug.cgi?id=6788 Bye, bearophile

Re: Set operation like cartesian product

2013-02-28 Thread Andrea Fontana
On Thursday, 28 February 2013 at 15:32:00 UTC, Andrea Fontana wrote: I see cartesianProduct in std.algorithm. I read: auto N = sequence!"n"(0); // the range of natural numbers auto N2 = cartesianProduct(N, N); // the range of all pairs of natural numbers So it gives (0,0) (0,1) (1,0) ... and

Re: Inlining a "pure" ASM function

2013-02-28 Thread D-ratiseur
On Thursday, 28 February 2013 at 15:35:07 UTC, Simen Kjærås wrote: Nope. Ok, thx, so it's like in Delphi/Fpc. Maybe the manual could contain a remark about this.

Re: Inlining a "pure" ASM function

2013-02-28 Thread Simen Kjærås
On Thu, 28 Feb 2013 16:22:49 +0100, D-ratiseur wrote: Hello, Is it possible for an ASM function to be inlined in D? Nope. -- Simen

Set operation like cartesian product

2013-02-28 Thread Andrea Fontana
I see cartesianProduct in std.algorithm. I read: auto N = sequence!"n"(0); // the range of natural numbers auto N2 = cartesianProduct(N, N); // the range of all pairs of natural numbers So it gives (0,0) (0,1) (1,0) ... and so on. Is there a way to generate only tuple: a[0] > a[1] (0,1) (0,2

Re: Concurrency and program speed

2013-02-28 Thread Sean Kelly
Does the laptop really have 4 cores or is it 2 cores with hyperthreading? My guess is the latter, and that will contribute to the timing you're seeing. Also, other things are going on in the system. Do larger jobs show a better or worse speedup? On Feb 28, 2013, at 6:15 AM, Joseph Rushton Wake

Re: Concurrency and program speed

2013-02-28 Thread Joseph Rushton Wakeling
On 02/28/2013 03:15 PM, Joseph Rushton Wakeling wrote: The times reported here are for programs compiled with GDC, but using LDC or DMD produces similar behaviour. Come to that, so does a C example put together using pthreads -- just in case anyone thought I was holding D responsible. But I'm

Inlining a "pure" ASM function

2013-02-28 Thread D-ratiseur
Hello, Is it possible for an ASM function to be inlined in D? for example I compile with -Release -inline, this function (used in a simple console app obviously): --- int SSERound(double AValue) { asm { cvtsd2si EAX,[AValue]; } } --- but, under win32, th

Re: Make a hash out of two ranges

2013-02-28 Thread Andrej Mitrovic
On 2/28/13, Chris Cain wrote: > Aha, I see now. Here you go: > > zip([1,3], [2,4]) > .map!(e => [e[0] : e[1]])() > .writeln(); Thanks, I figured this out too by now. :) But it's definitely nicer having the a/b syntax. I guess I could just overload my map against the phobos

Re: gui libs

2013-02-28 Thread Jacob Carlborg
On 2013-02-28 10:35, rho wrote: hi, what keeps me from using d, is that there is no compilable gui lib available. does dfl compile with the latest dmd? DWT: https://github.com/d-widget-toolkit/dwt -- /Jacob Carlborg

Concurrency and program speed

2013-02-28 Thread Joseph Rushton Wakeling
Hello all, I'm in need of some guidance regarding std.concurrency. Before writing further, I should add that I'm an almost complete novice where concurrency is concerned, in general and particularly with D: I've written a few programs that made use of std.parallelism but that's about it. In

Re: Transparent ANSI to UTF-8 conversion

2013-02-28 Thread Lubos Pintes
Thank you all. Now I believe I will be able to solve this. Dňa 28. 2. 2013 5:25 Era Scarecrow wrote / napísal(a): On Wednesday, 27 February 2013 at 10:56:16 UTC, Lubos Pintes wrote: Hi, I would like to transparently convert from ANSI to UTF-8 when dealing with text files. For example here in Sl

Re: Best way to handle settings files (ini file syntax or similar)

2013-02-28 Thread Lubos Pintes
Which JSON is better? I already saw Vibe's JSON, but don't know where is that new std.json. Dňa 27. 2. 2013 22:36 Dicebot wrote / napísal(a): I use this simple snippet to get quick and dirty key-value config: --- string[string] data; foreach( line; readText(filename).splitLines() ) { auto

Re: gui libs

2013-02-28 Thread simendsjo
On Thursday, 28 February 2013 at 09:35:03 UTC, rho wrote: hi, what keeps me from using d, is that there is no compilable gui lib available. does dfl compile with the latest dmd? http://wiki.dlang.org/Libraries_and_Frameworks#GUI_Libraries I haven't used any of them in a while, but I think at

byBassing toString (specifically for strings)

2013-02-28 Thread monarch_dodra
strings follow a special rule for printing: Basically, if you print a string, it gets pretty printed. However, if it becomes a part of a struct, or an array, or any container in general, it becomes printed as a type. EG: // string s = "hello\tworld"; writeln(s); //raw string writeln([s]);

Re: gui libs

2013-02-28 Thread Alexandr Druzhinin
28.02.2013 16:35, rho пишет: hi, what keeps me from using d, is that there is no compilable gui lib available. does dfl compile with the latest dmd? DWT is compilable with the last dmd and works fine Also GTK is available, but I didn't tested it

gui libs

2013-02-28 Thread rho
hi, what keeps me from using d, is that there is no compilable gui lib available. does dfl compile with the latest dmd?

Re: Playing with ranges and ufcs

2013-02-28 Thread Andrea Fontana
On Wednesday, 27 February 2013 at 23:43:49 UTC, bearophile wrote: void main() { auto a = [0,1,2,3,4,5,6,7,8,9][5 .. 2]; } I tried it too, hoping for something like [5,4,3] or at least [4,3,2] (== [0,1,2,3,4,5,6,7,8,9][2..5].reverse)

Re: Best way to handle settings files (ini file syntax or similar)

2013-02-28 Thread Samuel Lampa
On 02/27/2013 10:46 PM, Dicebot wrote: Btw now I have actually noticed it is really bad and dirty, so good to sometimes check your 2-year code. I think you can write better one anyway, just an example of how small it can be. Thanks! Yeah, you're right, rolling an own is not a too big deal. Jus