Re: Slow performance compared to C++, ideas?

2013-05-31 Thread finalpatch
I actually don't feel final by default is a big deal at all. Of all the factors that caused the poor performance that was discussed in the original post, final is the least significant one, only caused 5% to %7 of a speed penalty in a heavily recursive and looping program. Because of this I thi

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread Paulo Pinto
Am 01.06.2013 05:08, schrieb Jonathan M Davis: On Friday, May 31, 2013 23:59:45 Juan Manuel Cabo wrote: Making everything final by default would IMO kind of break automated mock classes generation for unit testing, automatic proxy class generation for DB entities, and other OOP niceities. Then

Re: Initializing a fixed sized array

2013-05-31 Thread finalpatch
Oh cool, good to know this has been fixed. You are right, I just verified with DMD 2.063 and the generated code was good! Sorry about the noise. On Saturday, 1 June 2013 at 06:28:45 UTC, Jonathan M Davis wrote: Are you sure that that still allocates? I thought that that had been fixed. If it h

Re: Initializing a fixed sized array

2013-05-31 Thread Jonathan M Davis
On Saturday, June 01, 2013 08:16:47 finalpatch wrote: > This form is nice: > > int[3] x = [1,2,3]; > > But it is horribly inefficient because it > > 1. allocates a dynamic array from the GC > 2. writes 1,2,3 to the dynamic array > 3. copies the 1,2,3 back to the static array Are you sure that t

D Ranges in C#

2013-05-31 Thread David Piepgrass
I'm adding D-style ranges to my new C# collections library. In case anyone would like to comment, please see here: http://loyc-etc.blogspot.ca/2013/06/d-style-ranges-in-c-net.html

Initializing a fixed sized array

2013-05-31 Thread finalpatch
This form is nice: int[3] x = [1,2,3]; But it is horribly inefficient because it 1. allocates a dynamic array from the GC 2. writes 1,2,3 to the dynamic array 3. copies the 1,2,3 back to the static array Or one can write: int[3] x; x[0] = 1; x[1] = 2; x[2] = 3; That is a lot of typing, but a

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread SomeDude
On Saturday, 1 June 2013 at 02:03:07 UTC, Manu wrote: So let's talk about garbage collection, and practical strategies to avoid allocation. Discuss... (or perhaps, "destroooy") Here is my take: http://forum.dlang.org/post/tftjtzmfuauxwcgco...@forum.dlang.org Sorry, I didn't see your new disc

Re: The non allocating D subset

2013-05-31 Thread SomeDude
On Saturday, 1 June 2013 at 05:45:38 UTC, SomeDude wrote: This would make D the truely universal language it was intended to be. This is a large undertaking, but I think there is no technical hurdle preventing it to succeed. IBasically it's only a matter of sweat. In fact I believe it has a m

The non allocating D subset

2013-05-31 Thread SomeDude
In the "Rust based provocation thread", I think Adam Ruppe's work went largely overlooked. He basically created a minimal D that runs on bare metal, proving thus that D can be used fruitfully on small embedded devices in place of C. On Monday, 27 May 2013 at 15:45:04 UTC, Adam D. Ruppe wrote:

Re: Labels as values and threaded-code interpretation

