<< 24-01-2018 >>

00:03:07*marenz_ joined #nim
00:05:12*Ven` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:37:49*ludocode joined #nim
00:38:43*MJCaley joined #nim
00:40:37user0Hi. The error message says that the compiler cannot insantiate StackObj. Not very helpful. What am I doing wrong? https://play.nim-lang.org/?gist=72761afd37d872771e9e8efcde38df65
00:45:45*dddddd quit (Remote host closed the connection)
01:09:28*marenz_ quit (Ping timeout: 268 seconds)
01:19:51*craigger quit (Quit: bye)
01:23:56*craigger joined #nim
01:25:06*craigger quit (Client Quit)
01:27:33*mal`` quit (Quit: Leaving)
01:28:34*craigger joined #nim
01:31:45*craigger quit (Client Quit)
01:33:57*tinAndi quit (Ping timeout: 264 seconds)
01:37:21*mal`` joined #nim
01:40:48*craigger joined #nim
01:55:36*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
01:59:47*craigger quit (Quit: bye)
02:10:44*craigger joined #nim
02:13:47*craigger quit (Client Quit)
02:22:09*chemist69 quit (Ping timeout: 265 seconds)
02:23:01*craigger joined #nim
02:25:10*craigger quit (Client Quit)
02:27:49*MJCaley quit (Quit: MJCaley)
02:28:29*sz0 joined #nim
02:29:23*craigger joined #nim
02:34:28*craigger quit (Quit: bye)
02:35:32*chemist69 joined #nim
02:40:46*craigger joined #nim
03:01:32*craigger quit (Quit: bye)
03:02:08*gokr quit (Quit: Leaving.)
03:03:24*craigger joined #nim
03:37:47*vlad1777d quit (Ping timeout: 256 seconds)
04:04:18*endragor joined #nim
04:05:22*endragor quit (Remote host closed the connection)
04:05:56*endragor joined #nim
04:16:14*yglukhov joined #nim
04:20:45*yglukhov quit (Ping timeout: 264 seconds)
04:37:23*sz0 quit (Quit: Connection closed for inactivity)
04:57:17GitDisc<awr> @user0 the return type of newStackObj should be StackObj[T] instead of just StackObj
04:59:45*c0ntribut0r quit (Ping timeout: 260 seconds)
05:00:11user0Thank you, awr
05:01:02*c0ntribut0r joined #nim
05:22:55*c0ntribut0r quit (Ping timeout: 268 seconds)
05:23:38*c0ntribut0r joined #nim
05:30:07*c0ntribut0r quit (Ping timeout: 248 seconds)
05:32:58*c0ntribut0r joined #nim
05:40:36*tinAndi joined #nim
05:41:13*user0 quit (Quit: user0)
05:41:35*c0ntribut0r quit (Read error: Connection reset by peer)
05:41:46Araqhmm does anybody know here how asymmetric encryption really works?
05:41:53*c0ntribut0r joined #nim
05:50:23*tinAndi quit (Ping timeout: 248 seconds)
06:04:02*gokr joined #nim
06:18:17*nsf joined #nim
06:31:54*Lord_Nightmare2 joined #nim
06:33:05*Lord_Nightmare quit (Ping timeout: 260 seconds)
06:33:06*Lord_Nightmare2 is now known as Lord_Nightmare
06:44:27*cspar__ quit (Ping timeout: 240 seconds)
06:54:05*c0ntribut0r quit (Ping timeout: 260 seconds)
06:54:43*c0ntribut0r joined #nim
06:55:31*cspar joined #nim
07:00:00*endragor quit (Remote host closed the connection)
07:03:54*c0ntribut0r quit (Ping timeout: 246 seconds)
07:05:34*c0ntribut0r joined #nim
07:05:55*rauss quit (Quit: WeeChat 2.0.1)
07:07:08*rauss joined #nim
07:13:16*solitudesf joined #nim
07:16:22*cspar_ joined #nim
07:19:27*cspar quit (Ping timeout: 240 seconds)
07:24:10*couven92 joined #nim
07:25:45*endragor joined #nim
07:27:51FromGitter<data-man> @Araq: What's so complicated? Simple math. :)
07:30:05*endragor quit (Ping timeout: 240 seconds)
07:32:53Araqthanks, got it covered, never mind
07:34:57miranAraq: yesterday you talked about cleaning up some keywords.... how about `countup` and `countdown`?
07:35:56Araqthese are not keywords.
07:36:10Araqand what's wrong with them?
07:37:37miran1. feels strange do have different names depending if you're going up and down. 2. there's no `..` equivalent when the step is not 1
07:39:00Araqon the contrary, using the same word for both directions doesn't work.
07:39:04miranis there a possibility to have something like: `5 .. 15 | 2` or `5, 7, .. 15` or something that has a possibility to define a step?
07:39:34Araqsure but not covered by the stdlib
07:40:19miranah, ok.... :'(
07:48:07*dddddd joined #nim
07:54:37*c0ntribut0r quit (Ping timeout: 268 seconds)
07:55:50*c0ntribut0r joined #nim
07:57:44Araqmiran: countdown is rare, countup not and so "countup by 1" got the ".." shortcut
07:58:56*endragor joined #nim
07:59:01miranAraq: ...and "countup by X" is also rare, so no need for shortcut, i guess?
07:59:11Araqyes
08:07:27gokrOk, so I am battling the endless gc-safe issues... Could I mark procs as safe?
08:08:36gokrI am trying to make the nim-mqtt wrapper work unblocking and... I get a proc saying "is not GC-safe as it performs an indirect call here"
08:09:30gokrWe talked about this Araq, but... I don't recall exactly what we ... said.
08:10:03Araqme neither
08:10:27Araqif you are in control of the "proc callback type", add a {.gcsafe.} to this type
08:10:44Araqif not, you're kind of losing the game but can make the compiler shut up via
08:10:49Araq{.gcsafe.}:
08:10:50gokrMmmm.
08:10:53Araq code block here
08:11:35gokrHmmm, I thought I just did.
08:11:54gokroh, ok, perhaps another on.
08:11:57gokrone.
08:14:47Araqmiran: https://gist.github.com/Araq/701565f110abd65801fbaea03143c24d
08:16:32gokrI'll be damned if I didn't get it to work.
08:16:33*c0ntribut0r quit (Read error: Connection reset by peer)
08:16:39*endragor quit (Remote host closed the connection)
08:16:42gokrNot sure if it will blow up, but... hasn't yet.
08:17:06gokrNow I just need federico3 to fix up nim-httpauth :)
08:17:18gokrfederico3: Yo man! ;)
08:20:22*c0ntribut0r joined #nim
08:22:13*endragor joined #nim
08:23:32*endragor quit (Remote host closed the connection)
08:23:39*endragor joined #nim
08:30:56*floppydh joined #nim
08:32:03*yglukhov joined #nim
08:33:12*xkapastel quit (Quit: Connection closed for inactivity)
08:49:40*PMunch joined #nim
08:50:01*c0ntribut0r quit (Ping timeout: 256 seconds)
08:50:22*c0ntribut0r joined #nim
08:50:32miranAraq: nice, thanks!
08:53:27*yglukhov quit (Ping timeout: 240 seconds)
08:53:27FromGitter<Bennyelg> @Araq, this piece of code blowed my mind. Nim is so clean & beautiful 🔥
08:54:51miran...to bad it won't be in the stdlib ;)
08:54:55miran*too
08:55:32AraqI don't mind putting it the stdlib, but I do mind more system.nim extensions
08:56:30Araq(btw the code can be simplified further)
08:57:09miranto me this syntax is much more beautiful/elegant than using countup/countdown whenever i'm not increasing by one
08:59:29*dddddd quit (Remote host closed the connection)
09:00:02miranfsharp has `1..2..9`, haskell has `2,4..20`
09:01:08miranarraymancer has `2..10|2`
09:03:27*gmpreussner quit (Ping timeout: 248 seconds)
09:05:27*gmpreussner joined #nim
09:05:32*yglukhov joined #nim
09:06:05*gangstacat quit (Ping timeout: 256 seconds)
09:10:42*Arrrr joined #nim
09:10:42*Arrrr quit (Changing host)
09:10:42*Arrrr joined #nim
09:29:03FromGitter<alehander42> stepping syntax would be nice indeed, wondered about that and registered countup/countdown as translations in py2nim for that purpose
09:36:03*Vladar joined #nim
09:38:40FromGitter<tim-st> tikz has {1,7,...,n}
09:45:24*stisa quit (Remote host closed the connection)
09:59:55*Yardanico joined #nim
10:04:49*c0ntribut0r quit (Read error: Connection reset by peer)
10:07:33*c0ntribut0r joined #nim
10:29:45*user0 joined #nim
10:30:53*sz0 joined #nim
10:35:29*AndroUser9 joined #nim
10:41:49*Vladar quit (Remote host closed the connection)
10:44:40Yardanicohmm wait, does nim search for .so library in current program directory? it seems it doesn't for me
10:44:50Yardanico(with dynlib pragma)
10:45:33Yardanicocopying this .so files to one of these directories work, but I don't want to copy my .so to system libs :)
10:45:52user0While creating a stack data structure is it more reasonable to use linked list or just plain vectors?
10:46:26*BitPuffin joined #nim
10:46:34Araqseq
10:46:54AraqYardanico: it doesn't do that because it wouldn't be Unixy.
10:47:11AraqUnixy is another word for "broken".
10:47:29YardanicoAraq, hmm, ok then
10:51:29*solitudesf quit (Quit: solitudesf)
10:55:33*c0ntribut0r quit (Ping timeout: 264 seconds)
10:55:59gokrSorry to say I need to drop Nim from the getcanoe.io project. I have now been banging my head against the mqtt library for hours and I just can't make this stuff work.
10:59:40Araqgokr: we can help if we can see some code snippets
11:00:48gokrYeah, but... it's unfortunately a pattern emerging. Jester is async, redis is async. Ok, fine. Then mqtt is not async, so... PAIN.
11:01:27gokrAnd I can't make it play nice - it was hard enough to whip up a thread with a channel etc - so that I could at least publish.
11:02:09gokrBut... getting these callbacks going - I am failing it. foreignThreadGC and allocShared and whatnot - I have no idea. And then it's not even integrated with the asyncdistpatch stuff.
11:03:14gokrAlso, canoed dies 2-3 times per day, buffer overflow somewhere down in libc.
11:04:16gokrSo even if the HTTP and JSON parts are kinda nice... well, I dunno. I have too little spare time.
11:04:34Araq:-( understandable
11:05:03gokrI tried integrating nim-httpauth but ... it failed too - since my MQTT code uses threads:on and a channel - and nim-httpauth blew up on gc-safe-stuff.
11:05:39gokrSo ... hours piling up and feeling out of depth to fix these things.
11:07:34gokrIt's basically the MQTT bits that's missing. Had there been an async MQTT lib, perhaps things would have played out fine.
11:08:02gokrredis, postgres, Jester - that stuff works fine.
11:08:07YardanicoWhat is the current way to convert array of chars to cstring? cstring(addr module.name) ?
11:08:33Yardanicomodule.name is an array of chars
11:09:15AraqYardanico: seems correct
11:09:37Araqgokr: yeah there are so many protocols that Nim lacks support for -.-
11:09:45PMunchgokr, wait what are you doing?
11:09:52PMunchThis is the MQTT to web thing right?
11:10:15gokrPMunch: I started a project to build a cross platform wallet (with server side) for Raiblocks.
11:10:18gokrgetcanoe.io
11:10:41Araqgokr: is it open source? if so you can push it to a branch and let me have a look at the .gcsafe problems
11:10:44gokrWe are 4 people working on it, almost 27 people joined up doing translation of the app, quite a lot of momentum.
11:10:51gokrAll open source
11:11:01*Vladar joined #nim
11:11:47gokrSo the wallet communicates with the backend at getcanoe.io - using both HTTP (Jester) and MQTT was the idea.
11:12:14gokrThe backend in turn talks to a rai_node (the official Raiblocks node) using HTTP RPC.
11:13:27PMunchRight
11:13:28gokrAraq: I can put out what I have. I hacked around inside mqtt - to try making it work async (not asyncdispatch). But I got stuck.
11:13:47PMunchBut why do you need MQTT to be async?
11:14:09*gangstacat joined #nim
11:14:30gokrJester code needs to publish and subscribe to MQTT stuff. Right now.. it does so via a channel to another thread, but that thread makes blocking calls to the mqtt lib.
11:14:48gokrwith 20 ms timeout, so a kindof loop there.
11:15:31gokrIt feels really icky, but... ok, fine, I could perhaps live with that.
11:16:08*c0ntribut0r joined #nim
11:16:22gokrBut then I failed with nim-httpauth since it doesn't like threads:on
11:16:50gokrAnd well, rabbit hole started.
11:17:09PMunchWhat blocking calls? I had a look at the MQTT wrapper and it seems like it would be a simple matter to just set up one callback, then keep a list or table of topic->channel bindings and have it find the correct channel to send the message over back to the Jester code
11:17:31PMunchYeah the httpauth/threads:on issue sounds a bit worse..
11:17:36gokrThings just keep biting me. Like... redis - ok, so I can't create a redis client on global level since NIm complains on gc-safety.
11:18:00gokrProbably because I have threads:on
11:18:20gokrI end up doing .threadvar. yadda yadda
11:18:22Araqnimsuggest has --threads:on too
11:18:33Araqbut it doesn't use much of the stdlib I guess
11:18:49Araqit's a good point, we need to make it the default, at least for testing things
11:19:40gokrPMunch: Problem is ... the setCallbacks() stuff in the MQTT lib doesn't work.
11:20:21gokrPMunch: Which is what I have been battling today for several hours.
11:20:36*endragor quit (Remote host closed the connection)
11:20:53PMunchDoesn't work?
11:21:07*endragor joined #nim
11:21:35gokrNot gc-safe, and then... when I tagged some things as gcsafe - it blew up in callback code - and then I added setupForeignGC - and then it got a bit further, and now blows up and I have no clue.
11:22:44Araqoh I see
11:22:56Araqit runs the callbacks on some random thread
11:23:00gokryup
11:23:05AraqNim has no control over
11:23:18Araqthat's like the worst thing that can be possible done :-)
11:23:25gokrAnd it has a context thingy where it has stuffed in the three callback procs - and it tried to call them
11:24:01PMunchWell, since you're running the MQTT code in it's own thread I guess you could do it this way: https://github.com/barnybug/nim-mqtt/blob/master/examples/sub.nim
11:24:11PMunchThen you don't need the setupForeignGC stuff
11:24:34gokrPMunch: Which is exactly what I did - with a 20 ms timeout
11:24:59PMunchWhy such a short timeout?
11:25:17gokrWell, I do want that thread to also be able to publish?
11:26:05gokrSo I block on that call, then I use tryRecv on the channel (anything I should publish?) then back to that call (anything coming in?) etc
11:26:39PMunchAaah, you want it to also publish
11:26:53gokrTo me it seems that... Nim needs a better story on integrating with libraries that use threads.
11:27:59Araqthat's actually covered by my Nim v2 proposals
11:28:11gokrRight now... I guess channels is the way to go - but ... not sure.
11:28:48gokrSo this mqtt lib, it registers its internal callback procs - fine. And I suppose they should stuff something onto a channel and be gone.
11:29:30gokrInstead of using this context object with callback procs etc, we can't really call them anyway because we are in a foreign thread, right?
11:29:49gokrI mean, we could call, but the pain just continues.
11:32:15gokrThis is the trouble area: https://github.com/barnybug/nim-mqtt/blob/master/src/mqtt.nim#L141-L170
11:32:17*Vladar quit (Remote host closed the connection)
11:32:41gokrThe context thing on line 160 - I moved that to line 166 and used allocShared0
11:33:05gokrThen I threw in setupForeignGC() on line 142
11:33:23gokrBut... on line 152 - it goes boom anyway.
11:33:40gokrAll looks good until line 152.
11:36:08*Yardanico quit (Remote host closed the connection)
11:36:57PMunchUhm, it looks like that might be a GC issue
11:38:07PMunchHe creates a Context value, but he never does the GC_ref thing
11:38:21gokrhttps://github.com/gokr/nim-mqtt
11:38:28gokrI threw up my hack there
11:38:55PMunchAnd he then casts random pointers he gets from the MQTT library to the Context type
11:39:12gokrHere you can see exactly what I did: https://github.com/gokr/nim-mqtt/commit/224160f2d12d069142f9422eecccc6f1b753dd20
11:39:28gokrIt blows up right after "All good" :)
11:39:33PMunchSo the MQTT library holds the pointer to the Context, but since Nim doesn't know about it any longer it will garbage collect it and free the memory causing crashes
11:39:58gokrMmmm, but check my link above - I used allocShared0
11:41:01dom96mqtt appears to just be a wrapper to a C lib :\
11:41:04gokrHe held the context in a global. I moved it (gc-safety) and tried allocShared0 instead
11:41:12dom96I see a lot of `pointer` which is just messy and asking for trouble.
11:41:16gokrdom96: It is, it's the PAHO C lib, tried and true.
11:41:22dom96Do you need to use MQTT?
11:41:32gokrHehe
11:41:52gokrWell, I am now possibly leaning towards WAMP - but Nim doesn't have that either
11:42:07PMunchHmm, yeah in your file it looks like it should work..
11:42:22gokrMQTT works very well, we have used VerneMQ in many projects and the js lib is stable and good.
11:42:34gokrIt's king in IoT.
11:43:00gokrdom96: It's pub/sub you know.
11:43:19gokrThere is a beginning of a Nim mqtt implementation though - but very barebone.
11:43:27dom96Write a native pub/sub implementation in Nim? ;)
11:43:28gokrAnd to be frank... it's not trivial.
11:43:44gokrWell, I am trying to make Canoe ...
11:43:52dom96yeah, I know.
11:44:18gokrIf any of you would help out - it would change the story of course. It's a really cool project (Raiblocks and Canoe).
11:44:26*Yardanico joined #nim
11:44:56gokrWe actually got 150 XRB in anonymous donation - that was earlier almost $4500.
11:45:48dom96if you're willing, another thing you could try is creating a separate process to handle the MQTT stuff
11:45:57dom96I don't know how realistic this is
11:46:04dom96you could communicate with it via sockets
11:46:08gokrdom96: This is the Nim code btw: https://github.com/getcanoe/canoed
11:46:19gokrVery small so far
11:47:07gokrRight now it doesn't run though - nim-httpauth doesn't mix well with threads:on
11:47:20gokrdom96: Yeah.
11:47:44dom96so is nim-httpauth the only problem currently?
11:47:57*Vladar joined #nim
11:48:07gokrWell... the main problem is the MQTT library that needs threads:on
11:48:14PMunchI think it's mostly a question about writing a better wrapper for the MQTT library
11:48:21gokrThat causes nim-httpauth to fail - gc-safety issues
11:49:12dom96Does MQTT offer no async support?
11:49:17gokrSure... cutting out MQTT... but then the question start popping up - why am I just not whipping it up in node?
11:49:35gokrdom96: It does have an async API - but it doesn't work.
11:49:46PMunchNot cutting out, just fixing the wrapper
11:50:04gokrPMunch: I was referring to the "use a socket with another process"
11:50:14PMunchOh right
11:50:35gokrBut yes, fixing the wrapper would be nice. But unless you make it use asyncdispatch - it still requires threads:on and still makes nim-httpauth barf.
11:50:56dom96if MQTT wrapper has async support then you should definitely try it
11:50:56PMunchYeah..
11:50:58dom96I can help
11:51:04dom96I need to leave for a lecture now
11:51:08dom96brb in like 10 minutes
11:51:08gokrCool
11:51:12gokrSuper
11:51:20PMunchA 10 min lecture`
11:51:23PMunch?
11:51:24gokrHehe
11:51:36gokrHe is a quick learner
11:52:29gokrI wonder if Dominik could asyncify that lib. The lib seems kinda well done, apart from this async stuff that ... is half b0rken
11:53:03*tinAndi joined #nim
11:53:07*samhain joined #nim
11:53:56gokrAn alternative would be to wrap some WAMP library. Anyone used WAMP?
11:53:59PMunchProbably. It appears to be written by someone who didn't quite know how Nim works with foreign libs and threads
11:54:28PMunch"WampServer refers to a software stack for the Microsoft Windows operating system"
11:54:32*PMunch *shudders*
11:54:56gokrwamp-proto.org
11:55:00PMunchBut I guess that's not the one you were talking about :P
11:55:02PMunchYeah
11:55:58PMunchNever used it, but it looks interesting
11:56:12gokrIt does have a whole slew of implementations.
11:56:37gokrAlthough I doubt it's as mature as MQTT.
11:58:43*tinAndi quit (Ping timeout: 256 seconds)
11:58:46*endragor quit (Remote host closed the connection)
11:59:14*endragor joined #nim
11:59:19*endragor quit (Remote host closed the connection)
12:00:25PMunchProbably not
12:00:32PMunchMQTT has been around for a while
12:00:50enthus1astbut MQTT is full of dragons
12:00:58*endragor joined #nim
12:02:17enthus1asthttp://vasters.com/archive/MQTT-An-Implementers-Perspective.html
12:03:37FromGitter<Bennyelg> When Installing Nim from devel (by git clone) where to clone it and compile it if I'm on mac? what is the acceptable place? (Application dir ?)
12:05:20cremI believe its better to do with choosenim, it will do everything automatically somehow. choosenim #head
12:06:09FromGitter<Bennyelg> no, I love to develop from the latest branch, sometimes I'm trying to fix bugs this is how I practice learning the language internals
12:06:37FromGitter<dom96> gokr: PMunch: heh, that's how long it takes to walk to the lecture :P
12:06:59FromGitter<dom96> @Bennyelg I have mine in ~/projects/nim
12:07:17FromGitter<Bennyelg> thanks this is probably what I'll do.
12:07:21FromGitter<dom96> gokr: in what way does the async API not work?
12:07:37FromGitter<dom96> isn't Node basically all async? How does it deal with that?
12:07:59gokrIf you look at this link: https://github.com/gokr/nim-mqtt/commit/224160f2d12d069142f9422eecccc6f1b753dd20
12:08:23gokrYou can see what tweaks I tried to make it work.
12:08:40gokrThe "async" style of that lib is based on using setCallbacks()
12:08:50gokrThere is an example in examples called callbacks.nim
12:09:12FromGitter<dom96> why are you using threads still then?
12:09:20arnetheduckif nim was designed today, would it still use exceptions for error handling?
12:09:45gokrdom96: That's not "Nim async" - it's PAHO C-lib async.
12:10:03gokrMeaning the C-lib has it's own threads doing stuff
12:11:35FromGitter<dom96> so it fakes async with threads? lol
12:11:45FromGitter<dom96> is this the lib? https://github.com/eclipse/paho.mqtt.c
12:11:51*AndroUser2 joined #nim
12:11:51gokrYes
12:11:57*AndroUser2 quit (Client Quit)
12:12:09gokr"fakes async" I would say that.
12:12:22gokrThe C lib has both a blocking API and a non blocking one.
12:12:33gokrIt doesn't claim to be async, sorry if I used the wrong term here.
12:13:07gokrThe callback stuff in nim-mqtt relies on the non blocking API in the C lib, and it uses internal threads.
12:13:21FromGitter<dom96> I see :\
12:13:36gokrit would be awesome if we could make this wrapper ... better.
12:13:45FromGitter<dom96> Then we need to ask Araq how to handle libraries that do this
12:13:54FromGitter<dom96> presumably the callbacks are called in a separate thread?
12:13:55gokrBut I am also not pretending it's an easy task.
12:14:04gokrYes, that's the crux.
12:14:13*AndroUser9 quit (Ping timeout: 256 seconds)
12:14:15gokrThe C lib calls back in its own foreign thread.
12:14:55gokrWe could probably use some channel(s), but I have no idea how to... not use threads:on.
12:15:36FromGitter<dom96> To use channels I think you need to enable threads
12:16:26FromGitter<dom96> I'm sure there are many libraries that behave this way, we need a general way to tackle this
12:16:30FromGitter<dom96> Araq? Any ideas?
12:18:48FromGitter<dom96> I don't see a way that this can work without --threads:on though, if this is the issue then there is no way to get around it.
12:19:04FromGitter<dom96> do your changes to MQTT wrapper work?
12:19:18gokrMy changes... kinda work a bit
12:20:04gokrIt blows up still - and I am not sure why. It blows up here: https://github.com/gokr/nim-mqtt/blob/master/src/mqtt.nim#L155
12:22:21FromGitter<dom96> what does it blow up with?
12:22:41gokrSIGSEGV: Illegal storage access. (Attempt to read from nil?)
12:23:29gokrThe topic etc comes in fine. But at that line, boom.
12:23:40*xet7 quit (Ping timeout: 260 seconds)
12:24:20FromGitter<dom96> hrm, maybe https://github.com/gokr/nim-mqtt/blob/master/src/mqtt.nim#L126 this needs {.cdecl.}?
12:24:55gokrcan try
12:25:13FromGitter<dom96> also https://github.com/gokr/nim-mqtt/blob/master/src/mqtt.nim#L35
12:25:16FromGitter<dom96> that looks wrong
12:26:02FromGitter<dom96> So what about other MQTT-like protocol libraries? Do they offer async?
12:28:55FromGitter<dom96> WAMP seems to have many implementation which suggests that writing one shouldn't be too difficult :)
12:30:54FromGitter<dom96> But yeah, I understand that it's extra work. But there is no getting away from it sometimes. If everyone decides at this point to just use Node then we will all be using Node by 2020. :/
12:32:43*kunev quit (Ping timeout: 256 seconds)
12:33:21*gokr quit (Ping timeout: 264 seconds)
12:33:24*gokr1 joined #nim
12:33:48*Vladar quit (Remote host closed the connection)
12:33:56gokr1dom96: Argh. My machine went thrash-berzerk
12:34:08*kunev joined #nim
12:34:34FromGitter<andreaferretti> Stupid question: if the C library does its own things with its own internal threads, why is Nim multithreading (--threads:on) even needed?
12:34:56FromGitter<andreaferretti> A lot of libraries do that and they work just fine single threaded
12:35:03FromGitter<andreaferretti> I mean from the Nim point of view
12:35:29FromGitter<andreaferretti> For instance, all BLAS implementations will use multiple threads to multiply big matrices
12:35:45gokr1In this case it was needed to have the blocking calls to the MQTT lib coexist with Jester
12:35:55*sz0 quit (Quit: Connection closed for inactivity)
12:35:58gokr1So I had to make a thread and a channel etc - that talks to the mqtt lib
12:36:07FromGitter<andreaferretti> ok I see
12:36:39*xet7 joined #nim
12:37:36FromGitter<dom96> why do you need a thread?
12:37:40FromGitter<dom96> You should only need a channel
12:39:05gokr1Well ...
12:41:18gokr1I tried adding cdecl to ... the callbacks, but nah.
12:42:00gokr1And I really am not sure what those callbacks could do anyway - they are in a foreign thread so can't touch anything.
12:42:17gokr1So moving to some channel API here is probably what one wants to do
12:43:32gokr1Sidenote: setupForeignThreadGC() requires threads:on so... we end up with threads:on anyway.
12:43:49gokr1Since I presume those are needed still in the "inner" callback procs that nim-mqtt uses.
12:46:07FromGitter<dom96> hrm, another issue might be to do with that function. The callbacks are called multiple times, so you'll be setting up the GC multiple times in the same thread, couldn't that cause problems?
12:47:40FromGitter<dom96> can you use zmq btw? It seems to offer a poll function implying it doesn't use threads for async
12:48:40FromGitter<dom96> I think it's time we set up a "library hack"
12:49:08gokr1zmq... is a totally different beast alltogether
12:49:15FromGitter<dom96> where we all create wrappers or libraries for various common scenarios that we ensure work
12:52:20FromGitter<dom96> bbl
12:54:43*endragor quit (Remote host closed the connection)
12:55:10*endragor joined #nim
12:57:26*endragor quit (Remote host closed the connection)
12:57:55*endragor joined #nim
13:02:14*Snircle joined #nim
13:05:02*Yardanico quit (Remote host closed the connection)
13:06:45*couven92 quit (Quit: Client Disconnecting)
13:07:52*Yardanico joined #nim
13:10:58*samhain quit (Ping timeout: 268 seconds)
13:12:10*Yardanico_ joined #nim
13:12:36*Yardanico_ quit (Remote host closed the connection)
13:28:47*endragor quit (Remote host closed the connection)
13:29:16*endragor joined #nim
13:34:27*m712 left #nim ("WeeChat 2.0.1")
13:39:40*marenz_ joined #nim
13:40:59*endragor quit (Remote host closed the connection)
13:41:27*endragor joined #nim
13:43:39*Arrrr quit (Ping timeout: 268 seconds)
13:58:05*Vladar joined #nim
14:12:53*dddddd joined #nim
14:38:05Araqhmm my new newlines fail on Windows
14:43:46*MJCaley joined #nim
14:43:58gokr1dom96: No need to sweat, I jumped ship. Sorry.
14:49:58Araqgokr1: I'm looking at your code now. Too late?
14:50:14gokr1yeah. Although MQTT is nice to get working of course.
14:50:23gokr1But I made the jump.
14:51:21Araqok, I'll fix c2nim instead then
14:57:26dom96:/
15:00:06*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
15:01:52dom96Araq: We need to figure out what to do about this so others don't suffer the same fate.
15:03:57AraqNim v2. ;-)
15:04:24PMunchgokr, what did you jump ship to? Just out of curiosity
15:05:36gokr1nodejs
15:05:56*sz0 joined #nim
15:05:57gokr1Here is a basic port of canoed to nodejs: https://github.com/getcanoe/canoed/blob/master/canoed2/canoed2.js
15:06:10federico3urgh
15:06:41gokr1One can say whatever one wants about nodejs. But "unfortunately" it gets the job done.
15:07:18gokr1I don't like js either, but I have come to realize the ... effectiveness of node as a tool.
15:07:49gokr1Ok, gotta run
15:08:06gokr1Thanks for all the help earlier, sorry I couldn't ... stick to it.
15:08:32Araqoh btw you could have tried --gc:boehm and --threadanalysis:off
15:08:32Araqfor some reason I keep forgetting these exist :-/
15:08:32Araqbye
15:08:58gokr1Ah
15:11:26*c0ntribut0r quit (Quit: Quit)
15:13:38*gokr1 quit (Ping timeout: 255 seconds)
15:15:34*xkapastel joined #nim
15:18:07*endragor quit (Remote host closed the connection)
15:18:34*endragor joined #nim
15:19:03*endragor quit (Remote host closed the connection)
15:20:34*endragor joined #nim
15:22:32FromGitter<Bennyelg> https://github.com/Bennyelg/lightForum
15:24:20PMunchCool!
15:25:09FromGitter<Bennyelg> There are plenty to do but the basics are already working. ⏎ Im newb to Nim so there are probably plenty of bad implementation
15:25:22FromGitter<Bennyelg> maybe I'll continue to develop it to practice on nim
15:25:53euantorlooks like you've checked binaries (`server` and `utils`) into Git, I'm guessing you hadn't noticed :)
15:26:11FromGitter<Bennyelg> yea :|
15:26:12FromGitter<Bennyelg> hehe
15:26:43euantorsame with `db_migrator`
15:26:53FromGitter<Bennyelg> same with all
15:27:09FromGitter<Bennyelg> how do I ignore them on the .git file ?
15:27:33euantornot very easily unfortunately. You either do it by single file name, or ignore all and exclude `*.nim`
15:27:33FromGitter<Bennyelg> .gitignore *
15:28:12FromGitter<Bennyelg> :/
15:29:14euantorhttps://www.irccloud.com/pastebin/dLVtc00E/
15:29:29FromGitter<GULPF> https://github.com/nim-lang/Nim/blob/devel/.gitignore
15:29:40euantorThat will kind of work, but you might need to exclude other files like `LICENSE` and `README.md`
15:30:23*c0ntribut0r joined #nim
15:31:48shashlickwhat's the nimble directory structure for a command line tool? it says everything should be in one .nim file
15:32:06shashlickI have all my code in a "src" directory and specified srcDir = "src"
15:33:40euantorif you have multiple nim files, it should be `src/[my_module.nim,my_module/utils.nim,my_module/bla.nim]`. Something like: https://github.com/euantorano/serial.nim/tree/master/src
15:34:27shashlickhow do you import those modules? just import module/file?
15:35:29euantorYep: https://github.com/euantorano/serial.nim/blob/master/src/serial.nim#L55
15:37:12PMunchdom96, is this something that could be included into nim doc? https://github.com/PMunch/combparser/blob/master/nimtorst
15:37:16shashlickawesome thanks!
15:41:25*regtools joined #nim
15:43:36*regtools quit (Client Quit)
15:43:41*endragor quit (Remote host closed the connection)
15:43:45*regtools joined #nim
15:44:08*endragor joined #nim
15:44:08*endragor quit (Remote host closed the connection)
15:46:01*endragor joined #nim
15:46:40*regtools quit (Client Quit)
15:47:00*regtools joined #nim
15:47:10*regtools quit (Client Quit)
15:47:35*regtools joined #nim
15:52:15shashlickeuantor: doesn't quite work - nimble still complains, says my_module folder should actually be my_module_pkg
15:52:25shashlickand my_module/utils doesn't import
15:52:53*NimBot joined #nim
15:53:20shashlickdom96: this is inconsistent with the documentation as well
15:53:21shashlickhttps://github.com/nim-lang/nimble#project-structure
15:54:58dom96which part?
15:56:11shashlicki have a binary nimble package - so I have src\qnim.nim, src\qnim\util.nim
15:56:25shashlicknimble complains that util is in src\qnim\ and not src\qnimpkg
15:56:44shashlickin either case, I cannot import util with "import qnim/util"
15:57:43dom96did you add srcDir = "src" to your .nimble file?
15:58:30shashlickyes
15:59:34*endragor quit (Remote host closed the connection)
16:00:00*endragor joined #nim
16:00:11shashlickI'm getting it to work by doing "import ./qnim/util"
16:00:24shashlickbut nimble is still upset about src/qnim/ instead of src/qnimpkg
16:03:01shashlickokay, so final version - src/qnim.nim, src/qnimpkg/util.nim, "import qnimpkg/util"
16:03:07shashlickclose to what's mentioned in the Hybrid section in the docs
16:03:36shashlickhowever, if I have src/qnimpkg/util2.nim which wants to import src/qnimpkg/util, I have to do "import ./util"
16:08:20*miran_ joined #nim
16:08:44FromGitter<dom96> Oh yes. If you're making a hybrid then you need to make it that way unfortunately
16:08:56shashlickit
16:09:01shashlickit's not really a hybrid, it's just a binary
16:09:40FromGitter<dom96> Then you should skipExt=@["nim"]
16:12:53FromGitter<dom96> This will become default in the future
16:13:00FromGitter<dom96> For binaries
16:13:26shashlickso if I set skipExt, then I can use src/qnim?
16:15:58shashlickokay, looks like I can do src/qnim if I skipExt
16:16:19shashlickbut for stuff within src/qnim, if there's modules that import each other, I have to use import ./module
16:16:49euantorthe whole `pkg` suffix is completely pointless
16:17:32euantorAs I've said in the past (and keep meaning to make a PR or issue for), binaries shouldn't end up in the `src` folder when doin `nimble build` - either put them in the working directory, or in a `bin`/`outputs` folder
16:17:52euantorLibraries/binaries/hybrids should all have the same structure
16:18:28*FromGitter quit (Remote host closed the connection)
16:19:13*FromGitter joined #nim
16:20:42*gokr joined #nim
16:20:57*PMunch quit (Quit: Leaving)
16:25:10*gokr quit (Ping timeout: 260 seconds)
16:43:21dom96euantor: https://github.com/nim-lang/nimble/issues/308
16:43:58euantoroh, nice. Hadn't realised there was an issue already :)
16:44:00dom96It's not simply a case of changing where the binaries are output.
16:44:21*MJCaley quit (Quit: MJCaley)
16:44:55dom96at least I don't think it is
16:45:01dom96we need to discuss the issues in that RFC :)
16:45:01euantoryeah, there's also the RFC about Nimble package structure that is about a very similar thing
16:45:14dom96yeah, and there is a lot of comments there and lack of consensus :)
16:45:36euantorsounds about right to me
16:47:26euantorI've opened issues in the past about how I find running `nim c src/app.nim` creates `./src/app` rather than `./app` (like every other tool that I'm aware of) too, but can't remember if I opened that on the Nim or Nimble repository
16:49:57FromGitter<andreaferretti> -o app
16:50:04FromGitter<andreaferretti> done :-)
16:51:43euantorI prefer sane defaults
16:52:03Araqnot using the likely directory name is a sane default
16:52:21dom96and `nim doc src/app.nim` will create ./app.html ...
16:52:38Araqyeah that one is stupid :P
16:52:54euantorthat one is what I'd expect
16:53:26euantorI personally wouldn't say that `src` is the expected output directory for a binary
16:53:47euantornormally `src` or `source` directories are for sources, not for binary artifacts
16:54:07euantorsame as I'd expect resources to be in `resource` directories rather than source code directories
16:54:29*Trustable joined #nim
16:55:07dom96Araq: As far as gokr's issue goes, we should fix it before v2
16:55:08AraqNim doesn't read the directory name though
16:55:25dom96And we should ask gokr if he will still use Nim which does not offer a GC
16:55:32dom96which AFAIK is what v2 will be
16:55:46Araqwhich one? "library runs procs on arbitrary threads breaking the GC?"
16:55:55Araqwhat's there to fix?
16:56:25dom96how can we make it work?
16:59:11planetis[m]hey the playground is down since yesterday
16:59:13euantorNo, I know Nim doesn't read the directory name (and it shouldn't), but it should trust the programmer to provide a path if they want to write the resulting binary to a path rather than to their current working directory - just like every other tool under the sun does
16:59:36euantor@planetis[m] https://play.nim-lang.org - seems to be up for me?
17:00:03Araqso a default that breaks under Unix is a "sane" default? I beg to differ
17:00:10euantorthough compilation seems to be broken
17:00:29euantorI must be missing something Araq. How does it "break under Unix"?
17:01:18planetis[m]yeah well code does not compile
17:01:27Araqfoo.nim # main file
17:01:35Araqfoo/ # nim code that foo.nim uses
17:01:46Araqnim c foo # cannot create binary 'foo'
17:02:42euantorso you put code under a `src` directory
17:02:50euantorThe current approach also breaks in this scenario
17:03:15Araqok, bad example
17:03:19euantor;)
17:03:25Araqnim c foo/foo.nim # breaks
17:03:47euantorok, how often do you do that or see that?
17:03:53Araqthis one is common IMHO
17:04:17euantorI'd say that in that case the programmer should be expected to be smart enough to specify `-o some_bin`
17:04:40euantorrather than then having `foo/[foo.nim,foo,foo.exe]`
17:04:49AraqI'd personally just use the current directory and an '.exe' extension
17:04:57dom96well... it's more common to have src/foo/, src/foo.nim
17:05:02dom96because that's how Nimble works
17:05:13euantorOf course, if unix was sane enough to have extensions for executables there'd be a lot less headache
17:05:33euantorAraq: So basically what I'm proposing, with `.exe` added
17:05:54dom96so maybe Nim should check whether a dir exists and give the exe a different name
17:05:57Araqmaybe, *shrug*
17:06:05euantorWhat I don't expect is for that scenario to result in `foo/foo` or `foo/foo.exe` - I expect an error, or a `foo.exe` in the cwd
17:06:20euantordom96: so `foo_1` or something?
17:06:42dom96yeah
17:06:43dom96bbl
17:06:47euantorWhat do other tools like GCC, Go, DMD, etc. do? I'd guess they just shout at the programmer for being stupid
17:07:17Araqthe best thing would be to remove the 'foo' directory and overwrite it with a 'foo' binary. traditional Unix style. "everything is a file" (directories too?) and "trust the programmer"
17:08:12Araqplus the classic "who would ever want to undo a delete operation"
17:08:34AraqXD
17:10:28euantorShall I open an issue RFC for this then?
17:10:48euantorthough I probably won't have time until tomorrow
17:10:49floppydhwell at least you can actually delete files, which seems to be something that can't reliable be done with windows file locking :)
17:12:25Araqfloppydh: the crucial difference is this one: Everybody already knows Windows is crap.
17:12:39Araqit's high time people realize Unix is too.
17:14:12Araqeuantor: sure, let's better fix it for 0.18
17:14:22Araqwhich is about "as many breaking changes as possible"
17:15:42*yglukhov quit (Remote host closed the connection)
17:16:30floppydhAraq: been "maining" Linux for quite a while now, dabbled in FreeBSD before, BSD people seem to think more highly of their OS, Linux people, who actually have been using Linux for more then a couple of months, and who aren't kids, don't think that much of Linux AFAIS, it's hard to be a fan of anything over time in my experience, for Linux peoples plan9 is their pipedream that magically does everything better, so
17:16:31floppydhif you want to get truly get Linux peoples, say plan9 is crap :)
17:16:54floppydhs/get truly get/truly get to/
17:22:33AraqI said "Unix" and I meant "Unix", BSD and Linux inherit all of its bullshit
17:24:39Araqbut also improving some things. too bad nobody sees the problems in not being able to blacklist compiled binaries in a gitignore file.
17:25:34*nsf quit (Quit: WeeChat 2.0.1)
17:30:46*endragor quit (Remote host closed the connection)
17:31:17*endragor joined #nim
17:35:29*floppydh quit (Quit: WeeChat 2.0.1)
17:35:53*endragor quit (Ping timeout: 256 seconds)
17:47:43*endragor joined #nim
17:52:33*endragor quit (Ping timeout: 264 seconds)
17:52:33*Sargun quit (Ping timeout: 248 seconds)
17:52:52*Sargun joined #nim
17:56:52FromGitter<dom96> Araq: so is there no formula that we can use to work with libraries like mqtt?
17:59:40*c0ntribut0r quit (Ping timeout: 260 seconds)
18:01:59*c0ntribut0r joined #nim
18:04:37*yglukhov joined #nim
18:09:04*yglukhov quit (Ping timeout: 252 seconds)
18:21:00*c0ntribut0r quit (Read error: Connection reset by peer)
18:24:52*c0ntribut0r joined #nim
18:25:22*drs joined #nim
18:26:26drsis there a way to call into nim from C? I have a large C program that i'd like to re-write into nim, although i need to probably do it a portion at at time.
18:26:49drsI guess what i'm looking for is to use gcc with nim provided .o files
18:27:17*yglukhov joined #nim
18:27:27drsgcc -Wall -O2 -o my_program cobj.o nimobj.o
18:29:47*yglukhov quit (Read error: Connection reset by peer)
18:30:23*yglukhov joined #nim
18:32:05*xet7 quit (Ping timeout: 240 seconds)
18:44:26shashlickyou could do that or make your nim code into a lib and use .exportc.
18:44:26shashlickhttps://nim-lang.org/docs/manual.html#foreign-function-interface-exportc-pragma
18:47:17*xet7 joined #nim
18:47:34*Jesin joined #nim
18:54:02*nsf joined #nim
19:15:47drsi installed nim 17.2, then fetched c2nim, it tells me there is no local packages.json and then it's trying to install compiler@>= 0.16.0
19:16:02drswhy do that when i already have 17.2 ?
19:19:17*sz0 quit (Quit: Connection closed for inactivity)
19:25:15*Yardanico quit (Ping timeout: 256 seconds)
19:25:38FromGitter<dom96> drs: sadly nimble isn't smart enough to realise that yet.
19:26:17FromGitter<dom96> Or rather, whatever method you've used to install Nim isn't smart enough to tell nimble about it yet :)
19:28:00FromGitter<dom96> Now that nimble supports "link files" this should be fairly simple to fix.
19:29:20*Yardanico joined #nim
19:30:46FromGitter<Bennyelg> Anyone did success install Jupyter Nim ?
19:31:03FromGitter<Bennyelg> Im wondering if its worth the try
19:31:33FromGitter<Bennyelg> Second question: ⏎ How is the most easiest way to debug apps ?
19:31:57*Yardanico quit (Remote host closed the connection)
19:32:12drsthanks dom96, I think I can do what c2nim is doing manually for my header file
19:32:13shashlickis there a simple proc to get all keys of a table into a seq?
19:36:03enthus1asttoSeq(table.keys)
19:36:17enthus1asttoSeq is from sequtils
19:36:45shashlickaah - I was doing table.keys() and it wasn't working
19:36:54enthus1astkeys is an iterator
19:37:01enthus1astso you have to for each over it
19:37:37shashlickhow come you can do "for i in table.keys()" but cannot do the () in toSeq
19:37:41drswhen interfacing with C libraries that return a "char *", is there a way to tell nim that the C function returned data that can be simply freed with a call to free() ?
19:39:30enthus1astshashlick: i do not understand. Do you mean why you can't call it as a function?
19:39:59shashlickkind of
19:41:43enthus1asthttps://nim-lang.org/docs/tables.html#keys.i,Table[A,B] it is not a proc but an iterator
19:41:51shashlickso I can do "for i in table.keys:" and "for i in table.keys()" - both work
19:42:03FromGitter<dom96> drs: nope. You have to do it manually right now.
19:42:59FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a68e1c35a9ebe4f75cd164a]
19:43:06FromGitter<Bennyelg> Trying to install nimsuggest
19:43:24FromGitter<Bennyelg> anyone familiar with this?
19:43:29enthus1astshashlick: this is a nim feature you can mostly omit the braces
19:43:30drsdom96 (or anyone) do you have a simple example of nim calling "strdup" and "free" then ?
19:45:44shashlickenthus1ast: ya but here the braces raise an error - if you do keys() in toSeq, it complains that keys() is unknown
19:47:57miran_@Bennyelg = jupyter nim? as in nim kernel for jupyter notebooks? that exists?
19:54:42shashlickdo we have a nim source code tokenizer lib?
20:06:03*jjido joined #nim
20:11:36FromGitter<SolitudeSF> uh, just noticed, i created a thread on forum, but i can only see it when im logged in, otherwise it just disappears from list
20:17:01*xkapastel quit (Quit: Connection closed for inactivity)
20:18:37dom96SolitudeSF: all new users are moderated
20:18:42dom96the forum needs to make that more clear :)
20:18:49dom96I fixed your status
20:19:27FromGitter<SolitudeSF> ah, ok
20:23:39dom96Feel free to bump your post if nobody answers
20:25:17dom96I would probably just submit this as issue
20:25:24dom96If anything, the error message could be clearer
20:25:34dom96Took me a while to realise that 'foldl' introduces a 'b'
20:25:42*salewski joined #nim
20:26:42*Jesin quit (Quit: Leaving)
20:28:10salewskiDo we already have a direct rounding proc from float to int, like round(0.9) ==> 1
20:33:23salewskiround(0.9).int is not that nice, and I assume it generates more code. At least I am using rounding float to int more often than rounding float to float.
20:36:05*drs left #nim (#nim)
20:37:09*Jesin joined #nim
20:39:34*PMunch joined #nim
20:40:33*Vladar quit (Quit: Leaving)
20:40:35FromGitter<tim-st> why doesn't this work: `try: ⏎ ⏎ ```return``` ⏎ ⏎ for e in node:` [https://gitter.im/nim-lang/Nim?at=5a68ef4398927d5745304b69]
20:41:02FromGitter<tim-st> file.nim(16, 12) Error: undeclared identifier: 'node'
20:41:37FromGitter<tim-st> doesnt the compile knows, that it is always declared?
20:41:38*jjido quit (Read error: Connection reset by peer)
20:42:37dom96Nim's scoping rules are different from python
20:42:42FromGitter<tim-st> ah, I got it my mistake
20:42:46dom96You need to declare this variable outside the 'try'
20:42:47*ofelas quit (Quit: shutdown -h now)
20:42:57PMunchDoes Python allow that scoping?
20:43:00FromGitter<tim-st> yes
20:43:35FromGitter<tim-st> this is of course not a one liner
20:45:30PMunchThat's just confusing.. They are two different blocks
20:45:52FromGitter<tim-st> ok, wasnt my mistake, I thought first there wasnt an exception. So the compiler doesnt know that this could should always work
20:46:16FromGitter<nitely> PMunch: try...except does have its own scope in python iirc
20:46:30FromGitter<nitely> *does not have
20:46:35*ofelas joined #nim
20:48:03FromGitter<nitely> that code would not work in python either, but coz if `getNode` raises then `node` is never declared
20:48:27FromGitter<tim-st> of course getNode raises
20:48:43FromGitter<tim-st> and the except block returns the proc
20:48:50FromGitter<tim-st> so why shouldnt this work?
20:49:49FromGitter<nitely> coz try..except has its own scope in Nim, iirc
20:50:43FromGitter<nitely> so var/let you declare inside try..except is not visible outside of it. So, can't declare `node` and then use it on the except section
20:51:25FromGitter<tim-st> I dont use it inside the exception block, wait a second for the code
20:51:43FromGitter<nitely> you should declare it outside of try..except and then assign to it. But that won't work either in this case, coz of getNode raising
20:52:07FromGitter<nitely> ah!
20:52:08PMunchYeah there are multiple things wrong with that example :P
20:52:22FromGitter<nitely> well, still, you're tying to use it outside of try..except
20:53:08FromGitter<nitely> yeah, I missed the return
20:53:35FromGitter<nitely> declaring `node` outside of try..except should fix it then
20:53:41FromGitter<tim-st> what is the syntax here for multiline code?
20:53:57FromGitter<tim-st> yes, exactly, but this isnt necessary in theory
20:54:23FromGitter<nitely> it is... try..except has its own scope, same for `if..else`
20:54:55dom96I added a new label to the GitHub repo called "User story", for real-life problems faced by Nim developers that I think we need to resolve. First issue for that label is the problems that gokr faced: https://github.com/nim-lang/Nim/issues/7134
20:56:09*Trustable quit (Remote host closed the connection)
20:56:32FromGitter<tim-st> It is necessary by the definition of nims scope, but it wouldnt be necessary for my code to run correct => it's a pain for the developer; I woulnt ever use this way in python
20:57:33subsetparkI think the hygiene gained by the stricter scope is very welcome
20:57:41subsetparkNim in general is much safer than Python
20:58:20FromGitter<tim-st> And that's good. But this time both ways have the same safety. This was the reason I wrote it..
20:58:47FromGitter<tim-st> Of course if someone doesnt return, both declarations should be needed
20:59:43*salewski quit (Quit: WeeChat 1.9.1)
21:02:16FromGitter<nitely> I prefer Nim's way and I'd prefer it to be consistent instead of full of special cases I have to remember
21:04:00FromGitter<tim-st> the problem here was, that I would to initialize my object to be iterable or do additionally do a check if it's not nil, but when this is needed I have to go this way..
21:05:32FromGitter<nitely> well, the nil check can be omitted since there's a return on except :P
21:07:19FromGitter<tim-st> ok, thats true
21:07:31FromGitter<nitely> I don't think the initialization is required. just do `var node: Node`
21:07:53FromGitter<tim-st> yes, i have it this way
21:08:19FromGitter<tim-st> it works now, thanks!
21:09:46FromGitter<nitely> great :)
21:11:05*Snircle joined #nim
21:13:09*saml_ joined #nim
21:19:21*miran_ quit (Quit: Konversation terminated!)
21:23:50*saml_ quit (Ping timeout: 260 seconds)
21:25:04*nsf quit (Quit: WeeChat 2.0.1)
21:28:24*PMunch quit (Quit: leaving)
21:29:14FromGitter<nitely> @dom96 I just read the issue. I think the "side note" is the way to go. httpauth must be fixed to work with `threads:on`, though
21:30:29dom96yep
21:31:29FromGitter<nitely> and I wonder if it's possible to use a Lock and a seq or queue and add whatever data is passed through callback to it. Then have an async proc awaiting on that seq. Dunno if it's even possible XD
21:35:41FromGitter<nitely> nevermind, cheatfate just posted what I was thinking
21:35:43*saml_ joined #nim
21:37:29*xkapastel joined #nim
21:38:11FromGitter<mratsim> !eval echo “test"
21:38:11NimBotCompile failed: <no output>
21:38:38FromGitter<mratsim> > > Playground is broken
21:43:59*gangstacat quit (Ping timeout: 276 seconds)
21:49:26*gokr joined #nim
21:51:38*c0ntribut0r quit (Ping timeout: 252 seconds)
21:59:09dom96yeah :\
21:59:35dom96@zacharycarter ^
22:04:17*saml_ quit (Remote host closed the connection)
22:09:59*vlad1777d joined #nim
22:14:48*gangstacat joined #nim
22:22:49shashlickdom96: this is a valid issue still - https://forum.nim-lang.org/t/1731
22:29:17*BitPuffin quit (Remote host closed the connection)
22:32:52dom96shashlick: PR? :)
22:33:10shashlick🙂will do
22:39:36shashlickmy nim quick editor is coming up quite well, any beta testers?
22:43:09dom96sure, send a link :)
22:50:12*yglukhov quit (Remote host closed the connection)
22:50:39shashlickdom96: https://www.dropbox.com/s/ndx7caouppckzb8/qnim.zip?dl=0
22:51:24shashlickneed to get it onto github soon
22:53:27dom96nice
22:53:33dom96If I press space, the line increments :)
22:53:39dom96seems like a bug
22:54:01dom96the interface is a little confusing
22:54:09shashlickwhat's your terminal?
22:54:26dom96macOS terminal
22:54:38shashlickaah, I've not tested this on mac at all
22:54:50shashlickcan you send me your map
22:55:11shashlicknimble buildmap && ./buildmap
22:55:26shashlickit's a lot of keys :D
22:59:15dom96lol?
22:59:27dom96Does it want me to enter every key combination in the world?
22:59:31dom96also... Enter CTRL_C:
22:59:39dom96yep, that terminates the app
23:00:11shashlickya I need to remove that, CTRL-Q, S and Z
23:00:26shashlickor add a sig handler
23:00:28shashlickwhich I added to the editor
23:00:46shashlicknever mind, I'll borrow a mac and try it out
23:02:32dom96https://gist.github.com/dom96/413d79ea1485a5a8024a7e0a1fe95c21
23:03:00dom96I pressed ESC for the ones that didn't work
23:05:34shashlickmost of the stuff lines up with xterm, but I'm wondering how you are getting newlines for space
23:06:26*MJCaley joined #nim
23:17:53dom96it does add a space when I press the spacebar
23:18:04dom96it increments the line number on the current line
23:18:12dom96yielding duplicate line numbers
23:24:00*arnetheduck quit (Ping timeout: 260 seconds)
23:43:58*MJCaley quit (Quit: MJCaley)
23:53:47*MJCaley joined #nim