Re: The Case Against Autodecode

2016-05-15 Thread Jon D via Digitalmars-d
On Thursday, 12 May 2016 at 20:15:45 UTC, Walter Bright wrote: On 5/12/2016 9:29 AM, Andrei Alexandrescu wrote: > I am as unclear about the problems of autodecoding as I am about the necessity > to remove curl. Whenever I ask I hear some arguments that work well emotionally > but are scant on

Re: Command line parsing

2016-05-14 Thread Jon D via Digitalmars-d
On Saturday, 14 May 2016 at 13:17:05 UTC, Andrei Alexandrescu wrote: I showed a fellow programmer std.getopt. We were both on laptops. He wanted to show me how good Python's argparse is and how D should copy it. By the end of the chat it was obvious argparse was much more verbose and less

Re: Intermediate level D and open source projects to study

2016-05-11 Thread Jon D via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 18:41:47 UTC, xtreak wrote: Hi, I am a D newbie. I worked through D programming language and programming in D books. I primarily use Python daily. I will be happy to know how I can go to intermediate level in D. It will be hepful to have projects in D of high

Re: Compiler benchmarks for an alternative to std.uni.asLowerCase.

2016-05-08 Thread Jon D via Digitalmars-d
On Monday, 9 May 2016 at 00:15:03 UTC, Peter Häggman wrote: On Sunday, 8 May 2016 at 23:38:31 UTC, Jon D wrote: I did a performance study on speeding up case conversion in std.uni.asLowerCase. Specifics for asLowerCase have been added to issue https://issues.dlang.org/show_bug.cgi?id=11229.

Compiler benchmarks for an alternative to std.uni.asLowerCase.

2016-05-08 Thread Jon D via Digitalmars-d
I did a performance study on speeding up case conversion in std.uni.asLowerCase. Specifics for asLowerCase have been added to issue https://issues.dlang.org/show_bug.cgi?id=11229. Publishing here as some of the more general observations may be of wider interest. Background - Case conversion

Re: Can't use std.algorithm.remove on a char[]?

2016-04-30 Thread Jon D via Digitalmars-d-learn
On Saturday, 30 April 2016 at 19:21:30 UTC, ag0aep6g wrote: On 30.04.2016 21:08, Jon D wrote: If an initial step is to fix the documentation, it would be helpful to include specifically that it doesn't work with characters. It's not obvious that characters don't meet the requirement.

Re: Can't use std.algorithm.remove on a char[]?

2016-04-30 Thread Jon D via Digitalmars-d-learn
On Saturday, 30 April 2016 at 18:32:32 UTC, ag0aep6g wrote: On 30.04.2016 18:44, TheGag96 wrote: I was just writing some code trying to remove a value from a character array, but the compiler complained "No overload matches for remove", and if I specifically say use std.algorithm.remove() the

Re: So, to print or not to print?

2016-04-26 Thread Jon D via Digitalmars-d
On Tuesday, 26 April 2016 at 16:30:22 UTC, Jonathan M Davis wrote: On Tuesday, April 26, 2016 12:18:11 cym13 via Digitalmars-d wrote: Finally it doesn't bring much. One learns writeln, laments a bit that it doesn't put spaces itself then just accepts it. I confess that I was very surprised to

Re: Is there a way to disable 'dub test' for applications?

2016-04-18 Thread Jon D via Digitalmars-d-learn
On Monday, 18 April 2016 at 11:47:42 UTC, Dicebot wrote: On Monday, 18 April 2016 at 04:25:25 UTC, Jon D wrote: I have an dub config file specifying a targetType of 'executable'. There is only one file, the file containing main(), and no unit tests. When I run 'dub test', dub builds and runs

Re: Is there a way to disable 'dub test' for applications?

2016-04-17 Thread Jon D via Digitalmars-d-learn
On Monday, 18 April 2016 at 05:30:21 UTC, Jonathan M Davis wrote: On Monday, April 18, 2016 04:25:25 Jon D via Digitalmars-d-learn wrote: I have an dub config file specifying a targetType of 'executable'. There is only one file, the file containing main(), and no unit tests. When I run 'dub

Is there a way to disable 'dub test' for applications?

