Re: Thoughts from newcommer

2017-04-20 Thread Stefan Koch via Digitalmars-d
On Tuesday, 18 April 2017 at 16:42:38 UTC, Andrei Alexandrescu wrote: On 04/18/2017 03:00 AM, Shachar Shemesh wrote: D would have the ability to have a nice container that would do RAII (for classes since for structs, __dtors are called automatically) That's just it, though. They are not.

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 04/18/2017 03:00 AM, Shachar Shemesh wrote: D would have the ability to have a nice container that would do RAII (for classes since for structs, __dtors are called automatically) That's just it, though. They are not. Not reliably. Yah, clearly there's a problem with the language

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 04/18/2017 10:55 AM, Russel Winder via Digitalmars-d wrote: On Tue, 2017-04-18 at 09:23 -0400, Andrei Alexandrescu via Digitalmars- d wrote: On 4/18/17 8:48 AM, prdan wrote: Thanks, maybe I will write a blog post about my experiences also. That would be great! Michael Parker may be of

Re: Thoughts from newcommer

2017-04-18 Thread Russel Winder via Digitalmars-d
On Tue, 2017-04-18 at 09:23 -0400, Andrei Alexandrescu via Digitalmars- d wrote: > On 4/18/17 8:48 AM, prdan wrote: > > Thanks, maybe I will write a blog post about my experiences also. > > That would be great! Michael Parker may be of help if you consider  > publishing in the official D Blog. --

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 4/18/17 8:48 AM, prdan wrote: Thanks, maybe I will write a blog post about my experiences also. That would be great! Michael Parker may be of help if you consider publishing in the official D Blog. -- Andrei

Re: Thoughts from newcommer

2017-04-18 Thread prdan via Digitalmars-d
On Tuesday, 18 April 2017 at 12:22:10 UTC, Andrei Alexandrescu wrote: Cool, thanks for this work! However, a word of caution - experiments ran on different CPUs can't count as comparable. I didn't compare D times to numbers from benchmarks game site. I've ran other languages on the same

Re: Thoughts from newcommer

2017-04-18 Thread rikki cattermole via Digitalmars-d
On 18/04/2017 1:22 PM, Andrei Alexandrescu wrote: On 04/17/2017 10:57 PM, prdan wrote: I've written multi-threaded regex-redux benchmark for D language and made some tests. This is my first program written in D, I didn't know much about D a week ago. Here are the results for other languages:

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 04/17/2017 10:57 PM, prdan wrote: I've written multi-threaded regex-redux benchmark for D language and made some tests. This is my first program written in D, I didn't know much about D a week ago. Here are the results for other languages:

Re: Thoughts from newcommer

2017-04-18 Thread prdan via Digitalmars-d
On Tuesday, 18 April 2017 at 07:22:29 UTC, thedeemon wrote: Which compiler did you use for D? I've used newest LDC. In benchmarks where some fixed amount of work should be done as fast as possible low CPU usage is not a good sign, it just means some cores were idle when they could really

Re: Thoughts from newcommer

2017-04-18 Thread Guillaume Piolat via Digitalmars-d
On Tuesday, 18 April 2017 at 07:22:29 UTC, thedeemon wrote: In benchmarks where some fixed amount of work should be done as fast as possible low CPU usage is not a good sign, it just means some cores were idle when they could really be working. Minor note: sometimes high CPU usage isn't good

Re: Thoughts from newcommer

2017-04-18 Thread thedeemon via Digitalmars-d
On Tuesday, 18 April 2017 at 02:57:59 UTC, prdan wrote: I've written multi-threaded regex-redux benchmark for D language and made some tests. Nice! Rust version 1.16 (newest stable) GCC ver 4.9.2 (newest debian 8 stable) Which compiler did you use for D? C was the fastest (1.32) but used

Re: Thoughts from newcommer

2017-04-18 Thread Shachar Shemesh via Digitalmars-d
D would have the ability to have a nice container that would do RAII (for classes since for structs, __dtors are called automatically) That's just it, though. They are not. Not reliably. Shachar

Re: Thoughts from newcommer

