Re: amoeba, a chess engine written in D

2016-05-21 Thread Johan Engelen via Digitalmars-d-announce
On Friday, 20 May 2016 at 23:16:01 UTC, Richard Delorme wrote: I am pleased to announce the release of a chess engine written in D: https://github.com/abulmo/amoeba In the makefile, I see you tried LDC's PGO, awesome! I hope to get (part of) it into LDC master very soon. All feedback is very

Re: amoeba, a chess engine written in D

2016-05-21 Thread Iain Buclaw via Digitalmars-d-announce
On 21 May 2016 at 10:23, Johan Engelen via Digitalmars-d-announce wrote: > On Friday, 20 May 2016 at 23:16:01 UTC, Richard Delorme wrote: >> >> >> The source can be compiled with dmd, ldc or gdc, but the best performance >> are obtained with the latter

Re: union alignment

2016-05-21 Thread Iain Buclaw via Digitalmars-d-learn
On Wednesday, 18 May 2016 at 01:46:37 UTC, tsbockman wrote: Shouldn't a union type always have an `alignof` at least as great as the `alignof` for its largest member? On x86, there's a difference between the type alignment and the field alignment. The type align of ulong and double are 8

Re: Enum that can be 0 or null

2016-05-21 Thread tsbockman via Digitalmars-d-learn
On Saturday, 21 May 2016 at 01:09:42 UTC, Alex Parrill wrote: On Friday, 20 May 2016 at 22:10:51 UTC, tsbockman wrote: If that's not a satisfactory answer, please show some specific examples of code that you don't know how to make work without VK_NULL_HANDLE so that I can propose a workaround.

Re: union alignment

2016-05-21 Thread tsbockman via Digitalmars-d-learn
On Wednesday, 18 May 2016 at 01:46:37 UTC, tsbockman wrote: Shouldn't a union type always have an `alignof` at least as great as the `alignof` for its largest member? Apparently not; it's actually DMD and LDC that are wrong here: http://bugzilla.gdcproject.org/show_bug.cgi?id=226

Re: Enum that can be 0 or null

2016-05-21 Thread tsbockman via Digitalmars-d-learn
On Saturday, 21 May 2016 at 01:53:21 UTC, Mike Parker wrote: When binding to a C library, it's desirable to have as close to the original C API as possible so that you *can* drop C snippets and examples into D code and have them just work. Obviously, 100% compatibility is not possible, but it

Re: Immutable objects and constructor ?

2016-05-21 Thread chmike via Digitalmars-d-learn
Unfortunately it is not possible to write this import std.typecons; class Info{...} rebindable!Info x; I get the following error message source/app.d(11,3): Error: template std.typecons.rebindable matches more than one template declaration: /usr/include/dmd/phobos/std/typecons.d(1675,14):

Diamond - MVC / Template engine

2016-05-21 Thread Bauss via Digitalmars-d-announce
Just finished up the base for Diamond and its initiate state with Github and Dub, as well the first guide on using Diamond with vibe.d for websites. Diamond is a MVC / Template framework originally made for a hobby project, but as I developed it further I saw some potential in it and have

Re: Immutable objects and constructor ?

2016-05-21 Thread chmike via Digitalmars-d-learn
Since I'm trying to implement a flyweight pattern, the opEqual need only comparision of reference in my case. By the way, what operation is the switch performing ? OpEqual or is ?

Re: My ACCU 2016 keynote video available online

2016-05-21 Thread Manu via Digitalmars-d-announce
On 20 May 2016 at 18:26, Walter Bright via Digitalmars-d-announce wrote: > On 5/19/2016 11:50 PM, Manu via Digitalmars-d-announce wrote: >> >> Ah. Okay, well while this is a very interesting talk, I was indeed >> hoping you were going to make a D concepts

Re: Single-Allocation Variable-Sized Array

2016-05-21 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 18 May 2016 at 23:45:07 UTC, Alex Parrill wrote: In C it's called a variable-length struct or object. I don't think D implements them, but this could probably work: Thanks!

Re: DMD producing huge binaries

2016-05-21 Thread poliklosio via Digitalmars-d
On Thursday, 19 May 2016 at 13:45:18 UTC, Andrei Alexandrescu wrote: On 05/19/2016 08:38 AM, Steven Schveighoffer wrote: Yep. chain uses voldemort type, map does not. We definitely need to fix Voldemort types. Walter and I bounced a few ideas during DConf. 1. Do the cleartext/compress/hash

Re: amoeba, a chess engine written in D

