Re: Can you do this in D?

2012-07-26 Thread Jacob Carlborg
On 2012-07-27 03:18, Wes wrote: 4. It doesn't have a simple prettyprint operator. I think .stringof is a big step forward from .ToString() for simplicity, but obviously $variable would be more terse. .stringof is not the equivalent to .ToString(). .stringof is more of a compile time language

Re: Can you do this in D?

2012-07-26 Thread Jacob Carlborg
On 2012-07-27 01:55, Walter Bright wrote: What is the utility of operators $, # and @? > Specifically I'd like $prefix to be stringification. Can you please be more specific about what this might do? If I understand him correctly I think: $variable Would be the same as: to!(string)(vari

Re: Impressed

2012-07-26 Thread Jonathan M Davis
On Friday, July 27, 2012 08:36:17 Jacob Carlborg wrote: > On 2012-07-27 02:25, Jonathan M Davis wrote: > > scope on local variables is going to be deprecated, because it's unsafe. > > scope on function parameters and scope statements are here to stay. > > "scope" on class declarations as well. I

Re: Impressed

2012-07-26 Thread Jacob Carlborg
On 2012-07-27 02:25, Jonathan M Davis wrote: scope on local variables is going to be deprecated, because it's unsafe. scope on function parameters and scope statements are here to stay. "scope" on class declarations as well. -- /Jacob Carlborg

Re: Impressed

2012-07-26 Thread Jacob Carlborg
On 2012-07-27 02:10, Brad Anderson wrote: D uses ranges instead of iterators. You can read more about them here: http://ddili.org/ders/d.en/ranges.html I find ranges to be a vast improvement over iterators personally (I use iterators extensively in C++ for my job and lament not having ranges re

Re: I just have to say that string mixins rock

2012-07-26 Thread Jacob Carlborg
On 2012-07-26 22:22, Jens Mueller wrote: Since we do not have many libraries we should do a better job at promoting the ones we have. Currently it's even difficult to find the existing ones. Working on that: https://github.com/jacob-carlborg/orbit/wiki/Orbit-Package-Manager-for-D -- /Jacob

Re: I just have to say that string mixins rock

2012-07-26 Thread Jacob Carlborg
On 2012-07-26 21:04, Jonathan M Davis wrote: That's part of why I started it. I was getting all ready to write a parser and then figured out that I didn't need it. I was itching to write one and didn't have one to write. So, I started on the D lexer, and I've ended up spending time on it when I

Re: Study: build times for D programs

2012-07-26 Thread Iain Buclaw
On 26 July 2012 23:07, Joseph Rushton Wakeling wrote: > On 26/07/12 20:27, David Nadlinger wrote: >> >> GDC probably performs inlining by default on -O2/-O3, just like LDC does. > > > I was surprised that using -inline alone (without any optimization option) > doesn't produce any meaningful improv

Re: Creating a shared library under Linux?

2012-07-26 Thread Alex Rønne Petersen
On 27-07-2012 07:23, Jens Mueller wrote: Hi, I've read several threads that about creating shared libraries. But I could not make it work. Does anybody know how to create a shared library? I don't care which compiler I have to use to accomplish it. Jens Well, all three compilers (DMD, GDC, L

Re: Can you do this in D?

2012-07-26 Thread Nick Sabalausky
On Thu, 26 Jul 2012 19:35:56 +0200 "David Piepgrass" wrote: > For example if I do > > enum twoPi = computePi() + computePi(); > > I don't know if the compiler computes PI once or twice. Does > someone know? But if I define this template: > You could toss a ctfeWriteln (or whatever it's named)

Creating a shared library under Linux?

2012-07-26 Thread Jens Mueller
Hi, I've read several threads that about creating shared libraries. But I could not make it work. Does anybody know how to create a shared library? I don't care which compiler I have to use to accomplish it. Jens

Re: Can you do this in D?

2012-07-26 Thread Alex Rønne Petersen
On 27-07-2012 06:56, Walter Bright wrote: On 7/26/2012 6:18 PM, Wes wrote: 1. It has *practically forces use of the GC, since turning it off means I can't use many features of the language. This isn't as big of a deal to me as it is to many C++ devs (my assumption). A GC gives the impression of

Re: Impressed

2012-07-26 Thread Walter Bright
On 7/26/2012 4:59 PM, Stuart wrote: Why does D have GOTO? I haven't used GOTO in over a decade, because it's truly evil. The road to hell is paved with good intentions, so we felt it necessary to add a touch of vil. One thing I really think D ought to have is iterators, We call them

Re: Can you do this in D?

