OT: Tiobe Index - December Headline: What is happening to good old language C?

2016-12-05 Thread Nick B via Digitalmars-d
The programming language of all programming languages C is 
consistently going down since November 2015. The language was in 
a range of 15% to 20% for more than 15 years and this year it 
suddenly started to suffer. Its ratings are now less than 10% and 
there is no clear way back to the top. So what happened to C? 
Some months ago we already listed some possible reasons: it is 
not a language that you think of while writing programs for 
popular fields such as mobile apps or websites, it is not 
evolving that much and there is no big company promoting the 
language. May be there are more reasons. If you happen to know 
one, please share it with us.


source: http://www.tiobe.com/tiobe-index/   (Dec 2016)


cheers
Nick




Re: [Semi-OT] I don't want to leave this language!

2016-12-05 Thread Nicholas Wilson via Digitalmars-d-learn

On Monday, 5 December 2016 at 20:49:50 UTC, e-y-e wrote:
On Monday, 5 December 2016 at 20:25:00 UTC, Ilya Yaroshenko 
wrote:

[...]


You know from the 15th December I will have a month of free 
time, and I would love to get myself up to speed with Mir to 
contribute to it. If you don't mind me saying, I think Mir 
could be one of the best things for the future of D (along with 
LDC) and I'd be glad to help it on its way.


That'd be great, drop in to our gitter some time 
https://gitter.im/libmir/public if you have any questions. The 
modules last updated before November are not very interesting at 
the moment. dcompute is, but is waiting on pulls for LDC.


Re: Andrei on the new D Foundation Scholarships

2016-12-05 Thread Walter Bright via Digitalmars-d-announce

On 12/5/2016 8:16 PM, Mike Parker wrote:

Thanks. I've noticed that when I leave such comments they initially get a number
of upvotes, but in some cases they get downvoted over time. So now I've taken to
only leaving them on posts where I can't come up with an obvious title for the
reddit link. I have no way to say what sort of impact it has on traffic from
reddit, though. Certain types of posts get more than others and I can't see any
correlation with explanatory comments.


My unscientific, anecdotal experience with reddit is that the first post, 
written well, will spark positive interest and discussion. It's really the same 
thing you already did when you posted the link to the n.g.


A negative first post will frame everything negatively afterwards. We shouldn't 
leave this possibility to chance. First impressions matter here as much as anywhere.


No first post often results in nobody ever commenting on it. If I see a topic 
with no posts, I think "why waste my time commenting here, nobody cares about 
this and nobody is looking at it."


If a title alone is good enough, movies would not be marketed with trailers, and 
books would not have a back cover.


If you're writing first posts that get downvoted, I suspect that concluding that 
first posts are a bad idea may not be correct. Maybe it just needs to be a 
better first post :-) Next time this happens, please ping me or Andrei and maybe 
we can help.


[Issue 5995] string append negative integer causes segfault

2016-12-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5995

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

   What|Removed |Added

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

--


[Issue 5995] string append negative integer causes segfault

2016-12-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5995

--- Comment #19 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/316e6d2607b4b22794ef75a331ad27d970717cda
fix issue 5995

https://github.com/dlang/druntime/commit/6dbbadbac4a0567ba49f0e616fccc8c597fec771
Merge pull request #1696 from somzzz/issue_5995

fix issue 5995 - string append negative integer causes segfault

--


Re: Andrei on the new D Foundation Scholarships

2016-12-05 Thread Mike Parker via Digitalmars-d-announce

On Tuesday, 6 December 2016 at 01:08:19 UTC, Walter Bright wrote:

On 12/5/2016 5:36 AM, Mike Parker wrote:



I took the liberty of posting the above to the reddit topic.

As always, postings on reddit will get less than half of the 
potential traction unless there's a comment explaining why the 
user should bother to click on the associated link.


