Re: Bug (?) with templates

2018-01-02 Thread Stefan_Salewski
template bar() = echo a template foo() {.dirty.} = let a = 5 bar() foo() echo a I would expect exactly that behaviour. As templates a hygienic by default, we need dirty pragma for foo() to make variable visible outside.

slice from openarray?

2018-01-02 Thread animosity
I'm trying to get a slice from an open array and there seems to be a type mismatch error. Is there any way around this? proc xxx(r: openarray[int]) = processRow(r[0..9]) <- type mismatch ...

Re: Deadlock using threadpool from a forked process.

2018-01-02 Thread luked2
There's no guarantee that the problem that valgrind is reporting is the cause of your bug of course. Anyhow, the code in question looks to be this, in threadpool.nim: proc nimSpawn3(fn: WorkerProc; data: pointer) {.compilerProc.} = # implementation of 'spawn' that is used by t

Re: Deadlock using threadpool from a forked process.

2018-01-02 Thread luked2
I tried running your code under helgrind. valgrind --tool=helgrind test It reported a data race: ==24599== ==24599== ==24599== Possible data race during read of size 8 at 0x33B168 by thread #1

Bug (?) with templates

2018-01-02 Thread zielmicha
This doesn't work: template bar() {.dirty.} = echo a template foo() = let a = 5 bar() foo() but this does: template bar() {.dirty.} = echo a template foo() {.dirty.} = let a = 5 bar()

Re: Any tips on how I might go about narrowing down the cause of this OSX specific error?

2018-01-02 Thread guibar
Hello, I also got this error on OSX with an older Mac ( MacBookPro Late 2011). I got this error too on the Linux partition (KDE Neon =~ Ubuntu 16.04) using clang (oddly, gcc is fine). The program is compiled with `-mavx2`, but the cpu of my Mac supports up to AVX instructions. Depending on the

Re: ASM on Windows basically dead?

2018-01-02 Thread monster
@jackmott I'm confused by your question. I thought that calls like _InterlockedExchangeAddNoFence64() _were_ intrinsics, therefore, isn't that what I'm already trying to do? (But failing for some unclear reason, since the failure is at link time, where they should already have been "replaced") U

Re: ASM on Windows basically dead?

2018-01-02 Thread jackmott
can you implement the same with intrinsics? That is generally the recommendation from Microsoft now.

Any tips on how I might go about narrowing down the cause of this OSX specific error?

2018-01-02 Thread jackmott
I have a SIMD project that does CPU feature detection and uses macros to provide a nice SIMD api, and the sample app works for me on Windows, and Linux, but a user has reported an issue on OSX: [https://github.com/jackmott/nim_simd/issues/4](https://github.com/jackmott/nim_simd/issues/4) I don'

Deadlock using threadpool from a forked process.

2018-01-02 Thread erhlee_bird
Nim Compiler Version 0.17.3 (2017-10-25) [Linux: amd64] Copyright (c) 2006-2017 by Andreas Rumpf git hash: fa02ffaeba219ca3f259667d5161d30e47bb13e0 active boot switches: -d:release * * * Code: import os except sleep import posix, strutils import threadpool when i

Re: Nim on Ubuntu - only old version?

2018-01-02 Thread federico3
geo555 you can pick packages from Artful Aardvark (the current stable release) or Bionic Beaver. They both ship 0.17.2 and are imported from Debian. There is also HTML documentation in the nim-doc package. [https://launchpad.net/ubuntu/+source/nim](https://launchpad.net/ubuntu/+source/nim)