Re: Potential GSoC project - GC improvements

2016-03-09 Thread NX via Digitalmars-d
On Wednesday, 9 March 2016 at 22:49:28 UTC, Jeremy DeHaan wrote: Hey all, I'm trying to think of good project ideas for this years GSoC, and one in particular I thought would be a great was working on and improving the GC. I'm not sure what the scope of this project would be like, but at the

Re: Speed kills

2016-03-09 Thread Jon D via Digitalmars-d
On Wednesday, 9 March 2016 at 20:30:10 UTC, Jon D wrote: I seen a few cases while exploring D. Turns out there are issues filed for each of the performance issues I mentioned: * Lower casing strings: https://issues.dlang.org/show_bug.cgi?id=11229 * Large associative arrays:

Re: How to sort a range

2016-03-09 Thread Ali Çehreli via Digitalmars-d-learn
On 03/09/2016 06:50 PM, rcorre wrote: > sort calls to quicksort (for unstable, at least) which uses > swapAt. swapAt takes the range by value, so it just swaps the values in > its local copy. Remembering that a range is not the collection, swapAt takes the range by value but it does not copy

[Issue 2504] Reserve for associative arrays

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2504 Jon Degenhardt changed: What|Removed |Added CC|

[Issue 11229] std.string.toLower is slow

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11229 Jon Degenhardt changed: What|Removed |Added CC|

[Issue 15038] Associative Array .get property const vs immutable

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15038 Jon Degenhardt changed: What|Removed |Added CC|

Re: Potential GSoC project - GC improvements

2016-03-09 Thread Adam Wilson via Digitalmars-d
Jeremy DeHaan wrote: Hey all, I'm trying to think of good project ideas for this years GSoC, and one in particular I thought would be a great was working on and improving the GC. I'm not sure what the scope of this project would be like, but at the moment I am thinking writing a generational

Re: Named arguments via struct initialization in functions

2016-03-09 Thread Michael Coulombe via Digitalmars-d
On Thursday, 10 March 2016 at 05:17:03 UTC, Michael Coulombe wrote: [...] Whoops, forgot this: private immutable struct KeyWordDollar { @property auto opDispatch(string param, T)(T t) { return Named!(param,T)(t); } }

Re: Named arguments via struct initialization in functions

2016-03-09 Thread Michael Coulombe via Digitalmars-d
On Wednesday, 9 March 2016 at 12:55:16 UTC, Idan Arye wrote: Allowing something like `auto params = [:y : 50, :x : 100]` won't really solve anything. It works nicely in Ruby, because Ruby has dynamic typing and with some syntactic sugar you get elegant syntax for dynamic structs. But in a

Re: How to import for mixin contents only.

