Re: Life in the Fast Lane (@nogc blog post)

2017-06-20 Thread Ali Çehreli via Digitalmars-d-announce
On 06/20/2017 09:47 AM, jmh530 wrote: On Tuesday, 20 June 2017 at 15:24:06 UTC, Dukc wrote: I wasn't skilled enough to make a generic version of this trough. And I do not know what happens if @nogc function ends up calling gc. This seems like it only would work if you know that there

Re: Life in the Fast Lane (@nogc blog post)

2017-06-20 Thread jmh530 via Digitalmars-d-announce
On Tuesday, 20 June 2017 at 16:47:20 UTC, jmh530 wrote: Below is a little more generic: Opps, left an extra import std.stdio in there.

Re: Life in the Fast Lane (@nogc blog post)

2017-06-20 Thread jmh530 via Digitalmars-d-announce
On Tuesday, 20 June 2017 at 15:24:06 UTC, Dukc wrote: I wasn't skilled enough to make a generic version of this trough. And I do not know what happens if @nogc function ends up calling gc. This seems like it only would work if you know that there wouldn't be any allocations. I don't

Re: Life in the Fast Lane (@nogc blog post)

2017-06-20 Thread Dukc via Digitalmars-d-announce
On Tuesday, 20 June 2017 at 09:56:03 UTC, Bastiaan Veelo wrote: Transferring this to GC, you could have @gc (the default), @nogc (the @safe equivalent) and the @trusted equivalent: @gc_code_that_is_acceptable_to_be_called_in_nogc_code_as_an_exception_to_the_rule. I'll abbreviate this as @gc78

Re: Life in the Fast Lane (@nogc blog post)

2017-06-20 Thread Bastiaan Veelo via Digitalmars-d-announce
On Monday, 19 June 2017 at 10:13:33 UTC, Ali Çehreli wrote: I know that there are efforts towards @nogc exceptions but I think @nogc should somehow related only to the normal operation of code. Since exceptions are for error cases, perhaps they shouldn't have an effect on whether a function is

Re: Life in the Fast Lane (@nogc blog post)

2017-06-19 Thread Ali Çehreli via Digitalmars-d-announce
On 06/19/2017 12:12 AM, Dukc wrote: On Monday, 19 June 2017 at 00:12:25 UTC, Ali Çehreli wrote: I would like to see these ideas in a blog post. It's liberating when assumed problems are convinced away. :) True, but I think the very blog post we're talking about already does that. LOL.

Re: Life in the Fast Lane (@nogc blog post)

2017-06-19 Thread Dukc via Digitalmars-d-announce
On Monday, 19 June 2017 at 00:12:25 UTC, Ali Çehreli wrote: I would like to see these ideas in a blog post. It's liberating when assumed problems are convinced away. :) True, but I think the very blog post we're talking about already does that.

Re: Life in the Fast Lane (@nogc blog post)

2017-06-18 Thread Ali Çehreli via Digitalmars-d-announce
On 06/17/2017 10:39 AM, Adam D. Ruppe wrote: > On Saturday, 17 June 2017 at 16:59:56 UTC, Dukc wrote: >> Didn't Don Clugston say about something at some Dconf that it must >> trigger allocation "not hardly ever, NEVER"? So there's a real need >> even for the rigid @nogc, albeit a niche one. > >

Re: Life in the Fast Lane (@nogc blog post)

2017-06-17 Thread Joakim via Digitalmars-d-announce
On Friday, 16 June 2017 at 18:26:15 UTC, Joakim wrote: On Friday, 16 June 2017 at 13:51:18 UTC, Mike Parker wrote: I've been meaning to get this done for weeks but have had a severe case of writer's block. The fact that I had no other posts ready to go this week and no time to write anything

Re: Life in the Fast Lane (@nogc blog post)

2017-06-17 Thread Adam D. Ruppe via Digitalmars-d-announce
On Saturday, 17 June 2017 at 16:59:56 UTC, Dukc wrote: If that Walter's DIP about reference-counted exceptions gets trough it should ease problem like that quite a bit. Possibly. There's a lot of solutions to the exception thing though, and it doesn't actually bother me if you see @nogc as

Re: Life in the Fast Lane (@nogc blog post)

2017-06-17 Thread Adam D. Ruppe via Digitalmars-d-announce
On Saturday, 17 June 2017 at 13:09:42 UTC, Guillaume Piolat wrote: As a counterpoint: It's true that it's a bit niche, but when you have "no gc" then @nogc really helps with peace of mind (only one allocation and you may crash). Yes, when you actually need it it might be helpful, and then the

