Re: Announcing bottom-up-build - a build system for C/C++/D

2013-06-27 Thread eles
On Thursday, 27 June 2013 at 05:44:16 UTC, Rob T wrote: One issue I immediately ran into, is when I run bub incorrectly it hangs after writing the bail message to console. ctrl-c does not kill it, and I have to run a process kill commandto terminate. CTRL-Z works for me. I think it expects

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread Joakim
On Wednesday, 26 June 2013 at 21:15:34 UTC, Iain Buclaw wrote: On Jun 26, 2013 9:00 PM, Joakim joa...@airpost.net wrote: This is flat wrong. I suggest you read the Artistic license, it was chosen for a reason, ie it allows closing of source as long as you provide the original, unmodified

Re: Announcing bottom-up-build - a build system for C/C++/D

2013-06-27 Thread eles
On Thursday, 27 June 2013 at 07:32:32 UTC, eles wrote: CTRL-Z works for me. I think it expects input. Ignore it. It just suspends it.

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread Joakim
On Thursday, 27 June 2013 at 03:20:37 UTC, Mathias Lang wrote: I've read (almost), everything, so I hope I won't miss a point here: a) I've heard about MSVC, Red Hat, Qt, Linux and so on. From my understanding, none of the projects mentionned have gone from free (as in free beer) to

Re: Announcing bottom-up-build - a build system for C/C++/D

2013-06-27 Thread Dicebot
Hm, bub.. Sounds like it should work with 'dub' nicely ;) Looks promising and I'd really love to see some build tool other then rdmd getting to the point it can be called standard. Makefile's sometimes are just too inconvenient.

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread Iain Buclaw
On 27 June 2013 09:21, Joakim joa...@airpost.net wrote: But lets assume that you are right and the optimization patches I'm talking about would tend to end up only in the backend. In that case, the frontend would not have any closed patches and the paid version of dmd would simply have a

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread Iain Buclaw
On 27 June 2013 09:53, Joakim joa...@airpost.net wrote: those involved with the D compiler can decide if this would be a worthwhile direction. From their silence so far, I can only assume that they are not interested in rousing the ire of the freetards and will simply maintain the status quo

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread Leandro Lucarella
Joakim, el 26 de June a las 17:52 me escribiste: On Wednesday, 26 June 2013 at 11:08:17 UTC, Leandro Lucarella wrote: Joakim, el 25 de June a las 23:37 me escribiste: I don't know the views of the key contributors, but I wonder if they would have such a knee-jerk reaction against any

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread Joseph Rushton Wakeling
On Thursday, 27 June 2013 at 08:21:12 UTC, Joakim wrote: I'm familiar with its arguments from a summary, not particularly interested in reading the whole thing. You know, I think I see what your problem is ... :-)

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread Joakim
As I said earlier, I'm done with this debate. There is no point talking to people who make blatantly ignorant statements like, Binary blobs are the exception rather than the rule in Linux, and many hardware vendors would flat out say 'no' to doing any support on them. This assertion is so

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread John Colvin
On Thursday, 27 June 2013 at 13:18:01 UTC, Joakim wrote: As I said earlier, I'm done with this debate. There is no point talking to people who make blatantly ignorant statements like, Binary blobs are the exception rather than the rule in Linux, and many hardware vendors would flat out say

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread Dicebot
On Thursday, 27 June 2013 at 13:18:01 UTC, Joakim wrote: There is no point talking to people who make blatantly ignorant statements Yeah, I keep wondering why someone even bothered to waste time explaining all this to someone who is incapable of both providing own reasoning and studying

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread Joakim
On Thursday, 27 June 2013 at 13:25:06 UTC, John Colvin wrote: On Thursday, 27 June 2013 at 13:18:01 UTC, Joakim wrote: Look, I get it, you guys are religious zealots- you tip your hand when you allude to ethical or moral reasons for using open source, a crazy idea if there ever was one- and

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread Iain Buclaw
On 27 June 2013 14:40, Joakim joa...@airpost.net wrote: On Thursday, 27 June 2013 at 13:25:06 UTC, John Colvin wrote: On Thursday, 27 June 2013 at 13:18:01 UTC, Joakim wrote: Look, I get it, you guys are religious zealots- you tip your hand when you allude to ethical or moral reasons for

Re: Announcing bottom-up-build - a build system for C/C++/D

2013-06-27 Thread Andrei Alexandrescu
On 6/26/13 5:10 PM, Graham St Jack wrote: Bottom-up-build (bub) is a build system written in D which supports building of large C/C++/D projects. http://www.reddit.com/r/programming/comments/1h6p2w/bottomupbuild_a_build_system_for_ccd/ Andrei