2013-05-31 Thread Manu
GCC has a non-standard extension to do this, I've used it to get great performance wins writing emulators. I love this feature, love to see it in D! On 1 Jun 2013 15:30, "Alex Rønne Petersen" wrote: > Hi, > > I'm sure this has been brought up before, but I feel I need to bring it up > again (beca

Labels as values and threaded-code interpretation

2013-05-31 Thread Alex Rønne Petersen
Hi, I'm sure this has been brought up before, but I feel I need to bring it up again (because I'm going to be writing a threaded-code interpreter): http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html This is an incredibly important extension. The final switch statement is not a replaceme

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Brad Anderson
On Saturday, 1 June 2013 at 04:16:44 UTC, Jonathan M Davis wrote: [snip] The situation is even worse with narrow strings (assuming that put works with them - I'm not sure that it does at the moment) given that even if you knew their length (which you wouldn't if you were going by hasLength), yo

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread deadalnix
On Friday, 31 May 2013 at 19:17:05 UTC, Sean Cavanaugh wrote: On 5/31/2013 4:42 AM, Manu wrote: People already have to type 'override' in every derived class, and they're happy to do that. Requiring to type 'virtual' in the base is hardly an inconvenience by contrast. Actually, it's quite or

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread deadalnix
On Saturday, 1 June 2013 at 02:58:59 UTC, Juan Manuel Cabo wrote: Well, the discussions at dconf convinced me. Certainly, at this point, I think that the only semi-viable excuse for not making functions non-virtual by default is the code breakage that it would cause, and given how surprisingly

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Jonathan M Davis
On Saturday, June 01, 2013 04:47:39 Brad Anderson wrote: > I played around with adding an overload that accepted an output > range to some of the std.string functions identified in my run of > -vgc over phobos[1] (after Jonathan pointed out this is probably > the best approach and is already what f

Re: OT: weary vs wary

2013-05-31 Thread Zach the Mystic
On Friday, 31 May 2013 at 21:35:46 UTC, Nick Sabalausky wrote: Just to be clear (not sure if it came across or not), I was [attempting to] make a joke about "Ahh, you love being corrected? Well then I'll be nice and correct you now! Enjoy, and you're welcome!" Really it's more contradiction tha

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Brad Anderson
On Saturday, 1 June 2013 at 02:47:40 UTC, Brad Anderson wrote: static arrays would need some sort of wrapper to make them output ranges I believe unless it was decided that put() should work by replacing the front and calling popFront for them (which I kind of doubt is the desired behavior).

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread Jonathan M Davis
On Friday, May 31, 2013 23:59:45 Juan Manuel Cabo wrote: > Making everything final by default would IMO kind of break > automated mock classes generation for unit testing, > automatic proxy class generation for DB entities, and > other OOP niceities. Then just mark them all as virtual if you don't

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread Juan Manuel Cabo
On 05/31/2013 10:27 PM, Jonathan M Davis wrote: > On Saturday, June 01, 2013 09:04:50 Manu wrote: >> **applause** >> Someone other than me said it, out loud! >> This is a magnificent day! :) > > Well, the discussions at dconf convinced me. Certainly, at this point, I > think > that the only semi

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread Juan Manuel Cabo
On 05/31/2013 10:27 PM, Jonathan M Davis wrote: > On Saturday, June 01, 2013 09:04:50 Manu wrote: >> **applause** >> Someone other than me said it, out loud! >> This is a magnificent day! :) > > Well, the discussions at dconf convinced me. Certainly, at this point, I > think > that the only semi

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Brad Anderson
On Saturday, 1 June 2013 at 02:16:02 UTC, Adam D. Ruppe wrote: just to toss in my quick thoughts, I wrote a couple comments on the recent reddit thread about using D with a minimal runtime and some of the talk may be relevant here too: http://www.reddit.com/r/programming/comments/1fc9jt/dmd_20

Re: Should we try and make some sort of schedule or todo-list for the next 2.064 release?

2013-05-31 Thread H. S. Teoh
On Sat, Jun 01, 2013 at 04:31:33AM +0200, Joseph Rushton Wakeling wrote: > Another thought for a task: the build scripts. The manual labour > needed to build and install DMD, druntime and Phobos is frustrating. > Ideally it'd be nice to have a solution like LDC, where druntime and > Phobos are git

Re: Should we try and make some sort of schedule or todo-list for the next 2.064 release?

2013-05-31 Thread Joseph Rushton Wakeling
Another thought for a task: the build scripts. The manual labour needed to build and install DMD, druntime and Phobos is frustrating. Ideally it'd be nice to have a solution like LDC, where druntime and Phobos are git submodules and they get built and installed via one simple script (for LDC yo

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Adam D. Ruppe
just to toss in my quick thoughts, I wrote a couple comments on the recent reddit thread about using D with a minimal runtime and some of the talk may be relevant here too: http://www.reddit.com/r/programming/comments/1fc9jt/dmd_2063_the_d_programming_language_reference/ca94mek Some little th

Re: Suggestion: Build windows DMD with MSVC

2013-05-31 Thread Manu
On 1 June 2013 12:02, bearophile wrote: > Manu: > > > Building DMD with MSVC results in a compiler that runs MUCH MUCH faster. >> In the interest of making DMD releases as fast as possible, this should be >> standardised. >> > > How much faster? > And how much time does it take to compile DMD it

Re: Suggestion: Build windows DMD with MSVC

2013-05-31 Thread Joseph Rushton Wakeling
On Friday, 31 May 2013 at 23:32:36 UTC, Manu wrote: Building DMD with MSVC results in a compiler that runs MUCH MUCH faster. ... Numbers? Purely out of academic curiosity, as I'm a GNU/Linux user :-)

Re: Suggestion: Build windows DMD with MSVC