Re: Life in the Fast Lane (@nogc blog post)

2017-06-17 Thread Dukc via Digitalmars-d-announce
On Saturday, 17 June 2017 at 13:05:50 UTC, Adam D. Ruppe wrote: The reason writeln fails @nogc is that it *might* throw an exception with most args if stdout is closed or something. Perfect example of an *extremely* rare case failing @nogc's ridiculously strict requirements. If that

Re: Life in the Fast Lane (@nogc blog post)

2017-06-17 Thread Johannes Pfau via Digitalmars-d-announce
Am Fri, 16 Jun 2017 13:51:18 + schrieb Mike Parker : > I've been meaning to get this done for weeks but have had a > severe case of writer's block. The fact that I had no other posts > ready to go this week and no time to write anything at all > motivated me to make

Re: Life in the Fast Lane (@nogc blog post)

2017-06-17 Thread ketmar via Digitalmars-d-announce
Guillaume Piolat wrote: On Saturday, 17 June 2017 at 13:05:50 UTC, Adam D. Ruppe wrote: This is why I consider @nogc to be an *extremely* niche feature and generally harmful. It makes things look a lot harder than it really is - people confuse `@nogc` with "no gc". Instead, I suggest just

Re: Life in the Fast Lane (@nogc blog post)

2017-06-17 Thread Adam D. Ruppe via Digitalmars-d-announce
On Saturday, 17 June 2017 at 07:03:53 UTC, Petar Kirov [ZombineDev] wrote: 2. However, there's this long list of things that you have to avoid. There's like 10 things to avoid in the language itself: http://dlang.org/spec/garbage.html#op_involving_gc and most of them are obviously array

Re: Life in the Fast Lane (@nogc blog post)

2017-06-17 Thread Guillaume Piolat via Digitalmars-d-announce
On Saturday, 17 June 2017 at 13:05:50 UTC, Adam D. Ruppe wrote: This is why I consider @nogc to be an *extremely* niche feature and generally harmful. It makes things look a lot harder than it really is - people confuse `@nogc` with "no gc". Instead, I suggest just minding the list and using

Re: Life in the Fast Lane (@nogc blog post)

2017-06-17 Thread Eugene Wissner via Digitalmars-d-announce
On Saturday, 17 June 2017 at 08:51:04 UTC, Mike Parker wrote: On Saturday, 17 June 2017 at 07:03:53 UTC, Petar Kirov [ZombineDev] wrote: The right answer is three fold: A) Examples of idiomatic D code - generic functions agnostic about the memory management strategy like range algorithms;

Re: Life in the Fast Lane (@nogc blog post)

2017-06-17 Thread Mike Parker via Digitalmars-d-announce
On Saturday, 17 June 2017 at 07:03:53 UTC, Petar Kirov [ZombineDev] wrote: The right answer is three fold: A) Examples of idiomatic D code - generic functions agnostic about the memory management strategy like range algorithms; B) Having solid tools at the language-level for implementing

Re: Life in the Fast Lane (@nogc blog post)

2017-06-17 Thread via Digitalmars-d-announce
On Friday, 16 June 2017 at 13:51:18 UTC, Mike Parker wrote: I've been meaning to get this done for weeks but have had a severe case of writer's block. The fact that I had no other posts ready to go this week and no time to write anything at all motivated me to make time for it and get it done

Re: Life in the Fast Lane (@nogc blog post)

2017-06-16 Thread Joakim via Digitalmars-d-announce
On Friday, 16 June 2017 at 13:51:18 UTC, Mike Parker wrote: I've been meaning to get this done for weeks but have had a severe case of writer's block. The fact that I had no other posts ready to go this week and no time to write anything at all motivated me to make time for it and get it done

Re: Life in the Fast Lane (@nogc blog post)

2017-06-16 Thread David Gileadi via Digitalmars-d-announce
On 6/16/17 6:51 AM, Mike Parker wrote: I've been meaning to get this done for weeks but have had a severe case of writer's block. The fact that I had no other posts ready to go this week and no time to write anything at all motivated me to make time for it and get it done anyway. My wife

Life in the Fast Lane (@nogc blog post)

2017-06-16 Thread Mike Parker via Digitalmars-d-announce
I've been meaning to get this done for weeks but have had a severe case of writer's block. The fact that I had no other posts ready to go this week and no time to write anything at all motivated me to make time for it and get it done anyway. My wife didn't complain when I told her I had to