Just installed latest devel from git to check my editor https://github.com/ngtk3/NEd
Added
cat nim.cfg path:"$projectdir"
to my project directory.
Compiles fine, but launching the program consumes more than 2 G of memory.
Tried
nimsuggest --stdin ned.nim
That also consumes all of my free memory, had to press Ctrl-C to abort. (A test with a tiny nim file without imports still works.)
I have installed nimsuggest with nimble
nimble install nimsuggest
May that be the problem?
https://github.com/nim-lang/nimsuggest indeed suggests manually cloning. Does that make a difference? [EDIT] Does not, just tested.
[EDIT2]
My first idea was something like cyclic imports, so I removed nim.cfg and the links to the imported gtk related modules from the current directory. Instead I cd into each of that wrapper directories and executed "nimble install" there. But that makes no difference.
I have just tried some of the pure modules shipped with Nim like strutils -- and for these all seems to work fine.
So it must be wrapper related, maybe special for my GTK related modules. Will try to find more info...
Araq, can you try
cd nimble/pkgs/c2nim-0.9.8 nimsuggest --stdin c2nim.nim
That crashes for me eating all my Ram, with many messages like
lib/pure/os.nim(1621, 24) template/generic instantiation from here
Or you may try
cd .nimble/pkgs/nimble-0.7.4 nimsuggest --stdin nimble.nim
[EDIT]
Well, maybe the problem is indeed "only" gigantic Ram consumption.
The minimal example from
https://github.com/ngtk3/nim-gtk3/blob/master/test/test.nim
can be processed by nimsuggest, but it consumes about one gigabyte of RAM. Is that really intended? Nim is not Java :-)
Sorry Araq, IRC just banned my IP again, so I can not answer there...
No, I don't used -d:release explicitely. But nimble install should have done that I guess?
Will try now with -d:release without nimble.
nim e compile_without_nimble -d:release nimsuggest.nim
Still crashes. But it seems that -d:release here makes no difference
nim e compile_without_nimble nimsuggest.nim
gives me exactly the same executable size: 2011240 Aug 8 22:17 nimsuggest
nimble install nimsuggest
Now startup works fine again for large projects!
BUT I am not convinced yet that USING it works fine again too. A fast test from within ned editor with "GOTO DEFINITION" or "ERROR CHECK" seems to eat still all of my 2 gigabyte. I will try to do these check from the command line tonight to ensure that the problem is really nimsuggest itself. And of course, its time to buy a box with more Ram,,,
OK, test done.
$ pwd /home/stefan/.nimble/pkgs/c2nim-0.9.8 nimsuggest --stdin c2nim.nim def c2nim.nim:60;18 # that is getTime() proc
And while the startup was fine, def command eats again all of my Ram after 5 seconds, so I had to kill it.
[EDIT]
Works fine again, thanks!