2012-07-26 Thread Walter Bright
On 7/26/2012 6:18 PM, Wes wrote: 1. It has *practically forces use of the GC, since turning it off means I can't use many features of the language. This isn't as big of a deal to me as it is to many C++ devs (my assumption). A GC gives the impression of slow managed, even if the language isn't sc

Re: Impressed

2012-07-26 Thread Alex Rønne Petersen
On 27-07-2012 05:32, Ali Çehreli wrote: On 07/26/2012 06:58 PM, Stuart wrote: > On Friday, 27 July 2012 at 00:23:54 UTC, Ali Çehreli wrote: > Well, kinda. "Goto case" and such are one thing, but allowing the > arbitrary use of goto for jumping around from label to label I just > don't un

Re: Impressed

2012-07-26 Thread Ali Çehreli
On 07/26/2012 06:58 PM, Stuart wrote: > On Friday, 27 July 2012 at 00:23:54 UTC, Ali Çehreli wrote: > Well, kinda. "Goto case" and such are one thing, but allowing the > arbitrary use of goto for jumping around from label to label I just > don't understand why the language even supports this.

Re: Impressed

2012-07-26 Thread Nick Sabalausky
On Fri, 27 Jul 2012 04:55:30 +0200 "Adam D. Ruppe" wrote: > > The fact that [goto] is scoped to functions I didn't think that was true in C? It's certainly true in D, anyway.

Re: [OT] Good^H^H^H^HAcceptable NG/email client?

2012-07-26 Thread Nick Sabalausky
On Fri, 27 Jul 2012 03:18:01 +0200 "Kapps" wrote: > Out of curiosity, what do you find wrong with the web interface? > > It's a web interface.

Re: Impressed

2012-07-26 Thread Nick Sabalausky
On Thu, 26 Jul 2012 23:21:54 -0400 Nick Sabalausky wrote: > On Thu, 26 Jul 2012 21:00:12 -0600 > Brad Anderson wrote: > > > On Thu, Jul 26, 2012 at 7:56 PM, Stuart wrote: > > > > > On Friday, 27 July 2012 at 00:10:31 UTC, Brad Anderson wrote: > > > > > >> D uses ranges instead of iterators. Y

Re: Impressed

2012-07-26 Thread Nick Sabalausky
On Thu, 26 Jul 2012 21:00:12 -0600 Brad Anderson wrote: > On Thu, Jul 26, 2012 at 7:56 PM, Stuart wrote: > > > On Friday, 27 July 2012 at 00:10:31 UTC, Brad Anderson wrote: > > > >> D uses ranges instead of iterators. You can read more about them > >> here: > >> http://ddili.org/ders/d.en/**ran

Re: JavaScript is Wonderous (Was: Can you do this in D?)

2012-07-26 Thread Nick Sabalausky
On Thu, 26 Jul 2012 16:06:47 -0700 "H. S. Teoh" wrote: > On Thu, Jul 26, 2012 at 05:59:08PM -0400, Nick Sabalausky wrote: > > On Thu, 26 Jul 2012 17:17:39 +0200 > > Andrej Mitrovic wrote: > [...] > > > Now if someone would stop fiddling with the damn javascript which > > > keeps erroring out.. I

Re: Impressed

2012-07-26 Thread Nick Sabalausky
On Thu, 26 Jul 2012 17:23:53 -0700 Ali Çehreli wrote: > > iterators > > Here is a paper that compares different approaches: > >http://www.informit.com/articles/printerfriendly.aspx?p=1407357 > As great as Andrei's article is, this makes me think: We need a short article with a simple litt

Re: Impressed

2012-07-26 Thread Brad Anderson
On Thu, Jul 26, 2012 at 7:56 PM, Stuart wrote: > On Friday, 27 July 2012 at 00:10:31 UTC, Brad Anderson wrote: > >> D uses ranges instead of iterators. You can read more about them here: >> http://ddili.org/ders/d.en/**ranges.html >> >> I find ranges to be

Re: Impressed

2012-07-26 Thread Nick Sabalausky
On Fri, 27 Jul 2012 03:56:32 +0200 "Stuart" wrote: > On Friday, 27 July 2012 at 00:10:31 UTC, Brad Anderson wrote: > > D uses ranges instead of iterators. You can read more about > > them here: http://ddili.org/ders/d.en/ranges.html > > > > I find ranges to be a vast improvement over iterators

Re: Impressed

2012-07-26 Thread Adam D. Ruppe
On Friday, 27 July 2012 at 02:41:21 UTC, Nick Sabalausky wrote: Plus having it in existence doesn't really cause problems - only abusing it causes problems and but nobody really abuses goto anymore anyway. goto in C and descendants is an entirely different animal than the goto that people woul

Re: Impressed

