Re: Why is Linux the only OS in version identifier list that has a lowercase name?

2016-04-11 Thread Zekereth via Digitalmars-d-learn

On Tuesday, 12 April 2016 at 01:32:02 UTC, Brian Schott wrote:

On Monday, 11 April 2016 at 23:01:08 UTC, marcpmichel wrote:

Is it because Linux is not an OS ? :p


I gnu somebody would bring that up.


/sigh so did I.


Re: Command line utilities for tab-separated value files

2016-04-11 Thread Joakim via Digitalmars-d-announce

On Tuesday, 12 April 2016 at 00:50:24 UTC, Jon D wrote:

Hi all,

I've open sourced a set of command line utilities for 
manipulating tab-separated value files. They are complementary 
to traditional unix tools like cut, grep, etc. They're useful 
for manipulating large data files. I use them when prepping 
files for R and similar tools. These tools were part of my 
'explore D' programming exercises.


[...]


Hmm, benchmarks are nice, someone post to reddit?


Re: The day before DConf 2016

2016-04-11 Thread Iain Buclaw via Digitalmars-d
On 10 Apr 2016 11:22 pm, "Andrej Mitrovic via Digitalmars-d" <
digitalmars-d@puremagic.com> wrote:
>
> PSA: Just remember you have to stamp your cards before boarding
> (unless it's a monthly ticket).
>
> When I was new in Berlin I even ended up once stamping a monthly
> ticket, which was a mistake. The ticket inspectors had a heartily
> laugh when they saw it and just said "you don't have to do that.. :)".
>

Tickets bought on buses don't need stamping either as I understand it.
Also make sure your ticket is still valid - once it took my girlfriend two
weeks to realise her monthly ticket had expired.  Lucky to have no one find
out, in my opinion.  ;-)


Re: Official dub packages for Debian and Ubuntu

2016-04-11 Thread jmh530 via Digitalmars-d-announce

On Monday, 11 April 2016 at 14:21:46 UTC, Matthias Klumpp wrote:


On the roadmap are adding debhelper sequences to simplify 
packaging dub-based D code in Debian based distros, auto-test 
support in Debian's CI, and of course the usual bugfixing.




Is adding to Linux Mint something you would consider as well?


Re: Is it legal to use std.windows modules?

2016-04-11 Thread Vladimir Panteleev via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 02:23:40 UTC, Vladimir Panteleev 
wrote:

http://dlang.org/phobos-prerelease/std_windows_syserror.html


Due to a simple omission, the documentation has not propagated 
from /phobos-prerelease/ to /phobos/:


Err, to correct/expand on that, the documentation has propagated, 
it's simply not in the navigation:


http://dlang.org/phobos/std_windows_syserror.html


Re: Is it legal to use std.windows modules?

2016-04-11 Thread Vladimir Panteleev via Digitalmars-d-learn

On Friday, 8 April 2016 at 22:50:05 UTC, FreeSlave wrote:
std.windows.syserror and others have documentation comments, 
but they are not listed in online documentation on dlang.org. 
Is it ok to use functions and classes from this modules in D 
applications?


They were documented a while ago:

http://dlang.org/phobos-prerelease/std_windows_syserror.html

https://issues.dlang.org/show_bug.cgi?id=14972

Due to a simple omission, the documentation has not propagated 
from /phobos-prerelease/ to /phobos/:


https://github.com/D-Programming-Language/dlang.org/pull/1265


[Issue 13516] std.windows.charset documentation missing from dlang.org

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13516

Vladimir Panteleev  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||thecybersha...@gmail.com
 Resolution|--- |DUPLICATE

--- Comment #4 from Vladimir Panteleev  ---
Marking as duplicate of newer bug as that bug has a PR, which has been merged,
thus has been fixed.

*** This issue has been marked as a duplicate of issue 14972 ***

--


[Issue 14972] Documentation for std.windows.* missing

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14972

--- Comment #6 from Vladimir Panteleev  ---
*** Issue 13516 has been marked as a duplicate of this issue. ***

--


[Issue 14085] Broken links on dlang.org

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14085
Issue 14085 depends on issue 13516, which changed state.

Issue 13516 Summary: std.windows.charset documentation missing from dlang.org
https://issues.dlang.org/show_bug.cgi?id=13516

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--


Re: Official dub packages for Debian and Ubuntu

2016-04-11 Thread Matthias Klumpp via Digitalmars-d-announce
On Monday, 11 April 2016 at 21:58:55 UTC, Joseph Rushton Wakeling 
wrote:

On Monday, 11 April 2016 at 14:21:46 UTC, Matthias Klumpp wrote:
As part of that work, the dub package an build management 
system is now available in Debian, and I will ensure it works 
well.
Additionally, it was possible to make dub available late in 
the Ubuntu 16.04 (Xenial) development cycle, so dub will also 
be part of the upcoming LTS release of Ubuntu (kudos here go 
to Matthias Klose for pointing me at the "new" --push-state 
linker directive to work around dub not linking properly 
against libcurl when the latter is compiled with --as-needed).


That's great news.  Thank you very much!

Related note: I see the lcd version in xenial is 0.17.0~beta2 
-- I don't suppose there's any chance of upgrading that to the 
stable 0.17.1 release ... ?  (Not asking you to do it 
personally, just wondering if that's something that could be 
achieved.)


I can ask, but given that the Xenial final freeze is on 24. April 
(release on 26.) and changing compiler versions that late in the 
cycle is potentially dangerous, I guess there is only a slim 
chance of success... On the pro-side is that having a beta 
compiler in the LTS release is undesirable, but even then I need 
to find an Ubuntu developer who does have time to do the sync and 
get the feature-freeze-exception. LDC FTBFSing on armel in Debian 
(and not entering testing due to that at time) is also an issue 
:-/


On the roadmap are adding debhelper sequences to simplify 
packaging dub-based D code in Debian based distros, auto-test 
support in Debian's CI, and of course the usual bugfixing.


That sounds very cool.  I'm very grateful that you are doing 
this work; it's going to save me my usual from-source install, 
and looks like it opens the gates for a bunch more D code 
getting into the Debian + Ubuntu universe.


Yes, that's the plan - for this to happen, we need some additions 
to dub though, to search in common global paths for packages. I 
opened bug 
https://github.com/D-Programming-Language/dub/issues/811 for 
that. Until that's fixed, I can't package more D code using dub 
(and adding debhelper bits also depends on this being resolved).


Curious question: what's the Debian policy these days on what D 
compiler should be used to build D packages?


There is no real policy, at least I have found none. But from my 
tests, ldc simply crashed right away when trying to compile, 
later it wasn't able to process some code gdc had no problems 
with (I haven't tried the upcoming release). Since the GNU 
Compiler Collection is Debian's default compiler, I have set the 
compiler dependency of dub to gdc | ldc | d-compiler, so gdc is 
preferred, but replacing it with any other compiler will work too.


And has dub's config been tweaked accordingly in terms of which 
compiler it prefers to use ... ?


I didn't touch that, since dub seems to automatically find the 
right compiler. The preference seems to be dmd >> gdc >> ldc2, 
which looks sane to me.


It's really bad that GDC isn't part of the official GCC yet, and 
the standard libraries differ so much between the compilers 
(mainly due to phobos progressing very quickly).


For Debian Stretch I assume the situation will be much better 
though :-) (given the state of the LDC and GDC Git repos).


[Issue 15884] Assigning char[] to std.json.JSONValue creates array, not string

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15884

Lionello Lunesu  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #5 from Lionello Lunesu  ---
I don't know how the link magic works, but here's the PR:
https://github.com/D-Programming-Language/phobos/pull/4185

--


Re: Official dub packages for Debian and Ubuntu

2016-04-11 Thread Matthias Klumpp via Digitalmars-d-announce

On Monday, 11 April 2016 at 18:05:31 UTC, Jordi Sayol wrote:

[...]

Well, this makes useful have dub in both repositories, 
Debian/Ubuntu and d-apt. All Debian/Ubuntu users can always use 
dub on their system. If the last release is needed for any 
reason they can add d-apt repository to install it. d-apt takes 
1-2 day to update dub deb packages after dub release. The deb 
package is not a problem because we use the same package name, 
and the version shouldn't be a problem too, the newer version 
will be installed regardless its source, isn't it?


