Based on your post I tried various versions. All failed, so I'm still not
getting it. Here's the full scene:
# nim c -d:ThreadPoolSize=8 -d:FixedChanSize=16 renderfunc.nim
import std/[math, monotimes]
import pixie
import malebolgia
const
Width = 800
make sure there are no captures in the call - in your case `image` is
implicitly captured. instead you would want to pass it as a `var Image`. also
the return type should be void as you are not actually returning an `Image`
from that procedure.
also from a cursory glance this may fail because `proc` is probably being
considered as a typeclass here instead of as a concrete procedure type in the
context of `assign()`
**Progress!** I focused on the multi-line `modifyIt` proc and found that the
`svd2nim` code generator passes a **variable** value to some `bitops`. I
rewrote a proc by hand using **constant** values and the resulting assembly was
much more compact. [Here's the
writeup](https://github.com/dwhall
firstly, you probably want `for j in 0..https://github.com/Araq/malebolgia/blob/master/src/malebolgia.nim#L168).
this works for `seq[T]` elements because `[]` returns a `var T` [in the
stdlib](https://github.com/nim-lang/Nim/blob/version-1-6/lib/system.nim#L2644)
whereas pixie defines a `[]=` (a
Any place where I can get discounted copies (or purchase parity) copies of _Nim
in Action_ and _Mastering Nim_ paperbacks?
I'm from India. Both books are quite expensive in India. _Mastering Nim_ is not
available in Amazon India.
@planitis, thanks for mentioning. Never noticed it.
@PMunch `var Image` results in the same error
I really like this blog's style! Thanks for sharing!
Sorry, I am writing through a translator since I am from Ukraine. Is it
possible to use your library to download files and show download progress in
the terminal?
The [.nimble file in
Jester](https://github.com/dom96/jester/blob/master/jester.nimble) is still at
version 0.5.0, so Nimble sees the tag, downloads it, doesn't see the correct
version number in the repo, and errors out.
Try making `Image` into a `var Image` in your parameter list. The error is a
bit vague, but essentially Nim doesn't allow you to get a pointer to
non-mutable data.
Thanks both! That fixed the problem. It would be good to have a fix. But if
that's a low priority concern then perhaps a stop gap warning with relevant
information to work around.
I was really wanting to install the just-released v0.6.0 of Jester, but:
* `nimble install` tries to reinstall v0.5.0
* `nimble install@0.6.0` acknowledges I want v0.6.0 but can only give me
v0.5.0
Am I trying this too early?
Thanks to those that worked on the new version of Jester.
I can't answer the original question but the last line `m.spawn rand(100) ->
s3[x,y,z]` is not threadsafe, there should be a compile warning at least. And
its documented in the random module.
In an attemt to speed up rendering of a function to image using Malebolgia and
pixy I ran into a problem. It is my first attempt at doing anything multi
threaded.
The original proc that works fine:
proc renderXYFunc1(
image: Image, #from pixy
function: proc,
funcV
15 matches
Mail list logo