Re: Amicable numbers in Nim and a few questions

2017-04-10 Thread def
Last I tested ICC worked with --cc:gcc --gcc.exe:icc --gcc.linkerexe:icc (but I see some ICC defines now, so that might have changed) Some work for auto-vectorization was still needed though: [https://github.com/nim-lang/Nim/issues/1797](https://github.com/nim-lang/Nim/issues/1797)

Re: Amicable numbers in Nim and a few questions

2017-04-10 Thread Libman
I [experimented a bit with benchmarking this code (see link for details)](https://github.com/lbmn/nim/tree/master/bench/amicableInt). Some observations: * Rust (v1.16.0) is slower than Nim (v0.16.0) on all int sizes except i32, where it takes off at the speed of Clang. * Rust binary sizes

Re: Amicable numbers in Nim and a few questions

2017-04-04 Thread petevine
I eventually settled for plain aliases: alias nim-gen='nim c -r -d:release --passC:-mcpu=cortex-a5 --passC:-mfpu=neon --passC:- ftree-vectorize --passC:-fprofile-generate --passL:-lgcov' alias nim-use='nim c -d:release --passC:-mcpu=cortex-a5 --passC:-mfpu=neon

Re: Amicable numbers in Nim and a few questions

2017-01-25 Thread petevine
> .nims config file Thanks @Jehan, I've just finished reading up on NimScript

Re: Amicable numbers in Nim and a few questions

2017-01-25 Thread lltp
Oh my... I may need to sleep a wee bit more...

Re: Amicable numbers in Nim and a few questions

2017-01-24 Thread petevine
No problem. Anyway it was Rust being slower but that's an ARM specific bug that should have been fixed a long time ago here: [http://llvm.org/viewvc/llvm-project?view=revision=259657](http://llvm.org/viewvc/llvm-project?view=revision=259657)

Re: Amicable numbers in Nim and a few questions

2017-01-24 Thread lltp
@petevine: oops... well, I read the post and the answers this morning and then I noticed that Nim's version was twice as slow. I got back to it this evening and completely forgot that this was absolutely not the question here but only something I was curious about. Sorry about that!

Re: Amicable numbers in Nim and a few questions

2017-01-24 Thread petevine
@lltp What problem exactly? Is there a performance hit on 64-bit perhaps?

Re: Amicable numbers in Nim and a few questions

2017-01-24 Thread lltp
In this specific case, the "problem" seems to arise from the use of int instead of int32.

Re: Amicable numbers in Nim and a few questions

2017-01-24 Thread Jehan
**petevine:** _It would be good for usability if the nim compiler offered automated profiled builds as well as pass the expanded CFLAGS via --passC automatically in release mode._ You can do this via a `.nims` config file, e.g.: import strutils, sequtils let cflags =

Re: Amicable numbers in Nim and a few questions

2017-01-24 Thread Araq
But I don't like environment variables, they are global shared state affecting the build environment... No thanks, it's already hard enough to figure out which set of options is passed to anything.

Re: Amicable numbers in Nim and a few questions

2017-01-24 Thread petevine
C compilers don't expand shell variables so the short answer to my questions seems to be no and no, use --passC It would be good for usability if the nim compiler offered automated profiled builds as well as pass the expanded CFLAGS via --passC automatically in release mode.

Re: Amicable numbers in Nim and a few questions

2017-01-24 Thread Varriount
The Nim compiler knows nothing about CFLAGS and related things, however the C compiler it uses should (if you're using GCC or Clang). You can also pass in arguments via `--passC` and `--passL` arguments. When benchmarking, it's good to remember some things: * Nim's `int` datatype is

Amicable numbers in Nim and a few questions

2017-01-23 Thread petevine
I've translated the Euler problem #21 solution (C and Rust versions lifted off the net) to Nim and benchmarked the binary. Time to solution for C/Nim/Rust on my Cortex A5 cpu: 1.5s/1.5s/2.5s Two questions about compiling the generated C immediately spring to mind. Does the nim compiler use