February 23, 2016
On Tuesday, 23 February 2016 at 20:03:30 UTC, dextorious wrote:
>
> Personally, I think a few aspects of documentation for the various compilers, dub and possibly the dlang.org website itself could be improved, if accessibility is considered important.

Couldn't agree more.

>
> Being new to the language, I certainly make no claims about what the Phobos library should do, but coming from a heavy numerics background in many languages, I can say that this is the first time I've seen a common summation function do anything beyond naive summation. Some languages feature more accurate options separately, but never as the default, so it did not occur to me to specifically check the documentation for something like sum() (which is my fault, of course, no issues there). Having the more accurate pairwise summation algorithm in the standard library is certainly worthwhile for some applications, but I was a bit surprised to see it as the default.

I think that's fair. I think part of the reason for the focus on accuracy over speed is that floats can have really weird behavior sometimes. For most people, it's better to be a little slower all the time in order to get the right answer all the time (or as often as possible with floats).

And people who want more speed, can look at the docs and figure out what they need to do to get more.
February 24, 2016
On Tuesday, 23 February 2016 at 20:03:30 UTC, dextorious wrote:
> For instance, I am still not sure how to make it pass the -O5 switch to the LDC2 compiler and the impression I got from the documentation is that explicit manual switches can only be supplied for the DMD compiler.

If you're referring to this:

"Additional flags passed to the D compiler - note that these flags are usually specific to the compiler in use, but a set of flags is automatically translated from DMD to the selected compiler"

My take is that a specific set of flags are automatically translated (so you don't need to make a separate dflags entry for each compiler you support if you only use those flags), but you can pass any compiler-specific flags you need.
February 24, 2016
On Wednesday, 24 February 2016 at 03:33:14 UTC, Mike Parker wrote:
> On Tuesday, 23 February 2016 at 20:03:30 UTC, dextorious wrote:
>> For instance, I am still not sure how to make it pass the -O5 switch to the LDC2 compiler and the impression I got from the documentation is that explicit manual switches can only be supplied for the DMD compiler.
>
> If you're referring to this:
>
> "Additional flags passed to the D compiler - note that these flags are usually specific to the compiler in use, but a set of flags is automatically translated from DMD to the selected compiler"
>
> My take is that a specific set of flags are automatically translated (so you don't need to make a separate dflags entry for each compiler you support if you only use those flags), but you can pass any compiler-specific flags you need.

There's part of what I'm referring to, yes. There doesn't seem to be any documentation on what gets translated and what doesn't.

For the moment, the only way I've found to manually pass specific compiler options ("-O5 -singleobj" in my case) is by settings the dflags attribute when defining a buildType. However, there doesn't seem to be any way to specify different dflags for different compilers, so I am forced to introduce separately named buildTypes for each compiler. Since I still need to manually specify the compiler using the --compiler option when running dub, this feels like I'm using a hacky workaround rather than a consistently designed CLI. Furthermore, from the documentation, I have no idea if what I'm doing is the intended way or just an ugly hack around whatever piece of information I've missed.
February 24, 2016
On Wednesday, 24 February 2016 at 19:15:23 UTC, dextorious wrote:
>
> However, there doesn't seem to be any way to specify different dflags for different compilers

There are examples like in the package format page
"dflags-dmd": ["-vtls"],
"sourceFiles-windows-x86_64-dmd": ["lib/win32/mylib.lib"],
that would give some idea of how to do it.

Combining them together, you are able to do things like
"dflags-windows-x86_64-dmd": ["-vtls"],

So yes, it is do-able, but as you mention above, the docs page could use some work in making this functionality clear.
February 24, 2016
On 02/23/2016 12:12 PM, dextorious wrote:

> Some languages
> feature more accurate options separately, but never as the default, so
> it did not occur to me to specifically check the documentation for
> something like sum() (which is my fault, of course, no issues there).
> Having the more accurate pairwise summation algorithm in the standard
> library is certainly worthwhile for some applications, but I was a bit
> surprised to see it as the default.

According to Wikipedia, pairwise summation is the default algorithm in NumPy and Julia as well:

"Pairwise summation is the default summation algorithm in NumPy and the Julia technical-computing language".

  https://en.wikipedia.org/wiki/Pairwise_summation

Ali

1 2 3
Next ›   Last »