Re: Hooking into GC

2016-06-28 Thread Ali Çehreli via Digitalmars-d-learn
On 06/28/2016 08:39 PM, MMJones wrote: > Yeah, I saw that. I'm looking the general answer though. Not just for > GC. Does D basically combine the d files in to phobos when they are > modified? No. Somebody must explicitly build the library. However, any code that's templated cannot be

Re: Accessing types by context

2016-06-28 Thread Hiemlick Hiemlicker via Digitalmars-d
On Wednesday, 29 June 2016 at 04:34:26 UTC, Chang Long wrote: On Wednesday, 29 June 2016 at 03:11:52 UTC, Hiemlick Hiemlicker wrote: test(myEnum.A | myEnum.B & myEnum.C). I like this: myEnum.( A | B & C) == myEnum.A | myEnum.B & myEnum.C Does that even work? Regardless, You still have

Re: Accessing types by context

2016-06-28 Thread Hiemlick Hiemlicker via Digitalmars-d
On Wednesday, 29 June 2016 at 03:50:35 UTC, Carl Vogel wrote: On Wednesday, 29 June 2016 at 03:11:52 UTC, Hiemlick Hiemlicker wrote: Suppose one has void test(myEnum e) enum myEnum { A,B,C } [...] Doesn't the with statement solve your problem here? with (myEnum) { test(A); test(B);

Re: Accessing types by context

2016-06-28 Thread Chang Long via Digitalmars-d
On Wednesday, 29 June 2016 at 03:11:52 UTC, Hiemlick Hiemlicker wrote: test(myEnum.A | myEnum.B & myEnum.C). I like this: myEnum.( A | B & C) == myEnum.A | myEnum.B & myEnum.C

Re: Accessing types by context

2016-06-28 Thread Carl Vogel via Digitalmars-d
On Wednesday, 29 June 2016 at 03:11:52 UTC, Hiemlick Hiemlicker wrote: Suppose one has void test(myEnum e) enum myEnum { A,B,C } [...] Doesn't the with statement solve your problem here? with (myEnum) { test(A); test(B); test(C); }

Re: Hooking into GC

2016-06-28 Thread MMJones via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 03:10:10 UTC, thedeemon wrote: On Wednesday, 29 June 2016 at 02:18:27 UTC, MMJones wrote: I read somewhere that one can modify the D files from phobos and runtime to supply a stub for the GC. I would like to add some logging features to the GC. You don't need

Re: Hooking into GC

2016-06-28 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 02:18:27 UTC, MMJones wrote: I read somewhere that one can modify the D files from phobos and runtime to supply a stub for the GC. I would like to add some logging features to the GC. You don't need to recompile anything, a stub can be installed from your

Accessing types by context

2016-06-28 Thread Hiemlick Hiemlicker via Digitalmars-d
Suppose one has void test(myEnum e) enum myEnum { A,B,C } It would be very cool if we could do test(A) instead of test(myEnum.A). by context, the compiler can look first in the scope for something named A then look in the enum itself and prepend myEnum internally. For flags, it would

Re: core.stdc.stdlib.malloc & alignment

2016-06-28 Thread captaindet via Digitalmars-d-learn
On 2016-06-29 14:39, Hiemlick Hiemlicker wrote: Yes, the C standard requires malloc to be aligned to the platform size(4 for 32bit, 8 for 64-bit). just what i was hopping for. thanks!

Re: core.stdc.stdlib.malloc & alignment

2016-06-28 Thread Hiemlick Hiemlicker via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 02:24:55 UTC, captaindet wrote: is there an alignment guarantee for core.stdc.stdlib.malloc? more specifically, using DMD and compiling for 32bit on windows, can i assume proper alignment for int or uint variables? background: i like to re-use a (ubyte) buffer,

core.stdc.stdlib.malloc & alignment

2016-06-28 Thread captaindet via Digitalmars-d-learn
is there an alignment guarantee for core.stdc.stdlib.malloc? more specifically, using DMD and compiling for 32bit on windows, can i assume proper alignment for int or uint variables? background: i like to re-use a (ubyte) buffer, sometimes it will store only bytes, sometimes it shall store

Hooking into GC