2013-05-31 Thread bearophile
Manu: Building DMD with MSVC results in a compiler that runs MUCH MUCH faster. In the interest of making DMD releases as fast as possible, this should be standardised. How much faster? And how much time does it take to compile DMD itself? I compile DMD almost every day, so I am interested i

Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Manu
So let's talk about garbage collection, and practical strategies to avoid allocation. GC related discussions come up basically every day, perhaps multiple times a day on IRC, and the recent reddit 2.063 release thread is dominated by C++ programmers who are keenly interested in D, but are scared b

Re: Will I try again? and also C header files.

2013-05-31 Thread Rikki Cattermole
On Friday, 31 May 2013 at 07:18:38 UTC, SeanVn wrote: I looked at the D programming language a few years ago and though it was good. Then I ran into trouble. The language was in a state of flux. I would write code and with the next version of D it would no longer work. The same thing was h

Re: OT: weary vs wary

2013-05-31 Thread Tyro[17]
On 5/31/13 4:42 PM, Walter Bright wrote: On 5/31/2013 10:47 AM, David Gileadi wrote: On 5/31/13 10:26 AM, Andrei Alexandrescu wrote: ... I'm a bit weary of ... I keep seeing people use this phrase; shouldn't it be "wary"? Not meaning to pick on you, Andrei; it's just that this time was the t

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread Jonathan M Davis
On Saturday, June 01, 2013 09:04:50 Manu wrote: > **applause** > Someone other than me said it, out loud! > This is a magnificent day! :) Well, the discussions at dconf convinced me. Certainly, at this point, I think that the only semi-viable excuse for not making functions non-virtual by defaul

Re: Suggestion: Build windows DMD with MSVC

2013-05-31 Thread Andrej Mitrovic
On 6/1/13, Manu wrote: > Building DMD with MSVC results in a compiler that runs MUCH MUCH faster. > In the interest of making DMD releases as fast as possible, this should be > standardised. Just one thing: Before attempting to build git-head, the following pull is required: https://github.com/D-

Re: A simple way to do compile time loop unrolling

2013-05-31 Thread finalpatch
Wow! That's so very cool! We can make it even nicer with template Unroll(alias CODE, alias N, alias SEP="") { enum t = replace(CODE, "%", "%1$d"); enum Unroll = iota(N).map!(i => format(t, i)).join(SEP); } And use % as the placeholder instead of the ugly %1$d: mixin(Unroll!("v1[%]*v2[%]

Re: Inability to dup/~ for const arrays of class objects

2013-05-31 Thread Peter Williams
On 31/05/13 23:58, Steven Schveighoffer wrote: On Fri, 31 May 2013 00:48:47 -0400, Peter Williams That makes programming much easier, doesn't it. I'll just avoid it by using: a = a ~ b; instead of: a ~= b; If you care nothing for performance, this certainly is a way to go. where I think

Re: OT: weary vs wary

2013-05-31 Thread Andrei Alexandrescu
On 5/31/13 5:35 PM, Nick Sabalausky wrote: On Fri, 31 May 2013 17:24:38 -0400 Andrei Alexandrescu wrote: On 5/31/13 4:50 PM, Nick Sabalausky wrote: On Fri, 31 May 2013 15:43:51 -0400 Andrei Alexandrescu wrote: On 5/31/13 1:47 PM, David Gileadi wrote: Not meaning to pick on you, Andrei;

Re: OT: weary vs wary

2013-05-31 Thread Andrei Alexandrescu
On 5/31/13 6:53 PM, H. S. Teoh wrote: I love self-contradictory / self-referential jokes... People say I'm indecisive, but I'm not sure about that. -- YHL, CONLANG People tell me that I'm skeptical, but I don't believe it. Not to mention Obama's one: "My job is to be P

Suggestion: Build windows DMD with MSVC

2013-05-31 Thread Manu
Building DMD with MSVC results in a compiler that runs MUCH MUCH faster. In the interest of making DMD releases as fast as possible, this should be standardised.

Re: Should we try and make some sort of schedule or todo-list for the next 2.064 release?

