> Is he wrong about Nim not being safe when not using Boehm GC? Does it not segfault when sending GC pointers between threads?
If he has said that, yes, then that would be wrong [1, 2] in that you cannot send GCed references between threads in the first place. For example, the following code results in an error:
var s = "foo"
proc foo {.thread.} =
echo s
createThread(foo)
Compiling this results in:
test.nim(3, 6) Error: 'foo' is not GC-safe as it accesses 's' which is a global using GC'ed memory
The problem here is one of expressiveness in that it is difficult for threads to share data (outside the limited and still experimental `parallel` construct). I've proposed a mechanism (shared, individually lockable heaps) modeled after Eiffel's SCOOP approach to remedy this, but so far this is just a proposal.
[1] Modulo any remaining compiler bugs, of course, or using explicitly unsafe features.
[2] Also, are you maybe confusing this with Go, which does have such a problem?