Re: DConf 2013 Day 2 Talk 5: A Precise Garbage Collector for D by Rainer Schütze

2013-06-27 Thread bearophile
Andrei Alexandrescu: http://www.reddit.com/r/programming/comments/1fpw2r/dconf_2013_day_2_talk_5_a_precise_garbage/ Another thing to keep in account while designing a more precise garbage collection is a possible special casing for Algebraic (and Variant, and more generally for some

Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-27 Thread Iain Buclaw
On 27 June 2013 14:17, Joakim joa...@airpost.net wrote: As I said earlier, I'm done with this debate. There is no point talking to people who make blatantly ignorant statements like, Binary blobs are the exception rather than the rule in Linux, and many hardware vendors would flat out say

Re: An idea - make dlang.org a fundation

2013-06-27 Thread ixid
-You could start taking donations and hire some people to work on D. This doesn't work as it's a volunteer project. Why should someone get paid when others give their time for free? It would create conflict while being a less effective application of funds, D already gets more than one or

Re: An idea - make dlang.org a fundation

2013-06-27 Thread Andrej Mitrovic
On 6/27/13, ixid nuacco...@gmail.com wrote: -You could start taking donations and hire some people to work on A better use of the money is another D conference which has been a huge success and generated both ideas and much greater interest and exposure for D. Yes, and some better glue for the

Re: Announcing bottom-up-build - a build system for C/C++/D

2013-06-27 Thread Graham St Jack
On Thu, 27 Jun 2013 07:44:07 +0200, Rob T wrote: This build system seems to be very well suited for building complex large projects in a sensible way. I successfully tested the example build on Debian linux. I will definitely explore this further using one of my own projects. One issue I

Re: An idea - make dlang.org a fundation

2013-06-27 Thread John Colvin
On Thursday, 27 June 2013 at 21:39:28 UTC, ixid wrote: -You could start taking donations and hire some people to work on D. This doesn't work as it's a volunteer project. Why should someone get paid when others give their time for free? It would create conflict while being a less effective

Re: TDD is BS?

2013-06-27 Thread Nick Sabalausky
On Wed, 26 Jun 2013 13:58:18 -0700 H. S. Teoh hst...@quickfur.ath.cx wrote: Actually, my first introduction to programming was the interactive tutorial disks that came with the Apple IIc. I sometimes find it kind of depressing that instruction isn't even *that* far along anymore, let

Re: Notes from C++ static analysis

2013-06-27 Thread Andrei Alexandrescu
On 6/26/13 8:05 PM, Andrej Mitrovic wrote: If you are the type of programmer who often tests their own code, why are you passing more arguments than needed to format? My point is they're needed. Andrei

Re: Notes from C++ static analysis

2013-06-27 Thread Andrei Alexandrescu
On 6/26/13 10:35 PM, Peter Williams wrote: On 27/06/13 14:20, H. S. Teoh wrote: On Thu, Jun 27, 2013 at 01:56:31PM +1000, Peter Williams wrote: [...] While you're fixing it can you modify it so that the format string can specify the order in which the arguments are replaced? This is very

Re: Notes from C++ static analysis

2013-06-27 Thread Andrei Alexandrescu
On 6/26/13 8:26 PM, Andrej Mitrovic wrote: The way I see it, write/writef is primarily used for debugging and benefits having some lax features, whereas format is used in more heavy-duty work where it's important not to screw things up at the call site. Then I think all the more format should

Re: Notes from C++ static analysis

