Re: On Concurrency

2014-04-25 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2014-04-25 at 17:10 +, Kagamin via Digitalmars-d-learn wrote: Fibers are more lightweight, they're not kernel objects. Threads are scheduled by kernel (usually). Fibers are better if you can get better resource usage with manual scheduling - less context switches, or don't want

enums

2014-05-30 Thread Russel Winder via Digitalmars-d-learn
I think I have no idea what D enums are about. Bearophile's example of some code in an email on another thread uses: enum double p0 = 0.0045; Now I would have written: immutable double p0 = 0.0045; or at the very worst: const double p0 = 0.0045; For me, enum means

Re: Different random shuffles generated when compiled with gdc than with dmd

2014-05-31 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2014-05-30 at 16:44 +, Andrew Brown via Digitalmars-d-learn wrote: GDC version 4.8.2,i guess that's my problem. This is what happens when you let Ubuntu look after your packages. Debian Sid has GCC 4.9 packages, but that may not help? -- Russel.

Re: What is best way to communicate between computer in local network ?

2014-06-28 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-06-28 at 16:21 +, John Colvin via Digitalmars-d-learn wrote: An MPI backend for std.concurrency would be a game-changer for D in certain scientific circles. Pragmatically, I think this would be a good idea… Note: I don't have much love for MPI, but it's the only practical

Re: Emacs d-mode cannot handle backquoted backslashe

