<< 19-09-2020 >>

00:00:04*abm joined #nim
00:05:21*justsomeguy joined #nim
00:06:54*gmaggior quit (Quit: Leaving)
00:19:08*justsomeguy left #nim (#nim)
00:23:01*D_ quit (Ping timeout: 264 seconds)
00:29:37*arecacea1 quit (Remote host closed the connection)
00:30:22*arecacea1 joined #nim
00:37:26FromDiscord<acek7> you saint
01:00:55*NimBot joined #nim
01:09:51*abm quit (Read error: Connection reset by peer)
01:26:54disruptekcall me carl.
01:34:07*apahl quit (Ping timeout: 272 seconds)
01:35:35*apahl joined #nim
01:38:09*arecacea1 quit (Remote host closed the connection)
01:38:32*arecacea1 joined #nim
01:47:13*kenran joined #nim
01:48:59*StevePerkins quit (Ping timeout: 265 seconds)
01:52:36*kenran quit (Ping timeout: 272 seconds)
02:10:17*audiofile quit (Quit: Default Quit Message)
02:40:23*muffindrake quit (Ping timeout: 244 seconds)
02:42:36*muffindrake joined #nim
02:53:22Prestigedisruptek: hi carl
02:56:13*waleee-cl quit (Quit: Connection closed for inactivity)
02:57:56*a_chou joined #nim
03:01:43FromDiscord<UNIcodeX> "Then there's me. My name is Earl."
03:07:28FromDiscord<iWonderAboutTuatara> woooah discord is havintg issues
03:07:30FromDiscord<iWonderAboutTuatara> godot server went down
03:21:23disruptekwhat? no. carl, call me.
03:35:12*apahl quit (Ping timeout: 260 seconds)
03:35:49*apahl joined #nim
03:48:08*kenran joined #nim
03:53:37*kenran quit (Ping timeout: 264 seconds)
03:58:14*arecacea1 quit (Remote host closed the connection)
03:58:38*lritter quit (Ping timeout: 272 seconds)
03:58:42*arecacea1 joined #nim
03:59:58*aenesidemus quit (Ping timeout: 265 seconds)
04:04:25*Tanger joined #nim
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:34*supakeen joined #nim
04:11:56*narimiran joined #nim
04:18:54FromDiscord<Zachary Carter> why does twitch suck balls?
04:21:12*a_chou quit (Quit: a_chou)
04:24:11FromDiscord<Zachary Carter> I just want to streammmmm
04:38:26FromDiscord<Rika> youtube has streaming if you dont mind using youtube
04:39:29FromDiscord<Zachary Carter> true dat
04:42:01*a_chou joined #nim
04:43:55*a_chou quit (Remote host closed the connection)
04:45:21*StevePerkins joined #nim
04:49:25*StevePerkins quit (Ping timeout: 240 seconds)
05:42:23*vicfred quit (Quit: Leaving)
05:46:04*solitudesf joined #nim
05:49:00*kenran joined #nim
05:54:03*kenran quit (Ping timeout: 260 seconds)
06:04:48FromDiscord<PizzaFox> how expensive of an operation is https://nim-lang.org/docs/os.html#setLastModificationTime%2Cstring%2C
06:05:05FromDiscord<PizzaFox> i have a bunch of files which i parse the name as a date and set the modification time to using that proc
06:05:29FromDiscord<PizzaFox> is it faster to just do that blind to all of them or to parse the filename and the last modified time and decide if they need to be updated
06:30:55ForumUpdaterBotNew thread by Saem: Modelling projects for VS Code Extension, see https://forum.nim-lang.org/t/6838
06:34:11*vicfred joined #nim
06:44:43FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2y5r
06:44:52FromDiscord<PizzaFox> the codeblock at the bottom doesnt run properly
06:52:40*Pisuke quit (Read error: Connection reset by peer)
07:50:07*kenran joined #nim
07:52:32*Jjp137 quit (Ping timeout: 258 seconds)
07:54:48*kenran quit (Ping timeout: 260 seconds)
08:03:38*kenran joined #nim
08:07:53*Trustable joined #nim
08:43:40*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:50:03*krux02 joined #nim
09:03:53*waleee-cl joined #nim
09:20:06*narimiran quit (Ping timeout: 260 seconds)
09:48:45FromDiscord<Julek> can someone compile this Nim code to C for me? I'm getting some weird GCC error when trying to https://media.discordapp.net/attachments/371759389889003532/756814029502283796/gc.nim
09:56:51FromDiscord<hobbledehoy> it compiles for me
09:57:37FromDiscord<Recruit_main707> it also does for me in playground
09:59:53FromDiscord<Recruit_main707> are you messing around with 32/64bit compilation or something else?
10:02:40FromDiscord<Recruit_main707> @Julek ^
10:03:36FromDiscord<Julek> just did `nim.exe c gc.nim`
10:05:53FromDiscord<Julek> ```↵C:\Users\Julek\Desktop\nim-1.2.6\lib/nimbase.h:522:13:Nim_and_C_compiler_disagree_on_target_architectureC:\Users\Julek\Desktop\nim-1.2.6\lib/nimbase.h:522:13:' is negative↵ 522 | typedef int error: size of array ' of(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1];```
10:08:20*Vladar joined #nim
10:09:41FromDiscord<alehander42> clyybber
10:09:46FromDiscord<alehander42> i'd say yes
10:09:55FromDiscord<alehander42> `For a hypothetical int not 1`
10:10:17FromDiscord<alehander42> but i'll have to generalize it: i want to, for enums and eventually cases like this
10:10:23FromDiscord<Recruit_main707> did you run finish.exe when installing nim?
10:10:32FromDiscord<alehander42> but it's important to mostly work on the pointer stuff for now
10:10:33FromDiscord<Julek> haven't installed it at all
10:10:43FromDiscord<Julek> thought it's portable
10:10:52FromDiscord<alehander42> as the other stuff might be based on z3 (even tho i think it can be also based on this one)
10:11:04FromDiscord<alehander42> tl;dr it would be cool to show a branch where this works to compare with z3
10:11:18FromDiscord<alehander42> but the goal for now is only nil stuff
10:11:28FromDiscord<Recruit_main707> wdym you havent installed it
10:11:44FromDiscord<Julek> downloaded the .zip extracted thats all
10:11:49FromDiscord<alehander42> and yeah: the enum stuff would be kinda similar, but for int not 1, you would probably need maths/equations
10:11:56FromDiscord<Julek> (edit) '.zip extracted' => '.zip, extracted,'
10:12:00FromDiscord<Recruit_main707> the one from github?
10:12:00FromDiscord<alehander42> to e.g. know x - 1 => 1 etc
10:12:01FromDiscord<krisppurg> Might be a dumb question, but what does `{.gcsafe.}`
10:12:11FromDiscord<alehander42> so maybe z3 might be indeed good to reuse there
10:12:11FromDiscord<krisppurg> (edit) 'Might be a dumb question, but what does `{.gcsafe.}` ... ' => 'Might be a dumb question, but what does `{.gcsafe.}`do?'
10:12:16FromDiscord<alehander42> similarly to bound checking
10:12:16FromDiscord<Julek> > the one from github?↵the one from nim-lang.org
10:12:29FromDiscord<alehander42> but the important thing is to be able to write that
10:12:34FromDiscord<Julek> (edit) 'nim-lang.org' => 'https://nim-lang.org/install.html'
10:13:14FromDiscord<Recruit_main707> https://media.discordapp.net/attachments/371759389889003532/756820187151335424/unknown.png
10:13:46FromDiscord<Julek> yeah but why is it a .zip
10:13:55FromDiscord<Julek> like coudn't it be .exe called setup
10:14:00FromDiscord<Julek> thought it's portable
10:14:18FromDiscord<ache of head> lmao
10:14:41FromDiscord<Recruit_main707> well, im not the one that decides how the installation process is goes so idk
10:14:55FromDiscord<Julek> ||no bardzo smieszne||
10:15:00FromDiscord<ache of head> ups
10:15:14*natrys joined #nim
10:15:23FromDiscord<ache of head> you can always just go with chooseni
10:15:24FromDiscord<ache of head> (edit) 'chooseni' => 'choosenim'
10:15:32FromDiscord<ache of head> https://github.com/dom96/choosenim/releases
10:15:35FromDiscord<Recruit_main707> choosenim is 32bit only though
10:15:43FromDiscord<ache of head> wait, what?
10:15:52FromDiscord<ache of head> it works for me and i'm on 64
10:15:59FromDiscord<Recruit_main707> but the nim version is 32bit
10:16:06FromDiscord<ache of head> 😳
10:16:08FromDiscord<Recruit_main707> thats what i meant
10:16:31FromDiscord<ache of head> didn't know that at all
10:17:02FromDiscord<Recruit_main707> im pretty sure, make sure and do nim --version though
10:17:21FromDiscord<Recruit_main707> @Julek about your issue, just run `finish.exe`
10:17:33FromDiscord<Julek> aight
10:17:34FromDiscord<Recruit_main707> everything should work then
10:17:50FromDiscord<Julek> it's my gcc than nim doesn't like
10:18:25FromDiscord<ache of head> https://pastebin.com/CyZ2rU32
10:18:32FromDiscord<ache of head> output of nim --version
10:18:40FromDiscord<Recruit_main707> it will install mingw if they disagree with the existing gcc installations,
10:18:48FromDiscord<Julek> btw can I somehow emit C
10:18:55FromDiscord<Julek> not just binary
10:19:03FromDiscord<Recruit_main707> you *can*
10:19:09FromDiscord<Recruit_main707> but the code is rather ugly
10:20:13FromDiscord<Recruit_main707> if you add `--nimcache:cache` in the compiler options you can see the intermediate c code
10:20:32FromDiscord<Recruit_main707> (it will be in a new directory called cache)
10:20:33FromDiscord<Gary M> Is there anyone around that can help me figure out socket communication with nimsuggest?
10:21:18FromDiscord<Recruit_main707> @ache of head hmm, maybe choosenim now has 64 bit installations too
10:21:43FromDiscord<ache of head> i remember maintaining the toolchain with choosenim, but i can't remember if i installed nim in general with choosenim or homebrew
10:21:44FromDiscord<ache of head> hmmm
10:22:16FromDiscord<Rika> @krisppurg depends on what context the pragma is in
10:22:50FromDiscord<Recruit_main707> @dom96 does choosenim have 64bit nim installations now?
10:23:14FromDiscord<dom96> yes
10:23:23FromDiscord<Recruit_main707> thats nice
10:24:09FromDiscord<krisppurg> For example `{.async.}`
10:24:20FromDiscord<ache of head> hmmmm
10:24:21FromDiscord<krisppurg> @Rika
10:24:29FromDiscord<ache of head> so the one i have in PATH is the one from choosenim
10:24:48FromDiscord<ache of head> as in from `~/.nimble/bin`
10:25:20FromDiscord<Rika> @krisppurg i mean if its put on a proc or a proc type decl
10:25:44FromDiscord<Rika> like proc xx() {.gcsafe.} versus let a: proc() {.gcsafe.}
10:26:12FromDiscord<krisppurg> hold on
10:27:39FromDiscord<Julek> anyone knows where/if nim compiler generates the C files before they are compiled with GCC for example?
10:28:18FromDiscord<Rika> ~/.cache/nim or ~/.nimcache i dont know anymore
10:28:19disbotno footnotes for `/.cache/nim`. 🙁
10:29:11FromDiscord<Julek> and those folders are located where?
10:29:42FromDiscord<Rika> thats the path
10:29:57FromDiscord<Rika> unless windows, in which case i dont got a damn clue 😛
10:30:09FromDiscord<Julek> yeah I'm on win
10:34:34FromDiscord<Recruit_main707> gimme a sec
10:35:07FromDiscord<Recruit_main707> `C:\Users\[username]\nimcache`
10:37:55FromDiscord<Julek> oh right
10:38:11FromDiscord<Julek> I was looking in `%temp%`
10:38:27FromDiscord<lqdev> i think nimble's having a mild stroke https://media.discordapp.net/attachments/371759389889003532/756826532277780520/unknown.png
10:39:56FromDiscord<Rika> nah just terminals being fucky
10:46:39FromDiscord<Clyybber> I don't see anything abnormal
10:46:48FromDiscord<Clyybber> oh nvrmnd
10:50:38*krux02 quit (Remote host closed the connection)
10:55:26*abm joined #nim
11:03:16FromDiscord<lqdev> @Rika well i _did_ update alacritty recently so there's that
11:07:34FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=2y6s
11:07:39FromDiscord<Rika> "how dare you use a program in another language!"
11:07:58FromDiscord<Rika> @krisppurg marks the proc as "gc safe" forcefully
11:08:26FromDiscord<Rika> so you dont get gc safe errors if nim deems the proc to not be gc safe, and the callback requires a gc safe proc
11:08:36FromDiscord<hobbledehoy> means you can't access global variables isn't it?
11:10:00FromDiscord<krisppurg> ahhh I get it.
11:10:21FromDiscord<krisppurg> been getting those in nim v1.2.6
11:11:55FromDiscord<dom96> You should be able to disable threads and not worry about these
11:12:13FromDiscord<dom96> although the nim compiler might now be enforcing it all the time
11:12:27FromDiscord<dom96> --threadAnalysis:off can also help
11:13:09FromDiscord<krisppurg> alright
11:13:21FromDiscord<krisppurg> I'll try to either keep in mind about that
11:14:41FromDiscord<dom96> another thing you can do if you want threading support is use {.threadvar.}
11:15:18FromDiscord<dom96> but in general, globals are almost always a bad idea 🙂
11:35:16*superbia1 joined #nim
11:38:13*superbia quit (Ping timeout: 260 seconds)
11:41:25*superbia1 quit (Ping timeout: 240 seconds)
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:37*supakeen joined #nim
12:40:24*audiofile joined #nim
13:04:23*arecacea1 quit (Remote host closed the connection)
13:04:49*arecacea1 joined #nim
13:04:53FromDiscord<Recruit_main707> how can i use nimble to have a part of the project that compiles to a dll and another part that uses that dll?
13:05:18FromDiscord<Recruit_main707> something like this: https://play.nim-lang.org/#ix=2y6X
13:09:14*jorjun joined #nim
13:11:06*arecacea1 quit (Remote host closed the connection)
13:12:16*arecacea1 joined #nim
13:14:05FromDiscord<lqdev> is it possible to change the JSON field name when using `json.to`?
13:24:45*krux02 joined #nim
13:45:08FromDiscord<alehander42> oi
13:45:38FromDiscord<Yardanico> @lqdev no, but if it's simply snake_case vs camelCase, you can just specify the field name in the object as in the JSON
13:45:49FromDiscord<lqdev> it's `type` vs `kind`
13:45:55FromDiscord<Yardanico> Ah, no
13:46:08FromDiscord<Yardanico> I had to modify json macros because of that
13:46:12FromDiscord<Yardanico> To add custom pragmas
13:46:19FromDiscord<Yardanico> You can also take a look at json serialisation
13:46:26FromDiscord<Vindaar> @lqdev Still not really possible and partly my fault. Worked on it, but there were problems with the custom pragma macro. You can use those new json hooks, but that to my understanding is not really different from providing your own `to` proc for your type https://github.com/nim-lang/Nim/blob/devel/lib/std/jsonutils.nim#L382-L398
13:46:31FromDiscord<Yardanico> https://github.com/status-im/nim-json-serialization/
13:46:52FromDiscord<Yardanico> This library supports a lot of stuff like changing field names
13:46:54FromDiscord<lqdev> i know that one but it seems to pull in a bunch of dependencies like chronos and crypto
13:46:56FromDiscord<Vindaar> yeah, that's ^ probably a better idea
13:46:57FromDiscord<lqdev> which is bloat.
13:47:08FromDiscord<Vindaar> there was a json library by
13:47:18FromDiscord<Yardanico> It's archived
13:47:20FromDiscord<Vindaar> * LemonBoy
13:47:23FromDiscord<lqdev> DCE is not an excuse, compile times will still be hindered
13:47:57FromDiscord<Yardanico> @lqdev well, you can also do it yourself, and start by checking some of my stuff
13:48:04FromDiscord<lqdev> lol during a game jam
13:48:18FromDiscord<Yardanico> https://github.com/Yardanico/telenim/blob/master/src/telenim/json_custom.nim
13:48:34FromDiscord<Yardanico> Usage at the bottom
13:48:57FromDiscord<Yardanico> It's mostly copy paste from the JSON module
13:48:58FromDiscord<Vindaar> what I meant: https://github.com/LemonBoy/jstin
13:49:03FromDiscord<Yardanico> And the custom pragma pr
13:49:12FromDiscord<Yardanico> @Vindaar yeah i know about that one
13:49:18FromDiscord<Clyybber> Its my fault in the end :p
13:49:25FromDiscord<Vindaar> but maybe @lqdev does not 😉
13:49:31FromDiscord<Yardanico> Heh
13:49:32FromDiscord<Clyybber> because I didn't finish the custom pragma pr
13:49:41FromDiscord<Vindaar> shame on you! 😄
13:49:48FromDiscord<lqdev> yeah just gonna use json.to
13:49:50FromDiscord<lqdev> it'll be easier
13:49:54FromDiscord<lqdev> to just strop the ident
13:50:06FromDiscord<alehander42> i dont like that
13:50:09FromDiscord<Clyybber> wait I can delegate the shame on krux who didn't finish it first
13:50:21FromDiscord<alehander42> ok, nevermind, i was going to discuss lib choices
13:50:30FromDiscord<alehander42> let me focus on my unfinished code 😄
13:51:50Yardanicorip irc, more and more people start using discord :(
13:51:59Yardanicothere are periods now when there is 0 messages from IRC for hours
13:52:49FromDiscord<Vindaar> sorry 😐 IRC is the one CLI tool I'm too lazy to use (yeah I know there's GUI clients)
13:53:00YardanicoI use quassel
13:53:04YardanicoI have quassel server on my VPS
13:53:33FromDiscord<alehander42> hm, should i support addr in the alias analysis
13:53:34FromDiscord<Vindaar> a friend of mine does the same. I've been thinking about doing that, but in the end I never do..
13:54:12Zevvno I would rather have a 25 MB web app hogging my memory and CPU, often making me wait for seconds before i can type something, mixing channels and threads so I have *no* clue anymore to who I was talking about what
13:54:16FromDiscord<Vindaar> the thing for me is that I like to keep distracting stuff in my browser (all the good that does, sigh)
13:54:23FromDiscord<Clyybber> @alehander42 You mean taking an address of a ref and modifying it via the addr?
13:54:24Zevvoh no, I'm mistaking. I prefera console IRC client
13:54:42FromDiscord<alehander42> yes @Clyybber
13:55:04FromDiscord<Clyybber> Hmm, not necesaarily. I'm not sure
13:55:39FromDiscord<Vindaar> @Zevv I understand where you're coming from, but neither is discord etc really important, nor is it the reason my browser is running. plus I have more than enough ram to not care (doesn't mean I don't agree in principle that modern software often is a ram hog for no reason)
13:55:48FromDiscord<Clyybber> IMO it would also be acceptable to process addr pessimistically
13:55:56FromDiscord<Clyybber> making it always violate not nil
13:57:53FromDiscord<alehander42> @Clyybber but how would this look
13:58:16FromDiscord<alehander42> i mean yeah
13:58:37FromDiscord<alehander42> you can just assume every usage after it is potentially problematic
13:58:52FromDiscord<alehander42> but that would be a bit rough
13:59:15FromDiscord<alehander42> supporting this case doesn't seem hard, I just wondered if it fits well the plan
14:12:08*nyd joined #nim
14:13:34*abm quit (Ping timeout: 258 seconds)
14:34:39*jorjun quit (Ping timeout: 245 seconds)
15:11:47FromDiscord<flywind> I use `gcsafe` to make program compile with `threads:on`, is it dangerous?
15:11:56FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2y7r
15:12:02Yardanicoyes
15:12:06Yardanicoit can be dangerous
15:12:24Yardanicowith that you basically say to the compiler "I know what i'm doing"
15:12:39Yardanico"i'm sure myself that it's gcsafe, so shut up" :D
15:12:45FromDiscord<flywind> But I also annotate `redisClient` as `threadvar`.
15:13:01Yardanicobut is hGetAll threadsafe?
15:13:13Yardanicoalso async libs themselves are often not gcsafe either
15:13:17Yardanicoi mean nim async libs
15:14:00supakeenя не async
15:14:14FromDiscord<lqdev> R He async
15:14:44supakeenI have learned about 3 words of Russian the past week and now I shall use them *everywhere*.
15:15:05Yardanicono
15:15:20Yardanicootherwise I'll stop speaking english in this channel
15:15:24Yardanico:DDD
15:15:57Yardanicoand I'm not understand what did you mean by "I'm not async"
15:16:00Yardanicoi *
15:16:22FromDiscord<flywind> I think `hGetAll` is `gcsafe` because it onlt uses `AsyncRedis` as parameters and doesn't use any other globals. And `AsyncRedis` is marked as `threadvar` by me. Right?
15:16:44Yardanicowell, you can check if hGetAll is really gcsafe by annotating it as gcsafe
15:16:49Yardanicoadding that pragmat to that proc/func
15:16:59Yardanicoand see if the compiler says that it's not gcsafe
15:17:34FromDiscord<flywind> Ok, thanks!
15:19:03supakeenYardanico: My Russian has not yet progressed to where it makes sense :)
15:21:29FromDiscord<flywind> I mark all functions that `hGetAll` calls, it now compiles too.
15:22:31FromDiscord<flywind> Should all async functions be marked `gcsafe`?
15:22:37Yardanicowell, idk
15:23:34FromDiscord<flywind> https://github.com/nim-lang/redis/blob/master/src/redis.nim
15:24:17FromDiscord<flywind> It is hard to make `async` work with threads when reusing a database connection.
15:26:31FromDiscord<flywind> This issue seems very common.
15:26:31FromDiscord<flywind> https://github.com/FedericoCeratto/nim-httpauth/issues/22
15:26:33disbotNot GC-safe for threading ; snippet at 12https://play.nim-lang.org/#ix=2y7w
15:26:48Yardanicowell, it's an issue because nim's async by default assumes one global dispatcher :)
15:26:55Yardanicoand a lot of libs assume having a single thread too
15:27:07Yardanicothere was an RFC about making --threads:on default, maybe we'll get that in nim 2.0 :P
15:30:03FromDiscord<lqdev> whyyyyy
15:30:07FromDiscord<flywind> Yea, I find a RFC for `gcsafe`
15:30:09FromDiscord<lqdev> why not 1.4
15:30:09FromDiscord<flywind> https://github.com/nim-lang/RFCs/issues/142
15:30:11disbotProposal to remove the `.gcsafe` effect from Nim ; snippet at 12https://play.nim-lang.org/#ix=26qX
15:30:43FromDiscord<lqdev> why are threads considered unstable enough to be behind a switch?
15:34:11Araqthey are not unstable but people cannot use them properly
15:34:28FromDiscord<lqdev> wdym?
15:36:14Araqglobal variables without locking, sharing thread local memory, deadlocks and data races
15:36:28Yardanico@lqdev that rfc about making --threads:on the default was actually proposed a few years ago
15:36:45Yardanicohttps://github.com/nim-lang/Nim/issues/9878
15:36:45disbot[RFC] switch threads to on by default
15:37:49Araqbtw for async ORC I get about 90% of the performance that MarkAndSweep gives me
15:37:58Yardanicoyay
15:38:05Araq80% with -d:useMalloc
15:38:12Yardanicooh, I thought it'd be slower
15:38:14Yardanicowith -d:useMalloc
15:38:29Araqso we lose 20% but allow for sharing the heap
15:38:42Araqwhich means we can use all the N cores finally
15:39:19Araqsounds like a very nice deal
15:39:20disruptekN cores are my favorite flavor of core.
15:39:25Yardanicogood morning
15:39:50Araqnow the only problem is how to actually move "tasks" between cores
15:41:21*pangey quit (Ping timeout: 260 seconds)
15:41:28*pangey__ joined #nim
15:42:01Araqan async implementation that doesn't overload my brain with callbacks and hidden state would be sweet
15:42:29AraqI heard CPS is ready now... :P
15:44:30*abm joined #nim
15:44:34Yardanicobtw, we got 46 more people on the discord server since that tweet about it becoming verified
15:44:40Yardanicobut most of them are inactive as usual :(
15:46:07YardanicoI wonder if I should bother with making more IRC channels to bridge our new discord channels
15:46:10Yardanicolike we got #science on discord
15:46:16Yardanicowe also have #nimble there
15:54:56disrupteki believe we call that a tar pit.
15:55:13disruptekcps is waiting for arc fixes, among others.
15:55:30Yardanicowhat arc fixes?
15:57:05Yardanicohttps://forum.nim-lang.org/t/6766 thread is becoming fun
15:57:24Yardanicoover a hundred posts in a week in a single thread, wow
15:57:24Araqmoderate it
15:57:46YardanicoI'm not a moderator and there is still some good discussion there :P
15:58:26Araqhaven't read it
15:58:52disruptek!repo cps
15:58:53disbothttps://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 35⭐ 1🍴
15:59:17disrupteksee the issues section.
15:59:58Yardanicowell, the issue isn't very descriptive :)
16:00:49Yardanicoand tests work for me with arc
16:00:53Yardanicoon latest devel
16:01:02Yardanicoor maybe that's wrong cps
16:02:06*narimiran joined #nim
16:03:01Yardanicotaste.nim worked for me with arc, not tzevv though, that one says "/home/dian/Stuff/cps/tests/tzevv.nim(54, 17) Error: invalid pragma: cps: C"
16:03:03Yardanicodisruptek: ^
16:03:17Yardanicotaste test output was "## 26 tests 🟢1 ❔5 ⛔20" but i'm not sure what is that supposed to mean
16:03:22AraqYardanico: you're now a moderator
16:03:30Yardanicowow, okay
16:03:50*Tanger quit (Remote host closed the connection)
16:05:40Araqnow go forth -- unleash the tides of doom -- upon all who would oppose us
16:06:52Zevveverything is broken. my code. my tests. my expectations of what life would bring me.
16:09:50*Zevv is not comfortable with that forum thread since post #6 or so
16:09:54Yardanicolol
16:10:55Araqhttps://www.youtube.com/watch?v=r5EXKDlf44M
16:11:49ZevvI find the tone is getting more and more toxic on the forum
16:12:05Zevvi'm not sure if there is deliberate trolling going on
16:12:09Yardanicobecause more and more people discover it :)
16:12:23Yardanicobut yeah, that forum thread has 114 replies
16:13:44disruptekmy kinda place.
16:14:18disruptekzevv: can you see if arc is still demonstrably broken in cps?
16:14:30FromDiscord<alehander42> oi
16:14:36Yardanicohola
16:15:11FromDiscord<alehander42> wow you're blue!
16:15:25Yardanicoyes I am
16:15:27Yardanicoblame robohash
16:15:30FromDiscord<alehander42> careful before Araq add additional color to the gc
16:15:36FromDiscord<alehander42> what is robohash
16:15:48Yardanicoone of the algorithms available on gravatar for generating user avatars
16:16:01Yardanico4raq's generated avatar is orange which is a nice coincidence
16:16:30Yardanicowithout avatars it would be harder to distinguish between different irc users from discord
16:16:43Yardanicohttps://robohash.org/
16:16:44*Jjp137 joined #nim
16:17:04Yardanicoenter your nickname (or mine), and you'll get the same avatar as the one used by the bridge
16:17:07Yardanicofor your nickname
16:17:14Yardanicoor not
16:17:26Yardanicoseems like not, lol
16:17:43Yardanicoanyway, sorry for spamming, time to go dig some more arc bugs
16:17:47*narimiran quit (Ping timeout: 240 seconds)
16:18:03disruptekzevv: i dunno how we've managed to distinguish each other all these years without avatars.
16:18:23Yardanicodisruptek: well, discord is discord :P
16:18:31Yardanicopeople are used to having colourful avatars and stuff
16:18:38FromDiscord<alehander42> i am surprised
16:18:41FromDiscord<alehander42> by the faces
16:19:23Yardanico!last FromGitter
16:19:24disbotFromGitter joined 12#nim-offtopic 3 weeks ago and last spoke 73 weeks ago
16:19:28Yardanicoreally
16:19:34Yardanicono people speaking from gitter in 3 weeks?
16:19:40Yardanicoor disbot is lying
16:20:11Zevvdisruptek: i need to sober up first, so not sure if i get to that today. my last tetsts were with the "desym your thing like He commanded" commit, and stuff was broken there.
16:20:13FromDiscord<alehander42> i did speak these days iirc
16:20:14disrupteki doubt the bridge says much.
16:20:38Yardanico!last FromDiscord
16:20:38disbotFromDiscord joined 12#nim-news 22 hours ago and last spoke 75 weeks ago
16:20:44FromDiscord<alehander42> disruptek do you like alloca
16:21:56disrupteklike it how?
16:22:01disruptekon toast?
16:22:15disruptekwith a little tartar sauce?
16:22:41disruptekraw and chilled on a bed of ice?
16:23:06Zevvmy stack is bigger then yours
16:23:07disruptekskewered through the asshole by a wooden stick?
16:23:58FromDiscord<alehander42> toast
16:24:01FromDiscord<alehander42> sounded good
16:24:01disruptekcut into strips and dunked in molten cheese. now you're talkin'.
16:24:05FromDiscord<alehander42> after this things got bad
16:24:13FromDiscord<alehander42> oh man are you hungry
16:24:17FromDiscord<alehander42> i got hungry now
16:24:59disruptekwhen i was in vermont i was near some workd-famous foodstuffs.
16:25:24disruptekhill farmstead brewery, zevv, and jasper hill cheese.
16:25:39FromDiscord<alehander42> sound good dude
16:27:56FromDiscord<alehander42> ok so {aliasA, a} -> start with {aliasA} {a} and copy
16:30:36disruptekthis is a helluva story you got going here.
16:30:44FromDiscord<alehander42> dude
16:30:46FromDiscord<alehander42> this is the plan
16:30:52FromDiscord<alehander42> but i am trying to ignore some cases
16:30:58FromDiscord<alehander42> first and this is not always easy
16:31:19disruptekthe best stories always leave something out.
16:31:25FromDiscord<alehander42> yeah
16:31:34FromDiscord<alehander42> like your story about food
16:31:37FromDiscord<alehander42> leaving ice cream
16:32:51FromDiscord<krisppurg> whats the difference between runForever and poll?
16:33:18disruptekonly one runs forever.
16:33:31Zevvthe other one merely poll
16:33:43Zevvbut beware, "forever" does not last
16:33:46YardanicorunForever runs poll internallyt
16:34:30FromDiscord<alehander42> ok my test
16:34:45FromDiscord<alehander42> function gets the correct warning but
16:35:04FromDiscord<alehander42> i still have to implement the actual logic
16:35:10FromDiscord<alehander42> currently is just being pessimistic
16:35:28*StevePerkins joined #nim
16:36:23Zevvso many promises, but disillusion is impeding. when no one needs timers or sockets, "forever" will prove to be relative, like teenage love
16:37:20FromDiscord<alehander42> zevv
16:37:23FromDiscord<alehander42> stop this
16:37:28FromDiscord<alehander42> before you wrote a poetry book
16:37:33ZevvI will climb over mountains, swim the widest oceans, i will do everything.
16:37:34FromDiscord<alehander42> and went into the art industry
16:37:36Zevvbut not when it rains
16:38:15FromDiscord<alehander42> raining is part of life
16:38:31FromDiscord<alehander42> OPEN YOUR ARMS AND WELCOME!
16:39:42*StevePerkins quit (Client Quit)
16:40:07ZevvrunForever (unless)
16:40:09*rockcavera quit (Remote host closed the connection)
16:40:29disruptekall i heard was teenage love sockets.
16:40:31Yardanicounless ?!😳
16:41:20ZevvrunForever will throw up on you if you don't feed it
16:41:44Yardaniconot sure why
16:41:44Zevvits like a tinder dinnerleech
16:41:53Yardanicobut you reminded me of C+equality "programming language"
16:42:06FromDiscord<alehander42> is it possible to
16:42:13FromDiscord<alehander42> write a(b: int, c: int = b)
16:42:24Zevvyou just did
16:42:26FromDiscord<alehander42> like, having aliases directly in args
16:42:32Zevvand I recently heard it actually is
16:42:34FromDiscord<alehander42> but is it possible to pass them to the compiler
16:42:37ZevvI was flabbergasted
16:42:39FromDiscord<alehander42> and the compilr to say dude
16:42:42Yardanicoyeah it's possible
16:42:43FromDiscord<alehander42> cool
16:42:44Zevvalso I heard its flaky
16:42:48Yardanicoit was fixed I think
16:42:48FromDiscord<alehander42> huh huh
16:42:54Yardanicoyou can do crazier stuff
16:43:02FromDiscord<alehander42> does it happen on callsite tiem
16:43:03Yardanicolike proc test(a: string, b = len(a))
16:43:05FromDiscord<alehander42> (edit) 'tiem' => 'time'
16:43:14disruptekit's not flakey.
16:43:15FromDiscord<alehander42> i mean, obviously it does but
16:43:15Zevvbut please dont. we do not need more crazynes in this world
16:43:19FromDiscord<alehander42> in python it does on decl
16:43:21YardanicoZevv: it's been documented
16:43:24FromDiscord<alehander42> i dont
16:43:25Yardanicolemme find the PR or something
16:43:27FromDiscord<alehander42> but i support it
16:43:31FromDiscord<alehander42> i need to support it
16:43:33disruptekit's behavior is consistently undefined.
16:43:41Zevvoh I'm wrong then. I think I heard it sometimes works but sometimes it doesnt
16:43:42FromDiscord<alehander42> because then if a.isNil: affects aliasA
16:43:53FromDiscord<alehander42> in proc b(a: A, aliasA: A = a)
16:43:53Yardanicoah right there was https://github.com/nim-lang/Nim/pull/15270
16:43:54disbotExpand hoisted default params in sem
16:43:57Yardanicowhich fixed some of its issues
16:43:57FromDiscord<alehander42> sometimes
16:44:04FromDiscord<alehander42> but not always
16:44:15Zevv"hoisted default params"
16:44:28FromDiscord<alehander42> but .. maybe this doesnt matter
16:44:29Yardanico:P
16:44:31ZevvI would really have no clue what that would mean from that name
16:44:33FromDiscord<alehander42> because that's possible anyway
16:44:41Yardanicoactually I don't know if it's documented
16:44:56FromDiscord<alehander42> such an interesting problem
16:45:03FromDiscord<alehander42> i guess i shouldn't assume anything different
16:45:05FromDiscord<alehander42> that normal args
16:45:24FromDiscord<alehander42> because they can be aliased in the callsite anyway
16:45:48FromDiscord<alehander42> so the default case should be just all separate for now
16:48:11FromDiscord<alehander42> ok thanks
16:50:01Zevvsometimes I think nims stdlib is soo bad and stupid. until I want to get the exit code of a spawned subprocess in Go 1.10
16:50:38FromDiscord<alehander42> just love them
16:50:47ZevvI started my own stdlib.
16:51:06*a_chou joined #nim
16:51:06Yardanicoyou want to repeat D's stdlib history? :P
16:51:21FromDiscord<alehander42> noo
16:51:31Zevvimport posix, and all is well
16:51:49*Zevv is home again
16:52:37Yardanicoadded another entry about default arguments using other arguments to https://github.com/nim-lang/Nim/wiki/Nim-features-you-didn't-know-you-needed
16:52:46Yardanicostupid page, I know, but its fun :P
16:53:10PrestigeYardanico: neat page
16:53:22Yardanicoyou can extend it if you know something else
16:53:26Yardanicowhich can be considered not widely known
16:53:42Zevvdoes it talk about abusing tuples for multiple assignment?
16:53:52Zevv(a, b) = (10, 20)
16:53:59FromDiscord<alehander42> i think this is common in python
16:54:04Yardanicono, I thought that this would be common knowledge :P
16:54:13Zevvfair enough
16:54:26YardanicoZevv: you know you can do var a, b, c = 30
16:54:26Yardanicoright?
16:54:36Yardanicojust curious
16:55:11Zevvyeah but not 10, 20, 30
16:55:56ZevvI really feel I should hate Nim. I am a minimalist by heart. Nim still has dark corners I learn about only now, after two years
16:57:11Zevvwow three it is
16:58:43disruptekcan you assign a var tuple in a params list?
16:59:05Zevvor use tuples for hoisted arguments?
16:59:24Zevv"hoisted default arguments"
16:59:29disruptektuples, sure, but i mean deconstruction.
16:59:49Zevvafter all these decades I still can not tell a declaration from a definition, let alone tell a hoisted default argument
17:00:03Zevvi have so no clue
17:00:46disruptekof course you can. otherwise, we wouldn't be having this conversation.
17:00:55Yardanicoso, I added two new channels to the bridge #nim-science and #nim-embedded, and I'll restart the bridge now so they get bridged
17:01:01Yardanicojoin these channels in IRC if you want
17:01:05*FromDiscord quit (Remote host closed the connection)
17:01:18*FromDiscord joined #nim
17:01:45Zevvso embedded, that would be pmunch and who?
17:03:55disruptekyou.
17:04:16FromDiscord<alehander42> embedDad
17:05:27YardanicoembedDat
17:06:06FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/756924089771229335/unknown.png
17:06:52FromDiscord<Yardanico> #nim-test is mine, created for testing the bridge
17:07:13*audiofile quit (Ping timeout: 260 seconds)
17:10:53FromDiscord<alehander42> ok guys going to the centerr bbl
17:11:25*a_chou quit (Quit: a_chou)
17:14:33*aenesidemus joined #nim
17:25:52FromDiscord<Avatarfighter> LMAO
17:26:08FromDiscord<Avatarfighter> Yall really just said "pmunch and who"
17:26:18Yardanicowell, he just asked
17:26:30Yardanicodisruptek isn't interested in embedded anyway if that's what you wanted to imply :)
17:26:33FromDiscord<Avatarfighter> thats so funny
17:26:42Yardanicowhy 🤔
17:26:47Yardanicofor me it sounded just like "pmunch and who else"
17:27:15FromDiscord<Avatarfighter> Idk i just woke up and i thought you all just called out pmunch for being the only person who does embedded stuff with nim
17:27:23Yardanicowell he's not the only one
17:27:32FromDiscord<Avatarfighter> i see that now lol
17:28:52FromDiscord<Avatarfighter> im kind of hyped for today, im going to deploy my scraper on a resource restricted deviced
17:29:02FromDiscord<Avatarfighter> spent a month bringing my ram usage down and the disk usage
17:29:58FromDiscord<Avatarfighter> what about you Yardanico? Working on anything fun?
17:30:02Yardaniconot really
17:32:02FromDiscord<Avatarfighter> Aww darn
17:39:32*bung quit (Quit: Lost terminal)
17:40:35*narimiran joined #nim
17:41:10FromDiscord<lqdev> i'm working on somethin' fun tho
17:41:37FromDiscord<lqdev> though i was dragged to a family member's birthday
17:41:49FromDiscord<lqdev> so not working on it right now
17:41:59FromDiscord<lqdev> (it's a game)
17:44:16*lritter joined #nim
17:58:26*nyd quit (Quit: nyd)
18:11:22*NimBot joined #nim
18:12:28*D_ joined #nim
18:19:44*vicfred quit (Quit: Leaving)
18:20:45FromDiscord<Recruit_main707> i know nim is not oop based and it doesnt want to, but id still like to see something like this being doable.↵https://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL↵(Its an interesting article too)
18:21:07FromDiscord<Recruit_main707> i wonder if we could despite depending on gcc/clang
18:21:10*vicfred joined #nim
18:21:20ForumUpdaterBotNew thread by Nhuman: Why does Random give the same value every time?, see https://forum.nim-lang.org/t/6840
18:21:29Yardanicohehe
18:25:20Yardanico@Recruit you're late
18:25:22Yardanico:P
18:25:52FromDiscord<Recruit_main707> i didnt type fast enough D:
18:27:16*nickster quit (Quit: The Lounge - https://thelounge.chat)
18:27:20FromDiscord<Vindaar> @Yardanico this isn't sarcasm: I like your honestly friendly tone and thoughtful responses to that guy 🙂
18:27:42FromDiscord<Yardanico> Well, they're a newbie
18:27:56FromDiscord<Yardanico> And i just happen to have some free time
18:27:57FromDiscord<Vindaar> *I shouln't assume guy I suppose
18:29:37FromDiscord<Vindaar> But still, it's just not a given and I appreciate it. We are _on the internet_ after all 😅
18:30:33Yardanicowell I try to behave in environments like this :P
18:32:26FromDiscord<Vindaar> haha
18:33:59*nickster joined #nim
18:37:40Yardanicothere are some telegram chats where I can be *not so polite* :D
18:37:44Yardanicobut that's a secret
18:42:25FromDiscord<Vindaar> that's fine I guess. I'm not _always_ nice either. Sometimes either because I'm in a really bad mood in the first place and read a comment of the "someone is _wrong_ on the internet" kind. Or if I know people and I don't worry about them taking stuff I say too seriously. All good
18:46:38disruptekzevv: so does cps work with arc now?
18:47:45Yardanicogood night honey badgers
18:52:39FromDiscord<Recruit_main707> gn
18:55:57*audiofile joined #nim
18:56:18*narimiran quit (Quit: leaving)
19:03:59*thomasross joined #nim
19:05:10FromDiscord<Recruit_main707> With this c++ code as an example (for context just in case the question is not clear enough):↵https://play.nim-lang.org/#ix=2y8n↵↵This is essentially a dll, that calls a function declared in the executable that imports it, how can this be done in Nim?
19:20:21FromDiscord<nim> coé
19:20:27FromDiscord<Otter> coé
19:20:37FromDiscord<nim> o pai chego
19:21:39Zevvdisruptek: easy dude
19:21:44Zevvi had quite some beers to digest
19:21:58Zevvtalking typed branch, right?
19:22:20Zevv/home/ico/external/Nim/lib/system/fatal.nim(49, 5) Error: unhandled exception: /home/ico/sandbox/prjs/cps/cps/environment.nim(524, 16) `name.kind == nnkSym` expecting a symbol for hi [AssertionDefect]
19:27:10PrestigeIs it not possible to change the compiler so we can invoke functions before they are declared without a for declaration? Maybe implicit forward declarations?
19:27:22PrestigeAfaik the compiler only does a single pass so maybe not
19:28:09solitudesfhttps://nim-lang.org/docs/manual.html#scope-rules-code-reordering
19:28:42PrestigeOoooh thanks
19:36:30*hnOsmium0001 joined #nim
20:01:22disruptekzevv: you need semytiped
20:13:45*krux02 quit (Remote host closed the connection)
20:16:47Zevvwut
20:16:54Zevvyou're making that up on the fly, right
20:22:59AraqPrestige: it's "in the works"
20:24:40Zevvis it
20:25:13PrestigeAraq: thanks, glad to hear it
20:29:24Araqalso the compiler does much more than a single pass :-)
20:29:50PrestigeOh, I thought I read somewhere that it only does one pass
20:30:00FromDiscord<Elegant Beef> Comedically i'd love if the next line was "It does 2!" 😄
20:30:09PrestigeHah
20:33:28FromDiscord<Recruit_main707> Araq, if someone knows, thats you, can you call a function from a dll, that its defined in the executable that imports it?
20:33:45FromDiscord<Recruit_main707> something like this in c++ https://play.nim-lang.org/#ix=2y8n
20:35:35AraqI think so
20:36:04FromDiscord<Recruit_main707> how, i have never seen something similar done
20:38:11Araqwell you can avoid the DLL mechanims altogether and use a function pointer, the DLL exports setCallback(cb: proc ()) and the exe calls that with its proc ()
20:44:02*bung joined #nim
20:44:04disruptekzevv: no, you need clyybber's on again off again branch: semytiped
20:44:56disruptekthat's the one that gives us sem'd proc params in typed macros.
20:45:26disruptekthe assertion guards agaibst trying to use a nim that lacks this.
20:46:11disruptekmy little palmtop doesn't work, so i'm kinda fucked.
20:46:21Zevvwhat's wrong with it
20:48:33Araqfound the ORC leak. or at least one
20:48:50Araqit's surprising how effective you can debug after a night of sleep
20:49:03Araqmaybe I should sleep even more
20:50:41Zevv/home/ico/sandbox/prjs/cps/cps/environment.nim(244, 41) Error: node has no type
20:50:55ZevvAraq: you got kids right? How can you *not* value sleep
20:51:07Zevvit's all about sleep
20:51:32AraqI do value sleep but I also value timely new major releases
20:51:42ZevvI'd go for the sleep
20:51:46Araqand 1.4 is overdue
20:54:27disruptekmaybe, but it's less important if it has fewer spec changes.
20:55:28Araqhmm this leak is still super confusing
20:55:53disruptekzevv: that error is ct but we're looking for the bug that a continuation return zotzes itself out at runtime under arc.
20:56:07FromDiscord<lqdev> json.to seems to be broken under devel from choosenim
20:56:20FromDiscord<lqdev> Error: undeclared field: 'nimIdentNormalize' for type system.string [declared in /home/daknus/.choosenim/toolchains/nim-#devel/lib/system.nim(34, 3)]
20:56:24disrupteki think i left the palmtop on the charger and it ruined its battery like an ifiot.
20:56:50Zevvoh that's baahd
20:56:58disruptekwhy are you using choosenim?
20:57:09Araqlqdev: report bugs on github
20:57:19Araqvar newList = newSeqOfCap[Callback](newLength) # this leaks memory
20:57:25Araq... # later
20:57:36disruptekgor some reason i thought it had hdmi out and it doesnt so its use is already waning.
20:57:44AraqfdData.readList = move newList # see? we moved it, how can it leak?
20:58:46Araqha! I hear you saying, the leak is reported when the seq is created
20:59:08Araqand then 'fdData.readList' is never freed afterwards
20:59:28Araqok, I'm buying that. how come if I do
20:59:36AraqfdData.readList = copy newList
20:59:40Araqthe leak is gone?
20:59:54Araqshouldn't it leak either way?!
21:00:06FromDiscord<lqdev> Araq: i'm not sure if this is something devel-related or choosenim-related tho
21:00:21FromDiscord<lqdev> i've had problems with choosenim and the stdlib some time ago
21:00:31FromDiscord<lqdev> but that was more related to testament
21:01:19Araqplease answer my question.
21:01:30Araq"shouldn't it leak either way?"
21:02:03FromDiscord<lqdev> no i was talking about the json.to thing
21:02:24disruptekit's only a leak because in one case we expect it to be freeable.
21:02:48disruptekthat's my guess.
21:03:27Araqdisruptek: my test program says getOccupiedMem() == 0 after GC_fullcollect
21:03:34disruptekwho reports it as a leak? valgrind?
21:03:36Araqthat's pretty convincing for "yeah, no leak"
21:03:45*lritter quit (Ping timeout: 240 seconds)
21:03:49Araqthat's my memory manager report
21:03:59Araqbut valgrind agrees too and says no leak
21:04:20Araqwith 'copy' I get no leaks. with 'move' I do.
21:04:31Araqboth tools that I ask agree on this.
21:04:42*lritter joined #nim
21:04:56disruptekoh, your numbers and those of valgrind?
21:05:03Araqyep
21:05:56disruptekare you sure it should be freed after move? ie the target is oos when you query your stats, right?
21:06:38disruptekdoes it show the memory grew despite not leaking?
21:06:53*Vladar quit (Quit: Leaving)
21:07:19disrupteki guess zero is hard to misinterpret.
21:07:53Araqwell I checked the produced code, it looks correct and it uses =sink so it frees what was previously in there
21:08:22disruptekit does that in any case, though.
21:08:46disrupteki mean, it destroys the target.
21:14:10disruptekit should destroy it twice (at least) over the course of the problem, right?
21:16:01Araqright, I run it in a loop
21:16:21Araqtried to write a tiny example with moves but no luck, then it doesn't leak
21:26:48*solitudesf quit (Ping timeout: 272 seconds)
21:35:18Araqfound it
21:36:30FromDiscord<XxDiCaprioxX> ``` var openings: seq[string]↵ for i in database.keys:↵ openings.add(i) ``` for some reason does not add to openings so when I do `let opening = openings[rand(openings.len-1)]` it gives me "-1 not in 0..bignumber"
21:36:36FromDiscord<XxDiCaprioxX> Any ideas?
21:36:59Araqdatabase.keys is empty?
21:38:31FromDiscord<XxDiCaprioxX> Other procs requesting from database work
21:38:35FromDiscord<XxDiCaprioxX> so it cant be
21:41:40FromDiscord<XxDiCaprioxX> Maybe because of the way openings is declared?
21:44:18Araqno
21:45:23FromDiscord<XxDiCaprioxX> maybe list.len stays 0 even if I add elements?
21:45:52*natrys quit (Quit: natrys)
21:46:23FromDiscord<XxDiCaprioxX> ah I mean openings, I changed the name to list
21:48:16Araqhttps://github.com/nim-lang/Nim/pull/15370 !!!
21:48:16disbotORC/ARC async progress
21:48:32Araqorc async is leak-free, apparently. more testing tomorrow
21:49:50FromDiscord<XxDiCaprioxX> So what does that mean for me
21:49:57FromDiscord<XxDiCaprioxX> I dont get it
21:51:56disruptekaraq: nice, gj.
21:52:11Araqit means I can rest easy. I dunno what it means for you.
21:52:25disrupteklol
21:55:54FromDiscord<XxDiCaprioxX> I still wonder, why is my sequence's length 0
21:57:10FromDiscord<Vindaar> @XxDiCaprioxX I think for us to be able to help you need to show the code before that snippet up there
22:00:21FromDiscord<XxDiCaprioxX> okay
22:01:04FromDiscord<XxDiCaprioxX> `var database: Table[string, Opening]` ```proc newOpening(name: string, openingMove: string, position: string, variations: Table[string, Variation], variationKeys: seq[string] = @[]): Opening =↵ let opening = Opening(name: name, openingMove: openingMove, position: position, variations: variations, variationKeys: variationKeys)↵ database.add(name, opening)↵ return opening```
22:01:25FromDiscord<XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2y9w
22:01:44FromDiscord<XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2y9x
22:02:03FromDiscord<XxDiCaprioxX> (the length part is new and was an attempted fix but it did not help)
22:03:58FromDiscord<Vindaar> the code seems a bit convoluted to me, but ok. In what order are those procs now called?
22:04:32FromDiscord<XxDiCaprioxX> readOpenings is called instantly on runtime
22:04:37FromDiscord<Vindaar> I assume `readOpenings`, then test a `randomOpening`
22:04:37FromDiscord<Vindaar> ah
22:04:38FromDiscord<Vindaar> ok
22:04:53FromDiscord<XxDiCaprioxX> and randomOpening as you call it per command
22:06:03FromDiscord<Vindaar> so is the `database` table even populated after a call to `readOpenings`? Does parsing the file `openingPath` work as intended?
22:06:16FromDiscord<XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2y9y
22:06:57*krux02 joined #nim
22:10:25FromDiscord<Vindaar> Hm, not sure what to tell you. While I would write the code differently, I can't really see anything inherently wrong right now, aside from the aforementioned
22:11:13FromDiscord<XxDiCaprioxX> Hm, thats what I was thinking too
22:11:26FromDiscord<XxDiCaprioxX> There has to be something problematic with the seq
22:11:49FromDiscord<XxDiCaprioxX> Maybe I can work around a seq and see if ti works
22:12:42FromDiscord<Vindaar> I really don't think that's the issue. Please check the content of `dbFile`, `database` and `list`
22:13:09FromDiscord<Vindaar> one of those isn't correctly being filled. My bet is on the `dbFile`
22:13:24FromDiscord<XxDiCaprioxX> but I mean my other proc works
22:13:31FromDiscord<XxDiCaprioxX> thats whats confusing me
22:26:01*liblq-dev joined #nim
22:26:09*liblq-dev quit (Client Quit)
22:26:54FromDiscord<lqdev> krux02: could you respond to (or merge) my nim-glm PR?
22:27:42FromDiscord<XxDiCaprioxX> Ah maybe because `database.keys` at compile time
22:28:10krux02lqdev: ok let me see
22:30:07PrestigeIs there a concise way to check if an index is in the range of an array/seq? Best I've come up with was this: https://play.nim-lang.org/#ix=2y9N
22:34:10krux02lqdev: I took a look into your PR and unfortunately I would reject it.
22:34:21krux02sorry for the late reply
22:35:09krux02the reason is, glm is a port of a c++ library and not its own design and I try to be as close as possible to the original glm library for several reasons.
22:35:33FromDiscord<XxDiCaprioxX> prestige: just `if index <= array.len-1:`
22:35:53FromDiscord<Elegant Beef> Well also >=0
22:35:59Prestige^
22:36:18FromDiscord<lqdev> krux02: understandable. so i guess the proper fix in my code would be to just not export glm.radians and glm.degrees?
22:36:21krux02The radians/degrees functions are also exactly like this part of GLSL and glm tries to bring glsl like programming to Nim.
22:36:25Prestigethat's what I usually do for other langs, was curious if there's something more concise in nim
22:36:43krux02lqdev: yes
22:36:53krux02or not import glm.radians and glm.degrees.
22:37:02FromDiscord<lqdev> either one works
22:37:21krux02but maybe there is something that can be done after all you should get an error message because of ambiguous overload resolution.
22:37:29krux02maybe that situation can be improved.
22:37:41FromDiscord<Elegant Beef> Prestige here is my suggestion https://play.nim-lang.org/#ix=2y9S
22:38:02PrestigeYeah I did almost exactly the same thing lol
22:38:30FromDiscord<Elegant Beef> Probably want to inline it though
22:39:38Prestigeoff topic, but I feel like inlining should be a compiler optimization. But yeah, added the pragma
22:40:26stisa[m]Prestige: I think you should be able to do check `index in a.low..a.high` too
22:40:40PrestigeYeah that's what I do in my example code
22:40:56Prestigealthough I assume there's slightly more overhead
22:41:14stisa[m]oh yeah, sorry
22:45:28stisa[m]mmh I'm not sure about overhead, you may want to keep the a.low check instead of >= 0 though
22:48:18stisa[m]actually nevermind, openarray.low is always 0 right? So no problems there either. Ugh I should go to sleep
22:50:37FromDiscord<Vindaar> @XxDiCaprioxX what do you mean `database.keys` is at compile time? `keys` is just a regular iterator taking a `Table`
22:51:38*a_chou joined #nim
22:53:21disruptekwe are now koching with grease.
22:53:30*shodan45 quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
22:55:40FromDiscord<Vindaar> I'm not koching at all, joke's on you! Cause I'm stuck in quarantine and forgot to have food delivered for the weekend...
22:59:33FromDiscord<XxDiCaprioxX> > @XxDiCaprioxX what do you mean `database.keys` is at compile time? `keys` is just a regular iterator taking a `Table`↵@Vindaar then I have no idea lol
22:59:50FromDiscord<XxDiCaprioxX> > I'm not koching at all, joke's on you! Cause I'm stuck in quarantine and forgot to have food delivered for the weekend...↵@Vindaar german langauge jokes. I made schnitzel today 😛
23:00:26FromDiscord<Vindaar> haha, hope you enjoyed it 😅 although technically that's more Austrian, no?
23:00:26Prestigestisa[m]: array.low can be anything, think you can change the range of an array
23:02:02FromDiscord<Rika> you can change the range yes
23:02:29stisa[m]Prestige yeah for an array, but I think openarray will always be from 0
23:03:44*shodan45 joined #nim
23:07:08FromDiscord<XxDiCaprioxX> > haha, hope you enjoyed it 😅 although technically that's more Austrian, no?↵@Vindaar yes, but I made it in Germany so that counts xD
23:07:24FromDiscord<Vindaar> oh, you're also German?
23:13:09disrupteki made it with a german today, too.
23:49:00*abm quit (Read error: Connection reset by peer)