2016-04-17 Thread Jon D via Digitalmars-d-learn
I have an dub config file specifying a targetType of 'executable'. There is only one file, the file containing main(), and no unit tests. When I run 'dub test', dub builds and runs the executable. This is not really desirable. Is there a way to set up the dub configuration file to disable

Specifying a minimum Phobos version in dub?

2016-04-17 Thread Jon D via Digitalmars-d-learn
Is there a way to specify a minimum Phobos version in a dub package specification? --Jon

Re: Command line utilities for tab-separated value files

2016-04-13 Thread Jon D via Digitalmars-d-announce
On Wednesday, 13 April 2016 at 19:52:30 UTC, Walter Bright wrote: On 4/11/2016 5:50 PM, Jon D wrote: I'd welcome any feedback, either on the apps or the code. Intention is that the code be reasonable example programs. And, I may write a blog post about my D explorations at some point, they'd

Re: Command line utilities for tab-separated value files

2016-04-13 Thread Jon D via Digitalmars-d-announce
On Wednesday, 13 April 2016 at 18:22:21 UTC, Dicebot wrote: On Wednesday, 13 April 2016 at 17:21:58 UTC, Jon D wrote: You don't need to put anything on path to run utils from dub packages. `dub run` will take care of setting necessary envionment (without messing with the system): dub fetch

Re: Command line utilities for tab-separated value files

2016-04-13 Thread Jon D via Digitalmars-d-announce
On Wednesday, 13 April 2016 at 12:36:56 UTC, Dejan Lekic wrote: On Tuesday, 12 April 2016 at 00:50:24 UTC, Jon D wrote: I've open sourced a set of command line utilities for manipulating tab-separated value files. I rarely need TSV files, but I deal with CSV files every day. - It would be

Re: Command line utilities for tab-separated value files

2016-04-13 Thread Jon D via Digitalmars-d-announce
On Wednesday, 13 April 2016 at 07:34:11 UTC, Rory McGuire wrote: On Wed, Apr 13, 2016 at 3:41 AM, Puming via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote: On Tuesday, 12 April 2016 at 06:22:55 UTC, Puming wrote: Here is what I know of it, using subPackages: Just

Re: Command line utilities for tab-separated value files

2016-04-12 Thread Jon D via Digitalmars-d-announce
On Tuesday, 12 April 2016 at 06:22:55 UTC, Puming wrote: On Tuesday, 12 April 2016 at 00:50:24 UTC, Jon D wrote: Hi all, I've open sourced a set of command line utilities for manipulating tab-separated value files. They are complementary to traditional unix tools like cut, grep, etc. They're

Command line utilities for tab-separated value files

2016-04-11 Thread Jon D via Digitalmars-d-announce
Hi all, I've open sourced a set of command line utilities for manipulating tab-separated value files. They are complementary to traditional unix tools like cut, grep, etc. They're useful for manipulating large data files. I use them when prepping files for R and similar tools. These tools

Re: Weak Purity Blog Post

2016-03-30 Thread Jon D via Digitalmars-d-announce
On Monday, 28 March 2016 at 01:44:02 UTC, sarn wrote: D's implementation of functional purity supports "weak" purity - functions that can mutate arguments but are otherwise traditionally pure. I wrote a post about some of the practical benefits of this kind of purity:

Re: Pitching D to a gang of Gophers

2016-03-12 Thread Jon D via Digitalmars-d
On Saturday, 12 March 2016 at 08:09:41 UTC, Dmitry Olshansky wrote: On 05-Mar-2016 14:05, Dmitry Olshansky wrote: Obligatory slides: http://slides.com/dmitryolshansky/deck/fullscreen/ Very nice slide deck. Thanks for publishing. --Jon

Re: Speed kills

2016-03-09 Thread Jon D via Digitalmars-d
On Wednesday, 9 March 2016 at 20:30:10 UTC, Jon D wrote: I seen a few cases while exploring D. Turns out there are issues filed for each of the performance issues I mentioned: * Lower casing strings: https://issues.dlang.org/show_bug.cgi?id=11229 * Large associative arrays:

Re: Speed kills

2016-03-09 Thread Jon D via Digitalmars-d
On Tuesday, 8 March 2016 at 14:14:25 UTC, ixid wrote: Since I posted this thread I've learned std.algorithm.sum is 4 times slower than a naive loop sum. Even if this is for reasons of accuracy this is exactly what I am talking about- this is a hidden iceberg of terrible performance that will

