<< 23-05-2025 >>

00:48:38FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#pasty=afsqsAfK
01:24:56*rockcavera quit (Remote host closed the connection)
02:46:42FromDiscord<Robyn [She/Her]> In reply to @griffith1deadly "isn't you try `number.cast[uint8]()`?": that needs to be `.cast[:int16]()`
02:47:14FromDiscord<leorize> you can't do that for cast afaik
02:47:20FromDiscord<leorize> but like, why cast
02:47:23FromDiscord<Robyn [She/Her]> oh damn, sad
02:47:28FromDiscord<leorize> `.int16` would've worked as well
02:47:34FromDiscord<leorize> or `i16` suffix
02:47:48FromDiscord<leorize> cast is ugly because you're not supposed to use it
02:47:52FromDiscord<Robyn [She/Her]> In reply to @leorize "`.int16` would've worked as": this would've yeah
05:25:08*nils` quit (Ping timeout: 244 seconds)
05:50:11*xet7 joined #nim
05:52:29*xet7 quit (Remote host closed the connection)
06:15:12*nils` joined #nim
06:35:51*skippy8 joined #nim
06:38:58*alexdaguy joined #nim
07:00:01*alexdaguy quit (Read error: Connection reset by peer)
07:01:27*alexdaguy joined #nim
07:09:19*andy-turner joined #nim
07:39:55FromDiscord<impbox [ftsf]> anyone know a workaround for stream.atEnd / peekChar not being available on JS backend? How do I tell if i'm at the end of the file?
09:14:56*beholders_eye joined #nim
09:28:54*andy-turner quit (Quit: Leaving)
11:11:42FromDiscord<aintea> My `.len` don't work anymore
11:11:50FromDiscord<aintea> they cause segfaults
11:11:53FromDiscord<aintea> seqs and strings
11:58:53FromDiscord<hawkey5212> sent a code paste, see https://play.nim-lang.org/#pasty=XWueEdPv
11:59:08FromDiscord<hawkey5212> sent a code paste, see https://play.nim-lang.org/#pasty=nTlucWWT
13:12:38*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in)
13:13:33*xutaxkamay joined #nim
14:02:01*ntat joined #nim
14:17:32*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in)
14:18:26*xutaxkamay joined #nim
14:33:16FromDiscord<Robyn [She/Her]> In reply to @aintea "My `.len` don't work": ...what
14:33:20FromDiscord<Robyn [She/Her]> send code?
14:33:28*thunder joined #nim
14:37:07FromDiscord<Robyn [She/Her]> In reply to @hawkey5212 "the top of the": try `file:///home/ben/IFT/mix` and the equivalent for libp2p
14:39:45FromDiscord<hawkey5212> In reply to @battery.acid.bubblegum "try `file:///home/ben/IFT/mix` and the": not working. neither did using relative paths.
14:44:51FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=SSSsjWgy
14:47:47FromDiscord<hawkey5212> sent a long message, see https://pasty.ee/AwxYYTWO
14:48:48FromDiscord<hawkey5212> the solution I came up with was to just move my entire project into the dependency and work from there.↵↵Is there a reason why you can't just specify a path for your dependency? I would have thought that to be a relatively common need.
14:50:51FromDiscord<Robyn [She/Her]> no clue, sorry, Nimble is kinda disliked but used because it's better than nothing
14:52:42FromDiscord<janakali> > Error: Package nim-libp2p@any version not found↵there's no `nim-libp2p`, correct package name is `libp2p` (check .nimble when not sure)
14:54:02*fabricio joined #nim
14:54:57FromDiscord<hawkey5212> In reply to @battery.acid.bubblegum "no clue, sorry, Nimble": isn't nimble the official tooling?↵↵e.g. cargo to rust, as is nimble to nim?
14:55:49FromDiscord<Robyn [She/Her]> In reply to @hawkey5212 "isn't nimble the official": yeah
14:56:14FromDiscord<Robyn [She/Her]> but it's not the best unfortunately
14:56:50FromDiscord<hawkey5212> https://tenor.com/view/lanakane-hooray-yay-sarcasm-archer-gif-9739117
14:58:00FromDiscord<Robyn [She/Her]> i wanna say that I'm working on my own but I'm procrastinating on writing a TOML parser with a nicer API than the ones that exist rn
14:58:41fabricioRobyn [She/Her]: https://github.com/fabricio-p/c-toml maybe check it out
15:02:44FromDiscord<hawkey5212> In reply to @battery.acid.bubblegum "i wanna say that": that would just create a fragmented ecosystem though, no? why not just make `.nimble` better (or am I confused about the topics)
15:03:23FromDiscord<Robyn [She/Her]> In reply to @fabricio "Robyn [She/Her]: https://github.com/fabricio-p/c-to": oooh thank you, I'll look at that when I'm at my PC, this'll help a shit ton
15:03:58FromDiscord<Robyn [She/Her]> In reply to @hawkey5212 "that would just create": I'd plan to have limited support for nimble anyway, and also I'd rather have a package manager much more like cargo than what we have now
15:05:27FromDiscord<hawkey5212> what do you think would happen if that was put to tthe people making decisions? the idea of just "dropping nimble, and replacing it with a cargo-like implementation"?
15:06:32FromDiscord<Robyn [She/Her]> In reply to @hawkey5212 "what do you think": personally i have no idea, but i feel like the question you raised earlier would just be asked again
15:07:00FromDiscord<Robyn [She/Her]> 'why not contribute to Nimble rather than make a new package manager'
15:07:44FromDiscord<Robyn [She/Her]> also since Nimble has been around for ages, doubt anyone is eager to replace it
15:09:11FromDiscord<hawkey5212> My response would be "because nimble as a project is not serving the nim project. a great language implies a great tooling ecosystem, and that can't be done with nimble as it stands. We'll keep nimble as it is on life support untill a cargo-like rewrite can take over, at which point, nimble will be deprecated"↵↵I'm making a lot of assumptions there, but something like that.
15:09:58FromDiscord<hawkey5212> if it's been around for ages, and this is its current state, it doesn't give me much confidence in its future :/
15:12:43FromDiscord<kapendev> Hot take, but I would not deal with nimble and just do it the classic way.
15:13:47FromDiscord<Robyn [She/Her]> In reply to @hawkey5212 "if it's been around": that's fair honestly
15:14:13FromDiscord<Robyn [She/Her]> In reply to @kapendev "Hot take, but I": if it was more convenient than just pulling in Nimble anyway, I'd prolly do the same
15:45:13*fabricio quit (Ping timeout: 252 seconds)
16:07:39*fabricio joined #nim
16:37:20FromDiscord<lainlaylie> In reply to @battery.acid.bubblegum "i wanna say that": parseHook and object field pragmas please
16:45:20*alexdaguy quit (Quit: ded)
16:49:26*xet7 joined #nim
16:57:01FromDiscord<nijmegenzuigt> you guys using makefiles too ? 😮
17:27:05FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=SteLVDWX
17:27:27FromDiscord<aintea> line 298, remove the debug prints with `.len` and the segfault is somewhere else
17:27:34FromDiscord<aintea> add a print with a len and you get a segfault
17:27:42FromDiscord<aintea> (edit) "https://play.nim-lang.org/#pasty=eaNkEuAt" => "https://play.nim-lang.org/#pasty=jFDbInYR"
17:28:30FromDiscord<aintea> compiles with `--mm:refc` tho
17:31:36FromDiscord<aintea> when I try to debug it with gdb I get the `memory freed twice`
17:31:38FromDiscord<aintea> because why not
17:34:26FromDiscord<Robyn [She/Her]> In reply to @lainlaylie "parseHook and object field": yeah that's what i want too
17:34:56FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=fLdYZAuO
17:35:27FromDiscord<aintea> I can't really minimize it but I already reported kind of the same thing
17:35:50FromDiscord<aintea> With `--mm:orc` it said memory freed twice but I got the actual error using `--mm:refc`
17:36:00FromDiscord<aintea> now `--mm:refc` just compiles and run normally
17:36:15FromDiscord<Elegantbeef> Do you have any destructors in your package?
17:47:43FromDiscord<aintea> no
18:02:40FromDiscord<Elegantbeef> Hmph it does not segfault here
18:03:36FromDiscord<Elegantbeef> oh wait I did not use the branch
18:10:09FromDiscord<Elegantbeef> Well it goes away if you don't use unittest 😄
18:10:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=ZcMbzmjR
18:11:01FromDiscord<Elegantbeef> Building it with `-d:useMalloc --debugger:native` then throwing it in valgrind showed the issue was inside unit test
18:24:39*beholders_eye quit (Ping timeout: 260 seconds)
18:32:12FromDiscord<aintea> Lmao
18:32:28FromDiscord<aintea> thanks man I could never guess it was not my fault
18:33:20*xutaxkamay quit (Ping timeout: 268 seconds)
18:33:55*xutaxkamay joined #nim
18:49:39FromDiscord<Elegantbeef> The question is now whether it's test or check causing the issue an how is it doing it
19:34:20*ntat quit (Quit: leaving)
19:42:45*beholders_eye joined #nim
20:07:19*fabricio quit (Ping timeout: 260 seconds)
20:33:43*beholders_eye quit (Ping timeout: 265 seconds)
20:49:23*fabricio joined #nim
21:11:32*fabricio quit (Quit: bye)
21:33:01*thunder quit (Killed (NickServ (GHOST command used by metasintactic)))
21:33:11*metasintactic joined #nim
21:34:30*thunder joined #nim
21:38:00*metasintactic quit (Ping timeout: 264 seconds)
21:45:14FromDiscord<heysokam> How are you supposed to debug nim code, without having to debug C mangled code instead?↵The issue is already difficult enough to find that print debugging is not enough, but I can't seem to find a way to even see the nim code on the debugger. `--debugger:native` with `nim-gdb` used to do this, but apparently it doesn't do that now↵Am I missing something, or has nim-gdb just bitrot in latest versions?
21:48:15*przmk quit (Remote host closed the connection)
21:48:38*przmk joined #nim
21:56:28FromDiscord<heysokam> edit: nvm, the debugger:native flag was missing due to a bug in my builder↵it does show the nim code when passing it
22:02:21FromDiscord<heysokam> dev experience is still crap with it. hoping its just my setup↵how do you guys step through nim code on a debugger? what's your setup?
22:10:10FromDiscord<summarity> honestly even setting up CodeLLDB and making adjustments to the support script for pretty data formatting, it's still a pain - so I usually avoid it
22:12:13FromDiscord<heysokam> yea, I avoid it myself too. but this bug is pretty nasty, because I don't know where it comes from and the app runs fine 😦
22:37:47FromDiscord<summarity> Unrelated: little reactive effects library I've been working on: https://github.com/turbo/signals.nim - def not production ready, but it's crossed a certain threshold of usefulness for me, so I thought I'd share. 🙂
22:55:55*beholders_eye joined #nim
22:59:07FromDiscord<heysokam> In reply to @summarity "Unrelated: little reactive effects": looks interesting. is this the same concept as "observables", or more on the line of react hooks instead?
22:59:23FromDiscord<summarity> more or less, yes
22:59:58FromDiscord<summarity> (edit) "more or less, yes ... " added "- it started as just scalar signals inspired by AlpineJS, but grew from there"
23:00:15FromDiscord<heysokam> but which is it?
23:00:34FromDiscord<heysokam> A or B? answer with "yes" does not represent A or B 🙂
23:01:03FromDiscord<summarity> observables - signals are observable values
23:01:06FromDiscord<heysokam> In reply to @summarity "more or less, yes": not familiar with alpine
23:02:03FromDiscord<heysokam> I like the idea of access implying observing, without any other extra calls
23:02:46FromDiscord<summarity> I use it mostly for UIs, and keeping track of state which is auto-saved (serialized) and gives me the ability to time travel (speaking of debugging)
23:03:39FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=PGawbotA
23:03:55FromDiscord<summarity> It is not, not for this purpose anyway
23:04:02FromDiscord<Elegantbeef> `=` is not overloadable
23:04:11FromDiscord<heysokam> it is for object fields
23:04:24FromDiscord<Elegantbeef> That's not `=` now is it 😛
23:04:28FromDiscord<heysokam> but I guess not as a proc
23:04:29FromDiscord<summarity> The assignment would have to be between a `Signal[T]` and `T`, which might be possible with converters, but not in this case, as signals.nim needs acess to the LHS reactive context
23:04:30FromDiscord<Elegantbeef> that's a setter
23:04:54FromDiscord<heysokam> ic
23:06:14*skippy8 quit (Quit: WeeChat 4.5.2)
23:11:39FromDiscord<aintea> is there a way to pattern match on a non compiletime defined boolean ?
23:11:55FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=BeMkhEsb
23:12:20FromDiscord<Elegantbeef> Nope case is compile time
23:12:29FromDiscord<Elegantbeef> The branches are constant anyway
23:13:32FromDiscord<aintea> is there then no other way than having to make an if chain ?
23:13:54FromDiscord<Elegantbeef> Use a macro for match instead
23:14:05FromDiscord<Elegantbeef> Or use an enum instead of `?args.....`
23:14:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=RzIWbEiI
23:14:28FromDiscord<Elegantbeef> Why make it more complicatedd
23:14:59FromDiscord<aintea> I can't use an enum without rewriting the whole library
23:15:22FromDiscord<Elegantbeef> Of course you can
23:15:26FromDiscord<aintea> I would like to but I don't see it any other way than to rewrite the whole app to use enums
23:15:45FromDiscord<aintea> Oh no I'll have to write a macro
23:15:48FromDiscord<aintea> that's genius
23:16:18FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/blob/master/staticcases.nim some reference material for you
23:18:06FromDiscord<Elegantbeef> But you can just y'know convert those bools to an enum inside of a procedure
23:18:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=IJYZtFPO
23:18:59FromDiscord<aintea> yeah but how do I namethe enum
23:19:02FromDiscord<aintea> (edit) "namethe" => "name the"
23:19:12FromDiscord<Elegantbeef> With an identifier
23:19:20FromDiscord<aintea> maybe the enum I want to name it was already defined by the user
23:19:26FromDiscord<Elegantbeef> Oh noes
23:19:33FromDiscord<Elegantbeef> They have to prefix the enum with the module
23:19:37FromDiscord<Elegantbeef> The world is a travesty
23:21:48*thunder quit (Ping timeout: 264 seconds)
23:22:11FromDiscord<aintea> is there a way to have an identifier that is guaranteed to have never been used in the program in Nim ? Something like `mktemp` in bash
23:23:21FromDiscord<leorize> `macros.genSym` will generate you an unique symbol
23:23:37FromDiscord<leorize> if you want an identifier out of it, use `repr()` on the result
23:24:42FromDiscord<aintea> thanks
23:34:23*xet7 quit (Remote host closed the connection)
23:35:56*beholders_eye quit (Ping timeout: 265 seconds)
23:48:44FromDiscord<aintea> you know what
23:48:45FromDiscord<aintea> no macro
23:48:46FromDiscord<aintea> no enums
23:48:55FromDiscord<aintea> if I suffered making this library the users will suffer using it
23:49:12FromDiscord<aintea> no reason this shouldn't be equal
23:49:32FromDiscord<aintea> equal rights equal will to throw myself off of the nearest window in my building
23:51:46*thunder joined #nim