Re: Fiber Local Storage

2013-07-25 Thread deadalnix
On Friday, 26 July 2013 at 04:30:18 UTC, Manu wrote: Is there an FLS implementation floating around? If not, it's probably something that should be considered for std.thread. I'd also love to have one ! (in fact I do think it should be the default).

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread Nick Sabalausky
On Fri, 26 Jul 2013 05:39:08 +0200 "SomeDude" wrote: > On Friday, 26 July 2013 at 03:37:46 UTC, SomeDude wrote: > > On Friday, 26 July 2013 at 01:48:36 UTC, Nick Sabalausky wrote: > >> On Fri, 26 Jul 2013 01:14:42 +0200 > > > >> Not to slam Rust or the Rust people, but I wouldn't call that > >>

Re: A proper language comparison...

2013-07-25 Thread Walter Bright
On 7/25/2013 7:19 PM, bearophile wrote: You don't want a stack overflow in the code that controls your car brakes (this is not a totally invented example). Sadly, it isn't: http://www.forbes.com/sites/andygreenberg/2013/07/24/hackers-reveal-nasty-new-car-attacks-with-me-behind-the-wheel-video

Re: Are we getting better at designing programming languages?

2013-07-25 Thread H. S. Teoh
On Fri, Jul 26, 2013 at 06:36:21AM +0200, Kagamin wrote: > On Tuesday, 23 July 2013 at 18:14:10 UTC, Ali Çehreli wrote: > >First of all, C does not have exceptions so every single thing > >must be done as two lines: > > > >err = do_something(); > >goto_finally_if_error(err); > > Huh, never

Re: Fiber Local Storage

2013-07-25 Thread Vladimir Panteleev
On Friday, 26 July 2013 at 04:30:18 UTC, Manu wrote: Is there an FLS implementation floating around? If not, it's probably something that should be considered for std.thread. Maybe something like this: -- private struct FLSEntry { void** ptr; size_t st

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread Nick Sabalausky
On Fri, 26 Jul 2013 05:37:41 +0200 "SomeDude" wrote: > On Friday, 26 July 2013 at 01:48:36 UTC, Nick Sabalausky wrote: > > On Fri, 26 Jul 2013 01:14:42 +0200 > > > Not to slam Rust or the Rust people, but I wouldn't call that > > an example > > of "class" so much as "new age nazi": where everyt

Re: Are we getting better at designing programming languages?

2013-07-25 Thread Kagamin
On Tuesday, 23 July 2013 at 18:14:10 UTC, Ali Çehreli wrote: First of all, C does not have exceptions so every single thing must be done as two lines: err = do_something(); goto_finally_if_error(err); Huh, never seen such pattern in C. I just return error code.

Re: Compile-time optimization

