Re: Bye bye, fast compilation times

2018-02-13 Thread Stefan Koch via Digitalmars-d
On Tuesday, 13 February 2018 at 05:47:10 UTC, Dmitry Olshansky wrote: Was once on my together with other OS memory manager functions, but postponed the work indefinetly. https://github.com/dlang/druntime/pull/1549 If someone is willing to revive that I’d gladly assist with review. Lastly

Re: Bye bye, fast compilation times

2018-02-12 Thread Dmitry Olshansky via Digitalmars-d
On Monday, 12 February 2018 at 00:24:32 UTC, Bastiaan Veelo wrote: On Wednesday, 7 February 2018 at 09:27:47 UTC, Stefan Koch wrote: One thing that I really need in druntime is a cross-platform way to allocate executable memory-pages, this can be done by someone else. Is this on someone's

Re: Bye bye, fast compilation times

2018-02-11 Thread Bastiaan Veelo via Digitalmars-d
On Wednesday, 7 February 2018 at 09:27:47 UTC, Stefan Koch wrote: One thing that I really need in druntime is a cross-platform way to allocate executable memory-pages, this can be done by someone else. Is this on someone's agenda? It probably needs an enhancement request at the very least, I

Re: Bye bye, fast compilation times

2018-02-11 Thread aliak via Digitalmars-d
On Sunday, 11 February 2018 at 16:35:35 UTC, Adam D. Ruppe wrote: The isemail function isn't about validating email addresses. It is just about recognizing something that looks like one. just like isurl doesn't actually try to fetch the site to see if it is broken, it just sees if it looks

Re: Bye bye, fast compilation times

2018-02-11 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 11 February 2018 at 16:26:19 UTC, aliak wrote: If anyone wants to do email validation this should be read first: The isemail function isn't about validating email addresses. It is just about recognizing something that looks like one. just like isurl doesn't actually try to fetch

Re: Bye bye, fast compilation times

2018-02-11 Thread aliak via Digitalmars-d
On Friday, 9 February 2018 at 14:19:56 UTC, bauss wrote: Generally the best way to validate an email is just to check if there is a value before @ and a value after. The real way to validate an email is to check if the email exists on a SMTP server, BUT some SMTP servers will not provide

Re: Bye bye, fast compilation times

2018-02-11 Thread Nathan S. via Digitalmars-d
On Wednesday, 7 February 2018 at 08:21:01 UTC, Seb wrote: There's `version(StdUnittest)` since a few days And I've just submitted a pull request that adds `version(StdUnittest)` to every unittest in the standard library. https://github.com/dlang/phobos/pull/6159

Re: Bye bye, fast compilation times

2018-02-09 Thread bauss via Digitalmars-d
On Tuesday, 6 February 2018 at 20:30:42 UTC, Steven Schveighoffer wrote: The regex in question I think is to ensure an email address like abc@192.168.0.5 has a valid IP address. The D1 function doesn't support that requirement. -Steve An invalid IP is not necessarily an invalid email

Re: Bye bye, fast compilation times

2018-02-08 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 02/08/2018 06:21 AM, Martin Tschierschke wrote: Beginner question: How to split my project, to compile the regex part separately as a lib and just link them? Unfortunately that depends completely on what buildsystem you're using. But if you're just calling the compiler directly, then

Re: Bye bye, fast compilation times

2018-02-08 Thread H. S. Teoh via Digitalmars-d
On Wed, Feb 07, 2018 at 10:59:51PM -0500, Nick Sabalausky (Abscissa) via Digitalmars-d wrote: [...] > On 02/06/2018 08:47 PM, jmh530 wrote: > > > > Would it help to take the approach of mir, i.e. putting > > version(mir_test) before all the unittests? > > That used to be a very common idiom.

Re: Bye bye, fast compilation times

2018-02-08 Thread Martin Tschierschke via Digitalmars-d
On Monday, 5 February 2018 at 21:27:57 UTC, H. S. Teoh wrote: One of my D projects for the past while has been taking unusually long times to compile. This morning, I finally decided to sit down and figure out exactly why. What I found was rather disturbing: -- import std.regex; void

Re: Bye bye, fast compilation times

2018-02-08 Thread Stefan Koch via Digitalmars-d
On Wednesday, 7 February 2018 at 22:00:48 UTC, Bastiaan Veelo wrote: On Wednesday, 7 February 2018 at 09:27:47 UTC, Stefan Koch wrote: Another Thing that can be done is reviewing the code and alerting me to potential problems. i.e. Missing or indecipherable comments as well as spelling

