<< 01-10-2022 >>

00:31:24FromDiscord<sOkam!> How do you work with raw byte data buffers (for file generation/modification, etc) in Nim?
00:32:04FromDiscord<sOkam!> If the question is too basic/simple, just pointing me to some proc names or std page would be fine
00:38:30FromDiscord<demotomohiro> Something like `seq[int8]`?↵https://nim-lang.org/docs/io.html#writeBytes%2CFile%2CopenArray%5B%5D%2CNatural%2CNatural
00:39:37FromDiscord<huantian> I think people usually use uint8 or byte but yeah
00:41:13FromDiscord<jos> in what scenario do you use typedesc[int] over int?
00:41:16FromDiscord<jos> so like
00:41:33FromDiscord<jos> in an argument position, it means use the type instead of the value, i guess
00:41:42FromDiscord<jos> but in other positions, like echo int or echo typedesc[int] it seems equivalent
00:41:47FromDiscord<jos> and i'm trying to understand what the difference is
00:41:54FromDiscord<Yardanico> In reply to @jos "but in other positions,": but that's not really the supposed usage of typedesc :)
00:42:00FromDiscord<Yardanico> as you said, it's for passing types as values in arguments
00:42:30FromDiscord<Yardanico> regarding `typedesc[int]` specifically the only "usecase" i can think of is making "static" "methods" (like they would be called in other languages)
00:42:41FromDiscord<jos> so when a bare type (int) appears in an expression, it's equivalent to typedesc[int]
00:42:50FromDiscord<jos> but when it appears in.. a place the compiler expects a type
00:42:58FromDiscord<huantian> iirc `echo int` implicitly calls `echo type(int)`, where `type(int)` returns `typedesc[int]`
00:43:01FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4bWU
00:43:06FromDiscord<Yardanico> In reply to @huantian "iirc `echo int` implicitly": yep
00:43:26FromDiscord<huantian> (edit) "type(int)`," => "typeof(int)`," | "`type(int)`" => "`typeof(int)`"
00:45:00FromDiscord<huantian> can't find where this is mentioned in the manual tho
00:45:16FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#special-types-typedesc-t
00:45:20FromDiscord<Yardanico> "For instance, the type of the symbol int is typedesc[int]"
00:47:28FromDiscord<huantian> does it mention when it implicitly calls `typeof` tho?
00:48:27FromDiscord<Yardanico> I don't think there's a such a thing, it's just that it's treated as a `typedesc`
00:48:31FromDiscord<huantian> ah ok
00:48:38FromDiscord<Yardanico> there's $ for typedesc defined
00:48:49FromDiscord<jos> wait, so typedesc without a type argument is valid?
00:48:55FromDiscord<Yardanico> In reply to @jos "wait, so typedesc without": ?
00:48:57FromDiscord<jos> > Just like with regular generic types, when the generic param is omitted, typedesc denotes the type class of all types. As a syntactic convenience, one can also use typedesc as a modifier.
00:49:05FromDiscord<Yardanico> yes, the same as a generic
00:49:13FromDiscord<Yardanico> although using a generic would be cleaner
00:49:19FromDiscord<jos> so it uses dynamic dispatch if you don't specify the generic?
00:49:25FromDiscord<jos> and i guess your public API can't leak that type
00:49:32FromDiscord<jos> for all generic types?
00:49:33FromDiscord<Yardanico> In reply to @jos "so it uses dynamic": there's no dynamic dispatch, it's all static dispatch
00:49:37FromDiscord<Yardanico> `typedesc` doesn't exist in runtime
00:49:42FromDiscord<Yardanico> it's just another way of writing generics
00:49:46FromDiscord<Elegantbeef> No nim only uses `method` for dynamic dispatch↵(@jos)
00:49:48FromDiscord<huantian> it is nicer to use typedesc when you expect your proc to be used with UFC syntax
00:49:53FromDiscord<Elegantbeef> It only uses dynamic dispatch on inheritance
00:49:58FromDiscord<jos> i mean it says "like all structs", when the generic param is omitted
00:50:02FromDiscord<Elegantbeef> `a: typedesc` turns the procedure into an implicit generic
00:50:06FromDiscord<jos> (edit) "structs"," => "generic types","
00:50:08FromDiscord<Yardanico> In reply to @jos "i mean it says": yes, but that's the same as `proc x[T](a: T)`
00:50:09FromDiscord<jos> ah ok
00:50:13FromDiscord<Yardanico> just a different way of writing the same thing
00:50:29FromDiscord<jos> so you can't make a list of generic types without specifying the generic type, for example, like you can in dart or java
00:50:36FromDiscord<huantian> (edit) "syntax" => "syntax↵though it still achieves the same as a generic [T](_ :typedesc[T]) which might be cleaner"
00:50:40FromDiscord<jos> and i guess that checks out if method is the only way to do dynamic dispatch
00:50:44FromDiscord<Yardanico> In reply to @jos "so you can't make": not sure I understand, can you show an example?
00:51:03FromDiscord<jos> like in Dart you can make a List<T> and cast it to List and still call .length on it
00:51:16FromDiscord<jos> and then store a List<List> where each list internally stores a different type T
00:51:21FromDiscord<jos> instead of List<List<T>>
00:52:10FromDiscord<huantian> you can do something like that if you wrap the `seq` with a ref object↵but generally that's not "idiomatic nim"
00:53:09FromDiscord<jos> https://media.discordapp.net/attachments/371759389889003532/1025571037431210024/unknown.png
00:53:21FromDiscord<jos> like in dart it allows you to perform automatic type erasure of the generic type
00:53:26FromDiscord<jos> which i think is a pretty cool feature
00:53:53FromDiscord<jos> but in a more static language like nim you would have to make sure those types aren't part of the call signature for any public methods i guess
00:54:08FromDiscord<Yardanico> In reply to @jos "": nah, you can't do that in Nim the same way
00:54:23FromDiscord<Yardanico> you can do it with object variants of course, but not as simple as this
00:56:51FromDiscord<jos> makes sense
00:56:58FromDiscord<jos> yeah i think c# and java do it too
00:57:15FromDiscord<jos> i think c# might not actually
00:57:19FromDiscord<jos> but dart and java definitely
00:57:38FromDiscord<jos> it's probably quite a bit slower
00:58:51FromDiscord<jos> is there an Any type in nim? or RootObj i guess?
00:59:02FromDiscord<jos> i tried using any and it said to use "auto", but then i get weird errors like this
00:59:34FromDiscord<jos> https://media.discordapp.net/attachments/371759389889003532/1025572644436852766/unknown.png
00:59:39FromDiscord<jos> i have no clue what this means but i guess somehow the auto has to be statically known?
00:59:42FromDiscord<huantian> `auto` is once again just a generic
00:59:59FromDiscord<huantian> so `proc[T](thing: T)` is the same as `proc(thing: auto)`
01:00:41FromDiscord<jos> so is there any way to return any type dynamically? and then cast it to the type that's known statically, somewhere else
01:00:53FromDiscord<jos> RootObj is the only thing i can think of but then only oopy stuff will work
01:02:11FromDiscord<huantian> The only way to have that is oop-y stuff, which is why java can do it
01:02:22FromDiscord<huantian> And also why java has boxed variants of their primitive
01:03:02FromDiscord<jos> well i don't see any reason you need an inheritance chain to box up some memory and cast it somewhere else
01:03:09FromDiscord<jos> rust can do it with the Any type, after all
01:03:19FromDiscord<jos> c can do it with a void pointer
01:03:26FromDiscord<jos> i'm sure you can do it in nim, just not sure how
01:05:58*rockcavera joined #nim
01:06:22FromDiscord<Elegantbeef> `RootRef` or `pointer`
01:06:56FromDiscord<jos> im reading the pointer docs, trying to figure out how to make cast between managed/unmanaged pointers
01:06:59FromDiscord<jos> :cartsweat:
01:07:25FromDiscord<Yardanico> managed pointers are called `ref` (references), and you can't exactly cast between them safely
01:07:30FromDiscord<Yardanico> as managed pointers are managed by the GC
01:07:41FromDiscord<Yardanico> but you can cast if you're sure it'll be safe :)
01:07:47FromDiscord<Elegantbeef> You can go from `ref` to `ptr` but it's only safe if you know
01:07:58FromDiscord<jos> i'm trying to make a dependency graph
01:08:18FromDiscord<jos> it should be okay
01:08:42FromDiscord<jos> i can guarantee there will only be one ref to the value and then i just wanna take it out of the managed world for a bit so i can pass it through a layer of type erasure
01:09:03FromDiscord<Yardanico> but again, if it's a ref, why not use RootRef ?
01:09:36FromDiscord<jos> does that mean any `ref T` will work?
01:09:42FromDiscord<jos> even if it doesn't get oopy
01:09:50FromDiscord<jos> yeah that makes sense, since ref is basically a boxed value, right?
01:11:01FromDiscord<sOkam!> Is there an existing library for image writing/reading/modification?
01:11:17FromDiscord<Elegantbeef> pixie
01:12:22FromDiscord<sOkam!> oh, there is no tga support. will have to code that i guess. but didn't think about pixie, ty
01:12:57FromDiscord<jos> i dont rly understand how to create a `ref int`
01:13:07FromDiscord<jos> for example
01:14:09FromDiscord<Rika> `let a = new int`
01:14:31FromDiscord<Rika> `a[] = # put integer content`
01:15:01FromDiscord<jos> a[] = 123, for example?
01:15:08FromDiscord<Rika> Yes
01:15:08FromDiscord<jos> definitely don't understand why that works
01:15:16FromDiscord<Yardanico> In reply to @jos "definitely don't understand why": `[]` is dereferencing operator
01:15:32FromDiscord<jos> :cartsweat:
01:15:37FromDiscord<jos> i guess that makes sense
01:15:40FromDiscord<Rika> And new just makes a reference of the T you pass it
01:16:15FromDiscord<sOkam!> In reply to @Elegantbeef "pixie": can it create and write byte buffers? do you know?
01:16:24FromDiscord<jos> ok yeah this works, i just got it working on the playground, thanks!
01:16:32FromDiscord<sOkam!> (edit) "create and write" => "create/read/write"
01:16:41FromDiscord<Rika> Oh yeah the playground is back up
01:16:42FromDiscord<Rika> Lmao
02:03:21*arkurious quit (Quit: Leaving)
02:33:42*Guest65 joined #nim
02:33:46*Guest65 left #nim (#nim)
03:04:50FromDiscord<Jool> How do I tune Nim's garbage collector?
03:06:42FromDiscord<Rika> In what ways would you like to tune it?
03:18:43FromDiscord<demotomohiro> !eval echo NimVersion
03:18:49NimBot1.6.8
03:24:40FromDiscord<Iliketwertles> how is this invalid indentation? https://media.discordapp.net/attachments/371759389889003532/1025609163893641286/screenshot_2022-09-30-232426.png
03:24:57FromDiscord<Iliketwertles> on `elif paramCount() == 0:`
03:25:55FromDiscord<Iliketwertles> do i have to add a else to the case of paramStr(1)?
03:26:14FromDiscord<Elegantbeef> missing `)`
03:26:36FromDiscord<Iliketwertles> oh
03:26:54FromDiscord<Iliketwertles> blind as a bat
03:27:39FromDiscord<apothecary> does anyone know how I can install nim on my m1 mac so that is produces arm executables instead of x86?
03:30:49FromDiscord<demotomohiro> I guess you need a gcc or clang that can produce arm executable for mac.
03:31:25FromDiscord<apothecary> I have clang
03:31:48FromDiscord<apothecary> I've tried using choosenim
03:32:06FromDiscord<demotomohiro> How about to search nim forum? I think I saw similar question before
03:32:10FromDiscord<Elegantbeef> I think choosenim fetches and sets up a x86 compiler
03:32:32FromDiscord<apothecary> yeah - it looks that way, although it built the compiler from source
03:32:48FromDiscord<Jool> Turning off and on.↵(@Rika)
03:32:52FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4bXo
03:33:16FromDiscord<Elegantbeef> `myProcThatTakesOpenArray(myCollection.toOpenArray(0, myCollection.high - 3)`
03:33:20FromDiscord<Elegantbeef> it's a 0 cost slice
03:33:57FromDiscord<sOkam!> whats high-3?
03:34:09FromDiscord<Elegantbeef> removing the last 3 entries
03:34:33FromDiscord<sOkam!> why would i remove anything? i need all data from a seq[uint8] buffer
03:34:34FromDiscord<Elegantbeef> It's a slice you cannot hold onto in a variable, `openArray` can only be a parameter
03:34:48FromDiscord<sOkam!> but the `open()` proc requires openarray
03:34:53FromDiscord<Elegantbeef> It was an example to how to use it
03:35:01FromDiscord<Elegantbeef> `seq` is implicitly converted to openarray
03:35:26FromDiscord<demotomohiro> @Jool I think this is what you want to read: https://nim-lang.org/docs/mm.html
03:35:38FromDiscord<apothecary> In reply to @demotomohiro "How about to search": looks like there are some things I can try on the foru
03:36:03FromDiscord<Jool> Thks↵(@demotomohiro)
03:36:11FromDiscord<sOkam!> In reply to @Elegantbeef "`seq` is implicitly converted": how do you calculate last then?
03:36:29FromDiscord<Elegantbeef> You dont need to
03:37:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bXp
03:37:50FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4bXq
03:38:13FromDiscord<sOkam!> The proc asks me to give the last parameter. Or am I missing something in how its used?
03:38:55FromDiscord<sOkam!> `sizeof(f)` maybe? 🤔
03:39:00FromDiscord<Elegantbeef> no
03:39:13FromDiscord<Elegantbeef> It'd be `buf = newSeq[uint8](128)` and `0, 128`
03:39:35FromDiscord<Elegantbeef> actually 127 sorry
03:39:40FromDiscord<sOkam!> why 127?
03:39:45FromDiscord<Elegantbeef> cause len - 1
03:40:10FromDiscord<sOkam!> i don't follow. isn't last meant to be the last byte of the file?
03:40:27FromDiscord<Elegantbeef> you're saying "write to 0 to 127"
03:40:28FromDiscord<Elegantbeef> No
03:40:37FromDiscord<Elegantbeef> The amount of bytes to write to
03:41:01FromDiscord<Elegantbeef> What library are you trying to use?
03:41:16FromDiscord<sOkam!> pixie, that has no support for tga
03:41:25FromDiscord<sOkam!> so im trying to get the tga data into nim types
03:41:39FromDiscord<Elegantbeef> ok
03:42:05FromDiscord<sOkam!> currently, just trying to get the raw byte data into nim at all, with no success
03:42:15FromDiscord<Elegantbeef> Yea i dont follow
03:42:19FromDiscord<Elegantbeef> Use the procedure and carry on
03:42:37FromDiscord<sOkam!> i cannot carry on if i don't understand what im doing
03:42:50FromDiscord<Elegantbeef> You need to allocate a buffer then say "This is the place in the buffer i want you to write"
03:43:20FromDiscord<Elegantbeef> Well i dont know what function you're trying to usse
03:43:20FromDiscord<Elegantbeef> So....
03:43:34FromDiscord<sOkam!> `readBytes()`
03:43:51FromDiscord<Elegantbeef> `reads len bytes into the buffer a starting at a[start]. Returns the actual number of bytes that have been read which may be less than len (if not as many bytes are remaining), but not greater. `
03:43:52FromDiscord<sOkam!> or anything else that gives me the raw byte data, i don't mind
03:43:54FromDiscord<Elegantbeef> That doesnt take `last`
03:44:35FromDiscord<Elegantbeef> If you want the raw byte data you can just `readFile`
03:45:15FromDiscord<sOkam!> true, i mixed the procs↵its `start, len`
03:46:06*alice quit (Remote host closed the connection)
03:46:16FromDiscord<sOkam!> oh much easier, it gives a string also. which can be used in binny directly
03:46:34FromDiscord<sOkam!> i was trying to convert to string, but i didn't see this
03:46:53*alice joined #nim
03:51:46FromDiscord<proton> How to convert object to JsonNode?
03:52:44FromDiscord<Elegantbeef> `% MyObject()`
03:54:19FromDiscord<apothecary> In reply to @demotomohiro "How about to search": https://forum.nim-lang.org/t/8181#52631 this ended up working. Sad that the homebrew and choosenim versions don't. They are basically DOA currently.
04:13:07FromDiscord<proton> sent a code paste, see https://play.nim-lang.org/#ix=4bXw
04:13:21FromDiscord<proton> Have to implement this Bool type
04:14:14FromDiscord<Rika> what is `Bool`?
04:14:58FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4bXx
04:15:38FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4bXx" => "https://play.nim-lang.org/#ix=4bXy"
04:15:55FromDiscord<Elegantbeef> binary operators allow new lining
04:16:01FromDiscord<Elegantbeef> But the real thing is why do you use sizeof on each field
04:16:07FromDiscord<Elegantbeef> and why `sum` is a `var`
04:16:27FromDiscord<sOkam!> because i don't know how to get the size of each field separately through a loop
04:16:41FromDiscord<Elegantbeef> `sizeof(T)`
04:16:48FromDiscord<sOkam!> I want to contrast the size that the type should have (18) with the one that is being given (20, so probably aligned)
04:16:58FromDiscord<sOkam!> sizeof(T) is 20, which is wrong
04:17:03FromDiscord<sOkam!> it should be 18
04:17:08FromDiscord<Elegantbeef> Put `{.packed.}` on the type
04:17:17FromDiscord<sOkam!> k ty
04:58:59*rockcavera quit (Remote host closed the connection)
06:21:01*derpydoo joined #nim
06:23:58*disso_peach quit (Quit: Leaving)
07:24:24*derpydoo quit (Ping timeout: 264 seconds)
07:25:39*ehmry quit (Remote host closed the connection)
07:26:50*ehmry joined #nim
07:34:16*derpydoo joined #nim
07:35:34FromDiscord<proton> How to restore a table from string?
07:36:20FromDiscord<Elishaboy Emmanuel4> sent a long message, see http://ix.io/4bY6
07:39:43FromDiscord<proton> sent a code paste, see https://play.nim-lang.org/#ix=4bY8
07:40:55FromDiscord<proton> It seems that to doesn't work for this object
07:42:12FromDiscord<Elishaboy Emmanuel4> sent a long message, see http://ix.io/4bY6
07:42:36FromDiscord<Elishaboy Emmanuel4> sent a long message, see http://ix.io/4bY6
07:51:51*ehmry quit (Quit: No Ping reply in 180 seconds.)
07:52:59*ehmry joined #nim
08:08:18FromDiscord<ChocolettePalette> The bottom line of "f\uck you" emojis is kinda sus doe
08:08:37FromDiscord<jan Apisu> In reply to @Elishaboy Emmanuel4 "Is your bitcoin wallet": totally legit
08:08:56FromDiscord<jan Apisu> btw matrix is cringe
08:17:29*dtomato quit (Read error: Connection reset by peer)
08:17:35*dtomato9 joined #nim
08:18:37FromDiscord<Rika> In reply to @ChocolettePalette "The bottom line of": LMAO I didn’t notice that
08:18:41FromDiscord<ChocolettePalette> Is this the reason why a stereotypical discord moderator is a pale fat guy wearing fedora? "Going outside is cringe people can freely shout spam and I can't even unhear this!"
08:27:44FromDiscord<Phil> In reply to @Elishaboy Emmanuel4 "Is your bitcoin wallet": <@&371760044473319454> I am hostile!↵Towards scummy ads
08:30:43*jmdaemon quit (Ping timeout: 244 seconds)
08:35:28*jmdaemon joined #nim
08:54:12*dnh joined #nim
09:11:30*dtomato joined #nim
09:12:21*dtomato9 quit (Ping timeout: 250 seconds)
09:12:30*Th30n joined #nim
09:13:06FromDiscord<ieltan> Maybe we should try to get a bot to deal with the scamspams
09:13:22Th30nHey all. I've recently started learning nim. :wave:
09:13:42*PMunch joined #nim
09:14:16Th30nI'm stuck on trying to make a generic `first` function that takes anything that can be looped over. How can I achieve that?
09:14:49Th30nSomething like `proc first(iter: <some-type>): Option<element-type> = for i in iter: return i.some`
09:17:00PMunchSo you just want to return the first thing if it exists? Wrapped in an option?
09:17:34Th30nPMunch: yep, exactly
09:17:51Th30nIs there maybe already something like that in the stdlib?
09:17:56FromDiscord<Rika> Probably needs concepts or "iterable" for that
09:18:05FromDiscord<Rika> Not sure about the status of iterable
09:21:40PMunchIt can definitely be done with concepts: https://play.nim-lang.org/#ix=4bYA
09:22:33PMunchTh30n ^
09:23:44Th30nBut concepts are experimental still, right?
09:29:27PMunchI guess, yeah
09:29:35PMunchI mean you could also do this with a template
09:31:32Th30nYeah, but template cannot be passed as an argument like a function can...
09:31:46Th30nOh well, I'm stuck with overloading for now then, until concepts arrive.
09:32:16PMunchHmm, or maybe not actually
09:32:47PMunchDo you actually need it for all iterables though?
09:32:54PMunchOr would openArray suffice?
09:33:36PMunchBy the way, concepts are enabled by default in the compiler. So in a way they are already here, just maybe a bit unstable (I'm using the "old" syntax I think, but it's the only one I can find documentation for)
09:34:29Th30nCurrenly, I only need it for openArray and HashSet, so it's fine with overloads.
09:34:38Th30nBut was hoping for something even more generic...
09:34:39FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4bYC
09:34:50FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4bYC" => "https://play.nim-lang.org/#ix=4bYD"
09:35:35FromDiscord<enthus1ast> @Phil\: y is float
09:35:49FromDiscord<Phil> That's just an example, I overall want to check if y is a number
09:35:54FromDiscord<Phil> Which means covering a lot more than just float
09:36:15PMunchTh30n, you could do it like this actually: https://play.nim-lang.org/#ix=4bYF
09:36:17FromDiscord<Phil> "If y is number then render number-input-field in HTML" is the logic
09:36:36FromDiscord<enthus1ast> maybe\:↵↵y is SomeNumber
09:38:00Th30nPMunch: And it's not experimental? Awesome, thanks!
09:38:26PMunch@Phil, you can create a typeclass: https://play.nim-lang.org/#ix=4bYG
09:38:36PMunchWhich is what the built in SomeNumber is
09:38:56PMunchTh30n, I don't think auto is experimental
09:39:10*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:39:17FromDiscord<Rika> In reply to @Th30n "<@696333749570371585>: And it's not": If it doesn’t have an iteration function it would not compile though
09:39:43FromDiscord<Rika> Is that desired?
09:39:47PMunchWell yes, of course
09:39:49Th30nExcellent, exactly what I wanted. So turn out C++ approach is the way :sweat_smile:
09:39:54Th30nturns*
09:40:10FromDiscord<Rika> In reply to @PMunch "Well yes, of course": Yes, but I don’t know if it is what they wanted
09:40:40PMunchBasically you'll get a compilation error saying something like T doesn't have a procedure `items` or something like that
09:46:00*dnh joined #nim
09:51:20*Th30n quit (Quit: WeeChat 3.6)
09:55:10*Th30n joined #nim
09:56:19*PMunch quit (Ping timeout: 248 seconds)
09:56:53FromDiscord<Phil> Webdev channel has become literally unuseable atm
10:16:42FromDiscord<hugogranstrom> In reply to @Isofruit "Webdev channel has become": wow they are spamming hard now 😮
10:19:09FromDiscord<hugogranstrom> Ugh, getting a `invalid integer: 2` from `parseInt` in the js backend. But only in one file using the same function, all other files runs fine 🙃 I've checked the `repr(s)` and `s.len` and `'\0' in s` but all of them says that the string is just `"2"` with a len of 1 and no hidden chars
10:27:45*jmdaemon quit (Ping timeout: 250 seconds)
10:44:50FromDiscord<enthus1ast> it looks like the spam harder when the're mentioned↵(@hugogranstrom)
10:45:35FromDiscord<pmunch> Banned the user
10:45:48FromDiscord<pmunch> Curiously it seems to mostly be our smaller channels
10:45:56FromDiscord<hugogranstrom> In reply to @enthus1ast "it looks like the": So the classic trick of ignoring them works on spam bots as well? xD
10:46:53FromDiscord<hugogranstrom> In reply to @pmunch "Curiously it seems to": yeah, but not all of them. Appdev and security seldom seems to have that much spam
10:47:47FromDiscord<enthus1ast> imho security is not briged to matrix right?
10:48:21FromDiscord<enthus1ast> (would be nice though)
10:54:04FromDiscord<jan Apisu> `code`
11:08:31FromDiscord<hugogranstrom> In reply to @enthus1ast "imho security is not": huh, perhaps not. Can't see any matrix `bot` banners at least. Appdev is bridged though
11:16:19FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=4bZd
11:52:57FromDiscord<enthus1ast> who actually are the bridge admins ?
11:59:10*arkurious joined #nim
12:03:25*Th30n quit (Quit: bye)
12:08:32FromDiscord<Tekk> is there a limit to how big an array can be?
12:17:22*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:18:57*dnh joined #nim
12:23:42FromDiscord<Horizon [She/Her]> 128 lines so far for the Jasmin instruction builder (and it's still not done yet)
12:24:07FromDiscord<Rika> In reply to @Tekk "is there a limit": as big as your stack can handle pretty much
12:24:26FromDiscord<Horizon [She/Her]> Some of these will need to be duplicated too, so variable names can be used instead of variable numbers
12:25:11FromDiscord<Horizon [She/Her]> And i'll still need to work on making classes wrapped in a decent way for IDE support, fun-
12:25:20FromDiscord<Horizon [She/Her]> I'll likely just use a single file like Beef said
12:25:42FromDiscord<Horizon [She/Her]> Wonder if can make 'namespaces' that aren't enforced in Nim
12:25:50FromDiscord<Horizon [She/Her]> Like how enums do it
12:31:15FromDiscord<Tekk> In reply to @Rika "as big as your": weird, my program just fails on specific array sizes
12:32:31FromDiscord<Rika> In reply to @Tekk "weird, my program just": example
12:38:15FromDiscord<Tekk> In reply to @Rika "example": i have a big array of vec3s for every pixel, 800\600 pixels, and i try multiplying each one so i can get a ray direction for the raycaster but it just fails, no specific error on why. just failed execution
12:38:36FromDiscord<Tekk> a 500500 array works fine
12:38:44FromDiscord<Rika> sequence or actual array
12:38:50FromDiscord<Tekk> actual array
12:38:54FromDiscord<Rika> okay just making sure
12:39:16FromDiscord<Rika> what's the definition for vec3
12:40:21FromDiscord<Tekk> im using sol package :p
12:41:22FromDiscord<Tekk> looking at source its a SIMD vector type
12:41:46FromDiscord<Tekk> and for nim its imported from c as object
12:42:36FromDiscord<Rika> which types are you using exactly since vec3 is a concept
12:42:45FromDiscord<Tekk> float64x3
12:43:59FromDiscord<Rika> thats 11 megs almost of stack wow
12:44:16FromDiscord<Rika> i dont think thats anywhere near the limit but its a lot
12:44:55FromDiscord<Tekk> 😆 probably doing something wrong
12:45:25FromDiscord<Rika> oh
12:45:31FromDiscord<Rika> linux stack limit is 8mb default
12:45:42FromDiscord<Rika> you might actually be going past the limit lol
12:45:55FromDiscord<Rika> 64/83800600 is 11.5 mebi i think
12:46:01FromDiscord<Rika> (edit) "64/83800600" => "`64/83800600`"
12:46:18FromDiscord<Rika> `64/83500500` is 6 mega
12:46:31FromDiscord<Rika> (edit) "mebi" => "mega"
12:46:37FromDiscord<Rika> so yeah that might explain things
12:46:50FromDiscord<Rika> any reasons you're using float64 for this lol
12:47:13FromDiscord<Tekk> nim manual says to use float in genera so im just using the default 🤷‍♂️
12:47:19FromDiscord<Tekk> (edit) "genera" => "general"
12:48:04FromDiscord<Rika> well, it depends on your usecase really
12:48:08FromDiscord<Rika> In reply to @Tekk "nim manual says to": where?
12:48:15FromDiscord<Rika> what are you using the numbers for?
12:48:23FromDiscord<Tekk> https://nim-lang.org/docs/manual.html#types-preminusdefined-floatingminuspoint-types
12:48:37FromDiscord<Tekk> In reply to @Rika "what are you using": dda raycasting
12:48:53FromDiscord<Rika> In reply to @Tekk "https://nim-lang.org/docs/manual.html#types-preminu": in general for float types
12:49:52FromDiscord<Tekk> hmmm...
12:50:34FromDiscord<Rika> In reply to @Tekk "dda raycasting": ill read about it to see if you can reduce the type size
12:50:41FromDiscord<Rika> (you prolly can?)
12:51:22*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:52:05FromDiscord<Rika> you can prolly use float32 instead since i assume you dont need extreme accuracy (is this for a game?)
12:52:09FromDiscord<Tekk> of course i can, probably a lot too
12:52:12FromDiscord<Rika> games tend to use float32
12:52:53FromDiscord<Tekk> In reply to @Rika "you can prolly use": just seeing if i can make a fast voxel renderer on cpu
12:56:28FromDiscord<ChocolettePalette> On a cpu you can't
12:57:28FromDiscord<Tekk> https://www.youtube.com/watch?v=qn7QWuU2duo
12:57:35FromDiscord<Tekk> this guy got 15 fps
12:59:17FromDiscord<ChocolettePalette> 15...
13:00:30*dnh joined #nim
13:02:27FromDiscord<Tekk> theres a ton of room for improvement!
14:14:00FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=4bZZ
14:17:09FromDiscord<dain> oh wait nvm i just screwed up on a line after it
14:19:18FromDiscord<dain> anyway this is the real thing i was stuck on, how do I make a template that converts an inline iterator into a closure iterator
14:19:57FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=4c01
14:20:30FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=4c03
14:22:41FromDiscord<Horizon [She/Her]> `long` is `int8`?
14:22:42FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4c06
14:25:15*kenran joined #nim
14:28:44FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4c09
14:30:07FromDiscord<Horizon [She/Her]> Oh okay i was confused, thanks!
14:30:29FromDiscord<jmgomez> Np, we have some UE/Cpp equivalences here https://github.com/jmgomez/NimForUE/blob/0aa2119d25ebea10927faa9816f9ab49d1dcbf31/src/nimforue/typegen/fproperty.nim#L112
14:31:31FromDiscord<Horizon [She/Her]> UE being UnrealEngine?
14:31:42FromDiscord<jmgomez> yup
14:31:49FromDiscord<Horizon [She/Her]> Ah neat
14:33:15FromDiscord<Horizon [She/Her]> I'm wondering now how well Nim would translate to the JVM again
14:34:50FromDiscord<jmgomez> it should fine, isnt it? I mean, it translates well to c/cpp and to js. Java is kind of in the middle. Actually the UE way of doing things is quite similar to Java/DotNet all the UObjects stuff (also garbage collected)
14:35:56FromDiscord<Horizon [She/Her]> True
14:37:07FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=4c0d
14:38:42FromDiscord<demotomohiro> Internal error means there is a bug in Nim compiler.
14:40:59FromDiscord<demotomohiro> sent a code paste, see https://paste.rs/28z
14:42:09FromDiscord<dain> how do I do that
14:42:37FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=4c0g
14:43:01FromDiscord<dain> that gives a compiler error
14:43:29FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=4c0h
14:48:23FromDiscord<dain> is this even possible
14:49:10FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4c0j
14:50:14FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=4c0k
14:50:29FromDiscord<dain> like i know it's useless to do that but surely it should still work
14:51:52*kenran` joined #nim
14:52:50FromDiscord<dain> the reason I ask is because I was trying to implement a version of `filter_it` that works on iterators
14:53:23*derpydoo quit (Ping timeout: 248 seconds)
14:53:28FromDiscord<dain> and I couldn't get it to work. in the course of trying to isolate the problem I removed successive pieces of the template until it was basically identical to `to_closure` and I got the same error
14:57:09FromDiscord<dain> sent a code paste, see https://paste.rs/YsT
14:57:16*kenran` quit (Remote host closed the connection)
14:57:16FromDiscord<4zv4l> what did I do wrong ?
14:57:17FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4c0n
14:57:19FromDiscord<4zv4l> it segfault everytime
15:04:10FromDiscord<demotomohiro> change `client.recv(addr buff, buff.len)` to `client.recv(addr buff[0], buff.len)` might fix.
15:04:45FromDiscord<demotomohiro> There are `recv` procs without pointer: https://nim-lang.org/docs/net.html#recv,Socket,string,int,int
15:06:34FromDiscord<demotomohiro> `addr buff` just returns the address of buff but not the address of content of `buff`.
15:18:00FromDiscord<4zv4l> oooh ok thanks !
15:18:40FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4c0R
15:18:44FromDiscord<4zv4l> I can import that function without a problem in C
15:18:52FromDiscord<4zv4l> but nim doesn't succeed to compile it
15:19:10FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4c0S
15:21:55FromDiscord<4zv4l> `--passL:-lpcap` did the trick
15:30:35FromDiscord<4zv4l> how do I import a type from a C lib ?
15:30:44FromDiscord<4zv4l> but it doesn't seem to work
15:30:46FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4c0V
15:30:54*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:33:10FromDiscord<4zv4l> In reply to @4zv4l "also I'm trying to": and the code doesn't work, idk why it segfault always
15:33:28FromDiscord<4zv4l> sent a code paste, see https://paste.rs/sT1
15:33:55FromDiscord<4zv4l> (edit) "https://play.nim-lang.org/#ix=4c10" => "https://play.nim-lang.org/#ix=4c0Z"
15:34:22FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4c11
15:35:27FromDiscord<4zv4l> thanks !
15:35:48FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4c12
15:35:54FromDiscord<4zv4l> I tried using `addr` and `ptr` instead of `var` but same result
15:36:13FromDiscord<4zv4l> (edit) "https://play.nim-lang.org/#ix=4c12" => "https://play.nim-lang.org/#ix=4c14"
15:38:13FromDiscord<dain> how do I determine whether something is being piped into the program? I tried using `stdin.isatty` but it doesn't work.
15:38:31FromDiscord<4zv4l> In reply to @dain "how do I determine": wouldn't that be in stdin ?
15:38:41FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=4c15
15:38:44FromDiscord<dain> this prints "something piped in" no matter what
15:39:00FromDiscord<4zv4l> if you pipe something to a program that will send the data to the `stdin` buffer of the program
15:39:01FromDiscord<dain> either with `echo "foo" | ./ttytest` or just `./ttytest`
15:39:18FromDiscord<dain> In reply to @4zv4l "if you pipe something": yeah I know.
15:39:25FromDiscord<dain> im trying to determine whether that has occurred or not
15:40:38FromDiscord<4zv4l> sent a long message, see http://ix.io/4c16
15:40:42*dnh joined #nim
15:40:51FromDiscord<4zv4l> but so that's not pipe in the right direction
15:41:00FromDiscord<dain> it shouldn't matter
15:43:28FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=4c1a
15:44:32FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4c1b
15:46:02*kenran quit (Remote host closed the connection)
15:46:33FromDiscord<dain> is it just a bug
15:51:41FromDiscord<4zv4l> is there a Nim function to pass from int32 to a string IP addr ?
15:52:10FromDiscord<4zv4l> like `inet_ntoa` but in Nim
15:53:54FromDiscord<demotomohiro> In reply to @4zv4l "is there a Nim": Probably it is in somewhere `net` or `nativesockets` module.
15:56:47FromDiscord<4zv4l> I looked in nativesockets but didn't really find anything
15:56:54FromDiscord<4zv4l> except if I can cast the i32 into an address
15:58:06FromDiscord<dain> In reply to @dain "is it just a": oh wait it looks like it's a problem with how I was running it
15:58:58FromDiscord<dain> for some reason it breaks when I compiled and ran it from vim
15:59:04FromDiscord<dain> but works when i do it from a normal terminal
15:59:08FromDiscord<dain> ¯\_(ツ)_/¯
16:00:42FromDiscord<dain> oh i guess because `! nim c % && echo "foo" | ./scriptname` wouldn't actually make a tty ..
16:00:59FromDiscord<4zv4l> yeah idk how vim runs command like this
16:09:14FromDiscord<4zv4l> how can I convert a i32 to an array of 4 u8 ?
16:10:48FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4c1n
16:11:38FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4c1q
16:11:42FromDiscord<4zv4l> or if there is a function in `net` that does it why not but
16:11:45FromDiscord<4zv4l> since I didn't find one
16:11:54FromDiscord<4zv4l> ip_raw is an i32
16:11:59FromDiscord<4zv4l> (edit) "an" => "a"
16:12:17FromDiscord<4zv4l> I'll try this `cast[array[4, byte]](ii)`
16:12:46FromDiscord<4zv4l> that works great !
16:12:52FromDiscord<4zv4l> is `cast` safe in nim ?
16:13:00FromDiscord<Rainbow Asteroids> no
16:14:01FromDiscord<4zv4l> alright, I know what I'm doing anyway, just to know
16:14:14FromDiscord<enthus1ast> but you can also use inet\_ntoa directly
16:14:21FromDiscord<4zv4l> from the c lib ?
16:15:06FromDiscord<enthus1ast> yeah
16:15:18FromDiscord<4zv4l> yeah I could
16:15:40FromDiscord<4zv4l> but glad I had to search, I thought that was magic at first how the ip could be put in a i32 xD
16:15:46FromDiscord<4zv4l> now I know it's simply 4 u8
16:16:03FromDiscord<enthus1ast> yes
16:17:01FromDiscord<4zv4l> how can I print a int as hex btw ?
16:17:22FromDiscord<4zv4l> I got more less strformat but I directly put the var name in the {} so idk how to precise the type of it
16:17:46FromDiscord<enthus1ast> ah
16:17:55FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4c1u
16:18:06FromDiscord<enthus1ast> i know it was there
16:19:42FromDiscord<4zv4l> oh yeah thanks, didn't think about that
16:52:27FromDiscord<auxym> In reply to @4zv4l "how can I print": with strformat something like `fmt"{a:#x}"` if a is your int
16:56:58FromDiscord<4zv4l> It worked without the # but yeah thank you ☺️ also it skipped zero, I don’t know if that’s because of how the ip is set in the memory and the 0 are at the beginning so it simply discard them idk
17:03:11FromDiscord<auxym> the # will add the 0x prefix
17:04:39FromDiscord<auxym> if you want leading zeros you'll have to decide on a field length. Like `#06x` will give you 0x prefix and pad the int with leading zeros if its less than 4 chars
17:24:45*gsalazar joined #nim
17:31:09*gsalazar quit (Ping timeout: 244 seconds)
18:15:42FromDiscord<Horizon [She/Her]> In reply to @auxym "with strformat something like": Oh strformat is like python in that regard
18:15:49FromDiscord<Horizon [She/Her]> Tho, iirc it is inspired by python so
18:20:00*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:20:25*dnh joined #nim
18:41:37FromDiscord<Mrcool> Do I have to run build_all_sh each time I make a change in the codebase or is there something that takes less time?
18:43:03FromDiscord<Mrcool> (edit) "Do I have to run build_all_sh each time I make a change in the ... codebase" added "nim"
18:48:45FromDiscord<Horizon [She/Her]> `koch temp` iirc
18:49:06FromDiscord<Horizon [She/Her]> Builds a version of the compiler meant for testing and debugging purposes @Mrcool
18:49:08*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:52:49FromDiscord<Horizon [She/Her]> In Nim, how do i check if a value is a string? When i'm doing `int | string | float`
18:53:25FromDiscord<huantian> `when some_var is string`
18:54:05*dnh joined #nim
18:54:26FromDiscord<Horizon [She/Her]> I thought `when` is compile time?
18:54:32FromDiscord<huantian> yes
18:54:38FromDiscord<huantian> also idk why I used camel case lmao
18:54:46FromDiscord<Horizon [She/Her]> Does is just expand the proc into multiple variations?
18:54:57FromDiscord<Horizon [She/Her]> In reply to @huantian "also idk why I": Python programmer? :p
18:55:10FromDiscord<Mrcool> python doesn't use camel
18:55:22FromDiscord<huantian> In reply to @Event Horizon "Python programmer? :p": mostly yeah
18:55:37FromDiscord<huantian> python uses camel for basically everything except classes/types
18:55:46FromDiscord<enthus1ast> this is determined at compile time↵(@Horizon [She/Her])
18:56:40FromDiscord<huantian> In reply to @Event Horizon "Does is just expand": basically, you don't get dynamic dispatch with `|` it's all compile time
18:57:14FromDiscord<Mrcool> In reply to @huantian "python uses camel for": Are you sure, I thought its snake case, for example taking a random knwon project <https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L356> I see its all snake case
18:57:20FromDiscord<Mrcool> (edit) "knwon" => "known"
18:57:38FromDiscord<huantian> oh wait yeah sorry I meant to say "idk why I used snake case"
18:57:56FromDiscord<Horizon [She/Her]> In reply to @enthus1ast "this is determined at": Ah good to know
18:59:29FromDiscord<Mrcool> In reply to @Event Horizon "`koch temp` iirc": The changes I'm doing are in nimsuggest, does koch handle this?
18:59:49FromDiscord<Horizon [She/Her]> In reply to @Mrcool "The changes I'm doing": Ah, no idea really, maybe you're better off asking in #internals?
19:00:23FromDiscord<Horizon [She/Her]> 673 lines of code for just mapping out the instructions in Jasmin
19:00:38FromDiscord<Horizon [She/Her]> I'm so glad the majority didn't need to be mapped out manually
19:01:02FromDiscord<Horizon [She/Her]> I still need to redo this later too, to make it neater and more idiomatic...
19:03:12FromDiscord<Mrcool> its `koch tools` and for my specific case I can just use ↵`bin/nim c -o:bin/nimsuggest -d:danger --skipUserCfg --skipParentCfg --hints:off nimsuggest/nimsuggest.nim`
19:04:02FromDiscord<Horizon [She/Her]> Ah neat
19:05:01FromDiscord<Mrcool> now the next question is how do I compile with debug symbols
19:05:42FromDiscord<Horizon [She/Her]> don't use `-d:danger` :p
19:06:02FromDiscord<Horizon [She/Her]> `-d:danger` is more... Intense? Than `-d:release` iirc
19:07:55FromDiscord<Mrcool> I just copied what koch tools was using
19:09:12FromDiscord<Horizon [She/Her]> Yeah, don't use `-d:danger` to get debug symbols
19:12:20FromDiscord<auxym> danger is like release but also turns off runtime checks like overflow and length checking
19:26:13FromDiscord<Mrcool> I removed danger but there are still no debug symbols
19:27:37*kenran joined #nim
19:31:11*kenran` joined #nim
19:31:50FromDiscord<Mrcool> `-g ` works
19:40:30*kenran` quit (Remote host closed the connection)
19:41:35FromDiscord<auxym> `--debugger:native`? https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#using-gdb-lldb
19:44:44FromDiscord<Mrcool> All the symbols are mangled, so each time I'm interested in a function I have to ad {.epxortc.} to it
19:51:33FromDiscord<auxym> IIRC there's a gdb init script distributed with nim somewhere that auto-demangles everything
19:56:52FromDiscord<auxym> tools/nim-gdb.py I think
20:13:59*rockcavera joined #nim
20:19:07FromDiscord<Dino> sent a code paste, see https://play.nim-lang.org/#ix=4c2w
20:20:04FromDiscord<Dino> oh does get have to be used on an asynch client...
20:20:55FromDiscord<Dino> (edit) "asynch" => "async"
20:43:32*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:47:12*disso_peach joined #nim
21:01:14FromDiscord<Horizon [She/Her]> Does `BiggestInt` have a way to get the integer type used?
21:01:26FromDiscord<Horizon [She/Her]> So `BiggestInt.typ` returns `int`?
21:11:11FromDiscord<Takemichi Hanagaki> sent a code paste, see https://play.nim-lang.org/#ix=4c2J
21:11:26FromDiscord<Takemichi Hanagaki> (edit) "https://play.nim-lang.org/#ix=4c2J" => "https://play.nim-lang.org/#ix=4c2K"
21:11:32FromDiscord<jan Apisu> python doesnt have namespaces
21:11:53FromDiscord<jan Apisu> math is a object just like anything else
21:12:08FromDiscord<Takemichi Hanagaki> In reply to @jan Apisu "math is a object": Hummmm, got it!
21:16:43FromDiscord<Elegantbeef> Nim doesnt use namespaces as it's annoying with UFCS
21:17:04FromDiscord<Elegantbeef> It's also annoying cause it's pointless
21:17:09FromDiscord<Elegantbeef> You already import a module why do you always need to say "I'm using it from X module"
21:24:08*kenran quit (Remote host closed the connection)
21:26:09*qwr quit (Ping timeout: 268 seconds)
21:27:30*qwr joined #nim
21:41:02FromDiscord<Rainbow Asteroids> In reply to @Elegantbeef "Nim doesnt use namespaces": if beef made nim, would nim still have UFCS
21:41:22FromDiscord<Rainbow Asteroids> or would nim have namespaces like in python
21:41:37FromDiscord<Elegantbeef> Namespaces are pointless if you ask me
21:41:38FromDiscord<Elegantbeef> It'd have ufcs
21:43:08FromDiscord<Rainbow Asteroids> sent a code paste, see https://play.nim-lang.org/#ix=4c2T
21:43:18FromDiscord<Elegantbeef> Sure
21:43:30FromDiscord<Elegantbeef> How does name spaces resolve that
21:43:38FromDiscord<Rainbow Asteroids> it does
21:44:06FromDiscord<Elegantbeef> By manually wrapping the code in namespaces and then using that name to dispatch that procedure?
21:44:16FromDiscord<Elegantbeef> You can do the same with Nim
21:45:31FromDiscord<Elegantbeef> We now did this and i hate it 😄
21:45:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4c2U
21:46:02FromDiscord<pmunch> Or if you keep them in separate modules \`from module import nil\`
21:46:09FromDiscord<pmunch> Or whatever that syntax is
21:46:16FromDiscord<Elegantbeef> In that case you just use the module name to disambiguate
21:46:28FromDiscord<Patitotective> or use different names for different procedures like a normal person
21:46:42FromDiscord<Elegantbeef> No namespaces required
21:46:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4c2V
21:46:50FromDiscord<Elegantbeef> You use modules symbols to disambiguate when required
21:47:27FromDiscord<pmunch> Fair enough
21:48:08FromDiscord<Elegantbeef> The only times you really need the 'namespace' import method is when you have two modules with identical procedures for whatever reason
21:48:17FromDiscord<Elegantbeef> Atleast that's how i use it
21:48:29FromDiscord<Elegantbeef> YMMV 😛
21:59:54FromDiscord<Takemichi Hanagaki> Thank you, @ElegantBeef!↵This explains to me so much! 🙂
22:00:13FromDiscord<Takemichi Hanagaki> But, what exactly is UFCS?
22:00:20FromDiscord<Elegantbeef> Method call syntax
22:00:38FromDiscord<Takemichi Hanagaki> In reply to @Elegantbeef "Method call syntax": Oooohh, got it!↵Thank you!
22:00:46FromDiscord<Elegantbeef> In Nim all procedures are freestanding but you can do `10.procedure()` or `procedure(10)`
22:00:55FromDiscord<Elegantbeef> Now that i think about it the reason that Python uses namespaces as much as it does is lack of static typing
22:00:55FromDiscord<Patitotective> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax
22:01:03FromDiscord<Elegantbeef> If it had static typing i'd imagine it'd be similar to Nim
22:01:55FromDiscord<Takemichi Hanagaki> In reply to @Elegantbeef "If it had static": Hummm, interesting!↵Again, thank you to explain! 😄
22:02:25FromDiscord<Takemichi Hanagaki> In reply to @Patitotective "https://nim-lang.org/docs/manual.html#procedures-me": I'll read it now! Thank you! 💯
22:26:43FromDiscord<Horizon [She/Her]> In reply to @Elegantbeef "Nim doesnt use namespaces": UFCS?
22:26:54FromDiscord<Patitotective> universal function call syntax iirc
22:27:25FromDiscord<Horizon [She/Her]> Ah
22:29:35FromDiscord<huantian> uniform
22:29:41FromDiscord<Patitotective> right
22:35:36FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4c36
22:36:01FromDiscord<Patitotective> search in the docs for a proc named `/`
22:38:35FromDiscord<Phil> There is no such proc in this one instance I call there.↵I call the same proc literally 5 lines further above as part of another (generic) proc and that works
22:39:37FromDiscord<Elegantbeef> What is line 18?
22:41:46FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4c37
22:42:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4c38
22:42:18FromDiscord<Phil> renderNimjaPage has worked in 7 different circumstances in the same file already, it's just this instance
22:42:23FromDiscord<Elegantbeef> Sorry `bind`
22:46:01FromDiscord<Elegantbeef> Whenever you have an error like this is good to assume the `/` isnt getting properly bound either not being left open or being mixin'd
22:46:12FromDiscord<Elegantbeef> or being binded\
22:53:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4c39
23:04:22*jmdaemon joined #nim
23:28:37*qwr quit (Ping timeout: 252 seconds)
23:30:45*qwr joined #nim