2013-05-31 Thread Brad Roberts
On 5/31/13 3:55 PM, Jonathan M Davis wrote: On Saturday, June 01, 2013 00:29:48 Andrej Mitrovic wrote: On 5/31/13, Andrej Mitrovic wrote: how about we create a table of big tasks on dwiki Thinking about this more, what we'd really need is software that does this. Editing wiki tables is too m

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread Manu
On 1 June 2013 09:15, bearophile wrote: > Manu: > > On 1 June 2013 01:12, bearophile wrote: >> >> Manu: >>> >>> >>> Frankly, this is a textbook example of why STL is the spawn of satan. >>> For >>> some reason people are TAUGHT that it's reasonable to write code like this.

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread bearophile
Manu: On 1 June 2013 01:12, bearophile wrote: Manu: Frankly, this is a textbook example of why STL is the spawn of satan. For some reason people are TAUGHT that it's reasonable to write code like this. There are many kinds of D code, not everything is a high performance ray-tracer

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread Manu
On 1 June 2013 02:32, Jonathan M Davis wrote: > On Friday, May 31, 2013 19:42:55 Manu wrote: > > On 31 May 2013 14:06, deadalnix wrote: > > > On Friday, 31 May 2013 at 02:56:25 UTC, Andrei Alexandrescu wrote: > > >> On 5/30/13 9:26 PM, finalpatch wrote: > > >>> https://dl.dropboxusercontent.**co

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread Manu
On 1 June 2013 01:12, bearophile wrote: > Manu: > > > Frankly, this is a textbook example of why STL is the spawn of satan. For >> some reason people are TAUGHT that it's reasonable to write code like >> this. >> > > There are many kinds of D code, not everything is a high performance > ray-trac

Re: Should we try and make some sort of schedule or todo-list for the next 2.064 release?

2013-05-31 Thread Jonathan M Davis
On Saturday, June 01, 2013 00:29:48 Andrej Mitrovic wrote: > On 5/31/13, Andrej Mitrovic wrote: > > how about we create a table of big tasks on dwiki > > Thinking about this more, what we'd really need is software that does > this. Editing wiki tables is too much work, and it's hard to keep > tra

Re: OT: weary vs wary

2013-05-31 Thread H. S. Teoh
On Fri, May 31, 2013 at 05:35:43PM -0400, Nick Sabalausky wrote: > On Fri, 31 May 2013 17:24:38 -0400 > Andrei Alexandrescu wrote: > > > On 5/31/13 4:50 PM, Nick Sabalausky wrote: > > > On Fri, 31 May 2013 15:43:51 -0400 > > > Andrei Alexandrescu wrote: [...] > > >> On the contrary I love being

Re: Should we try and make some sort of schedule or todo-list for the next 2.064 release?

