Re: Slides from LASER 2012

2012-09-21 Thread renoX
On Friday, 21 September 2012 at 04:56:04 UTC, Andrei Alexandrescu wrote: On 9/20/12 6:03 PM, renoX wrote: Thank for these slides. I didn't get some part of the VRP slides: p40 of the third lesson: byte a, b, c; a = 1; b = c | a; // error Is-this really an error? A binary-or operation on

Re: Slides from LASER 2012

2012-09-21 Thread Simen Kjaeraas
On Fri, 21 Sep 2012 05:58:21 +0200, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 9/20/12 10:06 AM, Simen Kjaeraas wrote: Cool. And now the inevitable: Will there be video? No video was taken. Andrei *sadface* -- Simen

Re: Slides from LASER 2012

2012-09-21 Thread Dmitry Olshansky
On 21-Sep-12 03:27, Timon Gehr wrote: On 09/21/2012 12:51 AM, bearophile wrote: Timon Gehr: chain has type Result. dynRange takes an arbitrary range and transforms it into a range with the same value/vs reference behaviour whose static type depends only on the element type. I see. So that

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread Iain Buclaw
On 21 September 2012 04:47, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I've met Matt Goldbolt, the author of the GCC Explorer at http://gcc.godbolt.org - a very handy online disassembler for GCC. We got to talk a bit about D and he hacked together support for D by using gdc.

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread Andrej Mitrovic
On 9/21/12, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: snip Integrating this with dpaste would be aweee..sooome!

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-21 Thread deadalnix
Le 21/09/2012 01:13, Timon Gehr a écrit : You could post an enhancement request to allow interpretation of incompletely-analyzed functions, if you think it is of any use. I predict tricky implementation.

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-21 Thread Jens Mueller
Jonathan M Davis wrote: On Friday, September 21, 2012 00:11:51 Jens Mueller wrote: I thought foo is interpreted at compile time. There seems to be a subtle difference I'm not getting. Because you can do the factorial using CTFE even though you have recursion. I.e. there you have a call to

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Johannes Pfau
Am Thu, 20 Sep 2012 22:41:23 +0400 schrieb Dmitry Olshansky dmitry.o...@gmail.com: On 20-Sep-12 22:18, bearophile wrote: Johannes Pfau: The perfect solution: Would allow user defined attributes on tests, so you could name them, assign categories, etc. But till we have those user

Re: From APL

