Re: Help optimizing code?

2018-01-01 Thread Uknown via Digitalmars-d-learn
On Tuesday, 2 January 2018 at 07:17:23 UTC, Uknown wrote: [snip] 0. Use LDC. It is significantly faster. 1. Utilize the fact that the Mandelbrot set is symmetric about the X axis.You can half the time taken. 2. Use std.parallelism for using multiple cores on the CPU 3. Use @fastmath of LDC 4.

Re: Help optimizing code?

2018-01-01 Thread Uknown via Digitalmars-d-learn
On Monday, 1 January 2018 at 15:09:53 UTC, Lily wrote: I started learning D a few days ago, coming from some very basic C++ knowledge, and I'd like some help getting a program to run faster. The code is here: https://github.com/IndigoLily/D-mandelbrot/blob/master/mandelbrot.d Right now it

Re: Is there a way to call scope guard without throw exception?

2018-01-01 Thread ChangLong via Digitalmars-d
On Monday, 1 January 2018 at 03:06:42 UTC, David Nadlinger wrote: On Saturday, 30 December 2017 at 13:48:16 UTC, ChangLong wrote: After fiber yield, the spoke guard is not able to execute, unless I throw a exception in Fiber. I am look if there is some hack method to make the fiber

[Issue 18146] A case expression of final switch allows to pass wrong enum value

2018-01-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18146 ARAI Kohei changed: What|Removed |Added Status|NEW |RESOLVED

Re: Maybe D is right about GC after all !

2018-01-01 Thread codephantom via Digitalmars-d
On Tuesday, 2 January 2018 at 00:34:57 UTC, Nerve wrote: I would simply add that the strongest vocalizations come from those with objections. The silent majority that is perfectly okay with GC and gets huge development complexity reductions thanks to it rarely spare the energy to argue

[Issue 17630] selective imports find symbols in private imports of other modules

2018-01-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17630 --- Comment #4 from Seb --- There is/was an open PR to fix this by Kenji: https://github.com/dlang/dmd/pull/3416 --

Re: structs inheriting from and implementing interfaces

2018-01-01 Thread rjframe via Digitalmars-d-learn
On Tue, 02 Jan 2018 00:54:13 +, Laeeth Isharc wrote: > On Friday, 29 December 2017 at 12:59:21 UTC, rjframe wrote: >> On Fri, 29 Dec 2017 12:39:25 +, Nicholas Wilson wrote: >> >> I've actually thought about doing this to get rid of a bunch of if >> qualifiers in my function declarations.

Re: Super Simple GUI Library

2018-01-01 Thread Martin Nowak via Digitalmars-d-announce
On Tuesday, 2 January 2018 at 02:06:00 UTC, Ivan Trombley wrote: For now, app.d has an example in the doc comments. I'll be adding more examples to the doc comments. Generating documentation is as simple as `dub build -b ddox` btw. See https://github.com/MartinNowak/bloom for an example on how

Re: Super Simple GUI Library

2018-01-01 Thread Ivan Trombley via Digitalmars-d-announce
On Monday, 1 January 2018 at 23:38:45 UTC, Anton Pastukhov wrote: Hi, it would be nice to see some more info. Screenshots, docs etc. Right now there is just another github repo without single example. For now, app.d has an example in the doc comments. I'll be adding more examples to the doc

Re: D downloads

2018-01-01 Thread Laeeth Isharc via Digitalmars-d
On Saturday, 30 December 2017 at 00:14:45 UTC, codephantom wrote: On Saturday, 23 December 2017 at 21:04:52 UTC, Laeeth Isharc wrote: http://erdani.com/d/downloads.daily.png Bad data, one off spike, or something else?

Re: D downloads

2018-01-01 Thread Laeeth Isharc via Digitalmars-d
On Thursday, 28 December 2017 at 22:02:16 UTC, Walter Bright wrote: On 12/24/2017 7:33 AM, Laeeth Isharc wrote: (The first person to receive Bitcoin was Hal Finney, a prominent member of both the extropians and cypherpunks lists). Hal was in the dorm room next to mine when I was a freshman. He

