<< 22-05-2019 >>

00:15:18*poopBot1 quit (Ping timeout: 268 seconds)
00:27:24*poopBot joined #nim
00:57:01*leorize quit (Ping timeout: 256 seconds)
01:07:39*leorize joined #nim
01:15:04*rockcavera joined #nim
01:15:16*xet7 quit (Quit: Leaving)
01:16:03*clyybber1 quit (Quit: WeeChat 2.4)
01:59:35*rnrwashere joined #nim
02:01:37*banc quit (Quit: Bye)
02:14:11*rnrwashere quit (Remote host closed the connection)
02:21:30*banc joined #nim
02:30:29*xace quit (Remote host closed the connection)
02:51:30*laaron quit (Remote host closed the connection)
02:52:00*laaron joined #nim
03:04:50*laaron quit (Remote host closed the connection)
03:05:11*laaron joined #nim
03:12:32*rnrwashere joined #nim
03:12:38*rnrwashere quit (Remote host closed the connection)
03:12:51*rnrwashere joined #nim
03:14:26*theelous3 quit (Ping timeout: 252 seconds)
03:45:57*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:49:24*Jesin quit (Quit: Leaving)
04:03:48*Jesin joined #nim
04:09:45*dddddd quit (Remote host closed the connection)
04:23:02*nsf joined #nim
04:30:42*vlad1777d quit (Ping timeout: 252 seconds)
04:42:21*kapilp joined #nim
05:13:02*ShalokShalom joined #nim
05:18:20*leorize quit (Quit: WeeChat 2.3)
05:18:55*narimiran joined #nim
05:28:42*odc quit (Read error: Connection reset by peer)
05:30:06*MD87 quit (Ping timeout: 252 seconds)
05:31:15*hoijui joined #nim
05:33:39*MD87 joined #nim
05:33:56*smitop quit (Quit: Connection closed for inactivity)
05:34:32*odc joined #nim
05:57:27*leorize joined #nim
06:19:23*PMunch joined #nim
06:38:45*solitudesf joined #nim
06:49:05*kapilp quit (Quit: Connection closed for inactivity)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:37*krux02 joined #nim
07:04:19*gmpreussner joined #nim
07:07:22*solitudesf quit (Ping timeout: 244 seconds)
07:13:01*rnrwashere quit (Remote host closed the connection)
07:13:38*rnrwashere joined #nim
07:17:33*Vladar joined #nim
07:17:54*rnrwashere quit (Ping timeout: 252 seconds)
07:21:59PMunchI'm trying to wrap a C library in Nim, I've got c2nim to transform the header file for me, but I'm missing some types from sys/socket.h and netdb.h how do I go about fixing that? Do I need to wrap those headers myself as well?
07:24:19Vladarwell, you can convert just the types required, I guess
07:26:36leorize[m]PMunch: see if posix module have them
07:28:28PMunchHmm, it does have them, but by incompatible names
07:28:45*laaron quit (Remote host closed the connection)
07:29:07*laaron joined #nim
07:32:03*neceve joined #nim
07:38:07PMunchOkay, fixed those problems and wrote a simple test program
07:38:31PMunchBut the C compiler fails with undefined reference errors
07:39:35PMunchOh wait
07:40:39PMunchI was missing a linkin statement
07:45:28PMunchNow just to deal with the fact that Nim is a lot stricter about types than C..
07:48:49*solitudesf joined #nim
07:50:01*kapilp joined #nim
07:52:29PMunchHey, got it working :)
07:53:22PMunchStyle insensitivity is golden for this kind of stuff, being able to write all my code in the same style even when it converts to a certain style in the C library is really nice
08:05:01FromGitter<kayabaNerve> PMunch: How is Nim stricter?
08:05:24narimiranwhile 1, from top of my head :D
08:05:28PMunchAbout types?
08:05:34FromGitter<kayabaNerve> Yeah
08:05:42PMunchEnums for example
08:05:47FromGitter<kayabaNerve> Ah
08:05:58*floppydh joined #nim
08:06:05FromGitter<kayabaNerve> So Nim creates distinct types for what C would consider the same?
08:06:10PMunchThis library has defined a bunch of enums with names for different things, but the procedures that takes these variables are defined as taking ints
08:06:30PMunchWell Nim creates an enum, which isn't directly compatible with an int
08:06:47PMunchIt's nothing worse than throwing on a couple cint conversions here and there though
08:08:04FromGitter<kayabaNerve> If you can cast it, it sounds like it is directly compatible
08:08:47FromGitter<kayabaNerve> :P
08:17:01*stefanos82 joined #nim
08:21:00PMunchWell, it is compatible, but Nim doesn't treat them like the same thing like C does
08:23:36*PMunch_ joined #nim
08:25:54*PMunch quit (Ping timeout: 244 seconds)
08:28:38*PMunch__ joined #nim
08:31:30*PMunch_ quit (Ping timeout: 272 seconds)
08:32:55*PMunch__ is now known as PMunch
08:33:12PMunchHmm, is this a good way of doing MD4? https://rosettacode.org/wiki/MD4#Nim
08:38:30leorizea terrible way imo :p
08:38:48leorizeuse seq[byte] for non-text stuff :P
08:39:36leorizeyou can try to implement the algo from scratch :)
08:41:30PMunchWell I need it like that as a hash string
08:44:29PMunchUgh, fun stuff porting crypto code from PHP, without really knowing PHP..
08:44:35PMunchThis is bound to fail :P
08:45:59leorizemaybe reading the RFC will get you further :p
08:51:26FromGitter<ChristianWitts> Hmmm ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ce50d8d9d64e537bceef495]
08:54:06*neceve quit (Remote host closed the connection)
08:58:05narimiranthat's now the third time i hear about choosenim problems in last couple of days :/
08:58:51FromGitter<ChristianWitts> It’s only the `self` update portion that’s having issues. `update stable` works
08:59:50*sz0 quit ()
09:00:49*sz0 joined #nim
09:07:40PMunchleorize, hmm that was in fact helpful
09:27:00*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
09:27:18*laaron joined #nim
09:35:32*seni quit (Quit: Leaving)
09:36:07poopBotso about http://niv.github.io/websocket.nim/docs/0.3.0/websocket/server.html websocket server i want to share 1 class across all connections do i just dump 1 var up form server and will that work across all connections, duno if each connection is separete thread or what
09:41:21*neceve joined #nim
09:43:05*arecaceae quit (Remote host closed the connection)
09:43:24*arecaceae joined #nim
09:48:35*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
09:48:45*laaron- joined #nim
09:55:08federico3how to read keypresses?
09:56:47livcdperverse question
09:57:02livcdanyone having a Nim program talking to a soap service?
09:59:30*ng0 joined #nim
10:02:21federico3shashlick: https://github.com/genotrance/snip/blob/master/src/snip/key.nim#L16 do we still need all of this to handle keyboard input?
10:07:07leorizefederico3: there's getch in the terminal module
10:07:20federico3thanks
10:07:56leorizeit can't do arrows though
10:08:22federico3urgh
10:08:30federico3nor function keys it seems
10:08:40leorizearrows on linux terminals are 3 bytes sent in one go
10:08:42*jjido joined #nim
10:09:10federico3we need a better built-it
10:09:42leorizea getch_nonblocking is a start
10:10:23leorizewith smt like that we can retrieve 2 bytes when the escape byte is detected
10:10:38leorizeif can't find anything it probably just someone pressing esc
10:20:22*xace joined #nim
10:20:29*leorize quit (Quit: WeeChat 2.3)
10:21:04FromGitter<kaushalmodi> PMunch: About your comment "I'm trying to wrap a C library in Nim
10:21:21FromGitter<kaushalmodi> .. have you tried nimterop?
10:27:51federico3PMunch: do you strictly need md4?
10:36:20*dddddd joined #nim
10:42:19FromGitter<kayabaNerve> MD4?
10:42:25FromGitter<kayabaNerve> Why would someone use MD4?
10:42:32FromGitter<kayabaNerve> Even MD5 isn't treated as secure anymore
10:43:05leorize[m]for interfacing with legacy protocols I think
10:48:03PMunchkaushalmodi, haven't tried it no. But I was looking at it if that helps :P
10:48:22PMunchfederico3, I need to use MD4, this is for MSCHAPv1
10:48:53PMunchkayabaNerve, ask Microsoft, I wouldn't use it if I was designing the protocol myself..
10:49:58*lritter joined #nim
10:50:50FromGitter<kayabaNerve> PMunch: Fight the machine
10:57:32WilhelmVonWeinerif the .this. pragma is deprecated
10:57:53WilhelmVonWeinerwas it replaced with a more nim-like way to do it
10:58:28FromGitter<jrfondren> not AFAIK.
10:58:55narimiranwell, "a more nim-like way" is to have full qualification, without shortcuts ;)
10:59:30WilhelmVonWeinerlame, cheers
10:59:38narimirancheers, lame
11:09:35leorize[m]WilhelmVonWeiner: see github.com/zevv/with
11:16:46Zevvhttps://utcc.utoronto.ca/~cks/space/blog/programming/GoIsGooglesLanguage One more reason I Nim
11:16:56federico3we all Nim
11:17:56Zevvyes, but *why*
11:19:21*abm joined #nim
11:20:32PMunchWilhelmVonWeiner, there is also the cascade module
11:21:11PMunchI also miss the this pragma, for gamedev and other heavily object oriented tasks
11:26:21PMunchZevv, in the same vein you can say that Nim is Araqs language
11:26:39PMunchAlthough it might be harder to picture him as an 800-pound gorilla :P
11:27:09ZevvIn my time here I have seen a few examples of araq not agreeing, but stuff still happening
11:27:25Zevvprobably not about the decisions he *really* cares about, but still
11:32:03FromGitter<Vindaar> small teaser about what I started working on:
11:32:09FromGitter<Vindaar> (https://files.gitter.im/nim-lang/Nim/cEIf/ggplotnim_preview.png)
11:37:55FromDiscord_<nothing to no one> When should I use object vs ref object?
11:38:04FromDiscord_<nothing to no one> When should I use object vs ref object when defining a new data type?
11:38:38Araqin doubt, use 'object', if you come from Python and don't understand value semantics, use ref
11:42:47FromDiscord_<nothing to no one> Value semantics?
11:43:33Araqstuff is copied around
11:44:57FromDiscord_<nothing to no one> I've written a decent amount of C, so I'm probably good there lol. Thanks though, I'll keep that "if in doubt" part in mind
11:50:58xaceVindaar: that looks nice, I look forward to trying it out :)
11:55:49Zevvbut what a sucky name, ggpplotnim
11:58:47shashlickfederico3 there might be a nimble lib that makes it easier now but that's what I had to do to get raw keys
11:59:18shashlickWas painful since I had to make kb maps and what not
11:59:33Araqshashlick, is the Nimble bug fixes that andreaferretti reported?
12:01:12shashlickThe old one yes, is there a new one?
12:04:04FromGitter<Vindaar> @xace: thanks! I only just started working on the ggplot like interface, so it'll take a while until it even remotely covers ggplot's features. The backend (similar to R's Grid package) has most features I need now though. ⏎ @Zevv: :P
12:04:32federico3shashlick: unfortunately your code is non-blocking
12:05:20narimiran@Vindar how about `nnplot`? :)
12:05:31ZevvI cant't even properly name my variables, let alone my projects
12:07:38narimiranor maybe XXplot since this is probably the 20th plotting attempt in nim? :D :D
12:08:00PMunchnothing to no one: https://peterme.net/nim-types-originally-a-reddit-reply.html
12:08:38federico3shashlick: and the reader thread is using a busy loop :-o
12:09:13FromGitter<Vindaar> @narimiran haha xxplot. `nnplot` is actually kinda nice, although not sure if I want to drop the reference to "grammar of graphics" . But naming the package has time :D
12:10:22narimiran grogplot :)
12:10:47narimirangra2plot :P
12:13:00*Kaivo joined #nim
12:13:45FromDiscord_<nothing to no one> I want to convert a json config into a nim object. the config uses nested lists, are sequences the best thing to use for that? https://hastebin.com/afapewiyog.pl
12:16:39*hoijui quit (Ping timeout: 250 seconds)
12:16:42Araqshashlick, he replied on it about something not working
12:16:53shashlick@federico3 using all cpu? I can fix that
12:18:55shashlickAraq: do you mean this? https://github.com/nim-lang/nimble/pull/635#issuecomment-488645566
12:19:57shashlickI fixed that in this https://github.com/nim-lang/nimble/pull/645
12:20:57Araqok nice
12:21:03Araqcan you tag the Nimble version then?
12:21:11Araq0.20 should come with the new Nimble
12:28:20leorize[m]Araq: is 0.20 coming anytime soon?
12:28:40federico3shashlick: thehre's no sleep :)
12:28:52narimiranleorize[m]: yep
12:29:22leorize[m]gotta run some checks on Haiku then :)
12:41:47shashlick@federico3 I figured a nice way to be responsive without blocking in feud
12:41:52shashlickWill use that
12:42:18shashlickAraq will do, need to check if I can tag
12:42:36shashlick@dom96 nimble 0.10.0?
12:48:12PMunchHmm, fun PHPs MD4 algorithm, and the one I imported from OpenSSL gives different results..
12:49:22PMunchOh no, wait..
12:49:41PMunchThe str2unicode function it passes it through converts to UTF16..
12:50:46federico3https://rosettacode.org/wiki/MD4#Nim ?
12:50:56PMunchYeah
12:51:57federico3a52bcfc6a0d0d300cdc5ddbfbefe478b nim is correct
12:54:41*Snircle joined #nim
12:54:45shashlick@federico3 - which OS you testing snip?
12:55:03federico3Linux
12:55:54*hoijui joined #nim
12:57:07*hoijui quit (Remote host closed the connection)
12:58:36*theelous3 joined #nim
13:00:00FromDiscord_<nothing to no one> Is there a way to map over json's JArray?
13:00:47narimirannothing to no one: sequtils.map?
13:02:48FromDiscord_<nothing to no one> It gives a type mismatch error
13:03:37FromDiscord_<nothing to no one> looks like map wants an openArray, and I'm giving it `seq[JsonNode]`
13:05:07FromDiscord_<nothing to no one> ohhhh my issue was in the proc I was passing to map, it has to have a var param
13:05:23leorize[m]openArray can match both array & seq
13:07:21FromDiscord_<nothing to no one> hmmm maybe not. full error message https://hastebin.com/ecapapehef.md
13:07:58FromDiscord_<nothing to no one> nvm figured it out, type mismatch on the function i was passing to map
13:08:11federico3shashlick: how are you converting keys back to letters/numbers?
13:09:11leorize[m]federico3: here's how I handled arrows key: https://rosettacode.org/wiki/2048#Nim
13:09:11federico3code.parseInt().char it seems
13:09:39leorize[m]good enough for a demo, but it's not the most reliable way
13:09:58federico3leorize[m]: I'm getting A B C D from function keys as well
13:10:18Zevvhaha, 2019 and still people are struggling reading keys
13:10:37Zevvunix tty handling is hell
13:12:27federico3Zevv: the problem is in not having that in Nim or in a library
13:14:19*stefantalpalaru joined #nim
13:15:37stefantalpalaruWhy is newException() not setting the "name" field?
13:15:47stefantalpalaruhttps://github.com/nim-lang/Nim/blob/master/lib/system.nim#L2890
13:17:23leorize[m]stefantalpalaru: the docs said raises fill it
13:20:35PMunchHmm, I have some imported procedures that takes a cstring, but my string starts with "\0" so when it converts it shows me an empty string
13:21:24PMunchAnd since it starts with 0 I can't do cast[cstring](regularString[0].addr) since it doesn't like to index to 0..
13:24:22leorize[m]PMunch: find functions that take a string + size
13:27:12PMunchIt does take string+size
13:27:20PMunchOr rather it takes a void pointer and a size
13:27:31shashlick@federico3: it is elaborate and ugly - https://github.com/genotrance/snip/blob/master/src/snip/keymap.nim
13:27:39FromGitter<jrfondren> so, it doesn't take a cstring. pass a ptr and size instead
13:27:49shashlickhttps://github.com/genotrance/snip/tree/master/src/snip/term
13:28:02FromGitter<jrfondren> because a string that begins with '\0' and *isn't* an empty string, certainly isn't a C string
13:28:29shashlickall to avoid ncurses
13:28:52PMunchYeah I was confused by some other code, but the problem still remains, how to get a pointer to the buffer of a nim string
13:29:01FromGitter<jrfondren> addr(str[0])
13:29:14FromGitter<jrfondren> maybe unsafeAddr
13:29:32FromGitter<jrfondren> but you want the zero'th index because strings and seqs have other data in front of that.
13:29:35leorize[m]<PMunch "Yeah I was confused by some othe"> cstring(string)
13:29:47PMunch[0] doesn't work since it starts with a 0, Nim complains..
13:30:00FromGitter<jrfondren> where does Nim complain?
13:30:15PMunchOh wait, it stopped complaining
13:30:56federico3shashlick: https://github.com/genotrance/snip/blob/master/src/snip/key.nim#L40 is not correct: you might get 2 keys back-to-back
13:31:41PMunchI'm certain I tried myStr[0].addr before and it complained..
13:31:43federico3shashlick: https://github.com/genotrance/snip/blob/master/src/snip/key.nim#L42 are you concatenating integers? 12 & 34 collides with 123 & 4
13:33:44leorize[m]PMunch: cstring(string) will give you the underlying buffer as well
13:33:50leorize[m]parts of stdlib uses it
13:37:25shashlick@federico3 - like i said it's ugly
13:37:28shashlickit is in raw mode
13:38:12shashlicki couldn't find any decent docs to map the numbers to keys
13:38:24*narimiran quit (Remote host closed the connection)
13:38:30shashlicknothing is cross-platform
13:38:51*narimiran joined #nim
13:41:53PMunch!eval echo len(cstring("\0hello world"))
13:41:55NimBot12
13:42:16PMunchHuh, why I tried to convert my string to a cstring it gave 0
13:42:26FromGitter<jrfondren> a cstring is just going to be a pointer to the zero'th element, same as the other thing.
13:42:40FromGitter<jrfondren> of course a cstring-aware len is going to say zero
13:43:06FromGitter<jrfondren> what you're doing is forgetting what you're actually dealing with, but you're using tools that know what you're dealing with
13:43:24FromGitter<jrfondren> a string that begins with \0 is an empty c-string. so it's going to display as nothing.
13:43:29PMunchYeah I know
13:43:47PMunchThe problem was that the function I was passing it to also treated it as a 0 string
13:44:11FromGitter<jrfondren> you're passing a length to that function as well, right?
13:44:33PMunchNow I am, that's what was causing the issue
13:44:54FromGitter<jrfondren> either it's poorly coded and doesn't really accept binary data, or you're confused about something.
13:45:20FromGitter<jrfondren> you weren't passing a length before?
13:47:01shashlick@federico3 - fixed the busy loop in snip
13:47:18*salewski joined #nim
13:47:48PMunchjrfonden, yeah it was my fault, I wasn't passing a length
13:48:21salewski!eval assert not [2, 3].contains(1)
13:48:22NimBotCompile failed: in.nim(1, 8) Error: type mismatch: got <proc (cond: bool, msg: string): typed, bool>
13:48:27FromGitter<jrfondren> that !eval result is maybe a bug with static strings
13:48:52narimiransalewski: use devel, it works in it ;)
13:48:56PMunchThere was a field in that function I had never used, just always left at -1, which worked fine for string and integers, since it knew how to handle those (I also passed a type identifier), but with the binary data it needed a length :)
13:49:01federico3shashlick: you might get 2 consecutive keys sometime
13:49:19PMunchNow just to figure out how to traverse a C style linked list in Nim..
13:49:26FromGitter<jrfondren> ah. I guess it treats the string as a C string if not given an explicit length
13:49:29*ng0 quit (Quit: Alexa, when is the end of world?)
13:50:06shashlick@federico3 it should only do that when it gets a control char which expects a follow up char
13:50:08salewski narimiran, yes I know. Got an issue report that gintro does not compile with such an assert for v0.19.6
13:50:11shashlick0, 27 and 224
13:50:18salewskiStange, i never noticed.
13:50:22FromGitter<jrfondren> @PMunch dereference with []
13:50:35narimiransalewski: there is a workaround if you want
13:50:40federico3shashlick: https://github.com/genotrance/snip/blob/master/src/snip/key.nim#L42
13:50:56FromGitter<jrfondren> if it's a good list with the cdr pointer at zero, the third element of the list would be at head[][][].val
13:51:08federico3the while might encounter [79, 81, 27, 79, 81]
13:51:19salewskiSure, but I hesitate to make a new gintro release just fot this issue...
13:51:44salewskiI think I will wain if more people complain.
13:51:54salewskiBye.
13:52:10*salewski quit (Client Quit)
13:53:00FromGitter<kaushalmodi> shashlick, federico3: I believe I'll need the keymap support soon ..
13:53:06narimiransalewski: it is as simple as adding parentheses: `assert(not [2, 3].contains(1))`
13:53:22FromGitter<kaushalmodi> I might need to design a selector from multiple options thingy like the Go peco
13:53:28federico3kaushalmodi: uh?
13:53:37shashlick@federico3 - not much choice since you get a long stream of numbers for some keys
13:53:39shashlickhttps://github.com/genotrance/snip/blob/master/src/snip/term/xterm.txt
13:53:40FromGitter<kaushalmodi> https://github.com/peco/peco
13:53:52*stefantalpalaru quit (Quit: stefantalpalaru)
13:54:32shashlickif there's a way to do cross-platform getch with all control keys, i'll throw all this code out right away
13:54:37shashlicktermbox is only posix
13:54:37*leorize joined #nim
13:56:49PMunchAh, it was another bug in c2nim
13:57:08shashlickwhat are you wrapping PMunch
13:57:39ZevvI volunteer to spend some time on proper keyboard input, sync and async, the posix side
13:57:48Zevvbut I need someone else to jump in for the windows part
13:58:05PMunch"myLinkedList = myLinkedList.next" worked fine, but the "typedef struct mll {} MyLinkedList;" was cimported as "struct MyLinkedList" and not "struct mll" or "MyLinkedList"
13:58:14PMunchshashlick, radcli
13:58:21PMunchA library to write Radius clients
13:59:55shashlickradcli.h?
14:00:24AraqZevv, I can run code on windows fwiw
14:01:17shashlicki can help on windows too
14:01:21Zevvwell, 'run' is only part of it. I could test with wine and stuff, but finding out which API's to use and getting that to work with async does not sound like a fun job with my total lack of win32 api experience
14:01:41*vivus joined #nim
14:01:43shashlicksee that's the issue - that way you can wrap termbox and call it a day
14:01:53shashlickthere's many posix libs that make it easy
14:01:58shashlicklibtickit or something
14:02:01FromGitter<kaushalmodi> Zevv: I'll test it on posix :)
14:02:06PMunchshashlick, yes radcli.h
14:02:10Zevvyeah of course. But if you want to go portable, the keymap definition is also part of the game
14:02:16shashlickPMunch - DLL or compiling in?
14:02:32Zevvon linux these days the default is libxbk, even on non-X systems like wayland and libevent
14:02:44PMunchshashlick, so far I'm compiling it in
14:03:14Zevvbut making this portable to windows probably requires a complete new keymap definition, which is then a again a huge pain in the behind if you want to mix that with existing event handling api's.
14:03:41shashlicktell me about it - see my poor man's keymaps in snip
14:03:55shashlickworks cross platform but is just so sad
14:04:14FromGitter<kaushalmodi> How do Go and other language deal with cross-platform keymaps? Or do they?
14:04:36Zevvand how deep do you go - expose scan codes? what to do with key repeats and raw up/down events?
14:04:53shashlicktermbox-go works on windows as well
14:04:59ZevvWhat about generating the symbols that come out. Hitting three keys on a french keyboard gives ç. Do you want to handle that?
14:05:06*PMunch quit (Remote host closed the connection)
14:05:09federico3getch does not look at scancodes (also you don't want to go that far)
14:05:17shashlicknodejs also has its own lib
14:05:51shashlickZevv: i was making a text editor so needed arrow keys, ctrl/alt, etc.
14:06:29Zevvgetting modifier keys is pretty much impossible on the terminal level
14:06:41Zevvthat's usually exposed through gui libs or libevent
14:07:52*nsf quit (Quit: WeeChat 2.4)
14:10:09shashlicki got it to work with raw mode
14:10:39FromGitter<jrfondren> sure, with terminals you just have to make assumptions about how certain codes were given. that works for what TUIs expect but you get some overlap, e.g. ctrl-[ and ESC map to the same code.
14:12:09Zevvwhat's the node-way?
14:12:20leorizelibuv I believe
14:12:25leorizeneovim uses it
14:16:11FromGitter<jrfondren> Forth just gives you `KEY KEY? EKEY EKEY?`. KEY blocks and returns a byte (or an error). KEY? returns true if there's anything to get. EKEY blocks and returns an int (or an error), including bytes local constants like K-UP K-DOWN after translating multi-byte codes. On posix KEY and EKEY change the terminal mode during their execution; there's no need for it to be raw all the time if you're not going full curses.
14:16:48Zevvlibuv is only event handling, we have the ioselectors for that
14:16:56FromGitter<jrfondren> that plus some constants that could have windows and other local definitions, plus a way to change the delay on ESC (no delays' fine locally, but people also use terminal programs over ssh)
14:17:23FromGitter<jrfondren> would be comfortable enough for many tasks.
14:17:42Zevvthat's all pretty much doable without external libs on posix. It's reading terminals and a bit of tcgetattr/tcsetattr
14:17:50FromGitter<jrfondren> but seriously, for a text editor you should just get curses. efficiently redrawing the screen is a real problem and you get it with a text editor as soon as you want to move the display up by one line.
14:18:16Zevvyeah but we're talking keyboard input, right - curses is so much more
14:18:39FromGitter<jrfondren> you'll still want other stuff in your not-curses terminal lib, like the stuff in man console_codes on linux
14:19:11Zevvyeah, but the linux consule is just another terminal - there's tons more, and they are still not compatible
14:19:33Zevvtry to read ctrl-shift-F1 in xterm, rxvt, gnome terminal, the linux console and a mac terminal - good luch
14:19:42Zevvluck
14:19:53FromGitter<jrfondren> yeah, but this has been the case forever, which is why no terminal program wants you to insert ctrl-shift-F1
14:20:14FromGitter<jrfondren> what's wanted is fairly portable.
14:20:34shashlickPMunch - almost done
14:21:56FromGitter<jrfondren> anyway, my recommendation is to mimic Forth at least as far as doing tcsetattr within the key-getting function. Change the terminal mode every single time a key's wanted, and then set it back. That'll be easier to work with in a lot of ways.
14:22:46shashlick@jrfondren: I am doing that but at the beginning of the program - https://github.com/genotrance/snip/blob/master/src/snip/getch.c
14:23:08FromGitter<jrfondren> right. that's the opposite of what I recommend :)
14:23:26Zevvjrfondern: kind of makes sense. but if you ^C or kill the program, you'd still have to catch the exit and restore the terminal
14:23:39FromGitter<jrfondren> sure.
14:23:47vivusHow do I save a table to a file, I tried `writeFile("myfile.txt", mytable)` but it gave an error. Do I need to save it line-by-line?
14:24:30FromGitter<jrfondren> you need to decide on some way to serialize the data, and do that.
14:24:54vivusserialize the data?
14:24:59FromGitter<jrfondren> you're working with csv, right? so emitting csv might be fine.
14:25:49vivusso I need to make each line in the table to output as a string separated by tabs/commas and then use "write" or whichever save-by-line proc exists?
14:26:13FromGitter<jrfondren> your table is held in memory in a manner that's convenient in a lot of ways but "someone could look at the sequence of raw bytes the table is within and make sense of it" is not one of those ways. Files though are just a sequence of bytes, and usually you want to be able to make sense of it when you look at it.
14:26:26FromGitter<jrfondren> yeah that'll work.
14:28:49*kapilp quit (Quit: Connection closed for inactivity)
14:28:49FromGitter<jrfondren> @vivus, it might be easiest to use the `json` module.
14:29:10FromGitter<jrfondren> it has `proc `%`T (table: Table[string, T] | OrderedTable[string, T]): JsonNode` f.e.
14:29:19vivusinteresting. That might work too and I could use JSON to render it as a simple webpage too
14:29:38vivusgreat suggestion @jrfondren <3
14:32:12Araqdamn, 6 open bugs left
14:32:20Araqbefore we get it down to 1200 ...
14:33:26Zevvsay "issues" not "bugs"
14:34:25FromGitter<jrfondren> an issue could be anything. issue: "please adopt my anime character as the official representative of Nim"
14:35:34leorize@jrfondren: that might have happened
14:36:07FromGitter<jrfondren> sure. it happened to Ruby, before they decided on a picture of a semi-precious gem (???)
14:37:32leorizehttps://github.com/nim-lang/RFCs/issues/104
14:37:34leorizenot anime though
14:40:51*a_b_m joined #nim
14:40:58Zevvleorize: watch out commenting on these things, it might hint narimiran about your age
14:41:24*narimiran quit (Remote host closed the connection)
14:41:36leorizedon't worry, even google got it wrong ;)
14:41:51*narimiran joined #nim
14:42:19narimiranZevv: too late for that. until proven otherwise, i've set leorize's age in my head
14:42:52Zevvaround 42, right
14:43:04narimiran...and i'm jealous of him for being such a smart young boy
14:43:29Zevvjealous because of the smartness of because of the age
14:43:43narimiranbecause of smartness AT that age
14:43:43*abm quit (Ping timeout: 248 seconds)
14:43:46Zevv:)
14:44:51shashlick@PMunch - where do i find radlogin.h
14:44:59narimiranZevv: my accomplishments at that time? i managed to win Civilization, or something along those lines
14:45:19Zevvshashlick: it's part of freeradius if i recall correctly
14:45:35Zevvnarimiran: well, look where it got you, you're pretty civilized these days
14:45:59narimiran:D
14:46:18shashlickwell, I took this as far as I could
14:46:26shashlick@PMunch - radcli wrapper - http://ix.io/1JJP/Nim
14:47:33shashlickoutput looks like this - http://ix.io/1JJR/Nim
14:47:52shashlickright now, it fails while compiling the c files since it looks for radlogin.h
14:48:58leorizenarimiran: I'm not that young
14:48:58leorizebut I won't say that I'm not old ;)
14:48:58leorizebut I won't say that I'm old ;)
14:48:58leorize:p
14:48:58*leorize quit (Remote host closed the connection)
14:49:51narimiranleorize until proven otherwise, you're born in 200x
14:50:01*leorize joined #nim
14:52:12Zevvwell he can tell animie, he might as well have been a teen in the 90's
14:56:25*floppydh quit (Quit: WeeChat 2.4)
15:01:22*fredrik92 joined #nim
15:01:29federico3shashlick: any way to support light background in snip?
15:02:38narimiranburn the witch!!!
15:02:49federico3?
15:03:11narimiranlight background, a clear sign of a witch
15:03:31federico3https://ux.stackexchange.com/questions/53264/dark-or-white-color-theme-is-better-for-the-eyes
15:04:02shashlickshould be doable - is there a way to detect background and adapt colors?
15:04:09shashlickor we need some config option
15:04:16federico3a simple flag would do :)
15:05:05shashlickokay sounds fair - need to figure out which colors stand out
15:05:49FromGitter<Vindaar> light background is good when working with a laptop outside (or maybe I become a witch in sunlight?)
15:05:59shashlickcolors are hard-coded in ui.nim right now - will need to make it a config file or something
15:06:24shashlickso snip is useful for you? i use it quite often when wanting to quickly test code
15:06:55shashlickshould port some of that compile code into feud
15:09:15federico3shashlick: not much with the current colors :-/
15:13:48*rnrwashere joined #nim
15:15:41*rnrwashere quit (Remote host closed the connection)
15:16:17*rnrwashere joined #nim
15:17:21*rnrwashere quit (Remote host closed the connection)
15:17:38*rnrwashere joined #nim
15:20:13*neceve quit (Ping timeout: 246 seconds)
15:20:33shashlickokay making it configurable
15:28:56*neceve joined #nim
15:33:40*rnrwashere quit (Remote host closed the connection)
15:34:08*rnrwashere joined #nim
15:34:33*stefantalpalaru joined #nim
15:37:49stefantalpalaruHow can I avoid type conversions in proc parameters? https://gist.github.com/stefantalpalaru/d07d51e2587510946162946352a611eb
15:48:11shashlick@federico3 - colors are now configurable with a colors.txt
15:48:13shashlicksee ui.nim
15:48:20federico3thanks!
15:48:35shashlickplease let me know if you face any other issues
15:53:20FromGitter<jrfondren> @stefantalpalaru, don't use OO if you don't want it.
15:54:31shashlicki'll evaluate libuv - seems like a possible alternative for terminal keyboard
15:55:39stefantalpalaru@jrfondren - there's nothing about OOP that says there should be hidden type conversions in function parameters.
15:57:05FromGitter<jrfondren> there's inheritance.
15:59:39stefantalpalaruAnd it's being ignored by failing to conserve derived types when the parameter is being declared as the base type.
16:00:42FromDiscord_<treeform> what happened to queues? https://nim-lang.org/docs/queues.html where they removed in 0.19.6?
16:02:10FromDiscord_<treeform> https://github.com/nim-lang/Nim/commit/cceb28b5eb9bae4f0fc364899858018a1bf480ae
16:02:16FromDiscord_<treeform> I guess they were.
16:02:27shashlicknodejs uses blessed
16:02:50narimiran@treeform use deques https://nim-lang.github.io/Nim/deques.html
16:04:20shashlickwell i've gone down the terminal keyboard rathole before with nothing to show for it
16:04:29shashlickif anyone has a better idea, please let me know
16:05:42FromGitter<jrfondren> @stefantalpalaru, you can use `error of Error1`in `t1` to see if it's an Error1 or not.
16:07:19stefantalpalaruYes, that works. Now how do I make it have its original type?
16:08:54FromGitter<jrfondren> one option's to write a function that accepts the original type instead of a parent. Otherwise, I'd have to look it up.
16:10:08stefantalpalaruAs you can guess, the original proc is being used for custom exception types. Making dozens of variants of it is not an option.
16:10:41vivus@jrfondren I can't find this in the documentation: `%`T (table: Table[string, T] | OrderedTable[string, T]): JsonNode`
16:11:11FromGitter<jrfondren> @vivus, https://nim-lang.github.io/Nim/json.html#%25
16:12:58vivus@jrfondren the syntax is unclear to me. is it: `var js = %T[mytable]` or `var js = %[T](mytable)` ?
16:13:25vivusok I tried both and neither work
16:13:34FromGitter<jrfondren> it's %mytable or %(mytable)
16:14:02vivus`Error: type mismatch: got <TableRef[system.string, tuple of (string, seq[string])]>`
16:15:02vivusok found the error, sorry
16:15:23FromGitter<jrfondren> what was the error?
16:17:13FromGitter<jrfondren> @stefantalpalaru, what's the actual problem? if you raise the exception without "restoring its original type" it still gets caught by exception handlers looking for Error1
16:17:27FromGitter<jrfondren> https://nim-lang.github.io/Nim/manual.html#exception-handling-except-clauses has an example of casting though
16:20:17stefantalpalaruThat's exactly the problem: it no longer matches the custom exception type in "except" blocks.
16:22:44*krux02 quit (Remote host closed the connection)
16:22:48stefantalpalaruHere's with actual types: TransportError inherits from AsyncError which inherits from CatchableError. Once the type has been converted to Exception, by passing it to a "proc foo(error: Exception)", "except CatchableError:" no longer catches it.
16:23:11FromGitter<jrfondren> https://gist.github.com/jrfondren/de4ab3f935e55a4fd9c44f8fb81a145b <- seems to work here.
16:24:53FromGitter<jrfondren> that also works after I raise a child of Error1. the child still gets caught by its specific error handler.
16:25:16FromGitter<jrfondren> ah, but you're not using the specific type.
16:25:40FromGitter<jrfondren> a child of Error1 still gets caught by an Error1 handler.
16:29:13stefantalpalaruYes, I can confirm that. Back to the drawing board.
16:29:25FromGitter<jrfondren> I'll believe that there's some real problem here. disruptek and a few other people complained about exceptions a while back. Maybe if you approach it as a bug you'll be able to get a good example for an github issue.
16:30:18FromGitter<jrfondren> or there might already be an issue for it, like this: https://github.com/nim-lang/Nim/issues/11118
16:39:09*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
16:39:27*laaron joined #nim
16:46:00vivus@jrfondren a noob error (forgot to import), but after doing so, I am getting: `template/generic instantiation from here ... Error: undeclared field: 'data'`
16:46:38FromGitter<jrfondren> sounds like you're accessing an undeclared field?
16:47:44*nsf joined #nim
16:48:09vivus@jrfondren yeah in some of the tuples, they are empty.
16:48:22narimiranvivus: show us your code, please
16:49:25vivus(this is by design, as some fields won't have a translation) - perhaps I should exclude those, as non-translated fields have no value for me
16:52:44vivusill be back later. gotta run now. ty for the help so far
16:53:45*vivus quit (Remote host closed the connection)
16:57:09*PrimHelios_ joined #nim
16:57:35*xet7 joined #nim
16:57:52*PrimHelios quit (Ping timeout: 246 seconds)
16:59:17*laaron- joined #nim
16:59:29*laaron quit (Remote host closed the connection)
17:00:18*NimBot joined #nim
17:07:51*jjido_ joined #nim
17:27:28*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
17:28:02*laaron joined #nim
17:31:09*Trustable joined #nim
17:31:56*Jesin quit (Quit: Leaving)
17:34:21*leorize quit (Ping timeout: 256 seconds)
17:34:48*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
17:35:09*laaron joined #nim
17:35:39*Jesin joined #nim
17:36:29*leorize joined #nim
17:48:20*gangstacat joined #nim
17:49:44FromGitter<alehander42> hm
17:49:49FromGitter<alehander42> does somebody run nimkernel
17:49:51FromGitter<alehander42> with new nim
17:49:56FromGitter<alehander42> i get missing appendString
17:51:28*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
17:51:44*laaron joined #nim
17:52:58FromGitter<alehander42> https://github.com/nim-lang/Nim/commit/a85d3879282a15e85ce9dd18b9a5bf020096a76c
17:53:07*gangstacat quit (Client Quit)
17:53:07FromGitter<alehander42> this fixed a previous bug
17:53:10FromGitter<alehander42> with that
17:53:19FromGitter<alehander42> hm how to find
17:53:23FromGitter<alehander42> what else is invoking
17:54:39*fredrik92 quit (Ping timeout: 248 seconds)
18:25:25*ShalokShalom43 joined #nim
18:31:24*jjido_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:33:44*sz0 quit (Quit: Connection closed for inactivity)
18:36:54*neceve quit (Read error: Connection reset by peer)
18:44:34*ShalokShalom43 quit (Remote host closed the connection)
18:44:34*ShalokShalom quit (Remote host closed the connection)
18:47:12*ShalokShalom joined #nim
18:55:53*jxy_ quit (Quit: leaving)
18:56:11*jxy joined #nim
19:09:19poopBothttps://hastebin.com/lihabejosa.cs
19:10:10poopBot^^^ need magic input from guild masters
19:18:40*rnrwashere quit (Remote host closed the connection)
19:19:38poopBoti tyred addign {.closure, gcsafe.} after async but that didnet wokr
19:20:08rayman22201because it's not gc safe lol.
19:20:25rayman22201accessing a global like that will never be gc safe
19:21:33poopBotso what should i do then, annote it unsafe or what
19:22:14poopBotis there some turtorial about this
19:23:05*Vladar quit (Remote host closed the connection)
19:23:32rayman22201good question. Maybe the Nim book? idk
19:24:03rayman22201don't use global variables. They are almost always bad.
19:24:58poopBoti hate reading books, so how to implement singleton if no globar variable?
19:25:44poopBotmeyeb this will help i go read https://nim-lang.github.io/Nim/manual.html#threads
19:26:37*cyraxjoe quit (Ping timeout: 246 seconds)
19:26:59*elrood joined #nim
19:27:40rayman22201You won't read books but you will read websites? lol...
19:28:27rayman22201singletons are also generally bad desing
19:28:29rayman22201design
19:28:32rayman22201use a database
19:28:37rayman22201that's what they were built for
19:29:37poopBotso waht if i am making a gameserver like duno cs go i should use a DB for storing positions and aiming ???
19:30:10*vivus joined #nim
19:30:19poopBotdid you read book? does it cower my issue?
19:30:37rayman22201You can either wrap your singleton with accessor procs that lock (or use lockfree datastructures), or using message passing, i.e. channels.
19:31:00vivusis this valid syntax: `and y.row[1] not in table2` ? it gives me an error when I try to run it
19:31:44rayman22201don't assume because your game is turn base that you will never have race conditions.
19:32:00narimiranvivus: use `notin`, without space
19:32:22poopBot accesor procs that lock -- SOUNDS LIKE WHAT I WANT
19:32:38rayman22201https://livebook.manning.com/#!/book/nim-in-action/chapter-6/
19:33:23rayman22201specifically chapter 6.5 "Dealing with race conditions"
19:34:00poopBotty will read up
19:35:48vivusnarimiran: can you tell me where my logic is flawed: https://dpaste.de/YFn3 ? the `elif` deletes all the keys except 1
19:35:56*nsf quit (Quit: WeeChat 2.4)
19:37:43narimiranvivus: what are mytable and table2?
19:38:27*elrood quit (Remote host closed the connection)
19:38:34vivusnarimiran: mytable = newTable[string, (string, seq[string])]() ... table2 = newTable[string, string]()
19:41:22narimiranfirst off, does line 17 really work when you uncomment that part?
19:41:42vivusnarimiran: yeah, that works as expected
19:42:15narimiranwell, "working as expected" is unexpected for me :D you can delete elements while iterating over it?!
19:42:36rayman22201sorry for coming off like an ass @poopBot. Honestly that error message is not as good as it could be, and there really aren't enough tutorials for Nim in general (yet :-P). If you can catch Dom96's attention, he is the ultimate expert on async in Nim.
19:43:39narimiranvivus: at least on devel, that should give you an AssertionError
19:44:09vivusnarimiran: yeah it does work. it deletes the item
19:45:04FromGitter<jrfondren> @narimiran, would you want an error if you iterated over an array[10, int] while mutating it?
19:45:35poopBotrayman22201, np i am thick skined and grown on playing fallout and ganging in hood so cant touch me xD
19:47:35narimiranvivus: here is the simplest example: http://ix.io/1JLg this raises AssertionError (unless you are in the release mode)
19:47:52vivuswhat is the latest stable version? 0.19.4?
19:48:11narimiranvivus: 0.19.6; but that AssertionError is only in devel
19:48:31narimiranso even if it works for you now, it won't work the next week ;)
19:49:16vivusmy code is a bit different though. I am checking if the value is empty, not if the key exists
19:49:21FromGitter<jrfondren> well that's #2 for "break it for no reason" features coming from devel
19:49:32vivuslet me update
19:49:51narimiran@jrfondren one thing is `a[i] = newValue`, other thing is resizing of seq
19:51:54*vlad1777d joined #nim
19:52:04narimiranwithout that i think i could do funny things with adding stuff to a table while iterating over it
19:53:10FromGitter<alehander42> Araq, it seems []=
19:53:16FromGitter<alehander42> somehow triggers appendString
19:53:20FromGitter<jrfondren> why are you checking the length of the table instead of the length of seq that's backing the table?
19:53:35FromGitter<jrfondren> you're erroring out on stuff that won't actually break anything.
19:53:57narimiranjrfondren: it is faster :P
19:54:18FromGitter<jrfondren> are you sure about that?
19:54:53narimiranvivus: "I am checking if the value is empty, not if the key exists" still the same (http://ix.io/1JLk), you shouldn't do that
19:55:02narimiran@jrfondren i am
19:55:18vivusdoes it still cause an error/
19:55:21vivus*?
19:55:27narimiranlen(table) = table.counter
19:55:58FromGitter<jrfondren> yes, and seqs also have a length field
19:56:23narimiranvivus: you shouldn't modify the table you're iterating over, it doesn't matter how you write your condition
19:56:33narimiran@jrfondren ah, you got me there :)
19:57:01vivusnarimiran: this is why I was trying to get the `elif` correct, so that I could avoid doing this type of checking
19:57:59FromGitter<jrfondren> well I'll pause my aggravation for now but I promise that one day, maybe not today, maybe not tomorrow, but one day, I'm going to be really annoyed about this restriction.
19:59:23FromGitter<jrfondren> but I guess a workaround at that time will be -d:release
19:59:24narimiran@jrfondren: you might be right, checking if the length of the seq underneath has changed might be "more correct", but that could lead to more questions
19:59:50narimiran"how come i can add a key 3 times, but not the 4th time?"
20:00:28FromGitter<jrfondren> questions aren't so bad if you have documentation
20:00:51narimiranbut why are you so upset about this? is this something that you regularly (ab)use?
20:01:07FromGitter<jrfondren> no, I just said that I was pausing my aggravation.
20:01:14vivusnarimiran: how can I make the `elif` work?
20:02:06narimiranvivus: why do you even need `if y.row[0] in mytable` part? see `del` documentation: "Deletes ``key`` from hash table ``t``. Does nothing if the key does not exist."
20:02:36FromGitter<Vindaar> @poopBot: something like this might work for your case: http://ix.io/1JLo/nim ⏎ I'm using this sort of approach myself, but I never have to serve several clients at the same time. So not sure if the server will handle those properly right now (didn't test the code). The communication between main thread and callbacks should work though
20:03:30FromGitter<jrfondren> @narimiran, also a more amusing example is "why, when I add an 'x' key during iteration, does that key not show up, but when I add an 'A' it does show up during the iteration?"
20:03:54vivusnarimiran: I updated the paste to show the first part too: https://dpaste.de/vJ9F
20:03:57dom96_poopBot: What are you trying to do with threads?
20:04:01*dom96_ is now known as dom96
20:04:01*dom96 quit (Changing host)
20:04:01*dom96 joined #nim
20:05:26poopBothmm am making poker game for fun, i finished logic part of figuring out best hands and stuff, now i want to use websockets and basicly i just want to make a singleton where pokergame hepends and process inuput form websockets
20:06:05dom96you don't need threads for this
20:07:18poopBotso how then should i acces an global objec from this webscoket thing
20:07:32poopBothttps://hastebin.com/lihabejosa.cs
20:07:41poopBothere my inital question,
20:08:35poopBot@Vindaar: ty will check that too
20:08:43narimiranvivus: this is just moving the code around, but see if this still doesn't work: http://ix.io/1JLr
20:08:46FromGitter<jrfondren> @poopBot, make it .threadvar.
20:09:58FromGitter<jrfondren> you don't actually need a program-wide singleton; you just need gcsafe-marked procs all running under the same thread to be able to access shared data
20:10:06dom96yeah ^
20:11:56poopBotok i think i got it
20:15:42*lritter quit (Quit: Leaving)
20:22:56poopBothttps://hastebin.com/evolitoyes.cs
20:24:03poopBotso its working, just it gives me warning about this process that its not gcsafe (cuz i makred it .gcsafe.) so cuz myani is GC destoryed until i terminate program all this is good right
20:24:51poopBotam raning 4 cleint instances and my pig just reached 740+ years
20:25:09poopBoti frogot to add yeast after getage()
20:26:05poopBot'incmyani' is not GC-safe as it accesses 'myani' which is a global using GC'ed memory [GcUnsafe2]
20:29:47*narimiran quit (Remote host closed the connection)
20:30:58poopBoti need to learn to write, i just read what i typed and its really hard to figure out what i wanted to say :)
20:32:12poopBotso my question is, so it gives me warnings about each proc that is unsafe, should i ignore that warning or do i need to learn up, am atm reading about sahred memory 6.5
20:34:05FromGitter<jrfondren> make it .threadvar.
20:36:12FromGitter<jrfondren> typos within words are relatively easy to read. what's harder is deliberate slang like 'cuz'. the hardest thing to understand was that you were aging a pig :p
20:36:39poopBothmm, sory but you all little confusing me, first person pointed me to shared memory and locks, second person gived me a channel meyeb working thing, thrid person told me to use threadward, 4th person told me to just use gcsafe procs
20:37:29rayman22201*facepalm* too many chefs in the kitchen lol
20:37:39FromGitter<jrfondren> did anyone really tell you to use gcsafe procs?
20:37:52poopBoti think you need now to death so i can only serve 1 master
20:38:24poopBot" you just need gcsafe-marked procs all running under the same thread to be able to access shared data"
20:38:31poopBotor meybe i got it wrong
20:38:37FromGitter<jrfondren> that wasn't me telling you to use gcsafe procs. that was me telling you to use threadvar
20:39:06poopBotok then so will focuse on threadvar
20:39:31FromGitter<jrfondren> ```var myani {.threadvar.}: Animal ⏎ myani = Animal(name:"Pig", age:1)``` [https://gitter.im/nim-lang/Nim?at=5ce5b383ecdf942b4c2a5b11]
20:39:48FromGitter<jrfondren> that's enough to resolve the gc safety warnings
20:40:15FromGitter<jrfondren> I feel like you have an off-by-one error though. Shouldn't your pig start at age 0 ?
20:44:58*stefantalpalaru quit (Quit: stefantalpalaru)
20:46:40poopBotok now i have no errors, https://nim-lang.github.io/Nim/manual.html, so where can i find info about this threadvar would like to know how it works, whats heppending now cuz i duno
20:48:20poopBotsearhhing it in Nim in Action or in manual dident get anything
20:49:36FromGitter<jrfondren> https://nim-lang.github.io/Nim/manual.html#threads-gc-safety
20:50:06vivusnarimiran[m]: I tried your suggested solution and it does the same thing as my code does
20:50:45*Trustable quit (Remote host closed the connection)
20:53:08rayman22201a threadvar is essentially a global variable for a single thread only. The manual should probably be expanded to talk about how threadvar and gcsafe interact.
20:53:25rayman22201I think that is a common issue with new people, especially when they start to do async stuff.
20:53:52*fredrik92 joined #nim
20:54:31poopBotok so from whati undestod, using {.gcsafe.} just alowes me to copile this proc, and that threadvar make this variable local to this thread, tough wierd i thinked just var something = "sdas" is just a local varbiale
20:54:36*btbytes joined #nim
20:55:22rayman22201yeah, gcsafe is basically to tell the compiler, "shut up, I know what I'm doing".
20:55:22FromGitter<jrfondren> it could be more explicit. it's implied by the 'no heap sharing' restriction.
20:55:52FromGitter<jrfondren> {.gcsafe.} as a block does that. {.gcsafe.} as a pragma attached to a proc is asking the compiler to check things actually.
20:57:24*smitop joined #nim
20:57:57rayman22201That's not true. "The gcsafe annotation can be used to mark a proc to be gcsafe, otherwise this property is inferred by the compiler."
20:58:34rayman22201and compiler technically always checks, but .gcsafe turns gc safe effect errors into a warning instead of an error.
20:59:18FromGitter<jrfondren> eh, alright
21:01:16FromDiscord_<kiwi> @federico3 ... can you change the background colour of the UI & the background colour of the buttons in ui.nim / libui? Like this .... https://i.imgur.com/4DHBmQn.png
21:02:18rayman22201@poopBot, to answer your question about var = "sdas". A var at the top of the file like your example that becomes a global variable. If you were to put it inside a proc, then it would be a local variable.
21:03:48*couven92 quit (Disconnected by services)
21:03:50*fredrik92 is now known as couven92
21:04:13*fredrik92 joined #nim
21:19:15*rnrwashere joined #nim
21:22:53*vivus quit (Remote host closed the connection)
21:23:39*rnrwashere quit (Ping timeout: 248 seconds)
21:41:10*cyraxjoe joined #nim
22:00:05*leorize quit (Remote host closed the connection)
22:00:51*leorize joined #nim
22:02:15*couven92 quit (Quit: Client Disconnecting)
22:02:34*xet7 quit (Quit: Leaving)
22:04:08*laaron quit (Remote host closed the connection)
22:04:47*laaron joined #nim
22:11:58*sealmove joined #nim
22:18:09*clyybber joined #nim
22:23:51*arecaceae quit (Remote host closed the connection)
22:24:10*arecaceae joined #nim
22:33:15*xet7 joined #nim
22:35:22*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
22:36:06*laaron joined #nim
22:39:23*Jesin quit (Quit: Leaving)
22:47:31*Jesin joined #nim
22:50:12sealmoveAraq: can you remind me what's missing from btrees.nim?
22:51:54*solitudesf quit (Ping timeout: 258 seconds)
22:55:14*xet7 quit (Quit: Leaving)
22:57:38*rantfisch is now known as qwertfisch
23:13:37*stefanos82 quit (Remote host closed the connection)
23:53:59Araqsealmove: del()
23:54:16sealmovecool