2016-03-09 Thread Taylor Hillegeist via Digitalmars-d-learn
On Thursday, 10 March 2016 at 04:56:52 UTC, Mike Parker wrote: On Thursday, 10 March 2016 at 04:07:54 UTC, Taylor Hillegeist wrote: So i want bitfields for just a little bit. but i dont want its dependencies. How is it done. I have tried this. but it doesnt seem to work on gdc. :( struct

Re: Potential GSoC project - GC improvements

2016-03-09 Thread Joakim via Digitalmars-d
On Wednesday, 9 March 2016 at 22:49:28 UTC, Jeremy DeHaan wrote: Hey all, I'm trying to think of good project ideas for this years GSoC, and one in particular I thought would be a great was working on and improving the GC. I'm not sure what the scope of this project would be like, but at the

Re: How to import for mixin contents only.

2016-03-09 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 10 March 2016 at 04:07:54 UTC, Taylor Hillegeist wrote: So i want bitfields for just a little bit. but i dont want its dependencies. How is it done. I have tried this. but it doesnt seem to work on gdc. :( struct Color_t { static if(__ctfe){ import

Re: Alias this does not work with pointers?

2016-03-09 Thread Chris Wright via Digitalmars-d
alias this can do so much more, though. For instance: struct Foo { int a; string b; alias a this; } void bar(int* p, size_t len) { for (int i = 0; i < len; i++) { p[i] = 0; } } bar(new Foo[2].ptr, 2); Two fields. You don't want to overwrite a pointer, so you

How to import for mixin contents only.

2016-03-09 Thread Taylor Hillegeist via Digitalmars-d-learn
So i want bitfields for just a little bit. but i dont want its dependencies. How is it done. I have tried this. but it doesnt seem to work on gdc. :( struct Color_t { static if(__ctfe){ import std.bitmanip:bitfields; } mixin(bitfields!(

Re: My whereabouts

2016-03-09 Thread Jack Stouffer via Digitalmars-d
On Wednesday, 9 March 2016 at 12:58:24 UTC, Andrei Alexandrescu wrote: Folks, I've been a tad scarce in the past month or so. This is because I've been working on a paper submission, which turned out to be a major and extremely captivating effort. Can't share yet - double blind review system.

Re: How to sort a range

2016-03-09 Thread rcorre via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 16:53:08 UTC, Xinok wrote: On Wednesday, 9 March 2016 at 15:39:55 UTC, rcorre wrote: Still curious as to why it fails; maybe the range is getting copied at some point? I guess I need to step through it. That's my suspicion as well. It seems that OnlyResult is

Re: A comparison between C++ and D

2016-03-09 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 10 March 2016 at 00:31:00 UTC, John Colvin wrote: what magic is this? I had no idea that taking the address of opCall would give me a delegate. opCall is a red herring: taking the address of *any* non-static member function in a class or struct object will give you a delegate.

Re: Is it safe to use 'is' to compare types?

2016-03-09 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Mar 10, 2016 at 01:33:41AM +, Yuxuan Shui via Digitalmars-d-learn wrote: > On Wednesday, 9 March 2016 at 22:26:38 UTC, Ali Çehreli wrote: > >On 03/09/2016 07:05 AM, Yuxuan Shui wrote: > > > >> Can we left TypeInfo symbol undefined in the shared libraries? i.e. > >> D compiler will

Re: Alias this does not work with pointers?

2016-03-09 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 10 March 2016 at 01:25:44 UTC, Nicholas Wilson wrote: struct Bar_T; // opaque alias Bar = Bar_T*; void someFuncIWantWrapped(Bar* bar) { } struct Foo { Bar bar; alias bar this; } void someFunc(Foo* foo) { someFuncIWantWrapped(foo); } gives Error: function

Re: Is it safe to use 'is' to compare types?

2016-03-09 Thread Yuxuan Shui via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 22:26:38 UTC, Ali Çehreli wrote: On 03/09/2016 07:05 AM, Yuxuan Shui wrote: > Can we left TypeInfo symbol undefined in the shared libraries? i.e. D > compiler will strip out TypeInfo definition when creating .so. > (Alternatively, we can have TypeInfo always

Alias this does not work with pointers?

2016-03-09 Thread Nicholas Wilson via Digitalmars-d
struct Bar_T; // opaque alias Bar = Bar_T*; void someFuncIWantWrapped(Bar* bar) { } struct Foo { Bar bar; alias bar this; } void someFunc(Foo* foo) { someFuncIWantWrapped(foo); } gives Error: function someFuncIWantWrapped (Bar_T** bar) is not callable using argument types Foo* I

[Issue 314] [module] Static, renamed, and selective imports are always public

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=314 github-bugzi...@puremagic.com changed: What|Removed |Added Status|REOPENED|RESOLVED

[Issue 3108] [meta] Protection

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3108 Issue 3108 depends on issue 314, which changed state. Issue 314 Summary: [module] Static, renamed, and selective imports are always public https://issues.dlang.org/show_bug.cgi?id=314 What|Removed |Added

[Issue 2830] private attribute doesn't work for structs/unions/classes

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2830 Issue 2830 depends on issue 314, which changed state. Issue 314 Summary: [module] Static, renamed, and selective imports are always public https://issues.dlang.org/show_bug.cgi?id=314 What|Removed |Added

[Issue 314] [module] Static, renamed, and selective imports are always public

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=314 --- Comment #52 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/7cf24a4b5f07f920c0d772ac84a3c5547db2c538 fix Issue 314 - static,

Re: A comparison between C++ and D

2016-03-09 Thread John Colvin via Digitalmars-d
On Wednesday, 9 March 2016 at 20:14:13 UTC, Adam D. Ruppe wrote: --- import std.stdio; @nogc int delegate(int) dg; int helper() @nogc { int a = 50; struct MyFunctor { int a; @nogc this(int a) { this.a = a; } // the function

Re: Named arguments via struct initialization in functions

2016-03-09 Thread John Colvin via Digitalmars-d
On Wednesday, 9 March 2016 at 07:30:31 UTC, Edwin van Leeuwen wrote: On Sunday, 6 March 2016 at 17:35:38 UTC, Seb wrote: [...] In ggplotd I often use named tuples as and "anonymoous" struct: Tuple!(double,"x")( 0.0 ) I also added a merge function that will return a tuple containing merged

Re: New Article: My Experience Porting Python Dateutil's Date Parser to D

2016-03-09 Thread Jack Stouffer via Digitalmars-d-announce
On Wednesday, 9 March 2016 at 23:31:04 UTC, Ola Fosheim Grøstad wrote: On Wednesday, 9 March 2016 at 22:17:39 UTC, H. S. Teoh wrote: system for my personal projects), I can totally sympathize with the annoyances of using a dynamically-typed language, as well as dodgy iterator designs like

[Issue 15224] making 'clean' results in garbage commands

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15224 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 15224] making 'clean' results in garbage commands

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15224 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/4e8c3492083d9f5ee19c22012820e5535f99147a fix Issue 15224 -

Re: New Article: My Experience Porting Python Dateutil's Date Parser to D

2016-03-09 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Wednesday, 9 March 2016 at 22:17:39 UTC, H. S. Teoh wrote: system for my personal projects), I can totally sympathize with the annoyances of using a dynamically-typed language, as well as dodgy iterator designs like __next__. (I've not had to deal with __next__ in Python so far, but *have*

Re: A comparison between C++ and D

2016-03-09 Thread Atila Neves via Digitalmars-d
On Wednesday, 9 March 2016 at 22:54:13 UTC, bigsandwich wrote: On Wednesday, 9 March 2016 at 22:05:28 UTC, Ola Fosheim Grøstad wrote: [...] Yes, I do. std::function<> uses type erasure to store a "function". If its small enough, its stored internally, otherwise it goes on the heap. It

Re: A comparison between C++ and D

2016-03-09 Thread bigsandwich via Digitalmars-d
On Wednesday, 9 March 2016 at 22:05:28 UTC, Ola Fosheim Grøstad wrote: On Wednesday, 9 March 2016 at 20:41:35 UTC, bigsandwich wrote: Right, I used to this sort of thing in C++ prior to C++11. I think not having an RAII wrapper for lambdas similar to std::function<> is an oversight for D,

Potential GSoC project - GC improvements

2016-03-09 Thread Jeremy DeHaan via Digitalmars-d
Hey all, I'm trying to think of good project ideas for this years GSoC, and one in particular I thought would be a great was working on and improving the GC. I'm not sure what the scope of this project would be like, but at the moment I am thinking writing a generational collector would be a

Re: Memory Efficient HashSet

2016-03-09 Thread Nordlöw via Digitalmars-d-learn
On Tuesday, 8 March 2016 at 12:25:36 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 8 March 2016 at 08:12:04 UTC, Nordlöw wrote: sparse_hash_set<> contained in https://github.com/sparsehash/sparsehash It appears to be very slow? What do you need it for? My knowledge database engine I'm

Re: Is it safe to use 'is' to compare types?

2016-03-09 Thread Ali Çehreli via Digitalmars-d-learn
On 03/09/2016 07:05 AM, Yuxuan Shui wrote: > Can we left TypeInfo symbol undefined in the shared libraries? i.e. D > compiler will strip out TypeInfo definition when creating .so. > (Alternatively, we can have TypeInfo always undefined in .o, and > generate them in linking stage only when

Re: Use of GUID constants

2016-03-09 Thread Ali Çehreli via Digitalmars-d-learn
On 03/09/2016 10:35 AM, KlausO wrote: > IUnknown pUnk; > > // > // Does not compile: > // > // Error: function > core.sys.windows.unknwn.IUnknown.QueryInterface(const(GUID)* riid, > void** pvObject) is not callable using argument types (const(GUID),

Re: New Article: My Experience Porting Python Dateutil's Date Parser to D

2016-03-09 Thread H. S. Teoh via Digitalmars-d-announce
On Wed, Mar 09, 2016 at 02:12:42PM -0800, Walter Bright via Digitalmars-d-announce wrote: > On 3/9/2016 1:55 PM, Jack Stouffer wrote: > >Hello everyone, > > > >I have spent the last two weeks porting the date string parsing > >functionality from the popular Python library, dateutil, to D. I have

Re: New Article: My Experience Porting Python Dateutil's Date Parser to D

2016-03-09 Thread Walter Bright via Digitalmars-d-announce
On 3/9/2016 1:55 PM, Jack Stouffer wrote: Hello everyone, I have spent the last two weeks porting the date string parsing functionality from the popular Python library, dateutil, to D. I have written about my experience here: http://jackstouffer.com/blog/porting_dateutil.html The code and docs

Re: A comparison between C++ and D

2016-03-09 Thread Ola Fosheim Grøstad via Digitalmars-d
On Wednesday, 9 March 2016 at 20:41:35 UTC, bigsandwich wrote: Right, I used to this sort of thing in C++ prior to C++11. I think not having an RAII wrapper for lambdas similar to std::function<> is an oversight for D, especially for people averse to GC. That little bit of syntactic sugar

New Article: My Experience Porting Python Dateutil's Date Parser to D

2016-03-09 Thread Jack Stouffer via Digitalmars-d-announce
Hello everyone, I have spent the last two weeks porting the date string parsing functionality from the popular Python library, dateutil, to D. I have written about my experience here: http://jackstouffer.com/blog/porting_dateutil.html The code and docs can be found here:

Re: Speed kills

2016-03-09 Thread John Colvin via Digitalmars-d
On Wednesday, 9 March 2016 at 21:01:13 UTC, H. S. Teoh wrote: On Wed, Mar 09, 2016 at 08:30:10PM +, Jon D via Digitalmars-d wrote: On Tuesday, 8 March 2016 at 14:14:25 UTC, ixid wrote: >[...] In the case of std.algorithm.sum, the focus is on accuracy rather than performance. It does

Re: DConf registrations have passed 110!

2016-03-09 Thread Walter Bright via Digitalmars-d-announce
On 3/9/2016 9:35 AM, Martin Tschierschke wrote: On Tuesday, 8 March 2016 at 22:54:00 UTC, Walter Bright wrote: This is more than double that of previous DConf's, and we've still got nearly 2 months to go! We've also been deluged with presentation proposals, and have a lot of work to do to sort

Re: Speed kills

2016-03-09 Thread H. S. Teoh via Digitalmars-d
On Wed, Mar 09, 2016 at 08:30:10PM +, Jon D via Digitalmars-d wrote: > On Tuesday, 8 March 2016 at 14:14:25 UTC, ixid wrote: > >Since I posted this thread I've learned std.algorithm.sum is 4 times > >slower than a naive loop sum. Even if this is for reasons of accuracy > >this is exactly what

Re: A comparison between C++ and D

2016-03-09 Thread bigsandwich via Digitalmars-d
On Wednesday, 9 March 2016 at 20:14:13 UTC, Adam D. Ruppe wrote: On Wednesday, 9 March 2016 at 18:26:01 UTC, bigsandwich wrote: [...] You can easily do it yourself with a struct. That's all the c++ lambda is anyway, a bit of syntax sugar over a struct. [...] Right, I used to this sort

Re: Trying to build a Scheme interpreter in D

2016-03-09 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 8 March 2016 at 18:11:24 UTC, John wrote: * For this kind of implementation, is the Algebraic type a good choice ? Is a simple union perhaps better ? You can go with Algebraic. I used to do that in scheme-d. Then I switched to a tagged union by hand to avoid a compiler

Re: Speed kills

2016-03-09 Thread Jon D via Digitalmars-d
On Tuesday, 8 March 2016 at 14:14:25 UTC, ixid wrote: Since I posted this thread I've learned std.algorithm.sum is 4 times slower than a naive loop sum. Even if this is for reasons of accuracy this is exactly what I am talking about- this is a hidden iceberg of terrible performance that will

Re: Named arguments via struct initialization in functions

2016-03-09 Thread Idan Arye via Digitalmars-d
On Wednesday, 9 March 2016 at 13:39:57 UTC, Martin Tschierschke wrote: On Wednesday, 9 March 2016 at 12:55:16 UTC, Idan Arye wrote: [...] [...] [...] Thats true. [...] Yes.Ok. What I like about the :symbol notation is, that a string witch is used only to distinguish between different

Re: Pitching D to academia

2016-03-09 Thread Ola Fosheim Grøstad via Digitalmars-d
On Wednesday, 9 March 2016 at 19:45:40 UTC, cym13 wrote: Let's add that D binaries are usually too bloated for their disassembly to be as readable as their C equivalent (mangling doesn't help) so even for "reverse engineering" assembly it is less than perfect (although perfectly doable of

Re: A comparison between C++ and D

2016-03-09 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 9 March 2016 at 18:26:01 UTC, bigsandwich wrote: As far as I know capturing other variables requires the GC in D. You can easily do it yourself with a struct. That's all the c++ lambda is anyway, a bit of syntax sugar over a struct. Then you pass the struct itself if you want

Re: A comparison between C++ and D

2016-03-09 Thread Ola Fosheim Grøstad via Digitalmars-d
On Wednesday, 9 March 2016 at 18:26:01 UTC, bigsandwich wrote: Is this really true? Couldn't the closure be stored internally somewhere like std::function<> does in C++? Lambdas in C++ creates a regular class with a call-operator, the class is instantiated and the fields filled with the

Re: Pitching D to academia

2016-03-09 Thread cym13 via Digitalmars-d
On Wednesday, 9 March 2016 at 19:34:24 UTC, Ola Fosheim Grøstad wrote: On Wednesday, 9 March 2016 at 16:25:46 UTC, Craig Dillabaugh wrote: I may be way off-base here but would teaching assembly be a good way to get D into the hands of undergrads? Learning assembly requires some sort of

Re: Pitching D to academia

2016-03-09 Thread Laeeth Isharc via Digitalmars-d
On Wednesday, 9 March 2016 at 16:12:08 UTC, Michael wrote: On Sunday, 6 March 2016 at 08:40:17 UTC, Ola Fosheim Grøstad wrote: On Sunday, 6 March 2016 at 07:38:01 UTC, Ali Çehreli wrote: Motivated by Dmitry's "Pitching D to a gang of Gophers" thread, how about pitching it to a gang of

Re: Pitching D to academia

2016-03-09 Thread Ola Fosheim Grøstad via Digitalmars-d
On Wednesday, 9 March 2016 at 16:25:46 UTC, Craig Dillabaugh wrote: I may be way off-base here but would teaching assembly be a good way to get D into the hands of undergrads? Learning assembly requires some sort of 'harness' to code your assembly in. I don't know what is common now, but I

Re: A comparison between C++ and D

2016-03-09 Thread maik klein via Digitalmars-d
On Wednesday, 9 March 2016 at 18:26:01 UTC, bigsandwich wrote: On Wednesday, 9 March 2016 at 01:18:26 UTC, maik klein wrote: [...] C++ as well as D have anonymous functions. C++: [](auto a, auto b){ return a + b;} , D: (a, b) => a + b or (a, b){return a + b;}. As far as I know capturing

Re: LLVM 3.8 released - and LDC is already able to use it!

2016-03-09 Thread Johan Engelen via Digitalmars-d-announce
On Tuesday, 8 March 2016 at 19:12:57 UTC, Kai Nacke wrote: Hi all! LLVM 3.8 has been released half an hour ago! See the release notes here: http://www.llvm.org/releases/3.8.0/docs/ReleaseNotes.html Downloads: http://www.llvm.org/releases/download.html#3.8.0 Also note that LDC is mentioned

Re: What can _not_ be marked pure?

2016-03-09 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Mar 09, 2016 at 05:12:18AM -0800, Jonathan M Davis via Digitalmars-d-learn wrote: [...] > So, in general, you can slap pure on most anything, though it will > rarely buy you anything in terms of performance. IMO, this is an area where the compiler could be improved to take better

Re: Argon: an alternative parser for command-line arguments

2016-03-09 Thread Markus Laker via Digitalmars-d-announce
On Saturday, 5 March 2016 at 16:28:25 UTC, karabuta wrote: I think he meant: [git status --help], where you have three attributes with the last one being the flag. So in addition to: [status --help] by default, you also have: [git status --help] to get help on status only. Odd: I wrote a

Re: A comparison between C++ and D

2016-03-09 Thread Namespace via Digitalmars-d
On Wednesday, 9 March 2016 at 01:18:26 UTC, maik klein wrote: Direct link: https://maikklein.github.io/post/CppAndD/ Reddit link: https://www.reddit.com/r/programming/comments/49lna6/a_comparison_between_c_and_d/ If you spot any mistakes, please let me know. I'm missing the wildcard

Use of GUID constants

2016-03-09 Thread KlausO via Digitalmars-d-learn
Dear list, I use DMD 2.070.0 I try to access COM Interfaces via the declarations in core.sys.windows.* I have some problems and maybe someone could give me a usage hint. Have a look at the following (relatively meaningless) sample program which demonstrates the problem. IMHO the problem is

Re: A comparison between C++ and D

2016-03-09 Thread bigsandwich via Digitalmars-d
On Wednesday, 9 March 2016 at 01:18:26 UTC, maik klein wrote: Direct link: https://maikklein.github.io/post/CppAndD/ Reddit link: https://www.reddit.com/r/programming/comments/49lna6/a_comparison_between_c_and_d/ If you spot any mistakes, please let me know. C++ as well as D have anonymous

unit-threaded v0.6.5 - Type-parametrized tests

2016-03-09 Thread Atila Neves via Digitalmars-d-announce
The forum must be sick of hearing from me... :P For those not in the know, unit-threaded is an advanced unit testing library for D: http://code.dlang.org/packages/unit-threaded The v0.6.3 release had tests parametrized by value; this v0.6.5 release brings with it the possibility of

Re: Memory Corruption Issue??

2016-03-09 Thread Bottled Gin via Digitalmars-d
The fix turned out to be much simpler than what I had thought. https://github.com/D-Programming-Language/druntime/pull/1506

[Issue 15513] Memory Corruption with thread local objects

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15513 --- Comment #6 from Puneet Goel --- https://github.com/D-Programming-Language/druntime/pull/1506 Wroks for me for linux. --

Re: DConf registrations have passed 110!

2016-03-09 Thread Martin Tschierschke via Digitalmars-d-announce
On Tuesday, 8 March 2016 at 22:54:00 UTC, Walter Bright wrote: This is more than double that of previous DConf's, and we've still got nearly 2 months to go! We've also been deluged with presentation proposals, and have a lot of work to do to sort through them. All in all, this promises to

Re: Deduction regression or improvement?

2016-03-09 Thread H. S. Teoh via Digitalmars-d
On Wed, Mar 09, 2016 at 02:42:51PM +, Meta via Digitalmars-d wrote: > On Tuesday, 8 March 2016 at 22:35:57 UTC, H. S. Teoh wrote: > >IMO, this *should* compile and infer T == const(SomeStruct) as the > >common type of a and b. But I'm not sure whether or not this is a > >regression. > > Does

Re: GC scan for pointers

2016-03-09 Thread Chris Wright via Digitalmars-d-learn
On Wed, 09 Mar 2016 15:50:43 +, Adam D. Ruppe wrote: > Or static > arrays of int on the stack will also be scanned, since the GC doesn't > actually know much about local variables It's especially tricky because compilers can reuse memory on the stack -- for instance, if I use one variable

Re: How to sort a range

2016-03-09 Thread Chris Wright via Digitalmars-d-learn
On Wed, 09 Mar 2016 14:28:11 +, cym13 wrote: > Note that an input range isn't even remotely a container Which is why sort() has template constraints beyond isInputRange. The constraints ensure that it is possible to swap values in the range.

Re: How to sort a range

2016-03-09 Thread Xinok via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 15:39:55 UTC, rcorre wrote: Still curious as to why it fails; maybe the range is getting copied at some point? I guess I need to step through it. That's my suspicion as well. It seems that OnlyResult is pass-by-value so every time it gets passed to another

Re: Pitching D to academia

2016-03-09 Thread Craig Dillabaugh via Digitalmars-d
On Wednesday, 9 March 2016 at 16:12:08 UTC, Michael wrote: On Sunday, 6 March 2016 at 08:40:17 UTC, Ola Fosheim Grøstad wrote: On Sunday, 6 March 2016 at 07:38:01 UTC, Ali Çehreli wrote: Motivated by Dmitry's "Pitching D to a gang of Gophers" thread, how about pitching it to a gang of

Re: Cannot compile program with DMD built from source

2016-03-09 Thread Minas Mina via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 16:13:38 UTC, Minas Mina wrote: Hello, I have followed the instructions here (http://wiki.dlang.org/Starting_as_a_Contributor#POSIX) to install DMD, druntime and phobos from source. My platform is Ubuntu 15.10 x64. This is the error I get:

Cannot compile program with DMD built from source

2016-03-09 Thread Minas Mina via Digitalmars-d-learn
Hello, I have followed the instructions here (http://wiki.dlang.org/Starting_as_a_Contributor#POSIX) to install DMD, druntime and phobos from source. My platform is Ubuntu 15.10 x64. This is the error I get: http://pastebin.com/kWCv0ymn

Re: Pitching D to academia

2016-03-09 Thread Michael via Digitalmars-d
On Sunday, 6 March 2016 at 08:40:17 UTC, Ola Fosheim Grøstad wrote: On Sunday, 6 March 2016 at 07:38:01 UTC, Ali Çehreli wrote: Motivated by Dmitry's "Pitching D to a gang of Gophers" thread, how about pitching it to a gang of professors and graduate students? The geeky graduate students are

Re: Pitching D to a gang of Gophers

2016-03-09 Thread Shammah Chancellor via Digitalmars-d
On Wednesday, 9 March 2016 at 13:23:55 UTC, Andrei Alexandrescu wrote: On 03/07/2016 02:17 PM, landaire wrote: I'd like to add that one of the things that I love about Go is that it is crazy easy to cross-compile. `GOOS=freebsd go build` and I have a FreeBSD binary sitting in my working

Re: How to sort a range

2016-03-09 Thread rcorre via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 14:28:11 UTC, cym13 wrote: Note that an input range isn't even remotely a container, it's a way to iterate on a container. As you don't have all elements at hand you can't sort them, that's why you have to use array here. Oh, I think it just clicked. I was

Re: GC scan for pointers

2016-03-09 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 15:14:02 UTC, Gerald Jansen wrote: will the large memory blocks allocated for a, b and/or c actually be scanned for pointers to GC-allocated memory during a garbage collection? If so, why? No. It knows that the type has no pointers in it, so it will not scan it

Re: How to sort a range

2016-03-09 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 15:39:55 UTC, rcorre wrote: On Wednesday, 9 March 2016 at 14:28:11 UTC, cym13 wrote: Still curious as to why it fails; maybe the range is getting copied at some point? I guess I need to step through it. I did try different SwapStrategies with no luck. Since

[Issue 15778] [REG2.064] polysemous string type doesn't work in array operation

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15778 Kenji Hara changed: What|Removed |Added Keywords||pull, rejects-valid ---

Re: How to sort a range

2016-03-09 Thread rcorre via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 14:28:11 UTC, cym13 wrote: On Wednesday, 9 March 2016 at 12:21:55 UTC, rcorre wrote: On Wednesday, 9 March 2016 at 09:15:01 UTC, Edwin van Leeuwen wrote: I'm not sure why your fix didn't work, but generally I work around this by converting the OnlyResult into an

[Issue 15722] std.algorithm sum should favour speed

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15722 --- Comment #5 from adamsib...@hotmail.com --- >John Colvin 2016-03-09 15:08:05 UTC >https://github.com/D-Programming-Language/phobos/pull/4069 Thanks John! Out of interest what is the impact on accuracy between the two methods? --

Re: Is it safe to use 'is' to compare types?

2016-03-09 Thread Yuxuan Shui via Digitalmars-d-learn
On Tuesday, 8 March 2016 at 23:13:32 UTC, Anon wrote: On Tuesday, 8 March 2016 at 20:26:04 UTC, Yuxuan Shui wrote: [...] [Note: I phrase my answer in terms of Linux shared libraries (*.so) because D doesn't actually have proper Windows DLL support yet. The same would apply to DLLs, it just

[Issue 15722] std.algorithm sum should favour speed

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15722 John Colvin changed: What|Removed |Added CC|

GC scan for pointers

2016-03-09 Thread Gerald Jansen via Digitalmars-d-learn
I've studied [1] and [2] but don't understand everything there. Hence these dumb questions: Given enum n = 100_000_000; // some big number auto a = new ulong[](n); auto b = new char[8][](n); struct S { ulong x; char[8] y; } auto c = new S[](n); will the large memory blocks allocated

Re: Speed kills

2016-03-09 Thread jmh530 via Digitalmars-d
On Wednesday, 9 March 2016 at 13:42:40 UTC, cym13 wrote: They just don't do the same thing, sum() uses pairwise summation which is safer as I understand it. Corresponding issue: https://issues.dlang.org/show_bug.cgi?id=15722 That third comment about how it's not obvious which algorithm sum

[Issue 15778] [REG2.064] polysemous string type doesn't work in array operation

2016-03-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15778 Kenji Hara changed: What|Removed |Added Summary|polysemous string type |[REG2.064] polysemous

Re: Deduction regression or improvement?

2016-03-09 Thread Meta via Digitalmars-d
On Tuesday, 8 March 2016 at 22:35:57 UTC, H. S. Teoh wrote: IMO, this *should* compile and infer T == const(SomeStruct) as the common type of a and b. But I'm not sure whether or not this is a regression. Does template type inference do implicit conversion? I thought it did not, and thus

Re: Speed kills

2016-03-09 Thread John Colvin via Digitalmars-d
On Wednesday, 9 March 2016 at 14:04:40 UTC, Andrei Alexandrescu wrote: On 3/9/16 9:03 AM, John Colvin wrote: On Wednesday, 9 March 2016 at 13:26:45 UTC, Andrei Alexandrescu wrote: On 03/08/2016 09:14 AM, ixid wrote: [...] Whoa. What's happening there? Do we have anyone on it? -- Andrei

Re: How to sort a range

2016-03-09 Thread cym13 via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 12:21:55 UTC, rcorre wrote: On Wednesday, 9 March 2016 at 09:15:01 UTC, Edwin van Leeuwen wrote: I'm not sure why your fix didn't work, but generally I work around this by converting the OnlyResult into an array: import std.array : array;

Re: Pitching D to a gang of Gophers

2016-03-09 Thread ZombineDev via Digitalmars-d
On Wednesday, 9 March 2016 at 13:23:55 UTC, Andrei Alexandrescu wrote: On 03/07/2016 02:17 PM, landaire wrote: I'd like to add that one of the things that I love about Go is that it is crazy easy to cross-compile. `GOOS=freebsd go build` and I have a FreeBSD binary sitting in my working

Re: Speed kills

2016-03-09 Thread Andrei Alexandrescu via Digitalmars-d
On 3/9/16 9:03 AM, John Colvin wrote: On Wednesday, 9 March 2016 at 13:26:45 UTC, Andrei Alexandrescu wrote: On 03/08/2016 09:14 AM, ixid wrote: Since I posted this thread I've learned std.algorithm.sum is 4 times slower than a naive loop sum. Even if this is for reasons of accuracy this is

Re: Speed kills

2016-03-09 Thread John Colvin via Digitalmars-d
On Wednesday, 9 March 2016 at 13:26:45 UTC, Andrei Alexandrescu wrote: On 03/08/2016 09:14 AM, ixid wrote: Since I posted this thread I've learned std.algorithm.sum is 4 times slower than a naive loop sum. Even if this is for reasons of accuracy this is exactly what I am talking about- this is

Re: My whereabouts

2016-03-09 Thread Andrei Alexandrescu via Digitalmars-d
On 3/9/16 8:36 AM, Robert burner Schadek wrote: On Wednesday, 9 March 2016 at 12:58:24 UTC, Andrei Alexandrescu wrote: Next on my coding agenda is rcstring. I thought you were working on the container, or has [1] established itself as pseudo standard. About rcstring, I have [2] which works

Re: Speed kills

2016-03-09 Thread cym13 via Digitalmars-d
On Wednesday, 9 March 2016 at 13:26:45 UTC, Andrei Alexandrescu wrote: On 03/08/2016 09:14 AM, ixid wrote: Since I posted this thread I've learned std.algorithm.sum is 4 times slower than a naive loop sum. Even if this is for reasons of accuracy this is exactly what I am talking about- this is

Re: Speed kills

2016-03-09 Thread Daniel Kozak via Digitalmars-d
Dne 9.3.2016 v 14:26 Andrei Alexandrescu via Digitalmars-d napsal(a): On 03/08/2016 09:14 AM, ixid wrote: Since I posted this thread I've learned std.algorithm.sum is 4 times slower than a naive loop sum. Even if this is for reasons of accuracy this is exactly what I am talking about- this is

Re: What can _not_ be marked pure?

2016-03-09 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 13:12:18 UTC, Jonathan M Davis wrote: In general though, you should use pure wherever possible. - Jonathan M Davis Thanks for the detailed answer and gotchas. It thought compilers would use pure in alias analysis to ensure everything did not mutate during a

Re: Named arguments via struct initialization in functions

2016-03-09 Thread Martin Tschierschke via Digitalmars-d
On Wednesday, 9 March 2016 at 12:55:16 UTC, Idan Arye wrote: [...] An other point on my wish list would be to allow string symbol notation like in ruby. Than using hashes (AA) for parameters gets more convenient: :symbol <= just short for => "symbol" h[:y]= 50; h[:x] = 100; // <=> h["y"] =

Re: My whereabouts

2016-03-09 Thread Robert burner Schadek via Digitalmars-d
On Wednesday, 9 March 2016 at 12:58:24 UTC, Andrei Alexandrescu wrote: Next on my coding agenda is rcstring. I thought you were working on the container, or has [1] established itself as pseudo standard. About rcstring, I have [2] which works for what I need for. I plan to extend it some

Re: A comparison between C++ and D

2016-03-09 Thread Andrei Alexandrescu via Digitalmars-d
On 03/08/2016 08:18 PM, maik klein wrote: Direct link: https://maikklein.github.io/post/CppAndD/ Reddit link: https://www.reddit.com/r/programming/comments/49lna6/a_comparison_between_c_and_d/ If you spot any mistakes, please let me know. Nice work, thanks! -- Andrei

Re: LLVM 3.8 released - and LDC is already able to use it!

2016-03-09 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 03/08/2016 02:12 PM, Kai Nacke wrote: Hi all! LLVM 3.8 has been released half an hour ago! See the release notes here: http://www.llvm.org/releases/3.8.0/docs/ReleaseNotes.html Downloads: http://www.llvm.org/releases/download.html#3.8.0 Also note that LDC is mentioned in the release notes

Re: Speed kills

2016-03-09 Thread Andrei Alexandrescu via Digitalmars-d
On 03/08/2016 09:14 AM, ixid wrote: Since I posted this thread I've learned std.algorithm.sum is 4 times slower than a naive loop sum. Even if this is for reasons of accuracy this is exactly what I am talking about- this is a hidden iceberg of terrible performance that will reflect poorly on D.

  1   2   >