2016-05-21 Thread Johan Engelen via Digitalmars-d-announce
On Friday, 20 May 2016 at 23:16:01 UTC, Richard Delorme wrote: The source can be compiled with dmd, ldc or gdc, but the best performance are obtained with the latter (almost twice faster). Can you give cmdline details and compiler version data for this? (how much faster is gdc relative to

Re: Immutable objects and constructor ?

2016-05-21 Thread Ali Çehreli via Digitalmars-d-learn
On 05/21/2016 01:07 AM, chmike wrote: > Unfortunately it is not possible to write this > > import std.typecons; > class Info{...} > rebindable!Info x; You have a capitalization typo. Rebindable is a type template, rebindable is a function template. import std.typecons; class Info{} void

Re: Discuss vulkan erupted, the other auto-generated vulkan binding

2016-05-21 Thread ParticlePeter via Digitalmars-d
On Friday, 20 May 2016 at 18:52:35 UTC, maik klein wrote: On Thursday, 19 May 2016 at 15:44:27 UTC, ParticlePeter wrote: I am a bit slow, how do I add xcb as a dependency? /source/erupted/types.d(3335,16): Error: module xcb is in file 'xcb/xcb.d' which cannot be read Can I add dependencies

Re: mutable keyword

2016-05-21 Thread ciechowoj via Digitalmars-d-learn
On Saturday, 21 May 2016 at 00:39:21 UTC, Jonathan M Davis wrote: Well, if you actually tried marking functions with pure, you'd see pretty fast that this won't work with pure. A function that's marked with pure cannot access any global, mutable state. It can only access what's passed to it

Re: Diamond - MVC / Template engine

2016-05-21 Thread Chris via Digitalmars-d-announce
On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote: [snip] Sounds interesting. Are you planning to add a tutorial / more examples? Typo on your Github page: "on every playform that can compile D" playform => platform

Re: problems with Rebindable

2016-05-21 Thread ag0aep6g via Digitalmars-d-learn
On 05/21/2016 12:42 PM, chmike wrote: Rebindable!Info x1, x2 = Infos.one; Rebindable!(immutable Info) x1, x2 = Infos.one;

Re: Confusion with anonymous functions and method overloads

2016-05-21 Thread Anonymouse via Digitalmars-d-learn
On Saturday, 21 May 2016 at 14:39:59 UTC, pineapple wrote: void clean(in void delegate(in T value) func){ this.clean((in T values[]) => { foreach(value; values) func(value); }); This doesn't do what you think it does. It passes a lambda that *returns* that

Re: Always false float comparisons

2016-05-21 Thread Tobias Müller via Digitalmars-d
On Friday, 20 May 2016 at 22:22:57 UTC, Walter Bright wrote: On 5/20/2016 5:36 AM, Tobias M wrote: Still an authority, though. If we're going to use the fallacy of appeal to authority, may I present Kahan who concurrently designed the IEEE 754 spec and the x87. Actually cited this

Re: Is there a 128-bit integer in D?

2016-05-21 Thread Stefan Koch via Digitalmars-d-learn
On Saturday, 21 May 2016 at 09:43:38 UTC, Saurabh Das wrote: I see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types? Alternatively, is there an any effort towards implementation of arbitrary-sized integers

Re: Always false float comparisons

2016-05-21 Thread Fool via Digitalmars-d
On Tuesday, 17 May 2016 at 21:07:21 UTC, Walter Bright wrote: [...] why an unusual case of producing a slightly worse answer trumps the usual case of producing better answers. 'Sometimes worse' is not 'better', but that's not the point, here. Even if you managed to consistently produce not

Re: amoeba, a chess engine written in D

2016-05-21 Thread Richard Delorme via Digitalmars-d-announce
On Saturday, 21 May 2016 at 00:29:13 UTC, extrawurst wrote: Two questions: 1) If it is using UCI protocol I guess there are other engines that you can compare amoeba with when it comes to performance and other aspects, did you ? Yes, It is a strong program, but far from the top programs yet.

Re: My ACCU 2016 keynote video available online

2016-05-21 Thread Manu via Digitalmars-d-announce
On 21 May 2016 at 23:20, Andrei Alexandrescu via Digitalmars-d-announce wrote: > On 05/21/2016 04:45 AM, Manu via Digitalmars-d-announce wrote: >> >> On 20 May 2016 at 18:26, Walter Bright via Digitalmars-d-announce >>

Re: problems with Rebindable

2016-05-21 Thread ag0aep6g via Digitalmars-d-learn
On 05/21/2016 03:36 PM, chmike wrote: Note however that it doesn't work with immutable. It only works with constant. I guess this is because immutable is "stronger" than const. I determined that only const was supported by looking at Rebindable's code. Here is the code that finally works as I

Re: DMD producing huge binaries

2016-05-21 Thread Johan Engelen via Digitalmars-d
On Saturday, 21 May 2016 at 06:18:05 UTC, poliklosio wrote: I have an Idea of reproducible, less-than-exponential time mangling, although I don't know how actionable. Leave mangling as is, but pretend that you are mangling something different, for example when the input is

Re: Immutable objects and constructor ?

2016-05-21 Thread chmike via Digitalmars-d-learn
On Saturday, 21 May 2016 at 08:24:19 UTC, Ali Çehreli wrote: On 05/21/2016 01:07 AM, chmike wrote: > Unfortunately it is not possible to write this > > import std.typecons; > class Info{...} > rebindable!Info x; You have a capitalization typo. Rebindable is a type template, rebindable is a

problems with Rebindable

2016-05-21 Thread chmike via Digitalmars-d-learn
This thread is a followup of https://forum.dlang.org/post/vuljzyufphsywzevu...@forum.dlang.org with a refocused subject and question. I'm looking for a mutable reference to a none mutable object to implement the flyweight pattern. It is for a library and its user interface. So I'm not

Re: [OT] Re: pl0stuff an optimizing pl0 > c transcompiler

2016-05-21 Thread Stefan Koch via Digitalmars-d-announce
On Friday, 20 May 2016 at 19:20:34 UTC, Johan Engelen wrote: On Friday, 20 May 2016 at 18:04:55 UTC, Stefan Koch wrote: Update I have implemented D codegen. The CodeGenerator as well as the optimizer work at CTFE. Therefore you can transcompile code at compileTime at call PL/0 functions as

Re: problems with Rebindable

2016-05-21 Thread ag0aep6g via Digitalmars-d-learn
On 05/21/2016 02:17 PM, chmike wrote: On Saturday, 21 May 2016 at 10:42:13 UTC, chmike wrote: source/app.d(23,27): Error: cannot implicitly convert expression (one) of type immutable(Obj) to app.Info Apparently Rebindable doesn't support polymorphism. This is hopefully fixable. No, the

Re: My ACCU 2016 keynote video available online

2016-05-21 Thread Leontien Smaal via Digitalmars-d-announce
On Friday, 20 May 2016 at 19:34:11 UTC, Walter Bright wrote: Constraints can address behavior and relationships, concepts do not. Wow, TIL. That's so clear once said ! There's been several discussion here and even one phobos PR that proposes a kind of concepts but I didn't realize before that

Re: Always false float comparisons

2016-05-21 Thread Timon Gehr via Digitalmars-d
On 21.05.2016 00:22, Walter Bright wrote: On 5/20/2016 5:36 AM, Tobias M wrote: Still an authority, though. If we're going to use the fallacy of appeal to authority, Authorities are not always wrong, the fallacy is to argue that they are right *because* they are authorities. However, in

Confusion with anonymous functions and method overloads

2016-05-21 Thread pineapple via Digitalmars-d-learn
I wrote a pair of methods that looked like this: void clean(in void delegate(in T value) func){ this.clean((in T values[]) => { foreach(value; values) func(value); }); } void clean(in void delegate(in T values[]) func){ ... } I was getting a

Re: Confusion with anonymous functions and method overloads

2016-05-21 Thread ag0aep6g via Digitalmars-d-learn
On 05/21/2016 04:39 PM, pineapple wrote: But I don't understand why. Could someone clarify the difference between the two? Common mistake, because other languages (e.g. C#) use similar but different syntax. The `foo => bar` syntax doesn't use braces. When you add braces around bar, that's

Is there a 128-bit integer in D?

2016-05-21 Thread Saurabh Das via Digitalmars-d-learn
I see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types? Alternatively, is there an any effort towards implementation of arbitrary-sized integers in Phobos? Thanks, Saurabh

Re: Diamond - MVC / Template engine

2016-05-21 Thread Bauss via Digitalmars-d-announce
On Saturday, 21 May 2016 at 10:02:17 UTC, Chris wrote: On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote: [snip] Sounds interesting. Are you planning to add a tutorial / more examples? Typo on your Github page: "on every playform that can compile D" playform => platform Thank you and

Interesting synchronization paradigm: flat combining

2016-05-21 Thread Piotr Szturmaj via Digitalmars-d
https://www.cs.bgu.ac.il/~hendlerd/papers/flat-combining.pdf [2010] "Traditional data structure designs, whether lock-based or lock-free, provide parallelism via fine grained synchronization among threads. We introduce a new synchronization paradigm based on coarse locking, which we call flat

DIP74 and precise GC

2016-05-21 Thread Dsby via Digitalmars-d
I look the DIP in the wiki: http://wiki.dlang.org/DIP74 and in GSOC ,https://forum.dlang.org/thread/jcfwcdvvfytdkjrpd...@forum.dlang.org which will be come true nearest。

Re: Always false float comparisons

2016-05-21 Thread Tobias M via Digitalmars-d
On Friday, 20 May 2016 at 22:22:57 UTC, Walter Bright wrote: On 5/20/2016 5:36 AM, Tobias M wrote: Still an authority, though. If we're going to use the fallacy of appeal to authority, may I present Kahan who concurrently designed the IEEE 754 spec and the x87. Since I'm just in the mood

[Issue 16051] New: ICE with nested functions and template alias parameter

2016-05-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16051 Issue ID: 16051 Summary: ICE with nested functions and template alias parameter Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Keywords: ice,

[Issue 12839] std.parallelism with nested functions and lambdas. Segfault

2016-05-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12839 --- Comment #6 from Lars T. Kyllingstad --- See also issue #16051, which deals with the same ICE. Not sure if it's a duplicate, though. --

Re: mutable keyword

2016-05-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 21, 2016 07:00:43 ciechowoj via Digitalmars-d-learn wrote: > On Saturday, 21 May 2016 at 00:39:21 UTC, Jonathan M Davis wrote: > > Well, if you actually tried marking functions with pure, you'd > > see pretty fast that this won't work with pure. A function > > that's marked with

Re: My ACCU 2016 keynote video available online

2016-05-21 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 05/21/2016 04:45 AM, Manu via Digitalmars-d-announce wrote: On 20 May 2016 at 18:26, Walter Bright via Digitalmars-d-announce wrote: On 5/19/2016 11:50 PM, Manu via Digitalmars-d-announce wrote: Ah. Okay, well while this is a very interesting talk, I

Re: problems with Rebindable

2016-05-21 Thread chmike via Digitalmars-d-learn
On Saturday, 21 May 2016 at 13:17:11 UTC, ag0aep6g wrote: On 05/21/2016 12:42 PM, chmike wrote: Rebindable!Info x1, x2 = Infos.one; Rebindable!(immutable Info) x1, x2 = Infos.one; Indeed. Thanks. Reading the unit tests in the source code and the implementation of Rebindable helped.

Re: My ACCU 2016 keynote video available online

2016-05-21 Thread Manu via Digitalmars-d-announce
On 21 May 2016 at 19:55, Stefan Koch via Digitalmars-d-announce wrote: > On Saturday, 21 May 2016 at 08:45:45 UTC, Manu wrote: >> >> Constraints are a good first-step in that direction, but they're unwieldy, >> produce the worst looking function signatures

Re: Always false float comparisons

2016-05-21 Thread Timon Gehr via Digitalmars-d
On 20.05.2016 13:32, Joakim wrote: On Friday, 20 May 2016 at 11:02:45 UTC, Timon Gehr wrote: On 20.05.2016 11:14, Joakim wrote: On Thursday, 19 May 2016 at 18:22:48 UTC, Timon Gehr wrote: On 19.05.2016 08:04, Joakim wrote: On Wednesday, 18 May 2016 at 17:10:25 UTC, Timon Gehr wrote: It's

Re: Always false float comparisons

2016-05-21 Thread Max Samukha via Digitalmars-d
On Friday, 20 May 2016 at 06:12:44 UTC, Walter Bright wrote: If you say so. I would like to see an example that demonstrates that the first roundToDouble is required. That's beside the point. If there are spots in the program that require rounding, what is wrong with having to specify it?

Re: Always false float comparisons

2016-05-21 Thread Timon Gehr via Digitalmars-d
On 20.05.2016 08:25, Walter Bright wrote: On 5/19/2016 12:49 AM, Max Samukha wrote: People are trying to get across that, if they wanted to maximize accuracy, they would request the most precise type explicitly. D has 'real' for that. This thread has shown unequivocally that the semantics you

Re: Game Development Using D

2016-05-21 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 21 May 2016 at 16:01:26 UTC, Stefan Koch wrote: On Saturday, 21 May 2016 at 15:53:18 UTC, David wrote: Hi, I want to try to create a game using D. I'm a complete newbie though (other than having C/C++ experience). Where would I start? Does D have an openGL binding? I am assuming

Re: Always false float comparisons

2016-05-21 Thread Timon Gehr via Digitalmars-d
On 17.05.2016 20:09, Max Samukha wrote: On Monday, 16 May 2016 at 19:01:19 UTC, Timon Gehr wrote: You are not even guaranteed to get the same result on two different x86 implementations. Without reading the x86 specification, I think it is safe to claim that you actually are guaranteed to

Re: Always false float comparisons

2016-05-21 Thread Walter Bright via Digitalmars-d
On 5/21/2016 2:26 AM, Tobias Müller wrote: On Friday, 20 May 2016 at 22:22:57 UTC, Walter Bright wrote: On 5/20/2016 5:36 AM, Tobias M wrote: Still an authority, though. If we're going to use the fallacy of appeal to authority, may I present Kahan who concurrently designed the IEEE 754 spec

Re: Is there a way to make a class variable visible but constant to outsiders, but changeable (mutable) to the class itself?

2016-05-21 Thread dan via Digitalmars-d-learn
Thanks Vit, Meta, and Yuxuan for your speedy help! So 3 pieces to put together, function, const, and @property (and i guess final for protection against subclasses).

Re: DMD producing huge binaries

2016-05-21 Thread poliklosio via Digitalmars-d
On Saturday, 21 May 2016 at 08:57:57 UTC, Johan Engelen wrote: On Saturday, 21 May 2016 at 06:18:05 UTC, poliklosio wrote: I have an Idea of reproducible, less-than-exponential time mangling, although I don't know how actionable. Leave mangling as is, but pretend that you are mangling

[Issue 16053] New: SysTime.fromIsoExtString don't work if nanoseconds are presented

2016-05-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16053 Issue ID: 16053 Summary: SysTime.fromIsoExtString don't work if nanoseconds are presented Product: D Version: D2 Hardware: x86_64 OS: Linux Status:

Re: binary expression...

2016-05-21 Thread captain_fid via Digitalmars-d-learn
On Saturday, 21 May 2016 at 18:33:53 UTC, Anonymouse wrote: On Saturday, 21 May 2016 at 18:10:55 UTC, captain_fid wrote: Please forgive if asked before. My google skills seemed to fail me and didn't see any result from search. My problem is simple (though not my understanding LOL). struct D

Re: DMD producing huge binaries

2016-05-21 Thread Guillaume Boucher via Digitalmars-d
On Saturday, 21 May 2016 at 18:25:46 UTC, Walter Bright wrote: On 5/20/2016 11:18 PM, poliklosio wrote: foo!(boo!(bar!(baz!(int))), #1, #2) Where #1 and #2 are special symbols that refer to stuff that was **already in the name**, particularly: #1: bar!(baz!(int)) #2: baz!(int) This is what

[Issue 15831] IFTI voldemort type exploding bloat

2016-05-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15831 Walter Bright changed: What|Removed |Added CC|

Re: DMD producing huge binaries

2016-05-21 Thread Walter Bright via Digitalmars-d
On 5/21/2016 1:09 PM, Era Scarecrow wrote: Depends on implementation and algorithm. However even the weakest compression settings can yield huge initial compression benefits. In normal text a reduction of 2:1 is expected, and will . The benefit being compression still contains all it's

Re: Battle-plan for CTFE

2016-05-21 Thread Martin Nowak via Digitalmars-d-announce
On 05/18/2016 07:50 PM, Stefan Koch wrote: > Indeed. > > I am currently designing an IR to feed into the CTFE Evaluator. > I am aware that this could potentially make it harder to get things > merged since DMD already has the glue-layer. As a compat layer between different interpreters or as a

Re: Always false float comparisons

2016-05-21 Thread Fool via Digitalmars-d
Reasons have been alleged. What's your final decision?

Need a Faster Compressor

2016-05-21 Thread Walter Bright via Digitalmars-d
The current one is effective, but slow: https://github.com/dlang/dmd/blob/master/src/backend/compress.c Anyone want to make a stab at making it faster? Changing the format is fair game, as well as down and dirty assembler if that's what it takes. So really, how good are you at fast code?

Re: Need a Faster Compressor

2016-05-21 Thread Timon Gehr via Digitalmars-d
On 21.05.2016 23:12, Walter Bright wrote: The current one is effective, but slow: https://github.com/dlang/dmd/blob/master/src/backend/compress.c Anyone want to make a stab at making it faster? Changing the format is fair game, as well as down and dirty assembler if that's what it takes.

Re: Is there a 128-bit integer in D?

2016-05-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 21, 2016 09:43:38 Saurabh Das via Digitalmars-d-learn wrote: > I see that 'cent' and 'ucent' are reserved for future use but not > yet implemented. Does anyone have a working implementation of > these types? The keywords are reserved for future use not in current use. So, no,

Re: mutable keyword

2016-05-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 21, 2016 17:15:16 Jack Applegame via Digitalmars-d-learn wrote: > On Friday, 20 May 2016 at 20:46:18 UTC, Jonathan M Davis wrote: > > Casting away const and mutating is undefined behavior in D. No > > D program should ever do it. > > Really? Mutating immutable is UB too, but look

Division - precision

2016-05-21 Thread Rygel via Digitalmars-d-learn
Hi there. I'm a beginners, so my questions could be silly. double x1 = 7.0; double x2 = 3.0; writeln(x1 / x2); from this code i get: 2.3 this is ok but how can i get more digits? For example: 2.3. thx :-)

Re: Basic question about stderr

2016-05-21 Thread chaseratx via Digitalmars-d-learn
On Saturday, 21 May 2016 at 21:40:36 UTC, Era Scarecrow wrote: On Saturday, 21 May 2016 at 21:21:31 UTC, chaseratx wrote: I'm learning D and I have a basic question. I'm trying to write stderr to a file using open() (rather than shell piping/redirection). It works for stdout but doesn't

Re: Game Development Using D

2016-05-21 Thread Rishub Nagpal via Digitalmars-d-learn
On Saturday, 21 May 2016 at 15:53:18 UTC, David wrote: Hi, I want to try to create a game using D. I'm a complete newbie though (other than having C/C++ experience). Where would I start? Does D have an openGL binding? I am assuming I'll need to leverage a good amount C APIs? Any list of

Re: problems with Rebindable

2016-05-21 Thread Kagamin via Digitalmars-d-learn
On Saturday, 21 May 2016 at 10:42:13 UTC, chmike wrote: switch(x1) { case Infos.one: writeln("case Infos.one"); break; default: writeln("default"); break; } You can generate fairly unique ids and use them in switch statements like this: https://dpaste.dzfl.pl/873b5b4cf71e

Re: Game Development Using D

2016-05-21 Thread Rishub Nagpal via Digitalmars-d-learn
On Saturday, 21 May 2016 at 15:53:18 UTC, David wrote: Hi, I want to try to create a game using D. I'm a complete newbie though (other than having C/C++ experience). Where would I start? Does D have an openGL binding? I am assuming I'll need to leverage a good amount C APIs? Any list of

Re: binary expression...

2016-05-21 Thread captain_fid via Digitalmars-d-learn
On Saturday, 21 May 2016 at 18:31:46 UTC, vit wrote: On Saturday, 21 May 2016 at 18:10:55 UTC, captain_fid wrote: Please forgive if asked before. My google skills seemed to fail me and didn't see any result from search. My problem is simple (though not my understanding LOL). struct D {

Re: DMD producing huge binaries

2016-05-21 Thread Kagamin via Digitalmars-d
On Saturday, 21 May 2016 at 18:18:21 UTC, Andrei Alexandrescu wrote: He said that that won't happen any longer, the growth was because of the return type. Is that correct? https://issues.dlang.org/show_bug.cgi?id=15831#c4 Looks like growth is due to the fact that the voldemort type is in the

Re: Diamond - MVC / Template engine

2016-05-21 Thread Bauss via Digitalmars-d-announce
On Saturday, 21 May 2016 at 19:46:38 UTC, Vladimir Panteleev wrote: On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote: Just finished up the base for Diamond and its initiate state with Github and Dub, as well the first guide on using Diamond with vibe.d for websites. The name is taken :)

Re: DMD producing huge binaries

2016-05-21 Thread Era Scarecrow via Digitalmars-d
On Saturday, 21 May 2016 at 17:34:19 UTC, Kagamin wrote: Equivalent to not mangling return type at all. But this leaves you with 2^^n growth, still exponential. Also is there any evidence that compression is faster than hashing? Depends on implementation and algorithm. However even the

Re: Always false float comparisons

2016-05-21 Thread Timon Gehr via Digitalmars-d
On 21.05.2016 19:58, Walter Bright wrote: On 5/21/2016 2:26 AM, Tobias Müller wrote: On Friday, 20 May 2016 at 22:22:57 UTC, Walter Bright wrote: On 5/20/2016 5:36 AM, Tobias M wrote: Still an authority, though. If we're going to use the fallacy of appeal to authority, may I present Kahan

Re: DMD producing huge binaries

2016-05-21 Thread Walter Bright via Digitalmars-d
On 5/21/2016 1:49 PM, Walter Bright wrote: We already have a compressor in the compiler source for compressing names: https://github.com/dlang/dmd/blob/master/src/backend/compress.c A faster one would certainly be nice. Anyone game? Note how well it does:

Re: Need a Faster Compressor

2016-05-21 Thread Timon Gehr via Digitalmars-d
On 21.05.2016 23:37, Timon Gehr wrote: On 21.05.2016 23:12, Walter Bright wrote: The current one is effective, but slow: https://github.com/dlang/dmd/blob/master/src/backend/compress.c Anyone want to make a stab at making it faster? Changing the format is fair game, as well as down and

Re: Basic question about stderr

2016-05-21 Thread Era Scarecrow via Digitalmars-d-learn
On Saturday, 21 May 2016 at 21:21:31 UTC, chaseratx wrote: I'm learning D and I have a basic question. I'm trying to write stderr to a file using open() (rather than shell piping/redirection). It works for stdout but doesn't seem to work with stderr. http://pastebin.com/KgzR9wAF stdout is

Re: Diamond - MVC / Template engine

2016-05-21 Thread Bauss via Digitalmars-d-announce
On Saturday, 21 May 2016 at 11:02:41 UTC, Bauss wrote: On Saturday, 21 May 2016 at 10:02:17 UTC, Chris wrote: On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote: [snip] Sounds interesting. Are you planning to add a tutorial / more examples? Typo on your Github page: "on every playform

Re: Diamond - MVC / Template engine

2016-05-21 Thread Vladimir Panteleev via Digitalmars-d-announce
On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote: Just finished up the base for Diamond and its initiate state with Github and Dub, as well the first guide on using Diamond with vibe.d for websites. The name is taken :) https://github.com/CyberShadow/Diamond I don't mind though.

