October 11, 2018
On Thursday, 11 October 2018 at 13:26:19 UTC, Jabari Zakiyth wrote:
> On Thursday, 11 October 2018 at 05:11:20 UTC, Ali Çehreli wrote:
>> [...]
>
> What country are you trying to get access from, because I know people in the US have gotten the papers from those link, for free and without an account. It may also have something to do with your browser. They work for me in various modern browsers, including the Tor Browser.

Not credible --- I cannot get either without an account browsing from the US using Firefox with no unusual arrangements.
October 11, 2018
On Thursday, 11 October 2018 at 14:49:54 UTC, Carl Sturtivant wrote:
> On Thursday, 11 October 2018 at 13:26:19 UTC, Jabari Zakiyth wrote:
>> On Thursday, 11 October 2018 at 05:11:20 UTC, Ali Çehreli wrote:
>>> [...]
>>
>> What country are you trying to get access from, because I know people in the US have gotten the papers from those link, for free and without an account. It may also have something to do with your browser. They work for me in various modern browsers, including the Tor Browser.
>
> Not credible --- I cannot get either without an account browsing from the US using Firefox with no unusual arrangements.

Wow. Those links used to work with no problem, so I don't know what is it (vpn use, etc,?).

OK, this will definitely work. Send me an email and I will email you the paper (and figure out a sure fire way to make it available).

Construct this full email (for humans).

(my first initial)(lastname) at gmail
October 11, 2018
On Thursday, 11 October 2018 at 16:13:17 UTC, Jabari Zakiya wrote:
> On Thursday, 11 October 2018 at 14:49:54 UTC, Carl Sturtivant wrote:
>> On Thursday, 11 October 2018 at 13:26:19 UTC, Jabari Zakiyth wrote:
>>> On Thursday, 11 October 2018 at 05:11:20 UTC, Ali Çehreli wrote:
>>>> [...]
>>>
>>> What country are you trying to get access from, because I know people in the US have gotten the papers from those link, for free and without an account. It may also have something to do with your browser. They work for me in various modern browsers, including the Tor Browser.
>>
>> Not credible --- I cannot get either without an account browsing from the US using Firefox with no unusual arrangements.
>
> Wow. Those links used to work with no problem, so I don't know what is it (vpn use, etc,?).
>
> OK, this will definitely work. Send me an email and I will email you the paper (and figure out a sure fire way to make it available).
>
> Construct this full email (for humans).
>
> (my first initial)(lastname) at gmail

Ok, hopefully this will work for everyone. Try this link:

https://mega.nz/#!yJxUEQgK!MY9dwjiWheE8tACtEeS0szduIvdBjiyTn4O6mMD_aZw

However, I'm still interested to find out what is|are the specific issues with the other links so I can make a possible bug report to those services.

1) Can you actually get to the site?

2) Can you see the document (a reference to it)?

3) Can you read the document online (did you try)?

4) What happened when you tried to download it (popup requiring account, etc)?

The paper is from 2014, Scribd has changed a lot since then. The more information people can provide will help me determine how to provide better access to them.

But you can always email me to get them as a last resort, or just to ask questions.

October 11, 2018
On 10/11/2018 10:14 AM, Jabari Zakiya wrote:

> Ok, hopefully this will work for everyone. Try this link:
>
> https://mega.nz/#!yJxUEQgK!MY9dwjiWheE8tACtEeS0szduIvdBjiyTn4O6mMD_aZw

Thank you. That worked just fine. I clicked the Download link and the pdf was saved on my end. :)

Ali

October 12, 2018
On Wednesday, 10 October 2018 at 16:15:56 UTC, Jabari Zakiya wrote:
> What I am requesting here is for a person(s) who is an "expert" (very good) to create a very fast D version, using whatever tricks it has to maximize performance.
>
> I would like to include in my paper a good comparison of various implementations in different compiled languages (C/C++, D, Nim, etc) to show how it performs with each.

I looked into your NIM code and from programmers point of view there is nothing interesting going on. Simple data structures and simple operations. If you wrote equivalent code in C, C++, D, NIM, Rust, Zig and compiled with same optimizing compiler (llvm or gcc) you should get the same machine code and almost the same performance (less than 1% difference due to runtime). If you got different machine code for equivalent implementation then you should file a bug report.

The only way you will get different performance is by changing implementation details but then you would compare apples to oranges.


October 12, 2018
On Friday, 12 October 2018 at 15:11:17 UTC, welkam wrote:
> On Wednesday, 10 October 2018 at 16:15:56 UTC, Jabari Zakiya wrote:
>> What I am requesting here is for a person(s) who is an "expert" (very good) to create a very fast D version, using whatever tricks it has to maximize performance.
>>
>> I would like to include in my paper a good comparison of various implementations in different compiled languages (C/C++, D, Nim, etc) to show how it performs with each.
>
> I looked into your NIM code and from programmers point of view there is nothing interesting going on. Simple data structures and simple operations. If you wrote equivalent code in C, C++, D, NIM, Rust, Zig and compiled with same optimizing compiler (llvm or gcc) you should get the same machine code and almost the same performance (less than 1% difference due to runtime). If you got different machine code for equivalent implementation then you should file a bug report.
>
> The only way you will get different performance is by changing implementation details but then you would compare apples to oranges.