2014-07-31 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2014-07-31 at 08:40 +, Nordlöw via Digitalmars-d-learn wrote: Currently Emacs d-mode cannot correctly highlight `\` because it doesn't understand that single backslashes are self-contained in back-quoted strings. I believe this extract from d-mode.el (defvar

Re: Threadpools, difference between DMD and LDC

2014-08-04 Thread Russel Winder via Digitalmars-d-learn
Sorry, I missed this thread (!) till now. On Mon, 2014-08-04 at 13:36 +, Dicebot via Digitalmars-d-learn wrote: On Monday, 4 August 2014 at 05:14:22 UTC, Philippe Sigaud via Digitalmars-d-learn wrote: I have another question: it seems I can spawn hundreds of threads (Heck, even

Re: Threadpools, difference between DMD and LDC

2014-08-04 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-04 at 16:57 +, Dicebot via Digitalmars-d-learn wrote: […] This is why I had or close remark :) Exact number almost always depends on exact deployment layout - i.e. what other processes are running in the system, how hardware interrupts are handled and so on. It is

Re: Threadpools, difference between DMD and LDC

2014-08-05 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-04 at 18:34 +, Dicebot via Digitalmars-d-learn wrote: […] Well it is a territory not completely alien to me either ;) I am less aware of academia research on topic though, just happen to work in industry where it matters. I have been out of academia now for 14 years, but

Re: Are there desktop appications being developed in D currently?

2014-08-10 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2014-08-10 at 04:37 +, Puming via Digitalmars-d-learn wrote: […] I didn't know about that. I don't actually know much about Rust except the hype on hackernews :-) But nonetheless, this indicates that a serious application like a browser is a good driving force for a language to

Re: Emacs d-mode cannot handle backquoted backslashe

2014-08-12 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-04 at 12:25 +, Atila Neves via Digitalmars-d-learn wrote: I took a look and I don't really know if it's possible without using the Emacs 24 only suggestion in the Stack Overflow comment to your question. As far as I can see, before that Emacs syntax tables have a

Re: Emacs d-mode cannot handle backquoted backslashe

2014-08-13 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2014-08-12 at 23:53 +0100, Russel Winder wrote: […] Per Nordlöw has offered a putative fix via a pull request. I'll check out the claim and if it seems to be true (and I fully expect it to be so) I'll accept the pull request. People using MELPA should see the new package quite quickly.

Re: beginner's pyd question - exporting structs to python

2014-08-18 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-18 at 16:39 +, Laeeth Isharc via Digitalmars-d-learn wrote: Hi there. Brief introduction, and a beginner's question. I just started playing with D a couple of weeks ago. I have been programming in C on and off since the late 80s, but I do finance for a living and my

Re: beginner's pyd question - exporting structs to python

2014-08-18 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-18 at 17:17 +, Laeeth Isharc via Digitalmars-d-learn wrote: Thank to jwhear on irc who solved it for me despite claiming not to be a pyd guru. :-) […] distutils.util.get_platform(), […] Does os.uname() not provide sufficient information? […] print mystruct.i

Re: beginner's pyd question - exporting structs to python

2014-08-18 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-18 at 19:00 +, Laeeth Isharc via Digitalmars-d-learn wrote: On Monday, 18 August 2014 at 18:08:59 UTC, Russel Winder via Digitalmars-d-learn wrote: […] distutils.util.get_platform(), […] Does os.uname() not provide sufficient information

Re: beginner's pyd question - exporting structs to python

2014-08-18 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-18 at 18:59 +, Laeeth Isharc via Digitalmars-d-learn wrote: […] Thanks for the colour - I appreciate it. I have played with numba and pypy with numpy and it seems a powerful tool for some kinds of jobs. Perhaps it is my relative unfamiliarity with python, but for the time

Re: London D User Group [was beginner's pyd question - exporting structs to python]

2014-08-18 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-18 at 23:16 +, Laeeth Isharc via Digitalmars-d-learn wrote: Are there any D users groups/meetups in London? I see you are not far away (I am in Barnes). Crickey, that is just round the corner . :-) Yes there is a London D user group, it just hasn't met as yet. I

Re: beginner's pyd question - exporting structs to python

2014-08-18 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-18 at 23:12 +, Laeeth Isharc via Digitalmars-d-learn wrote: Whilst the hardcore Pythonistas remain Pythonistas, some of the periphery has jumped ship to Go. Sadly D did not capture these folk, it perhaps should have done. It would be easy to blame fadism, but I think

Re: OT On NumPy [was beginner's pyd question - exporting structs to python]

2014-08-19 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-18 at 23:12 +, Laeeth Isharc via Digitalmars-d-learn wrote: […] For me, NumPy has some serious problems despite being the accepted norm for computational work. If not too offtopic, do you have a link describing, or would you briefly summarize these problems? I am

Re: beginner's pyd question - exporting structs to python

2014-08-19 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2014-08-19 at 00:53 +, bachmeier via Digitalmars-d-learn wrote: […] I'm not sure which computational work he is referring to, but for statistical analysis, R dominates by a wide margin (although statistical analysis done in Silicon Valley, the type you read about on Hacker News,

Re: RAII limitations in D?

2014-08-22 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2014-08-21 at 19:22 -0700, Timothee Cour via Digitalmars-d-learn wrote: What would be a good answer to this article? http://swiftcoder.wordpress.com/2009/02/18/raii-why-is-it-unique-to-c/ Especially the part mentioning D:{ D’s scope keyword, Python’s with statement and C#’s using

Re: Learning D

2014-08-26 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-25 at 17:09 +, Kiith-Sa via Digitalmars-d-learn wrote: […] I don't use an IDE, but MonoD seems to be the most recommended cross-platform option. It has a wiki page here if it helps: http://wiki.dlang.org/Mono-D I just tried following the instructions at

Re: Learning D

2014-08-26 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-25 at 18:09 +, Kiith-Sa via Digitalmars-d-learn wrote: […] I have no experience with GtkD, but with DUB you shouldn't need to mess with .lib files at all. DUB automatically downloads and compiles any libraries specified with dub.json, *and* links them with the compiled

Re: Learning D

2014-08-26 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-25 at 16:46 +, Ryan via Digitalmars-d-learn wrote: […] What Widget library should I use? I started with GTKD, but since there are no tutorials does this mean nobody actually does this? Should I use DWT? What about QT? GtkD should work for you. I would have preferred Qt

Re: Learning D the GTK+ way [was Learning D]

2014-08-28 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2014-08-27 at 13:25 +, Ryan via Digitalmars-d-learn wrote: […] I'm thinking I will probably create a more in depth GTK+ hello world that attempts to covers some of the current D landscape. Exactly what I am doing :-) For instance I now understand how DMD and RDMD work and how

Installing LDC on Windows

2014-09-06 Thread Russel Winder via Digitalmars-d-learn
OK I installed LDC pre-built on MinGW for Windows on Windows and then Installed MinGW for Windows but when I run ldc2 it tells me libgcc_s_dw2-1.dll is missing. Is this problem soluble by any means other than destruction of Windows? -- Russel.

Re: Installing LDC on Windows

2014-09-06 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-09-06 at 11:26 +, Danyal Zia via Digitalmars-d-learn wrote: On Saturday, 6 September 2014 at 11:13:20 UTC, Russel Winder via Digitalmars-d-learn wrote: OK I installed LDC pre-built on MinGW for Windows on Windows and then Installed MinGW for Windows but when I run ldc2

Re: Installing LDC on Windows

2014-09-06 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-09-06 at 15:09 +, Kagamin via Digitalmars-d-learn wrote: SEH was patented, so llvm doesn't support it. I installed the other MinGW option and it provides libgcc_s_sjlj-1.dll which is not helping me actually run ldc2 on Windows :-( -- Russel.

Re: Installing LDC on Windows

2014-09-07 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-09-06 at 21:52 +, David Nadlinger via Digitalmars-d-learn wrote: On Saturday, 6 September 2014 at 16:11:55 UTC, Russel Winder via Digitalmars-d-learn wrote: I installed the other MinGW option and it provides libgcc_s_sjlj-1.dll which is not helping me actually run ldc2

Re: Why is amap implemented as a member function of TaskPool?

2014-09-20 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-09-20 at 06:46 +, Nordlöw via Digitalmars-d-learn wrote: On Thursday, 18 September 2014 at 19:49:00 UTC, Atila Neves wrote: I had to roll my own parallel map today, but at least I did get a nice 3x speedup. How many cores? Is the problem a data parallel one and hence should

Re: std.parallelism curious results

2014-10-05 Thread Russel Winder via Digitalmars-d-learn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/10/14 15:27, flamencofantasy via Digitalmars-d-learn wrote: Hello, I am summing up the first 1 billion integers in parallel and in a single thread and I'm observing some curious results; I am fairly certain that your use of parallel for

Re: How are theads, Tid and spawn related?

2014-11-02 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-11-01 at 23:32 +, Neven via Digitalmars-d-learn wrote: Ok, a newbie question ahead. I want to create new thread which calls given function with some parameters. Thus, I think spawn is the right function for me. However that functions returns Tid and not a Thread object.

Re: Multithreading in D

2014-11-02 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2014-10-09 at 11:29 +, Sag Academy via Digitalmars-d-learn wrote: On Thursday, 9 October 2014 at 10:10:20 UTC, Konstantin wrote: Are you looking for parallel? http://dlang.org/library/std/parallelism/parallel.html I have seen this, but I'm not sure how to use it. Maybe:

Re: Instructions for compilation from multiple source files

2014-11-10 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-11-10 at 12:10 +, Solomon E via Digitalmars-d-learn wrote: I wanted to know how to compile a D program that has multiple source files. I looked under Modules in the language reference, but there isn't anything there about compilation, or anything about where to put the source

Re: Instructions for compilation from multiple source files

2014-11-10 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-11-10 at 13:01 +, Solomon E via Digitalmars-d-learn wrote: On Monday, 10 November 2014 at 12:49:46 UTC, ketmar via Digitalmars-d-learn wrote: you'd better not use command-line toolchain, they all aren't ready. if you can't figure out how to use some compiler of GCC

Re: threading issues with D - C - Python

2014-12-02 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2014-12-03 at 01:07 +, Michael via Digitalmars-d-learn wrote: Hi. I'm new here and this is my first post. I'm not sure this is the right subforum for it, but wasn't sure where else to put it either. I've written a library to talk to some external hardware using a socket. It

Re: DUB build questions

2014-12-20 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-12-20 at 05:46 +, Dicebot via Digitalmars-d-learn wrote: On Saturday, 20 December 2014 at 04:15:00 UTC, Rikki Cattermole wrote: b) Can I do parallel builds with dub. CMake gives me Makefiles so I can make -j does dub have a similar option? No Worth noting

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-12-22 at 10:12 +, Iov Gherman via Digitalmars-d-learn wrote: […] - D: 24 secs, 32 ms. - Java: 20 secs, 881 ms. - C: 21 secs - Go: 37 secs Without the source codes and the commands used to create and run, it is impossible to offer constructive criticism of the results.

Re: Data frames in D?

2014-12-26 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2014-12-26 at 20:44 +, Laeeth Isharc via Digitalmars-d-learn wrote: […] I agree with other posters that a D REPL and interactive/visualization data environment would be very cool, but unfortunately doesn't exist. Batch computing is more practical, but REPLs really hook new users. I

Re: Data frames in D?

2014-12-27 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-12-27 at 01:33 +, Laeeth Isharc via Digitalmars-d-learn wrote: […] Fair argument against an earlier poster but from my perspective, all I meant is that the absence of a shell is not a good reason to write off D for exploring data. Because there is a shell already that

Re: Data Frames in D - let's not wait for linear algebra; useful today in finance and Internet of Things

2014-12-27 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-12-27 at 06:21 +, Laeeth Isharc via Digitalmars-d-learn wrote: […] I don't believe I agree that we need a perfect multi-dimensional rectangular array library to serve as a backend before thinking and doing much on data frames (although it will certainly be very useful when

Re: Data frames in D?

2014-12-27 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-12-27 at 13:46 +, aldanor via Digitalmars-d-learn wrote: On Saturday, 27 December 2014 at 10:54:01 UTC, Russel Winder via Digitalmars-d-learn wrote: I know much less about R, but the whole Python/NumPy thing works but only because it is faster and easier than Python

Re: Data Frames in D - let's not wait for linear algebra; useful today in finance and Internet of Things

2014-12-27 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-12-27 at 13:53 +, via Digitalmars-d-learn wrote: […] I wonder how TSX would work with GIL. I suppose most GIL locks are short lived enough to be covered by TSX before it fails and takes a lock. For Intel chips this is good stuff (stolen from Sun's Rock processor). Hardware

Re: Data Frames in D - let's not wait for linear algebra; useful today in finance and Internet of Things

2014-12-27 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-12-27 at 14:28 +, via Digitalmars-d-learn wrote: […] I don't disagree in principle, but if an OpenMP supporting compiler can generate code for GPGPU then D will be miles behind for many homogeneous workloads. No-one with resources showed any interest in having a D with GPGPU

Re: Data Frames in D - let's not wait for linear algebra; useful today in finance and Internet of Things

2014-12-27 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-12-27 at 15:33 +, Laeeth Isharc via Digitalmars-d-learn wrote: […] I guess we vote with our feet/fingers. Sounds like you don't find D especially useful (since you don't use it much currently), whereas I do. De gustibus non est disputandum, particularly when tastes

Re: Data Frames in D - let's not wait for linear algebra; useful today in finance and Internet of Things

2014-12-27 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2014-12-27 at 15:33 +, Laeeth Isharc via Digitalmars-d-learn wrote: […lots of agreed uncontentious stuff :-) …] You write as if Christensen's book The Innovator's Dilemma had never been written, and nor had it been a standard textbook in business schools for some years. You may

iota and BigInt

2015-01-22 Thread Russel Winder via Digitalmars-d-learn
Using reduce for factorial, seems to require iota, not a bad things per se, with ulongs: reduce!a*b(1, iota(1, n + 1)) works fine. Now switch to BigInt: reduce!a*b(one, iota(one, n + one)) fails to compile, one and n + one are of different types. Problem is that one is

for ranges

2015-01-22 Thread Russel Winder via Digitalmars-d-learn
Playing with factorial implementations, as you do. I had a D implementation using ulong. Not sensible obviously since overflow is a bit of a problem. But the code worked, as did the tests. Now converting to BigInt and… The standard explicit iteration form uses a loop: for(i; 2..n+1) for

Re: for ranges

2015-01-22 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2015-01-22 at 16:48 +, bearophile via Digitalmars-d-learn wrote: It works for me: Sorry, you are right, it loops: So it is a bug, and I now have to find out how to report it! -- Russel. = Dr Russel

Re: iota and BigInt

2015-01-22 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2015-01-22 at 10:21 -0800, H. S. Teoh via Digitalmars-d-learn wrote: […] https://github.com/D-Programming-Language/phobos/pull/2895 This is just the tip of the iceberg. The full enhancement is described in: https://issues.dlang.org/show_bug.cgi?id=10762 Sadly, I suspect

Re: Parallelization of a large array

2015-03-11 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2015-03-11 at 07:10 -0700, Ali Çehreli via Digitalmars-d-learn wrote: On 03/11/2015 01:07 AM, Russel Winder via Digitalmars-d-learn wrote: On Tue, 2015-03-10 at 15:34 -0700, Ali Çehreli via Digitalmars-d-learn wrote: […] We can hope to make it simpler by taking advantage

Re: Parallelization of a large array

2015-03-11 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2015-03-10 at 15:34 -0700, Ali Çehreli via Digitalmars-d-learn wrote: […] We can hope to make it simpler by taking advantage of parallel map but it requires a static local function or a global function (a lambda cannot be used): […] Is there a reason for excluding lambdas, it a

Re: Will D have a serious dedicated well supported IDE like Visual Studio or Eclipse?

2015-02-27 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2015-02-27 at 04:12 +, AJ via Digitalmars-d-learn wrote: […] I am in the same boat and totally agree. It's tough going from the user-experience of IntelliJ IDEA or Visual Studio back to vi on OS X with D. There seems to be a large hole in support for D debugging outside of

Re: Converting Java code to D

2015-04-20 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2015-04-20 at 17:28 +, John Colvin via Digitalmars-d-learn wrote: […] True, the constructor doesn't really add anything here. To be honest, the combination of enumeration and runtime variables in the Java code seems like a rubbish design, but perhaps there's a good reason

Re: Moving from Python to D

2015-05-08 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2015-05-08 at 03:24 +, avarisclari via Digitalmars-d-learn wrote: Hello, Sorry to bother you with something trivial, but I am having trouble translating a block of code I wrote in Python over to D. Everything else I've figured out so far. Could someone help me understand how

Re: Lambda functions in D

2015-05-09 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-05-09 at 07:15 -0700, Ali Çehreli via Digitalmars-d-learn wrote: On 05/09/2015 04:59 AM, Dennis Ritchie wrote: On Saturday, 9 May 2015 at 11:49:48 UTC, Timon Gehr wrote: assert((function int(int x)=x?x*__traits(parent,{})(x-1):1)(10)==3628800); Thanks. Yes, it is similar

Re: Lambda functions in D

2015-05-09 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-05-09 at 09:49 -0700, Ali Çehreli via Digitalmars-d-learn wrote: […] BigInt factorial(size_t n) { return bigInts(1).take(n).reduce!((a, b) = a *= b); } I wonder if that should be a * b rather than a *= b? It turns out that 2.067 fixes the integrality of BigInts so:

Re: goroutines vs vibe.d tasks

2015-07-02 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2015-06-30 at 15:20 +, Alex Parrill via Digitalmars-d-learn wrote: […] Use GDC or LDC for profiling code; the DMD optimizer isn't as good. Also note that gc code generation is poor compared to gccgo: always use gccgo for benchmarking. […] -- Russel.

Re: Python's features, which requires D

2015-05-23 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-05-23 at 12:58 +, Dennis Ritchie via Digitalmars-d-learn wrote: On Saturday, 23 May 2015 at 10:58:33 UTC, Kagamin wrote: Well, list comprehension is built into language in python (and not in D), such level of support is definitely more streamlined. Well, what's to keep D

Re: Dual conditions in D and Python

2015-05-23 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-05-23 at 10:17 -0700, Andrei Alexandrescu via Digitalmars-d-learn wrote: […] if (ordered(4, 5, 6)) { ... } if (strictlyOrdered(4, 5, 6)) { ... } So the latter means the integers have to lashed as well as ordered? ; -) -- Russel.

Re: post on using go 1.5 and GC latency

2015-08-22 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-08-22 at 07:30 +, rsw0x via Digitalmars-d-learn wrote: […] because Go is not a general purpose language. Not entirely true. Go is a general purpose language, it is a successor to C as envisioned by Rob Pike, Russ Cox, and others (I am not sure how much input Brian Kernighan

Re: post on using go 1.5 and GC latency

2015-08-22 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2015-08-21 at 10:47 +, via Digitalmars-d-learn wrote: Yes, Go has sacrificed some compute performance in favour of latency and convenience. They have also released GC improvement plans for 1.6: https://docs.google.com/document/d/1kBx98ulj5V5M9Zdeamy7v6ofZXX3yPziA

Re: New to D - playing with Thread and false Sharing

2015-08-22 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2015-08-21 at 01:22 +, Nicholas Wilson via Digitalmars-d -learn wrote: […] Keep in mind java may be using green threads as opposed to kernel threads. The equivalent in D is a Fiber. I believe Java itself hasn't used green threads in an awful long time: Threads are mapped to

Re: New to D - playing with Thread and false Sharing

2015-08-22 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2015-08-20 at 20:01 +, tony288 via Digitalmars-d-learn wrote: […] Now what I would like to know, how would I make this code more efficient? Which is basically the aim I'm trying to achieve. Any pointers would be really help full. Should I use concurrency/parallelism etc..? I

Re: post on using go 1.5 and GC latency

2015-08-22 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-08-22 at 06:54 +, via Digitalmars-d-learn wrote: On Saturday, 22 August 2015 at 06:48:48 UTC, Russel Winder wrote: But one that Google are entirely happy to fully fund. Yes, they have made Go fully supported on Google Cloud now, so I think it is safe to say that Google

Re: post on using go 1.5 and GC latency

2015-08-23 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2015-08-23 at 11:26 +, rsw0x via Digitalmars-d-learn wrote: […] https://groups.google.com/forum/#!msg/golang -dev/pIuOcqAlvKU/C0wooVzXLZwJ 25-50% performance decrease across the board in 1.4 with the addition of write barriers, to an already slow language. Garbage collection

Re: post on using go 1.5 and GC latency

2015-08-23 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-08-22 at 11:06 +, Laeeth Isharc via Digitalmars-d -learn wrote: […] Builds in Go 1.5 will be slower by a factor of about two. The automatic translation of the compiler and linker from C to Go resulted in unidiomatic Go code that performs poorly compared to well-written

Re: post on using go 1.5 and GC latency

2015-08-23 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-08-22 at 09:27 +, rsw0x via Digitalmars-d-learn wrote: […] The performance decrease has been there since 1.4 and there is no way to remove it - write barriers are the cost you pay for concurrent collection. Go was already much slower than other compiled languages, now it

Re: Role of D in Python and performance computing [was post on using go 1.5 and GC latency]

2015-08-24 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2015-08-23 at 19:42 +, via Digitalmars-d-learn wrote: […] Yes, of course it is, but given it's typical use context I find it odd that they didn't go more towards higher level constructs. For me Go displaces Python where more speed is required, though I wish it was more

Re: good reasons not to use D?

2015-11-01 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-10-31 at 20:55 +, David Nadlinger via Digitalmars-d- learn wrote: > On Saturday, 31 October 2015 at 18:23:43 UTC, rumbu wrote: > > My opinion is that a decimal data type must be builtin in any > > modern language, not implemented as a library. > > "must be builtin in any modern

Re: good reasons not to use D?

2015-10-31 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-10-31 at 15:41 +, tcak via Digitalmars-d-learn wrote: > On Saturday, 31 October 2015 at 14:37:23 UTC, rumbu wrote: > > On Friday, 30 October 2015 at 10:35:03 UTC, Laeeth Isharc wrote: > > > I'm writing a talk for codemesh on the use of D in finance. > > > > > > Any other

Re: OT: why do people use python when it is slow?

2015-10-15 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2015-10-15 at 10:00 +, Chris via Digitalmars-d-learn wrote: > […] > Well, you know how gourmet sausages are made (100% meat), because > you make them yourself apparently. But I was talking about the > sausages you get out there ;) A lot of websites are not > "planned". They are

Re: OT: why do people use python when it is slow?

2015-10-15 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2015-10-15 at 09:35 +, Ola Fosheim Grøstad via Digitalmars- d-learn wrote: > On Thursday, 15 October 2015 at 07:57:51 UTC, Russel Winder wrote: > > lot better than it could be. From small experiments D is (and > > also Chapel is even more) hugely faster than Python/NumPy at > >

Re: OT: why do people use python when it is slow?

2015-10-15 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2015-10-15 at 06:48 +, data pulverizer via Digitalmars-d- learn wrote: > […] > A journey of a thousand miles ... Exactly. > I tried to start creating a data table type object by > investigating variantArray: > http://forum.dlang.org/thread/hhzavwrkbrkjzfohc...@forum.dlang.org >

Re: OT: why do people use python when it is slow?

2015-10-15 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2015-10-15 at 17:00 +, jmh530 via Digitalmars-d-learn wrote: > On Thursday, 15 October 2015 at 10:33:54 UTC, Russel Winder wrote: > > > > CUDA is of course doomed in the long run as Intel put GPGPU on > > the processor chip. OpenCL will eventually be replaced with > > Vulkan

Re: StopWatch

2015-10-20 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2015-10-20 at 02:19 -0700, Jonathan M Davis via Digitalmars-d- learn wrote: > […] > > auto before = MonoTime.currTime; > // do stuff > auto diff = MonoTime.currTime - before; What import statement do you use to get MonoTime.  I tried the above and got an error with all the things I

Re: StopWatch

2015-10-20 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2015-10-20 at 15:16 +0100, Russel Winder wrote: > […] > What import statement do you use to get MonoTime.  I tried the above > and got an error with all the things I tried. Hummm… I am now not worried about the import, I tried compiling a different way and it worked. The upshot is that I

Re: OT: why do people use python when it is slow?

2015-10-14 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2015-10-14 at 14:48 +, John Colvin via Digitalmars-d-learn wrote: > On Wednesday, 14 October 2015 at 14:32:00 UTC, jmh530 wrote: > > On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc > > wrote: > > > https://www.quora.com/Why-is-Python-so-popular-despite-being-so-s > > > low

Re: Looking for a language to hang my hat on.

2015-11-17 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2015-11-16 at 22:39 +, Dan via Digitalmars-d-learn wrote: > […] > My platform of choice is 64-bit Fedora using Code::Blocks (yes, I > use an IDE as a crutch). It seems that D supports this combo. Last time I looked at Code::Blocks it couldn't do a dark theme, and the D support was

Re: What's the "right" way to do openmp-style parallelism?

2015-09-07 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2015-09-07 at 02:56 +, Charles via Digitalmars-d-learn wrote: > […] > > x = float[imax][jmax]; //x is about 8 GB of floats > for(j = 0; j < jmax; j++){ > //create some local variables. > for(i = 0; i < imax; i++){ > x[j][i] = complicatedFunction(i, x[j-1], other, local,

Re: What's the "right" way to do openmp-style parallelism?

2015-09-09 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2015-09-08 at 07:33 +, Dominikus Dittes Scherkl via Digitalmars-d-learn wrote: > On Tuesday, 8 September 2015 at 05:50:30 UTC, Russel Winder wrote: > > void main() { > > immutable imax = 10; > > immutable jmax = 10; > > float[imax][jmax] x; > > foreach(int

Re: Calling D from C, C++, Python…

2015-09-12 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2015-09-11 at 21:50 +0200, Jacob Carlborg via Digitalmars-d -learn wrote: > On 2015-09-10 20:01, Russel Winder via Digitalmars-d-learn wrote: > > Is there an easy way of knowing when you do not have to initialize > > the > > D runtime system to call D code from, in

Re: Hello World Example with Glade?

2015-09-12 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-12 at 06:58 +, Mike McKee via Digitalmars-d-learn wrote: […] > I just tested and you are correct. Now, is there a way that I can > edit /etc/dmd.conf and make it so that I don't need to do this > pkg-config stuff all the time? I think editing /etc/dmd.conf would be the wrong

Calling D from C, C++, Python…

2015-09-10 Thread Russel Winder via Digitalmars-d-learn
Is there an easy way of knowing when you do not have to initialize the D runtime system to call D code from, in this case, Python via a C adapter? I naïvely transformed some C++ to D, without consideration of D runtime systems, compiled it and it all worked. Which is good, but… -- Russel.

Re: Reduce parameters [was pi program]

2015-09-26 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2015-09-25 at 12:54 +, John Colvin via Digitalmars-d-learn wrote: > […] > I vastly prefer the UFCS version, but unfortunately reduce has > its arguments the wrong way around for that if you use the > version that takes a seed... In which case the reduce parameter list is wrong,

Re: Threading Questions

2015-09-29 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2015-09-29 at 03:05 +, bitwise via Digitalmars-d-learn wrote: > On Monday, 28 September 2015 at 11:47:38 UTC, Russel Winder wrote: > > I hadn't answered as I do not have answers to the questions you > > ask. My reason: people should not be doing their codes using > > these low-level

Re: Parallel processing and further use of output

2015-09-28 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2015-09-28 at 12:46 +, John Colvin via Digitalmars-d-learn wrote: > […] > > Pretty much as expected. Locks are slow, shared accumulators > suck, much better to write to thread local and then merge. Quite. Dataflow is where the parallel action is. (Except for those writing

Re: WTF does "Enforcement failed" actually mean?

2015-10-01 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2015-10-01 at 08:52 +, John Colvin via Digitalmars-d-learn wrote: > […] > > Bug report? Then it'll get fixed. https://issues.dlang.org/show_bug.cgi?id=15133 Timer running… ;-) -- Russel. = Dr Russel

WTF does "Enforcement failed" actually mean?

2015-09-30 Thread Russel Winder via Digitalmars-d-learn
I have the code: reduce!"a+b"(x) where x is a int[] and I get an exception "Enforcement failed" at run time. This gives me enough information to say ¿que? -- Russel. = Dr Russel Winder t: +44 20 7585 2200

Re: WTF does "Enforcement failed" actually mean?

2015-10-01 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2015-09-30 at 23:35 -0700, Ali Çehreli via Digitalmars-d-learn wrote: > On 09/30/2015 10:46 PM, Russel Winder via Digitalmars-d-learn wrote: > > I have the code: > > > > reduce!"a+b"(x) > > > > where x is a int[] and I get an excepti

Re: Parallel processing and further use of output

2015-09-28 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-26 at 15:56 +, Jay Norwood via Digitalmars-d-learn wrote: > std.parallelism.reduce documentation provides an example of a > parallel sum. > > This works: > auto sum3 = taskPool.reduce!"a + b"(iota(1.0,101.0)); > > This results in a compile error: > auto sum3 =

Re: Parallel processing and further use of output

2015-09-28 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2015-09-28 at 11:38 +, John Colvin via Digitalmars-d-learn wrote: > […] > > It would be really great if someone knowledgable did a full > review of std.parallelism to find out the answer, hint, hint... > :) Indeed, I would love to be able to do this. However I don't have time in

Re: Parallel processing and further use of output

2015-09-28 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-26 at 14:33 +0200, anonymous via Digitalmars-d-learn wrote: > […] > I'm pretty sure atomicOp is faster, though. Rough and ready anecdotal evidence would indicate that this is a reasonable statement, by quite a long way. However a proper benchmark is needed for statistical

Re: pi program

2015-09-28 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2015-09-25 at 18:45 +, Meta via Digitalmars-d-learn wrote: > […] > > The main difference is that "method call" style is more amenable > to chaining (and IMO, it looks cleaner as you don't have nesting > parentheses. I guess coming from Clojure I was less worried about Lisp-style

Re: Threading Questions

2015-09-28 Thread Russel Winder via Digitalmars-d-learn
I hadn't answered as I do not have answers to the questions you ask. My reason: people should not be doing their codes using these low-level shared memory techniques. Data parallel things should be using the std.parallelism module. Dataflow-style things should be using spawn and channels – akin to

Re: Parallel processing and further use of output

2015-09-28 Thread Russel Winder via Digitalmars-d-learn
As a single data point: == anonymous_fix.d == 5050 real0m0.168s user0m0.200s sys 0m0.380s == colvin_fix.d == 5050 real0m0.036s user0m0.124s sys 0m0.000s == norwood_reduce.d

Re: Reduce parameters [was pi program]

2015-09-28 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-26 at 10:46 +, John Colvin via Digitalmars-d-learn wrote: > […] I guess the summary is: it's a breaking change, so do it. No we can't do that it's a breaking change. Seems lame given all the other breaking changes that have been. Sad given that reduce is probably the single

Re: Parallel processing and further use of output

2015-09-28 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-26 at 12:32 +, Zoidberg via Digitalmars-d-learn wrote: > > Here's a correct version: > > > > import std.parallelism, std.range, std.stdio, core.atomic; > > void main() > > { > > shared ulong i = 0; > > foreach (f; parallel(iota(1, 100+1))) > > { > >

Re: Parallel processing and further use of output

2015-09-28 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-26 at 17:20 +, Jay Norwood via Digitalmars-d-learn wrote: > This is a work-around to get a ulong result without having the > ulong as the range variable. > > ulong getTerm(int i) > { > return i; > } > auto sum4 = taskPool.reduce!"a + >

Re: Reduce parameters [was pi program]

2015-09-28 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2015-09-28 at 11:37 +, John Colvin via Digitalmars-d-learn wrote: > […] > My thoughts exactly, even though it was partly me that pointed > out the breaking changes... Curses, if no-one had pointed out it was breaking maybe no-one would have noticed, and just made the change? > I

Re: Debugging D shared libraries

2015-09-22 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2015-09-20 at 17:49 +0200, Johannes Pfau via Digitalmars-d -learn wrote: > […] > > Just realized this thread is titled "Debugging D shared libraries" ; > -) > GDC does not yet support shared libraries. Conversely I thought it did due to the GCC toolchain thingy. I'm using DMD and LDC

  1   2   3   4   5   >