2012-09-21 Thread Simen Kjaeraas
On Thu, 20 Sep 2012 13:55:48 +0200, bearophile bearophileh...@lycos.com wrote: Section 2.3 is about Scan operations, that are like reduce or fold, but keep all the intermediate results too: +\ of 3 1 2 4 is 3 4 6 10 Some lazy scans are present in the Haskell Prelude too (and in

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jacob Carlborg
On 2012-09-20 21:11, Johannes Pfau wrote: Oh right, I thought that interface was more restrictive. So the only changes necessary in druntime are to adapt to the new compiler interface. The new dmd code is still necessary, as it allows to access all unittests of a module individually. The

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jacob Carlborg
On 2012-09-20 23:14, Jonathan M Davis wrote: Running more unittest blocks after a failure is similarly flawed, but at least in that case, you know that had a failure earlier in the module, which should then tell you that you may not be able to trust further tests (but if you still run them,

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Jacob Carlborg
On 2012-09-21 06:23, Andrei Alexandrescu wrote: For a very simple reason: unless the algorithm under benchmark is very long-running, max is completely useless, and it ruins average as well. I may have completely misunderstood this but aren't we talking about what do include in the output of

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread Jacob Carlborg
On 2012-09-21 05:47, Andrei Alexandrescu wrote: I've met Matt Goldbolt, the author of the GCC Explorer at http://gcc.godbolt.org - a very handy online disassembler for GCC. We got to talk a bit about D and he hacked together support for D by using gdc. Take a look at http://d.godbolt.org, I

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Tove
On Friday, 21 September 2012 at 04:44:58 UTC, Andrei Alexandrescu wrote: Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: My claim is unremarkable. All I'm saying is the minimum running time of an algorithm on a given input is a stable and indicative proxy for the behavior of the

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread Jens Mueller
Andrei Alexandrescu wrote: I've met Matt Goldbolt, the author of the GCC Explorer at http://gcc.godbolt.org - a very handy online disassembler for GCC. This is not a disassembler. It just stops compilation before the assembler (gcc -S). A dissembler would create the assembler code given only

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread Bernard Helyer
On Friday, 21 September 2012 at 10:04:00 UTC, Jens Mueller wrote: Andrei Alexandrescu wrote: I've met Matt Goldbolt, the author of the GCC Explorer at http://gcc.godbolt.org - a very handy online disassembler for GCC. This is not a disassembler. It just stops compilation before the assembler

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-21 Thread Jens Mueller
Jens Mueller wrote: Jonathan M Davis wrote: On Friday, September 21, 2012 00:11:51 Jens Mueller wrote: I thought foo is interpreted at compile time. There seems to be a subtle difference I'm not getting. Because you can do the factorial using CTFE even though you have recursion.

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-21 Thread Jonathan M Davis
On Friday, September 21, 2012 10:44:11 Jens Mueller wrote: Is it also illegal to do int foo(char[] s) { if (__ctfe) return mixin(s); else return ; // or assert(false) } ? Because this is executable at run time. It's not executable at runtime. The __ctfe branch may very

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-21 Thread Jens Mueller
Timon Gehr wrote: On 09/20/2012 11:22 PM, Jens Mueller wrote: Hi, I do not understand the following error message given the code: string foo(string f) { if (f == somestring) { return got somestring; } return bar!(foo(somestring)); } template

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread Iain Buclaw
On 21 September 2012 11:17, Bernard Helyer b.hel...@gmail.com wrote: On Friday, 21 September 2012 at 10:04:00 UTC, Jens Mueller wrote: Andrei Alexandrescu wrote: I've met Matt Goldbolt, the author of the GCC Explorer at http://gcc.godbolt.org - a very handy online disassembler for GCC.

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread Iain Buclaw
On 21 September 2012 11:29, Iain Buclaw ibuc...@ubuntu.com wrote: On 21 September 2012 11:17, Bernard Helyer b.hel...@gmail.com wrote: On Friday, 21 September 2012 at 10:04:00 UTC, Jens Mueller wrote: Andrei Alexandrescu wrote: I've met Matt Goldbolt, the author of the GCC Explorer at

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread Jens Mueller
Iain Buclaw wrote: On 21 September 2012 11:29, Iain Buclaw ibuc...@ubuntu.com wrote: On 21 September 2012 11:17, Bernard Helyer b.hel...@gmail.com wrote: On Friday, 21 September 2012 at 10:04:00 UTC, Jens Mueller wrote: Andrei Alexandrescu wrote: I've met Matt Goldbolt, the author of

Re: Infer function template parameters

2012-09-21 Thread Jonas Drewsen
On Thursday, 20 September 2012 at 21:39:31 UTC, Jonathan M Davis wrote: On Thursday, September 20, 2012 21:57:47 Jonas Drewsen wrote: In foreach statements the type can be inferred: foreach (MyFooBar fooBar; fooBars) writeln(fooBar); same as: foreach (foobar; fooBars) writeln(fooBar); This is

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Johannes Pfau
Am Fri, 21 Sep 2012 11:11:49 +0200 schrieb Jacob Carlborg d...@me.com: On 2012-09-20 21:11, Johannes Pfau wrote: Oh right, I thought that interface was more restrictive. So the only changes necessary in druntime are to adapt to the new compiler interface. The new dmd code is still

Re: Infer function template parameters

2012-09-21 Thread deadalnix
I'll add that delegate literals already allow a similar syntax, so, for consistency reasons, this is something that make sense.

Re: Infer function template parameters

2012-09-21 Thread Jonathan M Davis
On Friday, September 21, 2012 13:14:56 Jonas Drewsen wrote: Maybe I wasn't clear in my suggestion. The new syntax in simply a way to define a templated function - not a non-templated one ie: auto foo(a,b) {} is exactly the same as auto foo(A,B)(A a, B b) {} So all it does is save you a few

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jens Mueller
Johannes Pfau wrote: Am Fri, 21 Sep 2012 11:11:49 +0200 schrieb Jacob Carlborg d...@me.com: On 2012-09-20 21:11, Johannes Pfau wrote: Oh right, I thought that interface was more restrictive. So the only changes necessary in druntime are to adapt to the new compiler interface.

Re: [OT] Was: totally satisfied :D

2012-09-21 Thread Steven Schveighoffer
On Thu, 20 Sep 2012 17:16:14 -0400, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: On Thu, 20 Sep 2012 08:46:00 -0400 Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 19 Sep 2012 17:05:35 -0400, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: There's also a

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jacob Carlborg
On 2012-09-21 14:19, Jens Mueller wrote: Why do you need filename and line information of a unittest. If a unittest fails you'll get the relevant information. Why do you want the information when a unittest succeeded? I only care about failed unittests. A count of the number of executed

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-21 Thread monarch_dodra
On Thursday, 20 September 2012 at 11:10:43 UTC, Jonathan M Davis wrote: [SNIP] - Jonathan M Davis #1 Hey, I've been working on this (locally): I've made all the PRNGs reference ranges. It actually works perfectly. I took the ensure initialized route, as you suggested. I was able to take an

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread bearophile
Andrei Alexandrescu: I've met Matt Goldbolt, the author of the GCC Explorer at http://gcc.godbolt.org - a very handy online disassembler for GCC. We got to talk a bit about D and he hacked together support for D by using gdc. Take a look at http://d.godbolt.org, I think it's pretty darn

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-21 Thread Timon Gehr
On 09/21/2012 10:29 AM, deadalnix wrote: Le 21/09/2012 01:13, Timon Gehr a écrit : You could post an enhancement request to allow interpretation of incompletely-analyzed functions, if you think it is of any use. I predict tricky implementation. This depends on the existing code base. It is

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread bearophile
I'd like a way to filter the output to the disassembly of just one (or few) functions, because otherwise the output risks being too much large. It seems even this program produces a too much long asm listing for the site: import std.stdio; void main() { writeln(%f, 1.5); } Bye,

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-21 Thread Timon Gehr
On 09/21/2012 12:23 PM, Jens Mueller wrote: Timon Gehr wrote: ... The issue is that CTFE can only interpret functions that are fully analyzed and therefore the analysis of foo depends circularly on itself. The compiler should spit out an error that indicates the issue. That is true. I will

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread bearophile
It seems even this program produces a too much long asm listing for the site: import std.stdio; void main() { writeln(%f, 1.5); } Compiled with: -O0 -march=native Bye, bearophile

Re: [OT] Was: totally satisfied :D

2012-09-21 Thread Paulo Pinto
On Thursday, 20 September 2012 at 21:15:24 UTC, Nick Sabalausky wrote: On Thu, 20 Sep 2012 08:46:00 -0400 Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 19 Sep 2012 17:05:35 -0400, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: On Wed, 19 Sep 2012 10:11:50 -0400

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jens Mueller
Jacob Carlborg wrote: On 2012-09-21 14:19, Jens Mueller wrote: Why do you need filename and line information of a unittest. If a unittest fails you'll get the relevant information. Why do you want the information when a unittest succeeded? I only care about failed unittests. A count of the

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Manu
On 21 September 2012 07:17, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 9/20/12 10:05 AM, Manu wrote: Memory locality is often the biggest contributing performance hazard in many algorithms, and usually the most unpredictable. I want to know about that in my measurements.

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread Iain Buclaw
On 21 September 2012 14:49, bearophile bearophileh...@lycos.com wrote: It seems even this program produces a too much long asm listing for the site: import std.stdio; void main() { writeln(%f, 1.5); } Compiled with: -O0 -march=native Bye, bearophile Curse those templates. ;-)

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread David Piepgrass
However, what's truly insane IMHO is continuing to run a unittest block after it's already had a failure in it. Unless you have exceedingly simplistic unit tests, the failures after the first one mean pretty much _nothing_ and simply clutter the results. I disagree. Not only are my unit

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Manu
On 21 September 2012 07:30, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I don't quite agree. This is a domain in which intuition is having a hard time, and at least some of the responses come from an intuitive standpoint, as opposed from hard data. For example, there's this

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Manu
On 21 September 2012 07:45, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: As such, you're going to need a far more convincing argument than It worked well for me. Sure. I have just detailed the choices made by std.benchmark in a couple of posts. At Facebook we measure using

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Johannes Pfau
Am Fri, 21 Sep 2012 16:37:37 +0200 schrieb Jens Mueller jens.k.muel...@gmx.de: Jacob Carlborg wrote: On 2012-09-21 14:19, Jens Mueller wrote: Why do you need filename and line information of a unittest. If a unittest fails you'll get the relevant information. Why do you With the recent

Re: Infer function template parameters

2012-09-21 Thread Peter Alexander
On Thursday, 20 September 2012 at 21:04:15 UTC, Timon Gehr wrote: On 09/20/2012 10:52 PM, Peter Alexander wrote: Like it or not, templates still cause a lot of code bloat, complicate linking, cannot be virtual, increase compilation resources, and generate difficult to understand messages. They

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Johannes Pfau
Am Fri, 21 Sep 2012 11:25:10 +0200 schrieb Jacob Carlborg d...@me.com: On 2012-09-20 23:14, Jonathan M Davis wrote: Running more unittest blocks after a failure is similarly flawed, but at least in that case, you know that had a failure earlier in the module, which should then tell you

Re: Infer function template parameters

2012-09-21 Thread Steven Schveighoffer
On Thu, 20 Sep 2012 15:57:47 -0400, Jonas Drewsen jdrew...@nospam.com wrote: In foreach statements the type can be inferred: foreach (MyFooBar fooBar; fooBars) writeln(fooBar); same as: foreach (foobar; fooBars) writeln(fooBar); This is nice and tidy. Wouldn't it make sense to allow the

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Tobias Pankrath
I'm actually kinda surprised the feedback on this is rather negative. I thought running unit tests individually and printing line/file/name was requested quite often? I want to have this. My workflow is: Run all tests0(run all). If some fail, see if there might be a common reason (so don't

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-21 Thread monarch_dodra
On Friday, 21 September 2012 at 13:19:55 UTC, monarch_dodra wrote: QUESTION: If I (were to) deprecate save, how would that work with the range traits type? If a range has save, but it is deprecated, does it answer true to isForwardRange? Never mind I found out the answer: Using something

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/21/12 10:58 AM, Manu wrote: What I'm typically more interested in is profiling. I do occasionally need to do some benchmarking by your definition, so I'll find this useful, but should there then be another module to provide a 'profiling' API? Also worked into this API? That's a good

GC.malloc problems with the DMD

2012-09-21 Thread Raphael Basso
Hello I'm porting my connection library to Firebird database for the D language, and I'm having problems with Access Violation using DMD (did some testing and this problem does not occur with GDC). This code is based on a simple C implementation, and it works ok in VC++ and GCC): [code]

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jacob Carlborg
On 2012-09-21 16:37, Jens Mueller wrote: If there are use cases I agree. I do not know one. The question whether there are *tools* that report in case of success is easier to verify. Do you know any tool that does reporting in case success? I think gtest does not do it. I'm not sure about

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jacob Carlborg
On 2012-09-21 17:32, Johannes Pfau wrote: Well, I think we should just leave the basic unittest runner in druntime unchanged. There are unittests in phobos which depend on that behavior. Yeah, this was more a philosophical discussion. Other projects can use a custom test runner like Jens

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Johannes Pfau
Am Fri, 21 Sep 2012 19:15:13 +0200 schrieb Jacob Carlborg d...@me.com: On 2012-09-21 17:32, Johannes Pfau wrote: Well, I think we should just leave the basic unittest runner in druntime unchanged. There are unittests in phobos which depend on that behavior. Yeah, this was more a

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Jacob Carlborg
On 2012-09-21 18:21, Andrei Alexandrescu wrote: That's a good angle. Profiling is currently done by the -profile switch, and there are a couple of library functions associated with it. To my surprise, that documentation page has not been ported to the dlang.org style:

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread Ellery Newcomer
On 09/21/2012 03:04 AM, Jens Mueller wrote: But it's nice to have source code and assembly side by side. Jens And very nice to have demangled names in assembly.

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jacob Carlborg
On 2012-09-21 20:01, Johannes Pfau wrote: I didn't think of setAssertHandler. My changes are perfectly compatible with it. IIRC setAssertHandler has the small downside that it's used for all asserts, not only those used in unit tests? I'm not sure if that's a drawback or actually useful.

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Johannes Pfau
Am Fri, 21 Sep 2012 00:45:44 -0400 schrieb Andrei Alexandrescu seewebsiteforem...@erdani.org: The issue here is automating the benchmark of a module, which would require some naming convention anyway. A perfect use case for user defined attributes ;-) @benchmark void foo(){} @benchmark(File

Re: Infer function template parameters

2012-09-21 Thread jerro
Although I like it, I wonder if it works in D's context free grammar. Timon probably would know best... I came up with this code, which compiles today: import std.stdio; alias int x; void foo(x) {} void foo2(string x) {writeln(x);} void main() { foo(1); foo2(hello); } Under your

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Jacob Carlborg
On 2012-09-21 19:45, Johannes Pfau wrote: A perfect use case for user defined attributes ;-) @benchmark void foo(){} @benchmark(File read test) void foo(){} Yes, we need user defined attributes and AST macros ASAP :) -- /Jacob Carlborg