2013-05-31 Thread Andrej Mitrovic
On 5/31/13, Andrej Mitrovic wrote: > how about we create a table of big tasks on dwiki Thinking about this more, what we'd really need is software that does this. Editing wiki tables is too much work, and it's hard to keep track of certain things (e.g. how much time has passed since someone appli

Re: The stately := operator feature proposal

2013-05-31 Thread Timon Gehr
On 05/31/2013 02:54 PM, Byron Heads wrote: ... The question is which is more optimal for the MRV style of programming // here the compiler can decide the best way to return the two ints, // probably in two registers, maybe even better for inlining (int, int) positionMRV() { return 1, 2; } // h

Re: The stately := operator feature proposal

2013-05-31 Thread Math guy
I don't think it works that way. Yaa, I did exaggerate it a little, and didn't say it properly. What I meant is that if that assignment operator is implemented, I would port my engineering/math libraries I use at my work to D, and try to convince my colleagues to use D with my libraries. All

Re: OT: weary vs wary

2013-05-31 Thread Nick Sabalausky
On Fri, 31 May 2013 17:24:38 -0400 Andrei Alexandrescu wrote: > On 5/31/13 4:50 PM, Nick Sabalausky wrote: > > On Fri, 31 May 2013 15:43:51 -0400 > > Andrei Alexandrescu wrote: > > > >> On 5/31/13 1:47 PM, David Gileadi wrote: > >> > >>> Not meaning to pick on you, Andrei; it's just that this ti

Re: OT: weary vs wary

2013-05-31 Thread Andrei Alexandrescu
On 5/31/13 4:50 PM, Nick Sabalausky wrote: On Fri, 31 May 2013 15:43:51 -0400 Andrei Alexandrescu wrote: On 5/31/13 1:47 PM, David Gileadi wrote: Not meaning to pick on you, Andrei; it's just that this time was the tipping point for the editor in me to kick in :) On the contrary I love bei

Re: minifying the website

2013-05-31 Thread Nick Sabalausky
On Fri, 31 May 2013 23:05:20 +0200 "Aleksandar Ruzicic" wrote: > On Friday, 31 May 2013 at 21:00:05 UTC, Nick Sabalausky wrote: > > On Fri, 31 May 2013 19:50:06 +0200 > > "Adam D. Ruppe" wrote: > >> > >> BTW I suck at apache config and hate doing it > > > > Me, too. I run Nginx on my server the

Re: Aftershock of 2.063 release

2013-05-31 Thread Ellery Newcomer
On 05/31/2013 04:13 AM, Russel Winder wrote: Given the release of 2.063, it would be good to upgrade. Clearly I could download the deb and rpm files and put them in my local repository. However, there is the D APT repository and it seems good to use this instead for Debian. I wonder if it would

Re: Will I try again? and also C header files.

2013-05-31 Thread Rémy Mouëza
Concerning dstep, I compiled it recently (Ubuntu 12.04 32 bits system) and it wasn't as straightforward as it was described in the README file, nor was it that complicated to have it work. I'll outline my experience below for those interested. first step that needed some care was the compila

Re: minifying the website

2013-05-31 Thread Aleksandar Ruzicic
On Friday, 31 May 2013 at 21:00:05 UTC, Nick Sabalausky wrote: On Fri, 31 May 2013 19:50:06 +0200 "Adam D. Ruppe" wrote: BTW I suck at apache config and hate doing it Me, too. I run Nginx on my server these days. One of the things I like about it is that its configuration is so much easier

Re: minifying the website

2013-05-31 Thread Nick Sabalausky
On Fri, 31 May 2013 19:50:06 +0200 "Adam D. Ruppe" wrote: > > BTW I suck at apache config and hate doing it Me, too. I run Nginx on my server these days. One of the things I like about it is that its configuration is so much easier to deal with. It still isn't trivial, and I still have to think

Re: Should we try and make some sort of schedule or todo-list for the next 2.064 release?

2013-05-31 Thread Joseph Rushton Wakeling
On 05/31/2013 10:42 PM, Andrej Mitrovic wrote: > Some big features that come to mind, just off the top of my head (and > these are language-oriented): Redefine random number generators as reference types (monarch_dodra already did a bunch of work in this direction). This needs to be worked out an

Re: OT: weary vs wary

2013-05-31 Thread Nick Sabalausky
On Fri, 31 May 2013 15:43:51 -0400 Andrei Alexandrescu wrote: > On 5/31/13 1:47 PM, David Gileadi wrote: > > > Not meaning to pick on you, Andrei; it's just that this time was the > > tipping point for the editor in me to kick in :) > > On the contrary I love being corrected. > No you don't.

Re: OT: weary vs wary

2013-05-31 Thread Walter Bright
On 5/31/2013 10:47 AM, David Gileadi wrote: On 5/31/13 10:26 AM, Andrei Alexandrescu wrote: ... I'm a bit weary of ... I keep seeing people use this phrase; shouldn't it be "wary"? Not meaning to pick on you, Andrei; it's just that this time was the tipping point for the editor in me to kick

Should we try and make some sort of schedule or todo-list for the next 2.064 release?

2013-05-31 Thread Andrej Mitrovic
The 2.063 release got me thinking, all of those features that were implemented and mentioned in the changelog were basically features which contributors picked to contribute to at a random point in time. While Phobos has a proposal/review/voting process for new modules, other features or changes a

Re: minifying the website

2013-05-31 Thread Aleksandar Ruzicic
On Friday, 31 May 2013 at 19:51:29 UTC, Andrei Alexandrescu wrote: Tried, broke the directory. I recall our admin has disabled .htaccess. Andrei Which hosting company do you guys use? Disabling .htaccess seems too unprofessional.. Anyway, I was under impression that dlang.org is hosted

Re: The stately := operator feature proposal

2013-05-31 Thread monarch_dodra
On Friday, 31 May 2013 at 16:38:48 UTC, Rob T wrote: The := syntax looks just like the += *= ~= syntax, which has completely different meanings, so for some people it will only serve to confuse them more than they already are. BTW D does have instances of multiple ways of doing the same thing

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread Nicolas Guillemot
On Friday, 31 May 2013 at 19:17:05 UTC, Sean Cavanaugh wrote: On 5/31/2013 4:42 AM, Manu wrote: People already have to type 'override' in every derived class, and they're happy to do that. Requiring to type 'virtual' in the base is hardly an inconvenience by contrast. Actually, it's quite or

Re: minifying the website

2013-05-31 Thread Andrei Alexandrescu
On 5/31/13 1:50 PM, Adam D. Ruppe wrote: I'd just upload a file.html.gz (gzip file.html on your own computer) and then try to go to dlang.org/file.html It downloaded the file with name file.html. When opened with an editor, it showed the garbled compressed content. It might just work. If th

Re: OT: weary vs wary

2013-05-31 Thread Steven Schveighoffer
On Fri, 31 May 2013 15:43:51 -0400, Andrei Alexandrescu wrote: On 5/31/13 1:47 PM, David Gileadi wrote: On 5/31/13 10:26 AM, Andrei Alexandrescu wrote: ... I'm a bit weary of ... I keep seeing people use this phrase; shouldn't it be "wary"? 500K hits: https://www.google.com/#safe=off&o

Re: A simple way to do compile time loop unrolling

2013-05-31 Thread Nick Sabalausky
On Fri, 31 May 2013 19:30:10 +0200 "Peter Alexander" wrote: > > > mixin(iota(3).map!(i => format("v[%1$d]+=rhs.v[%1$d];", > i)).join()); Dayamn! I knew CTFE had improved considerably over the last year or so, but even I didn't expect something like that to be working already. That's crazy! :)