2016-06-28 Thread MMJones via Digitalmars-d-learn
I read somewhere that one can modify the D files from phobos and runtime to supply a stub for the GC. I would like to add some logging features to the GC. Does this not require one to recompile phobos? I figured the source code was just for debugging? I'm curious if I can really get away

[Issue 16215] Nested class unable to resolve outer class variables in certain scenarios

2016-06-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16215 --- Comment #1 from Puneet Goel --- Another reduced case: class Foo { class FooInner {} } class Bar: Foo { byte foo; class BarInner(T): Foo.FooInner { byte zoo() { return foo; } } alias BarInnerThis =

Rate based allocation strategies

2016-06-28 Thread Hiemlick Hiemlicker via Digitalmars-d
Many memory management routines allocate 2x the required capacity on overflow and and de-allocate when the array is 1/2 used. This method is inefficient and wastes up to 100% of the actually memory required, although some on average is is probably much lower than this. I am thinking it

Re: static if enhancement

2016-06-28 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, June 28, 2016 13:34:48 QAston via Digitalmars-d wrote: > On Monday, 27 June 2016 at 22:56:41 UTC, Jonathan M Davis wrote: > > Agreed. The code outside of the static if should be compiled > > regardless, because it's not part of the static if/else at all > > and therefore has not been

Re: static if enhancement

2016-06-28 Thread deadalnix via Digitalmars-d
On Tuesday, 28 June 2016 at 21:06:18 UTC, QAston wrote: On Tuesday, 28 June 2016 at 17:41:58 UTC, deadalnix wrote: "The solution doesn't solve all problems, therefore the solution do not make things any better" Nonsense. More like "this solution doesn't solve all problems solved by other

Re: Call to Action: making Phobos @safe

2016-06-28 Thread Andrei Alexandrescu via Digitalmars-d
On 06/28/2016 05:34 PM, Robert burner Schadek wrote: On Monday, 27 June 2016 at 19:33:45 UTC, Walter Bright wrote: Sorry to have offended you, I worded things badly. Thank you for making the list. It's just that I'm feeling a bit overwhelmed at the moment with trying to get things done and

Re: Call to Action: making Phobos @safe

2016-06-28 Thread Robert burner Schadek via Digitalmars-d
On Monday, 27 June 2016 at 19:33:45 UTC, Walter Bright wrote: Sorry to have offended you, I worded things badly. Thank you for making the list. It's just that I'm feeling a bit overwhelmed at the moment with trying to get things done and being asked to do more every day, and I'd like to

Re: GC pathological case behaviour

2016-06-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 28 June 2016 at 21:19:18 UTC, Steven Schveighoffer wrote: It appears so: https://github.com/dlang/phobos/blob/master/std/concurrency.d#L2164 m_maxMsgs is default 0. I guess it makes sense, as you could get deadlocks for specific restrictions, although I personally would side with

Re: GC pathological case behaviour

2016-06-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 28 June 2016 at 21:01:20 UTC, John Colvin wrote: On Tuesday, 28 June 2016 at 20:12:29 UTC, luminousone wrote: Is puts high enough latency that, that main thread can fill the message queue faster then start can exhaust it? If you put a call to sleep for 1ms in the main loop does it

Re: GC pathological case behaviour

2016-06-28 Thread Steven Schveighoffer via Digitalmars-d
On 6/28/16 4:35 PM, Ola Fosheim Grøstad wrote: On Tuesday, 28 June 2016 at 20:24:33 UTC, Steven Schveighoffer wrote: On 6/28/16 4:12 PM, luminousone wrote: Is puts high enough latency that, that main thread can fill the message queue faster then start can exhaust it? If you put a call to

Re: static if enhancement

2016-06-28 Thread QAston via Digitalmars-d
On Tuesday, 28 June 2016 at 17:41:58 UTC, deadalnix wrote: "The solution doesn't solve all problems, therefore the solution do not make things any better" Nonsense. More like "this solution doesn't solve all problems solved by other solution and that's worth keeping in mind". We already

Re: GC pathological case behaviour

2016-06-28 Thread John Colvin via Digitalmars-d
On Tuesday, 28 June 2016 at 20:12:29 UTC, luminousone wrote: Is puts high enough latency that, that main thread can fill the message queue faster then start can exhaust it? If you put a call to sleep for 1ms in the main loop does it have the same result? It appears that adding a 1ms sleep

Re: Release D 2.071.1