Re: Review of Andrei's std.benchmark

2012-09-21 Thread David Piepgrass
After extensive tests with a variety of aggregate functions, I can say firmly that taking the minimum time is by far the best when it comes to assessing the speed of a function. Like others, I must also disagree in princple. The minimum sounds like a useful metric for functions that (1) do

Re: Review of Andrei's std.benchmark

2012-09-21 Thread jerro
As far as I know, D doesn't offer a sampling profiler, It is possible to use a sampling profiler on D executables though. I usually use perf on Linux and AMD CodeAnalyst on Windows.

Re: [OT] Was: totally satisfied :D

2012-09-21 Thread H. S. Teoh
On Fri, Sep 21, 2012 at 03:54:21PM +0200, Paulo Pinto wrote: [...] In big corporations you spend more time taking care of existing projects in big teams, than developing stuff from scratch. In these type of environments you learn to appreciate the verbosity of certain programming languages,

Re: Infer function template parameters

2012-09-21 Thread Jonas Drewsen
On Friday, 21 September 2012 at 11:40:54 UTC, Jonathan M Davis wrote: On Friday, September 21, 2012 13:14:56 Jonas Drewsen wrote: Maybe I wasn't clear in my suggestion. The new syntax in simply a way to define a templated function - not a non-templated one ie: auto foo(a,b) {} is exactly the

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Manu
On 21 September 2012 07:23, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: For a very simple reason: unless the algorithm under benchmark is very long-running, max is completely useless, and it ruins average as well. This is only true for systems with a comprehensive pre-emptive OS

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Jonathan M Davis
On Friday, September 21, 2012 17:58:05 Manu wrote: Okay, I can buy this distinction in terminology. What I'm typically more interested in is profiling. I do occasionally need to do some benchmarking by your definition, so I'll find this useful, but should there then be another module to

