Re: Setting up Vim

2017-02-26 Thread Anton Pastukhov via Digitalmars-d
On Monday, 27 February 2017 at 02:06:29 UTC, helxi wrote: Any vim users here? I've been trying to set up Vim to get started with D. I was going to install Dutyl plugin but DCD is not working. Hi, setting up (Neo)Vim for D might be tricky. Here is my config for neovim: https://gist.github.com

Re: Of the use of unpredictableSeed

2017-02-26 Thread cym13 via Digitalmars-d
On Monday, 27 February 2017 at 04:51:37 UTC, Nick Sabalausky (Abscissa) wrote: On 02/26/2017 01:23 PM, cym13 wrote: [1]: https://cym13.github.io/article/unpredictableSeed.html Good enlightening article. And Veles looks cool, never heard of it before. One detail: auto copyState(uint origin

Re: Of the use of unpredictableSeed

2017-02-26 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 02/26/2017 01:23 PM, cym13 wrote: [1]: https://cym13.github.io/article/unpredictableSeed.html Good enlightening article. And Veles looks cool, never heard of it before. One detail: auto copyState(uint origin) { for (uint i=1; i>0; i++) { if (origin == Random(i).front)

Setting up Vim

2017-02-26 Thread helxi via Digitalmars-d
Any vim users here? I've been trying to set up Vim to get started with D. I was going to install Dutyl plugin but DCD is not working. Neovim's deoplete-d doesn't seem to work either. I'm not sure about how to set up importpath. Can anyone share .vimrc? Also, if anyone gave me a step by step i

Re: Of the use of unpredictableSeed

2017-02-26 Thread Nick Sabalausky via Digitalmars-d
On Monday, 27 February 2017 at 00:10:31 UTC, cym13 wrote: The only thing that saves you here is that your DefaultCryptoRand isn't seedable. Note that I'm not saying that to bash you or anything, it just happens to show well why I think my article was necessary. Oh, don't get me wrong, I'm v

Re: Code size without documentation comments and unittests

2017-02-26 Thread Andrei Alexandrescu via Digitalmars-d
On 2/26/17 7:59 PM, Andrei Alexandrescu wrote: On 2/26/17 4:53 PM, hmm wrote: On Sunday, 26 February 2017 at 21:25:52 UTC, Andrei Alexandrescu wrote: On 02/26/2017 01:37 AM, Seb wrote: That been said DUB is a build tool and it's good to be in verbose in case of errors and there's `-q` which yo

Re: Code size without documentation comments and unittests

2017-02-26 Thread Andrei Alexandrescu via Digitalmars-d
On 2/26/17 4:53 PM, hmm wrote: On Sunday, 26 February 2017 at 21:25:52 UTC, Andrei Alexandrescu wrote: On 02/26/2017 01:37 AM, Seb wrote: That been said DUB is a build tool and it's good to be in verbose in case of errors and there's `-q` which you can use as expected, e.g: dub run dscanner -

Re: Of the use of unpredictableSeed

2017-02-26 Thread cym13 via Digitalmars-d
On Sunday, 26 February 2017 at 22:56:14 UTC, Nick Sabalausky (Abscissa) wrote: On 02/26/2017 01:23 PM, cym13 wrote: Hi, I found many times that people use unpredictableSeed in combination with normal PRNG for cryptographic purpose. Some even go as far as reseeding at each call to try making

Re: assert with format considered harmful

2017-02-26 Thread Jonathan M Davis via Digitalmars-d
On Sunday, February 26, 2017 11:13:47 Nick Sabalausky via Digitalmars-d wrote: > Yea. Six years ago, assertPred was written for Phobos and rejected > because it was decided it was better for assert to just gain that > functionality built-in...which a full six years later, never happened. > Lettin

Re: Of the use of unpredictableSeed

2017-02-26 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 02/26/2017 01:23 PM, cym13 wrote: Hi, I found many times that people use unpredictableSeed in combination with normal PRNG for cryptographic purpose. Some even go as far as reseeding at each call to try making it more secure. It is a dangerous practice, most PRNG are not designed with securi

Re: Of the use of unpredictableSeed

2017-02-26 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
Speaking of, another good source of more "how to not mess up security" info is here: https://crackstation.net/hashing-security.htm DAuth/InstaUser is based on the points in there.

Re: Code size without documentation comments and unittests

2017-02-26 Thread hmm via Digitalmars-d
On Sunday, 26 February 2017 at 21:25:52 UTC, Andrei Alexandrescu wrote: On 02/26/2017 01:37 AM, Seb wrote: That been said DUB is a build tool and it's good to be in verbose in case of errors and there's `-q` which you can use as expected, e.g: dub run dscanner -q -- --sloc . Cool, that doe

Re: Voting for std.experimental.checkedint

2017-02-26 Thread Walter Bright via Digitalmars-d
On 2/26/2017 1:15 PM, Andrei Alexandrescu wrote: Indeed, the routines in core.checkedint are everything needed (in addition to some inline code for comparisons) if the purpose is to check operations individually. The purpose of core.checkedint is to provide the smallest possible building block