2017-04-17 Thread Jerry via Digitalmars-d
On Monday, 17 April 2017 at 22:44:52 UTC, Stanislav Blinov wrote: On Monday, 17 April 2017 at 21:20:42 UTC, Jerry wrote: So what happens when the resource outlives the object's lifetime. Then RAII rule is violated. That's exactly what is happening when you are using the garbage collector.

Re: Thoughts from newcommer

2017-04-17 Thread prdan via Digitalmars-d
I've written multi-threaded regex-redux benchmark for D language and made some tests. This is my first program written in D, I didn't know much about D a week ago. Here are the results for other languages: http://benchmarksgame.alioth.debian.org/u64q/regexredux.html I have newer CPU than one

Re: Thoughts from newcommer

2017-04-17 Thread Stanislav Blinov via Digitalmars-d
On Monday, 17 April 2017 at 21:20:42 UTC, Jerry wrote: So what happens when the resource outlives the object's lifetime. Then RAII rule is violated. That's exactly what is happening when you are using the garbage collector. Correction, that is what *may* happen in some cases when you are

Re: Thoughts from newcommer

2017-04-17 Thread Jerry via Digitalmars-d
On Monday, 17 April 2017 at 16:06:20 UTC, Stanislav Blinov wrote: On Monday, 17 April 2017 at 15:24:26 UTC, Jerry wrote: It has everything to do with @nogc, if it isn't @nogc then it is using the garbage collector and even if it is using Destroy() it is still invoking the GC and something is

Re: Thoughts from newcommer

2017-04-17 Thread jmh530 via Digitalmars-d
On Monday, 17 April 2017 at 16:06:20 UTC, Stanislav Blinov wrote: Yes, std.container does need quite a bit of love. That doesn't mean that D doesn't have RAII or that it's RAII support is somehow deficient. Of course the reason it doesn't get more love is well-known here. Walter and Andrei

Re: Thoughts from newcommer

2017-04-17 Thread Stanislav Blinov via Digitalmars-d
On Monday, 17 April 2017 at 15:24:26 UTC, Jerry wrote: It has everything to do with @nogc, if it isn't @nogc then it is using the garbage collector and even if it is using Destroy() it is still invoking the GC and something is still going to have to be freed by the GC, even if that class is

Re: Thoughts from newcommer

2017-04-17 Thread Jerry via Digitalmars-d
On Monday, 17 April 2017 at 15:10:59 UTC, Jack Stouffer wrote: On Monday, 17 April 2017 at 02:56:00 UTC, Jerry wrote: Okay, only one container, and happens to be most simple basic one. The others aren't nogc and some of them are even classes. Not only that, Array wasn't @nogc until about a

Re: Thoughts from newcommer

2017-04-17 Thread Jack Stouffer via Digitalmars-d
On Monday, 17 April 2017 at 02:56:00 UTC, Jerry wrote: Okay, only one container, and happens to be most simple basic one. The others aren't nogc and some of them are even classes. Not only that, Array wasn't @nogc until about a month ago. No idea what you mean about goal posts. Do you mean

Re: Thoughts from newcommer

2017-04-17 Thread Jonathan M Davis via Digitalmars-d
On Monday, April 17, 2017 11:14:47 Shachar Shemesh via Digitalmars-d wrote: > scope(exit) is a much cleaner solution than a finally clause, but > not as clean as RAII. If the language supports RAII, how come > people are not using it? Well, if you're talking managing memory, most folks just use

Re: Thoughts from newcommer

2017-04-17 Thread Stanislav Blinov via Digitalmars-d
On Monday, 17 April 2017 at 11:14:47 UTC, Shachar Shemesh wrote: On Sunday, 16 April 2017 at 17:00:25 UTC, Jack Stouffer wrote: So we can say that D has buggy RAII. Claiming that D doesn't have RAII is equally false. To me, that's a basic misunderstanding of what RAII mean. RAII, to me,

Re: Thoughts from newcommer

2017-04-17 Thread Basile B. via Digitalmars-d
On Monday, 17 April 2017 at 11:14:47 UTC, Shachar Shemesh wrote: On Sunday, 16 April 2017 at 17:00:25 UTC, Jack Stouffer wrote: So we can say that D has buggy RAII. Claiming that D doesn't have RAII is equally false. To me, that's a basic misunderstanding of what RAII mean. RAII, to me,

Re: Thoughts from newcommer