2016-06-28 Thread ag0aep6g via Digitalmars-d-announce
On 06/28/2016 10:47 PM, deadalnix wrote: On Monday, 27 June 2016 at 23:26:25 UTC, Jack Stouffer wrote: [...] I wouldn't call 1.0 * -1.0 == 1.0 boring! What is this about ? https://issues.dlang.org/show_bug.cgi?id=16027

Re: Release D 2.071.1

2016-06-28 Thread deadalnix via Digitalmars-d-announce
On Monday, 27 June 2016 at 23:26:25 UTC, Jack Stouffer wrote: On Monday, 27 June 2016 at 23:15:06 UTC, Robert burner Schadek wrote: Awesome, releases are becoming more and more boring. I like it! I wouldn't call 1.0 * -1.0 == 1.0 boring! What is this about ?

Re: GC pathological case behaviour

2016-06-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 28 June 2016 at 20:24:33 UTC, Steven Schveighoffer wrote: On 6/28/16 4:12 PM, luminousone wrote: Is puts high enough latency that, that main thread can fill the message queue faster then start can exhaust it? If you put a call to sleep for 1ms in the main loop does it have the

Re: GC pathological case behaviour

2016-06-28 Thread Steven Schveighoffer via Digitalmars-d
On 6/28/16 4:12 PM, luminousone wrote: Is puts high enough latency that, that main thread can fill the message queue faster then start can exhaust it? If you put a call to sleep for 1ms in the main loop does it have the same result? I think this is it. Your main loop is doing very little,

Re: GC pathological case behaviour

2016-06-28 Thread Steven Schveighoffer via Digitalmars-d
On 6/28/16 3:53 PM, Ola Fosheim Grøstad wrote: On Tuesday, 28 June 2016 at 19:03:14 UTC, John Colvin wrote: char[2] s = '\0'; s[0] = cast(char)msg; puts(s.ptr);// remove this => no memory leak But wait, is the string zero terminated? I

Re: GC pathological case behaviour