Re: Get memory usage report from GC

2016-02-19 Thread Jon D via Digitalmars-d-learn
On Saturday, 20 February 2016 at 05:34:01 UTC, tcak wrote: On Saturday, 20 February 2016 at 05:33:00 UTC, tcak wrote: Is there any way (I checked core.memory already) to collect report about memory usage from garbage collector? So, I can see a list of pointer and length information. Since

Re: Scala Spark-like RDD for D?

2016-02-16 Thread Jon D via Digitalmars-d-learn
On Wednesday, 17 February 2016 at 02:32:01 UTC, bachmeier wrote: You can discuss here, but there is also a gitter room https://gitter.im/DlangScience/public Also, I've got a project that embeds R inside D http://lancebachmeier.com/rdlang/ It's not quite as good a user experience as others

Re: Scala Spark-like RDD for D?

2016-02-16 Thread Jon D via Digitalmars-d-learn
On Tuesday, 16 February 2016 at 16:27:27 UTC, bachmeier wrote: On Monday, 15 February 2016 at 11:09:10 UTC, data pulverizer wrote: As an alternative are there plans for parallel/cluster computing frameworks for D? You can use MPI: https://github.com/DlangScience/OpenMPI FWIW, I'm

Re: Reserving capacity in associative arrays

2016-02-16 Thread Jon D via Digitalmars-d-learn
On Tuesday, 16 February 2016 at 19:49:55 UTC, H. S. Teoh wrote: On Tue, Feb 16, 2016 at 07:34:07PM +, Jon D via Digitalmars-d-learn wrote: On Tuesday, 16 February 2016 at 16:37:07 UTC, Steven Schveighoffer wrote: >On 2/14/16 10:22 PM, Jon D wrote: >>Is there a way to reserve

Re: Reserving capacity in associative arrays

2016-02-16 Thread Jon D via Digitalmars-d-learn
On Tuesday, 16 February 2016 at 16:37:07 UTC, Steven Schveighoffer wrote: On 2/14/16 10:22 PM, Jon D wrote: Is there a way to reserve capacity in associative arrays? [snip] The underlying implementation of associative arrays appears to take an initial number of buckets, and there's a private

Re: Reserving capacity in associative arrays

2016-02-16 Thread Jon D via Digitalmars-d-learn
On Tuesday, 16 February 2016 at 17:05:11 UTC, Basile B. wrote: On Tuesday, 16 February 2016 at 16:37:07 UTC, Steven Schveighoffer wrote: There is not a public way to access these methods unfortunately. It would be a good addition to druntime I believe. -Steve After reading the topic i've

Re: Reserving capacity in associative arrays

2016-02-14 Thread Jon D via Digitalmars-d-learn
On Monday, 15 February 2016 at 05:29:23 UTC, sigod wrote: On Monday, 15 February 2016 at 03:22:44 UTC, Jon D wrote: Is there a way to reserve capacity in associative arrays? [snip] Maybe try using this: http://code.dlang.org/packages/aammm Thanks, I wasn't aware of this package. I'll give

Reserving capacity in associative arrays

