00:09:50 | FromDiscord | <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:26 | FromDiscord | <Elegantbeef> The point is to make it the same across cpu/OS |
00:11:03 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright↵even mobile CPUs have FPU? |
00:11:09 | FromDiscord | <Elegantbeef> Of couruse |
00:11:11 | FromDiscord | <Elegantbeef> course\ |
00:11:16 | FromDiscord | <Elegantbeef> FPUs are too powerful not to have |
00:11:55 | FromDiscord | <System64 ~ Flandre Scarlet> Even game consoles? |
00:11:59 | * | lucasta joined #nim |
00:12:00 | FromDiscord | <Chronos [She/Her]> How about Risc-V CPUs? Are FPUs something in the spec by default? |
00:12:05 | FromDiscord | <Chronos [She/Her]> In reply to @sys64 "Even game consoles?": Yep :P |
00:13:11 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Yep :P": GBA : Doesn't have an FPU↵SNES : Doesn't have an FPU |
00:13:56 | FromDiscord | <Elegantbeef> Yea 20+ year old consoles do not |
00:13:58 | FromDiscord | <Elegantbeef> Modern game consoles due |
00:14:00 | FromDiscord | <Elegantbeef> do\ |
00:17:18 | FromDiscord | <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:17 | FromDiscord | <treeform> 0.1 is hard to store in a binary fixed point |
00:19:43 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright, makes sense |
00:19:59 | FromDiscord | <Chronos [She/Her]> In reply to @sys64 "GBA : Doesn't have": Yeah was talking about modern ones not old ones :p |
00:20:06 | FromDiscord | <Chronos [She/Her]> Also smaller embedded devices don't |
00:20:22 | FromDiscord | <System64 ~ Flandre Scarlet> And is converting float to int and int to float expensive? |
00:22:12 | FromDiscord | <treeform> It’s time yes, but not really |
00:22:42 | FromDiscord | <treeform> You can time it |
00:24:38 | FromDiscord | <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:25 | FromDiscord | <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:51 | FromDiscord | <odexine> In reply to @isofruit "Just to be on": Inter process need security, thread does not |
02:29:13 | FromDiscord | <odexine> In reply to @isofruit "Nope, seq is always": Sequences are always heap allocated, but act as value types |
02:30:43 | FromDiscord | <Elegantbeef> the `(len, ptr Data)` is a value type |
02:30:59 | FromDiscord | <Elegantbeef> Can we stop saying "always stack allocated" or even saying "Stack allocated" 😄 |
02:31:13 | FromDiscord | <odexine> Pretty much yeah |
02:33:44 | FromDiscord | <odexine> In reply to @chronos.vitaqua "How about Risc-V CPUs?": I believe they are extensions in RISC V |
02:34:16 | FromDiscord | <odexine> Yeah, the F and D extension indicate float and double |
02:35:19 | FromDiscord | <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:18 | FromDiscord | <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:23 | FromDiscord | <odexine> Distincts do not expose the fields |
02:54:38 | FromDiscord | <Elegantbeef> Cause it doesnt exist unless you do `type Point3 {.borrow: `.`.} = distinct ....` |
02:54:40 | FromDiscord | <Elegantbeef> Well screwed the pooch there |
02:55:00 | FromDiscord | <odexine> Can’t type code fast on a phone |
02:55:04 | FromDiscord | <odexine> I’ll leave it to you |
02:56:14 | FromDiscord | <Elegantbeef> Though I'd personally just do `type Vec3 = distinct array[3, float]` and use `std/typetraits.distinctBase` |
02:56:15 | FromDiscord | <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:37 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/qZI40 |
02:57:55 | FromDiscord | <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:02 | FromDiscord | <Elegantbeef> also those `[]` probably should return `var float` |
02:58:13 | FromDiscord | <Elegantbeef> `borrow` borrows operations from the base type |
02:58:23 | FromDiscord | <Elegantbeef> `distinct` explicitly has no operations of the base type |
02:58:28 | FromDiscord | <Elegantbeef> borrowing `.` borrows field access |
03:00:17 | FromDiscord | <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:43 | FromDiscord | <Elegantbeef> We can even automate this further for all types using some dirty concept magic |
03:09:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/8mpyD |
03:09:49 | FromDiscord | <Elegantbeef> Concepts are experimental, but yea they do enable nice things |
03:10:05 | FromDiscord | <Elegantbeef> Sadly template pragmas do not work on generics though.... so uhh yea |
03:11:27 | FromDiscord | <cy_tek> sent a code paste, see https://paste.rs/zYxYq |
03:11:31 | FromDiscord | <cy_tek> In reply to @Elegantbeef "Concepts are experimental, but": How likely are they to become stable, any guesses? |
03:11:48 | FromDiscord | <Elegantbeef> No clue, I use them when I need/want them |
03:12:03 | FromDiscord | <Elegantbeef> They work if you do not do crazy things in them like those FP nerds due |
03:12:04 | FromDiscord | <Elegantbeef> do\ |
03:12:19 | FromDiscord | <odexine> 👀 |
03:16:05 | FromDiscord | <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:05 | FromDiscord | <odexine> Fuck you HAHAHA |
03:17:49 | FromDiscord | <odexine> I believe technically Nim doesn’t need an implementation of church numeral types as it already has static values as types |
03:17:58 | FromDiscord | <odexine> So that’s good at least |
03:19:09 | FromDiscord | <Elegantbeef> I have no clue, I just threw together a slew of words I've read in FP circles |
03:25:27 | FromDiscord | <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:35 | FromDiscord | <odexine> well ig thats just lambda calc in a nutshell |
03:26:59 | FromDiscord | <alireza0x0> hi guys |
03:27:29 | FromDiscord | <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:41 | FromDiscord | <alireza0x0> (edit) "thisg before" => "thisbefore" |
03:27:44 | FromDiscord | <alireza0x0> (edit) "thisbefore" => "this before" |
03:31:35 | FromDiscord | <odexine> httpbeast probably allocated that memory on startup |
03:32:32 | FromDiscord | <alireza0x0> well i dont see any "alloc" or "allocshared" in the code... |
03:32:46 | FromDiscord | <alireza0x0> (edit) ""alloc"" => ""alloc~"" | ""allocshared"" => ""allocshared~"" |
03:34:37 | FromDiscord | <Elegantbeef> Seems like it's deallocating threads created with `createThread` |
03:35:06 | FromDiscord | <Elegantbeef> Which means it has assumptions on how they're allocated |
03:35:33 | FromDiscord | <alireza0x0> true |
03:47:40 | FromDiscord | <alireza0x0> nim's destroythread() is doing the exact same thing, its weird that they simply did not call that |
03:48:25 | FromDiscord | <alireza0x0> oh wait, its not , the destroythread is under the "when false" ! |
03:49:16 | FromDiscord | <alireza0x0> (edit) "destroythread" => "destroythread()" |
03:57:55 | FromDiscord | <Elegantbeef> They probably should have destructors, but idk |
03:57:57 | FromDiscord | <Elegantbeef> Likely the destructor should ensure the thread is finished as a safety, but idk |
05:04:54 | FromDiscord | <sOkam! 🫐> In reply to @inventormatt "There is this one": its sadly not deterministic |
05:05:22 | FromDiscord | <samurmaykr> i have been wanting to learn nim for some time, how is the scrapping ecosystem here? |
05:15:31 | FromDiscord | <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:08 | FromDiscord | <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:09 | FromDiscord | <Elegantbeef> Araq suggests malebolgia, though I've never used any so cannot say which |
06:22:34 | FromDiscord | <Elegantbeef> There is a question of whether you actually need threading |
06:37:06 | FromDiscord | <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:05 | FromDiscord | <Elegantbeef> I assume using processes would not work? |
06:40:23 | FromDiscord | <Elegantbeef> Just wondering, it's always simpler to use self contained programs than threading |
06:59:25 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> Processes will be simpler so just fall back to that when you inevitably get stuck in multithreading hell 😄 |
07:01:24 | FromDiscord | <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:56 | FromDiscord | <odexine> httpbeast is probably not the most up to date project using threading |
07:02:08 | FromDiscord | <Elegantbeef> It's a TCP server though |
07:02:21 | FromDiscord | <alireza0x0> it received some commits like 3 months ago |
07:02:32 | FromDiscord | <alireza0x0> yea i dont need any protocol upper than tcp for now |
07:02:34 | FromDiscord | <Elegantbeef> Wonder if there are any better TCP servers that use multi threading |
07:02:36 | FromDiscord | <Elegantbeef> I know httpleast uses CPS but don't think it uses threading |
07:02:57 | FromDiscord | <Elegantbeef> Mummy is a modern http server |
07:03:00 | FromDiscord | <Elegantbeef> Using modern Nim |
07:03:23 | FromDiscord | <Elegantbeef> Wasn't httpbeast not even capable of being ran with Nim 2.0 until recently? |
07:03:25 | FromDiscord | <Elegantbeef> Or was that jester |
07:03:32 | FromDiscord | <alireza0x0> it crashes |
07:03:34 | FromDiscord | <odexine> ~~prolly both~~ |
07:03:34 | FromDiscord | <Elegantbeef> I do not recall some project was not usable with orc |
07:03:37 | FromDiscord | <alireza0x0> i didnt test my self |
07:03:43 | FromDiscord | <alireza0x0> someone in telegram group had trouble with it |
07:03:50 | FromDiscord | <alireza0x0> it was crashing with nim 2 |
07:04:35 | FromDiscord | <Elegantbeef> Yea given dom has left Nim, abandon faith in any of his software working with 2.0 |
07:04:43 | FromDiscord | <alireza0x0> by the way |
07:04:52 | FromDiscord | <alireza0x0> why dom left nim? i couldnt find an answer |
07:05:02 | FromDiscord | <alireza0x0> i see his name everywhere in async std libs |
07:05:03 | FromDiscord | <Elegantbeef> Araq is a silly billy |
07:05:11 | FromDiscord | <alireza0x0> hmm |
07:05:34 | FromDiscord | <Elegantbeef> Araq has said some things I'd consider silly and Dom disagreed with them |
07:05:46 | FromDiscord | <Elegantbeef> So Dom left and stopped using Nim |
07:05:57 | FromDiscord | <alireza0x0> wasnt it about 0 terminating strings ? ;D |
07:06:02 | FromDiscord | <Elegantbeef> No |
07:06:10 | FromDiscord | <alireza0x0> i have seen some discussions in git rfcs... |
07:06:15 | FromDiscord | <Elegantbeef> It was Araq's views on non programming things |
07:07:14 | FromDiscord | <alireza0x0> hmm, thats really sad, he was one of the most active core devs |
07:39:29 | NimEventer | New 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:35 | FromDiscord | <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:53 | FromDiscord | <Elegantbeef> It cannot any more |
09:52:08 | PMunch | I used to be possible through source code filters: https://nim-lang.org/docs/filters.html |
09:59:02 | FromDiscord | <odexine> That’s a different feature to what allowed it before |
10:05:26 | PMunch | Really? I thought they where the same feature |
10:06:08 | FromDiscord | <odexine> I don’t think syntax skins fell under source code filters? |
10:19:22 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "<@380360389377916939> I needed a": Wdym by determinism? |
10:20:00 | FromDiscord | <sOkam! 🫐> In reply to @sys64 "Wdym by determinism?": always returning the exact same values no matter which computer/architecture runs it |
10:20:10 | FromDiscord | <sOkam! 🫐> (edit) "it" => "it, or how many times the process is run" |
10:27:38 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "always returning the exact": Oh alright, so there are some UBs? |
10:29:10 | FromDiscord | <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:48 | FromDiscord | <odexine> Calculations are not necessarily the same between machines by default |
10:30:05 | FromDiscord | <odexine> I don’t know if certain compiler flags protect against this well enough |
10:33:02 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "its not UB. math": Oh alright, and why is that like this? |
10:34:20 | FromDiscord | <sOkam! 🫐> In reply to @sys64 "Oh alright, and why": https://www.youtube.com/watch?v=f4ekifyijIg |
10:34:27 | FromDiscord | <odexine> Differences in FPU implementation |
10:34:34 | FromDiscord | <odexine> And compiler choices |
10:34:37 | FromDiscord | <odexine> IIRC |
10:35:15 | FromDiscord | <odexine> You have to check first if it matters to you if it is deterministic in that sense though |
10:38:10 | FromDiscord | <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:31 | FromDiscord | <nnsee> In reply to @piqueiras "If I have some": `&` |
10:42:33 | FromDiscord | <piqueiras> myseq & toSeq(n..m) I guess? |
10:42:54 | FromDiscord | <odexine> Depends on if you want to modify the original or not |
10:48:23 | FromDiscord | <System64 ~ Flandre Scarlet> Aaaah YouTube makes me cringes because of those ads in the middle of the video! |
10:50:16 | FromDiscord | <piqueiras> In reply to @odexine "Depends on if you": I do |
10:50:23 | FromDiscord | <piqueiras> but I guess &= is a thing |
10:50:46 | FromDiscord | <piqueiras> also is there not a proc like pop() but for the first element? |
10:51:29 | FromDiscord | <odexine> No, that would be “expensive computationally” |
10:51:39 | FromDiscord | <piqueiras> no queues? rip |
10:51:47 | FromDiscord | <odexine> There is, different data type |
10:52:03 | FromDiscord | <odexine> https://nim-lang.org/1.6.6/deques.html |
10:52:21 | FromDiscord | <odexine> (edit) "https://nim-lang.org/1.6.6/deques.html" => "https://nim-lang.org/docs/deques.html" |
10:52:37 | FromDiscord | <piqueiras> hmm |
10:57:29 | FromDiscord | <piqueiras> guessing deques dont have & tho |
11:00:38 | FromDiscord | <odexine> No |
11:25:21 | FromDiscord | <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:12 | FromDiscord | <piqueiras> I guess as well |
11:48:31 | * | NunavuT quit (Remote host closed the connection) |
11:52:53 | * | NunavuT joined #nim |
12:10:01 | FromDiscord | <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:17 | FromDiscord | <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:07 | FromDiscord | <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:02 | FromDiscord | <spotlightkid> For example\: `if state and Keymod.KMOD_LSHIFT.ord:` |
14:42:24 | FromDiscord | <odexine> == should work actually |
14:42:35 | FromDiscord | <odexine> oh wait, you're doing that |
14:42:46 | FromDiscord | <odexine> kinda the wrong way about it but okay sure that would work |
14:44:37 | FromDiscord | <spotlightkid> Why do you say it's wrong? You need bitwise and, because several modifiers can be encoded in `state`. |
14:47:53 | FromDiscord | <aria0zero> In reply to @odexine "kinda the wrong way": What would be the right way? |
14:48:13 | FromDiscord | <aria0zero> It's my first time with SDL |
14:48:33 | FromDiscord | <odexine> enums arent meant to represent a bitwise set |
14:48:45 | FromDiscord | <odexine> sets are, enums are the values of that set |
14:50:06 | FromDiscord | <aria0zero> This is from the SDL wrapper for nim... |
14:50:10 | FromDiscord | <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:12 | FromDiscord | <odexine> i see |
14:50:27 | FromDiscord | <odexine> then you'll have to do the "hack" spotlight sent |
14:51:11 | FromDiscord | <saint.___.> Two anime pfps talking to each other |
14:51:21 | FromDiscord | <odexine> so? |
14:51:42 | FromDiscord | <saint.___.> Oh no nothing sorry |
14:51:47 | FromDiscord | <saint.___.> I just thought it was cool |
14:52:11 | FromDiscord | <nnsee> anime pfp detected, opinion discarded |
14:52:24 | FromDiscord | <odexine> Lol |
14:54:27 | FromDiscord | <aria0zero> bdw, how are you supposed to do the bitwise and? |
14:54:40 | FromDiscord | <nnsee> literally `and` |
14:55:40 | FromDiscord | <aria0zero> oh, it was givving some cryptic error before and i was trying eith bitand |
14:55:48 | FromDiscord | <aria0zero> (edit) "eith" => "with" |
14:55:59 | FromDiscord | <aria0zero> (edit) "givving" => "giving" | "bitand" => "`bitand`" |
14:58:05 | FromDiscord | <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:44 | FromDiscord | <nnsee> what did your case look like? |
14:58:54 | FromDiscord | <nnsee> sent a code paste, see https://paste.rs/8Nu28 |
14:59:00 | FromDiscord | <nnsee> it might've been that you were missing the default fallback value |
14:59:57 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://paste.rs/xD9Bb |
15:01:25 | FromDiscord | <aria0zero> sent a code paste, see https://paste.rs/YSG5R |
15:03:30 | FromDiscord | <aria0zero> sent a code paste, see https://paste.rs/0rvfd |
15:12:47 | FromDiscord | <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:43 | FromDiscord | <Chronos [She/Her]> Hey Beef, are you around? :p |
15:37:37 | FromDiscord | <aria0zero> So, compiling with hotcode reloading fails https://media.discordapp.net/attachments/371759389889003532/1181258009796689971/message.txt?ex=65806740&is=656df240&hm=adbe1b1e2e81b2e90c3317affce2e617f923825c7275cf2b1c46af63c30d683c& |
15:39:08 | FromDiscord | <aria0zero> Compiling with hot code reloading failed https://media.discordapp.net/attachments/371759389889003532/1181258394875723917/message.txt?ex=6580679c&is=656df29c&hm=14cba6370632de973a212d8073648344da6a247dec82e73ae472fef1dfe2c5e3& |
16:05:46 | FromDiscord | <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:30 | Amun-Ra | $field.typeof? |
17:47:49 | FromDiscord | <Chronos [She/Her]> In reply to @Amun-Ra "$field.typeof?": This is in a macro, which is the issue |
17:48:01 | FromDiscord | <Chronos [She/Her]> But I decided that them using aliases is stupid anyway :P |
17:50:07 | Amun-Ra | $foo.get_type should work |
17:50:18 | FromDiscord | <Chronos [She/Her]> Ah thank you! |
17:50:38 | Amun-Ra | *should*, I haven't tested that ;P |
17:51:46 | Amun-Ra | I have to reread some macro docs again after I stop writing them for a while |
17:51:55 | Amun-Ra | I'm not Elegantbeef ;) |
17:54:44 | FromDiscord | <Phil> In that case: Do better 😛 |
17:54:50 | FromDiscord | <Phil> (edit) "Do" => "Be" |
18:02:56 | * | adium quit (Excess Flood) |
18:04:59 | * | adium joined #nim |
18:12:37 | FromDiscord | <kaddkaka> Hi, how to calculate "power of"? |
18:13:24 | FromDiscord | <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:58 | FromDiscord | <odexine> the manual does not have proc definitions or signatures |
18:14:00 | FromDiscord | <Phil> import std/math? |
18:14:08 | FromDiscord | <odexine> power of depends on which kind, integer or float |
18:14:28 | FromDiscord | <Chronos [She/Her]> Hey Phil did the playground die? :p |
18:14:46 | FromDiscord | <Chronos [She/Her]> Oh it's back- |
18:14:59 | FromDiscord | <Phil> Can also do `2.4^4` , for float in the exponent no clue |
18:14:59 | FromDiscord | <kaddkaka> Thanks Phil |
18:15:08 | FromDiscord | <odexine> math also has `pow` for float powers |
18:15:10 | FromDiscord | <Chronos [She/Her]> Aaand it's gone again when I clicked share to IX |
18:15:30 | FromDiscord | <kaddkaka> integer is enough, I'm still finding Nim very hard to discover 😢 |
18:15:30 | FromDiscord | <Phil> Ix more generally is down (the service for linking stuff) afaik, but it has been so for a while |
18:15:44 | FromDiscord | <odexine> `^` requires positive integral exponents |
18:16:02 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Ix more generally is": Seems to cause the entire playground to freeze up :p |
18:16:06 | FromDiscord | <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:20 | FromDiscord | <kaddkaka> is there a intended entry point for nim reference/manual ? |
18:16:21 | FromDiscord | <Chronos [She/Her]> Yep, Cloudflare reports an issue here- |
18:16:29 | FromDiscord | <Chronos [She/Her]> Host error :PPP |
18:16:40 | FromDiscord | <Chronos [She/Her]> I found a bug :'D |
18:16:42 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/lNWy9 |
18:16:45 | FromDiscord | <kaddkaka> where do I find all the packages(?) are they listed somehwere |
18:16:48 | FromDiscord | <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:51 | FromDiscord | <kaddkaka> (edit) "packages(?)" => "packages(?)," | "somehwere" => "somehwere?" |
18:17:02 | FromDiscord | <Phil> https://nim-lang.org/docs/lib.html |
18:17:15 | FromDiscord | <Chronos [She/Her]> And it's back, looks like a request to ix causes it to freeze |
18:17:24 | FromDiscord | <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:34 | FromDiscord | <Phil> (edit) "Link to the std lib and the search bar right there ... 😄" added "in the manual" |
18:18:13 | FromDiscord | <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:43 | FromDiscord | <kaddkaka> the results show up at the top, so if scrolled down, a user gets no feedback that the search has happened |
18:20:54 | FromDiscord | <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:32 | FromDiscord | <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:07 | FromDiscord | <Phil> Wait a sec, you can't annotate a type with a macro? |
18:28:24 | FromDiscord | <Phil> `type A {.serverMessage.} = object` is blowing up on me somehow |
18:28:43 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Wait a sec, you": You can... Or well, should be able to |
18:29:57 | FromDiscord | <Chronos [She/Her]> In reply to @chronos.vitaqua "https://hastebin.skyra.pw/kihibeyaki.bash so the is": Seems to be an oversight |
18:31:53 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/XcNaM |
18:37:42 | FromDiscord | <odexine> In reply to @isofruit "`Error: invalid expression: A": you cant have it be a typed nimnoed |
18:37:43 | FromDiscord | <odexine> (edit) "nimnoed" => "nimnode" |
18:38:04 | FromDiscord | <odexine> i dont really know what it should do when it is `typed` |
18:39:59 | FromDiscord | <kaddkaka> is there some kind of `sumIt` method on sequences? |
18:41:07 | FromDiscord | <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:30 | FromDiscord | <odexine> "sumIt" how would that work? |
18:44:40 | FromDiscord | <kaddkaka> @[1, 2, 3].sumIt(it2) == 12 |
18:44:43 | FromDiscord | <kaddkaka> (edit) "@[1," => "`@[1," | "12" => "12`" |
18:44:48 | FromDiscord | <Phil> In reply to @kaddkaka "is there some kind": There's a general accumulation method called "foldl" or "foldr" |
18:45:04 | FromDiscord | <kaddkaka> oh ok |
18:46:11 | FromDiscord | <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:19 | FromDiscord | <kaddkaka> but my current element "iterator" is now `b` and the "running sum" is `a`? |
18:49:10 | FromDiscord | <kaddkaka> In reply to @isofruit "There's a general accumulation": Oh ,can I use foldl on a sequence? |
18:49:15 | FromDiscord | <kaddkaka> sorry iterable |
18:49:57 | FromDiscord | <odexine> "iterables" dont exactly exist, i assume anything with an `items` iterator? |
18:50:04 | FromDiscord | <odexine> iterators can be turned into sequences |
18:50:19 | FromDiscord | <odexine> In reply to @kaddkaka "but my current element": yes |
18:50:25 | FromDiscord | <Phil> It's not tied to the sequence type, so arrays, openarrays etc. will work with it |
18:50:31 | FromDiscord | <odexine> so `a+b2` |
18:50:39 | FromDiscord | <Phil> Also:↵> The first parameter is the start value (the first a) and therefore defines the type of the result. |
18:51:09 | FromDiscord | <odexine> In reply to @isofruit "Also: > The first": only for the 2 parameter kind |
18:51:19 | FromDiscord | <odexine> the 3 param one (shown) isnt |
18:51:19 | FromDiscord | <kaddkaka> did I mess up the parameter order? |
18:51:28 | FromDiscord | <odexine> i do not think so |
18:52:02 | FromDiscord | <kaddkaka> The line gives me 4 copied of this diagnostic: `template/generic instantiation from here [nimsuggest chk]` |
18:52:03 | FromDiscord | <odexine> In reply to @kaddkaka "so, count the number": lines("input").toSeq.foldl(...) |
18:52:26 | FromDiscord | <odexine> In reply to @kaddkaka "The line gives me": ignore that, that's technically just an indicator of where the error starts |
18:52:50 | FromDiscord | <kaddkaka> sent a code paste, see https://paste.rs/lNd4g |
19:00:22 | FromDiscord | <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:47 | FromDiscord | <kaddkaka> sent a code paste, see https://paste.rs/gW5h6 |
19:13:24 | FromDiscord | <Phil> Historical reasons |
19:13:31 | FromDiscord | <Phil> Honestly I'd never not use std/ for exactly that reason |
19:17:55 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/FoFZ7 |
19:19:50 | FromDiscord | <kaddkaka> ok 👍 |
19:21:51 | * | disso_pch joined #nim |
19:22:07 | PMunch | AoC 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:41 | FromDiscord | <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:27 | FromDiscord | <Chronos [She/Her]> Hold on a sec it should be easy, actually |
19:31:12 | FromDiscord | <Phil> is enum? |
19:31:37 | FromDiscord | <Chronos [She/Her]> Nvm it isn't- |
19:31:51 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "is enum?": Using an untyped macro |
19:32:09 | FromDiscord | <Chronos [She/Her]> Need to check if `MyEnum` is an enum, not sure how to do that |
19:34:02 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://paste.rs/SDH4H |
19:36:51 | FromDiscord | <kaddkaka> is there any other overview of all methods on countTable than https://nim-lang.org/docs/tables.html ? |
19:37:09 | FromDiscord | <kaddkaka> I'm trying to find a total or sum |
19:37:28 | * | Amun-Ra joined #nim |
19:39:17 | FromDiscord | <Chronos [She/Her]> In reply to @kaddkaka "I'm trying to find": Doesn't seem to be |
19:39:57 | FromDiscord | <kaddkaka> sorry for the noob spam |
19:40:41 | FromDiscord | <Chronos [She/Her]> It's fine no worries ^^ |
19:41:06 | FromDiscord | <Chronos [She/Her]> You could do `sum(copies.values.toSeq())`? |
19:41:22 | FromDiscord | <Chronos [She/Her]> `sum` is from `std/math` and `toSeq` is from `std/sequtils` |
19:41:48 | FromDiscord | <kaddkaka> sent a code paste, see https://paste.rs/PPmM4 |
19:43:17 | FromDiscord | <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:54 | FromDiscord | <␀ 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:50 | FromDiscord | <Chronos [She/Her]> In reply to @chronos.vitaqua "I'm just gonna make": This... Doesn't work ._. |
19:55:11 | FromDiscord | <␀ Array> sent a code paste, see https://paste.rs/kNHK3 |
19:56:33 | FromDiscord | <␀ Array> sent a code paste, see https://paste.rs/4FL7y |
19:59:24 | FromDiscord | <␀ Array> sent a code paste, see https://paste.rs/LslQM |
20:02:16 | FromDiscord | <Phil> I don't do JS backend magic, however, I know someone who does! |
20:02:24 | FromDiscord | <Phil> @hotdog6666 ! I choose you ! |
20:04:37 | FromDiscord | <␀ Array> sent a code paste, see https://paste.rs/4dOnk |
20:09:53 | FromDiscord | <Elegantbeef> @Chronos [She/Her] what do you want? |
20:10:42 | FromDiscord | <Chronos [She/Her]> Lol Beef is tired of me |
20:11:02 | FromDiscord | <Elegantbeef> No you just asked if I was alive and not your question |
20:11:05 | FromDiscord | <Chronos [She/Her]> I sorted out my issue frm before so it's fine now lol |
20:11:38 | FromDiscord | <␀ Array> beef can you help me |
20:11:45 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> I swear if someone pings me without asking their question again I'm going to go to the rust matrix server |
20:12:57 | FromDiscord | <Elegantbeef> `compiles(VarNum[int32])` 😄 |
20:13:27 | FromDiscord | <Chronos [She/Her]> Lol thanks! |
20:13:57 | FromDiscord | <␀ Array> ^ |
20:14:45 | FromDiscord | <␀ Array> idk how to use an object that is returned from a js function |
20:17:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/WE5VF |
20:22:01 | FromDiscord | <Elegantbeef> Cause you're likely expecting a JS string on the JS side |
20:22:02 | FromDiscord | <␀ 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:04 | FromDiscord | <Elegantbeef> You do not have to you can use `JsObject` and access fields dynamically like JS |
20:22:09 | FromDiscord | <Elegantbeef> But you're in Nim so you want static typing, use it |
20:22:31 | FromDiscord | <␀ Array> i see, thank you! |
20:28:36 | FromDiscord | <Chronos [She/Her]> I wish it was possible to put a pragma on an enum |
20:28:46 | FromDiscord | <Elegantbeef> Why? |
20:30:29 | FromDiscord | <Chronos [She/Her]> That way I could make my code for generating MC packets much cleaner |
20:30:46 | FromDiscord | <Chronos [She/Her]> Hold on let me explain |
20:35:51 | FromDiscord | <Elegantbeef> So what does the pragma solve? |
20:35:57 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://paste.rs/KtIWn |
20:35:57 | FromDiscord | <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:32 | FromDiscord | <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:05 | FromDiscord | <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:41 | FromDiscord | <Elegantbeef> So you want to associate a type to parse? |
20:42:23 | FromDiscord | <hotdog6666> In reply to @isofruit "<@472459996068839424> ! I choose": Pikapika? |
20:42:40 | FromDiscord | <Phil> More like js js |
20:42:48 | FromDiscord | <Phil> Or nimjs nimjs |
20:42:49 | FromDiscord | <hotdog6666> In reply to @␀ Array "second question i have": You can just make an overload for each version |
20:43:20 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "So you want to": Yep |
20:46:08 | FromDiscord | <Elegantbeef> The pragma does not make any sense either though |
20:46:27 | FromDiscord | <Elegantbeef> Since you want to dynamically change the flow of the program based off static values |
20:46:27 | FromDiscord | <Elegantbeef> You need to emit something like the above |
20:46:31 | FromDiscord | <Elegantbeef> Should probably be \`distinct NextState |
20:46:51 | FromDiscord | <Elegantbeef> But point still stands you want to have type branches in your code which means you need flow control |
20:47:37 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/qdC6J |
20:56:34 | * | PMunch quit (Quit: leaving) |
20:56:54 | marcus | Punch: guess I'm on irc too ;-) |
21:04:03 | FromDiscord | <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:54 | FromDiscord | <Chronos [She/Her]> As you can see, I am shit at explaining :p |
21:06:56 | * | NunavuT joined #nim |
21:14:08 | FromDiscord | <Chronos [She/Her]> Ah! Figured out the pragma stuff :D |
21:14:39 | FromDiscord | <Chronos [She/Her]> Template pragmas don't work because it leaves a `{..}` behind which is invalid AST |
21:14:49 | FromDiscord | <Chronos [She/Her]> A custom macro though isn't an issue |
21:22:21 | * | NunavuT quit (Remote host closed the connection) |
21:28:15 | FromDiscord | <␀ 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 |