02:13:18 | * | mal`` quit (Quit: Leaving) |
02:42:04 | * | mal`` joined #nim |
03:36:09 | * | alexdaguy joined #nim |
05:54:36 | * | mahlon quit (Ping timeout: 276 seconds) |
06:44:41 | * | GnuYawk67 quit (Quit: The Lounge - https://thelounge.chat) |
06:44:59 | * | GnuYawk67 joined #nim |
06:52:46 | * | mahlon joined #nim |
08:01:14 | * | beholders_eye joined #nim |
08:08:34 | * | coldfeet joined #nim |
08:20:43 | * | beholders_eye quit (Read error: Connection reset by peer) |
08:24:49 | * | mahlon quit (Ping timeout: 248 seconds) |
08:26:33 | * | beholders_eye joined #nim |
08:40:54 | FromDiscord | <aintea> Nimlangserver is more stable, and it works pretty well in neovim with nvim-cmp, however with blink.cmp it is slow, like real slow |
08:53:58 | FromDiscord | <nick.stokoe> Elegantbeef\: .throwstar |
08:54:22 | * | SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev) |
08:57:37 | * | SchweinDeBurg joined #nim |
09:05:57 | FromDiscord | <Elegantbeef> Nice inane spam |
09:18:10 | * | beholders_eye quit (Ping timeout: 272 seconds) |
09:49:43 | FromDiscord | <odexine> In reply to @Elegantbeef "Nice inane spam": Throw star |
10:11:59 | * | thunder quit (Read error: Connection reset by peer) |
11:33:18 | * | def- quit (Quit: -) |
11:34:23 | * | def- joined #nim |
11:57:34 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @aintea "Nimlangserver is more stable,": I struggle to setup nvim (even with a distro) and Helix sadly |
12:02:13 | * | coldfeet quit (Quit: Lost terminal) |
12:06:20 | FromDiscord | <System64 ~ Flandre Scarlet> Btw↵Is it possible to implement Discord Rich presence in Nim program please? Is there a Nim module for that? |
12:09:41 | * | ntat joined #nim |
12:14:45 | FromDiscord | <intellij_gamer> https://github.com/DavideGalilei/nimpresence↵Zero clue if it works↵Just remember using it once ages ago |
13:02:16 | * | thunder joined #nim |
13:07:58 | FromDiscord | <fabric.input_output> In reply to @sys64 "I struggle to setup": you ever tried going the incremental route? |
13:53:03 | * | ntat quit (Ping timeout: 272 seconds) |
14:18:14 | * | xet7 joined #nim |
14:42:25 | * | alexdaguy quit (Quit: ded) |
14:49:32 | * | ntat joined #nim |
16:31:52 | FromDiscord | <nnsee> In reply to @sys64 "Btw Is it possible": you don't really need a special module for that, the API calls are easy to perform using any HTTP client |
16:58:09 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @nnsee "you don't really need": I guess it's only post requests since I send data |
17:12:18 | om3ga_ | hi all! I forgot how to dereference for example ptr int |
17:13:03 | om3ga_ | for example I have ptr to something, created by createShared(int, sizeof(int)) |
17:13:22 | om3ga_ | how to take int and not ptr int, []? |
17:14:27 | * | coldfeet joined #nim |
17:16:12 | FromDiscord | <lainlaylie> Yes |
17:16:14 | FromDiscord | <lainlaylie> https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types |
17:16:17 | om3ga_ | static code analyser eats it |
17:16:32 | om3ga_ | probably I have other issues with the code |
17:17:07 | om3ga_ | Seems passing var Lock to the thread war will not work |
17:17:27 | om3ga_ | https://play.nim-lang.org/#pasty=OioYkVOH |
17:18:34 | om3ga_ | oh, not this |
17:19:00 | om3ga_ | https://play.nim-lang.org/#pasty=YhOcYFmL |
17:20:09 | * | om3ga_ is now known as om3ga |
17:21:11 | om3ga | In my opinion this should work |
17:22:01 | om3ga | create shared is not necessary, both code examples in theory should be ok |
17:40:30 | om3ga | hmm, probably this will not work in C too |
17:55:36 | om3ga | yes, in C pthread locks are also defined in global, please ignore |
18:20:12 | * | thunder quit (Remote host closed the connection) |
18:20:41 | * | thunder joined #nim |
18:53:04 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=JTCtgRGM |
18:53:46 | FromDiscord | <System64 ~ Flandre Scarlet> because if there is slow internet for example, it will take ages to startup |
18:53:56 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "https://play.nim-lang.org/#pasty=FBeXnoHQ" => "https://play.nim-lang.org/#pasty=pqTubDNQ" |
19:04:30 | FromDiscord | <thepotatochronicler> Don't use await? :hmm |
19:04:32 | FromDiscord | <thepotatochronicler> (edit) ":hmm" => ":hmm:" |
19:25:13 | * | ensyde joined #nim |
19:25:41 | FromDiscord | <jm_sts> sent a code paste, see https://play.nim-lang.org/#pasty=WYGmNZZj |
19:41:05 | FromDiscord | <treeform> You can print out whats in the nnkStmtListExpr .. I bet it some sort of resolution choosing object to use on or the other. |
19:41:19 | FromDiscord | <treeform> (edit) "on" => "one" | "other." => "other definition." |
19:41:34 | FromDiscord | <jm_sts> Ahhh let me check |
19:50:27 | * | GnuYawk67 quit (Quit: The Lounge - https://thelounge.chat) |
19:50:45 | * | GnuYawk67 joined #nim |
19:51:30 | FromDiscord | <jm_sts> sent a code paste, see https://play.nim-lang.org/#pasty=XWhfgqlM |
19:52:08 | FromDiscord | <jm_sts> (edit) "https://play.nim-lang.org/#pasty=lEXlUzPX" => "https://play.nim-lang.org/#pasty=zBbhgTFs" |
19:52:13 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=IoURVVMH |
19:52:41 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "use another thread?": Oh, this can work! |
19:56:00 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "use another thread?": Or I can use the Drain() proc |
20:21:03 | FromDiscord | <System64 ~ Flandre Scarlet> Lol the double segfault https://media.discordapp.net/attachments/371759389889003532/1322660609975652352/image.png?ex=6771af2f&is=67705daf&hm=fc2a071e76bb062ce77b45a6b3d992f20e7085721abd73be1673f81a549553e5& |
20:31:48 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=uprEepKe |
20:31:57 | FromDiscord | <Robyn [She/Her]> In reply to @sys64 "Oh, this can work!": oh it was said already |
20:32:44 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=XAztyDRV |
20:32:56 | FromDiscord | <Robyn [She/Her]> Then just check if `presence != null` |
20:33:50 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "oh wait it's async?": But asyncCheck can throw an exception, and exceptions are quite expansive I think |
20:34:07 | FromDiscord | <Robyn [She/Her]> In reply to @sys64 "Lol the double segfault": yeah async dispatch and threads do NOT like eachother |
20:34:35 | FromDiscord | <Robyn [She/Her]> In reply to @sys64 "But asyncCheck can throw": await can also throw exceptions, and iirc in arc/orc, try-except are basically just an if statement |
20:35:04 | FromDiscord | <System64 ~ Flandre Scarlet> Oh, good to know |
20:35:26 | FromDiscord | <Robyn [She/Her]> plus you're using async, isn't most stuff allocated on the heap? |
20:35:54 | FromDiscord | <System64 ~ Flandre Scarlet> I think? |
20:37:26 | FromDiscord | <Elegantbeef> Async and threads like eachother just fine |
20:37:35 | FromDiscord | <Elegantbeef> Futures are just thread local |
20:37:43 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "oh wait it's async?": so it's↵asyncCheck myFunction()? |
20:39:16 | FromDiscord | <Robyn [She/Her]> In reply to @sys64 "so it's asyncCheck myFunction()?": yeah |
20:40:08 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Async and threads like": you can't spawn an async function on another thread if the future comes from a different thread though, right? that's what i mean |
20:40:45 | FromDiscord | <Elegantbeef> Right but that's not what you said |
20:41:22 | FromDiscord | <System64 ~ Flandre Scarlet> Isn't using threads just easier? |
20:43:29 | FromDiscord | <Elegantbeef> They're two completely different things |
20:43:29 | FromDiscord | <Elegantbeef> So no |
20:43:29 | FromDiscord | <Elegantbeef> Using selectors is easier |
20:44:08 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Right but that's not": it captures the meaning sorta :p |
20:44:43 | FromDiscord | <Elegantbeef> It reads as you cannot use threads and async at the same time which is false |
20:45:15 | FromDiscord | <umi_l> Anyone know of a 3d physics engine for gamedev written in (or has bindings to) nim? |
20:49:50 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "It reads as you": fair enough yeah |
20:50:26 | FromDiscord | <Robyn [She/Her]> In reply to @umi_l "Anyone know of a": UE has Nim bindings, there's also Nim bindings for Godot |
20:51:06 | FromDiscord | <Elegantbeef> "Physics engine" |
20:51:25 | FromDiscord | <umi_l> In reply to @chronos.vitaqua "UE has Nim bindings,": I'm using raylib for my game engine so can't really justify bundling in a whole other game engine, nor would I know how I could do that |
20:53:03 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "oh wait it's async?": I use an option |
20:53:20 | * | beholders_eye joined #nim |
20:53:53 | * | ntat quit (Read error: Connection reset by peer) |
20:54:11 | * | ntat joined #nim |
20:55:21 | * | ntat quit (Remote host closed the connection) |
20:55:40 | * | ntat joined #nim |
20:56:14 | FromDiscord | <Robyn [She/Her]> oh physics engine sorry |
20:57:07 | FromDiscord | <Robyn [She/Her]> In reply to @umi_l "I'm using raylib for": You could run Futhark on Bullet3D's C API |
20:57:12 | FromDiscord | <Elegantbeef> Jolt would be the best to look at |
20:57:16 | FromDiscord | <Elegantbeef> It has a C-API and is a good engine |
20:57:20 | FromDiscord | <Robyn [She/Her]> Or maybe use Jolt or Rapier yeah |
20:57:22 | FromDiscord | <Elegantbeef> Well unofficial C api |
20:58:58 | * | ntat quit (Read error: Connection reset by peer) |
21:00:33 | * | ntat joined #nim |
21:01:31 | * | xet7 quit (Remote host closed the connection) |
21:03:06 | FromDiscord | <System64 ~ Flandre Scarlet> /home/system64/.choosenim/toolchains/nim-2.2.0/lib/pure/asyncmacro.nim(250, 31) Error: 'runRichPresence (Async)' is not GC-safe as it calls 'initPresence'↵↵I love using threads... |
21:03:32 | FromDiscord | <Elegantbeef> Stop using globals 😛 |
21:03:57 | * | ensyde quit (Ping timeout: 276 seconds) |
21:04:01 | FromDiscord | <System64 ~ Flandre Scarlet> I don't even use globals |
21:04:13 | FromDiscord | <Elegantbeef> You obviously do if a proc is not gcsafe |
21:04:39 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=cDkQuILQ |
21:04:56 | FromDiscord | <Elegantbeef> `initPresence` |
21:05:45 | FromDiscord | <System64 ~ Flandre Scarlet> In this case, it's the library fault since it's not my function |
21:06:50 | FromDiscord | <System64 ~ Flandre Scarlet> Oh probably some Future stuff |
21:10:00 | * | thunder quit (Remote host closed the connection) |
21:10:31 | * | thunder joined #nim |
21:16:33 | * | beholders_eye quit (Ping timeout: 252 seconds) |
21:16:49 | * | thunder quit (Remote host closed the connection) |
21:17:14 | * | thunder joined #nim |
21:19:45 | * | beholders_eye joined #nim |
21:43:43 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=DiNLLGYT |
21:45:46 | FromDiscord | <Elegantbeef> It'll block the thread and wait, so probably not check |
21:46:07 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "It'll block the thread": And what if I use sleep()? |
21:52:59 | FromDiscord | <griffith1deadly> In reply to @sys64 "And what if I": why not just [addTimer](https://nim-lang.org/docs/asyncdispatch.html#addTimer%2Cint%2Cbool%2CCallback) and [poll](https://nim-lang.org/docs/asyncdispatch.html#poll%2Cint) |
21:55:15 | FromDiscord | <griffith1deadly> or even just addTimer and waitFor |
22:04:34 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=VbRVcuBV |
22:09:46 | FromDiscord | <System64 ~ Flandre Scarlet> asyncCheck is easier imo |
22:11:44 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=KkWYfonk |
22:19:35 | FromDiscord | <fabric.input_output> thread pool? |
22:22:32 | * | coldfeet quit (Quit: Lost terminal) |
22:27:34 | * | coldfeet joined #nim |
22:28:09 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=AyULIvve |
22:28:10 | FromDiscord | <System64 ~ Flandre Scarlet> Error : Enable "experimental" pragma↵Also error : invalid pragma "experimental" |
22:28:18 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "could use malebolgia": Is it simpler? |
22:28:34 | FromDiscord | <Robyn [She/Her]> yeah it's a simple lib, you could also use taskpools |
22:29:40 | FromDiscord | <Robyn [She/Her]> idk if malebolgia works here actually |
22:39:09 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=mXXVyljr |
22:43:07 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=qXmigYnm |
22:43:23 | FromDiscord | <System64 ~ Flandre Scarlet> I love vague error messages |
22:45:26 | FromDiscord | <Elegantbeef> isolated has to be consumed directly |
22:45:54 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "isolated has to be": So my functions must return something? |
22:46:19 | FromDiscord | <Elegantbeef> No you must construct the objects inside the `spawn` expression |
22:46:50 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "No you must construct": Oh, so I can't use pre-existing objects? |
22:52:00 | FromDiscord | <System64 ~ Flandre Scarlet> Oh even with threadpools I have this isolation problem |
22:55:16 | * | ntat quit (Quit: Leaving) |
22:55:33 | FromDiscord | <System64 ~ Flandre Scarlet> Lol↵I can bypass it by using... POINTERS |
22:58:00 | * | ensyde joined #nim |
22:58:45 | * | coldfeet quit (Quit: Lost terminal) |
23:01:51 | FromDiscord | <dedraiaken> Is there a means of converting a `ptr UncheckedArray[char]` to a string without copying? |
23:02:46 | FromDiscord | <Elegantbeef> Nope |
23:03:10 | FromDiscord | <Elegantbeef> Nim strings own data so there must be a copy |
23:05:47 | rockcavera | dedraiaken https://github.com/rockcavera/nim-zerocstringtostring I was playing around with this once, but I don't know if it's 100% safe. |
23:06:11 | FromDiscord | <dedraiaken> hmm so kind of hosed if a library is expecting a string? Shouldn't be able to mimic the data structure and perform a cast? |
23:06:15 | FromDiscord | <Elegantbeef> Well it's clearly not safe as you do not own the data |
23:06:34 | FromDiscord | <Elegantbeef> Use Nim's string instead then convert to `cstring` |
23:06:41 | FromDiscord | <Elegantbeef> Nim strings are null terminated |
23:07:26 | FromDiscord | <Elegantbeef> You can abuse the fact Nim strings have a copy on write feature to achieve your no copy, but it's some low level shenanigans that can always change |
23:08:12 | FromDiscord | <Elegantbeef> Rock does your implementation abuse the MSB of the capacity(or is it length?) indicating a 'constant'? |
23:08:32 | FromDiscord | <dedraiaken> Hmm.. I've got gigabytes of data in a buffer that I want to parse chunks out of as JSON without copying. |
23:09:12 | FromDiscord | <Elegantbeef> Well you could abuse that mechanism if you wanted to |
23:11:10 | rockcavera | Elegantbeef I don't remember anything about the project, I was just playing around |
23:11:42 | rockcavera | I vaguely remember that I ran valgrind and no problems were reported |
23:13:30 | FromDiscord | <Elegantbeef> I looked, you arent |
23:13:32 | FromDiscord | <Elegantbeef> Oh it uses the capacity as a flag |
23:13:32 | FromDiscord | <Elegantbeef> Which means you need to have an int before the string and say "this is a constant" |
23:13:32 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/lib/system/strs_v2.nim#L26 |
23:14:02 | FromDiscord | <Elegantbeef> Yea if you're very cautious with your code it's safe |
23:14:16 | FromDiscord | <Elegantbeef> But if you attempt to grow the string, or don't call the zero it'll attempt to free the memory |
23:14:30 | rockcavera | yes |
23:16:59 | * | beholders_eye quit (Ping timeout: 260 seconds) |
23:26:35 | FromDiscord | <ricky._.spanish> is there a nim library for creating a LSP for another language? |
23:28:22 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=nIVApLSU |
23:31:57 | FromDiscord | <System64 ~ Flandre Scarlet> Like, I don't understand why |
23:39:54 | * | mahlon joined #nim |
23:59:45 | FromDiscord | <drugss> IMG-20241228-WA0002.jpg https://media.discordapp.net/attachments/371759389889003532/1322715645304897618/IMG-20241228-WA0002.jpg?ex=6771e270&is=677090f0&hm=829a85c42edc94629a39fbf496678af01f55b4196939f96e0fe381a3d9812afa& |