Re: Running a D game in the browser

2016-08-04 Thread Sebastien Alaiwan via Digitalmars-d-announce
On Thursday, 4 August 2016 at 19:17:34 UTC, Sebastien Alaiwan wrote: at the moment, I have a patch to making the build work (only for the binary "ldc2", not other tools of the package). I created a dedicated github branch "fastcomp-ldc". The patch:

Re: The Computer Language Benchmarks Game

2016-08-04 Thread ZombineDev via Digitalmars-d
On Thursday, 4 August 2016 at 20:15:35 UTC, Ali Çehreli wrote: We don't hear about the following site here any more: http://benchmarksgame.alioth.debian.org/ How relevant is that site for us? Should D be represented there as well? Would someone (you? :p) be interested in adding D to the

Re: Self Optimizing Code

2016-08-04 Thread Chris Wright via Digitalmars-d
On Thu, 04 Aug 2016 18:39:36 +, Mark "J" Twain wrote: > I would have to disagree about the language complexity though. At most > the hardest part would be figuring out what syntax to use for symbols. The cost with language changes isn't just implementation. The largest part is that people

Re: Documented unittests & code coverage

2016-08-04 Thread Walter Bright via Digitalmars-d
In adding some overflow detection to Phobos, I discovered that some allocations were never called by the unittests. Adding a unittest for those paths, I discovered those paths didn't work at all for any cases. I'm not giving up coverage testing anytime soon, regardless of what some study

Re: LDC 1.1.0-beta2 has been released!

2016-08-04 Thread Emre Temelkuran via Digitalmars-d-announce
On Wednesday, 3 August 2016 at 20:12:59 UTC, Kai Nacke wrote: Hi everyone, LDC 1.1.0-beta2, the LLVM-based D compiler, is available for download! This BETA release is based on the 2.071.1 frontend and standard library and supports LLVM 3.5-3.9. We provide binaries for Linux, OX X, FreeBSD,

Re: The Origins of the D Cookbook

2016-08-04 Thread Mike Parker via Digitalmars-d-announce
On Thursday, 4 August 2016 at 15:42:50 UTC, Joakim wrote: Nice read. I must say Mike's doing a great job running the blog so far. Perhaps it's for the best I never got the D blog running back when I suggested it a couple years back, though I hope to contribute to this one soon. Thanks,

Re: Recommended procedure to upgrade DMD installation

2016-08-04 Thread Mike Parker via Digitalmars-d
On Thursday, 4 August 2016 at 18:47:36 UTC, A D dev wrote: Hi group, Somewhat new to D. What is the recommended procedure, if any, to upgrade my DMD installation (on Windows, if that makes a difference)? I.e. If I have 2.70.0 and I saw that 2.17.1 is out now, I can look at the list of bug

Re: Instantiate C struct on heap

2016-08-04 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 4 August 2016 at 23:49:26 UTC, Mike Parker wrote: C structs can be created with new just like D structs as long For clarity, in a D binding to a C library, a C struct *is* a D struct. If they are declared as extern(C), that affects the name of the symbol and how it exists in

Re: Instantiate C struct on heap

2016-08-04 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 4 August 2016 at 21:02:59 UTC, TencoDK wrote: Hey, I'm using DerelictSFML2 + CSFML, I have stuck on instantiating window. derelict/window.d (binding from C): struct sfWindow; my_file.d: sfWindow* sfmlWindow = null; sfmlWindow = new sfWindow; // ??? This code snippet gives me:

Re: C binding with D function