2012-07-26 Thread Jonathan M Davis
On Friday, July 27, 2012 04:27:36 Stuart wrote: > On Friday, 27 July 2012 at 02:13:19 UTC, Jonathan M Davis wrote: > > It's inherently unsafe. What happens if you returned a > > reference to foo from someFunc? > > Good answer. I didn't think of that. > > > scope on local variables is going away f

Re: Impressed

2012-07-26 Thread Nick Sabalausky
On Fri, 27 Jul 2012 04:09:36 +0200 "Stuart" wrote: > On Friday, 27 July 2012 at 01:45:35 UTC, Jonathan M Davis wrote: > > Now, we have way more safe constructs for moving around in code > > then was the case when goto was originally vilified, > > and everyone is using those constructs rather tha

Re: Impressed

2012-07-26 Thread Nick Sabalausky
On Fri, 27 Jul 2012 04:05:48 +0200 "Stuart" wrote: > > Incidentally, none of that answered my original question, which > is "why does VisualD crash?" > You should probably ask over at wherever VisualD's site is. I don't personally use big IDEs much (I use Programmer's Notepad 2 for my D work)

Re: Impressed

2012-07-26 Thread Stuart
On Friday, 27 July 2012 at 02:13:19 UTC, Jonathan M Davis wrote: It's inherently unsafe. What happens if you returned a reference to foo from someFunc? Good answer. I didn't think of that. scope on local variables is going away for pretty much the same reason that delete is. Delete is goi

Re: D support in Exuberant Ctags 5.8 for Windows

2012-07-26 Thread Brian Schott
On Friday, 27 July 2012 at 00:19:37 UTC, José Armando García Sancio wrote: On Thu, Jul 26, 2012 at 4:59 PM, Brian Schott wrote: On Thursday, 26 July 2012 at 23:51:34 UTC, José Armando García Sancio wrote: On Thu, Jul 26, 2012 at 3:34 PM, dnewbie wrote: There is --ctags output in Dscanner

Re: Impressed

2012-07-26 Thread Stuart
On Friday, 27 July 2012 at 02:17:22 UTC, Jonathan M Davis wrote: We have library documentation on dlang.org: http://dlang.org/phobos/std_typecons.html#scoped Wow! That's a lot of information. Better get reading it, then. Thanks.

Re: Impressed

2012-07-26 Thread Jonathan M Davis
On Friday, July 27, 2012 04:13:09 Stuart wrote: > On Friday, 27 July 2012 at 01:54:16 UTC, Chad J wrote: > > Stuart & other readers: > > > > I just asked about this in the other thread, and Jonathan > > mentioned that std.typecons.scoped can be used to accomplish > > the same thing. So the functi

Re: Impressed

2012-07-26 Thread Stuart
On Friday, 27 July 2012 at 01:54:16 UTC, Chad J wrote: Stuart & other readers: I just asked about this in the other thread, and Jonathan mentioned that std.typecons.scoped can be used to accomplish the same thing. So the functionality isn't being removed; it's just being moved from the lang

Re: Impressed

2012-07-26 Thread Jonathan M Davis
On Friday, July 27, 2012 04:00:56 Stuart wrote: > On Friday, 27 July 2012 at 00:25:49 UTC, Jonathan M Davis wrote: > > scope on local variables is going to be deprecated, because > > it's unsafe. > > Um...could you explain why? I thought scope on locals was a > really nice feature. I was looking f

Re: Impressed

2012-07-26 Thread Stuart
On Friday, 27 July 2012 at 01:45:35 UTC, Jonathan M Davis wrote: Now, we have way more safe constructs for moving around in code then was the case when goto was originally vilified, and everyone is using those constructs rather than goto. But the stigma remains and everyone is used to thinking o

Re: Impressed

2012-07-26 Thread Stuart
On Friday, 27 July 2012 at 01:25:45 UTC, F i L wrote: I know many are attached at the hip to Visual Studios, but I recommend MonoDevelop + Mono-D plugin for D programming. It's very nice, with the exception of a few bug, it offers is *similar* experience to Visual Studios C#/VB. Plus it's cro

Re: Impressed

2012-07-26 Thread Jonathan M Davis
On Friday, July 27, 2012 03:58:52 Stuart wrote: > On Friday, 27 July 2012 at 00:23:54 UTC, Ali Çehreli wrote: > > Welcome! :) > > > > GOTO is evil; 'goto' is not! ;) goto makes switch-case > > > statements safer in D: > Well, kinda. "Goto case" and such are one thing, but allowing the > arbitrary

Re: Impressed

2012-07-26 Thread Stuart
On Friday, 27 July 2012 at 00:25:49 UTC, Jonathan M Davis wrote: scope on local variables is going to be deprecated, because it's unsafe. Um...could you explain why? I thought scope on locals was a really nice feature. I was looking forward to making use of it for deterministic resource dea

