As there are problems using gcc and avx(2) on windows I switched to VCC. Now I noticed with an other program that it did not "finish" execution. So I modified the Malebolgia demo program a bit, with the same result. It just uses processors to the max and does not progress and has to be terminated Ctrl-C.
(Win11, Microsoft (R) C/C++ Optimizing Compiler Version 19.40.33813 for x64)
The modified program, to get an impression of the flow of things:
nim c -d:ThreadPoolSize=8 -d:FixedChanSize=16 malle.nim
import malebolgia
proc dfs(depth, breadth: int): int {.gcsafe.} =
if depth == 0: return 1
var sums = newSeq[int](breadth)
var m = createMaster()
m.awaitAll:
for i in 0 ..< breadth:
echo i
m.spawn dfs(depth - 1, breadth) -> sums[i]
echo "+"
result = 0
for i in 0 ..< breadth:
result += sums[i]
let answer = dfs(2,2)
echo answer
output:
vcc unfinished:
0
+
0
1
+
1
0
+
1
+
+
+
vcc unfinished:
0
+
0
1
+
1
0
+
+
+
1
+
gcc & vcc finished:
0
+
1
+
0
0
+
1
+
1
+
+
4
The only change made to /toolchains/nim-2.0.8/config/nim.cfg id:
cc = vcc
#cc = gcc
Does it require more changes, or is there something else wrong? @Araq sai Claude 3.7 is goo with Nim, so I asked. Here's the discussion: https://claude.ai/share/f1fa8368-1a57-4c46-905a-3c35398cba54
I cant judge the quality of the answer, maybe it helps to fix.
Visual Studio 2022 Developer Command Prompt v17.10.5
Microsoft (R) C/C++ Optimizing Compiler Version 19.40.33813
Is what Claude replied not for C11? I have no clue about these things. I'll ask it later when there is quotum again.
-d:nimUseCppAtomics does not change the result, only -d:useMalloc does.
for C11 this is the answer it gave...
https://claude.ai/share/f1fa8368-1a57-4c46-905a-3c35398cba54
The above does not work, so I asked it for more. But, to be honest I have no clue about these things and thus can't ask specific questions, only implement the suggestions and test. Here's this mornings discussion. Maybe it inspires someone to have a go at it,
https://claude.ai/share/858d1c61-9299-4e3c-89f7-fecb2c8c3618