Re: __Symbol an alternative to recursive templates for type-introsecption

2016-10-09 Thread Jacob Carlborg via Digitalmars-d
On 2016-10-09 15:52, Stefan Koch wrote: Walter would rather die. Then see ast-macros in D. Yeah, unfortunately. Instead a lot of features are proposed and some implement that all could be implement using macros. At the same time complaining that macros are complex. That's making the language

Re: Required DMD changes for Mir and few thoughts about D future

2016-10-09 Thread Martin Nowak via Digitalmars-d
On Saturday, 8 October 2016 at 18:53:32 UTC, Andrei Alexandrescu wrote: (after thinking a bit more) ... but Mir seems to rely in good part on templates, which makes pre-compiled libraries less effective. -- Andrei On Saturday, 8 October 2016 at 18:53:32 UTC, Andrei Alexandrescu wrote: Ilya's

Re: Required DMD changes for Mir and few thoughts about D future

2016-10-09 Thread Martin Nowak via Digitalmars-d
On Saturday, 8 October 2016 at 18:10:14 UTC, Ilya Yaroshenko wrote: https://github.com/MartinNowak/druntime/blob/23373260e65af5edea989b61d6660832fedbec15/src/core/internal/arrayop.d#L78. Could you please give an example how it works for user? I mean aligned vs unaligned. ??? You could pack th

Re: Required DMD changes for Mir and few thoughts about D future

2016-10-09 Thread Martin Nowak via Digitalmars-d
On Monday, 10 October 2016 at 05:20:56 UTC, Martin Nowak wrote: (after thinking a bit more) ... but Mir seems to rely in good part on templates, which makes pre-compiled libraries less effective. -- Andrei Exactly, this is what I was wondering. Maybe it uses a finite set of precompilable kern

Re: Unum II announcement

2016-10-09 Thread Nick B via Digitalmars-d
On Saturday, 8 October 2016 at 00:35:31 UTC, Nick B wrote: On Sunday, 25 September 2016 at 02:22:01 UTC, Nick B wrote: I suggest that now, programmers would/may have a choice: be slow and correct, or fast and incorrect, and that would depend if real accuracy is important or not, the types of

Re: Required DMD changes for Mir and few thoughts about D future

2016-10-09 Thread Martin Nowak via Digitalmars-d
On Saturday, 8 October 2016 at 18:53:32 UTC, Andrei Alexandrescu wrote: You mean dmd/ldc/etc interop at binary level? Yes, that would be pretty Should already work, but of courses isn't well tested. (after thinking a bit more) ... but Mir seems to rely in good part on templates, which makes p

Re: Can you shrink it further?

