<< 25-12-2024 >>

00:20:35FromDiscord<thepotatochronicler> In reply to @Amun-Ra "or just return non-ref": I am working with raw opaque pointers, so not really an option kek
00:20:38FromDiscord<thepotatochronicler> (edit) removed "kek"
00:20:52FromDiscord<thepotatochronicler> In reply to @Amun-Ra "https://nim-lang.org/docs/manual_experimental_stric": Nice
00:52:25*beholders_eye quit (Ping timeout: 260 seconds)
04:27:48*SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev)
04:35:20*SchweinDeBurg joined #nim
05:11:06*encyde joined #nim
08:03:27*nils` quit (Ping timeout: 244 seconds)
08:31:54*coldfeet joined #nim
09:04:06*nils` joined #nim
09:06:35FromDiscord<albassort> is there a postgres module with better catchable extensions
09:06:40FromDiscord<albassort> (edit) "extensions" => "functions"
09:47:00strogon14Yesterday I learned that GitHub Actions CI runners for Linux ARM are only available for paid accounts. What is the best option for running the test for your Nim project on Linux arm64 in a CI?
09:49:01FromDiscord<Elegantbeef> I want to say the joke "Use x86 with qemu" but I don't want to be taken seriously
09:58:39FromDiscord<nnsee> In reply to @Elegantbeef "I want to say": but that's a serious suggestion :p
10:04:46FromDiscord<Elegantbeef> I hate modern tech
10:15:13strogon14Any example Nim projects which have that set up for GH actions?
10:19:30*oprypin quit (Quit: Bye)
10:19:56*oprypin joined #nim
10:25:01FromDiscord<fabric.input_output> In reply to @strogon14 "Any example Nim projects": nim maybe and arraymancer
10:32:25Amun-Rahmm, is there any define for nim.cfg's @if to detect building for JS?
11:11:19FromDiscord<spotlightkid> I can't see any refernce to ARM in their Gh workflows.↵(@fabric.input_output)
11:11:30FromDiscord<spotlightkid> I can't see any reference to ARM in their GH workflows.
11:11:36*coldfeet quit (Quit: Lost terminal)
11:41:37FromDiscord<demotomohiro> https://github.com/nim-lang/nightlies/releases↵Nightly build for ARM64 works on Raspberry Pi3.↵You might be able to use it for other arm64 Linux if you don't like to build Nim from source.
11:58:55strogon14Oh, ok, the workflow is not in the main Nim repo.
12:01:38strogon14But if I understand the workflow correctly, at a glance, this only does cross-compilation of Nim for the target platforms.
12:13:45*hexlocation joined #nim
12:35:13*nils` quit (Ping timeout: 244 seconds)
12:35:28*hexlocation quit (Ping timeout: 252 seconds)
12:36:29*hexlocation joined #nim
12:43:07FromDiscord<thepotatochronicler> Dealing with `const char ` in C FFI was truly a fun experience
12:58:54*beholders_eye joined #nim
13:03:29*hexlocation quit (Quit: Lost terminal)
13:16:08*nils` joined #nim
13:24:18*beholders_eye quit (Ping timeout: 252 seconds)
14:20:29FromDiscord<heysokam> In reply to @thepotatochronicler "Dealing with `const char": `cstring`↵but yes, they are a pain
14:42:08FromDiscord<thepotatochronicler> In reply to @heysokam "`cstring` but yes, they": It was a function that took `const char ` as an out argument, so it was a little more pain
14:45:34FromDiscord<heysokam> In reply to @thepotatochronicler "It was a function": `cstringArray` then? 🤔 or `UncheckedArray[cstring]`
14:45:51FromDiscord<thepotatochronicler> It doesn't add the const part then
14:46:07FromDiscord<heysokam> i have a fix for that, sec
14:46:19FromDiscord<thepotatochronicler> I already figured it out, no need 😄
14:46:57FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=WfyZezXX
15:04:14Amun-RacstringArray is an equivalnent of char** of (char *)[]
15:05:23Amun-Raesp. when one needs to index the result value
15:55:27*rockcavera joined #nim
15:57:51*nils` quit (Ping timeout: 265 seconds)
16:11:25FromDiscord<thepotatochronicler> Okay, sorry to bother even more, how to work with C++ references through importcpp pragma? `var Type` doesn't work, tried to make a separate type that has the same type but `byref` pragma, tried `ref` and `ptr` but neither makes sense.↵↵Looking at <https://github.com/Clonkk/nim-cppstl>, it suggests `var` should work, but I must be doing something wrong, the resulting C++ doesn't make it a reference 🥴
16:32:48FromDiscord<leorize> strogon14\: the workflow doesn't do cross-compilation, it runs QEMU to emulate arm instead
16:33:31FromDiscord<leorize> if you want native arm CI, circleci, cirrus or drone cloud all have arm machines
16:38:33FromDiscord<jmgomez> In reply to @thepotatochronicler "Okay, sorry to bother": what are you trying to import, a global variable? If so, import it as a pointer. References matters only in the context of matching function signatures
16:42:13*nils` joined #nim
16:42:39FromDiscord<thepotatochronicler> In reply to @jmgomez "what are you trying": A function that returns a reference
16:44:23FromDiscord<jmgomez> `var` should work but you can also do: ↵`proc getGameplayAttributeValueChangeDelegate(asc: UAbilitySystemComponentPtr, attribute: FGameplayAttribute): ptr FOnGameplayAttributeValueChange {.importcpp:"&(#->GetGameplayAttributeValueChangeDelegate(#))".}`
16:44:35FromDiscord<jmgomez> (edit) "`var` should work but you can also do: ↵`proc getGameplayAttributeValueChangeDelegate(asc: UAbilitySystemComponentPtr, attribute: FGameplayAttribute): ptr FOnGameplayAttributeValueChange {.importcpp:"&(#->GetGameplayAttributeValueChangeDelegate(#))".}`" => "sent a code paste, see https://play.nim-lang.org/#pasty=hDKHapYl"
16:45:36FromDiscord<thepotatochronicler> sent a code paste, see https://play.nim-lang.org/#pasty=TNiCJECD
16:45:59FromDiscord<thepotatochronicler> Might be missing something obvious
16:46:52FromDiscord<jmgomez> hmm, not sure. But just do what I said above and use a `ptr` as its closer to nim
16:47:47FromDiscord<thepotatochronicler> Technically running it directly like `imgui.getIO().IniFilename = nil` actually works, wack
16:48:21FromDiscord<jmgomez> yeah, likely is creating a copy. Hence a `ptr` is better
16:48:57FromDiscord<thepotatochronicler> In reply to @jmgomez "yeah, likely is creating": It doesn't as far as I can see https://media.discordapp.net/attachments/371759389889003532/1321520067241971763/image.png?ex=676d88f8&is=676c3778&hm=f3e67afb9bd18151ae5c87b4044494dc8f51a3a8f756d41142f201b0e2c14a0a&
16:49:13FromDiscord<jmgomez> I mean in the first scenario
16:49:18FromDiscord<thepotatochronicler> Aha
16:49:37FromDiscord<thepotatochronicler> It does create a copy in the first scenario, sadly
17:02:12FromDiscord<thepotatochronicler> Actually, this seems to be an entirely nim thing? There isn't any instance in the docs where the result of a function returning `var T` is stored inside a let/var as far as I can see
17:05:36FromDiscord<thepotatochronicler> Guess that's intentional then, goddamn
17:09:28FromDiscord<jmgomez> Just use a `ptr`
17:09:49FromDiscord<thepotatochronicler> For anyone possibly reading in the future, if you need to edit a lot of fields by reference, but don't wanna keep calling the function, then passing the result directly to a proc with `var T` parameter works
17:10:27FromDiscord<thepotatochronicler> Or ptr, yes
19:00:56*beholders_eye joined #nim
19:05:50*nils` quit (Quit: nils`)
19:08:23*xet7 quit (Remote host closed the connection)
19:09:50*xet7 joined #nim
19:19:52FromDiscord<sleeves> Is there a way to set position when reading a file using a line number? I'll likely just throw something together, but if std has it I'd rather use that.
19:20:56FromDiscord<sleeves> I know you can do it by bytes, but for my specific case newlines would be more convenient
19:21:06Amun-Rathere isn't
19:21:26FromDiscord<sleeves> Alright, thanks
19:31:55FromDiscord<Elegantbeef> You get to iterate in blocks counting `\n`
19:32:00FromDiscord<Elegantbeef> It's a very odd and costly operation
19:37:09Amun-Raand for the extra cost - use lines iterator
21:07:48*Guest85 joined #nim
21:12:52*Guest85 quit (Quit: Client closed)
22:29:52*beholders_eye quit (Ping timeout: 272 seconds)