January 07, 2013
On 2013-01-07 12:55, nazriel wrote:
> Anyways, great read. Also nice to see that more and more Polish people are
> getting interested in D Programming Language. Maybe in near future I will be
> able to meet someone in real world living close to me and drink some beer and
> talk about D.

Who knows. Maybe there will even be a D conference in Poland in our lifetime. ;)
January 07, 2013
On 2013-01-07 14:31, Chris wrote:
> (one more Fibbonacci example and I'll go maD!)

Sorry for using the most overused one. :)

> However, in order to convince people to use D for new projects,
> it would be nice to have some practical real-world examples
> and possibly a list of "Made with D"-software.

Definitely.

January 07, 2013
On Monday, 7 January 2013 at 16:57:05 UTC, FG wrote:
> Who knows. Maybe there will even be a D conference in Poland in our lifetime. ;)

Not sure if you were implying this, but actually there was a D conference in Poland already, the Tango Conference in 2008. ;)

David
January 07, 2013
On 2013-01-07 18:20, David Nadlinger wrote:
> Not sure if you were implying this, but actually there was a D conference in
> Poland already, the Tango Conference in 2008. ;)

Oh. I didn't know much about D back then and haven't tried Tango.
IIRC I only started following D after regular expressions in Phobos got decent.

January 07, 2013
On Monday, 7 January 2013 at 17:20:23 UTC, David Nadlinger wrote:
> On Monday, 7 January 2013 at 16:57:05 UTC, FG wrote:
>> Who knows. Maybe there will even be a D conference in Poland in our lifetime. ;)
>
> Not sure if you were implying this, but actually there was a D conference in Poland already, the Tango Conference in 2008. ;)
>
> David

Yeah, it was hosted in Torun.
Unfortunately I had no idea about D back then, buu.

Lets hope there will be more in near future *winks
January 07, 2013
On 1/7/2013 5:31 AM, Chris wrote:
> Nice article. Once I have enough time I would like to write a short article
> about how D has solved practical issues for me.

Please do!


> I think it is not enough to talk
> about all the features of the language (templates, GC) without giving practical
> examples

This is a very important point. Without showing how features combine to solve interesting problems, people tend to view lists of features as just

   ...buzz...buzz...buzz...buzz...buzz...

January 07, 2013
Cool article.

Most of my favorite features are just skipped but hey, you can't cover everything in an overview! Plus, every new article describing D's is important.

What's he saying about "delete" being deprecated? Is that true? Are we talking about that delete:

class {
  new( size_t size ) { ... }
  delete( void * v ) { ... }

}

Or the global one he uses? Personally, I would like the delete operator to continue to exist, just to explicitly delete objects when needed (although scope objects works fine in most cases).

Phil
January 07, 2013
On Monday, 7 January 2013 at 21:49:12 UTC, Phil Lavoie wrote:
> Cool article.
>
> Most of my favorite features are just skipped but hey, you can't cover everything in an overview! Plus, every new article describing D's is important.
>
> What's he saying about "delete" being deprecated? Is that true? Are we talking about that delete:
>
> class {
>   new( size_t size ) { ... }
>   delete( void * v ) { ... }
>
> }
>
> Or the global one he uses? Personally, I would like the delete operator to continue to exist, just to explicitly delete objects when needed (although scope objects works fine in most cases).
>
> Phil

I meant scope objects work fine in most cases, but sometimes its good to explicitly delete objects on the heap.
January 07, 2013
On Monday, 7 January 2013 at 21:49:12 UTC, Phil Lavoie wrote:
> Or the global one he uses?

Both actually, iirc. delete foo; is discouraged in favor of a library function destroy(foo) (or something, the name has changed once), and the class allocators can be done at the creation site (std.typecons has functions like emplace or Scoped) or with static methods and private constructors.

> Personally, I would like the delete operator to continue to exist, just to explicitly delete objects when needed (although scope objects works fine in most cases).

Bah, I'd like to get rid of both new and delete, replacing both with simple library functions. Well, probably not "get rid of" because that'd break too much code, but certainly discourage in favor of library function templates.

A benefit there is you could swap out to other things without changing the syntax, and it can return special library types.

import gc;
auto foo = New!Foo(); // could return a NotNull!Foo, which is substitutable for plain Foo, but also gives the guarantee that it isn't null

or
import malloc;
auto foo = New!Foo(); // could return RefCounted!Foo or whatever




Another benefit with all library is it'd clear up the delete deprecation... since new is just a library function, there'd be no confusion about delete being a library function either :)
January 07, 2013
On 01/07/2013 01:57 PM, Phil Lavoie wrote:

> I meant scope objects work fine in most cases, but sometimes its good to
> explicitly delete objects on the heap.

Usually, what is needed is to just finalize the object. The memory that it sits on should still be managed by the GC.

So, now there is destroy():

  http://dlang.org/phobos/object.html#.TypeInfo.destroy

        auto variable = new Foo;
        // ... later ...
        destroy(variable);

Ali