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

2015-10-15 Thread Chris via Digitalmars-d-learn
On Thursday, 15 October 2015 at 09:47:56 UTC, Ola Fosheim Grøstad wrote: On Thursday, 15 October 2015 at 09:24:52 UTC, Chris wrote: Yep. This occurred to me too. Sorry Ola, but I think you don't know how sausages are made. I most certainly do. I am both doing backend programming and we have

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

Building and Running Unittests for a Specific Phobos Package Only

2015-10-15 Thread Nordlöw via Digitalmars-d-learn
Is there a Make-target for building and running the unittests for a specific Phobos package, say `std.range`, only?

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 Ola Fosheim Grøstad via Digitalmars-d-learn
On Thursday, 15 October 2015 at 09:24:52 UTC, Chris wrote: Yep. This occurred to me too. Sorry Ola, but I think you don't know how sausages are made. I most certainly do. I am both doing backend programming and we have a farm... :-) Do you really think that all the websites out there 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 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 Chris via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 18:17:29 UTC, Russel Winder wrote: The thing about Python is NumPy, SciPy, Pandas, Matplotlib, IPython, Jupyter, GNU Radio. The data science, bioinformatics, quant, signal provessing, etc. people do not give a sh!t which language they used, what they want

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

2015-10-15 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 15 October 2015 at 02:20:42 UTC, jmh530 wrote: On Wednesday, 14 October 2015 at 22:11:56 UTC, data pulverizer 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-slow Andrei suggested posting more

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

2015-10-15 Thread Chris via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 18:37:40 UTC, Mengu wrote: On Wednesday, 14 October 2015 at 05:42:12 UTC, Ola Fosheim Grøstad 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-slow Andrei suggested posting

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

2015-10-15 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
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 things Python people think NumPy is brilliant for. Expectations Have you had a chance to look at

Re: Why isn't global operator overloading allowed in D?

2015-10-15 Thread Shriramana Sharma via Digitalmars-d-learn
John Colvin wrote: > On Wednesday, 14 October 2015 at 15:02:02 UTC, Shriramana Sharma > wrote: > What binary arithmetic operators do you need that real[] doesn't > already support? OMG silly me! I can already do a[] /= b[]... D is great! :-D Thanks a lot!

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