Re: Impressed

2012-07-26 Thread Stuart
On Friday, 27 July 2012 at 00:10:31 UTC, Brad Anderson wrote: D uses ranges instead of iterators. You can read more about them here: http://ddili.org/ders/d.en/ranges.html I find ranges to be a vast improvement over iterators personally (I use iterators extensively in C++ for my job and lamen

Re: Impressed

2012-07-26 Thread Stuart
On Friday, 27 July 2012 at 00:23:54 UTC, Ali Çehreli wrote: Welcome! :) GOTO is evil; 'goto' is not! ;) goto makes switch-case statements safer in D: Well, kinda. "Goto case" and such are one thing, but allowing the arbitrary use of goto for jumping around from label to label I just don

Re: Impressed

2012-07-26 Thread Chad J
On 07/26/2012 08:54 PM, Jonathan M Davis wrote: On Friday, July 27, 2012 02:46:20 Adam D. Ruppe wrote: On Friday, 27 July 2012 at 00:25:49 UTC, Jonathan M Davis wrote: scope on local variables is going to be deprecated, because it's unsafe. scope on function parameters and scope statements are

Re: Impressed

2012-07-26 Thread Jonathan M Davis
On Friday, July 27, 2012 03:23:27 Era Scarecrow wrote: > On Friday, 27 July 2012 at 00:57:15 UTC, bearophile wrote: > > Stuart: > >> Why does D have GOTO? I haven't used GOTO in over a decade, > >> because it's truly evil. > > > > Gotos are not so evil. Just use them when they are useful and > > t

Re: Impressed

2012-07-26 Thread F i L
Stuart wrote: Why does D have GOTO? I haven't used GOTO in over a decade, because it's truly evil. There are some who use it, and I imagine it's in there for their benefit. Thought I agree, I've rarely ever used goto. I have a couple of questions though. Why does the VisualD plugin crash V

Re: Impressed

2012-07-26 Thread Era Scarecrow
On Friday, 27 July 2012 at 00:57:15 UTC, bearophile wrote: Stuart: Why does D have GOTO? I haven't used GOTO in over a decade, because it's truly evil. Gotos are not so evil. Just use them when they are useful and they can't be replaced by structured programming. In D I create finite state m

Re: Can you do this in D?

2012-07-26 Thread Wes
On Thursday, 26 July 2012 at 23:55:29 UTC, Walter Bright wrote: On 7/26/2012 4:20 AM, Wes wrote: 5. Why not support other operators like $, #, and @? This is more of a rhetorical... as I know the language doesn't need them, nor would I know if they would be binary/unary prefix/etc or the precede

Re: [OT] Good^H^H^H^HAcceptable NG/email client?

2012-07-26 Thread Kapps
Out of curiosity, what do you find wrong with the web interface?

Re: Impressed

2012-07-26 Thread bearophile
Stuart: Why does D have GOTO? I haven't used GOTO in over a decade, because it's truly evil. Gotos are not so evil. Just use them when they are useful and they can't be replaced by structured programming. In D I create finite state machines at compile-time that use gotos, they are quick.

Re: Impressed

2012-07-26 Thread Jonathan M Davis
On Friday, July 27, 2012 02:46:20 Adam D. Ruppe wrote: > On Friday, 27 July 2012 at 00:25:49 UTC, Jonathan M Davis wrote: > > scope on local variables is going to be deprecated, because > > it's unsafe. scope > > on function parameters and scope statements are here to stay. > > There's also scope(

Re: Impressed

2012-07-26 Thread Adam D. Ruppe
On Friday, 27 July 2012 at 00:25:49 UTC, Jonathan M Davis wrote: scope on local variables is going to be deprecated, because it's unsafe. scope on function parameters and scope statements are here to stay. There's also scope(exit), scope(success), and scope(failure), which aren't going anywher

Re: Impressed

2012-07-26 Thread Jonathan M Davis
On Thursday, July 26, 2012 17:18:38 H. S. Teoh wrote: > On Fri, Jul 27, 2012 at 01:59:12AM +0200, Stuart wrote: > > I'm quite new to D, and I've just been reading the guides. I just > > wanted to say I'm very impressed with some of the features I'm reading > > about. Slices, closures, the scope key

Re: Impressed

2012-07-26 Thread Ali Çehreli
Welcome! :) On 07/26/2012 04:59 PM, Stuart wrote: > Why does D have GOTO? I haven't used GOTO in over a decade, because it's > truly evil. GOTO is evil; 'goto' is not! ;) goto makes switch-case statements safer in D: http://dlang.org/statement.html#GotoStatement > iterators Here is a pap