2016-06-28 Thread luminousone via Digitalmars-d
On Tuesday, 28 June 2016 at 19:03:14 UTC, John Colvin wrote: On my machine (OS X), this program eats up memory with no end in sight import std.concurrency; import core.stdc.stdio; void start() { while(true) { receive( (int msg) { char[2]

Re: GC pathological case behaviour

2016-06-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 28 June 2016 at 19:53:27 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 28 June 2016 at 19:03:14 UTC, John Colvin wrote: char[2] s = '\0'; s[0] = cast(char)msg; puts(s.ptr);// remove this => no memory leak But wait, is the string

Re: GC pathological case behaviour

2016-06-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 28 June 2016 at 19:03:14 UTC, John Colvin wrote: char[2] s = '\0'; s[0] = cast(char)msg; puts(s.ptr);// remove this => no memory leak But wait, is the string zero terminated?

Re: GC pathological case behaviour

2016-06-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 28 June 2016 at 19:03:14 UTC, John Colvin wrote: This is very odd, no? I'm not sure if it's a bug, but it sure is surprising. Why should "puts" cause a GC leak (writeln is the same)? What's so special about small allocations that allows all my memory to get filled up? Try to put

Re: C++17 is feature complete

2016-06-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 28 June 2016 at 18:50:25 UTC, Enamex wrote: On Monday, 27 June 2016 at 19:47:14 UTC, Ola Fosheim Grøstad wrote: Are you trolling me? Please, no need to. Huh? What exactly are you trying to convey? Also, C++17 is 'getting' Modules and Concepts Lite later in tech specs... that

Re: GC pathological case behaviour

2016-06-28 Thread deadalnix via Digitalmars-d
On Tuesday, 28 June 2016 at 19:03:14 UTC, John Colvin wrote: On my machine (OS X), this program eats up memory with no end in sight import std.concurrency; import core.stdc.stdio; void start() { while(true) { receive( (int msg) { char[2]

Re: dmd,druntime,phobos,etc as submodules

2016-06-28 Thread Seb via Digitalmars-d
On Tuesday, 28 June 2016 at 06:54:43 UTC, rikki cattermole wrote: On 28/06/2016 6:49 PM, Timothee Cour via Digitalmars-d wrote: Is there any reason not to use git submodules to organize the various common dlang repos? see relevant discussion: *

GC pathological case behaviour

2016-06-28 Thread John Colvin via Digitalmars-d
On my machine (OS X), this program eats up memory with no end in sight import std.concurrency; import core.stdc.stdio; void start() { while(true) { receive( (int msg) { char[2] s = '\0'; s[0] = cast(char)msg;

Re: C++17 is feature complete

2016-06-28 Thread Enamex via Digitalmars-d
On Monday, 27 June 2016 at 19:47:14 UTC, Ola Fosheim Grøstad wrote: On Monday, 27 June 2016 at 19:39:20 UTC, luminousone wrote: OpenCL is for micro threading, not simd. What is your point? Clang++ vector extensions use OpenCL semantics, so you need to look up the OpenCL spec to figure out

[Issue 13637] std.utf.decode: index parameter should be able to pass by value

2016-06-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13637 Jack Stouffer changed: What|Removed |Added Hardware|x86_64 |All

[Issue 13637] std.utf.decode: index parameter should be able to pass by value

2016-06-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13637 Jack Stouffer changed: What|Removed |Added CC||j...@jackstouffer.com

Re: static if enhancement

2016-06-28 Thread deadalnix via Digitalmars-d
On Tuesday, 28 June 2016 at 13:34:48 UTC, QAston wrote: On Monday, 27 June 2016 at 22:56:41 UTC, Jonathan M Davis wrote: Agreed. The code outside of the static if should be compiled regardless, because it's not part of the static if/else at all and therefore has not been marked as

Re: Where is the D deep learning library?

2016-06-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 28 June 2016 at 17:17:47 UTC, Dejan Lekic wrote: Thanks for reminding me why I stopped doing C++ programming... When I saw that... using LeNet = loss_multiclass_log< fc<10, relu

[Issue 9646] std.algorithm.splitter for strings has opportunities for improvement

2016-06-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9646 q...@web.de changed: What|Removed |Added CC||q...@web.de --- Comment #3 from q...@web.de ---

Re: Where is the D deep learning library?

2016-06-28 Thread Dejan Lekic via Digitalmars-d
On Monday, 27 June 2016 at 14:10:15 UTC, Guillaume Piolat wrote: With the latest popularity of Machine Learning, and all the achievement we see, where is the D alternative in this area? C++'s offering makes lot of use of meta-programming already:

Re: Minor feature request

2016-06-28 Thread ZombineDev via Digitalmars-d
On Tuesday, 28 June 2016 at 15:03:01 UTC, Steven Schveighoffer wrote: On 6/28/16 10:07 AM, Ola Fosheim Grøstad wrote: On Tuesday, 28 June 2016 at 13:50:42 UTC, Steven Schveighoffer wrote: On 6/28/16 7:35 AM, Ola Fosheim Grøstad wrote: alias func = (int i) => i*i; ? Is that valid in the

Re: 4x faster strlen with 4 char sentinel

2016-06-28 Thread Jay Norwood via Digitalmars-d-announce
On Tuesday, 28 June 2016 at 09:18:34 UTC, qznc wrote: Did you also compare to strlen from libc? I'd guess GNU libc uses a lot more tricks like vector instructions. I did test with the libc strlen, although the D libraries did not have a strlen for dchar or wchar. I'm currently using this for

DMD RPM

2016-06-28 Thread Russel Winder via Digitalmars-d
Is the DMD RPM file supposed to be signed? There is a .sig file beside the .rpm but dnf insists the .rpm file itself is not signed. -- Russel. = Dr Russel Winder t: +44 20 7585 2200 voip:

Re: Minor feature request

2016-06-28 Thread Steven Schveighoffer via Digitalmars-d
On 6/28/16 10:07 AM, Ola Fosheim Grøstad wrote: On Tuesday, 28 June 2016 at 13:50:42 UTC, Steven Schveighoffer wrote: On 6/28/16 7:35 AM, Ola Fosheim Grøstad wrote: alias func = (int i) => i*i; ? Is that valid in the compiler, or are you proposing it? I haven't used or seen such a thing.

Re: Minor feature request

2016-06-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 28 June 2016 at 13:50:42 UTC, Steven Schveighoffer wrote: On 6/28/16 7:35 AM, Ola Fosheim Grøstad wrote: alias func = (int i) => i*i; ? Is that valid in the compiler, or are you proposing it? I haven't used or seen such a thing. It does work: import std.stdio; alias

Re: Minor feature request

2016-06-28 Thread Steven Schveighoffer via Digitalmars-d
On 6/28/16 7:35 AM, Ola Fosheim Grøstad wrote: On Tuesday, 28 June 2016 at 11:22:38 UTC, Steven Schveighoffer wrote: We pretty much have this with lambda syntax: (int arg) => arg alias func = (int i) => i*i; ? Is that valid in the compiler, or are you proposing it? I haven't used or

[Issue 16216] New: struct equality compares padding

2016-06-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16216 Issue ID: 16216 Summary: struct equality compares padding Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Keywords: wrong-code

Re: static if enhancement

2016-06-28 Thread QAston via Digitalmars-d
On Monday, 27 June 2016 at 22:56:41 UTC, Jonathan M Davis wrote: Agreed. The code outside of the static if should be compiled regardless, because it's not part of the static if/else at all and therefore has not been marked as conditionally compilable. But if we don't warn about unreachable

Re: [Semi OT] About code review

2016-06-28 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 6/26/16 8:01 PM, deadalnix wrote: Several people during DConf asked abut tips and tricks on code review. So I wrote an article about it: http://www.deadalnix.me/2016/06/27/on-code-review/ Nice work. Let's see: https://www.reddit.com/r/programming/comments/4q9fl5/on_code_review/ -- Andrei

Re: Where is the D deep learning library?

2016-06-28 Thread jmh530 via Digitalmars-d
On Tuesday, 28 June 2016 at 08:14:07 UTC, Nicholas Wilson wrote: I am planning to provide OpenCL and CUDA targets to ldc in the next few weeks, probably starting in earnest next week, allowing direct compilation and calling code on the gpu automagically with reflection. Cool.

[Issue 14162] Erratic inference of @safe for lambdas

2016-06-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14162 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/366378a5b606ee2093eb6625101e88573a7b2960 fix Issue 14162 - Erratic inference of @safe for lambdas

Re: 4x faster strlen with 4 char sentinel

2016-06-28 Thread Jay Norwood via Digitalmars-d-announce
On Tuesday, 28 June 2016 at 09:31:46 UTC, Sebastiaan Koppe wrote: If we were in interview, I'd ask you "what does this returns if you pass it an empty string ?" Since no one is answering: It depends on the memory right before c. But if there is at least one 0 right before it - which is quite

Re: GSoC 2016 - std.experimental.xml after a month

2016-06-28 Thread Nikolay via Digitalmars-d
On Thursday, 23 June 2016 at 20:04:26 UTC, Lodovico Giaretta wrote: -- Brace yourself: a very long post is coming -- What is planned for the near future? - When the DOM classes will be usable (even if not 100% complete) I will start working on a DOM parser to build them from the source; - DTD

Re: Minor feature request

2016-06-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 28 June 2016 at 11:22:38 UTC, Steven Schveighoffer wrote: We pretty much have this with lambda syntax: (int arg) => arg alias func = (int i) => i*i; ?

Re: Minor feature request

2016-06-28 Thread Steven Schveighoffer via Digitalmars-d
On 6/28/16 2:13 AM, Superstar64 wrote: Right now, D functions expect a Block Statement (https://dlang.org/spec/function.html#FunctionBody) as their function body. Changing that to allow any statement (https://dlang.org/spec/statement.html#Statement) would provide a few new syntactic sugars like:

Re: dmd,druntime,phobos,etc as submodules

2016-06-28 Thread Steven Schveighoffer via Digitalmars-d
On 6/28/16 5:17 AM, qznc wrote: On Tuesday, 28 June 2016 at 09:13:40 UTC, qznc wrote: I don't believe a root repo makes sense. Submodules should be used to model actual dependencies. For example, phobos does not depend on dmd, since it could be ldc or gdc as well. Some dependencies are: dmd

Re: GSoC 2016 - std.experimental.xml after a month

2016-06-28 Thread Steven Schveighoffer via Digitalmars-d
On 6/28/16 4:04 AM, Lodovico Giaretta wrote: On Monday, 27 June 2016 at 22:36:36 UTC, Martin Nowak wrote: On 06/25/2016 10:33 PM, Lodovico Giaretta wrote: But your idea about a stack keeping all the context informations is quite valuable, given that some validations need them (e.g. checking

[Issue 16195] delete should be @system

2016-06-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16195 Walter Bright changed: What|Removed |Added Keywords||pull

Re: Release D 2.071.1

2016-06-28 Thread Michael via Digitalmars-d-announce
On Monday, 27 June 2016 at 23:26:25 UTC, Jack Stouffer wrote: On Monday, 27 June 2016 at 23:15:06 UTC, Robert burner Schadek wrote: Awesome, releases are becoming more and more boring. I like it! I wouldn't call 1.0 * -1.0 == 1.0 boring! Yeah I was thinking this haha.

IUP, CD, IM, lua interfaces in D.

2016-06-28 Thread mogu via Digitalmars-d-announce
Now IUP library collections' interfaces accomplished. IUP(3.18): http://code.dlang.org/packages/iupd IM(3.10): http://code.dlang.org/packages/imd CD(5.9):http://code.dlang.org/packages/cdd lua(5.3.3): http://code.dlang.org/packages/nluad As I'm not good enough, all bindings may have many

[Issue 16208] moduleinfo importedModules contains needless duplicates

2016-06-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16208 Ketmar Dark changed: What|Removed |Added CC|

[Issue 16212] Segfault using "with" for field access inside switch statement

2016-06-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16212 --- Comment #2 from Ketmar Dark --- so i suppose that this bug can be closes as "fixed", but i'll wait for someone else to check it too before closing. --

[Issue 16212] Segfault using "with" for field access inside switch statement

2016-06-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16212 Ketmar Dark changed: What|Removed |Added CC|

Re: I have a problem with D

2016-06-28 Thread Stefan via Digitalmars-d
On Tuesday, 28 June 2016 at 04:37:34 UTC, Adam Sansier wrote: Hi, I have designed a class based system that involves self-delegation instead of override. It is similar to event based programming. I have defined an event as a container type that holds functions(or possibly delegates, but

Re: 4x faster strlen with 4 char sentinel

2016-06-28 Thread Sebastiaan Koppe via Digitalmars-d-announce
On Tuesday, 28 June 2016 at 01:53:22 UTC, deadalnix wrote: On Sunday, 26 June 2016 at 16:40:08 UTC, Jay Norwood wrote: After watching Andre's sentinel thing, I'm playing with strlen on char strings with 4 terminating 0s instead of a single one. Seems to work and is 4x faster compared to the

Re: 4x faster strlen with 4 char sentinel

2016-06-28 Thread qznc via Digitalmars-d-announce
On Sunday, 26 June 2016 at 16:40:08 UTC, Jay Norwood wrote: After watching Andre's sentinel thing, I'm playing with strlen on char strings with 4 terminating 0s instead of a single one. Seems to work and is 4x faster compared to the runtime version. nothrow pure size_t strlen2(const(char)*

Re: dmd,druntime,phobos,etc as submodules

2016-06-28 Thread qznc via Digitalmars-d
On Tuesday, 28 June 2016 at 06:49:03 UTC, Timothee Cour wrote: Is there any reason not to use git submodules to organize the various common dlang repos? see relevant discussion: * http://www.digitalmars.com/d/archives/digitalmars/D/The_annoying_D_build_system_181472.html [from 2012] *

Phobos enhancement: add method to convert UnknownAddressReference to non-opaque Address subtype

2016-06-28 Thread Stefan via Digitalmars-d
Many functions in std.socket, such as getAddress or parseAddress return the UnknownAddressReference Address subtype instead of InternetAddress or InternetAddress6. While in many cases this is sufficient (e.g., when you just need to do Socket.sendTo), in some cases it is not, especially when

Re: Where is the D deep learning library?

2016-06-28 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 28 June 2016 at 03:29:46 UTC, jmh530 wrote: On Monday, 27 June 2016 at 22:17:55 UTC, Martin Nowak wrote: [...] I could probably write a simple backpropogation one, but I would probably screw something up if I wrote my own convolutional neural network. [...] I am planning to

Re: Minor feature request

2016-06-28 Thread Lodovico Giaretta via Digitalmars-d
On Tuesday, 28 June 2016 at 06:13:44 UTC, Superstar64 wrote: Right now, D functions expect a Block Statement (https://dlang.org/spec/function.html#FunctionBody) as their function body. Changing that to allow any statement (https://dlang.org/spec/statement.html#Statement) would provide a few

Re: Registration-free COM client

2016-06-28 Thread John via Digitalmars-d-learn
On Monday, 27 June 2016 at 21:17:52 UTC, Thalamus wrote: Hi everyone, I've succeeded in using D as a client for regular (registered) COM servers in the past, but in this case, I'm building the server as well. I would like to avoid registering it if possible so XCOPY-like deployment remains

Re: GSoC 2016 - std.experimental.xml after a month

2016-06-28 Thread Lodovico Giaretta via Digitalmars-d
On Monday, 27 June 2016 at 22:36:36 UTC, Martin Nowak wrote: On 06/25/2016 10:33 PM, Lodovico Giaretta wrote: But your idea about a stack keeping all the context informations is quite valuable, given that some validations need them (e.g. checking that all prefixes have been declared, and

Re: Minor feature request

2016-06-28 Thread Gary Willoughby via Digitalmars-d
On Tuesday, 28 June 2016 at 06:13:44 UTC, Superstar64 wrote: --- auto func(MyObj obj) with(obj) { //... } auto func(int arg) return arg; auto func() try { //... } finally { return //... } --- Please no! All of these are awful.

Re: Release D 2.071.1

2016-06-28 Thread Walter Bright via Digitalmars-d-announce
On 6/27/2016 3:11 PM, Martin Nowak wrote: Glad to announce D 2.071.1. http://dlang.org/download.html This point release fixes a few issues over 2.071.0, see the changelog for more details. http://dlang.org/changelog/2.071.1.html -Martin Thank you, Martin!

Re: 4x faster strlen with 4 char sentinel

2016-06-28 Thread deadalnix via Digitalmars-d-announce
On Tuesday, 28 June 2016 at 03:11:26 UTC, Jay Norwood wrote: On Tuesday, 28 June 2016 at 01:53:22 UTC, deadalnix wrote: If we were in interview, I'd ask you "what does this returns if you pass it an empty string ?" I'd say use this one instead, to avoid negative size_t. It is also a little

Re: dmd,druntime,phobos,etc as submodules

2016-06-28 Thread rikki cattermole via Digitalmars-d
On 28/06/2016 6:49 PM, Timothee Cour via Digitalmars-d wrote: Is there any reason not to use git submodules to organize the various common dlang repos? see relevant discussion: * http://www.digitalmars.com/d/archives/digitalmars/D/The_annoying_D_build_system_181472.html [from 2012] *

dmd,druntime,phobos,etc as submodules

2016-06-28 Thread Timothee Cour via Digitalmars-d
Is there any reason not to use git submodules to organize the various common dlang repos? see relevant discussion: * http://www.digitalmars.com/d/archives/digitalmars/D/The_annoying_D_build_system_181472.html [from 2012] * http://comments.gmane.org/gmane.comp.lang.d.general/172893 * [llvm-dev]

Re: Fiber local GC

2016-06-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 27 June 2016 at 22:51:05 UTC, Martin Nowak wrote: Simple as don't allocate on a per-request basis if you want a fast program. It also trivial to attach an std.allocator to your custom Fiber. Also Fibers should be pooled and reused to avoid the setup cost (just measured 1.5µs on top

Re: I have a problem with D

2016-06-28 Thread rikki cattermole via Digitalmars-d
On 28/06/2016 4:37 PM, Adam Sansier wrote: Hi, I have designed a class based system that involves self-delegation instead of override. It is similar to event based programming. I have defined an event as a container type that holds functions(or possibly delegates, but the desire is to avoid

Re: Minor feature request

2016-06-28 Thread rikki cattermole via Digitalmars-d
On 28/06/2016 6:13 PM, Superstar64 wrote: Right now, D functions expect a Block Statement (https://dlang.org/spec/function.html#FunctionBody) as their function body. Changing that to allow any statement (https://dlang.org/spec/statement.html#Statement) would provide a few new syntactic sugars

Minor feature request

2016-06-28 Thread Superstar64 via Digitalmars-d
Right now, D functions expect a Block Statement (https://dlang.org/spec/function.html#FunctionBody) as their function body. Changing that to allow any statement (https://dlang.org/spec/statement.html#Statement) would provide a few new syntactic sugars like: --- auto func(MyObj obj) with(obj)