<< 24-01-2024 >>

00:23:45FromDiscord<Arkanoid> I reduced the error I'm dealing with to a minimum example. I get an error in VM if I try to echo a closure, and a GCC compiler error if I try to repr it
00:24:23FromDiscord<Arkanoid> @nnsee seems down again (error 500)
00:25:18FromDiscord<Arkanoid> sent a code paste, see https://paste.rs/wRAZr
00:25:37FromDiscord<Elegantbeef> Closures cannot be consts
00:26:18FromDiscord<Arkanoid> yes I know. I've already solved this in the general context, but the error I get from this problem its not up to Nim level
00:27:59FromDiscord<Elegantbeef> It's an established issue that has not been resolved
00:28:26FromDiscord<Elegantbeef> Someone just needs to ensure that the environment is nil at declaration and emit a "const Closure procedures cannot have an environment"
00:29:06FromDiscord<Elegantbeef> Bung was working on it but did not understand how to properly do it
00:29:29FromDiscord<Arkanoid> this one? https://github.com/nim-lang/Nim/issues/20545
00:29:59FromDiscord<Elegantbeef> Well the two PRs
00:30:49FromDiscord<Arkanoid> but why const pass can't have closure? Is it a VM limitation, or I am missing the logic that makes it impossible
00:31:26FromDiscord<Elegantbeef> A closure has GC'd memory having a constant with GC'd memory is just not allowed
00:31:38*raynei joined #nim
00:31:41FromDiscord<Elegantbeef> There is a caveat for `seq` and `string` though
00:32:18FromDiscord<Elegantbeef> What is the runtime implementation of a const closure, can the environment be mutated?
00:32:28FromDiscord<Elegantbeef> It's quite an ambiguous concept
00:33:01FromDiscord<Elegantbeef> It's not too dissimilar to having `ref` being `const`
00:33:38FromDiscord<Arkanoid> got it, const pass can't trace the memory usage of the closure. You'd need to handle memory manually there I guess
00:33:51FromDiscord<Elegantbeef> That's not really the issue
00:35:05FromDiscord<Arkanoid> let me wrap my head around this for a minute then
00:35:16FromDiscord<Arkanoid> thanks for the explanation, as always
00:35:38FromDiscord<Elegantbeef> Gc'd memory being `const` is very much 'what do you expect to happen here, it makes little sense'
00:37:14FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=VyViDLpVBLMN
00:38:11*madprops_ is now known as madprops
00:38:12*madprops quit (Changing host)
00:38:12*madprops joined #nim
00:38:28FromDiscord<Elegantbeef> Though even if Nim had stack allocated closures the premise of a const closure makes little sense as it requires runtime information to be able to use it
00:39:47FromDiscord<Elegantbeef> But maybe I'm silly and a const closure makes sense 😄
00:47:34FromDiscord<leorize> nim does have stack closure to a degree iirc
00:51:52*krux02 quit (Remote host closed the connection)
00:53:28FromDiscord<Elegantbeef> I think the docs allude to that but I do not think there is any implementation of that
00:53:31FromDiscord<Elegantbeef> But I could be wrong
01:05:30FromDiscord<leorize> it's definitely not impossible, at least
01:24:34*raynei quit (Ping timeout: 264 seconds)
01:31:18*antranigv quit (Ping timeout: 260 seconds)
01:37:07*antranigv joined #nim
01:47:03FromDiscord<odinshat> Is Atlas necessary? Is it just Nims way of doing virtualenvs like in Python?
01:49:06FromDiscord<odinshat> Is Atlas like PyVirtualEnv?
01:51:53FromDiscord<leorize> kinda
02:29:56*raynei joined #nim
02:51:52*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
04:19:18FromDiscord<odinshat> To learn Nim I thought I'd dive straight to something immediately useful - a basic Lemmy bot that grabbed news form an RSS feed and posted to Lemmy. Is that something Nim is good/ok for? Or is it like trying to build a web scraper in Assembly? ↵↵It looks like it should be simple....thougts?
04:20:20FromDiscord<4zv4l> it should be simple↵Nim has good libraries for that
04:23:52FromDiscord<4zv4l> I would recommend:↵- fetch rss/post Lemmy: https://github.com/treeform/puppy↵- parse xml: https://github.com/ba0f3/xml.nim
04:25:22FromDiscord<odinshat> Excellent - thank you! \:)
04:33:08FromDiscord<␀ Array 🇵🇸 🍉> if targeting js then using js's fetch would be better no?↵(@4zv4l)
04:45:23*SchweinDeBurg joined #nim
04:46:29FromDiscord<4zv4l> oh I didnt know he's targetting js
04:46:42FromDiscord<4zv4l> (edit) "targetting" => "targeting"
04:48:11FromDiscord<␀ Array 🇵🇸 🍉> idk if he is lol↵(@4zv4l)
05:34:22FromDiscord<srabb> how do i go to #gamedev on matrix
06:02:39FromDiscord<Elegantbeef> #gamedev
06:04:46*raynei quit (Ping timeout: 264 seconds)
06:09:52FromDiscord<varriount> @_araq Come across any interesting CS papers recently?
06:24:07*azimut quit (Ping timeout: 240 seconds)
07:03:25*antranigv quit (Ping timeout: 264 seconds)
07:38:16*advesperacit joined #nim
07:40:04FromDiscord<_araq> hundreds of AI related papers but nothing to bring Nim forward
08:46:03FromDiscord<nnsee> In reply to @Arkanoid "<@961485620075720734> seems down again": interesting
08:46:06FromDiscord<nnsee> will take a look
08:48:04FromDiscord<nnsee> it seems up to me
08:48:17FromDiscord<nnsee> and last errors are from last night before i fixed postgres
08:48:29FromDiscord<nnsee> oh, i think i know what it might be... some threads are nonfunctional
08:48:41FromDiscord<nnsee> there's 32 of them so
08:49:12FromDiscord<Elegantbeef> > some threads are nonfunctional↵> Hey that's Phil's entire view of Nim threading!
08:49:13FromDiscord<Elegantbeef> Damn it
08:49:16FromDiscord<Elegantbeef> Too lazy to fix it live with the shitty joke
08:51:27FromDiscord<nnsee> lmao
09:12:53FromDiscord<Phil> In reply to @Elegantbeef "> some threads are": I say some threads are non-functional?↵I say some thread-constellations leak memory like the traitors they are!
09:13:09FromDiscord<Elegantbeef> Speaking of traitors time to use tratior
09:13:10FromDiscord<Phil> (Notable thread + async)
09:13:14FromDiscord<Elegantbeef> traitor even
09:14:51*khazakar quit (Quit: Connection closed for inactivity)
09:19:12FromDiscord<nnsee> I don't understand how CONNECTION_OK is in scope here https://github.com/treeform/pg/blob/master/src/pg.nim#L31
09:19:34FromDiscord<nnsee> I am also importing db_connector/db_postgres yet that's not defined for me
09:19:50FromDiscord<nnsee> oh, wait, `include`
09:21:08FromDiscord<Elegantbeef> You could also do `import db_postgres{.all.}`
09:21:13FromDiscord<Elegantbeef> Atleast in theory
09:23:54FromDiscord<nnsee> eh i just did `import db_connector/[db_postgres, postgres]`
09:29:20FromDiscord<nnsee> sent a long message, see https://pasty.ee/kTogkIpvABOc
09:31:19FromDiscord<Elegantbeef> `assert` is compiled out in release so ya
09:32:44FromDiscord<nnsee> well yeah but that just means the code proceeds trying to use the connection for db operations even though the connection is bad
09:33:01FromDiscord<nnsee> it should at least try to call `pqreset` on it first
09:34:44FromDiscord<Elegantbeef> I do not know anything about these libraries so yes do the proper thing 😛
09:36:12FromDiscord<nnsee> well I think the PGconn object is passed as a pointer to the postgres C library, which _does_ set that field to `BAD`, so I should be fine?
09:37:52FromDiscord<Elegantbeef> Crickets
09:47:19Amun-Rais there a way for nim doc to include all exports into since doc file and not list exports at the bottom of the page?
09:47:41Amun-RaI don't want to have a single large .nim just bc of the docs
09:48:01Amun-Raand include won't work as I have several include files that import from each other
09:50:25Amun-Raand the import and export list is rather long: https://retro.rocks/tmp/nlibsdl2/
09:51:59FromDiscord<Elegantbeef> I assume with these wrappings you cannot just import specific Nim modules?
09:52:34Amun-Rano
09:53:13Amun-RaI have an include tree that represents original include file structure
09:53:51Amun-Raputting all these types and consts to single file would require specific placement
09:54:08Amun-RaC before A, A before B, etc.
09:55:54Amun-Raplus I have a low lever wrapper that I do not expose to the user, and high level one in separate nim file, I can't include all the types in both; I can join low level with high level into single file tho
09:57:24Amun-RaI think the only way to go with current doc target is to have single nim file with all the types and single nim file with all the procs
09:58:12Amun-Rais it worth it for the sake of doc page to look complete? hmm
09:58:37FromDiscord<Elegantbeef> No
10:02:34Amun-Rayou're right
10:37:35NimEventerNew thread by Solo-Leveler: Nim safety features like Zig & Rust?, see https://forum.nim-lang.org/t/10910
11:02:47NimEventerNew thread by domogled: Import compiler, see https://forum.nim-lang.org/t/10911
12:52:10FromDiscord<takemichihanagaki3129> Guys, I have a question. This may sound dumb, but is ARC/ORC a borrow checker?
12:52:35FromDiscord<takemichihanagaki3129> https://forum.nim-lang.org/t/10910#72675↵Araq said that Nim has a Borrow checker, is he referring to it?
12:53:21FromDiscord<Phil> I mean, it'd be how I'd have described it in a sense.↵Just that instead of blocking your compilation, nim uses it to infer whether to do copies or not
12:53:42FromDiscord<Phil> That's as far as my understanding of it goes at least.
12:54:00FromDiscord<takemichihanagaki3129> Interesting...
12:54:25FromDiscord<Phil> It's the same kind of logic through which you can claim C++ to have a borrow checker though - You just do ref-counting and free when there's no ref's around
12:55:23FromDiscord<takemichihanagaki3129> I always thought it was a separated concern.↵I mean, I don't see people referring to RAII or Swift MM as a borrowing checker.↵That was my confusion.
12:55:35FromDiscord<takemichihanagaki3129> (edit) "concern.↵I" => "concept.↵I"
12:55:50FromDiscord<takemichihanagaki3129> (edit) "Swift" => "Swift's"
12:56:30FromDiscord<Phil> You might want to ask internals about the clearer distinction there.↵Might be the combination of nim inferring copies in some scenarios (to generally make life easier but which will screw you sometimes)
12:56:40FromDiscord<Phil> (edit) "You might want to ask internals about the clearer distinction there.↵Might be the combination of nim inferring copies in some scenarios (to generally make life easier but which will screw you sometimes) ... " added "together with ref-counting"
12:57:53FromDiscord<takemichihanagaki3129> In reply to @isofruit "You might want to": Alright, I'll ask there!
13:05:13FromDiscord<tobin6579> The first 10 people to Invest $50 will earn $750 within 12 hours... Ask me how↵  👇👇👇👇👇👇↵https://t.me/+FGhsj-vpp7dmZDc0
13:05:51FromDiscord<takemichihanagaki3129> In reply to @tobin6579 "The first 10 people": <@&371760044473319454>
13:08:54NimEventerNew thread by AntonioFS: 'can have side effects' error., see https://forum.nim-lang.org/t/10913
13:14:17*jmdaemon quit (Ping timeout: 256 seconds)
13:55:10*azimut joined #nim
14:23:33*fallback quit (Ping timeout: 256 seconds)
14:25:14FromDiscord<luteva> sent a code paste, see https://play.nim-lang.org/#pasty=tEfYiRGMlKVZ
14:35:35PMunchA bit wonky, but this works: `default(MyArray)[0].typeof`
14:46:25FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=kSUyMYErMuWS
15:07:52*raynei joined #nim
15:10:33FromDiscord<fullvaluerider> Those are two different T's
15:21:16*cvoxel joined #nim
15:21:56FromDiscord<odexine> T is an arbitrary name you give to the generic param
15:22:21FromDiscord<odexine> if you replace T with anything else it would work the same
15:22:43FromDiscord<odexine> ah, seems like array does use T in the name
15:22:59FromDiscord<odexine> i assume it's because it's a magic that it doesn't work
15:27:34FromDiscord<demotomohiro> https://nim-lang.org/docs/system.html#array↵`array` has I and T like generics but I guess it actually magic and not generic.
15:45:25*raynei quit (Ping timeout: 264 seconds)
15:53:24*fallback joined #nim
15:55:07*antranigv joined #nim
16:08:22*raynei joined #nim
16:27:25*raynei quit (Ping timeout: 264 seconds)
16:28:55*azimut quit (Ping timeout: 240 seconds)
16:29:19*azimut joined #nim
17:18:45*rockcavera joined #nim
17:47:57NimEventerNew thread by arnetheduck: Chronos 4.0, see https://forum.nim-lang.org/t/10914
17:54:36*azimut quit (Remote host closed the connection)
17:55:11*azimut joined #nim
18:25:29*raynei joined #nim
18:56:17*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
19:31:39*adigitoleo quit (*.net *.split)
19:31:54*adigitoleo joined #nim
19:32:00*adigitoleo quit (Max SendQ exceeded)
19:32:07*adigitoleo joined #nim
19:53:50*krux02 joined #nim
19:56:47FromDiscord<soic> does anyone have issues with nimlangserver in Neovim? I keep getting random "compiler errors" that don't actually exist if I try to compile the program
19:56:53FromDiscord<soic> Matrix.png https://media.discordapp.net/attachments/371759389889003532/1199805038751653988/Matrix.png?ex=65c3e084&is=65b16b84&hm=8797e4c29cf34f532c3cb8f0fb3fd0d22f763c71bd9f2d580e36d0ab892c8bff&
19:56:53FromDiscord<soic> Matrix 2.png https://media.discordapp.net/attachments/371759389889003532/1199805041926733915/Matrix_2.png?ex=65c3e085&is=65b16b85&hm=c0c49455ba5ca31adf0f16f256a61bc2949b42cc681dffcfc8435fb49cc98523&
19:57:11*raynei quit (Ping timeout: 256 seconds)
19:58:29FromDiscord<soic> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1199805015527796877): does anyone have issues with nimlangserver in Neovim? I keep getting completely nonsense "compiler errors" that don't actually exist if I try to compile the program
19:59:01FromDiscord<soic> I obviously tried updating all of my plugins, nimlangserver and restarting neovim but neither of those worked
20:05:23FromDiscord<spacelucy> hey, i'm having some problems installing nimlsp
20:05:36FromDiscord<spacelucy> basically, i run `nimble install nimlsp` and it gives me this
20:06:15FromDiscord<spacelucy> image.png https://media.discordapp.net/attachments/371759389889003532/1199807398177673337/image.png?ex=65c3e2b7&is=65b16db7&hm=dfbc9f0141dfba51fca3f96a318e712c9cad5028896b0c52d9af5244d968d49b&
20:06:15FromDiscord<spacelucy> some issue with nimsuggest i think
20:06:38FromDiscord<spacelucy> but i have nimsuggest installed
20:06:39FromDiscord<spacelucy> image.png https://media.discordapp.net/attachments/371759389889003532/1199807499876966522/image.png?ex=65c3e2cf&is=65b16dcf&hm=3f9a02c52d89d92b9a4eddb77fad0629239ff87da5d4ce77d34d72db925870cf&
20:14:54FromDiscord<soic> I also tried installing nimlsp but gave up and used nimsuggest instead
20:15:30FromDiscord<spacelucy> how?
20:15:44FromDiscord<spacelucy> i'm just trying to remember how to get syntax highlighting working in neovim
20:15:58FromDiscord<spacelucy> i did it before in the past but i can't remember what i did
20:19:39FromDiscord<soic> I installed it using \:Mason in neovim
20:20:05FromDiscord<soic> I would try to help you but I'm not sure about what I did too lmao
20:20:15FromDiscord<spacelucy> lol
20:20:15FromDiscord<spacelucy> its okay
20:20:25FromDiscord<spacelucy> nimlangserver installs with Mason
20:20:30FromDiscord<spacelucy> but nimlsp fails
20:20:56FromDiscord<soic> yeah, same thing for me
20:21:17FromDiscord<spacelucy> image.png https://media.discordapp.net/attachments/371759389889003532/1199811182337462373/image.png?ex=65c3e63d&is=65b1713d&hm=eaf072ba29fb7cf9d1ad28952b4d801c5b24738a6803b8df4fba49a17dd7310c&
20:21:35FromDiscord<soic> oh
20:21:37FromDiscord<soic> I use treesitter
20:23:35FromDiscord<spacelucy> i'll try that
20:38:26FromDiscord<luteva> sent a code paste, see https://play.nim-lang.org/#pasty=QrfjqOHureCR
20:46:31FromDiscord<Elegantbeef> It's not static it's a variable
20:51:03FromDiscord<spacelucy> yay
20:51:09FromDiscord<spacelucy> \:TSInstall nim worked
20:51:40FromDiscord<soic> nice
20:53:04FromDiscord<luteva> i know it is a variabl, yes. but it is in a static block. so i thought that if the compile can calculate the value of 'index' at the time the 'get()' is called, it should be ok, right?
20:53:24FromDiscord<luteva> (edit) "that" => "that:" | "compile" => "compiler"
20:53:58FromDiscord<Elegantbeef> Nope
20:54:09FromDiscord<luteva> 😦
20:54:13FromDiscord<Elegantbeef> Static parameters have to be static static
20:55:40FromDiscord<luteva> ok so there's nothing but using a const for that?
20:55:58FromDiscord<luteva> (which then can't be reset)
20:56:08FromDiscord<Elegantbeef> A const, a literal, a static evaluatable expression, anything static
20:56:50FromDiscord<Elegantbeef> The issue is that `bleh.get` depends on that runtime `int` which means if it is 1 or 0 it changes the `typeof(myTup.get(ind))`
20:57:13FromDiscord<Elegantbeef> Nim is statically typed meaning that expression is just wrong
20:57:42FromDiscord<luteva> ok thx!
20:58:42FromDiscord<Elegantbeef> The only way you can get a tuple's fields using a runtime delimited index is if you have a chain of `if ind == x` or the tuple is homogeneously typed
21:05:19FromDiscord<luteva> ok thanks!
21:15:25*raynei joined #nim
23:02:09*jmdaemon joined #nim
23:23:46*dza quit (Quit: )
23:26:00*dza joined #nim
23:47:11FromDiscord<piman_discriminator_1010> what's a good quick to set up GUI library
23:49:19FromDiscord<Elegantbeef> owlkettle
23:59:46FromDiscord<piman_discriminator_1010> something that doesn't require msys2 or GTK?