2016-02-14 Thread Jon D via Digitalmars-d-learn
Is there a way to reserve capacity in associative arrays? In some programs I've been writing I've been getting reasonable performance up to about 10 million entries, but beyond that performance is impacted considerably (say, 30 million or 50 million entries). GC stats (via the

Re: Vision for the first semester of 2016

2016-01-29 Thread Jon D via Digitalmars-d-announce
On Monday, 25 January 2016 at 02:37:40 UTC, Andrei Alexandrescu wrote: Hot off the press! http://wiki.dlang.org/Vision/2016H1 -- Andrei A couple comments: a) No mention of targeting increased organizational participation (academic, corporate, etc). Not trying to suggest it should or

Difference between toLower() and asLowerCase() for strings?

2016-01-24 Thread Jon D via Digitalmars-d-learn
I'm trying to identify the preferred ways to lower case a string. In std.uni there are two functions that return the lower case form of a string: toLower() and asLowerCase(). There is also toLowerInPlace(). I'm having trouble figuring out what the relationship is between these, and when to

Re: Difference between toLower() and asLowerCase() for strings?

2016-01-24 Thread Jon D via Digitalmars-d-learn
On Sunday, 24 January 2016 at 21:04:46 UTC, Adam D. Ruppe wrote: On Sunday, 24 January 2016 at 20:56:20 UTC, Jon D wrote: I'm trying to identify the preferred ways to lower case a string. In std.uni there are two functions that return the lower case form of a string: toLower() and

Re: Speed of csvReader

2016-01-21 Thread Jon D via Digitalmars-d-learn
On Thursday, 21 January 2016 at 22:20:28 UTC, H. S. Teoh wrote: On Thu, Jan 21, 2016 at 10:09:24PM +, Jon D via Digitalmars-d-learn wrote: [...] FWIW - I've been implementing a few programs manipulating delimited files, e.g. tab-delimited. Simpler than CSV files because

Re: Speed of csvReader

2016-01-21 Thread Jon D via Digitalmars-d-learn
On Thursday, 21 January 2016 at 09:39:30 UTC, data pulverizer wrote: I have been reading large text files with D's csv file reader and have found it slow compared to R's read.table function which is not known to be particularly fast. FWIW - I've been implementing a few programs manipulating

function argument accepting function or delegate?

2016-01-16 Thread Jon D via Digitalmars-d-learn
My underlying question is how to compose functions taking functions as arguments, while allowing the caller the flexibility to pass either a function or delegate. Simply declaring an argument as either a function or delegate seems to prohibit the other. Overloading works. Are there better

Re: function argument accepting function or delegate?

2016-01-16 Thread Jon D via Digitalmars-d-learn
On Sunday, 17 January 2016 at 06:49:23 UTC, rsw0x wrote: On Sunday, 17 January 2016 at 06:27:41 UTC, Jon D wrote: My underlying question is how to compose functions taking functions as arguments, while allowing the caller the flexibility to pass either a function or delegate. [...]

Re: Silicon Valley D Meetup December 17, 2015

2015-12-18 Thread Jon D via Digitalmars-d-announce
On Friday, 18 December 2015 at 16:01:48 UTC, Andrei Alexandrescu wrote: On 12/17/2015 10:07 PM, Ali Cehreli wrote: On Thursday, 17 December 2015 at 17:41:30 UTC, Ali Çehreli wrote: On 12/12/2015 05:03 PM, Ali Çehreli wrote: Our guest speaker is Steven Schveighoffer. He will present

Re: We need better documentation for functions with ranges and templates

2015-12-16 Thread Jon D via Digitalmars-d
On Monday, 14 December 2015 at 19:04:46 UTC, bachmeier wrote: Something has to be done with the documentation for Phobos functions that involve ranges and templates. Many useful ideas in this thread. One I don't recall seeing - a standard way to denote whether a routine is lazy or eager. I'm

Re: Why should file names intended for executables be valid identifiers?

2015-12-14 Thread Jon D via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 03:31:18 UTC, Shriramana Sharma wrote: For instance, hyphens are often used as part of executable names on Linux, but if I do this: $ dmd usage-printer.d I get the following error: usage-printer.d: Error: module usage-printer has non-identifier characters

Re: Reason for 'static struct'

2015-12-09 Thread Jon D via Digitalmars-d-learn
On Wednesday, 9 December 2015 at 21:23:03 UTC, Daniel Kozák wrote: V Wed, 09 Dec 2015 21:10:43 + Jon D via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> napsáno: There is a fair bit of range related code in the standard library structured like: auto MyRange(Range)

Reason for 'static struct'

2015-12-09 Thread Jon D via Digitalmars-d-learn
There is a fair bit of range related code in the standard library structured like: auto MyRange(Range)(Range r) if (isInputRange!Range) { static struct Result { private Range source; // define empty, front, popFront, etc }

Re: block file reads and lazy utf-8 decoding

2015-12-09 Thread Jon D via Digitalmars-d-learn
On Thursday, 10 December 2015 at 00:36:27 UTC, Jon D wrote: Question I have is if there is a better way to do this. For example, a different way to construct the lazy 'decodeUTF8Range' rather than writing it out in this fashion. A further thought - The decodeUTF8Range function is basically

block file reads and lazy utf-8 decoding

2015-12-09 Thread Jon D via Digitalmars-d-learn
I want to combine block reads with lazy conversion of utf-8 characters to dchars. Solution I came with is in the program below. This works fine. Has good performance, etc. Question I have is if there is a better way to do this. For example, a different way to construct the lazy

Re: Wiki article: Starting as a Contributor

2015-12-03 Thread Jon D via Digitalmars-d
On Tuesday, 1 December 2015 at 18:58:37 UTC, Jack Stouffer wrote: On Monday, 3 August 2015 at 21:25:35 UTC, Andrei Alexandrescu wrote: I had to set up dmd and friends on a fresh Ubuntu box, so I thought I'd document the step-by-step process: http://wiki.dlang.org/Starting_as_a_Contributor

Re: copy and array length vs capacity. (Doc suggestion?)

2015-11-23 Thread Jon D via Digitalmars-d-learn
On Tuesday, 24 November 2015 at 01:00:40 UTC, Steven Schveighoffer wrote: On 11/23/15 7:29 PM, Ali Çehreli wrote: On 11/23/2015 04:03 PM, Steven Schveighoffer wrote: > On 11/23/15 4:29 PM, Jon D wrote: >> In the example I gave, what I was really wondering was if there is a >> difference

Re: copy and array length vs capacity. (Doc suggestion?)

2015-11-23 Thread Jon D via Digitalmars-d-learn
On Monday, 23 November 2015 at 15:19:08 UTC, Steven Schveighoffer wrote: On 11/21/15 10:19 PM, Jon D wrote: On Sunday, 22 November 2015 at 00:31:53 UTC, Jonathan M Davis wrote: Honestly, arrays suck as output ranges. They don't get appended to; they get filled, and for better or worse, the

Re: copy and array length vs capacity. (Doc suggestion?)

2015-11-21 Thread Jon D via Digitalmars-d-learn
On Sunday, 22 November 2015 at 00:10:07 UTC, Ali Çehreli wrote: May I suggest that you improve that page. ;) If you don't already have a clone o the repo, you can do it easily by clicking the "Improve this page" button on that page. Hi Ali, thanks for the quick response. And point taken :) I

copy and array length vs capacity. (Doc suggestion?)

2015-11-21 Thread Jon D via Digitalmars-d-learn
Something I found confusing was the relationship between array capacity and copy(). A short example: void main() { import std.algorithm: copy; auto a = new int[](3); assert(a.length == 3); [1, 2, 3].copy(a); // Okay int[] b; b.reserve(3); assert(b.capacity >=

Re: copy and array length vs capacity. (Doc suggestion?)

2015-11-21 Thread Jon D via Digitalmars-d-learn
On Sunday, 22 November 2015 at 00:31:53 UTC, Jonathan M Davis wrote: Honestly, arrays suck as output ranges. They don't get appended to; they get filled, and for better or worse, the documentation for copy is probably assuming that you know that. If you want your array to be appended to when

compatible types for chains of different lengths

2015-11-17 Thread Jon D via Digitalmars-d-learn
I'd like to chain several ranges and operate on them. However, if the chains are different lengths, the data type is different. This makes it hard to use in a general way. There is likely an alternate way to do this that I'm missing. A short example: $ cat chain.d import std.stdio; import

Re: compatible types for chains of different lengths

2015-11-17 Thread Jon D via Digitalmars-d-learn
On Tuesday, 17 November 2015 at 23:22:58 UTC, Brad Anderson wrote: One solution: [snip] Thanks for the quick response. Extending your example, here's another style that works and may be nicer in some cases. import std.stdio; import std.range; import std.algorithm; void main(string[]

Preferred behavior of take() with ranges (value vs reference range)

2015-11-08 Thread Jon D via Digitalmars-d-learn
Just started looking at D, very promising! One of the first programs I constructed involved infinite sequences. A design question that showed up is whether to construct the range as a struct/value, or class/reference. It appears that structs/values are more the norm, but there are

Re: Preferred behavior of take() with ranges (value vs reference range)

2015-11-08 Thread Jon D via Digitalmars-d-learn
On Monday, 9 November 2015 at 02:44:48 UTC, TheFlyingFiddle wrote: On Monday, 9 November 2015 at 02:14:58 UTC, Jon D wrote: Here's an example of the behavior differences below. It uses refRange, but same behavior occurs if the range is created as a class rather than a struct. --Jon This is