Re: structs inheriting from and implementing interfaces

2018-01-01 Thread Meta via Digitalmars-d-learn
On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin wrote: In C#, structs can inherit from and implement interfaces. using System; interface IPrint { void Print(); } struct MyStruct : IPrint { public void Print() { Console.WriteLine(ToString()); } } public

Re: Maybe D is right about GC after all !

2018-01-01 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, January 02, 2018 00:34:57 Nerve via Digitalmars-d wrote: > On Tuesday, 19 December 2017 at 09:54:05 UTC, Walter Bright wrote: > > "C, Python, Go, and the Generalized Greenspun Law" > > > > http://esr.ibiblio.org/?p=7804 > > I would simply add that the strongest vocalizations come from

[Issue 14660] std.range.choose() is not CTFE'able

2018-01-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14660 --- Comment #4 from Ali Ak --- Sweet! Thanks! --

Re: structs inheriting from and implementing interfaces

2018-01-01 Thread Laeeth Isharc via Digitalmars-d-learn
On Friday, 29 December 2017 at 12:59:21 UTC, rjframe wrote: On Fri, 29 Dec 2017 12:39:25 +, Nicholas Wilson wrote: On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin wrote: The problem is that interfaces are a runtime thing (e.g. you can cast a class to an interface) structs

Re: Maybe D is right about GC after all !

2018-01-01 Thread Nerve via Digitalmars-d
On Tuesday, 19 December 2017 at 09:54:05 UTC, Walter Bright wrote: "C, Python, Go, and the Generalized Greenspun Law" http://esr.ibiblio.org/?p=7804 I would simply add that the strongest vocalizations come from those with objections. The silent majority that is perfectly okay with GC and

Re: Super Simple GUI Library

2018-01-01 Thread Anton Pastukhov via Digitalmars-d-announce
On Monday, 1 January 2018 at 01:57:13 UTC, Ivan Trombley wrote: I started a new GUI library project (for various reasons) base on SDL2. It's pretty basic at the moment but I created a github repository so that I can hopefully get some feedback on it. What is currently present: - App: an

[Issue 14660] std.range.choose() is not CTFE'able

2018-01-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14660 Seb changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 14660] std.range.choose() is not CTFE'able

2018-01-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14660 Ali Ak changed: What|Removed |Added CC||ali.akhtarz...@gmail.com

Re: Lazily parse a JSON text file using stdx.data.json?

2018-01-01 Thread David Gileadi via Digitalmars-d
On 12/30/17 8:16 PM, Marco Leise wrote: There is also the JSON parser from https://github.com/mleise/fast if you need to parse 2x faster than RapidJSON ;) Nice, I'll take a look. My original post was mainly to express how surprised I was that one of D's front-page features was, for me,

Re: Cannot confirm that a DigitalMars order has been received

2018-01-01 Thread Walter Bright via Digitalmars-d
On 1/1/2018 6:42 AM, Dennis wrote: On Friday, 24 November 2017 at 22:34:53 UTC, Walter Bright wrote: It should be in your email inbox by now. I review purchases manually, because of occasional attempts to manipulate the shopping cart. Sorry about the delay. I don't like bumping this topic,

Re: static if and early exit from function doesn't seem to work?

2018-01-01 Thread aliak via Digitalmars-d-learn
On Sunday, 31 December 2017 at 13:47:32 UTC, Adam D. Ruppe wrote: On Sunday, 31 December 2017 at 13:32:03 UTC, aliak wrote: So it seems it tries to compile the statements below the check on V.length even though it's guaranteed to be true and there's a return statement inside the if. Yeah,

Re: How do you safely deal with range.front?

2018-01-01 Thread aliak via Digitalmars-d-learn
On Monday, 1 January 2018 at 02:18:36 UTC, Jonathan M Davis wrote: Except that the reason for arrays throwing RangeErrors when you try and index them out-of-bounds is to avoid memory safety issues, which is not necessarily the case at all when you're talking about ranges. Having ranges in

Re: What don't you switch to GitHub issues

