<< 04-12-2023 >>

00:09:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "Flags like ‘`-fno-fast-math -ffloat-store": Does it prevents 0.1 + 0.2 = 0.30000000...4?
00:10:26FromDiscord<Elegantbeef> The point is to make it the same across cpu/OS
00:11:03FromDiscord<System64 ~ Flandre Scarlet> Oh alright↵even mobile CPUs have FPU?
00:11:09FromDiscord<Elegantbeef> Of couruse
00:11:11FromDiscord<Elegantbeef> course\
00:11:16FromDiscord<Elegantbeef> FPUs are too powerful not to have
00:11:55FromDiscord<System64 ~ Flandre Scarlet> Even game consoles?
00:11:59*lucasta joined #nim
00:12:00FromDiscord<Chronos [She/Her]> How about Risc-V CPUs? Are FPUs something in the spec by default?
00:12:05FromDiscord<Chronos [She/Her]> In reply to @sys64 "Even game consoles?": Yep :P
00:13:11FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Yep :P": GBA : Doesn't have an FPU↵SNES : Doesn't have an FPU
00:13:56FromDiscord<Elegantbeef> Yea 20+ year old consoles do not
00:13:58FromDiscord<Elegantbeef> Modern game consoles due
00:14:00FromDiscord<Elegantbeef> do\
00:17:18FromDiscord<treeform> In reply to @sys64 "Does it prevents 0.1": Even fixed point has that problem. If you want to fix that you want binary packed decimal or something like that
00:18:17FromDiscord<treeform> 0.1 is hard to store in a binary fixed point
00:19:43FromDiscord<System64 ~ Flandre Scarlet> Oh alright, makes sense
00:19:59FromDiscord<Chronos [She/Her]> In reply to @sys64 "GBA : Doesn't have": Yeah was talking about modern ones not old ones :p
00:20:06FromDiscord<Chronos [She/Her]> Also smaller embedded devices don't
00:20:22FromDiscord<System64 ~ Flandre Scarlet> And is converting float to int and int to float expensive?
00:22:12FromDiscord<treeform> It’s time yes, but not really
00:22:42FromDiscord<treeform> You can time it
00:24:38FromDiscord<Schelz> can someone take a look at what iv done so far to make a wrap for d3d9 in nim ? https://github.com/SchelZ/d9Nim/tree/main
01:01:46*Mister_Magister quit (Quit: bye)
01:03:41*Mister_Magister joined #nim
01:24:25FromDiscord<demotomohiro> Raspberry Pi Pico's CPU (RP2040) doesn't have FPU and floats are emulated.
02:04:51*NunavuT joined #nim
02:17:31*targz77 left #nim (Leaving)
02:28:51FromDiscord<odexine> In reply to @isofruit "Just to be on": Inter process need security, thread does not
02:29:13FromDiscord<odexine> In reply to @isofruit "Nope, seq is always": Sequences are always heap allocated, but act as value types
02:30:43FromDiscord<Elegantbeef> the `(len, ptr Data)` is a value type
02:30:59FromDiscord<Elegantbeef> Can we stop saying "always stack allocated" or even saying "Stack allocated" 😄
02:31:13FromDiscord<odexine> Pretty much yeah
02:33:44FromDiscord<odexine> In reply to @chronos.vitaqua "How about Risc-V CPUs?": I believe they are extensions in RISC V
02:34:16FromDiscord<odexine> Yeah, the F and D extension indicate float and double
02:35:19FromDiscord<odexine> To note, integer multiplication and division is also an extension in RISC V
02:45:50*lucasta quit (Remote host closed the connection)
02:45:59*jmdaemon joined #nim
02:53:18FromDiscord<cy_tek> Hi everyone, still new to Nim here, and I'm seeing a strange error, can someone please explain why it doesn't seem like `arr` exists on the distinct type when trying to access it? https://media.discordapp.net/attachments/371759389889003532/1181065660890107945/image.png?ex=657fb41c&is=656d3f1c&hm=67f41b6904813896974499f8fd518628cdb2396e0ac9acdf045b848bb693ddac&
02:54:23FromDiscord<odexine> Distincts do not expose the fields
02:54:38FromDiscord<Elegantbeef> Cause it doesnt exist unless you do `type Point3 {.borrow: `.`.} = distinct ....`
02:54:40FromDiscord<Elegantbeef> Well screwed the pooch there
02:55:00FromDiscord<odexine> Can’t type code fast on a phone
02:55:04FromDiscord<odexine> I’ll leave it to you
02:56:14FromDiscord<Elegantbeef> Though I'd personally just do `type Vec3 = distinct array[3, float]` and use `std/typetraits.distinctBase`
02:56:15FromDiscord<cy_tek> (edit) "Hi everyone, still new to Nim here, and I'm seeing" => "sent" | "strange error, can someone please explain why it doesn't seem like `arr` exists on the distinct type when trying to access it? https://media.discordapp.net/attachments/371759389889003532/1181065660890107945/image.png?ex=657fb41c&is=656d3f1c&hm=67f41b6904813896974499f8fd518628cdb2396e0ac9acdf045b848bb693ddac&" => "code paste, see https://paste.rs/KoML2"
02:57:37FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/qZI40
02:57:55FromDiscord<cy_tek> In reply to @Elegantbeef "Though I'd personally just": Thanks for the help! Can you explain what borrow does, and the the ``.`` does?↵And okay! That looks promising 🙂
02:58:02FromDiscord<Elegantbeef> also those `[]` probably should return `var float`
02:58:13FromDiscord<Elegantbeef> `borrow` borrows operations from the base type
02:58:23FromDiscord<Elegantbeef> `distinct` explicitly has no operations of the base type
02:58:28FromDiscord<Elegantbeef> borrowing `.` borrows field access
03:00:17FromDiscord<cy_tek> In reply to @Elegantbeef "borrowing `.` borrows field": Thanks so much, this is all super helpful! I'm going to go play with it some now and see how far I can get 🙂
03:00:43FromDiscord<Elegantbeef> We can even automate this further for all types using some dirty concept magic
03:09:48FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/8mpyD
03:09:49FromDiscord<Elegantbeef> Concepts are experimental, but yea they do enable nice things
03:10:05FromDiscord<Elegantbeef> Sadly template pragmas do not work on generics though.... so uhh yea
03:11:27FromDiscord<cy_tek> sent a code paste, see https://paste.rs/zYxYq
03:11:31FromDiscord<cy_tek> In reply to @Elegantbeef "Concepts are experimental, but": How likely are they to become stable, any guesses?
03:11:48FromDiscord<Elegantbeef> No clue, I use them when I need/want them
03:12:03FromDiscord<Elegantbeef> They work if you do not do crazy things in them like those FP nerds due
03:12:04FromDiscord<Elegantbeef> do\
03:12:19FromDiscord<odexine> 👀
03:16:05FromDiscord<Elegantbeef> "Excuse me whilst I try to implement church numeral monads that use lambda calculus to ensure the sanctity of effect handlers inside concepts"
03:17:05FromDiscord<odexine> Fuck you HAHAHA
03:17:49FromDiscord<odexine> I believe technically Nim doesn’t need an implementation of church numeral types as it already has static values as types
03:17:58FromDiscord<odexine> So that’s good at least
03:19:09FromDiscord<Elegantbeef> I have no clue, I just threw together a slew of words I've read in FP circles
03:25:27FromDiscord<odexine> iirc (if im not a complete dumbass) church encoding is used commonly to implement things in a language where pretty much only functions exist? kinda deal
03:25:35FromDiscord<odexine> well ig thats just lambda calc in a nutshell
03:26:59FromDiscord<alireza0x0> hi guys
03:27:29FromDiscord<alireza0x0> can anyone explain why httpbeast dose thisg before exiting? is that required? why? https://media.discordapp.net/attachments/371759389889003532/1181074269485142016/image.png?ex=657fbc21&is=656d4721&hm=e38b743c44b255fe5a87b8b32e0ae7ad12dfd293688ed14fea61be881251c803&
03:27:41FromDiscord<alireza0x0> (edit) "thisg before" => "thisbefore"
03:27:44FromDiscord<alireza0x0> (edit) "thisbefore" => "this before"
03:31:35FromDiscord<odexine> httpbeast probably allocated that memory on startup
03:32:32FromDiscord<alireza0x0> well i dont see any "alloc" or "allocshared" in the code...
03:32:46FromDiscord<alireza0x0> (edit) ""alloc"" => ""alloc~"" | ""allocshared"" => ""allocshared~""
03:34:37FromDiscord<Elegantbeef> Seems like it's deallocating threads created with `createThread`
03:35:06FromDiscord<Elegantbeef> Which means it has assumptions on how they're allocated
03:35:33FromDiscord<alireza0x0> true
03:47:40FromDiscord<alireza0x0> nim's destroythread() is doing the exact same thing, its weird that they simply did not call that
03:48:25FromDiscord<alireza0x0> oh wait, its not , the destroythread is under the "when false" !
03:49:16FromDiscord<alireza0x0> (edit) "destroythread" => "destroythread()"
03:57:55FromDiscord<Elegantbeef> They probably should have destructors, but idk
03:57:57FromDiscord<Elegantbeef> Likely the destructor should ensure the thread is finished as a safety, but idk
05:04:54FromDiscord<sOkam! 🫐> In reply to @inventormatt "There is this one": its sadly not deterministic
05:05:22FromDiscord<samurmaykr> i have been wanting to learn nim for some time, how is the scrapping ecosystem here?
05:15:31FromDiscord<sOkam! 🫐> sent a long message, see https://paste.rs/FJuvO
05:37:55*disso-peach quit (Quit: Leaving)
05:39:21*azimut quit (Remote host closed the connection)
05:39:47*azimut joined #nim
05:49:22*azimut quit (Remote host closed the connection)
05:49:46*azimut joined #nim
06:08:35*rockcavera quit (Remote host closed the connection)
06:13:08FromDiscord<alireza0x0> so , what is the recommended way of having a threadpool in nim ...? malebolgia / nim-taskpools / others...? since im a beginner i have no idea which one to choose, i want to build a multi-threaded tcp server
06:14:09FromDiscord<Elegantbeef> Araq suggests malebolgia, though I've never used any so cannot say which
06:22:34FromDiscord<Elegantbeef> There is a question of whether you actually need threading
06:37:06FromDiscord<alireza0x0> I need it for sure because the app im making usually runs on multi core servers and needs to process large amount of data flow , currently the single threaded version implemented and works fine...
06:40:05FromDiscord<Elegantbeef> I assume using processes would not work?
06:40:23FromDiscord<Elegantbeef> Just wondering, it's always simpler to use self contained programs than threading
06:59:25FromDiscord<alireza0x0> hmm, that can work but for some reasons I actually prefer doing or trying it first with threads, that is my current plan at least for now
07:00:07FromDiscord<Elegantbeef> Processes will be simpler so just fall back to that when you inevitably get stuck in multithreading hell 😄
07:01:24FromDiscord<alireza0x0> yea, i like headache XD reading httpbeast gives me some hope that this can be done so ill try it, wont be harder than understanding gcsafe pragma 🙂
07:01:56FromDiscord<odexine> httpbeast is probably not the most up to date project using threading
07:02:08FromDiscord<Elegantbeef> It's a TCP server though
07:02:21FromDiscord<alireza0x0> it received some commits like 3 months ago
07:02:32FromDiscord<alireza0x0> yea i dont need any protocol upper than tcp for now
07:02:34FromDiscord<Elegantbeef> Wonder if there are any better TCP servers that use multi threading
07:02:36FromDiscord<Elegantbeef> I know httpleast uses CPS but don't think it uses threading
07:02:57FromDiscord<Elegantbeef> Mummy is a modern http server
07:03:00FromDiscord<Elegantbeef> Using modern Nim
07:03:23FromDiscord<Elegantbeef> Wasn't httpbeast not even capable of being ran with Nim 2.0 until recently?
07:03:25FromDiscord<Elegantbeef> Or was that jester
07:03:32FromDiscord<alireza0x0> it crashes
07:03:34FromDiscord<odexine> ~~prolly both~~
07:03:34FromDiscord<Elegantbeef> I do not recall some project was not usable with orc
07:03:37FromDiscord<alireza0x0> i didnt test my self
07:03:43FromDiscord<alireza0x0> someone in telegram group had trouble with it
07:03:50FromDiscord<alireza0x0> it was crashing with nim 2
07:04:35FromDiscord<Elegantbeef> Yea given dom has left Nim, abandon faith in any of his software working with 2.0
07:04:43FromDiscord<alireza0x0> by the way
07:04:52FromDiscord<alireza0x0> why dom left nim? i couldnt find an answer
07:05:02FromDiscord<alireza0x0> i see his name everywhere in async std libs
07:05:03FromDiscord<Elegantbeef> Araq is a silly billy
07:05:11FromDiscord<alireza0x0> hmm
07:05:34FromDiscord<Elegantbeef> Araq has said some things I'd consider silly and Dom disagreed with them
07:05:46FromDiscord<Elegantbeef> So Dom left and stopped using Nim
07:05:57FromDiscord<alireza0x0> wasnt it about 0 terminating strings ? ;D
07:06:02FromDiscord<Elegantbeef> No
07:06:10FromDiscord<alireza0x0> i have seen some discussions in git rfcs...
07:06:15FromDiscord<Elegantbeef> It was Araq's views on non programming things
07:07:14FromDiscord<alireza0x0> hmm, thats really sad, he was one of the most active core devs
07:39:29NimEventerNew thread by angus: Why is "end" a reserved keyword?, see https://forum.nim-lang.org/t/10730
07:51:24*advesperacit joined #nim
07:55:13*PMunch joined #nim
08:01:43*azimut quit (Ping timeout: 240 seconds)
09:34:33*jay-tuckey joined #nim
09:35:09*jay-tuckey quit (Client Quit)
09:40:35FromDiscord<alireza0x0> hey, i have heard nim can use bracers instead of indentation, i won't use it but im curious how, anyone knows? 🙂
09:51:53FromDiscord<Elegantbeef> It cannot any more
09:52:08PMunchI used to be possible through source code filters: https://nim-lang.org/docs/filters.html
09:59:02FromDiscord<odexine> That’s a different feature to what allowed it before
10:05:26PMunchReally? I thought they where the same feature
10:06:08FromDiscord<odexine> I don’t think syntax skins fell under source code filters?
10:19:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "<@380360389377916939> I needed a": Wdym by determinism?
10:20:00FromDiscord<sOkam! 🫐> In reply to @sys64 "Wdym by determinism?": always returning the exact same values no matter which computer/architecture runs it
10:20:10FromDiscord<sOkam! 🫐> (edit) "it" => "it, or how many times the process is run"
10:27:38FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "always returning the exact": Oh alright, so there are some UBs?
10:29:10FromDiscord<sOkam! 🫐> In reply to @sys64 "Oh alright, so there": its not UB. math works as expected↵its just not the same every time, like it happens with floats
10:29:48FromDiscord<odexine> Calculations are not necessarily the same between machines by default
10:30:05FromDiscord<odexine> I don’t know if certain compiler flags protect against this well enough
10:33:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "its not UB. math": Oh alright, and why is that like this?
10:34:20FromDiscord<sOkam! 🫐> In reply to @sys64 "Oh alright, and why": https://www.youtube.com/watch?v=f4ekifyijIg
10:34:27FromDiscord<odexine> Differences in FPU implementation
10:34:34FromDiscord<odexine> And compiler choices
10:34:37FromDiscord<odexine> IIRC
10:35:15FromDiscord<odexine> You have to check first if it matters to you if it is deterministic in that sense though
10:38:10FromDiscord<piqueiras> If I have some random seq like @[3,7,9] what is the preferable way of adding some other consecutive numbers to it, so I can get @[3,7,9,2,3,4,5] for example
10:38:31FromDiscord<nnsee> In reply to @piqueiras "If I have some": `&`
10:42:33FromDiscord<piqueiras> myseq & toSeq(n..m) I guess?
10:42:54FromDiscord<odexine> Depends on if you want to modify the original or not
10:48:23FromDiscord<System64 ~ Flandre Scarlet> Aaaah YouTube makes me cringes because of those ads in the middle of the video!
10:50:16FromDiscord<piqueiras> In reply to @odexine "Depends on if you": I do
10:50:23FromDiscord<piqueiras> but I guess &= is a thing
10:50:46FromDiscord<piqueiras> also is there not a proc like pop() but for the first element?
10:51:29FromDiscord<odexine> No, that would be “expensive computationally”
10:51:39FromDiscord<piqueiras> no queues? rip
10:51:47FromDiscord<odexine> There is, different data type
10:52:03FromDiscord<odexine> https://nim-lang.org/1.6.6/deques.html
10:52:21FromDiscord<odexine> (edit) "https://nim-lang.org/1.6.6/deques.html" => "https://nim-lang.org/docs/deques.html"
10:52:37FromDiscord<piqueiras> hmm
10:57:29FromDiscord<piqueiras> guessing deques dont have & tho
11:00:38FromDiscord<odexine> No
11:25:21FromDiscord<intellij_gamer> In reply to @piqueiras "also is there not": You could use [delete](https://nim-lang.org/docs/system.html#delete,seq[T],Natural) or [del](https://nim-lang.org/docs/system.html#del,seq[T],Natural) with index 0
11:30:12FromDiscord<piqueiras> I guess as well
11:48:31*NunavuT quit (Remote host closed the connection)
11:52:53*NunavuT joined #nim
12:10:01FromDiscord<madprog32> Hello, I was wondering if, with a given flag, nim or nimble was able to recompile only the needed files (and skip the compilation if the target is already up-to-date)
12:12:17FromDiscord<odexine> incremental compilation is still in the works for nim
12:56:46*azimut joined #nim
13:11:17*rockcavera joined #nim
14:29:42*xet7 joined #nim
14:34:00*xet7 quit (Read error: Connection reset by peer)
14:34:07FromDiscord<aria0zero> sent a code paste, see https://paste.rs/v8zS4
14:34:18*xet7 joined #nim
14:34:24*xet7 quit (Remote host closed the connection)
14:40:02FromDiscord<spotlightkid> For example\: `if state and Keymod.KMOD_LSHIFT.ord:`
14:42:24FromDiscord<odexine> == should work actually
14:42:35FromDiscord<odexine> oh wait, you're doing that
14:42:46FromDiscord<odexine> kinda the wrong way about it but okay sure that would work
14:44:37FromDiscord<spotlightkid> Why do you say it's wrong? You need bitwise and, because several modifiers can be encoded in `state`.
14:47:53FromDiscord<aria0zero> In reply to @odexine "kinda the wrong way": What would be the right way?
14:48:13FromDiscord<aria0zero> It's my first time with SDL
14:48:33FromDiscord<odexine> enums arent meant to represent a bitwise set
14:48:45FromDiscord<odexine> sets are, enums are the values of that set
14:50:06FromDiscord<aria0zero> This is from the SDL wrapper for nim...
14:50:10FromDiscord<odexine> so LSHIFT should = 1, RSHIFT = 2, etc, then getModState returns a set[Keymod] (but you have to size it correctly so maybe make a type = set[Keymod] + attach the size pragma then make that the return type)
14:50:12FromDiscord<odexine> i see
14:50:27FromDiscord<odexine> then you'll have to do the "hack" spotlight sent
14:51:11FromDiscord<saint.___.> Two anime pfps talking to each other
14:51:21FromDiscord<odexine> so?
14:51:42FromDiscord<saint.___.> Oh no nothing sorry
14:51:47FromDiscord<saint.___.> I just thought it was cool
14:52:11FromDiscord<nnsee> anime pfp detected, opinion discarded
14:52:24FromDiscord<odexine> Lol
14:54:27FromDiscord<aria0zero> bdw, how are you supposed to do the bitwise and?
14:54:40FromDiscord<nnsee> literally `and`
14:55:40FromDiscord<aria0zero> oh, it was givving some cryptic error before and i was trying eith bitand
14:55:48FromDiscord<aria0zero> (edit) "eith" => "with"
14:55:59FromDiscord<aria0zero> (edit) "givving" => "giving" | "bitand" => "`bitand`"
14:58:05FromDiscord<aria0zero> Oh, i got it now. I use it in a case↵`Error: cannot evaluate at compile time: event`↵guess i need to use it in a if statement
14:58:44FromDiscord<nnsee> what did your case look like?
14:58:54FromDiscord<nnsee> sent a code paste, see https://paste.rs/8Nu28
14:59:00FromDiscord<nnsee> it might've been that you were missing the default fallback value
14:59:57FromDiscord<Chronos [She/Her]> sent a code paste, see https://paste.rs/xD9Bb
15:01:25FromDiscord<aria0zero> sent a code paste, see https://paste.rs/YSG5R
15:03:30FromDiscord<aria0zero> sent a code paste, see https://paste.rs/0rvfd
15:12:47FromDiscord<Chronos [She/Her]> Can't figure out how I'd check if `VarNum[int32]` is a valid type... I know I can do `bindSym"VarNum"` but that doesn't work for `VarNum[int32]` obviously
15:20:57*PMunch quit (Quit: Leaving)
15:24:43FromDiscord<Chronos [She/Her]> Hey Beef, are you around? :p
15:37:37FromDiscord<aria0zero> So, compiling with hotcode reloading fails https://media.discordapp.net/attachments/371759389889003532/1181258009796689971/message.txt?ex=65806740&is=656df240&hm=adbe1b1e2e81b2e90c3317affce2e617f923825c7275cf2b1c46af63c30d683c&
15:39:08FromDiscord<aria0zero> Compiling with hot code reloading failed https://media.discordapp.net/attachments/371759389889003532/1181258394875723917/message.txt?ex=6580679c&is=656df29c&hm=14cba6370632de973a212d8073648344da6a247dec82e73ae472fef1dfe2c5e3&
16:05:46FromDiscord<Chronos [She/Her]> Would https://nim-lang.org/docs/macros.html#getType%2CNimNode allow me to do something like `fieldType.getType().strVal`, where `fieldType` is `MyTypeAlias` (which is a `type MyTypeAlias = string`)?
16:47:38*disso-peach joined #nim
17:46:30Amun-Ra$field.typeof?
17:47:49FromDiscord<Chronos [She/Her]> In reply to @Amun-Ra "$field.typeof?": This is in a macro, which is the issue
17:48:01FromDiscord<Chronos [She/Her]> But I decided that them using aliases is stupid anyway :P
17:50:07Amun-Ra$foo.get_type should work
17:50:18FromDiscord<Chronos [She/Her]> Ah thank you!
17:50:38Amun-Ra*should*, I haven't tested that ;P
17:51:46Amun-RaI have to reread some macro docs again after I stop writing them for a while
17:51:55Amun-RaI'm not Elegantbeef ;)
17:54:44FromDiscord<Phil> In that case: Do better 😛
17:54:50FromDiscord<Phil> (edit) "Do" => "Be"
18:02:56*adium quit (Excess Flood)
18:04:59*adium joined #nim
18:12:37FromDiscord<kaddkaka> Hi, how to calculate "power of"?
18:13:24FromDiscord<kaddkaka> I'm having trouble searching https://nim-lang.org/docs/manual.html , can't find definition of operations of numbers, like `+` and `-`.
18:13:58FromDiscord<odexine> the manual does not have proc definitions or signatures
18:14:00FromDiscord<Phil> import std/math?
18:14:08FromDiscord<odexine> power of depends on which kind, integer or float
18:14:28FromDiscord<Chronos [She/Her]> Hey Phil did the playground die? :p
18:14:46FromDiscord<Chronos [She/Her]> Oh it's back-
18:14:59FromDiscord<Phil> Can also do `2.4^4` , for float in the exponent no clue
18:14:59FromDiscord<kaddkaka> Thanks Phil
18:15:08FromDiscord<odexine> math also has `pow` for float powers
18:15:10FromDiscord<Chronos [She/Her]> Aaand it's gone again when I clicked share to IX
18:15:30FromDiscord<kaddkaka> integer is enough, I'm still finding Nim very hard to discover 😢
18:15:30FromDiscord<Phil> Ix more generally is down (the service for linking stuff) afaik, but it has been so for a while
18:15:44FromDiscord<odexine> `^` requires positive integral exponents
18:16:02FromDiscord<Chronos [She/Her]> In reply to @isofruit "Ix more generally is": Seems to cause the entire playground to freeze up :p
18:16:06FromDiscord<Phil> I honestly didn't even know we had std/math, I just assumed we might have one called like that or "std/calc" or so
18:16:20FromDiscord<kaddkaka> is there a intended entry point for nim reference/manual ?
18:16:21FromDiscord<Chronos [She/Her]> Yep, Cloudflare reports an issue here-
18:16:29FromDiscord<Chronos [She/Her]> Host error :PPP
18:16:40FromDiscord<Chronos [She/Her]> I found a bug :'D
18:16:42FromDiscord<Phil> sent a code paste, see https://paste.rs/lNWy9
18:16:45FromDiscord<kaddkaka> where do I find all the packages(?) are they listed somehwere
18:16:48FromDiscord<Phil> In reply to @kaddkaka "is there a intended": Generally the nim manual is for reference.↵To look for specific procs, search for specific names or keywords in the search bar
18:16:51FromDiscord<kaddkaka> (edit) "packages(?)" => "packages(?)," | "somehwere" => "somehwere?"
18:17:02FromDiscord<Phil> https://nim-lang.org/docs/lib.html
18:17:15FromDiscord<Chronos [She/Her]> And it's back, looks like a request to ix causes it to freeze
18:17:24FromDiscord<Phil> Link to the std lib and the search bar right there 😄 https://media.discordapp.net/attachments/371759389889003532/1181298223453831228/image.png?ex=65808cb3&is=656e17b3&hm=635296b0496c8d9aba28f8d78b9e5bda0f0cfc3c0d96ba716809ba08234a84ae&
18:17:34FromDiscord<Phil> (edit) "Link to the std lib and the search bar right there ... 😄" added "in the manual"
18:18:13FromDiscord<kaddkaka> the search box looks like it's not working unless scrolled to the top https://media.discordapp.net/attachments/371759389889003532/1181298427351547975/image.png?ex=65808ce4&is=656e17e4&hm=12bacd4f9dde7109e9fe879fcafa725cc63fbf182054d6f1f330cd39420d6a42&
18:18:43FromDiscord<kaddkaka> the results show up at the top, so if scrolled down, a user gets no feedback that the search has happened
18:20:54FromDiscord<kaddkaka> searching for power does not find `^` but it finds `isPowerOfTwo` and with a ctrl-f on math.html, you can find the power operator. Hmm ...
18:23:53*edr joined #nim
18:26:32FromDiscord<Chronos [She/Her]> https://hastebin.skyra.pw/kihibeyaki.bash so the issue I was gonna share was that it seems like `expandMacros` doesn't show that the type itself is exported, despite me making sure the postfix was added?
18:28:07FromDiscord<Phil> Wait a sec, you can't annotate a type with a macro?
18:28:24FromDiscord<Phil> `type A {.serverMessage.} = object` is blowing up on me somehow
18:28:43FromDiscord<Chronos [She/Her]> In reply to @isofruit "Wait a sec, you": You can... Or well, should be able to
18:29:57FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "https://hastebin.skyra.pw/kihibeyaki.bash so the is": Seems to be an oversight
18:31:53FromDiscord<Phil> sent a code paste, see https://paste.rs/XcNaM
18:37:42FromDiscord<odexine> In reply to @isofruit "`Error: invalid expression: A": you cant have it be a typed nimnoed
18:37:43FromDiscord<odexine> (edit) "nimnoed" => "nimnode"
18:38:04FromDiscord<odexine> i dont really know what it should do when it is `typed`
18:39:59FromDiscord<kaddkaka> is there some kind of `sumIt` method on sequences?
18:41:07FromDiscord<kaddkaka> I guess similar to https://nim-lang.org/docs/math.html#sum%2CopenArray%5BT%5D, but combined wiht mapIt, maybe that's how to do it ^^'
18:42:30FromDiscord<odexine> "sumIt" how would that work?
18:44:40FromDiscord<kaddkaka> @[1, 2, 3].sumIt(it2) == 12
18:44:43FromDiscord<kaddkaka> (edit) "@[1," => "`@[1," | "12" => "12`"
18:44:48FromDiscord<Phil> In reply to @kaddkaka "is there some kind": There's a general accumulation method called "foldl" or "foldr"
18:45:04FromDiscord<kaddkaka> oh ok
18:46:11FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "https://hastebin.skyra.pw/kihibeyaki.bash so the is": for hard way try import type in other file, or repr/treeRepr
18:46:19FromDiscord<kaddkaka> but my current element "iterator" is now `b` and the "running sum" is `a`?
18:49:10FromDiscord<kaddkaka> In reply to @isofruit "There's a general accumulation": Oh ,can I use foldl on a sequence?
18:49:15FromDiscord<kaddkaka> sorry iterable
18:49:57FromDiscord<odexine> "iterables" dont exactly exist, i assume anything with an `items` iterator?
18:50:04FromDiscord<odexine> iterators can be turned into sequences
18:50:19FromDiscord<odexine> In reply to @kaddkaka "but my current element": yes
18:50:25FromDiscord<Phil> It's not tied to the sequence type, so arrays, openarrays etc. will work with it
18:50:31FromDiscord<odexine> so `a+b2`
18:50:39FromDiscord<Phil> Also:↵> The first parameter is the start value (the first a) and therefore defines the type of the result.
18:51:09FromDiscord<odexine> In reply to @isofruit "Also: > The first": only for the 2 parameter kind
18:51:19FromDiscord<odexine> the 3 param one (shown) isnt
18:51:19FromDiscord<kaddkaka> did I mess up the parameter order?
18:51:28FromDiscord<odexine> i do not think so
18:52:02FromDiscord<kaddkaka> The line gives me 4 copied of this diagnostic: `template/generic instantiation from here [nimsuggest chk]`
18:52:03FromDiscord<odexine> In reply to @kaddkaka "so, count the number": lines("input").toSeq.foldl(...)
18:52:26FromDiscord<odexine> In reply to @kaddkaka "The line gives me": ignore that, that's technically just an indicator of where the error starts
18:52:50FromDiscord<kaddkaka> sent a code paste, see https://paste.rs/lNd4g
19:00:22FromDiscord<kaddkaka> ok, that's what my editor inline message looks like >.<
19:05:59*LuxuryMode quit (Quit: Connection closed for inactivity)
19:09:57*PMunch joined #nim
19:11:47FromDiscord<kaddkaka> sent a code paste, see https://paste.rs/gW5h6
19:13:24FromDiscord<Phil> Historical reasons
19:13:31FromDiscord<Phil> Honestly I'd never not use std/ for exactly that reason
19:17:55FromDiscord<Phil> sent a code paste, see https://paste.rs/FoFZ7
19:19:50FromDiscord<kaddkaka> ok 👍
19:21:51*disso_pch joined #nim
19:22:07PMunchAoC stream day 4 is live: https://www.youtube.com/watch?v=c0UsWstoFPU https://twitch.tv/pmunche
19:22:14*oisota9 joined #nim
19:22:17*TheLink8 joined #nim
19:23:03*notchris_ joined #nim
19:23:10*madprops_ joined #nim
19:23:10*gshumway_ joined #nim
19:25:40*notchris quit (Ping timeout: 252 seconds)
19:25:41*gshumway quit (Ping timeout: 252 seconds)
19:25:41*edr quit (Ping timeout: 252 seconds)
19:25:41*disso-peach quit (Ping timeout: 252 seconds)
19:25:41FromDiscord<Chronos [She/Her]> How would I check if a given type is an enum? :p
19:25:41*Amun-Ra quit (Ping timeout: 252 seconds)
19:25:41*madprops quit (Ping timeout: 252 seconds)
19:25:41*oisota quit (Ping timeout: 252 seconds)
19:25:41*TheLink quit (Ping timeout: 252 seconds)
19:25:43*TheLink8 is now known as TheLink
19:25:44*notchris_ is now known as notchris
19:25:44*oisota9 is now known as oisota
19:26:27FromDiscord<Chronos [She/Her]> Hold on a sec it should be easy, actually
19:31:12FromDiscord<Phil> is enum?
19:31:37FromDiscord<Chronos [She/Her]> Nvm it isn't-
19:31:51FromDiscord<Chronos [She/Her]> In reply to @isofruit "is enum?": Using an untyped macro
19:32:09FromDiscord<Chronos [She/Her]> Need to check if `MyEnum` is an enum, not sure how to do that
19:34:02FromDiscord<Chronos [She/Her]> sent a code paste, see https://paste.rs/SDH4H
19:36:51FromDiscord<kaddkaka> is there any other overview of all methods on countTable than https://nim-lang.org/docs/tables.html ?
19:37:09FromDiscord<kaddkaka> I'm trying to find a total or sum
19:37:28*Amun-Ra joined #nim
19:39:17FromDiscord<Chronos [She/Her]> In reply to @kaddkaka "I'm trying to find": Doesn't seem to be
19:39:57FromDiscord<kaddkaka> sorry for the noob spam
19:40:41FromDiscord<Chronos [She/Her]> It's fine no worries ^^
19:41:06FromDiscord<Chronos [She/Her]> You could do `sum(copies.values.toSeq())`?
19:41:22FromDiscord<Chronos [She/Her]> `sum` is from `std/math` and `toSeq` is from `std/sequtils`
19:41:48FromDiscord<kaddkaka> sent a code paste, see https://paste.rs/PPmM4
19:43:17FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "How would I check": I'm just gonna make a special macro for this :p
19:51:54FromDiscord<␀ Array> hii, i am trying to learn how to wrap js functions in nim but idk how to deal with a function that returns an object
19:54:50FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "I'm just gonna make": This... Doesn't work ._.
19:55:11FromDiscord<␀ Array> sent a code paste, see https://paste.rs/kNHK3
19:56:33FromDiscord<␀ Array> sent a code paste, see https://paste.rs/4FL7y
19:59:24FromDiscord<␀ Array> sent a code paste, see https://paste.rs/LslQM
20:02:16FromDiscord<Phil> I don't do JS backend magic, however, I know someone who does!
20:02:24FromDiscord<Phil> @hotdog6666 ! I choose you !
20:04:37FromDiscord<␀ Array> sent a code paste, see https://paste.rs/4dOnk
20:09:53FromDiscord<Elegantbeef> @Chronos [She/Her] what do you want?
20:10:42FromDiscord<Chronos [She/Her]> Lol Beef is tired of me
20:11:02FromDiscord<Elegantbeef> No you just asked if I was alive and not your question
20:11:05FromDiscord<Chronos [She/Her]> I sorted out my issue frm before so it's fine now lol
20:11:38FromDiscord<␀ Array> beef can you help me
20:11:45FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Can't figure out how": My question was above me asking about your current state of being
20:12:00FromDiscord<Elegantbeef> I swear if someone pings me without asking their question again I'm going to go to the rust matrix server
20:12:57FromDiscord<Elegantbeef> `compiles(VarNum[int32])` 😄
20:13:27FromDiscord<Chronos [She/Her]> Lol thanks!
20:13:57FromDiscord<␀ Array> ^
20:14:45FromDiscord<␀ Array> idk how to use an object that is returned from a js function
20:17:21FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/WE5VF
20:22:01FromDiscord<Elegantbeef> Cause you're likely expecting a JS string on the JS side
20:22:02FromDiscord<␀ Array> so i have to create a nim object with the same elements of the js object? why use `cstring` instead of `string`?
20:22:04FromDiscord<Elegantbeef> You do not have to you can use `JsObject` and access fields dynamically like JS
20:22:09FromDiscord<Elegantbeef> But you're in Nim so you want static typing, use it
20:22:31FromDiscord<␀ Array> i see, thank you!
20:28:36FromDiscord<Chronos [She/Her]> I wish it was possible to put a pragma on an enum
20:28:46FromDiscord<Elegantbeef> Why?
20:30:29FromDiscord<Chronos [She/Her]> That way I could make my code for generating MC packets much cleaner
20:30:46FromDiscord<Chronos [She/Her]> Hold on let me explain
20:35:51FromDiscord<Elegantbeef> So what does the pragma solve?
20:35:57FromDiscord<Chronos [She/Her]> sent a code paste, see https://paste.rs/KtIWn
20:35:57FromDiscord<Chronos [She/Her]> Also there's the fact that `VarNum` enums need to be supported too... This could be done very easily if I could just use a custom pragma on next state, since then I could just store what type is being used
20:36:32FromDiscord<Chronos [She/Her]> My idea originally was to do something like `template packetEnum(typ: typedesc) {.pragma.}` as a custom pragma, but turns out that I can't do that
20:37:05FromDiscord<Chronos [She/Her]> So the next best thing is to just create another macro that creates an enum and stores the data in a cache table or cache seq
20:39:41FromDiscord<Elegantbeef> So you want to associate a type to parse?
20:42:23FromDiscord<hotdog6666> In reply to @isofruit "<@472459996068839424> ! I choose": Pikapika?
20:42:40FromDiscord<Phil> More like js js
20:42:48FromDiscord<Phil> Or nimjs nimjs
20:42:49FromDiscord<hotdog6666> In reply to @␀ Array "second question i have": You can just make an overload for each version
20:43:20FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "So you want to": Yep
20:46:08FromDiscord<Elegantbeef> The pragma does not make any sense either though
20:46:27FromDiscord<Elegantbeef> Since you want to dynamically change the flow of the program based off static values
20:46:27FromDiscord<Elegantbeef> You need to emit something like the above
20:46:31FromDiscord<Elegantbeef> Should probably be \`distinct NextState
20:46:51FromDiscord<Elegantbeef> But point still stands you want to have type branches in your code which means you need flow control
20:47:37FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/qdC6J
20:56:34*PMunch quit (Quit: leaving)
20:56:54marcusPunch: guess I'm on irc too ;-)
21:04:03FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Since you want to": I'm not doing anything dynamically, point is to have this information at compile time to change what code is generated
21:06:50*NunavuT quit (Killed (NickServ (GHOST command used by Nunavut_)))
21:06:54FromDiscord<Chronos [She/Her]> As you can see, I am shit at explaining :p
21:06:56*NunavuT joined #nim
21:14:08FromDiscord<Chronos [She/Her]> Ah! Figured out the pragma stuff :D
21:14:39FromDiscord<Chronos [She/Her]> Template pragmas don't work because it leaves a `{..}` behind which is invalid AST
21:14:49FromDiscord<Chronos [She/Her]> A custom macro though isn't an issue
21:22:21*NunavuT quit (Remote host closed the connection)
21:28:15FromDiscord<␀ Array> yea i realized thank you↵(@hotdog6666)
21:30:38*NunavuT joined #nim
21:37:39*madprops_ is now known as madprops
21:37:39*madprops quit (Changing host)
21:37:40*madprops joined #nim
21:45:28*lucerne quit (Ping timeout: 256 seconds)
21:55:33*lucerne joined #nim
22:12:55*NunavuT quit (Killed (NickServ (GHOST command used by Nunavut_)))
22:12:59*NunavuT joined #nim
22:28:53*advesperacit quit ()
23:57:59*NunavuT quit (Ping timeout: 252 seconds)
23:58:40*NunavuT joined #nim