Re: CTFE Status 2

2017-06-08 Thread Stefan Koch via Digitalmars-d
On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote: [ ... ] Hi there, I just pulled another all nighter. I found a bug in the code that was supposed to adjust the values of || and &&. As will as a mixup in the error messages for overlapping slice-assignment. Both are fixed. I

Re: SCons and D

2017-06-08 Thread bachmeier via Digitalmars-d
On Thursday, 8 June 2017 at 14:27:53 UTC, Russel Winder wrote: It seems I am on a bit of a roll getting changesets relating to D support for SCons into an appropriate state so that they get merged into the mainline SCons repository. So maybe now is a time to get any "pet peeves" with D support

Re: SCons, Python 3, and D

2017-06-08 Thread Nordlöw via Digitalmars-d
On Thursday, 8 June 2017 at 09:42:50 UTC, Russel Winder wrote: In case anyone has missed recent news, SCons seems now to work without any problems using Python 3 Nice. I am using Python 3 to run all my SCons D builds. Me too :)

Re: Concept proposal: Safely catching error

2017-06-08 Thread Jesse Phillips via Digitalmars-d
I want to start by stating that the discussion around being able to throw Error from nothrow functions and the compiler optimizations that follow is important to the thoughts below. The other aspect of array bounds checking is that those particular checks will not be added in -release. There h

Re: Concept proposal: Safely catching error