Re: Bye bye, fast compilation times

2018-02-08 Thread Stefan Koch via Digitalmars-d
On Wednesday, 7 February 2018 at 22:00:48 UTC, Bastiaan Veelo wrote: On Wednesday, 7 February 2018 at 09:27:47 UTC, Stefan Koch wrote: Another Thing that can be done is reviewing the code and alerting me to potential problems. i.e. Missing or indecipherable comments as well as spelling

Re: Bye bye, fast compilation times

2018-02-07 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
Yes. This has been a personal annoyance for many years. Even tried arguing some time back to get it fixed to no avail. Really hoping for better success this time. On 02/06/2018 08:47 PM, jmh530 wrote: Would it help to take the approach of mir, i.e. putting version(mir_test) before all the

Re: Bye bye, fast compilation times

2018-02-07 Thread Walter Bright via Digitalmars-d
On 2/7/2018 1:07 PM, Nathan S. wrote: On Tuesday, 6 February 2018 at 22:29:07 UTC, Walter Bright wrote: nobody uses regex for lexer in a compiler. Some years ago I was surprised when I saw this in Clojure's source code. It appears to still be there today:

Re: Bye bye, fast compilation times

2018-02-07 Thread Bastiaan Veelo via Digitalmars-d
On Wednesday, 7 February 2018 at 09:27:47 UTC, Stefan Koch wrote: Another Thing that can be done is reviewing the code and alerting me to potential problems. i.e. Missing or indecipherable comments as well as spelling mistakes. (with the correction please (just telling me something is wrong,

Re: Bye bye, fast compilation times

2018-02-07 Thread Nathan S. via Digitalmars-d
On Tuesday, 6 February 2018 at 22:29:07 UTC, Walter Bright wrote: nobody uses regex for lexer in a compiler. Some years ago I was surprised when I saw this in Clojure's source code. It appears to still be there today:

Re: Bye bye, fast compilation times

2018-02-07 Thread Nicholas Wilson via Digitalmars-d
On Wednesday, 7 February 2018 at 02:05:46 UTC, Timothee Cour wrote: how about using same syntax (and reusing logic) as newly introduced: ` -i=+foo.bar,+baz-baz.bad` `dmd -unittest=+foo.bar,+baz,-baz.bad rest_of_arguments` which would only enable unittests as specified? It's flexible and

Re: Bye bye, fast compilation times

2018-02-07 Thread Stefan Koch via Digitalmars-d
On Tuesday, 6 February 2018 at 18:56:44 UTC, H. S. Teoh wrote: We seriously need to get newCTFE finished and merged. Stefan is very busy with other stuff ATM; I wonder if a few of us can continue his work and get newCTFE into a mergeable state. Given how much D's "compile-time" features

Re: Bye bye, fast compilation times

2018-02-07 Thread Stefan Koch via Digitalmars-d
On Tuesday, 6 February 2018 at 18:56:44 UTC, H. S. Teoh wrote: We seriously need to get newCTFE finished and merged. Stefan is very busy with other stuff ATM; I wonder if a few of us can continue his work and get newCTFE into a mergeable state. Given how much D's "compile-time" features

Re: Bye bye, fast compilation times

2018-02-07 Thread Seb via Digitalmars-d
On Wednesday, 7 February 2018 at 01:20:04 UTC, H. S. Teoh wrote: On Mon, Feb 05, 2018 at 01:27:57PM -0800, H. S. Teoh via Digitalmars-d wrote: [...] [...] I don't want this thread to turn into ragging on std.regex, so here's the next instalment of this saga. [...] Already done. There's

Re: Bye bye, fast compilation times

2018-02-06 Thread Walter Bright via Digitalmars-d
On 2/6/2018 2:51 PM, Steven Schveighoffer wrote: The regex problem is being solved: https://github.com/dlang/phobos/pull/6129 Great!

Re: Bye bye, fast compilation times

2018-02-06 Thread Timothee Cour via Digitalmars-d
how about using same syntax (and reusing logic) as newly introduced: ` -i=+foo.bar,+baz-baz.bad` `dmd -unittest=+foo.bar,+baz,-baz.bad rest_of_arguments` which would only enable unittests as specified? It's flexible and intuitive On Tue, Feb 6, 2018 at 5:56 PM, Jonathan M Davis via

Re: Bye bye, fast compilation times

2018-02-06 Thread psychoticRabbit via Digitalmars-d
On Tuesday, 6 February 2018 at 20:11:56 UTC, Walter Bright wrote: std.string.isEmail() in D1 was a simple function. Maybe regex is just the wrong solution for this problem. [...] C .. D style. I love it! (bugs and all).

Re: Bye bye, fast compilation times

2018-02-06 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, February 07, 2018 01:47:19 jmh530 via Digitalmars-d wrote: > On Wednesday, 7 February 2018 at 01:20:04 UTC, H. S. Teoh wrote: > > So I'd like to propose that we do something similar to what we > > did with template instantiations a couple of years ago: make it > > so that unittests

Re: Bye bye, fast compilation times

2018-02-06 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, February 06, 2018 17:20:04 H. S. Teoh via Digitalmars-d wrote: > So I'd like to propose that we do something similar to what we did with > template instantiations a couple of years ago: make it so that unittests > are only instantiated if the module they occur in is being compiled, >

Re: Bye bye, fast compilation times

2018-02-06 Thread jmh530 via Digitalmars-d
On Wednesday, 7 February 2018 at 01:20:04 UTC, H. S. Teoh wrote: So I'd like to propose that we do something similar to what we did with template instantiations a couple of years ago: make it so that unittests are only instantiated if the module they occur in is being compiled, otherwise

Re: Bye bye, fast compilation times

2018-02-06 Thread H. S. Teoh via Digitalmars-d
On Wed, Feb 07, 2018 at 01:22:02AM +, Andres Clari via Digitalmars-d wrote: [...] > Is there some tutorial or example for using SCons with dub > dependencies? Not that I know of. Basically what I did was: - Create a dummy dub project in a subdirectory, containing a dummy source file

Re: Bye bye, fast compilation times

2018-02-06 Thread H. S. Teoh via Digitalmars-d
On Mon, Feb 05, 2018 at 01:27:57PM -0800, H. S. Teoh via Digitalmars-d wrote: > One of my D projects for the past while has been taking unusually long > times to compile. This morning, I finally decided to sit down and > figure out exactly why. [...] I don't want this thread to turn into ragging

Re: Bye bye, fast compilation times

2018-02-06 Thread Andres Clari via Digitalmars-d
On Wednesday, 7 February 2018 at 00:36:22 UTC, H. S. Teoh wrote: On Tue, Feb 06, 2018 at 11:20:53PM +, Andres Clari via Digitalmars-d wrote: [...] [...] I seem to vaguely recall that in some cases, ctRegex might even perform slower than regex(). But either way, my use cases for regexes

Re: Bye bye, fast compilation times

2018-02-06 Thread H. S. Teoh via Digitalmars-d
On Tue, Feb 06, 2018 at 11:20:53PM +, Andres Clari via Digitalmars-d wrote: [...] > Switching from ctRegex! to regex yielded a 50% build time reduction, > and from what I read even the normal regex are slowing things down > considerably. I seem to vaguely recall that in some cases, ctRegex

Re: Bye bye, fast compilation times

2018-02-06 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 02/06/2018 01:11 AM, Dmitry Olshansky wrote: On Tuesday, 6 February 2018 at 05:45:35 UTC, Steven Schveighoffer wrote: On 2/6/18 12:35 AM, Dmitry Olshansky wrote: That’s really bad idea - isEmail is template so the burden of freaking slow ctRegex is paid on per instantiation basis. Could

Re: Bye bye, fast compilation times

2018-02-06 Thread Andres Clari via Digitalmars-d
On Tuesday, 6 February 2018 at 22:51:51 UTC, Steven Schveighoffer wrote: On 2/6/18 5:23 PM, Walter Bright wrote: On 2/6/2018 2:03 PM, Jacob Carlborg wrote: On 2018-02-06 21:11, Walter Bright wrote: std.string.isEmail() in D1 was a simple function. Maybe regex is just the wrong solution for

Re: Bye bye, fast compilation times

2018-02-06 Thread Steven Schveighoffer via Digitalmars-d
On 2/6/18 5:23 PM, Walter Bright wrote: On 2/6/2018 2:03 PM, Jacob Carlborg wrote: On 2018-02-06 21:11, Walter Bright wrote: std.string.isEmail() in D1 was a simple function. Maybe regex is just the wrong solution for this problem. If I recall correctly, the current implementation of

Re: Bye bye, fast compilation times

2018-02-06 Thread H. S. Teoh via Digitalmars-d
On Tue, Feb 06, 2018 at 02:29:07PM -0800, Walter Bright via Digitalmars-d wrote: > On 2/6/2018 12:30 PM, Steven Schveighoffer wrote: > > The regex in question I think is to ensure an email address like > > abc@192.168.0.5 has a valid IP address. The D1 function doesn't > > support that

Re: Bye bye, fast compilation times

2018-02-06 Thread Walter Bright via Digitalmars-d
On 2/6/2018 12:30 PM, Steven Schveighoffer wrote: The regex in question I think is to ensure an email address like abc@192.168.0.5 has a valid IP address. The D1 function doesn't support that requirement. I admit, I've never used it, so I don't know why it needs to be so complex. But I assume

Re: Bye bye, fast compilation times

2018-02-06 Thread Walter Bright via Digitalmars-d
On 2/6/2018 2:03 PM, Jacob Carlborg wrote: On 2018-02-06 21:11, Walter Bright wrote: std.string.isEmail() in D1 was a simple function. Maybe regex is just the wrong solution for this problem. If I recall correctly, the current implementation of std.net.isEmail was requested by you.

Re: Bye bye, fast compilation times

2018-02-06 Thread Jacob Carlborg via Digitalmars-d
On 2018-02-06 21:11, Walter Bright wrote: std.string.isEmail() in D1 was a simple function. Maybe regex is just the wrong solution for this problem. If I recall correctly, the current implementation of std.net.isEmail was requested by you. -- /Jacob Carlborg

Re: Bye bye, fast compilation times

2018-02-06 Thread Timothee Cour via Digitalmars-d
another weird gotcha: auto s="foo".isEmail; writeln(s.toString); // ok writeln(s); // compile error On Tue, Feb 6, 2018 at 12:30 PM, Steven Schveighoffer via Digitalmars-d wrote: > On 2/6/18 3:11 PM, Walter Bright wrote: >> >> On 2/5/2018 9:35 PM, Dmitry

Re: Bye bye, fast compilation times

2018-02-06 Thread Steven Schveighoffer via Digitalmars-d
On 2/6/18 3:11 PM, Walter Bright wrote: On 2/5/2018 9:35 PM, Dmitry Olshansky wrote: That’s really bad idea - isEmail is template so the burden of freaking slow ctRegex is paid on per instantiation basis. Could be horrible with separate compilation. std.string.isEmail() in D1 was a simple

Re: Bye bye, fast compilation times

2018-02-06 Thread Walter Bright via Digitalmars-d
On 2/5/2018 9:35 PM, Dmitry Olshansky wrote: That’s really bad idea - isEmail is template so the burden of freaking slow ctRegex is paid on per instantiation basis. Could be horrible with separate compilation. std.string.isEmail() in D1 was a simple function. Maybe regex is just the wrong

Re: Bye bye, fast compilation times

2018-02-06 Thread Steven Schveighoffer via Digitalmars-d
On 2/6/18 2:07 PM, H. S. Teoh wrote: I'm not sure I'm seeing the value of using ctRegex here. What's wrong with a module static runtime regex initialized by a static this()? No, I'd rather have it initialized on first call. And before anyone complains about initializing the regex if user

Re: Bye bye, fast compilation times

2018-02-06 Thread H. S. Teoh via Digitalmars-d
On Tue, Feb 06, 2018 at 05:35:44AM +, Dmitry Olshansky via Digitalmars-d wrote: > On Tuesday, 6 February 2018 at 04:35:42 UTC, Steven Schveighoffer wrote: > > On 2/5/18 11:09 PM, psychoticRabbit wrote: [...] > > > > > > import std.net.isemail; > > > > > > void main() > > > { > > >    

Re: Bye bye, fast compilation times

2018-02-06 Thread H. S. Teoh via Digitalmars-d
On Tue, Feb 06, 2018 at 05:44:17AM +, Dmitry Olshansky via Digitalmars-d wrote: [...] > Honestly I’m tired to hell of working with our compiler and its > compile time features. When it doesn’t pee itself due to OOM I’m > almost happy. Heh, dmd's famous memory usage is causing me tons of

Re: Bye bye, fast compilation times

2018-02-06 Thread Dmitry Olshansky via Digitalmars-d
On Tuesday, 6 February 2018 at 13:51:01 UTC, Nathan S. wrote: Just use the run-time version, it’s not that much slower. But then again static ipRegex = regex(...) will parse and build regex at CTFE. Maybe lazy init? FYI I've made a pull request that replaces uses of regexes in

Re: Bye bye, fast compilation times

2018-02-06 Thread Nathan S. via Digitalmars-d
On Tuesday, 6 February 2018 at 06:11:55 UTC, Dmitry Olshansky wrote: On Tuesday, 6 February 2018 at 05:45:35 UTC, Steven Schveighoffer wrote: On 2/6/18 12:35 AM, Dmitry Olshansky wrote: That’s really bad idea - isEmail is template so the burden of freaking slow ctRegex is paid on per

Re: Bye bye, fast compilation times

2018-02-05 Thread Dmitry Olshansky via Digitalmars-d
On Tuesday, 6 February 2018 at 05:45:35 UTC, Steven Schveighoffer wrote: On 2/6/18 12:35 AM, Dmitry Olshansky wrote: That’s really bad idea - isEmail is template so the burden of freaking slow ctRegex is paid on per instantiation basis. Could be horrible with separate compilation.

Re: Bye bye, fast compilation times

2018-02-05 Thread Steven Schveighoffer via Digitalmars-d
On 2/6/18 12:35 AM, Dmitry Olshansky wrote: On Tuesday, 6 February 2018 at 04:35:42 UTC, Steven Schveighoffer wrote: On 2/5/18 11:09 PM, psychoticRabbit wrote: On Monday, 5 February 2018 at 21:27:57 UTC, H. S. Teoh wrote: Comment out the call to `regex()`, and I get: -- real    0m0.285s

Re: Bye bye, fast compilation times

2018-02-05 Thread Dmitry Olshansky via Digitalmars-d
On Monday, 5 February 2018 at 21:27:57 UTC, H. S. Teoh wrote: One of my D projects for the past while has been taking unusually long times to compile. This morning, I finally decided to sit down and figure out exactly why. What I found was rather disturbing: -- import std.regex; void

Re: Bye bye, fast compilation times

2018-02-05 Thread Dmitry Olshansky via Digitalmars-d
On Tuesday, 6 February 2018 at 04:35:42 UTC, Steven Schveighoffer wrote: On 2/5/18 11:09 PM, psychoticRabbit wrote: On Monday, 5 February 2018 at 21:27:57 UTC, H. S. Teoh wrote: Comment out the call to `regex()`, and I get: -- real    0m0.285s user    0m0.262s sys 0m0.023s --

Re: Bye bye, fast compilation times

2018-02-05 Thread rikki cattermole via Digitalmars-d
On 06/02/2018 4:35 AM, Steven Schveighoffer wrote: On 2/5/18 11:09 PM, psychoticRabbit wrote: On Monday, 5 February 2018 at 21:27:57 UTC, H. S. Teoh wrote: Comment out the call to `regex()`, and I get: -- real    0m0.285s user    0m0.262s sys 0m0.023s -- regex is not the only

Re: Bye bye, fast compilation times

2018-02-05 Thread Steven Schveighoffer via Digitalmars-d
On 2/5/18 11:09 PM, psychoticRabbit wrote: On Monday, 5 February 2018 at 21:27:57 UTC, H. S. Teoh wrote: Comment out the call to `regex()`, and I get: -- real    0m0.285s user    0m0.262s sys 0m0.023s -- regex is not the only one I avoid.. how long you think this takes to

Re: Bye bye, fast compilation times

2018-02-05 Thread psychoticRabbit via Digitalmars-d
On Tuesday, 6 February 2018 at 04:09:24 UTC, psychoticRabbit wrote: how long you think this takes to compile? (try ldc2 too ..just for laughs ;-) import std.net.isemail; void main() { auto checkEmail = "some...@somewhere.com".isEmail(); } oh.. and for an even bigger laugh... -O

Re: Bye bye, fast compilation times

2018-02-05 Thread psychoticRabbit via Digitalmars-d
On Monday, 5 February 2018 at 21:27:57 UTC, H. S. Teoh wrote: Comment out the call to `regex()`, and I get: -- real0m0.285s user0m0.262s sys 0m0.023s -- regex is not the only one I avoid.. how long you think this takes to compile? (try ldc2 too ..just for laughs ;-)

Bye bye, fast compilation times

2018-02-05 Thread H. S. Teoh via Digitalmars-d
One of my D projects for the past while has been taking unusually long times to compile. This morning, I finally decided to sit down and figure out exactly why. What I found was rather disturbing: -- import std.regex; void main() { auto re = regex(``); } -- Compile command: time