2013-06-27 Thread Andrei Alexandrescu
On 6/26/13 8:36 PM, Jonathan M Davis wrote: On Wednesday, June 26, 2013 19:18:27 Andrei Alexandrescu wrote: On 6/26/13 1:50 PM, bearophile wrote: Andrei Alexandrescu: Actually this is good because it allows to customize the format string to print only a subset of available information (I've

Re: Notes from C++ static analysis

2013-06-27 Thread Jonathan M Davis
On Wednesday, June 26, 2013 23:49:41 Andrei Alexandrescu wrote: The only point I'd negotiate would be to not throw with positional arguments, and throw with sequential arguments. All code that cares uses positional specifiers anyway. That sounds like a good compromise. - Jonathan M Davis

Re: Notes from C++ static analysis

2013-06-27 Thread Jonathan M Davis
On Wednesday, June 26, 2013 23:47:15 Andrei Alexandrescu wrote: That behavour is surprising, and it risks hiding some information silently. Doesn't surprise me one bit. Well, it shocks most of us. I'm also not moved by argumentum ad populum. ad populum obviously isn't enough. But

Re: Notes from C++ static analysis

2013-06-27 Thread Andrei Alexandrescu
On 6/26/13 11:59 PM, Jonathan M Davis wrote: On Wednesday, June 26, 2013 23:47:15 Andrei Alexandrescu wrote: That behavour is surprising, and it risks hiding some information silently. Doesn't surprise me one bit. Well, it shocks most of us. I'm also not moved by argumentum ad populum.

Re: Notes from C++ static analysis

2013-06-27 Thread Andrei Alexandrescu
On 6/26/13 11:59 PM, Jonathan M Davis wrote: I'm just pointing out that ignoring what the majority thinks is not necessarily a good idea. Of course. In this case it is. Andrei

Re: Notes from C++ static analysis

2013-06-27 Thread Paulo Pinto
On Thursday, 27 June 2013 at 02:25:54 UTC, Andrei Alexandrescu wrote: On 6/26/13 2:47 PM, Paulo Pinto wrote: Am 26.06.2013 20:52, schrieb H. S. Teoh: On Wed, Jun 26, 2013 at 08:08:08PM +0200, bearophile wrote: An interesting blog post found through Reddit:

Re: Notes from C++ static analysis

2013-06-27 Thread Paulo Pinto
On Wednesday, 26 June 2013 at 22:56:41 UTC, Walter Bright wrote: On 6/26/2013 2:47 PM, Paulo Pinto wrote: I have been an adept of iostreams since day one and never understood why people complain so much about them or the operator and operator for that matter. Even if you can get past the

Re: Notes from C++ static analysis

2013-06-27 Thread deadalnix
On Thursday, 27 June 2013 at 06:59:49 UTC, Jonathan M Davis wrote: ad populum obviously isn't enough. But if we make a design decision that favors 1% of our user base and causes problems for the other 99%, then I think that we've made a big mistake. And while having most everyone disagree with

Re: Notes from C++ static analysis

2013-06-27 Thread Paulo Pinto
On Wednesday, 26 June 2013 at 22:04:39 UTC, H. S. Teoh wrote: On Wed, Jun 26, 2013 at 11:47:32PM +0200, Paulo Pinto wrote: Am 26.06.2013 20:52, schrieb H. S. Teoh: [...] None of my C++ code uses iostream. I still find stdio.h more comfortable to use, in spite of its many problems. One of the

Re: Notes from C++ static analysis

2013-06-27 Thread monarch_dodra
On Thursday, 27 June 2013 at 07:33:16 UTC, Paulo Pinto wrote: On Wednesday, 26 June 2013 at 22:56:41 UTC, Walter Bright wrote: On 6/26/2013 2:47 PM, Paulo Pinto wrote: I have been an adept of iostreams since day one and never understood why people complain so much about them or the operator

Re: OT: CS education gone wrong (Was: Re: TDD is BS?)

2013-06-27 Thread Walter Bright
On 6/21/2013 4:10 AM, Paulo Pinto wrote: Except not everyone has the authorization to place their work code in such public places nor the availability or desire to code after work, just to please job interviewers. True, but your odds of being 'discovered' go up enormously if you make such an

Re: Notes from C++ static analysis

2013-06-27 Thread monarch_dodra
On Thursday, 27 June 2013 at 02:17:09 UTC, Andrei Alexandrescu wrote: On 6/26/13 1:31 PM, Andrej Mitrovic wrote: On 6/26/13, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: Actually this is good because it allows to customize the format string to print only a subset of available

Re: Why UTF-8/16 character encodings?

2013-06-27 Thread Kagamin
On Thursday, 30 May 2013 at 11:29:47 UTC, Manu wrote: Have you ever worked on code written by people who barely speak English? I did. It's better than having a mixture of languages like here: http://code.google.com/p/trileri/source/browse/trunk/tr/yazi.d assert(length == dizgi.length); - in

Re: Why UTF-8/16 character encodings?

2013-06-27 Thread deadalnix
On Tuesday, 28 May 2013 at 00:11:18 UTC, Walter Bright wrote: Every time I've been to a programming shop in a foreign country, the developers speak english at work and code in english. Of course, that doesn't mean that everyone does, but as far as I can tell the overwhelming bulk is done in

Re: Notes from C++ static analysis

2013-06-27 Thread renoX
On Wednesday, 26 June 2013 at 18:08:10 UTC, bearophile wrote: [cut] The most common problem they find are errors in the format string of printf-like functions (despite the code is C++): The top type of bug that /analyze finds is format string errors – mismatches between printf-style format

Re: Notes from C++ static analysis

2013-06-27 Thread Nicolas Sicard
On Wednesday, 26 June 2013 at 20:50:03 UTC, bearophile wrote: If you want a special behavour you should use a special function as partialWritefln that ignores arguments not present in the format string. Or maybe just define a new format specifier (%z, for 'zap'?) to ignore one or more

Re: Notes from C++ static analysis

2013-06-27 Thread bearophile
Jonathan M Davis: Andrei Alexandrescu: The only point I'd negotiate would be to not throw with positional arguments, and throw with sequential arguments. All code that cares uses positional specifiers anyway. That sounds like a good compromise. OK :-) Bye, bearophile

Re: Notes from C++ static analysis

2013-06-27 Thread Adam D. Ruppe
On Thursday, 27 June 2013 at 06:59:49 UTC, Jonathan M Davis wrote: But if we make a design decision that favors 1% of our userbase I really think we all need to be more careful about these kinds of statements. I often see posts on the newsgroup where someone says feature/function X is

Re: proposal for better syntax for extern objective-C and compatibility with named argument parameters

2013-06-27 Thread Jacob Carlborg
On 2013-06-27 07:35, Timothee Cour wrote: See [1][2] for related thread introducing extern(objective C) A) The syntax proposed in [2] transforms: -(void) insertItemWithObjectValue: (NSString *) path atGreen:(NSInteger) anInt; [obj insertItemWithObjectValue:val atGreen:idx ]; into: void

