Re: Cross compile (Osx to linux) - how to

2019-02-28 Thread shashlick
You want to cross compile which means you need a cross-compiling toolchain. While Nim can cross-compile, it generates C/C++ which then needs to be further cross-compiled to the target arch. Is the gcc you are using a 64-bit Linux compiler that runs on OSX? You might also want to check out [htt

Re: Cross compile (Osx to linux) - how to

2019-02-28 Thread shashlick
Posted on reddit as well. [https://www.reddit.com/r/nim/comments/avtq1u/nim_cross_compile_osx_to_linux_how_to](https://www.reddit.com/r/nim/comments/avtq1u/nim_cross_compile_osx_to_linux_how_to)/

Re: deallocate ``ref object`` type

2019-02-28 Thread Stefan_Salewski
Fine that it now works for you. Generally allocating heap objects in a narrow loop can make programs slow, that is not really a GC issue, but due to the many allocations. I read that some other languages like Java or Python cache allocations, but I think current Nim does not much caching for al

Re: deallocate ``ref object`` type

2019-02-28 Thread namnium1125
Thank you for your reply, Stefan_Salewski. And I'm sorry that my reply was too late. I tried using `--gc:regions`. However, probably due to that gc works fine, the speed of the execution of my program became very slow. So after all I rewrote the program so that it works without gc (for example,

Cross compile (Osx to linux) - how to

2019-02-28 Thread Skota
Greetings, I am a new comer to nim and first time poster. I am trying to cross compile to linux from osx using the following command $nim c --cpu:i386 --os:linux hello.nim This is the error i am seeing -- start Error: execution of an external compile

Re: Problem with templates in multiple files

2019-02-28 Thread cdunn2001
[https://nim-lang.org/docs/nimc.html#compiler-usage-search-path-handling](https://nim-lang.org/docs/nimc.html#compiler-usage-search-path-handling) I needed to check the _compiler_ docs instead of the _language_ docs. Duh! It's obvious now that I see it.

Re: Replacement for "<" in array ranges?

2019-02-28 Thread cdunn2001
Fortunately, `array[n, int]` _is_ 0-based, so that will work fine for me in this case. I would not be happy with array[0 .. (n-1), int]. > (Not to mention that most people prefer 'A'..'Z' over 'A'..<'Z'+1.) I prefer `range(26, 'A')`. When you provide both length and start-point, there is never

Re: Problem getting the element type of a generic container

2019-02-28 Thread mratsim
I tried the same with getTypeInst but got V symbol instead of an expansion :/