Your excellent work is wasted unless this is done :-(


Thanks. I've noticed that when I leave such comments they 
initially get a number of upvotes, but in some cases they get 
downvoted over time. So now I've taken to only leaving them on 
posts where I can't come up with an obvious title for the reddit 
link. I have no way to say what sort of impact it has on traffic 
from reddit, though. Certain types of posts get more than others 
and I can't see any correlation with explanatory comments.


Re: Set Intersection of SortedRanges

2016-12-05 Thread Nicholas Wilson via Digitalmars-d-learn
Whoops forgot to add checks for .empty on the ranges, and I don't 
think reduce!equal work but you get the point.


Re: Set Intersection of SortedRanges

2016-12-05 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 6 December 2016 at 01:46:38 UTC, Nicholas Wilson 
wrote:

On Monday, 5 December 2016 at 22:10:34 UTC, Nordlöw wrote:

On Monday, 5 December 2016 at 21:48:49 UTC, Nordlöw wrote:

Ahh, setops has intersection aswell:

https://dlang.org/phobos/std_algorithm_setops.html#setIntersection

I should have a guessed that.


Ahh again, but current Phobos is currently not optimized for 
the case when all inputs are SortedArrays. In that case a 
double binary search algorithm as describe here


http://cs.stackexchange.com/a/37124/25769

might be faster.

Has anybody already done this?


The double binary search linked only finds *one* element of the 
intersection.


It should be as simple as a linear find (over the range of 
ranges) that returns (i.e. caches to .front) if the elements 
intersect.


Hmm not sure that will work.

The annoying property of this problem is calculating .empty and 
having .empty not mutate the ranges. however if you settle for an 
eager empty something like


auto setIntersect(RoR,alias _pred)(RoR ror) if (allSatisfy!(RoR, 
isSortedRange!_pred) &&
  
allSatisfy!(RoR, isSame!(ElementType) &&
 
!allSatisfy!(RoR, isRandomAccessRange))

{
enum lengths = RoR.length;
alias elem = ElementType!(RoR[0]);
alias pred = BinaryFun!_pred;
struct SetIntersect
{
RoR ror;
elem[lengths] fronts = void;
elem front = void;
bool valid = false;
this(RoR r)
{
ror = r;
populate();
}
void populate()
{
foreach(i, ref r; ror)
  fronts[i] = r.front;
}
void advance()
{
foreach( ref r; ror)
r.popFront();
}
void popFront() { valid = false; }
bool empty()
{
if (valid) return false;
advance();
populate();
if (reduce!(equal)(fronts)) return false;
elem m = reduce!(pred)(fronts);
foreach(i, ref r; ror)
{
  while(!pred(r.front,m))
 r.popFront();

}
populate();
valid = reduce!(equal)(fronts));
return !valid;
}

}
}



Re: Derelict

2016-12-05 Thread D.Rex via Digitalmars-d

On Monday, 5 December 2016 at 22:36:25 UTC, Chris Wright wrote:

On Mon, 05 Dec 2016 15:46:44 +, D.Rex wrote:

Do DLLs have to be marked executable? I seem to recall 
something like that.


Okay, so I moved my source code and the glfw3 dll to my local 
machine and lo and behold it worked, so I gather the 'access 
denied' problem I was having before was an issue regarding 
permissions on the FileServer side.  I should probably make note 
of that somewhere...


Re: Set Intersection of SortedRanges

2016-12-05 Thread Nicholas Wilson via Digitalmars-d-learn

On Monday, 5 December 2016 at 22:10:34 UTC, Nordlöw wrote:

On Monday, 5 December 2016 at 21:48:49 UTC, Nordlöw wrote:

Ahh, setops has intersection aswell:

https://dlang.org/phobos/std_algorithm_setops.html#setIntersection

I should have a guessed that.


Ahh again, but current Phobos is currently not optimized for 
the case when all inputs are SortedArrays. In that case a 
double binary search algorithm as describe here


http://cs.stackexchange.com/a/37124/25769

might be faster.

Has anybody already done this?


The double binary search linked only finds *one* element of the 
intersection.


It should be as simple as a linear find (over the range of 
ranges) that returns (i.e. caches to .front) if the elements 
intersect.




Re: D Flowgraph GUI Interface

2016-12-05 Thread Nick B via Digitalmars-d

On Monday, 5 December 2016 at 12:35:46 UTC, D.Rex wrote:

Howdy,

I am embarking on a project to create a Flowgraph (node based) 
GUI interface, much like Blender's Node Editor or Unreal ENgine 
4's Blueprint System, for other future projects, I have been 
looking around for many months now on tutorials but I can never 
quite find anything.   but I really like D as a language, and 
want this interface to be written in it.


Cheers!


try here

https://s3.amazonaws.com/gamedev-tutorials/Tutorials/Scripting-Flow_Graph-(01)_Introduction_to_Flow_Graph.pdf


Re: Andrei on the new D Foundation Scholarships

2016-12-05 Thread Walter Bright via Digitalmars-d-announce

On 12/5/2016 5:36 AM, Mike Parker wrote:

After a two-week hiatus, the latest post at the blog takes the form of an
interview with Andrei regarding the new scholarships he announced a couple weeks
back. He talks about how the program came into existence, how it works, and some
of what he hopes to see come out of it.


I took the liberty of posting the above to the reddit topic.

As always, postings on reddit will get less than half of the potential traction 
unless there's a comment explaining why the user should bother to click on the 
associated link.


Your excellent work is wasted unless this is done :-(


Re: [Semi-OT] I don't want to leave this language!

2016-12-05 Thread sarn via Digitalmars-d-learn

On Monday, 5 December 2016 at 17:18:25 UTC, e-y-e wrote:
Currently I have been learning D for about a year and a half. 
This may seem like a short time, but this is the longest I have 
stuck with any language. I have only been learning for 4 years 
and I am currently in university studying first year of 
computer systems engineering.

...
Does anyone have any advice for me?


Honestly, I recommend just learning C and C++.  Especially C if 
you're into low level stuff.  You won't just broaden your job 
market, you'll learn stuff that will help you use D more 
effectively.  You don't have to think of it as "leaving" the 
language.


how can I replace some of the great things about D? Things like 
built-in unittests, sane static if, painless CTFE, ranges, or 
even just the DUB package manager/build tool.


You'll have to learn to do without them :)


Re: Derelict

2016-12-05 Thread Chris Wright via Digitalmars-d
On Mon, 05 Dec 2016 15:46:44 +, D.Rex wrote:
> My D source
> code and the GLFW3.dll library are stored on a Linux file server

Do DLLs have to be marked executable? I seem to recall something like 
that.


Re: Set Intersection of SortedRanges

2016-12-05 Thread Nordlöw via Digitalmars-d-learn

On Monday, 5 December 2016 at 21:48:49 UTC, Nordlöw wrote:

Ahh, setops has intersection aswell:

https://dlang.org/phobos/std_algorithm_setops.html#setIntersection

I should have a guessed that.


Ahh again, but current Phobos is currently not optimized for the 
case when all inputs are SortedArrays. In that case a double 
binary search algorithm as describe here


http://cs.stackexchange.com/a/37124/25769

might be faster.

Has anybody already done this?


Re: wrong isInputRange design

2016-12-05 Thread pineapple via Digitalmars-d

On Sunday, 4 December 2016 at 11:18:56 UTC, rumbu wrote:
Yes, this is the same workaround I found, but that does not 
solve the fact that the following code does not compile:


While it may be too late to redeem Phobos and its handling of 
arrays as ranges, it is worth noting that in the library I've 
been working on the `isRange` template behaves like you're 
expecting. In mach, `front` and `popFront` and `empty` are not 
defined for strings; rather, functions that accept ranges also 
accept types that ranges can be made to enumerate, including 
strings and other arrays.


If you really wanted an `isInputRange` that behaves like you're 
wanting, it's only a 6 line template that you would have to 
interject in your code.


enum bool isInputRange(T) = is(typeof({
T range = T.init;
if(range.empty){}
auto element = range.front;
range.popFront();
}));

https://github.com/pineapplemachine/mach.d



Re: Set Intersection of SortedRanges

2016-12-05 Thread Nordlöw via Digitalmars-d-learn

On Monday, 5 December 2016 at 21:34:39 UTC, Nordlöw wrote:
What's the fastest way of calculating a set-intersection of two 
or more SortedRanges (all containing unique values)?


Ahh, setops has intersection aswell:

https://dlang.org/phobos/std_algorithm_setops.html#setIntersection

I should have a guessed that.


Re: Set Union of SortedRanges

2016-12-05 Thread Nordlöw via Digitalmars-d-learn

On Monday, 5 December 2016 at 20:18:24 UTC, Nordlöw wrote:
What's the fastest way of calculating a set-union of two or 
more SortedRanges (all containing unique values)?


Doh, I meant intersection, not union:

http://forum.dlang.org/post/jthiwaxkyykalwfyk...@forum.dlang.org


Set Intersection of SortedRanges

2016-12-05 Thread Nordlöw via Digitalmars-d-learn
What's the fastest way of calculating a set-intersection of two 
or more SortedRanges (all containing unique values)?


Any typical branchings of the algorithm depending on the lengths 
of the SortedRanges?


Re: [Semi-OT] I don't want to leave this language!

2016-12-05 Thread e-y-e via Digitalmars-d-learn

On Monday, 5 December 2016 at 20:25:00 UTC, Ilya Yaroshenko wrote:

Hi e-y-e,

The main problem with D for production is its runtime. GC, 
DRuntime, Phobos is big constraint for real world software 
production.


Good D code should be nothrow, @nogc, and betterC. BetterC 
means that it must not require DRuntime to link and to start. I 
started Mir as scientific/numeric project, but it is going to 
be a replacement for Phobos to use D instead/with of C/C++.


For example, Mir CPUID, Mir GLAS, Mir Random are nothrow @nogc 
and do not need DRuntime to start/link. (Mir Random is not 
tested for BetterC, so maybe few dependencies are exist.) Mir 
Random covers C++11 random number generation for example.


If D code can be compiled into a common C libraries like Mir 
libs, than you can include it into existing ecosystem. 
Currently it is possible only with LDC (requires some 
programming techniques for now).


I will be happy to see more Mir contributors [1]

Currently there are 5 Mir devs (not all are visible publicly).

[1] https://github.com/libmir

Cheers,
Ilya


You know from the 15th December I will have a month of free time, 
and I would love to get myself up to speed with Mir to contribute 
to it. If you don't mind me saying, I think Mir could be one of 
the best things for the future of D (along with LDC) and I'd be 
glad to help it on its way.


Re: [Semi-OT] I don't want to leave this language!

2016-12-05 Thread Ilya Yaroshenko via Digitalmars-d-learn

Hi e-y-e,

The main problem with D for production is its runtime. GC, 
DRuntime, Phobos is big constraint for real world software 
production.


Good D code should be nothrow, @nogc, and betterC. BetterC means 
that it must not require DRuntime to link and to start. I started 
Mir as scientific/numeric project, but it is going to be a 
replacement for Phobos to use D instead/with of C/C++.


For example, Mir CPUID, Mir GLAS, Mir Random are nothrow @nogc 
and do not need DRuntime to start/link. (Mir Random is not tested 
for BetterC, so maybe few dependencies are exist.) Mir Random 
covers C++11 random number generation for example.


If D code can be compiled into a common C libraries like Mir 
libs, than you can include it into existing ecosystem. Currently 
it is possible only with LDC (requires some programming 
techniques for now).


I will be happy to see more Mir contributors [1]

Currently there are 5 Mir devs (not all are visible publicly).

[1] https://github.com/libmir

Cheers,
Ilya



Set Union of SortedRanges

2016-12-05 Thread Nordlöw via Digitalmars-d-learn
What's the fastest way of calculating a set-union of two or more 
SortedRanges (all containing unique values)?


Any typical branchings of the algorithm depending on the lengths 
of the SortedRanges?


Re: [Semi-OT] I don't want to leave this language!

2016-12-05 Thread bachmeier via Digitalmars-d-learn

On Monday, 5 December 2016 at 17:18:25 UTC, e-y-e wrote:
Currently I have been learning D for about a year and a half. 
This may seem like a short time, but this is the longest I have 
stuck with any language. I have only been learning for 4 years 
and I am currently in university studying first year of 
computer systems engineering.


My main problem is that now I am looking for industry 
placements, it is clear that in this field C and C++ are highly 
desired. I have used C++ prior to discovering D, but much of my 
learning curve has occured while using D, and I feel quite 
comfortable using it. Using D makes me look back at what a 
great language it is compared to C++ (I know it can also be 
compared to C but I haven't used C).


So I don't want to go back. It isn't as if I have a career in 
C++ (like I know some people here have) and use D (only) for 
pleasure so I have no real knowledge of how things I write in D 
compare to what I would do in C++ (and none whatsoever for C).


Does anyone have any advice for me? Obviously I'm going to have 
to make this leap and the organizations will have their own 
ecosystem but while I'm learning how can I replace some of the 
great things about D? Things like built-in unittests, sane 
static if, painless CTFE, ranges, or even just the DUB package 
manager/build tool.


Failing that, think of this as another one of those 'D is 
great!' posts ;). And whatever happens, I'll certainly try and 
convince my host company to use it...


I'm an academic, so no useful advice. I was reminded when reading 
your post of all the comments from Lisp, Scheme, Haskell, and 
[insert language] users that are able to choose their language 
for much of their job. Many use Lisp. Just not for production. An 
advantage of D is that you can mix C/C++ with D, so that 
increases the chance of using it.


Re: @property get/set or public varaible?

2016-12-05 Thread ArturG via Digitalmars-d-learn
On Sunday, 4 December 2016 at 20:44:05 UTC, Jonathan M Davis 
wrote:
On Sunday, December 04, 2016 15:30:22 vladdeSV via 
Digitalmars-d-learn wrote:

Hello!

I have a question not directly related to D as it is with 
coding standards.


My issue at hand is if I have one variable for a class, which I
want to be directly accessible for anything else, should it be
  1. public, or
  2. private, with @property get/setters?

 From what I have been told is that variables should be 
private.
But if I do not want to make any checks whatsoever when 
setting a

variable, I see no benefit to the private approach.

Are there any other reasons to use get/setters?





This might not be usefull for ure current usecase but if you want 
a property to behave like a field, it has to be a field.
So a boxed type might be better depending how much you want to 
manage.

Here are some property like examples:

   struct Prop(T)
   {
  private T value;

  alias opCall this;
  ref T opCall() { return value; }
  ref T opCall(T val) { return value = val; }
  string toString() { import std.conv: to; return 
value.to!string; }

   }

   struct ReadOnly(T)
   {
  private T value;

  alias opCall this;
  T opCall() { return value; } // return a copy
  string toString() { import std.conv: to; return 
value.to!string; }

   }

   struct WriteOnly(T)
   {
  private T value;

  void opAssign(T val) { value = val; }
  string toString() { return typeof(this).stringof; }
   }

// alternative write only so you can chain opCall 
writeOnly(33)(56)(66);

struct AltWriteOnly(T)
   {
  private T value;

  ref typeof(this) opCall(T val) { value = val; return this; }
  string toString() { return typeof(this).stringof; }
   }

   struct FunProp(T) if(isSomeFunction!T)
   {
  private T value;

  alias value this;
  void opAssign(T val) { value = val; }
  string toString() { return T.stringof; }
   }


   class Test
   {
   Prop!int someVal;
   ReadOnly!string name;
   WriteOnly!int someOtherVal;
   FunProp!(void delegate(int)) funProp;

   this()
   {
   name.value = "Test";
   }
   }

   void main()
   {
   auto test = new Test;
   test.someVal = 66;
   test.someVal++;
   test.someOtherVal = 100;
   test.funProp = (int i) => i + test.someVal;
   test.someVal.writeln;
   test.name.writeln;
   test.funProp(33).writeln;
   test.funProp.writeln;
   test.someOtherVal.writeln;
   }

haven't done extencive tests with them but they can be used as 
builing blocks, you can add other operator overloads to manage 
other access to the value.

you can build better properties without @property :/


Re: Building with dub fails on Ubuntu 16.10.

2016-12-05 Thread moe via Digitalmars-d-learn

On Monday, 5 December 2016 at 07:32:21 UTC, Daniel Kozak wrote:

On Saturday, 3 December 2016 at 16:07:47 UTC, moe wrote:
On Sunday, 11 September 2016 at 02:17:21 UTC, Vlasov Roman 
wrote:

Hello, guys.
I tried to build HelloWorld with dub, but i got strange 
linker error:


[...]



I just switched from Windows to linux (arch) and got the exact 
same problem. Did you resolve this yet? I'm not very 
experienced with development on linux any hint here would be 
welcome.


On arch linux there should not be any issue. Archlinux does not 
use fPIC by default so, this error seems like you have 
something wrong with your Archlinux installation.


Thanks for the tip. I haven't done a lot of development on linux 
so I messed quite a bit with my arch install. It's very well 
possible that I messed something up. I am planing to reinstall in 
a few weeks anyway :)


Having said that, from the arch wiki: 
https://wiki.archlinux.org/index.php/D_(programming_language)
Looks like there is a hardening-wrapper which forces PIC by 
default. As clang worked just fine I assumed that was the actual 
problem. I will look into it again once I reinstalled my system.


Re: How about a bounty for a new windows installer using inno setup ?

2016-12-05 Thread Jim Hewes via Digitalmars-d

On 12/5/2016 3:19 AM, Kjartan F. Kvamme wrote:

On Monday, 5 December 2016 at 09:24:59 UTC, Basile B. wrote:

How about a bounty for a new windows installer using inno setup ?

There are several issues related to the nsis-based windows installer
(even on bugzilla). The problem that happened last Fall with a virus
false detection may happen again. "Braddr" proposed to handle digital
signatures in case it would involve payment.

Programming an installer is a small job but it has a long term impact
on the user experience. Worth 100€ imo.


Any particular reason to use Inno Setup over for example Wix Toolset?



In my last job I worked on installers (which I didn't like but someone 
had to do it.) I recommend WiX over Inno. The main reason is that WiX 
produces an MSI and Inno doesn't. An MSI is just a data file, not an 
executable, and is thus better for security. I normally wrapped the MSI 
in a bootstrap exe. But we had one customer that was part of the 
government and wouldn't accept anything but an MSI.
If you want, you can generate the XML with a program. I just didn't 
because I figured it was easier to modify if you can directly see the 
XML. My install builder was actually a combination of C# and WiX. I 
never found scripts to be flexible enough and it's just one more 
language to know.


Jim



Re: CTFE Status

2016-12-05 Thread Stefan Koch via Digitalmars-d
On Monday, 5 December 2016 at 16:47:33 UTC, Andrei Alexandrescu 
wrote:

On 12/05/2016 11:28 AM, Stefan Koch wrote:
It looks like the performance wins brought by the new ctfe 
engine might

be higher then I predicted.


That's awesome!! -- Andrei


After discovering this performance bottleneck I have now changed 
my mind about how I will tackle concatenation of arrays and 
strings in particular.

All con-cat operations should be done as intrinsic calls.
Because tight cooperation with the 
CTFE-Memory-Management-Subsystem is needed.




Re: Should we warn if we detect null derefernces or void value uses ?

2016-12-05 Thread Jonathan M Davis via Digitalmars-d
On Monday, December 05, 2016 08:35:34 Andrei Alexandrescu via Digitalmars-d 
wrote:
> On 12/04/2016 11:41 PM, Stefan Koch wrote:
> > Hi Guys,
> > What is your opinion, should we warn if we unambiguously detect
> > something that is clearly unwanted ?
> >
> > int fn(int y)
> > {
> >
> >   int x = void;
> >   ++x;
> >   return x+y;
> >
> > }
>
> No new warnings please. If something (such as the above) is definitely
> wrong - the code is not memory unsafe but is definitely in error - then
> just issue an error. That should be done whether or not the function is
> used in CTFE. -- Andrei

+1

- Jonathan M Davis



Re: the best language I have ever met(?)

2016-12-05 Thread Igor Shirkalin via Digitalmars-d-learn

On Monday, 5 December 2016 at 17:27:21 UTC, Igor Shirkalin wrote:

On Monday, 5 December 2016 at 16:39:33 UTC, eugene wrote:
On Monday, 5 December 2016 at 16:07:41 UTC, Igor Shirkalin 
wrote:
I didnt count, but its about ten thousend a year, i.e. 
nothing.


if you earned nothing using D language why do you recommend 
it?)))