Re: OT: weary vs wary

2013-05-31 Thread Andrei Alexandrescu
On 5/31/13 1:47 PM, David Gileadi wrote: On 5/31/13 10:26 AM, Andrei Alexandrescu wrote: ... I'm a bit weary of ... I keep seeing people use this phrase; shouldn't it be "wary"? 500K hits: https://www.google.com/#safe=off&output=search&sclient=psy-ab&q=%22i%27ve+been+weary+of%22&oq=%22i%27v

Re: Slow performance compared to C++, ideas?

2013-05-31 Thread Sean Cavanaugh
On 5/31/2013 4:42 AM, Manu wrote: People already have to type 'override' in every derived class, and they're happy to do that. Requiring to type 'virtual' in the base is hardly an inconvenience by contrast. Actually, it's quite orthogonal. D tends to prefer being explicit. Why bend the rules in

Re: Dynamic array and slices (need Walter and Andrei decision)

2013-05-31 Thread js.mdnq
On Friday, 31 May 2013 at 18:14:57 UTC, Simen Kjaeraas wrote: Interestingly, on Lambda the Ultimate[0] today I found an article[1] that discusses some of this - the Three Laws of Programming: - What you get right, nobody mentions it. - What you get wrong, people bitch about. - What is difficu

Re: minifying the website

2013-05-31 Thread Aleksandar Ruzicic
On Friday, 31 May 2013 at 17:26:16 UTC, Andrei Alexandrescu wrote: On 5/31/13 1:17 PM, w0rp wrote: I recommend YUI Compressor. http://yui.github.io/yuicompressor/ I use it for compressing JavaScript and CSS at my job, and it works very well. (It's also part of a Maven build script at my job, wh

Idea for allocators

2013-05-31 Thread Diggory
So, I've been thinking about a few of the current problems with D: - No allocators on containers - Standard library functions doing too much GC allocation - Escaping pointers to memory not allocated using the GC - Implicit allocation with "~", "~=" and array literals And I came up with something

Re: minifying the website

2013-05-31 Thread Kapps
On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote: Hello, I've been looking through the logs and it looks like the top files in bytes transferred yesterday (even with the deluge of downloads) were a number of Javascript, HTML, and CSS files. There are programs to reduce the

Re: minifying the website

2013-05-31 Thread Vladimir Panteleev
On Friday, 31 May 2013 at 17:26:16 UTC, Andrei Alexandrescu wrote: Thanks. I'm a bit weary of adding Java as a requirement for building. Is that a legitimate concern? I would add it as a separate make target, which is not needed for building the website, but is ran before uploading it to dlan

Re: OT: weary vs wary

2013-05-31 Thread John Colvin
On Friday, 31 May 2013 at 17:47:18 UTC, David Gileadi wrote: On 5/31/13 10:26 AM, Andrei Alexandrescu wrote: ... I'm a bit weary of ... I keep seeing people use this phrase; shouldn't it be "wary"? Not meaning to pick on you, Andrei; it's just that this time was the tipping point for the edi

Re: Dynamic array and slices (need Walter and Andrei decision)

2013-05-31 Thread Simen Kjaeraas
Interestingly, on Lambda the Ultimate[0] today I found an article[1] that discusses some of this - the Three Laws of Programming: - What you get right, nobody mentions it. - What you get wrong, people bitch about. - What is difficult to understand you have to explain to people over and over ag

Re: minifying the website

2013-05-31 Thread H. S. Teoh
On Fri, May 31, 2013 at 07:43:08PM +0200, Wyatt wrote: > On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote: [...] > >I've been looking through the logs and it looks like the top files > >in bytes transferred yesterday (even with the deluge of downloads) > >were a number of Javascrip