2015-10-15 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Thursday, 15 October 2015 at 10:00:21 UTC, Chris wrote: about the sausages you get out there ;) A lot of websites are not "planned". They are quickly put together to promote an idea. They are WordPress sites... :-( If you designed a website from a programming point of view first, you'd

Re: Class, constructor and inherance.

2015-10-15 Thread holo via Digitalmars-d-learn
Thank you for example. I asked about it programmers at work too - PHP guys - and they explained me how you are see usage of that interfaces in my code. They prepare for me some "skeleton" on which i will try to build my solution. Will be back if i will have some code.

Re: Why isn't global operator overloading allowed in D?

2015-10-15 Thread John Colvin via Digitalmars-d-learn
On Thursday, 15 October 2015 at 15:45:00 UTC, Shriramana Sharma wrote: John Colvin wrote: On Wednesday, 14 October 2015 at 15:02:02 UTC, Shriramana Sharma wrote: What binary arithmetic operators do you need that real[] doesn't already support? OMG silly me! I can already do a[] /= b[]...

Re: Building and Running Unittests for a Specific Phobos Package Only

2015-10-15 Thread Marc Schütz via Digitalmars-d-learn
On Thursday, 15 October 2015 at 10:07:29 UTC, Nordlöw wrote: Is there a Make-target for building and running the unittests for a specific Phobos package, say `std.range`, only? make -f posix.mak std/range.test

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

2015-10-15 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 15 October 2015 at 07:57:51 UTC, Russel Winder wrote: On Thu, 2015-10-15 at 06:48 +, data pulverizer via Digitalmars-d- learn wrote: Just because D doesn't have this now doesn't mean it cannot. C doesn't have such capability but R and Python do even though R and CPython are

Re: Building and Running Unittests for a Specific Phobos Package Only

2015-10-15 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 15 October 2015 at 13:12:32 UTC, Marc Schütz wrote: make -f posix.mak std/range.test Thx

Re: Class, constructor and inherance.

2015-10-15 Thread Rikki Cattermole via Digitalmars-d-learn
On 16/10/15 4:14 PM, holo wrote: I created interface IfRequestHandler it is used only by one class RequestHandlerXML right now but thanks to such solution i can create more classes with same interface which can handle it in different way.. eg second can be RequestHandlerCSVReport or

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

2015-10-15 Thread Laeeth Isharc via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 15:25:22 UTC, David DeWitt wrote: On Wednesday, 14 October 2015 at 14:48:22 UTC, John Colvin 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:

Strange behavior of array

2015-10-15 Thread VlasovRoman via Digitalmars-d-learn
I get it in dmd 2.068.2 and dmd 2.069-b2. I think, that this behavior some strange: I have some code: enum int m = 10; enum int n = 5; ubyte[m][n] array; for(int x = 0; x < m; x++) { for(int y = 0; y < n; y++) { array[x][y] = cast(ubyte)(x + y); } } In

Re: Strange behavior of array

2015-10-15 Thread Rikki Cattermole via Digitalmars-d-learn
On 16/10/15 3:39 PM, VlasovRoman wrote: enum int m = 10; enum int n = 5; ubyte[m][n] array; for(int x = 0; x < m; x++) { for(int y = 0; y < n; y++) { array[x][y] = cast(ubyte)(x + y); } } First on the left(declaration), last on the right(index/assign). void main() {

Alias lamda argument vs Type template argument

2015-10-15 Thread Freddy via Digitalmars-d-learn
There are two these different ways to pass functions as template arguments. Which is preferred? --- void funcA(alias calle)() { calle(); } void funcB(T)(T calle) { calle(); } void main() { funcA!(() => 0); funcB(() => 0); } ---

Re: Strange behavior of array

2015-10-15 Thread VlasovRoman via Digitalmars-d-learn
On Friday, 16 October 2015 at 02:46:03 UTC, Rikki Cattermole wrote: On 16/10/15 3:39 PM, VlasovRoman wrote: enum int m = 10; enum int n = 5; ubyte[m][n] array; for(int x = 0; x < m; x++) { for(int y = 0; y < n; y++) { array[x][y] = cast(ubyte)(x + y); } } First on the

Re: Class, constructor and inherance.

2015-10-15 Thread holo via Digitalmars-d-learn
I created interface IfRequestHandler it is used only by one class RequestHandlerXML right now but thanks to such solution i can create more classes with same interface which can handle it in different way.. eg second can be RequestHandlerCSVReport or RequestHandlerSendViaEmail. Is it this what

Re: Builtin array and AA efficiency questions

2015-10-15 Thread Random D user via Digitalmars-d-learn
Ah missed your post before replying to H.S. Teoh (I should refresh more often). Thanks for reply. On Thursday, 15 October 2015 at 19:50:27 UTC, Steven Schveighoffer wrote: Without more context, I would say no. assumeSafeAppend is an assumption, and therefore unsafe. If you don't know what

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

2015-10-15 Thread Laeeth Isharc via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 22:11:56 UTC, data pulverizer 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-slow Andrei suggested posting more widely. I am coming at D by way of R, C++, Python etc. so

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

2015-10-15 Thread Laeeth Isharc via Digitalmars-d-learn
On Thursday, 15 October 2015 at 07:57:51 UTC, Russel Winder wrote: 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:

Re: Builtin array and AA efficiency questions

2015-10-15 Thread anonymous via Digitalmars-d-learn
On Thursday, October 15, 2015 11:48 PM, Random D user wrote: > Should array have clear() as well? > Basically wrap array.length = 0; array.assumeSafeAppend(); > At least it would then be symmetric (and more intuitive) with > built-in containers. No. "clear" is too harmless a name for it to

Re: Builtin array and AA efficiency questions

2015-10-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/15/15 12:47 PM, Random D user wrote: So I was doing some optimizations and I came up with couple basic questions... A) What does assumeSafeAppend actually do? A.1) Should I call it always if before setting length if I want to have assumeSafeAppend semantics? (e.g. I don't know if it's

Re: Builtin array and AA efficiency questions

2015-10-15 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Oct 15, 2015 at 09:00:36PM +, Random D user via Digitalmars-d-learn wrote: > Thanks for thorough answer. > > On Thursday, 15 October 2015 at 18:46:22 UTC, H. S. Teoh wrote: [...] > >The only thing I can think of is to implement this manually, e.g., by > >wrapping your AA in a type

Re: Builtin array and AA efficiency questions

2015-10-15 Thread Random D user via Digitalmars-d-learn
Thanks for thorough answer. On Thursday, 15 October 2015 at 18:46:22 UTC, H. S. Teoh wrote: It adjusts the size of the allocated block in the GC so that subsequent appends will not reallocate. So how does capacity affect this? I mean what is exactly a GC block here. Shrink to fit bit

Re: Alias lamda argument vs Type template argument

2015-10-15 Thread Rikki Cattermole via Digitalmars-d-learn
On 16/10/15 4:02 PM, Freddy wrote: There are two these different ways to pass functions as template arguments. Which is preferred? --- void funcA(alias calle)() { calle(); } void funcB(T)(T calle) { calle(); } void main() { funcA!(() => 0); funcB(() => 0); } --- Depends,

Re: Builtin array and AA efficiency questions

2015-10-15 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 15 October 2015 at 21:48:29 UTC, Random D user wrote: An array uses a block marked for appending, assumeSafeAppend simply sets how much data is assumed to be valid. Calling assumeSafeAppend on a block not marked for appending will do nothing except burn CPU cycles. So yours is

Re: Strange behavior of array

2015-10-15 Thread Mike Parker via Digitalmars-d-learn
On Friday, 16 October 2015 at 03:01:12 UTC, VlasovRoman wrote: Oh, thank you. Some strange solution. D doesn't have multidimensional built-in arrays, but rectangular arrays. Think of it this way: int[3] a1; a1 is a static array of 3 ints. Indexing it returns an int. We can think of it

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

2015-10-15 Thread jmh530 via Digitalmars-d-learn
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 (assuming they can get the chips made). I thought Vulkan was meant to replace OpenGL.

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

Builtin array and AA efficiency questions

2015-10-15 Thread Random D user via Digitalmars-d-learn
So I was doing some optimizations and I came up with couple basic questions... A) What does assumeSafeAppend actually do? A.1) Should I call it always if before setting length if I want to have assumeSafeAppend semantics? (e.g. I don't know if it's called just before the function I'm in) A.2)

Re: Builtin array and AA efficiency questions

2015-10-15 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Oct 15, 2015 at 04:47:35PM +, Random D user via Digitalmars-d-learn wrote: > So I was doing some optimizations and I came up with couple basic > questions... > > A) > What does assumeSafeAppend actually do? It adjusts the size of the allocated block in the GC so that subsequent