People usually earn money using programming langs.
some people have nothing about science. Some of them are god's 
addicted. I don't think D is here. We are out of here. We 
should go to facebook and keep here if you take it. that's it.


I think we have to stop.



Re: the best language I have ever met(?)

2016-12-05 Thread Igor Shirkalin via Digitalmars-d-learn

On Monday, 5 December 2016 at 16:39:33 UTC, eugene wrote:
On Monday, 5 December 2016 at 16:07:41 UTC, Igor Shirkalin 
wrote:

I didnt count, but its about ten thousend a year, i.e. nothing.


if you earned nothing using D language why do you recommend 
it?)))

People usually earn money using programming langs.
some people have nothing about science. Some of them are god's 
addicted. I don't think D is here. We are out of here. We should 
go to facebook and keep here if you take it. that's it.


[Semi-OT] I don't want to leave this language!

2016-12-05 Thread e-y-e via Digitalmars-d-learn
Currently I have been learning D for about a year and a half. 
This may seem like a short time, but this is the longest I have 
stuck with any language. I have only been learning for 4 years 
and I am currently in university studying first year of computer 
systems engineering.


My main problem is that now I am looking for industry placements, 
it is clear that in this field C and C++ are highly desired. I 
have used C++ prior to discovering D, but much of my learning 
curve has occured while using D, and I feel quite comfortable 
using it. Using D makes me look back at what a great language it 
is compared to C++ (I know it can also be compared to C but I 
haven't used C).


So I don't want to go back. It isn't as if I have a career in C++ 
(like I know some people here have) and use D (only) for pleasure 
so I have no real knowledge of how things I write in D compare to 
what I would do in C++ (and none whatsoever for C).


Does anyone have any advice for me? Obviously I'm going to have 
to make this leap and the organizations will have their own 
ecosystem but while I'm learning how can I replace some of the 
great things about D? Things like built-in unittests, sane static 
if, painless CTFE, ranges, or even just the DUB package 
manager/build tool.


Failing that, think of this as another one of those 'D is great!' 
posts ;). And whatever happens, I'll certainly try and convince 
my host company to use it...