Re: Template expansion bug?

2013-05-31 Thread monarch_dodra
On Friday, 31 May 2013 at 14:42:32 UTC, Steven Schveigho I can't at the moment think of a reason why anyone would ever use the full syntax, but I would expect it to be accessible, and for the compiler to treat foo as a template first, function call second. -Steve I do believe that the idea

Re: OT: weary vs wary

2013-05-31 Thread Simen Kjaeraas
On 2013-05-31, 19:47, David Gileadi wrote: On 5/31/13 10:26 AM, Andrei Alexandrescu wrote: ... I'm a bit weary of ... I keep seeing people use this phrase; shouldn't it be "wary"? Not meaning to pick on you, Andrei; it's just that this time was the tipping point for the editor in me to kic

Re: minifying the website

2013-05-31 Thread Adam D. Ruppe
On Friday, 31 May 2013 at 17:23:49 UTC, Andrei Alexandrescu wrote: I don't know if the server is configured to serve them gzipped. How do I figure that out? I'd just upload a file.html.gz (gzip file.html on your own computer) and then try to go to dlang.org/file.html It might just work. If t

OT: weary vs wary

2013-05-31 Thread David Gileadi
On 5/31/13 10:26 AM, Andrei Alexandrescu wrote: ... I'm a bit weary of ... I keep seeing people use this phrase; shouldn't it be "wary"? Not meaning to pick on you, Andrei; it's just that this time was the tipping point for the editor in me to kick in :)

Re: minifying the website

2013-05-31 Thread w0rp
On Friday, 31 May 2013 at 17:43:09 UTC, Wyatt wrote: I may be in the minority in this, but I would prefer if some of that were just removed entirely. In particular, the code-running doohickey that doesn't even work needs to die for the pathological behaviour it gives on Firefox. For example

Re: minifying the website

2013-05-31 Thread Wyatt
On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote: Hello, I've been looking through the logs and it looks like the top files in bytes transferred yesterday (even with the deluge of downloads) were a number of Javascript, HTML, and CSS files. There are programs to reduce the

Re: minifying the website

2013-05-31 Thread Brad Anderson
On Friday, 31 May 2013 at 17:33:15 UTC, Andrei Alexandrescu wrote: On 5/31/13 1:28 PM, Brad Anderson wrote: Ran it on http://dlang.org/ http://www.webpagetest.org/result/130531_FM_d41bcc90232a08ecab128ed395047e63/ Got similar results. Quite dramatic. So what should I tell our admin? Andre

Re: hello world in D

2013-05-31 Thread Marco Leise
Am Fri, 31 May 2013 13:14:48 -0400 schrieb Andrei Alexandrescu : > On 5/31/13 12:48 PM, Joseph Rushton Wakeling wrote: > > On 05/31/2013 06:34 PM, Brad Anderson wrote: > >> On Friday, 31 May 2013 at 14:56:17 UTC, khurshid wrote: > >>> Why copyright 2012 not a 2013? > >> > >> Fixed in git. > > > >

Re: A simple way to do compile time loop unrolling