2017-04-17 Thread Shachar Shemesh via Digitalmars-d
On Sunday, 16 April 2017 at 17:00:25 UTC, Jack Stouffer wrote: So we can say that D has buggy RAII. Claiming that D doesn't have RAII is equally false. To me, that's a basic misunderstanding of what RAII mean. RAII, to me, means you wrap your resource in a container, and then can just go

Re: Thoughts from newcommer

2017-04-16 Thread Jerry via Digitalmars-d
On Sunday, 16 April 2017 at 22:18:51 UTC, Jack Stouffer wrote: On Sunday, 16 April 2017 at 18:36:30 UTC, Jerry wrote: I wouldn't really call them RAII containers if they aren't @nogc Moving the goal posts again. Even still, void main() @nogc { Array!int ai; ai ~= 1;

Re: Thoughts from newcommer

2017-04-16 Thread Andrei Alexandrescu via Digitalmars-d
On 4/16/17 12:05 PM, Stefan Koch wrote: On Sunday, 16 April 2017 at 14:25:22 UTC, Andrei Alexandrescu wrote: On 4/16/17 3:50 AM, Shachar Shemesh wrote: https://issues.dlang.org/show_bug.cgi?id=14246 I'd raised the importance and urgency of this issue in the past. Walter is really overloaded

Re: Thoughts from newcommer

2017-04-16 Thread Jack Stouffer via Digitalmars-d
On Sunday, 16 April 2017 at 18:36:30 UTC, Jerry wrote: I wouldn't really call them RAII containers if they aren't @nogc Moving the goal posts again. Even still, void main() @nogc { Array!int ai; ai ~= 1; assert(ai.front == 1); ai.reserve(10); assert(ai.capacity == 10);

Re: Thoughts from newcommer

2017-04-16 Thread Jerry via Digitalmars-d
On Sunday, 16 April 2017 at 17:00:25 UTC, Jack Stouffer wrote: Semantic game. D actually has RAII. And D does have RAII containers: https://dlang.org/phobos/std_container.html I wouldn't really call them RAII containers if they aren't @nogc, and especially so if they aren't structs but

Re: Thoughts from newcommer

2017-04-16 Thread Jack Stouffer via Digitalmars-d
On Sunday, 16 April 2017 at 07:50:43 UTC, Shachar Shemesh wrote: The first is that the language does not offer any RAII containers out of the box. What it does provide is the *ability* to create RAII containers. D supports RAII, but does not actually have RAII. Semantic game. D actually has

Re: Thoughts from newcommer

2017-04-16 Thread Russel Winder via Digitalmars-d
On Sun, 2017-04-16 at 16:09 +, Isaac Gouy via Digitalmars-d wrote: > […] > I wish the D community would stop using the benchmarks game as an  > excuse. > But you have a position of great power. People look at your game and if a language isn't in it, it is assumed to be crap. You may not be

Re: Thoughts from newcommer

2017-04-16 Thread Joakim via Digitalmars-d
On Sunday, 16 April 2017 at 07:11:23 UTC, Isaac Gouy wrote: On Sunday, 16 April 2017 at 04:19:56 UTC, Joakim wrote: came out tops if I weighted time, memory, and source code size equally. Not always highest, as Free Pascal would sometimes beat it, but D usually won. You juggled the numbers

Re: Thoughts from newcommer

2017-04-16 Thread Isaac Gouy via Digitalmars-d
On Sunday, 16 April 2017 at 08:44:07 UTC, Walter Bright wrote: When anyone mentions the Compiler Shootout for the last 10 years, Isaac always pops up and says he won't put it on his site. I wish he'd just go away. I wish the D community would stop using the benchmarks game as an excuse.

Re: Thoughts from newcommer

2017-04-16 Thread Stefan Koch via Digitalmars-d
On Sunday, 16 April 2017 at 14:25:22 UTC, Andrei Alexandrescu wrote: On 4/16/17 3:50 AM, Shachar Shemesh wrote: https://issues.dlang.org/show_bug.cgi?id=14246 I'd raised the importance and urgency of this issue in the past. Walter is really overloaded for the time being. Any volunteer wants

Re: Thoughts from newcommer

2017-04-16 Thread Andrei Alexandrescu via Digitalmars-d
On 4/16/17 3:50 AM, Shachar Shemesh wrote: https://issues.dlang.org/show_bug.cgi?id=14246 I'd raised the importance and urgency of this issue in the past. Walter is really overloaded for the time being. Any volunteer wants to look into this now? -- Andrei

Re: Thoughts from newcommer

2017-04-16 Thread Walter Bright via Digitalmars-d
When anyone mentions the Compiler Shootout for the last 10 years, Isaac always pops up and says he won't put it on his site. I wish he'd just go away. On 4/16/2017 12:11 AM, Isaac Gouy wrote: On Sunday, 16 April 2017 at 04:19:56 UTC, Joakim wrote: came out tops if I weighted time, memory, and

Re: Thoughts from newcommer

2017-04-16 Thread Shachar Shemesh via Digitalmars-d
On 11/04/17 23:09, Jack Stouffer wrote: On Tuesday, 11 April 2017 at 19:57:19 UTC, Piotr Kowalski wrote: What about RAII? It's already in the language. There are two problems with that statement. The first is that the language does not offer any RAII containers out of the box. What it

Re: Thoughts from newcommer

2017-04-16 Thread Isaac Gouy via Digitalmars-d
On Sunday, 16 April 2017 at 04:19:56 UTC, Joakim wrote: came out tops if I weighted time, memory, and source code size equally. Not always highest, as Free Pascal would sometimes beat it, but D usually won. You juggled the numbers to get a result ;-) This one doesn't show any benchmarks

Re: Thoughts from newcommer

2017-04-15 Thread Joakim via Digitalmars-d
On Saturday, 15 April 2017 at 18:00:50 UTC, Isaac Gouy wrote: On Thursday, 13 April 2017 at 03:29:26 UTC, Joakim wrote: Cooperative with what? He chose not to include D anymore, which at one point dominated the shootout, and says we should just start our own site:

Re: Thoughts from newcommer

2017-04-15 Thread Isaac Gouy via Digitalmars-d
On Thursday, 13 April 2017 at 03:29:26 UTC, Joakim wrote: Cooperative with what? He chose not to include D anymore, which at one point dominated the shootout, and says we should just start our own site: https://forum.dlang.org/post/no8klt$1d1i$1...@digitalmars.com When did D dominate?

Re: Thoughts from newcommer

2017-04-13 Thread thedeemon via Digitalmars-d
On Thursday, 13 April 2017 at 08:08:04 UTC, Russel Winder wrote: It is Isaac's game, he runs it, he chooses which languages are up there. It is not an official Debian thing as far as I know. So what the problem? I think Piotr stated the problem in the original post. If a language is missing

Re: Thoughts from newcommer

2017-04-13 Thread Dejan Lekic via Digitalmars-d
On Wednesday, 12 April 2017 at 09:38:49 UTC, Russel Winder wrote: On Tue, 2017-04-11 at 20:07 +, Stefan Koch via Digitalmars-d wrote: […] At the risk of starting a flame war: The memory safety is currently in the works. We just have one std-lib now. GC is slow, yes. I don't care, it

Re: Thoughts from newcommer

2017-04-13 Thread Russel Winder via Digitalmars-d
On Wed, 2017-04-12 at 19:31 +, thedeemon via Digitalmars-d wrote: > On Tuesday, 11 April 2017 at 19:57:19 UTC, Piotr Kowalski wrote: > > > http://benchmarksgame.alioth.debian.org/ > > > > Why D is not there? > > Because maintainer of that site doesn't want D there, as I  > remember from

Re: Thoughts from newcommer

2017-04-12 Thread Joakim via Digitalmars-d
On Wednesday, 12 April 2017 at 19:37:06 UTC, qznc wrote: On Wednesday, 12 April 2017 at 19:31:06 UTC, thedeemon wrote: On Tuesday, 11 April 2017 at 19:57:19 UTC, Piotr Kowalski wrote: http://benchmarksgame.alioth.debian.org/ Why D is not there? Because maintainer of that site doesn't want

Re: Thoughts from newcommer

2017-04-12 Thread qznc via Digitalmars-d
On Wednesday, 12 April 2017 at 19:31:06 UTC, thedeemon wrote: On Tuesday, 11 April 2017 at 19:57:19 UTC, Piotr Kowalski wrote: http://benchmarksgame.alioth.debian.org/ Why D is not there? Because maintainer of that site doesn't want D there, as I remember from previous discussions. At some

Re: Thoughts from newcommer

2017-04-12 Thread thedeemon via Digitalmars-d
On Tuesday, 11 April 2017 at 19:57:19 UTC, Piotr Kowalski wrote: http://benchmarksgame.alioth.debian.org/ Why D is not there? Because maintainer of that site doesn't want D there, as I remember from previous discussions. At some point (years ago) D was present there, then removed. C and

Re: Thoughts from newcommer

2017-04-12 Thread Russel Winder via Digitalmars-d
On Tue, 2017-04-11 at 20:07 +, Stefan Koch via Digitalmars-d wrote: > […] At the risk of starting a flame war: > > The memory safety is currently in the works. > We just have one std-lib now. > GC is slow, yes. I don't care, it doesn't impact the programs I write, and the GC means I can be

Re: Thoughts from newcommer

2017-04-12 Thread Russel Winder via Digitalmars-d
On Tue, 2017-04-11 at 19:57 +, Piotr Kowalski via Digitalmars-d wrote: > Hello D community, > > I am language polyglot that lately got interested in D. I love  > it, it's very elegant language, so simple and so powerful same  > time. I will write some thoughts as outsider. > > […] If do

Re: Thoughts from newcommer

2017-04-11 Thread Piotr Kowalski via Digitalmars-d
On Tuesday, 11 April 2017 at 21:06:28 UTC, Jack Stouffer wrote: On Tuesday, 11 April 2017 at 20:48:13 UTC, Piotr Kowalski wrote: Is it in std already? How do I allocate equivalent of std::vector on heap with RAII in D that will be disposed at the end of the scope automatically? You're asking

Re: Thoughts from newcommer

2017-04-11 Thread qznc via Digitalmars-d
On Tuesday, 11 April 2017 at 19:57:19 UTC, Piotr Kowalski wrote: Two other important things to change people minds about D performance: http://benchmarksgame.alioth.debian.org/ Why D is not there? I worked on that [0] and decided its not worth it. It is literally a "game". You can have

Re: Thoughts from newcommer

2017-04-11 Thread Jack Stouffer via Digitalmars-d
On Tuesday, 11 April 2017 at 20:48:13 UTC, Piotr Kowalski wrote: Is it in std already? How do I allocate equivalent of std::vector on heap with RAII in D that will be disposed at the end of the scope automatically? You're asking about two different things here. RAII is already in the

Re: Thoughts from newcommer

2017-04-11 Thread Eugene Wissner via Digitalmars-d
On Tuesday, 11 April 2017 at 20:48:13 UTC, Piotr Kowalski wrote: (All gc-ed langauges recommend static preallocation :P) ;) Thanks for replying. https://wiki.dlang.org/Vision/2017H1 Thanks, I have read that already, that's why I've asked about longer term. What about RAII? It's