Re: Code size without documentation comments and unittests

2017-02-26 Thread Guest via Digitalmars-d
On Saturday, 25 February 2017 at 19:55:04 UTC, Timothee Cour wrote: Try dscanner --sloc although IMO --tokenCount should be the most relevant metric (only caveat is mixin strings with which one could cheat to make token count smaller). TokenCount formatting invariant On Feb 25, 2017 11:36 AM,

Re: Code size without documentation comments and unittests

2017-02-26 Thread Andrei Alexandrescu via Digitalmars-d
On 02/26/2017 01:37 AM, Seb wrote: That been said DUB is a build tool and it's good to be in verbose in case of errors and there's `-q` which you can use as expected, e.g: dub run dscanner -q -- --sloc . Cool, that does it for me. Thanks! -- Andrei

Re: Code size without documentation comments and unittests

2017-02-26 Thread Andrei Alexandrescu via Digitalmars-d
On 02/26/2017 02:31 AM, Jack Stouffer wrote: On Saturday, 25 February 2017 at 19:31:06 UTC, Andrei Alexandrescu wrote: What would be a simple way to count the "effective" lines in a module, i.e. excluding ddoc comments and unittests? Having a tool for that in tools/ would be neat. -- Andrei Fu

Re: Voting for std.experimental.checkedint

2017-02-26 Thread Andrei Alexandrescu via Digitalmars-d
On 2/26/17 4:53 AM, Seb wrote: On Sunday, 26 February 2017 at 09:41:46 UTC, rumbu wrote: On Saturday, 25 February 2017 at 15:21:10 UTC, Andrei Alexandrescu wrote: On 02/25/2017 10:17 AM, rumbu wrote: A lot of bloat code for something extremely basic. If you can do it with less code, I'm all

Re: Of the use of unpredictableSeed

2017-02-26 Thread ketmar via Digitalmars-d
cym13 wrote: "like /dev/random on Linux" (sighs) it was so good until this... That's a typo actually, I meant urandom, I'll correct it. thank you. sorry for me being rough: i was trying to make a joke, and i was pretty sure that it was a typo. but now i reread my post and found that the jok

Re: Of the use of unpredictableSeed

2017-02-26 Thread cym13 via Digitalmars-d
On Sunday, 26 February 2017 at 18:33:08 UTC, ketmar wrote: cym13 wrote: Hi, I found many times that people use unpredictableSeed in combination with normal PRNG for cryptographic purpose. Some even go as far as reseeding at each call to try making it more secure. It is a dangerous practic

Re: Of the use of unpredictableSeed