Re: Infer function template parameters

2012-09-21 Thread Jonas Drewsen
On Friday, 21 September 2012 at 15:04:14 UTC, Steven Schveighoffer wrote: On Thu, 20 Sep 2012 15:57:47 -0400, Jonas Drewsen jdrew...@nospam.com wrote: In foreach statements the type can be inferred: foreach (MyFooBar fooBar; fooBars) writeln(fooBar); same as: foreach (foobar; fooBars)

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-21 Thread Jonathan M Davis
On Friday, September 21, 2012 15:20:49 monarch_dodra wrote: #3 The only thing I'm having an issue with is save. IMO, it is exceptionally dangerous to have a PRNG be a ForwardRange: It should only be saved if you have a damn good reason to do so. You can still dup if you want (manually) (if

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/19/12 4:12 AM, Thiez wrote: On Tuesday, 18 September 2012 at 22:01:30 UTC, Andrei Alexandrescu wrote: After extensive tests with a variety of aggregate functions, I can say firmly that taking the minimum time is by far the best when it comes to assessing the speed of a function. What if

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/19/12 4:06 AM, Peter Alexander wrote: I don't see why `benchmark` takes (almost) all of its parameters as template parameters. It looks quite odd, seems unnecessary, and (if I'm not mistaken) makes certain use cases quite difficult. That is intentional - indirect calls would add undue

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/19/12 3:54 PM, Jacob Carlborg wrote: On 2012-09-19 11:38, Peter Alexander wrote: The problem with slowest is that you end up with the occasional OS hiccup or GC collection which throws the entire benchmark off. I see your point, but unless you can prevent the OS from interrupting, the

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/19/12 4:11 PM, Øivind wrote: New question for you :) To register benchmarks, the 'scheduleForBenchmarking' mixin inserts a shared static initializer into the module. If I have a module A and a module B, that both depend on eachother, than this will probably not work..? The runtime will

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/19/12 3:59 PM, Graham Fawcett wrote: For comparison's sake, the Criterion benchmarking package for Haskell is worth a look: http://www.serpentine.com/blog/2009/09/29/criterion-a-new-benchmarking-library-for-haskell/ Criterion accounts for clock-call costs, displays various central