Re: DMD producing huge binaries

2016-05-21 Thread poliklosio via Digitalmars-d
On Saturday, 21 May 2016 at 18:25:46 UTC, Walter Bright wrote: On 5/20/2016 11:18 PM, poliklosio wrote: I have an Idea of reproducible, less-than-exponential time mangling, although I don't know how actionable. Leave mangling as is, but pretend that you are mangling something different, for

[Issue 15885] float serialized to JSON loses precision

2016-05-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15885 b2.t...@gmx.com changed: What|Removed |Added Status|NEW |ASSIGNED CC|

Re: Small-Size-Optimized Array

2016-05-21 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 19 May 2016 at 06:20:24 UTC, Nikolay wrote: You can look to my experement (see iarray.d): https://bitbucket.org/sibnick/inplacearray.git Thanks!

Basic question about stderr

2016-05-21 Thread chaseratx via Digitalmars-d-learn
I'm learning D and I have a basic question. I'm trying to write stderr to a file using open() (rather than shell piping/redirection). It works for stdout but doesn't seem to work with stderr. http://pastebin.com/KgzR9wAF stdout is written to the file, but stderr is not and outputs to the

Re: Battle-plan for CTFE

2016-05-21 Thread Martin Nowak via Digitalmars-d-announce
On 05/21/2016 11:18 PM, Martin Nowak wrote: > The debugging metaphor would be comparing a program that only uses > pointer arithmetic against one that is memory safe, the former can > randomly write everywhere from anywhere, the latter could use the wrong > reference. It's also similar to