Yes.

$ dpkg --compare-versions "0.9.25-0" gt "0.9.24-1ubuntu1" && 
echo "greater" || echo "NOT greater"


As long as you keep the Debian revision at 0, everything is fine 
and there should be no conflicts, if the binary package names in 
Debian and your repo match. Please just don't increase the Debian 
revision to something bigger than zero, that can result in 
breakage.
You could use a revision like "-0~1" or "-0.1" when making 
changes to the package without a new upstream releases.
But that seems to be the case already, so there's no problem here 
:-)




[Issue 15884] Assigning char[] to std.json.JSONValue creates array, not string

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15884

Lionello Lunesu  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #4 from Lionello Lunesu  ---
Ah, you're fast, but what about wchar[] dchar[]? I suggest we use
std.utf.toUTF8() to handle all the non-string cases (it does a "idup" for
char[], by the way.)

--


Re: Why is Linux the only OS in version identifier list that has a lowercase name?

2016-04-11 Thread Brian Schott via Digitalmars-d-learn

On Monday, 11 April 2016 at 23:01:08 UTC, marcpmichel wrote:

Is it because Linux is not an OS ? :p


I gnu somebody would bring that up.



Command line utilities for tab-separated value files

2016-04-11 Thread Jon D via Digitalmars-d-announce

Hi all,

I've open sourced a set of command line utilities for 
manipulating tab-separated value files. They are complementary to 
traditional unix tools like cut, grep, etc. They're useful for 
manipulating large data files. I use them when prepping files for 
R and similar tools. These tools were part of my 'explore D' 
programming exercises.


The tools are here: https://github.com/eBay/tsv-utils-dlang

They are likely of interest primarily to people regularly working 
with large files, though others might find the performance 
benchmarks of interest as well (included in the README).


I'd welcome any feedback, either on the apps or the code. 
Intention is that the code be reasonable example programs. And, I 
may write a blog post about my D explorations at some point, 
they'd be referenced in such an article.


--Jon


Re: year to date pull statistics (week ending 2016-04-09)

2016-04-11 Thread Jack Stouffer via Digitalmars-d

On Monday, 11 April 2016 at 20:44:20 UTC, Brad Roberts wrote:

2016-04-03 - 2016-04-09 64  45+19


Ouch, slow week for reviewing I guess.


Re: Why is Linux the only OS in version identifier list that has a lowercase name?

2016-04-11 Thread marcpmichel via Digitalmars-d-learn

On Sunday, 10 April 2016 at 22:03:54 UTC, Zekereth wrote:
Looking at the list(unless I'm missing something) Linux is the 
only OS that is lowercase.


Is it because Linux is not an OS ? :p



[Issue 11531] For a faster std.algorithm.group on strings

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11531

Jack Stouffer  changed:

   What|Removed |Added

   Keywords||performance
 CC||j...@jackstouffer.com

--


[Issue 5542] std.string.join() for chars too

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5542

Jack Stouffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||j...@jackstouffer.com
 Resolution|--- |WONTFIX

--- Comment #4 from Jack Stouffer  ---
This is a one liner,

string input = "123";
auto result = input.roundRobin('x'.repeat(input.length - 1));

Going off of Walter's comments in this PR,
https://github.com/D-Programming-Language/phobos/pull/4153, I am marking this
as WONTFIX.

--


Re: Extensible struct type via variadic template arguments

2016-04-11 Thread Joseph Rushton Wakeling via Digitalmars-d-learn

On Monday, 11 April 2016 at 22:06:00 UTC, ag0aep6g wrote:


mixin template multipleEdgeProperties (EdgePropertyList...)
{
static if (EdgePropertyList.length >= 1)
{
mixin singleEdgeProperty!(EdgePropertyList[0]);
mixin multipleEdgeProperties!(EdgePropertyList[1 .. $]);
}
}

mixin template singleEdgeProperty (alias property)
{
mixin(`public property.Type[] ` ~ property.name ~ `;`);
}


Ah, nice!  I knew I was missing a trick somewhere with mixin 
templates, but I haven't used them for sufficiently long that my 
brain wasn't in the right place to find it.  Your solution is 
_much_ more elegant than what I have now.


The string mixin is hidden away in singleEdgeProperty, but it's 
still there.


To get rid of it, you'd have take a different approach, I think.


Yea, makes sense.  I'm probably going to hang onto the broader 
details of the approach (a string mixin or two isn't _that_ 
horrendous...) because there are some other aspects to it that I 
would like to play with.  But your suggested alternative is 
interesting to consider.


Thanks very much for the useful ideas! :-)


Re: Extensible struct type via variadic template arguments

2016-04-11 Thread ag0aep6g via Digitalmars-d-learn

On 10.04.2016 20:45, Joseph Rushton Wakeling wrote:

One very basic idea is to allow graph edges to have arbitrary
properties, and to do that, I've tried to come up with a basic data
structure that can be extended via variadic template arguments.
However, I'm not entirely satisfied with the design, as I suspect it can
be simplified/made nicer.  Here's what I have at present:


//

[...]

//


There are two things I'm wondering about the above design:

   * is it possible to redesign EdgeProperty as a template that would take
 a type parameter directly rather than as a string, so one could write
 e.g. EdgeProperty!("weight", double) ... ?

   * is it possible to rework things to avoid the string mixins ...?



struct ExtensibleEdgeList (EdgePropertyList...)
{
public size_t[] tail;
public size_t[] head;

mixin multipleEdgeProperties!(EdgePropertyList);
}

template EdgeProperty(Type_, string name_)
{
alias Type = Type_;
enum string name = name_;
}

mixin template multipleEdgeProperties (EdgePropertyList...)
{
static if (EdgePropertyList.length >= 1)
{
mixin singleEdgeProperty!(EdgePropertyList[0]);
mixin multipleEdgeProperties!(EdgePropertyList[1 .. $]);
}
}

mixin template singleEdgeProperty (alias property)
{
mixin(`public property.Type[] ` ~ property.name ~ `;`);
}


The string mixin is hidden away in singleEdgeProperty, but it's still there.

To get rid of it, you'd have take a different approach, I think. For 
example:


struct Foo
{
mixin EdgeListHeadTail;
EdgeProperty!double weight;
EdgeProperty!int bar;
}

mixin template EdgeListHeadTail ()
{
public size_t[] tail;
public size_t[] head;
}

alias EdgeProperty (Type) = Type[];


No code generation anymore. But now the user must not forget the mixin 
of EdgeListHeadTail. And if you need to generate something from the 
number of edge properties, then this way isn't feasible at all, of course.


Re: Official dub packages for Debian and Ubuntu

2016-04-11 Thread Joseph Rushton Wakeling via Digitalmars-d-announce

On Monday, 11 April 2016 at 14:21:46 UTC, Matthias Klumpp wrote:
As part of that work, the dub package an build management 
system is now available in Debian, and I will ensure it works 
well.
Additionally, it was possible to make dub available late in the 
Ubuntu 16.04 (Xenial) development cycle, so dub will also be 
part of the upcoming LTS release of Ubuntu (kudos here go to 
Matthias Klose for pointing me at the "new" --push-state linker 
directive to work around dub not linking properly against 
libcurl when the latter is compiled with --as-needed).


That's great news.  Thank you very much!