Re: LDC blacklisted in Ubuntu

2012-09-21 Thread Joseph Rushton Wakeling
On 20/09/12 19:04, David Nadlinger wrote: On Thursday, 20 September 2012 at 17:26:25 UTC, Joseph Rushton Wakeling wrote: Some rather urgent news: LDC has just been blacklisted in Ubuntu. It is not really news, as the LDC version in the Debian repo has not been updated for ages. It's not

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/20/12 3:42 AM, Manu wrote: On 19 September 2012 12:38, Peter Alexander peter.alexander...@gmail.com mailto:peter.alexander...@gmail.com wrote: The fastest execution time is rarely useful to me, I'm almost always much more interested in the slowest execution time.

Re: [OT] Was: totally satisfied :D

2012-09-21 Thread Paulo Pinto
On Friday, 21 September 2012 at 19:09:48 UTC, H. S. Teoh wrote: On Fri, Sep 21, 2012 at 03:54:21PM +0200, Paulo Pinto wrote: [...] In big corporations you spend more time taking care of existing projects in big teams, than developing stuff from scratch. In these type of environments you learn

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Dmitry Olshansky
On 21-Sep-12 22:49, David Piepgrass wrote: After extensive tests with a variety of aggregate functions, I can say firmly that taking the minimum time is by far the best when it comes to assessing the speed of a function. As far as I know, D doesn't offer a sampling profiler, so one might

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Dmitry Olshansky
I'd throw in a request to address the following. Suppose we have a function F and a set of inputs S that are supposedly different scenarios we optimize for. What is interesting is to benchmark all of F(S[i]) as |S| separate functions greatly saving on boilerplate (and helping readability).

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Jonathan M Davis
On Friday, September 21, 2012 15:59:31 Andrei Alexandrescu wrote: On 9/19/12 4:11 PM, Øivind wrote: New question for you :) To register benchmarks, the 'scheduleForBenchmarking' mixin inserts a shared static initializer into the module. If I have a module A and a module B, that both

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jens Mueller
Johannes Pfau wrote: Am Fri, 21 Sep 2012 16:37:37 +0200 schrieb Jens Mueller jens.k.muel...@gmx.de: Jacob Carlborg wrote: On 2012-09-21 14:19, Jens Mueller wrote: Why do you need filename and line information of a unittest. If a unittest fails you'll get the relevant

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jens Mueller
Jacob Carlborg wrote: On 2012-09-21 16:37, Jens Mueller wrote: If there are use cases I agree. I do not know one. The question whether there are *tools* that report in case of success is easier to verify. Do you know any tool that does reporting in case success? I think gtest does not do

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/21/12 5:39 AM, Jacob Carlborg wrote: On 2012-09-21 06:23, Andrei Alexandrescu wrote: For a very simple reason: unless the algorithm under benchmark is very long-running, max is completely useless, and it ruins average as well. I may have completely misunderstood this but aren't we

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/21/12 11:12 AM, Manu wrote: On 21 September 2012 07:45, Andrei Alexandrescu seewebsiteforem...@erdani.org mailto:seewebsiteforem...@erdani.org wrote: As such, you're going to need a far more convincing argument than It worked well for me. Sure. I have just detailed

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Dmitry Olshansky
On 21-Sep-12 23:59, Andrei Alexandrescu wrote: On 9/19/12 4:11 PM, Øivind wrote: New question for you :) To register benchmarks, the 'scheduleForBenchmarking' mixin inserts a shared static initializer into the module. If I have a module A and a module B, that both depend on eachother, than

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/21/12 11:14 AM, Manu wrote: On 21 September 2012 07:23, Andrei Alexandrescu seewebsiteforem...@erdani.org mailto:seewebsiteforem...@erdani.org wrote: For a very simple reason: unless the algorithm under benchmark is very long-running, max is completely useless, and it ruins average

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jens Mueller
Tobias Pankrath wrote: I'm actually kinda surprised the feedback on this is rather negative. I thought running unit tests individually and printing line/file/name was requested quite often? I want to have this. My workflow is: Run all tests0(run all). If some fail, see if there might be

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jens Mueller
Jacob Carlborg wrote: On 2012-09-21 20:01, Johannes Pfau wrote: I didn't think of setAssertHandler. My changes are perfectly compatible with it. IIRC setAssertHandler has the small downside that it's used for all asserts, not only those used in unit tests? I'm not sure if that's a drawback

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/21/12 2:49 PM, David Piepgrass wrote: After extensive tests with a variety of aggregate functions, I can say firmly that taking the minimum time is by far the best when it comes to assessing the speed of a function. Like others, I must also disagree in princple. The minimum sounds like a

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-21 Thread Jens Mueller
David Piepgrass wrote: However, what's truly insane IMHO is continuing to run a unittest block after it's already had a failure in it. Unless you have exceedingly simplistic unit tests, the failures after the first one mean pretty much _nothing_ and simply clutter the results. I

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread Jens Mueller
Ellery Newcomer wrote: On 09/21/2012 03:04 AM, Jens Mueller wrote: But it's nice to have source code and assembly side by side. Jens And very nice to have demangled names in assembly. You can pipe your assembly code to ddemangle if there is some other tool that missing demangling. I did

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Jens Mueller
Andrei Alexandrescu wrote: On 9/21/12 5:39 AM, Jacob Carlborg wrote: On 2012-09-21 06:23, Andrei Alexandrescu wrote: For a very simple reason: unless the algorithm under benchmark is very long-running, max is completely useless, and it ruins average as well. I may have completely