2016-08-04 Thread bachmeier via Digitalmars-d-learn
On Thursday, 4 August 2016 at 17:11:04 UTC, Adam D. Ruppe wrote: On Thursday, 4 August 2016 at 14:46:33 UTC, bachmeier wrote: I'd like to put this example on the wiki unless you think there is a reason to not do so. cool. I'll prolly slap it in this week in D soon too (I've been kinda short

Pass Tid[string] to another thread (by send)

2016-08-04 Thread TencoDK via Digitalmars-d-learn
Hi! I'm trying to make threads communicate by sending an immutable address book to each thread. Code: Tid[string] addressBook; addressBook["Some"] = sdfsdf; addressBook["Input"] = sdfsdf; auto sharedAddressBook = cast(immutable(Tid[string]))(addressBook); send(tid, sharedAddressBook);

Re: vsprintf or printf variable arguments

2016-08-04 Thread Mark J Twain via Digitalmars-d-learn
On Thursday, 4 August 2016 at 21:03:52 UTC, Mark "J" Twain wrote: How can I construct a va_list for vsprintf when all I have is the a list of pointers to the data, without their type info? A va_list seems to be a packed struct of values and/or pointers to the data. While I could construct

Re: Recommended procedure to upgrade DMD installation

2016-08-04 Thread Seb via Digitalmars-d
On Thursday, 4 August 2016 at 18:47:36 UTC, A D dev wrote: Hi group, Somewhat new to D. What is the recommended procedure, if any, to upgrade my DMD installation (on Windows, if that makes a difference)? I.e. If I have 2.70.0 and I saw that 2.17.1 is out now, I can look at the list of bug

Re: Documented unittests & code coverage

2016-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2016 12:04 PM, Atila Neves wrote: What I take issue with is two things: 1. Code coverage metric targets (especially if the target is 100%). This leads to inane behaviours such as "testing" a print function (which itself was only used in testing) to meet the target. It's busywork that

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Seb via Digitalmars-d
On Thursday, 4 August 2016 at 21:13:23 UTC, Iain Buclaw wrote: On 4 August 2016 at 01:00, Seb via Digitalmars-d wrote: To make matters worse std.math yields different results than compiler/assembly intrinsics - note that in this example import std.math.pow adds

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2016 2:13 PM, Iain Buclaw via Digitalmars-d wrote: This could be something specific to your architecture. I get the same result on from all versions of powf, and from GCC builtins too, regardless of optimization tunings. It's important to remember that what gcc does and what the C

Re: Instantiate C struct on heap

2016-08-04 Thread TencoDK via Digitalmars-d-learn
On Thursday, 4 August 2016 at 21:21:14 UTC, Adam D. Ruppe wrote: On Thursday, 4 August 2016 at 21:02:59 UTC, TencoDK wrote: derelict/window.d (binding from C): struct sfWindow; That kind of struct isn't supposed to be created directly... there should be a create window function in the

Re: Instantiate C struct on heap

2016-08-04 Thread TencoDK via Digitalmars-d-learn
On Thursday, 4 August 2016 at 21:02:59 UTC, TencoDK wrote: Hey, I'm using DerelictSFML2 + CSFML, I have stuck on instantiating window. derelict/window.d (binding from C): struct sfWindow; my_file.d: sfWindow* sfmlWindow = null; sfmlWindow = new sfWindow; // ??? This code snippet gives me:

Re: Instantiate C struct on heap

2016-08-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 4 August 2016 at 21:02:59 UTC, TencoDK wrote: derelict/window.d (binding from C): struct sfWindow; That kind of struct isn't supposed to be created directly... there should be a create window function in the library somewhere.

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Iain Buclaw via Digitalmars-d
On 4 August 2016 at 01:00, Seb via Digitalmars-d wrote: > > Consider the following program, it fails on 32-bit :/ > It would be nice if explicit casts were honoured by CTFE here. toDouble(a + b) just seems to be avoiding the why CTFE ignores the cast in

vsprintf or printf variable arguments

2016-08-04 Thread Mark J Twain via Digitalmars-d-learn
How can I construct a va_list for vsprintf when all I have is the a list of pointers to the data, without their type info? A va_list seems to be a packed struct of values and/or pointers to the data. While I could construct such a list, theoretically, I don't always know when I should store

Instantiate C struct on heap

2016-08-04 Thread TencoDK via Digitalmars-d-learn
Hey, I'm using DerelictSFML2 + CSFML, I have stuck on instantiating window. derelict/window.d (binding from C): struct sfWindow; my_file.d: sfWindow* sfmlWindow = null; sfmlWindow = new sfWindow; // ??? This code snippet gives me: Error: struct derelict.sfml2.window.sfWindow unknown size

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2016 1:29 PM, Fool wrote: I'm afraid, I don't understand your implementation. Isn't toFloat(x) + toFloat(y) computed in real precision (first rounding)? Why doesn't toFloat(toFloat(x) + toFloat(y)) involve another rounding? You're right, in that case, it does. But C does, too:

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Ilya Yaroshenko via Digitalmars-d
IEEE behaviour by default is required by numeric software. @fastmath (like recent LDC) or something like that can be used to allow extended precision. Ilya

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2016 1:03 PM, deadalnix wrote: It is actually very common for C compiler to work with double for intermediate values, which isn't far from what D does. In fact, it used to be specified that C behave that way!

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Fool via Digitalmars-d
On Thursday, 4 August 2016 at 20:00:14 UTC, Walter Bright wrote: On 8/4/2016 12:03 PM, Fool wrote: How can we ensure that toFloat(toFloat(x) + toFloat(y)) does not involve double-rounding? It's the whole point of it. I'm afraid, I don't understand your implementation. Isn't toFloat(x) +

Re: The Computer Language Benchmarks Game

2016-08-04 Thread jmh530 via Digitalmars-d
On Thursday, 4 August 2016 at 20:15:35 UTC, Ali Çehreli wrote: We don't hear about the following site here any more: http://benchmarksgame.alioth.debian.org/ How relevant is that site for us? Should D be represented there as well? Would someone (you? :p) be interested in adding D to the

Re: Initialize array of objects not work

2016-08-04 Thread Ali Çehreli via Digitalmars-d-learn
On 08/04/2016 09:06 AM, Steven Schveighoffer wrote: On 8/4/16 11:19 AM, Andre Pany wrote: On Thursday, 4 August 2016 at 13:48:46 UTC, Steven Schveighoffer wrote: On 8/3/16 2:34 PM, Ali Çehreli wrote: void main() { Element[] elements = cast(Element[])[ quadraticCoefficient(1),

The Computer Language Benchmarks Game

2016-08-04 Thread Ali Çehreli via Digitalmars-d
We don't hear about the following site here any more: http://benchmarksgame.alioth.debian.org/ How relevant is that site for us? Should D be represented there as well? Would someone (you? :p) be interested in adding D to the languages there? There is the following page where the author may

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2016 12:03 PM, Fool wrote: How can we ensure that toFloat(toFloat(x) + toFloat(y)) does not involve double-rounding? It's the whole point of it.

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread deadalnix via Digitalmars-d
On Thursday, 4 August 2016 at 18:53:23 UTC, Walter Bright wrote: On 8/4/2016 7:08 AM, Andrew Godfrey wrote: Now, my major experience is in the context of Intel non-SIMD FP, where internal precision is 80-bit. I can see the appeal of asking for the ability to reduce internal precision to match

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2016 11:53 AM, Walter Bright wrote: It has been proposed many times that the solution for D is to have a function called toFloat() or something like that in core.math, which guarantees a round to float precision for its argument. But so far nobody has written such a function.

Re: For the Love of God, Please Write Better Docs!

2016-08-04 Thread profan via Digitalmars-d
On Tuesday, 2 August 2016 at 20:26:06 UTC, Jack Stouffer wrote: 6. Examples for every function. Simple examples are nice, but an example which shows real world use is even better. You need to show the user why this function exists. 7. Module level examples, meaning examples which show the

Re: Running a D game in the browser

2016-08-04 Thread Sebastien Alaiwan via Digitalmars-d-announce
On Wednesday, 3 August 2016 at 20:40:47 UTC, Kai Nacke wrote: That's awesome! Do you still know the modifications you made to compile LDC with emscripten-fastcomp? I would be interested to have a look into the "PNaCl legalization passes" problem. That would be great, and might simplify the

Re: Documented unittests & code coverage

2016-08-04 Thread Atila Neves via Digitalmars-d
On Thursday, 4 August 2016 at 10:24:39 UTC, Walter Bright wrote: On 8/4/2016 1:13 AM, Atila Neves wrote: On Thursday, 28 July 2016 at 23:14:42 UTC, Walter Bright wrote: On 7/28/2016 3:15 AM, Johannes Pfau wrote: And as a philosophical question: Is code coverage in unittests even a meaningful

Return type based overloading and multiple return values via templates

2016-08-04 Thread Steve Biedermann via Digitalmars-d
Every few weeks D amazes me, with how flexible this language is. Today, I'm amazed that I could implement multiple return values and return type based function overloading on a library level: https://github.com/hardliner66/D_ReturnLowering Probably not the best code. Also not as comfortable

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Fool via Digitalmars-d
On Thursday, 4 August 2016 at 18:53:23 UTC, Walter Bright wrote: It has been proposed many times that the solution for D is to have a function called toFloat() or something like that in core.math, which guarantees a round to float precision for its argument. But so far nobody has written such

Re: [OT] Create more debt == earn more

2016-08-04 Thread Laeeth Isharc via Digitalmars-d
On Wednesday, 3 August 2016 at 13:34:13 UTC, jmh530 wrote: On Wednesday, 3 August 2016 at 07:35:28 UTC, deadalnix wrote: And how is this legal tender emitted ? With debt. Do you mean how money is created? The Fed and other major central banks use open market operations like repos or

Re: D safety! New Feature?

2016-08-04 Thread ag0aep6g via Digitalmars-d
On 08/04/2016 08:22 PM, Mark J Twain wrote: The problem is that you have fixated on the *array* and not the general principle. The Array was an example. I'm having trouble understanding what you're getting at, so I'm trying to get it from the example you gave. If there's merit in your idea,

Re: Self Optimizing Code

2016-08-04 Thread Mark J Twain via Digitalmars-d
On Thursday, 4 August 2016 at 11:35:41 UTC, crimaniak wrote: On Tuesday, 2 August 2016 at 22:06:38 UTC, Mark "J" Twain wrote: Instead, a better solution would be to use variables: if (n*length > m*capacity) expand(l*length) Some time ago I played with self-optimizing cache layer. Problem:

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2016 7:08 AM, Andrew Godfrey wrote: Now, my major experience is in the context of Intel non-SIMD FP, where internal precision is 80-bit. I can see the appeal of asking for the ability to reduce internal precision to match the data type you're using, and I think I've read something written

Recommended procedure to upgrade DMD installation

2016-08-04 Thread A D dev via Digitalmars-d
Hi group, Somewhat new to D. What is the recommended procedure, if any, to upgrade my DMD installation (on Windows, if that makes a difference)? I.e. If I have 2.70.0 and I saw that 2.17.1 is out now, I can look at the list of bug fixes and any new features in the new version and decide

Re: Self Optimizing Code

2016-08-04 Thread Mark J Twain via Digitalmars-d
On Thursday, 4 August 2016 at 04:41:43 UTC, Chris Wright wrote: In your example, you have a size_t or double factor for array growth. If you set it to -1, you would have an unpleasant time. You need a way to specify the range of valid values. In more complex algorithms, you need a way to

Re: D safety! New Feature?

2016-08-04 Thread Mark J Twain via Digitalmars-d
On Thursday, 4 August 2016 at 13:08:11 UTC, ag0aep6g wrote: On 08/03/2016 09:33 PM, Mark J Twain wrote: The built in array is mutable and exposes the same interface for the immutable copy. The only difference is that the immutable copy is marked immutable. I don't understand. An immutable

Re: Things that make writing a clean binding system more difficult

2016-08-04 Thread Seb via Digitalmars-d
On Thursday, 4 August 2016 at 12:44:49 UTC, Manu wrote: On 29 July 2016 at 16:51, Jonathan M Davis via Digitalmars-d wrote: [...] Bingo! But it's much deeper than that. ref is a disaster. Use it to any real extent; in particular, binding (or fabricating

Re: C binding with D function

2016-08-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 4 August 2016 at 14:46:33 UTC, bachmeier wrote: I'd like to put this example on the wiki unless you think there is a reason to not do so. cool. I'll prolly slap it in this week in D soon too (I've been kinda short on material lately!)

Re: C binding with D function

2016-08-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 4 August 2016 at 13:14:34 UTC, llaine wrote: I saw that your compiling using dmd with all thoses options. Can you explain me what is the benefit of using this ? I just don't use dub, I don't see the benefit of it, but if it works for you, cool!

code examples on dlang.org

2016-08-04 Thread grm via Digitalmars-d-learn
wouldn't it be great to have a 'next example' button beside/below the 'your code here' area on dlang.org's main page?

Re: [OT] Music to Program Compilers To

2016-08-04 Thread Meta via Digitalmars-d
On Thursday, 4 August 2016 at 14:09:45 UTC, Jack Stouffer wrote: Protest the Hero (favorite song from them: https://www.youtube.com/watch?v=p3T-wusBodE) Protest the Hero is great; I was really into them in high school. Kezia is my favourite album of theirs. Another great band is Dance Gavin

Re: Initialize array of objects not work

2016-08-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/4/16 11:19 AM, Andre Pany wrote: On Thursday, 4 August 2016 at 13:48:46 UTC, Steven Schveighoffer wrote: On 8/3/16 2:34 PM, Ali Çehreli wrote: void main() { Element[] elements = cast(Element[])[ quadraticCoefficient(1), linearCoefficient(2), equals(), constant(1) ]; is the cast

Re: The Origins of the D Cookbook

2016-08-04 Thread Joakim via Digitalmars-d-announce
On Thursday, 4 August 2016 at 14:23:03 UTC, Mike Parker wrote: I've just published a guest post from Adam Ruppe at the D Blog [1]. If you notice any errors, that's all on me. I had intended it for yesterday, but was just too busy. And though I did manage to get it out today, I did not have the

Re: C binding with D function

2016-08-04 Thread Martin Tschierschke via Digitalmars-d-learn
On Thursday, 4 August 2016 at 12:14:48 UTC, Adam D. Ruppe wrote: On Thursday, 4 August 2016 at 10:36:05 UTC, llaine wrote: Any idea how can I call them ? Just like any other function. Consider this: [...] Compile [...] hi from D, Ruby user! Thank you a lot!!! I want to use some vibe.d

Re: Running a D game in the browser

2016-08-04 Thread Martin Tschierschke via Digitalmars-d-announce
On Wednesday, 3 August 2016 at 20:26:23 UTC, Sebastien Alaiwan wrote: Hi, I finally managed to compile some D code to asm.js, using Emscripten. [...] You can play a minimalistic demo: http://code.alaiwan.org/dscripten/full.html [...] Please let me know what you think! Fascinating!

Re: Initialize array of objects not work

2016-08-04 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 4 August 2016 at 13:48:46 UTC, Steven Schveighoffer wrote: On 8/3/16 2:34 PM, Ali Çehreli wrote: void main() { Element[] elements = cast(Element[])[ quadraticCoefficient(1), linearCoefficient(2), equals(), constant(1) ]; is the cast necessary? I assumed the compiler would

Re: C binding with D function

2016-08-04 Thread bachmeier via Digitalmars-d-learn
On Thursday, 4 August 2016 at 12:14:48 UTC, Adam D. Ruppe wrote: On Thursday, 4 August 2016 at 10:36:05 UTC, llaine wrote: Any idea how can I call them ? Just like any other function. Consider this: I'd like to put this example on the wiki unless you think there is a reason to not do so.

The Origins of the D Cookbook

2016-08-04 Thread Mike Parker via Digitalmars-d-announce
I've just published a guest post from Adam Ruppe at the D Blog [1]. If you notice any errors, that's all on me. I had intended it for yesterday, but was just too busy. And though I did manage to get it out today, I did not have the time to review it as thoroughly as I normally do. Please post

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-04 Thread Andrew Godfrey via Digitalmars-d
On Wednesday, 3 August 2016 at 23:00:11 UTC, Seb wrote: There was a recent discussion on Phobos about D's floating point behavior [1]. I think Ilya summarized quite elegantly our problem: [...] In my experience (production-quality FP coding in C++), you are in error merely by combining

Re: [OT] Music to Program Compilers To

2016-08-04 Thread Jack Stouffer via Digitalmars-d
On Tuesday, 2 August 2016 at 13:02:23 UTC, burjui wrote: Nice to see fellow metalheads here. Here are some of my favourite bands: Aghora Animals as Leaders Between The Buried And Me Children of Bodom Cynic Dan Swano Gorod Iron Maiden In Flames Killswitch Engage Kovenant Lamb Of God Lye By

Re: Running a D game in the browser

2016-08-04 Thread Suliman via Digitalmars-d-announce
Very cool! Is it's possible now to write not graphical Apps for web in D? I do not need graphics, but I need normal language instead of js that can help me to do some computation. For example is it's possible to write in D app that would validate some fileds in HTML and simply show (even on

Re: Initialize array of objects not work

2016-08-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/3/16 2:34 PM, Ali Çehreli wrote: void main() { Element[] elements = cast(Element[])[ quadraticCoefficient(1), linearCoefficient(2), equals(), constant(1) ]; is the cast necessary? I assumed the compiler would infer the common base type... -Steve

[Issue 16351] Nonstandard output library causes no-argument writeln() to fail.

2016-08-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16351 --- Comment #1 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/65fe9934b48f5675957794ac41aaca8e14b6344e Fix issue 16351 When using nonstandard output

[Issue 16351] Nonstandard output library causes no-argument writeln() to fail.

2016-08-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16351 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: alias to function literal, call without () not possible

2016-08-04 Thread ag0aep6g via Digitalmars-d-learn
On 08/03/2016 09:40 PM, Andre Pany wrote: Thanks for the info. Yes, I forgot the () for new Object; Adding the () for new Object() still returns the same error. `new Object` without parentheses is perfectly fine.

Re: C binding with D function

2016-08-04 Thread ketmar via Digitalmars-d-learn
On Thursday, 4 August 2016 at 13:14:34 UTC, llaine wrote: I saw that your compiling using dmd with all thoses options. Can you explain me what is the benefit of using this ? very simple: avoiding dub. Adam is not using it.

Re: D safety! New Feature?

2016-08-04 Thread ag0aep6g via Digitalmars-d
On 08/03/2016 09:33 PM, Mark J Twain wrote: The built in array is mutable and exposes the same interface for the immutable copy. The only difference is that the immutable copy is marked immutable. I don't understand. An immutable array does not let you overwrite elements. A mutable array

Re: Things that make writing a clean binding system more difficult

2016-08-04 Thread Manu via Digitalmars-d
On 29 July 2016 at 19:55, Walter Bright via Digitalmars-d wrote: > On 7/29/2016 1:34 AM, Jonathan M Davis via Digitalmars-d wrote: >> >> I've always looked at D's ref as being essentially the same as C++'s & >> except that it's not considered to be part of the type,

Re: Running a D game in the browser

2016-08-04 Thread Sebastien Alaiwan via Digitalmars-d-announce
On Thursday, 4 August 2016 at 09:57:57 UTC, Mike Parker wrote: On Wednesday, 3 August 2016 at 20:26:23 UTC, Sebastien Alaiwan wrote: And a blogpost explaining the technique is available here: http://code.alaiwan.org/wp/?p=103 (Spoiler: at some point, it involves lowering the source code

Re: Things that make writing a clean binding system more difficult

2016-08-04 Thread Manu via Digitalmars-d
On 29 July 2016 at 16:51, Jonathan M Davis via Digitalmars-d wrote: > On Friday, July 29, 2016 08:29:19 Timon Gehr via Digitalmars-d wrote: >> On 29.07.2016 06:52, Jonathan M Davis via Digitalmars-d wrote: >> > On Friday, July 29, 2016 06:44:16 Timon Gehr via

Re: Things that make writing a clean binding system more difficult

2016-08-04 Thread Manu via Digitalmars-d
On 29 July 2016 at 07:34, Steven Schveighoffer via Digitalmars-d wrote: > On 7/28/16 4:16 PM, Jonathan M Davis via Digitalmars-d wrote: >> >> On Thursday, July 28, 2016 01:49:35 Walter Bright via Digitalmars-d wrote: >>> >>> On 7/28/2016 1:33 AM, Ethan Watson wrote:

Re: C binding with D function

2016-08-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 4 August 2016 at 10:36:05 UTC, llaine wrote: Any idea how can I call them ? Just like any other function. Consider this: -- // i.d import std.stdio; extern(C) void hello() { writeln("hi from D"); } -- # d.rb require 'rubygems' require 'ffi' module

[Issue 8108] Forward declaration and implementation allowed in same file

2016-08-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8108 --- Comment #2 from Sobirari Muhomori --- *** Issue 16329 has been marked as a duplicate of this issue. *** --

[Issue 16329] Function declaration followed by definition does not work

2016-08-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16329 Sobirari Muhomori changed: What|Removed |Added Status|NEW |RESOLVED

Re: Things that make writing a clean binding system more difficult

2016-08-04 Thread Jacob Carlborg via Digitalmars-d
On 2016-07-28 10:33, Ethan Watson wrote: 4) Forward declaring a function prototype means I can never declare that function elsewhere (say, for example, with a mixin) You mean like this: import std.stdio; void foo(); void foo() { writeln("asd"); } void main() { foo(); } That works

Re: Self Optimizing Code

2016-08-04 Thread crimaniak via Digitalmars-d
On Tuesday, 2 August 2016 at 22:06:38 UTC, Mark "J" Twain wrote: Instead, a better solution would be to use variables: if (n*length > m*capacity) expand(l*length) Some time ago I played with self-optimizing cache layer. Problem: Time to obtain cache items is unknown and server dependant. For

Re: std.experimental.xml available on DUB

2016-08-04 Thread Jacob Carlborg via Digitalmars-d-announce
On 2016-08-04 09:15, Lodovico Giaretta wrote: I don't know if it is what you want, but you can do this: auto lexer = chooseLexer!input; The function chooseLexer creates the most suitable lexer type based on the input type. You can test if a type is a lexer using the trait isLexer defined in

Re: std.experimental.xml available on DUB

2016-08-04 Thread Jacob Carlborg via Digitalmars-d-announce
On 2016-08-03 22:57, Robert burner Schadek wrote: Well, currently you have to make that choice as developer, and there is always the BufferedLexer which should be good choice is most cases. Polymorphic design was not a goal of the project, so I think it is going to be hard to add that without

Re: C binding with D function

2016-08-04 Thread llaine via Digitalmars-d-learn
On Wednesday, 3 August 2016 at 16:09:15 UTC, bachmeier wrote: On Wednesday, 3 August 2016 at 15:56:34 UTC, llaine wrote: Okay on stack overflow, they are not using ffi but dl. I tried changing ffi to dl, it's the same don't work unfortunatly. That's about as far as I can go without having it

Re: Documented unittests & code coverage

2016-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2016 1:13 AM, Atila Neves wrote: On Thursday, 28 July 2016 at 23:14:42 UTC, Walter Bright wrote: On 7/28/2016 3:15 AM, Johannes Pfau wrote: And as a philosophical question: Is code coverage in unittests even a meaningful measurement? Yes. I've read all the arguments against code

Re: Running a D game in the browser

2016-08-04 Thread Mike Parker via Digitalmars-d-announce
On Wednesday, 3 August 2016 at 20:26:23 UTC, Sebastien Alaiwan wrote: And a blogpost explaining the technique is available here: http://code.alaiwan.org/wp/?p=103 (Spoiler: at some point, it involves lowering the source code back to C) Reddit:

[Issue 16311] toHash for Slice is not defined

2016-08-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16311 --- Comment #1 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/fba7339893829061b7f6dd59ab4cda24287b06dc Merge pull request #4639 from 9il/mm3 fix Issue 16311 -

Re: Running a D game in the browser

2016-08-04 Thread Chris via Digitalmars-d-announce
On Wednesday, 3 August 2016 at 20:26:23 UTC, Sebastien Alaiwan wrote: Hi, I finally managed to compile some D code to asm.js, using Emscripten. It had been done by one dude several years ago, but some changes in the inner workings of Emscripten (the introduction of fastcomp, also probably

Re: Why D is not popular enough?

2016-08-04 Thread ketmar via Digitalmars-d
On Thursday, 4 August 2016 at 00:57:13 UTC, bitwise wrote: On Wednesday, 3 August 2016 at 21:19:21 UTC, ketmar wrote: On Wednesday, 3 August 2016 at 19:57:13 UTC, bitwise wrote: On Tuesday, 2 August 2016 at 07:50:29 UTC, ketmar wrote: On Monday, 1 August 2016 at 19:33:48 UTC, bitwise wrote:

Re: [DIP] In-place struct initialization

2016-08-04 Thread ketmar via Digitalmars-d
On Thursday, 4 August 2016 at 07:22:27 UTC, ZombineDev wrote: On Thursday, 4 August 2016 at 05:15:56 UTC, Patrick Schluter wrote: This said, in C++ compound initialiser are implemented in some compiler as extension and are really problematic (object life time) and it would be probably similar

Re: alias to function literal, call without () not possible

2016-08-04 Thread Kagamin via Digitalmars-d-learn
Function pointers and delegates are not intended to allow optional parentheses. See also DIP23.

Re: Documented unittests & code coverage

2016-08-04 Thread Atila Neves via Digitalmars-d
On Thursday, 28 July 2016 at 23:14:42 UTC, Walter Bright wrote: On 7/28/2016 3:15 AM, Johannes Pfau wrote: And as a philosophical question: Is code coverage in unittests even a meaningful measurement? Yes. I've read all the arguments against code coverage testing. But in my usage of it for

Re: Indexing with an arbitrary type

2016-08-04 Thread Alex via Digitalmars-d-learn
What I think about is something like this: https://dpaste.dzfl.pl/d37cfb8e513d

Re: [DIP] In-place struct initialization

2016-08-04 Thread ketmar via Digitalmars-d
On Thursday, 4 August 2016 at 00:57:16 UTC, Chris Wright wrote: Curly braces are already extremely overloaded. They can start a block statement, a delegate literal, a struct literal and I'm sure I forgot something. q{} strings. this is unambiguous. and, btw, it blocks "inline delegate

Re: [DIP] In-place struct initialization

2016-08-04 Thread ZombineDev via Digitalmars-d
On Thursday, 4 August 2016 at 05:15:56 UTC, Patrick Schluter wrote: On Wednesday, 3 August 2016 at 21:35:58 UTC, ZombineDev wrote: On Wednesday, 3 August 2016 at 20:30:07 UTC, deadalnix wrote: On Sunday, 31 July 2016 at 14:38:33 UTC, Lodovico Giaretta wrote: I support this idea of extending

Re: std.experimental.xml available on DUB

2016-08-04 Thread Lodovico Giaretta via Digitalmars-d-announce
On Wednesday, 3 August 2016 at 09:04:30 UTC, Jacob Carlborg wrote: On 2016-07-30 11:26, Lodovico Giaretta wrote: Hi, I'm proud to announce that std.experimental.xml v0.1.0 is available on DUB [1]! Another question. I see that there are a couple of different lexers available. Can those be

Re: Running a D game in the browser

2016-08-04 Thread Sebastien Alaiwan via Digitalmars-d-announce
On Thursday, 4 August 2016 at 05:03:17 UTC, Joel wrote: [snip] Though, it looks like the score isn't reset when you start a new game. Or, is it intended that way? Oh, I read it wrong, the score is reset. Dummy, me! It's just that you're becoming better at this silly game :-) Thanks for your

Re: Why Does Dscanner Warn About a Missing toHash if opEquals is Defined?

2016-08-04 Thread mlsgmls via Digitalmars-d-learn
On Sunday, 31 July 2016 at 18:57:50 UTC, Jack Stouffer wrote: On Sunday, 31 July 2016 at 17:48:48 UTC, BLM768 wrote: writeln(n1.hashOf == n2.hashOf); // false = BAD! Ok, yeah that is bad. Next question: what's the fastest hashing implementation that will provide the least collisions? Is