Re: proposal for better syntax for extern objective-C and compatibility with named argument parameters

2013-06-27 Thread Paulo Pinto
On Thursday, 27 June 2013 at 05:35:28 UTC, Timothee Cour wrote: See [1][2] for related thread introducing extern(objective C) A) The syntax proposed in [2] transforms: -(void) insertItemWithObjectValue: (NSString *) path atGreen:(NSInteger) anInt; [obj insertItemWithObjectValue:val

Re: Notes from C++ static analysis

2013-06-27 Thread Andrej Mitrovic
On 6/27/13, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: NO! This is exactly the kind of code that is buggy and useless. The right use cases involve more arguments than format specifiers. I mistyped that, I meant: format(%s, 1, 2); // no exceptions in future release safeFormat(%s,

Re: Notes from C++ static analysis

2013-06-27 Thread Adam D. Ruppe
On Thursday, 27 June 2013 at 13:11:55 UTC, Andrej Mitrovic wrote: I mistyped that, I meant: format(%s, 1, 2); // no exceptions in future release safeFormat(%s, 1, 2); // exception thrown I think if there's going to be a new function anyway, it might as well be more like the ctFormat

Re: Notes from C++ static analysis

2013-06-27 Thread Andrej Mitrovic
On 6/27/13, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: On 6/27/13, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: NO! This is exactly the kind of code that is buggy and useless. The right use cases involve more arguments than format specifiers. I mistyped that, I meant:

Re: Notes from C++ static analysis

2013-06-27 Thread Andrej Mitrovic
On 6/27/13, Adam D. Ruppe destructiona...@gmail.com wrote: I think if there's going to be a new function anyway, it might as well be more like the ctFormat bearophile mentioned, and check it at compile time. Yeah but it's not always possible to know what the formatting string is. For example,

Re: Notes from C++ static analysis

2013-06-27 Thread bearophile
Andrej Mitrovic: Yeah but it's not always possible to know what the formatting string is. For example, maybe you have an enum array of format strings but a runtime index into this array which you pass to format at runtime. I've ported C samples before that used this style of formatting. In

Re: proposal for better syntax for extern objective-C and compatibility with named argument parameters

2013-06-27 Thread Michel Fortin
On 2013-06-27 05:35:11 +, Timothee Cour thelastmamm...@gmail.com said: See [1][2] for related thread introducing extern(objective C) A) The syntax proposed in [2] transforms: -(void) insertItemWithObjectValue: (NSString *) path atGreen:(NSInteger) anInt; [obj insertItemWithObjectValue:val

Re: Notes from C++ static analysis

2013-06-27 Thread Artur Skawina
On 06/27/13 13:16, Nicolas Sicard wrote: On Wednesday, 26 June 2013 at 20:50:03 UTC, bearophile wrote: If you want a special behavour you should use a special function as partialWritefln that ignores arguments not present in the format string. Or maybe just define a new format specifier

Re: why allocators are not discussed here

2013-06-27 Thread BLM768
On Wednesday, 26 June 2013 at 23:59:01 UTC, Adam D. Ruppe wrote: On Wednesday, 26 June 2013 at 23:02:47 UTC, H. S. Teoh wrote: Maybe a type distinction akin to C++'s auto_ptr might help? It might not be so bad if we modified D to add a lent storage class, or something, similar to some

auto type for defaulted arguments? [Repost]

2013-06-27 Thread bearophile
(This is an extended repost of a message that I have put in D.learn.) Sometimes I have code like this: struct VeryLongNamedStruct {} void foo(in VeryLongNamedStruct x = VeryLongNamedStruct(1)) {} void main() {} Or even: void bar(in TupleFoo x = TupleFoo(TupleBar(2), TupleSpam(3))) {} In

Re: auto type for defaulted arguments? [Repost]

2013-06-27 Thread Maxim Fomin
On Thursday, 27 June 2013 at 17:42:14 UTC, bearophile wrote: (This is an extended repost of a message that I have put in D.learn.) Sometimes I have code like this: struct VeryLongNamedStruct {} void foo(in VeryLongNamedStruct x = VeryLongNamedStruct(1)) {} void main() {} Or even: void

Re: Notes from C++ static analysis

2013-06-27 Thread bearophile
Andrei Alexandrescu: But the bottom line is I don't think we need to force anything on anybody. If anything, we could split up the internal format implementation and provide format and safeFormat functions. format(%s %s, 1); // no exceptions NO! This is exactly the kind of code that is

Re: Notes from C++ static analysis

2013-06-27 Thread Adam D. Ruppe
On Thursday, 27 June 2013 at 19:22:08 UTC, bearophile wrote: (also why is it 1-based?): It is specified that way in the Single Unix Specification for format strings. I'm not sure why they did it that way, but if we changed it, that would be surprising since the format string is otherwise

Re: Notes from C++ static analysis

2013-06-27 Thread Jonathan M Davis
On Thursday, June 27, 2013 13:47:53 Adam D. Ruppe wrote: On Thursday, 27 June 2013 at 06:59:49 UTC, Jonathan M Davis wrote: But if we make a design decision that favors 1% of our userbase I really think we all need to be more careful about these kinds of statements. I often see posts on the

Re: Having a bit if fun on stackoverflow

2013-06-27 Thread Idan Arye
On Thursday, 27 June 2013 at 04:15:27 UTC, H. S. Teoh wrote: Anything else is just the formula for endless frustration, untraceable bugs, and project failure. If your IDE's build function doesn't support full end-to-end reproducible builds, it's worthless and should be thrown out. The IDE's

Re: auto type for defaulted arguments? [Repost]

2013-06-27 Thread Nick Sabalausky
On Thu, 27 Jun 2013 19:58:58 +0200 Maxim Fomin ma...@maxim-fomin.ru wrote: On Thursday, 27 June 2013 at 17:42:14 UTC, bearophile wrote: (This is an extended repost of a message that I have put in D.learn.) Sometimes I have code like this: struct VeryLongNamedStruct {} void foo(in

Re: Having a bit if fun on stackoverflow

2013-06-27 Thread H. S. Teoh
On Thu, Jun 27, 2013 at 10:20:59PM +0200, Idan Arye wrote: On Thursday, 27 June 2013 at 04:15:27 UTC, H. S. Teoh wrote: Anything else is just the formula for endless frustration, untraceable bugs, and project failure. If your IDE's build function doesn't support full end-to-end reproducible

Re: TDD is BS?

2013-06-27 Thread Nick Sabalausky
On Sat, 22 Jun 2013 06:27:34 +0200 QAston qas...@gmail.com wrote: On Thursday, 20 June 2013 at 12:16:54 UTC, deadalnix wrote: Which lead to TITMOD, test in the middle of dev. You should write a book on that, it'd be a total paradigm shift for the non-yet-believers of TITMOD. The

Re: TDD is BS?

2013-06-27 Thread Nick Sabalausky
On Thu, 20 Jun 2013 00:15:50 +0200 Szymon Gatner noem...@gmail.com wrote: On Wednesday, 19 June 2013 at 21:59:21 UTC, Jonathan M Davis wrote: I _do_ agree with writing the tests fora function as soon as the function is done, in which case, you're likely going to have to do more

Re: Folding similar templates into one

2013-06-27 Thread Meta
On Thursday, 27 June 2013 at 03:47:39 UTC, Jonathan M Davis wrote: That's _very_ dependent on what the function does. A prime counter-example would be overloaded operators like opBinary which uses their string template arguments in mixins within the function, thereby generating completely

Re: Having a bit if fun on stackoverflow

2013-06-27 Thread Craig Dillabaugh
On Thursday, 27 June 2013 at 20:43:47 UTC, H. S. Teoh wrote: clip That's something I never really understood about the Windows / GUI world. The backend functionality is already all there, yet for some strange reason the application refuses to have the means to access that functionality,

Re: Having a bit if fun on stackoverflow

2013-06-27 Thread Idan Arye
On Thursday, 27 June 2013 at 20:43:47 UTC, H. S. Teoh wrote: That's something I never really understood about the Windows / GUI world. The backend functionality is already all there, yet for some strange reason the application refuses to have the means to access that functionality, requiring

Re: Having a bit if fun on stackoverflow

2013-06-27 Thread H. S. Teoh
On Thu, Jun 27, 2013 at 11:48:15PM +0200, Idan Arye wrote: On Thursday, 27 June 2013 at 20:43:47 UTC, H. S. Teoh wrote: That's something I never really understood about the Windows / GUI world. The backend functionality is already all there, yet for some strange reason the application refuses

Re: Having a bit if fun on stackoverflow

2013-06-27 Thread Idan Arye
On Thursday, 27 June 2013 at 21:56:00 UTC, H. S. Teoh wrote: On Thu, Jun 27, 2013 at 11:48:15PM +0200, Idan Arye wrote: On Thursday, 27 June 2013 at 20:43:47 UTC, H. S. Teoh wrote: That's something I never really understood about the Windows / GUI world. The backend functionality is already

Re: why allocators are not discussed here

2013-06-27 Thread John Colvin
On Tuesday, 25 June 2013 at 22:22:09 UTC, cybervadim wrote: I know Andrey mentioned he was going to work on Allocators a year ago. In DConf 2013 he described the problems he needs to solve with Allocators. But I wonder if I am missing the discussion around that - I tried searching this forum,

Re: memory allocation in dmd

2013-06-27 Thread Nick B
On Thursday, 27 June 2013 at 22:12:49 UTC, Nick B wrote: On Sunday, 23 June 2013 at 15:22:22 UTC, Jacob Carlborg wrote: On 2013-06-23 15:12, qznc wrote: That would be SystemTap on Linux. However, I wonder if it is the right tool for the job. [snip] here is a comparion of Systemtap and

Re: Notes from C++ static analysis

2013-06-27 Thread Peter Williams
On 27/06/13 23:33, bearophile wrote: Andrej Mitrovic: Yeah but it's not always possible to know what the formatting string is. For example, maybe you have an enum array of format strings but a runtime index into this array which you pass to format at runtime. I've ported C samples before that

Automatic typing

2013-06-27 Thread JS
Would it be possible for a language(specifically d) to have the ability to automatically type a variable by looking at its use cases without adding too much complexity? It seems to me that most compilers already can infer type mismatchs which would allow them to handle stuff like: main() {

Re: Notes from C++ static analysis

2013-06-27 Thread Peter Williams
On 28/06/13 05:52, Jonathan M Davis wrote: On Thursday, June 27, 2013 13:47:53 Adam D. Ruppe wrote: On Thursday, 27 June 2013 at 06:59:49 UTC, Jonathan M Davis wrote: But if we make a design decision that favors 1% of our userbase I really think we all need to be more careful about these

Re: Automatic typing

2013-06-27 Thread Adam D. Ruppe
I believe it would be possible. D does something similar for auto return values on functions already. Might be a bit of work in the compiler though.

Re: Automatic typing

2013-06-27 Thread Steven Schveighoffer
On Thu, 27 Jun 2013 20:34:53 -0400, JS js.m...@gmail.com wrote: Would it be possible for a language(specifically d) to have the ability to automatically type a variable by looking at its use cases without adding too much complexity? It seems to me that most compilers already can infer type

Re: Automatic typing

2013-06-27 Thread bearophile
JS: in this case x and y's type is inferred from future use. The compiler essentially just lazily infers the variable type. Obviously ambiguity will generate an error. Do you mean the flow-sensitive typing of the Whiley language? http://whiley.org/guide/typing/flow-typing/ It's surely

Linking 2 c++ libraries with D

2013-06-27 Thread Milvakili
I have successfully link c++ with D. Have ever when I create a dependency: cpp2-cpp1-d when compile with dmd dmd cpp1.a cpp2.a file.d -L-lstdc++ It compiles but when I run it I get relocation error: some path: symbol _ZNSsC1EPKcRKSaIcE, version GLIBCXX_3.4 not defined in file libstdc++.so.6

Re: Linking 2 c++ libraries with D

2013-06-27 Thread Adam D. Ruppe
On Friday, 28 June 2013 at 01:12:11 UTC, Milvakili wrote: relocation error: some path: symbol _ZNSsC1EPKcRKSaIcE, version GLIBCXX_3.4 not defined in file libstdc++.so.6 with link time reference did you compile the C++ and run the program on the same computer? This is complaining that it

Re: Linking 2 c++ libraries with D

2013-06-27 Thread Milvakili
On Friday, 28 June 2013 at 01:39:49 UTC, Adam D. Ruppe wrote: On Friday, 28 June 2013 at 01:12:11 UTC, Milvakili wrote: relocation error: some path: symbol _ZNSsC1EPKcRKSaIcE, version GLIBCXX_3.4 not defined in file libstdc++.so.6 with link time reference did you compile the C++ and run the

Re: Notes from C++ static analysis

2013-06-27 Thread Jonathan M Davis
On Friday, June 28, 2013 10:44:36 Peter Williams wrote: On 28/06/13 05:52, Jonathan M Davis wrote: On Thursday, June 27, 2013 13:47:53 Adam D. Ruppe wrote: On Thursday, 27 June 2013 at 06:59:49 UTC, Jonathan M Davis wrote: But if we make a design decision that favors 1% of our userbase

Re: Linking 2 c++ libraries with D

2013-06-27 Thread Milvakili
On Friday, 28 June 2013 at 01:42:35 UTC, Milvakili wrote: On Friday, 28 June 2013 at 01:39:49 UTC, Adam D. Ruppe wrote: On Friday, 28 June 2013 at 01:12:11 UTC, Milvakili wrote: relocation error: some path: symbol _ZNSsC1EPKcRKSaIcE, version GLIBCXX_3.4 not defined in file libstdc++.so.6 with

Re: Linking 2 c++ libraries with D

2013-06-27 Thread Juan Manuel Cabo
On 06/27/2013 10:12 PM, Milvakili wrote: I have successfully link c++ with D. Have ever when I create a dependency: cpp2-cpp1-d when compile with dmd dmd cpp1.a cpp2.a file.d -L-lstdc++ I tried it and it works _perfectly_ for me, but instead of .a I compiled the C++ files to .o

Re: Notes from C++ static analysis

2013-06-27 Thread Peter Williams
On 28/06/13 11:47, Jonathan M Davis wrote: On Friday, June 28, 2013 10:44:36 Peter Williams wrote: On 28/06/13 05:52, Jonathan M Davis wrote: On Thursday, June 27, 2013 13:47:53 Adam D. Ruppe wrote: On Thursday, 27 June 2013 at 06:59:49 UTC, Jonathan M Davis wrote: But if we make a design

Re: Linking 2 c++ libraries with D

2013-06-27 Thread Milvakili
On Friday, 28 June 2013 at 02:34:01 UTC, Juan Manuel Cabo wrote: On 06/27/2013 10:12 PM, Milvakili wrote: I have successfully link c++ with D. Have ever when I create a dependency: cpp2-cpp1-d when compile with dmd dmd cpp1.a cpp2.a file.d -L-lstdc++ I tried it and it works _perfectly_ for

Using alloca?

2013-06-27 Thread Maxime Chevalier-Boisvert
I'd like to stack-allocate an array that will be dynamically sized. Is alloca somewhere in the standard D library? If so, what should I import to have access to it?

Re: auto type for defaulted arguments? [Repost]

2013-06-27 Thread Maxim Fomin
On Thursday, 27 June 2013 at 20:24:46 UTC, Nick Sabalausky wrote: but auto can be used in paramenters too. It can? Cool! Actually I meant dmd does not support the feature now, but I see no reason for not supporting it.

Re: Using alloca?

2013-06-27 Thread Andrei Alexandrescu
On 6/27/13 9:42 PM, Maxime Chevalier-Boisvert wrote: I'd like to stack-allocate an array that will be dynamically sized. Is alloca somewhere in the standard D library? If so, what should I import to have access to it? Yah, import core.stdc.stdlib. Andrei

Re: mutable constant?

2013-06-27 Thread Namespace
You're right. I didn't read over the OP's example carefully enough. The mutation is being done to a module-level variable in an inout function, which is completely legit. I thought that what the OP thought was wrong was mutating a module-level variable in a non-mutable function (and that's

Re: How would you solve this 'interview' question in D?

2013-06-27 Thread monarch_dodra
On Wednesday, 26 June 2013 at 21:00:42 UTC, Adam D. Ruppe wrote: On Wednesday, 26 June 2013 at 20:51:35 UTC, Gary Willoughby wrote: Just for a bit of fun, I saw this question posted on reddit the other day and wondered how *you* would solve this in D? Since they didn't say *pure* function,

auto in function signature for defaulted arguments?

2013-06-27 Thread bearophile
Sometimes I have code like this: struct VeryLongNamedStruct {} void foo(in VeryLongNamedStruct x = VeryLongNamedStruct(1)) {} void main() {} Or even: void bar(in TupleFoo x = TupleFoo(TupleBar(2), TupleSpam(3))) {} So is it a good idea to allow auto in the function signature for the

Re: How would you solve this 'interview' question in D?

2013-06-27 Thread John Colvin
On Wednesday, 26 June 2013 at 20:51:35 UTC, Gary Willoughby wrote: Just for a bit of fun, I saw this question posted on reddit the other day and wondered how *you* would solve this in D? http://stackoverflow.com/questions/731832/interview-question-ffn-n The question is ambiguous as to what

Re: How would you solve this 'interview' question in D?

2013-06-27 Thread John Colvin
On Thursday, 27 June 2013 at 12:38:25 UTC, John Colvin wrote: Woops, sorry missed an assert unittest { assert(f(f(int.min)) == -(cast(long)int.min)); foreach(int n; int.min + 1 .. int.max) { assert(f(f(n)) == -n); } assert(f(f(int.max)) ==

Re: auto in function signature for defaulted arguments?

2013-06-27 Thread Andrej Mitrovic
On 6/27/13, bearophile bearophileh...@lycos.com wrote: So is it a good idea to allow auto in the function signature for the arguments that have a default value? void foo(in auto x = VeryLongNamedStruct(1)) {} I've wanted this too once. Although there's a tradeoff here, now the user has to

Re: How would you solve this 'interview' question in D?

2013-06-27 Thread John Colvin
On Wednesday, 26 June 2013 at 23:14:09 UTC, H. S. Teoh wrote: I think the 4-cycle algorithm is probably still the best one I've seen. All (correct) mathematically based answers are 4-cycle. begin very sloppy proof with mixed up notation: Let f^2(x) = -x f^4(x) = f^2(f^2(x)) = f^2(-x)

Re: auto in function signature for defaulted arguments?

2013-06-27 Thread bearophile
Andrej Mitrovic: On the other hand it could be useful in non-public and generic code. Do you have a realistic use case for generic code? Bye, bearophile

Re: auto in function signature for defaulted arguments?

2013-06-27 Thread Andrej Mitrovic
On 6/27/13, bearophile bearophileh...@lycos.com wrote: On the other hand it could be useful in non-public and generic code. Do you have a realistic use case for generic code? No, I'm just speaking out loud about the possibility.

Re: How would you solve this 'interview' question in D?

2013-06-27 Thread MattCodr
On Thursday, 27 June 2013 at 12:38:25 UTC, John Colvin wrote: The question is ambiguous as to what they mean by -n. Do they mean the result of negation on the 32bit signed int, or do they mean the negative of the number represented by that int. this matters because -int.min evaluates to

Re: How would you solve this 'interview' question in D?

2013-06-27 Thread John Colvin
On Thursday, 27 June 2013 at 15:32:05 UTC, MattCodr wrote: On Thursday, 27 June 2013 at 12:38:25 UTC, John Colvin wrote: The question is ambiguous as to what they mean by -n. Do they mean the result of negation on the 32bit signed int, or do they mean the negative of the number represented by

Re: How would you solve this 'interview' question in D?

2013-06-27 Thread MattCodr
On Thursday, 27 June 2013 at 16:02:59 UTC, John Colvin wrote: On Thursday, 27 June 2013 at 15:32:05 UTC, MattCodr wrote: On Thursday, 27 June 2013 at 12:38:25 UTC, John Colvin wrote: The question is ambiguous as to what they mean by -n. Do they mean the result of negation on the 32bit signed

Re: How would you solve this 'interview' question in D?

2013-06-27 Thread Steven Schveighoffer
On Thu, 27 Jun 2013 04:09:39 -0400, monarch_dodra monarchdo...@gmail.com wrote: On Wednesday, 26 June 2013 at 21:00:42 UTC, Adam D. Ruppe wrote: On Wednesday, 26 June 2013 at 20:51:35 UTC, Gary Willoughby wrote: Just for a bit of fun, I saw this question posted on reddit the other day and

  1   2   >