Related note: I see the lcd version in xenial is 0.17.0~beta2 -- 
I don't suppose there's any chance of upgrading that to the 
stable 0.17.1 release ... ?  (Not asking you to do it personally, 
just wondering if that's something that could be achieved.)



On the roadmap are adding debhelper sequences to simplify 
packaging dub-based D code in Debian based distros, auto-test 
support in Debian's CI, and of course the usual bugfixing.


That sounds very cool.  I'm very grateful that you are doing this 
work; it's going to save me my usual from-source install, and 
looks like it opens the gates for a bunch more D code getting 
into the Debian + Ubuntu universe.


Curious question: what's the Debian policy these days on what D 
compiler should be used to build D packages?  And has dub's 
config been tweaked accordingly in terms of which compiler it 
prefers to use ... ?


Thanks & best wishes,

-- Joe


Re: Any usable SIMD implementation?

2016-04-11 Thread Walter Bright via Digitalmars-d

On 4/11/2016 7:24 AM, Marco Leise wrote:

Am Mon, 4 Apr 2016 11:43:58 -0700
schrieb Walter Bright :


On 4/4/2016 9:21 AM, Marco Leise wrote:

To put this to good use, we need a reliable way - basically
a global variable - to check for SSE4 (or POPCNT, etc.). What
we have now does not work across all compilers.


http://dlang.org/phobos/core_cpuid.html


That's what I implied in "what we have now":

import core.cpuid;

writeln( mmx );  // prints 'false' with GDC
version(InlineAsm_X86_Any)
writeln("DMD and LDC support the Dlang inline assembler");
else
writeln("GDC has the GCC extended inline assembler");


There's no reason core.cpuid, which has a platform-independent API, cannot be 
made to work with GDC and LDC. Adding more global variables to do the same thing 
would add no value and would not be easier to implement.




Both LLVM and GCC have moved to "extended inline assemblers"
that require you to provide information about input, output
and scratch registers as well as memory locations, so the
compiler can see through the asm-block for register allocation
and inlining purposes. It's more difficult to get right, but
also more rewarding, as it enables you to write no-overhead
"one-liners" and "intrinsics" while having calling conventions
still handled by the compiler.


I know, but "more difficult" is a bit of an understatement. For example, 
core.cpuid has not been implemented using those assemblers.


BTW, dmd's inline assembler does know about which instructions read/write which 
registers, and makes use of that when inserting the code so it will work with 
the rest of the code generator's register usage tracking.


I find needing to tell gcc which registers are read/written by a particular 
instruction to be a step BACKWARDS in usability. This is what computers are 
supposed to be good for :-)



An example for GDC:

struct DblWord { ulong lo, hi; }

/// Multiplies two machine words and returns a double
/// machine word.
DblWord bigMul(ulong x, ulong y)
{
DblWord tmp = void;
// '=a' and '=d' are outputs to RAX and RDX
// respectively that are bound to the two
// fields of 'tmp'.
// '"a" x' means that we want 'x' as input in
// RAX and '"rm" y' places 'y' wherever it
// suits the compiler (any general purpose
// register or memory location).
// 'mulq %3' multiplies with the ulong
// represented by the argument at index 3 (y).
asm {
"mulq %3"
 : "=a" tmp.lo, "=d" tmp.hi
 : "a" x, "rm" y;
}
return tmp;
}

In the above example the compiler has enough information to
inline the function or directly return the result in RAX:RDX
without writing to memory first. The same thing in DMD would
likely have turned out slower than emulating this using
several uint->ulong multiplies.


DMD doesn't inline functions with asm in them, but that is not the fault of the 
inline assembler.


The only real weakness in the DMD inline assembler is it doesn't support "let 
the compiler select the register". DMD's strong support for compiler builtins, 
however, mitigate this to an acceptable level.




Although less powerful, the LDC team implemented Dlang inline
assembly according to the specs and so core.cpuid works for
them. GDC on the other hand is out of the picture until either
1) GDC adds Dlang inline assembly
2) core.cpuid duplicates most of its assembly code to support
the GCC extended inline assembler

I would prefer a common extended inline assembler though,
because when you use it for performance reasons you typically
cannot go with non-inlinable Dlang asm, so you end up with pure
D for DMD, GCC asm for GDC and LDC asm - three code paths.





Re: Compile a shared library

2016-04-11 Thread bitwise via Digitalmars-d

On Sunday, 10 April 2016 at 05:34:24 UTC, Nafees wrote:
I am trying to create a shared library, I just tried to compile 
the code that Mono-D generates for an empty shared library. I 
tried to compile it, but there were errors, and this is what 
the compile log said:


Building Solution: QScr (Debug)

Building: QScr (Debug)
Performing main compilation...
Current dictionary: /home/nafees/Desktop/Projects/QScr/QScr
dmd -debug -gc "myclass.d" "dllmain.d"  "-I/usr/include/dmd" 
"-L/IMPLIB:/home/nafees/Desktop/Projects/QScr/QScr/bin/Debug/libQScr.a" "-odobj/Debug" "-of/home/nafees/Desktop/Projects/QScr/QScr/bin/Debug/libQScr.so" -w -vcolumns
/usr/bin/ld: cannot find 
/IMPLIB:/home/nafees/Desktop/Projects/QScr/QScr/bin/Debug/libQScr.a: No such file or directory

collect2: error: ld returned 1 exit status
--- errorlevel 1
Exit code 1
Build complete -- 1 error, 0 warnings

-- Done --

Build: 1 error, 0 warnings


see, there is that .a file missing, I've no idea what it is. 
And I'm using DMD2 on Linux (Ubuntu 14.04). Any ideas how can I 
compile it?


IMPLIB is a linker flag for windows. Its possible that Mono-D is 
not correctly identifying the OS for some code paths. I would 
file a bug on github/mono-d.


As far as dmd goes though, shared library support is spotty at 
the moment. AFAIK, shared libraries should work on linux, but I 
haven't tried it myself. It may be a good idea to try and build 
one manually to confirm.


   Bit


TECO - Inspiration for the D programming language

2016-04-11 Thread Walter Bright via Digitalmars-d-announce

https://www.reddit.com/r/programming/comments/4e07lo/last_night_in_a_fit_of_boredom_far_away_from_my/d1x5rl7


[Issue 14504] Regex Optimizer doesn't merge equivalent threads.

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14504

--- Comment #4 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/0e7fc33abaac676290add738499ec46d9e4be8ab
Fix issue 14504 Regex Optimizer doesn't merge equivalent threads

We can be unprecise a bit by using a hash of table to represent a state of
optimizer thread, after all any collision will result in just a shorter prefix
search.

https://github.com/D-Programming-Language/phobos/commit/11ef8c4a11dfcd397b5ba6a6e62344cc429d7715
Merge pull request #4157 from DmitryOlshansky/issue14504

Fix issue 14504 Regex Optimizer doesn't merge equivalent threads

--


[Issue 14504] Regex Optimizer doesn't merge equivalent threads.

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14504

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


Re: year to date pull statistics (week ending 2016-04-09)

2016-04-11 Thread Brad Roberts via Digitalmars-d

total open: 270
created since 2016-01-01 and still open: 100

 created  closed  delta
2016-04-10 - today  9   10 -1
2016-04-03 - 2016-04-09 64  45+19
2016-03-27 - 2016-04-02 65  60 +5
2016-03-20 - 2016-03-26 65  63 +2
2016-03-13 - 2016-03-19 44  51 -7
2016-03-06 - 2016-03-12 41  46 +5
2016-02-28 - 2016-03-05 54  48 -6
2016-02-21 - 2016-02-27 29  20 -9
2016-02-14 - 2016-02-20 32  36 +4
2016-02-07 - 2016-02-13 52  52  0
2016-01-31 - 2016-02-06 54  61 +7
2016-01-24 - 2016-01-30 40  37 -3
2016-01-17 - 2016-01-23 31  21-10
2016-01-10 - 2016-01-16 39  42 +3
2016-01-03 - 2016-01-09 26  33 +7
2016-01-01 - 2016-01-02  2   5 +3
   --- ------
   647 630+17

https://auto-tester.puremagic.com/chart.ghtml?projectid=1


[Issue 15043] [e2ir] dmd still crashes when trying to set a delegate from __traits(getOverloads)

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15043

ag0ae...@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||ag0ae...@gmail.com
 Resolution|WONTFIX |---

--- Comment #3 from ag0ae...@gmail.com ---
The bug is still there. ICEs are certainly not WONTFIX. Reopening.

--


Re: Beta of D language online tour

2016-04-11 Thread Mark Isaacson via Digitalmars-d

Still awesome! Good work.

An easy(?) suggestion that would make this easier to browse: make 
the left/right arrow keys control advancing to the next page.


std.experimental.allocator and @nogc?

2016-04-11 Thread Danni Coy via Digitalmars-d-learn
Lets assume I want to be able to swap in and out allocators none of
which will be the gc_allocator...
What is best practice for using std.experimental.allocator in @nogc code?


