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:26 | FromDiscord | <acek7> you saint |
01:00:55 | * | NimBot joined #nim |
01:09:51 | * | abm quit (Read error: Connection reset by peer) |
01:26:54 | disruptek | call 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:22 | Prestige | disruptek: hi carl |
02:56:13 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:57:56 | * | a_chou joined #nim |
03:01:43 | FromDiscord | <UNIcodeX> "Then there's me. My name is Earl." |
03:07:28 | FromDiscord | <iWonderAboutTuatara> woooah discord is havintg issues |
03:07:30 | FromDiscord | <iWonderAboutTuatara> godot server went down |
03:21:23 | disruptek | what? 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:54 | FromDiscord | <Zachary Carter> why does twitch suck balls? |
04:21:12 | * | a_chou quit (Quit: a_chou) |
04:24:11 | FromDiscord | <Zachary Carter> I just want to streammmmm |
04:38:26 | FromDiscord | <Rika> youtube has streaming if you dont mind using youtube |
04:39:29 | FromDiscord | <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:48 | FromDiscord | <PizzaFox> how expensive of an operation is https://nim-lang.org/docs/os.html#setLastModificationTime%2Cstring%2C |
06:05:05 | FromDiscord | <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:29 | FromDiscord | <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:55 | ForumUpdaterBot | New 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:43 | FromDiscord | <PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2y5r |
06:44:52 | FromDiscord | <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:45 | FromDiscord | <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:51 | FromDiscord | <hobbledehoy> it compiles for me |
09:57:37 | FromDiscord | <Recruit_main707> it also does for me in playground |
09:59:53 | FromDiscord | <Recruit_main707> are you messing around with 32/64bit compilation or something else? |
10:02:40 | FromDiscord | <Recruit_main707> @Julek ^ |
10:03:36 | FromDiscord | <Julek> just did `nim.exe c gc.nim` |
10:05:53 | FromDiscord | <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:41 | FromDiscord | <alehander42> clyybber |
10:09:46 | FromDiscord | <alehander42> i'd say yes |
10:09:55 | FromDiscord | <alehander42> `For a hypothetical int not 1` |
10:10:17 | FromDiscord | <alehander42> but i'll have to generalize it: i want to, for enums and eventually cases like this |
10:10:23 | FromDiscord | <Recruit_main707> did you run finish.exe when installing nim? |
10:10:32 | FromDiscord | <alehander42> but it's important to mostly work on the pointer stuff for now |
10:10:33 | FromDiscord | <Julek> haven't installed it at all |
10:10:43 | FromDiscord | <Julek> thought it's portable |
10:10:52 | FromDiscord | <alehander42> as the other stuff might be based on z3 (even tho i think it can be also based on this one) |
10:11:04 | FromDiscord | <alehander42> tl;dr it would be cool to show a branch where this works to compare with z3 |
10:11:18 | FromDiscord | <alehander42> but the goal for now is only nil stuff |
10:11:28 | FromDiscord | <Recruit_main707> wdym you havent installed it |
10:11:44 | FromDiscord | <Julek> downloaded the .zip extracted thats all |
10:11:49 | FromDiscord | <alehander42> and yeah: the enum stuff would be kinda similar, but for int not 1, you would probably need maths/equations |
10:11:56 | FromDiscord | <Julek> (edit) '.zip extracted' => '.zip, extracted,' |
10:12:00 | FromDiscord | <Recruit_main707> the one from github? |
10:12:00 | FromDiscord | <alehander42> to e.g. know x - 1 => 1 etc |
10:12:01 | FromDiscord | <krisppurg> Might be a dumb question, but what does `{.gcsafe.}` |
10:12:11 | FromDiscord | <alehander42> so maybe z3 might be indeed good to reuse there |
10:12:11 | FromDiscord | <krisppurg> (edit) 'Might be a dumb question, but what does `{.gcsafe.}` ... ' => 'Might be a dumb question, but what does `{.gcsafe.}`do?' |
10:12:16 | FromDiscord | <alehander42> similarly to bound checking |
10:12:16 | FromDiscord | <Julek> > the one from github?↵the one from nim-lang.org |
10:12:29 | FromDiscord | <alehander42> but the important thing is to be able to write that |
10:12:34 | FromDiscord | <Julek> (edit) 'nim-lang.org' => 'https://nim-lang.org/install.html' |
10:13:14 | FromDiscord | <Recruit_main707> https://media.discordapp.net/attachments/371759389889003532/756820187151335424/unknown.png |
10:13:46 | FromDiscord | <Julek> yeah but why is it a .zip |
10:13:55 | FromDiscord | <Julek> like coudn't it be .exe called setup |
10:14:00 | FromDiscord | <Julek> thought it's portable |
10:14:18 | FromDiscord | <ache of head> lmao |
10:14:41 | FromDiscord | <Recruit_main707> well, im not the one that decides how the installation process is goes so idk |
10:14:55 | FromDiscord | <Julek> ||no bardzo smieszne|| |
10:15:00 | FromDiscord | <ache of head> ups |
10:15:14 | * | natrys joined #nim |
10:15:23 | FromDiscord | <ache of head> you can always just go with chooseni |
10:15:24 | FromDiscord | <ache of head> (edit) 'chooseni' => 'choosenim' |
10:15:32 | FromDiscord | <ache of head> https://github.com/dom96/choosenim/releases |
10:15:35 | FromDiscord | <Recruit_main707> choosenim is 32bit only though |
10:15:43 | FromDiscord | <ache of head> wait, what? |
10:15:52 | FromDiscord | <ache of head> it works for me and i'm on 64 |
10:15:59 | FromDiscord | <Recruit_main707> but the nim version is 32bit |
10:16:06 | FromDiscord | <ache of head> 😳 |
10:16:08 | FromDiscord | <Recruit_main707> thats what i meant |
10:16:31 | FromDiscord | <ache of head> didn't know that at all |
10:17:02 | FromDiscord | <Recruit_main707> im pretty sure, make sure and do nim --version though |
10:17:21 | FromDiscord | <Recruit_main707> @Julek about your issue, just run `finish.exe` |
10:17:33 | FromDiscord | <Julek> aight |
10:17:34 | FromDiscord | <Recruit_main707> everything should work then |
10:17:50 | FromDiscord | <Julek> it's my gcc than nim doesn't like |
10:18:25 | FromDiscord | <ache of head> https://pastebin.com/CyZ2rU32 |
10:18:32 | FromDiscord | <ache of head> output of nim --version |
10:18:40 | FromDiscord | <Recruit_main707> it will install mingw if they disagree with the existing gcc installations, |
10:18:48 | FromDiscord | <Julek> btw can I somehow emit C |
10:18:55 | FromDiscord | <Julek> not just binary |
10:19:03 | FromDiscord | <Recruit_main707> you *can* |
10:19:09 | FromDiscord | <Recruit_main707> but the code is rather ugly |
10:20:13 | FromDiscord | <Recruit_main707> if you add `--nimcache:cache` in the compiler options you can see the intermediate c code |
10:20:32 | FromDiscord | <Recruit_main707> (it will be in a new directory called cache) |
10:20:33 | FromDiscord | <Gary M> Is there anyone around that can help me figure out socket communication with nimsuggest? |
10:21:18 | FromDiscord | <Recruit_main707> @ache of head hmm, maybe choosenim now has 64 bit installations too |
10:21:43 | FromDiscord | <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:44 | FromDiscord | <ache of head> hmmm |
10:22:16 | FromDiscord | <Rika> @krisppurg depends on what context the pragma is in |
10:22:50 | FromDiscord | <Recruit_main707> @dom96 does choosenim have 64bit nim installations now? |
10:23:14 | FromDiscord | <dom96> yes |
10:23:23 | FromDiscord | <Recruit_main707> thats nice |
10:24:09 | FromDiscord | <krisppurg> For example `{.async.}` |
10:24:20 | FromDiscord | <ache of head> hmmmm |
10:24:21 | FromDiscord | <krisppurg> @Rika |
10:24:29 | FromDiscord | <ache of head> so the one i have in PATH is the one from choosenim |
10:24:48 | FromDiscord | <ache of head> as in from `~/.nimble/bin` |
10:25:20 | FromDiscord | <Rika> @krisppurg i mean if its put on a proc or a proc type decl |
10:25:44 | FromDiscord | <Rika> like proc xx() {.gcsafe.} versus let a: proc() {.gcsafe.} |
10:26:12 | FromDiscord | <krisppurg> hold on |
10:27:39 | FromDiscord | <Julek> anyone knows where/if nim compiler generates the C files before they are compiled with GCC for example? |
10:28:18 | FromDiscord | <Rika> ~/.cache/nim or ~/.nimcache i dont know anymore |
10:28:19 | disbot | no footnotes for `/.cache/nim`. 🙁 |
10:29:11 | FromDiscord | <Julek> and those folders are located where? |
10:29:42 | FromDiscord | <Rika> thats the path |
10:29:57 | FromDiscord | <Rika> unless windows, in which case i dont got a damn clue 😛 |
10:30:09 | FromDiscord | <Julek> yeah I'm on win |
10:34:34 | FromDiscord | <Recruit_main707> gimme a sec |
10:35:07 | FromDiscord | <Recruit_main707> `C:\Users\[username]\nimcache` |
10:37:55 | FromDiscord | <Julek> oh right |
10:38:11 | FromDiscord | <Julek> I was looking in `%temp%` |
10:38:27 | FromDiscord | <lqdev> i think nimble's having a mild stroke https://media.discordapp.net/attachments/371759389889003532/756826532277780520/unknown.png |
10:39:56 | FromDiscord | <Rika> nah just terminals being fucky |
10:46:39 | FromDiscord | <Clyybber> I don't see anything abnormal |
10:46:48 | FromDiscord | <Clyybber> oh nvrmnd |
10:50:38 | * | krux02 quit (Remote host closed the connection) |
10:55:26 | * | abm joined #nim |
11:03:16 | FromDiscord | <lqdev> @Rika well i _did_ update alacritty recently so there's that |
11:07:34 | FromDiscord | <krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=2y6s |
11:07:39 | FromDiscord | <Rika> "how dare you use a program in another language!" |
11:07:58 | FromDiscord | <Rika> @krisppurg marks the proc as "gc safe" forcefully |
11:08:26 | FromDiscord | <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:36 | FromDiscord | <hobbledehoy> means you can't access global variables isn't it? |
11:10:00 | FromDiscord | <krisppurg> ahhh I get it. |
11:10:21 | FromDiscord | <krisppurg> been getting those in nim v1.2.6 |
11:11:55 | FromDiscord | <dom96> You should be able to disable threads and not worry about these |
11:12:13 | FromDiscord | <dom96> although the nim compiler might now be enforcing it all the time |
11:12:27 | FromDiscord | <dom96> --threadAnalysis:off can also help |
11:13:09 | FromDiscord | <krisppurg> alright |
11:13:21 | FromDiscord | <krisppurg> I'll try to either keep in mind about that |
11:14:41 | FromDiscord | <dom96> another thing you can do if you want threading support is use {.threadvar.} |
11:15:18 | FromDiscord | <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:53 | FromDiscord | <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:18 | FromDiscord | <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:05 | FromDiscord | <lqdev> is it possible to change the JSON field name when using `json.to`? |
13:24:45 | * | krux02 joined #nim |
13:45:08 | FromDiscord | <alehander42> oi |
13:45:38 | FromDiscord | <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:49 | FromDiscord | <lqdev> it's `type` vs `kind` |
13:45:55 | FromDiscord | <Yardanico> Ah, no |
13:46:08 | FromDiscord | <Yardanico> I had to modify json macros because of that |
13:46:12 | FromDiscord | <Yardanico> To add custom pragmas |
13:46:19 | FromDiscord | <Yardanico> You can also take a look at json serialisation |
13:46:26 | FromDiscord | <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:31 | FromDiscord | <Yardanico> https://github.com/status-im/nim-json-serialization/ |
13:46:52 | FromDiscord | <Yardanico> This library supports a lot of stuff like changing field names |
13:46:54 | FromDiscord | <lqdev> i know that one but it seems to pull in a bunch of dependencies like chronos and crypto |
13:46:56 | FromDiscord | <Vindaar> yeah, that's ^ probably a better idea |
13:46:57 | FromDiscord | <lqdev> which is bloat. |
13:47:08 | FromDiscord | <Vindaar> there was a json library by |
13:47:18 | FromDiscord | <Yardanico> It's archived |
13:47:20 | FromDiscord | <Vindaar> * LemonBoy |
13:47:23 | FromDiscord | <lqdev> DCE is not an excuse, compile times will still be hindered |
13:47:57 | FromDiscord | <Yardanico> @lqdev well, you can also do it yourself, and start by checking some of my stuff |
13:48:04 | FromDiscord | <lqdev> lol during a game jam |
13:48:18 | FromDiscord | <Yardanico> https://github.com/Yardanico/telenim/blob/master/src/telenim/json_custom.nim |
13:48:34 | FromDiscord | <Yardanico> Usage at the bottom |
13:48:57 | FromDiscord | <Yardanico> It's mostly copy paste from the JSON module |
13:48:58 | FromDiscord | <Vindaar> what I meant: https://github.com/LemonBoy/jstin |
13:49:03 | FromDiscord | <Yardanico> And the custom pragma pr |
13:49:12 | FromDiscord | <Yardanico> @Vindaar yeah i know about that one |
13:49:18 | FromDiscord | <Clyybber> Its my fault in the end :p |
13:49:25 | FromDiscord | <Vindaar> but maybe @lqdev does not 😉 |
13:49:31 | FromDiscord | <Yardanico> Heh |
13:49:32 | FromDiscord | <Clyybber> because I didn't finish the custom pragma pr |
13:49:41 | FromDiscord | <Vindaar> shame on you! 😄 |
13:49:48 | FromDiscord | <lqdev> yeah just gonna use json.to |
13:49:50 | FromDiscord | <lqdev> it'll be easier |
13:49:54 | FromDiscord | <lqdev> to just strop the ident |
13:50:06 | FromDiscord | <alehander42> i dont like that |
13:50:09 | FromDiscord | <Clyybber> wait I can delegate the shame on krux who didn't finish it first |
13:50:21 | FromDiscord | <alehander42> ok, nevermind, i was going to discuss lib choices |
13:50:30 | FromDiscord | <alehander42> let me focus on my unfinished code 😄 |
13:51:50 | Yardanico | rip irc, more and more people start using discord :( |
13:51:59 | Yardanico | there are periods now when there is 0 messages from IRC for hours |
13:52:49 | FromDiscord | <Vindaar> sorry 😐 IRC is the one CLI tool I'm too lazy to use (yeah I know there's GUI clients) |
13:53:00 | Yardanico | I use quassel |
13:53:04 | Yardanico | I have quassel server on my VPS |
13:53:33 | FromDiscord | <alehander42> hm, should i support addr in the alias analysis |
13:53:34 | FromDiscord | <Vindaar> a friend of mine does the same. I've been thinking about doing that, but in the end I never do.. |
13:54:12 | Zevv | no 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:16 | FromDiscord | <Vindaar> the thing for me is that I like to keep distracting stuff in my browser (all the good that does, sigh) |
13:54:23 | FromDiscord | <Clyybber> @alehander42 You mean taking an address of a ref and modifying it via the addr? |
13:54:24 | Zevv | oh no, I'm mistaking. I prefera console IRC client |
13:54:42 | FromDiscord | <alehander42> yes @Clyybber |
13:55:04 | FromDiscord | <Clyybber> Hmm, not necesaarily. I'm not sure |
13:55:39 | FromDiscord | <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:48 | FromDiscord | <Clyybber> IMO it would also be acceptable to process addr pessimistically |
13:55:56 | FromDiscord | <Clyybber> making it always violate not nil |
13:57:53 | FromDiscord | <alehander42> @Clyybber but how would this look |
13:58:16 | FromDiscord | <alehander42> i mean yeah |
13:58:37 | FromDiscord | <alehander42> you can just assume every usage after it is potentially problematic |
13:58:52 | FromDiscord | <alehander42> but that would be a bit rough |
13:59:15 | FromDiscord | <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:47 | FromDiscord | <flywind> I use `gcsafe` to make program compile with `threads:on`, is it dangerous? |
15:11:56 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2y7r |
15:12:02 | Yardanico | yes |
15:12:06 | Yardanico | it can be dangerous |
15:12:24 | Yardanico | with that you basically say to the compiler "I know what i'm doing" |
15:12:39 | Yardanico | "i'm sure myself that it's gcsafe, so shut up" :D |
15:12:45 | FromDiscord | <flywind> But I also annotate `redisClient` as `threadvar`. |
15:13:01 | Yardanico | but is hGetAll threadsafe? |
15:13:13 | Yardanico | also async libs themselves are often not gcsafe either |
15:13:17 | Yardanico | i mean nim async libs |
15:14:00 | supakeen | я не async |
15:14:14 | FromDiscord | <lqdev> R He async |
15:14:44 | supakeen | I have learned about 3 words of Russian the past week and now I shall use them *everywhere*. |
15:15:05 | Yardanico | no |
15:15:20 | Yardanico | otherwise I'll stop speaking english in this channel |
15:15:24 | Yardanico | :DDD |
15:15:57 | Yardanico | and I'm not understand what did you mean by "I'm not async" |
15:16:00 | Yardanico | i * |
15:16:22 | FromDiscord | <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:44 | Yardanico | well, you can check if hGetAll is really gcsafe by annotating it as gcsafe |
15:16:49 | Yardanico | adding that pragmat to that proc/func |
15:16:59 | Yardanico | and see if the compiler says that it's not gcsafe |
15:17:34 | FromDiscord | <flywind> Ok, thanks! |
15:19:03 | supakeen | Yardanico: My Russian has not yet progressed to where it makes sense :) |
15:21:29 | FromDiscord | <flywind> I mark all functions that `hGetAll` calls, it now compiles too. |
15:22:31 | FromDiscord | <flywind> Should all async functions be marked `gcsafe`? |
15:22:37 | Yardanico | well, idk |
15:23:34 | FromDiscord | <flywind> https://github.com/nim-lang/redis/blob/master/src/redis.nim |
15:24:17 | FromDiscord | <flywind> It is hard to make `async` work with threads when reusing a database connection. |
15:26:31 | FromDiscord | <flywind> This issue seems very common. |
15:26:31 | FromDiscord | <flywind> https://github.com/FedericoCeratto/nim-httpauth/issues/22 |
15:26:33 | disbot | ➥ Not GC-safe for threading ; snippet at 12https://play.nim-lang.org/#ix=2y7w |
15:26:48 | Yardanico | well, it's an issue because nim's async by default assumes one global dispatcher :) |
15:26:55 | Yardanico | and a lot of libs assume having a single thread too |
15:27:07 | Yardanico | there was an RFC about making --threads:on default, maybe we'll get that in nim 2.0 :P |
15:30:03 | FromDiscord | <lqdev> whyyyyy |
15:30:07 | FromDiscord | <flywind> Yea, I find a RFC for `gcsafe` |
15:30:09 | FromDiscord | <lqdev> why not 1.4 |
15:30:09 | FromDiscord | <flywind> https://github.com/nim-lang/RFCs/issues/142 |
15:30:11 | disbot | ➥ Proposal to remove the `.gcsafe` effect from Nim ; snippet at 12https://play.nim-lang.org/#ix=26qX |
15:30:43 | FromDiscord | <lqdev> why are threads considered unstable enough to be behind a switch? |
15:34:11 | Araq | they are not unstable but people cannot use them properly |
15:34:28 | FromDiscord | <lqdev> wdym? |
15:36:14 | Araq | global variables without locking, sharing thread local memory, deadlocks and data races |
15:36:28 | Yardanico | @lqdev that rfc about making --threads:on the default was actually proposed a few years ago |
15:36:45 | Yardanico | https://github.com/nim-lang/Nim/issues/9878 |
15:36:45 | disbot | ➥ [RFC] switch threads to on by default |
15:37:49 | Araq | btw for async ORC I get about 90% of the performance that MarkAndSweep gives me |
15:37:58 | Yardanico | yay |
15:38:05 | Araq | 80% with -d:useMalloc |
15:38:12 | Yardanico | oh, I thought it'd be slower |
15:38:14 | Yardanico | with -d:useMalloc |
15:38:29 | Araq | so we lose 20% but allow for sharing the heap |
15:38:42 | Araq | which means we can use all the N cores finally |
15:39:19 | Araq | sounds like a very nice deal |
15:39:20 | disruptek | N cores are my favorite flavor of core. |
15:39:25 | Yardanico | good morning |
15:39:50 | Araq | now 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:01 | Araq | an async implementation that doesn't overload my brain with callbacks and hidden state would be sweet |
15:42:29 | Araq | I heard CPS is ready now... :P |
15:44:30 | * | abm joined #nim |
15:44:34 | Yardanico | btw, we got 46 more people on the discord server since that tweet about it becoming verified |
15:44:40 | Yardanico | but most of them are inactive as usual :( |
15:46:07 | Yardanico | I wonder if I should bother with making more IRC channels to bridge our new discord channels |
15:46:10 | Yardanico | like we got #science on discord |
15:46:16 | Yardanico | we also have #nimble there |
15:54:56 | disruptek | i believe we call that a tar pit. |
15:55:13 | disruptek | cps is waiting for arc fixes, among others. |
15:55:30 | Yardanico | what arc fixes? |
15:57:05 | Yardanico | https://forum.nim-lang.org/t/6766 thread is becoming fun |
15:57:24 | Yardanico | over a hundred posts in a week in a single thread, wow |
15:57:24 | Araq | moderate it |
15:57:46 | Yardanico | I'm not a moderator and there is still some good discussion there :P |
15:58:26 | Araq | haven't read it |
15:58:52 | disruptek | !repo cps |
15:58:53 | disbot | https://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 35⭐ 1🍴 |
15:59:17 | disruptek | see the issues section. |
15:59:58 | Yardanico | well, the issue isn't very descriptive :) |
16:00:49 | Yardanico | and tests work for me with arc |
16:00:53 | Yardanico | on latest devel |
16:01:02 | Yardanico | or maybe that's wrong cps |
16:02:06 | * | narimiran joined #nim |
16:03:01 | Yardanico | taste.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:03 | Yardanico | disruptek: ^ |
16:03:17 | Yardanico | taste test output was "## 26 tests 🟢1 ❔5 ⛔20" but i'm not sure what is that supposed to mean |
16:03:22 | Araq | Yardanico: you're now a moderator |
16:03:30 | Yardanico | wow, okay |
16:03:50 | * | Tanger quit (Remote host closed the connection) |
16:05:40 | Araq | now go forth -- unleash the tides of doom -- upon all who would oppose us |
16:06:52 | Zevv | everything 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:54 | Yardanico | lol |
16:10:55 | Araq | https://www.youtube.com/watch?v=r5EXKDlf44M |
16:11:49 | Zevv | I find the tone is getting more and more toxic on the forum |
16:12:05 | Zevv | i'm not sure if there is deliberate trolling going on |
16:12:09 | Yardanico | because more and more people discover it :) |
16:12:23 | Yardanico | but yeah, that forum thread has 114 replies |
16:13:44 | disruptek | my kinda place. |
16:14:18 | disruptek | zevv: can you see if arc is still demonstrably broken in cps? |
16:14:30 | FromDiscord | <alehander42> oi |
16:14:36 | Yardanico | hola |
16:15:11 | FromDiscord | <alehander42> wow you're blue! |
16:15:25 | Yardanico | yes I am |
16:15:27 | Yardanico | blame robohash |
16:15:30 | FromDiscord | <alehander42> careful before Araq add additional color to the gc |
16:15:36 | FromDiscord | <alehander42> what is robohash |
16:15:48 | Yardanico | one of the algorithms available on gravatar for generating user avatars |
16:16:01 | Yardanico | 4raq's generated avatar is orange which is a nice coincidence |
16:16:30 | Yardanico | without avatars it would be harder to distinguish between different irc users from discord |
16:16:43 | Yardanico | https://robohash.org/ |
16:16:44 | * | Jjp137 joined #nim |
16:17:04 | Yardanico | enter your nickname (or mine), and you'll get the same avatar as the one used by the bridge |
16:17:07 | Yardanico | for your nickname |
16:17:14 | Yardanico | or not |
16:17:26 | Yardanico | seems like not, lol |
16:17:43 | Yardanico | anyway, sorry for spamming, time to go dig some more arc bugs |
16:17:47 | * | narimiran quit (Ping timeout: 240 seconds) |
16:18:03 | disruptek | zevv: i dunno how we've managed to distinguish each other all these years without avatars. |
16:18:23 | Yardanico | disruptek: well, discord is discord :P |
16:18:31 | Yardanico | people are used to having colourful avatars and stuff |
16:18:38 | FromDiscord | <alehander42> i am surprised |
16:18:41 | FromDiscord | <alehander42> by the faces |
16:19:23 | Yardanico | !last FromGitter |
16:19:24 | disbot | FromGitter joined 12#nim-offtopic 3 weeks ago and last spoke 73 weeks ago |
16:19:28 | Yardanico | really |
16:19:34 | Yardanico | no people speaking from gitter in 3 weeks? |
16:19:40 | Yardanico | or disbot is lying |
16:20:11 | Zevv | disruptek: 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:13 | FromDiscord | <alehander42> i did speak these days iirc |
16:20:14 | disruptek | i doubt the bridge says much. |
16:20:38 | Yardanico | !last FromDiscord |
16:20:38 | disbot | FromDiscord joined 12#nim-news 22 hours ago and last spoke 75 weeks ago |
16:20:44 | FromDiscord | <alehander42> disruptek do you like alloca |
16:21:56 | disruptek | like it how? |
16:22:01 | disruptek | on toast? |
16:22:15 | disruptek | with a little tartar sauce? |
16:22:41 | disruptek | raw and chilled on a bed of ice? |
16:23:06 | Zevv | my stack is bigger then yours |
16:23:07 | disruptek | skewered through the asshole by a wooden stick? |
16:23:58 | FromDiscord | <alehander42> toast |
16:24:01 | FromDiscord | <alehander42> sounded good |
16:24:01 | disruptek | cut into strips and dunked in molten cheese. now you're talkin'. |
16:24:05 | FromDiscord | <alehander42> after this things got bad |
16:24:13 | FromDiscord | <alehander42> oh man are you hungry |
16:24:17 | FromDiscord | <alehander42> i got hungry now |
16:24:59 | disruptek | when i was in vermont i was near some workd-famous foodstuffs. |
16:25:24 | disruptek | hill farmstead brewery, zevv, and jasper hill cheese. |
16:25:39 | FromDiscord | <alehander42> sound good dude |
16:27:56 | FromDiscord | <alehander42> ok so {aliasA, a} -> start with {aliasA} {a} and copy |
16:30:36 | disruptek | this is a helluva story you got going here. |
16:30:44 | FromDiscord | <alehander42> dude |
16:30:46 | FromDiscord | <alehander42> this is the plan |
16:30:52 | FromDiscord | <alehander42> but i am trying to ignore some cases |
16:30:58 | FromDiscord | <alehander42> first and this is not always easy |
16:31:19 | disruptek | the best stories always leave something out. |
16:31:25 | FromDiscord | <alehander42> yeah |
16:31:34 | FromDiscord | <alehander42> like your story about food |
16:31:37 | FromDiscord | <alehander42> leaving ice cream |
16:32:51 | FromDiscord | <krisppurg> whats the difference between runForever and poll? |
16:33:18 | disruptek | only one runs forever. |
16:33:31 | Zevv | the other one merely poll |
16:33:43 | Zevv | but beware, "forever" does not last |
16:33:46 | Yardanico | runForever runs poll internallyt |
16:34:30 | FromDiscord | <alehander42> ok my test |
16:34:45 | FromDiscord | <alehander42> function gets the correct warning but |
16:35:04 | FromDiscord | <alehander42> i still have to implement the actual logic |
16:35:10 | FromDiscord | <alehander42> currently is just being pessimistic |
16:35:28 | * | StevePerkins joined #nim |
16:36:23 | Zevv | so many promises, but disillusion is impeding. when no one needs timers or sockets, "forever" will prove to be relative, like teenage love |
16:37:20 | FromDiscord | <alehander42> zevv |
16:37:23 | FromDiscord | <alehander42> stop this |
16:37:28 | FromDiscord | <alehander42> before you wrote a poetry book |
16:37:33 | Zevv | I will climb over mountains, swim the widest oceans, i will do everything. |
16:37:34 | FromDiscord | <alehander42> and went into the art industry |
16:37:36 | Zevv | but not when it rains |
16:38:15 | FromDiscord | <alehander42> raining is part of life |
16:38:31 | FromDiscord | <alehander42> OPEN YOUR ARMS AND WELCOME! |
16:39:42 | * | StevePerkins quit (Client Quit) |
16:40:07 | Zevv | runForever (unless) |
16:40:09 | * | rockcavera quit (Remote host closed the connection) |
16:40:29 | disruptek | all i heard was teenage love sockets. |
16:40:31 | Yardanico | unless ?!😳 |
16:41:20 | Zevv | runForever will throw up on you if you don't feed it |
16:41:44 | Yardanico | not sure why |
16:41:44 | Zevv | its like a tinder dinnerleech |
16:41:53 | Yardanico | but you reminded me of C+equality "programming language" |
16:42:06 | FromDiscord | <alehander42> is it possible to |
16:42:13 | FromDiscord | <alehander42> write a(b: int, c: int = b) |
16:42:24 | Zevv | you just did |
16:42:26 | FromDiscord | <alehander42> like, having aliases directly in args |
16:42:32 | Zevv | and I recently heard it actually is |
16:42:34 | FromDiscord | <alehander42> but is it possible to pass them to the compiler |
16:42:37 | Zevv | I was flabbergasted |
16:42:39 | FromDiscord | <alehander42> and the compilr to say dude |
16:42:42 | Yardanico | yeah it's possible |
16:42:43 | FromDiscord | <alehander42> cool |
16:42:44 | Zevv | also I heard its flaky |
16:42:48 | Yardanico | it was fixed I think |
16:42:48 | FromDiscord | <alehander42> huh huh |
16:42:54 | Yardanico | you can do crazier stuff |
16:43:02 | FromDiscord | <alehander42> does it happen on callsite tiem |
16:43:03 | Yardanico | like proc test(a: string, b = len(a)) |
16:43:05 | FromDiscord | <alehander42> (edit) 'tiem' => 'time' |
16:43:14 | disruptek | it's not flakey. |
16:43:15 | FromDiscord | <alehander42> i mean, obviously it does but |
16:43:15 | Zevv | but please dont. we do not need more crazynes in this world |
16:43:19 | FromDiscord | <alehander42> in python it does on decl |
16:43:21 | Yardanico | Zevv: it's been documented |
16:43:24 | FromDiscord | <alehander42> i dont |
16:43:25 | Yardanico | lemme find the PR or something |
16:43:27 | FromDiscord | <alehander42> but i support it |
16:43:31 | FromDiscord | <alehander42> i need to support it |
16:43:33 | disruptek | it's behavior is consistently undefined. |
16:43:41 | Zevv | oh I'm wrong then. I think I heard it sometimes works but sometimes it doesnt |
16:43:42 | FromDiscord | <alehander42> because then if a.isNil: affects aliasA |
16:43:53 | FromDiscord | <alehander42> in proc b(a: A, aliasA: A = a) |
16:43:53 | Yardanico | ah right there was https://github.com/nim-lang/Nim/pull/15270 |
16:43:54 | disbot | ➥ Expand hoisted default params in sem |
16:43:57 | Yardanico | which fixed some of its issues |
16:43:57 | FromDiscord | <alehander42> sometimes |
16:44:04 | FromDiscord | <alehander42> but not always |
16:44:15 | Zevv | "hoisted default params" |
16:44:28 | FromDiscord | <alehander42> but .. maybe this doesnt matter |
16:44:29 | Yardanico | :P |
16:44:31 | Zevv | I would really have no clue what that would mean from that name |
16:44:33 | FromDiscord | <alehander42> because that's possible anyway |
16:44:41 | Yardanico | actually I don't know if it's documented |
16:44:56 | FromDiscord | <alehander42> such an interesting problem |
16:45:03 | FromDiscord | <alehander42> i guess i shouldn't assume anything different |
16:45:05 | FromDiscord | <alehander42> that normal args |
16:45:24 | FromDiscord | <alehander42> because they can be aliased in the callsite anyway |
16:45:48 | FromDiscord | <alehander42> so the default case should be just all separate for now |
16:48:11 | FromDiscord | <alehander42> ok thanks |
16:50:01 | Zevv | sometimes 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:38 | FromDiscord | <alehander42> just love them |
16:50:47 | Zevv | I started my own stdlib. |
16:51:06 | * | a_chou joined #nim |
16:51:06 | Yardanico | you want to repeat D's stdlib history? :P |
16:51:21 | FromDiscord | <alehander42> noo |
16:51:31 | Zevv | import posix, and all is well |
16:51:49 | * | Zevv is home again |
16:52:37 | Yardanico | added 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:46 | Yardanico | stupid page, I know, but its fun :P |
16:53:10 | Prestige | Yardanico: neat page |
16:53:22 | Yardanico | you can extend it if you know something else |
16:53:26 | Yardanico | which can be considered not widely known |
16:53:42 | Zevv | does it talk about abusing tuples for multiple assignment? |
16:53:52 | Zevv | (a, b) = (10, 20) |
16:53:59 | FromDiscord | <alehander42> i think this is common in python |
16:54:04 | Yardanico | no, I thought that this would be common knowledge :P |
16:54:13 | Zevv | fair enough |
16:54:26 | Yardanico | Zevv: you know you can do var a, b, c = 30 |
16:54:26 | Yardanico | right? |
16:54:36 | Yardanico | just curious |
16:55:11 | Zevv | yeah but not 10, 20, 30 |
16:55:56 | Zevv | I 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:11 | Zevv | wow three it is |
16:58:43 | disruptek | can you assign a var tuple in a params list? |
16:59:05 | Zevv | or use tuples for hoisted arguments? |
16:59:24 | Zevv | "hoisted default arguments" |
16:59:29 | disruptek | tuples, sure, but i mean deconstruction. |
16:59:49 | Zevv | after all these decades I still can not tell a declaration from a definition, let alone tell a hoisted default argument |
17:00:03 | Zevv | i have so no clue |
17:00:46 | disruptek | of course you can. otherwise, we wouldn't be having this conversation. |
17:00:55 | Yardanico | so, 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:01 | Yardanico | join 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:45 | Zevv | so embedded, that would be pmunch and who? |
17:03:55 | disruptek | you. |
17:04:16 | FromDiscord | <alehander42> embedDad |
17:05:27 | Yardanico | embedDat |
17:06:06 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/756924089771229335/unknown.png |
17:06:52 | FromDiscord | <Yardanico> #nim-test is mine, created for testing the bridge |
17:07:13 | * | audiofile quit (Ping timeout: 260 seconds) |
17:10:53 | FromDiscord | <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:52 | FromDiscord | <Avatarfighter> LMAO |
17:26:08 | FromDiscord | <Avatarfighter> Yall really just said "pmunch and who" |
17:26:18 | Yardanico | well, he just asked |
17:26:30 | Yardanico | disruptek isn't interested in embedded anyway if that's what you wanted to imply :) |
17:26:33 | FromDiscord | <Avatarfighter> thats so funny |
17:26:42 | Yardanico | why 🤔 |
17:26:47 | Yardanico | for me it sounded just like "pmunch and who else" |
17:27:15 | FromDiscord | <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:23 | Yardanico | well he's not the only one |
17:27:32 | FromDiscord | <Avatarfighter> i see that now lol |
17:28:52 | FromDiscord | <Avatarfighter> im kind of hyped for today, im going to deploy my scraper on a resource restricted deviced |
17:29:02 | FromDiscord | <Avatarfighter> spent a month bringing my ram usage down and the disk usage |
17:29:58 | FromDiscord | <Avatarfighter> what about you Yardanico? Working on anything fun? |
17:30:02 | Yardanico | not really |
17:32:02 | FromDiscord | <Avatarfighter> Aww darn |
17:39:32 | * | bung quit (Quit: Lost terminal) |
17:40:35 | * | narimiran joined #nim |
17:41:10 | FromDiscord | <lqdev> i'm working on somethin' fun tho |
17:41:37 | FromDiscord | <lqdev> though i was dragged to a family member's birthday |
17:41:49 | FromDiscord | <lqdev> so not working on it right now |
17:41:59 | FromDiscord | <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:45 | FromDiscord | <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:07 | FromDiscord | <Recruit_main707> i wonder if we could despite depending on gcc/clang |
18:21:10 | * | vicfred joined #nim |
18:21:20 | ForumUpdaterBot | New thread by Nhuman: Why does Random give the same value every time?, see https://forum.nim-lang.org/t/6840 |
18:21:29 | Yardanico | hehe |
18:25:20 | Yardanico | @Recruit you're late |
18:25:22 | Yardanico | :P |
18:25:52 | FromDiscord | <Recruit_main707> i didnt type fast enough D: |
18:27:16 | * | nickster quit (Quit: The Lounge - https://thelounge.chat) |
18:27:20 | FromDiscord | <Vindaar> @Yardanico this isn't sarcasm: I like your honestly friendly tone and thoughtful responses to that guy 🙂 |
18:27:42 | FromDiscord | <Yardanico> Well, they're a newbie |
18:27:56 | FromDiscord | <Yardanico> And i just happen to have some free time |
18:27:57 | FromDiscord | <Vindaar> *I shouln't assume guy I suppose |
18:29:37 | FromDiscord | <Vindaar> But still, it's just not a given and I appreciate it. We are _on the internet_ after all 😅 |
18:30:33 | Yardanico | well I try to behave in environments like this :P |
18:32:26 | FromDiscord | <Vindaar> haha |
18:33:59 | * | nickster joined #nim |
18:37:40 | Yardanico | there are some telegram chats where I can be *not so polite* :D |
18:37:44 | Yardanico | but that's a secret |
18:42:25 | FromDiscord | <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:38 | disruptek | zevv: so does cps work with arc now? |
18:47:45 | Yardanico | good night honey badgers |
18:52:39 | FromDiscord | <Recruit_main707> gn |
18:55:57 | * | audiofile joined #nim |
18:56:18 | * | narimiran quit (Quit: leaving) |
19:03:59 | * | thomasross joined #nim |
19:05:10 | FromDiscord | <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:21 | FromDiscord | <nim> coé |
19:20:27 | FromDiscord | <Otter> coé |
19:20:37 | FromDiscord | <nim> o pai chego |
19:21:39 | Zevv | disruptek: easy dude |
19:21:44 | Zevv | i had quite some beers to digest |
19:21:58 | Zevv | talking typed branch, right? |
19:22:20 | Zevv | /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:10 | Prestige | Is 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:22 | Prestige | Afaik the compiler only does a single pass so maybe not |
19:28:09 | solitudesf | https://nim-lang.org/docs/manual.html#scope-rules-code-reordering |
19:28:42 | Prestige | Ooooh thanks |
19:36:30 | * | hnOsmium0001 joined #nim |
20:01:22 | disruptek | zevv: you need semytiped |
20:13:45 | * | krux02 quit (Remote host closed the connection) |
20:16:47 | Zevv | wut |
20:16:54 | Zevv | you're making that up on the fly, right |
20:22:59 | Araq | Prestige: it's "in the works" |
20:24:40 | Zevv | is it |
20:25:13 | Prestige | Araq: thanks, glad to hear it |
20:29:24 | Araq | also the compiler does much more than a single pass :-) |
20:29:50 | Prestige | Oh, I thought I read somewhere that it only does one pass |
20:30:00 | FromDiscord | <Elegant Beef> Comedically i'd love if the next line was "It does 2!" 😄 |
20:30:09 | Prestige | Hah |
20:33:28 | FromDiscord | <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:45 | FromDiscord | <Recruit_main707> something like this in c++ https://play.nim-lang.org/#ix=2y8n |
20:35:35 | Araq | I think so |
20:36:04 | FromDiscord | <Recruit_main707> how, i have never seen something similar done |
20:38:11 | Araq | well 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:04 | disruptek | zevv: no, you need clyybber's on again off again branch: semytiped |
20:44:56 | disruptek | that's the one that gives us sem'd proc params in typed macros. |
20:45:26 | disruptek | the assertion guards agaibst trying to use a nim that lacks this. |
20:46:11 | disruptek | my little palmtop doesn't work, so i'm kinda fucked. |
20:46:21 | Zevv | what's wrong with it |
20:48:33 | Araq | found the ORC leak. or at least one |
20:48:50 | Araq | it's surprising how effective you can debug after a night of sleep |
20:49:03 | Araq | maybe I should sleep even more |
20:50:41 | Zevv | /home/ico/sandbox/prjs/cps/cps/environment.nim(244, 41) Error: node has no type |
20:50:55 | Zevv | Araq: you got kids right? How can you *not* value sleep |
20:51:07 | Zevv | it's all about sleep |
20:51:32 | Araq | I do value sleep but I also value timely new major releases |
20:51:42 | Zevv | I'd go for the sleep |
20:51:46 | Araq | and 1.4 is overdue |
20:54:27 | disruptek | maybe, but it's less important if it has fewer spec changes. |
20:55:28 | Araq | hmm this leak is still super confusing |
20:55:53 | disruptek | zevv: that error is ct but we're looking for the bug that a continuation return zotzes itself out at runtime under arc. |
20:56:07 | FromDiscord | <lqdev> json.to seems to be broken under devel from choosenim |
20:56:20 | FromDiscord | <lqdev> Error: undeclared field: 'nimIdentNormalize' for type system.string [declared in /home/daknus/.choosenim/toolchains/nim-#devel/lib/system.nim(34, 3)] |
20:56:24 | disruptek | i think i left the palmtop on the charger and it ruined its battery like an ifiot. |
20:56:50 | Zevv | oh that's baahd |
20:56:58 | disruptek | why are you using choosenim? |
20:57:09 | Araq | lqdev: report bugs on github |
20:57:19 | Araq | var newList = newSeqOfCap[Callback](newLength) # this leaks memory |
20:57:25 | Araq | ... # later |
20:57:36 | disruptek | gor some reason i thought it had hdmi out and it doesnt so its use is already waning. |
20:57:44 | Araq | fdData.readList = move newList # see? we moved it, how can it leak? |
20:58:46 | Araq | ha! I hear you saying, the leak is reported when the seq is created |
20:59:08 | Araq | and then 'fdData.readList' is never freed afterwards |
20:59:28 | Araq | ok, I'm buying that. how come if I do |
20:59:36 | Araq | fdData.readList = copy newList |
20:59:40 | Araq | the leak is gone? |
20:59:54 | Araq | shouldn't it leak either way?! |
21:00:06 | FromDiscord | <lqdev> Araq: i'm not sure if this is something devel-related or choosenim-related tho |
21:00:21 | FromDiscord | <lqdev> i've had problems with choosenim and the stdlib some time ago |
21:00:31 | FromDiscord | <lqdev> but that was more related to testament |
21:01:19 | Araq | please answer my question. |
21:01:30 | Araq | "shouldn't it leak either way?" |
21:02:03 | FromDiscord | <lqdev> no i was talking about the json.to thing |
21:02:24 | disruptek | it's only a leak because in one case we expect it to be freeable. |
21:02:48 | disruptek | that's my guess. |
21:03:27 | Araq | disruptek: my test program says getOccupiedMem() == 0 after GC_fullcollect |
21:03:34 | disruptek | who reports it as a leak? valgrind? |
21:03:36 | Araq | that's pretty convincing for "yeah, no leak" |
21:03:45 | * | lritter quit (Ping timeout: 240 seconds) |
21:03:49 | Araq | that's my memory manager report |
21:03:59 | Araq | but valgrind agrees too and says no leak |
21:04:20 | Araq | with 'copy' I get no leaks. with 'move' I do. |
21:04:31 | Araq | both tools that I ask agree on this. |
21:04:42 | * | lritter joined #nim |
21:04:56 | disruptek | oh, your numbers and those of valgrind? |
21:05:03 | Araq | yep |
21:05:56 | disruptek | are you sure it should be freed after move? ie the target is oos when you query your stats, right? |
21:06:38 | disruptek | does it show the memory grew despite not leaking? |
21:06:53 | * | Vladar quit (Quit: Leaving) |
21:07:19 | disruptek | i guess zero is hard to misinterpret. |
21:07:53 | Araq | well I checked the produced code, it looks correct and it uses =sink so it frees what was previously in there |
21:08:22 | disruptek | it does that in any case, though. |
21:08:46 | disruptek | i mean, it destroys the target. |
21:14:10 | disruptek | it should destroy it twice (at least) over the course of the problem, right? |
21:16:01 | Araq | right, I run it in a loop |
21:16:21 | Araq | tried 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:18 | Araq | found it |
21:36:30 | FromDiscord | <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:36 | FromDiscord | <XxDiCaprioxX> Any ideas? |
21:36:59 | Araq | database.keys is empty? |
21:38:31 | FromDiscord | <XxDiCaprioxX> Other procs requesting from database work |
21:38:35 | FromDiscord | <XxDiCaprioxX> so it cant be |
21:41:40 | FromDiscord | <XxDiCaprioxX> Maybe because of the way openings is declared? |
21:44:18 | Araq | no |
21:45:23 | FromDiscord | <XxDiCaprioxX> maybe list.len stays 0 even if I add elements? |
21:45:52 | * | natrys quit (Quit: natrys) |
21:46:23 | FromDiscord | <XxDiCaprioxX> ah I mean openings, I changed the name to list |
21:48:16 | Araq | https://github.com/nim-lang/Nim/pull/15370 !!! |
21:48:16 | disbot | ➥ ORC/ARC async progress |
21:48:32 | Araq | orc async is leak-free, apparently. more testing tomorrow |
21:49:50 | FromDiscord | <XxDiCaprioxX> So what does that mean for me |
21:49:57 | FromDiscord | <XxDiCaprioxX> I dont get it |
21:51:56 | disruptek | araq: nice, gj. |
21:52:11 | Araq | it means I can rest easy. I dunno what it means for you. |
21:52:25 | disruptek | lol |
21:55:54 | FromDiscord | <XxDiCaprioxX> I still wonder, why is my sequence's length 0 |
21:57:10 | FromDiscord | <Vindaar> @XxDiCaprioxX I think for us to be able to help you need to show the code before that snippet up there |
22:00:21 | FromDiscord | <XxDiCaprioxX> okay |
22:01:04 | FromDiscord | <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:25 | FromDiscord | <XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2y9w |
22:01:44 | FromDiscord | <XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2y9x |
22:02:03 | FromDiscord | <XxDiCaprioxX> (the length part is new and was an attempted fix but it did not help) |
22:03:58 | FromDiscord | <Vindaar> the code seems a bit convoluted to me, but ok. In what order are those procs now called? |
22:04:32 | FromDiscord | <XxDiCaprioxX> readOpenings is called instantly on runtime |
22:04:37 | FromDiscord | <Vindaar> I assume `readOpenings`, then test a `randomOpening` |
22:04:37 | FromDiscord | <Vindaar> ah |
22:04:38 | FromDiscord | <Vindaar> ok |
22:04:53 | FromDiscord | <XxDiCaprioxX> and randomOpening as you call it per command |
22:06:03 | FromDiscord | <Vindaar> so is the `database` table even populated after a call to `readOpenings`? Does parsing the file `openingPath` work as intended? |
22:06:16 | FromDiscord | <XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2y9y |
22:06:57 | * | krux02 joined #nim |
22:10:25 | FromDiscord | <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:13 | FromDiscord | <XxDiCaprioxX> Hm, thats what I was thinking too |
22:11:26 | FromDiscord | <XxDiCaprioxX> There has to be something problematic with the seq |
22:11:49 | FromDiscord | <XxDiCaprioxX> Maybe I can work around a seq and see if ti works |
22:12:42 | FromDiscord | <Vindaar> I really don't think that's the issue. Please check the content of `dbFile`, `database` and `list` |
22:13:09 | FromDiscord | <Vindaar> one of those isn't correctly being filled. My bet is on the `dbFile` |
22:13:24 | FromDiscord | <XxDiCaprioxX> but I mean my other proc works |
22:13:31 | FromDiscord | <XxDiCaprioxX> thats whats confusing me |
22:26:01 | * | liblq-dev joined #nim |
22:26:09 | * | liblq-dev quit (Client Quit) |
22:26:54 | FromDiscord | <lqdev> krux02: could you respond to (or merge) my nim-glm PR? |
22:27:42 | FromDiscord | <XxDiCaprioxX> Ah maybe because `database.keys` at compile time |
22:28:10 | krux02 | lqdev: ok let me see |
22:30:07 | Prestige | Is 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:10 | krux02 | lqdev: I took a look into your PR and unfortunately I would reject it. |
22:34:21 | krux02 | sorry for the late reply |
22:35:09 | krux02 | the 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:33 | FromDiscord | <XxDiCaprioxX> prestige: just `if index <= array.len-1:` |
22:35:53 | FromDiscord | <Elegant Beef> Well also >=0 |
22:35:59 | Prestige | ^ |
22:36:18 | FromDiscord | <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:21 | krux02 | The radians/degrees functions are also exactly like this part of GLSL and glm tries to bring glsl like programming to Nim. |
22:36:25 | Prestige | that's what I usually do for other langs, was curious if there's something more concise in nim |
22:36:43 | krux02 | lqdev: yes |
22:36:53 | krux02 | or not import glm.radians and glm.degrees. |
22:37:02 | FromDiscord | <lqdev> either one works |
22:37:21 | krux02 | but maybe there is something that can be done after all you should get an error message because of ambiguous overload resolution. |
22:37:29 | krux02 | maybe that situation can be improved. |
22:37:41 | FromDiscord | <Elegant Beef> Prestige here is my suggestion https://play.nim-lang.org/#ix=2y9S |
22:38:02 | Prestige | Yeah I did almost exactly the same thing lol |
22:38:30 | FromDiscord | <Elegant Beef> Probably want to inline it though |
22:39:38 | Prestige | off topic, but I feel like inlining should be a compiler optimization. But yeah, added the pragma |
22:40:26 | stisa[m] | Prestige: I think you should be able to do check `index in a.low..a.high` too |
22:40:40 | Prestige | Yeah that's what I do in my example code |
22:40:56 | Prestige | although I assume there's slightly more overhead |
22:41:14 | stisa[m] | oh yeah, sorry |
22:45:28 | stisa[m] | mmh I'm not sure about overhead, you may want to keep the a.low check instead of >= 0 though |
22:48:18 | stisa[m] | actually nevermind, openarray.low is always 0 right? So no problems there either. Ugh I should go to sleep |
22:50:37 | FromDiscord | <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:21 | disruptek | we are now koching with grease. |
22:53:30 | * | shodan45 quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
22:55:40 | FromDiscord | <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:33 | FromDiscord | <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:50 | FromDiscord | <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:26 | FromDiscord | <Vindaar> haha, hope you enjoyed it 😅 although technically that's more Austrian, no? |
23:00:26 | Prestige | stisa[m]: array.low can be anything, think you can change the range of an array |
23:02:02 | FromDiscord | <Rika> you can change the range yes |
23:02:29 | stisa[m] | Prestige yeah for an array, but I think openarray will always be from 0 |
23:03:44 | * | shodan45 joined #nim |
23:07:08 | FromDiscord | <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:24 | FromDiscord | <Vindaar> oh, you're also German? |
23:13:09 | disruptek | i made it with a german today, too. |
23:49:00 | * | abm quit (Read error: Connection reset by peer) |