Simple logging with module filename and line number

2017-10-04 Thread Tiberium
Nim allows getting a line number from a template (via compile-time information). So you can make a log template to do that: import logging, strutils var logger = newConsoleLogger(fmtStr = "[$time][$levelid]") addHandler(logger) template log*(lvl: Level, data:

Re: how to make nimble link against libs in $HOME

2017-10-04 Thread woggioni
which compiler are you using for the generated C code? (you can see in compiling with the '--listCmd' flag)

problems in https://nim-lang.org/docs/nimc.html

2017-10-04 Thread bkerin
The path descriptions in [https://nim-lang.org/docs/nimc.html](https://nim-lang.org/docs/nimc.html) aren't clear, e.g. --cincludes presumably goes at the head of some list, but it's not spelled out, it just says it "modifies" the search path. There seems to be a convention that PATH is used

Re: Hacktoberfest project contributions?

2017-10-04 Thread perturbation2
Thanks guys! I'll take a look at those issues this weekend and let you know if I have questions.

Re: How to

2017-10-04 Thread monster
@cdunn2001 I can see how what you ask would be useful. But I don't have that problem yet, because I'm just getting started with Nim. I assume it will be months before I have anything that is both working, well tested, well written (idiomatic), generally useful, and covers something that hasn't

about locks and condition variables

2017-10-04 Thread woggioni
I'm trying to use locks and condition variable from the locks module, the documentation I found [here](https://nim-lang.org/docs/locks.html) seems to be quite poor, then I assumed that condition variables works like std::condition_variable in C++ that I've already used in the past. In

why doesn't nimble uninstall nimx remove ~/.nimble/pkgs/nimx-1.0

2017-10-04 Thread bkerin
it seems like 'nimble uninstall nimx' should be a symmetric operation to 'nimble install nimx'. Why isn't it?

Re: Traybar support ?

2017-10-04 Thread Aiesha_Nazarothi
That thing: [https://github.com/zserge/tray](https://github.com/zserge/tray) :sounds like an option, though I'm unsure. AFAIR Nim can include .c/.h files directly, no ?

Re: Safe sdl2 wrapper library?

2017-10-04 Thread wizzardx
I've started playing with a port of pygame_sdl2 over to Nim. Probably won't go anywhere, but I'm having fun with it [https://github.com/renpy/pygame_sdl2](https://github.com/renpy/pygame_sdl2) And occasionally jumping between that and trying to re-implement some really basic parts of Ren'Py

Re: Hacktoberfest project contributions?

2017-10-04 Thread mratsim
@perturbation, Thanks for your interest. Many of the low hanging fruits in Arraymancer are done but I could use your help in implementing reduction functions like "max", "min", and in-place functions like msqrt, msin, as mentioned here:

Re: Another reason to deprecate ..

2017-10-04 Thread mratsim
To be honest I also find ... Ruby syntax illogical (not a Rubyist, coming from Python) Triple dot are probably a source of silent bugs that are also harder to catch in code reviews. Also I think ..< better convey the meaning of mathematical exclusive range [a, b[ vs inclusive [a, b] Now

Re: OpenMP and Nim

2017-10-04 Thread mratsim
What kind of advanced usage do you need? You can always resort to the {.emit.} pragma to emit raw OpenMP pragma. Also [QEX](https://github.com/jcosborn/qex/blob/master/src/omp.nim) by jcosborn is probably the one using it the most as he even implemented barriers.

Re: How to

2017-10-04 Thread cdunn2001
> I come from the Land of Java ... I guess my "pain threshold" for long names > is higher. @monster, My problem is that I am porting code from other languages. I want to follow the directory structure of Python **networkx**. For example, I want something in a directory path like

Re: Another reason to deprecate ..

2017-10-04 Thread cdunn2001
@jzakiya, everyone knows that Ruby has a great community and has been a highly successful language. I don't think any offense was intended. Could you make your code and tests available? If you results can be reproduced, they would make a stronger case. If nothing else, I would code "a..(b-1)"

Re: Another reason to deprecate ..

2017-10-04 Thread jlp765
It should be noted (for completeness) that with a Garbage Collected language, the GC can add random timings into the benchmark. I have also found that when benchmarking, also switch around the order of two tests within the code, because that also changes things (can trigger the GC differently,