Hmm,I don't think what you're saying about similar output|performance with other languages is empirically correct, but it's really not the point of the challenge.

The real point of the challenge is too see what idiomatic code, written for performance, using the best resources that the language provides, will produce compared, to the Nim version. It's not to see what a line-by-line translation from Nim to D would look like. That may be a start to get something working, but shouldn't be the end goal.

I'm using the Nim version here as the "reference implementation" so it can be used as the standard for comparison (accuracy of results and performance). The goal for D (et al) users is to use whatever resources it provides to maybe do better.

Example. Nim currently doesn't provide standard bitarrays. Using bitarrays in place of byte arrays should perform faster because more data can fit in cache and operate faster.

Also, to parallelize the algorithm maybe using OpenMP, CUDA, etc is the way to do it for D. I don't know what constructs D uses for parallel multiprocessing. And as noted before, this algorithms screams out to be done with GPUs.

But you are correct that the Nim code uses very simple coding operations. That is one of its beauties! :) It is simple to understand and implement mathematically, short and simple to code, and architecturally adaptable to hardware.

So to really do the challenge, the Nim code needs to be compiled and run (per instructions in code) to use as the "reference implementation", to see what correct outputs look like, and their times, and then other implementations can be compared to it.

I would hope, after getting an output correct implementation done (to show you really know what you're doing) then alternative implementations can be done to wring out better performance.

I think this is a good challenge for anyone wanting to learn D too, because it involves something substantially more than a "toy" algorithm, but short enough to do with minimal time and effort, that involves the need to know (learn about) D in enough detail to determine the "best" (alternative) way to do it.

Finally, a really fast D implementation can be a marketing bananza to show people in the numerical analysis, data|signal processing fields, et al, that D can be used by them to solve their problems and be more performant than C++, etc.

Again, people should feel free to email me if the want more direct answers to questions, or help.

October 12, 2018
On Friday, 12 October 2018 at 16:19:59 UTC, Jabari Zakiya wrote:
> Hmm,I don't think what you're saying about similar output|performance with other languages is empirically correct, but it's really not the point of the challenge.


Thats why godbolt exists.

c++ and Rust
https://godbolt.org/z/FffXY2
C and D
https://godbolt.org/z/YQvkXU

Look at assembly output. Its all the same. Compilers are very good at recognizing simple arithmetic computations and can reason about it. What they struggle with is memory access.

On Friday, 12 October 2018 at 16:19:59 UTC, Jabari Zakiya wrote:
> Finally, a really fast D implementation can be a marketing bananza to show people > in the numerical analysis, data|signal processing fields, et al, that D can be used by them to solve their problems and be more performant than C++, etc

eBay`s tsv-utils is fastest in the world
https://github.com/eBay/tsv-utils/blob/master/docs/comparative-benchmarks-2018.md#top-four-in-each-benchmark

D`s JSON parsing is fastest in the world
https://github.com/kostya/benchmarks#json

Sambamba is BAM data processor and is fastest in the world
https://www.basepairtech.com/blog/sorting-bam-files-samtools-vs-sambamba/

Mir GLAS is faster than OpenBLAS and Eigen
http://blog.mir.dlang.io/glas/benchmark/openblas/2016/09/23/glas-gemm-benchmark.html

There are enough examples but they are not enough to change minds
October 12, 2018
On Friday, 12 October 2018 at 16:19:59 UTC, Jabari Zakiya wrote:
> The real point of the challenge is too see what idiomatic code...

There is no idiomatic D code. There is only better implementations.

D doesnt tell you how to write your code. It gives you many tools and you choose which tools to use. That`s what people like about D.
October 12, 2018
On Friday, 12 October 2018 at 20:05:29 UTC, welkam wrote:
> On Friday, 12 October 2018 at 16:19:59 UTC, Jabari Zakiya wrote:
>> The real point of the challenge is too see what idiomatic code...
>
> There is no idiomatic D code. There is only better implementations.
>
> D doesnt tell you how to write your code. It gives you many tools and you choose which tools to use. That`s what people like about D.

I await your implementation(s)! :-)
October 13, 2018
On Friday, 12 October 2018 at 21:08:03 UTC, Jabari Zakiya wrote:
> On Friday, 12 October 2018 at 20:05:29 UTC, welkam wrote:
>> On Friday, 12 October 2018 at 16:19:59 UTC, Jabari Zakiya wrote:
>>> The real point of the challenge is too see what idiomatic code...
>>
>> There is no idiomatic D code. There is only better implementations.
>>
>> D doesnt tell you how to write your code. It gives you many tools and you choose which tools to use. That`s what people like about D.
>
> I await your implementation(s)! :-)

I downloaded the reference NIM implementation and got the latest nim compiler, but I received the following error:
  $ nim c --cc:gcc --d:release --threads:on twinprimes_ssoz.nim
  twinprimes_ssoz.nim(74, 11) Error: attempting to call undeclared routine: 'sort'

For a person not familiar with nim, what's the fastest way to fix that?