Re: Andrei on the new D Foundation Scholarships

2016-12-05 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 12/05/2016 08:36 AM, Mike Parker wrote:

After a two-week hiatus, the latest post at the blog takes the form of
an interview with Andrei regarding the new scholarships he announced a
couple weeks back. He talks about how the program came into existence,
how it works, and some of what he hopes to see come out of it. The
relevant links, as always follow. Given the nature of this particular
post, I opted to post it to /r/d_language rather than /r/programming.

Blog:
https://dlang.org/blog/2016/12/05/the-d-language-foundations-scholarship-program/


Reddit:
https://www.reddit.com/r/d_language/comments/5glwes/the_d_language_foundations_scholarship_program/


Thanks for the great writeup, Mike! -- Andrei



Re: CTFE Status

2016-12-05 Thread Andrei Alexandrescu via Digitalmars-d

On 12/05/2016 11:28 AM, Stefan Koch wrote:

It looks like the performance wins brought by the new ctfe engine might
be higher then I predicted.


That's awesome!! -- Andrei


Re: How about a bounty for a new windows installer using inno setup ?

2016-12-05 Thread Basile B. via Digitalmars-d

On Monday, 5 December 2016 at 15:24:20 UTC, ketmar wrote:

On Monday, 5 December 2016 at 14:42:26 UTC, Basile B. wrote:

I have a little guy in my  town, he thinks he's a genius.


i'm not living there!


yes, i know ketmar.if you know me,dont bother.
https://www.youtube.com/watch?v=4XVQ5GScEoI=15=PLFp2qxgnM_2MmFfd_hoWor6CHS80i5-Yq


Re: the best language I have ever met(?)

2016-12-05 Thread eugene via Digitalmars-d-learn

On Monday, 5 December 2016 at 16:07:41 UTC, Igor Shirkalin wrote:

I didnt count, but its about ten thousend a year, i.e. nothing.


if you earned nothing using D language why do you recommend it?)))
People usually earn money using programming langs.



[Issue 16948] broken links in std.stdio due to inccorrect use of WEB macro

2016-12-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16948

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

   What|Removed |Added

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

--


[Issue 16948] broken links in std.stdio due to inccorrect use of WEB macro

2016-12-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16948

--- Comment #3 from github-bugzi...@puremagic.com ---
Commits pushed to stable at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/c8a123f4d0f2cc9b611545f5c3055cfcc31fcb05
fix issue 16948 - broken links in std.stdio due to inccorrect use of WEB macro

https://github.com/dlang/phobos/commit/68cf6e8d1e6d8a1b43bff65fcbaef324bd158497
Merge pull request #4931 from aG0aep6G/16948

fix issue 16948 - broken links in std.stdio due to inccorrect use of WEB macro

--


Re: CTFE Status

2016-12-05 Thread Stefan Koch via Digitalmars-d

On Monday, 5 December 2016 at 07:48:31 UTC, Stefan Koch wrote:


I found an easily fixable performance problem inside the 
byte-code generator.

Causing it to allocate 800K per discovery of a new type.
Reducing this will probably make IR generation 10 times faster 
in the average case.

Clearing 800K takes quite some time.


I just fixed this.
As predicted, the taken time to generate byte-code is now greatly 
reduced.

This has a really huge impact.
It looks like the performance wins brought by the new ctfe engine 
might be higher then I predicted.


Re: the best language I have ever met(?)

2016-12-05 Thread Igor Shirkalin via Digitalmars-d-learn

On Saturday, 3 December 2016 at 15:02:35 UTC, eugene wrote:
On Friday, 18 November 2016 at 17:54:52 UTC, Igor Shirkalin 
wrote:

That was preface.
Now I have server written in D for C++ pretty ancient client. 
Most things are three times shorter in size and clear (@clear? 
suffix). All programming paradigms were used.
I have the same text in russian, but who has bothered 
russian(s)?
The meaning of all of that is: powerfull attractive language 
with sufficient infrastructure with future. Just use it.


p.s. I'm excused for my primitive english.


how much money did you earn using D language?
I didnt count, but its about ten thousend a year, i.e. nothing. 
You earn ten times more of me. Ask me enything more.




[Issue 16950] New: [Downloads]

2016-12-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16950

  Issue ID: 16950
   Summary: [Downloads]
   Product: D
   Version: D2
  Hardware: All
   URL: http://dlang.org/
OS: All
Status: NEW
  Severity: enhancement
  Priority: P3
 Component: dlang.org
  Assignee: nob...@puremagic.com
  Reporter: steven_kladi...@yahoo.com

the beta download disappeared for 2072.1

--


Re: Derelict

2016-12-05 Thread D.Rex via Digitalmars-d

On Monday, 5 December 2016 at 15:00:23 UTC, D.Rex wrote:

On Monday, 5 December 2016 at 14:53:53 UTC, Mike Parker wrote:




On Monday, 5 December 2016 at 14:53:53 UTC, Mike Parker wrote:

Thanks for the help anyways, I shall look into this.  Are you 
the creator of Derelict?  If so do you have an e-mail or 
something similar I can contact you on regarding my project? it 
is heavily involved with D and OpenGL and I would be really 
interested in your opinion.


Actually, I think I may know the problem with the access denied 
bit, it's too late for me to test now but I will test tomorrow.  
My D source code and the GLFW3.dll library are stored on a Linux 
file server (I am using D in Eclipse on a Windows 10 machine), so 
perhaps there is some issue with the FileServer denying access to 
certain things, so I will investigate if moving the source and 
the dll to my local machine will remove this issue, I will post 
here the results.


Re: The order of libraries makes error in dub

2016-12-05 Thread unDEFER via Digitalmars-d-learn

On Monday, 5 December 2016 at 15:16:27 UTC, unDEFER wrote:
2) Its put to linker command at the first "libdb53d.lib 
WS2_32.lib" and AFTER that -m32mscoff. As result "cannot open 
file".


Oh, the reason was mistype. And I have found how-to hide linker 
warning ("lflags-windows": ["/NODEFAULTLIB:LIBCMTD"]).


Full correct dub.json:
===
{
"name": "bdb2d",
"targetName": "db",
"targetType": "library",
"description": "BerkeleyDB to D bindings.",
"authors": ["Nikolay (unDEFER) Krivchenkov"],
"homepage": "http://unde.su;,
"license": "GPL-3.0 or later",
"libs-posix": ["db"],
"libs-windows-dmd": ["libdb53sd", "WS2_32"],
"dflags-windows": ["-m32mscoff"],
"lflags-windows": ["/NODEFAULTLIB:LIBCMTD"],

"subPackages": [
{
"name": "reader",
"description": "BerkeleyDB Transaction test. Reader",
"targetName": "reader",
"targetType": "executable",
"sourceFiles": ["transactions_test/reader.d"],
"targetPath": "transactions_test",
"dependencies": {
"bdb2d": "*"
}
}, {
"name": "writer",
"description": "BerkeleyDB Transaction test. Writer",
"targetName": "writer",
"targetType": "executable",
"sourceFiles": ["transactions_test/writer.d"],
"targetPath": "transactions_test",
"dependencies": {
"bdb2d": "*"
}
}
]
}


Thank you to all, the thread is closed.


Re: How about a bounty for a new windows installer using inno setup ?

2016-12-05 Thread ketmar via Digitalmars-d

On Monday, 5 December 2016 at 14:42:26 UTC, Basile B. wrote:

I have a little guy in my  town, he thinks he's a genius.


i'm not living there!


Re: The order of libraries makes error in dub

2016-12-05 Thread unDEFER via Digitalmars-d-learn

On Monday, 5 December 2016 at 14:59:26 UTC, Mike Parker wrote:

"libs-windows-dmd":["libdb53d.lib","ws2_32.lib"]


I have used "sourceFiles-windows-dmd", because it is the single 
that I could find.
Thank you, "libs-windows-dmd":["libdb53d","WS2_32"] works much 
better, but again these errors:

1) Its put to linker command "db.lib" from libs-posix
2) Its put to linker command at the first "libdb53d.lib 
WS2_32.lib" and AFTER that -m32mscoff. As result "cannot open 
file".


Re: Derelict

2016-12-05 Thread D.Rex via Digitalmars-d

On Monday, 5 December 2016 at 14:53:53 UTC, Mike Parker wrote:

On Monday, 5 December 2016 at 14:40:46 UTC, D.Rex wrote:


OK, this has nothing to do with your code or with Derelict. 
When you get a SharedLibLoadException, the message it contains 
comes from the system. In this case, it's the bit that says 
'Access is denied'. I've never encountered that while loading 
libraries on Windows. It looks like something to do with file 
permissions, but I really have no idea. You'll need to consult 
Google to find out what it means to get that message in 
conjunction with LoadLibrary (which is what Derelict is using 
internally).


On Monday, 5 December 2016 at 14:53:53 UTC, Mike Parker wrote:

Thanks for the help anyways, I shall look into this.  Are you the 
creator of Derelict?  If so do you have an e-mail or something 
similar I can contact you on regarding my project? it is heavily 
involved with D and OpenGL and I would be really interested in 
your opinion.


Re: The order of libraries makes error in dub

2016-12-05 Thread rikki cattermole via Digitalmars-d-learn

On 06/12/2016 3:59 AM, Mike Parker wrote:

snip


Also, let's be clear here, the errors you saw above are linker errors,
not DUB errors. This one in particular is very common on Windows when
using the MS linker:

warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs;
use /NODEFAULTLIB:library

It's normally because you're linking in libs compiled against different
versions of the C standard library. Google should help you out there.


Or in unDEFERS case, Cygwin and dmc's (which is 100% against Cygwin's 
design).


Re: The order of libraries makes error in dub

2016-12-05 Thread Mike Parker via Digitalmars-d-learn

On Monday, 5 December 2016 at 14:29:42 UTC, unDEFER wrote:

On Monday, 5 December 2016 at 11:51:52 UTC, unDEFER wrote:


"libs-posix": ["db"],
"sourceFiles-windows-dmd": ["libdb53d.lib", "WS_32.LIB"],
"dflags-windows": ["-m32mscoff"],

"subPackages": [



I understand that I don't must add "sourceFiles-windows-dmd" to 
lib project, I must add it to subPackages, but dub places the 
names of lib BEFORE -m32mscoff. So it doesn't work.

Say me: dub for windows not ready??


DUB works on Windows just fine. My question is, why are you 
passing libraries in the sourceFiles field? Why not:


"libs-windows-dmd":["libdb53d.lib","ws2_32.lib"]

Does that make a difference?

Also, let's be clear here, the errors you saw above are linker 
errors, not DUB errors. This one in particular is very common on 
Windows when using the MS linker:


warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other 
libs; use /NODEFAULTLIB:library


It's normally because you're linking in libs compiled against 
different versions of the C standard library. Google should help 
you out there.


Re: Derelict

2016-12-05 Thread Mike Parker via Digitalmars-d

On Monday, 5 December 2016 at 14:40:46 UTC, D.Rex wrote:

I have done as you have said here, I have glfw3.dll into the 
same directory as the executable, and included the dependencies 
in the dub.json file, however when I run my intialization code, 
it gives me the following error:


derelict.util.exception.SharedLibLoadException@src\derelict-util\source\derelict\util\exception.d(35):
 Failed to load one or more shared libraries:
glfw3.dll - Access is denied.


OK, this has nothing to do with your code or with Derelict. When 
you get a SharedLibLoadException, the message it contains comes 
from the system. In this case, it's the bit that says 'Access is 
denied'. I've never encountered that while loading libraries on 
Windows. It looks like something to do with file permissions, but 
I really have no idea. You'll need to consult Google to find out 
what it means to get that message in conjunction with LoadLibrary 
(which is what Derelict is using internally).


Re: How about a bounty for a new windows installer using inno setup ?

2016-12-05 Thread Basile B. via Digitalmars-d

On Monday, 5 December 2016 at 11:39:37 UTC, Basile B. wrote:
On Monday, 5 December 2016 at 11:19:31 UTC, Kjartan F. Kvamme 
wrote:

On Monday, 5 December 2016 at 09:24:59 UTC, Basile B. wrote:
How about a bounty for a new windows installer using inno 
setup ?


There are several issues related to the nsis-based windows 
installer (even on bugzilla). The problem that happened last 
Fall with a virus false detection may happen again. "Braddr" 
proposed to handle digital signatures in case it would 
involve payment.


Programming an installer is a small job but it has a long 
term impact on the user experience. Worth 100€ imo.


Any particular reason to use Inno Setup over for example Wix 
Toolset?


D has `extern(Pascal)`, which means the the new setup program 
could be mostly coded in a D dll used by the innosetup script.


I have a little guy in my  town, he thinks he's a genius.
This job is for him. He'll start the hard way.


Re: Derelict

2016-12-05 Thread D.Rex via Digitalmars-d

On Monday, 5 December 2016 at 13:54:01 UTC, Mike Parker wrote:

On Monday, 5 December 2016 at 11:38:05 UTC, D.Rex wrote:

Hi,

I am sure this has been asked a thousand times before, but can 
anyone link me to a tutorial on how to set up derelict and 
GLFW3, I am trying to work on a project and I just can't get 
it set up regardless of how many times I read the derelict 
readme's.


See the Derelict documentation (linked from the README) on 
using Derelict with DUB-managed projects [1]. Summary:


Step 1: Make sure the GLFW 3 library is installed on your 
system. On Windows, that means you just put the glfw3.dll in 
the same directory in which your executable will reside. On 
Mac, it's easiest to install with Homebrew (should be 'brew 
install glfw' or 'brew install glfw3', can't recall which). On 
Linux, use your package manager. Get the dev version of the 
package if you want, but you don't need it with Derelict.


