Re: Why macros can't find a local module?

2018-04-01 Thread r3d9u11
yes, it works without macro. probably, your code works because strutils is a global module.

Re: Why macros can't find a local module?

2018-04-01 Thread c0ntribut0r
Heres a [macro for importing by string](https://forum.nim-lang.org/t/3547/1#22257), try it out

Re: Memory usage skyrocketed with nim 0.18.0 (in my async tcp service test)

2018-04-01 Thread Araq
Well you have a logical memory leak in your code, you keep adding things to you sequence, `clients.add client`. If async is faster, it fills up your sequence faster. In a memory constrained environment, don't have logical leaks.

Re: Memory usage skyrocketed with nim 0.18.0 (in my async tcp service test)

2018-04-01 Thread jcosborn
Can you try testing with the Nim devel branch? Some allocator bugs have been fixed there.

Re: Why macros can't find a local module?

2018-04-01 Thread r3d9u11
Thanks for hint, but idea that module name isn't hardcoded and contained inside of string.

Re: Why macros can't find a local module?

2018-04-01 Thread mashingan
This can: import macros macro loadModule(): typed = result = quote do: import mymodule loadModule()

Memory usage skyrocketed with nim 0.18.0 (in my async tcp service test)

2018-04-01 Thread aguspiza2
I have done a little test to find out if I could run some microservices with async code in memory constrained devices. Here is the test code: [https://gist.github.com/aguspiza/80e34b5cf65aa3bbfd19c7339ee9b695](https://gist.github.com/aguspiza/80e34b5cf65aa3bbfd19c7339ee9b695) That test uses 5x

Why macros can't find a local module?

2018-04-01 Thread r3d9u11
Hi. Why a local module can't be found at macro-time? myModyle.nim: echo "myModule loaded" main.nim: macro loadModule(): typed = result = parseStmt("import myModule") loadModule() # will rise exception "cannot open 'myModule'" Is it possible

Re: Is there any way to create template with await?

2018-04-01 Thread slangmgh
@dom96 is right, it can be done like this: macro withTran(db, body: untyped): untyped = quote do: block: proc action(`db`: apgPoolConnection) {.async.} = `body` let fut = doTransaction(action) yield fut

atomic and ref pointer

2018-04-01 Thread 2vg
Is there a correct way to handle ref object with atomic? Is it a bad way to cast to ptr?

Re: SIGSEGV using lines(filename)

2018-04-01 Thread kinkinkijkin
Thanks! I feel dumb now.

Re: module name collision across nimble packages

2018-04-01 Thread timothee
thanks! actually, import std/times is allowed but not std.times ; shouldn't both be supported?