<< 18-02-2020 >>

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:51Guest62hello, 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:27disruptekby design; lets are immutable.
02:27:04*theelous3 quit (Read error: Connection reset by peer)
02:45:40leorizedisruptek: 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:35FromDiscord<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:13Zevvbut he still did not test all the numbers
08:40:19Zevvthat might take a day or two
08:54:05*dadada_ is now known as dadada
08:55:05dadadacan you export an import? for example, when I want a certain module to be automatically imported, whenever another module is imported?
08:55:39leorizeyes
08:55:47leorizeexport <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:58WilhelmVonWeinerwhat is the difference between , and ; in a proc's parameter list?
09:43:23narimiranno difference
09:43:53solitudesfthere is if you use `using` statement
09:46:36*marmotini_ joined #nim
09:46:47*pbb_ quit (Remote host closed the connection)
09:48:02WilhelmVonWeinerinteresting
09:48:20solitudesfalso in templates/macros it makes difference, since parameters you dont provide type for assumed `untyped`.
09:48:32solitudesfhttps://forum.nim-lang.org/t/5547#34556
09:51:25*marmotini_ quit (Ping timeout: 268 seconds)
09:54:31WilhelmVonWeineris there a builtin/stdlib way to flatten a seq of seqs?
09:57:36FromGitter<Varriount> Two `for` loops?
09:58:11WilhelmVonWeinernot particularly what I was thinking of by builtin
09:59:42solitudesfhttps://nim-lang.org/docs/sequtils.html#concat%2Cvarargs%5Bseq%5BT%5D%5BT%5D%5D
10:07:47WilhelmVonWeineroh okay
10:07:48WilhelmVonWeinerlol
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:15dadadacan 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:54lqdev[m]nope, you can use term rewriting macros for that
11:20:11lqdev[m]ah no
11:20:16lqdev[m]source code filters
11:20:24lqdev[m]my bad
11:24:21dadadawith dumpTree: you can generate an indented representation of nim code
11:24:44dadadais there a reverse version of that, that takes dumpTree output and makes nim code?
11:25:15dadadathe dumpTree output shouldn't lack any required data, right?
11:30:21*solitudesf quit (Ping timeout: 272 seconds)
11:34:49FromGitter<kristianmandrup> Does Nim support of dereferencing of arrays and/or objects (tables)?
11:35:16FromGitter<kristianmandrup> ie. sth like `[a, b] = numbers`, where `numbers = [1,2]`
11:35:57FromGitter<alehander92> destructuring8
11:36:03FromGitter<kristianmandrup> can also be used swap, ie `[a,b] = [b,a]`
11:36:25FromGitter<kristianmandrup> yup, destructuring :)
11:36:42FromGitter<alehander92> not sure, i think it does with tuples
11:36:53FromGitter<alehander92> and i am sorry, this might also be pattern matching
11:36:56FromGitter<kristianmandrup> yeah, would be logical
11:37:05FromGitter<alehander92> as some libs define such helpers
11:37:39FromGitter<alehander92> e.g. `match ... : @[@a, @b, @c*]: echo c` (iirc)
11:38:32FromGitter<kristianmandrup> wow
11:38:36FromGitter<kristianmandrup> well, this works :)
11:38:36FromGitter<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:49FromGitter<kristianmandrup> https://play.nim-lang.org/#ix=2c1P
11:39:32FromGitter<alehander92> https://github.com/alehander92/gara but again this might be overengineered and its experimental
11:39:48FromGitter<alehander92> awesome, if tuples work, use them
11:40:06FromGitter<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:10FromGitter<kristianmandrup> Totally works :)
11:40:17FromGitter<alehander92> i think (a, b) = (b, a)
11:40:25FromGitter<alehander92> should also work, as its an idiom in python too
11:40:42FromGitter<alehander92> yep it seems so
11:40:59FromGitter<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:36dadadahow advanced is the parsesql sql parser in nim?
12:37:47dadadaI was surprised that there even is one :D
12:38:02narimiran73/100 on the advanced scale :P
12:39:34dadadawhat is missing in it?
12:52:51FromDiscord<Rika> what do you guys usually do for a deserializing proc? `proc deser(str: string, typ: typedesc): string`?
12:53:05narimirandadada: 27 points
13:01:18*gangstacat joined #nim
13:11:19FromDiscord<Stuffe> I found an extremely weird bug: https://play.nim-lang.org/#ix=2c2b
13:12:47FromDiscord<Stuffe> Some sort of memory corruption
13:13:21narimiranproc outer*(table: var Table[int, int]) =
13:15:47FromDiscord<Rika> shouldnt it error out?
13:20:08FromDiscord<Skaruts> is there an inverse proc for `astToStr()`?
13:22:03FromDiscord<Skaruts> strToAst doesn't exist
13:22:14FromDiscord<Skaruts> `strToAst` doesn't exist
13:34:27FromDiscord<exelotl> @Skaruts there's parseExpr and parseStmt but they're not recommended
13:35:29FromDiscord<Skaruts> They don't seem to work anyway, I tried both and the compiler says I need to discard them
13:36:11FromDiscord<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:54FromDiscord<exelotl> Have you worked with macros yet?
13:37:04FromDiscord<Stuffe> narimiran, that's not a solution
13:37:09FromDiscord<Skaruts> no, I'm still avoiding them...
13:37:25FromDiscord<Stuffe> consider this: https://play.nim-lang.org/#ix=2c2h
13:38:04FromDiscord<Stuffe> There are reasons why you don't want to make proc arguments mutable necessarily
13:38:15FromDiscord<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:56FromGitter<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:31FromGitter<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:46FromDiscord<Skaruts> this is from a small test where I was trying to get it working: https://play.nim-lang.org/#ix=2c2k
13:41:51narimiran@Stuffe btw, if you echo your table after the last line in the code, everything is there :/
13:41:53FromDiscord<Skaruts> (that's non-working code)
13:42:17FromDiscord<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:40FromDiscord<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:37FromDiscord<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:55FromDiscord<Skaruts> ok I'm gonna do some reading then
13:44:57FromDiscord<Skaruts> thanks
13:45:25*azed joined #nim
13:45:41narimiran@Stuffe btw, this also works: https://play.nim-lang.org/#ix=2c2m
13:47:05narimiranmy 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:50FromDiscord<Stuffe> Thats curious
13:48:06FromDiscord<Stuffe> although the whole thing is beyond me
13:48:30FromDiscord<Stuffe> if you change any numbers in the sequence, it also works fine
13:49:05narimirannow that's strange!
13:50:23FromGitter<matrixbot> `reversem3` What is better suited for web programming Karax or Jester?
13:50:43FromDiscord<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:02narimiranthe 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:19narimiraninitially you have 32 elements, and add more than 11
13:52:22narimiranand i noticed this right now: `var table* = Table[int, int]()` - why does this even work??
13:52:48FromDiscord<Rika> oh LMAO
13:52:54narimiranyep, use `var table* = initTable[int, int](128)` and it works
13:53:28FromDiscord<exelotl> @Skaruts here's a quick fix for your example btw: https://play.nim-lang.org/#ix=2c2q
13:54:43FromDiscord<exelotl> though needless to say, closures / anonymous procs are probably the more suitable way to attach behaviour to buttons
13:55:54FromGitter<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:17FromGitter<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:51FromDiscord<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:05FromDiscord<Rika> no clue, and its just an example
13:59:16FromDiscord<Rika> ah, i made a mistake
13:59:24FromDiscord<Rika> yeah it shouldnt return a string but the actual type
13:59:38FromDiscord<Rika> nonetheless i do not know what approach i should take for deserializing procs
14:00:16FromDiscord<exelotl> What kind of data are you deserializing?
14:00:27FromDiscord<Rika> not json
14:01:50FromDiscord<Stuffe> narimiran, thank you, that's a good fix for my situation
14:02:45FromGitter<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:54FromDiscord<exelotl> You can just do `proc deser(str:string): Foo` right?
14:04:26FromDiscord<exelotl> or well, you'd have to choose a better name than deser to disambiguate from other deserialization functions
14:04:46FromDiscord<exelotl> or do it like `proc deser(target: var Foo, str: string)`
14:05:21FromDiscord<Rika> ah yeah
14:05:26FromDiscord<Rika> out arguments
14:05:35FromDiscord<Rika> okay, that sounds good
14:06:26FromDiscord<Rika> thanks
14:06:26FromDiscord<Skaruts> @exelotl oh, thanks!
14:07:14FromDiscord<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:50FromDiscord<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:03FromGitter<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:32FromGitter<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:38FromGitter<kaushalmodi> https://github.com/nim-lang/Nim/pull/13429/files
14:20:39disbotAdd `sequtils.unzip` to complement `sequtils.zip`
14:21:59WilhelmVonWeinerI 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:59FromGitter<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:22FromGitter<matrixbot> `reversem3` Does using sugar hinder performance ?
14:30:02FromDiscord<Rika> i assume compile time will go up
14:30:57FromDiscord<Rika> ok. so UFCS is a lie when it comes to parseEnum, idk why
14:31:37FromGitter<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:39FromDiscord<exelotl> @Rika yeahh I just noticed that too
14:32:59FromGitter<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:44FromGitter<shizhaojingszj> @Vindaar Thank you very much! I'll check them out.
14:34:00FromGitter<Vindaar> you're welcome!
14:34:14FromDiscord<Rika> i'm still baffled as to why UFCS fails on parseEnum
14:34:25FromGitter<kaushalmodi> @Vindaar Looking forward to the annotations! 🎉
14:35:14FromGitter<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:18FromDiscord<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:00FromGitter<Vindaar> as you said before, `parseEnum` doesn't like UFCS, because it explicitly generic: https://play.nim-lang.org/#ix=2c2M
14:49:09FromGitter<Vindaar> *it's
14:50:39FromGitter<kaushalmodi> heh, I did something similar: https://play.nim-lang.org/#ix=2c2O
14:51:13FromGitter<Vindaar> hehe :)
14:51:19FromGitter<kaushalmodi> I cannot get satisfaction until I see something echoed out
14:51:29disruptekkinky.
14:51:48FromGitter<kaushalmodi> heh
14:56:44*Hideki_ joined #nim
14:58:52lqdev[m]use x.parseEnum[:Ty]()
14:58:57*tane joined #nim
15:01:40FromDiscord<Rika> what's with the colon
15:09:10disruptekAraq: 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:24disruptekhave 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:50disruptekso #13430
16:01:12disruptekso #13430 mr bot?
16:01:15disbothttps://github.com/nim-lang/Nim/issues/13430 -- 3Strange Table memory error ; snippet at 12https://play.nim-lang.org/#ix=2c3d
16:02:41disruptekwe 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:41njosephIs cross-compilation for MacOS/Darwin supported yet?
16:09:08*marmotini_ joined #nim
16:11:37*floppydh quit (Quit: WeeChat 2.7)
16:13:21shashlickif you use osxcross, sure
16:13:45shashlicknim 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:48Araqomg, just setup a CI already for cross compiles to OSX
18:34:08Araqyour 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:43Araqit'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:44Zevvand 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:14FromGitter<mratsim> You have appveyor and azure for windows
19:14:38FromDiscord<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:39FromDiscord<Recruit_main_70007> https://play.nim-lang.org/#ix=2c4F
19:18:48solitudesf`void*` is `pointer`
19:19:57solitudesfLoadInterface takes cpp string, not nim string
19:20:12FromDiscord<Recruit_main_70007> ye, i thought that was wrong
19:23:25FromDiscord<Recruit_main_70007> s that it?
19:28:07*ptdel quit (Ping timeout: 240 seconds)
19:35:39*seni joined #nim
19:37:48FromGitter<Varriount> Recruit_main_70007: Technically, it might be better to use 'cint', 'cbool', etc
19:38:16FromDiscord<Recruit_main_70007> ok
19:38:45FromGitter<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:42FromDiscord<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:13Araqwe 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:51federico3the latter, with a bump in version number
21:12:11Araqsounds good
21:14:10FromDiscord<Recruit_main_70007> so, i have RLNim.nim at root folder, and then this structure,
21:14:11FromDiscord<Recruit_main_70007> RLBotCPP-master
21:14:11FromDiscord<Recruit_main_70007> │ ├───inc
21:14:11FromDiscord<Recruit_main_70007> │ ├───lib
21:14:11FromDiscord<Recruit_main_70007> │ │ └───inc
21:14:11FromDiscord<Recruit_main_70007> │ │ └───flatbuffers
21:14:14FromDiscord<Recruit_main_70007> └─── some headers here
21:14:23disruptekdude.
21:14:37FromDiscord<Recruit_main_70007> that is small
21:14:57FromDiscord<Recruit_main_70007> how big is the feed of Irc?
21:15:07disruptek--> <--
21:16:02shashlickAraq why not modify and maintain in one place
21:16:46Araqit would be unfair to the 9 upvotes that I already got
21:16:57Araqfeels like cheating
21:18:30shashlickCan have a changelog and ask people to comment or adjust their votes
21:19:19shashlickOf course depends how much the RFC has changed
21:22:12FromDiscord<Recruit_main_70007> ok...
21:22:12FromDiscord<Recruit_main_70007> now with the pastebin...
21:22:12FromDiscord<Recruit_main_70007> I have this folder structure (continues in the pastebin)
21:22:12FromDiscord<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:45FromDiscord<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:46lqdev[m]@Yepoleb yeah, `x in low(T)..high(T)
21:47:02FromDiscord<Yepoleb> does that even work with gaps?
21:48:35FromDiscord<Yepoleb> To give more context, I want to do `if validEnum(x): result = enumType(x) else: result = enumTypeUnknown`
21:57:55FromGitter<mratsim> use EnumTy
21:58:07FromGitter<mratsim> use EnumeType(x)
21:58:31lqdev[m]@Yepoleb gaps are not checked.
22:08:17*MarderIII quit (Quit: Leaving)
22:13:28FromDiscord<Yepoleb> I don't want to use the exception of the conversion operator as a check, because it's slow
22:15:02leorizeexception is not slow anymore with the new --exception:goto
22:15:15leorizewell not **that** slow
22:15:34*Trustable quit (Remote host closed the connection)
22:16:30FromDiscord<clyybber> \o/
22:16:40leorizebut conversion failure won't be catchable in the future iirc
22:16:44leorizesince it's a bug
22:16:59leorizethough why do you need enums with gaps?
22:17:28FromDiscord<clyybber> enums with gaps are cursed
22:17:28disruptekmake a constant set representing e.low .. e.high and then check for membership.
22:17:48FromDiscord<clyybber> leorize: I wonder though, where you'd read that?
22:18:15leorizeclyybber: Araq did some benchmark on the forum iirc
22:18:45FromDiscord<Yepoleb> i'm implementing a standard (DNS) which has gaps in the assigned values
22:19:35FromDiscord<clyybber> leorize: Oh : /
22:19:37FromDiscord<clyybber> well
22:19:41FromDiscord<clyybber> it neverworked anyways
22:19:54FromDiscord<clyybber> at least not with enums with holes
22:20:01FromDiscord<clyybber> or at least not on gc:arc
22:20:08FromDiscord<clyybber> even before exceptions goto
22:20:24FromDiscord<clyybber> you'd just get invalid data anyways
22:20:28leorizeto be fair constants are much better than enum with holes
22:20:31FromDiscord<clyybber> the catchability was a hoax
22:21:05disruptekif you care about speed, waste some memory to achieve it.
22:21:08leorizeuse distinct types with your own checking routines
22:23:10FromDiscord<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:30leorizeuse distinct types and your own checking logic
22:25:12FromDiscord<Yepoleb> using distinct types gives me no benefits over using enums with holes
22:25:37FromDiscord<clyybber> enums with holes give you no advantage over distinct ints
22:25:59FromDiscord<clyybber> enums with holes are a good candidate to be made *illegal*
22:26:06FromDiscord<clyybber> or deprected or removed at some point
22:26:29disruptekditto dns.
22:27:09FromDiscord<Yepoleb> i'm aware that dns is just as cursed
22:27:40FromDiscord<clyybber> there is a way, but its also slow
22:27:43FromDiscord<clyybber> you can $ it
22:27:50FromDiscord<clyybber> and check against "invalid data"
22:27:58FromDiscord<clyybber> I agree there should be a better way
22:28:53FromDiscord<Yepoleb> i think i'm going to use a hash set with all possible values and use that to check
22:29:39FromDiscord<clyybber> yeah, thats probably best
22:29:39FromDiscord<Yepoleb> because that's what any sane internal implementation would use anyway
22:30:14leorizeor you can write a macro that generate the checking routine for you using a case statement
22:30:19leorizenot sure which is faster though
22:30:35disruptekthe macro is faster, but who cares?
22:31:12FromDiscord<clyybber> if it fits in a builtin set than its not gonna differ
22:31:13Araqwell 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:45FromDiscord<Yepoleb> i was hoping using an enum would make it easier to check for valid values
22:34:47FromDiscord<Yepoleb> because the compiler knows all possible values at the time of definition, which is not the case with distinct types
22:34:49leorizeit appears to me that you can't do custom pragma in the type section
22:35:43FromDiscord<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:49disruptekyou /can/ iterate over possible values.
22:36:55FromDiscord<Yepoleb> i can?
22:37:00disrupteki will permit it.
22:38:18FromDiscord<Yepoleb> i only know of the low/high loop, which does not work in this case
22:43:31FromDiscord<clyybber> yeah, there is no way
22:43:41FromDiscord<clyybber> though its technically possible
22:43:48FromDiscord<clyybber> but not implemented
22:44:35*krux02 joined #nim
22:46:04FromDiscord<Yepoleb> is it possible using macros?
22:46:24leorizeyes
22:47:07disrupteklife is short. make it work. move on.
22:47:20FromDiscord<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:53disruptekis this for a hearing aid?
22:48:14FromDiscord<Yepoleb> what?
22:48:21disrupteksounds like yes.
22:50:01FromDiscord<clyybber> (╯°□°)╯︵ ┻━┻
22:50:51FromDiscord<clyybber> yepoleb do you hear this?
22:51:26FromDiscord<Yepoleb> no, i can only hear rick astley playing right now
22:51:31FromDiscord<clyybber> lol
22:51:32FromDiscord<clyybber> aigh
22:51:40FromDiscord<clyybber> t - townsfolk
22:53:15*natrys quit (Ping timeout: 240 seconds)
22:53:53FromDiscord<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:18FromDiscord<Elegant Beef> So if i have a ptr how do i get it as a value?
22:56:37leorize@Yepoleb: https://play.nim-lang.org/#ix=2c5N
22:57:00FromDiscord<clyybber> @Elegant Beef cast to int is what you want I think
22:58:16*sz0 joined #nim
22:58:34leorizewait I think I broke that one
23:01:25FromDiscord<Elegant Beef> Nice getting out of memory when building now
23:01:28FromDiscord<Elegant Beef> im a genius
23:01:59FromDiscord<Yepoleb> thanks leorize!
23:02:08leorizenope that doesn't work
23:02:15leorizeI made a small typo
23:02:18leorizelemme fix that real quick
23:04:13FromDiscord<clyybber> @Elegant Beef how?
23:04:27FromDiscord<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:31FromDiscord<Elegant Beef> probably cause im daft
23:05:00FromDiscord<Elegant Beef> using pointers to masks for entities now, but getting an error when building assuming i have pointers out of memory
23:05:09FromDiscord<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:50FromDiscord<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:01FromDiscord<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:15FromDiscord<Elegant Beef> but seems i did something wrong 😄
23:06:29leorizeYepoleb: use this version instead: https://play.nim-lang.org/#ix=2c5P
23:06:42leorizethe last one won't return anything but false, due to a typo
23:07:49leorize@Yepoleb: ^
23:07:56FromDiscord<Yepoleb> thanks for writing this for me 🙂
23:08:22leorizeyou're welcome :)
23:10:16FromDiscord<Elegant Beef> what's the proper way to handle passing a ptr to a proc that doesnt take ptrs?
23:10:38leorizewhy would you want to pass a ptr to a proc that don't take it?
23:10:45leorizeor 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:18FromDiscord<Elegant Beef> I want what's at the ptr
23:13:40leorizeuse the `[]` operator
23:13:46leorize`p[]`
23:13:53leorize^ like that
23:13:54FromDiscord<Elegant Beef> Or i misunderstand pointers
23:15:20FromDiscord<Elegant Beef> so `p[pointerVar]`?
23:16:04FromDiscord<Elegant Beef> ah
23:16:25leorizeit's `pointerVar[]` :P
23:16:52FromDiscord<Elegant Beef> yay no more out of memory
23:16:53FromDiscord<Elegant Beef> danke
23:34:35disruptekError: unhandled exception: No handles or timers registered in dispatcher. [ValueError]
23:37:45disruptektime to remove async, i guess.