2013-07-25 Thread JS
Thanks.. I am working on getting the code to work with unrolling an array: module main; import std.stdio, std.traits; template tuple(args...) { alias tuple = args; } template tUnrollArray(args...) { static if (isArray!(typeof(args))) { pragma(msg, "isarray

Fiber Local Storage

2013-07-25 Thread Manu
Is there an FLS implementation floating around? If not, it's probably something that should be considered for std.thread.

Re: A proper language comparison...

2013-07-25 Thread Walter Bright
On 7/25/2013 8:39 PM, H. S. Teoh wrote: How would a D program recover from stack overflow? The program doesn't. In a safe system, there'd be a backup in case the main program failed (which it inevitably will). Isn't it possible to allocate the stack at the far end of the program's address s

Re: A proper language comparison...

2013-07-25 Thread H. S. Teoh
On Thu, Jul 25, 2013 at 07:39:15PM -0700, Walter Bright wrote: > On 7/25/2013 7:19 PM, bearophile wrote: > >If you allocate too much data on the stack this could cause stack > >overflow. As you say a stack overflow is memory safe, but if your > >program is doing something important, a sudden crash

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread SomeDude
On Friday, 26 July 2013 at 01:48:36 UTC, Nick Sabalausky wrote: On Fri, 26 Jul 2013 01:14:42 +0200 Not to slam Rust or the Rust people, but I wouldn't call that an example of "class" so much as "new age nazi": where everything is incontrovertibly wonderful in it's own special way and any opi

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread SomeDude
On Friday, 26 July 2013 at 03:37:46 UTC, SomeDude wrote: On Friday, 26 July 2013 at 01:48:36 UTC, Nick Sabalausky wrote: On Fri, 26 Jul 2013 01:14:42 +0200 Not to slam Rust or the Rust people, but I wouldn't call that an example of "class" so much as "new age nazi": where everything is incon

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread deadalnix
On Friday, 26 July 2013 at 02:51:57 UTC, Walter Bright wrote: On 7/25/2013 6:48 PM, Nick Sabalausky wrote: Not to slam Rust or the Rust people, but I wouldn't call that an example of "class" so much as "new age nazi": where everything is incontrovertibly wonderful in it's own special way and an

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread Walter Bright
On 7/25/2013 6:48 PM, Nick Sabalausky wrote: Not to slam Rust or the Rust people, but I wouldn't call that an example of "class" so much as "new age nazi": where everything is incontrovertibly wonderful in it's own special way and any opinion contrary to that is categorically invalid and not to b

Re: xdc: A hypothetical D cross-compiler and AST manipulation tool.

2013-07-25 Thread Chad Joan
On Thursday, 25 July 2013 at 20:28:31 UTC, Tofu Ninja wrote: If you started a kick starter, I would put some money up, the problem with it is I am not sure you could get enough contributions for something like this unless the whole D community got behind it. Cool, thanks! I'm willing to th

Re: A proper language comparison...

2013-07-25 Thread Walter Bright
On 7/25/2013 7:19 PM, bearophile wrote: If you allocate too much data on the stack this could cause stack overflow. As you say a stack overflow is memory safe, but if your program is doing something important, a sudden crash could be regarded as dangerous for the user. You don't want a stack over

Re: A proper language comparison...

2013-07-25 Thread bearophile
Walter Bright: It's done by the hardware (putting a "no-access" page at the end of the stack). There's nothing unsafe about it. no variable-sized stack-allocated arrays that help a bit created bounded collections, I don't see how that is a safety issue. In my opinion where you allocate y

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread Nick Sabalausky
On Fri, 26 Jul 2013 01:14:42 +0200 "SomeDude" wrote: > On Wednesday, 24 July 2013 at 06:20:11 UTC, Andrei Alexandrescu > wrote: > > On 7/23/13 9:23 PM, Walter Bright wrote: > >>> reddit link: > >>> http://www.reddit.com/r/programming/comments/1ixnf6/benchmarking_roguelike_level_generation_go_rus

Re: A proper language comparison...

2013-07-25 Thread Manfred Nowak
"qznc" wrote in news:buxislkfauizlnrvo...@forum.dlang.org: > until your favorite language is the winner. This is a wrong path. The winner should be found by weighting the results in such a way that all tested languages are at least close to equal. If such equality can be achieved by some cano

Re: A proper language comparison...

2013-07-25 Thread Walter Bright
On 7/25/2013 1:28 PM, bearophile wrote: there is no significant stack overflow protection, It's done by the hardware (putting a "no-access" page at the end of the stack). There's nothing unsafe about it. no variable-sized stack-allocated arrays that help a bit created bounded collections,

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread SomeDude
On Wednesday, 24 July 2013 at 06:20:11 UTC, Andrei Alexandrescu wrote: On 7/23/13 9:23 PM, Walter Bright wrote: reddit link: http://www.reddit.com/r/programming/comments/1ixnf6/benchmarking_roguelike_level_generation_go_rust/ Please post your comment here to Reddit! Did. I tried to provide p

Re: A proper language comparison...

2013-07-25 Thread Peter Alexander
On Thursday, 25 July 2013 at 20:28:54 UTC, bearophile wrote: Peter Alexander: - What's safe and unsafe is very subjective. There are large bodies of people that count bugs in code, and correlate them with coding practices. They have created language subsets like C for automotive industry, C

Re: Article

2013-07-25 Thread Joseph Rushton Wakeling
On Thursday, 25 July 2013 at 20:26:19 UTC, Vladimir Panteleev wrote: On Thursday, 25 July 2013 at 17:51:45 UTC, Joseph Rushton Wakeling wrote: My blog doesn't show up there, despite my D-related articles being tagged. It does now! Thanks! :-) Then again I never asked a

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread Iain Buclaw
On Jul 25, 2013 1:10 AM, "Jonathan M Davis" wrote: > > On Thursday, July 25, 2013 01:29:04 John Colvin wrote: > > And @safe is automatically inferred (on templates only still?) > > when possible? I don't like where this is going... > > If you have code that you want to be explictly @system, then m

Re: A proper language comparison...

2013-07-25 Thread bearophile
Peter Alexander: - What's safe and unsafe is very subjective. There are large bodies of people that count bugs in code, and correlate them with coding practices. They have created language subsets like C for automotive industry, C++ for aviation, code for space missions, Ada language and it

Re: xdc: A hypothetical D cross-compiler and AST manipulation tool.

2013-07-25 Thread Tofu Ninja
On Thursday, 18 July 2013 at 01:21:44 UTC, Chad Joan wrote: Would you pay for this? If so, then I might be able to do a kickstarter at some point. I am not independently wealthy or retired (or both?) like Walter, nor am I able to survive on zero hours of sleep each night like Andrei, and this w

Re: Article

2013-07-25 Thread Vladimir Panteleev
On Thursday, 25 July 2013 at 17:51:45 UTC, Joseph Rushton Wakeling wrote: My blog doesn't show up there, despite my D-related articles being tagged. It does now! ...or it would, if the DSource server would actually accept the files my server tried to upload. It's tempera

Re: A proper language comparison...

2013-07-25 Thread Peter Alexander
On Thursday, 25 July 2013 at 18:23:19 UTC, Xinok wrote: These are the type of comparisons I'd like to see with programming languages. For starters, there should be standard "challenges" (algorithms and such) implemented in each language designed to measure various aspects of the language, such

Re: A proper language comparison...

2013-07-25 Thread qznc
On Thursday, 25 July 2013 at 18:23:19 UTC, Xinok wrote: Once in a while, a thread pops up in the newsgroups pitting D against some other language. More often than not, these comparisons are flawed, non-encompassing, and uninformative. Most recently with the article comparing D with Go and Rust,

Re: xdc: A hypothetical D cross-compiler and AST manipulation tool.

2013-07-25 Thread Kagamin
It's probably C11. It allows only enlarging the alignment, because it's not cross-platform the other way.

Re: A proper language comparison...

2013-07-25 Thread Brad Anderson
On Thursday, 25 July 2013 at 18:23:19 UTC, Xinok wrote: Once in a while, a thread pops up in the newsgroups pitting D against some other language. More often than not, these comparisons are flawed, non-encompassing, and uninformative. Most recently with the article comparing D with Go and Rust,

A proper language comparison...

2013-07-25 Thread Xinok
Once in a while, a thread pops up in the newsgroups pitting D against some other language. More often than not, these comparisons are flawed, non-encompassing, and uninformative. Most recently with the article comparing D with Go and Rust, the community pointed out a few flaws involving a late

Re: Article

2013-07-25 Thread Andrei Alexandrescu
On 7/25/13 10:28 AM, Mike Parker wrote: On Thursday, 25 July 2013 at 15:20:03 UTC, Chris wrote: Ah no, no reason, except that Walter might want to put it somewhere on the D homepage, if it is interestig enough. It's for the whole community and those who are interested in D. And I don't know whe

Re: FAQs

2013-07-25 Thread Adam D. Ruppe
Another one that should be added is a pro/con list for shared std libs.

Re: Article

2013-07-25 Thread Walter Bright
On 7/25/2013 6:46 AM, Chris wrote: I have (finally) written an article about how D helped to solve a practical programming problem. Nothing special, it focuses on the solution more than on language design / philosophy or benchmarking, the usual suspects. I would like to send it to Walter for comm

Re: Article

2013-07-25 Thread Joseph Rushton Wakeling
On Thursday, 25 July 2013 at 17:05:51 UTC, Dicebot wrote: On Thursday, 25 July 2013 at 16:26:14 UTC, Peter Alexander wrote: Well, the usual approach is to put it on a blog. There's a number of free services for that: http://www.blogger.com/ http://wordpress.com/ https://www.tumblr.com/ ..and

Re: Article

2013-07-25 Thread Mike Parker
On Thursday, 25 July 2013 at 15:20:03 UTC, Chris wrote: Ah no, no reason, except that Walter might want to put it somewhere on the D homepage, if it is interestig enough. It's for the whole community and those who are interested in D. And I don't know where to put it online. Any advice? game

Re: Compile-time optimization

2013-07-25 Thread H. S. Teoh
On Thu, Jul 25, 2013 at 07:57:30AM -0700, H. S. Teoh wrote: > On Thu, Jul 25, 2013 at 03:47:23PM +0200, JS wrote: [...] > > Allow for array reduction and delim/indexing. When using join we > > typically want to join an array of strings while also inserting a > > delimiter between them... usually wi

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread Joseph Rushton Wakeling
On Thursday, 25 July 2013 at 11:22:47 UTC, monarch_dodra wrote: Is this a big problem performance wise though? I mean, the bug was *only* that the first few iteration were "not so random", is this correct? This fix didn't really change the computational cost of the operation, did it? Re the b

Re: Article

2013-07-25 Thread Dicebot
On Thursday, 25 July 2013 at 16:26:14 UTC, Peter Alexander wrote: Well, the usual approach is to put it on a blog. There's a number of free services for that: http://www.blogger.com/ http://wordpress.com/ https://www.tumblr.com/ ..and if "D" tag is used, it will soon become plugged into Plane

Re: Article

2013-07-25 Thread Peter Alexander
On Thursday, 25 July 2013 at 15:20:03 UTC, Chris wrote: On Thursday, 25 July 2013 at 15:11:34 UTC, Peter Alexander Any reason we can't all comment on it? :-) Ah no, no reason, except that Walter might want to put it somewhere on the D homepage, if it is interestig enough. It's for the whole

Re: Article

2013-07-25 Thread Wyatt
On Thursday, 25 July 2013 at 15:20:03 UTC, Chris wrote: I don't know where to put it online. Any advice? Well, you could post it here-- we're not strangers to enormous walls of text. ;) Where it goes from there is a community effort. Or if you think there are irreconcilable formatting need

Re: Article

2013-07-25 Thread H. S. Teoh
On Thu, Jul 25, 2013 at 05:20:01PM +0200, Chris wrote: > On Thursday, 25 July 2013 at 15:11:34 UTC, Peter Alexander wrote: > >On Thursday, 25 July 2013 at 13:46:07 UTC, Chris wrote: > >>I have (finally) written an article about how D helped to solve > >>a practical programming problem. Nothing spec

Re: Unable to install latest DMD from D-Apt

2013-07-25 Thread Rene Zwanenburg
Okay great. Thanks again for your help. On Thursday, 25 July 2013 at 15:01:59 UTC, H. S. Teoh wrote: For best results, replace all occurrences of "squeeze" with "stable" (and remove the line you added, since it will be identical with one of the previous lines). That way, it will automatically

Re: Article

2013-07-25 Thread Chris
On Thursday, 25 July 2013 at 15:11:34 UTC, Peter Alexander wrote: On Thursday, 25 July 2013 at 13:46:07 UTC, Chris wrote: I have (finally) written an article about how D helped to solve a practical programming problem. Nothing special, it focuses on the solution more than on language design /

Re: Article

2013-07-25 Thread Peter Alexander
On Thursday, 25 July 2013 at 13:46:07 UTC, Chris wrote: I have (finally) written an article about how D helped to solve a practical programming problem. Nothing special, it focuses on the solution more than on language design / philosophy or benchmarking, the usual suspects. I would like to sen

Re: Unable to install latest DMD from D-Apt

2013-07-25 Thread H. S. Teoh
On Thu, Jul 25, 2013 at 02:04:17PM +0200, Rene Zwanenburg wrote: > That fixed it, thanks! > > One more question about my current sources.list: > > > # deb http://ftp.nl.debian.org/debian/ squeeze main > > deb http://ftp.nl.debian.org/debian/ squeeze main non-free > deb-src http://ftp.nl.deb

Re: Compile-time optimization

2013-07-25 Thread H. S. Teoh
On Thu, Jul 25, 2013 at 03:47:23PM +0200, JS wrote: [...] > Cool, this is definitely on the right track! I like how you are able > to generate the expansion reduction without string mixins(the naive > way I would try and do it). String mixins are sorta like nuclear warheads, a last resort when ab

Article

2013-07-25 Thread Chris
I have (finally) written an article about how D helped to solve a practical programming problem. Nothing special, it focuses on the solution more than on language design / philosophy or benchmarking, the usual suspects. I would like to send it to Walter for comments, if you are interested, Walt

Re: Compile-time optimization

2013-07-25 Thread JS
On Wednesday, 24 July 2013 at 19:52:57 UTC, H. S. Teoh wrote: On Wed, Jul 24, 2013 at 08:12:36PM +0200, JS wrote: T, I've looked over your code and understand what you are doing but I don't understand the expression is(typeof(func(args[0], args[1] you are checking if func(a,b)'s re

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread monarch_dodra
On Thursday, 25 July 2013 at 11:42:10 UTC, Jonathan M Davis wrote: On Thursday, July 25, 2013 08:56:40 monarch_dodra wrote: On Thursday, 25 July 2013 at 00:09:40 UTC, Jonathan M Davis wrote: > On Thursday, July 25, 2013 01:29:04 John Colvin wrote: >> And @safe is automatically inferred (on temp

Re: Unable to install latest DMD from D-Apt

2013-07-25 Thread Rene Zwanenburg
That fixed it, thanks! One more question about my current sources.list: # deb http://ftp.nl.debian.org/debian/ squeeze main deb http://ftp.nl.debian.org/debian/ squeeze main non-free deb-src http://ftp.nl.debian.org/debian/ squeeze main deb http://security.debian.org/ squeeze/updates main

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread Jonathan M Davis
On Thursday, July 25, 2013 08:56:40 monarch_dodra wrote: > On Thursday, 25 July 2013 at 00:09:40 UTC, Jonathan M Davis wrote: > > On Thursday, July 25, 2013 01:29:04 John Colvin wrote: > >> And @safe is automatically inferred (on templates only still?) > >> when possible? I don't like where this is

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread monarch_dodra
On Thursday, 25 July 2013 at 10:52:58 UTC, Joseph Rushton Wakeling wrote: On Thursday, 25 July 2013 at 10:34:56 UTC, Joseph Rushton Wakeling wrote: Just checked the code ... not thoroughly enough. D.d in the GitHub repo is using the same handwritten 32-bit Xorshift as the C and Go code. Is

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread Joseph Rushton Wakeling
On Thursday, 25 July 2013 at 10:34:56 UTC, Joseph Rushton Wakeling wrote: Just checked the code ... not thoroughly enough. D.d in the GitHub repo is using the same handwritten 32-bit Xorshift as the C and Go code.

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread Joseph Rushton Wakeling
On Thursday, 25 July 2013 at 08:13:07 UTC, Joseph Rushton Wakeling wrote: On Wednesday, 24 July 2013 at 11:32:17 UTC, bearophile wrote: Compiling with LDC2 I have found Xorshift about as fast as C rand :-) Minor point, but it may be worth checking the number of bits used in different language

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread John Colvin
On Thursday, 25 July 2013 at 10:00:53 UTC, John Colvin wrote: On Thursday, 25 July 2013 at 00:09:40 UTC, Jonathan M Davis wrote: On Thursday, July 25, 2013 01:29:04 John Colvin wrote: And @safe is automatically inferred (on templates only still?) when possible? I don't like where this is going.

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread John Colvin
On Thursday, 25 July 2013 at 00:09:40 UTC, Jonathan M Davis wrote: On Thursday, July 25, 2013 01:29:04 John Colvin wrote: And @safe is automatically inferred (on templates only still?) when possible? I don't like where this is going... If you have code that you want to be explictly @system, th

Re: DMD performance issues with deeply-recursive templates

2013-07-25 Thread Peter Alexander
On Thursday, 25 July 2013 at 08:17:28 UTC, Peter Alexander wrote: Actually, it's probably caused by the exponential size of template symbol names thanks to mangling of eponymous templates: Sorry, that's a lie. Eponymous templates aren't the problem, the problem is that you are instantiating an

Re: DMD performance issues with deeply-recursive templates

2013-07-25 Thread Peter Alexander
On Thursday, 25 July 2013 at 04:33:59 UTC, H. S. Teoh wrote: From what I can tell from a cursory glance, it's caused by the implementation of cartesianProduct using too many template expansions (esp. in the variadic version of cartesianProduct), causing DMD to run very slowly and eventually exh

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread Joseph Rushton Wakeling
On Wednesday, 24 July 2013 at 11:32:17 UTC, bearophile wrote: Compiling with LDC2 I have found Xorshift about as fast as C rand :-) Minor point, but it may be worth checking the number of bits used in different languages' Xorshifts. For D the default is 128. If others use less (or more) they

Re: Flame bait: D vs. Rust vs. Go Benchmarking

2013-07-25 Thread monarch_dodra
On Thursday, 25 July 2013 at 00:09:40 UTC, Jonathan M Davis wrote: On Thursday, July 25, 2013 01:29:04 John Colvin wrote: And @safe is automatically inferred (on templates only still?) when possible? I don't like where this is going... If you have code that you want to be explictly @system, th