2018-01-01 Thread Pjotr Prins via Digitalmars-d
On Monday, 1 January 2018 at 02:02:03 UTC, rjframe wrote: That's probably not the best method of effecting change. It killed off the discussion nicely, indeed. I am just going to share my thoughts a little. Github, in my opinion, is hype and even though I depend on it today, I am trying to

Re: How do you safely deal with range.front?

2018-01-01 Thread aliak via Digitalmars-d-learn
On Monday, 1 January 2018 at 04:18:29 UTC, Ali Çehreli wrote: If you're fine with specifying the function as a template argument, the following works. (As seen with 's => s.foo()' below, you have to use a lambda for member functions anyway.) Ali Nice! Thanks :) And I think your usage for

Re: What do you want to see for a mature DLang?

2018-01-01 Thread IM via Digitalmars-d
On Sunday, 31 December 2017 at 21:16:35 UTC, Walter Bright wrote: On 12/31/2017 8:18 AM, IM wrote: What do you think? Do you agree that a process is needed? We've tried adding process before. It does not work, for the simple reason that it requires a dedicated group of people to dedicate

Re: std.file and non-English filename in Windows

2018-01-01 Thread tipdbmp via Digitalmars-d-learn
I think you have to decode your input to UTF-8. stdin .byLineCopy(No.keepTerminator) .each!((string file_name_raw) { // change Latin1String to the code page of your console; // use the 'chcp' command to see the current code page of your console // import std.encoding; auto

Does UDA not work for enums?

2018-01-01 Thread Marc via Digitalmars-d-learn
I got compilers errors from this: enum E { @("foo") A, @("baa") B } I got: Error: basic type expected, not @ Error: no identifier for declarator _error_ Error: type only allowed if anonymous enum and no enum type Error: if type, there must be an initializer

Re: Does UDA not work for enums?

2018-01-01 Thread Seb via Digitalmars-d-learn
On Monday, 1 January 2018 at 17:15:24 UTC, Marc wrote: I got compilers errors from this: enum E { @("foo") A, @("baa") B } I got: Error: basic type expected, not @ Error: no identifier for declarator _error_ Error: type only allowed if anonymous enum and no

Re: std.file and non-English filename in Windows

2018-01-01 Thread Domain via Digitalmars-d-learn
On Monday, 1 January 2018 at 16:13:06 UTC, Domain wrote: On Monday, 1 January 2018 at 12:33:27 UTC, John Chapman wrote: On Sunday, 31 December 2017 at 18:21:29 UTC, Domain wrote: In Windows, exists, rename, copy will report file not exists when you input non-English filename, such as Chinese

Re: Help optimizing code?

2018-01-01 Thread Muld via Digitalmars-d-learn
On Monday, 1 January 2018 at 16:47:40 UTC, Adam D. Ruppe wrote: On Monday, 1 January 2018 at 16:13:37 UTC, Muld wrote: If you use .ptr then you get zero detection, even in debug builds. It is limited to the one expression where you wrote it, instead of on the ENTIRE program like the build

Re: Help optimizing code?

2018-01-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 1 January 2018 at 16:13:37 UTC, Muld wrote: If you use .ptr then you get zero detection, even in debug builds. It is limited to the one expression where you wrote it, instead of on the ENTIRE program like the build switches do. It is a lot easier to check correctness in an

Re: std.file and non-English filename in Windows

2018-01-01 Thread Domain via Digitalmars-d-learn
On Monday, 1 January 2018 at 12:33:27 UTC, John Chapman wrote: On Sunday, 31 December 2017 at 18:21:29 UTC, Domain wrote: In Windows, exists, rename, copy will report file not exists when you input non-English filename, such as Chinese 中文.txt Works for me. I created a file with the name

Re: Help optimizing code?

2018-01-01 Thread Muld via Digitalmars-d-learn
On Monday, 1 January 2018 at 15:54:33 UTC, Adam D. Ruppe wrote: On Monday, 1 January 2018 at 15:29:28 UTC, user1234 wrote: dmd mandelbrot.d -O -release -inline -boundscheck=off -O and -inline are OK, but -release and -boundscheck are harmful and shouldn't be used. Yeah, you can squeeze a

Re: Help optimizing code?

2018-01-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 1 January 2018 at 15:29:28 UTC, user1234 wrote: dmd mandelbrot.d -O -release -inline -boundscheck=off -O and -inline are OK, but -release and -boundscheck are harmful and shouldn't be used. Yeah, you can squeeze a bit of speed out of them, but there's another way to do it -

[Issue 18150] dmd segfault on classinfo.create

2018-01-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18150 Basile B. changed: What|Removed |Added CC||b2.t...@gmx.com

Re: Help optimizing code?

2018-01-01 Thread user1234 via Digitalmars-d-learn
On Monday, 1 January 2018 at 15:23:19 UTC, Adam D. Ruppe wrote: On Monday, 1 January 2018 at 15:09:53 UTC, Lily wrote: I started learning D a few days ago, coming from some very basic C++ knowledge, and I'd like some help getting a program to run faster. So a few easy things you can do: 1)

Re: Help optimizing code?

2018-01-01 Thread user1234 via Digitalmars-d-learn
On Monday, 1 January 2018 at 15:09:53 UTC, Lily wrote: I started learning D a few days ago, coming from some very basic C++ knowledge, and I'd like some help getting a program to run faster. The code is here: https://github.com/IndigoLily/D-mandelbrot/blob/master/mandelbrot.d Right now it

[Issue 18150] New: dmd segfault on classinfo.create

2018-01-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18150 Issue ID: 18150 Summary: dmd segfault on classinfo.create Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: minor Priority:

Re: Help optimizing code?

2018-01-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 1 January 2018 at 15:09:53 UTC, Lily wrote: I started learning D a few days ago, coming from some very basic C++ knowledge, and I'd like some help getting a program to run faster. So a few easy things you can do: 1) use `float` instead of `real`. real sucks, it is really slow and

Help optimizing code?

2018-01-01 Thread Lily via Digitalmars-d-learn
I started learning D a few days ago, coming from some very basic C++ knowledge, and I'd like some help getting a program to run faster. The code is here: https://github.com/IndigoLily/D-mandelbrot/blob/master/mandelbrot.d Right now it runs slower than my JavaScript Mandelbrot renderer on the

Re: Developing blockchain software with D, not C++

2018-01-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 January 2018 at 13:34:39 UTC, aberba wrote: On Monday, 1 January 2018 at 12:24:29 UTC, Ola Fosheim Grøstad wrote: On Monday, 1 January 2018 at 11:24:45 UTC, Ola Fosheim Grøstad wrote: [...] Btw, I think one should be very sceptical of such presentations in general: [...]

Re: Cannot confirm that a DigitalMars order has been received

2018-01-01 Thread Dennis via Digitalmars-d
On Friday, 24 November 2017 at 22:34:53 UTC, Walter Bright wrote: It should be in your email inbox by now. I review purchases manually, because of occasional attempts to manipulate the shopping cart. Sorry about the delay. I don't like bumping this topic, but I have the same issue. I ordered

Re: Developing blockchain software with D, not C++

2018-01-01 Thread aberba via Digitalmars-d
On Monday, 1 January 2018 at 12:24:29 UTC, Ola Fosheim Grøstad wrote: On Monday, 1 January 2018 at 11:24:45 UTC, Ola Fosheim Grøstad wrote: [...] Btw, I think one should be very sceptical of such presentations in general: [...] Come on! Ada?

Re: Finding unsafe line of code

2018-01-01 Thread Vino via Digitalmars-d-learn
On Friday, 29 December 2017 at 10:33:16 UTC, Johan Engelen wrote: On Friday, 29 December 2017 at 10:23:24 UTC, codephantom wrote: On Friday, 29 December 2017 at 09:38:50 UTC, Vino wrote: Let me re-frame the question with an example, as the Dsafe the below line of code is considered as

Re: D as a betterC a game changer ?

2018-01-01 Thread Russel Winder via Digitalmars-d
On Sun, 2017-12-31 at 17:32 +, Ola Fosheim Grøstad via Digitalmars- d wrote: > […] > I'd love to, but I haven't found the specific paper. She seems to > work on many different things related to software design and > visual tooling. I'll email her and get the best start point citation for

Re: std.file and non-English filename in Windows

2018-01-01 Thread John Chapman via Digitalmars-d-learn
On Sunday, 31 December 2017 at 18:21:29 UTC, Domain wrote: In Windows, exists, rename, copy will report file not exists when you input non-English filename, such as Chinese 中文.txt Works for me. I created a file with the name "中文.txt" and std.file.exists returned true. Is your D source file

Re: Developing blockchain software with D, not C++

2018-01-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 January 2018 at 11:24:45 UTC, Ola Fosheim Grøstad wrote: I am not arguing with their choice, but it was for a C++ conference, so obviously they would praise C++… Btw, I think one should be very sceptical of such presentations in general: 1. They are there to market their

[Issue 17508] optlink 8.00.17 crash at EIP=0040F60A

2018-01-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17508 computermatro...@gmail.com changed: What|Removed |Added CC|

Re: std.file and non-English filename in Windows

2018-01-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, January 01, 2018 10:47:51 Patrick Schluter via Digitalmars-d- learn wrote: > On Sunday, 31 December 2017 at 18:21:29 UTC, Domain wrote: > > In Windows, exists, rename, copy will report file not exists > > when you input non-English filename, such as Chinese 中文.txt > > It's unclear what

Re: Developing blockchain software with D, not C++

2018-01-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 January 2018 at 10:46:23 UTC, aberba wrote: On Sunday, 31 December 2017 at 09:45:52 UTC, Ola Fosheim Grøstad wrote: On Saturday, 30 December 2017 at 16:59:41 UTC, aberba wrote: Besides, D maturity (which I can't confirm or deny), what else does D miss to be considered a better

Re: Slices and Dynamic Arrays

2018-01-01 Thread Seb via Digitalmars-d-learn
On Monday, 1 January 2018 at 02:10:14 UTC, Jonathan M Davis wrote: On Sunday, December 31, 2017 14:49:40 Tony via Digitalmars-d-learn wrote: On Sunday, 31 December 2017 at 14:24:40 UTC, Jonathan M Davis wrote: > [...] The DLang Tour also uses the term slice to refer to T[]. "The type of arr

Re: Developing blockchain software with D, not C++

2018-01-01 Thread aberba via Digitalmars-d
On Sunday, 31 December 2017 at 10:58:09 UTC, Joakim wrote: On Saturday, 30 December 2017 at 16:59:41 UTC, aberba wrote: In this video[1] from 2016, developer talks about C++ memory safety features, meta-programming, maturity and few others as main reasons they choose it for developing their

Re: Developing blockchain software with D, not C++

2018-01-01 Thread aberba via Digitalmars-d
On Sunday, 31 December 2017 at 09:45:52 UTC, Ola Fosheim Grøstad wrote: On Saturday, 30 December 2017 at 16:59:41 UTC, aberba wrote: Besides, D maturity (which I can't confirm or deny), what else does D miss to be considered a better alternative for blockchain in 2018? You can write

Re: std.file and non-English filename in Windows

2018-01-01 Thread Patrick Schluter via Digitalmars-d-learn
On Sunday, 31 December 2017 at 18:21:29 UTC, Domain wrote: In Windows, exists, rename, copy will report file not exists when you input non-English filename, such as Chinese 中文.txt It's unclear what your problem is but here a wild guess. Windows API's for Unicode use UTF-16 as far as I know.

Re: Maybe D is right about GC after all !

2018-01-01 Thread lobo via Digitalmars-d
On Monday, 1 January 2018 at 05:29:06 UTC, Ali wrote: On Tuesday, 19 December 2017 at 09:54:05 UTC, Walter Bright wrote: "C, Python, Go, and the Generalized Greenspun Law" http://esr.ibiblio.org/?p=7804 So .. and this is more of a question, to the maintainers and creators of D, what does