Re: D support in Exuberant Ctags 5.8 for Windows

2012-07-26 Thread José Armando García Sancio
On Thu, Jul 26, 2012 at 4:59 PM, Brian Schott wrote: > On Thursday, 26 July 2012 at 23:51:34 UTC, José Armando García Sancio wrote: >> >> On Thu, Jul 26, 2012 at 3:34 PM, dnewbie wrote: >>> >>> There is --ctags output in Dscanner >>> https://github.com/Hackerpilot/Dscanner >> >> >> Very interesti

Re: Impressed

2012-07-26 Thread H. S. Teoh
On Fri, Jul 27, 2012 at 01:59:12AM +0200, Stuart wrote: > I'm quite new to D, and I've just been reading the guides. I just > wanted to say I'm very impressed with some of the features I'm reading > about. Slices, closures, the scope keyword(!!!), class variable > initialisers, anonymous array lite

Re: Impressed

2012-07-26 Thread Brad Anderson
On Thursday, 26 July 2012 at 23:59:13 UTC, Stuart wrote: I'm quite new to D, and I've just been reading the guides. I just wanted to say I'm very impressed with some of the features I'm reading about. Slices, closures, the scope keyword(!!!), class variable initialisers, anonymous array literal

Impressed

2012-07-26 Thread Stuart
I'm quite new to D, and I've just been reading the guides. I just wanted to say I'm very impressed with some of the features I'm reading about. Slices, closures, the scope keyword(!!!), class variable initialisers, anonymous array literals, array concatenation, synchronisation... even decent ex

Re: D support in Exuberant Ctags 5.8 for Windows

2012-07-26 Thread Brian Schott
On Thursday, 26 July 2012 at 23:51:34 UTC, José Armando García Sancio wrote: On Thu, Jul 26, 2012 at 3:34 PM, dnewbie wrote: There is --ctags output in Dscanner https://github.com/Hackerpilot/Dscanner Very interesting. Is this Dscanner pluggable? I would be interesting to use Dscanner for lo

Re: Can you do this in D?

2012-07-26 Thread Walter Bright
On 7/26/2012 12:44 PM, Araq wrote: He explicitely asked about other programming languages... Araq, you are welcome here.

Re: Can you do this in D?

2012-07-26 Thread Walter Bright
On 7/26/2012 4:20 AM, Wes wrote: 5. Why not support other operators like $, #, and @? This is more of a rhetorical... as I know the language doesn't need them, nor would I know if they would be binary/unary prefix/etc or the precedence... although they would be nice to have. The question should

Re: Computed gotos on Reddit

2012-07-26 Thread Walter Bright
On 7/26/2012 2:17 PM, Dmitry Olshansky wrote: Filed: http://d.puremagic.com/issues/show_bug.cgi?id=8448 Thank you.

Re: D support in Exuberant Ctags 5.8 for Windows

2012-07-26 Thread José Armando García Sancio
On Thu, Jul 26, 2012 at 3:34 PM, dnewbie wrote: > There is --ctags output in Dscanner > https://github.com/Hackerpilot/Dscanner Very interesting. Is this Dscanner pluggable? I would be interesting to use Dscanner for localization. For example it would be nice if it could generate a list of all th

Re: JavaScript is Wonderous (Was: Can you do this in D?)

2012-07-26 Thread H. S. Teoh
On Thu, Jul 26, 2012 at 05:59:08PM -0400, Nick Sabalausky wrote: > On Thu, 26 Jul 2012 17:17:39 +0200 > Andrej Mitrovic wrote: [...] > > Now if someone would stop fiddling with the damn javascript which > > keeps erroring out.. I'm beginning to join the Nick camp w.r.t. JS. > > :p > > JavaScript

Re: D support in Exuberant Ctags 5.8 for Windows

2012-07-26 Thread Brian Schott
On Thursday, 26 July 2012 at 22:34:51 UTC, dnewbie wrote: There is --ctags output in Dscanner https://github.com/Hackerpilot/Dscanner But be warned that I haven't tested it on Windows.

Re: D support in Exuberant Ctags 5.8 for Windows

2012-07-26 Thread dnewbie
On Thursday, 26 July 2012 at 22:06:08 UTC, Gary Willoughby wrote: I'm looking at this page and trying to download the latest CTags 5.8 with D patch compiled for Windows but i'm getting a dead link. Does anyone else have this file or can point me to another link? http://prowiki.org/wiki4d/wiki

D support in Exuberant Ctags 5.8 for Windows

