<< 13-09-2024 >>

00:24:44*beholders_eye quit (Ping timeout: 260 seconds)
02:59:49*disso-peach quit (Quit: Leaving)
03:11:30*rockcavera quit (Remote host closed the connection)
04:36:36*ntat joined #nim
07:10:18FromDiscord<arm_3_d> sent a code paste, see https://play.nim-lang.org/#pasty=yxthjhNd
07:31:03*mfg joined #nim
07:43:23*ntat quit (Quit: Leaving)
07:48:39*redj quit (Ping timeout: 260 seconds)
07:49:18*redj joined #nim
07:54:48FromDiscord<Elegantbeef> @arm_3_d if `someString` is `string` that's wholly unsafe as you're returning a string which is deallocated when the procedure returns
08:15:31*ntat joined #nim
08:30:19FromDiscord<arm_3_d> In reply to @Elegantbeef "<@107466914392969216> if `someString` is": Thanks. It means I need to call alloc explicitly and then return? Also if return value is a struct with cstrings in it I also have to provide corresponding free function for user convenience, correct?
08:33:14FromDiscord<Elegantbeef> Of course the barrier removes any automatic memory management
09:35:24*albe quit (Quit: The Lounge - https://thelounge.chat)
09:35:46Amun-Raand dangling pointers sooner or later will kick you in the you-know-what
09:40:06FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Of course the barrier": why not just `GC_ref` a string? or is that not doable
09:41:44*albe joined #nim
09:42:42FromDiscord<xtrayambak> Are my function names too big? 😅 https://media.discordapp.net/attachments/371759389889003532/1284086848318341171/image.png?ex=66e55a91&is=66e40911&hm=e71e0596e2fcc1184da7089eb9684ec8fa761b19a362fa7f036170ce953febd9&
09:46:07FromDiscord<Robyn [She/Her]> In reply to @xtrayambak "Are my function names": yeah definitely
09:47:41FromDiscord<Robyn [She/Her]> In reply to @xtrayambak "Are my function names": whhy not `utf8ToUtf16BE` (which'd follow `utf<N>ToUtf<N><Endianness Abbreviation>` and have `error` as a default parameter
09:48:18FromDiscord<xtrayambak> In reply to @chronos.vitaqua "whhy not `utf8ToUtf16BE` (which'd": ah, that seems more sensible now that I think of it
09:48:39FromDiscord<xtrayambak> hold on, that'd cause another problem though
09:48:42FromDiscord<Robyn [She/Her]> Oh?
09:49:02FromDiscord<xtrayambak> the `<xyz>WithError` procs return `simdutf_result`, whilst the standard ones return a bool
09:49:12FromDiscord<xtrayambak> I could use `Result` now that I think of it
09:49:19FromDiscord<xtrayambak> but I don't want to force that on everyone who uses my library
09:49:32FromDiscord<Robyn [She/Her]> Could return a tuple?
09:49:43FromDiscord<xtrayambak> tuples get messy fast from my experience
09:49:50FromDiscord<Robyn [She/Her]> Also fair
09:49:52FromDiscord<Robyn [She/Her]> Hm
09:50:32FromDiscord<Robyn [She/Her]> I guess you could have the error proc as a different function than, could use `Err` to signify you return an error
09:57:26*beholders_eye joined #nim
10:20:18*beholders_eye quit (Ping timeout: 276 seconds)
10:59:57*xet7 joined #nim
11:47:52FromDiscord<andeee23> sent a code paste, see https://play.nim-lang.org/#pasty=GgJpohnl
11:48:34FromDiscord<andeee23> (edit) "https://play.nim-lang.org/#pasty=GefCxIOr" => "https://play.nim-lang.org/#pasty=wgURTFAI"
11:49:08FromDiscord<andeee23> (edit) "https://play.nim-lang.org/#pasty=DQmdhhfa" => "https://play.nim-lang.org/#pasty=qYebEyjA"
11:55:24FromDiscord<nimaoth> sent a code paste, see https://play.nim-lang.org/#pasty=LhrpFCjX
11:55:36Amun-Raandeee23: you have to pick different names
11:56:20Amun-Rathose clash with ones in SDL3
11:59:05FromDiscord<andeee23> In reply to @Amun-Ra "<@282574599558791169>: you have to": thanks for replying!↵which ones need to be renamed? I tried both the nim names and the exportc names and it didn't make a difference 🤔
11:59:06*ntat quit (Quit: Leaving)
11:59:20*albe quit (Quit: The Lounge - https://thelounge.chat)
11:59:36*albe joined #nim
11:59:48Amun-Ra"SDL_AppInit" etc.
12:01:32Amun-Rah, I've read the comment
12:01:48Amun-RaI think the culprit is the lack of #define SDL_MAIN_USE_CALLBACKS
12:03:19*albe quit (Client Quit)
12:04:17*albe joined #nim
12:10:43FromDiscord<andeee23> In reply to @Amun-Ra "I think the culprit": i added that at the top in the emit↵↵i looked at the nim c cache and it seems like it doesn’t generate the functions in c
12:11:17FromDiscord<andeee23> seems like i just don’t understand how nim decides to output these
12:20:13*om3ga_ is now known as om3ga
12:39:16*xet7 quit (Remote host closed the connection)
12:58:11*noeontheend quit (Read error: Connection reset by peer)
12:58:11*casaca quit (Read error: Connection reset by peer)
12:58:19*casaca joined #nim
12:58:20*noeontheend joined #nim
13:00:06*ntat joined #nim
13:21:08*Artea left #nim (#nim)
13:22:35*lucasta joined #nim
13:25:00*coldfeet joined #nim
13:28:39*coldfeet quit (Remote host closed the connection)
13:50:41*robertmeta quit (Ping timeout: 252 seconds)
13:50:45*johuck quit (Ping timeout: 248 seconds)
13:50:45*mronetwo quit (Ping timeout: 248 seconds)
13:50:54*casaca quit (Ping timeout: 276 seconds)
13:51:08*adigitoleo quit (Ping timeout: 248 seconds)
13:52:19*ursa-major quit (Ping timeout: 252 seconds)
13:52:51*noeontheend quit (Ping timeout: 276 seconds)
13:59:48*johuck joined #nim
14:01:24*mfg quit (Ping timeout: 260 seconds)
14:02:57*johuck quit (Read error: Connection reset by peer)
14:04:22*adigitoleo joined #nim
14:05:43*Artea joined #nim
14:05:59*robertmeta joined #nim
14:06:48*ursa-major joined #nim
14:09:02*mronetwo joined #nim
14:10:38*johuck joined #nim
14:14:04*noeontheend joined #nim
14:14:39*casaca joined #nim
15:01:07*nisstyre quit (Ping timeout: 252 seconds)
15:04:47*Artea left #nim (#nim)
15:14:29*nisstyre joined #nim
15:28:51*coldfeet joined #nim
15:29:35*beholders_eye joined #nim
16:01:31Amun-RaI'll play with that in my free time
16:13:08FromDiscord<krissh.wtf> sent a code paste, see https://play.nim-lang.org/#pasty=jLTbyKDm
16:13:14FromDiscord<krissh.wtf> (edit) "https://play.nim-lang.org/#pasty=KDywDRhp" => "https://play.nim-lang.org/#pasty=VrcGUPVx"
16:30:14Amun-Raactual error isn't shown in the log
16:31:36*lucasta quit (Remote host closed the connection)
16:39:07*beholders_eye quit (Ping timeout: 264 seconds)
16:53:14*beholders_eye joined #nim
16:59:54*major0 joined #nim
17:02:29*beholders_eye quit (Ping timeout: 252 seconds)
17:03:22*coldfeet quit (Remote host closed the connection)
17:03:34major0Are there any existing frameworks w/in Nim for automatically detecting cross compilers/linkers?
17:07:10major0I have been reading through the docs and I get the feeling I need to either use something like autoconf to potentially generate a collection of nim.cfg files, or could just use autoconf+automake and manage all the build flags that way. Not really seeing anything that stands out for detecting the appriopriate cc/ld for a requested target.
17:08:06Amun-Radepdns on the target platform, you can f.e. crosscompile for win32 with a single switch
17:09:28major0Yah, I noticed that, but I am looking to target different architectures. E.g. arm64, riscv, x86_64, superh, mips, etc...
17:10:30Amun-Rathat requires redefine a few settings like compiler, linker and so one, quite easy
17:11:13major0Right, but someone has to know the name of the cc/ld/etc and change the configs
17:11:33Amun-Ramhm
17:13:24major0Soo, I will need to provide something akin to autoconf to automatically detect cc/ld/etc and generate a nim.cfg based on a nim.cfg.in
17:16:35major0That brings up my next inquiry .. is there any docs/guidelines/patterns for dealing with and abstracting arch specific optimizations. Something akin to src/arch/amd64/foo.nim. It doesn't seem like there is a clear way to import an arch specific version. I was tossing around the idea of having a standard path that everything can import and which handles doing an `include` based on the target arch.
17:17:09Amun-Rathe way I do it: https://dpaste.com/BX4LM6PZK
17:17:16Amun-Ra(nim.cfg)
17:17:32Amun-Rayou can define that in config.nims, too
17:18:48Amun-Raand then: nim c -d=some_platform_switch main.nim and voila
17:20:07Amun-Raand my tweaks for cross compiling for win32/64: https://dpaste.com/9YH8THHDW
17:21:07major0Right, but generally you can use almost any `{arch}-*-gcc` to target an --os:any ELF binary.
17:21:36Amun-Raand for emscripten: https://dpaste.com/DKYKQ6XD6
17:22:00Amun-Rait becomes quite easy once you get into it
17:23:55major0Right, but this is `--os:any`, in fact, there is no target OS, only a target arch, and I want to use any available {arch}-elf capable cc/ld I can locate.
17:24:21major0I suppose I can let the compiler sort it out on the backend on its own.
17:24:39Amun-Ralook at config/nim.cfg in your local nim directory
17:27:20major0Right, but in all of these there is an assumed `os` target.
17:29:23Amun-Raright
17:30:04major0That is incompatible with my goals.
17:32:51Amun-Rait's optional
17:39:02major0Yah, just not really groking a way to easily do what I am trying to do via just the config..
17:41:20major0Does Nim honor the CC and LD environ variables?
17:46:10FromDiscord<crim4> hi do you remember about carbon language? well the author said in an talk that they wanted to transpile c++ idioms to carbon's one for proper c++ interop.↵↵since nim has probably the best c++ interop in the industry right now, how do you manage to create bindings (using c++ code inside nim) in the best way? for example a c++ class with inheritance, rather then a operator method or exception thrower method or even a method that takes an
17:46:33FromDiscord<crim4> since nim and c++ may have different semantics for similar concepts?
17:47:31FromDiscord<crim4> and these are pretty easy to bind actually, are there bettere examples where it's clear that binding a c++ idiom inside nim is really hard and results in bad binsing?
17:47:34FromDiscord<crim4> thanks
17:48:08*ntat quit (Quit: Leaving)
18:00:06*xet7 joined #nim
18:25:05*def- quit (Quit: -)
18:25:17*def- joined #nim
18:32:32*ntat joined #nim
18:59:02*ntat quit (Quit: Leaving)
19:10:04FromDiscord<Elegantbeef> Cause you're passing the string by it's cstring which means that you cannot free it. Not to mention Arc/Orc do not have ref counted strings↵(@Robyn [She/Her])
19:12:24FromDiscord<Robyn [She/Her]> ah
19:15:08FromDiscord<spotlightkid> Isn't the bot that posted new Nim forum threads active anymore?
19:40:13*major0 left #nim (#nim)
19:41:37*major0 joined #nim
19:44:13*major0 quit (Remote host closed the connection)
20:15:16*major0 joined #nim
20:45:32*major0 quit (Quit: major0)
20:53:40*major0 joined #nim
21:00:57FromDiscord<firasuke> I am having troubles copying somewhat big directories using copyDirWithPermissions or copyDir on an ext4 filesystem (works fine with both cp and rsync). The directories appear to have been copied but the function stalls.
21:03:33FromDiscord<Elegantbeef> Are you sure the data is fully copied and the procedure is not blocking while it writes the data?
21:05:17*xet7 quit (Remote host closed the connection)
21:10:31FromDiscord<firasuke> In reply to @Elegantbeef "Are you sure the": I am not sure, it's taking a lot of time
21:10:59FromDiscord<firasuke> how can I check to see if that's the case?
21:11:18FromDiscord<Elegantbeef> Look at the system disk io whilst the program is running
21:12:00FromDiscord<firasuke> In reply to @Elegantbeef "Look at the system": already did that, it stops moving
21:12:13FromDiscord<Elegantbeef> Then the API is broken
21:12:34FromDiscord<firasuke> ouch
21:13:08FromDiscord<firasuke> I will narrow it down
21:13:17FromDiscord<firasuke> I believe there's a certain type of file
21:13:34FromDiscord<firasuke> or perhaps an unresorvable or infinite symlink somewhere
21:13:36FromDiscord<firasuke> since this is a rootfs that I am copying
21:18:21FromDiscord<firasuke> yeah that was quick
21:26:55FromDiscord<firasuke> nvm this requires some more testing
21:27:05FromDiscord<firasuke> but yeah there's something it's stuck on
21:37:47FromDiscord<nevercompile> whats the best way to learn nim?
21:48:02FromDiscord<that_dude.> Small projects imo
21:48:46FromDiscord<nevercompile> well how to you learn to write vim and learn to know how to even build things in the language↵(@that_dude.)
21:48:57FromDiscord<nevercompile> well how do you learn to write vim and learn to know how to even build things in the language
21:49:26FromDiscord<that_dude.> Just double checking, do you mean nim or vim?
21:50:04FromDiscord<that_dude.> How much coding experience do you have in other langs, and how many lang? Do you know python?
21:50:27FromDiscord<nevercompile> nim my bad
21:50:43FromDiscord<nevercompile> i know enough python to make a text based adventure game
21:51:00FromDiscord<nevercompile> or follow a more complex tutorial with some understanding
21:51:05FromDiscord<nevercompile> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1284269614385201164): well how do you learn to write nim and learn to know how to even build things in the language
21:54:28FromDiscord<that_dude.> If you have a decent grasp of python, I would suggest taking a look at the main tutorials
21:54:30FromDiscord<that_dude.> https://nim-lang.org/docs/tut1.html
21:55:46FromDiscord<nevercompile> thank you thug
22:01:27FromDiscord<firasuke> sent a code paste, see https://play.nim-lang.org/#pasty=ZKZvlyeB
22:08:09FromDiscord<that_dude.> @nevercompile im mid work so I couldn't finish my thought lol. I was going to suggest remaking one of your previous projects in nim, I'd say it's the fastest way to get a feel for the Lang in comparison to what you know. Alternively you can grab some basic leet code /starter difficulty style problems.
22:12:03FromDiscord<that_dude.> In order to learn Java recently, I first made a number guessing game, and then made a super simple 4 operator calculator with priority as a second. First one as a basio hello world with io. Second I could practice things like object construction, tree traversal, and inheritance
22:20:46*jjido joined #nim
23:24:04FromDiscord<demotomohiro> In reply to @crim4 "hi do you remember": If you want to learn how to learn how to interop C++ code:↵https://nim-lang.org/docs/manual.html#implementation-specific-pragmas↵There is Nim bindings for the C++ STL:↵https://github.com/Clonkk/nim-cppstl
23:44:16*_________ quit (Ping timeout: 272 seconds)
23:45:02*_________ joined #nim