Array indexed by a subrange type

2017-12-01 Thread adrien79
I want to define an array indexed by another type. I can make it work like this: type Point = range[0 .. 360] ... type MyArray = array[Point(0) .. Point(360), int] but not like this: type Point = range[0 .. 360] const AllPoints = Point(0) .. Point(360)

Re: Anonymous iterators

2017-12-01 Thread dawkot
Yup, that's what I was looking for.

Re: Nim versus Julia benchmark comparison

2017-12-01 Thread sdwfrost
Hi @stefan_salewski My box is 64 bit (Intel Core i7-5500U CPU @ 2.40GHz x 4), with gcc 5.4.0. AFAIK default optimisation is O3; how does one check via Nim?

Re: Nim versus Julia benchmark comparison

2017-12-01 Thread Stefan_Salewski
Note I add some advice to my previous post!

Re: Nim versus Julia benchmark comparison

2017-12-01 Thread Stefan_Salewski
You have to tell us if your box is 32 or 64 bit. Size of data (4 or 8 byte) can make a difference. And maybe tell us gcc version and optimize level of gcc. Is it default -O3 And you may prove if your random() proc is inlined. Recently we had a case where a plain proc from std lib was not

Re: Nim versus Julia benchmark comparison

2017-12-01 Thread guibar
Hello, I played a bit with it (config: i5-2675QM Linux 64-bit gcc 64-bit gcc 5.4.0 nim 0.17.2 julia 0.6.1), and I found also that, with the `-d:release` flag, that the Nim version is 3-4x slower than the Julia one. However, with different flags to the C compiler, the results varied

Re: Nim versus Julia benchmark comparison

2017-12-01 Thread sdwfrost
Hi all, A few things: 1. Yes, @def @miran, I compiled with -d:release. 2. I'm using Julia 0.6.0 vs Nim 0.17.2 on Linux, and I'm getting way better times on Julia. 3. Apologies for the cast! I didn't like it, and didn't know about setting a single member working (BTW this works)

Re: Nim t-shirt (San Francisco)

2017-12-01 Thread treeform
I don't care about T-Shirt, but I am also in SF and would love to just hangout.

Is for procs only one generic parameter allowed?

2017-12-01 Thread Stefan_Salewski
I tried to create a generic RTree. Beginning was easy, tests of union() and intersect() was working fine. But I did not got search() working -- it gets a rtree parameter and a box, which both are generic. I tried with proc p() which compiles when one of the parameters is used, but not when both

Re: Nim t-shirt (San Francisco)

2017-12-01 Thread dom96
Sounds like we need to create a Nim user's map Sorry to hear about the t-shirt size btw

Re: Error invalid module name: nim_1.1.1

2017-12-01 Thread dom96
Is this a naming scheme suggested by AoC? day1, day2, etc. Is far better anyway IMO

Re: Nim versus Julia benchmark comparison

2017-12-01 Thread Stefan_Salewski
And can you please try to avoid the ugly cast: #var u:array[4,int64] = cast[array[4,int64]]([60,1,342,0]) var u: array[4, int64] = [60.int64, 1, 342, 0] # should work -- if not tell Araq

Re: Nim versus Julia benchmark comparison

2017-12-01 Thread def
Additionally: 32bit ints might be faster than 64, Julia might opt to use them by default while Nim uses 64bit ints on x86-64 by default. But locally, compiling Nim with `-d:release`, I see Nim being slightly faster than Julia: 0.22 s instead of 0.28 s.

Re: Nim versus Julia benchmark comparison

2017-12-01 Thread miran
A wild guess, have you used -d:release flag when compiling?

Nim versus Julia benchmark comparison

2017-12-01 Thread sdwfrost
Dear All, I'm trying to compare a simple discrete-time simulation in Nim and Julia; I've put a gist [here](https://gist.github.com/sdwfrost/7c660322c6c33961297a826df4cbc30d). I wrote the code to be as similar as possible between the two languages, but Nim is about 3-4x slower than my Julia

Re: VoxelSpace engine demo

2017-12-01 Thread sendell
It would be interesting to compile it through emscripten to compare the perfs with the original version

Re: RussianAICup2017 now supports Nim!

2017-12-01 Thread xomachine
First round has finished and the second one will start at 9th of December. First [60 participants](http://russianaicup.ru/contest/1/standings/without/3/page/1) (except those who won in the first round) from the sandbox will pass to the second round, so everyone have a chance. Am I the only

Wrap cpp class library?

2017-12-01 Thread Stromberg
Hi, I'm probably a below average programmer, but I'm wondering if it is possible to wrap a c++ class library. I've followed the free nim in action chapter about wrapping c libraries, and bought the book after that. Maya has 3 ways to write plugins, c++, c# and python(wrapper), so even when

Re: Error invalid module name: nim_1.1.1

2017-12-01 Thread geo555
You can't know. In AoC they've always been DD.c, DD.py, DD.dat, DD.txt, DD.ijs etc, just because DD means the day of month, no need to add more letters. Now this scheme has to be broken. Not a big deal, just an awkward unnecessary nuisance.

Re: Error invalid module name: nim_1.1.1

2017-12-01 Thread Araq
The language considers it a module if you personally don't. You can name it `e01.nim` or -- even better -- anything else that actually has a meaning. The only sad thing here is your way of naming things.

Re: Error invalid module name: nim_1.1.1

2017-12-01 Thread geo555
And it turned out, I can't have a program name 01.nim, even if I'm not going to consider it a module. C can, Python can, J can, Nim can't. Very sad.

Re: Nim t-shirt (San Francisco)

2017-12-01 Thread slimshady
I also got a Nim t-shirt and live in SF. Are there more Nim users here?

Nim t-shirt (San Francisco)

2017-12-01 Thread boia01
Got my Nim t-shirt (men's medium) but it's too small for me. I'm 6'1" and fairly athletic build. If you're in San Francisco, can point to Nim code on your GitHub account and willing to pick up downtown, reach out to Alex dot Boisvert at GeeMail dot you-know-what. It's yours for free.

Re: A wish for Nim conferences

2017-12-01 Thread jzakiya
Matz's (Ruby's creator) Keynote Address at RubyConf 2017 provides very good guidance for language (any project really) development. It's really worth the TL;DR time.