2012-07-26 Thread Gary Willoughby
I'm looking at this page and trying to download the latest CTags 5.8 with D patch compiled for Windows but i'm getting a dead link. Does anyone else have this file or can point me to another link? http://prowiki.org/wiki4d/wiki.cgi?ReferenceForTools/ExuberantCtags

Re: Study: build times for D programs

2012-07-26 Thread Joseph Rushton Wakeling
On 26/07/12 20:27, David Nadlinger wrote: GDC probably performs inlining by default on -O2/-O3, just like LDC does. I was surprised that using -inline alone (without any optimization option) doesn't produce any meaningful improvement. It cuts maybe 1s off the DMD-compiled runtime, but it's n

JavaScript is Wonderous (Was: Can you do this in D?)

2012-07-26 Thread Nick Sabalausky
On Thu, 26 Jul 2012 17:17:39 +0200 Andrej Mitrovic wrote: > On 7/26/12, Andrei Alexandrescu wrote: > > The OP is likely new to the community, so throwing acronyms around > > may not be helpful. > > http://dlang.org/glossary.html > > Now if someone would stop fiddling with the damn javascript w

Re: Can you do this in D?

2012-07-26 Thread Simen Kjaeraas
On Thu, 26 Jul 2012 21:44:24 +0200, Araq wrote: On Thursday, 26 July 2012 at 19:38:41 UTC, David Nadlinger wrote: On Thursday, 26 July 2012 at 19:02:15 UTC, Araq wrote: ;-) Further context: Araq is the guy behind Nimrod. Man, we should totally infiltrate their forums as well. David, serio

Re: Computed gotos on Reddit

2012-07-26 Thread Dmitry Olshansky
On 27-Jul-12 00:50, Dmitry Olshansky wrote: On 27-Jul-12 00:31, Walter Bright wrote: On 7/26/2012 1:14 PM, Dmitry Olshansky wrote: Obviously it's backwards and awful. Makes me wonder why can't we take it directly, what's limitation ? How about allowing it, at least in inline assembly? It can

Re: Variable interpolation in strings

2012-07-26 Thread Justin Whear
On Thu, 26 Jul 2012 22:40:25 +0200, Tobias Pankrath wrote: >> My original thought was to allow cool syntax like x!"embedded variable: >> $foo" but template instantiations don't have access to variables from >> instantiation scope (unless you pass them explicitly via alias, >> of course). > > temp

Re: What is the compilation model of D?

2012-07-26 Thread Nick Sabalausky
On Thu, 26 Jul 2012 09:27:03 +0100 Russel Winder wrote: > On Wed, 2012-07-25 at 01:03 -0700, Jonathan M Davis wrote: > > > In any case, much as I like C++ (not as much as D, but I still like > > it quite a bit), its build times are undeniably horrible. > > Indeed, especially with -O2 or -O3. >

Re: Study: build times for D programs

2012-07-26 Thread Nick Sabalausky
On Thu, 26 Jul 2012 10:54:07 -0700 Ali Çehreli wrote: > On 07/26/2012 02:28 AM, Jacob Carlborg wrote: > > On 2012-07-25 23:56, Jonathan M Davis wrote: > > > Incremental builds don't have to mean "pass a single file to the > > compiler". You can start by passing all the files at once to the >

Re: Computed gotos on Reddit

