Re: how to build DSFMLC ?

2018-08-24 Thread Flaze07 via Digitalmars-d-learn
On Sunday, 19 August 2018 at 08:57:05 UTC, Flaze07 wrote: I keep having the same problem with building DSFMLC https://ibb.co/edRStK for anyone having the same problem, I found the solution in another thread. You have to use MinGW32 bit version if you use mingw, as for visual C++, I think

Cross compile windows programs on linux

2018-08-24 Thread John Burton via Digitalmars-d-learn
Is in the subject. Are there any cross compilers that will run on a linux system but compile D code using Win32 into a windows .exe file, preferably 64 bit? I can find hints of cross compilers but not really seen anything packaged up?

Re: Fast OpenGL-based visualization engine mainly for animated two-dimensional graphs

2018-08-24 Thread Per Nordlöw via Digitalmars-d-learn
On Friday, 24 August 2018 at 14:03:08 UTC, drug wrote: imgui, but now I'm replacing it by nuklear. Is nuklear a software project that can be found somewhere?

Patterns to avoid GC with capturing closures?

2018-08-24 Thread Peter Alexander via Digitalmars-d-learn
Consider this code, which is used as an example only: auto scaleAll(int[] xs, int m) { return xs.map!(x => m * x); } As m is captured, the delegate for map will rightly allocate the closure in the GC heap. In C++, you would write the lambda to capture m by value, but this is not a

Re: Fast OpenGL-based visualization engine mainly for animated two-dimensional graphs

2018-08-24 Thread drug via Digitalmars-d-learn
24.08.2018 16:32, Per Nordlöw пишет: Is anybody working on a D-based really fast OpenGL-based visualization engine that supports tessellation of 2d primitives on the GPU? For instance, if I want to animate a huge amount of circles (in a 2d-graph) and I would like to only have to send an array

Re: Patterns to avoid GC with capturing closures?

2018-08-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/24/18 11:18 AM, Peter Alexander wrote: Consider this code, which is used as an example only: auto scaleAll(int[] xs, int m) {   return xs.map!(x => m * x); } As m is captured, the delegate for map will rightly allocate the closure in the GC heap. In C++, you would write the lambda to

Parallelizing factorial computation

2018-08-24 Thread Uknown via Digitalmars-d-learn
I was messing and tried comparing the performance of different ways to compute the factorial of a number. Here's the benchmark results: recursive: 244 ms, 283 μs, and 2 hnsecs loop: 241 ms, 412 μs, and 3 hnsecs parallel: 1 sec, 784 ms, 829 μs, and 5 hnsecs

Fast OpenGL-based visualization engine mainly for animated two-dimensional graphs

2018-08-24 Thread Per Nordlöw via Digitalmars-d-learn
Is anybody working on a D-based really fast OpenGL-based visualization engine that supports tessellation of 2d primitives on the GPU? For instance, if I want to animate a huge amount of circles (in a 2d-graph) and I would like to only have to send an array of centers and radiuses and

Re: Fast OpenGL-based visualization engine mainly for animated two-dimensional graphs

2018-08-24 Thread Per Nordlöw via Digitalmars-d-learn
On Friday, 24 August 2018 at 14:34:46 UTC, Per Nordlöw wrote: On Friday, 24 August 2018 at 14:03:08 UTC, drug wrote: imgui, but now I'm replacing it by nuklear. Is nuklear a software project that can be found somewhere? Ahh, I presume you mean - https://github.com/vurtun/nuklear -

Re: Cross compile windows programs on linux

2018-08-24 Thread kinke via Digitalmars-d-learn
On Friday, 24 August 2018 at 13:10:40 UTC, John Burton wrote: Is in the subject. Are there any cross compilers that will run on a linux system but compile D code using Win32 into a windows .exe file, preferably 64 bit? I can find hints of cross compilers but not really seen anything packaged

Re: Cross compile windows programs on linux

2018-08-24 Thread Radu via Digitalmars-d-learn
On Friday, 24 August 2018 at 16:30:56 UTC, John Burton wrote: On Friday, 24 August 2018 at 15:26:30 UTC, kinke wrote: On Friday, 24 August 2018 at 13:10:40 UTC, John Burton wrote: Is in the subject. Are there any cross compilers that will run on a linux system but compile D code using Win32

Re: Fast OpenGL-based visualization engine mainly for animated two-dimensional graphs

2018-08-24 Thread drug via Digitalmars-d-learn
24.08.2018 17:38, Per Nordlöw пишет: On Friday, 24 August 2018 at 14:34:46 UTC, Per Nordlöw wrote: On Friday, 24 August 2018 at 14:03:08 UTC, drug wrote: imgui, but now I'm replacing it by nuklear. Is nuklear a software project that can be found somewhere? Ahh, I presume you mean -

