<< 18-07-2025 >>

00:13:42*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
00:51:19*rockcavera joined #nim
01:42:49*tokyovigilante quit (Remote host closed the connection)
01:46:25*tokyovigilante joined #nim
02:25:29*pmp-p quit (Ping timeout: 260 seconds)
02:34:57*pmp-p joined #nim
02:59:06*skippy8 joined #nim
03:24:53*rockcavera quit (Remote host closed the connection)
04:19:34*xet7 joined #nim
04:26:51*xet7 quit (Quit: Leaving)
05:08:49*amadaluzia quit (Quit: ZNC 1.10.0 - https://znc.in)
05:15:19*SchweinDeBurg quit (Quit: WeeChat 4.7.0-dev)
05:15:46*SchweinDeBurg joined #nim
05:17:28*xet7 joined #nim
05:57:50*xet7 quit (Quit: Leaving)
07:08:43FromDiscord<0xfab_10> example?
07:23:00*jjido joined #nim
07:45:44*redj quit (Ping timeout: 260 seconds)
07:46:17*redj joined #nim
07:51:19FromDiscord<kapendev> TextureId loadTexture(IStr path)
07:56:01FromDiscord<kapendev> Almost everything in Godot returns an error code.
08:15:11*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
08:16:53*jjido joined #nim
08:17:15*jjido quit (Client Quit)
08:19:26FromDiscord<blashyrk> sent a code paste, see https://play.nim-lang.org/#pasty=cNogulcP
08:42:59FromDiscord<0xfab_10> In reply to @kapendev "Almost everything in Godot": well duh as it should, have you seen vulkan or sdl?
08:44:22FromDiscord<kapendev> In Rust land this would not be the case 90% of the time.
08:44:51FromDiscord<kapendev> I can also imagine they do that for their bindings/wrappers.
08:45:14*beholders_eye joined #nim
08:54:25FromDiscord<lainlaylie> In reply to @blashyrk "Does anyone know if": are you looking for something like mapIt?
08:55:42FromDiscord<blashyrk> In reply to @lainlaylie "are you looking for": Yes but mapIt works for seqs (it's from sequtils) only I think, and also allocates to the best of my knowledge.
08:57:59FromDiscord<blashyrk> Oooh but I just realized there's an `inject` pragma, that should do the trick (with a template)
09:01:05FromDiscord<lainlaylie> mapIt works on arrays (or anything it can iterate over) but indeed returns a seq. there's no closure involve though, the ast passed as argument is expanded directly
09:01:16FromDiscord<lainlaylie> (edit) "involve" => "involved"
09:08:09FromDiscord<blashyrk> sent a code paste, see https://play.nim-lang.org/#pasty=KlZlsfTr
09:23:14FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=nhGIpWAz
09:24:35FromDiscord<lainlaylie> you can, that's what mapIt does
09:25:37FromDiscord<lainlaylie> this kind of error usually means something in the template is failing to compile
09:26:31FromDiscord<lainlaylie> In reply to @blashyrk "Thanks! I'd like to": though i can't debug your exact code because it's missing some definitions and the actual call to `magnitude`
09:27:08FromDiscord<griffith1deadly> In reply to @lainlaylie "you can, that's what": didn't know that
09:32:40FromDiscord<hawkey5212> In reply to @fabric.input_output "example?": I'd love to see an example as well. Curious about what constitutes abuse of `Result` or `Option` in rust.↵↵In my experience, nothing gets past code review without at least being noticed if it looks like inappropriate use.
09:34:48FromDiscord<blashyrk> In reply to @lainlaylie "though i can't debug": I think it's because it might be impossible to infer the U param this way... So I also tried this to no avail:↵↵https://play.nim-lang.org/#pasty=JWwuhmWd
09:35:42FromDiscord<blashyrk> I saw that `mapIt` uses some moderately complex machinery to figure out the output type, maybe I need to copy that
09:37:28FromDiscord<lainlaylie> `type resType = typeof((let it {.inject.} = default(T); body))`
09:37:49FromDiscord<lainlaylie> the problem is in typeof(body), there is no `it` so it fails to compile
09:43:29FromDiscord<blashyrk> Thanks, that did the trick! 🙂
09:44:25FromDiscord<blashyrk> Seems kinda "ugly" to use `it` also in the intermediate step for the type, but I'm not complaining 😄
09:44:41FromDiscord<0xfab_10> In reply to @kapendev "In Rust land this": why would it not be?
09:45:15FromDiscord<blashyrk> Ah but it only works if T is the same as U 😦 ... Back to the drawing board
09:48:10FromDiscord<lainlaylie> In reply to @blashyrk "Ah but it only": that shouldn't be the case
10:06:34*CypherCat quit (Changing host)
10:06:34*CypherCat joined #nim
10:07:33FromDiscord<nnsee> In reply to @fabric.input_output "why would it not": don't you know? rust prevents all errors from ever happening
10:08:53FromDiscord<nnsee> on a more serious note, the type system is quite powerful and the compiler should stop some invalid states from even being possible, but... that only gets you so far. errors occurring at runtime are runtime errors and no amount of compiler magic changes that
10:27:05FromDiscord<0xfab_10> also sometimes it's not the function's responsibility to handle the error so the best you can do is just pass it along
10:28:19FromDiscord<hawkey5212> sent a code paste, see https://play.nim-lang.org/#pasty=gGuVPFPT
10:29:30FromDiscord<hawkey5212> In reply to @fabric.input_output "also sometimes it's not": which is where code review comes into play. I think kapendev is complaining about bad engineers letting poor design past review, than the language itself.
12:00:24*przmk joined #nim
12:00:38*przmk4 quit (Quit: The Lounge - https://thelounge.chat)
12:02:41*amadaluzia joined #nim
13:09:14FromDiscord<mayendradwika> today i join nim
13:25:56*FromDiscord quit (Server closed connection)
13:26:21*FromDiscord joined #nim
13:30:40FromDiscord<0xfab_10> welcome
13:42:20FromDiscord<lainlaylie> do you hate crabs or are you a hate-crab
13:50:20*xet7 joined #nim
14:16:51FromDiscord<mayendradwika> i hate rust
14:17:47*amadaluzia quit (Quit: ZNC 1.10.0 - https://znc.in)
14:19:02FromDiscord<lucidrains (Phil Wang)> i know this comes up a lot, but what would people recommend for multithreading for nim lang in 2025?
14:19:31FromDiscord<lucidrains (Phil Wang)> i'm looking at making weave work, but just want to hear some affirmations
14:31:03*skippy8 quit (Quit: WeeChat 4.6.3)
14:38:51FromDiscord<kapendev> In reply to @fabric.input_output "also sometimes it's not": I get that, and I don't really have a source for that lol, but most of them pass the error up without even trying to deal with it. "It's your problemo, friend." And then we have exceptions again.
14:41:23FromDiscord<kapendev> I would remove the `?` thing from the language just to make it harder to pass the problem up.
15:15:58FromDiscord<hawkey5212> In reply to @kapendev "I get that, and": if "that's your preblemo, friend" is how you see errors being passed up, then I can only imagine you've been mentored by engineers that have no idea what they're doing.
15:21:10FromDiscord<hawkey5212> sent a long message, see https://pasty.ee/wFVnhYFn
15:23:04FromDiscord<kapendev> There are a lot of things that can be improved about Rust. I am not saying that you should never pass things up.
15:25:40FromDiscord<hawkey5212> there are a lot of things that can be improved in _every_ language. I think rust is proven itself as the language that has the highest quality engineering behind it, though. I can only think of 3 or 4 things about it that are arguably due to lack of engineering quality going into the project.
15:28:08FromDiscord<hawkey5212> the sync/async issue. const generics. async trait methods. some edge cases on module/library dependency stuff. function constraints are the ones that come to mind.
15:28:47FromDiscord<hawkey5212> allocations assumed to not fail.
15:29:25FromDiscord<hawkey5212> not treating embedded as a first class citizen.
15:33:41FromDiscord<hawkey5212> sent a long message, see https://pasty.ee/igDegLbA
15:36:04FromDiscord<kapendev> Everything is kinda vibe based when designing a language. My good version of Rust will probably not be the same as most Rust users just because I like writing C, C++ and D more. Same for Nim actually. My good version of Nim would probably have better docs 🙂↵I don't really do embedded stuff, so no idea.
15:45:59FromDiscord<hawkey5212> sent a long message, see https://pasty.ee/ngVGecaC
15:47:56FromDiscord<kapendev> Making a language easily grepable is a nice idea. I think C3 kinda tries that.
15:50:45FromDiscord<hawkey5212> sent a long message, see https://pasty.ee/xhioqmDY
15:53:11FromDiscord<hawkey5212> sent a code paste, see https://play.nim-lang.org/#pasty=UZsVmlhJ
16:05:39*przmk_ joined #nim
16:06:13*przmk_ quit (Remote host closed the connection)
16:06:42*przmk quit (Ping timeout: 248 seconds)
16:07:57*przmk joined #nim
16:18:29*beholders_eye quit (Ping timeout: 260 seconds)
16:54:19*beholders_eye joined #nim
16:58:45*ntat joined #nim
17:11:18*bcksl quit (Ping timeout: 252 seconds)
17:11:34*end quit (Ping timeout: 260 seconds)
17:13:38*skippy8 joined #nim
17:33:13*bcksl joined #nim
17:47:32*end joined #nim
18:14:35*nils` joined #nim
19:13:22*beholders_eye quit (Ping timeout: 272 seconds)
19:41:49*ntat quit (Quit: Leaving)
20:10:31*amadaluzia joined #nim
20:16:49*amadaluzia quit (Quit: ZNC 1.10.0 - https://znc.in)
20:17:41*amadaluzia joined #nim
20:50:16*Guest33 joined #nim
20:50:56*lucerne quit (Server closed connection)
20:51:02*Guest33 quit (Client Quit)
20:52:11*lucerne joined #nim
20:52:51*skippy8 quit (Quit: WeeChat 4.6.3)
21:03:37*jjido joined #nim
21:28:35*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
21:31:00*cm quit (Ping timeout: 252 seconds)
21:31:36*cm joined #nim
22:30:00*amadaluzia quit (Quit: ZNC 1.10.0 - https://znc.in)