[Issue 15872] [ndslice] indexing a slice with an array causes an error inside ndslice

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15872

--- Comment #1 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/d1ef8a0cc5eee0c4604a754541056293d02ca42a
fix Issue 15872

https://github.com/D-Programming-Language/phobos/commit/3e0aefe23f3c91ad975246e2826e00079a3ea5be
Merge pull request #4152 from 9il/opindex

fix Issue 15872

--


[Issue 15872] [ndslice] indexing a slice with an array causes an error inside ndslice

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15872

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


Re: Release D 2.071.0

2016-04-11 Thread Dicebot via Digitalmars-d-announce

On Monday, 11 April 2016 at 19:20:50 UTC, Marco Leise wrote:

Am Thu, 07 Apr 2016 10:13:35 +
schrieb Dicebot :
It is second time git tag for DMD release refers to commit 
with VERSION file content which doesn't match the tag. May 
indicate something is wrong in release procedure.


Or maybe something is wrong with source based Linux 
distributions in this time and age. I don't know. But I'm glad 
that you fire proof the source bundles first, before I move my 
lazy ass to update DMD packages for Gentoo. I hope to start 
from a good, clean 2.071.0/2.071.1 tar ball. :D


:)

I must admit I took the easy path and simply added `echo $pkgver 
> ../VERSION` to package build script instead of making upstream 
PR.


Re: Sample Rate

2016-04-11 Thread TheAnalyst via Digitalmars-d

On Sunday, 10 April 2016 at 14:57:03 UTC, hilop wrote:

On Saturday, 9 April 2016 at 14:15:38 UTC, Nordlöw wrote:
Has anybody more than I thought about representing the sample 
rate of a sampled signal collected from sources such as 
microphones and digital radio receivers?


With it we could automatically relate DFT/FFT bins to real 
frequencies and other cool stuff.


Maybe we could make it part of the standard solution for 
linear algebra processing and units of measurement in D.


Destroy.


The magnitude is not hard to represent for a buffer.
let's say you have a FFT of 512 sample, each bin N represent a 
sub-sinusoid of a frequency given by (SR/(512*2)) * N. Then 
you've got the power of this sub-sinusoid with Hypoth(bin.real, 
bin.imag).


Since amplitude perception is not linear, the Y (A to db, from 
.0f->.1f to -100f->0.0f scale must be adjusted.
Since the frequency neither the X scale also (frequency to 
pitch, from 0->22050 to 0->127). (I don't remember the formula 
right now but those two converters could be part of the unit 
framework.)


Now to make the things properly (which means avoiding the 
artifacts, aka the aliasing or the spectrum folding, due to the 
cut at the buffer edge), the buffers must be multiplied by a 
windowing function (e.g hanning, hamming, etc) and overlapped 
(to maintain the original power spectrum).


Believe me or not but we are living in a world where it's easy to 
get the information, but very few people are able to understand 
the information.

Technician vs Analyst.


Re: Release D 2.071.0

2016-04-11 Thread Marco Leise via Digitalmars-d-announce
Am Thu, 07 Apr 2016 10:13:35 +
schrieb Dicebot :

> On Tuesday, 5 April 2016 at 22:43:05 UTC, Martin Nowak wrote:
> > Glad to announce D 2.071.0.
> >
> > http://dlang.org/download.html
> >
> > This release fixes many long-standing issues with imports and 
> > the module
> > system.
> > See the changelog for more details.
> >
> > http://dlang.org/changelog/2.071.0.html
> >
> > -Martin  
> 
> It is second time git tag for DMD release refers to commit with 
> VERSION file content which doesn't match the tag. May indicate 
> something is wrong in release procedure.

Or maybe something is wrong with source based Linux
distributions in this time and age. I don't know. But I'm glad
that you fire proof the source bundles first, before I move my
lazy ass to update DMD packages for Gentoo. I hope to start
from a good, clean 2.071.0/2.071.1 tar ball. :D

Nice work on the import bugs. There is so much less on the
attic now.

-- 
Marco



Mir v0.13.0: mir.combinatorics & mir.ndslice allocators/constructors/converters

2016-04-11 Thread 9il via Digitalmars-d-announce

Mir v0.13.0 was released.

http://mir.dlang.io

# New functions was added:

- `mir.combinatorics` (by Sebastian Wilzbach)
  - `combinations`
  - `combinationsRepeat`
  - `permutations`
  - `cartesianPower`

- `mir.ndslice.slice`
 - `SliceException`
 - `shape`
 - `slice`
 - `makeSlice`
 - `ndarray`
 - `makeNdarray`

- `mir.ndslice.selection`
 - `iotaSlice`/`IotaSlice`

For corresponding ndslice updates in Phobos see
https://github.com/D-Programming-Language/phobos/pull/4182

Best regards,
Ilya


[Issue 15873] In order to implement std.simd, compile time info about CPU specifics is needed

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15873

Marco Leise  changed:

   What|Removed |Added

 CC||marco.le...@gmx.de

--- Comment #7 from Marco Leise  ---
My concern is with "fast.json" where the call site reads

  auto json = parseJSON(...);

and I feel that

  import core.cpuid;
  if (sse42)
handleJson!true();
  else
handleJson!false();

  void handleJson(bool sse42)()
  {
auto json = parseJSON!sse42(...);
  }

is just not palatable. ('handleJson' being needed, since the return value would
be a RAII struct with compile-time specialization.) Importing core.cpuid,
figuring out which flag to use and set as a template argument and writing a
switch-case or if-else is not economically reasonable, so to speak when you
could enable SSE4 globally and often implicitly (-march=native). Also in my
case DMD wont profit, because it's inline assembly doesn't inline (making it
too slow) and GDC wont profit because it is not supported by core.cpuid,
leaving only LDC - but that's another story.

My argument here is that the one writing SIMD code is not necessarily the one
calling it. Compile-time information about the (implied) target enables us to
reduce the cognitive load for library users, and still make use of the latest
CPU features. This is working to great benefit with intrinsics in other
compilers (for popcnt, memcpy, etc.), but we can't imitate that. So we ended up
with runtime checks against a global variable in popcnt for what should be a
single instruction on recent CPUs and an additional "SSE4 only" _popcnt in
http://dlang.org/phobos/core_bitop.html#.popcnt

--


Re: Official dub packages for Debian and Ubuntu

2016-04-11 Thread Matthias Klumpp via Digitalmars-d-announce

On Monday, 11 April 2016 at 17:41:44 UTC, Matthias Klumpp wrote:

[...]
Eww, that's not something we can do for official packages - 
it's fine though for 3rd-party stuff :-)


"can not do", obviously... :P



Re: Official dub packages for Debian and Ubuntu

2016-04-11 Thread Matthias Klumpp via Digitalmars-d-announce

On Monday, 11 April 2016 at 14:26:32 UTC, Edwin van Leeuwen wrote:

On Monday, 11 April 2016 at 14:21:46 UTC, Matthias Klumpp wrote:
And porting Python code to D was incredibly easy. I'll likely 
blog about my experience with D).


That would be great. Do you have a link to your blog (and its 
rss feed)?


That would be http://blog.tenstral.net/ and 
http://blog.tenstral.net/feed - no D content there yet though, 
lots of Freedesktop and distro engineering stuff instead ^^


As part of that work, the dub package an build management 
system is now available in Debian, and I will ensure it works 
well.


Nice, that will make it a lot easier, for people that are not 
using D, to install D programs/packages


Jup - the biggest issue is that GDC and LDC are lagging behind 
the proprietary DMD compiler, especially in terms of supporting a 
more recent Phobos version. The latter makes many things 
buildable only with DMD, which won't be found in any mainstream 
Linux distribution (no free software).


On Monday, 11 April 2016 at 17:18:28 UTC, Jordi Sayol wrote:
El 11/04/16 a les 16:21, Matthias Klumpp via 
Digitalmars-d-announce ha escrit:

[...]
Co-maintainers[1] and feedback from the dub developers is very 
welcome, and I hope this addition is useful for you.

[...]
[1]: Especially from the d-apt people - helping with official 
Debian packages is possible even if you're no Debian Developer 
/ Maintainer.


I'm the only one d-apt maintainer.