2017-06-08 Thread Steven Schveighoffer via Digitalmars-d
On 6/8/17 11:19 AM, Stanislav Blinov wrote: On Thursday, 8 June 2017 at 14:13:53 UTC, Steven Schveighoffer wrote: void foo(Mutex m, Data d) pure { synchronized(m) { // ... manipulate d } // no guarantee m gets unlocked } Isn't synchronized(m) not nothrow? You're right, it i

Re: vibe.d on Web Framework Benchmarks

2017-06-08 Thread Ali Çehreli via Digitalmars-d
On 06/08/2017 05:09 AM, Dominikus Dittes Scherkl wrote: > Wow. Answer was actually visible before the OP. THAT is what I would > call fast. Did you use vibe.d? Your answer hasn't arrived yet. Using something other than vibe.d? :p Ali

Re: Concept proposal: Safely catching error

2017-06-08 Thread Stanislav Blinov via Digitalmars-d
On Thursday, 8 June 2017 at 14:13:53 UTC, Steven Schveighoffer wrote: void foo(Mutex m, Data d) pure { synchronized(m) { // ... manipulate d } // no guarantee m gets unlocked } -Steve Isn't synchronized(m) not nothrow?

Re: SCons and D

2017-06-08 Thread Russel Winder via Digitalmars-d
On Thu, 2017-06-08 at 14:37 +, bachmeier via Digitalmars-d wrote: > On Thursday, 8 June 2017 at 14:27:53 UTC, Russel Winder wrote: > > It seems I am on a bit of a roll getting changesets relating to  > > D support for SCons into an appropriate state so that they get  > > merged into the mainlin

Re: sqlite3 vs. sqlite-d

2017-06-08 Thread Russel Winder via Digitalmars-d
On Thu, 2017-06-08 at 14:55 +, Dejan Lekic via Digitalmars-d wrote: > On Thursday, 8 June 2017 at 13:37:41 UTC, Russel Winder wrote: > > > Exactly my point. Using SQLAlchemy made me actually enjoy  > > writing database code. Which I did last year having avoided it > > Using ORM like SQLAlchem

Re: Concept proposal: Safely catching error

2017-06-08 Thread ag0aep6g via Digitalmars-d
On 06/08/2017 04:02 PM, Olivier FAURE wrote: That's true. A "pure after cleanup" function is incompatible with catching Errors (unless we introduce a "scope(error)" keyword that also runs on errors, but that comes with other problems). Is pureMalloc supposed to be representative of pure functi

Re: sqlite3 vs. sqlite-d

2017-06-08 Thread Dejan Lekic via Digitalmars-d
On Thursday, 8 June 2017 at 13:37:41 UTC, Russel Winder wrote: Exactly my point. Using SQLAlchemy made me actually enjoy writing database code. Which I did last year having avoided it Using ORM like SQLAlchemy certainly has benefits but like any other ORM, it generates hideous SQL code, somet

Re: sqlite3 vs. sqlite-d

2017-06-08 Thread Stefan Koch via Digitalmars-d
On Thursday, 8 June 2017 at 13:06:55 UTC, Ozan (O/N/S) wrote: Your sqlite-d solution would be complete if writing sqlite files are also possible. Ignore the SQL parsing stuff, it does not fit in a world of fast data processing. Writing or rather modifying sqlite-dbs is a bit harder then readi

Re: SCons and D

2017-06-08 Thread bachmeier via Digitalmars-d
On Thursday, 8 June 2017 at 14:27:53 UTC, Russel Winder wrote: It seems I am on a bit of a roll getting changesets relating to D support for SCons into an appropriate state so that they get merged into the mainline SCons repository. So maybe now is a time to get any "pet peeves" with D support

SCons and D

2017-06-08 Thread Russel Winder via Digitalmars-d
It seems I am on a bit of a roll getting changesets relating to D support for SCons into an appropriate state so that they get merged into the mainline SCons repository. So maybe now is a time to get any "pet peeves" with D support in SCons fixed. For myself, I am currently working on a new tool "

Re: Concept proposal: Safely catching error

2017-06-08 Thread Steven Schveighoffer via Digitalmars-d
On 6/8/17 9:42 AM, Olivier FAURE wrote: On Thursday, 8 June 2017 at 12:20:19 UTC, Steven Schveighoffer wrote: Hm... if you locked an object that was passed in on the stack, for instance, there is no guarantee the object gets unlocked. This wouldn't be allowed unless the object was duplicated

Re: Concept proposal: Safely catching error

2017-06-08 Thread Olivier FAURE via Digitalmars-d
On Thursday, 8 June 2017 at 13:02:38 UTC, ag0aep6g wrote: Catching the resulting error is @safe when you throw the int* away. So if f is `pure` and you make sure that the arguments don't survive the `try` block, you're good, because f supposedly cannot have reached anything else. This is your

Re: Concept proposal: Safely catching error

2017-06-08 Thread Olivier FAURE via Digitalmars-d
On Thursday, 8 June 2017 at 12:20:19 UTC, Steven Schveighoffer wrote: Hm... if you locked an object that was passed in on the stack, for instance, there is no guarantee the object gets unlocked. This wouldn't be allowed unless the object was duplicated / created inside the try block. Aside

Re: sqlite3 vs. sqlite-d

2017-06-08 Thread Russel Winder via Digitalmars-d
On Thu, 2017-06-08 at 11:36 +, Stefan Koch via Digitalmars-d wrote: > […] > The Alternative is not doing SQL at all. > But building the queries inside your code. Exactly my point. Using SQLAlchemy made me actually enjoy writing database code. Which I did last year having avoided it since I wa

Re: sqlite3 vs. sqlite-d

2017-06-08 Thread Ozan (O/N/S) via Digitalmars-d
On Wednesday, 7 June 2017 at 19:16:07 UTC, Stefan Koch wrote: On Wednesday, 7 June 2017 at 19:10:26 UTC, Ozan wrote: On Wednesday, 7 June 2017 at 17:51:30 UTC, Stefan Koch wrote: Hi guys I made a small video. Mature and heavily optimized C library vs. young D upstart. See for yourself how it

Re: Concept proposal: Safely catching error

2017-06-08 Thread ag0aep6g via Digitalmars-d
On 06/08/2017 11:27 AM, Olivier FAURE wrote: Contracts are made to preempt memory corruption, and to protect against *programming* errors; they're not recoverable because breaking a contract means that from now on the program is in a state that wasn't anticipated by the programmer. Which mean

Re: Concept proposal: Safely catching error

2017-06-08 Thread Steven Schveighoffer via Digitalmars-d
On 6/7/17 12:20 PM, Olivier FAURE wrote: On Monday, 5 June 2017 at 14:05:27 UTC, Steven Schveighoffer wrote: I don't think this will work. Only throwing Error makes a function nothrow. A nothrow function may not properly clean up the stack while unwinding. Not because the stack unwinding code s

Re: vibe.d on Web Framework Benchmarks

2017-06-08 Thread Dominikus Dittes Scherkl via Digitalmars-d
On Wednesday, 7 June 2017 at 21:18:21 UTC, ketmar wrote: Ozan wrote: On Wednesday, 7 June 2017 at 09:44:55 UTC, Ali Çehreli wrote: Is there an issue with the tests? Surprised that vibe.d is not higher in the rating... https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=fortun

Re: sqlite3 vs. sqlite-d

2017-06-08 Thread Stefan Koch via Digitalmars-d
On Thursday, 8 June 2017 at 08:44:56 UTC, Russel Winder wrote: But what is D's equivalent to Python's SQLAlchemy? C++ now has sqlpp11. Anyone doing SQL code manipulation with strings in another language is doing it wrong. Internal DSLs FTW. The Alternative is not doing SQL at all. But buil

SCons, Python 3, and D

2017-06-08 Thread Russel Winder via Digitalmars-d
In case anyone has missed recent news, SCons seems now to work without any problems using Python 3 (the one true Python – until Python 4, obviously). I am using Python 3 to run all my SCons D builds. Obviously this relates to using a checkout of the mainline Mercurial repository and using default

Re: Concept proposal: Safely catching error

2017-06-08 Thread Olivier FAURE via Digitalmars-d
On Wednesday, 7 June 2017 at 19:45:05 UTC, ag0aep6g wrote: You gave the argument against catching out-of-bounds errors as: "it means an invariant is broken, which means the code surrounding it probably makes invalid assumptions and shouldn't be trusted." That line of reasoning applies to @tru

Re: sqlite3 vs. sqlite-d

2017-06-08 Thread Russel Winder via Digitalmars-d
On Wed, 2017-06-07 at 20:40 +, Stefan Koch via Digitalmars-d wrote: > On Wednesday, 7 June 2017 at 20:12:22 UTC, cym13 wrote: > > > It should be noted that the benchmark isn't fair, it favours  > > the sqlite3 implementation as parsing and preparing the  > > statement isn't measured. And yes,