Re: Using Plotly.js in Nim

2017-09-22 Thread Tiberium
Well you would wrap this functions too? And I really think you should make it a real wrapper

Re: Using Plotly.js in Nim

2017-09-22 Thread sdwfrost
PS. One more thing; the more sophisticated examples using Plotly.d3.csv, Plotly.d3.json etc. (see [here](https://plot.ly/javascript/)). How can this nested structure be kept in Nim?

Re: Nimscript: setLen segfaults?

2017-09-22 Thread Tiberium
Udiknedormin: can you post a code example? And also create an issue on github

Nimscript: setLen segfaults?

2017-09-22 Thread Udiknedormin
When I used keepItIf in a nimble scirpt, it segfaulted. After copy-pasting the templates body and trying to play with it a little bit it turned out setLen was the one to blame. If I replace moving the elements to adding them to another seq and then assign it to the original one, everything

Re: Introducing Reel Valley

2017-09-22 Thread yglukhov
@Udiknedormin, yuriy dot glukhov gmail

Re: Introducing Reel Valley

2017-09-22 Thread Udiknedormin
@yglukhov May I have your e-mail address or sth so I can provide you with details?

Re: TIL more about imports

2017-09-22 Thread Udiknedormin
@jester I said two **modules** with the same name, not just two modules that provide two things with the same name. More like: import graphics.settings import sounds.settings sth_they_share() # error: which one? settings.sth_they_share() # error: which

Re: Success - calling custom CUDA kernels from Nim

2017-09-22 Thread Udiknedormin
That's really good news. It means it should be 100% safe for programs not requiring more GPU memory than what your GPU can actually offer. For the ones that do, I would advise you to use regions or write RAII-like templates yourself as I don't think there is any way for Nim's GC to handle GPU

Re: Providing writable string buffer to a foreign C-function

2017-09-22 Thread Udiknedormin
Maybe add a single proc to update a string if its cstring is modified separately? It would make this example much easier and the implementation seems easy assuming we cstring's memory is still within the string capacity. It seems to me it could be pretty nice to have such a proc in stdlib,

Re: Get a constant passed to a macro call

2017-09-22 Thread Udiknedormin
Nooo, I'm not THAT silly to not be able to code sth like that if I needed to, you know? Two problems with your solution: 1. You do NOT actually get the constant, you just use it's AST to generate code with it. I need to access the constant in the macro itself (for example iterate over

Re: TIL more about imports

2017-09-22 Thread jester
@Udiknedormin: # # Both provide baz(x:int) # import foo import bar proc main = # No conflict if the code doesn't use baz. # Unqualified use of baz causes an error because it is ambiguous. # baz(1) # Qualified uses of baz

Re: Introducing Reel Valley

2017-09-22 Thread yglukhov
@spamsalty, I've written a [small article](https://yglukhov.github.io/Making-ReelValley-Overview/) that should cover your question as well. @leledumbo, hehe, thanks! Don't gamble too much, write something in Nim as well!

Can't install Nim on Windows 8 32 bit

2017-09-22 Thread dangkhoa
Hi all, I have downloaded Nim 0.15.2 and read the text file. As per the text file, i run the finish.exe but nothing happened. There are 22 items in my Nim folder and it weighs 42.67 MB. I copied this folder to C drive and run the same file again. But no way. What i did wrong. I would like to

Re: Success - calling custom CUDA kernels from Nim

2017-09-22 Thread mratsim
I double-checked and the cuda driver releases all GPU memory allocated by a program upon termination. I also have addQuitProc to make sure I release all my handles. I guess I'll also add a GC_fullCollect to the exit procedure.

Re: TIL more about imports

2017-09-22 Thread cdunn2001
> I am interested in what conflicts you have, so that you really want to use > the from foo import nil pattern. I _always_ use that pattern, if possible. Well, I sometimes use a bare import so that templates will compile. But I avoid it. I write code for other people to read. I _hate_ reading

Re: Subtle memory management error found

2017-09-22 Thread cdunn2001
> Deprecating unary < is growing on me, it's always used with .. and so "..<" > can be used instead. +1

Re: Introducing Reel Valley

2017-09-22 Thread leledumbo
> I'm proud to announce that another game written in 99.99% pure Nim is online > now. You can play it on Facebook. Mobile version is coming later on. Comments > are welcome! =) I hate you, IT'S TOO ADDICTIVE!!! :v :v :v

Re: Introducing Reel Valley

2017-09-22 Thread spamsalty
How was Nim when it comes to JS backend?

Re: Using Plotly.js in Nim

2017-09-22 Thread jlp765
This is an excellent example (YMMV). It raises a question: `Is there a guide for JS development in Nim?` I looked in the "docs", and "learn" and came across [Nim backend integration](https://nim-lang.org/docs/backends.html#nim-code-calling-the-backend-javascript-invocation-example) Should an

Using Plotly.js in Nim

2017-09-22 Thread sdwfrost
Dear All, I was playing with wrapping Javascript libraries in Nim, and I thought I would try [Plotly.js](https://plot.ly/javascript/). My first go is [here](https://github.com/sdwfrost/nim-plotly-example). I'm sure I'm breaking tons of good practices here, so any tweaks to the code would be