About the d-apt dub deb package, they're built using binaries 
from  and do not compile 
anything.


Eww, that's not something we can do for official packages - it's 
fine though for 3rd-party stuff :-)


How long will it take from a dub release until dub deb package 
will be available on the Debian stable repositories? And for 
Ubuntu?


Depends on the release cycle of Debian and Ubuntu. Generally, 
once software is in stable, it will only receive security fixes, 
and no further upstream versions will be added. That is part of 
the stability promise we give to users. Every new upstream 
release might include changes in behavior, breaking things or 
introducing new bugs.


That being said, new upstream releases can be made available via 
backports, if there is demand for it (it's relatively easy, if 
the code compiles with the older GDC release in stable at that 
time).


The Ubuntu Xenial (16.04) release (due in April) will have dub 
0.9.24, and Debian Stretch (9), which will likely be released in 
spring next year, will have whatever dub version is current then 
(or if the dub developers prefer a certain version for stable, 
that version).


Cheers,
  Matthias


Re: Official dub packages for Debian and Ubuntu

2016-04-11 Thread Jordi Sayol via Digitalmars-d-announce
El 11/04/16 a les 16:21, Matthias Klumpp via Digitalmars-d-announce ha escrit:
> As part of that work, the dub package an build management system is now 
> available in Debian, and I will ensure it works well.
> Additionally, it was possible to make dub available late in the Ubuntu 16.04 
> (Xenial) development cycle, so dub will also be part of the upcoming LTS 
> release of Ubuntu

This is a very good news!

> Co-maintainers[1] and feedback from the dub developers is very welcome, and I 
> hope this addition is useful for you.
[...]
> [1]: Especially from the d-apt people - helping with official Debian packages 
> is possible even if you're no Debian Developer / Maintainer. 

I'm the only one d-apt maintainer. 

About the d-apt dub deb package, they're built using binaries from 
 and do not compile anything.

How long will it take from a dub release until dub deb package will be 
available on the Debian stable repositories? And for Ubuntu?

Regards,
Jordi.


Re: Females in the community.

2016-04-11 Thread Ola Fosheim Grøstad via Digitalmars-d

On Saturday, 26 March 2016 at 19:52:18 UTC, QAston wrote:
A person who advocates for a more welcoming community and 
wishes for objective moderation introduces a divisive topic


You need to relax. The topic wasn't divisive. I haven't asked for 
moderation. I haven't argued in favour of objectivity. What is 
appropriate and not appropriate in an off-topic social thread 
like this is entirely cultural. I don't consider politics to be 
particularly contentious, and have never seen it been made an 
issue of, outside of very narrow US contexts, in my past _30_ 
years on the Internet. The overall problem with this mentality is 
that you aren't supposed to mention politics _in case_ someone 
gets offended, not because they actually do get offended. Which 
pretty much makes it very difficult to get a working democracy.


What _is_ a problem in these forums are the level of butt-hurt 
personal focus, not the occasional social thread. This community 
would be much better if there were more social threads, actually. 
A general forum is _usually_ a catch-all forum, so if you guys 
want to allow socialization, but don't want off-topic threads you 
probably should consider creating a separate social forum.


Of course, it seems like socialization is not a priority, but 
then you won't see the formation of strong bonds either (outside 
of IRC etc). Github doesn't really form strong ties. The basic 
idea that people will form strong teams based on code alone is 
not entirely well-founded.


Re: Dub and derelict-allegro5 "Could not find a valid dependency tree configuration"

2016-04-11 Thread Mike Parker via Digitalmars-d-learn

On Monday, 11 April 2016 at 10:34:58 UTC, Pedro Lopes wrote:



it is definitely derelict-allegro5's fault.



Yes. As I said in my second post, change your dependency to 0.0.5 
and you should be good to go.


Re: Any usable SIMD implementation?

2016-04-11 Thread Marco Leise via Digitalmars-d
Am Wed, 6 Apr 2016 20:29:21 -0700
schrieb Walter Bright :

> On 4/6/2016 7:25 PM, Manu via Digitalmars-d wrote:
> > TL;DR, defining architectures with an intel-centric naming convention
> > is a very bad idea.  
> 
> You're not making a good case for a standard language defined set of 
> definitions 
> for all these (they'll always be obsolete, inadequate and probably wrong, as 
> you 
> point out).

We can either define the language in terms of CPU models or
features and Manu gave two good reasons to go with features:
1) Typically we end up with "version(SSE4)" and similar in our
   code, not "version(Haswell)".
2) On ARM chips it turns out difficult to translate models to
   features to begin with.

It wasn't a good or bad case for the feature in general.
That said, in the long run Dlang should grow said language.
Aside from scientific servers there are also a few Linux
distributions that compile and install most packages from
sources and telling the compile to target the host CPU comes
naturally there. In practice there is likely some config file
that sets an environment variable like CFLAGS to
"-march=native" on such systems.
I understand that DMD doesn't concern itself with all that,
but the D language itself of which DMD is one implementation
should not artificially be limited compared to popular C/C++
compilers. I died a bit on the inside when I saw Phobos add
both popcnt and _popcnt of which the latter is the version that
uses the POPCNT instruction found in newer x86 CPUs.
In GCC or LLVM when we use such an intrinic, the compiler will
take a look at the compilation target and pick the optimal
code at compile-time. In one micro-benchmark [1], POPCNT was
roughly 50 times faster than bit-twiddling. If I wanted an SSE4
version in otherwise generic amd64 code, I would add
@attribute("target", "+sse4") before the function using popcnt.

So in my eyes a system like GCC offers, where you can specify
target features on the command line and also override them for
specific functions is a viable solution that simplifies user
code (just picking the popcnt, clz, bsr, ... intrinsic will
always be optimal) and Phobos code by making _popcnt et.al.
superfluous. In addition, the compiler could later error out on
mnemonics in our inline assembly that don't exist on the
target. This avoids unexpected "Illegal Instruction" crashes.

[1]
http://kent-vandervelden.blogspot.de/2009/10/counting-bits-population-count-and.html

-- 
Marco