Re: Thoughts from newcommer

2017-04-11 Thread Piotr Kowalski via Digitalmars-d
(All gc-ed langauges recommend static preallocation :P) ;) Thanks for replying. https://wiki.dlang.org/Vision/2017H1 Thanks, I have read that already, that's why I've asked about longer term. What about RAII? It's already in the language. Is it in std already? How do I allocate

Re: Thoughts from newcommer

2017-04-11 Thread Jack Stouffer via Digitalmars-d
On Tuesday, 11 April 2017 at 19:57:19 UTC, Piotr Kowalski wrote: The only discussion I remember about D was that it had two standard libraries and there were no consensus on which to use and that it uses GC so it's slow. It seems it's impossible to completely shrug off past impressions. The

Re: Thoughts from newcommer

2017-04-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 April 2017 at 19:57:19 UTC, Piotr Kowalski wrote: Hello D community, I am language polyglot that lately got interested in D. I love it, it's very elegant language, so simple and so powerful same time. I will write some thoughts as outsider. The reason I am looking at D in

Thoughts from newcommer

2017-04-11 Thread Piotr Kowalski via Digitalmars-d
Hello D community, I am language polyglot that lately got interested in D. I love it, it's very elegant language, so simple and so powerful same time. I will write some thoughts as outsider. The reason I am looking at D in 2017 is that D it's almost nonexistent on popular sites for