00:16:01 | * | sean__ joined #nim |
00:17:50 | * | sean__ quit (Client Quit) |
00:18:10 | * | my_dude joined #nim |
00:37:05 | * | abm joined #nim |
00:43:39 | * | dadada_ quit (Ping timeout: 240 seconds) |
00:43:59 | * | abm quit (Quit: Leaving) |
00:48:40 | * | NimBot joined #nim |
00:49:06 | * | dadada joined #nim |
00:49:29 | * | dadada is now known as Guest44642 |
00:52:53 | * | dwdv quit (Quit: quit) |
00:59:51 | * | zickzackv quit (Ping timeout: 260 seconds) |
01:02:56 | * | Guest44642 quit (Ping timeout: 268 seconds) |
01:03:34 | * | dadada_ joined #nim |
01:12:50 | * | couven92 quit (Ping timeout: 240 seconds) |
01:17:14 | * | dadada_ quit (Ping timeout: 240 seconds) |
01:18:33 | * | dadada_ joined #nim |
01:28:02 | * | dadada_ quit (Ping timeout: 240 seconds) |
01:35:34 | * | rockcavera quit (Remote host closed the connection) |
01:42:19 | * | icebattle joined #nim |
01:46:13 | * | sagax quit (Quit: Konversation terminated!) |
01:46:29 | * | sagax joined #nim |
01:47:35 | * | sagax quit (Client Quit) |
02:00:08 | * | smitop quit (Quit: Connection closed for inactivity) |
02:07:08 | * | Guest62 joined #nim |
02:07:51 | Guest62 | hello, how do i move between two lets? for example `let a = @[1, 2, 3]; let b = a; doAssert unsafeAddr(a) == unsafeAddr(b)`. this currently fails, and `move(a)` only works if a is a var |
02:11:11 | * | LER0ever joined #nim |
02:17:47 | * | chemist69 quit (Ping timeout: 240 seconds) |
02:20:07 | * | chemist69 joined #nim |
02:21:03 | * | Guest62 quit (Remote host closed the connection) |
02:21:27 | disruptek | by design; lets are immutable. |
02:27:04 | * | theelous3 quit (Read error: Connection reset by peer) |
02:45:40 | leorize | disruptek: how's the ryu port going? |
03:28:16 | * | LER0ever quit (Ping timeout: 265 seconds) |
03:28:47 | * | muffindrake quit (Ping timeout: 240 seconds) |
03:31:09 | * | LER0ever joined #nim |
03:31:18 | * | muffindrake joined #nim |
03:38:28 | * | dadada joined #nim |
03:38:51 | * | dadada is now known as Guest58321 |
03:47:23 | * | Guest58321 quit (Ping timeout: 260 seconds) |
03:48:33 | * | dadada_ joined #nim |
04:02:26 | * | dadada_ quit (Ping timeout: 240 seconds) |
04:03:39 | * | dadada_ joined #nim |
04:17:47 | * | dadada_ quit (Ping timeout: 272 seconds) |
04:18:34 | * | dadada_ joined #nim |
04:32:22 | * | icebattle quit (Quit: leaving) |
04:32:59 | * | dadada_ quit (Ping timeout: 272 seconds) |
04:33:34 | * | dadada_ joined #nim |
04:35:07 | * | nsf joined #nim |
04:41:46 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
04:48:11 | * | dadada_ quit (Ping timeout: 272 seconds) |
04:48:40 | * | dadada joined #nim |
04:49:03 | * | dadada is now known as Guest55713 |
05:00:44 | * | sagax joined #nim |
05:03:00 | * | Guest55713 quit (Ping timeout: 265 seconds) |
05:03:36 | * | dadada_ joined #nim |
05:06:28 | * | arecaceae quit (Remote host closed the connection) |
05:06:51 | * | arecaceae joined #nim |
05:18:14 | * | dadada_ quit (Ping timeout: 268 seconds) |
05:18:43 | * | dadada_ joined #nim |
05:21:51 | * | LER0ever quit (Ping timeout: 265 seconds) |
05:24:41 | * | LER0ever joined #nim |
05:32:51 | * | dadada_ quit (Ping timeout: 260 seconds) |
05:33:35 | * | dadada_ joined #nim |
05:37:38 | * | tefter joined #nim |
05:47:57 | * | dadada_ quit (Ping timeout: 265 seconds) |
05:48:40 | * | dadada joined #nim |
05:49:01 | * | marmotini_ joined #nim |
05:49:02 | * | dadada is now known as Guest25665 |
06:02:27 | * | Guest25665 quit (Ping timeout: 265 seconds) |
06:03:31 | * | dadada_ joined #nim |
06:04:32 | * | marmotini_ quit (Remote host closed the connection) |
06:07:46 | * | disrupteq quit (Ping timeout: 265 seconds) |
06:12:03 | * | marmotini_ joined #nim |
06:12:32 | * | narimiran joined #nim |
06:18:03 | * | dadada_ quit (Ping timeout: 268 seconds) |
06:18:39 | * | dadada_ joined #nim |
06:42:49 | * | dddddd quit (Ping timeout: 272 seconds) |
06:47:15 | * | dadada_ quit (Ping timeout: 272 seconds) |
06:48:40 | * | dadada joined #nim |
06:49:03 | * | dadada is now known as Guest77756 |
07:02:52 | * | Guest77756 quit (Ping timeout: 265 seconds) |
07:03:33 | * | dadada_ joined #nim |
07:07:03 | * | lritter joined #nim |
07:15:55 | * | my_dude quit (Ping timeout: 265 seconds) |
07:17:24 | * | Vladar joined #nim |
07:17:51 | * | dadada_ quit (Ping timeout: 260 seconds) |
07:18:38 | * | dadada_ joined #nim |
07:27:50 | * | my_dude joined #nim |
07:31:51 | * | my_dude quit (Ping timeout: 246 seconds) |
07:32:47 | * | dadada_ quit (Ping timeout: 260 seconds) |
07:33:39 | * | dadada_ joined #nim |
07:45:29 | * | solitudesf joined #nim |
07:48:03 | * | dadada_ quit (Ping timeout: 272 seconds) |
07:48:43 | * | dadada joined #nim |
07:49:07 | * | dadada is now known as Guest57678 |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:02:39 | * | Guest57678 quit (Ping timeout: 260 seconds) |
08:03:38 | * | dadada_ joined #nim |
08:03:50 | * | JustASlacker joined #nim |
08:04:51 | * | gmpreussner joined #nim |
08:15:35 | FromDiscord | <clyybber> leorize: I finished it |
08:17:35 | * | dadada_ quit (Ping timeout: 260 seconds) |
08:17:54 | * | dadada_ joined #nim |
08:30:04 | * | JustASlacker quit (Read error: Connection reset by peer) |
08:38:54 | * | floppydh joined #nim |
08:40:13 | Zevv | but he still did not test all the numbers |
08:40:19 | Zevv | that might take a day or two |
08:54:05 | * | dadada_ is now known as dadada |
08:55:05 | dadada | can you export an import? for example, when I want a certain module to be automatically imported, whenever another module is imported? |
08:55:39 | leorize | yes |
08:55:47 | leorize | export <module name here> |
09:12:16 | * | pbb_ joined #nim |
09:12:17 | * | pbb quit (Ping timeout: 272 seconds) |
09:30:07 | * | marmotini_ quit (Remote host closed the connection) |
09:30:42 | * | marmotini_ joined #nim |
09:35:03 | * | marmotini_ quit (Ping timeout: 260 seconds) |
09:38:58 | WilhelmVonWeiner | what is the difference between , and ; in a proc's parameter list? |
09:43:23 | narimiran | no difference |
09:43:53 | solitudesf | there is if you use `using` statement |
09:46:36 | * | marmotini_ joined #nim |
09:46:47 | * | pbb_ quit (Remote host closed the connection) |
09:48:02 | WilhelmVonWeiner | interesting |
09:48:20 | solitudesf | also in templates/macros it makes difference, since parameters you dont provide type for assumed `untyped`. |
09:48:32 | solitudesf | https://forum.nim-lang.org/t/5547#34556 |
09:51:25 | * | marmotini_ quit (Ping timeout: 268 seconds) |
09:54:31 | WilhelmVonWeiner | is there a builtin/stdlib way to flatten a seq of seqs? |
09:57:36 | FromGitter | <Varriount> Two `for` loops? |
09:58:11 | WilhelmVonWeiner | not particularly what I was thinking of by builtin |
09:59:42 | solitudesf | https://nim-lang.org/docs/sequtils.html#concat%2Cvarargs%5Bseq%5BT%5D%5BT%5D%5D |
10:07:47 | WilhelmVonWeiner | oh okay |
10:07:48 | WilhelmVonWeiner | lol |
10:18:39 | * | pbb joined #nim |
10:35:27 | * | zyklon quit (Ping timeout: 240 seconds) |
10:42:25 | * | couven92 joined #nim |
10:57:59 | * | JustASlacker joined #nim |
11:08:15 | dadada | can macros be used to overwrite what builtin keywords do? |
11:12:13 | * | opal quit (Remote host closed the connection) |
11:12:30 | * | opal joined #nim |
11:16:18 | * | xet7 quit (Remote host closed the connection) |
11:17:25 | * | xet7 joined #nim |
11:17:51 | * | zyklon joined #nim |
11:19:54 | lqdev[m] | nope, you can use term rewriting macros for that |
11:20:11 | lqdev[m] | ah no |
11:20:16 | lqdev[m] | source code filters |
11:20:24 | lqdev[m] | my bad |
11:24:21 | dadada | with dumpTree: you can generate an indented representation of nim code |
11:24:44 | dadada | is there a reverse version of that, that takes dumpTree output and makes nim code? |
11:25:15 | dadada | the dumpTree output shouldn't lack any required data, right? |
11:30:21 | * | solitudesf quit (Ping timeout: 272 seconds) |
11:34:49 | FromGitter | <kristianmandrup> Does Nim support of dereferencing of arrays and/or objects (tables)? |
11:35:16 | FromGitter | <kristianmandrup> ie. sth like `[a, b] = numbers`, where `numbers = [1,2]` |
11:35:57 | FromGitter | <alehander92> destructuring8 |
11:36:03 | FromGitter | <kristianmandrup> can also be used swap, ie `[a,b] = [b,a]` |
11:36:25 | FromGitter | <kristianmandrup> yup, destructuring :) |
11:36:42 | FromGitter | <alehander92> not sure, i think it does with tuples |
11:36:53 | FromGitter | <alehander92> and i am sorry, this might also be pattern matching |
11:36:56 | FromGitter | <kristianmandrup> yeah, would be logical |
11:37:05 | FromGitter | <alehander92> as some libs define such helpers |
11:37:39 | FromGitter | <alehander92> e.g. `match ... : @[@a, @b, @c*]: echo c` (iirc) |
11:38:32 | FromGitter | <kristianmandrup> wow |
11:38:36 | FromGitter | <kristianmandrup> well, this works :) |
11:38:36 | FromGitter | <alehander92> (disclaimer, iirc thats my gara lib syntax, my point is that you can use it in pattern matching to include stuff like wildcards and unification, so not sure how useful) |
11:38:49 | FromGitter | <kristianmandrup> https://play.nim-lang.org/#ix=2c1P |
11:39:32 | FromGitter | <alehander92> https://github.com/alehander92/gara but again this might be overengineered and its experimental |
11:39:48 | FromGitter | <alehander92> awesome, if tuples work, use them |
11:40:06 | FromGitter | <kristianmandrup> ```let numbers = @[1,2,3,4,5,6] ⏎ var a,b: int ⏎ (a,b) = numbers ⏎ echo (a, b)``` [https://gitter.im/nim-lang/Nim?at=5e4bcd15b401eb68a584b521] |
11:40:10 | FromGitter | <kristianmandrup> Totally works :) |
11:40:17 | FromGitter | <alehander92> i think (a, b) = (b, a) |
11:40:25 | FromGitter | <alehander92> should also work, as its an idiom in python too |
11:40:42 | FromGitter | <alehander92> yep it seems so |
11:40:59 | FromGitter | <kristianmandrup> Great :) |
11:42:13 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
11:43:09 | * | pbb joined #nim |
12:03:21 | * | nsf quit (Quit: WeeChat 2.7) |
12:12:09 | * | chemist69 quit (Ping timeout: 272 seconds) |
12:12:42 | * | chemist69 joined #nim |
12:17:25 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
12:19:16 | * | pbb joined #nim |
12:25:19 | * | pbb_ joined #nim |
12:27:07 | * | pbb quit (Ping timeout: 240 seconds) |
12:36:03 | * | rockcavera joined #nim |
12:36:18 | * | gangstacat quit (Quit: Ĝis!) |
12:37:36 | dadada | how advanced is the parsesql sql parser in nim? |
12:37:47 | dadada | I was surprised that there even is one :D |
12:38:02 | narimiran | 73/100 on the advanced scale :P |
12:39:34 | dadada | what is missing in it? |
12:52:51 | FromDiscord | <Rika> what do you guys usually do for a deserializing proc? `proc deser(str: string, typ: typedesc): string`? |
12:53:05 | narimiran | dadada: 27 points |
13:01:18 | * | gangstacat joined #nim |
13:11:19 | FromDiscord | <Stuffe> I found an extremely weird bug: https://play.nim-lang.org/#ix=2c2b |
13:12:47 | FromDiscord | <Stuffe> Some sort of memory corruption |
13:13:21 | narimiran | proc outer*(table: var Table[int, int]) = |
13:15:47 | FromDiscord | <Rika> shouldnt it error out? |
13:20:08 | FromDiscord | <Skaruts> is there an inverse proc for `astToStr()`? |
13:22:03 | FromDiscord | <Skaruts> strToAst doesn't exist |
13:22:14 | FromDiscord | <Skaruts> `strToAst` doesn't exist |
13:34:27 | FromDiscord | <exelotl> @Skaruts there's parseExpr and parseStmt but they're not recommended |
13:35:29 | FromDiscord | <Skaruts> They don't seem to work anyway, I tried both and the compiler says I need to discard them |
13:36:11 | FromDiscord | <Skaruts> my purpose is to temporarily store a piece of code passed into a template, so I can use it after processing some other stuff |
13:36:54 | FromDiscord | <exelotl> Have you worked with macros yet? |
13:37:04 | FromDiscord | <Stuffe> narimiran, that's not a solution |
13:37:09 | FromDiscord | <Skaruts> no, I'm still avoiding them... |
13:37:25 | FromDiscord | <Stuffe> consider this: https://play.nim-lang.org/#ix=2c2h |
13:38:04 | FromDiscord | <Stuffe> There are reasons why you don't want to make proc arguments mutable necessarily |
13:38:15 | FromDiscord | <exelotl> If you want to store code at compile time for later, macros are what you want |
13:39:44 | * | LER0ever quit (Remote host closed the connection) |
13:40:56 | FromGitter | <kaushalmodi> @Vindaar Thanks I will have a look at the seqmath library. I was just surprised that `zip` was missing its counterpart `unzip` :) |
13:41:31 | FromGitter | <kaushalmodi> I might try at adding `unzip` to sequtils.. and may be I will realize in the process why it wasn't added? :) |
13:41:46 | FromDiscord | <Skaruts> this is from a small test where I was trying to get it working: https://play.nim-lang.org/#ix=2c2k |
13:41:51 | narimiran | @Stuffe btw, if you echo your table after the last line in the code, everything is there :/ |
13:41:53 | FromDiscord | <Skaruts> (that's non-working code) |
13:42:17 | FromDiscord | <exelotl> The Nim In Action metaprogramming chapter is a pretty good place to learn them, though I suspect the docs are improved nowadays too |
13:42:40 | FromDiscord | <Stuffe> narimiran, I know, the problem is the inner scope is messed up. This is a real issue that happens in my code |
13:42:52 | * | abm joined #nim |
13:43:37 | FromDiscord | <Stuffe> Actually it's in a func that I would like to keep side effects out of, so it would be double inconvenient to use the outer scope |
13:44:55 | FromDiscord | <Skaruts> ok I'm gonna do some reading then |
13:44:57 | FromDiscord | <Skaruts> thanks |
13:45:25 | * | azed joined #nim |
13:45:41 | narimiran | @Stuffe btw, this also works: https://play.nim-lang.org/#ix=2c2m |
13:47:05 | narimiran | my guess is: underlying sequence needs to be expanded, and that's why you're seeing this after "larger than 10" amount of new items |
13:47:50 | FromDiscord | <Stuffe> Thats curious |
13:48:06 | FromDiscord | <Stuffe> although the whole thing is beyond me |
13:48:30 | FromDiscord | <Stuffe> if you change any numbers in the sequence, it also works fine |
13:49:05 | narimiran | now that's strange! |
13:50:23 | FromGitter | <matrixbot> `reversem3` What is better suited for web programming Karax or Jester? |
13:50:43 | FromDiscord | <Rika> sorry for asking again but what do you guys usually do for a deserializing proc? do you use a signature like `proc deser(str: string, typ: typedesc): string`? |
13:50:53 | * | azed quit (Quit: WeeChat 2.7) |
13:51:02 | narimiran | the initial size of the seq which contains table's keys is 64 elements and it is resized when you reach 2/3 of it, and that's 42.6 |
13:51:19 | narimiran | initially you have 32 elements, and add more than 11 |
13:52:22 | narimiran | and i noticed this right now: `var table* = Table[int, int]()` - why does this even work?? |
13:52:48 | FromDiscord | <Rika> oh LMAO |
13:52:54 | narimiran | yep, use `var table* = initTable[int, int](128)` and it works |
13:53:28 | FromDiscord | <exelotl> @Skaruts here's a quick fix for your example btw: https://play.nim-lang.org/#ix=2c2q |
13:54:43 | FromDiscord | <exelotl> though needless to say, closures / anonymous procs are probably the more suitable way to attach behaviour to buttons |
13:55:54 | FromGitter | <Vindaar> @kaushalmodi yeah, that surprised me a long time ago too. Feel free to try to add it to sequtils. However, I only now just realize that I didn't correctly remember what my `split` template is actually for, heh :/ |
13:57:17 | FromGitter | <Vindaar> I forgot that `zip` actually gives you a `seq[tuple[a, b: whatever]]`, right? The `split` seq is for nested sequences however (`seq[seq[SomeNumber]]`) instead. ⏎ Writing a generic `unzip` should be actually rather easy, since the tuple is well defined at compile time |
13:58:51 | FromDiscord | <exelotl> @Rika why does it return string? Also is it legal to take a typedesc at runtime? I don't think I tried it before lol |
13:59:05 | FromDiscord | <Rika> no clue, and its just an example |
13:59:16 | FromDiscord | <Rika> ah, i made a mistake |
13:59:24 | FromDiscord | <Rika> yeah it shouldnt return a string but the actual type |
13:59:38 | FromDiscord | <Rika> nonetheless i do not know what approach i should take for deserializing procs |
14:00:16 | FromDiscord | <exelotl> What kind of data are you deserializing? |
14:00:27 | FromDiscord | <Rika> not json |
14:01:50 | FromDiscord | <Stuffe> narimiran, thank you, that's a good fix for my situation |
14:02:45 | FromGitter | <kaushalmodi> > Writing a generic unzip should be actually rather easy ⏎ ⏎ I think so too.. that's why I put a qualifier "may be I will realize in the process why it wasn't added" :D |
14:03:54 | FromDiscord | <exelotl> You can just do `proc deser(str:string): Foo` right? |
14:04:26 | FromDiscord | <exelotl> or well, you'd have to choose a better name than deser to disambiguate from other deserialization functions |
14:04:46 | FromDiscord | <exelotl> or do it like `proc deser(target: var Foo, str: string)` |
14:05:21 | FromDiscord | <Rika> ah yeah |
14:05:26 | FromDiscord | <Rika> out arguments |
14:05:35 | FromDiscord | <Rika> okay, that sounds good |
14:06:26 | FromDiscord | <Rika> thanks |
14:06:26 | FromDiscord | <Skaruts> @exelotl oh, thanks! |
14:07:14 | FromDiscord | <Skaruts> that's for an immediate mode ui, so it's not using callbacks of any kind (I had trouble doing callbacks on a retained ui) |
14:10:31 | * | nsf joined #nim |
14:14:50 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2c2z i feel like i'm doing something horribly wrong here... (perhaps the var enum argument) |
14:18:03 | FromGitter | <kaushalmodi> @Vindaar May be I inadvertently "unlocked" that ease for unzip implementation when I changed the zip return type to be a seq of generic tuples :D Earlier (nim 1.x), it returned tuples with fields "a" and "b" |
14:20:32 | FromGitter | <Vindaar> @kaushalmodi well with a macro we could also previously check the field names of the tuple. But yes, having generic names should make it a little easier too |
14:20:38 | FromGitter | <kaushalmodi> https://github.com/nim-lang/Nim/pull/13429/files |
14:20:39 | disbot | ➥ Add `sequtils.unzip` to complement `sequtils.zip` |
14:21:59 | WilhelmVonWeiner | I was looking for that maybe 30 minutes ago |
14:22:05 | * | dddddd joined #nim |
14:24:03 | * | paxis quit (Ping timeout: 245 seconds) |
14:24:48 | * | marmotini_ joined #nim |
14:24:59 | FromGitter | <Vindaar> @kaushalmodi btw, custom annotations are coming along nicely so far |
14:27:16 | * | azed joined #nim |
14:27:46 | * | azed quit (Client Quit) |
14:29:22 | FromGitter | <matrixbot> `reversem3` Does using sugar hinder performance ? |
14:30:02 | FromDiscord | <Rika> i assume compile time will go up |
14:30:57 | FromDiscord | <Rika> ok. so UFCS is a lie when it comes to parseEnum, idk why |
14:31:37 | FromGitter | <shizhaojingszj> Hi, people. I'm new and following the wiki https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers , but i cannot find collect function, where is it defined? I'm using Nim 1.0.6. |
14:31:39 | FromDiscord | <exelotl> @Rika yeahh I just noticed that too |
14:32:59 | FromGitter | <Vindaar> @shizhaojingszj it's defined in sugar here: https://nim-lang.github.io/Nim/sugar.html#collect.m%2Cuntyped%2Cuntyped ⏎ In general you can go here: https://nim-lang.github.io/Nim/theindex.html and just search on that page for whatever function you're looking for |
14:33:44 | FromGitter | <shizhaojingszj> @Vindaar Thank you very much! I'll check them out. |
14:34:00 | FromGitter | <Vindaar> you're welcome! |
14:34:14 | FromDiscord | <Rika> i'm still baffled as to why UFCS fails on parseEnum |
14:34:25 | FromGitter | <kaushalmodi> @Vindaar Looking forward to the annotations! 🎉 |
14:35:14 | FromGitter | <kaushalmodi> Rika: can you create an example on play.nimlang.org and share that? |
14:35:29 | * | nullwarp quit (Quit: ZNC 1.7.5 - https://znc.in) |
14:36:18 | FromDiscord | <Rika> > https://play.nim-lang.org/#ix=2c2z i feel like i'm doing something horribly wrong here... (perhaps the var enum argument) |
14:40:48 | * | nullwarp joined #nim |
14:49:00 | FromGitter | <Vindaar> as you said before, `parseEnum` doesn't like UFCS, because it explicitly generic: https://play.nim-lang.org/#ix=2c2M |
14:49:09 | FromGitter | <Vindaar> *it's |
14:50:39 | FromGitter | <kaushalmodi> heh, I did something similar: https://play.nim-lang.org/#ix=2c2O |
14:51:13 | FromGitter | <Vindaar> hehe :) |
14:51:19 | FromGitter | <kaushalmodi> I cannot get satisfaction until I see something echoed out |
14:51:29 | disruptek | kinky. |
14:51:48 | FromGitter | <kaushalmodi> heh |
14:56:44 | * | Hideki_ joined #nim |
14:58:52 | lqdev[m] | use x.parseEnum[:Ty]() |
14:58:57 | * | tane joined #nim |
15:01:40 | FromDiscord | <Rika> what's with the colon |
15:09:10 | disruptek | Araq: bump is failing tests because unittest cannot `expect ValueError` under cpp goto exceptions. there's also an arc destroy segv in the same tests on travis, but i cannot reproduce it using Nim#head. the weekly test passed last week. |
15:22:03 | * | solitudesf joined #nim |
15:39:13 | * | JustASlacker quit (Ping timeout: 268 seconds) |
15:40:24 | disruptek | have yourself a pretty little christmas |
15:50:16 | * | hoijui joined #nim |
15:58:03 | * | marmotini_ quit (Remote host closed the connection) |
15:58:38 | * | marmotini_ joined #nim |
16:00:50 | disruptek | so #13430 |
16:01:12 | disruptek | so #13430 mr bot? |
16:01:15 | disbot | https://github.com/nim-lang/Nim/issues/13430 -- 3Strange Table memory error ; snippet at 12https://play.nim-lang.org/#ix=2c3d |
16:02:41 | disruptek | we think we're passing by value but we're not. then the source table grows, is realloc'd and zero'd. |
16:03:19 | * | marmotini_ quit (Ping timeout: 260 seconds) |
16:08:41 | njoseph | Is cross-compilation for MacOS/Darwin supported yet? |
16:09:08 | * | marmotini_ joined #nim |
16:11:37 | * | floppydh quit (Quit: WeeChat 2.7) |
16:13:21 | shashlick | if you use osxcross, sure |
16:13:45 | shashlick | nim can cross compile fine, you need the C/C++ cross-compiler to complement it |
16:20:03 | * | marmotini_ quit (Ping timeout: 240 seconds) |
16:25:09 | * | ptdel joined #nim |
16:31:06 | * | abm quit (Quit: Leaving) |
16:34:40 | * | marmotini_ joined #nim |
16:39:30 | * | azed joined #nim |
16:56:21 | * | icebattle joined #nim |
17:06:51 | * | couven92 quit (Ping timeout: 240 seconds) |
17:11:58 | * | paxis joined #nim |
17:26:21 | * | azed quit (Quit: WeeChat 2.7) |
17:57:20 | * | nsf quit (Quit: WeeChat 2.7) |
17:57:46 | * | sacredfrog quit (Quit: ZNC 1.7.5 - https://znc.in) |
17:59:42 | * | sacredfrog joined #nim |
18:13:52 | * | marmotini_ quit (Read error: Connection reset by peer) |
18:25:59 | * | NimBot joined #nim |
18:30:36 | * | tiorock joined #nim |
18:30:37 | * | rockcavera is now known as Guest18933 |
18:30:37 | * | tiorock is now known as rockcavera |
18:33:48 | Araq | omg, just setup a CI already for cross compiles to OSX |
18:34:08 | Araq | your users will thank you that you actually tested the result somewhat |
18:34:20 | * | natrys joined #nim |
18:34:21 | * | Guest18933 quit (Ping timeout: 268 seconds) |
18:34:43 | Araq | it's 2020, cross compiling is for embedded devices |
18:43:31 | * | kungtotte_ is now known as kungtotte |
18:44:29 | * | sz0 quit (Quit: Connection closed for inactivity) |
18:45:10 | * | lritter quit (Quit: Leaving) |
18:49:44 | Zevv | and for compiling to windows |
18:54:29 | * | marmotini_ joined #nim |
19:01:39 | * | marmotini_ quit (Ping timeout: 240 seconds) |
19:04:57 | * | marmotini_ joined #nim |
19:07:14 | FromGitter | <mratsim> You have appveyor and azure for windows |
19:14:38 | FromDiscord | <Recruit_main_70007> since i am pretty sure this is gonna be wrong i will jump right into the question before wrapping a whole library incorrectly, so, what am i doing wrong here if nothing? |
19:14:39 | FromDiscord | <Recruit_main_70007> https://play.nim-lang.org/#ix=2c4F |
19:18:48 | solitudesf | `void*` is `pointer` |
19:19:57 | solitudesf | LoadInterface takes cpp string, not nim string |
19:20:12 | FromDiscord | <Recruit_main_70007> ye, i thought that was wrong |
19:23:25 | FromDiscord | <Recruit_main_70007> s that it? |
19:28:07 | * | ptdel quit (Ping timeout: 240 seconds) |
19:35:39 | * | seni joined #nim |
19:37:48 | FromGitter | <Varriount> Recruit_main_70007: Technically, it might be better to use 'cint', 'cbool', etc |
19:38:16 | FromDiscord | <Recruit_main_70007> ok |
19:38:45 | FromGitter | <Varriount> At least that way, you can easily scan through code you're having trouble with, and say "ok, I'm not using int, string, or bool, so there's less chance the types are wrong" |
19:39:42 | FromDiscord | <Recruit_main_70007> undeclared identifier: 'cbool' |
19:39:56 | * | ptdel joined #nim |
19:59:46 | * | ikan-keli_ joined #nim |
20:00:41 | * | ikan-keli_2 quit (Ping timeout: 268 seconds) |
20:05:41 | * | J joined #nim |
20:06:04 | * | J is now known as Guest88294 |
20:10:29 | * | couven92 joined #nim |
20:10:45 | * | Guest88294 quit (Remote host closed the connection) |
20:15:50 | * | solitudesf quit (Remote host closed the connection) |
20:25:16 | * | MarderIII joined #nim |
20:31:05 | * | Trustable joined #nim |
20:34:14 | * | jjido joined #nim |
20:38:55 | * | narimiran quit (Ping timeout: 268 seconds) |
20:49:30 | * | hoijui quit (Ping timeout: 246 seconds) |
20:52:39 | * | tane quit (Quit: Leaving) |
21:02:03 | * | Vladar quit (Quit: Leaving) |
21:06:13 | Araq | we need a bit of a proess for RFCs. Am I supposed to edit my original RFC or close it and open a new one with my modifications? |
21:08:51 | federico3 | the latter, with a bump in version number |
21:12:11 | Araq | sounds good |
21:14:10 | FromDiscord | <Recruit_main_70007> so, i have RLNim.nim at root folder, and then this structure, |
21:14:11 | FromDiscord | <Recruit_main_70007> RLBotCPP-master |
21:14:11 | FromDiscord | <Recruit_main_70007> │ ├───inc |
21:14:11 | FromDiscord | <Recruit_main_70007> │ ├───lib |
21:14:11 | FromDiscord | <Recruit_main_70007> │ │ └───inc |
21:14:11 | FromDiscord | <Recruit_main_70007> │ │ └───flatbuffers |
21:14:14 | FromDiscord | <Recruit_main_70007> └─── some headers here |
21:14:23 | disruptek | dude. |
21:14:37 | FromDiscord | <Recruit_main_70007> that is small |
21:14:57 | FromDiscord | <Recruit_main_70007> how big is the feed of Irc? |
21:15:07 | disruptek | --> <-- |
21:16:02 | shashlick | Araq why not modify and maintain in one place |
21:16:46 | Araq | it would be unfair to the 9 upvotes that I already got |
21:16:57 | Araq | feels like cheating |
21:18:30 | shashlick | Can have a changelog and ask people to comment or adjust their votes |
21:19:19 | shashlick | Of course depends how much the RFC has changed |
21:22:12 | FromDiscord | <Recruit_main_70007> ok... |
21:22:12 | FromDiscord | <Recruit_main_70007> now with the pastebin... |
21:22:12 | FromDiscord | <Recruit_main_70007> I have this folder structure (continues in the pastebin) |
21:22:12 | FromDiscord | <Recruit_main_70007> https://pastebin.com/WWxd6RJm |
21:24:16 | * | marmotini_ quit (Remote host closed the connection) |
21:24:48 | * | marmotini_ joined #nim |
21:28:53 | * | hoijui joined #nim |
21:29:29 | * | marmotini_ quit (Ping timeout: 272 seconds) |
21:43:54 | * | solitudesf joined #nim |
21:45:45 | FromDiscord | <Yepoleb> Hello, is there a way to check if an int corresponds to a valid enum value or do I have to use try/except? |
21:46:46 | lqdev[m] | @Yepoleb yeah, `x in low(T)..high(T) |
21:47:02 | FromDiscord | <Yepoleb> does that even work with gaps? |
21:48:35 | FromDiscord | <Yepoleb> To give more context, I want to do `if validEnum(x): result = enumType(x) else: result = enumTypeUnknown` |
21:57:55 | FromGitter | <mratsim> use EnumTy |
21:58:07 | FromGitter | <mratsim> use EnumeType(x) |
21:58:31 | lqdev[m] | @Yepoleb gaps are not checked. |
22:08:17 | * | MarderIII quit (Quit: Leaving) |
22:13:28 | FromDiscord | <Yepoleb> I don't want to use the exception of the conversion operator as a check, because it's slow |
22:15:02 | leorize | exception is not slow anymore with the new --exception:goto |
22:15:15 | leorize | well not **that** slow |
22:15:34 | * | Trustable quit (Remote host closed the connection) |
22:16:30 | FromDiscord | <clyybber> \o/ |
22:16:40 | leorize | but conversion failure won't be catchable in the future iirc |
22:16:44 | leorize | since it's a bug |
22:16:59 | leorize | though why do you need enums with gaps? |
22:17:28 | FromDiscord | <clyybber> enums with gaps are cursed |
22:17:28 | disruptek | make a constant set representing e.low .. e.high and then check for membership. |
22:17:48 | FromDiscord | <clyybber> leorize: I wonder though, where you'd read that? |
22:18:15 | leorize | clyybber: Araq did some benchmark on the forum iirc |
22:18:45 | FromDiscord | <Yepoleb> i'm implementing a standard (DNS) which has gaps in the assigned values |
22:19:35 | FromDiscord | <clyybber> leorize: Oh : / |
22:19:37 | FromDiscord | <clyybber> well |
22:19:41 | FromDiscord | <clyybber> it neverworked anyways |
22:19:54 | FromDiscord | <clyybber> at least not with enums with holes |
22:20:01 | FromDiscord | <clyybber> or at least not on gc:arc |
22:20:08 | FromDiscord | <clyybber> even before exceptions goto |
22:20:24 | FromDiscord | <clyybber> you'd just get invalid data anyways |
22:20:28 | leorize | to be fair constants are much better than enum with holes |
22:20:31 | FromDiscord | <clyybber> the catchability was a hoax |
22:21:05 | disruptek | if you care about speed, waste some memory to achieve it. |
22:21:08 | leorize | use distinct types with your own checking routines |
22:23:10 | FromDiscord | <Yepoleb> tbh speed is not really the reason, it's just unelegant and will break as soon as someone disables runtime checks, which shouldn't be used to implement logic anyway |
22:24:30 | leorize | use distinct types and your own checking logic |
22:25:12 | FromDiscord | <Yepoleb> using distinct types gives me no benefits over using enums with holes |
22:25:37 | FromDiscord | <clyybber> enums with holes give you no advantage over distinct ints |
22:25:59 | FromDiscord | <clyybber> enums with holes are a good candidate to be made *illegal* |
22:26:06 | FromDiscord | <clyybber> or deprected or removed at some point |
22:26:29 | disruptek | ditto dns. |
22:27:09 | FromDiscord | <Yepoleb> i'm aware that dns is just as cursed |
22:27:40 | FromDiscord | <clyybber> there is a way, but its also slow |
22:27:43 | FromDiscord | <clyybber> you can $ it |
22:27:50 | FromDiscord | <clyybber> and check against "invalid data" |
22:27:58 | FromDiscord | <clyybber> I agree there should be a better way |
22:28:53 | FromDiscord | <Yepoleb> i think i'm going to use a hash set with all possible values and use that to check |
22:29:39 | FromDiscord | <clyybber> yeah, thats probably best |
22:29:39 | FromDiscord | <Yepoleb> because that's what any sane internal implementation would use anyway |
22:30:14 | leorize | or you can write a macro that generate the checking routine for you using a case statement |
22:30:19 | leorize | not sure which is faster though |
22:30:35 | disruptek | the macro is faster, but who cares? |
22:31:12 | FromDiscord | <clyybber> if it fits in a builtin set than its not gonna differ |
22:31:13 | Araq | well we can remove enum with holes, or we map them to 'distinct int' internally |
22:32:49 | * | solitudesf quit (Ping timeout: 272 seconds) |
22:33:45 | FromDiscord | <Yepoleb> i was hoping using an enum would make it easier to check for valid values |
22:34:47 | FromDiscord | <Yepoleb> because the compiler knows all possible values at the time of definition, which is not the case with distinct types |
22:34:49 | leorize | it appears to me that you can't do custom pragma in the type section |
22:35:43 | FromDiscord | <Yepoleb> but if there's no way to check if a value is valid or iterate over all possible values, that benefit is gone |
22:36:07 | * | sagax quit (Remote host closed the connection) |
22:36:49 | disruptek | you /can/ iterate over possible values. |
22:36:55 | FromDiscord | <Yepoleb> i can? |
22:37:00 | disruptek | i will permit it. |
22:38:18 | FromDiscord | <Yepoleb> i only know of the low/high loop, which does not work in this case |
22:43:31 | FromDiscord | <clyybber> yeah, there is no way |
22:43:41 | FromDiscord | <clyybber> though its technically possible |
22:43:48 | FromDiscord | <clyybber> but not implemented |
22:44:35 | * | krux02 joined #nim |
22:46:04 | FromDiscord | <Yepoleb> is it possible using macros? |
22:46:24 | leorize | yes |
22:47:07 | disruptek | life is short. make it work. move on. |
22:47:20 | FromDiscord | <Yepoleb> because i don't want to assign values to the names and then add an extra array with all the names listed again |
22:47:53 | disruptek | is this for a hearing aid? |
22:48:14 | FromDiscord | <Yepoleb> what? |
22:48:21 | disruptek | sounds like yes. |
22:50:01 | FromDiscord | <clyybber> (╯°□°)╯︵ ┻━┻ |
22:50:51 | FromDiscord | <clyybber> yepoleb do you hear this? |
22:51:26 | FromDiscord | <Yepoleb> no, i can only hear rick astley playing right now |
22:51:31 | FromDiscord | <clyybber> lol |
22:51:32 | FromDiscord | <clyybber> aigh |
22:51:40 | FromDiscord | <clyybber> t - townsfolk |
22:53:15 | * | natrys quit (Ping timeout: 240 seconds) |
22:53:53 | FromDiscord | <Yepoleb> is it better to write a macro that generates distinct constants and the possible-values-array from a key-value array or keep using enums and extract the possible-values-array from that? |
22:54:18 | FromDiscord | <Elegant Beef> So if i have a ptr how do i get it as a value? |
22:56:37 | leorize | @Yepoleb: https://play.nim-lang.org/#ix=2c5N |
22:57:00 | FromDiscord | <clyybber> @Elegant Beef cast to int is what you want I think |
22:58:16 | * | sz0 joined #nim |
22:58:34 | leorize | wait I think I broke that one |
23:01:25 | FromDiscord | <Elegant Beef> Nice getting out of memory when building now |
23:01:28 | FromDiscord | <Elegant Beef> im a genius |
23:01:59 | FromDiscord | <Yepoleb> thanks leorize! |
23:02:08 | leorize | nope that doesn't work |
23:02:15 | leorize | I made a small typo |
23:02:18 | leorize | lemme fix that real quick |
23:04:13 | FromDiscord | <clyybber> @Elegant Beef how? |
23:04:27 | FromDiscord | <Yepoleb> is there a reason to use ord instead of integer conversion directly on enums? I usually need to convert to uint16 for serialization, so using uint16() directly is shorter. |
23:04:31 | FromDiscord | <Elegant Beef> probably cause im daft |
23:05:00 | FromDiscord | <Elegant Beef> using pointers to masks for entities now, but getting an error when building assuming i have pointers out of memory |
23:05:09 | FromDiscord | <Elegant Beef> using pointers to point tomasks for entities now, but getting an error when building assuming i have pointers out of memory |
23:05:50 | FromDiscord | <Elegant Beef> Im now using arrays of ints as a bitmask for entities, and realized that i could store those in a list to reduce memory usage |
23:06:01 | FromDiscord | <Elegant Beef> Im now using arrays of ints as a bitmask for entities, and realized that i could store those masks in a list to reduce memory usage |
23:06:15 | FromDiscord | <Elegant Beef> but seems i did something wrong 😄 |
23:06:29 | leorize | Yepoleb: use this version instead: https://play.nim-lang.org/#ix=2c5P |
23:06:42 | leorize | the last one won't return anything but false, due to a typo |
23:07:49 | leorize | @Yepoleb: ^ |
23:07:56 | FromDiscord | <Yepoleb> thanks for writing this for me 🙂 |
23:08:22 | leorize | you're welcome :) |
23:10:16 | FromDiscord | <Elegant Beef> what's the proper way to handle passing a ptr to a proc that doesnt take ptrs? |
23:10:38 | leorize | why would you want to pass a ptr to a proc that don't take it? |
23:10:45 | leorize | or do you want to dereference it? |
23:12:19 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:13:07 | * | hoijui quit (Ping timeout: 260 seconds) |
23:13:18 | FromDiscord | <Elegant Beef> I want what's at the ptr |
23:13:40 | leorize | use the `[]` operator |
23:13:46 | leorize | `p[]` |
23:13:53 | leorize | ^ like that |
23:13:54 | FromDiscord | <Elegant Beef> Or i misunderstand pointers |
23:15:20 | FromDiscord | <Elegant Beef> so `p[pointerVar]`? |
23:16:04 | FromDiscord | <Elegant Beef> ah |
23:16:25 | leorize | it's `pointerVar[]` :P |
23:16:52 | FromDiscord | <Elegant Beef> yay no more out of memory |
23:16:53 | FromDiscord | <Elegant Beef> danke |
23:34:35 | disruptek | Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError] |
23:37:45 | disruptek | time to remove async, i guess. |