[Issue 12367] std.regex: Recognize (?# ... ) comment syntax

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12367

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/12c7d680449dde70fdb5f35c997d6940e4298a81
Fix issue 12367 - std.regex: Recognize (?# ... ) comment syntax

https://github.com/D-Programming-Language/phobos/commit/9f256889edd5069fe6d3e6babb22c406933dbd2c
Add documnetation and changelog for issue 12367

https://github.com/D-Programming-Language/phobos/commit/b4f0478434ba3c44306f9cfaf74d250e481fca32
Merge pull request #4159 from DmitryOlshansky/issue-12367

Fix issue 12367 - std.regex: Recognize (?# ... ) comment syntax

--


Re: Cancelling a stdin.read?

2016-04-11 Thread Adam D. Ruppe via Digitalmars-d-learn

On Monday, 11 April 2016 at 14:57:27 UTC, Lass Safin wrote:
I can't put it in one loop, since the window also has some 
autonomous features.


Eh, my terminal.d and simpledisplay.d can combine event loops, 
you use a muliplexing function like select() on both the window 
and terminal so it waits for either or both at once without 
either blocking the other.


It does mean you need to skip readln though, since its buffering 
can break those multiplexing functions.



Well, anyway, take a gander at:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa363794%28v=vs.85%29.aspx

which is Windows Vista and up. or on linux send yourself a sigint 
https://en.wikipedia.org/wiki/SIGINT_%28POSIX%29


kill(getpid(), SIGINT);

should do the trick. import core.sys.posix.signal; IIRC for those 
functions


Re: Cancelling a stdin.read?

2016-04-11 Thread Lass Safin via Digitalmars-d-learn

On Monday, 11 April 2016 at 14:53:31 UTC, Adam D. Ruppe wrote:

On Sunday, 10 April 2016 at 08:29:22 UTC, Lass Safin wrote:
Thus, my question is: Is there any way to cancel the read from 
stdin prematurely from another thread, so that the thread can 
finish?


What operating system are you on?

I wouldn't be using threads for this at all, you might want to 
reorganize the program to get terminal events sent to the same 
gui event loop so exiting it would exit all of it.


But failing that, canceling an I/O request can be done by 
sending yourself a signal on posix and on Windows there's a 
system API call that one thread can cancel another thread's 
blocking read.


The D library would see these cancels as an error and throw an 
exception. You could catch it or let it kill the thread, since 
you want to exit anyway.


My savior!
I can't put it in one loop, since the window also has some 
autonomous features.


Re: Cancelling a stdin.read?

2016-04-11 Thread Adam D. Ruppe via Digitalmars-d-learn

On Sunday, 10 April 2016 at 08:29:22 UTC, Lass Safin wrote:
Thus, my question is: Is there any way to cancel the read from 
stdin prematurely from another thread, so that the thread can 
finish?


What operating system are you on?

I wouldn't be using threads for this at all, you might want to 
reorganize the program to get terminal events sent to the same 
gui event loop so exiting it would exit all of it.


But failing that, canceling an I/O request can be done by sending 
yourself a signal on posix and on Windows there's a system API 
call that one thread can cancel another thread's blocking read.


The D library would see these cancels as an error and throw an 
exception. You could catch it or let it kill the thread, since 
you want to exit anyway.


[Issue 15861] [REG 2.069] Wrong double-to-string conversion with -O

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15861

--- Comment #3 from Vladimir Panteleev  ---
Thanks. In the future, you can let me know if you'd like a completely reduced
test case.

--


Re: Is it legal to use std.windows modules?

2016-04-11 Thread Adam D. Ruppe via Digitalmars-d-learn

On Friday, 8 April 2016 at 22:50:05 UTC, FreeSlave wrote:
std.windows.syserror and others have documentation comments, 
but they are not listed in online documentation on dlang.org. 
Is it ok to use functions and classes from this modules in D 
applications?


For what it is worth, my dpldocs.info site is able to document it:

http://dpldocs.info/experimental-docs/std.windows.html

and there's nothing in the source about it being private, so you 
should be ok using it.


Re: Any usable SIMD implementation?

2016-04-11 Thread Marco Leise via Digitalmars-d
Am Mon, 4 Apr 2016 13:29:11 -0700
schrieb Walter Bright :

> On 4/4/2016 7:02 AM, 9il wrote:
> >> What kind of information?  
> >
> > Target cpu configuration:
> > - CPU architecture (done)  
> 
> Done.
> 
> > - Count of FP/Integer registers  
> 
> ??
> 
> > - Allowed sets of instructions: for example, AVX2, FMA4  
> 
> Done. D_SIMD

I wonder if answers like this are meant to be filled into a
template like this: "We have [$2] in place for that. If that
doesn't get the job $1, please report whatever is missing to
bugzilla. Thanks!"
Since otherwise it should be clear that the distinction
between AVX2 and FMA4 asks for something more specialized
than D_SIMD, which is basically the same as checking the
front-end __VERSION__.

-- 
Marco



Re: Any usable SIMD implementation?

2016-04-11 Thread Marco Leise via Digitalmars-d
Am Mon, 4 Apr 2016 11:43:58 -0700
schrieb Walter Bright :

> On 4/4/2016 9:21 AM, Marco Leise wrote:
> >To put this to good use, we need a reliable way - basically
> >a global variable - to check for SSE4 (or POPCNT, etc.). What
> >we have now does not work across all compilers.  
> 
> http://dlang.org/phobos/core_cpuid.html

That's what I implied in "what we have now":

import core.cpuid;

writeln( mmx );  // prints 'false' with GDC
version(InlineAsm_X86_Any)
writeln("DMD and LDC support the Dlang inline assembler");
else
writeln("GDC has the GCC extended inline assembler");

Both LLVM and GCC have moved to "extended inline assemblers"
that require you to provide information about input, output
and scratch registers as well as memory locations, so the
compiler can see through the asm-block for register allocation
and inlining purposes. It's more difficult to get right, but
also more rewarding, as it enables you to write no-overhead
"one-liners" and "intrinsics" while having calling conventions
still handled by the compiler. An example for GDC:

struct DblWord { ulong lo, hi; }

/// Multiplies two machine words and returns a double
/// machine word.
DblWord bigMul(ulong x, ulong y)
{
DblWord tmp = void;
// '=a' and '=d' are outputs to RAX and RDX
// respectively that are bound to the two
// fields of 'tmp'.
// '"a" x' means that we want 'x' as input in
// RAX and '"rm" y' places 'y' wherever it
// suits the compiler (any general purpose
// register or memory location).
// 'mulq %3' multiplies with the ulong
// represented by the argument at index 3 (y). 
asm {
"mulq %3"
 : "=a" tmp.lo, "=d" tmp.hi
 : "a" x, "rm" y;
}
return tmp;
}

In the above example the compiler has enough information to
inline the function or directly return the result in RAX:RDX
without writing to memory first. The same thing in DMD would
likely have turned out slower than emulating this using
several uint->ulong multiplies.

Although less powerful, the LDC team implemented Dlang inline
assembly according to the specs and so core.cpuid works for
them. GDC on the other hand is out of the picture until either
1) GDC adds Dlang inline assembly
2) core.cpuid duplicates most of its assembly code to support
   the GCC extended inline assembler

I would prefer a common extended inline assembler though,
because when you use it for performance reasons you typically
cannot go with non-inlinable Dlang asm, so you end up with pure
D for DMD, GCC asm for GDC and LDC asm - three code paths.

-- 
Marco



Re: Official dub packages for Debian and Ubuntu

2016-04-11 Thread Edwin van Leeuwen via Digitalmars-d-announce

On Monday, 11 April 2016 at 14:21:46 UTC, Matthias Klumpp wrote:
And porting Python code to D was incredibly easy. I'll likely 
blog about my experience with D).


That would be great. Do you have a link to your blog (and its rss 
feed)?


As part of that work, the dub package an build management 
system is now available in Debian, and I will ensure it works 
well.


Nice, that will make it a lot easier, for people that are not 
using D, to install D programs/packages


Official dub packages for Debian and Ubuntu

2016-04-11 Thread Matthias Klumpp via Digitalmars-d-announce

Hello!
I am very new to the D community and just recently finished a 
project in D, which I want to make available in Debian (reason 
for choosing D was mostly its speed and similarity to C++ and C, 
making a very shallow learning curve for someone knowing these 
languages. And porting Python code to D was incredibly easy. I'll 
likely blog about my experience with D).


As part of that work, the dub package an build management system 
is now available in Debian, and I will ensure it works well.
Additionally, it was possible to make dub available late in the 
Ubuntu 16.04 (Xenial) development cycle, so dub will also be part 
of the upcoming LTS release of Ubuntu (kudos here go to Matthias 
Klose for pointing me at the "new" --push-state linker directive 
to work around dub not linking properly against libcurl when the 
latter is compiled with --as-needed).


Co-maintainers[1] and feedback from the dub developers is very 
welcome, and I hope this addition is useful for you.


On the roadmap are adding debhelper sequences to simplify 
packaging dub-based D code in Debian based distros, auto-test 
support in Debian's CI, and of course the usual bugfixing.


Cheers,
Matthias

https://packages.debian.org/stretch/dub
http://packages.ubuntu.com/xenial/dub

[1]: Especially from the d-apt people - helping with official 
Debian packages is possible even if you're no Debian Developer / 
Maintainer.


Re: Dynamic library

2016-04-11 Thread Chris via Digitalmars-d-learn
I wanted to test, if I could use D with JNA (Java Native Access). 
I get this error message:


# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x7fd24ab66074, pid=15733, 
tid=140541714827008

#
# JRE version: OpenJDK Runtime Environment (8.0_66-b17) (build 
1.8.0_66-internal-b17)
# Java VM: OpenJDK 64-Bit Server VM (25.66-b17 mixed mode 
linux-amd64 compressed oops)

# Problematic frame:
# C  [libphobos2.so.0.69+0x467074]  _d_dso_registry+0x59c

libphobos is a "problematic frame".



Re: Dynamic library

2016-04-11 Thread Chris via Digitalmars-d-learn

On Monday, 11 April 2016 at 13:45:42 UTC, Adam D. Ruppe wrote:

On Monday, 11 April 2016 at 13:40:14 UTC, Chris wrote:
For the record, I fixed it by changing the contents of 
libphobos2.so from


