Prime sieve language race
Bastiaan at Veelo.net
Tue Jul 13 19:06:12 UTC 2021
On Sunday, 4 July 2021 at 22:35:44 UTC, SealabJaster wrote:
> On Sunday, 4 July 2021 at 15:31:31 UTC, Bastiaan Veelo wrote:
> Decided to give it a go. Faithful but is slightly more D-ish
I like it! A few points:
1. The output in the readme shows `Valid: false`, which worries
me. I didn't try your solution myself yet.
2. Not sure if this was clearly stated in the rules, but he [says
that the sieve size must be a run time
value](https://youtu.be/Yl9OegOorYM?t=532). I hope this doesn't
disqualify your solution.
Further some nit-picks, feel free to ignore:
3. Line 23 `// it also allows D to write more "file-portable"
code.` Not sure what you mean by this. Worth noting however is
that the import only happens iff the template is instantiated,
which is nice.
4. Line 38: Did you mean to leave `(citation needed)` in there?
5. `printResults` can be made `@safe` by means of a nested
// If not called from multiple threads, this can be trusted.
static File trustedStderr() @trusted
Out of curiosity, do you know how your solution compares with the
first one performance wise, roughly?
Thanks for your submission!
More information about the Digitalmars-d