<< 15-12-2022 >>

00:00:52FromDiscord<ShalokShalom> @c4ulmu#0000 thats languages vs implementations
00:01:32FromDiscord<ShalokShalom> Different implementations for Python, Ruby and others are actually not GIL locked
00:01:35*ltriant quit (Read error: Connection reset by peer)
00:01:55FromDiscord<c4ulmu> Yes, of course if they are based on java they gonna have multithreading
00:01:59FromDiscord<ShalokShalom> A language is not GIL locked itself.↵See Graal
00:02:06FromDiscord<ShalokShalom> Or Truffle
00:02:35FromDiscord<c4ulmu> But default mostly used implementations lacks normal multithreading
00:02:55FromDiscord<c4ulmu> it is kind of strange for me
00:03:47FromDiscord<ShalokShalom> That's historic cruft
00:03:57FromDiscord<ShalokShalom> Multi threading was not important
00:04:15FromDiscord<ShalokShalom> Erlang has that, since it was important in their use case
00:04:50FromDiscord<ShalokShalom> Multi threading makes no sense, if there are no multi threads 😅
00:06:46*ltriant joined #nim
00:13:40FromDiscord<@thatrandomperson5-6310e3b26da03> Can someone please explain why this does not work\: https://play.nim-lang.org/#ix=4iD3
00:15:27FromDiscord<Gumbercules> In reply to @ShalokShalom "Multi threading makes no": well - you can use software / green threads
00:21:06FromDiscord<Rika> Generics can’t be stored
00:21:16FromDiscord<Rika> They don’t exist until a type is given to make them concrete
00:33:51*rez quit (Quit: l8r)
00:42:03FromDiscord<@thatrandomperson5-6310e3b26da03> Then how would i type that?
00:46:06FromDiscord<amadan> sent a code paste, see https://paste.rs/SsD
00:47:30FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4iDc
00:47:44FromDiscord<! Nilts> (edit) "https://play.nim-lang.org/#ix=4iDc" => "https://play.nim-lang.org/#ix=4iDd"
00:49:44FromDiscord<albassort> i wrote some eldritch code
00:49:49FromDiscord<albassort> and I rewrote it
00:49:56FromDiscord<albassort> and it was around 700% slower
00:50:16FromDiscord<albassort> why must I have this horrid fucking code
02:16:14*arkurious quit (Quit: Leaving)
02:16:22*rockcavera quit (Remote host closed the connection)
02:33:52*wallabra quit (Ping timeout: 256 seconds)
02:34:34*wallabra joined #nim
02:42:59*rockcavera joined #nim
02:52:15*wallabra quit (Remote host closed the connection)
02:54:24*wallabra joined #nim
03:31:32FromDiscord<albassort> what optimization do to a mf
03:33:29FromDiscord<Rika> pessimization
03:36:26FromDiscord<albassort> the stdlib codes something completely differently than how i would and I don't know if its for speeds sake or because its ancient and disgusting
03:36:38FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iDG
03:37:04FromDiscord<huantian> the obvious way would be to do a string slice
03:37:06FromDiscord<huantian> however this does a copy
03:37:20FromDiscord<huantian> so when you compare it character by character, it doesn't have to copy a big string
03:37:35FromDiscord<albassort> not trying to copy
03:38:38FromDiscord<huantian> well what's your code?
03:38:52FromDiscord<albassort> im writing it now but im optimizing something so its very specific
03:38:55FromDiscord<albassort> to what im doing
03:41:33FromDiscord<Rika> Do you need to optimise it or are you doing it because you think it’s slow
03:42:23FromDiscord<albassort> In reply to @Rika "Do you need to": I need to because the way i was doing it before was 20x slower than starts with
03:42:29FromDiscord<albassort> and startswith doesn't meet my needs
03:42:39FromDiscord<albassort> (edit) "starts with" => "startswith"
03:43:49FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iDJ
03:44:28FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4iDJ" => "https://play.nim-lang.org/#ix=4iDL"
03:44:52FromDiscord<albassort> ah wait i wrote this wrong
03:46:57FromDiscord<albassort> im hoping this is only 3x slower than starts with
03:57:28FromDiscord<albassort> 0.07999719499999999↵vs↵0.007708121999999998
03:57:57FromDiscord<albassort> only 10x slower
03:58:05FromDiscord<albassort> before, i got the power wrong, it was 200x slower
03:59:26FromDiscord<Elegantbeef> To openarray ftw↵(@huantian)
04:00:14FromDiscord<albassort> In reply to @Elegantbeef "To openarray ftw (<@300050030923087872>)": i guess i could do that but im not working in ascii so i would need to chunk it by 3
04:00:24FromDiscord<albassort> which would remove any benefit
04:00:36FromDiscord<Elegantbeef> If you're using `startswith` you dont need to worry about utf8
04:00:48FromDiscord<albassort> no i mean in my implementaiton
04:00:51FromDiscord<albassort> (edit) "implementaiton" => "implementation"
04:01:04FromDiscord<albassort> for my specific usecase
04:02:00FromDiscord<Elegantbeef> 😄
04:02:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iDQ
04:02:27FromDiscord<Elegantbeef> Of course we can use `equalMem` instead of the slicing
04:03:24FromDiscord<Elegantbeef> Easy simd optimisation for startwith
04:05:03FromDiscord<huantian> make a pr beef I dare you
04:05:18FromDiscord<Elegantbeef> Nah araq no like strutils to use `openarray[char]`
04:05:53FromDiscord<Elegantbeef> "Strutils doesnt need low level logic" or something silly like that
04:06:14FromDiscord<Elegantbeef> On the plus side we can remake strutils in userspace and just use that with openarray
04:06:26FromDiscord<Elegantbeef> Unicode and parseutils now use `openarray[char]` in devel
04:06:36FromDiscord<Elegantbeef> So the two important modules already use the 0 cost version
04:07:36FromDiscord<Elegantbeef> For context the simd comment was mainly just `startsWith` is actually quite good for simd
04:08:52FromDiscord<Elegantbeef> Load you register and your buffers if your result is all on up to your last interested byte you've got a starts with
04:12:27FromDiscord<Elegantbeef> I do now kinda want to see how much faster simd startswith is
04:13:56FromDiscord<メッリーレイムー 🎄> how do i convert this python code to nim? toying around w/ making a parsec style library thing↵> ParserP = tp.Callable[[str], tp.Tuple[tp.Any, str]]
04:14:13FromDiscord<Elegantbeef> If i knew what any of that did it'd tell you
04:14:25FromDiscord<huantian> > `Any`↵you can't do that here heh
04:14:39FromDiscord<メッリーレイムー 🎄> could I just create a generic type then?
04:14:55FromDiscord<メッリーレイムー 🎄> it just has to model `(str, (A, rest_str))`
04:15:00FromDiscord<huantian> yeah
04:15:07FromDiscord<メッリーレイムー 🎄> how would i do thta?
04:15:44FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4iDS
04:16:50FromDiscord<メッリーレイムー 🎄> gotcha, thank
04:17:55FromDiscord<huantian> also I have never seen anyone `import typing as tp`, is that a convention? I've always just `import` `from`ed typing
04:24:23FromDiscord<Gumbercules> yes
04:24:42FromDiscord<Gumbercules> import from gets pretty unwieldy if you need to import more than one or two symbols
04:47:08FromDiscord<メッリーレイムー 🎄> @huantian i get the dumbest error ever
04:47:21FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iDY
04:47:35FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iDZ
04:47:37FromDiscord<メッリーレイムー 🎄> how do i go about this
04:47:44FromDiscord<huantian> Ah yeah I love that error
04:48:02FromDiscord<メッリーレイムー 🎄> sarcasm?
04:48:14FromDiscord<huantian> Yeah I’ve gotten that error before too lol
04:48:26FromDiscord<メッリーレイムー 🎄> how to fix
04:49:18FromDiscord<huantian> 1s
04:49:21FromDiscord<メッリーレイムー 🎄> kk
04:50:55FromDiscord<huantian> You seem to be a bit confused witht the return type in your type def
04:51:27FromDiscord<huantian> right now you're saying f should be a function that takes in a single argument that's a `string`
04:51:36FromDiscord<huantian> and returns a `(string, (string, A))`
04:51:53FromDiscord<huantian> but you give it a function that takes a single argument and returns a `(string, A)`
04:52:07FromDiscord<huantian> also, you can't name your function parameter `string` because that's the name of a type
04:52:11FromDiscord<メッリーレイムー 🎄> it s hould be this btw
04:52:22FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iE0
04:52:23FromDiscord<メッリーレイムー 🎄> In reply to @huantian "also, you can't name": i didnt do it??
04:52:35FromDiscord<メッリーレイムー 🎄> oh wait
04:52:38FromDiscord<メッリーレイムー 🎄> im braindead
04:52:41FromDiscord<メッリーレイムー 🎄> thats not the type right?
04:52:54FromDiscord<メッリーレイムー 🎄> oh well it still btiches at me
04:53:05FromDiscord<メッリーレイムー 🎄> (edit) "https://play.nim-lang.org/#ix=4iE0" => "https://paste.rs/2E4"
04:54:11FromDiscord<huantian> ig you have to do `let pc = Parser[char](f: (s: string) => ("abcdef", ("Error", 'a')))`
04:57:16FromDiscord<Elegantbeef> You kids and your new fangled arrow operators 😛
05:01:31FromDiscord<albassort> In reply to @Elegantbeef "Nah araq no like": make your own strutils
05:01:35FromDiscord<albassort> i will use it
05:08:46*rockcavera quit (Remote host closed the connection)
05:15:29FromDiscord<メッリーレイムー 🎄> In reply to @Elegantbeef "You kids and your": its called a lambda grand dad :p
05:15:45FromDiscord<Elegantbeef> It's an arrow operator
05:16:01FromDiscord<メッリーレイムー 🎄> no its lambda
05:16:04FromDiscord<メッリーレイムー 🎄> 😔
05:16:55FromDiscord<albassort> its called an anonymous function
05:18:46FromDiscord<albassort> In reply to @huantian "ig you have to": i dont understand how these work in nim or haskell
05:19:01FromDiscord<albassort> and why you'd use them a not be normal and just write a normal function
05:19:09FromDiscord<albassort> seems needlessly ugly
05:20:16FromDiscord<Gumbercules> `=>` is just syntactic sugar you could write a normal procedure there
05:20:38FromDiscord<Gumbercules> what makes it anonymous is the fact that the procedure has no symbol associated with it
05:21:01FromDiscord<Gumbercules> if you're only ever going to invoke that particular function once, why write it elsewhere to be used?
05:21:18FromDiscord<Gumbercules> it's actually more explicit and readable to make it an anonymous function
05:21:21FromDiscord<Gumbercules> then the user knows that it is only available to be invoked in that scope
05:23:30FromDiscord<albassort> ok but
05:23:38FromDiscord<albassort> from nim by example
05:23:46FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iE3
05:23:46FromDiscord<albassort> why do this when you can do this
05:24:08FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iE4
05:24:23FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4iE4" => "https://play.nim-lang.org/#ix=4iE5"
05:25:17FromDiscord<albassort> @Gumbercules
05:26:41FromDiscord<Gumbercules> well one is more explicit and readable
05:26:41FromDiscord<Gumbercules> the former
05:27:01FromDiscord<Gumbercules> if I'm reading your code I have to figure out what `powersOfTwo.filtter` accepts as an argument
05:27:10FromDiscord<Elegantbeef> I mean to each their own, i personally dislike the arrow operators
05:27:18FromDiscord<albassort> the first one bombards you with a ton of info you dont need
05:27:19FromDiscord<Gumbercules> `x` could be an `int`, a `uint` an `int32` a `uint32` etc...
05:27:27FromDiscord<albassort> int and bool
05:27:30FromDiscord<albassort> you don't needthat
05:27:36FromDiscord<Gumbercules> you do need it if you don't know what `powerOfTwo` accepts
05:27:50FromDiscord<albassort> . > yields a bool and its between two ints so you don't need any type info
05:27:55FromDiscord<albassort> you already know the types
05:27:58FromDiscord<Gumbercules> no you don't
05:28:09FromDiscord<albassort> the extra types makes you re-read the proc and make sure you're not wrong
05:28:11FromDiscord<Elegantbeef> `>` can be user defined
05:28:36FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iE6
05:28:39FromDiscord<albassort> ok it can be but at that point you have bigger problems than using non specific arrow functions
05:28:44*ltriant quit (Ping timeout: 252 seconds)
05:28:51FromDiscord<Gumbercules> well you don't if you're explicit
05:28:54FromDiscord<Elegantbeef> this is all down to user preference
05:29:00FromDiscord<Gumbercules> then you have no problem 🙂
05:29:01FromDiscord<Elegantbeef> There is not much reason to dispute here
05:29:22FromDiscord<albassort> this is a friendly discussion on minor snytax
05:29:26FromDiscord<albassort> (edit) "snytax" => "syntax"
05:29:38FromDiscord<Gumbercules> beef isn't friendly, he's like the one Canadian that isn't
05:29:46FromDiscord<Gumbercules> he'll kill you over minor syntax
05:29:58FromDiscord<Elegantbeef> over allocations\
05:30:02FromDiscord<Gumbercules> with his hands
05:30:05FromDiscord<Gumbercules> or paws
05:30:13FromDiscord<Gumbercules> still not sure if he's the dog in his picture or not
05:30:17FromDiscord<Gumbercules> avatar, excuse me
05:30:28FromDiscord<Gumbercules> I sound as old as I am
05:30:31FromDiscord<Elegantbeef> The dogs in my PFPs are too small to kill anything
05:30:39FromDiscord<Gumbercules> my dickhead dog bit me tonight
05:30:57FromDiscord<Gumbercules> she always does when she's trying to fight the neighbor dogs through our fence
05:31:10FromDiscord<Gumbercules> fucking chihuahuas
05:31:46FromDiscord<albassort> if your code isn't typesafe assembly beef will come to your house and kill you
05:32:07FromDiscord<Elegantbeef> The fuck is type safe assembly
05:32:20FromDiscord<Gumbercules> that's like a blank check to kill everyone
05:32:31FromDiscord<albassort> i mean extremely low level nim
05:33:00FromDiscord<Gumbercules> lol Improbable's military consulting metaverse arm went belly up
05:33:14FromDiscord<Elegantbeef> Unlikely
05:33:16FromDiscord<Gumbercules> I swear there has never been a more useless company on the face of the planet
05:33:32FromDiscord<Gumbercules> minus the one SBF just sunk
05:33:40FromDiscord<Gumbercules> and Theranos or whatever that lady's company was named
05:33:50FromDiscord<albassort> damn i wish i could use the super low level start with but i need to do unicode
05:33:51FromDiscord<albassort> 😭
05:33:53FromDiscord<Elegantbeef> FTX was a grand company
05:33:56FromDiscord<Elegantbeef> It was a nice inverted funnel
05:34:10FromDiscord<Gumbercules> it was....
05:34:16FromDiscord<Elegantbeef> Startwith doesnt need unicode support↵(@albassort)
05:34:18FromDiscord<Gumbercules> now its going to be a funnel into SBF's butthole
05:34:23FromDiscord<Gumbercules> filled with penis
05:34:30FromDiscord<Gumbercules> in prison
05:34:56FromDiscord<Rika> why does startswith have to be unicode compatible
05:35:06FromDiscord<Elegantbeef> Startwith is one of the few operators that needs no unicode support
05:35:33FromDiscord<Elegantbeef> if the start of the string matches the prefix it's starts with
05:35:43FromDiscord<Elegantbeef> There is no unicode needed as there is no indexxing offset or anything
05:37:12FromDiscord<albassort> In reply to @Elegantbeef "Startwith doesnt need unicode": mine does
05:37:21FromDiscord<Elegantbeef> Why?
05:37:34FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iE8
05:38:20FromDiscord<Elegantbeef> You're not even using unicode properly
05:38:27FromDiscord<Elegantbeef> Ah nvm
05:38:31FromDiscord<Elegantbeef> I missed the `toRunes`
05:40:02FromDiscord<albassort> In reply to @Elegantbeef "I missed the `toRunes`": editing the code to make that more clear
05:40:31FromDiscord<Elegantbeef> Dont convert the `Rune` to an int
05:40:46FromDiscord<Elegantbeef> It's an int32 internally
05:42:04FromDiscord<Gumbercules> https://github.com/tail-wag-games/frag only 77.5% asm now
05:42:05FromDiscord<albassort> neat
05:42:09FromDiscord<Gumbercules> yeet
05:42:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iE9
05:43:15FromDiscord<Elegantbeef> whoops `max(ouni, suni)`
05:44:31FromDiscord<albassort> i dont know what max does
05:44:46FromDiscord<Elegantbeef> takes the largest of two values
05:45:02FromDiscord<Elegantbeef> It seems you're just trying to see if the runes are specific runes though
05:45:30FromDiscord<albassort> no i only wanna do it if they fall between 2 blocks
05:46:03FromDiscord<albassort> im just making 2 orthogonal unicode blocks work via an offset
05:46:30FromDiscord<albassort> > orthogonal↵i used that word wrong
05:46:49FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1052824029016358974/image.png
05:46:53FromDiscord<Gumbercules> 75.5 even
05:47:08FromDiscord<Elegantbeef> 100% too much asm
05:47:14FromDiscord<Gumbercules> nah
05:47:22FromDiscord<Gumbercules> it's just for set and jmp context
05:48:00FromDiscord<Gumbercules> it's - https://github.com/boostorg/context - minus boost
05:48:59FromDiscord<Gumbercules> https://github.com/boostorg/context/tree/develop/src/asm
05:49:38FromDiscord<Elegantbeef> albassort using words what are you trying to do with your code
05:50:02FromDiscord<Elegantbeef> My understanding is if your two characters are in a given range you want to return true
05:50:10FromDiscord<Elegantbeef> well two runes
05:52:24arkanoidhow would you write a function that checks if any float field of a flat object is NaN or Inf?
05:53:19arkanoidI'm trying with fieldPairs but field inside the loop doesn't work with "if field.classify == fcNaN or field.classify == fcInf"
05:55:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iEc
05:57:53FromDiscord<albassort> In reply to @Elegantbeef "My understanding is if": MY CODE SPEAKS FOR ITSELF
05:58:28FromDiscord<albassort> ok lemme do it visually
05:59:38FromDiscord<albassort> sent a long message, see http://ix.io/4iEd
05:59:42FromDiscord<albassort> or something
06:00:06FromDiscord<Rika> if you named your variables better perhaps you would have an easier time
06:03:58arkanoidElegantbeef, thanks, but it doesn't pass my tests
06:04:19arkanoidI'm trying to understand why
06:16:48*kenran joined #nim
06:17:05arkanoidI hardly believe I am the only one having such serious issues with nimsuggest.
06:17:50*kenran quit (Remote host closed the connection)
06:17:54arkanoidI have to reboot my machine (hard reboot!) Every 45/60 minutes when I try to make it work, as it fills the ram even before I can switch to console
06:19:26arkanoidI have to work without any of its service, especially check, otherwise goodbye productivity
06:21:21arkanoidThis is a rant, I know, but I'm baffled by the lack of viable solution. I've tested vscode extension with and without lsp (both nimlsp and nimlangserver) everytime the same problem, HUGE memory leaks. Even when it seems to not be crashing the machines, it takes on average 8/9 GB of ram
06:24:11FromDiscord<Rika> you arent the only one, yes
06:25:52FromDiscord<ezquerra> The tooling situation is IMHO the least mature / nice part of nim’s ecosystem
06:35:51FromDiscord<Gumbercules> It doesn't ever require me to hard reboot my machine
06:36:04FromDiscord<Gumbercules> either of them
06:36:53FromDiscord<Gumbercules> the thing that annoys me about Nimsuggest is when I want to build a new version of Nim and its running in the background
06:37:31FromDiscord<Gumbercules> other than that - sure it leaks and has resource issues or whatever but if it was bothering me that much I'd just turn it off
06:38:27FromDiscord<Gumbercules> I think maybe I just have code completion turned off for Nim in VSCode or something - don't really need it at this point anyway...
06:45:47FromDiscord<ezquerra> One little thing that indicates that tooling is not at the top of the nim project’s priorities is that there is not even a “#tools” discord channel. There is only a #nimble channel
06:47:52FromDiscord<Elegantbeef> When it comes to nimsuggest it's apart of the compiler so #internals makes sense
06:51:19arkanoidI don't think I am writing the most complex piece of project in nim galaxy, how comes nimsuggest wants 8/10GB or ram space and a whole cpu core to work
06:51:53FromDiscord<Elegantbeef> Runaway nimsuggest likes running away
06:58:09arkanoidElegantbeef, I'm fighting trying to make your isNan solution to work, but I thing all drills down to -ffast-math
06:58:27FromDiscord<Rika> oh definitely, NaNs are fucked with in fast math
06:58:52arkanoidbut math.isNan docs says it works with ffast-math
07:05:07FromDiscord<pyolyokh> what math.isNan actually does is call the isnan() macro from math.h. Maybe that works with -ffast-math in some cases but not yours. It expands to a C compiler builtin for me.
07:15:58*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
07:17:02*ehmry joined #nim
07:20:44FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4iEl
07:20:57FromDiscord<Gumbercules> https://stackoverflow.com/questions/7420665/what-does-gccs-ffast-math-actually-do
07:21:15FromDiscord<Gumbercules> arkanoid ^
07:23:01FromDiscord<arkanoid> Whoops
07:23:41FromDiscord<arkanoid> Well, then, I am the the wrong position. Thanks for the pointer
07:25:04*PMunch joined #nim
07:43:39arkanoidElegantbeef, toggling ffast-math makes it work
08:16:11PMunchHmm, is there a way to make Nim know that it depends on an external file? Currently I have to use `nim c -f` in order to make sure it rebuilds even if I didn't change anything in the Nim files
08:16:18*Amun-Ra_ is now known as Amun-Ra
08:20:12FromDiscord<Elegantbeef> I dont think so
08:25:26FromDiscord<amadan> perform `staticRead` on the file maybe?↵quick glace at the impl seems like it adds it to the module so assuming it would recheck?
08:31:14FromDiscord<Elegantbeef> It should indeed
08:32:31FromDiscord<ajusa> Anyone know if there is a library that has Pick/Omit utility types, similar to typescript?
08:32:54FromDiscord<ajusa> Would something like that even be possible using macros in Nim?
08:33:26FromDiscord<Elegantbeef> Wouldnt a concept just fit that?
08:33:42FromDiscord<Elegantbeef> Oh wait never mind
08:33:43FromDiscord<Elegantbeef> Misunderstood
08:33:48FromDiscord<Elegantbeef> Yea a macro could make this possible
08:34:02FromDiscord<ajusa> Yeah, I'm talking about generating a new type that is a subset of an existing type
08:42:25FromDiscord<ricky> just found out there's a bad clone of nim
08:42:28FromDiscord<ricky> and it's super laggy..
08:42:32FromDiscord<ricky> ||python||
08:53:03FromDiscord<Elegantbeef> @ajusa I couldnt help myself to expand micros' example base https://github.com/beef331/micros/blob/master/tests/t_tsinspiredmacros.nim#L4-L46
08:54:51FromDiscord<Bung> oh, macro madman
08:55:35FromDiscord<Elegantbeef> Hey micros makes this actually readable
08:58:45FromDiscord<Bung> maybe you can do more like https://www.typescriptlang.org/docs/handbook/utility-types.html and https://github.com/sindresorhus/type-fest
08:59:41FromDiscord<Elegantbeef> What do you mean?
09:00:25FromDiscord<Bung> don't know , didn't look in deep, just for inspiration
09:00:40FromDiscord<Elegantbeef> I mean I copied omit and pick verbatim from there
09:00:52FromDiscord<Elegantbeef> Remove all fields that match a name, and keep all fields that match a name
09:04:46FromDiscord<Bung> I guess there can have some Optional fields combine with options module
09:09:06FromDiscord<Elegantbeef> It doesnt make much sense in Nim eitherway given most people dont use concepts
09:09:28FromDiscord<Bung> ok then.
09:16:28FromDiscord<nonce> sent a code paste, see https://play.nim-lang.org/#ix=4iEA
09:18:14FromDiscord<ajusa> Thanks beef! That's shockingly readable honestly
09:19:01FromDiscord<Elegantbeef> What line does it error on?
09:19:50FromDiscord<Elegantbeef> Yea micros aims to be readable
09:23:10FromDiscord<nonce> In reply to @Elegantbeef "Yea micros aims to": db.exec
09:23:19FromDiscord<nonce> (edit) "db.exec" => "sec"
09:25:10FromDiscord<nonce> argh, was looking at the wrong file. pardòn
09:53:51FromDiscord<ShalokShalom> In reply to @Gumbercules "beef isn't friendly, he's": haha, yeah he contains all the meanness and Nim skills of the entire nation 🇨🇦
09:53:56FromDiscord<ShalokShalom> 😄
09:57:08*pro joined #nim
09:57:28*pro left #nim (#nim)
10:25:05FromDiscord<BenitzCoding> Question, why should I start coding in Nim over other languages like Python and JS as a former Python Developer? Are there advantages?
10:30:46FromDiscord<leetnewb> In reply to @BenitzCoding "Question, why should I": Static typed and the ability to compile to a binary is nice
10:31:04FromDiscord<BenitzCoding> In reply to @leetnewb "Static typed and the": Anything else?
10:31:08FromDiscord<BenitzCoding> Is it as simple as Python?
10:39:55FromDiscord<leetnewb> Not exactly, but it depends on what you're trying to do
10:40:32FromDiscord<leetnewb> Pretty similar in getting basic stuff done
10:41:06FromDiscord<BenitzCoding> Interesting... Are there docs or examples I can go through?
10:41:29FromDiscord<Rika> https://nim-lang.org/docs/manual.html
10:41:43FromDiscord<BenitzCoding> Thank you!
10:41:45FromDiscord<Rika> there are other thirdparty documents but i do not know them
10:42:03FromDiscord<Rika> the third party documents are easier to go through if you're having difficulty with the manual
10:42:22FromDiscord<leetnewb> I've used the manual and this: https://ssalewski.de/nimprogramming.html
10:43:01FromDiscord<leetnewb> Also coming from python: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
10:46:10FromDiscord<BenitzCoding> Kinda feel like JavaScript + Bash with Python Syntax.
10:46:17FromDiscord<BenitzCoding> (edit) "feel" => "feels"
10:46:34FromDiscord<BenitzCoding> In reply to @leetnewb "Also coming from python:": Thank you!
10:48:19*PMunch quit (Quit: Leaving)
11:15:30FromDiscord<leetnewb> In reply to @BenitzCoding "Thank you!": Sure. One other thing I'd mention - this channel/community is very active and helpful. Not sure how that compares to other languages though.
11:18:47FromDiscord<nocturn9x> I have a question
11:18:55FromDiscord<nocturn9x> say I have a `Compiler` type
11:19:03FromDiscord<nocturn9x> then I subtype it with a `BytecodeCompiler` type
11:19:18FromDiscord<nocturn9x> `Compiler` defines a bunch of functions such as `unary` which return nil in the stub implementation
11:19:53FromDiscord<nocturn9x> if I declare them as `method` and then call `self.unary()` in a function declared in `Compiler`, will it work if I then also call that function from `BytecodeCompiler`? i.e. will the correct type dispatching occur
11:20:01FromDiscord<nocturn9x> (edit) "occur" => "occur?"
11:22:45FromDiscord<ShalokShalom> In reply to @leetnewb "Sure. One other thing": Oh, Python is crazy supportive on their Discord↵↵But here its more familiar 😊
11:29:20FromDiscord<leetnewb> In reply to @ShalokShalom "Oh, Python is crazy": Fair enough. I was always bothered by /r/python shoving all questions to /r/learnpython rather than just using flairs, but I suppose I can't paint the entire community.
11:31:05FromDiscord<ShalokShalom> Python on Discord had channels that you could claim
11:31:18FromDiscord<ShalokShalom> And then you could close the question
11:31:28FromDiscord<ShalokShalom> To open the channel for someone else
11:31:42FromDiscord<ShalokShalom> Now, they are doing the same, just with the new forums feature
11:32:14FromDiscord<ShalokShalom> And it takes approximately 10 to 60 seconds, to get your answer, and mostly pretty straight
11:32:52FromDiscord<ShalokShalom> But for social activities, it is way too overcrowded for me, personally
11:33:00FromDiscord<leetnewb> That sounds surprisingly functional
11:33:23FromDiscord<ShalokShalom> Well, they have a heckton of people
11:33:29FromDiscord<ShalokShalom> Its kinda nessecary
11:33:57FromDiscord<ShalokShalom> The old system had the downside, that you could be typing, which ultimately locks the channel for one, and somebody is faster
11:34:04FromDiscord<ShalokShalom> That is solved now
11:34:35FromDiscord<leetnewb> Certainly a vast ecosystem
11:43:53*ltriant joined #nim
11:52:52FromDiscord<BenitzCoding> In reply to @leetnewb "Sure. One other thing": I can see that, most official communities are very toxic, this one on the other hand, seems nice and helpful!
11:58:42FromDiscord<ShalokShalom> You will see, Nim as a language is also like that
11:58:50FromDiscord<ShalokShalom> 😉
11:59:50FromDiscord<Phil> sent a long message, see http://ix.io/4iF4
12:03:01FromDiscord<ShalokShalom> Phil should maintain the homepage :nim1:
12:03:23FromDiscord<Phil> Personally, nim had me at "python-like syntax but with static typing and compiles to a binary", I'll be honest
12:04:02FromDiscord<Phil> What you want is foster off that task to somebody so its more actively maintained 😛
12:04:12FromDiscord<nocturn9x> I can't seem to get methods working the way I like
12:05:29FromDiscord<nocturn9x> I have a module defining some methods that take a generic `self` argument of type `A` and just return `nil`, then I reimplement a specialized version of them with `self`'s type being `B of A`. The module defining `A` has some other method `m` that calls other methods, but Nim is always dispatching to my stubs rather than using RTTI to dispatch to my specialized versions
12:05:47FromDiscord<nocturn9x> module `B` calls `A`'s implementation of `m`, so `self` is of type `B of A`
12:08:52FromDiscord<Rika> can you show code because your terminology doesnt seem to be the same terminology for nim
12:08:59FromDiscord<ShalokShalom> In reply to @Isofruit "What you want is": Well you can compile Python to a binary
12:09:06FromDiscord<ShalokShalom> And it has limited typing
12:09:14FromDiscord<ShalokShalom> But I think Nim is more
12:09:23FromDiscord<nocturn9x> In reply to @Rika "can you show code": uhm
12:09:27FromDiscord<nocturn9x> it's like well over 3000 lines
12:09:28FromDiscord<ShalokShalom> It's the complete package
12:09:37FromDiscord<nocturn9x> I'll try to keep it concise
12:09:44FromDiscord<nocturn9x> let me write a short snippet
12:12:04FromDiscord<nocturn9x> sent a code paste, see https://paste.rs/pLZ
12:13:12FromDiscord<nocturn9x> I'd expect that when I call `self.infer()` from within `target.nim` with `self` being of type `BytecodeCompiler`, that when it calls `identifier()` it gets dispatched to my implementation for `BytecodeCompiler` rather than the stub returning `nil`
12:13:27FromDiscord<Rika> `type Compiler = ref object {.inheritable.}` -> `type Compiler = ref object of RootObj`↵first identifier and infer should have `{.base.}`
12:13:37FromDiscord<nocturn9x> ohhh
12:13:44FromDiscord<nocturn9x> stupid me
12:14:09FromDiscord<Rika> ah wait
12:14:11FromDiscord<Rika> not infer
12:14:13FromDiscord<Rika> just identifier
12:14:30FromDiscord<nocturn9x> ye, thx
12:15:30FromDiscord<nocturn9x> doesn't seem to be doing anything apparently
12:15:36FromDiscord<nocturn9x> should the `base` impl. be a stub
12:15:38FromDiscord<nocturn9x> without any body
12:16:39FromDiscord<Rika> no
12:16:45FromDiscord<Rika> not that i recall
12:16:59FromDiscord<Rika> include the parameters
12:17:02FromDiscord<Rika> the first one of each function
12:17:08FromDiscord<nocturn9x> I do
12:17:11FromDiscord<Rika> In reply to @Rika "include the parameters": in the demo
12:17:14FromDiscord<Rika> to read
12:17:28FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#ix=4iFd
12:17:55FromDiscord<nocturn9x> (edit) "https://play.nim-lang.org/#ix=4iFd" => "https://play.nim-lang.org/#ix=4iFe"
12:18:06FromDiscord<Rika> the implementations one have BytecodeCompiler instead no?
12:18:10FromDiscord<nocturn9x> yes
12:18:28FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#ix=4iFf
12:18:45FromDiscord<nocturn9x> is it not dispatching because `name` is of a different type
12:18:48FromDiscord<nocturn9x> (edit) "type" => "type?"
12:19:03FromDiscord<nocturn9x> afaik nim only has single dispatch, right?
12:19:56FromDiscord<nocturn9x> yes, that was it
12:20:15FromDiscord<nocturn9x> I had to declare `name` as `Name` rather than `BytecodeName` and then do an explicit type conversion inside
12:22:04*disso_peach quit (Ping timeout: 256 seconds)
12:22:07FromDiscord<ShalokShalom> Didn't the compiler just tell you that's a type error?
12:22:27FromDiscord<ShalokShalom> Error messages could surely improve 😅
12:22:49FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4iFh
12:23:00FromDiscord<Rika> okay
12:25:05FromDiscord<nocturn9x> In reply to @ShalokShalom "Didn't the compiler just": no
12:25:06FromDiscord<nocturn9x> it did compile
12:25:11FromDiscord<nocturn9x> it just called the stub instead
12:25:20FromDiscord<nocturn9x> In reply to @Rika "are the implementations public": they don't need to be
12:25:24FromDiscord<nocturn9x> they're internal to the bytecode compiler
12:25:27FromDiscord<nocturn9x> only the stubs are
12:42:30*jmdaemon quit (Ping timeout: 252 seconds)
12:47:32FromDiscord<ringabout> Is there a difference to build course on between Window and Linux?
12:51:57FromDiscord<ShalokShalom> In reply to @nocturn9x "no": So the type system did fail somehow?
12:52:11*pro joined #nim
12:52:55FromDiscord<nocturn9x> nim's type system? I don't know if I'd call it a fail
12:53:17FromDiscord<nocturn9x> it was yet another case of PEBCAK
12:57:34FromDiscord<ShalokShalom> Idk, that's a fail in my book
12:58:16FromDiscord<ShalokShalom> Or I misunderstood the sense of a type system
13:06:50FromDiscord<scruz> How would I delete all nimble packages in one command?
13:07:40FromDiscord<scruz> There's `nimble delete [pkg]` but there's a lot of pkg(s) that I get when I use the command `nimble list`
13:10:28FromDiscord<scruz> nvm I'm just gonna manually delete the .nimble folder
13:24:09FromDiscord<Phil> In reply to @scruz "nvm I'm just gonna": I was about to say that your solution is one rm command away
13:31:39FromDiscord<scruz> I asked because I want to uninstall nim
13:31:52FromDiscord<scruz> So I figured I'll delete all the nimble packages first
13:33:09FromDiscord<aMOPel> Hey there 🙂 I'm stuck on this problem:↵I have a `distinct` type and I want to `{.borrow.}` the operations from the base type. However the base type defines the operations in a template so I get the error "no symbol to borrow from found", because the template that defines the operations gets evaluated to late. Is there some way to force an earlier evaluation of that template? Or is there another way to get around this problem?
13:33:36*xet7 quit (Remote host closed the connection)
13:36:08FromDiscord<Bung> better post your code to https://play.nim-lang.org/
13:38:33*disso_peach joined #nim
13:41:46FromDiscord<aMOPel> In reply to @Bung "better post your code": https://play.nim-lang.org/#ix=4iFs↵It doesn't run in the browser since it depends on a nimble package...
13:45:41FromDiscord<Bung> you can't borrow `[]` `[]=`
13:46:26FromDiscord<aMOPel> Interesting. The error gets thrown way before that, though. So the problems remains
13:51:10FromDiscord<Bung> you may try boot nim compiler from this https://github.com/nim-lang/Nim/pull/20659
13:51:50FromDiscord<Bung> borrow is buggy I can't figure out the problem by eye
13:55:36FromDiscord<aMOPel> The problem is that `+` etc of the original type are defined in a template in the library `vmath`.
13:56:03FromDiscord<aMOPel> borrowing `==` for example works just fine, since it isn't defined in a template
13:56:54FromDiscord<aMOPel> My question is: is there some way to control the evaluation time of a template? Like a pragma that delays a template or forces an early evaluation of a template?
13:58:19*xet7 joined #nim
14:01:59FromDiscord<Bung> I just tried https://play.nim-lang.org/#ix=4iFv in devel
14:02:16FromDiscord<Bung> compiles fine, so the problem may not related to template
14:02:30FromDiscord<aMOPel> curious
14:03:32FromDiscord<aMOPel> you happen to know, when that code is expected to be merged?
14:05:51FromDiscord<Bung> probably after v2 release
14:06:48FromDiscord<ringabout> v2rc has been almost frozen, I don't think more PRs will be merged.
14:07:13FromDiscord<aMOPel> In reply to @Bung "probably after v2 release": Thanks for your help
14:09:10*moonlit quit (Ping timeout: 256 seconds)
14:11:20FromDiscord<aMOPel> In reply to @Bung "compiles fine, so the": does work indeed
14:16:33FromDiscord<BenitzCoding> In reply to @Isofruit "Things that haven't been": Cool! Thank you for the information!!!
14:24:04FromDiscord<albassort> o uh on evil
14:24:08FromDiscord<albassort> (edit) "o" => "so"
14:24:18FromDiscord<albassort> does uhhhhh is there no more defects?
14:24:22FromDiscord<albassort> (edit) "evil" => "devil"
14:24:34*disso_peach quit (Quit: Leaving)
14:24:37FromDiscord<albassort> because my program is breaking crashing and it wont tell me where :)
14:26:50FromDiscord<auxym> is it compiled with -d:debug? if so it should produce a stack trace
14:27:08FromDiscord<albassort> nothin
14:28:02FromDiscord<albassort> on danger it gives me more info
14:29:27FromDiscord<albassort> something in json is broken on devel
14:29:44FromDiscord<albassort> not a revolutionary sentence i know
14:35:16*moonlit joined #nim
14:36:14*xet7 quit (Quit: Leaving)
14:42:45*pro left #nim (#nim)
14:46:09FromDiscord<albassort> yea its broken
14:46:26FromDiscord<albassort> looking for a new json parser
14:50:23FromDiscord<auxym> there's a few on nimble. But if the issue isn't reported you should definitely open an issue on the nim GH. especially since the current devel will be released as v2 very soon
15:00:20FromDiscord<albassort> In reply to @auxym "there's a few on": opened an issue on jsony because treeformed forgot that not all json begin with {
15:00:30FromDiscord<albassort> (edit) "treeformed" => "treeform"
15:00:45FromDiscord<albassort> In reply to @auxym "there's a few on": sounds like a pita, probably wont do shit
15:01:30FromDiscord<ringabout> https://github.com/nim-lang/Nim/pull/21108 the devel branch is going to use csource_v2
15:03:23FromDiscord<ringabout> (edit) "csource_v2" => "csources_v2"
15:05:59FromDiscord<albassort> nevermind my code is borked in strange and eldritch ways
15:06:41FromDiscord<albassort> unless its an illusive bug
15:08:49FromDiscord<albassort> hmmm
15:10:11FromDiscord<albassort> oh god this bug is insane
15:11:03FromDiscord<Phil> In reply to @albassort "nevermind my code is": This is why every programmer should carry with them the holy sword of refactor
15:11:22FromDiscord<albassort> well
15:11:27FromDiscord<Phil> Only this legendary blade enables you to slay the beast and turn it into a well-ordered and easily understandable program
15:11:27FromDiscord<albassort> i was implementing new code into old code
15:11:33FromDiscord<albassort> already refactored
15:11:50FromDiscord<Phil> One never can stab the best with refactor enoguh
15:11:52FromDiscord<Phil> (edit) "enoguh" => "enough"
15:12:01FromDiscord<Phil> ~~only when the money runs out~~
15:13:06FromDiscord<albassort> so the json parser is mutating based on what im doing with it next
15:13:11FromDiscord<albassort> so i think this is a GC issue
15:15:33FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1052967156796641381/Peek_2022-12-15_10-15.mp4
15:15:35FromDiscord<albassort> @Phil
15:19:29*moonlit quit (Remote host closed the connection)
15:19:47*moonlit joined #nim
15:23:59FromDiscord<@thatrandomperson5-6310e3b26da03> I get type mistmatch for `fieldPairs` on a object of an object of RootObj
15:24:02FromDiscord<@thatrandomperson5-6310e3b26da03> how do fix
15:24:22FromDiscord<Phil> Why in the name of all that is holy aren't you splitting that into more sub-procs
15:25:13FromDiscord<albassort> I G N O R E T H E C O D E
15:25:30FromDiscord<albassort> how am i gonna improve my code when my compiler is being a big ole bitch
15:26:17FromDiscord<albassort> i rewrote it to be all pretty
15:26:20FromDiscord<albassort> and it was like 200x slower
15:26:21FromDiscord<Phil> I am like 10% certain that you missunderstood jsony
15:26:26FromDiscord<Phil> (edit) "missunderstood" => "misunderstood"
15:26:30FromDiscord<Phil> Can't really say for sure
15:26:31FromDiscord<albassort> this is json
15:26:39FromDiscord<albassort> jsony doesn't work for this situation
15:26:47FromDiscord<albassort> i owned an issue for it
15:26:49FromDiscord<Phil> Ahhh okay
15:27:04FromDiscord<albassort> (edit) "owned" => "opened"
15:27:06FromDiscord<Phil> the jsony variable in between threw me off
15:27:08FromDiscord<planetis> Maybe you don't close the file
15:27:26FromDiscord<albassort> what do you mean
15:27:46FromDiscord<planetis> You write to a file?
15:28:01FromDiscord<albassort> no
15:28:08FromDiscord<planetis> Nvm
15:28:16FromDiscord<albassort> the only thing different is the extra lines of me capturing the data
15:36:04FromDiscord<Scuffi> Does anyone know how to change the nim compiler version/platform? My compiler uses amd64 but I'm actually running arm64 (m1 chip)?
15:39:59*moonlit quit (Remote host closed the connection)
15:40:16*moonlit joined #nim
15:42:13FromDiscord<albassort> https://nim-lang.org/docs/nimc.html
15:42:30FromDiscord<albassort> @Scuffi
15:42:39FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iFT
15:43:19FromDiscord<albassort> In reply to @albassort "": so the issue was in os.walkdir
15:43:39FromDiscord<Scuffi> sent a code paste, see https://play.nim-lang.org/#ix=4iFU
15:43:49FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iFV
15:45:46FromDiscord<albassort> i don't know to open an issue :think:
15:56:17FromDiscord<auxym> In reply to @Scuffi "Thank you": for arm64 it should be `--cpu:aarch64`
15:56:23FromDiscord<auxym> arm is arm 32bit
15:57:04FromDiscord<Scuffi> In reply to @auxym "for arm64 it should": ah okay thank you
15:57:43FromDiscord<Scuffi> I specified arm64 as the compiler is telling me that aarch64 is unknown
15:59:18FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4iG1
15:59:23FromDiscord<auxym> In reply to @Scuffi "I specified arm64 as": yes right sorry arm64 is correct
16:00:21FromDiscord<Scuffi> okay thanks i'll try that as i'm trying to use nimpy to import compiled nim but keep getting a mismatch in architectures so i'll try edit some config stuff
16:03:07FromDiscord<@thatrandomperson5-6310e3b26da03> > I get type mistmatch for `fieldPairs` on a object of an object of RootObj↵help?
16:08:29FromDiscord<Phil> Could you show a code sample
16:08:31FromDiscord<Phil> ?
16:09:08FromDiscord<Phil> Because `type A = object of object of RootObj` shouldn't even be a valid definition in the first place so I'm not 100%
16:10:18FromDiscord<@thatrandomperson5-6310e3b26da03> > Because `type A = object of object of RootObj` shouldn't even be a valid definition in the first place so I'm not 100%↵My type\:
16:10:46FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iG8
16:11:08FromDiscord<Phil> In reply to @@thatrandomperson5-6310e3b26da03 "> Because `type A": The bridge appears to be dying a sad death, could you post a link to the playground with your code? https://media.discordapp.net/attachments/371759389889003532/1052981144439758878/image.png
16:14:02FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4iGa
16:14:50NimEventerNew thread by DougT: Odd timings using threads, see https://forum.nim-lang.org/t/9726
16:17:44FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iGe
16:28:38FromDiscord<sOkam!> @exelotl I'm documenting my project with `##` and markdown syntax, but I'm not ready to adopt the natu-docs workflow yet. Is this a good enough pattern to start documenting with, so that later on I can adopt the tool into the project without trouble? Or should I be doing something else?
16:31:45*junaid_ joined #nim
16:31:57FromDiscord<exelotl> mmh so my sphinx extension so far is only made with RST syntax in mind. I'd imagine it's possible to make it work with markdown syntax but I don't know how yet, would need to look into it some more.
16:32:21FromDiscord<exelotl> but yes generally you're just writing normal procs and types with ## comments
16:40:19FromDiscord<exelotl> I really need to get enums and object field documentation working 😭
16:42:34FromDiscord<auxym> sphinx extension? tell me more...
16:43:26FromDiscord<exelotl> https://git.sr.ht/~exelotl/natu-docs
16:45:21FromDiscord<exelotl> not properly released yet but basically I wrote a crappy parser in Python to extract the docs from a "normal" nim codebase (i.e. one with simple types/vars/procs, not one that's doing crazy compile-time shenanigans to generate public symbols)
16:48:55FromDiscord<exelotl> Once it's set up you can just write in your docs e.g. `.. autonim:: backgrounds.loadTiles` and it will generate the signature & description for that symbol https://media.discordapp.net/attachments/371759389889003532/1052990649126887466/Screenshot_from_2022-12-15_16-49-05.png
16:49:40*disso_peach joined #nim
16:50:40FromDiscord<exelotl> it's still pretty rough right now though, and I have limited time to work on it
17:03:06NimEventerNew thread by DougT: Strange timings for threads, see https://forum.nim-lang.org/t/9728
17:03:38FromDiscord<auxym> In reply to @exelotl "not properly released yet": Cool. I haven't actually properly written nim docs yet, but I have a project I want to document in the near future, and I'm somewhat familiar with sphinx (or I was, 10 years ago, at least). Out of curiosity, instead of parsing nim directly, couldn't you use the output the jsondoc?
17:17:59*moonlit quit (Remote host closed the connection)
17:18:34*moonlit joined #nim
17:21:07*disso_peach quit (Ping timeout: 265 seconds)
17:31:20*rockcavera joined #nim
17:33:34FromDiscord<exelotl> kind of, but it doesn't output in an ideal format for use with other documentation systems: https://nim-lang.org/docs/docgen.html#document-types-json
17:34:32FromDiscord<exelotl> the descriptions are pre-converted to HTML so you have to convert them back. And the args & fields aren't exposed in a programmer-friendly way, so you still have to parse them yourself anyways
17:41:51FromDiscord<@thatrandomperson5-6310e3b26da03> Both of mine a ref objects, not object↵(@Phil)
17:43:18FromDiscord<Phil> In reply to @@thatrandomperson5-6310e3b26da03 "Both of mine a": Field pairs only works on objects directly. If you want to use it on a ref object you need to dereference it with [] first
17:45:15FromDiscord<@thatrandomperson5-6310e3b26da03> Idk how to make it just object from within a macro
17:49:17NimEventerNew thread by DougT: Odd timings for threads, see https://forum.nim-lang.org/t/9729
17:51:54FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iGH
17:52:00FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iGI
17:52:24FromDiscord<@thatrandomperson5-6310e3b26da03> Ok, i fixed it, thanks
17:57:26FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iGL
18:00:38FromDiscord<@thatrandomperson5-6310e3b26da03> What is the difference between ref object and object. Becuase if it is not ref object it can’t find the proc from the parent
18:03:26FromDiscord<@thatrandomperson5-6310e3b26da03> Here is the example of the issue\: https://play.nim-lang.org/#ix=4iGQ
18:04:41FromDiscord<Phil> In reply to @@thatrandomperson5-6310e3b26da03 "What is the difference": Ref object is in heap memory, so a random piece of memory somewhere in your ram .↵Direct objects are in stack memory, they're faster but always create a copy whenever you reassign a variable, which can be slow for large objects etc.↵↵Basically it comes down to stack Vs heap memory
18:06:08FromDiscord<Phil> The proc from the parent? What output would you expect?
18:06:11FromDiscord<@thatrandomperson5-6310e3b26da03> How come in the example i provided it does not work.↵(@Phil)
18:06:33FromDiscord<@thatrandomperson5-6310e3b26da03> > The proc from the parent? What output would you expect?↵The output of the provided $ proc
18:07:13FromDiscord<Phil> To me the output looks correct.↵Do you not expect to see the field of type B because you are typing initially for A?
18:08:09FromDiscord<@thatrandomperson5-6310e3b26da03> Im trying to understand why it only works with “ref”
18:08:37FromDiscord<@thatrandomperson5-6310e3b26da03> But i get another error
18:11:28FromDiscord<@thatrandomperson5-6310e3b26da03> > To me the output looks correct.↵> Do you not expect to see the field of type B because you are typing initially for A?↵I expect it to take the $ for type A becuase that is after RootObj
18:12:04FromDiscord<メッリーレイムー 🎄> In reply to @メッリーレイムー 🎄 "how do i take": so how do i fix this?
18:13:02FromDiscord<Phil> https://play.nim-lang.org/#ix=4iGR↵The compiling version for ref objects.↵I'm actually surprised it's not printing the field of B
18:17:18FromDiscord<@thatrandomperson5-6310e3b26da03> > https://play.nim-lang.org/#ix=4iGR↵> The compiling version for ref objects.↵> I'm actually surprised it's not printing the field of B↵It does not echo anything, also don’t use [], it only gives the attributes of the parent
18:18:21FromDiscord<メッリーレイムー 🎄> can i get some help?
18:19:01FromDiscord<Phil> I'm on phone and doing reps in between, for anything more substantial you'll need to wait
18:19:34*junaid_ quit (Remote host closed the connection)
18:21:59FromDiscord<Phil> In reply to @@thatrandomperson5-6310e3b26da03 "> https://play.nim-lang.org/#ix=4iGR > The": You'll have to as [] dereferences the ref object, can't use any of the iterators otherwise
18:22:39*neceve joined #nim
18:23:03*neceve quit (Remote host closed the connection)
18:23:04FromDiscord<Phil> What you're trying to do may require a generic rather than just using the parent class
18:26:04FromDiscord<Phil> I can whip up an example in 2h or so, I'm not typing out generics via phone
18:40:40*neceve joined #nim
18:41:02FromDiscord<Phil> In reply to @メッリーレイムー 🎄 "how do i take": Why not just write the function that you want to accept without the name?
18:41:02*neceve quit (Remote host closed the connection)
18:41:55FromDiscord<Phil> A proc declaration is, in a sense, just a type declaration that also assigns the instructions underneath it to the name you provide in the proc declaration
18:43:02FromDiscord<Phil> Here an example of how norm accepts a func to create dB connections ↵https://norm.nim.town/pool.html
18:43:06FromDiscord<albassort> is there any alternative to OS.walkdir
18:43:17FromDiscord<albassort> im tired of my life being wasted on whatever the fuck is happening here
18:44:08FromDiscord<Phil> Best ask beef I think, I'm not aware of one.↵Maybe there's a nimble package?
18:44:43*neceve joined #nim
18:45:02*neceve quit (Remote host closed the connection)
18:45:06FromDiscord<albassort> i cant think anything else thats causing this
18:46:12FromDiscord<Phil> In reply to @メッリーレイムー 🎄 "how do i take": Ah, in my norm link the example is at the very bottom
18:47:22FromDiscord<albassort> how do i even report this bug
18:47:51FromDiscord<Phil> Minimal example possible?↵I assume no... Try to anyway?
18:48:39*neceve joined #nim
18:49:02*neceve quit (Remote host closed the connection)
18:51:45FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4iGZ
18:56:27FromDiscord<メッリーレイムー 🎄> In reply to @Isofruit "Why not just write": how would i do this?
18:56:31FromDiscord<メッリーレイムー 🎄> im confused ngl
18:58:08FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iH1
18:58:48FromDiscord<albassort> its hideous
19:00:55FromDiscord<Phil> In reply to @メッリーレイムー 🎄 "how would i do": Already checked out the linked norm docs?
19:00:56*neceve joined #nim
19:09:35FromDiscord<albassort> https://github.com/nim-lang/Nim/issues/21111
19:28:27FromDiscord<Phil> Finally back in front of a keyboard
19:28:35FromDiscord<Gumbercules> were you behind it earlier?
19:29:10FromDiscord<Gumbercules> I'm kidding by the way
19:29:23FromDiscord<Gumbercules> having some fun 🙂
19:29:27FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iH9
19:30:15FromDiscord<Gumbercules> you could also just do `let x = proc() = echo "Hello World"`
19:30:17FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHa
19:30:38FromDiscord<Phil> In reply to @Gumbercules "you could also just": The point was around how to pass a proc, so the first thing is about type annotations for proc variables
19:30:42FromDiscord<Gumbercules> gotcha
19:31:05FromDiscord<Gumbercules> and thanks for the context
19:32:23FromDiscord<@thatrandomperson5-6310e3b26da03> What. Idk what that is↵(@Phil)
19:33:04FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHb
19:33:20FromDiscord<Phil> In reply to @@thatrandomperson5-6310e3b26da03 "What. Idk what that": Alrighty, in that case first what background knowledge you've got so far? Python?
19:33:32FromDiscord<Phil> So I know where to make analogies to
19:36:38FromDiscord<Gumbercules> In reply to @albassort "https://github.com/nim-lang/Nim/issues/21111": didn't you say `std/json` was broken on devel?
19:36:42FromDiscord<Gumbercules> I just compiled my project with it and it works fine
19:36:50FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iHc
19:36:51FromDiscord<メッリーレイムー 🎄> like a callback
19:37:10FromDiscord<Phil> In reply to @メッリーレイムー 🎄 "I just want to": See my last example 😉↵Just trying to show you all examples including throwing it into a variable
19:38:21FromDiscord<Phil> In reply to @@thatrandomperson5-6310e3b26da03 "What. Idk what that": Here an example of how this would work via generic that requires that any type passed to it is inherited from A:↵https://play.nim-lang.org/#ix=4iHe
19:38:25FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://paste.rs/4L1
19:38:31FromDiscord<メッリーレイムー 🎄> @Phil
19:38:46FromDiscord<Phil> One sec, throwing it in an editor to look at it closer
19:39:39FromDiscord<Phil> What's the type definition of Parser?
19:40:44FromDiscord<Phil> @メッリーレイムー 🎄
19:41:15FromDiscord<メッリーレイムー 🎄> one sec
19:45:41FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHh
19:45:49FromDiscord<Phil> Will print out "Potato" and an empty seq
19:52:19*tiorock joined #nim
19:52:19*tiorock quit (Changing host)
19:52:19*tiorock joined #nim
19:52:19*rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services)))
19:52:19*tiorock is now known as rockcavera
20:12:15FromDiscord<@thatrandomperson5-6310e3b26da03> Python↵(@Phil)
20:12:52FromDiscord<Phil> In reply to @@thatrandomperson5-6310e3b26da03 "Python (<@180601887916163073>)": Ahh perfect.↵So you know how in python you can pass any sort of value into any kind of function?
20:13:30FromDiscord<Phil> You could pass a string into a function just as well as a number or whatever, you'll find out at runtime if it breaks or not
20:14:34FromDiscord<メッリーレイムー 🎄> In reply to @Isofruit "I can't make an": that is so cursed
20:14:40FromDiscord<Phil> In reply to @@thatrandomperson5-6310e3b26da03 "Python (<@180601887916163073>)": Nim insists that you specify what type everything is.↵However, often you want to do the same type of operation for multiple different datatypes just like in python, that's where generics come into play.↵You can define one proc and it'll work for all types that meet the criteria you define
20:14:43FromDiscord<メッリーレイムー 🎄> lemme get on pc and then send u the gypes
20:15:12FromDiscord<Phil> In reply to @メッリーレイムー 🎄 "that is so cursed": In my defense, I had no choice 😛
20:18:36FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHn
20:20:40FromDiscord<treeform> In reply to @albassort "opened an issue on": I replied to your issue https://github.com/treeform/jsony/issues/55
20:21:51*pro joined #nim
20:23:21FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4iHp
20:23:39*pro left #nim (#nim)
20:25:58FromDiscord<Phil> In reply to @@thatrandomperson5-6310e3b26da03 "This is my proc": Could you try the playground again?↵THe bridge really doesn't like when you post code, I'm getting HTML all over the place
20:26:10FromDiscord<Phil> https://media.discordapp.net/attachments/371759389889003532/1053045320155660319/image.png
20:34:29*moonlit quit (Remote host closed the connection)
20:34:46*moonlit joined #nim
20:49:10*pro joined #nim
20:49:34*pro left #nim (#nim)
20:53:15*arkurious joined #nim
21:00:03*neceve quit (Quit: ZNC - https://znc.in)
21:11:40*neceve joined #nim
21:12:02*neceve quit (Remote host closed the connection)
21:16:46*neceve joined #nim
21:17:01*neceve quit (Remote host closed the connection)
21:34:46*neceve joined #nim
21:35:02*neceve quit (Remote host closed the connection)
21:37:32FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iHz
21:38:35*neceve joined #nim
21:39:01*neceve quit (Remote host closed the connection)
21:41:13FromDiscord<Phil> Ahh, the f needs to be a closure but "parseFuncParam" doesn't appear to be one (?)↵How are you defining the func? In-line with some help from std/sugar?
21:41:41FromDiscord<Elegantbeef> They're calling a procedure instead of passing a procedure
21:41:53FromDiscord<Phil> You can read that from the error?
21:42:01FromDiscord<Elegantbeef> > but expression 'parseFuncParam(parser)' is of type\: AstNode
21:42:21FromDiscord<Elegantbeef> > required type for f\: proc (i0\: Parser)\: AstNode{.closure.}
21:43:07FromDiscord<Phil> That's how I got that it's not a closure but should be, inferring the next step that thus what is being passed as a call of the proc instead of .... ohhhh you saw that given the proc should return an AstNode
21:43:28FromDiscord<Elegantbeef> Correct
21:43:54FromDiscord<Phil> See, this is why you're beef
21:45:05FromDiscord<Elegantbeef> Cause my parents didnt love me?
21:45:57FromDiscord<Phil> If that's what gave you the ability to learn nim and understand problems that quickly, then yes
21:47:41*neceve joined #nim
21:48:02*neceve quit (Remote host closed the connection)
22:01:41*neceve joined #nim
22:19:07*disso_peach joined #nim
22:26:51FromDiscord<Scuffi> If I had an instance of a type that I want to be global, i.e. shared across all threads, how could I write it? Every time I've attempted to it's given me the error of the variable not being gc-safe, which makes sense, I'm just not sure of the syntactical method of writing it correctly?
22:33:16FromDiscord<Elegantbeef> Thread analysis can be overidden if what you're doing you know is safe
22:34:05FromDiscord<Elegantbeef> Perhaps `SharedPtr` in nim-lang/threading might work with `ref`s
22:34:08FromDiscord<Elegantbeef> But i do not know
22:37:30FromDiscord<Phil> ... I just copiously apply "cast gcsafe" tbh
22:37:51FromDiscord<Phil> and make sure the type has a lock somewhere
22:38:10FromDiscord<Elegantbeef> Yea that works with arc/orc
22:38:17FromDiscord<Phil> not with refc?
22:38:20FromDiscord<Elegantbeef> It's not a good design to force upon users
22:38:26FromDiscord<Phil> Okay thats fair
22:38:28FromDiscord<Elegantbeef> refc doesnt have a shared heap
22:38:47FromDiscord<Phil> Wait so every thread under refc has its own heap?
22:38:48FromDiscord<Phil> Huh
22:43:49FromDiscord<ajusa> Is there a way for me to avoid writing out all of these generic params and instead use varargs somehow? I want this template to take any number of arguments, and those arguments to be of any type at compile time. https://github.com/ajusa/rowdy/blob/master/src/rowdy.nim#L29-L52↵↵At the moment I'm planning on duplicating this code by hand, but that seems a bit tiresome
22:44:07FromDiscord<ajusa> (edit) "hand," => "hand (T1, T2, T3),"
22:44:54FromDiscord<@thatrandomperson5-6310e3b26da03> ?
22:45:38FromDiscord<! Nilts> The gitter link sucks, but now i'm on discord.
22:47:30FromDiscord<Phil> In reply to @@thatrandomperson5-6310e3b26da03 "?": The bridge seriously is dying, I didn't see that post and its still not there when I'm Looking for it ↵I'll take a look at it one sec https://media.discordapp.net/attachments/371759389889003532/1053080892299559033/image.png
22:48:02FromDiscord<Phil> (edit) "↵I'll" => "(see screenshot jumps from 22:45 to after 23:00 seamlessly)↵I'll"
22:49:18FromDiscord<Phil> In reply to @@thatrandomperson5-6310e3b26da03 "?": Your error is ` Error: the field 'catName' is not accessible.`?
22:50:05FromDiscord<Phil> Then you're running into one of nims ways to keep fields private.↵If you want to make a field accessible to code outside of the module that said field is defined in, you also need to annotate it with `` just like you would the type itself or a proc
22:50:27FromDiscord<Phil> Just because put taht `` onto the type doesn't mean all its fields are public, just that the type can be used outside of the module where its defined
22:50:33FromDiscord<Phil> (edit) "taht" => "that"
22:50:52FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHI
22:51:45FromDiscord<Phil> (edit) "Just because ... put" added "you"
22:56:26FromDiscord<! Nilts> In reply to @Isofruit "Basically, this fixes it:": It is suddenly working, but thanks, btw this is the discord account for thatrandomperson5
22:56:41FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iHK
22:56:44FromDiscord<Phil> In reply to @not logged in "It is suddenly working,": Ohhhhhhhh I was mildly confused already 😄
22:56:47FromDiscord<メッリーレイムー 🎄> seperated by _
22:56:50FromDiscord<Phil> Webcord works okay btw
22:57:32FromDiscord<Phil> In reply to @メッリーレイムー 🎄 "playing around w/ doing": So like... If I were to feed in A and B it would generate `A_B`?
22:58:19FromDiscord<Phil> As for how to generate that, I'm pretty sure you can just make a string like that and then turn the string into a symbol
22:58:30FromDiscord<Phil> I remember stealing a macro for that from beef as a general "getter" kind of thing
22:59:24FromDiscord<メッリーレイムー 🎄> In reply to @Isofruit "So like... If I": yeah
23:00:13FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4iHL
23:00:30FromDiscord<メッリーレイムー 🎄> yes, i am adding a scuffed form of typeclasses to nim, dont @ me
23:00:51FromDiscord<! Nilts> How do i check if the value of a var is a proc?
23:01:23FromDiscord<Phil> In reply to @not logged in "How do i check": In what context would you not know the type of a variable ?
23:01:53FromDiscord<! Nilts> In reply to @Isofruit "In what context would": `fieldPairs`
23:02:17*pech joined #nim
23:02:21FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHN
23:03:14FromDiscord<メッリーレイムー 🎄> so is this possible? @Phil
23:03:33FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4iHO
23:03:37FromDiscord<Phil> In reply to @メッリーレイムー 🎄 "so is this possible?": It is, but my macro knowledge is somewhere below sea level, so your only option is to try and steal from beef
23:04:03FromDiscord<メッリーレイムー 🎄> can i not just have it generate a class and then insert my own manually written code below it?
23:04:07FromDiscord<メッリーレイムー 🎄> or is that not how macros work
23:05:10FromDiscord<Elegantbeef> `let myName = ident($one & $two)`
23:05:15FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHP
23:05:34*disso_peach quit (Ping timeout: 272 seconds)
23:06:07*ksqsf joined #nim
23:06:30FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHQ
23:06:40FromDiscord<Elegantbeef> Inside the macro you dunce
23:07:09FromDiscord<Phil> In my defence, it's like really late and I guess I should really go to sleep
23:10:21FromDiscord<メッリーレイムー 🎄> im curious how cursed i can make this thing
23:10:29FromDiscord<jmgomez> Hey beef, now you are here.. can you pass a parameter from a macro (static) to a static parameter from a proc? Faced that today and had to do a workaround
23:11:00FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4iHT
23:12:52FromDiscord<Phil> Could you paste the next 5-6 lines of the error as well?
23:13:10FromDiscord<Phil> And indicate where line 19 is
23:13:47FromDiscord<Phil> Ohhhhhhhhh wait
23:14:03FromDiscord<Phil> In reply to @not logged in "Can someone please explain": You want to do that kind of stuff compile-time, not runtime.↵If only works on runtime. You want to use when
23:14:40FromDiscord<! Nilts> ???
23:14:48FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHW
23:15:14FromDiscord<Phil> Imagine when as being a pair of scissors that cuts one of these pieces (either what is under when or what is under else) out of your code at compile-time depending on the circumstances
23:15:36FromDiscord<Phil> Wait, right, compiletime and loop unrolling is something you're likely not yet familiar with
23:15:50FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4iHX
23:16:34*Phytolizer joined #nim
23:17:20FromDiscord<Elegantbeef> Nope they're considered runtime values afaik↵(@jmgomez)
23:18:11FromDiscord<demotomohiro> `fieldPair` iterator generates a code that repeat iterator body to each fields at compile time and when statement runs at compile time.
23:18:42*Phytolizer quit (Remote host closed the connection)
23:19:20FromDiscord<! Nilts> In reply to @demotomohiro "`fieldPair` iterator generates a": nice ok
23:19:31FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iHZ
23:20:03FromDiscord<Phil> That's what's meant when anything talks of "unrolling a loop"
23:20:21FromDiscord<! Nilts> ok, thanks
23:22:05*ksqsf quit (Remote host closed the connection)
23:51:15*ksqsf joined #nim
23:52:21FromDiscord<! Nilts> In a macro can i create a unused Ident? For making a type? Also what is a symbol
23:52:52*ksqsf left #nim (#nim)