2016-10-09 Thread Andrei Alexandrescu via Digitalmars-d
On 10/09/2016 10:55 PM, safety0ff wrote: On Sunday, 9 October 2016 at 22:11:50 UTC, Andrei Alexandrescu wrote: I suspect there are cleverer things that can be done. Less clever seemed to work for me: void popFront1(ref char[] s) @trusted pure nothrow { immutable c = s[0]; if (c < 0x80 ||

Re: New encryption block...

2016-10-09 Thread sarn via Digitalmars-d
On Sunday, 9 October 2016 at 20:33:29 UTC, Era Scarecrow wrote: Something coming to mind is the idea of making a small algorithm to be used with other already existing encryption functions to extend the blocksize of encryption with minimal complexity growth. In theory this would extend a block

Re: Can you shrink it further?

2016-10-09 Thread safety0ff via Digitalmars-d
On Sunday, 9 October 2016 at 22:11:50 UTC, Andrei Alexandrescu wrote: I suspect there are cleverer things that can be done. Less clever seemed to work for me: void popFront1(ref char[] s) @trusted pure nothrow { immutable c = s[0]; if (c < 0x80 || c >= 0xFE) { s = s.ptr[1 .. s.length];

Re: Can you shrink it further?

2016-10-09 Thread Andrei Alexandrescu via Digitalmars-d
On 10/09/2016 07:05 PM, Stefan Koch wrote: On Sunday, 9 October 2016 at 22:11:50 UTC, Andrei Alexandrescu wrote: Had a bit of a good time with popFront for UTF, got to this: https://github.com/dlang/phobos/pull/4848. I suspect there are cleverer things that can be done. Can anyone make it tighte

Re: Can you shrink it further?

2016-10-09 Thread Stefan Koch via Digitalmars-d
On Sunday, 9 October 2016 at 22:11:50 UTC, Andrei Alexandrescu wrote: Had a bit of a good time with popFront for UTF, got to this: https://github.com/dlang/phobos/pull/4848. I suspect there are cleverer things that can be done. Can anyone make it tighter? Take a look at the disassembly referred

Can you shrink it further?

2016-10-09 Thread Andrei Alexandrescu via Digitalmars-d
Had a bit of a good time with popFront for UTF, got to this: https://github.com/dlang/phobos/pull/4848. I suspect there are cleverer things that can be done. Can anyone make it tighter? Take a look at the disassembly referred to in the pull request. Thanks! -- Andrei

New encryption block...

2016-10-09 Thread Era Scarecrow via Digitalmars-d
Something coming to mind is the idea of making a small algorithm to be used with other already existing encryption functions to extend the blocksize of encryption with minimal complexity growth. In theory this would extend a blocksize of 4 or 8 bytes, to say 64 bytes. Not only that each stage

Re: Supporting musl libc

2016-10-09 Thread Daniel Kozak via Digitalmars-d
On Sunday, 9 October 2016 at 13:38:33 UTC, Jacob Carlborg wrote: On 2016-10-08 20:47, Daniel Kozak wrote: What is the current status? Without support of musl-libc, I can not ad support for a Alpine linux distribution. It is a shame because they already have go and rust support. I've not wor

Re: color lib

2016-10-09 Thread Manu via Digitalmars-d
On 9 October 2016 at 23:36, Ilya Yaroshenko via Digitalmars-d wrote: > On Sunday, 9 October 2016 at 13:18:22 UTC, Manu wrote: >> >> On 9 October 2016 at 15:34, Ilya Yaroshenko via Digitalmars-d >> wrote: >>> >>> On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: On 9 October 20

Re: __Symbol an alternative to recursive templates for type-introsecption

2016-10-09 Thread Stefan Koch via Digitalmars-d
On Sunday, 9 October 2016 at 13:40:14 UTC, Jacob Carlborg wrote: How about we just implement AST macros and be done with it :) Walter would rather die. Then see ast-macros in D. I must say they would probably be worse then templates, in regards of compile-time bloating.

Re: inout delegate

2016-10-09 Thread Manu via Digitalmars-d
On 9 October 2016 at 16:04, Nicholas Wilson via Digitalmars-d wrote: > On Friday, 7 October 2016 at 02:13:21 UTC, Manu wrote: >> >> Perhaps you'd like to give it a go ;) >> >> Something like: >> >> template delegateTypeForInoutMethod(T, string method) >> { >> alias delegateTypeForInoutMethod = [

Re: __Symbol an alternative to recursive templates for type-introsecption

2016-10-09 Thread Jacob Carlborg via Digitalmars-d
On 2016-10-09 05:05, Stefan Koch wrote: Hi Guys, You might remember my critique regarding the fullyQulifiedName-template in phobos. Basically it is dramatically slowed down by the cost of template instanciation. I tried to remedy the situation by using by introducing another __trait. While this

Re: color lib

2016-10-09 Thread Ilya Yaroshenko via Digitalmars-d
On Sunday, 9 October 2016 at 13:18:22 UTC, Manu wrote: On 9 October 2016 at 15:34, Ilya Yaroshenko via Digitalmars-d wrote: On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d wrote: [...] Well the trouble is the lambda t

Re: Supporting musl libc

2016-10-09 Thread Jacob Carlborg via Digitalmars-d
On 2016-10-08 20:47, Daniel Kozak wrote: What is the current status? Without support of musl-libc, I can not ad support for a Alpine linux distribution. It is a shame because they already have go and rust support. I've not worked at this at all. For my use case it was easier to just build in

Re: color lib

2016-10-09 Thread Manu via Digitalmars-d
On 9 October 2016 at 18:39, Nicholas Wilson via Digitalmars-d wrote: > On Sunday, 9 October 2016 at 05:34:06 UTC, Ilya Yaroshenko wrote: >> >> On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: >>> >>> On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d >>> wrote: [...] >>

Re: color lib

2016-10-09 Thread Manu via Digitalmars-d
On 9 October 2016 at 18:25, Nicholas Wilson via Digitalmars-d wrote: > On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: >> >> On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d >> wrote: >>> >>> How far would `r.inBatchesOf!(N)` go in terms of compiler optimisations >>> (e.g. vec

Re: color lib

2016-10-09 Thread Manu via Digitalmars-d
On 9 October 2016 at 15:34, Ilya Yaroshenko via Digitalmars-d wrote: > On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: >> >> On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d >> wrote: >>> >>> [...] >> >> >> Well the trouble is the lambda that you might give to 'map' won't work

Re: color lib

2016-10-09 Thread Manu via Digitalmars-d
On 9 October 2016 at 15:34, Ilya Yaroshenko via Digitalmars-d wrote: > On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: >> >> On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d >> wrote: >>> >>> [...] >> >> >> Well the trouble is the lambda that you might give to 'map' won't work

Re: inout delegate

2016-10-09 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 9 October 2016 at 04:20:26 UTC, Nicholas Wilson wrote: Do you know the cause? i.e. would dustmiting/`git bisect` tell you anything you don't already know? On the bug report, I linked to the commit and a small patch that fixes the problem: https://github.com/dlang/dmd/commit/3c53a0f

Re: color lib

2016-10-09 Thread Ilya Yaroshenko via Digitalmars-d
On Sunday, 9 October 2016 at 08:39:57 UTC, Nicholas Wilson wrote: On Sunday, 9 October 2016 at 05:34:06 UTC, Ilya Yaroshenko wrote: On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d wrote: [...] Well the trouble is the lambd

Re: std.math API rework

2016-10-09 Thread Ilya Yaroshenko via Digitalmars-d
On Friday, 7 October 2016 at 17:02:02 UTC, Andrei Alexandrescu wrote: On 10/07/2016 03:42 AM, Ilya Yaroshenko wrote: For example, SUM_i of sqrt(fabs(a[i])) can be vectorised using mir.ndslice.algorithm. vxorps instruction can be used for fabs. vsqrtps instruction can be used for sqrt. LDC's @fas

Re: color lib

2016-10-09 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 9 October 2016 at 08:25:40 UTC, Nicholas Wilson wrote: How? All you need is an extra `each` e.g. r.inBatchesOf!(8).each!(a =>a[].map!(convertColor!RGBA8)) perhaps define a helper function for it that does each + the explicit slice + map, but it certainly doesn't scream completely

Re: color lib

2016-10-09 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 9 October 2016 at 05:34:06 UTC, Ilya Yaroshenko wrote: On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d wrote: [...] Well the trouble is the lambda that you might give to 'map' won't work anymore. Operators don't

Re: color lib

2016-10-09 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d wrote: How far would `r.inBatchesOf!(N)` go in terms of compiler optimisations (e.g. vectorisation) if N is a power of 2? auto inBatchesOf(size_t N,R)(R r) if(N!=0 &&isInputRan