Re: [OT] Was: totally satisfied :D

2012-09-21 Thread Nick Sabalausky
On Fri, 21 Sep 2012 08:24:07 -0400 Steven Schveighoffer schvei...@yahoo.com wrote: That works too, but doesn't warrant rants about how you haven't learned how to use the fucking thing :) It's *volume* controls, there doesn't need to be *anything* to learn. Try listing out all the

Re: Review of Andrei's std.benchmark

2012-09-21 Thread David Piepgrass
Some random comments about std.benchmark based on its documentation: - It is very strange that the documentation of printBenchmarks uses neither of the words average or minimum, and doesn't say how many trials are done Because all of those are irrelevant and confusing. Huh? It's not

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-21 Thread monarch_dodra
On Friday, 21 September 2012 at 19:47:16 UTC, Jonathan M Davis wrote: On Friday, September 21, 2012 15:20:49 monarch_dodra wrote: #3 The only thing I'm having an issue with is save. IMO, it is exceptionally dangerous to have a PRNG be a ForwardRange: It should only be saved if you have a damn

Re: GDC Explorer - an online disassembler for D

2012-09-21 Thread nazriel
On Friday, 21 September 2012 at 07:40:11 UTC, Andrej Mitrovic wrote: On 9/21/12, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: snip Integrating this with dpaste would be aweee..sooome! http://dpaste.dzfl.pl/news/change-log---v0.82 Those are in plans for all compilers but atm, we