How did you do that btw? The file there should really just be a 
link to some binary file, maybe it got mangled in copying at 
some point.


Turns out that it was due to dvm (the D version manager). Somehow 
the libraries (in linux/lib64/) are not unzipped properly when 
dvm installs a version of D/dmd. I unzipped them manually and now 
it works without changing "libphobos2.so" as it is now recognizes 
as a "link to libphobos2.so.0.xx.x". In the dvm installation 
libphobos2.so is recognized as "shared library" while it is only 
a line of text (interpreted as linker script).


Re: Dynamic library

2016-04-11 Thread Adam D. Ruppe via Digitalmars-d-learn

On Monday, 11 April 2016 at 13:40:14 UTC, Chris wrote:
For the record, I fixed it by changing the contents of 
libphobos2.so from


How did you do that btw? The file there should really just be a 
link to some binary file, maybe it got mangled in copying at some 
point.


Re: Dynamic library

2016-04-11 Thread Chris via Digitalmars-d-learn

On Monday, 11 April 2016 at 11:42:22 UTC, Chris wrote:

I followed these steps:

https://dlang.org/dll-linux.html#dso7

What I get is this error:

libphobos2.so: file format not recognized; treating as linker 
script


I don't know why it is not recognized. Any ideas?


For the record, I fixed it by changing the contents of 
libphobos2.so from


libphobos2.so.069.2 [or whatever]

to

GROUP (libphobos2.so.0.69.2)


Re: Any usable SIMD implementation?

2016-04-11 Thread Marco Leise via Digitalmars-d
Am Mon, 04 Apr 2016 18:35:26 +
schrieb 9il :

> @attribute("target", "+sse4")) would not work well for BLAS. BLAS 
> needs compile time constants. This is very important because BLAS 
> can be 95% portable, so I just need to write a code that would be 
> optimized very well by compiler. --Ilya

It's just for the case where you want a generic executable
with a generic and a specialized code path. I didn't mean this
to be exclusively used without compile-time information about
target features. 

-- 
Marco



[Issue 15884] Assigning char[] to std.json.JSONValue creates array, not string

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15884

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 15884] Assigning char[] to std.json.JSONValue creates array, not string

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15884

--- Comment #3 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/329f068d7aedd0371b324c2676a4ebf75f3a4a13
fix issue 15884 - Assigning char[] to std.json.JSONValue creates array, not
string

https://github.com/D-Programming-Language/phobos/commit/ada161f0c571733aeb280566d6aff0af1e9396ad
Merge pull request #4176 from BBasile/issue-15884

fix issue 15884 - Assigning char[] to std.json.JSONValue creates array, not
string

--


Re: Release D 2.071.0

2016-04-11 Thread Kagamin via Digitalmars-d-announce

On Monday, 11 April 2016 at 11:43:20 UTC, wobbles wrote:

When updating with the .dev package on my Ubuntu 15.10 system

https://forum.dlang.org/post/mailman.4114.1454138584.22025.digitalmars-d-annou...@puremagic.com


Re: mov reg,0 vs xor reg,reg in core.atomic ?

2016-04-11 Thread Kagamin via Digitalmars-d-learn

https://randomascii.wordpress.com/2012/12/29/the-surprising-subtleties-of-zeroing-a-register/
But there was at least one out-of-order design that did not 
recognize xor reg, reg as a special case: the Pentium Pro. The 
Intel Optimization manuals for the Pentium Pro recommended 
“mov” to zero a register.


Dynamic library

2016-04-11 Thread Chris via Digitalmars-d-learn

I followed these steps:

https://dlang.org/dll-linux.html#dso7

What I get is this error:

libphobos2.so: file format not recognized; treating as linker 
script


I don't know why it is not recognized. Any ideas?


Re: Release D 2.071.0

2016-04-11 Thread wobbles via Digitalmars-d-announce

On Monday, 11 April 2016 at 11:43:20 UTC, wobbles wrote:

On Tuesday, 5 April 2016 at 22:43:05 UTC, Martin Nowak wrote:

Glad to announce D 2.071.0.

http://dlang.org/download.html

This release fixes many long-standing issues with imports and 
the module

system.
See the changelog for more details.

http://dlang.org/changelog/2.071.0.html

-Martin


When updating with the .dev package on my Ubuntu 15.10 system -


.deb package - not .dev


Re: Release D 2.071.0

2016-04-11 Thread wobbles via Digitalmars-d-announce

On Tuesday, 5 April 2016 at 22:43:05 UTC, Martin Nowak wrote:

Glad to announce D 2.071.0.

http://dlang.org/download.html

This release fixes many long-standing issues with imports and 
the module

system.
See the changelog for more details.

http://dlang.org/changelog/2.071.0.html

-Martin


When updating with the .dev package on my Ubuntu 15.10 system - I 
get this message:

```
The installation of a package which violates the quality 
standards isn't allowed. This could cause serious problems on 
your computer. Please contact the person or organisation who 
provided this package file and include the details beneath.


Details
Lintian check results for 
/home/colin/Downloads/dmd_2.071.0-0_amd64.deb:
Can't close(GLOB(0x291a6f0)) filehandle: '' at 
/usr/share/lintian/helpers/coll/objdump-info-helper line 192
command failed with error code 123 at 
/usr/share/lintian/collection/objdump-info line 79.

warning: collect info objdump-info about package dmd failed
warning: skipping check of binary package dmd
```


Re: Dub and derelict-allegro5 "Could not find a valid dependency tree configuration"

2016-04-11 Thread Pedro Lopes via Digitalmars-d-learn

On Monday, 11 April 2016 at 00:36:28 UTC, Mike Parker wrote:



You say it happens when you try to "run" a project, but the 
error message sounds like it's happening before building even 
begins, correct? What platform are you on? What does your dub 
configuration look like? What does 'dub build -v' tell you?


Sorry for the delay (we are in different time zones),
I know my first post was kinda short, I did not gave enough info.
The error happens when I try to run the project.

I created the project with the dependency using this command:
" dub init allegrotest derelict-allegro5"
no errors are shown, the project is created just fine.

Then when I run the command: "dub run ", dub returns the error 
"Could not find a valid dependency tree configuration: "


If I run the command: "dub run --bare" dub returns this error: 
"Root package allegrotest contains reference to invalid package 
derelict-allegro5 0.0.4"


derelict-allegro5 might be the culprit... but maybe not entirely.

Whenever I ran the command: "dub build -v" it returns:
"Using dub registry url 'http://code.dlang.org/'
Refreshing local packages (refresh existing: true)...
Looking for local package map at 
/var/lib/dub/packages/local-packages.json
Looking for local package map at 
/home/pedro/.dub/packages/local-packages.json
Note: Failed to determine version of package allegrotest at .. 
Assuming ~master.

Refreshing local packages (refresh existing: false)...
Looking for local package map at 
/var/lib/dub/packages/local-packages.json
Looking for local package map at 
/home/pedro/.dub/packages/local-packages.json
Version selection for dependency derelict-allegro5 
(derelict-allegro5) of allegrotest is missing.

Checking for missing dependencies.
Search for versions of derelict-allegro5 (1 package suppliers)
Search for versions of derelict-util (1 package suppliers)
Package derelict-allegro5 contains invalid dependency 
derelict-util (ci=0)

Could not find a valid dependency tree configuration: "


it is definitely derelict-allegro5's fault.

this is my (auto-generated) dub.sdl file:
« name "allegrotest"
description "A minimal D application."
copyright "Copyright © 2016, pedro"
authors "pedro"
dependency "derelict-allegro5" version="0.0.4" »

My platform is a linux-lts Antergos (basically Arch).



[Issue 15682] Implement efficient setops for builtin AAs

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15682

ZombineDev  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||petar.p.ki...@gmail.com
 Resolution|REMIND  |---
Summary|concat associative arrays   |Implement efficient setops
   ||for builtin AAs

