<< 29-05-2024 >>

00:04:57*SchweinDeBurg joined #nim
00:09:45FromDiscord<Robyn [She/Her]> https://pasty.ee/UvYUcGcJ I have no idea what this means
00:14:27*def- quit (Quit: -)
00:15:57*def- joined #nim
00:18:51FromDiscord<Elegantbeef> It means you should go to 1525 and put a `debug typeA` and `debug typeB`
00:22:34*def- quit (Quit: -)
00:26:31*def- joined #nim
00:29:31*def- quit (Client Quit)
00:30:39FromDiscord<Robyn [She/Her]> Oooh
00:31:30*def- joined #nim
00:31:32FromDiscord<Robyn [She/Her]> Wait, 1525?
00:32:02FromDiscord<Elegantbeef> `/data/data/com.termux/files/home/.nim/stable/compiler/semtypes.nim(1525) semGeneric`↵I mean that's where the callstack points
00:32:19FromDiscord<Robyn [She/Her]> Aaah
00:37:07*beholders_eye joined #nim
00:38:58FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=KXdnpmRA
01:14:28FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=PJykwssM
01:14:40FromDiscord<Robyn [She/Her]> They both have different IDs too
01:15:08FromDiscord<Elegantbeef> Neither do I, probably just the abuse to the compiler we've done
01:15:27FromDiscord<Robyn [She/Her]> 😔
01:15:47FromDiscord<Robyn [She/Her]> I doubt I can make a mvp for reproducing this issue either
01:18:51*beholders_eye quit (Read error: Connection reset by peer)
01:22:30FromDiscord<Robyn [She/Her]> I love causing compiler bugs 😔
01:22:51FromDiscord<Robyn [She/Her]> Ig I can live without those init procs
01:23:19FromDiscord<Elegantbeef> Well you arent exactly doing it by the book so it's not really expected that it works
01:24:29*beholders_eye joined #nim
01:25:02FromDiscord<Robyn [She/Her]> What else am I supposed to do tho ;-;
01:25:36FromDiscord<Robyn [She/Her]> Tbf for my usecase it should be fine since I don't need generics, but damn
01:25:54FromDiscord<Elegantbeef> Use the ugly `join:` or another DSL
01:26:04FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Use the ugly ": Join didn't work, remember?
01:26:09FromDiscord<Robyn [She/Her]> It worked for basic things
01:26:24FromDiscord<Robyn [She/Her]> But referencing a type within the same block started causing janky behaviour
01:26:24FromDiscord<Elegantbeef> It'd work just fine
01:26:44FromDiscord<Robyn [She/Her]> As in, I couldn't reference a `DotExpr`
01:27:30*def- quit (Quit: -)
01:28:29FromDiscord<Elegantbeef> You mean you needed the left hand forward declare
01:28:33*def- joined #nim
01:34:53*redj quit (Ping timeout: 240 seconds)
01:50:52*redj joined #nim
01:51:22*def- quit (Quit: -)
01:52:38*def- joined #nim
01:55:16*SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev)
02:08:57FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "You mean you needed": Yeah, but the issue with that is that the type I was doing that on was another sum type
02:12:03FromDiscord<Elegantbeef> Right so you put them all in the type section together
02:12:21FromDiscord<Robyn [She/Her]> Tbf, I could make a macro that you have to call yourself to generate the init procs
02:12:51FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Right so you put": I couldn't, this was the code: https://gist.github.com/Luyten-Orion/7a19b8fc1a1161882e79da302f1c1696
02:13:33FromDiscord<Robyn [She/Her]> Line 150, it was a `ref FunctionCall`, not DotExpr
02:14:50FromDiscord<Elegantbeef> Right but you're using my macro
02:16:10FromDiscord<Robyn [She/Her]> Yeah
02:16:27FromDiscord<Robyn [She/Her]> With my macro it isn't an issue now
02:16:35FromDiscord<Robyn [She/Her]> It's just the init proc not working with generics being annoying
02:48:37FromDiscord<Robyn [She/Her]> Genuinely clueless on why this isn't working ngl
02:49:26FromDiscord<Robyn [She/Her]> I tried copying the generic anyway instead of reusing the existing generic params but no effect
03:03:43*beholders_eye quit (Read error: Connection reset by peer)
03:09:27*beholders_eye joined #nim
03:11:58FromDiscord<Robyn [She/Her]> Oh Beef, I got the original error to go away by doing `Option[T: auto]` instead of `Option[T]`, now the error is `Error: object constructor needs an object type [genericInvocation]`
03:27:25*def- quit (Quit: -)
03:30:33*def- joined #nim
03:38:08*def- quit (Quit: -)
03:38:19*def- joined #nim
03:49:34*SchweinDeBurg joined #nim
04:19:16*beholders_eye quit (Read error: Connection reset by peer)
04:24:56*beholders_eye joined #nim
04:31:25*def- quit (Quit: -)
04:31:53*def- joined #nim
04:39:58*beholders_eye quit (Read error: Connection reset by peer)
04:46:01*beholders_eye joined #nim
04:47:17*beholders_eye quit (Read error: Connection reset by peer)
04:53:22*beholders_eye joined #nim
05:37:11*ntat joined #nim
05:47:43*beholders_eye quit (Read error: Connection reset by peer)
05:53:26*beholders_eye joined #nim
06:09:23*PMunch joined #nim
06:14:31*def- quit (Quit: -)
06:16:55*def- joined #nim
06:22:16*beholders_eye quit (Read error: Connection reset by peer)
06:28:15*beholders_eye joined #nim
06:42:53*beholders_eye quit (Read error: Connection reset by peer)
06:45:22*krux02 quit (Quit: Leaving)
06:48:34*beholders_eye joined #nim
07:06:59*ntat quit (Quit: Leaving)
07:22:12*def- quit (Quit: -)
07:22:37*def- joined #nim
07:30:45*def- quit (Quit: -)
07:31:29*def- joined #nim
07:52:14*rockcavera quit (Remote host closed the connection)
08:01:19NimEventerNew thread by Hobbyman: CodeTwig - a small project-viewer, see https://forum.nim-lang.org/t/11666
08:34:55*dtomato quit (Ping timeout: 256 seconds)
08:35:39*dtomato joined #nim
08:44:24*beholders_eye quit (Read error: Connection reset by peer)
08:50:21*beholders_eye joined #nim
08:52:07*beholders_eye quit (Read error: Connection reset by peer)
08:57:45*beholders_eye joined #nim
09:00:31*beholders_eye quit (Read error: Connection reset by peer)
09:06:08*beholders_eye joined #nim
09:07:16*beholders_eye quit (Read error: Connection reset by peer)
09:13:27*beholders_eye joined #nim
09:20:20*def- quit (Quit: -)
09:38:06*def- joined #nim
09:38:07*beholders_eye quit (Read error: Connection reset by peer)
09:42:32PMunchUhm, is it just me, or is Nims runeAt incorrect?
09:43:10FromDiscord<nnsee> how is it incorrect?
09:43:15FromDiscord<nnsee> and... repro?
09:44:13*beholders_eye joined #nim
09:44:14*beholders_eye quit (Read error: Connection reset by peer)
09:45:18PMunchI tried `"ñ".runeAt(0)` and got the expected "ñ" character, but with `"ñ".runeAt(1)` I get `±`. Now UTF-8's variable encoding is created in such a way that if you are dropped at a random byte you are able to see if this is the start of the character or not. The byte at position 1 in "ñ" should be a continuation byte and not a valid start, so I would expect `runeAt(1)` to traverse back to the start of the rune and return the correct one.
09:49:06FromDiscord<nnsee> does runeAtPos return the same result?
09:49:44PMunchWell runeAtPos takes the unicode position
09:49:49FromDiscord<nnsee> or, wait, yeah
09:49:52FromDiscord<nnsee> was just about to say
09:50:34*beholders_eye joined #nim
09:51:37FromDiscord<nnsee> right
09:51:42FromDiscord<nnsee> does seem incorrect to me as well
09:52:33PMunchLike this bit is incorrect: https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/unicode.nim#L158-L160
09:55:09FromDiscord<nnsee> seems by design, see https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/unicode.nim#L172
09:55:42PMunchYeah that documentation snippet is what led me to find this
09:57:34PMunchhttps://github.com/nim-lang/Nim/commit/36287310644b31ed3b65922075d49e58940cdd7e
09:57:50PMunchIt seems like it was done to prevent failure on "Invalid unicode bytes"
09:57:55PMunchBut they aren't invalid..
10:18:30*def- quit (Quit: -)
10:25:55Amun-Rais there a way to mark custom pragma for export?
10:27:32FromDiscord<Robyn [She/Her]> In reply to @Amun-Ra "is there a way": What do you mean?
10:28:17FromDiscord<Robyn [She/Her]> A custom pragma is defined like `template myPragma() {.pragma.}`, you can export it like any other template
10:34:17Amun-Raas in: {.pragma: eio, raises: IOError.}
10:34:38Amun-Rabut I missed that you can do that with template, too
10:34:59FromDiscord<odexine> Pragmas made by the pragma pragma cannot be exported
10:35:16FromDiscord<odexine> Aside from by using include on the source file
10:35:43Amun-Ramhm
10:39:06Amun-Rano, I can't do that with a template
10:44:52FromDiscord<odexine> Raises takes an array by the way
10:46:16Amun-Ramhm
10:47:11Amun-Rasquare brackets are not required if there's only one exception type raised
10:57:03*def- joined #nim
11:02:49*def- quit (Quit: -)
11:03:07*def- joined #nim
11:06:31FromDiscord<odexine> Is that so
11:20:07Amun-Raaye
11:24:50FromDiscord<Robyn [She/Her]> In reply to @odexine "Pragmas made by the": They can't? :/
11:28:29FromDiscord<demotomohiro> In reply to @chronos.vitaqua "They can't? :/": https://nim-lang.org/docs/manual.html#userminusdefined-pragmas
11:30:41FromDiscord<Robyn [She/Her]> Damn
11:30:44FromDiscord<Robyn [She/Her]> Seems annoying
11:39:10*def- quit (Quit: -)
11:39:51*def- joined #nim
11:40:03*_________ quit (Ping timeout: 272 seconds)
11:41:28*_________ joined #nim
11:50:50*ntat joined #nim
11:53:05*beholders_eye quit (Ping timeout: 252 seconds)
11:55:01*beholders_eye joined #nim
12:20:25*def- quit (Quit: -)
12:21:15*def- joined #nim
12:21:38FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=VGtxaElk
12:22:35FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=qTQfpmTW
12:23:16FromDiscord<System64 ~ Flandre Scarlet> can I just do ``export []`` and ``export []=``?
12:23:17FromDiscord<nnsee> using the `export` keyword?
12:23:22FromDiscord<nnsee> probably need the quotes as well
12:23:41FromDiscord<System64 ~ Flandre Scarlet> In reply to @nnsee "using the `export` keyword?": And every proc with the same name will be exported?
12:24:06FromDiscord<nnsee> i believe so, same rules as with regular procs
12:24:17FromDiscord<System64 ~ Flandre Scarlet> Oh alright, thanks!
12:32:47*beholders_eye quit (Ping timeout: 256 seconds)
12:35:34FromDiscord<demotomohiro> In reply to @ieltan "dear nim experts, is": Why dont you use `setLen` proc?
12:39:11FromDiscord<ieltan> In reply to @demotomohiro "Why dont you use": `system.setLen` can have excessive zeroing and `grow\shrink` is more explicit with what it does in my code so it's more readable
12:39:12FromDiscord<System64 ~ Flandre Scarlet> Maybe he doesn't know it, but I directly he is a C programmer
12:39:20FromDiscord<ieltan> no no, i know
12:39:30FromDiscord<System64 ~ Flandre Scarlet> (edit) "Maybe he doesn't know it, but I directly ... he" added "see"
12:39:40FromDiscord<System64 ~ Flandre Scarlet> Oh, sorry
12:39:51NimEventerNew thread by Hobbyman: Where the .. does that echo come from?, see https://forum.nim-lang.org/t/11668
12:41:54FromDiscord<ieltan> oh welp
12:42:09FromDiscord<ieltan> i'm going to know for sure if i did an oppsie once i use that code
12:42:43FromDiscord<ieltan> segfault-driven developement or something
12:50:46*def- quit (Quit: -)
12:53:12FromDiscord<demotomohiro> In reply to @ieltan "`system.setLen` can have excessive": Are you sure `grow` proc that doesn't fill zeros faster than Nim's `setLen`?↵Nim or GCC compiler cannot optimize excessive zeroing when growing string?
12:53:15*def- joined #nim
12:56:25FromDiscord<ieltan> Who knows if GCC can optimize Nim stuff properly all the time ?
12:56:55*xet7 quit (Ping timeout: 268 seconds)
12:57:42FromDiscord<ieltan> I'll do a benchmark later but fwiw there's like almost a dozen stuff on github about this issue, thats why procs like `setLenUninitialized` exists or else it wouldn't :p
12:59:02FromDiscord<ieltan> (edit) "`setLenUninitialized`" => "`setLenUninit`"
12:59:17FromDiscord<ieltan> https://github.com/nim-lang/Nim/issues/19727
13:02:57FromDiscord<demotomohiro> I think creating new optimized string type yourself is better and safer than writing code depends on internal data structure of std string type.↵iirc, data structure of string is different in old Nim ver.
13:05:00FromDiscord<ieltan> btw, this issues has references to a bunch of other `uninit` issues due to zeroMem being used, arnetheduck mentions in https://github.com/status-im/nim-stew/pull/109 that large seqs are affected greatly, so I thought GCC probably doesn't really optimize zeroMem that well and it's worth a try
13:06:23FromDiscord<ieltan> In reply to @demotomohiro "I think creating new": fair enough but the standard library already provides plenty of ways of having builtin types with uninitialized memory, i'm honestly just extending the concept.
13:06:58FromDiscord<ieltan> the language too with `{.noInit.}`
13:09:42*xet7 joined #nim
13:12:43*def- quit (Quit: -)
13:13:41*def- joined #nim
13:14:12FromDiscord<demotomohiro> In reply to @ieltan "fair enough but the": Maybe you can create a new uninitialized string with `newString`:↵https://nim-lang.org/docs/system.html#newString%2CNatural↵Then, copy `result` string content to new string and move new string to `result` string.
13:20:15*beholders_eye joined #nim
13:24:00FromDiscord<ieltan> In reply to @demotomohiro "Maybe you can create": If i want to avoid zeromem obviously i dont want to have temporaries which can be even more expensive for small strings, moving the string back to `result` doesn't really erase the fact i've had a temporary does it ?
13:33:12FromDiscord<demotomohiro> In reply to @ieltan "If i want to": When you grow the string and the string doesn't have enough capacity, you need to allocate a new heap and need to copy original string content to new allocated.↵heap.↵If the string have enough capacity, you just change len.
13:35:25*rockcavera joined #nim
13:49:45PMunch(unless realloc is successful, in which case you don't have to copy)
13:53:23FromDiscord<ieltan> Ugh sorry but no
13:55:03FromDiscord<ieltan> I don't want to make allocations in an operation like that, `realloc` is special because it's much faster, that newString and moving around method sounds much slower
13:56:27*lucasta joined #nim
14:00:05*def- quit (Quit: -)
14:00:24*def- joined #nim
14:03:00*PMunch quit (Quit: Leaving)
14:34:48*xet7 quit (Ping timeout: 252 seconds)
14:48:19*xet7 joined #nim
15:20:37FromDiscord<nervecenter> What's the latest news/progress on object variant/sum type syntax? There were threads on Github and the forum I think.
15:22:14*ntat quit (Quit: Leaving)
15:24:08FromDiscord<that_dude.> Last time I saw, the RFC stalled because Araq mentioned that he just didn't like the way the syntax worked/looked.
15:46:11FromDiscord<Robyn [She/Her]> I was making a macro to kind of emulate the syntax but it breaks on generics :P
16:00:10*def- quit (Quit: -)
16:00:41*xet7 quit (Ping timeout: 268 seconds)
16:03:16*lucasta quit (Quit: Leaving)
16:13:11*xet7 joined #nim
16:20:46*def- joined #nim
16:54:47*def- quit (Quit: -)
16:55:09*def- joined #nim
17:02:25*SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev)
17:11:05NimEventerNew thread by Araq: Cheap exceptions, opinionated error handling, see https://forum.nim-lang.org/t/11670
17:12:17*ntat joined #nim
17:16:50*beholders_eye quit (Read error: Connection reset by peer)
17:22:27*beholders_eye joined #nim
17:39:57*def-- joined #nim
17:41:14*def- quit (Ping timeout: 252 seconds)
17:41:22*def-- is now known as def-
17:46:08FromDiscord<dolfy0191> sent a code paste, see https://play.nim-lang.org/#pasty=EGeNfJwb
17:47:50FromDiscord<dolfy0191> sent a code paste, see https://play.nim-lang.org/#pasty=IIarOeZC
17:48:40FromDiscord<dolfy0191> ah, probably I should create a type for `myArr`
17:49:42*lucerne quit (Quit: Ping timeout (120 seconds))
17:50:42*cornfeedhobo quit (Quit: ZNC - https://znc.in)
17:50:58*lucerne joined #nim
17:51:00*def- quit (Quit: -)
17:51:31FromDiscord<dolfy0191> yep. A bit convoluted, but works. Thanks anyway
17:51:34*def- joined #nim
17:54:20NimEventerNew thread by pegra4: Karax, input: readonly; textarea: set and get cursor position, see https://forum.nim-lang.org/t/11672
17:54:29*def- quit (Client Quit)
17:55:14*def- joined #nim
17:56:26*cornfeedhobo joined #nim
17:59:11*krux02 joined #nim
18:00:30*ntat quit (Quit: Leaving)
18:03:32*def- quit (Quit: -)
18:21:40*def- joined #nim
18:27:02*def- quit (Quit: -)
18:27:43*def- joined #nim
18:34:46*def- quit (Quit: -)
18:35:26*def- joined #nim
18:36:52FromDiscord<pmunch> In reply to @dolfy0191 "yep. A bit convoluted,": Uhm, you don't need a type for your array..
18:37:02FromDiscord<pmunch> But you seem to have the array syntax confused
18:52:04FromDiscord<Phil> Man, discussions in #internals really serve to keep me humble
18:52:24FromDiscord<Phil> I read that stuff and am very quickly confronted with the fact that I know nothing and apparently my name is Jon Snow
19:02:06*ntat joined #nim
19:40:36FromDiscord<zidsal> don't panic Phil, unless someone can convince me otherwise #internals is clearly just a markhov chain bot
20:09:11*def- quit (Quit: -)
20:09:22*def- joined #nim
20:11:20*ntat quit (Quit: Leaving)
20:32:19*def- quit (Quit: -)
20:32:44*def- joined #nim
21:03:06*xet7 quit (Ping timeout: 252 seconds)
21:08:54FromDiscord<the_real_hypno> In reply to @isofruit "Man, discussions in <#768367394547957761>": Same but i always tell myself that the reason for it is just that i have been confronted with those things
21:09:06FromDiscord<the_real_hypno> (edit) "have" => "havent"
21:09:12FromDiscord<the_real_hypno> (edit) "things" => "things, yet"
21:10:02FromDiscord<the_real_hypno> Also, your name is Phil, like mine
21:16:47*xet7 joined #nim
21:27:35*SEP quit (Ping timeout: 264 seconds)
21:35:02*SEP joined #nim
21:35:08*def- quit (Quit: -)
21:35:39*def- joined #nim
21:52:15*def- quit (Quit: -)
21:53:04*def- joined #nim
21:55:58*def- quit (Client Quit)
21:56:21*def- joined #nim
21:59:37*def- quit (Client Quit)
22:01:05*def- joined #nim
22:05:35*def- quit (Client Quit)
22:05:48*def- joined #nim
22:15:35*pmp-p quit (Ping timeout: 264 seconds)
22:18:59FromDiscord<shad.ow> does anyone know of decent `nimwave` docs ?
22:19:09FromDiscord<shad.ow> i'm reading the example right now and i'm slowly getting the gist but it's rather daunting
22:25:51FromDiscord<Robyn [She/Her]> Hey Beef, you know how there's an issue with generics being all funky? What if `init` procs were instead generated as `proc init[T: Some](_: typedesc[T], val: T.T): T = T(Option[T.T](SomeData: val))`?
22:26:18FromDiscord<Robyn [She/Her]> It miiiight work? I'm gonna try it but if it doesn't, oh well
22:30:04*pmp-p joined #nim
22:52:10*beholders_eye quit (Read error: Connection reset by peer)
22:58:14*beholders_eye joined #nim
23:11:39FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "It miiiight work? I'm": It doesn't work
23:12:11FromDiscord<Robyn [She/Her]> I really don't get why though
23:21:16FromDiscord<Robyn [She/Her]> Tbf, init procs aren't needed and everything else works for the generics ig
23:22:12*cnx quit (Remote host closed the connection)
23:23:27*cnx joined #nim
23:25:08*beholders_eye quit (Read error: Connection reset by peer)
23:26:28*def- quit (Quit: -)
23:27:10*def- joined #nim
23:31:01*beholders_eye joined #nim
23:58:38FromDiscord<Robyn [She/Her]> https://nim-lang.org/docs/tables.html#sort%2CCountTable%5BA%5D what does this mean by destructive?
23:59:07*def- quit (Quit: -)
23:59:15FromDiscord<Robyn [She/Her]> Why can't I modify the table after?
23:59:41FromDiscord<Elegantbeef> Cause it's no longer sorted