<< 22-07-2022 >>

00:04:33FromDiscord<ghoom> In reply to @Elegantbeef "`taskPools` and `weave`": "weave"↵i love that name
00:05:54FromDiscord<!Patitotective> slurp
00:08:08FromDiscord<ghoom> imagine a package called fuck
00:08:22FromDiscord<ghoom> `import fuck`
00:12:04FromDiscord<!Patitotective> what would it do
00:12:22FromDiscord<!Patitotective> rm -rf /
00:12:26FromDiscord<ghoom> lol
00:12:34FromDiscord<ghoom> dat would be `nuke`
00:12:48FromDiscord<!Patitotective> yes, inside fuck
00:12:54FromDiscord<ghoom> ah
00:13:02FromDiscord<ghoom> `fuck/nuke`
00:13:45FromDiscord<ghoom> (edit) "`fuck/nuke`" => "`import fuck/nuke`"
00:21:03FromDiscord<Nimion #ඞ> hmm weave and taskpool seem to not work on iterators, u have to specifiy a range urself
00:21:35FromDiscord<Nimion #ඞ> and taskpool uses FlowVar↵do I need that in weave also to access sequences?
00:44:14FromDiscord<sOkam!> Is there a way to get the bit representation of a number, so it can be `echo`ed?
00:44:26FromDiscord<Elegantbeef> `strutils.toBin`
00:44:29FromDiscord<sOkam!> ty
00:55:34FromDiscord<ghoom> how do i bypass the `not all cases are covered` error?
00:55:43FromDiscord<Elegantbeef> Cover all cases
00:55:47FromDiscord<Elegantbeef> `else: discard`
00:56:01FromDiscord<ghoom> oh yeaa
00:56:03FromDiscord<ghoom> thanks
00:56:12*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
00:56:26FromDiscord<ghoom> i tried putting `;` in place of `discard` and it didn't work
00:56:26FromDiscord<Elegantbeef> Or if it's an range you can convert it to a subrange type `range[0..3](myVal)`
00:56:41FromDiscord<ghoom> shweet
00:57:05FromDiscord<Elegantbeef> Though i'd argue in that case where ever you got it from should convert to a subrange type
00:58:25*Lord_Nightmare joined #nim
01:32:16FromDiscord<Girvo> Hi all!
01:33:28FromDiscord<Girvo> Short of using StatusIM's `byteutils` stuff, whats the go-to way of grabbing the two `byte` parts that make up a `uint16`?
01:39:10FromDiscord<Girvo> Ah `std/bitops`
01:40:18FromDiscord<Girvo> Though the fact they all seem to mutate it is a little annoying lol
01:41:38FromDiscord<Girvo> Oh `bitand` doesn't at least
01:45:44FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=455B
01:49:51*CyberTailor quit (Remote host closed the connection)
01:51:23*CyberTailor joined #nim
01:51:33FromDiscord<Rika> "bitand" is just a function version of the operator "and"
01:51:50FromDiscord<Rika> "and" is bitwise when used with numbers
01:52:01FromDiscord<Girvo> Hah. Cheers
01:53:08FromDiscord<Girvo> Way nicer
01:53:11FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=455C
02:01:20*CyberTailor quit (Remote host closed the connection)
02:02:19*CyberTailor joined #nim
02:07:28FromDiscord<gibson> What's so bad about changing the active branch for a variant? The manual says don't do it, then the next immediate section is on `{.cast(uncheckedAssign).}` and it says here's how you do it. Is it because the underlying union fields might contain GC traced memory, and a caress active branch change could totally mess up how that memory is handled?
02:07:51FromDiscord<gibson> (edit) "caress" => "careless"
02:16:21FromDiscord<Rika> Changing the branch changes the types of the fields
02:16:38FromDiscord<Rika> The fields in an object variant are all stored in the same section of memory
02:16:51FromDiscord<Rika> You’ll essentially cast memory by changing the kind discriminator
02:16:56*toluene quit (Read error: Connection reset by peer)
02:17:34FromDiscord<gibson> So am I right that it's only an issue if that memory holds something GC traced?
02:17:44FromDiscord<Rika> No
02:17:56FromDiscord<Rika> It’s an issue for all types
02:18:10FromDiscord<Rika> Integers being interpreted as floats is undesirable
02:18:19FromDiscord<Rika> Booleans as arrays
02:18:22FromDiscord<Rika> Etcetera
02:18:36*toluene joined #nim
02:18:37FromDiscord<Nimion #ඞ> how can I get rid of warnings when casting int to enum?
02:18:43FromDiscord<gibson> Sure, but that's just how casting works.
02:18:57FromDiscord<gibson> Undesirable is dependent on context.
02:19:08FromDiscord<Rika> In reply to @gibson "Sure, but that's just": It’s not desired unless you explicitly write cast 🙂
02:19:23FromDiscord<gibson> Okay, so I think that fits my intuition. Thanks!
02:19:24FromDiscord<Rika> That’s how Nim wants it
02:22:17FromDiscord<Prestige> isn't there `parseEnum` or something similar
02:22:31FromDiscord<Girvo> Silly question, `result` vs `return`? Way back when I picked up Nim (in the v0.10 days) result was common, but a lot more of the code I've seen out in the wild seems to use return a lot more nowaday
02:23:16FromDiscord<Prestige> Just preference
02:24:24FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=455I
02:24:49FromDiscord<gibson> @Girvo Status.im Nim guidelines are very interesting to read through, as they're a company with some good nim experience. They suggest avoiding using `result`. No clue if that has anything to do with the trend you observe, though.
02:25:16FromDiscord<Prestige> I think result is warranted in some cases
02:25:36FromDiscord<Prestige> Because I think it is implicitly created anyway (maybe wrong about this)
02:26:09FromDiscord<!Patitotective> In reply to @Girvo "Silly question, `result` vs": in some video i watched araq saying that nim prefered structured programming and result over return
02:26:11FromDiscord<Nimion #ඞ> sent a code paste, see https://play.nim-lang.org/#ix=455J
02:26:25FromDiscord<!Patitotective> (edit) "return" => "return↵i think"
02:26:50FromDiscord<Prestige> Enums with holes usually ends up being a pain to deal with, if you can avoid it
02:26:52FromDiscord<!Patitotective> In reply to @TryAngle "ah wait it's a": then you can `switch("warning", "HoleEnumConv:off")`
02:26:56FromDiscord<gibson> @!Patitotective Araq does. Status.im has industry experience around commercial dev w/ Nim, and in their experience `result` is more confusing and harder for static analysis.
02:27:14FromDiscord<gibson> https://status-im.github.io/nim-style-guide/language.result.html
02:27:16FromDiscord<Nimion #ඞ> In reply to @Patitotective "then you can `switch("warning",": is there another way to do this code wise🥺
02:27:30FromDiscord<!Patitotective> In reply to @TryAngle "is there another way": `--warning:HoleEnumConv:off` (?)
02:27:35FromDiscord<!Patitotective> In reply to @gibson "<@762008715162419261> Araq does. Status.im": 👀
02:28:38FromDiscord<Nimion #ඞ> In reply to @Avahe "Enums with holes usually": hmm I'm interfacing with C in this case so i'ts not that possible 😢
02:28:51FromDiscord<Nimion #ඞ> can a `converter` do the job?
02:29:12FromDiscord<Nimion #ඞ> In reply to @Patitotective "`--warning:HoleEnumConv:off` (?)": it's a library, I don't want to force that on anyone
02:30:15FromDiscord<Girvo> Yeah dealing with hole-y enums across the Nim-C boundary is a pain 😦 I'm yet to find a nice pattern myself
02:30:22FromDiscord<!Patitotective> `{.push warning[HoleEnumConv]: off.}` ... `{.pop.}` lol
02:30:41FromDiscord<Girvo> ^ I was literally just typing that lol. Thats what we've done in our bindings
02:30:52FromDiscord<Nimion #ඞ> lmao
02:31:11FromDiscord<Nimion #ඞ> ok this looks better than using warnings off completely at least
02:31:41FromDiscord<Girvo> `push` in general is handy for library-level bindings where you have to do weird shit and don't want to force your odd config on everyone else lol
02:32:20FromDiscord<Girvo> In our firmware we've got our "app" level code which is all nice idomatic nim, and the kernel level which is a nightmare of horrid bindings to ESP-IDF and other drivers and components lol
02:32:32FromDiscord<Girvo> So its handy to be able to disable stuff just where its needed
02:36:07FromDiscord<Girvo> I never know whether to be happy or sad when I find a library that does the exact thing I wanted but I was looking forward to writing myself lol
02:42:44FromDiscord<gibson> @Girvo what lib?
02:52:50FromDiscord<!Patitotective> In reply to @Girvo "I never know whether": hahah yeah↵second time ive been fooled
02:59:55FromDiscord<Girvo> https://github.com/sumatoshi/w8crc
03:00:09FromDiscord<Girvo> @gibson ^
03:00:39FromDiscord<Girvo> I was going to implement CRC16 for the modbus implementation I'm working on but found this lol
03:01:31FromDiscord<voidwalker> In an ordered table, is it possible to get the order/position (it was added in) of a certain key ?
03:03:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=455P
03:03:30FromDiscord<gibson> @voidwalker If you ask for the keys, they should be in order, right? Then just find the key in the resulting seq.
03:04:03FromDiscord<gibson> @ElegantBeef 's is better :p
03:06:27FromDiscord<voidwalker> hmm
03:06:52FromDiscord<voidwalker> maybe I should just store position as value, instead of the "count" that I do now, and do not need
03:07:28FromDiscord<voidwalker> I want to store/enumerate all uniqe strings of db column, so I can try and turn them into an INT using bitmask of their positions
03:07:41FromDiscord<voidwalker> Is ordered table what you would use for this?
03:10:39*pch quit (Quit: Leaving)
03:11:42FromDiscord<Elegantbeef> that's why i just did 😄
03:11:43FromDiscord<Elegantbeef> Without allocating a seq for keys
03:16:25FromDiscord<gibson> @voidwalker Are you talking giant data? Otherwise turning the unique set of strings into a lookup table with index as their values might be faster.
03:23:13*pch joined #nim
03:36:47FromDiscord<voidwalker> About 10 million rows, with 1-4 entries (bitgs)
03:36:54FromDiscord<voidwalker> (edit) "(bitgs)" => "(bits)"
03:37:48FromDiscord<voidwalker> this is what I did so far
03:37:49FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=455S
03:39:27FromDiscord<voidwalker> But I am thinking, better build that 32bit mask (28 possible values) from memory (the keys/position) rahter than lookup in the db
03:41:50FromDiscord<voidwalker> In reply to @Elegantbeef "The way to do": This needs to loop over the values to find position of "key". Not good. I wanted something instant. As my algorithm does not need to iterate over the keys but over the db values containing such keys, and map them to a position
03:43:46FromDiscord<ghoom> how do i define methods?
03:44:08FromDiscord<Elegantbeef> Dynamic dispatch 'methods' or procedures?
03:44:27FromDiscord<ghoom> like inside a `object`
03:44:29FromDiscord<ghoom> (edit) "a" => "an"
03:44:44FromDiscord<Elegantbeef> You dont define member functions in Nim
03:44:59FromDiscord<Elegantbeef> If you're using OOP nim has `method` for dynamic dispatch, if you're using procedure nim has `proc`
03:45:02FromDiscord<Elegantbeef> So what're you doing?
03:47:41FromDiscord<ghoom> sent a code paste, see https://play.nim-lang.org/#ix=455U
03:47:53FromDiscord<ghoom> i wanna do dis but in nim
03:48:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=455V
03:48:23FromDiscord<Elegantbeef> Nim does not attach procedures to types
03:48:31FromDiscord<ghoom> ooh ok
03:48:35FromDiscord<ghoom> interesting
03:49:00FromDiscord<Elegantbeef> Nim is procedural with modules, so types can exist and modules implement logic that applies to those data types
03:49:41FromDiscord<ghoom> cool
03:51:59FromDiscord<!Patitotective> oop is just sugar syntax
04:18:07*arkurious quit (Quit: Leaving)
04:26:50*duuude quit (Ping timeout: 240 seconds)
04:31:44FromDiscord<j-james> In reply to @Patitotective "oop is just sugar": using nim's ufcs and rust's impls really helped make this click for me
05:16:29*CyberTailor quit (Read error: Connection reset by peer)
05:17:12*CyberTailor joined #nim
05:18:33FromDiscord<b1rdf00d> sent a long message, see http://ix.io/4566
05:20:43FromDiscord<Elegantbeef> Yea i've seen the "if you just force all procedures to be called `f(...)` it's already uniform" 😄
05:24:46FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4567
05:27:26FromDiscord<Elegantbeef> `import module as othername`
05:28:05FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4568
05:40:03FromDiscord<# Luke> Does Nim have classes
05:40:09FromDiscord<Prestige> Nope
05:40:18FromDiscord<# Luke> Or do I use objects
05:40:32FromDiscord<sOkam!> objects
05:40:32FromDiscord<Prestige> objects and functions
05:40:48FromDiscord<Elegantbeef> No
05:40:48FromDiscord<Elegantbeef> There are macros to simulate them but no
05:40:49FromDiscord<# Luke> Ah lol ok
05:41:02FromDiscord<sOkam!> then you do `object.theFunction` and you get the same thing
05:41:50FromDiscord<sOkam!> not encapsulated with classes, but with files instead
05:42:06FromDiscord<sOkam!> so, its more similar to C in that sense, but still get the nice functionality of dot notation
05:42:59FromDiscord<IDF> kinda like ocaml modules, but silly
06:29:13FromDiscord<sOkam!> Is it possible to export pragmas from one file to another?
06:29:52FromDiscord<Elegantbeef> Depends on the kind
06:31:37FromDiscord<Elegantbeef> template pragmas can be exported
06:35:53*CyberTailor quit (Write error: Connection reset by peer)
06:36:45*CyberTailor joined #nim
06:57:17*duuude joined #nim
06:58:26FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=456j
06:58:42*CyberTailor quit (Remote host closed the connection)
06:59:58*CyberTailor joined #nim
07:00:12FromDiscord<Elegantbeef> inject doesnt do anything here
07:04:22FromDiscord<Elegantbeef> But i think you can
07:05:15FromDiscord<ajusa> Not sure if I've asked this before, but there's no way to remove a C linker flag right? Playing around with https://github.com/Yardanico/cosmonim
07:05:59FromDiscord<jmgomez> In reply to @Elegantbeef "But i think you": how?
07:06:06FromDiscord<Elegantbeef> `stack {.inject.}`
07:06:15FromDiscord<Elegantbeef> I dont get why you need to use inject here but alas
07:06:16FromDiscord<jmgomez> In reply to @Elegantbeef "inject doesnt do anything": well, its inside genAst
07:07:19FromDiscord<jmgomez> oh it seemed to work, I swear I tried that yesterday.. thanks!
07:16:32*duuude quit (Quit: Konversation terminated!)
07:24:05*jmdaemon joined #nim
07:34:14FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=456o
07:34:21FromDiscord<Elegantbeef> `ord`
07:34:32FromDiscord<Elegantbeef> That works for all enums regardless if they're ordinal or not
07:35:05NimEventerNew thread by Niminem: Weird Type Mismatch error for JS backend (1.6.X), see https://forum.nim-lang.org/t/9313
07:59:10*toluene quit (Ping timeout: 272 seconds)
08:03:12*toluene joined #nim
08:26:52FromDiscord<frobnicate> I'm not sure you should depend on the "value" of an enum though, unless it's like a bitmask. Smells like an anti pattern
08:27:00FromDiscord<frobnicate> I don't know what you guys think
08:27:31FromDiscord<Elegantbeef> Enums should be ordinals is what i think
08:28:07FromDiscord<Elegantbeef> They're interoping with C so dont get the luxury
08:28:22FromDiscord<frobnicate> So would you make a type for bit masks?
08:28:45FromDiscord<Elegantbeef> Possibly
08:28:50FromDiscord<Elegantbeef> I've never really needed to so i dont know
08:29:09FromDiscord<Elegantbeef> I much prefer using Nim's bitsets where i can but that involves staying in Nim
08:29:29FromDiscord<frobnicate> Is that a type?
08:29:39FromDiscord<Elegantbeef> Bitsets are just `set[T]`
08:30:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=456A
08:30:27FromDiscord<frobnicate> And I guess you make T a range 0..1?
08:30:29FromDiscord<Elegantbeef> That creates an 8 bit set and flicks the 3/4th bit on
08:30:46FromDiscord<frobnicate> Oh
08:30:48FromDiscord<frobnicate> Nvm
08:31:01FromDiscord<frobnicate> Yeah that's much more readable than normal bitmask stuff lol
08:31:14NimEventerNew thread by Mildred: Error: both asyncdispatch.await and asyncmacro.await match, but asyncmacro is not imported, see https://forum.nim-lang.org/t/9314
08:31:15FromDiscord<Elegantbeef> Think most call them bitflags but yea
08:31:32FromDiscord<Elegantbeef> You can also do them more programatically
08:32:01FromDiscord<frobnicate> I call them masks because of raycasting
08:32:11FromDiscord<frobnicate> Bad habit maybe
08:32:27FromDiscord<Elegantbeef> Like if you have bit fields you can generally do niftier things with enum + sets
08:32:34FromDiscord<frobnicate> I see
08:32:43FromDiscord<Elegantbeef> getting a link if you're interested
08:32:49FromDiscord<frobnicate> Yes please
08:33:32FromDiscord<Elegantbeef> https://github.com/mattrberry/gba/pull/5/files#diff-d93a4dfd344765bba00a8f3ea5773f9d2ab8c7ddc199238c23887da7f209ae33L34-L39
08:33:39FromDiscord<frobnicate> Thank you
08:33:59FromDiscord<Elegantbeef> Also on that PR you can see me talk about Tables
08:35:57FromDiscord<Elegantbeef> Whoever originally implemented sets in pascal did it right 😄
08:36:27FromDiscord<frobnicate> Yeah it looks cleaner than ORing
08:36:37FromDiscord<Elegantbeef> Sets also work on all ordinals(within uint16.high range) so if you need an efficient set of less than 65k integers you can use them
08:37:52FromDiscord<frobnicate> Is there a way to do this dynamically at runtime? Or is it only during compile? I'm just thinking of using it in an engine where the user creates a physics layer, for instance
08:37:52FromDiscord<Elegantbeef> It does use a lot of memory of course 2^16 bits always allocated is quite a lot
08:38:08FromDiscord<Elegantbeef> Nim's bitsets are statically typed
08:38:36FromDiscord<Elegantbeef> Statically sized rather
08:39:00FromDiscord<frobnicate> So I would have to handle it dynamically while the user is editing, and then when they hot reload I can recompile with their settings
08:39:33FromDiscord<Elegantbeef> I'd just say have a `seq[0..128]` then keep track of how many layers
08:39:38FromDiscord<Elegantbeef> `set` rather
08:39:38FromDiscord<frobnicate> So I would have to make a template for it and run it for each layer they've created, or something like that, right?
08:40:03FromDiscord<Elegantbeef> Like will you ever need more than 128 physics layers
08:40:13FromDiscord<Elegantbeef> If so i'm sorry for the shit you're in but get yourself a rope
08:40:27FromDiscord<frobnicate> I have no idea if someone would be that crazy
08:40:40FromDiscord<frobnicate> I usually use around 8 myself whenever I make a game
08:40:50FromDiscord<Elegantbeef> Exactly you can just do like `set[0..63]` or w/e
08:41:10FromDiscord<Elegantbeef> Your layer mask is then just `{range[0..63](0), 1, 2, 10, 13}`
08:41:18FromDiscord<frobnicate> Ok that makes sense
08:41:49FromDiscord<Elegantbeef> yes that conversion is required else Nim thinks "Oh you're trying to make a set of `int` that requires 2^64 bits"
08:41:54FromDiscord<frobnicate> I guess if they need more I can make a setting for another range of layers
08:42:13*rockcavera quit (Remote host closed the connection)
08:42:43FromDiscord<Elegantbeef> I mean Unity iirc only has 32 layers
08:42:50FromDiscord<Elegantbeef> I think their layermasks are uint32
08:43:41FromDiscord<frobnicate> Yeah but screw unity
08:44:08FromDiscord<Elegantbeef> well then make 40 layers just to spite them
08:45:40FromDiscord<Elegantbeef> I mean i dont even know how one would keep track of 32 layers nevermind 40 or 64
08:46:04FromDiscord<Elegantbeef> Even with a collision matrix gui, that's a lot of interactions
08:46:15FromDiscord<frobnicate> That's another thing
08:46:26FromDiscord<frobnicate> I wanted to come up with tools to help development
08:46:34FromDiscord<frobnicate> Like checking for dead ends
08:46:43FromDiscord<frobnicate> Or islands on nav mesh
08:47:02FromDiscord<Elegantbeef> Oh thought you mean if a poor programmer wrote `while true` 😄
08:47:08FromDiscord<frobnicate> Lol no
08:47:21FromDiscord<frobnicate> Code analysis is a bit beyond me
08:49:41FromDiscord<frobnicate> I did want some kind of feature that made it possible to tag something as placeholder
08:49:56FromDiscord<frobnicate> And warning you if you do a release build with placeholders left
08:50:11FromDiscord<frobnicate> Because that's an oopsie I've done myself
09:11:34FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=456K
09:12:18*jmdaemon quit (Ping timeout: 240 seconds)
09:12:26FromDiscord<sOkam!> isn't `<Syscall>` supposed to be that very same type? I don't have any other type named like that 🧩
09:13:46*xet7 joined #nim
09:13:47*xet7 quit (Remote host closed the connection)
09:19:22FromDiscord<Elegantbeef> That seems like you're doing something wrong and the compiler doesnt get it
09:21:08FromDiscord<Asbjørn F> what's the code on the line?
09:29:22*xet7 joined #nim
09:43:16FromDiscord<sOkam!> trying to isolate the error into a separate simpler file, so that I can see what is wrong easier
09:45:03FromDiscord<ricky> weird q-
09:46:37FromDiscord<Rika> ?
09:47:24FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=456W
09:47:45FromDiscord<ricky> I compiled something in Nim to a static bin and loaded it in-memory into a parent C program but am not sure best way to jmp back to the caller
09:48:02FromDiscord<ricky> it runs ok but ofc it will just exit normally at the end
09:48:34FromDiscord<Rika> If you’re gonna call those converters manually all the time then just make them procs
09:49:04FromDiscord<sOkam!> i will. im calling them explictely to be sure that's not the issue
09:49:10FromDiscord<Rika> Okay
09:50:39FromDiscord<sOkam!> I guess the problem is somewhere in the cast, or something 🤔
09:52:33FromDiscord<Rika> youre passing a `proc(callNum: clong): clong` a `Syscall`? when it wants a `clong`?
09:53:16FromDiscord<sOkam!> it wants an `intptr_t` with the shape of that proc. so trying to convert the proc to the shape and passing that
09:53:25FromDiscord<sOkam!> (edit) "it" => "the C code"
09:53:33FromDiscord<sOkam!> (edit) "code" => "binary"
09:53:46FromDiscord<Rika> `Sysc.error.toSysc` is a `Syscall` i dont understand what you mean
09:54:18FromDiscord<sOkam!> oh, i see what you mean
09:54:35FromDiscord<sOkam!> im passing a function to the function, instead of a the callnum
09:54:38FromDiscord<Rika> yes
10:03:41*toluene quit (Read error: Connection reset by peer)
10:04:12*toluene joined #nim
10:08:52FromDiscord<sOkam!> how do you convert from clong to nim native int?
10:09:05FromDiscord<sOkam!> is there an expected way to do it?
10:46:47FromDiscord<sOkam!> i guess `theClongNumber.int` works 🤷‍♂️
10:54:24FromDiscord<Nimion #ඞ> how does nim's hashtable or how do hashtables in the major langs handle collisions? In my uni course I learned about so many ways now but what is actually done in practice?
10:56:19FromDiscord<flywind> In reply to @TryAngle "how does nim's hashtable": It uses open addressing .
10:56:53FromDiscord<flywind> Basically it just tries the next slot iirc.
10:58:16FromDiscord<Nimion #ඞ> ah I see, thanks
10:58:55FromDiscord<Nimion #ඞ> linear probing 🤓
11:17:49NimEventerNew thread by Mantielero: Carbon lang, see https://forum.nim-lang.org/t/9315
11:21:28FromDiscord<anonsh> Hey↵Does anyone know what nim's equivalent of 'not' is?
11:24:04FromDiscord<anonsh> Because right now I'm wrapping the whole statement in brackets and checking if it equates to false
11:24:12FromDiscord<Nimion #ඞ> In reply to @anonsh "Hey Does anyone know": nim is using not for booleans if this is ur question
11:25:06FromDiscord<Nimion #ඞ> sent a code paste, see https://play.nim-lang.org/#ix=457p
11:25:06FromDiscord<anonsh> sent a code paste, see https://paste.rs/0ws
11:25:18FromDiscord<Nimion #ඞ> u don't need ( ) but u can use them
11:25:28FromDiscord<anonsh> sent a code paste, see https://play.nim-lang.org/#ix=457q
11:25:30FromDiscord<anonsh> Thanks for clearing it up
11:26:08FromDiscord<Nimion #ඞ> nim doesn't even need you to use ( ) when callings procs or (funcs or macros or templates or convertes or iterators)
11:26:45FromDiscord<anonsh> sent a code paste, see https://play.nim-lang.org/#ix=457r
11:27:30FromDiscord<anonsh> So I guess in this case I would have to wrap in ()?
11:27:43FromDiscord<Nimion #ඞ> hmm maybe u need ( ) around input_cmd .. in given_evidence
11:27:50FromDiscord<Nimion #ඞ> it probably only looks at input_cmd
11:27:54FromDiscord<Nimion #ඞ> (edit) "it probably only looks at input_cmd ... " added ".."
11:27:59FromDiscord<anonsh> sent a code paste, see https://play.nim-lang.org/#ix=457t
11:28:08FromDiscord<Nimion #ඞ> ye try that
11:29:01*lain quit (Ping timeout: 244 seconds)
11:29:31FromDiscord<anonsh> Yep it works
11:29:33FromDiscord<anonsh> thanks again
11:30:18FromDiscord<Nimion #ඞ> 👍
11:31:17*lain joined #nim
11:32:57FromDiscord<Rika> In reply to @anonsh "ok see I": Use "notin"
11:33:13FromDiscord<Rika> x not_in list
11:33:36FromDiscord<Nimion #ඞ> Oh wow we have that 😳😳
11:34:37FromDiscord<anonsh> Nim's pretty easy to pick up
11:34:53FromDiscord<anonsh> If it had more accessible docs ↵This would be pretty neat
11:42:34*Guest25 joined #nim
11:42:49*Guest25 quit (Client Quit)
11:48:57qwrdon't know, the docs have been fine for me, in what way these could be more accessible?
11:49:52qwrmaybe some details are hard to find
12:14:20FromDiscord<sOkam!> sent a code paste, see https://paste.rs/zxS
12:28:05FromDiscord<Rika> dynlib pragma
12:28:12FromDiscord<Rika> I forgot how to use
12:28:20FromDiscord<Rika> Youre missing that though
13:07:38FromDiscord<Dale> In reply to @qwr "don't know, the docs": I agree in general, overall the docs are quite comprehensive, but I'm finding a few things to be fragmented. For example, the current state of certain things isn't really documented that way, like the fact that `parallel` is going to be removed
13:07:58FromDiscord<Dale> (edit) "way," => "well,"
13:08:20FromDiscord<Dale> It can be tricky to make sure you're doing certain things properly because of this
13:08:24FromDiscord<Phil> In reply to @Dale "I agree in general,": Imagine a long and in depth guide to macros that weren't in Araqs book
13:08:32FromDiscord<Dale> The whole GC arc/orc thing could be documented better, for example
13:09:19FromDiscord<Dale> I haven't read the book yet, but I'll probably pick it up soon
13:09:27FromDiscord<Rika> Is tutorial three not comprehensive enough for macros lol
13:11:52FromDiscord<Dale> A nice thing about Lua is that the standard library is so small and concise it's documented in the language manual itself. Now, Nim's std lib right now might be a bit too big to do that, but it is really nice to have a single document you can ctrl+f in, rather than having multiple tabs and pages open
13:12:10FromDiscord<Dale> also the doc generator would probably need to be reworked for that
13:13:18FromDiscord<Dale> Overall the nim docs aren't that bad at all, just that some specific things can be tricky to find
13:13:58FromDiscord<Dale> And to be honest, I think that's mostly because the language is still a bit volatile and experimental
13:14:39FromDiscord<Dale> So really, when you choose to program in Nim you have already signed up for those kind of issues
13:16:08FromDiscord<Dale> That's the way I see it anyways. I love the Nim syntax, and I like a lot of other features, but I'm still not 100% sure whether I should use C++ for my project. I want to use Nim so I'm continuing, but I have this nagging feeling that I might one day run into something and flip the table
13:17:10FromDiscord<Dale> I'd rather that not happen though, and I'm optimistic that Araq and the other contributors can figure stuff out
13:36:55*arkurious joined #nim
13:43:22FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=4585
13:43:47FromDiscord<lantos> (edit) "https://play.nim-lang.org/#ix=4585" => "https://play.nim-lang.org/#ix=4586"
13:43:59FromDiscord<lantos> (edit) "https://play.nim-lang.org/#ix=4586" => "https://play.nim-lang.org/#ix=4587"
13:55:10FromDiscord<hotdog> In reply to @lantos "<@107140179025735680> Hey, with": What error are you getting?
14:03:14NimEventerNew post on r/nim by _culito_: Is Nim a good language to write Linux TUI applications?, see https://reddit.com/r/nim/comments/w5berx/is_nim_a_good_language_to_write_linux_tui/
14:13:18FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=458h
14:17:19FromDiscord<hotdog> sent a code paste, see https://play.nim-lang.org/#ix=458i
14:20:08FromDiscord<lantos> thanks,↵but think the coercion might not be the right way of doing it because if I need to serialize and send the object out I'll need to re-capitalize the object.
14:22:13FromDiscord<hotdog> In reply to @lantos "thanks, but think the": As long as the api is consistent that would work
14:44:53*rockcavera joined #nim
14:44:53*rockcavera quit (Changing host)
14:44:53*rockcavera joined #nim
15:17:07FromDiscord<christallo> hi
15:17:20FromDiscord<christallo> is there any plane to add support for zgc in nim?
15:18:51FromDiscord<Yardanico> I don't think so, ORC is expected to become the default and there are no experiments with new GCs
15:18:56FromDiscord<Yardanico> why specifically do you want zgc?
15:24:22FromDiscord<christallo> just looking for easy to implement automatic memory managment algorithms usable in realtime systems
15:24:25FromDiscord<christallo> (edit) "just looking for easy to implement automatic memory managment algorithms usable in ... realtime" added "hard"
15:24:40FromDiscord<Yardanico> well, ARC is usable in hard-realtime although it means that cycles will leak
15:26:24FromDiscord<sOkam!> In reply to @Rika "Youre missing that though": if i use dynlyb, it requires exportc. but im not exporting, afaik?
15:26:42FromDiscord<sOkam!> (edit) "dynlyb," => "dynlib,"
15:27:00FromDiscord<Rika> im not sure what you're trying to do sorry
15:27:15FromDiscord<sOkam!> build a dll made with nim, to connect with a c binary
15:27:31FromDiscord<Rika> and you want those two functions to be seen in the dynlib
15:27:35FromDiscord<sOkam!> the binary compiles separately, and its written in c
15:27:37FromDiscord<Rika> so you have to export them
15:28:07FromDiscord<sOkam!> but isn't exportc something for compiling to C code, not library?
15:28:15FromDiscord<sOkam!> i assumed that, maybe i misunderstood
15:29:26FromDiscord<Rika> sent a code paste, see https://paste.rs/W4x
15:29:45FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=458N
15:30:42FromDiscord<sOkam!> yea, definitely misread. tysm
15:31:23FromDiscord<Rika> yeah its usually in the manual
15:33:00FromDiscord<!Patitotective> is there a way to make the `{key: val, ...}` syntax create a sequence of tuples instead of an array so they can have different lenght ? (~~macros~~)
15:34:04FromDiscord<!Patitotective> :oooo `@{key: val, ...}` wors
15:34:06FromDiscord<!Patitotective> (edit) "wors" => "works"
15:34:07FromDiscord<!Patitotective> amazing
15:34:53FromDiscord<Yardanico> In reply to @Patitotective "amazing": yes, because @ is a proc in system and {} makes an array of tuples
15:35:10FromDiscord<!Patitotective> beautiful
15:35:14FromDiscord<ajusa> Is there an easy way to see why a module is being imported? Something is importing linenoise in my code and I want to figure out where it's coming from
15:50:40FromDiscord<sOkam!> Callback Hype #moment https://media.discordapp.net/attachments/371759389889003532/1000067362948644904/unknown.png
15:57:14FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=458U
15:57:27FromDiscord<!Patitotective> are if else statements forbidden in formatted strings?
16:12:59FromDiscord<demotomohiro> Maybe `:` is special character in strformat and you cannot use any expressions contains `:`.
16:13:52FromDiscord<Rika> it is
16:13:56FromDiscord<Rika> its used for formatting
16:14:29FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4592
16:16:38FromDiscord<!Patitotective> :[[[[
16:18:23FromDiscord<sOkam!> omegaSadge emoji
16:18:37FromDiscord<!Patitotective> ye
16:20:29FromDiscord<!Patitotective> there are no workarounds? :[
16:24:14FromDiscord<Require Support> whats the syntax for getting last x characters of a string ?
16:24:16FromDiscord<Rika> no
16:24:27FromDiscord<Rika> that wasnt to you, req
16:25:32FromDiscord<Prestige> sent a code paste, see https://play.nim-lang.org/#ix=4594
16:25:36FromDiscord<Prestige> here you get the last 2 characters
16:25:45FromDiscord<Rika> you could just ^1 though
16:25:51FromDiscord<Rika> why the foo.high
16:26:11FromDiscord<Prestige> ^1 would get you just the last character
16:26:28FromDiscord<!Patitotective> In reply to @Patitotective "there are no workarounds?": putting everything around parenthesis just works :DDDDDDDDdd
16:26:42FromDiscord<!Patitotective> In reply to @Avahe "^1 would get you": rika meant `foo[^2..^1]`
16:26:48FromDiscord<Prestige> oh, idk
16:26:52FromDiscord<Prestige> that works too lol
16:37:39FromDiscord<demotomohiro> Workaround for strformat `:` problem is create a new strformat that doesnt use `:` for formatting.
16:39:15FromDiscord<treeform> In reply to @lantos "<@107140179025735680> Hey, with": If you control the json, you should just make it match your objects.
16:39:46FromDiscord<!Patitotective> In reply to @demotomohiro "Workaround for strformat `:`": it was already solved and now you can use `:` inside parenthesis
16:41:30FromDiscord<Rika> oh yeah true its in the doc too
16:41:30FromDiscord<lantos> In reply to @treeform "If you control the": external API 😭
16:41:30FromDiscord<Rika> `To enable evaluating Nim expressions within curlies, colons inside parentheses do not need to be escaped. `
16:43:53FromDiscord<demotomohiro> @!Patitotective oh, I didn't know that.
17:23:44*wallabra_ joined #nim
17:23:51*wallabra quit (Ping timeout: 244 seconds)
17:27:17*wallabra joined #nim
17:28:29*wallabra_ quit (Ping timeout: 268 seconds)
17:33:09FromDiscord<Mike> sent a code paste, see https://play.nim-lang.org/#ix=459i
17:33:42FromDiscord<Mike> It waits like I would expect it to... but there's no vim. It acts like it's launched invisibly somewhere and I have to ctl-c to exit
17:34:07FromDiscord<Mike> I can launch firefox or something and it works just like I'd expect
17:37:08FromDiscord<Mike> Wait, got it!
17:37:14FromDiscord<Mike> `let p = startProcess("/usr/bin/nvim", options = {poParentStreams})`
17:37:20FromDiscord<sOkam!> In reply to @Mike "It waits like I": vim exists in a terminal window↵you'll need to launch that from the startprocess call, i understand↵what i do with alacritty is `alacritty -l nvim`
17:39:55FromDiscord<ghoom> is https://nim-lang.org/docs/nep1.html the most style nimmers use?
17:40:02FromDiscord<ghoom> (edit) "is https://nim-lang.org/docs/nep1.html the most ... style" added "common"
17:40:16FromDiscord<huantian> mhnm
17:40:29FromDiscord<ghoom> lonml
17:40:38FromDiscord<Mike> Hmm, so that does work too. It launches in a separate instance
17:40:39FromDiscord<Mike> Using `poParentStreams` launches in the same terminal window, which in that case is what I want. But that's still useful
17:43:17*wallabra quit (Ping timeout: 268 seconds)
17:43:46FromDiscord<!Patitotective> In reply to @ghoom "is https://nim-lang.org/docs/nep1.html the most": i think most people use what they feel looks better lol
17:44:22FromDiscord<ghoom> In reply to @Patitotective "i think most people": yeah but what's the most common "looks better" in repos?
17:44:39FromDiscord<ghoom> (edit) ""looks" => ""what they feel looks"
17:45:15FromDiscord<ghoom> also i just noticed that you're not Patitotective
17:46:09FromDiscord<!Patitotective> 👀 how
17:47:02FromDiscord<ghoom> cuz i'm a gamer
17:47:04FromDiscord<ghoom> i mean a programmer
17:47:27FromDiscord<!Patitotective> In reply to @ghoom "yeah but what's the": i think types with pascal case, everything else with camel case is the biggest convention lol
17:48:11*wallabra joined #nim
17:48:14FromDiscord<!Patitotective> you can always see if github has api for "looking at code" and analyse it and find the most common patterns 😁
17:48:24FromDiscord<!Patitotective> In reply to @ghoom "also i just noticed": who am i then
17:48:35FromDiscord<ghoom> In reply to @Patitotective "who am i then": you're false
17:48:49FromDiscord<ghoom> cuz Patitotective's truth value is true
17:49:02FromDiscord<ghoom> cuz it's an object
17:49:04FromDiscord<Dale> Can you overload `!` in nim?
17:49:12FromDiscord<Rika> Yeah sure
17:49:23FromDiscord<Dale> Or rather, overload the boolean value of a type
17:49:40FromDiscord<Rika> Nim does not have truthiness
17:49:44FromDiscord<ghoom> In reply to @Dale "Can you overload `!`": nim has `not` instead of `!` btw
17:49:44FromDiscord<Dale> You can do that in C++ I think
17:50:05FromDiscord<Rika> Nim values do not implicitly have a Boolean value by default
17:50:16FromDiscord<Rika> 1 is not true and 0 is not false by default
17:50:23FromDiscord<ghoom> 🤔
17:50:30FromDiscord<Dale> Ah yeah, I tried to do `if obj:` and it didn't work
17:50:37FromDiscord<Rika> unless you convert explicitly I mean
17:50:42FromDiscord<Dale> Which is kinda annoying, but I get why it's not a thing
17:50:48FromDiscord<ghoom> In reply to @Dale "Which is kinda annoying,": why
17:51:13FromDiscord<Dale> Because nullchecks in the form of `if obj:` are really quick to read & write
17:51:28FromDiscord<Rika> Well value types don’t have a null
17:51:44FromDiscord<Dale> but from what I can tell null/nil isnot very well liked by nim users
17:51:49FromDiscord<huantian> meh not really I always get confused when people do that, I haveto check what type `obj` is to see what that means
17:51:53FromDiscord<Dale> (edit) "isnot" => "is not"
17:52:44FromDiscord<!Patitotective> `isNil` is much clearer
17:53:03FromDiscord<ghoom> "nil" reminds me of lua
17:53:38FromDiscord<ghoom> the first time i ever heard that word is when i started using lua
17:54:16FromDiscord<Dale> It's basically the same as null, but different from false (in Lua)
17:54:54FromDiscord<Dale> which is handy, you can store false in tables (can actually store nil but it's convoluted and not really used much)
17:55:13FromDiscord<ghoom> > (can actually store nil but it's convoluted and not really used much)↵lol
17:55:27FromDiscord<ghoom> true
17:55:30FromDiscord<ghoom> (pun intended)
17:56:03FromDiscord<Tuatarian> Anyone have any experience with Odin?
17:56:06FromDiscord<Tuatarian> (language)
17:58:39FromDiscord<Rika> A small small bit
17:58:43FromDiscord<Rika> I just looked at it
17:59:38FromDiscord<ghoom> what does a procedure type expression look like?
18:00:09FromDiscord<huantian> `let a: proc(x: int, y: string): float = ...`
18:02:02FromDiscord<!Patitotective> i think they meant in odin lol
18:02:10FromDiscord<!Patitotective> unless thats odin
18:02:11FromDiscord<!Patitotective> is it?
18:02:23FromDiscord<Tuatarian> No
18:02:41FromDiscord<Tuatarian> I think ghoom as asking about nim tho
18:02:51FromDiscord<ghoom> ye
18:02:52FromDiscord<Tuatarian> In reply to @huantian "`let a: proc(x: int,": I don't know why but I find this really funny
18:03:17FromDiscord<Tuatarian> I know super little about nim but it seems similar to nim in some ways but different in others
18:03:38FromDiscord<Tuatarian> Much more emphasis on manual memory management which I generally like
18:04:02FromDiscord<Tuatarian> At the same time, that has notable downsides
18:04:42FromDiscord<!Patitotective> leaks lol
18:05:08FromDiscord<Tuatarian> I mean, if you accidentally have a cyclic ref in ARC you're leaking anyway
18:05:42FromDiscord<huantian> that's why you use orc 😛
18:05:43FromDiscord<Tuatarian> And (example) I'm not sure how to do something like an arena in nim simply because I basically never use manual allocation
18:06:17FromDiscord<Tuatarian> Orc is great, no complaints :)
18:06:53FromDiscord<Tuatarian> How do you actually do a virtual arena in nim?
18:07:53FromDiscord<huantian> I mean you can just allocate a bunch of memory manually
18:08:09FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=459A
18:08:52FromDiscord<lantos> (edit) "https://play.nim-lang.org/#ix=459A" => "https://play.nim-lang.org/#ix=459B"
18:08:54FromDiscord<Tuatarian> How do you dole out the allocated memory?
18:09:01FromDiscord<Tuatarian> Also lantos what am I looking at?
18:09:11FromDiscord<lantos> (edit) "https://play.nim-lang.org/#ix=459B" => "https://play.nim-lang.org/#ix=459C"
18:09:13FromDiscord<Tuatarian> Mb I missed the edits
18:11:47FromDiscord<Rika> Can you provide a full running snippet to replicate
18:11:53FromDiscord<Rika> Including usage
18:12:07FromDiscord<huantian> In reply to @iWonderAboutTuatara "How do you dole": I don't know how you woulld in other langs so I have no idea 😛
18:13:00FromDiscord<huantian> you could probably do the same thing as with other langs
18:13:13FromDiscord<lantos> sure
18:14:06FromDiscord<huantian> In reply to @lantos "Is there away to": your generic constraint seems wrong btw, `T: void` means `T` can only be `void`
18:19:43FromDiscord<lantos> sent a code paste, see https://paste.rs/2CY
18:20:12FromDiscord<lantos> (edit) "https://play.nim-lang.org/#ix=459J" => "https://play.nim-lang.org/#ix=459I"
18:23:21FromDiscord<!Patitotective> how do i move an element of a sequence? do i delete it and insert it in other place?
18:25:30FromDiscord<ghoom> In reply to @Patitotective "how do i move": that's the definition of "move" anyway
18:25:42FromDiscord<wiga> the https://media.discordapp.net/attachments/371759389889003532/1000106376342814820/unknown.png
18:26:40FromDiscord<ghoom> In reply to @wiga "the": is `HttpMethod` an enum?
18:27:13FromDiscord<wiga> i copy pasted from the doc
18:27:18FromDiscord<wiga> 🤷‍♂️
18:27:44FromDiscord<ghoom> can you show me?
18:27:56FromDiscord<ghoom> (edit) "show me?" => "link me to it?"
18:28:05FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1000106976858091611/unknown.png
18:28:25FromDiscord<ghoom> yeah it should be `httpMethod` not `HttpMethod`
18:28:28FromDiscord<ghoom> i think
18:28:38FromDiscord<wiga> real
18:28:53FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1000107178717347882/unknown.png
18:29:15FromDiscord<wiga> nvm
18:29:20FromDiscord<demotomohiro> In nim, first character of a word is case sensitive.
18:29:35FromDiscord<wiga> final boss https://media.discordapp.net/attachments/371759389889003532/1000107354819407922/unknown.png
18:29:53FromDiscord<huantian> can you show more of the code
18:30:07FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1000107489695645706/unknown.png
18:30:07FromDiscord<ghoom> below
18:30:10FromDiscord<!"Dialz_†> jonj
18:30:36FromDiscord<huantian> put a discard after the comment before hit
18:31:01FromDiscord<ghoom> `discard` is like `pass` in python
18:31:02FromDiscord<wiga> ty
18:31:17FromDiscord<wiga> In reply to @ghoom "`discard` is like `pass`": or ; in java
18:31:18FromDiscord<ghoom> it can substitute statements
18:31:23FromDiscord<ghoom> ye
18:31:29FromDiscord<!Patitotective> In reply to @ghoom "that's the definition of": 🧐
18:31:36FromDiscord<ghoom> 🐸
18:43:48FromDiscord<ghoom> is there a nim personification yet? preferably an anime girl
18:45:10FromDiscord<demotomohiro> https://github.com/nim-lang/RFCs/issues/104
18:45:35FromDiscord<ghoom> oh wow
18:46:49FromDiscord<ghoom> if nim was an anime girl, it would be 1000% better imo
18:52:58FromDiscord<gat0r> Needs to be an anime girl. That thing is trash
18:53:59FromDiscord<ghoom> In reply to @gat0r "Needs to be an": https://tenor.com/view/dap-handshake-dap-me-up-secret-handshake-friends-gif-21759511
18:55:47FromDiscord<ghoom> how do i make a method be defined at run-time only if an object case is met?
19:03:37FromDiscord<scemino> sent a long message, see http://ix.io/459V
19:04:19FromDiscord<ghoom> In reply to @scemino "Hi I'm <@691628504659394560> ,": doesn't `include` work?
19:04:52FromDiscord<Prestige> In reply to @ghoom "if nim was an": If our mascot became an anime girl I'd delete all my nim code
19:05:05FromDiscord<ghoom> In reply to @Avahe "If our mascot became": 😈
19:05:22FromDiscord<exelotl> In reply to @gat0r "Needs to be an": wtf don't diss nimi
19:06:02FromDiscord<exelotl> now the honeybadger... _that_ is trash :P
19:06:12FromDiscord<ghoom> XD
19:07:14FromDiscord<ghoom> In reply to @Avahe "If our mascot became": cmon man↵anime and programming go together well these days
19:07:28FromDiscord<dom96> We should use the donations to commission a Nim manga
19:07:29FromDiscord<scemino> In reply to @ghoom "doesn't `include` work?": I don't know but there is no issue with `include` ? Do you have an example ?
19:08:00FromDiscord<dom96> so many new people here, where did you come from?
19:08:20FromDiscord<ghoom> In reply to @scemino "I don't know but": cuz `include` literally just puts some file's content in another↵so theoretically it A should be able to see B and vice versa
19:08:24FromDiscord<Prestige> In reply to @ghoom "cmon man anime and": No that's just a dirty lie weebs want you to believe
19:08:32FromDiscord<ghoom> 😭
19:08:40FromDiscord<ghoom> heart attack
19:08:53FromDiscord<ghoom> (edit) "theoretically it" => "theoretically,"
19:09:15FromDiscord<!Patitotective> In reply to @ghoom "how do i make": you dont lmao
19:09:24FromDiscord<ghoom> rip
19:09:42FromDiscord<!Patitotective> actually i dont know↵cant you just `case kind`
19:10:02FromDiscord<ghoom> In reply to @Patitotective "actually i dont know": i can't define methods that way
19:10:18FromDiscord<ghoom> i can just declare proc properties
19:10:20FromDiscord<ghoom> (edit) "i can just declare proc properties ... " added "that way"
19:10:23FromDiscord<!Patitotective> yea but inside the method it does something if its of a kind and nothing otherwise
19:10:57FromDiscord<Generic> I don't think having an official Nim-chan would hurt
19:11:06FromDiscord<ghoom> In reply to @Generic "I don't think having": thank you 😭
19:11:13FromDiscord<ghoom> (edit) "😭" => "😭👍"
19:11:35FromDiscord<ghoom> In reply to @Patitotective "yea but inside the": yea but the method would be defined regardless of the case
19:11:39FromDiscord<ghoom> (edit) "defined" => "run-time-defined"
19:11:53FromDiscord<ghoom> that's my only solution
19:11:55FromDiscord<ghoom> ¯\_(ツ)_/¯
19:12:16FromDiscord<Generic> just it'd need to be additionally to another mascot normal people can empathize with
19:12:33FromDiscord<scemino> In reply to @ghoom "cuz `include` literally just": If B includes A, can I import A in an another file ? or I would have A declared twice ? And if not can I import B somewhere else ?
19:13:10FromDiscord<ghoom> In reply to @scemino "If B includes A,": just put one of the types in a file then include it in place of where the type was
19:13:35FromDiscord<!Patitotective> In reply to @ghoom "yea but the method": i dont think you can define procedures at run-time
19:14:14FromDiscord<Prestige> In reply to @Generic "I don't think having": It would
19:14:26FromDiscord<ghoom> sent a code paste, see https://play.nim-lang.org/#ix=459X
19:14:37FromDiscord<!Patitotective> In reply to @Avahe "It would": i agree↵a cute animal would be way better
19:14:50FromDiscord<ghoom> we need a poll
19:15:13FromDiscord<!Patitotective> ~~pool cause youre a frog jksdf~~
19:15:25FromDiscord<ghoom> 🐸
19:15:44FromDiscord<ghoom> insert kermit suicide gif here
19:16:20FromDiscord<scemino> sent a code paste, see https://play.nim-lang.org/#ix=459Y
19:16:42FromDiscord<demotomohiro> If you want to add some code at runtime, Nimscripter might help you:↵https://github.com/beef331/nimscripter
19:17:22FromDiscord<huantian> In reply to @ghoom "doesn't `include` work?": no stop no include bad
19:17:48FromDiscord<ghoom> In reply to @huantian "no stop no include": why
19:17:51FromDiscord<scemino> In reply to @huantian "no stop no include": What do you propose ?
19:18:07FromDiscord<ghoom> squints eyes
19:18:38FromDiscord<huantian> In reply to @ghoom "why": because you will get things that do things that you don't expect
19:18:45FromDiscord<huantian> and your code will become harder and harder to read
19:19:01FromDiscord<huantian> if you have circular dependencies either use a delayed import or combine your files/type definition blocks
19:20:53FromDiscord<ghoom> what is a delayed import?
19:23:29FromDiscord<scemino> In reply to @huantian "if you have circular": Same question do you have an example ?
19:28:17FromDiscord<huantian> how do the objects depend on each other again?
19:28:46FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=45a3
19:29:17FromDiscord<Phil> Count me in on curiosity for "clean" solutions for circular dependencies.↵I have some of those in my database (characters that are members of a specific organizations but also organizations that have a specific character as a leader).↵That leads to circular dependencies in the corresponding norm models.↵My "solution" was to make a private redefinition of the type that omits the problematic field, that suffices for norm.
19:29:29FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=45a4
19:29:34FromDiscord<!Patitotective> ghoom
19:31:35FromDiscord<scemino> sent a code paste, see https://play.nim-lang.org/#ix=45a7
19:32:17FromDiscord<Phil> So a layer wants to hold a ref to the room it is inside of, and room wants to hold references to all layers inside of it?
19:32:28FromDiscord<huantian> in that case you have to have both definitions in the same `type` block for that to work iirc
19:32:35FromDiscord<scemino> I have maybe too much circular dependencies like this, but still...
19:32:50FromDiscord<huantian> I would recommend you make a `types.nim` file that hold this type definition, and write procs that work on them elsewhere
19:33:34FromDiscord<scemino> I tried this but I had some issues (I don't remember what)
19:34:34FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=45a9
19:35:00FromDiscord<scemino> yes but I had some issues with methods for these types
19:35:08FromDiscord<scemino> I will try to find a concrete example
19:35:23FromDiscord<Phil> Is there ever a clean solution for circular imports btw?
19:36:09FromDiscord<scemino> In reply to @huantian "I would recommend you": all procs in the same files ? or is it possible to split in several files ?
19:36:22FromDiscord<huantian> it should be
19:36:38FromDiscord<huantian> as long as the procs themselves dont' circularly depend on each other
19:37:07FromDiscord<Phil> Time for layers of proc recursion
19:37:25FromDiscord<scemino> that's sad it's not easy as `Java`or `C#`
19:37:53FromDiscord<huantian> In reply to @Isofruit "Is there ever a": I think?
19:38:15FromDiscord<huantian> I swear there is something
19:41:08FromDiscord<Phil> sent a long message, see http://ix.io/45ab
19:41:21FromDiscord<Phil> (edit) "http://ix.io/45ab" => "http://ix.io/45ac"
19:42:09FromDiscord<Phil> (edit) "http://ix.io/45ac" => "http://ix.io/45ad"
19:42:19FromDiscord<scemino> sent a code paste, see https://play.nim-lang.org/#ix=45ae
19:42:37FromDiscord<Phil> Could you throw in the whole code?
19:42:52FromDiscord<Phil> I see an if statement of a custom proc and a lot of custom types
19:43:00FromDiscord<Phil> I can't really say much about that
19:43:16FromDiscord<Kermithos> In reply to @scemino "Another weird problem, if": did u already try to delete the cache?
19:44:09FromDiscord<Phil> or rather, can you replicate this in a minimal example
19:44:12FromDiscord<scemino> In reply to @Isofruit "Could you throw in": Yes https://media.discordapp.net/attachments/371759389889003532/1000126134828138587/generaltool.nim
19:45:51FromDiscord<!Patitotective> In reply to @scemino "Another weird problem, if": imgui 👀
19:45:56FromDiscord<Phil> Where does igBegin come from?
19:47:21FromDiscord<scemino> In reply to @Isofruit "Where does igBegin come": wrapper to cimgui (https://github.com/cimgui/cimgui)
19:47:53FromDiscord<!Patitotective> are you compiling to c or cpp?
19:48:17FromDiscord<scemino> cpp
19:50:28FromDiscord<Phil> ... don't you have to import cimgui somewhere ?
19:50:44FromDiscord<!Patitotective> yea you should be doing `import imgui`
19:50:55FromDiscord<!Patitotective> or `nimgl/imgui`
19:51:05FromDiscord<Phil> disclaimer: Not knowledgeable about c++ usage in nim, I barely have some c usage in nim knowledge
19:51:30FromDiscord<!Patitotective> well its actually a c wrapper so
19:51:47FromDiscord<Phil> Just trying to first figure out where you'd get the symbol definition from in the first place, and if that's within cimgui then you'd need to somehow get access to cimgui first I'd think
19:51:53FromDiscord<scemino> Here is the result https://media.discordapp.net/attachments/371759389889003532/1000128066607132762/engge2.png
19:52:25FromDiscord<!Patitotective> so it compiles??
19:52:35FromDiscord<Phil> Is ↵> import ../../libs/imgui↵Your custom wrapper of cimgui?
19:52:57FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=45ag
19:53:47FromDiscord<lantos> (edit) "https://play.nim-lang.org/#ix=45ag" => "https://play.nim-lang.org/#ix=45ah"
19:53:53FromDiscord<lantos> (edit) "https://play.nim-lang.org/#ix=45ah" => "https://play.nim-lang.org/#ix=45ai"
19:54:06FromDiscord<scemino> sent a code paste, see https://play.nim-lang.org/#ix=45aj
19:54:27FromDiscord<Phil> In reply to @lantos "<@259277943275126785> worked it out": Out of curiosity, would this also compile with just T since T itself should be a typedesc?
19:54:40FromDiscord<Phil> (edit) "In reply to @lantos "<@259277943275126785> worked it out": Out of curiosity, would this also compile with just T ... since" added "instead of T.typedesc"
19:55:01FromDiscord<lantos> yeah it should be but it wasn't liking it so I threw .typedesc in and it stopped complaining
19:55:17FromDiscord<scemino> In reply to @Isofruit "Is > import": Yes I had to, because I wanted to use SDL2 also and I didn't find anything with SDL2 and dear imgui in nim.
19:56:12FromDiscord<Phil> In reply to @scemino "Yes I had to,": Ahhhh so that's how you get the symbol ifBegin defined.↵You imgui module has such a proc. Question, is your igBegin definition generic?
19:57:58FromDiscord<Phil> I'm asking because if you have a generic and it is never used with a specific type, then the code for a proc that deals with that specific type is never generated
19:58:40FromDiscord<Phil> And if I'm reading this right an external cpp file is trying to access the proc, am I comprehending that right?
19:58:42*kenran joined #nim
19:59:38FromDiscord<scemino> sent a code paste, see https://play.nim-lang.org/#ix=45al
20:00:59FromDiscord<Phil> I think this might be reaching the very limited extent of my troubleshooting knowledge for that area.↵I can recommend other folks to you, or preparing some small-ish example to post it on the forum.↵Or lantos/Patito have an idea on helping you out
20:01:45FromDiscord<scemino> In reply to @Isofruit "I think this might": Sounds good thank you, I will share my project on github when it will be more mature.
20:02:01FromDiscord<!Patitotective> yes, complete code would be useful
20:04:05FromDiscord<scemino> Last question, are you able to debug nim project ?
20:04:25FromDiscord<Phil> Define debug?
20:05:47FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=45am
20:05:54FromDiscord<scemino> sorry to use a debugger
20:06:40FromDiscord<scemino> do step in/step out/step over on nim files, watch variables, stack, memory and so on
20:08:11FromDiscord<demotomohiro> https://internet-of-tomohiro.netlify.app/nim/gdb.en.html↵This might help you to use gdb to debug Nim code. But it is bit old.
20:08:11FromDiscord<Phil> You can use typical C debuggers it appears:↵https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#using-code-writestacktrace-code
20:09:28FromDiscord<Phil> out of curiosity demo, how much of a pain is using GDB and the like?
20:10:17FromDiscord<Phil> Compared to quick and dirty "echo out fvalue"
20:10:21FromDiscord<scemino> yes I found this https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html but I wanted to use vscode
20:11:02FromDiscord<demotomohiro> I usually use echo rather than gdb.
20:11:04FromDiscord<scemino> I'm using echo and it is really painful
20:13:25FromDiscord<scemino> run code, modify code to do an echo, run the program, wait to be at the exact moment where I want to reproduce a problem, then I realize that my echo is not enough, I didn't echo all the values needed, and start from the beginning over and over, really painful, sorry but I found that a debugger is really useful.
20:14:09FromDiscord<Phil> No need to convince me, I write java at work which lives and dies on its debuggers, just never used them in a nim context
20:14:51FromDiscord<huantian> The vscode extension has instructions on using a debugger
20:16:24FromDiscord<Phil> > can confirm that debugging native code is possible with this extension (at least Linux GDB)↵Huh
20:16:33FromDiscord<scemino> In reply to @huantian "The vscode extension has": Which one ? Maybe I don't use the correct one
20:16:37FromDiscord<Phil> That's from the nimsaem extension
20:19:51FromDiscord<!Patitotective> i use perf so i can visualize it with https://profiler.firefox.com
20:21:09FromDiscord<!Patitotective> oh, actually its profile not debug :p
20:30:51FromDiscord<wiga> i have a little problem, when it makes the request after it sent it, the program idle but in the code its suppose to stop
20:31:17FromDiscord<wiga> any idea of what's the cause?
20:31:22FromDiscord<wiga> i use httpclient
20:32:24FromDiscord<Phil> In reply to @wiga "i have a little": Sounds like you're sending an asynchronous request when you're expecting it to behave like a synchronous one.↵Do you have a small code snippet to show?
20:33:07FromDiscord<wiga> sent a code paste, see https://play.nim-lang.org/#ix=45aq
20:33:09FromDiscord<wiga> i dont want to get the response
20:33:31FromDiscord<wiga> but i cant use it if i dont assign it
20:34:14FromDiscord<Phil> First things first, because I fear we might be running into language issues here
20:34:30FromDiscord<wiga> a
20:34:32FromDiscord<Phil> You're familiar with async vs sync code?
20:34:40FromDiscord<wiga> uh depends
20:35:01FromDiscord<wiga> i know when you use async you have to await the thing
20:35:15FromDiscord<wiga> and sync you dont have to bother
20:35:17FromDiscord<Phil> Well, you don't have to, but it's an option, but alrighty
20:35:29FromDiscord<scemino> In reply to @Isofruit "That's from the nimsaem": Oh great it works 👏
20:35:47FromDiscord<Phil> I assume the type of client is `HttpClient` ?
20:35:53FromDiscord<wiga> yes
20:36:00FromDiscord<wiga> well ig
20:36:14FromDiscord<wiga> it is yes
20:37:09FromDiscord<Phil> Check. And the issue is it is moving on pas the line of ` res = client.request("http://localhost:9000/server", httpMethod = HttpPost, body = $body)` even though it hasn't received the response yet?
20:37:34FromDiscord<Phil> I'm not entirely sure how to interpret the sentence↵> i have a little problem, when it makes the request after it sent it, the program idle but in the code its suppose to stop
20:37:36FromDiscord<wiga> it sends the request
20:37:40FromDiscord<wiga> the server get it
20:37:49FromDiscord<wiga> but it seems to wait for a response
20:37:57FromDiscord<wiga> but it doesnt send a response
20:38:04FromDiscord<Phil> Ahhh, and you don't want it to wait for a response?
20:38:13FromDiscord<wiga> yes
20:38:18FromDiscord<wiga> exactly
20:38:39FromDiscord<Phil> So the server doesn't even send back an HTTP200 that the request succeeded?
20:38:55FromDiscord<wiga> it does by default
20:39:00FromDiscord<wiga> i use express for backend
20:39:39FromDiscord<Phil> I know it might be annoying that I'm asking this, I've just never seen a server that doesn't give any response to an HTTP request, you tend to always get one, if there's no content then at least HTTP200 to know that you didn't send the request into the void and nothing happened
20:40:17FromDiscord<Phil> In reply to @wiga "it does by default": Does "It does by default" here mean that you explicitly removed it? Or that it still does?
20:40:57FromDiscord<wiga> express sends a 200 by default if the request has been sent without error
20:41:08FromDiscord<wiga> i can specify it tho
20:41:44FromDiscord<Phil> That's fine, you stated you didn't care to send anything specific back, then all you need to do is send a response back that "Yes, Server has received request and done stuff as expected".
20:41:56FromDiscord<Phil> Which is the HTTP200
20:42:04FromDiscord<wiga> i tried and it stills idle
20:42:12FromDiscord<wiga> it doesnt even show the response
20:42:48*kenran quit (Quit: WeeChat info:version)
20:43:16FromDiscord<Phil> Could you add some echos to your code to get an idea at which line it gets stuck?
20:43:32FromDiscord<Phil> Like, you are certain the binary gets stuck on the client.request proc?
20:44:21FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1000141273388298360/unknown.png
20:44:36FromDiscord<wiga> it sent the request
20:46:05FromDiscord<wiga> is there other http client for sync requests?
20:46:06*jmdaemon joined #nim
20:46:13FromDiscord<wiga> or async idk
20:46:54FromDiscord<Phil> I don't think this is a client issue at first glance. It's just not receiving a response, I'll try to poke at my own backend with an HTTP request with nim and see if it works
20:47:06FromDiscord<wiga> alr
20:48:08FromDiscord<wiga> oh it worked
20:48:23FromDiscord<wiga> i made my backend send "allah" and it worked lmao
20:48:48FromDiscord<Phil> Check if you previously were actually returning HTTP200 by poking your backend via postman
20:49:02FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1000142453438939286/unknown.png
20:49:15FromDiscord<Phil> Huh, nice
20:49:22FromDiscord<Phil> And you said you didn't care about the response?
20:49:44FromDiscord<Phil> If this is time critical, you could have that run async and move on with your actual code without having to wait for the request to complete
20:50:10FromDiscord<wiga> im gonna see if it makes a difference wait
20:51:46FromDiscord<wiga> it gets stuck somewhere else now
20:53:58FromDiscord<wiga> it get stuck on my pinger
20:54:31FromDiscord<wiga> i forgot a socket.close() 🤦‍♂️
20:55:37FromDiscord<Phil> 😆 Yeh, it's always the little things that get us.↵Btw. you were doing this over websockets?
20:55:52FromDiscord<Phil> Or is that just expressjs syntax?
20:56:06FromDiscord<wiga> it generates a random ip, check if a minecraft server is open on it and if yes send the ip on my backend
20:58:00FromDiscord<ghoom> what's the diff between `uint` and `Natural`?
20:58:28FromDiscord<!Patitotective> Natural is a range from 0 to infinite↵uint is an actual unsigend integer
20:58:54FromDiscord<!Patitotective> nim recommends using natural so you dont have to implement all arithmetic stuff with uints
20:59:04FromDiscord<ghoom> you mean naturals are floats?
20:59:22FromDiscord<huantian> no naturals are ints with bounds checking
20:59:30FromDiscord<!Patitotective> `Natural = range[0 .. high(int)]`
20:59:38FromDiscord<ghoom> but you said infinite lmao
20:59:48FromDiscord<!Patitotective> ¯\_(ツ)_/¯
21:00:09FromDiscord<ghoom> In reply to @Patitotective "`Natural = range[0 ..": but that's literally a uint
21:00:13FromDiscord<!Patitotective> nope
21:00:18FromDiscord<!Patitotective> uint takes less memory
21:00:31FromDiscord<ghoom> 😕
21:00:43FromDiscord<!Patitotective> because in ints one bit is used to store the sign
21:01:07FromDiscord<ghoom> it's still there for uints tho
21:01:19FromDiscord<ghoom> uints ain't gonna be one bit smaller
21:01:23FromDiscord<huantian> here's one way to see it
21:01:27FromDiscord<!Patitotective> but one bit bigger
21:01:30FromDiscord<huantian> !echo Natural.high + 1
21:01:43FromDiscord<huantian> !eval echo Natural.high +1; echo uint64.high + 1
21:01:46NimBotCompile failed: /usercode/in.nim(1, 13) Error: type mismatch: got <typedesc[Natural], int literal(1)>
21:01:56FromDiscord<huantian> excuse mwa
21:02:00FromDiscord<ghoom> xd
21:02:10FromDiscord<huantian> oh I forgot a space
21:02:11FromDiscord<huantian> agh
21:02:14FromDiscord<!Patitotective> !eval echo Natural.high + 1; echo uint64.high + 1
21:02:18NimBot/usercode/in.nim(1) in↵/playground/nim/lib/system/fatal.nim(53) sysFatal↵Error: unhandled exception: over- or underflow [OverflowDefect]
21:02:30FromDiscord<ghoom> but if the highest value for a natural is `high(int)`, doesnt that mean `uint`s are superior since they can store more?
21:02:38FromDiscord<huantian> no
21:02:40FromDiscord<ghoom> (edit) "more?" => "more positives?"
21:02:41FromDiscord<huantian> !eval echo uint64.high + 1
21:02:45NimBot0
21:02:50FromDiscord<huantian> instead of raising an error when it overflows it does that
21:02:55FromDiscord<huantian> and then breaks your code
21:03:34FromDiscord<🐒🧠br4n_d0n> Natural has overflow checks to prevent unintended issues unlike uint
21:03:41FromDiscord<ghoom> ok cool
21:03:44FromDiscord<ghoom> tamks
21:03:59FromDiscord<!Patitotective> also using natural you can use every proc that uses int↵without having to cast
21:04:26FromDiscord<🐒🧠br4n_d0n> Can you elaborate?
21:04:59FromDiscord<ghoom> In reply to @Patitotective "!eval echo Natural.high +": someone needs to use slash commands
21:05:09FromDiscord<ghoom> (edit) "use" => "implement" | "implementslash commands ... " added "here"
21:05:19FromDiscord<huantian> yeah figure out how to get slash commands to work over in irc
21:05:25FromDiscord<huantian> then we can use slash commands 😛
21:05:39FromDiscord<ghoom> irc?
21:05:42FromDiscord<!Patitotective> i mean↵if i procedure accepts an integer and you want to use it inside your own procedure that only accepts natural numbers you can pass the natural integer directly to the other procedure, meanwhile using unsigned integers require you to cast it to an integer
21:05:57FromDiscord<🐒🧠br4n_d0n> BTW ghoom, I like your avatar
21:05:58FromDiscord<!Patitotective> In reply to @ghoom "irc?": yes, discord is connected to irc
21:06:11FromDiscord<ghoom> In reply to @Patitotective "yes, discord is connected": bruh wtf
21:06:22FromDiscord<ghoom> y'all are high
21:06:35FromDiscord<ghoom> XD
21:07:04FromDiscord<!Patitotective> https://en.wikipedia.org/wiki/Internet_Relay_Chat
21:07:12FromDiscord<ghoom> i know what irc is
21:07:28FromDiscord<ghoom> i just don't know why you think discord relies on it
21:07:32FromDiscord<🐒🧠br4n_d0n> They have bots set to integrate Discord with Matrix and IRC
21:07:55FromDiscord<Phil> "discord is connected to irc" as in "this discord is connected to irc"
21:08:03FromDiscord<ghoom> In reply to @Isofruit ""discord is connected to": oooh ok
21:08:18FromDiscord<!Patitotective> 🧠
21:08:23FromDiscord<ghoom> 🤯
21:08:32FromDiscord<wiga> whats the equivalent of null?
21:08:35FromDiscord<!Patitotective> nil
21:08:43FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1000147402533126164/unknown.png
21:08:45FromDiscord<Phil> That's why you'll find regularly people with the "bot" tag posting which sound suspiciously sentient, it's a running gag at this point
21:08:56FromDiscord<ghoom> In reply to @Patitotective "nil": i think that was a world record
21:08:56FromDiscord<huantian> `data.isNil`
21:08:57FromDiscord<!Patitotective> In reply to @wiga "": `data.isNil`
21:09:27FromDiscord<!Patitotective> In reply to @ghoom "i think that was": yes, i do nothing more but look at this channel cause im stuck with everything i try to do :p
21:09:49FromDiscord<wiga> what https://media.discordapp.net/attachments/371759389889003532/1000147678899994757/unknown.png
21:09:54FromDiscord<ghoom> In reply to @Patitotective "yes, i do nothing": 🤝
21:10:07FromDiscord<!Patitotective> In reply to @wiga "what": what type is `data`
21:10:12FromDiscord<huantian> is `data` an `object` or a `ref object`↵(@wiga)
21:10:12FromDiscord<wiga> string
21:10:18FromDiscord<huantian> strings are never null
21:10:20FromDiscord<huantian> they're value types
21:10:34FromDiscord<!Patitotective> you can `data.len == 0` to check if it's empty
21:10:35FromDiscord<🐒🧠br4n_d0n> ""
21:10:46FromDiscord<Phil> In reply to @wiga "string": Are you aware of the difference between ref types and value types?
21:11:03FromDiscord<wiga> dude i started nim like yesterday
21:11:17FromDiscord<!Patitotective> you should read the tutorial https://nim-lang.org/docs/tut1.html
21:11:20FromDiscord<Phil> Wasn't meant accusatory, was more a general question whether I should dive into it
21:11:43FromDiscord<!Patitotective> and check the manual from time to time https://nim-lang.org/docs/manual.html
21:11:56FromDiscord<wiga> i always look at the docs
21:11:58FromDiscord<ghoom> In reply to @Patitotective "and check the manual": our bible
21:12:00FromDiscord<Phil> In reply to @wiga "dude i started nim": Alrighty, I'll do a quick deep dive about it. Have you written in other languages before? Other languages tend to have similar stuff
21:12:09FromDiscord<Phil> So I might be able to reference them to make it easier to understand
21:12:18FromDiscord<!Patitotective> In reply to @ghoom "our bible": our outdated and sometimes incomplete bible, yes
21:12:46FromDiscord<wiga> In reply to @Isofruit "Alrighty, I'll do a": idk i do nodejs, powershell, a bit of java, vbs(yes its old), html, css, js and other stuff
21:13:03FromDiscord<wiga> and python
21:13:06FromDiscord<Phil> In reply to @wiga "idk i do nodejs,": Java! Perfect, so you're familiar with the fact that java calls some types "primitives"?
21:13:24FromDiscord<ghoom> In reply to @wiga "idk i do nodejs,": > powershell↵🤝
21:13:27FromDiscord<Phil> Have you heard of "pass by value" and "Pass by reference" in the context of function calls?
21:13:33FromDiscord<🐒🧠br4n_d0n> In reply to @Patitotective "our outdated and sometimes": ... it is in serious need of some love and think it needs to use more "plain language" to help beginners. https://en.wikipedia.org/wiki/Plain_language
21:13:45FromDiscord<wiga> In reply to @Isofruit "Java! Perfect, so you're": "a bit" means i started like 2 days ago and still understand alf of the stuff
21:13:58FromDiscord<wiga> (edit) "In reply to @Isofruit "Java! Perfect, so you're": "a bit" means i started like 2 days ago and still ... understand" added "dont"
21:14:02FromDiscord<Phil> Alright, in that case I'll get out some drawio
21:14:18FromDiscord<Phil> If you use vscode, I highly recommend the drawio extension btw, wonderful for making sketches
21:14:34FromDiscord<!Patitotective> gimp goes brrr
21:14:43FromDiscord<Phil> Not with that interface it doesn't
21:14:47FromDiscord<ghoom> In reply to @Patitotective "gimp goes brrr": laughs in magick
21:14:52FromDiscord<ghoom> (edit) "laughs" => "laughs" | "magick" => "magick"
21:14:57FromDiscord<wiga> In reply to @Patitotective "gimp goes brrr": flameshot drawing goes bababoi
21:15:00FromDiscord<ghoom> (edit) "magick" => "imagemagick"
21:17:37FromDiscord<!"Dialz_†> Baboi
21:20:16FromDiscord<wiga> bab
21:20:42FromDiscord<ghoom> why isn't `Natural` defined as `range[0..high(uint)]`?
21:21:40FromDiscord<Phil> One sec, drawing image
21:22:45FromDiscord<!Patitotective> what is he going to draw 👀
21:23:12FromDiscord<eyecon> In reply to @wiga "flameshot drawing goes bababoi": Mermaid/PlantUML goes tralala
21:23:47FromDiscord<ghoom> In reply to @Patitotective "what is he going": nim chan
21:23:51FromDiscord<!Patitotective> nooo
21:23:55FromDiscord<ghoom> xd
21:24:03FromDiscord<ghoom> yes
21:24:05FromDiscord<ghoom> (edit) "yes" => "yes!!"
21:24:22FromDiscord<Phil> god... damnit vscode, stop crashing on me when I want to save
21:24:35FromDiscord<ghoom> 🪦
21:24:55FromDiscord<!Patitotective> In reply to @ghoom "why isn't `Natural` defined": because then it would be of type uint, not int
21:24:59FromDiscord<!Patitotective> and using it would be useless
21:25:20FromDiscord<ghoom> isn't the range-checking useful enough?
21:25:42FromDiscord<!Patitotective> a uint cannot be negative
21:25:52FromDiscord<ghoom> yeah but what's wrong with that?
21:26:07FromDiscord<ghoom> natural can't be negative either
21:26:10FromDiscord<Elegantbeef> Nim wants you to default to `int`s
21:26:21FromDiscord<ghoom> oh
21:26:38FromDiscord<Elegantbeef> Natural being an alias to uint doesnt solve what it's meant to solve
21:26:49FromDiscord<Elegantbeef> Natural is supposed to be all natural integer numbers
21:28:35FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=45aw
21:29:12FromDiscord<ghoom> i see
21:29:58FromDiscord<🐒🧠br4n_d0n> I don't understand the need for pushing ints all of the time... IMO I find more than not I'm using non-negative values
21:30:22FromDiscord<Elegantbeef> The reason is that in nim uints do not do over/underflow checks
21:30:32FromDiscord<Elegantbeef> And it's much easier to underflow a uint than an int
21:31:08*krux02 joined #nim
21:32:04FromDiscord<Elegantbeef> There are arguments for defaulting to both uint and int
21:34:01FromDiscord<Elegantbeef> It's also not like in most cases a 64bit int doesnt have enough positive values 😄
21:34:23*Guest2776 joined #nim
21:34:42FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=45ax
21:35:03FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=45ax" => "https://play.nim-lang.org/#ix=45ay"
21:35:14FromDiscord<Phil> Wait, where is the image
21:35:16FromDiscord<Phil> God damnit
21:35:20FromDiscord<Elegantbeef> > var myObj2 = myObj there will now be 2 objects in memory which are copies of one another.↵With the caveat you arent using Orc/Arc 😛
21:35:23FromDiscord<Phil> Fine, I'll throw it up on imgur
21:35:43FromDiscord<Phil> In reply to @Elegantbeef "> var myObj2 =": We're at the point where we're elaborating on what a ref or object type even is, I don't think bringing up orc/arc is useful yet 😛
21:35:58FromDiscord<Elegantbeef> Cmon phil it
21:36:16FromDiscord<Phil> sidenote, the fact I can't post images here to elaborate points is pretty annoying
21:36:49FromDiscord<Elegantbeef> Why cant you?
21:36:57FromDiscord<Phil> https://i.imgur.com/eQwEnUE.png
21:37:16Guest2776Oh, you're bridged to discord, are you perhaps bridged to xmpp?
21:37:21FromDiscord<Phil> In reply to @Elegantbeef "Why cant you?": I tried earlier where in the explanation, that should've had an image attached, apparently got insta removed since it never showed up
21:37:32FromDiscord<Elegantbeef> Your `myRefObj` should be on stack
21:37:47FromDiscord<Elegantbeef> References are pointers on the stack that point to the heap
21:38:02FromDiscord<Elegantbeef> Unless of course you've got a ref in heap allocated memory
21:38:25Guest2776ref ref...
21:39:42FromDiscord<Phil> In reply to @Elegantbeef "Your `myRefObj` should be": Fair, the image was more meant to illustrate that 1) the content of ref objects is in heap, the content of value objects is in stack 2) variables of ref objects do not store contents of an object but a pointer to the heap memory.
21:41:53FromDiscord<Elegantbeef> Hey where would i be without pedantry
21:44:01FromDiscord<Phil> sent a long message, see http://ix.io/45az
21:45:35FromDiscord<Phil> Now why is that important?↵You may have noticed that java has this nice thing called "null" and "NullPointerExceptions"
21:45:41FromDiscord<Phil> In nim that is "nil"
21:45:56*toluene quit (Read error: Connection reset by peer)
21:46:11FromDiscord<Phil> That is the concept of "You have a variable that contains a pointer that is empty."↵As in, there is no memory on the heap with anything for you. The variable is empty.
21:47:06*toluene joined #nim
21:47:36FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=45aB
21:47:51FromDiscord<Phil> `a.name == ""` will be true instead of throwing an exception!
21:47:57FromDiscord<🐒🧠br4n_d0n> https://tenor.com/view/imostergolfra-gif-25274972
21:49:49FromDiscord<Phil> Joke not really appreciated, but alright, I'll stop
21:50:12FromDiscord<wiga> In reply to @Isofruit "`a.name == ""` will": yes
21:50:22FromDiscord<🐒🧠br4n_d0n> You don't have to stop, I was just joking that it's a lot of text in one go
21:50:37FromDiscord<wiga> thing is now
21:50:57FromDiscord<wiga> the socket is not giving up trying to connect even with a 400ms timeout
21:51:00FromDiscord<Phil> In reply to @wiga "yes": Once you got that value types ALWAYS have a value and can not ever be null, you'll see why you can't check them for nil
21:51:23FromDiscord<ghoom> why don't ranges accept uints?
21:51:41FromDiscord<ghoom> (edit) "ranges" => "subranges"
21:51:44FromDiscord<!Patitotective> they dont?
21:51:51FromDiscord<ghoom> (edit) "subranges" => "subrange types"
21:51:59FromDiscord<!Patitotective> !eval echo range[0u..10u]
21:52:00FromDiscord<ghoom> `range[2..high(uint)]` returns an error
21:52:04NimBotrange 0..10(uint)
21:52:14FromDiscord<wiga> whats wrong with this https://media.discordapp.net/attachments/371759389889003532/1000158354351603903/unknown.png
21:52:19FromDiscord<ghoom> oh so i should mark 2 as unsigned
21:52:30FromDiscord<!Patitotective> yes
21:52:35FromDiscord<ghoom> me bad
21:52:36FromDiscord<wiga> it tries to connect but its not timingout
21:53:13FromDiscord<!Patitotective> btw @wiga you should put `socket.close()` in a `finally` block
21:53:32FromDiscord<wiga> no idea of what it is 😃
21:53:49FromDiscord<!Patitotective> it executes that block of code no matter if it excepts
21:54:13FromDiscord<wiga> how
21:54:33FromDiscord<!Patitotective> read this https://nim-lang.org/docs/manual.html#exception-handling
21:54:34FromDiscord<Phil> In reply to @wiga "no idea of what": Basically, the full construct is not "try except", it's "try except finally". The finally block is just often ommitted since there isn't always something that must be done, no matter if the bit within "try" succeeded or not
21:55:37FromDiscord<Phil> As for websockets, I haven't used them enough to give much feedback here
21:57:35FromDiscord<wiga> is there a way to enable a verbose mod?
21:59:30FromDiscord<wiga> @.luke 🤝 https://media.discordapp.net/attachments/371759389889003532/1000160184217370644/unknown.png
22:00:02FromDiscord<Elegantbeef> To see why it's erroring you can do `except Exception as e: echo e.msg`↵(@wiga)
22:00:28FromDiscord<# Luke> In reply to @wiga "<@704106773660827690> 🤝": Lol nice
22:01:07FromDiscord<wiga> In reply to @Elegantbeef "To see why it's": first i get an error instantly but second is slow https://media.discordapp.net/attachments/371759389889003532/1000160589668167871/unknown.png
22:03:22FromDiscord<wiga> second got timedout after 1min when its suppose to have a 400ms timeout https://media.discordapp.net/attachments/371759389889003532/1000161155643363378/unknown.png
22:03:56FromDiscord<🐒🧠br4n_d0n> Is there a way to get the available/total system memory?
22:07:04FromDiscord<Elegantbeef> That's odd↵(@wiga)
22:07:49FromDiscord<# Luke> In reply to @wiga "first i get an": Kde?
22:08:00FromDiscord<wiga> In reply to @ripluke "Kde?": yes
22:08:01FromDiscord<wiga> sent a code paste, see https://play.nim-lang.org/#ix=45aH
22:08:12FromDiscord<# Luke> Oh
22:08:32FromDiscord<wiga> garuda is fast asf
22:08:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45aI
22:08:54FromDiscord<wiga> sent a code paste, see https://play.nim-lang.org/#ix=45aJ
22:09:09FromDiscord<# Luke> Kde? Fast? Never heard those words in the same sentence lmao 🤣
22:09:11FromDiscord<Elegantbeef> It's funny cause it's just `return data[0] != '\255`
22:09:21FromDiscord<wiga> In reply to @ripluke "Kde? Fast? Never heard": i mean garuda to play games
22:09:25FromDiscord<Elegantbeef> sorry `'\255'`
22:09:40FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=45aK
22:09:47FromDiscord<# Luke> In reply to @wiga "i mean garuda to": That's cuz of the zen kernel lol
22:09:56FromDiscord<🐒🧠br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=45aL
22:10:26FromDiscord<wiga> In reply to @br4n_d0n "... I'm looking for": check for one with bash and make a if/else with os.platform prbly idk
22:10:35FromDiscord<Elegantbeef> Stop it
22:10:42FromDiscord<wiga> if os.platform exists in nim
22:10:42FromDiscord<Elegantbeef> Dont suggest using shell commands in a program
22:10:49FromDiscord<wiga> to get memory?
22:11:15FromDiscord<Elegantbeef> those shell commands typically call apis that are accessible
22:12:01FromDiscord<🐒🧠br4n_d0n> Beef any suggestions?
22:12:19FromDiscord<Elegantbeef> Use sysinfo on linux, the windows API on windows and the mac api on mac
22:12:49FromDiscord<🐒🧠br4n_d0n> 😫 there isn't a Nim builtin for this?
22:12:55FromDiscord<wiga> basically the same thing but yes
22:13:09FromDiscord<Elegantbeef> needing to know how much ram a PC has isnt a common operation really
22:14:12FromDiscord<Elegantbeef> For linux it's just a `sysinfo` call
22:14:14FromDiscord<wiga> In reply to @Elegantbeef "sorry `'\255'`": it returns either nothing or this https://media.discordapp.net/attachments/371759389889003532/1000163890321166466/2022-07-22_17-17.png
22:14:31FromDiscord<Elegantbeef> https://github.com/treeform/sysinfo might make you happy brandon
22:15:02FromDiscord<Elegantbeef> Yea i dont know what it's supposed to do
22:15:38FromDiscord<wiga> In reply to @Elegantbeef "https://github.com/treeform/sysinfo might make you": it executes shell commands lmfao
22:15:43FromDiscord<wiga> in some places
22:16:04FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1000164354018246656/unknown.png
22:16:06FromDiscord<Elegantbeef> It really shouldnt
22:16:51FromDiscord<wiga> it has the memory stuff tho https://media.discordapp.net/attachments/371759389889003532/1000164550873731212/unknown.png
22:17:04FromDiscord<wiga> btw https://media.discordapp.net/attachments/371759389889003532/1000164606280474686/unknown.png
22:17:06FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1000164614748766238/image.png
22:17:24FromDiscord<Elegantbeef> Why it doesnt just use `sysInfo` on linux is beyond me
22:17:24FromDiscord<wiga> thw whole library is executing shell commands
22:18:13FromDiscord<Elegantbeef> Or reading linux files instead of using the C apis
22:18:15FromDiscord<Elegantbeef> Cause fuck me i guess
22:18:30FromDiscord<wiga> kek
22:19:01FromDiscord<Elegantbeef> Anyway brandon you can use that api or go wrap the sysinfo and friends for each OS
22:24:19FromDiscord<🐒🧠br4n_d0n> 🐒 I think I'll go back to smashing rocks...
22:25:50FromDiscord<🐒🧠br4n_d0n> Though, I agree with you on using things like sysinfo over scripts unless there is a good enough reason to go the other way
22:26:19FromDiscord<Nimion #ඞ> In reply to @br4n_d0n "🐒 I think": me when I see anything from the C ecosystem
22:26:25FromDiscord<Nimion #ඞ> (edit) "C" => "C/C++"
22:27:00FromDiscord<ghoom> why doesn't nim support tabs?
22:27:24FromDiscord<🐒🧠br4n_d0n> It's a style choice that might be changed in an upcoming update
22:27:31FromDiscord<ghoom> i hope so
22:28:00FromDiscord<🐒🧠br4n_d0n> For now, I've mapped my editor to use spaces for Nim files
22:28:06FromDiscord<ghoom> same
22:29:59FromDiscord<!Patitotective> In reply to @ghoom "why doesn't nim support": spaces goes bbrrr
22:29:59FromDiscord<🐒🧠br4n_d0n> @TryAngle what's the creature in your avatar picture?
22:30:08FromDiscord<Nimion #ඞ> In reply to @br4n_d0n "<@147447489316913152> what's the creature": it's not a creature
22:30:10FromDiscord<Nimion #ඞ> it's a chad animal
22:30:14FromDiscord<Nimion #ඞ> Binturong
22:31:03FromDiscord<Elegantbeef> The reason Nim doesnt use tabs is they're not easily configurable across editors/viewers
22:31:17FromDiscord<ghoom> In reply to @Patitotective "spaces goes bbrrr": laughs in U+2003
22:31:32FromDiscord<🐒🧠br4n_d0n> In reply to @Elegantbeef "The reason Nim doesnt": https://tenor.com/view/this-is-some-bullshit-pissed-off-spongebob-gif-13980660
22:31:35FromDiscord<Nimion #ඞ> In reply to @br4n_d0n "<@147447489316913152> what's the creature": https://www.youtube.com/watch?v=ZDz9ELQ4zpo
22:31:41FromDiscord<Elegantbeef> Araq wanted a single indent character and due to the fact not all places allow easily customizing tab size spaces were chosen
22:32:00FromDiscord<Nimion #ඞ> In reply to @Elegantbeef "Araq wanted a single": omg I love Araq
22:32:01FromDiscord<Elegantbeef> And no there isnt any indication of being changed to allow tabs in a coming update
22:32:07FromDiscord<Nimion #ඞ> whatever else he does good or bad, this is enough
22:32:18FromDiscord<ghoom> TAB GANG
22:32:24FromDiscord<ghoom> WHO'S WITH ME?
22:32:29FromDiscord<huantian> Nobody
22:32:33FromDiscord<!Patitotective> yes, nobody
22:32:36FromDiscord<ghoom> fuck
22:32:43FromDiscord<Elegantbeef> Tabs are superior but it makes sense that in a white space significant language you want a single indent and spaces seemed better
22:32:44FromDiscord<Nimion #ඞ> this is so annoying in python, opening a file and it has different tab sizes than you have in ur editor
22:32:56FromDiscord<Elegantbeef> What?↵(@TryAngle)
22:33:13FromDiscord<Elegantbeef> The entire benefit of tabs is that they're customizable
22:33:18FromDiscord<Elegantbeef> Like the fuck are you on about
22:33:28FromDiscord<ghoom> In reply to @Elegantbeef "Like the fuck are": XD
22:33:31FromDiscord<🐒🧠br4n_d0n> Lol
22:33:38FromDiscord<!Patitotective> sublime detects the language and sets the tabs/spaces↵doesnt all editors do that? lol
22:33:48FromDiscord<Elegantbeef> They do
22:34:06FromDiscord<Nimion #ඞ> have u never opened a haskell or bash or python file and it had turbo random tab spaces?
22:34:18FromDiscord<🐒🧠br4n_d0n> I'm partial to tabs, but have no loyalty to either side
22:34:19FromDiscord<Elegantbeef> No i dont write those languages
22:34:59FromDiscord<Elegantbeef> I mean i see people that horizontally align code so that's enough random spaces
22:36:10FromDiscord<🐒🧠br4n_d0n> I don't like that Nim uses 2 spaces though as I've run into instances where the indentation becomes a little difficult to tell on a quick glance... I would prefer 4
22:36:23FromDiscord<Elegantbeef> Then use 4?
22:36:29FromDiscord<!Patitotective> you can use the spaces you want↵2 spaces is just a convention
22:36:37FromDiscord<Elegantbeef> As long as you arent contributing to the stdlib/compiler you can use 120 if you want
22:52:32FromDiscord<exelotl> you could also try a rainbow indent extension, that makes the indentation a lot easier to read
22:53:18FromDiscord<ghoom> In reply to @exelotl "you could also try": rainbow?
22:53:26FromDiscord<ghoom> 🌈
22:53:53FromDiscord<exelotl> yeah, like this one: https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow
22:54:07FromDiscord<ghoom> oh that's cute
22:54:24FromDiscord<ghoom> i love it 😍
22:54:47FromDiscord<exelotl> it was like training wheels for me
22:55:03FromDiscord<exelotl> eventually it broke in the version of vscode I use
22:55:09FromDiscord<exelotl> but then I realised I could live without it xD
22:55:17FromDiscord<Generic> it still works for me?
22:55:22FromDiscord<ghoom> yeah it's not necessary imo but it's fun
22:57:43FromDiscord<exelotl> I think it only broke in code-oss
22:58:18FromDiscord<exelotl> and vscodium
22:58:47FromDiscord<exelotl> it's been a while since I tried it though so maybe it started working again x)
23:00:17FromDiscord<Elegantbeef> You can get it to work by downloading an older version and using it
23:07:41FromDiscord<eyecon> In reply to @exelotl "and vscodium": Current version works in vscodium, I use it
23:08:09FromDiscord<exelotl> ah, good to know
23:22:47FromDiscord<ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45aW
23:23:05FromDiscord<huantian> too bad that looks horrible 😛
23:23:16FromDiscord<ghoom> imagine a lot of em
23:23:27FromDiscord<ghoom> i dont wanna exceed 80 chars
23:23:33FromDiscord<ghoom> (edit) "i dont wanna exceed 80 chars ... " added "per line"
23:23:39FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=45aX
23:23:52FromDiscord<ghoom> imagine if the type is `Option[range[2u..high(uint)]]`
23:24:00FromDiscord<ghoom> 😭
23:26:08FromDiscord<huantian> you can omit the `range` in there btw
23:26:21FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=45aY
23:26:54FromDiscord<ghoom> sent a code paste, see https://play.nim-lang.org/#ix=45aZ
23:26:57FromDiscord<ghoom> shorty lol
23:27:26FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=45b0
23:27:32FromDiscord<ghoom> ye i was gonna do dat
23:27:46FromDiscord<Prestige> Read it as unnatural
23:27:52FromDiscord<sOkam!> `type UNaturallyShorty` feels better in the context
23:27:57FromDiscord<sOkam!> 😄
23:28:22FromDiscord<ghoom> and now we're back to long type expressions
23:28:37FromDiscord<ghoom> XD
23:35:37FromDiscord<ghoom> what's the diff between `object` and `object of RootObj`?
23:35:58FromDiscord<!Patitotective> object of RootObj can be inheritable
23:36:14FromDiscord<ghoom> but why not object?
23:36:23FromDiscord<huantian> because
23:36:45FromDiscord<ghoom> he broke
23:36:51FromDiscord<!Patitotective> yes, because
23:37:07FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=45b5
23:37:23FromDiscord<ghoom> but why is RootObj necessary for inheritance?
23:37:23qwri'm not sure, but it looks like plain object is more like simple record type
23:37:51qwrprobably compiler uses it to generate more efficent code
23:37:51FromDiscord<!Patitotective> In reply to @ghoom "but why is RootObj": yes https://media.discordapp.net/attachments/371759389889003532/1000184934671056926/unknown.png
23:38:32FromDiscord<ghoom> honestly why not just assume RootObj when the parent is not specified?
23:38:43FromDiscord<ghoom> 🤔
23:38:51FromDiscord<Elegantbeef> Cause they have different semantics
23:38:55FromDiscord<Elegantbeef> `ref object` has no type information
23:39:04FromDiscord<Elegantbeef> `object` has no type information
23:39:13FromDiscord<Elegantbeef> only `object of RootObj` has type information
23:39:26FromDiscord<ghoom> but whyyy
23:39:31FromDiscord<ghoom> im gonna cry
23:39:34FromDiscord<!Patitotective> he just answered...
23:39:51FromDiscord<ghoom> idk man
23:39:59FromDiscord<ghoom> frogs are dumb
23:39:59FromDiscord<Elegantbeef> Cause Nim is a system language and type information adds a pointer and extraneous data only needed if you're doing OOP or dynamic dispatch
23:40:16FromDiscord<Elegantbeef> Nim is a procedural language with OOP mechanisms it's not an OOP language with procedural mechanisms
23:40:27FromDiscord<Elegantbeef> `object` in Nim is just a `struct` in most other languages
23:40:48FromDiscord<ghoom> ah, so if you specify the parent, it now no longer becomes a simple struct
23:40:54qwri just tried, any object with {.inheritable.} annotation can be used as parent
23:41:06FromDiscord<Elegantbeef> Yes it adds type information qwr
23:41:18FromDiscord<Elegantbeef> It's only really meant for CInterop though
23:41:22FromDiscord<ghoom> 🐸👍
23:41:41FromDiscord<Elegantbeef> You can do `{.pure, inheritable.}` which means when you do `object of Base` it copies the fields and adds no type information
23:41:47FromDiscord<ghoom> btw can you guys see emoji on irc?
23:41:53FromDiscord<Elegantbeef> I'm not on irc
23:42:05FromDiscord<ghoom> where?
23:42:09FromDiscord<Elegantbeef> Matrix
23:42:14FromDiscord<ghoom> ah ok
23:42:17FromDiscord<Elegantbeef> I have full multimedia support here
23:42:31FromDiscord<ghoom> i think qwr is using irc
23:42:33FromDiscord<ghoom> no?
23:42:36FromDiscord<Elegantbeef> Yep
23:42:54FromDiscord<Elegantbeef> The answer is going to be "only if the emoji is unicode and my font supports it"
23:43:07FromDiscord<ghoom> fair enough
23:43:11FromDiscord<Elegantbeef> The matrix bridge actually even handles custom discord emojis
23:43:21FromDiscord<ghoom> wow
23:43:34FromDiscord<ghoom> matrix 🤘
23:44:34qwrghoom: yes, these come over to irc as unicode characters (via utf-8)
23:44:47FromDiscord<!Patitotective> the only thin they dont see are reactions
23:44:56FromDiscord<Elegantbeef> Custom emojis i assume are just `:name:`
23:45:00FromDiscord<!Patitotective> (edit) "thin" => "thing"
23:45:52FromDiscord<Elegantbeef> to be fair though making `= object` equivlent to `{.pure, inheritable.}` actually doesnt seem bad to me
23:46:07FromDiscord<ghoom> ikr???
23:46:27FromDiscord<Elegantbeef> I dont think you do know
23:47:17FromDiscord<Elegantbeef> The issue is going to be whenever you use low level operations like `copyMem` or similar though
23:47:31FromDiscord<Elegantbeef> So being able to blindly have a larger type means you lose this data
23:47:49FromDiscord<Elegantbeef> So there are cases where it makes sense you cannot inherit
23:50:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45b8
23:50:16FromDiscord<Elegantbeef> That doesnt behave as one expects
23:51:05FromDiscord<Elegantbeef> this can be resolved by do `proc doThing[T: A](a, b: var T)` but alas it doesnt error which is important to note