Re: [OT] Was: totally satisfied :D

2012-09-21 Thread Nick Sabalausky
On Fri, 21 Sep 2012 22:13:22 +0200 Paulo Pinto pj...@progtools.org wrote: On Friday, 21 September 2012 at 19:09:48 UTC, H. S. Teoh wrote: The saddest thing is that people are paying big bucks for this kind of enterprise code. It's one of those things that make me never want to pay

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Andrei Alexandrescu
On 9/21/12 5:36 PM, David Piepgrass wrote: Some random comments about std.benchmark based on its documentation: - It is very strange that the documentation of printBenchmarks uses neither of the words average or minimum, and doesn't say how many trials are done Because all of those are

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Peter Alexander
On Friday, 21 September 2012 at 19:54:12 UTC, Andrei Alexandrescu wrote: On 9/19/12 4:06 AM, Peter Alexander wrote: I don't see why `benchmark` takes (almost) all of its parameters as template parameters. It looks quite odd, seems unnecessary, and (if I'm not mistaken) makes certain use cases

Re: [OT] Was: totally satisfied :D

2012-09-21 Thread H. S. Teoh
On Fri, Sep 21, 2012 at 05:38:06PM -0400, Nick Sabalausky wrote: On Fri, 21 Sep 2012 22:13:22 +0200 Paulo Pinto pj...@progtools.org wrote: On Friday, 21 September 2012 at 19:09:48 UTC, H. S. Teoh wrote: The saddest thing is that people are paying big bucks for this kind of

Re: Review of Andrei's std.benchmark

2012-09-21 Thread Nick Sabalausky
On Fri, 21 Sep 2012 17:00:29 -0400 Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 9/21/12 11:12 AM, Manu wrote: On 21 September 2012 07:45, Andrei Alexandrescu Currently std.benchmark does not expose raw results for the sake of simplicity. It's easy to expose such, but

Re: Problem with environ variable (Mac OS X)

2012-09-21 Thread Jacob Carlborg
On 2012-09-20 21:34, Chris wrote: Thanks a million, Jacob! I have just tested it with the latest version of dmd and it works. No problem. You can use DVM if you need the to keep the old version of the compiler. https://bitbucket.org/doob/dvm -- /Jacob Carlborg

  1   2   >