Re: Need a Faster Compressor

2016-05-21 Thread Era Scarecrow via Digitalmars-d
On Saturday, 21 May 2016 at 21:12:15 UTC, Walter Bright wrote: So really, how good are you at fast code? I recall being able to get a marginal boost in speed by assigning the first 1-2 bytes in preassigned buckets (256 & 65536 respectively), so you have an immediate 1-2 byte matches

Re: Battle-plan for CTFE

2016-05-21 Thread Martin Nowak via Digitalmars-d-announce
On 05/18/2016 04:59 PM, Daniel Murphy wrote: > The bytecode generator and bytecode interpreter can be debugged (and > tested!) independently. So the total amount of code will increase but > the components themselves will be better isolated and easier to work with. It's simpler to debug an AST

Game Development Using D

2016-05-21 Thread David via Digitalmars-d-learn
Hi, I want to try to create a game using D. I'm a complete newbie though (other than having C/C++ experience). Where would I start? Does D have an openGL binding? I am assuming I'll need to leverage a good amount C APIs? Any list of these that would be useful it a game setting? Obviously

Re: Game Development Using D

2016-05-21 Thread Stefan Koch via Digitalmars-d-learn
On Saturday, 21 May 2016 at 15:53:18 UTC, David wrote: Hi, I want to try to create a game using D. I'm a complete newbie though (other than having C/C++ experience). Where would I start? Does D have an openGL binding? I am assuming I'll need to leverage a good amount C APIs? Any list of

