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:09 | Tiberium | Why 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:17 | Tiberium | is there an easy way to "reverse" a table? |
14:09:18 | Tiberium | like |
14:09:35 | Tiberium | {1: "1", 2: "2"} to {"1": 1, "2": 2} |
14:17:23 | * | BitPuffin|osx joined #nim |
14:23:11 | rauss | Lmao ^^^ |
14:25:31 | rauss | Tiberium: that's often called "invert" |
14:25:35 | Tiberium | yeah |
14:26:04 | rauss | There's not a built-in way AFAIK but it seems pretty straightforward to do a loop and set table[value] = key |
14:29:24 | rauss | Tiberium: Btw I've been using godot-nim a lot recently and it has been great |
14:29:36 | rauss | Tiberium: Did you ever get passed whichever issues you had? |
14:29:53 | Tiberium | well I didn't try to use it after fixes :) |
14:29:58 | * | haha_ joined #nim |
14:32:56 | * | haha_ quit (Client Quit) |
14:34:01 | Tiberium | also I've solved this in a more elegant way via list comprehensions :) |
14:34:17 | Tiberium | let data = lc[(FlipTable[key], key) | (key <- FlipTable.keys), tuple[a, b: string]].toTable() |
14:34:22 | Tiberium | also it's a const |
14:34:28 | Tiberium | so it's computed on compile-time |
14:34:47 | * | haha_ joined #nim |
14:39:41 | rauss | Yeah, nice! |
14:39:51 | rauss | Tiberium: I love the name :-D |
14:40:33 | Tiberium | well it's a table with values like this: key=a val=ɐ |
14:40:35 | rauss | (╯°□°)╯︵ ┻━┻ |
14:40:45 | rauss | Hahahahahaha |
14:40:56 | Tiberium | so I want to invert string |
14:41:05 | rauss | So all operations are idempotent! |
14:41:11 | Tiberium | hello - ollǝɥ |
14:41:54 | rauss | if you flip `a => ɐ` you get `a => ɐ` |
14:42:10 | Tiberium | well not flip, but invert :) |
14:42:37 | crem | nope, with both flip and mirror it's <= |
14:42:38 | rauss | I 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:12 | crem | Did you know that (()) was not a palindrome? |
14:43:17 | crem | ())( is! |
14:43:25 | rauss | Anyway we solved your "quiet in here" dilemma |
14:43:39 | Tiberium | yeah |
14:43:54 | rauss | crem: That's really crazy |
14:44:29 | rauss | crem: Like with letters it's obvious, AABB isn't but ABBA is |
14:44:47 | rauss | seeing it with symbols breaks that understanding, and makes it seem like magicks |
14:48:11 | * | xet7 joined #nim |
14:59:29 | Araq | Tiberium: strutils.multiReplace ? |
14:59:57 | Araq | no 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:29 | Tiberium | well I need to replace unicode characters, so I can't use multiReplace |
15:07:11 | Tiberium | also why there's no procedure like python's dict.get |
15:07:14 | Tiberium | you can call it like |
15:07:30 | Tiberium | dict.get(key, "fallback value") |
15:08:28 | Tiberium | oh, there is |
15:08:30 | Tiberium | for string tables!! |
15:09:12 | euantor | Yeah, 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:23 | euantor | WHich would make sense to me, it's a fairly common task |
15:10:22 | Tiberium | well I think it's very very easy to implement |
15:10:40 | euantor | it is indeed |
15:11:55 | Tiberium | also it would be faster than checking if key in a table before access |
15:12:39 | Tiberium | like instead of "if letter in table: data = table[letter] else: letter" you just do data = table.get(letter, letter) |
15:12:59 | crem | Also need for set_if_missing(key, value) is not rare either. |
15:13:08 | euantor | I like the `getOrDefault()` name |
15:13:14 | euantor | There is a `getOrPut` already |
15:13:20 | crem | ok! |
15:13:42 | euantor | Or `hasKeyOrPut`: https://nim-lang.org/docs/tables.html#hasKeyOrPut,Table[A,B],A,B |
15:13:44 | Tiberium | returns true iff key is in the table, otherwise inserts value |
15:13:46 | Tiberium | hasKeyOrPut |
15:14:22 | euantor | And `mgetOrPut`: https://nim-lang.org/docs/tables.html#mgetOrPut,TableRef[A,B],A,B |
15:14:30 | Tiberium | yeah |
15:14:30 | euantor | Which returns the existing value or the added value |
15:16:20 | * | Trustable joined #nim |
15:18:38 | Araq | Tiberium: 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:45 | subsetpark | is there an operator that acts like Python's `or` in expressions like `foo or 1`? |
17:58:55 | subsetpark | Or would that just be an if expression |
18:03:30 | * | haha_ joined #nim |
18:06:02 | * | PMunch joined #nim |
18:06:43 | euantor | There's this: https://github.com/piedar/coalesce |
18:09:33 | subsetpark | Didn't know that was the verb! |
18:26:56 | Tiberium | subsetpark, well you can use this |
18:27:02 | Tiberium | let a = if something: foo else: 1 |
18:27:12 | Tiberium | if I understood you correctly |
18:28:02 | * | v17d quit (Remote host closed the connection) |
18:30:45 | * | Matthias247 joined #nim |
18:32:15 | subsetpark | Tiberium: i'm basically just wondering about sugar around `if foo != 0: foo else: 1` |
18:32:40 | subsetpark | in Python `foo or 1` == `if bool(foo): foo else: 1` |
18:32:45 | subsetpark | with a short-circuit on the 1 |
18:33:13 | Tiberium | subsetpark, well there's no that thing |
18:33:16 | Tiberium | only let a = if something: foo else: 1 |
18:33:30 | subsetpark | yes, hence euantor's link :) |
18:38:11 | rauss | euantor: That's cool, thanks |
18:40:42 | euantor | yeah, it's pretty neat. Was posted in the Nim reddit a while back |
18:41:39 | subsetpark | ugh any advice on debugging a [GCASSERT] decRef: interiorPtr exception? |
18:42:22 | dom96 | subsetpark: D: |
18:42:29 | dom96 | Try the other GCs |
18:42:33 | dom96 | --gc:markandsweep |
18:42:35 | subsetpark | haha noooo |
18:42:37 | dom96 | and --gc:boehm |
18:43:28 | FromGitter | <JohnEmhoff> what's the default --gc? |
18:43:55 | subsetpark | dom96: are those production-ready these days? |
18:44:13 | dom96 | subsetpark: sure, why wouldn't they be? |
18:44:22 | subsetpark | dunno. Last I heard they were kind of flaky. |
18:44:32 | subsetpark | Or maybe I just don't understand their tradeoffs. |
18:44:40 | dom96 | I'm actually using markandsweep for my Snake game IIRC |
18:46:53 | dom96 | JohnEmhoff: 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:43 | subsetpark | dom96: why keep around three different gcs then? |
18:50:05 | dom96 | subsetpark: because each is better at different things |
18:59:04 | subsetpark | dom96: next you're gonna tell me their relative advantages and disadvantages are documented somewhere :) |
18:59:16 | dom96 | Doubt it :) |
19:01:02 | * | Vladar quit (Quit: Leaving) |
19:03:02 | * | nsf joined #nim |
19:03:29 | subsetpark | ManI tell you what, rob Pike would never stand for that... |
19:06:14 | dom96 | I wouldn't either if I got to work on Nim full-time ;) |
19:15:25 | Tiberium | was it a bit intentional to make JSON fully valid in NIm? |
19:15:50 | Tiberium | I mean not parsing JSON, but writing JSON in Nim code |
19:16:02 | dom96 | not really |
19:16:18 | dom96 | The {"...": ...} was created rather cleverly |
19:16:30 | dom96 | and didn't arrive until quite recently |
19:16:44 | * | haha_ quit (Quit: haha_) |
19:18:08 | FromGitter | <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:29 | dom96 | I 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:44 | FromGitter | <JohnEmhoff> @dom96 okay, thanks. Looking at the generated C it seems the difference is passing a * vs a ** |
19:26:03 | FromGitter | <JohnEmhoff> I mean, pointer vs pointer to a pointer |
19:30:05 | Tiberium | also don't forget that C compiler can optimize code too :) |
19:30:37 | FromGitter | <JohnEmhoff> yeah, that's a lot of abstraction and indirection to wade through though :) |
19:33:55 | Tiberium | dom96, is there a way to force json module to not convert unicode letters to something like "\u0431\u043E\u0442" ? |
19:34:14 | Tiberium | I mean if I'm converting JSON to string |
19:34:22 | FromGitter | <Varriount> @JohnEmhoff Sequences, strings, and object types have copy-on-assignment semantics |
19:34:24 | Tiberium | well, I can use a simple workaround |
19:34:26 | dom96 | I don't think so |
19:34:37 | dom96 | why do you want this? |
19:35:00 | Tiberium | well because I use json for configuration and I have a configuration template in my program |
19:35:00 | FromGitter | <Varriount> Parameters are passed intelligently by the compiler. |
19:35:19 | Tiberium | If I define a template as string (e.g. just embed json in string), it writes to file like normal letters |
19:35:38 | Tiberium | if I use %* and then pretty, it becomes "\u0431\u043E\u0442" |
19:35:48 | FromGitter | <JohnEmhoff> @Varriount The C compiler, or Nim compiler? |
19:36:07 | Tiberium | well It doesn't really matter for me |
19:36:07 | FromGitter | <JohnEmhoff> mostly just curious as to where the smarts are |
19:36:14 | Tiberium | Since it's easy to embed JSON in a string |
19:36:25 | dom96 | JohnEmhoff: Nim |
19:36:31 | FromGitter | <Varriount> @JohnEmhoff the Nim compiler mostly |
19:36:54 | FromGitter | <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:09 | Araq | subsetpark: m&s GC --> throughput |
20:31:17 | Araq | refc GC --> responsiveness |
20:31:43 | Araq | boehm 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:29 | Tiberium | Araq, wait what? you can use shared memory between threads with boehm? |
20:38:35 | Araq | yes |
20:38:52 | Tiberium | without manual memory management? |
20:39:05 | Tiberium | I mean like "ptr" and so |
20:39:18 | * | dankrad joined #nim |
20:40:50 | Araq | yes |
20:41:16 | Araq | new(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:04 | Araq | you need to convince Nim though that GC safety is not an issue, you can do that via |
20:42:11 | Araq | {.gcsafe.}: |
20:42:17 | Araq | # dangerous code here |
20:42:54 | dom96 | or just --threadAnalysis:off :P |
20:43:11 | dom96 | in fact, why isn't that just implicit for boehm? |
20:44:54 | Araq | because you're supposed to be able to switch between GCs |
20:45:33 | Araq | without 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:49 | FromGitter | <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) |