Re: Nim Repository Template for GitHub

2019-07-23 Thread Tristano
Hi @Araq, sorry for the late reply, > Hey, wait a second, I didn't say that! I said git shouldn't touch the > newlines. The reason I said "I've learned that..." is because of tools like c2nim output Nim sources with LF even on Windows (that was the original question on the repository Issue). S

Re: Passing a type through a macro?

2019-07-23 Thread zevv
Well, do I feel _stupid_ now :) Thanks!

nimble is not installing nimongo

2019-07-23 Thread marihanz
I'm using manjaro, and my nim version is 0.20.0. I'm trying to install nimongo with nimble using this command: $nimble install nimongo But I get an error which says, "Error: Could not read package info file in /tmp/nimble_21023/githubcom_SSPkroliknimongo/nimongo.nimble; ... Reading as ini file

Re: Passing a type through a macro?

2019-07-23 Thread jasper
@zevv Like this? [https://play.nim-lang.org/#ix=1Pjn](https://play.nim-lang.org/#ix=1Pjn)

Re: Passing a type through a macro?

2019-07-23 Thread zevv
@kaushalmodi: also tried the static variants, no luck @jasper: No reason other then I just happened to write down these two of the numerous posibillities I have tried - `proc gen(T: NimNode): NimNode` also doesn't work. Have I hit some bug?

Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-23 Thread Libman
> > Is having a "std" GUI / drawing / clipboard / etc lib really so important > > when there are non-"std" candidates in nimble? > > Yes, quite a lot. Std GUI lib means that you can and will be able to make ui > using same code for every compatible platform and 90% extensions (like custom > con

Re: Passing a type through a macro?

2019-07-23 Thread jasper
The `getAst` template gets expanded before `getAst` is called for generic proc. This may be a bug. Is there any reason you want to pass the arg as a `typedesc` instead of plain `NimNode`? If not, the signature `proc gen(T: NimNode): NimNode` should work.

Re: Passing a type through a macro?

2019-07-23 Thread kaushalmodi
I don't have the full solution, but I believe a `static` type `typedesc` arg will get passed without conversion to NimNode? I think there's an example in tut3.

Passing a type through a macro?

2019-07-23 Thread zevv
I have been trying to figure out how to get this working for the last few days, but no luck yet. Consider this snippet: template skel(T: untyped): untyped = let fn = proc(): T = echo "I am fn" fn proc gen(): NimNode = result = getAst skel(int)

Re: Hyphens Not Allowed in Nim Filenames? [Invalid Module Name]

2019-07-23 Thread Araq
It came up before, it does cause some head-scratching / friction, it is little effort to support it, we should support it. We don't have to tell people "don't use that" because why not... Nim should get out of the way, Nim is not about petty rules.

Passing a type through a macro to a generic?

2019-07-23 Thread zevv
How can I pass a type through a macro to instantiate a proc with the given type? Heavily reduced from my real code, I end up with something like this: import macros proc bar[T]() = var a: T echo "T=", typeof(a)# <-- T=NimNode, but want int

Re: Nim standard library on embedded platforms

2019-07-23 Thread endes
I'm using `--os:standalone` (this is my full parameters list `--os:standalone --gc:regions --cpu:mips --define:StandaloneHeapSize=32 --opt:size`), but Nim still includes a call to `stderr` and import `io.nim`.

Re: Nim standard library on embedded platforms

2019-07-23 Thread dom96
You should be able to use this for clues: [https://github.com/dom96/nimkernel](https://github.com/dom96/nimkernel) (it's likely that things have changed since and that it's broken now) TL;DR: try `--os:standalone`.

Nim standard library on embedded platforms

2019-07-23 Thread endes
Hi, time ago I made a project for use Nim on arduino for esp8266. Now I'm starting a more ambitious project to use Nim on many different embedded platforms. But I have 2 problems. 1. In the generated code, Nim includes a call to `stderr` due to proc `raiseOutOfMem` in `mmdisp.nim`. Is there a

Re: Problem getting address using recvFromInto

2019-07-23 Thread dom96
> I'm using FreeBSD which has an extra unsigned char called sa_len at the > beginning of the struct. I don't know if this is contributing to the problem. Try adding it and see if that helps. By the way, since you're already messing around with UDP and async. Maybe you'd be interested in impleme

Re: Hyphens Not Allowed in Nim Filenames? [Invalid Module Name]

2019-07-23 Thread federico3
It's also quite common to use hyphens in project names, git repositories and project home pages - including many projects in Nimble. Being able to keep consistent naming across project name, filenames, executable name and imports instead of a random mixture of "my-project" "my_project" and "myp

Problem getting address using recvFromInto

2019-07-23 Thread nealie
I'm receiving multicast UDP packets, which works fine, but I don't seem to be getting a valid address returned after I call asyncdispatch.recvFromInto. Here's a fragment of my code: > var > message = newString(1000) sock_address: SockAddr sock_address_len: SockLen > > > while true: >

Try our cash back

2019-07-23 Thread naderinvstoc
Invstoc “ I did it . you can do it too “ Do you think trading binary option is complicated ? That’s what I used to think before I started trading with invstoc . now I have a steady income that helps pay for my tuition . Try our cash back www.invstoc.com [https://www.invstoc.com/cashback](ht

Re: Anyone using D3.js?

2019-07-23 Thread mratsim
I did not use D3.js directly but I did use a charting library relying on D3.js. Here is a proof-of-concept of how I wrapped a JS lib: [https://github.com/numforge/monocle/blob/cfedeff642b7e67161b6abffc2a1edaf93b030ad/src/monocle/viz.nim#L20-L30](https://github.com/numforge/monocle/blob/cfedeff642

Re: Wrap C library that needs CMake

2019-07-23 Thread hugogranstrom
Yep, have noticed the same (and filed the issue @shashlick mentioned). The way I solved it for the meantime was by copying the type definitions into a separate header file and importing it.