Step 2: Add 'derelict-glfw3' as a dependency to your dub.json 
or dub.sdl file (assuming you are using dub to manage your 
project. If not, see the Derelict documentation using Derelict 
packages with non-DUB projects [2]).


For dub.json:
"dependencies" : {
"derelict-glfw3": "~>3.1.1"
}

For dub.sdl:

dependency "derelict-glfw3" version="~>3.1.1"

Step 3: Import derelict.glfw3.glfw3 and somewhere in your code, 
preferably during startup, call DerelictGLFW3.load.


```
import derelict.glfw3.glfw3;
void main() { DerelictGLFW3.load(); }
```

[1] http://derelictorg.github.io/building/with-dub/
[2] http://derelictorg.github.io/building/without-dub/


I have done as you have said here, I have glfw3.dll into the same 
directory as the executable, and included the dependencies in the 
dub.json file, however when I run my intialization code, it gives 
me the following error:


derelict.util.exception.SharedLibLoadException@src\derelict-util\source\derelict\util\exception.d(35):
 Failed to load one or more shared libraries:
glfw3.dll - Access is denied.

0x004166B3 in void 
derelict.util.exception.SharedLibLoadException.throwNew(immutable(char)[][], immutable(char)[][]) at L:\dev\D\DEngine\src\derelict-util\source\derelict\util\exception.d(67)
0x0041BA52 in void 
derelict.util.sharedlib.SharedLib.load(immutable(char)[][]) at 
L:\dev\D\DEngine\src\derelict-util\source\derelict\util\sharedlib.d(144)
0x00416A78 in void 
derelict.util.loader.SharedLibLoader.load(immutable(char)[][]) at 
L:\dev\D\DEngine\src\derelict-util\source\derelict\util\loader.d(197)
0x004169C2 in void 
derelict.util.loader.SharedLibLoader.load(immutable(char)[]) at 
L:\dev\D\DEngine\src\derelict-util\source\derelict\util\loader.d(143)
0x004168B1 in void derelict.util.loader.SharedLibLoader.load() at 
L:\dev\D\DEngine\src\derelict-util\source\derelict\util\loader.d(83)

0x00402028 in _Dmain at L:\dev\D\DEngine\src\app.d(13)
0x0041C263 in 
D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv
0x0041C227 in void rt.dmain2._d_run_main(int, char**, extern (C) 
int function(char[][])*).runAll()

0x0041C128 in _d_run_main
0x00403BA0 in main at L:\dev\D\DEngine\src\app.d(7)
0x00436AF5 in mainCRTStartup
0x73EF62C4 in BaseThreadInitThunk
0x77480719 in RtlSubscribeWnfStateChangeNotification
0x774806E4 in RtlSubscribeWnfStateChangeNotification

The code I have that runs derelictGLFW3.load() etc is as follows:

import derelict.opengl3.gl3;
import derelict.glfw3.glfw3;

int main()
{
DerelictGL3.load();
DerelictGLFW3.load();

GLFWwindow* window;

if(!glfwInit())
{
return -1;
}

	window = glfwCreateWindow(1280,720, "D OpenGL Engine", null, 
null);

if(!window)
{
glfwTerminate();
return -1;
}

/* make window' context current */
glfwMakeContextCurrent(window);
DerelictGL3.reload();

while(!glfwWindowShouldClose(window))
{
glfwSwapBuffers(window);
glfwPollEvents();
}

glfwTerminate();
return 0;
}


Re: The order of libraries makes error in dub

2016-12-05 Thread unDEFER via Digitalmars-d-learn

On Monday, 5 December 2016 at 11:51:52 UTC, unDEFER wrote:


"libs-posix": ["db"],
"sourceFiles-windows-dmd": ["libdb53d.lib", "WS_32.LIB"],
"dflags-windows": ["-m32mscoff"],

"subPackages": [



I understand that I don't must add "sourceFiles-windows-dmd" to 
lib project, I must add it to subPackages, but dub places the 
names of lib BEFORE -m32mscoff. So it doesn't work.

Say me: dub for windows not ready??




Re: CTFE Status

2016-12-05 Thread Stefan Koch via Digitalmars-d

On Monday, 5 December 2016 at 04:26:35 UTC, Stefan Koch wrote:

I just improved the handling of void initializations.
Now the code is less pessimistic and will allow them if they 
are assigned to before use.
However using void variables at ctfe will not result in any 
performance wins.


Oh it's broken.
It does not detect the ... maybe not void case.

I found out why certain switches are broken.
Essentially this is fixable by putting a guarding jump around the 
braces that holds the cases.
Which is also the reason why code in a switch that does not 
belong to any case is unreachable code :)





Re: CTFE Status

2016-12-05 Thread Stefan Koch via Digitalmars-d

On Monday, 5 December 2016 at 07:55:32 UTC, deadalnix wrote:

On Monday, 5 December 2016 at 04:26:35 UTC, Stefan Koch wrote:

I just improved the handling of void initializations.
Now the code is less pessimistic and will allow them if they 
are assigned to before use.
However using void variables at ctfe will not result in any 
performance wins.


Void initialization are allowed at CTFE ?


the following code will compile just fine.
uint fn(uint a) {
 int b = void;
 if (a == 2)
 {
   b = 1;
 }

 return b; // only fine is a was 2;
}

static assert(fn(2) == 1);



Re: Derelict

2016-12-05 Thread Mike Parker via Digitalmars-d

On Monday, 5 December 2016 at 11:38:05 UTC, D.Rex wrote:

Hi,

I am sure this has been asked a thousand times before, but can 
anyone link me to a tutorial on how to set up derelict and 
GLFW3, I am trying to work on a project and I just can't get it 
set up regardless of how many times I read the derelict 
readme's.


See the Derelict documentation (linked from the README) on using 
Derelict with DUB-managed projects [1]. Summary:


