Re: Arraymancer - A n-dimensional array / tensor library

2017-07-08 Thread cmacmackin
I've been following this for a while on GitHub and I think it is a very impressive project. Nim would be a great language for scientific computing, but it needs to have the numerical libraries and this is an excellent first step in creating them. A couple of questions. First, are you planning

Re:

2017-06-26 Thread cmacmackin
I guess I'll use a converter. I need some additional fields beyond just what's available in a `Table`, so just using an alias won't work, I'm afraid. My hestitation over using a converter is that it means there will be an unnecessary copy operation performed on the `Table`. I guess I'll just

"Inheriting" procs with composition

2017-06-26 Thread cmacmackin
I'm creating a type which contains a table and I want to make all of the table procs works on this new type. Obviously I could manually write a bunch of procs to do this, but that seems quite time consuming. If this were Python I would just inherit from a table (well, dict in Python's case),

Re: Difficulty writing wrapper using FFI

2017-06-05 Thread cmacmackin
@yglukhov I was thinking the same thing.

Re: Difficulty writing wrapper using FFI

2017-06-05 Thread cmacmackin
Adding the bycopy pragma fixed it. I must say, that's a pretty subtle requirement and it could do with a more prominent place in the documentation of the FFI.

Re: Difficulty writing wrapper using FFI

2017-06-04 Thread cmacmackin
Thanks for that suggestion; I've made some progress. You were right to wonder whether it was related to passing parameters by value. It turns out that proc fprint*(value: value_t; stream: File): clonglong {.cdecl, importc: "neo4j_fprint", dynlib: libneo4j.} gets

Re: Difficulty writing wrapper using FFI

2017-06-03 Thread cmacmackin
Thanks for the suggestion. I tried it, but it did not fix the problem. I did use c2nim for the bindings, but it didn't seem to know what to use for uintptr_t. I thought I'd come across a wrapper somewhere which had used cint, but I might be mis-remembering. As you can see, I have renamed the

Difficulty writing wrapper using FFI

2017-05-30 Thread cmacmackin
Hi, I'm quite new to Nim, although I've been following the language for awhile now. This is probably a simple misunderstanding of the FFI on my part, but I was wondering if anyone could advise on why I'm getting the errors I am. I'm trying to wrap the [C