2013-05-31 Thread Peter Alexander
On Friday, 31 May 2013 at 14:06:19 UTC, finalpatch wrote: Just want to share a new way I just discovered to do loop unrolling. template Unroll(alias CODE, alias N) { static if (N == 1) enum Unroll = format(CODE, 0); else enum Unroll = Unroll!(CODE, N-1)~format(CODE, N-1)

Re: minifying the website

2013-05-31 Thread Andrei Alexandrescu
On 5/31/13 1:28 PM, Brad Anderson wrote: On Friday, 31 May 2013 at 17:20:14 UTC, bearophile wrote: Andrei Alexandrescu: There are programs to reduce the size of such files called "minifiers". Should we use some? If so, what would the experts recommend? We'd need ideally some command line utili

Re: minifying the website

2013-05-31 Thread Andrei Alexandrescu
On 5/31/13 1:33 PM, Mr. Anonymous wrote: It would be also great if you could remove that flashing after the page is loaded. I believe it's caused by the bodyLoad() function. Why is it even needed? Hyphenation. Andrei

Re: Template expansion bug?

2013-05-31 Thread Steven Schveighoffer
On Fri, 31 May 2013 13:18:13 -0400, Simen Kjaeraas wrote: On 2013-05-31, 16:42, Steven Schveighoffer wrote: While doing some testing, I came across this behavior: template foo(T) { void foo() {} } void main() { foo!(int).foo(); //foo!(int)(); // this works } I'm not certa

Re: minifying the website

2013-05-31 Thread Mr. Anonymous
On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote: Hello, I've been looking through the logs and it looks like the top files in bytes transferred yesterday (even with the deluge of downloads) were a number of Javascript, HTML, and CSS files. There are programs to reduce the

Re: minifying the website

2013-05-31 Thread Andrei Alexandrescu
On 5/31/13 1:17 PM, w0rp wrote: I recommend YUI Compressor. http://yui.github.io/yuicompressor/ I use it for compressing JavaScript and CSS at my job, and it works very well. (It's also part of a Maven build script at my job, which is also cool.) If you use it, I recommend --nomunge --preserve-se

Re: minifying the website

2013-05-31 Thread Brad Anderson
On Friday, 31 May 2013 at 17:20:14 UTC, bearophile wrote: Andrei Alexandrescu: There are programs to reduce the size of such files called "minifiers". Should we use some? If so, what would the experts recommend? We'd need ideally some command line utility that we can deploy easily and integra

Re: minifying the website

2013-05-31 Thread w0rp
On Friday, 31 May 2013 at 17:23:49 UTC, Andrei Alexandrescu wrote: Can we count on all modern browsers to ask for gzipped content? Andrei Browsers send Accept-Encoding headers to let the webserver know if gzip is viable, and webservers send gzip if they can, supposing they are configured to

Re: minifying the website

2013-05-31 Thread w0rp
Also, unless I'm mistaken, the dlang.org files don't appear to be gzipped. (Content-Encoding: gzip) Using gzip should massively reduce network IO. gzip works very well on HTML, JavaScript, JSON, and CSS, as there are a lot of redundant words used.

Re: hello world in D

2013-05-31 Thread Marco Leise
Am Fri, 31 May 2013 17:58:11 +0200 schrieb "Craig Dillabaugh" : > Do you really think that is such a big issue? I can't remember > the last time I looked at the size of an executable I generated. > When I am trying to learn a new language it is really not > something I think of as a major issue.

Re: minifying the website

2013-05-31 Thread Andrei Alexandrescu
On 5/31/13 1:19 PM, Adam D. Ruppe wrote: On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote: There are programs to reduce the size of such files called "minifiers". Are these files gzipped? gzipping them will almost certainly give a much bigger effect than any minifier and is tr

Re: hello world in D

2013-05-31 Thread Rob T
On Friday, 31 May 2013 at 16:52:53 UTC, Jonathan M Davis wrote: On Friday, May 31, 2013 18:05:16 Rob T wrote: I've seen this happen with 2.062, if you take out -noboundscheck it may reduce the size significantly and compile a lot faster. Makes no sense. My first guess would be that more ends

Re: minifying the website

2013-05-31 Thread bearophile
Andrei Alexandrescu: There are programs to reduce the size of such files called "minifiers". Should we use some? If so, what would the experts recommend? We'd need ideally some command line utility that we can deploy easily and integrate with the build process. Alternatively, an online servic

Re: hello world in D

2013-05-31 Thread deadalnix
On Friday, 31 May 2013 at 16:31:42 UTC, Regan Heath wrote: On Fri, 31 May 2013 16:58:11 +0100, Craig Dillabaugh wrote: Under 40 kilobytes! If you do the bare minimum you can get down to about 1 KB, but at that point, you're actually writing in mostly (inline) assembly rather than D. The co

Re: minifying the website

2013-05-31 Thread Adam D. Ruppe
On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote: There are programs to reduce the size of such files called "minifiers". Are these files gzipped? gzipping them will almost certainly give a much bigger effect than any minifier and is trivially easy (in fact, it might be as si

Re: minifying the website

2013-05-31 Thread Brad Anderson
On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote: Hello, I've been looking through the logs and it looks like the top files in bytes transferred yesterday (even with the deluge of downloads) were a number of Javascript, HTML, and CSS files. There are programs to reduce the

Re: minifying the website

2013-05-31 Thread w0rp
On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote: Hello, I've been looking through the logs and it looks like the top files in bytes transferred yesterday (even with the deluge of downloads) were a number of Javascript, HTML, and CSS files. There are programs to reduce the

Re: Template expansion bug?

2013-05-31 Thread Simen Kjaeraas
On 2013-05-31, 16:42, Steven Schveighoffer wrote: While doing some testing, I came across this behavior: template foo(T) { void foo() {} } void main() { foo!(int).foo(); //foo!(int)(); // this works } I'm not certain, but it could be ambiguity: template foo(T) { struct fo

  1   2   >