<< 10-08-2023 >>

00:00:21FromDiscord<Elegantbeef> Well I showed how to do that, so do that
00:01:28FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1138985429819985920/image.png
00:01:59FromDiscord<Elegantbeef> palette isnt an open array
00:02:06FromDiscord<Elegantbeef> It' not a seq or an array is it?
00:02:21FromDiscord<System64 ~ Flandre Scarlet> oh wait I'm dumb, I forgot .data
00:05:10FromDiscord<System64 ~ Flandre Scarlet> but if I modify the merged array, will I modify elements from the others arrays too?
00:05:19FromDiscord<Elegantbeef> Of course not
00:05:45FromDiscord<Elegantbeef> Unless they're `ref`s
00:06:07FromDiscord<System64 ~ Flandre Scarlet> Any risks? https://media.discordapp.net/attachments/371759389889003532/1138986598285987890/image.png
00:06:28FromDiscord<Elegantbeef> How does that relate
00:06:28FromDiscord<Elegantbeef> The elements are not refs
00:06:49FromDiscord<System64 ~ Flandre Scarlet> Oh alright
00:07:54FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4D1u
00:08:23FromDiscord<Elegantbeef> Value types do not point back to collections so of course not
00:08:37FromDiscord<System64 ~ Flandre Scarlet> ah alright, thanks
00:39:45NimEventerNew Nimble package! dan_magaji - extensible performant http and web socket proxy server, see https://github.com/C-NERD/dan_magaji
01:00:40FromDiscord<summarity> sent a code paste, see https://play.nim-lang.org/#ix=4D1O
01:01:18FromDiscord<Elegantbeef> If you search for `owner` you might find a message that has a macro for that
01:03:20FromDiscord<Elegantbeef> Well that didnt work
01:08:03FromDiscord<Elegantbeef> There we go
01:08:06FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/qamYP
01:08:10FromDiscord<Elegantbeef> Someone write that down for me
01:08:10FromDiscord<Elegantbeef> Thanks
01:27:57FromDiscord<Chronos [She/Her]> https://play.nim-lang.org/#ix=4D1U anyone able to see if there's anything wrong with my logic here? I personally can't see an issue honestly-
01:28:01FromDiscord<Chronos [She/Her]> The issue is:
01:28:38FromDiscord<Chronos [She/Her]> `sb` when put though literally any other decoder does not give the inputted number, it instead gives `7168`
01:29:07FromDiscord<Chronos [She/Her]> Which means my decoding and encoding logic for handling base conversion is simply flawed but I don't get how
01:50:50FromDiscord<Elegantbeef> https://www.lifewire.com/base64-encoding-overview-1166412 no clue if this helps
01:55:34FromDiscord<Chronos [She/Her]> Yeah doesn't really help-
01:55:49FromDiscord<Chronos [She/Her]> It's just something I'm struggling to understand, oh well
02:05:41FromDiscord<that_dude.> Do you know how to convert numbers between decimal/binary/hex?
02:06:08FromDiscord<that_dude.> There's a lot of resources on those. base64 is just the same thing, just well as a base of 64
02:06:24FromDiscord<that_dude.> Look at the conversions between base64 and binary
02:07:03FromDiscord<Chronos [She/Her]> In reply to @that_dude. "Do you know how": Decimal and binary yes, hex I've never quite grasped tbh
02:08:54FromDiscord<Chronos [She/Her]> Also my code does work for Base16, tf?
02:09:08FromDiscord<Elegantbeef> Do you know what a base actually means?
02:09:33FromDiscord<Chronos [She/Her]> The amount of characters it can be represented in?
02:09:46FromDiscord<Elegantbeef> That's a loose definition of base
02:10:02FromDiscord<Elegantbeef> `10` is 1 \ 10^1 + 0 \ 10^0 in base 10
02:10:05FromDiscord<Chronos [She/Her]> We use base 10 (0-9) as the decimal system from what i know
02:10:11FromDiscord<_gumbercules> base16 is simply hex
02:10:16FromDiscord<Chronos [She/Her]> Yeah
02:10:17FromDiscord<_gumbercules> 0-9 + A-F
02:10:21FromDiscord<_gumbercules> base 8 == octal
02:10:25FromDiscord<_gumbercules> decimal = base 10
02:10:27FromDiscord<_gumbercules> binary = base 2
02:10:30FromDiscord<Elegantbeef> in base 2 it's 1 \ 2 ^ 1 + 0 \ 2^0
02:11:20FromDiscord<Chronos [She/Her]> Why does base10 have 1 10^1?
02:11:27FromDiscord<Chronos [She/Her]> Isn't 10 to the power of 1 still 10?
02:11:48FromDiscord<Chronos [She/Her]> Actually I think I'm defo wrong on that
02:11:57FromDiscord<Elegantbeef> 10^1 is 10
02:12:01FromDiscord<Elegantbeef> 10^0 is 1
02:12:03FromDiscord<Chronos [She/Her]> Oh huh
02:12:05FromDiscord<Chronos [She/Her]> Aah
02:12:18FromDiscord<Chronos [She/Her]> Okay so then why did you add the power?
02:12:33FromDiscord<Elegantbeef> Cause that's how bases work
02:12:43FromDiscord<Chronos [She/Her]> Huh...
02:12:48FromDiscord<Elegantbeef> number systems are just sumination of the digit multiplied to the power
02:12:59FromDiscord<Chronos [She/Her]> I'm still completely lost on how bases work really
02:13:26FromDiscord<Chronos [She/Her]> It's genuinely a brick wall type thing here
02:13:46FromDiscord<Elegantbeef> it just changes the range of values in a place
02:13:59FromDiscord<Elegantbeef> So instead of a 10s place like we have in base 10 you have a 2s place
02:14:06FromDiscord<Elegantbeef> Or a 4s place instead of 100s
02:16:36FromDiscord<_gumbercules> think about it this way
02:20:00FromDiscord<_gumbercules> you read from right to left - the first column holds 0 - 9. You get to 9 and now you have a problem so you have the next column which represents the number of 10's and also holds 0-9.↵↵Once we get to the number 9 and add one, we put a `1` in the `10`s column and change the `9` in the `0-9` column to `0`. Now we have 1 | 0 and can start back up to 1 | 9 again. Eventually we'd get to `9 | 9` which would represent `99` and we'd need
02:20:12FromDiscord<_gumbercules> if you want to think about base 2 - just replace 0-9 with 0-1
02:20:27FromDiscord<_gumbercules> base 8? 0-9 with 0-7
02:21:51FromDiscord<Elegantbeef> https://i.imgur.com/NQPrUsI.gifv
02:22:13FromDiscord<Elegantbeef> My favourite visualisation of number systems in a different base than 10
02:23:04FromDiscord<_gumbercules> raising a number to the power `n` is simply multiplying the number by itself `n` times.
02:23:11FromDiscord<_gumbercules> if that wasn't already covered
02:23:53FromDiscord<_gumbercules> In reply to @Elegantbeef "My favourite visualisation of": yeah this is a nice visualization for binary and to convert between decimal and binary there are simple little tricks you can use but I mean - like most things just use a calculator
02:24:16FromDiscord<_gumbercules> as long as you understand how to convert between bases
02:25:06FromDiscord<_gumbercules> @Chronos [She/Her] if I could recommend a book to you - https://www.microsoftpressstore.com/store/code-the-hidden-language-of-computer-hardware-and-software-9780735611313 - would be it
02:26:09FromDiscord<_gumbercules> it's going to start off slow and probably seem simplistic but it's an awesome book and does a great job of explaining ^ and a lot more about computers and how they work as well as how the idea of code has evolved
02:26:35FromDiscord<_gumbercules> oh there's a 2nd ed now, I forgot: https://www.microsoftpressstore.com/store/code-the-hidden-language-of-computer-hardware-and-software-9780137909100
02:27:03FromDiscord<_gumbercules> It's especially great if you don't have a firm understanding of logic gates and how cpus and meory work
02:27:11FromDiscord<_gumbercules> (edit) "meory" => "memory"
02:45:20FromDiscord<jordan4ibanez> It's bits
02:45:28FromDiscord<jordan4ibanez> 0000
02:45:38FromDiscord<arathanis> sent a long message, see http://ix.io/4D25
02:45:44FromDiscord<jordan4ibanez> (edit) "0000 ... " added "= 0"
02:46:14FromDiscord<arathanis> (edit) "http://ix.io/4D25" => "http://ix.io/4D27"
02:46:19FromDiscord<jordan4ibanez> 0001 = 1↵0010 = 2↵0011 = 3↵0100 = 4
02:46:53FromDiscord<jordan4ibanez> So on so forth, blah blah blah. Each boolean represents a multiplicative
02:47:00FromDiscord<arathanis> (edit) "http://ix.io/4D27" => "http://ix.io/4D29"
02:47:13FromDiscord<arathanis> (edit) "http://ix.io/4D29" => "http://ix.io/4D2a"
02:49:04FromDiscord<jordan4ibanez> Unless you're using malbolge then it's simply ggnore with 0,1,&2
02:51:09FromDiscord<jordan4ibanez> Wait, I misunderstood the question lmao
03:11:53*cm_ joined #nim
03:12:58*cm quit (Ping timeout: 256 seconds)
03:12:59*cm_ is now known as cm
03:25:44FromDiscord<Chronos [She/Her]> In reply to @_gumbercules "if you want to": Okay, I think I understand that, sounds simple there
03:26:59FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "https://i.imgur.com/NQPrUsI.gifv": Okay that's cool-
03:27:26FromDiscord<Chronos [She/Her]> In reply to @_gumbercules "oh there's a 2nd": I'll definitely look into it, thanks y'all!
03:28:39FromDiscord<Chronos [She/Her]> Thanks everyone, I think now I somewhat understand it now-
03:30:10FromDiscord<Elegantbeef> Yea base seems like a complicated thing, but you just have to break down how our number system works and then you realise you indirectly knew it the entire time
03:30:39FromDiscord<Chronos [She/Her]> With a brain that's barely functional half the time it's not shocking it took someone to break it down for me
03:30:42FromDiscord<Chronos [She/Her]> Sigh
03:31:26*cm quit (Ping timeout: 260 seconds)
03:38:54FromDiscord<_gumbercules> In reply to @chronos.vitaqua "With a brain that's": I think your brain probably functions just fine - not everyone learns the same way or is naturally blessed with the same skillset. Even if you were attempting some self-deprecating humor, it's better not to speak of yourself so negatively 🙂
03:39:12FromDiscord<Elegantbeef> Yea leave it to the professionals!
03:39:25FromDiscord<_gumbercules> Well, Beef does this way too much too - words are powerful
03:39:42FromDiscord<Chronos [She/Her]> Cut me some slack, I'm exhausted and depressed! I'm allowed to make self-deprecating jokes once in a while 😛
03:39:42FromDiscord<_gumbercules> and so is one's subconsious mind
03:39:57FromDiscord<Chronos [She/Her]> But dw abt it aha, I'm definitely much better than we used to be, in that regard
03:40:06FromDiscord<Chronos [She/Her]> It's something I'm working on, really
03:40:22FromDiscord<Chronos [She/Her]> In reply to @_gumbercules "I think your brain": Tho yeah, this is hella true
03:41:05*cm joined #nim
03:41:27*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
03:41:48FromDiscord<Chronos [She/Her]> Now, I'm going to drown myself in incoherent brain fog and pass out aha, goodnight all! (Even if it is 4:41 am rn haha)
03:42:21FromDiscord<_gumbercules> Night! Try and cheer up! There's nothing to be depressed about, I guarantee it.
03:42:39FromDiscord<Chronos [She/Her]> Pfffff i wish there was nothing to be depressed about but eh
03:43:44*ehmry joined #nim
03:44:44FromDiscord<_gumbercules> There truly isn't - I know from personal experience that can be impossible to understand or see when you're in it, and obviously you don't have to believe or agree with my statement but it's still the truth. Perspective is everything and perspective comes from understanding. I'm confident you posess an answer and solution to whatever could possibly be troubling you 🙂 Hope you sleep well!
04:50:37*xet7 joined #nim
04:50:54*xet7 quit (Remote host closed the connection)
04:55:01FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D2t
04:55:27FromDiscord<Elegantbeef> \: untyped\`
04:55:57FromDiscord<Phil> Did typed not give me benefit of checking whether the code generated was type-wise sane?
04:56:06FromDiscord<Elegantbeef> It's talking about the return value
04:56:15FromDiscord<Elegantbeef> the result is untyped code
04:56:20FromDiscord<Phil> Yeh, me too
04:56:36FromDiscord<Phil> Ahh check, so the NimNode you return does not get checked in that manner
04:56:42FromDiscord<Phil> (edit) "Ahh check, so the NimNode you return does not get checked in that manner ... " added "at the time of returning"
04:57:00FromDiscord<Elegantbeef> I mean that's not what it means, but yea
04:57:18FromDiscord<Elegantbeef> You're returning AST, that AST is not semantically checked so saying `typed` is wrong
04:58:02FromDiscord<Phil> Ohhh I read the section in macro tutorial wrong
04:58:16FromDiscord<Phil> typed just means autoconversions, not checking
04:58:28FromDiscord<Phil> (edit) "Ohhh I read the section in ... macro" added "the"
04:58:44FromDiscord<Elegantbeef> typed means it's semantically checked
04:59:10FromDiscord<Elegantbeef> That means symbols are looked up, macros are expanded, it compiles
04:59:25FromDiscord<Elegantbeef> You are not the compiler so cannot return semantically checked code
05:00:15FromDiscord<Phil> In reply to @Elegantbeef "You are not the": My dream of becoming a compiler: Crushed
05:00:39FromDiscord<Elegantbeef> Just go write C or Odin
05:01:18FromDiscord<Phil> I mean logically speaking once I'm comfortable enough with macros that's one of the remaining larger holes in my skillset
05:01:20FromDiscord<_gumbercules> Maybe you're not THE compiler but that doesn't mean you cannot be A compiler!
05:01:36FromDiscord<Phil> Learning memory management that is
05:01:51FromDiscord<Elegantbeef> Memory management isnt that much
05:03:23FromDiscord<Phil> I would claim the opposite. The fundamental act not maybe, but mastering it to at least some degree, learning strategies on when to destroy/move what in e.g. cyclical datastructures etc. seems like it might be a bit
05:03:43FromDiscord<Elegantbeef> Ehh it's calling `malloc` and `free` 😛
05:04:23FromDiscord<Phil> I'd claim getting some knowledge with allocators and the choices there would also fall under that
05:06:39FromDiscord<Phil> Though the next things on the ticket are definitely macros and learning not to let it get to me when legacy code cruft makes it nearly impossible to write decent code which feels frustrating as hell
05:07:07FromDiscord<Phil> (edit) "code" => "code/make good design decisions"
05:09:42FromDiscord<_gumbercules> It really depends
05:10:13FromDiscord<_gumbercules> It's a rabbit hole for sure - but for a lot of people understanding malloc and free and possibly implementing them youself is probably enough
05:10:55FromDiscord<_gumbercules> If you want to get into a specific niche of programming, like game development for instance, and you plan on working on an engine - understanding how to write a memory management subsystem and various allocators is a good idea.
05:11:23FromDiscord<_gumbercules> If you wanted to get that deep with Nim - my recommendation would be to write your own stdlib that doesn't depend on the gc
05:12:09FromDiscord<_gumbercules> It's something I want to do eventually when and if I ever have time - It'd also be nice to patch some of the system library so that an allocator could be provided per-allocation
05:12:42*rockcavera quit (Remote host closed the connection)
05:13:34FromDiscord<_gumbercules> Every allocator has tradeoffs but unless you're working in a resource constrained / performance critical environment or just want to know - you don't really need to know all that much.
05:14:02FromDiscord<_gumbercules> (edit) "need" => "NEED" | "NEEDto know all that much. ... " added "Hell there are a lot of programmers out there that get by without knowing what `malloc` is."
05:14:05FromDiscord<Elegantbeef> Would be even cooler if statically typed allocators on the builtin types was possible 😄
05:14:21FromDiscord<_gumbercules> In reply to @Elegantbeef "Would be even cooler": That sounds like more work than writing one's own stdlib
05:14:25FromDiscord<_gumbercules> but I agree
05:14:57FromDiscord<_gumbercules> although I think if I were to do custom allocators I would just make `Allocator` a concept
05:14:58FromDiscord<Phil> That sounds super interesting, but I think for me it would mostly just be understanding that there are different allocators and where they make their trade-offs, basically the surface-level PRO/CONs without needing to understand the entire history underneath, as that'd provide a decent starting point for if I ever need to go deeper
05:15:21FromDiscord<Phil> And surface level how an Allocator in general works
05:15:23FromDiscord<Elegantbeef> I mean yea gumber the allocator wouldbe a static generic parameter
05:15:43FromDiscord<_gumbercules> generally it's a tradeoff between a few things- number of sys calls, amount of fragmentation, memory required, latency
05:15:53FromDiscord<Phil> (edit) "works" => "works, because for now to me that is↵"Variable declarations --> magic involving allocator --> variable in memory""
05:16:10FromDiscord<_gumbercules> and number of sys calls can influence latency
05:20:43FromDiscord<_gumbercules> fragmentation is very similar to disk fragmentation except it occurs with the heap - user takes a chunk of the heap and starts dishing it out. They free and return one of the earlier allocations - maybe the second out of five so now there's a hole in the pool they've allocated. Unless the next block of memory is the same size, there's a risk that fragmentation will occur.
05:21:19FromDiscord<_gumbercules> Memory required is pretty understandable - depending on the algorithm in use the amount of memory required will vary. Similar to the amount of space time.
05:22:03FromDiscord<_gumbercules> And I mean - you can get pretty fancy with memory allocationi techniques. For instance - memory areanas are one strategy for avoiding lots of small allocations and frees. You an certainly implement them using `malloc` and `free`.
05:22:13FromDiscord<Elegantbeef> Worth noting phil that variables do not call the allocator that most people talk about
05:22:33FromDiscord<Elegantbeef> In Nim allocations are mostly explicit through constructors or concatenation
05:24:44FromDiscord<Phil> Actually, right, I just realized I can't do `let x: ref int = 5` likely because of that, no allocation done, requires a new(int) first
05:25:28FromDiscord<Phil> In reply to @_gumbercules "And I mean -": I assume memory area's just means "get huge chunk of memory and deal with that yourself"↵... sounds like the kind of thing the jvm would use
05:25:40FromDiscord<Elegantbeef> The only real exception in Nim I can think of it are the collections in Nim being treated as value types
05:26:00FromDiscord<_gumbercules> In reply to @isofruit "I assume memory area's": https://en.wikipedia.org/wiki/Region-based_memory_management
05:27:33FromDiscord<Phil> Oh right, treating a memory area as something you can have a reference to and destroying that entire thing at once seems pretty efficient
05:29:12FromDiscord<_gumbercules> As does only making one system call to allocate the entire arena
05:29:30FromDiscord<_gumbercules> or however many the allocator you allocate the arena with, makes
05:32:10FromDiscord<_gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4D2B
05:48:49*advesperacit joined #nim
05:52:38*LuxuryMode joined #nim
06:33:38*PMunch joined #nim
07:07:24*ntat joined #nim
07:18:38*azimut quit (Ping timeout: 240 seconds)
07:38:54*jmdaemon quit (Ping timeout: 246 seconds)
08:03:11FromDiscord<roupi.rb> how do i get the error of a future ?
08:21:10FromDiscord<roupi.rb> wtf
08:21:33FromDiscord<roupi.rb> so await and asyncCheck should raise if the future returned a error
08:21:53FromDiscord<odexine> not always, but oftentimes they do
08:23:34FromDiscord<roupi.rb> im doing the chat example from the nim book
08:23:42FromDiscord<roupi.rb> but it connects to the server
08:23:59FromDiscord<roupi.rb> but the server doest receive any messages
08:24:05FromDiscord<roupi.rb> from the client
08:24:09FromDiscord<roupi.rb> on telnet it works
08:24:42FromDiscord<roupi.rb> i thought i was not catching the error but i it doest seem like it
08:32:59FromDiscord<enthus1ast> @roupi.rb\: do you send a newline ?
08:33:09FromDiscord<enthus1ast> telnet sends a newline imho
08:33:30FromDiscord<enthus1ast> i would try to append a "\\n" to the text you send
08:33:44FromDiscord<roupi.rb> OHHhhhh
08:34:28FromDiscord<roupi.rb> one last thing
08:34:36FromDiscord<roupi.rb> that this error means ? https://media.discordapp.net/attachments/371759389889003532/1139114562289942578/image.png
08:34:50FromDiscord<roupi.rb> https://media.discordapp.net/attachments/371759389889003532/1139114619395379210/image.png
08:35:05FromDiscord<roupi.rb> https://media.discordapp.net/attachments/371759389889003532/1139114681798250536/image.png
08:35:44FromDiscord<enthus1ast> ok i see mutliple things \:)
08:35:51FromDiscord<odexine> all of the futures finished but you're still polling, iirc technically its not allowed
08:36:44FromDiscord<enthus1ast> the "unused imports" means, you imported the modules, but do not use them in your application
08:36:58FromDiscord<roupi.rb> so the event loop doest have any events to poll
08:37:03FromDiscord<roupi.rb> so it raises ?
08:37:21FromDiscord<enthus1ast> then change the asyncChecks to waitFor
08:37:44FromDiscord<enthus1ast> (oh for me the first image did not load)
08:37:59FromDiscord<roupi.rb> same problem
08:38:00FromDiscord<enthus1ast> asyncCheck do not block, waitFor does
08:38:27FromDiscord<enthus1ast> you do not need to poll
08:38:35FromDiscord<enthus1ast> since waitFor polls on its own
08:38:45FromDiscord<roupi.rb> oh
08:38:51FromDiscord<enthus1ast> the thing is, you are not in an async function
08:39:23FromDiscord<enthus1ast> this is the reason you must use waitFor, in a normal async function you would use await
08:39:50FromDiscord<roupi.rb> but i dont understand why the poll raises in that case
08:40:04FromDiscord<enthus1ast> it complains because it has nothing to poll on
08:40:20FromDiscord<roupi.rb> oh
08:40:32FromDiscord<roupi.rb> so asyncCheck has its own poll
08:40:38FromDiscord<enthus1ast> waitFor
08:40:53FromDiscord<roupi.rb> but then
08:41:12FromDiscord<roupi.rb> why does the poll raises with asyncCheck
08:41:23FromDiscord<odexine> Because the futures eventually finish
08:41:26FromDiscord<roupi.rb> the poll processed the 2 futures
08:41:27FromDiscord<enthus1ast> asyncCheck should be used inside an async function
08:41:29FromDiscord<odexine> Then there’s nothing to poll on
08:41:43FromDiscord<roupi.rb> and after finishing raised
08:42:08FromDiscord<roupi.rb> how do i check if there are no events left ?event
08:42:12FromDiscord<roupi.rb> (edit) "?event" => "?"
08:42:46FromDiscord<enthus1ast> asyncCheck is like await but does not "block", both must be used inside an async function↵waitFor is when you want to call async code from non async code
08:43:22FromDiscord<roupi.rb> the book uses asyncCheck on the main function
08:43:48FromDiscord<enthus1ast> nim in action?
08:43:55FromDiscord<roupi.rb> yes
08:44:54FromDiscord<roupi.rb> https://media.discordapp.net/attachments/371759389889003532/1139117155271581736/image.png
08:45:57FromDiscord<roupi.rb> they should've used waitFor here
08:46:25FromDiscord<enthus1ast> i would have used waitFor yes
08:47:01FromDiscord<enthus1ast> mh i do not have my copy of nim in action here unfortunately
08:47:37FromDiscord<enthus1ast> have a look at this\:↵https://nim-lang.org/docs/asyncnet.html
08:47:38FromDiscord<enthus1ast> example
08:48:01FromDiscord<enthus1ast> oh i think i'm wrong ...
08:48:08FromDiscord<enthus1ast> its early here
08:48:08FromDiscord<enthus1ast> \:)
08:49:06FromDiscord<enthus1ast> the server example i mean
08:49:18FromDiscord<enthus1ast> this is quite a good example for async network code
08:49:56FromDiscord<enthus1ast> the serve proc never finishes, so it always have something to poll on
08:50:32FromDiscord<enthus1ast> the server code "block" on server.accept() but then spawn's a "co routine" with asyncCheck to handle the client
08:51:17FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D39
08:52:03FromDiscord<roupi.rb> what the pagma threadvar does there
08:52:12FromDiscord<roupi.rb> i dont see any spawn
08:52:37FromDiscord<enthus1ast> i mean starts a "co routine" with asyncCheck
08:53:26FromDiscord<enthus1ast> in the server code when it would be written like↵`await processClient`↵it could only process 1 client
08:53:49FromDiscord<enthus1ast> because it would not accept new connections, since the processClient does not return
08:54:56FromDiscord<enthus1ast> the code in nim in action mixes threads and async, because it wants to also get user input while doing async network stuff
08:57:04FromDiscord<enthus1ast> threadvar makes sure that every thread has its "own" version of the variable, so you must initialize the variable in every thread
08:57:35FromDiscord<roupi.rb> i mean what would be the problem if you removed the threadvar pragma of clients ?
08:58:56FromDiscord<enthus1ast> thats a good question, no idea why its in there
08:59:20FromDiscord<enthus1ast> no threads are used here
09:00:09FromDiscord<enthus1ast> in general, when multiple threads access the same variable, you must guard the access with locks
09:01:20FromDiscord<roupi.rb> now i reached the fun part making unit tests
09:02:16FromDiscord<enthus1ast> i like them, i like to think of ways to break my code \:)
09:04:02FromDiscord<roupi.rb> im thinking of spawning a new server process while running the tests
09:04:25FromDiscord<roupi.rb> and do the assertions using the client code
09:04:40FromDiscord<enthus1ast> when its pure async, you can do client and server in the same process
09:05:36FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/8kOP1
09:05:49FromDiscord<enthus1ast> idk how the threaded code haves
09:05:50*ntat quit (Quit: leaving)
09:05:53FromDiscord<enthus1ast> behaves
09:07:01FromDiscord<roupi.rb> i should try to do some integration tests
09:09:01FromDiscord<enthus1ast> we also have two testing utilities in nim,↵unittests↵and testament
09:10:53FromDiscord<roupi.rb> im using unittest2
09:11:23FromDiscord<roupi.rb> it is similar to minitest in ruby
09:11:30FromDiscord<enthus1ast> with testament you can also test for compile time exceptions
09:11:34FromDiscord<enthus1ast> https://github.com/enthus1ast/nimja/blob/master/tests/basic/test_tokens_before_extend_error.nim
09:11:55FromDiscord<enthus1ast> it is controlled by the comment at the top
09:12:42FromDiscord<enthus1ast> in nimja i use both testament and unittests in some occasions
09:13:40FromDiscord<enthus1ast> testament to run the differents tests from the test dir, and unittests inside the module
09:16:14NimEventerNew question by Ethosa: Open file at compile-time [JS backend], see https://stackoverflow.com/questions/76874290/open-file-at-compile-time-js-backend
09:16:43NimEventerNew thread by Qtless: Open file at compile-time [JS backend], see https://forum.nim-lang.org/t/10392
09:21:11Amun-Rathat's not a compile time
09:23:36FromDiscord<enthus1ast> its a macro
09:37:39FromDiscord<Phil> In reply to @roupi.rb "now i reached the": If you find a mocking solution to solve the "how do I test my proc in isolation of all that procs it calls" give me a shoutout, I couldn't find one back when I was at the stage and got stuck with basically only unit-testing
09:37:51FromDiscord<Phil> (edit) "that" => "the other"
09:38:02FromDiscord<Phil> (edit) "give" => "send" | "a shoutout," => "amessage,"
09:50:27FromDiscord<roupi.rb> nim doest support monkey patching ?
09:53:45FromDiscord<Phil> I found no solution for it at least.↵You can work around that by essentially at test-time having a macro that rewrites your proc definitions as `var x = <procDefitinion>` so you can reassign.↵Tried that (mockingbird, at the time I knew even less about macros than the little I do now), but hit a brick wall at generics since those aren't real and kinda stripped down templates.
09:54:38Amun-Ranot directly
09:54:39FromDiscord<enthus1ast> you mean change code at runtime?
09:54:57Amun-Raroupi.rb: that's --import and nimscript's patch_file: https://nim-lang.org/docs/nimscript.html#patchFile%2Cstring%2Cstring%2Cstring
09:55:18Amun-Rathat's → there's
09:58:17FromDiscord<Phil> If you wanted to apply that to unit-testing, you'd basically prepare a lot of files with mock-proc-variations that provide you with the desired behaviour and compile your module-under-test a lot of times or sth?
10:09:47Amun-Rayes, there's no monkey-patching like in python/ruby
10:10:45FromDiscord<Phil> or how you can do if you base your everything around methods and dynamic dispatch where you can just swap out the object with a mock-one
10:12:41FromDiscord<enthus1ast> folks, how you handle secrets in your code?
10:13:20FromDiscord<enthus1ast> so, when you need to add api keys / password etc to test a thing but still want to commit to git?
10:14:05FromDiscord<enthus1ast> environment variables?
10:14:08FromDiscord<Phil> I have a JSON file that basically only root has read and write permissions to in a folder that only root has read and write permissions to.↵And then I add a specific user that the application runs as to have read access
10:14:31Amun-Raenv vars / config files in xfg
10:14:33Amun-Raxdg
10:14:34FromDiscord<Phil> That JSON file I read in on startup in a read-only manner
10:14:54FromDiscord<enthus1ast> xfg?
10:14:59Amun-Raxdg
10:14:59FromDiscord<enthus1ast> ah
10:16:05FromDiscord<Phil> And for deploying that... well I deploy docker containers so I build the JSON file into the docker container.↵Though I guess the smarter way would be to have that JSON file already on your server and mount that directory into the container
10:16:44FromDiscord<odexine> Environment variables and using the SystemD secrets system
10:17:15FromDiscord<Phil> TIL systemD has a secrets system, that I might actually want to look into instead of writing my own stuff
10:17:21FromDiscord<enthus1ast> SystemD secrets system, never heared of this
10:17:22FromDiscord<odexine> Then again I guess a secrets file would work with that too
10:18:26FromDiscord<Phil> The secrets file approach that only root and your application-user have access to are the only approaches I was aware of before this
10:18:27FromDiscord<roupi.rb> there is 2 ways, you can put the apikeys on env vars, or put them on a encrypted file and use a single env var like `master-key` to decrypt it.
10:18:58FromDiscord<odexine> https://systemd.io/CREDENTIALS/
10:20:08FromDiscord<roupi.rb> so instead of having to update your heroku secrets then your githubaction secrets and all the other services that you use that may require you to set then
10:20:11FromDiscord<roupi.rb> (edit) "then" => "them"
10:20:21FromDiscord<Phil> Wait, no, I run an alpine container, that is not an option for me unless I say goodbye to my alpine setup
10:20:24FromDiscord<roupi.rb> you just update the encrypted file
10:21:07FromDiscord<roupi.rb> and commit, then you dont have to update anything on the other services
10:21:37FromDiscord<odexine> I actively try not to have containers on my systems ever :baqua:
10:21:55FromDiscord<roupi.rb> (edit) "githubaction" => "githubactions"
10:22:12FromDiscord<Phil> I find it an alright exercise to confront myself with the kinds of problems I'll have to be able to deal with at work anyway
10:22:32FromDiscord<Phil> It's not as boring as the other stuff I really should be learning to deal with better >_>
10:23:07FromDiscord<enthus1ast> cool i'll read about systemd secrets
10:24:05FromDiscord<enthus1ast> thing is, i try to not rely on os stuff for my coe
10:24:06FromDiscord<enthus1ast> code
10:24:31FromDiscord<enthus1ast> but its still interesting
10:25:21FromDiscord<Phil> That it is for sure!↵And I mean, I feel like for your usecase its valid, you're deploying for webdev right?
10:25:43FromDiscord<Phil> I feel like assuming a linux environment is an alright base-assumption to make in those scenarios
10:25:52FromDiscord<Phil> (edit) "I feel like assuming ... a" added "you always deploy to"
10:26:21FromDiscord<enthus1ast> currently i build (or have build already and add stuff) to a nim module that can send messages over multiple channels (email, rocketchat, webhook, matrix later) for monitoring messages
10:26:28FromDiscord<Phil> (edit) "scenarios" => "scenarios.↵Which means you'll always have systemd unless you're a lunatic and actually deploy work-binaries in an alpine container"
10:27:10FromDiscord<Phil> I can't quite make a mental image of "building to a nim module".↵Is a module in this context a part of a server environment?
10:27:23FromDiscord<enthus1ast> i have "geinglischt"
10:27:37FromDiscord<Phil> Not the denglisch!
10:27:45FromDiscord<enthus1ast> nope not that one \:)
10:28:01FromDiscord<enthus1ast> yeah it runs on a server
10:28:45FromDiscord<Phil> In that case since you control the OS, controlling it to be Linux seems fair since afaik the only thing Windows has on you is Active Directory for user permissions
10:29:09FromDiscord<enthus1ast> but i also use it for other stuff (for example for a small application that runs on my desktop and informs me of events in the frankfurt stadion, that makes the S-Bahn full of people and give me the chance to avoid it, by using another train stop)
10:30:03FromDiscord<Phil> In that case controlling the OS of every computer you touch ever to be Linux seems fair, in order to make the world a better place and keep yourself sane.
10:30:37FromDiscord<enthus1ast> haha
10:30:39FromDiscord<enthus1ast> yeah
10:30:51FromDiscord<enthus1ast> i also switched to linux as my daily work os
10:30:55FromDiscord<enthus1ast> works good
10:31:44FromDiscord<Phil> I wish teams worked not like an absolute crapfest on it, both the linux client and the web-client suck a lot
10:32:00FromDiscord<enthus1ast> teams also blows on macos
10:32:39FromDiscord<Phil> But then again, that also feels slightly unfair because I assume a lot of it is based on it interacting with the browser etc.
10:33:51FromDiscord<enthus1ast> my feeling is that is was rushed, because of the sucess of zoom
10:34:01FromDiscord<enthus1ast> but i do not use it regulary
10:34:04FromDiscord<enthus1ast> regularily
10:34:19FromDiscord<Zoom> What success? \:/
10:34:39FromDiscord<enthus1ast> the zoom application \:P
10:34:56FromDiscord<Phil> God dangit Zoom, stop making the setups for quips so easy, I was half way writing through one before I stopped myself!
10:35:08FromDiscord<odexine> In reply to @Zoom "What success? \:/": Oof.
10:36:27FromDiscord<enthus1ast> what do you think is the correct order of config\:↵↵config file -\> env vars -\> parameters?
10:37:11FromDiscord<enthus1ast> so env var overwrite settings in the config file, application parameters overwrite env vars and config files settings
10:37:45FromDiscord<Phil> Application parameters as in flags you start the application with?
10:37:50FromDiscord<enthus1ast> yes
10:39:05FromDiscord<Phil> parameters as highest priority most certainly↵Personally I'd give config file priority over env vars because I prefer them, but I think env vars are something you set more explicitly to signal something
10:39:50FromDiscord<enthus1ast> but then the thing is i could leave the config empty, but set secrets in the env, or even as parameters and not commit them to git
10:39:55FromDiscord<Phil> Just make sure that if you're giving envvars priority over configs, that those envvars being set specifically means that a value should be so and so
10:40:35FromDiscord<Phil> In reply to @enthus1ast "but then the thing": Absolutely an option, welcome to the reason I don't use envvars and put it all into config.json and secrets.json files
10:41:02FromDiscord<enthus1ast> mh how was the name of the convention "12 steps app" or something....
10:41:11FromDiscord<Phil> ?
10:41:27FromDiscord<enthus1ast> https://12factor.net/
10:41:47FromDiscord<enthus1ast> https://12factor.net/config
10:42:04FromDiscord<Phil> I can just say I don't like env vars because I like having an overview over things and explicit config-files/secrets files give me that.↵I only need to know that those 2 exist and where they exist.↵With envvars to get a list of all the values currently getting applied I have to comparatively do more work than staring at a JSON file
10:42:15FromDiscord<Phil> (edit) "staring at" => "opening" | "openinga ... JSONand" added "single" | "asingleJSON file ... " added "and staring"
10:44:14FromDiscord<enthus1ast> mh yeah i also like config files better, but the (second) link is sent has some valid points
10:44:45FromDiscord<enthus1ast> link i sent
10:46:13FromDiscord<enthus1ast> i started to use https://github.com/ba0f3/sim.nim for config files lately, its quite awesome. This for env vars would be an awesome addition
10:47:45FromDiscord<odexine> if you want to be pretty insane, there's this config language called dhall...
10:47:46FromDiscord<Phil> In reply to @enthus1ast "link i sent": Yeeees-ish.↵I find that checking in config files is the most valuable problem it solves.↵The entire "env vars scale better" I feel starts mattering for the 1% of companies actually deploying systems that large
10:49:20FromDiscord<odexine> In reply to @odexine "if you want to": phil would you like to spare some time to look at the semi-insanity
10:49:32FromDiscord<enthus1ast> dhall ..
10:49:46FromDiscord<odexine> hahaha
10:50:47FromDiscord<enthus1ast> nim for config files would be nice, and i did explored it a little, but its too complicated
10:51:11FromDiscord<Phil> In reply to @odexine "phil would you like": I'm near the end of my lunch break, this sounds like it would a) take longer and b) make me not like it for being complicated where things don'T need to be
10:51:19FromDiscord<Phil> (edit) "don'T" => "don't"
10:51:52FromDiscord<odexine> some other time then
10:52:19FromDiscord<Phil> I like it when I just need to get from A to B and get a simple train ticket to do that, I don't need to make it a vacation around the globe with a hundred different modes of transportation being involved
10:54:59FromDiscord<roupi.rb> In reply to @enthus1ast "nim for config files": it would require some fun metaprograming maybe
10:56:14PMunchenthus1ast, did someone say Nim for configuration?
10:56:16FromDiscord<Phil> I mean, the configs must be runtime loadable, so like... how?
10:56:27PMunchI've played around with ideas like this
10:56:33FromDiscord<roupi.rb> in ruby thats pretty common to use ruby to config things
10:56:44PMunch(haven't read your conversation, so not sure if this is entirely off-topic)
10:57:00FromDiscord<Phil> You'd need to turn the nim-file into a dynamically loadable library and load that at runtime in your application.↵Oooor load in a nimscript file and how that would work I can't even fathom
10:57:30FromDiscord<Phil> And all of that seems like too much effort for just needing a config file
10:58:19PMunchBasically my idea was to configure various programs on my machine through a common set of config files. The files themselves would be written in NimScript with some nice DSL. The benefit would be that you could share variables across configuration files, you could create different modes to launch programs different ways, and callbacks/scripts could be written in NimScript.
10:58:32FromDiscord<roupi.rb> runtime import
11:00:38FromDiscord<odexine> there's the problem of potentially untrusted "config" to be loaded
11:00:46FromDiscord<odexine> and ofc the halting problem
11:01:10FromDiscord<odexine> would you like your program to infinitely stall at your config...
11:02:58FromDiscord<roupi.rb> if you can debug where it is stalling
11:03:02FromDiscord<roupi.rb> i dont see the problem
11:03:52FromDiscord<Phil> In reply to @enthus1ast "https://12factor.net/config": Actually, there's also some solid counterpoints:↵https://security.stackexchange.com/questions/197784/is-it-unsafe-to-use-environmental-variables-for-secret-data
11:05:08FromDiscord<odexine> In reply to @roupi.rb "if you can debug": again, thats not what i mean; what if someone discovers an exploit and sends you config that stalls forever
11:06:04FromDiscord<odexine> i dont know why i said again, disregard that lol
11:09:25PMunchHmm, is there a Git tutorial that is structured as a Git repository?
11:09:57PMunchI.e. you just clone the repo, then read the README and learn more and more Git commands as you navigate the repo?
11:12:32FromDiscord<Phil> Never heard of such a thing
11:14:20PMunchI feel like it should be a thing..
11:14:30PMunchBut I haven't heard of it either
11:14:40FromDiscord<roupi.rb> there are some cool things you can do when you use a programming language as config file
11:15:43FromDiscord<enthus1ast> yeah nimscript
11:16:27FromDiscord<enthus1ast> but its a little fragile as you pointed out
11:17:03FromDiscord<roupi.rb> like running model updates in a migration like here: https://media.discordapp.net/attachments/371759389889003532/1139155445165072446/image.png
11:17:52FromDiscord<enthus1ast> is this ruby?
11:17:55FromDiscord<roupi.rb> yes
11:18:54FromDiscord<Chronos [She/Her]> In reply to @isofruit "You'd need to turn": Nimscripter for Nimscript configs, easy, no?
11:18:57FromDiscord<enthus1ast> after my nimscript config experiments i tried lua with nim, which is actually quite nice, but its not nim \:)
11:19:16FromDiscord<Phil> In reply to @chronos.vitaqua "Nimscripter for Nimscript configs,": I'd need to know nimscripter to know how that could ro could not work
11:19:33FromDiscord<Phil> (edit) "ro" => "or"
11:19:40FromDiscord<Chronos [She/Her]> Fair
11:19:47FromDiscord<Chronos [She/Her]> In reply to @enthus1ast "after my nimscript config": Yeah agreed
11:20:21FromDiscord<enthus1ast> i found it quite hard to use the compiler as a lib, i'm too stupid for this i guess
11:20:36FromDiscord<enthus1ast> or i do not know enough about nim internals
11:33:42FromDiscord<enthus1ast> if you're interested, this is what i've experimented with
11:33:53FromDiscord<enthus1ast> https://play.nim-lang.org/#ix=4D3z
11:36:18PMunchenthus1ast, have you seen NimScripter?
11:37:27FromDiscord<heysokam> What data format can I use to send a list of replacements to `multireplace( ..., replacements = MyVariable )` directly as a variable, and not as varargs? 🤔↵https://nim-lang.org/docs/strutils.html#multiReplace,string,varargs%5B%5D
11:37:29FromDiscord<enthus1ast> then the config itself looked like this
11:37:30FromDiscord<enthus1ast> https://play.nim-lang.org/#ix=4D3B
11:37:39FromDiscord<enthus1ast> with tousands of lines
11:38:28FromDiscord<enthus1ast> yes, i think this code predates nimscripter↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
11:39:36PMunchMy idea would be to pre-load a set of procedures and macros that would be implemented by the config loader. Then the config would be written in such a way that it calls on these procedures. So config loader would then simply load and run the script, and read out the state of the VM after the execution. Minimal futzing around with the compiler API, and maximum readability of how it actually works
11:40:30PMunchAppears to be similar to what you're doing there
11:40:33FromDiscord<enthus1ast> yes
11:41:41NimEventerNew Nimble package! fastpnm - fast PNM (.pbm .pgm .ppm) parser, see https://github.com/hamidb80/fastpnm
11:42:44FromDiscord<enthus1ast> yes this has 2 exposed procs that i use.↵↵addCommand (that adds a monitoring command)↵addCheck (that adds a check, for a monitoring system)
11:43:15FromDiscord<enthus1ast> have used, i diched the whole thing
11:43:33PMunchWhy did you ditch it?
11:44:19*xet7 joined #nim
11:44:44FromDiscord<enthus1ast> the main reason was that it was way to slow to compile
11:45:21FromDiscord<enthus1ast> and i was moving fast while experimenting
11:46:00PMunchI've been thinking of building a system like this for Linux DE-less setups. If you only use a WM with an assortment of helper programs you end up with a lot of configs. A lot of specifying the same fonts and colours everywhere, and making sure nothing uses the same keyboard shortcuts. Would be nice to have everything managed through a common tool.
11:46:11PMunchAh the whole NimScript embedded thing was slow?
11:46:34FromDiscord<enthus1ast> Compiling the compiler was quite slow yes
11:46:52FromDiscord<enthus1ast> it increased the compile time by maybe 2 - 3 times
11:47:02PMunchI know ElegantBeef is working on NimScripter as a dynamic library. That way you could compile NimScripter once, and then load the dynamic library. Should mean that the tool you build compiles much faster
11:47:50FromDiscord<enthus1ast> i thought he's full on the webasm trip
11:47:52FromDiscord<Phil> I mean configs as dynamic library is the only sensible thing, no?
11:48:02FromDiscord<Phil> Configs are supposed to be runtime changeable values, is my understanding of them at least
11:48:30FromDiscord<enthus1ast> yeah the config is in plain text and is interpreted by the nimvm
11:48:32PMunchOh I'm talking about having the NimScript evaluation engine as a dynamic library. Config would still be scripts
11:48:33FromDiscord<Phil> Thus my assumption that for that to work with any kind of nim-format it'd have to be either with a nim-vm executing some nim-code or the like, or a DLL
11:49:03PMunchYeah this is using the Nim VM as a DLL, and that loads NimScript files
11:49:18FromDiscord<Phil> That sounds like a wild thing to do
11:49:19FromDiscord<enthus1ast> maybe i could just compile the code above as a dll and
11:49:24PMunchOf course you could compile Nim modules and execute them to get your configs as well
11:49:31FromDiscord<jmgomez> Yes, that does work. I do that for NimForUE
11:49:55FromDiscord<Phil> I think nim files as DLL-config files and providing tooling to make that as simple as possible seems like an easier approach
11:50:34PMunchWell, then everyone who wants to configure anything would need to have the Nim compiler installed
11:50:47FromDiscord<Phil> Fair
11:50:57PMunchWith NimScript there would only be the NimScripter DLL shipped with your program.
11:51:06PMunchWell, and the standard library I guess..
11:51:33FromDiscord<Phil> Entire std lib? Wouldn't it have to be the subset that works with nimscript?
11:51:42PMunchSure
11:51:57PMunchBut it's easier to just ship the entire thing
11:52:18PMunchI wrote about it here: https://peterme.net/creating-condensed-shared-libraries-embedding-nimscript-pt-3.html
11:52:29FromDiscord<Chronos [She/Her]> How would I support the `stint` library without declaring it as an explicit dependency...
11:52:49FromDiscord<Chronos [She/Her]> Like, if it's used, it is supported, but also works on the normal int data types
11:53:19FromDiscord<Phil> Are the types in stint distinctly different from int?
11:53:48FromDiscord<Phil> as in, would they be accepting into a proc such as `proc a(x: int) = echo "bla"`?
11:53:55FromDiscord<Phil> (edit) "accepting" => "accepted"
11:54:08FromDiscord<enthus1ast> you could overload like↵↵proc a(x\: int \| stintInt)
11:54:24FromDiscord<Phil> In reply to @enthus1ast "you could overload like": That would require having the dependency to have the types
11:54:35FromDiscord<enthus1ast> yes true
11:54:41FromDiscord<enthus1ast> concept?
11:54:42PMunchGenerics I guess
11:54:43FromDiscord<Phil> The only way to get around that in particular is to swap to concepts
11:54:44PMunchOr concepts
11:54:59FromDiscord<Phil> generics with concepts basically
11:55:10PMunchWell generics by themselves would work, but you'd have to keep them open to anything
11:55:23FromDiscord<Phil> Yeah fair
11:57:55FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1139165726964461638/442.PNG
11:57:57FromDiscord<.maverk> why not compiling ?
11:59:12PMunch.maverk, you appear to not have GCC installed
11:59:20PMunchDid you run `finish.exe` after installing?
11:59:40FromDiscord<Phil> What's the name of whatever compiler windows uses by default and could that be substituted in by default?
11:59:50FromDiscord<Phil> That would teach a valuable lesson in compiler flags!
11:59:51PMunchvcc?
11:59:57FromDiscord<leetnewb> mingw?
12:00:04FromDiscord<.maverk> yes gcc is not installed
12:00:08FromDiscord<.maverk> should be installed ?
12:00:50PMunchYes, Nim requires a C compiler as it compiles via C. You could use other C compilers than GCC, but it is the default and probably the easiest to set up
12:00:53FromDiscord<Phil> It can be installed.↵For compilation it might be easiest to think that it goes:↵Nim --> Intermediate Representation --> C --> Binary↵For the C --> Binary step you can use gcc or a ton of other C compilers such as mingw etc.
12:02:14FromDiscord<.maverk> it is easy to install
12:02:21FromDiscord<.maverk> i will install it then
12:04:21FromDiscord<Phil> --cc:mingw ?
12:04:30FromDiscord<.maverk> pacman -S mingw-w64-ucrt-x86_64-gcc
12:04:37FromDiscord<.maverk> through msys
12:04:43FromDiscord<Phil> Or what would the flag be?
12:04:56FromDiscord<.maverk> pacman -S --needed base-devel mingw-w64-x86_64-toolchain
12:04:58FromDiscord<.maverk> this
12:05:22FromDiscord<Phil> The fact you have a program called pacman confuses the hell out of me given that I'm on Arch where that's the package manager
12:05:35FromDiscord<.maverk> In reply to @isofruit "The fact you have": hhhhhhh
12:05:38FromDiscord<Phil> Wait a sec, that is a pacman install command
12:05:46FromDiscord<.maverk> yeah
12:06:12FromDiscord<Phil> Are you running the Linux vm on windows thing?
12:06:37FromDiscord<.maverk> no i am on windows
12:06:59FromDiscord<Phil> 🤷 to each their own setup then
12:07:32FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1139168151049879562/3.PNG
12:07:43FromDiscord<heysokam> In reply to @isofruit "The fact you have": mingw has pacman
12:07:44FromDiscord<.maverk> it is installing
12:07:52FromDiscord<heysokam> as its default package manager
12:08:00FromDiscord<.maverk> yeah exactly
12:08:16FromDiscord<.maverk> i can share the docs if you guys want
12:08:22FromDiscord<.maverk> 😇
12:08:55FromDiscord<Phil> No need, I'm staying as far away from windows as physically possible
12:09:17FromDiscord<.maverk> hhhhh
12:09:34FromDiscord<odexine> What in the fuck
12:09:37FromDiscord<Phil> I have like 3 computers and 3 different Linux distros on them, I'm good
12:09:38FromDiscord<heysokam> @.maverk next time just install mingw with chocolatey or some similar package manager for windows. its a lot easier↵never installed Nim on windows without having mingw before it, but I assumed that Nim installs it by default 🤔
12:09:43FromDiscord<.maverk> i use windows for developing software
12:09:44FromDiscord<odexine> Windows is cursed…
12:10:13FromDiscord<.maverk> In reply to @heysokam "<@1021771961040375900> next time just": i used to use msys
12:10:20FromDiscord<.maverk> i used c for many years
12:10:21FromDiscord<enthus1ast> idk if msys binaries are on the path
12:10:26FromDiscord<heysokam> ah kk, then all good
12:10:51FromDiscord<enthus1ast> could be that you must add them
12:10:52FromDiscord<leetnewb> pretty sure choosenim installs mingw
12:12:14NimEventerNew thread by SmutnyNosacz: Type class that is "anything but X", see https://forum.nim-lang.org/t/10393
12:16:18FromDiscord<enthus1ast> but mingw is quite old
12:16:31FromDiscord<enthus1ast> its perfectly valid to get a recent gcc via msys
12:17:32FromDiscord<heysokam> sent a long message, see http://ix.io/4D3P
12:17:44PMunchI thought Nim shipped a compiler with it?
12:17:54PMunchOr that `finish.exe` grabbed one from somewhere
12:19:00PMunchYeah, finish.exe downloads and installs mingw and sets it up to work with Nim: https://github.com/nim-lang/Nim/blob/devel/tools/finish.nim#L9
12:19:26FromDiscord<enthus1ast> @heysokam\: re , nre , nitely/nim-regex
12:19:47FromDiscord<enthus1ast> maybe glob
12:20:01PMunchEven the install instructions under the big yellow download button says this: The installation using the provided zip files should be fairly straightforward. Simply extract the files into the desired installation directory, and run finish.exe.
12:20:17PMunch.maverk ^
12:20:31FromDiscord<.maverk> what else missing ? https://media.discordapp.net/attachments/371759389889003532/1139171415250182184/rr.PNG
12:20:57PMunchPlease just follow the install instructions..
12:20:57FromDiscord<heysokam> In reply to @enthus1ast "<@186489007247589376>\: re , nre": oh, I totally missed this one↵https://nim-lang.org/docs/re.html#multiReplace%2Cstring%2CopenArray%5Btuple%5BRegex%2Cstring%5D%5D
12:21:40FromDiscord<enthus1ast> i usually try to avoid regex to solve problems
12:21:40PMunchOr even better, just do it through `choosenim`: https://github.com/dom96/choosenim#installation
12:22:07FromDiscord<enthus1ast> just gives me more problems \:)
12:23:45FromDiscord<.maverk> In reply to @PMunch "Or even better, just": hmmm can i trust it ? is it from nim officially ?
12:23:54FromDiscord<enthus1ast> i use it
12:24:00FromDiscord<enthus1ast> it works good so far
12:24:27FromDiscord<enthus1ast> dom96 is well know in the nim community
12:24:29FromDiscord<leetnewb> might play whack-a-mole with windows defender trying to get it to go right
12:25:28FromDiscord<heysokam> In reply to @enthus1ast "i usually try to": if you have any ideas, im all ears
12:25:44FromDiscord<enthus1ast> idk what you wanna do
12:25:47FromDiscord<heysokam> I just have no single clue how to replace a prefix with another prefix without touching the rest
12:26:31FromDiscord<heysokam> In reply to @enthus1ast "idk what you wanna": Replacing `SomePrefix.` with `OtherPrefix.` where `.` would be regex for any amount of individual characters
12:26:46FromDiscord<heysokam> I need it to match a pattern, because the letter after needs to remain untouched
12:27:14FromDiscord<heysokam> But I have no clue how to do anything with it, not even with regex, because I don't know how to get the character after and not change it
12:27:49FromDiscord<Chronos [She/Her]> In reply to @isofruit "as in, would they": Don't think so
12:28:14FromDiscord<heysokam> `SomePrefixWord` should change to `OtherPrefixWord`, and `SomePrefixOther` should change to `OtherPrefixOther`.... so the `W` and `O` need to not be touched, but they must be matched because `SomePrefix` shouldn't be changed
12:28:27FromDiscord<Chronos [She/Her]> In reply to @PMunch "Well generics by themselves": Fair, oh well... Ig I could probably could make a define switch for it maybe?
12:28:31FromDiscord<Chronos [She/Her]> Actually no
12:28:34FromDiscord<heysokam> (edit) "`SomePrefixWord` should change to `OtherPrefixWord`, and `SomePrefixOther` should change to `OtherPrefixOther`.... so the `W` and `O` need to not be touched, but they must be matched because `SomePrefix` ... shouldn't" added "without characters after"
12:28:36FromDiscord<Chronos [She/Her]> Because nimble would throw a fit
12:28:40FromDiscord<Chronos [She/Her]> Sigh
12:29:01FromDiscord<heysokam> (edit) "it" => "it↵`SomePrefixWord` should change to `OtherPrefixWord`, and `SomePrefixOther` should change to `OtherPrefixOther`.... so the `W` and `O` need to not be touched, but they must be matched because `SomePrefix` without characters after shouldn't be changed"
12:30:03PMunch.maverk, it is listed at the bottom of the install page, not sure how much more official you want it
12:30:33FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/qBQVD
12:31:18FromDiscord<enthus1ast> or another api, that returns bool on change and accepts a var str idk what fits your needs
12:32:13FromDiscord<enthus1ast> or maybe i do not understand, it seems more complicated?
12:34:17FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4D3V
12:34:45FromDiscord<heysokam> i would have no issues if they were individual strings, like you mentioned with `startsWith`
12:35:00FromDiscord<enthus1ast> is the file seperated by newline?
12:35:17FromDiscord<heysokam> yeah, but the matches are not at the start of the line necessarily
12:35:33FromDiscord<heysokam> as in probably most likely wont be in like 50-60% of the cases or more
12:35:36FromDiscord<enthus1ast> then march through the line
12:46:32*xet7 quit (Remote host closed the connection)
12:53:35FromDiscord<enthus1ast> @heysokam\: this maybe? https://play.nim-lang.org/#ix=4D42
12:53:42FromDiscord<enthus1ast> oh bugs
12:54:31FromDiscord<enthus1ast> https://play.nim-lang.org/#ix=4D43
12:57:22FromDiscord<heysokam> seems overly complicated, but yeah something like that, and being able to access the resulting renamed to be able to `nimIdent` it to normalize it to camelCase
12:57:44FromDiscord<enthus1ast> > overly complicated↵> maybe
12:57:46FromDiscord<heysokam> that's the whole reason for the problem, basically
12:58:56FromDiscord<heysokam> Ideally I would want `Prefix([A-Z][a-zA-Z])` so that I can then `normalize( $1 )`
12:59:09FromDiscord<heysokam> (edit) "`Prefix([A-Z][a-zA-Z])`" => "to match `SomePrefix([A-Z][a-zA-Z])`"
12:59:44FromDiscord<heysokam> I guess I could use your method and pattern match every word or something 🤔↵slow, but might work
13:00:35FromDiscord<enthus1ast> i mean, you're not me, if you like regex then use it \:)
13:00:51FromDiscord<heysokam> i don't like it, i just want to do the thing in whatever way its doable, that's all
13:00:58FromDiscord<heysokam> (edit) "i don't like ... it," added "it and I don't dislike"
13:02:34FromDiscord<odysseus> Hello, can I ask a question (using a simple example implementing the Collatz conjecture) regarding the use of procedures?
13:02:35FromDiscord<enthus1ast> i think the reason it might be slow is that it scans the string multipe times
13:04:10FromDiscord<odysseus> sent a long message, see http://ix.io/4D47
13:04:41FromDiscord<enthus1ast> odysseus\: i think the identation is messed up
13:04:47FromDiscord<odysseus> (Assume that the idnentation is correct \:-) )
13:05:24FromDiscord<enthus1ast> wrap the code in triple \`
13:08:38FromDiscord<enthus1ast> in the last one
13:08:39FromDiscord<enthus1ast> the 7 is a literal and not a var
13:08:39FromDiscord<odysseus> yes, why?
13:08:40FromDiscord<enthus1ast> var foo = 7↵echo FindCollatzSeq(foo)
13:08:41FromDiscord<odysseus> so?
13:08:41FromDiscord<odysseus> Can I fix it?
13:08:41FromDiscord<enthus1ast> so this matches at least the proc definition
13:08:42FromDiscord<odysseus> because I find it stupid to use two vars
13:09:07FromDiscord<odysseus> Can I use the second way without the literal?
13:09:18FromDiscord<enthus1ast> `proc FindCollatzSeq(inside: VAR int): seq[int] =`says, `inside` must be a var
13:09:27FromDiscord<enthus1ast> but 7 is a literal
13:09:30FromDiscord<enthus1ast> and no var
13:09:42FromDiscord<odysseus> so how can I convert it?
13:09:57FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D4a
13:10:28FromDiscord<odysseus> Still... it tried!
13:11:12FromDiscord<odysseus> No sorry...is OK
13:11:20FromDiscord<odysseus> Thank you very much!
13:11:24FromDiscord<enthus1ast> np
13:11:56FromDiscord<enthus1ast> btw
13:12:01FromDiscord<enthus1ast> you can use the results variable
13:12:05FromDiscord<enthus1ast> result
13:12:18*rockcavera joined #nim
13:12:46FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D4b
13:13:06FromDiscord<enthus1ast> then you can also omit the return Collatz\_sequence sice its implicit
13:14:29FromDiscord<odysseus> I know that I can omit return...ditto for seq[int] (i.e., the type, as in var x = 7 instead of var x \: int = 7) but I am a newcomer so I want to keep things typical
13:14:41FromDiscord<enthus1ast> in nim its typical to use the result var
13:14:47PMunchIf you just want it on one line you can always do: https://play.nim-lang.org/#ix=4D4d
13:16:40FromDiscord<odysseus> sorry, I re-read it...and confused...did you mean something like\:
13:16:59FromDiscord<odysseus> sent a code paste, see https://paste.rs/FqA1G
13:17:02FromDiscord<enthus1ast> no need for `return result`
13:17:07FromDiscord<heysokam> @odysseus when you use `return Variable` you are basically copying the variable into the `result = ` variable... so ideally you would just use `result = yourLogicHere` to apply directly
13:17:10FromDiscord<enthus1ast> it is implicitly returned
13:18:38FromDiscord<odysseus> Could you please, modify my example and pass it in here, because I do not get?
13:18:57FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D4f
13:19:54FromDiscord<odysseus> Thank you very much
13:21:22FromDiscord<enthus1ast> i would also name it findCollatzSeq, by convention procs in nim start with a small letter
13:21:38PMunchHmm, anyone know how to make gdb ignore #line directives and show me the underlying C code?
13:21:50PMunchI have a suspicion that it is lying to me..
13:21:56FromDiscord<odysseus> thanks ... I am trying to diggest the new version ;-)
13:23:28PMunch`while inside >= 1: if inside == 1: break`, uhm, couldn't you just say `while inside > 1`?
13:24:49FromDiscord<enthus1ast> `result` is automatically declared as the return type you specified, and when your proc/func/method ends it is returned automatically
13:25:49FromDiscord<odysseus> regardless of the return type (int, float, seq, tuple, etc) ? Nice! Thank you... it is my 3rd day in Nim
13:25:57FromDiscord<odexine> In reply to @odysseus "regardless of the return": yes regardless
13:26:44FromDiscord<odysseus> Thank you↵(@odexine)
13:26:48FromDiscord<enthus1ast> odysseus\: i hope you like it, Nim is a wonderful lang \:)
13:27:21FromDiscord<odysseus> Well, essentially, it is my first language in general (barring Wolfram)
13:28:07FromDiscord<enthus1ast> not the worst to start with imho, if you get used to some concepts of nim you'll miss them in other langs
13:28:59FromDiscord<odysseus> I have some Scheme in the past... weird... especially the recursive procedures...and computationally expensive
13:29:33FromDiscord<odysseus> But yes, so far nice...
13:29:50FromDiscord<odysseus> Thank you again my friends!
13:30:14FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/QryDA
13:30:27FromDiscord<enthus1ast> all of them are valid
13:30:44FromDiscord<odysseus> I prefer the 1st way though...more functional (in the mathematical sense)
13:32:13PMunchHmm, there is --lineDir:off. But that doesn't help me debug the crash I have now
13:32:25PMunchBasically my script crashes every now and again
13:32:35PMunchCan go days between a crash
13:33:08FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D4k
13:33:11PMunchBut it always happens in the same place, and GDB claims that it is in popCurrentException, but the line numbers doesn't match up..
13:42:36FromDiscord<enthus1ast> Do you use threads or dlls?
13:45:04PMunchWho me?
13:55:19PMunchI have --threads:off and don't explicitly load any dynamic libraries
13:55:28PMunchNot sure if any of my dependencies does though..
14:10:37FromDiscord<Phil> In reply to @odysseus "I prefer the 1st": The nice thing is you can use them depending on what you want to express
14:11:07FromDiscord<Phil> Object call syntax if you want to express "This proc does something and this object/first parameter is the main protagonist of this proc/something is done to this parameter)"
14:11:23FromDiscord<Phil> (edit) "Object call" => "`x.method(y)`"
14:11:45FromDiscord<Phil> `bla(x, y)` if there is no real protagonist/the parameters need to be mixed together anyhow
14:12:03FromDiscord<Phil> You can express based on your mental model and apply emphasis using this, I really like it
14:12:23FromDiscord<Phil> (edit) "apply emphasis" => "can emphasize the first parameter if it's important"
14:12:54*ntat joined #nim
14:17:49FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D4u
14:17:55FromDiscord<enthus1ast> syntax
14:18:08FromDiscord<enthus1ast> nice for barriers or cleaning up etc.
14:26:00FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D4x
14:42:14FromDiscord<acomab> no wonder my computer has been running hot all day... https://media.discordapp.net/attachments/371759389889003532/1139207079333212221/image.png
14:42:26FromDiscord<acomab> i think this is a bug with the vim vscode extension, not sure
14:43:29*jmdaemon joined #nim
14:46:16FromDiscord<djazz> How does nimsuggest work btw?
14:46:42FromDiscord<djazz> Also noticed the high cpu load
14:46:59FromDiscord<jmgomez> In reply to @acomab "no wonder my computer": it opens more than needed but it also seems in mac it doenst close them. The later is a bug, the first it may be an intended "feature"
14:47:17FromDiscord<jmgomez> (edit) "In reply to @acomab "no wonder my computer": it opens more than needed but it also seems in mac it doenst close ... them." added "all of"
14:47:31FromDiscord<jmgomez> (edit) "first it" => "formerit"
14:49:04FromDiscord<bung8954> the high cpu usage is wrong, try use devel
14:49:33FromDiscord<enthus1ast> any idea how would i specify a branch in nimble install with a url?↵↵i want the v1.3 branch of https://github.com/tandy-1000/matrix-nim-sdk
14:49:35FromDiscord<leorize> nimsuggest eating cpu is a known issue
14:49:56FromDiscord<leorize> `@#v1.3` suffix
14:50:08FromDiscord<Phil> One that'll require major work from what I'm aware of
14:50:11FromDiscord<leorize> drop the `@`, only `#`
14:52:27FromDiscord<enthus1ast> but now ...
14:52:28FromDiscord<enthus1ast> hu strange i tried it and failed
14:52:28FromDiscord<leorize> commits are always safer
14:52:28FromDiscord<leorize> I'm not gonna recommend doing it like that, since nimble can be very finicky with how it interpret branches
14:52:29FromDiscord<leorize> (though with lockfiles it might have become less of an issue)
14:52:29FromDiscord<enthus1ast> strange now it work
14:52:29FromDiscord<enthus1ast> weird
14:52:31FromDiscord<enthus1ast> thank you
14:59:22*jmdaemon quit (Ping timeout: 252 seconds)
15:02:16*LuxuryMode quit (Quit: Connection closed for inactivity)
15:09:18*jmd_ joined #nim
15:10:54*azimut joined #nim
15:21:57*jmd_ quit (Ping timeout: 260 seconds)
15:48:26FromDiscord<arathanis> i was hoping atlas was going to be part of the toolchain for nim 2.0
15:48:43FromDiscord<arathanis> is the correct way to use atlas just to clone it, compile it, and add it to my path?
15:48:54FromDiscord<arathanis> or did i miss a step somewhere?
15:57:24FromDiscord<leetnewb> I found that using choosenim had path issues out of the box with atlas
15:57:52FromDiscord<leetnewb> binary was there, so I dropped a symlink where it needed to be
16:01:37FromDiscord<roupi.rb> how do i run a proc in as a child process ?
16:02:20FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D51
16:02:29*lucasta joined #nim
16:03:29FromDiscord<arathanis> In reply to @leetnewb "binary was there, so": oh the binary is present its just hooking it up right?
16:03:52FromDiscord<arathanis> where should i look for the binary?
16:05:44FromDiscord<leetnewb> How did you install nim? and what operating system?
16:06:46FromDiscord<odexine> In reply to @isofruit "Hmmm can I "spread": no
16:07:06FromDiscord<odexine> maybe you can write a curry/uncurry proc
16:07:22FromDiscord<odexine> i guess it would be named differently in nim tho
16:07:31FromDiscord<odexine> prolly tuplise/detuplise or whatever
16:07:34FromDiscord<leetnewb> it's present for me in ~/.choosenim/toolchains/nim-2.0.0/bin/
16:09:00FromDiscord<roupi.rb> wait i cant use async on a new thread ?
16:09:31FromDiscord<roupi.rb> https://media.discordapp.net/attachments/371759389889003532/1139229044991332442/image.png https://media.discordapp.net/attachments/371759389889003532/1139229045263958108/image.png
16:09:47FromDiscord<roupi.rb> https://media.discordapp.net/attachments/371759389889003532/1139229115216580669/image.png
16:10:10FromDiscord<Chronos [She/Her]> In reply to @odexine "maybe you can write": Pack and unpack
16:10:36FromDiscord<Chronos [She/Her]> Or `` which Python does for unpacking
16:10:51FromDiscord<Chronos [She/Her]> In reply to @isofruit "Hmmm can I "spread": Oh there's a macro for this too
16:10:59FromDiscord<Chronos [She/Her]> `unpackVarargs` iirc in std/macros
16:18:52FromDiscord<litlighilit> sent a long message, see http://ix.io/4D57
16:23:09FromDiscord<bostonboston> How do I access compiler switches in my code
16:24:12FromDiscord<litlighilit> ?You mean \`compileOption\`
16:24:46FromDiscord<bostonboston> I think what I was looking for is `defined(x)`
16:24:46FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D59
16:24:54FromDiscord<arathanis> In reply to @bostonboston "I think what I": ohhhh
16:26:58FromDiscord<odexine> In reply to @roupi.rb "": you can, you need to initialise an event loop per thread IIRC
16:27:07FromDiscord<Phil> In reply to @litlighilit "Firstly \`unpackVarargs\` is surely": I think the biggest option I'd like the tuple unpacking to work with args of completely different types
16:27:08FromDiscord<odexine> or smth, i dont use threading with async
16:27:59FromDiscord<Phil> Basically I'd like to do parameterized tests and each of the parameters is a value in a tuple.↵Then I just pass a tuple into the test-proc each time and I'm settled rather than having to go `tup[0], tup[1], tup[2]...`
16:28:15FromDiscord<Phil> (edit) "Basically I'd like to do parameterized tests and each of the parameters is a value in a tuple.↵Then I just ... pass" added "iterate over a seq of tuples and"
16:28:28FromDiscord<Phil> (edit) "`tup[0]," => "`testProc(tup[0]," | "tup[2]...`" => "tup[2]...)`"
16:28:42FromDiscord<Phil> I'll try unpackVarargs in a sec
16:30:43FromDiscord<litlighilit> If it can be done in compile-time, you can use \`macro x(v\: vararg[typed])\`, which, however, makes it more complex. ↵↵unpackVararg is handy
16:31:17FromDiscord<System64 ~ Flandre Scarlet> Do you know how I can add an item to a table please? https://media.discordapp.net/attachments/371759389889003532/1139234527416430742/image.png
16:31:34FromDiscord<Phil> In reply to @litlighilit "If it can be": Sidenote, welcome to the server (?), I think this is the first time we've seen each other ^^
16:32:30FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D5d
16:32:32FromDiscord<Phil> WIth the easiest syntax available 😄
16:32:48FromDiscord<System64 ~ Flandre Scarlet> Oh alright, thanks!↵So I can query by Vector too?
16:33:06FromDiscord<Phil> Pretty much
16:33:20FromDiscord<Phil> One sec, I assume the vectors are value types?
16:33:24FromDiscord<System64 ~ Flandre Scarlet> yeah
16:33:31FromDiscord<System64 ~ Flandre Scarlet> they are not ref
16:33:41FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1139235127747153930/image.png
16:33:48FromDiscord<Phil> Okay, because I have no clue whether the table checks for reference equality or for value equality when you use one as a key
16:34:00FromDiscord<Phil> (edit) "one" => "a ref-type"
16:34:10FromDiscord<Phil> I have the sneaking suspicion it might be reference equality
16:34:36FromDiscord<System64 ~ Flandre Scarlet> for non-ref, should be value equality
16:34:50FromDiscord<Phil> I mean, must be because the stack ain't got nothing else ^^
16:36:43FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D5f
16:37:06FromDiscord<Phil> It can deal with pointers though
16:39:04FromDiscord<sirolaf> sent a code paste, see https://play.nim-lang.org/#ix=4D5g
16:40:41FromDiscord<odexine> nim requires the key on tables to be hashable aka have the hash proc defined
16:41:07FromDiscord<odexine> either in hashes (no need to import) or before usage (so defined above or in an import)
16:41:12FromDiscord<odexine> (edit) "hashes" => "std/hashes"
16:41:49FromDiscord<litlighilit> Just overload \`hash\`
16:42:36FromDiscord<odexine> yeah, more clearly put
16:48:28FromDiscord<Chronos [She/Her]> In reply to @litlighilit "Firstly \`unpackVarargs\` is surely": Phil seemed to want to be able to spread a tuple into a functions args which is why i suggested unpackVarargs
16:50:39FromDiscord<litlighilit> Yeah, Emm... I mean I agree
16:53:06FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/fji0U
16:53:19*lucasta quit (Quit: Leaving)
17:03:50FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=4D5v
17:04:25FromDiscord<arathanis> ahh your current namespace does not have the pairs iterator for tables in it
17:04:43FromDiscord<arathanis> should flatty use `exports` for this?
17:04:54FromDiscord<treeform> not if you never need a table?
17:05:01FromDiscord<arathanis> fair
17:05:04FromDiscord<Matt> Could someone help me see why this code doesn't compile? https://play.nim-lang.org/#ix=4D5w
17:05:06FromDiscord<arathanis> but also a weird footgun
17:05:10FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "Thats a table error.": Oh alright! thanks!↵The error message is confusing
17:05:33FromDiscord<Matt> Looking to iterate over a variable of iterators, this is some dummy code that only echoes rather than doing the actual logic I plan on implementing
17:05:45FromDiscord<treeform> I wish nim will fix this. There is an RFC for this.
17:06:14FromDiscord<arathanis> In reply to @x.hat "Could someone help me": `items` is an iterator and i dont think you can use it in that context
17:06:48FromDiscord<Matt> So how could I pass in some amount of iterators to test my function?
17:07:08FromDiscord<Matt> In another language my function would expect something like an Iterable trait/interface etc
17:08:58FromDiscord<arathanis> In reply to @x.hat "So how could I": probably pass around the sequences themselves, try using "openArray".
17:09:06FromDiscord<System64 ~ Flandre Scarlet> and is it possible to iterate through a Table so I can get the Key AND the Value?
17:09:44*qwr joined #nim
17:09:46FromDiscord<System64 ~ Flandre Scarlet> Oh, this works https://media.discordapp.net/attachments/371759389889003532/1139244211623964841/image.png
17:09:57FromDiscord<Matt> @arathanis could you help me understand when we prefer to use seq/openarray/array?
17:10:09FromDiscord<Matt> So that I can understand why you suggested doing so
17:10:21FromDiscord<arathanis> In reply to @x.hat "<@136570191038513152> could you help": looks like `openArray` isnt happy being in varargs.
17:10:33qwropenarray is nice for arguments, if you don't need to be more specific for some reason
17:10:33FromDiscord<arathanis> the reason we like `openArray` is it makes the proc more usable since it supports many types.
17:10:43FromDiscord<arathanis> openArray parameters can use arrays, sequences, etc
17:12:09FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D5z
17:12:21FromDiscord<arathanis> (edit) "https://play.nim-lang.org/#ix=4D5z" => "https://play.nim-lang.org/#ix=4D5A"
17:12:28qwrseq has variable length, for array its part of type
17:13:59FromDiscord<Matt> So would that be preferable (using a vararg of seq to indicate that something is iterable + using openArrays / sequences everywhere)?
17:14:11FromDiscord<Matt> For context- the function I am trying to write
17:14:27FromDiscord<Matt> is something that takes a sequence of some arrays / sequences / iterables and then merges them all together
17:14:34FromDiscord<arathanis> varargs doesnt seem to support `openArray`
17:15:08FromDiscord<Matt> so seq then^
17:15:12FromDiscord<arathanis> In reply to @x.hat "is something that takes": or array
17:15:18FromDiscord<arathanis> you may write more than one function for multiple types
17:15:24FromDiscord<Matt> would require them of being const size / known size then, no?
17:15:31FromDiscord<arathanis> you can do both
17:15:36FromDiscord<arathanis> to support both
17:15:41FromDiscord<Matt> That would work for me
17:15:45FromDiscord<Matt> Is that idiomatic?
17:15:45FromDiscord<arathanis> but yes, seq sounds like what you want
17:15:57FromDiscord<arathanis> In reply to @x.hat "Is that idiomatic?": overloading a function based on the type is idiomatic, yes
17:16:04FromDiscord<Matt> I could keep it a fixed size- would a seqwcap be considered the way to go, or arrays
17:16:08FromDiscord<arathanis> or using a generic if it makes sense
17:16:09FromDiscord<Matt> If you have a strong sense
17:16:12FromDiscord<arathanis> write it first for seq
17:16:17FromDiscord<arathanis> then you can decide if you need anything else
17:16:17FromDiscord<Matt> 👍
17:16:23FromDiscord<arathanis> what is this function of yours going to do?
17:16:58FromDiscord<Matt> Read each iterable side-by-side, look at the first key on each file, copy the lowest key, and repeat. Discards equals keys., then produces a new merged iterable, also sorted by key.
17:17:49FromDiscord<arathanis> i think an (input, output) pair would help understand
17:18:58FromDiscord<System64 ~ Flandre Scarlet> Why do I have a mismatch here? I can't assign a value?↵the Table is [VectorI64, bool] https://media.discordapp.net/attachments/371759389889003532/1139246522056327168/image.png
17:19:12FromDiscord<Matt> In reply to @arathanis "i think an (input,": Sure. I am practicing my Nim by working on a (not literal) rewrite of this small python project: https://github.dev/fgmacedo/soonerdb/tree/main/soonerdb
17:19:28FromDiscord<Matt> It's a very basic key-value lsm tree
17:19:52FromDiscord<odexine> In reply to @sys64 "Why do I have": first param not var
17:19:59*qwr . o O ( https://github.com/golang/go/wiki/LoopvarExperiment )
17:20:47FromDiscord<arathanis> In reply to @qwr ". o O (": why does everyone want to clone C's character vomit in their languages
17:21:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "first param not var": Even if I set to var, I have problems
17:21:36FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1139247187973382235/image.png
17:21:52FromDiscord<arathanis> guys I have a great idea. Let's use `{}` to denote blocks of code, so we don't have to rely on whitespace!↵then, and this is the genius part, we will make every reasonable coding style make it so white space might as well be significant!
17:22:05FromDiscord<odexine> are you totally sure stdtables is imported
17:22:08FromDiscord<odexine> (edit) "stdtables" => "std/tables"
17:22:44FromDiscord<System64 ~ Flandre Scarlet> Oh forgot to import that again 🤣
17:22:53FromDiscord<odexine> 💀
17:25:12FromDiscord<Matt> In reply to @arathanis "i think an (input,": i.e. here's the Python equivalent signature: def merge_iterables(iterables: Iterable[Tuple[str, str]]):
17:25:36FromDiscord<arathanis> In reply to @x.hat "i.e. here's the Python": yes, i knew what language you were referring too haha
17:25:38FromDiscord<arathanis> nim is not python
17:25:40FromDiscord<Matt> All g
17:26:04FromDiscord<Matt> I mean that I am not trying to make it a literal clone, but a practice in idiomatic rewriting
17:26:07FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "nim is not python": Nim is not Python↵But Nim is better than Python!
17:26:15FromDiscord<arathanis> In reply to @sys64 "Nim is not Python": i dont agree with this
17:26:18FromDiscord<Matt> Eh- they have their tradeoffs
17:26:27FromDiscord<Matt> But before this goes downhill
17:26:29FromDiscord<arathanis> https://media.discordapp.net/attachments/371759389889003532/1139248418536042536/image.png
17:26:31FromDiscord<arathanis> bahahaha
17:26:33FromDiscord<Phil> In reply to @arathanis "guys I have a": This is the man that will state "Well, we can't know when a line ends"
17:26:44FromDiscord<Matt> Does that help answer the question regarding what function I am looking to implement?
17:26:48FromDiscord<arathanis> i use them for different things
17:26:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "i dont agree with": why?↵Well, if it's about number of libraries, Python > Nim yeah
17:26:53FromDiscord<arathanis> In reply to @x.hat "Does that help answer": implement against `seq`
17:27:10FromDiscord<System64 ~ Flandre Scarlet> but Nim is much more efficient than Python
17:27:13FromDiscord<arathanis> In reply to @sys64 "why? Well, if it's": different strengths and weaknesses.
17:27:22FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=4D5D
17:27:31FromDiscord<arathanis> In reply to @sys64 "but Nim is much": depends on what kind of efficiency we are talking about.↵↵i often use them together
17:27:34FromDiscord<Matt> In reply to @odexine "nim iterators are by": I've seen that before! https://github.com/def-/nim-iterutils/commit/63d2891e5d9964c0949cec197fad8df2e7041189
17:27:44FromDiscord<odexine> yesa
17:27:44FromDiscord<odexine> yes
17:27:47FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "different strengths and weaknesses.": what are pros and cons of each? Beside of speed obviously because this is obvious
17:27:50FromDiscord<odexine> thats prolly what you want to use yes
17:27:52FromDiscord<Matt> In reply to @arathanis "depends on what kind": I would be interesting in hearing more about your interop actually
17:28:02FromDiscord<Matt> Interested
17:28:17FromDiscord<arathanis> In reply to @sys64 "what are pros and": just off the top of my head:↵↵Python's↵- community
17:28:32FromDiscord<Phil> In reply to @sys64 "what are pros and": There are some things where python is just significantly easier because python does them at runtime and doesn't give a shit about your types half the time
17:28:33FromDiscord<Matt> 👁️ where it go 👁️
17:28:53FromDiscord<Matt> In reply to @isofruit "There are some things": Can you expand on that
17:28:54FromDiscord<Phil> Particularly a lot of dynamic stuff in nim where you have to bust out compile-time logic to get around the static type system
17:28:58FromDiscord<Matt> As in where it;s useful
17:29:06FromDiscord<arathanis> sent a long message, see http://ix.io/4D5F
17:29:09FromDiscord<Matt> something you were implementing where that tradeoff is emphasized
17:29:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "There are some things": Imo having a strict types system prevents you from doing dangerous things
17:29:23FromDiscord<Matt> In reply to @isofruit "Particularly a lot of": ++
17:29:28FromDiscord<arathanis> Python's metaprogramming is easier, but Nim has such good metaprogramming for a statically typed compiled language I don't count it.
17:29:36FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=4D5H
17:29:44FromDiscord<arathanis> In reply to @sys64 "Imo having a strict": Python is strictly typed.
17:29:53FromDiscord<Matt> Python has a bolt-on type system
17:30:00FromDiscord<Matt> Same as Ruby's Sorbet
17:30:11FromDiscord<Matt> As someone who's worked extensively w both and worked on Ruby internals
17:30:12FromDiscord<Matt> I gotta say
17:30:15FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "Python is strictly typed.": but dynamically typed, so it can be dangerous if you're not careful
17:30:21FromDiscord<Phil> In reply to @x.hat "As in where it;s": Generally serialization was where I noticed it the most personally, a lot of the kind of "I want to transfer this field like this, but under certain circumstances it has to come out as this other thing
17:30:21FromDiscord<odexine> that way when you copy paste blocks you just need to fix the first line's indentation then the formatter would fix it, almost just like in regular brace languages where you just need to fix the braces then the indetnation can be handled by the formatter
17:30:23FromDiscord<Matt> I would prefer a language-level type system
17:30:37FromDiscord<Matt> Flow, incremental... verdict's out on that one.
17:30:37FromDiscord<arathanis> In reply to @sys64 "but dynamically typed, so": yes, but I always statically type my Python code so it's a non-issue.
17:30:45FromDiscord<System64 ~ Flandre Scarlet> Oh alright
17:30:51FromDiscord<Phil> In reply to @sys64 "Imo having a strict": That is also entirely correct.↵In the endeavour however of forcing you to be correct, nim has made some things harder than in dynamic languages, it's kind of unavoidable in static type systems.
17:30:52FromDiscord<Matt> In reply to @isofruit "Generally serialization was where": I see
17:30:58FromDiscord<System64 ~ Flandre Scarlet> But I have one big problem with Python : SPEED
17:31:03FromDiscord<arathanis> In reply to @sys64 "Oh alright": static typing in python is optional
17:31:12FromDiscord<arathanis> so a quick dirty script or fiddling in a REPL? go to town
17:31:12FromDiscord<Chronos [She/Her]> In reply to @sys64 "Imo having a strict": Inferred types are great
17:31:26FromDiscord<Chronos [She/Her]> In reply to @sys64 "But I have one": I mean, you could look at LPython, that's a new thing
17:31:29FromDiscord<arathanis> but anything anyone has to maintain? you can (and should) use types
17:31:36FromDiscord<odexine> In reply to @chronos.vitaqua "I mean, you could": sounds like an L to me
17:31:36FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Inferred types are great": Yeah sadly Nim lacks of that
17:31:37FromDiscord<odexine> :baqua:
17:31:47FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "I mean, you could": Oh? Will check that right now
17:31:47FromDiscord<Chronos [She/Her]> In reply to @sys64 "Yeah sadly Nim lacks": Nim uses inferred types
17:31:49FromDiscord<Matt> Yeah - what's the state of a Jupyter kernel for Nim
17:32:03FromDiscord<odexine> who are you asking
17:32:05FromDiscord<Matt> Until that's a thing, toying around is not as easy in some ways
17:32:10FromDiscord<Matt> Generally asking
17:32:26FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Nim uses inferred types": Doesn't it? Like, if an assignment omits the type but you assign it a value, it'll use the type of that value
17:32:33FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "I mean, you could": I looked for it, didn't found it
17:32:59FromDiscord<Chronos [She/Her]> https://github.com/lcompilers/lpython second result on google
17:33:08FromDiscord<Chronos [She/Her]> first is the official websitr
17:33:18FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D5J
17:33:29FromDiscord<huantian> generics that make sense!
17:33:41FromDiscord<Phil> sent a long message, see http://ix.io/4D5K
17:34:00FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "https://github.com/lcompilers/lpython second result": Didn't found it for me, weird
17:34:03FromDiscord<Phil> (edit) "http://ix.io/4D5K" => "http://ix.io/4D5L"
17:34:33FromDiscord<arathanis> I hope that answered your question @System64 ~ Flandre Scarlet .
17:34:51FromDiscord<Chronos [She/Her]> In reply to @sys64 "Didn't found it for": Fair
17:35:04FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Fair": Wow incredible! Is it usable now?
17:35:12FromDiscord<Phil> In reply to @huantian "generics that make sense!": Mandatory disclaimer that generics are a lie!↵There are no generics, only copy-paste instructions for the compiler!
17:35:31FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "I hope that answered": I think Python will add JIT soon?
17:35:33FromDiscord<Phil> Well, generics in nim anyway
17:35:33FromDiscord<Chronos [She/Her]> Can't do `def baz(self, s: S) -> Bar[T, S]`
17:35:34FromDiscord<Matt> In reply to @isofruit "Deeeepeeeeeends. Typescript shines a": I'm coming from a background of codebases with many thousands of lines written in Ruby and Python (and some TS)- in my experience the incremental typing dream doesn't live up to the promises and you end up trying to enforce strict typing everywhere once you reach a certain point or some code needs to be refactored/worked with
17:35:41FromDiscord<Chronos [She/Her]> You have to use a string for it instead
17:35:44FromDiscord<Chronos [She/Her]> Is annoying
17:35:52FromDiscord<Matt> Also TS is pretty nice, but I don't like JS itself and at the end of the day it's only a transpiler
17:35:55FromDiscord<Chronos [She/Her]> In reply to @sys64 "I think Python will": Should already be there in 3.12
17:35:56FromDiscord<Matt> :|
17:36:12FromDiscord<arathanis> In reply to @chronos.vitaqua "https://github.com/lcompilers/lpython second result": You can also use Cython or Nuitka!
17:36:13FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Should already be there": Oh alright, so should be much more faster
17:36:22FromDiscord<Chronos [She/Her]> In reply to @sys64 "Wow incredible! Is it": I wouldn't know but you can read the page perhaps
17:36:29FromDiscord<Chronos [She/Her]> In reply to @arathanis "You can also use": Also true
17:36:45FromDiscord<arathanis> Python is very much worth learning imo.
17:37:13FromDiscord<Matt> I do look forwards to the push for compiled Python + type system upgrades and derivatives like LPython and Mojo. The DS / ML community is starting to realize that the c-ext for perf + python for scripting boundaries are ugly
17:38:15FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "You can also use": So Nuitka is like PyToExe?
17:38:34FromDiscord<arathanis> In reply to @sys64 "So Nuitka is like": it seems to convert to C under the hood so its not just bundling
17:38:37FromDiscord<Chronos [She/Her]> In reply to @arathanis "Python is very much": Learnt it as a kid aha
17:38:51FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "it seems to convert": Oh wow!!
17:38:55FromDiscord<Chronos [She/Her]> In reply to @sys64 "So Nuitka is like": Nuitka does compilation of code, iirc PyToExe literally bundles a Python interpreter
17:39:20FromDiscord<Phil> In reply to @arathanis "Python is very much": Imo its the consequences that arise from python that are the actual thing to learn, like the ability to have Mixins, how python is a protocol driven language via dunder methods etc.
17:39:41FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D5O
17:39:54FromDiscord<Phil> (edit) "etc." => "etc.↵And all the other fancy schmancy magic you can do when everything is a dictionary"
17:40:13FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Nuitka does compilation of": Oh, I should try those things↵Maybe it will convince me Python isn't that slow
17:40:27FromDiscord<arathanis> I usually use PyInstaller over PyToExe
17:40:43FromDiscord<arathanis> since its cross platform 😉
17:41:21FromDiscord<System64 ~ Flandre Scarlet> Ah yeah, PyInstaller sorry
17:42:10FromDiscord<Chronos [She/Her]> In reply to @sys64 "Oh, I should try": No worries aha, but I'd still recommend Nim over Python since Nim is meant to be compiled lol
17:42:22FromDiscord<huantian> yeah pyinstaller is nice but still kinda jank
17:42:32FromDiscord<arathanis> In reply to @chronos.vitaqua "No worries aha, but": depends what you want
17:42:35FromDiscord<huantian> compared to actual compiled programs
17:42:38FromDiscord<arathanis> one of the biggest mistakes is pre-mature optimization
17:42:42FromDiscord<arathanis> python is slower, yes
17:42:49FromDiscord<arathanis> but is it too slow for what you are doing?
17:42:59FromDiscord<arathanis> that is the important question
17:43:18FromDiscord<Chronos [She/Her]> It's unsuited for threading (currently) which I'd imagine is important for chat applications and games
17:43:36FromDiscord<huantian> yeah for most of what I do python isn't too slow↵but it's kinda annoying to bundle the python interpreter with pyinstaller
17:43:38FromDiscord<Chronos [She/Her]> Tho there's gonna be W.I.P builds that remove the GIL which will be interesting
17:43:39FromDiscord<arathanis> In reply to @chronos.vitaqua "It's unsuited for threading": yes, though they are removing the GIL.
17:43:45FromDiscord<Chronos [She/Her]> Yeah
17:43:49FromDiscord<huantian> well they aren't just removing it but
17:43:51FromDiscord<jos7388> is there any way to use a specific object variant as a type
17:43:53FromDiscord<System64 ~ Flandre Scarlet> @arathanis Do I have to pay if I use Nuitka to make a game I want to sell?
17:44:10FromDiscord<arathanis> In reply to @sys64 "<@136570191038513152> Do I have": i have no idea
17:44:26FromDiscord<jos7388> https://media.discordapp.net/attachments/371759389889003532/1139252935608512633/image.png
17:44:28FromDiscord<jos7388> like something like this
17:44:41FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "i have no idea": https://nuitka.net/doc/commercial.html↵Because that makes me confused
17:45:22FromDiscord<Phil> In reply to @jos7388 "": I don't think so because you can't know at compiletime what variant of an object variant is present
17:45:37FromDiscord<Phil> That's kind of what object variants are there for, to allow something to be two things at once
17:45:43FromDiscord<arathanis> In reply to @sys64 "https://nuitka.net/doc/commercial.html Because that": this looks to enhance features and not unlock a license that lets you sell things
17:45:44FromDiscord<jos7388> i think u can with a case statement no
17:46:00FromDiscord<jos7388> like i can't access literal.number outside of a case statement where i can the tag field on the object variant
17:46:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @arathanis "this looks to enhance": Oh alright, so even with the standard version I can sell my programs?
17:46:24FromDiscord<Phil> In reply to @jos7388 "i think u can": That'll be a runtime check.↵You'll solely be defining how to deal with the object variant at compiletime, all the case-statement will do is force you to deal with every scenario the object variant will be
17:46:31FromDiscord<jos7388> ye but u know the type when ur passing it
17:46:33FromDiscord<jos7388> to the function
17:46:34FromDiscord<Phil> (edit) "scenario" => "variant" | "will" => "could"
17:46:38FromDiscord<jos7388> u know what i mean
17:46:58FromDiscord<Phil> Does your instance exist at compiletime or at runtime?
17:47:04FromDiscord<Phil> (edit) "Does your ... instance" added "object variant"
17:47:06FromDiscord<arathanis> In reply to @sys64 "Oh alright, so even": seems to be the case, read their licensing info
17:47:12FromDiscord<jos7388> https://media.discordapp.net/attachments/371759389889003532/1139253628327182447/image.png
17:47:14FromDiscord<jos7388> like this
17:47:29FromDiscord<jos7388> on line 6 it knows that the literal is a number statically
17:47:41FromDiscord<jos7388> but i dont wanna have another case statement in parseNumber
17:47:47FromDiscord<Phil> In reply to @jos7388 "on line 6 it": In that case you should pass on not literal, but the contents of literal
17:47:55FromDiscord<huantian> i wish nim could do that tbh
17:47:57FromDiscord<jos7388> i could do that
17:48:04FromDiscord<jos7388> that works i guess
17:48:06FromDiscord<huantian> and that it had better tracking of object variant state statically
17:48:34FromDiscord<Phil> I'm not aware of any other way to do this basically
17:49:55FromDiscord<Phil> It also semantically makes more sense to me, why pass on all the possible things a variant could be and have to deal with all cases of it instead of just passing on the data of the one case you care about and thus only having to deal with that
17:51:08FromDiscord<Phil> Afterall, passing on the variant also means passing on the ability to access all the fields it might possibly have (and have your program blow up on you at runtime if it's the wrong one)
17:52:00FromDiscord<Phil> But that is solely my opinion, other folks of course have their own view on that
17:52:45FromDiscord<odexine> In reply to @isofruit "Mandatory disclaimer that generics": compilers are just smart lookup tables and copy pasters
17:53:37FromDiscord<odexine> oh boy sounds like people want flow typing huh
17:53:50FromDiscord<Phil> ?
17:54:29FromDiscord<odexine> In reply to @jos7388 "": technically the problem is that nim would need "proof that all usages of parseNumber will always have literal.kind == Number" and there isnt a mechanism for that yet
17:54:43FromDiscord<odexine> In reply to @isofruit "?": type narrowing from conditions
17:55:08FromDiscord<odexine> like saying `if a in 0..10:` then inside the statement a's type is "0..10"
17:55:37FromDiscord<Phil> Ah, like how you can know that an option contains a value if you check option.isPresent beforehand and so auto-unpacking could be sensible or sth?
17:55:50FromDiscord<odexine> pretty much i guess
17:56:32FromDiscord<jos7388> In reply to @isofruit "It also semantically makes": it's because u often have useful data on the rest of the object outside the field the variant guards
17:56:34FromDiscord<jos7388> u could just pass both i guess
17:56:42FromDiscord<jos7388> rust has the same issue with enums, variants aren't types
17:56:50FromDiscord<jos7388> although in nim the issue is a little different
17:57:13FromDiscord<odexine> well this is kinda the same, just that variant discriminators arent types
17:57:22FromDiscord<odexine> pattern matching where
17:57:46FromDiscord<jos7388> ye but in nim the variant discriminator doesn't hold the data, the field it guards on the object variant is
17:57:47FromDiscord<jos7388> (edit) "is" => "does"
17:57:53FromDiscord<jos7388> in rust the variant discriminator holds the data
17:57:55FromDiscord<jos7388> so it's even worse
17:58:17FromDiscord<odexine> oh elixir how you have ruined me `def something(%{kind: "idk smth"} = a)`
17:58:27FromDiscord<jos7388> whats that do
17:58:56FromDiscord<odexine> a is bound to a "map" (just think of it as a struct-ish thing) that has kind == "idk smth"
17:59:14FromDiscord<odexine> and if it doesnt match then it's an error
18:00:10FromDiscord<odexine> well iirc in elixir's case its either a compile or run time error depending on the information available statically but eh
18:01:20FromDiscord<odexine> wonder what a nice solution for this would be in nims case
18:07:26FromDiscord<Phil> Somehow writing RxNim could solve this I'm sure!
18:10:32FromDiscord<odexine> phil pls
18:11:21*jmd_ joined #nim
18:18:05FromDiscord<Chronos [She/Her]> Pfffff
18:23:28*jmd_ quit (Ping timeout: 246 seconds)
18:32:59FromDiscord<System64 ~ Flandre Scarlet> RxNim?
18:59:56FromDiscord<jos7388> reactive programming patterns
19:00:04FromDiscord<jos7388> :nervouscart:
19:01:26FromDiscord<System64 ~ Flandre Scarlet> In reply to @jos7388 "reactive programming patterns": what is this?
19:01:44qwrarathanis: don't know, but nim seems to have accidentally (reinvent|copied|?) javascript and go behaviour on for loop binding for lambdas
19:01:58FromDiscord<jos7388> basically when a value changes other expressions are reevaluated
19:02:25FromDiscord<jos7388> Rx libs expose it with an observable-style API
19:02:38FromDiscord<jos7388> u can build big chains of reactive expressions and have some other features for escape hatches and whatever
19:02:45FromDiscord<jos7388> it’s normally used for UI
19:03:03FromDiscord<jos7388> Svelte adds it as a first class citizen to JS
19:03:11FromDiscord<jos7388> builds a ui framework around it
19:05:43FromDiscord<summarity> sent a code paste, see https://play.nim-lang.org/#ix=4D6u
19:09:12FromDiscord<odysseus> sent a long message, see https://paste.rs/hn1Xo
19:09:58NimEventerNew question by IvanS: nim - Windows - how to check for system wide hotkey press?, see https://stackoverflow.com/questions/76878691/nim-windows-how-to-check-for-system-wide-hotkey-press
19:10:51FromDiscord<Chronos [She/Her]> In reply to @summarity "I've got a type": Probably have to use unions
19:10:59FromDiscord<Chronos [She/Her]> So `Foo | Bar | Yep`
19:15:37FromDiscord<arathanis> In reply to @qwr "<@136570191038513152>: don't know, but": can you elaborate?
19:16:03FromDiscord<Matt> If I have an iterator, how can I fetch a single value from it
19:16:39FromDiscord<Matt> i.e. if I have defined an `iterator` that `yield`s how would I go about doing something like `let fetch_just_the_one = myIter.next()`
19:17:48FromDiscord<arathanis> that is more of a python thing, not sure Nim iterators work that way
19:18:48FromDiscord<arathanis> I think you might be able to build iterators that way...
19:19:32FromDiscord<Chronos [She/Her]> Probably would be easier to just make it a seq bc yeah iterators just don't work like that atm
19:21:46*def- quit (Quit: -)
19:25:12*advesperacit quit ()
19:33:26nisstyrewouldn't closure iterators allow for that at least in theory?
19:35:50*PMunch_ joined #nim
19:38:58*PMunch quit (Ping timeout: 256 seconds)
19:41:25FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D6G
19:43:32FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D6H
19:43:35FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4D6I
19:44:57FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D6J
19:45:09FromDiscord<arathanis> (edit) "https://play.nim-lang.org/#ix=4D6H" => "https://play.nim-lang.org/#ix=4D6K"
19:45:31FromDiscord<arathanis> yeah @Matt this seems to work
19:49:51FromDiscord<arathanis> but really you might just need to rethink your approach
19:50:11FromDiscord<arathanis> rather than trying to force nim to do it the way you would do it in python, maybe just do it the way you would do it in Nim?
19:50:21FromDiscord<arathanis> (edit) "nim" => "Nim"
19:50:26FromDiscord<arathanis> (edit) "python," => "Python,"
19:51:50*PMunch joined #nim
19:53:23FromDiscord<demotomohiro> iterator without `{.closure.}` is an inline iterator.↵That works like template and doesn't have status.
19:53:54FromDiscord<arathanis> isn't that also how `iterator foo(...)` works?
19:54:15FromDiscord<demotomohiro> Yes.
19:54:36*PMunch_ quit (Ping timeout: 245 seconds)
19:55:58FromDiscord<arathanis> do you still need to specify `{.closure.}`? it doesnt seem to matter anymore.
19:56:06FromDiscord<arathanis> might be implied?
19:56:20FromDiscord<arathanis> seems like its implied
20:01:08FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-firstminusclass-iterators
20:02:25FromDiscord<Matt> thanks
20:02:38FromDiscord<Matt> I'm starting to see how different iterators are here compared to Python
20:03:49*def- joined #nim
20:06:02FromDiscord<wick3dr0se> Is it difficult to import a module made with Nim in C or other languages?
20:07:13FromDiscord<summarity> No, you just export the symbols you need and call them.
20:07:30FromDiscord<arathanis> In reply to @wick3dr0se "Is it difficult to": ive had success with both static and dynamic linking
20:07:47FromDiscord<arathanis> specifically into C/C++
20:08:55FromDiscord<demotomohiro> In reply to @wick3dr0se "Is it difficult to": https://internet-of-tomohiro.netlify.app/nim/clibrary.en#c-library-tutorial-for-nimmer-create-static-library-from-nim-code-and-use-from-c-code
20:11:57FromDiscord<summarity> You also may have to invoke `NimMain()` depending on the platform
20:13:11FromDiscord<Matt> In reply to @demotomohiro "https://internet-of-tomohiro.netlify.app/nim/clibra": Cool site! Will explore in depth later
20:22:04*ntat quit (Quit: leaving)
20:38:34FromDiscord<0xrh0d4m1n> hey guys, anyone is getting problems with Jester in this latest release of Nim 2.0?
20:39:02FromDiscord<0xrh0d4m1n> (edit) "hey guys, anyone is getting problems with Jester in this latest release of Nim 2.0? ... " added "Something related to ORC?"
20:40:05FromDiscord<Elegantbeef> Yea jester likely has bugs related to Orc and not being updated to support it, in the time being you could compile with `--mm:refc` or use a different library
20:40:39FromDiscord<0xrh0d4m1n> Thank you so much @elegantbeef
20:44:32FromDiscord<0xrh0d4m1n> just for someone future reference I was getting this:
20:44:36FromDiscord<0xrh0d4m1n> https://media.discordapp.net/attachments/371759389889003532/1139298271328751767/image.png
20:45:18FromDiscord<Elegantbeef> Yea it's a known issue, undecided whether it's an issue with jester or orc
20:45:38FromDiscord<Elegantbeef> Likely with jester having preconceived ideas of the runtime
20:45:49FromDiscord<Elegantbeef> Dom no longer uses Nim so I guess "forks welcome"
20:50:07FromDiscord<jos7388> wha
20:50:09FromDiscord<jos7388> what’s he use now
20:50:21FromDiscord<Elegantbeef> No clue
20:50:26FromDiscord<bung8954> try useStdLib to reduce problem
20:51:12FromDiscord<0xrh0d4m1n> In reply to @jos7388 "what’s he use now": https://github.com/ringabout/awesome-nim#frameworks
20:51:14FromDiscord<heysokam> is there a way to get the underlying int representation of an enum set containing flags? 🤔
20:51:36FromDiscord<Elegantbeef> `cast[WantedSize](myEnum)`
20:51:45FromDiscord<heysokam> ty beef ✍️
20:52:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4D71
20:53:18Amun-Rawhat if sizeof(result) > sizeof(source)?
20:58:14FromDiscord<Elegantbeef> Put an error in
21:07:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Nuitka does compilation of": So if it compiles, my program will be way faster than vanilla Python?
21:07:44FromDiscord<jakraes> Question, is there a way to use inherited methods that are currently overriden? The same way you can override a function in java but still use its super
21:08:35FromDiscord<Elegantbeef> `procCall myProc(Base(child))`
21:09:35FromDiscord<jakraes> I am a little confused by that ngl 💀
21:09:48FromDiscord<Elegantbeef> `procCall` forces the code to be evaluated statically
21:09:54FromDiscord<Elegantbeef> well not evaluated but dispatched
21:10:31FromDiscord<jakraes> Gotcha, and what's the Base() for?
21:10:39FromDiscord<Elegantbeef> Type conversion
21:10:57FromDiscord<jakraes> 🫡
21:11:01FromDiscord<jakraes> Understood it now, thank you
21:11:32FromDiscord<Elegantbeef> Can also of course use command syntax or method call syntax for the conversion, but that's between you and your god
21:13:05Amun-Raproccall, TIL
21:13:33FromDiscord<jakraes> In reply to @Elegantbeef "Can also of course": Gonna keep it simple and use proccall LUL
21:14:05FromDiscord<Elegantbeef> I mean `Base child` or `child.base`
21:14:15FromDiscord<Elegantbeef> well `child.Base`
21:18:58FromDiscord<Chronos [She/Her]> In reply to @sys64 "So if it compiles,": In theory yeah
21:19:04FromDiscord<Chronos [She/Her]> Typically it should be faster
21:21:29*NimEventer quit (*.net *.split)
21:21:29*Lord_Nightmare quit (*.net *.split)
21:21:30*syl quit (*.net *.split)
21:21:54*syl joined #nim
21:22:13*Lord_Nightmare joined #nim
21:23:23*NimEventer joined #nim
21:24:45FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4D7c
21:25:40FromDiscord<Chronos [She/Her]> Nice
21:28:43Amun-Rawhat about pypy?
21:28:43FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Nice": Nuitka is blue↵Slower than Python?? https://media.discordapp.net/attachments/371759389889003532/1139309376860061706/image.png
21:29:21FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "what about pypy?": PyPy can't produces executables, can it?
21:30:03Amun-Rastandalone? no
21:30:32FromDiscord<System64 ~ Flandre Scarlet> It would be so nice to have executables with PyPy
21:31:35FromDiscord<Chronos [She/Her]> In reply to @sys64 "Nuitka is blue Slower": Idk
21:39:44FromDiscord<System64 ~ Flandre Scarlet> PyPy is still way faster
21:40:15FromDiscord<Phil> ~~Pypy is like the majority of the reason Django is even viable~~
21:43:05FromDiscord<System64 ~ Flandre Scarlet> Now sad you can't have an exe with PyPy
21:45:22FromDiscord<Elegantbeef> I'm more sad people want to distibute python binaries
21:47:22Amun-Raindeed
22:00:25FromDiscord<Phil> Oh hey, it appears I can successfully pull nim 2.0 images from dockerhub!↵Sweet!
22:04:53*rockcavera quit (Remote host closed the connection)
22:11:29FromDiscord<Matt> I'm trying to install this library for a project of mine using Nim 2.0: https://github.com/haltcase/glob
22:12:59FromDiscord<Matt> sent a code paste, see https://play.nim-lang.org/#ix=4D7k
22:13:03FromDiscord<Matt> What might be causing this?
22:13:32*rockcavera joined #nim
22:15:26FromDiscord<Elegantbeef> `nimble install glob@#head`
22:15:27FromDiscord<Elegantbeef> they didnt tag a release
22:15:37FromDiscord<Matt> https://github.com/haltcase/glob/blob/64f71af2fa4572c2bdf8987a56a427c1d88fc34f/glob.nimble#L1-L10
22:15:57FromDiscord<Elegantbeef> Yea they didnt tag a new release so when you install `0.11.2` is got
22:16:06FromDiscord<Matt> https://github.com/haltcase/glob/releases/tag/v0.11.2
22:16:08FromDiscord<Elegantbeef> Make an issue to tag a new release for the 2.0 support
22:16:16FromDiscord<Matt> Is that not it?
22:16:23FromDiscord<Elegantbeef> https://github.com/haltcase/glob/commit/64f71af2fa4572c2bdf8987a56a427c1d88fc34f
22:16:26FromDiscord<Elegantbeef> Look at the commit
22:16:44FromDiscord<Elegantbeef> The issue with nimble is that it has a manually written version and a git tag, nimble uses the git tag
22:17:10FromDiscord<Elegantbeef> This is why graffiti exists 😄
22:17:14FromDiscord<Matt> Pause
22:17:33FromDiscord<Matt> Are you looking at a different repo to see which commit is being used
22:17:40FromDiscord<Elegantbeef> No
22:17:51FromDiscord<Elegantbeef> https://github.com/haltcase/glob/commit/64f71af2fa4572c2bdf8987a56a427c1d88fc34f look at the tagged commit
22:17:54FromDiscord<Elegantbeef> It's from octoer
22:18:02FromDiscord<Elegantbeef> october\
22:18:02FromDiscord<Elegantbeef> the 2.0 support was done in novemeber
22:18:08FromDiscord<Elegantbeef> It needs a new `tag`
22:18:10FromDiscord<Matt> Oh
22:18:14FromDiscord<Matt> I'm tripping
22:18:16FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D7n
22:18:16FromDiscord<Phil> You'll get the latest from there
22:18:35FromDiscord<Matt> I totally missed that
22:18:37FromDiscord<Matt> Ok, thanks
22:19:03FromDiscord<Elegantbeef> Make an issue so they tag it
22:23:01FromDiscord<Matt> Did
22:23:21FromDiscord<Matt> Thanks Mr B :^)
22:23:51qwrMatt: you could just break in for loop to use only first value
22:25:15FromDiscord<Elegantbeef> Is there something I'm missing qwr?
22:25:44qwrhe asked how to use only first value from iterator
22:26:45qwr(and it seemed to me that this solution wasn't mentioned by anyone yet)
22:26:54FromDiscord<Elegantbeef> Ah
22:29:14FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4D7q
22:30:23FromDiscord<Elegantbeef> Ah actually `next` works even with overloads
22:30:40FromDiscord<Elegantbeef> so `pop` or `next` would suffice
22:47:25FromDiscord<Matt> Thanks qwr
22:52:58FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4D7t
22:53:06FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4D7t" => "https://paste.rs/P28pu"
22:53:58FromDiscord<Elegantbeef> Yes
22:54:08FromDiscord<Elegantbeef> `(int, int, int)`
22:54:22FromDiscord<heysokam> do they need to be named mandatory in the typedef?
22:55:15FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4D7u
22:55:18FromDiscord<odexine> yes theyd need to be named there
22:55:22FromDiscord<Elegantbeef> When using the named tuple syntax yes
22:55:24FromDiscord<odexine> otherwise you use the () style
22:55:28FromDiscord<Elegantbeef> `appVers: (int, int, int) = (0, 0, 0)`
22:55:41FromDiscord<heysokam> oh I had no idea that's a valid type
22:55:44FromDiscord<Elegantbeef> you can do`tuple[_, _, _: int]` probably
22:55:45FromDiscord<heysokam> im dummy, ty
22:55:51FromDiscord<Elegantbeef> Assuming metagn handled it
22:55:56FromDiscord<odexine> In reply to @Elegantbeef "you can do`tuple[_, _,": sounds cursed
22:59:21FromDiscord<Elegantbeef> Hey I wouldnt suggest it if it wasnt