Step 1: Make sure the GLFW 3 library is installed on your system. 
On Windows, that means you just put the glfw3.dll in the same 
directory in which your executable will reside. On Mac, it's 
easiest to install with Homebrew (should be 'brew install glfw' 
or 'brew install glfw3', can't recall which). On Linux, use your 
package manager. Get the dev version of the package if you want, 
but you don't need it with Derelict.


Step 2: Add 'derelict-glfw3' as a dependency to your dub.json or 
dub.sdl file (assuming you are using dub to manage your project. 
If not, see the Derelict documentation using Derelict packages 
with non-DUB projects [2]).


For dub.json:
"dependencies" : {
"derelict-glfw3": "~>3.1.1"
}

For dub.sdl:

dependency "derelict-glfw3" version="~>3.1.1"

Step 3: Import derelict.glfw3.glfw3 and somewhere in your code, 
preferably during startup, call DerelictGLFW3.load.


```
import derelict.glfw3.glfw3;
void main() { DerelictGLFW3.load(); }
```

[1] http://derelictorg.github.io/building/with-dub/
[2] http://derelictorg.github.io/building/without-dub/





Andrei on the new D Foundation Scholarships

2016-12-05 Thread Mike Parker via Digitalmars-d-announce
After a two-week hiatus, the latest post at the blog takes the 
form of an interview with Andrei regarding the new scholarships 
he announced a couple weeks back. He talks about how the program 
came into existence, how it works, and some of what he hopes to 
see come out of it. The relevant links, as always follow. Given 
the nature of this particular post, I opted to post it to 
/r/d_language rather than /r/programming.


Blog: 
https://dlang.org/blog/2016/12/05/the-d-language-foundations-scholarship-program/


Reddit: 
https://www.reddit.com/r/d_language/comments/5glwes/the_d_language_foundations_scholarship_program/


Re: Should we warn if we detect null derefernces or void value uses ?

2016-12-05 Thread Andrei Alexandrescu via Digitalmars-d

On 12/04/2016 11:41 PM, Stefan Koch wrote:

Hi Guys,
What is your opinion, should we warn if we unambiguously detect
something that is clearly unwanted ?

int fn(int y)
{
  int x = void;
  ++x;
  return x+y;
}


No new warnings please. If something (such as the above) is definitely 
wrong - the code is not memory unsafe but is definitely in error - then 
just issue an error. That should be done whether or not the function is 
used in CTFE. -- Andrei


Re: Inline aggregate types

2016-12-05 Thread Jacob Carlborg via Digitalmars-d

On 2016-12-05 13:32, Ethan Watson wrote:


I also want to support statically sized
bit arrays, Phobos only provides support for dynamically sized.


That would be nice, I had a need for that.

--
/Jacob Carlborg


D Flowgraph GUI Interface

2016-12-05 Thread D.Rex via Digitalmars-d

Howdy,

I am embarking on a project to create a Flowgraph (node based) 
GUI interface, much like Blender's Node Editor or Unreal ENgine 
4's Blueprint System, for other future projects, I have been 
looking around for many months now on tutorials but I can never 
quite find anything.  I was wondering if anyone could point me to 
a good starting point/tutorial for such an interface.


one of the projects I am endeavoring to work on is a visual 
node-based scripting system for Windows Command Prompt and Linux 
Shell script editing.


I have tried a few things in a few different languages (like 
java) but I really like D as a language, and want this interface 
to be written in it.


Cheers!


Re: Inline aggregate types

2016-12-05 Thread Ethan Watson via Digitalmars-d
On Monday, 5 December 2016 at 11:57:18 UTC, Guillaume Chatelet 
wrote:
Do you plan on contributing this back to phobos? I also came 
across this exact same problem.


It'll want to go through a few polish iterations before I even 
think of doing that; and it'll need support for things like 
toString/toHash/etc.


Another critical bit of functionality that std.bitmanip provides 
that I currently don't is a bit array. I also want to support 
statically sized bit arrays, Phobos only provides support for 
dynamically sized.


[Issue 16948] broken links in std.stdio due to inccorrect use of WEB macro

2016-12-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16948

--- Comment #2 from LucienPe  ---
Thanks for the fix.

--


Re: Inline aggregate types

2016-12-05 Thread Guillaume Chatelet via Digitalmars-d

On Friday, 2 December 2016 at 11:11:30 UTC, Ethan Watson wrote:
On Friday, 2 December 2016 at 10:16:17 UTC, Jacob Carlborg 
wrote:

[...]


I was attempting to support all methods. new class isn't the 
cleanest way of doing things either, so I decided I'd support 
all the things and let the user choose what they're comfortable 
with.


[...]


Do you plan on contributing this back to phobos? I also came 
across this exact same problem.


The order of libraries makes error in dub

2016-12-05 Thread unDEFER via Digitalmars-d-learn
Hello, dub makes string like the next to compile my program 
(WS_32.LIB at the beginning):


$ dmd -m32mscoff -lib 
-of.dub\\build\\library-debug-windows-x86-dmd_2072-83D2723917096513EB360761C22DDD87\\db.lib -debug -g -w -version=Have_bdb2d WS_32.LIB libdb53d.lib source/berkeleydb/* -vcolumns

Error: Error reading file 'WS_32.LIB'

So it shows error.

In other order (libraries at the end):
$ dmd -m32mscoff -lib 
-of.dub\\build\\library-debug-windows-x86-dmd_2072-83D2723917096513EB360761C22DDD87\\db.lib -debug -g -w -version=Have_bdb2d -Isource source/berkeleydb/* libdb53sd.lib WS2_32.LIB -vcolumns


No error.

But (again WS_32.LIB at beginning):
$ dmd -m32mscoff WS2_32.LIB libdb53sd.lib 
transactions_test/writer source/berkeleydb/*
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use 
of other libs; use /NODEFAULTLIB:library


Again no error, only warning.

How to make with dub correct compilable compile line?

my dub.json:
===
{
"name": "bdb2d",
"targetName": "db",
"targetType": "library",
"description": "BerkeleyDB to D bindings.",
"authors": ["Nikolay (unDEFER) Krivchenkov"],
"homepage": "http://unde.su;,
"license": "GPL-3.0 or later",
"libs-posix": ["db"],
"sourceFiles-windows-dmd": ["libdb53d.lib", "WS_32.LIB"],
"dflags-windows": ["-m32mscoff"],

"subPackages": [
{
"name": "reader",
"description": "BerkeleyDB Transaction test. Reader",
"targetName": "reader",
"targetType": "executable",
"sourceFiles": ["transactions_test/reader.d"],
"targetPath": "transactions_test",
"dependencies": {
"bdb2d": "*"
}
}, {
"name": "writer",
"description": "BerkeleyDB Transaction test. Writer",
"targetName": "writer",
"targetType": "executable",
"sourceFiles": ["transactions_test/writer.d"],
"targetPath": "transactions_test",
"dependencies": {
"bdb2d": "*"
}
}
]
}
==


Re: How about a bounty for a new windows installer using inno setup ?

2016-12-05 Thread Basile B. via Digitalmars-d
On Monday, 5 December 2016 at 11:19:31 UTC, Kjartan F. Kvamme 
wrote:

On Monday, 5 December 2016 at 09:24:59 UTC, Basile B. wrote:
How about a bounty for a new windows installer using inno 
setup ?


There are several issues related to the nsis-based windows 
installer (even on bugzilla). The problem that happened last 
Fall with a virus false detection may happen again. "Braddr" 
proposed to handle digital signatures in case it would involve 
payment.


Programming an installer is a small job but it has a long term 
impact on the user experience. Worth 100€ imo.


Any particular reason to use Inno Setup over for example Wix 
Toolset?


D has `extern(Pascal)`, which means the the new setup program 
could be mostly coded in a D dll used by the innosetup script.


Derelict

2016-12-05 Thread D.Rex via Digitalmars-d

Hi,

I am sure this has been asked a thousand times before, but can 
anyone link me to a tutorial on how to set up derelict and GLFW3, 
I am trying to work on a project and I just can't get it set up 
regardless of how many times I read the derelict readme's.


Also, if anyone knows of any good tutorials or ways of creating a 
flow-graph editor similar to blender's flow-graph editor 
interface I would greatly appreciate a link or some assistance, I 
have a rather large project I am working on which I would love to 
do in D and requires a flow-graph GUI much like blender's.


Cheers!


Re: How about a bounty for a new windows installer using inno setup ?

2016-12-05 Thread Kjartan F. Kvamme via Digitalmars-d

On Monday, 5 December 2016 at 09:24:59 UTC, Basile B. wrote:
How about a bounty for a new windows installer using inno setup 
?


There are several issues related to the nsis-based windows 
installer (even on bugzilla). The problem that happened last 
Fall with a virus false detection may happen again. "Braddr" 
proposed to handle digital signatures in case it would involve 
payment.


Programming an installer is a small job but it has a long term 
impact on the user experience. Worth 100€ imo.


Any particular reason to use Inno Setup over for example Wix 
Toolset?


Re: How about a bounty for a new windows installer using inno setup ?

2016-12-05 Thread Basile B. via Digitalmars-d

On Monday, 5 December 2016 at 09:24:59 UTC, Basile B. wrote:
How about a bounty for a new windows installer using inno setup 
?


There are several issues related to the nsis-based windows 
installer (even on bugzilla). The problem that happened last 
Fall with a virus false detection may happen again. "Braddr" 
proposed to handle digital signatures in case it would involve 
payment.


Programming an installer is a small job but it has a long term 
impact on the user experience. Worth 100€ imo.


https://issues.dlang.org/show_bug.cgi?id=16405
https://issues.dlang.org/show_bug.cgi?id=15375
https://issues.dlang.org/show_bug.cgi?id=14847
https://issues.dlang.org/show_bug.cgi?id=14849
https://forum.dlang.org/post/akxxnjatohebpmhbe...@forum.dlang.org


Re: Should we warn if we detect null derefernces or void value uses ?

2016-12-05 Thread Jonathan M Davis via Digitalmars-d
On Monday, December 05, 2016 05:03:36 Stefan Koch via Digitalmars-d wrote:
> On Monday, 5 December 2016 at 04:59:01 UTC, ketmar wrote:
> > On Monday, 5 December 2016 at 04:41:55 UTC, Stefan Koch wrote:
> >> Hi Guys,
> >> What is your opinion, should we warn if we unambiguously
> >> detect something that is clearly unwanted ?
> >>
> >> int fn(int y)
> >> {
> >>
> >>   int x = void;
> >>   ++x;
> >>   return x+y;
> >>
> >> }
> >>
> >>  This requires data-flow analysis (The same kind that tells
> >>
> >> you if you are skipping a statement)
> >> And will slow down compilation a little if we enable such a
> >> warning.
> >
> > no need to. if i explicitly wrote `=void` there, i know what i
> > am doing. maybe i want that UB. or something. and i tried to
> > tell the compiler STFU. please, don't make it harder, and don't
> > force me to invent another ways to say STFU.
>
> Even if you want that ub.
> A warning will not halt the compilation.

It will with -w. And even if you build with -wi, it's bad practice to leave
warnings in. So, really, we should _never_ warn about anything where it
would be reasonable for the programmer to not fix whatever is causing the
warning.

That being said, if we're dealing with something that is clearly never okay,
a warning is fine. And I don't know how anyone can claim that doing
something like ++x on a variable that was initialized with null or void is
rasonable. But if such a warning were introduced, it would have to be done
carefully and only used when it was totally certain that what the programmer
was doing was invalid. For instance, taking the address of the variable or
passing it to a function would potentially be perfectly fine, whereas
calling a member function on it when nothing could have possibly given it a
value wouldn't be.

Java sometimes gets annoying with how it requires that you initialize a
variable before you use it, because its detection simply isn't smart enough,
and we don't want to get into a similar boat with D. So, if such detection
really _is_ smart enough, then fine, but it should never have false
positives, or it's making things worse than they are now.

- Jonathan M Davis



Re: CTFE Status

2016-12-05 Thread Dominikus Dittes Scherkl via Digitalmars-d

On Monday, 5 December 2016 at 08:07:11 UTC, ketmar wrote:

On Monday, 5 December 2016 at 07:55:32 UTC, deadalnix wrote:

On Monday, 5 December 2016 at 04:26:35 UTC, Stefan Koch wrote:

I just improved the handling of void initializations.
Now the code is less pessimistic and will allow them if they 
are assigned to before use.
However using void variables at ctfe will not result in any 
performance wins.


Void initialization are allowed at CTFE ?


not now, but it looks like needless limitation. any void 
initialization can be converted to "fill the things with 
zeroes" in CTFE engine.


On the contrary. If something is NOT initialized, it uses its 
default (e.g. zeroes), but if it is =void it should be an error 
to use it before any assignment.




How about a bounty for a new windows installer using inno setup ?

2016-12-05 Thread Basile B. via Digitalmars-d

How about a bounty for a new windows installer using inno setup ?

There are several issues related to the nsis-based windows 
installer (even on bugzilla). The problem that happened last Fall 
with a virus false detection may happen again. "Braddr" proposed 
to handle digital signatures in case it would involve payment.


Programming an installer is a small job but it has a long term 
impact on the user experience. Worth 100€ imo.


Re: How to use library compiled with Microsoft Visual Studio 2015 in D?

2016-12-05 Thread unDEFER via Digitalmars-d-learn
OK, I have found. It must be library WS2_32.LIB from Microsoft 
SDK. But dumpbin doesn't show __imp__htonl@4 symbol there. The 
magic!

Thank you!


Re: Should we warn if we detect null derefernces or void value uses ?

2016-12-05 Thread ketmar via Digitalmars-d

On Monday, 5 December 2016 at 05:03:36 UTC, Stefan Koch wrote:

A warning will not halt the compilation.


it will: all my projects are built in "-Werror" mode (the only 
warning i made explicitly switchable in dmd is "statement 
unreachable" -- it is completely useless for me).


i'd prefer to have `pragma(warning/info, msg);` instead, so i can 
issue informational messages when i want to.


Re: CTFE Status

2016-12-05 Thread ketmar via Digitalmars-d

On Monday, 5 December 2016 at 07:55:32 UTC, deadalnix wrote:

On Monday, 5 December 2016 at 04:26:35 UTC, Stefan Koch wrote:

I just improved the handling of void initializations.
Now the code is less pessimistic and will allow them if they 
are assigned to before use.
However using void variables at ctfe will not result in any 
performance wins.


Void initialization are allowed at CTFE ?


not now, but it looks like needless limitation. any void 
initialization can be converted to "fill the things with zeroes" 
in CTFE engine.


Re: How to use library compiled with Microsoft Visual Studio 2015 in D?

2016-12-05 Thread unDEFER via Digitalmars-d-learn

On Monday, 5 December 2016 at 07:21:30 UTC, Jacob Carlborg wrote:
If you compile your D code with the "-m32mscoff" flag it will 
produce COFF objects and use the Visual Studio tool chain 
(linker and runtime). Compiling for 64bit (-m64) will always 
produce COFF objects.


Big thanks! -m32mscoff is great!
But now I have the problem of unresolved external symbols, e.g. 
"__imp__htonl@4".
What I'm doing? I'm going to Microsoft Visual Studio directory 
and run the script:
$ for i in `/bin/find.exe . -iname "*.lib"`; do bin/dumpbin 
/SYMBOLS $i | /bin/grep __imp__htonl@4 && echo $i; done

308  UNDEF  notype   External | __imp__htonl@4
./atlmfc/lib/nafxcw.lib
3C6  UNDEF  notype   External | __imp__htonl@4
./atlmfc/lib/nafxcwd.lib
332  UNDEF  notype   External | __imp__htonl@4
./atlmfc/lib/uafxcw.lib
3D6  UNDEF  notype   External | __imp__htonl@4
./atlmfc/lib/uafxcwd.lib

Try to link with found libraries, but it doesn't work. The 
symbols still unresolved.

What I'm doing wrong?


Re: CTFE Status

2016-12-05 Thread deadalnix via Digitalmars-d

On Monday, 5 December 2016 at 04:26:35 UTC, Stefan Koch wrote:

I just improved the handling of void initializations.
Now the code is less pessimistic and will allow them if they 
are assigned to before use.
However using void variables at ctfe will not result in any 
performance wins.


Void initialization are allowed at CTFE ?