2012-07-26 Thread Dmitry Olshansky
On 27-Jul-12 00:38, Walter Bright wrote: On 7/26/2012 8:55 AM, Dmitry Olshansky wrote: int test(int i) { switch (i) { case 3: i += 3; break; case 4: i += 4; break; case 5: i += 5; break; case 6: i += 6; break; case 7: i += 7; break;

Re: Computed gotos on Reddit

2012-07-26 Thread Dmitry Olshansky
On 27-Jul-12 00:31, Walter Bright wrote: On 7/26/2012 1:14 PM, Dmitry Olshansky wrote: Obviously it's backwards and awful. Makes me wonder why can't we take it directly, what's limitation ? How about allowing it, at least in inline assembly? It can be done, it's just that nobody has done the i

Re: Variable interpolation in strings

2012-07-26 Thread Tobias Pankrath
My original thought was to allow cool syntax like x!"embedded variable: $foo" but template instantiations don't have access to variables from instantiation scope (unless you pass them explicitly via alias, of course). template mixins?

Re: I just have to say that string mixins rock

2012-07-26 Thread Nick Sabalausky
On Thu, 26 Jul 2012 09:32:03 +0100 Russel Winder wrote: > On Thu, 2012-07-26 at 08:48 +0200, Philippe Sigaud wrote: > […] > > Ditto. Took me a while to be convinced (assembling code as strings? > > Ewww, oh gross!), but now I'm sold. > > Dynamic languages have been doing this for ages, and indee

Re: Computed gotos on Reddit

2012-07-26 Thread Walter Bright
On 7/26/2012 8:55 AM, Dmitry Olshansky wrote: int test(int i) { switch (i) { case 3: i += 3; break; case 4: i += 4; break; case 5: i += 5; break; case 6: i += 6; break; case 7: i += 7; break; case 8: i += 8; break; default:

Re: Computed gotos on Reddit

2012-07-26 Thread Walter Bright
On 7/26/2012 1:14 PM, Dmitry Olshansky wrote: Obviously it's backwards and awful. Makes me wonder why can't we take it directly, what's limitation ? How about allowing it, at least in inline assembly? It can be done, it's just that nobody has done the implementation in the inline assembler.

Re: I just have to say that string mixins rock

2012-07-26 Thread Jens Mueller
Jonathan M Davis wrote: > On Thursday, July 26, 2012 19:52:53 Paulo Pinto wrote: > > What prevents me to use D besides toy projects is the lack of libraries. > > Due to my time constraints I must use off the shelf libraries. > > Yeah. That's a big problem, which is part of why Walter and Andrei ha

Re: Computed gotos on Reddit

2012-07-26 Thread Dmitry Olshansky
On 26-Jul-12 11:56, Don Clugston wrote: But doing that screws up the CPU"s stack prediction so badly that it will dominate the timing At least do something like: jump_table: move EAX, [ESP] ret BTW this seems to be a roundabout way to get address of label that I can use do a thr

Re: Study: build times for D programs

2012-07-26 Thread David Nadlinger
On Thursday, 26 July 2012 at 19:36:51 UTC, Jonathan M Davis wrote: That was my point. -inline seems to be pretty much identical between the two compilers, and if the inlining is done in the frontend, then that makes sense. Thinking on it, it makes sense to me that it would be in the frontend, b

Re: Can you do this in D?

2012-07-26 Thread Araq
On Thursday, 26 July 2012 at 19:38:41 UTC, David Nadlinger wrote: On Thursday, 26 July 2012 at 19:02:15 UTC, Araq wrote: ;-) Further context: Araq is the guy behind Nimrod. Man, we should totally infiltrate their forums as well. David, serious as ever He explicitely asked about other progr

Re: Can you do this in D?

2012-07-26 Thread David Nadlinger
On Thursday, 26 July 2012 at 19:02:15 UTC, Araq wrote: ;-) Further context: Araq is the guy behind Nimrod. Man, we should totally infiltrate their forums as well. David, serious as ever

Re: Study: build times for D programs

2012-07-26 Thread Jonathan M Davis
On Thursday, July 26, 2012 21:29:57 David Nadlinger wrote: > On Thursday, 26 July 2012 at 18:59:14 UTC, Jonathan M Davis wrote: > > […] That probably just > > indicates that it's a frontend issue (which I suppose makes > > sense when I think > > about it). > > Oh, and I don't know what exactly you

Re: Study: build times for D programs

2012-07-26 Thread David Nadlinger
On Thursday, 26 July 2012 at 18:59:14 UTC, Jonathan M Davis wrote: Clearly -O is where the big runtime speed difference is at between dmd and gdc, which _is_ a bit obvious, but I'm surprised that -inline had no differences, since dmd is generally accused at being poor at inlining. That probably

Re: Study: build times for D programs

2012-07-26 Thread David Nadlinger
On Thursday, 26 July 2012 at 18:59:14 UTC, Jonathan M Davis wrote: […] That probably just indicates that it's a frontend issue (which I suppose makes sense when I think about it). Oh, and I don't know what exactly you are referring to here, but any difference between DMD and GDC is likely no

Re: Variable interpolation in strings

2012-07-26 Thread Adam D. Ruppe
It might be useful to do this kind of thing with a filter function: string escape(string s) { return s.replace("\n", "\\n"); } auto foo = "cool\nstuff"; string lol = mixin(x("blah $foo", escape)); assert(lol == "blah cool\\nstuff");

Re: Can you do this in D?

2012-07-26 Thread Araq
On Thursday, 26 July 2012 at 11:20:35 UTC, Wes wrote: Can you do this in D? If not then what other language? Nimrod (http://nimrod-code.org/) can do 2, 3, 4, 5 of your list. (1 is planned.) 2 can be done very efficiently directly for tuples; for classes it can currently only be done with RTTI.

Re: I just have to say that string mixins rock

2012-07-26 Thread Jonathan M Davis
On Thursday, July 26, 2012 20:52:09 Jacob Carlborg wrote: > On 2012-07-26 20:47, Jonathan M Davis wrote: > > However, I _was_ pleasantly surprised the other day when I figured out the > > other day that someone had already created a D parser for YAML ( > > https://github.com/kiith-sa/D-YAML ). I ne

Re: Study: build times for D programs

2012-07-26 Thread Jacob Carlborg
On 2012-07-26 19:54, Ali Çehreli wrote: GNU make has the special $? prerequisite that may help with the above: "The names of all the prerequisites that are newer than the target, with spaces between them. " http://www.gnu.org/software/make/manual/make.html#index-g_t_0024_003f-944 Ali I'm t

Re: Study: build times for D programs

2012-07-26 Thread Jonathan M Davis
On Thursday, July 26, 2012 18:00:21 Joseph Rushton Wakeling wrote: > On 26/07/12 15:42, Andrei Alexandrescu wrote: > >> If you can advise some flag combinations (for D and C++) you'd like to > >> see tested, I'll happily do them. > > > > The classic to ones are: (a) no flags at all, (b) -O -releas

Re: Can you do this in D?

2012-07-26 Thread Jacob Carlborg
On 2012-07-26 16:53, Andrei Alexandrescu wrote: What happened to __traits(allMembers, module_name)? It doesn't list the contents of the current scope, but instead that of a module (including the current one). It can be used on classes and structs (I assume) as well, -- /Jacob Carlborg

Re: I just have to say that string mixins rock

2012-07-26 Thread Jacob Carlborg
On 2012-07-26 20:47, Jonathan M Davis wrote: However, I _was_ pleasantly surprised the other day when I figured out the other day that someone had already created a D parser for YAML ( https://github.com/kiith-sa/D-YAML ). I needefd one and was expecting to have to write it (which I was actually

Variable interpolation in strings

2012-07-26 Thread Justin Whear
Jonathan M. Davis' recent post about string mixins reminded me of something I put together a couple of months ago: variable interpolation in strings http://dpaste.dzfl.pl/5689d535 Some of the projects I work on have lots of embedded queries which are assembled on the fly (not just values but co

Re: I just have to say that string mixins rock

2012-07-26 Thread Jonathan M Davis
On Thursday, July 26, 2012 19:52:53 Paulo Pinto wrote: > What prevents me to use D besides toy projects is the lack of libraries. > Due to my time constraints I must use off the shelf libraries. Yeah. That's a big problem, which is part of why Walter and Andrei have tried to push Deimos. But it's

Re: I just have to say that string mixins rock

2012-07-26 Thread Brad Anderson
On Thu, Jul 26, 2012 at 4:25 AM, Denis Shelomovskij < verylonglogin@gmail.com> wrote: > That's why current `std.algorithm` string lambdas looks good and by > design. I'm happy pull 707 is reverted. > > > -- > Денис В. Шеломовский > Denis V. Shelomovskij > I do like the brevity of the string l

Re: Can you do this in D?

2012-07-26 Thread Brad Anderson
On Thu, Jul 26, 2012 at 9:17 AM, Andrej Mitrovic wrote: > On 7/26/12, Andrei Alexandrescu wrote: > > The OP is likely new to the community, so throwing acronyms around may > > not be helpful. > > http://dlang.org/glossary.html > > Now if someone would stop fiddling with the damn javascript which

Re: Study: build times for D programs

2012-07-26 Thread Ali Çehreli
On 07/26/2012 02:28 AM, Jacob Carlborg wrote: > On 2012-07-25 23:56, Jonathan M Davis wrote: > Incremental builds don't have to mean "pass a single file to the > compiler". You can start by passing all the files at once to the > compiler and then later you just pass all the files that have change

Re: I just have to say that string mixins rock

2012-07-26 Thread Paulo Pinto
Am 26.07.2012 17:26, schrieb Russel Winder: What is the equivalent for D. Is the target C, C++, Fortran, Go, Java? What is the problem that D can solve that is so damned difficult in C, C ++, Go, Fortran? Speaking from the corporate world where I work, I think most C and C++ projects that wan

Re: Multi-threaded GUI

2012-07-26 Thread Simon
On 26/07/2012 09:16, Russel Winder wrote: On Wed, 2012-07-25 at 23:17 +0200, Kagamin wrote: On Wednesday, 25 July 2012 at 18:50:51 UTC, Simon wrote: You have to be very, very careful with trying to do multi threading w/ windoze windows. Try doing a google search on it, and the advice is invaria

Re: Inherited mutability, freeze, thaw and more in Rust

2012-07-26 Thread Chris Cain
On Thursday, 26 July 2012 at 14:54:59 UTC, bearophile wrote: struct Foo { immutable int x; int y; } void main() { Foo f = Foo(5, 10); f = Foo(20, 30); } There's problems with this which would have significant consequences in D. It would destroy the ability to reason about code

  1   2   >