<< 16-08-2017 >>

00:06:31*chemist69 quit (Ping timeout: 255 seconds)
00:15:07*pilne joined #nim
00:20:22*chemist69 joined #nim
00:21:04*Tiberium quit (Remote host closed the connection)
00:29:02*jinshil joined #nim
00:44:43*yglukhov quit (Remote host closed the connection)
00:46:05*v17d joined #nim
00:51:10*endragor joined #nim
00:55:29*endragor quit (Ping timeout: 248 seconds)
01:14:30*chemist69 quit (Ping timeout: 240 seconds)
01:18:07*smt quit (Ping timeout: 260 seconds)
01:23:33*v17d quit (Remote host closed the connection)
01:28:24*chemist69 joined #nim
02:01:14*dddddd quit (Remote host closed the connection)
02:22:39*endragor joined #nim
02:48:55*def-pri-pub joined #nim
03:27:15*pilne quit (Quit: Quitting!)
03:39:40*def-pri-pub quit (Quit: leaving)
05:13:25*Lord_Nightmare quit (Ping timeout: 246 seconds)
05:23:04*Lord_Nightmare joined #nim
05:46:38*dankrad quit (Ping timeout: 246 seconds)
05:51:03*rauss quit (Quit: WeeChat 1.9)
06:09:14*gangstacat joined #nim
06:14:20*Vladar joined #nim
06:15:56*nsf joined #nim
06:32:43*ShalokShalom_ joined #nim
06:36:02*ShalokShalom quit (Ping timeout: 260 seconds)
06:40:49*solitude joined #nim
06:47:13*Arrrr joined #nim
06:47:13*Arrrr quit (Changing host)
06:47:13*Arrrr joined #nim
06:48:54*planhths joined #nim
07:22:44*yglukhov joined #nim
07:26:08*planhths quit (Ping timeout: 240 seconds)
07:29:52*MonsterAbyss_ is now known as MonsterAbyss
07:33:55*mahmudov joined #nim
07:46:24*couven92 joined #nim
08:03:13*nattefrost joined #nim
08:13:37*planhths joined #nim
08:38:28*dom96|w joined #nim
08:51:39*endragor quit (Quit: Leaving...)
08:54:28*gokr joined #nim
09:04:42*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
09:05:22*jinshil quit (Quit: Good-bye!)
09:16:10*mahmudov quit (Ping timeout: 240 seconds)
09:32:11*dom96|w joined #nim
09:33:47*Tiberium joined #nim
09:42:11*gokr quit (Ping timeout: 246 seconds)
09:54:51*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
09:56:06*dom96|w joined #nim
09:59:05*gokr joined #nim
09:59:05*dave24 quit (Ping timeout: 255 seconds)
10:00:33*planhths quit (Ping timeout: 248 seconds)
10:00:51*dave24 joined #nim
10:05:39*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
10:05:46*PMunch joined #nim
10:07:00*ShalokShalom_ is now known as ShalokShalom
10:28:19*arnetheduck joined #nim
10:29:03*haha_ joined #nim
10:41:04*dom96|w joined #nim
10:43:58*crem quit (Ping timeout: 240 seconds)
11:14:37*dddddd joined #nim
11:15:38*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
11:17:25*haha_ quit (Quit: haha_)
11:31:56*scriptum quit (Quit: Leaving)
11:41:51*dom96|w joined #nim
11:56:34*crem joined #nim
12:09:03*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
12:11:42*dom96|w joined #nim
12:13:43*Arrrr quit (Read error: Connection reset by peer)
12:21:45*haha_ joined #nim
12:23:05*haha_ quit (Client Quit)
12:38:02*mahmudov joined #nim
12:56:58*nattefrost quit (Remote host closed the connection)
13:01:13*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
13:19:48*rauss joined #nim
13:31:32*couven92 quit (Quit: Client disconnecting)
13:32:54*gangstacat quit (Quit: Leaving)
13:35:25*Matthias247 joined #nim
14:01:59*PMunch quit (Quit: Leaving)
14:03:09TiberiumWhy is it so quiet here today?
14:04:07*Calinou is now known as A_tumbleweed
14:04:11*A_tumbleweed passes by.
14:04:19*A_tumbleweed is now known as Calinou
14:06:14*nsf quit (Quit: WeeChat 1.9)
14:09:17Tiberiumis there an easy way to "reverse" a table?
14:09:18Tiberiumlike
14:09:35Tiberium{1: "1", 2: "2"} to {"1": 1, "2": 2}
14:17:23*BitPuffin|osx joined #nim
14:23:11raussLmao ^^^
14:25:31raussTiberium: that's often called "invert"
14:25:35Tiberiumyeah
14:26:04raussThere's not a built-in way AFAIK but it seems pretty straightforward to do a loop and set table[value] = key
14:29:24raussTiberium: Btw I've been using godot-nim a lot recently and it has been great
14:29:36raussTiberium: Did you ever get passed whichever issues you had?
14:29:53Tiberiumwell I didn't try to use it after fixes :)
14:29:58*haha_ joined #nim
14:32:56*haha_ quit (Client Quit)
14:34:01Tiberiumalso I've solved this in a more elegant way via list comprehensions :)
14:34:17Tiberiumlet data = lc[(FlipTable[key], key) | (key <- FlipTable.keys), tuple[a, b: string]].toTable()
14:34:22Tiberiumalso it's a const
14:34:28Tiberiumso it's computed on compile-time
14:34:47*haha_ joined #nim
14:39:41raussYeah, nice!
14:39:51raussTiberium: I love the name :-D
14:40:33Tiberiumwell it's a table with values like this: key=a val=ɐ
14:40:35rauss(╯°□°)╯︵ ┻━┻
14:40:45raussHahahahahaha
14:40:56Tiberiumso I want to invert string
14:41:05raussSo all operations are idempotent!
14:41:11Tiberiumhello - ollǝɥ
14:41:54raussif you flip `a => ɐ` you get `a => ɐ`
14:42:10Tiberiumwell not flip, but invert :)
14:42:37cremnope, with both flip and mirror it's <=
14:42:38raussI was going with the table flipping metaphor
14:42:48*dom96|w joined #nim
14:42:52*gokr quit (Ping timeout: 246 seconds)
14:43:12cremDid you know that (()) was not a palindrome?
14:43:17crem())( is!
14:43:25raussAnyway we solved your "quiet in here" dilemma
14:43:39Tiberiumyeah
14:43:54rausscrem: That's really crazy
14:44:29rausscrem: Like with letters it's obvious, AABB isn't but ABBA is
14:44:47raussseeing it with symbols breaks that understanding, and makes it seem like magicks
14:48:11*xet7 joined #nim
14:59:29AraqTiberium: strutils.multiReplace ?
14:59:57Araqno need to construct a compiletime table, invert it and then pass it to some shitty homegrown algorithm when you can use multiReplace
15:02:56*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:05:29Tiberiumwell I need to replace unicode characters, so I can't use multiReplace
15:07:11Tiberiumalso why there's no procedure like python's dict.get
15:07:14Tiberiumyou can call it like
15:07:30Tiberiumdict.get(key, "fallback value")
15:08:28Tiberiumoh, there is
15:08:30Tiberiumfor string tables!!
15:09:12euantorYeah, I think that's been talked about before with a possible overload for `tables.getOrDefault` to allow a third parameter for a fallback value
15:09:23euantorWHich would make sense to me, it's a fairly common task
15:10:22Tiberiumwell I think it's very very easy to implement
15:10:40euantorit is indeed
15:11:55Tiberiumalso it would be faster than checking if key in a table before access
15:12:39Tiberiumlike instead of "if letter in table: data = table[letter] else: letter" you just do data = table.get(letter, letter)
15:12:59cremAlso need for set_if_missing(key, value) is not rare either.
15:13:08euantorI like the `getOrDefault()` name
15:13:14euantorThere is a `getOrPut` already
15:13:20cremok!
15:13:42euantorOr `hasKeyOrPut`: https://nim-lang.org/docs/tables.html#hasKeyOrPut,Table[A,B],A,B
15:13:44Tiberiumreturns true iff key is in the table, otherwise inserts value
15:13:46TiberiumhasKeyOrPut
15:14:22euantorAnd `mgetOrPut`: https://nim-lang.org/docs/tables.html#mgetOrPut,TableRef[A,B],A,B
15:14:30Tiberiumyeah
15:14:30euantorWhich returns the existing value or the added value
15:16:20*Trustable joined #nim
15:18:38AraqTiberium: huh? multiReplace deals with strings and an Unicode character is a string (pretty much)
15:25:59*MyMind joined #nim
15:27:29*Sembei quit (Ping timeout: 248 seconds)
15:34:49*yglukhov quit (Remote host closed the connection)
15:36:45*dom96|w joined #nim
15:38:41*BitPuffin|osx quit (Ping timeout: 248 seconds)
15:41:39*yglukhov joined #nim
15:46:07*yglukhov quit (Ping timeout: 260 seconds)
15:47:28*itseris quit (Ping timeout: 240 seconds)
15:51:06*gokr joined #nim
16:04:05*dddddd quit (Ping timeout: 240 seconds)
16:16:47*dddddd joined #nim
16:18:16*itseris joined #nim
16:18:28*mahmudov quit (Ping timeout: 240 seconds)
16:20:33*haha_ quit (Quit: haha_)
16:28:07*Matthias247 quit (Read error: Connection reset by peer)
16:33:35*yglukhov joined #nim
16:36:06*dankrad joined #nim
16:36:43*yglukhov quit (Read error: Connection reset by peer)
16:37:15*yglukhov joined #nim
16:46:14*smt joined #nim
16:59:25*Trustable quit (Remote host closed the connection)
17:00:58*haha_ joined #nim
17:04:39*v17d joined #nim
17:07:34*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:09:12*haha_ quit (Quit: haha_)
17:19:27*dddddd quit (Ping timeout: 260 seconds)
17:22:41*gokr quit (Ping timeout: 248 seconds)
17:32:01*dddddd joined #nim
17:42:14*mahmudov joined #nim
17:47:38*dankrad quit (Ping timeout: 246 seconds)
17:48:29*scriptum joined #nim
17:49:28*dankrad joined #nim
17:58:45subsetparkis there an operator that acts like Python's `or` in expressions like `foo or 1`?
17:58:55subsetparkOr would that just be an if expression
18:03:30*haha_ joined #nim
18:06:02*PMunch joined #nim
18:06:43euantorThere's this: https://github.com/piedar/coalesce
18:09:33subsetparkDidn't know that was the verb!
18:26:56Tiberiumsubsetpark, well you can use this
18:27:02Tiberiumlet a = if something: foo else: 1
18:27:12Tiberiumif I understood you correctly
18:28:02*v17d quit (Remote host closed the connection)
18:30:45*Matthias247 joined #nim
18:32:15subsetparkTiberium: i'm basically just wondering about sugar around `if foo != 0: foo else: 1`
18:32:40subsetparkin Python `foo or 1` == `if bool(foo): foo else: 1`
18:32:45subsetparkwith a short-circuit on the 1
18:33:13Tiberiumsubsetpark, well there's no that thing
18:33:16Tiberiumonly let a = if something: foo else: 1
18:33:30subsetparkyes, hence euantor's link :)
18:38:11rausseuantor: That's cool, thanks
18:40:42euantoryeah, it's pretty neat. Was posted in the Nim reddit a while back
18:41:39subsetparkugh any advice on debugging a [GCASSERT] decRef: interiorPtr exception?
18:42:22dom96subsetpark: D:
18:42:29dom96Try the other GCs
18:42:33dom96--gc:markandsweep
18:42:35subsetparkhaha noooo
18:42:37dom96and --gc:boehm
18:43:28FromGitter<JohnEmhoff> what's the default --gc?
18:43:55subsetparkdom96: are those production-ready these days?
18:44:13dom96subsetpark: sure, why wouldn't they be?
18:44:22subsetparkdunno. Last I heard they were kind of flaky.
18:44:32subsetparkOr maybe I just don't understand their tradeoffs.
18:44:40dom96I'm actually using markandsweep for my Snake game IIRC
18:46:53dom96JohnEmhoff: I'm not sure what it's name is, but it's the deferred RC'ing soft real-time GC.
18:47:07*gokr joined #nim
18:49:43subsetparkdom96: why keep around three different gcs then?
18:50:05dom96subsetpark: because each is better at different things
18:59:04subsetparkdom96: next you're gonna tell me their relative advantages and disadvantages are documented somewhere :)
18:59:16dom96Doubt it :)
19:01:02*Vladar quit (Quit: Leaving)
19:03:02*nsf joined #nim
19:03:29subsetparkManI tell you what, rob Pike would never stand for that...
19:06:14dom96I wouldn't either if I got to work on Nim full-time ;)
19:15:25Tiberiumwas it a bit intentional to make JSON fully valid in NIm?
19:15:50TiberiumI mean not parsing JSON, but writing JSON in Nim code
19:16:02dom96not really
19:16:18dom96The {"...": ...} was created rather cleverly
19:16:30dom96and didn't arrive until quite recently
19:16:44*haha_ quit (Quit: haha_)
19:18:08FromGitter<JohnEmhoff> I'm a little bit confused by the fact that lots of things (such as sequences) have value semantics. How do I efficiently pass huge lists as proc parameters; with "var" parameters?
19:23:29dom96I think you can safely pass them normally, the compiler will pick the most efficient way to pass the sequence.
19:25:29*Jesin joined #nim
19:25:44FromGitter<JohnEmhoff> @dom96 okay, thanks. Looking at the generated C it seems the difference is passing a * vs a **
19:26:03FromGitter<JohnEmhoff> I mean, pointer vs pointer to a pointer
19:30:05Tiberiumalso don't forget that C compiler can optimize code too :)
19:30:37FromGitter<JohnEmhoff> yeah, that's a lot of abstraction and indirection to wade through though :)
19:33:55Tiberiumdom96, is there a way to force json module to not convert unicode letters to something like "\u0431\u043E\u0442" ?
19:34:14TiberiumI mean if I'm converting JSON to string
19:34:22FromGitter<Varriount> @JohnEmhoff Sequences, strings, and object types have copy-on-assignment semantics
19:34:24Tiberiumwell, I can use a simple workaround
19:34:26dom96I don't think so
19:34:37dom96why do you want this?
19:35:00Tiberiumwell because I use json for configuration and I have a configuration template in my program
19:35:00FromGitter<Varriount> Parameters are passed intelligently by the compiler.
19:35:19TiberiumIf I define a template as string (e.g. just embed json in string), it writes to file like normal letters
19:35:38Tiberiumif I use %* and then pretty, it becomes "\u0431\u043E\u0442"
19:35:48FromGitter<JohnEmhoff> @Varriount The C compiler, or Nim compiler?
19:36:07Tiberiumwell It doesn't really matter for me
19:36:07FromGitter<JohnEmhoff> mostly just curious as to where the smarts are
19:36:14TiberiumSince it's easy to embed JSON in a string
19:36:25dom96JohnEmhoff: Nim
19:36:31FromGitter<Varriount> @JohnEmhoff the Nim compiler mostly
19:36:54FromGitter<Varriount> I wouldn't be surprised if the C compiler does copy optimizations though
19:41:05*Jesin quit (Ping timeout: 240 seconds)
20:09:32*dankrad_ joined #nim
20:12:35*dankrad quit (Ping timeout: 240 seconds)
20:31:09Araqsubsetpark: m&s GC --> throughput
20:31:17Araqrefc GC --> responsiveness
20:31:43Araqboehm GC --> single shared heap
20:33:16*xet7 quit (Quit: Leaving)
20:37:38*dankrad_ quit (Ping timeout: 255 seconds)
20:38:28*salewski joined #nim
20:38:29TiberiumAraq, wait what? you can use shared memory between threads with boehm?
20:38:35Araqyes
20:38:52Tiberiumwithout manual memory management?
20:39:05TiberiumI mean like "ptr" and so
20:39:18*dankrad joined #nim
20:40:50Araqyes
20:41:16Araqnew(x) et al are mapped to the Boehm GC which supports shared memory
20:41:49*dankrad quit (Remote host closed the connection)
20:42:04Araqyou need to convince Nim though that GC safety is not an issue, you can do that via
20:42:11Araq{.gcsafe.}:
20:42:17Araq # dangerous code here
20:42:54dom96or just --threadAnalysis:off :P
20:43:11dom96in fact, why isn't that just implicit for boehm?
20:44:54Araqbecause you're supposed to be able to switch between GCs
20:45:33Araqwithout changing a line of code, with --gc:boehm and --threadAnalysis:off problems are hidden for good
20:46:34*dankrad joined #nim
20:47:04*Tiberium quit (Remote host closed the connection)
20:49:46*Tiberium joined #nim
20:49:56*rauss quit (Quit: WeeChat 1.9)
20:59:29*byteflame joined #nim
21:13:58*onionhammer quit (Ping timeout: 240 seconds)
21:18:48*salewski quit (Quit: WeeChat 1.4)
21:20:28*solitude quit (Ping timeout: 255 seconds)
21:32:41*onionhammer joined #nim
21:33:27*rauss joined #nim
21:34:48*onionhammer quit (Client Quit)
21:46:25*Matthias247 quit (Read error: Connection reset by peer)
21:53:01*couven92 joined #nim
21:57:27*couven92 quit (Client Quit)
22:06:49FromGitter<zacharycarter> o/
22:08:59*PMunch quit (Quit: leaving)
22:15:46*Tiberium quit (Ping timeout: 246 seconds)
22:17:30*Tiberium joined #nim
22:27:17*dankrad quit (Remote host closed the connection)
22:27:17*ludocode joined #nim
22:31:30*dankrad joined #nim
22:39:07*gokr quit (Ping timeout: 260 seconds)
22:55:43*nsf quit (Quit: WeeChat 1.9)
23:09:17*cspar joined #nim
23:15:52*Tiberium quit (Read error: Connection reset by peer)
23:29:14*mahmudov quit (Ping timeout: 246 seconds)
23:34:49*jinshil joined #nim
23:36:00*pilne joined #nim
23:54:15*yglukhov quit (Remote host closed the connection)