Re: amoeba, a chess engine written in D

2016-05-21 Thread Richard Delorme via Digitalmars-d-announce
On Saturday, 21 May 2016 at 08:23:59 UTC, Johan Engelen wrote: On Friday, 20 May 2016 at 23:16:01 UTC, Richard Delorme wrote: The source can be compiled with dmd, ldc or gdc, but the best performance are obtained with the latter (almost twice faster). Can you give cmdline details and

Re: DMD producing huge binaries

2016-05-21 Thread krzaq via Digitalmars-d
On Saturday, 21 May 2016 at 17:34:19 UTC, Kagamin wrote: On Friday, 20 May 2016 at 19:37:23 UTC, Andrei Alexandrescu wrote: Was talking to Walter on the phone and he just had one of those great ideas: encode in the function mangle that it returns "auto". I thought that was fantastic. Would

Re: DMD producing huge binaries

2016-05-21 Thread Andrei Alexandrescu via Digitalmars-d
On 05/21/2016 01:34 PM, Kagamin wrote: But this leaves you with 2^^n growth, still exponential He said that that won't happen any longer, the growth was because of the return type. Is that correct? -- Andrei

Re: Is there a way to make a class variable visible but constant to outsiders, but changeable (mutable) to the class itself?

2016-05-21 Thread Meta via Digitalmars-d-learn
On Saturday, 21 May 2016 at 17:32:47 UTC, dan wrote: Is it possible to have a class which has a variable which can be seen from the outside, but which can only be modified from the inside? Something like: class C { int my_var = 3; // semi_const?? void do_something() { my_var = 4; } }

Re: Discuss vulkan erupted, the other auto-generated vulkan binding

2016-05-21 Thread ParticlePeter via Digitalmars-d
Test worked, now supporting dub packages xcb-d, xlib-d, wayland-client-d.

Re: Is there a way to make a class variable visible but constant to outsiders, but changeable (mutable) to the class itself?

2016-05-21 Thread Yuxuan Shui via Digitalmars-d-learn
On Saturday, 21 May 2016 at 17:32:47 UTC, dan wrote: Is it possible to have a class which has a variable which can be seen from the outside, but which can only be modified from the inside? Something like: class C { int my_var = 3; // semi_const?? void do_something() { my_var = 4; } }

[Issue 16052] New: Debugging not possible - probably wrong debug information

2016-05-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16052 Issue ID: 16052 Summary: Debugging not possible - probably wrong debug information Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

Re: Is there a way to make a class variable visible but constant to outsiders, but changeable (mutable) to the class itself?

2016-05-21 Thread vit via Digitalmars-d-learn
On Saturday, 21 May 2016 at 17:32:47 UTC, dan wrote: Is it possible to have a class which has a variable which can be seen from the outside, but which can only be modified from the inside? Something like: class C { int my_var = 3; // semi_const?? void do_something() { my_var = 4; } }

[Issue 15940] std.variant.Variant: compilation fails if a value is aliased struct

2016-05-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15940 b2.t...@gmx.com changed: What|Removed |Added Status|NEW |ASSIGNED CC|

Re: DMD producing huge binaries

2016-05-21 Thread Walter Bright via Digitalmars-d
On 5/20/2016 11:18 PM, poliklosio wrote: I have an Idea of reproducible, less-than-exponential time mangling, although I don't know how actionable. Leave mangling as is, but pretend that you are mangling something different, for example when the input is foo!(boo!(bar!(baz!(int))),

Re: problems with Rebindable

2016-05-21 Thread Kagamin via Digitalmars-d-learn
On Saturday, 21 May 2016 at 13:36:02 UTC, chmike wrote: static Info one() { static auto x = Info(new Obj("I'm one")); return x; } static Info two() { static auto x = Info(new Obj("I'm two")); return x; } FYI those are thread local

Re: Always false float comparisons

2016-05-21 Thread Tobias M via Digitalmars-d
On Saturday, 21 May 2016 at 17:58:49 UTC, Walter Bright wrote: On 5/21/2016 2:26 AM, Tobias Müller wrote: On Friday, 20 May 2016 at 22:22:57 UTC, Walter Bright wrote: On 5/20/2016 5:36 AM, Tobias M wrote: Still an authority, though. If we're going to use the fallacy of appeal to authority,

  1   2   >