Re: How to best implement a DSL?

2018-08-24 Thread Matthew OConnor via Digitalmars-d-learn
On Saturday, 28 July 2018 at 17:01:22 UTC, rikki cattermole wrote: You missed my point here. There is nothing special about parsing at CTFE, you're just restricted as to the language features you can use (e.g. no extern's), that's it. Is there an example of how this could be done?

"The D Way" to run a sequence of executables?

2018-08-24 Thread Matthew OConnor via Digitalmars-d-learn
I'd like to run a sequence of executables with something like std.process.execute, but I would like the sequence to error out if one of the executables returns a non-zero return code. What is the recommended way to do this? A wrapper that throws exceptions? Checking return values?

Re: Cross compile windows programs on linux

2018-08-24 Thread John Burton via Digitalmars-d-learn
On Friday, 24 August 2018 at 15:26:30 UTC, kinke wrote: On Friday, 24 August 2018 at 13:10:40 UTC, John Burton wrote: Is in the subject. Are there any cross compilers that will run on a linux system but compile D code using Win32 into a windows .exe file, preferably 64 bit? I can find hints of

Re: Parallelizing factorial computation

2018-08-24 Thread Peter Alexander via Digitalmars-d-learn
On Friday, 24 August 2018 at 13:04:47 UTC, Uknown wrote: I was quite surprised by the fact that parallel ran so much slower than recursive and loop implementations. Does anyone know why? n = 100 is too small to see parallelism gains. Try n = 1 https://run.dlang.io/is/XDZTSd

Re: Cross compile windows programs on linux

2018-08-24 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-learn
On 08/24/2018 12:30 PM, John Burton wrote: On Friday, 24 August 2018 at 15:26:30 UTC, kinke wrote: On Friday, 24 August 2018 at 13:10:40 UTC, John Burton wrote: Is in the subject. Are there any cross compilers that will run on a linux system but compile D code using Win32 into a windows .exe

Re: Cross compile windows programs on linux

2018-08-24 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, August 24, 2018 3:28:37 PM MDT Nick Sabalausky (Abscissa) via Digitalmars-d-learn wrote: > On 08/24/2018 12:30 PM, John Burton wrote: > > On Friday, 24 August 2018 at 15:26:30 UTC, kinke wrote: > >> On Friday, 24 August 2018 at 13:10:40 UTC, John Burton wrote: > >>> Is in the subject.

Re: "The D Way" to run a sequence of executables?

2018-08-24 Thread Chris M. via Digitalmars-d-learn
On Friday, 24 August 2018 at 17:36:25 UTC, Matthew OConnor wrote: I'd like to run a sequence of executables with something like std.process.execute, but I would like the sequence to error out if one of the executables returns a non-zero return code. What is the recommended way to do this? A

Re: Patterns to avoid GC with capturing closures?

2018-08-24 Thread Paul Backus via Digitalmars-d-learn
On Friday, 24 August 2018 at 15:18:13 UTC, Peter Alexander wrote: I can write scaleAll like this: auto scaleAll(int[] xs, int m) @nogc { return repeat(m).zip(xs).map!(mx => mx[0] * mx[1]); } So that repeat(m) stores m, but it is quite hacky to work like this. Here's a spoonful of sugar to

Re: "The D Way" to run a sequence of executables?

2018-08-24 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, August 24, 2018 11:36:25 AM MDT Matthew OConnor via Digitalmars- d-learn wrote: > I'd like to run a sequence of executables with something like > std.process.execute, but I would like the sequence to error out > if one of the executables returns a non-zero return code. What is > the

Re: Parallelizing factorial computation

2018-08-24 Thread Uknown via Digitalmars-d-learn
On Friday, 24 August 2018 at 20:43:46 UTC, Peter Alexander wrote: On Friday, 24 August 2018 at 13:04:47 UTC, Uknown wrote: I was quite surprised by the fact that parallel ran so much slower than recursive and loop implementations. Does anyone know why? n = 100 is too small to see parallelism

Get max elemenr over RegexMatch

2018-08-24 Thread Andrey via Digitalmars-d-learn
Hello, This code produces an error: auto matches = content.matchAll(pattern); auto max = matches.maxElement!"a => a.back.to!uint"(); I have a RegexMatch array like: [["text1234", "1234"], ["zxs432fff", "432"], ["text000_", "000"]] Max element here is 1234. I apply map function "a =>

Re: Get max elemenr over RegexMatch

2018-08-24 Thread ag0aep6g via Digitalmars-d-learn
On 08/24/2018 01:13 PM, Andrey wrote: This code produces an error: auto matches = content.matchAll(pattern); auto max = matches.maxElement!"a => a.back.to!uint"(); You're mixing two different notations. It's either matches.maxElement!(a => a.back.to!uint)() or