A Friendly Challenge for D

Vijay Nayar madric at gmail.com
Sat Oct 13 17:36:33 UTC 2018


On Saturday, 13 October 2018 at 15:50:06 UTC, Vijay Nayar wrote:
> On Saturday, 13 October 2018 at 15:19:07 UTC, Jabari Zakiya 
> wrote:
>> On Saturday, 13 October 2018 at 14:32:33 UTC, welkam wrote:
>>> On Saturday, 13 October 2018 at 09:22:16 UTC, Vijay Nayar 
>>> wrote:
>>>> [...]
>>>
>>> import algorithm
>>>
>>> thats all but then it spits out
>>>
>>> lib/nim/pure/algorithm.nim(144, 11) Error: interpretation 
>>> requires too many iterations
>>
>> My mistake. I updated the file and forgot to include the 
>> 'import algorithm' directive. The file is now fixed to include 
>> it. Download the corrected version or patch your file 
>> accordingly.
>>
>> As stated in the file intro **YOU MUST DO THIS** to get it to 
>> compile with current Nim (they were supposed to fix this in 
>> this version 0.19.0 but didn't).
>>
>>  To compile for nim versions <= 0.19.0 do following:
>>  1) in file: ~/nim-0.19.0/compiler/vmdef.nim
>>  2) set variable: MaxLoopIterations* = 1_000_000_000 (1 
>> Billion or >)
>>  3) then rebuild sysem: ./koch boot -d:release
>>
>> If you are using 'choosenim' to install Nim (highly advisable) 
>> the full path is:
>>
>>  ~/.choosenim/toolchains/nim-0.19.0/compiler/vmdef.nim
>>
>> I'll post performance results from my laptop to give reference 
>> times to compare against.
>
> Ok, now it builds.  I was previously following the build 
> instructions from the Nim website and am not super clear what 
> the "koch" tool does, but following your instructions, the 
> program does build and run.  I'll take a stab at making a D 
> version.

Interesting results so far.  I have a partially converted program 
here:  
https://gist.github.com/vnayar/79e2d0a9850833b8859dd9f08997b4d7

The interesting part is that during compilation (with the command 
"dmd twinprimes_ssoz.d"), the compilation will abort with the 
message "Killed" and no further information. That's a new one for 
me, so I'm looking into the cause.


More information about the Digitalmars-d mailing list