2017-02-26 Thread ketmar via Digitalmars-d
cym13 wrote: Hi, I found many times that people use unpredictableSeed in combination with normal PRNG for cryptographic purpose. Some even go as far as reseeding at each call to try making it more secure. It is a dangerous practice, most PRNG are not designed with security (and unpredictab

Of the use of unpredictableSeed

2017-02-26 Thread cym13 via Digitalmars-d
Hi, I found many times that people use unpredictableSeed in combination with normal PRNG for cryptographic purpose. Some even go as far as reseeding at each call to try making it more secure. It is a dangerous practice, most PRNG are not designed with security (and unpredictability) in mind,

Re: assert with format considered harmful

2017-02-26 Thread Seb via Digitalmars-d
On Sunday, 26 February 2017 at 16:13:47 UTC, Nick Sabalausky (Abscissa) wrote: On 02/26/2017 02:17 AM, Seb wrote: [...] Yea. Six years ago, assertPred was written for Phobos and rejected because it was decided it was better for assert to just gain that functionality built-in...which a full s

Re: assert with format considered harmful

2017-02-26 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 02/26/2017 02:17 AM, Seb wrote: On Sunday, 26 February 2017 at 06:34:07 UTC, Ali Çehreli wrote: So, obviously, assert message generation is not lazy. This is a WAT! for me but perhaps there is a good reason for it. FWIW imho we shouldn't need to write such messages at all. It shouldn't be t

Notes for DLang maintainers

2017-02-26 Thread Seb via Digitalmars-d
As it's getting a bit exhaustive to repeat these bits on GitHub over and over again, I though I summarize a couple of notes that hopefully are interesting for the DLang maintainers. Please take this as a friendly summary and personal advice of most GH-related process improvements that have hap

Re: Code size without documentation comments and unittests

2017-02-26 Thread Jacob Carlborg via Digitalmars-d
On 2017-02-26 06:50, Andrei Alexandrescu wrote: On 2/25/17 2:55 PM, Timothee Cour via Digitalmars-d wrote: Try dscanner --sloc although IMO --tokenCount should be the most relevant metric (only caveat is mixin strings with which one could cheat to make token count smaller). Thanks, got that wo

Re: Property access to a struct that contains struct

2017-02-26 Thread Guenter via Digitalmars-d
On Sunday, 26 February 2017 at 11:18:12 UTC, Mike Parker wrote: On Sunday, 26 February 2017 at 11:05:42 UTC, Guenter wrote: Hi, i do not understand where I am wrong in this code. I seems there is a missing constructor, but i have no idea where. @property A_t ext() { return fext; } Str

Re: Property access to a struct that contains struct

2017-02-26 Thread Guenter via Digitalmars-d
On Sunday, 26 February 2017 at 11:15:21 UTC, Eugene Wissner wrote: you return a copy of A_t and then change this copy instead of the real B_t member. Thank you. Guenter

Re: If you needed any more evidence that memory safety is the future...

2017-02-26 Thread Johannes Pfau via Digitalmars-d
Am Sat, 25 Feb 2017 21:19:59 + schrieb Stefan Koch : > On Saturday, 25 February 2017 at 21:12:13 UTC, Timon Gehr wrote: > > > > > I know my claim seems insane, but it is actually true. > > > > http://forum.dlang.org/post/lr4kek$2rd$1...@digitalmars.com > > The optimizer can currently not t

Re: Property access to a struct that contains struct

2017-02-26 Thread Mike Parker via Digitalmars-d
On Sunday, 26 February 2017 at 11:05:42 UTC, Guenter wrote: Hi, i do not understand where I am wrong in this code. I seems there is a missing constructor, but i have no idea where. @property A_t ext() { return fext; } Structs in D are value types, so you're returning a copy of fext he

Re: Property access to a struct that contains struct

2017-02-26 Thread Eugene Wissner via Digitalmars-d
On Sunday, 26 February 2017 at 11:05:42 UTC, Guenter wrote: Hi, i do not understand where I am wrong in this code. I seems there is a missing constructor, but i have no idea where. module main; import std.stdio; struct A_t { int fvalue; A_t opCall() { return this; }; @pr

Property access to a struct that contains struct

2017-02-26 Thread Guenter via Digitalmars-d
Hi, i do not understand where I am wrong in this code. I seems there is a missing constructor, but i have no idea where. module main; import std.stdio; struct A_t { int fvalue; A_t opCall() { return this; }; @property int value () { return fvalue; } @property void val

Re: Voting for std.experimental.checkedint

2017-02-26 Thread Seb via Digitalmars-d
On Sunday, 26 February 2017 at 10:34:07 UTC, Patrick Schluter wrote: On Sunday, 26 February 2017 at 09:53:42 UTC, Seb wrote: On Sunday, 26 February 2017 at 09:41:46 UTC, rumbu wrote: [...] If you want a module with a lot less features, the low-level core.checkedint might be interesting for y

Re: Voting for std.experimental.checkedint

2017-02-26 Thread Patrick Schluter via Digitalmars-d
On Sunday, 26 February 2017 at 09:53:42 UTC, Seb wrote: On Sunday, 26 February 2017 at 09:41:46 UTC, rumbu wrote: [...] If you want a module with a lot less features, the low-level core.checkedint might be interesting for you: http://dlang.org/phobos/core_checkedint.html [...] It is no

Re: Voting for std.experimental.checkedint

2017-02-26 Thread Seb via Digitalmars-d
On Sunday, 26 February 2017 at 09:41:46 UTC, rumbu wrote: On Saturday, 25 February 2017 at 15:21:10 UTC, Andrei Alexandrescu wrote: On 02/25/2017 10:17 AM, rumbu wrote: A lot of bloat code for something extremely basic. If you can do it with less code, I'm all ears. Thanks! -- Andrei This

Re: Voting for std.experimental.checkedint

2017-02-26 Thread rumbu via Digitalmars-d
On Saturday, 25 February 2017 at 15:21:10 UTC, Andrei Alexandrescu wrote: On 02/25/2017 10:17 AM, rumbu wrote: A lot of bloat code for something extremely basic. If you can do it with less code, I'm all ears. Thanks! -- Andrei This was not about coding skills, was about usability. The module

Re: assert with format considered harmful

2017-02-26 Thread ketmar via Digitalmars-d
Seb wrote: On Sunday, 26 February 2017 at 06:34:07 UTC, Ali Çehreli wrote: So, obviously, assert message generation is not lazy. This is a WAT! for me but perhaps there is a good reason for it. FWIW imho we shouldn't need to write such messages at all. It shouldn't be to difficult to lower `a

Re: If you needed any more evidence that memory safety is the future...

2017-02-26 Thread Ola Fosheim Grøstad via Digitalmars-d
On Sunday, 26 February 2017 at 06:02:59 UTC, Nick Sabalausky (Abscissa) wrote: On 02/26/2017 12:17 AM, Ola Fosheim Grostad wrote: On Saturday, 25 February 2017 at 22:37:15 UTC, Chris Wright wrote: The undefined behavior is what happens after the would-be assertion failure occurs. The compiler i