--- Comment #1 from ZombineDev  ---
Currently, Phobos provides setops only for sorted ranges
(http://dlang.org/phobos/std_algorithm_setops).
It would be great if druntime could expose primitives that would allow
efficient set operations over builtin AAs, including concatenation (set union),
as per OP.

As buitin AAs are implemented as hash tables (i.e. they are unordered) it is
not possible to implement efficiently set operations only using the byKey,
byValue and byKeyValue, etc. ranges.

--


[Issue 8716] `package` restricts members usage in same module if there is no package name

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8716

Sobirari Muhomori  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #6 from Sobirari Muhomori  ---


*** This issue has been marked as a duplicate of issue 15402 ***

--


[Issue 15402] allow private access to package symbols

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15402

Sobirari Muhomori  changed:

   What|Removed |Added

 CC||verylonglogin@gmail.com

--- Comment #5 from Sobirari Muhomori  ---
*** Issue 8716 has been marked as a duplicate of this issue. ***

--


Re: vibe.d kafka driver & probabilistic linear counting

2016-04-11 Thread André via Digitalmars-d-announce

On Sunday, 10 April 2016 at 10:51:38 UTC, yawniek wrote:

we pushed 2 new projects:

a native kafka driver to work with the vibe.d eventloop
http://code.dlang.org/packages/kafka-d
it's not full featured yet (no zookeeper) but the basic use 
cases work fine.
throughput depends on the buffer sizes but we achieved gigabit 
speeds in benchmarks.

thanks to Piotr for most of the implementation.


The news on Kafka are really great! Thanks a lot for the work! 
Did you inform the Kafka developers that there is a new language 
supported? Maybe this could be added to this Wiki page which 
lists all supported libs and languages: 
https://cwiki.apache.org/confluence/display/KAFKA/Clients.


Regards,
André




[Issue 15861] [REG 2.069] Wrong double-to-string conversion with -O

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15861

--- Comment #2 from Walter Bright  ---
https://github.com/D-Programming-Language/dmd/pull/5650

--


Re: New repo for my reusable D Phobos extensions

2016-04-11 Thread Nordlöw via Digitalmars-d-announce

On Sunday, 10 April 2016 at 20:54:31 UTC, ag0aep6g wrote:
No, these are the overloads for non-integer T. The constraint 
says `!(isIntegral!T)`. The integer overloads are above the 
ones I linked, respectively.


Ok. Thanks. Fixed.


[Issue 15861] [REG 2.069] Wrong double-to-string conversion with -O

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15861

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #1 from Walter Bright  ---
Sadly, this generates about 10,000 lines of assembler.

--


[Issue 15910] Prevent mismatch of VERSION information in dmd releases

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15910

--- Comment #2 from Joseph Rushton Wakeling  ---
> That's not entirely correct b/c the downloadable packages contain the correct 
> VERSION file

Well, yes, that's really the point of concern -- there is a mismatch between
the downloadable packages (correct version) and the git-hosted source
(incorrect version), that shouldn't be there.

> Now we could validate that the VERSION file contains the to be build tag, but 
> this will be a constant nuisance, e.g. deleting already created tags, 
> changing the VERSION from 2.071.0-b1 to 2.071.0-b2, retag, and build.

I'm not sure I follow the concern here.  If there are multiple version tags on
a single commit, isn't the norm to just take the highest version out of all of
them?  And then compare to VERSION contents ... ?

> I'd instead suggest that any build script using the git repo or tags, should 
> get the VERSION from git or write the VERSION file when downloading a tar 
> bundle from github.

Yes, it makes sense that git tags might be the principal source of version
information and that VERSION should derive from that.  Probably this could
address both the issue described here and
 all in one go?

> VERSION can also be set through make -f posix.mak VERSION=2.071.0

Thanks, that's useful.

--


[Issue 15899] Tuple.toString not recognized as a function with isSomeFunction

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15899

Edwin van Leeuwen  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--


[Issue 15899] Tuple.toString not recognized as a function with isSomeFunction

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15899

--- Comment #2 from Edwin van Leeuwen  ---
That makes sense, thanks for the explanation.

Might be useful to add an isField attribute to traits. Previously I assumed
that if something !isSomeFunction it would be a field, but that does not seem
to be the case. Now changed that assumption to also ignore templates.

--


Re: Graylog Extended Log Format (GELF) for D

2016-04-11 Thread Adil via Digitalmars-d-announce

On Saturday, 9 April 2016 at 20:06:01 UTC, angel wrote:

But what about this ?
https://forum.dlang.org/thread/eryphpbznrrovjvxj...@forum.dlang.org


What about it?


[Issue 14914] Inconsistent alias declaration could be detected

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14914

b2.t...@gmx.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--


[Issue 15682] concat associative arrays

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15682

b2.t...@gmx.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |REMIND

--


[Issue 15043] [e2ir] dmd still crashes when trying to set a delegate from __traits(getOverloads)

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15043

b2.t...@gmx.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX
   Assignee|k.hara...@gmail.com |nob...@puremagic.com

--


Re: D goes business! Bindings for SAP NetWeaver RFC SDK

2016-04-11 Thread Lars Johansson via Digitalmars-d-announce

On Monday, 4 April 2016 at 04:52:06 UTC, Kai Nacke wrote:

On Saturday, 2 April 2016 at 08:00:18 UTC, Lars Johansson wrote:

Hi Kai,
I'm for the zillionth time starting to learn D. I just started 
with 'The D programming language' after that I will explore 
the possibilities to access SAP from D. A good SAP is 
important for my sucess with D. Will you maintain and develop 
the SAP interface?


Hi Lars!

Yes, I maintain and develop the SAP interface. It is my 2nd pet 
project after ldc. :-)


All functions from the SDK except for DecFloat16 and DecFloat34 
are available and can be used like in C. As additional goody I 
created decorate functions which throw a SAPException instead 
of returning RFC_ERROR_INFO. This simplifies the logic a lot.


I really like to have more users of the SAP binding. There are 
still rough edges and I like to know about them...


Regards,
Kai


Hi Kai,
Thats good to hear, I'm struggle on with with your "D web 
development". If I succeed and have the time I will try to 
convert my SAP integration extension from PHP to D, just for the 
hell of it. Unfortunately I have neither the skill nor the time 
to help with your SAP module.
This post is obsolete but it gives an idea of what I will try to 
do in D. 
http://larsxjohansson.blogspot.se/2012/03/extracting-data-from-sap.html
If all goes well I will start with the conversion this summer, 
but do not do anything just for me, I'm a very unreliable user.


[Issue 15350] [MailMan] end of message stripped

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15350

b2.t...@gmx.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--


[Issue 15880] int hex literals properties are rejected

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15880

b2.t...@gmx.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--


[Issue 15805] Automatic fix two erroneous integer comparison cases by widening

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15805

b2.t...@gmx.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--


[Issue 11356] isASCII for strings

2016-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11356

--- Comment #6 from github-bugzi...@puremagic.com ---
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/0015fd25b70d1bfa83a9c3563760ad85fdfbb9ca
Merge pull request #4153 from JackStouffer/issue11356

Add Informative Example to canEncode

--


Re: The day before DConf 2016

2016-04-11 Thread darat via Digitalmars-d

On Sunday, 10 April 2016 at 21:21:47 UTC, Andrej Mitrovic wrote:

PSA: Just remember you have to stamp your cards before boarding
(unless it's a monthly ticket).

When I was new in Berlin I even ended up once stamping a 
monthly ticket, which was a mistake. The ticket inspectors had 
a heartily laugh when they saw it and just said "you don't have 
to do that.. :)".


lol, I imagine the guy who stamps the monthly ticket 31 times.
"Mmmmh it's strange but maybe it's like that here"


Re: mov reg,0 vs xor reg,reg in core.atomic ?

2016-04-11 Thread darat via Digitalmars-d-learn

On Monday, 11 April 2016 at 05:45:17 UTC, Ali Çehreli wrote:

On 04/10/2016 04:00 AM, darat wrote:
Is there a particular reason explaining why mov reg,0 is used 
and not

xor reg,reg ?

https://www.google.com/search?q=mov+0+versus+xor+cycles=utf-8=utf-8#q=mov+0+versus+xor+cpu+cycle

Ali


I've read them all before posting here. Nothing answers the 
question. The only clue is maybe that xor modifies the EFLAG 
register, but since inline asm is not inlined (there's always a 
CALL) I'm not 100% sure this is relevant.