I'm trying different things and experimenting and that's how I ended up trying to use --seqsv2:on. However, it shows the above error.
The compilation is done on macOS 10.14.6 with Nim 1.0.99.
The complete compilation command is:
nim c --gcc.options.speed="-O4 -Ofast -flto -march=native -fno-strict-aliasing -ffast-math " \
--gcc.options.linker="-flto" --clang.options.speed="-O4 -Ofast -flto -march=native -fno-strict-aliasing -ffast-math " \
--clang.options.linker="-flto" -d:release -d:danger --passL:parser.a --threads:on --hints:off --opt:speed \
--nilseqs:on --seqsv2:on --gc:regions --path:src -o:arturo -f --nimcache:_cache --embedsrc --checks:off --overflowChecks:on \
src/main.nim
But I'm getting:
/Users/drkameleon/Documents/Code/Tests/Nim/lib/system/gc_regions.nim(342, 8) Error: undeclared identifier: 'PGenericSeq'
stack trace: (most recent call last)
/private/var/folders/0k/4qyh49ss2pqg9262tw1sn23r0000gn/T/nimblecache/nimscriptapi.nim(165, 16)
/Users/drkameleon/Documents/Code/OpenSource/arturo-lang/arturo/nim_98658.nims(151, 16) releaseTask
Any ideas what is going on? Is it incompatible with --gc:regions?
@drkameleon: "--seqsv2" is a "future feature" that is a recent development that has come about because of experimental work done with "--gc:destructors" and "--newruntime", for which two uses (and --gc:hooks, which is a special adaptation of --gc:destructors) it is a hard-coded prerequisite to make them work; it is intended that it be back ported to be able to be used across all current GC's. In fact, it changes the implementation for both seq's and string's, not just seq's.
You'll find that it doesn't currently work for any of the other GC's or even --gc:none with the same kind of compiler error.
Hopefully, you'll find that it will work for something like Nim version 1.1 or 1.2, and it is intended to eventually be the default implementation for seq's and string's for everything.
For normal use (when it works), you shouldn't see any difference in its use from the current "legacy" seq's and string's as the API is intended to be exactly the same. The reason for the proposed change is that the implementation inside the compiler and runtime libraries is cleaner to use less memory and hopefully be faster.
As well, do note that that "-gc:destructors" and "--newruntime" you'll find mentioned as compiler command line switches are in development and don't work entirely properly yet either. Destructors is likely to work before the Newruntime switches, but these are development explorations that will likely work in some form for future versions.
Just to shortcut your frustration in your experimentation, "--gc:go" doesn't currently work either as there is a dependency on a Go language library file that currently isn't shipped with the Nim installation files for both Linux and Windows (don't know about MacOS). In case you see it mentioned, "--gc:v2" has never been fully developed and tested and is likely to be eliminated in future versions. If you are trying other GC's and want one that works across threads, "--gc:boehm" does work pretty well.
You should know that since you are running a devel branch version of Nim, there will be many features other than as mentioned that are experimental even though they aren't documented anywhere as such.