00:00:21 | FromDiscord | <Elegantbeef> Well I showed how to do that, so do that |
00:01:28 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1138985429819985920/image.png |
00:01:59 | FromDiscord | <Elegantbeef> palette isnt an open array |
00:02:06 | FromDiscord | <Elegantbeef> It' not a seq or an array is it? |
00:02:21 | FromDiscord | <System64 ~ Flandre Scarlet> oh wait I'm dumb, I forgot .data |
00:05:10 | FromDiscord | <System64 ~ Flandre Scarlet> but if I modify the merged array, will I modify elements from the others arrays too? |
00:05:19 | FromDiscord | <Elegantbeef> Of course not |
00:05:45 | FromDiscord | <Elegantbeef> Unless they're `ref`s |
00:06:07 | FromDiscord | <System64 ~ Flandre Scarlet> Any risks? https://media.discordapp.net/attachments/371759389889003532/1138986598285987890/image.png |
00:06:28 | FromDiscord | <Elegantbeef> How does that relate |
00:06:28 | FromDiscord | <Elegantbeef> The elements are not refs |
00:06:49 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
00:07:54 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4D1u |
00:08:23 | FromDiscord | <Elegantbeef> Value types do not point back to collections so of course not |
00:08:37 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright, thanks |
00:39:45 | NimEventer | New Nimble package! dan_magaji - extensible performant http and web socket proxy server, see https://github.com/C-NERD/dan_magaji |
01:00:40 | FromDiscord | <summarity> sent a code paste, see https://play.nim-lang.org/#ix=4D1O |
01:01:18 | FromDiscord | <Elegantbeef> If you search for `owner` you might find a message that has a macro for that |
01:03:20 | FromDiscord | <Elegantbeef> Well that didnt work |
01:08:03 | FromDiscord | <Elegantbeef> There we go |
01:08:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/qamYP |
01:08:10 | FromDiscord | <Elegantbeef> Someone write that down for me |
01:08:10 | FromDiscord | <Elegantbeef> Thanks |
01:27:57 | FromDiscord | <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:01 | FromDiscord | <Chronos [She/Her]> The issue is: |
01:28:38 | FromDiscord | <Chronos [She/Her]> `sb` when put though literally any other decoder does not give the inputted number, it instead gives `7168` |
01:29:07 | FromDiscord | <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:50 | FromDiscord | <Elegantbeef> https://www.lifewire.com/base64-encoding-overview-1166412 no clue if this helps |
01:55:34 | FromDiscord | <Chronos [She/Her]> Yeah doesn't really help- |
01:55:49 | FromDiscord | <Chronos [She/Her]> It's just something I'm struggling to understand, oh well |
02:05:41 | FromDiscord | <that_dude.> Do you know how to convert numbers between decimal/binary/hex? |
02:06:08 | FromDiscord | <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:24 | FromDiscord | <that_dude.> Look at the conversions between base64 and binary |
02:07:03 | FromDiscord | <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:54 | FromDiscord | <Chronos [She/Her]> Also my code does work for Base16, tf? |
02:09:08 | FromDiscord | <Elegantbeef> Do you know what a base actually means? |
02:09:33 | FromDiscord | <Chronos [She/Her]> The amount of characters it can be represented in? |
02:09:46 | FromDiscord | <Elegantbeef> That's a loose definition of base |
02:10:02 | FromDiscord | <Elegantbeef> `10` is 1 \ 10^1 + 0 \ 10^0 in base 10 |
02:10:05 | FromDiscord | <Chronos [She/Her]> We use base 10 (0-9) as the decimal system from what i know |
02:10:11 | FromDiscord | <_gumbercules> base16 is simply hex |
02:10:16 | FromDiscord | <Chronos [She/Her]> Yeah |
02:10:17 | FromDiscord | <_gumbercules> 0-9 + A-F |
02:10:21 | FromDiscord | <_gumbercules> base 8 == octal |
02:10:25 | FromDiscord | <_gumbercules> decimal = base 10 |
02:10:27 | FromDiscord | <_gumbercules> binary = base 2 |
02:10:30 | FromDiscord | <Elegantbeef> in base 2 it's 1 \ 2 ^ 1 + 0 \ 2^0 |
02:11:20 | FromDiscord | <Chronos [She/Her]> Why does base10 have 1 10^1? |
02:11:27 | FromDiscord | <Chronos [She/Her]> Isn't 10 to the power of 1 still 10? |
02:11:48 | FromDiscord | <Chronos [She/Her]> Actually I think I'm defo wrong on that |
02:11:57 | FromDiscord | <Elegantbeef> 10^1 is 10 |
02:12:01 | FromDiscord | <Elegantbeef> 10^0 is 1 |
02:12:03 | FromDiscord | <Chronos [She/Her]> Oh huh |
02:12:05 | FromDiscord | <Chronos [She/Her]> Aah |
02:12:18 | FromDiscord | <Chronos [She/Her]> Okay so then why did you add the power? |
02:12:33 | FromDiscord | <Elegantbeef> Cause that's how bases work |
02:12:43 | FromDiscord | <Chronos [She/Her]> Huh... |
02:12:48 | FromDiscord | <Elegantbeef> number systems are just sumination of the digit multiplied to the power |
02:12:59 | FromDiscord | <Chronos [She/Her]> I'm still completely lost on how bases work really |
02:13:26 | FromDiscord | <Chronos [She/Her]> It's genuinely a brick wall type thing here |
02:13:46 | FromDiscord | <Elegantbeef> it just changes the range of values in a place |
02:13:59 | FromDiscord | <Elegantbeef> So instead of a 10s place like we have in base 10 you have a 2s place |
02:14:06 | FromDiscord | <Elegantbeef> Or a 4s place instead of 100s |
02:16:36 | FromDiscord | <_gumbercules> think about it this way |
02:20:00 | FromDiscord | <_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:12 | FromDiscord | <_gumbercules> if you want to think about base 2 - just replace 0-9 with 0-1 |
02:20:27 | FromDiscord | <_gumbercules> base 8? 0-9 with 0-7 |
02:21:51 | FromDiscord | <Elegantbeef> https://i.imgur.com/NQPrUsI.gifv |
02:22:13 | FromDiscord | <Elegantbeef> My favourite visualisation of number systems in a different base than 10 |
02:23:04 | FromDiscord | <_gumbercules> raising a number to the power `n` is simply multiplying the number by itself `n` times. |
02:23:11 | FromDiscord | <_gumbercules> if that wasn't already covered |
02:23:53 | FromDiscord | <_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:16 | FromDiscord | <_gumbercules> as long as you understand how to convert between bases |
02:25:06 | FromDiscord | <_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:09 | FromDiscord | <_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:35 | FromDiscord | <_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:03 | FromDiscord | <_gumbercules> It's especially great if you don't have a firm understanding of logic gates and how cpus and meory work |
02:27:11 | FromDiscord | <_gumbercules> (edit) "meory" => "memory" |
02:45:20 | FromDiscord | <jordan4ibanez> It's bits |
02:45:28 | FromDiscord | <jordan4ibanez> 0000 |
02:45:38 | FromDiscord | <arathanis> sent a long message, see http://ix.io/4D25 |
02:45:44 | FromDiscord | <jordan4ibanez> (edit) "0000 ... " added "= 0" |
02:46:14 | FromDiscord | <arathanis> (edit) "http://ix.io/4D25" => "http://ix.io/4D27" |
02:46:19 | FromDiscord | <jordan4ibanez> 0001 = 1↵0010 = 2↵0011 = 3↵0100 = 4 |
02:46:53 | FromDiscord | <jordan4ibanez> So on so forth, blah blah blah. Each boolean represents a multiplicative |
02:47:00 | FromDiscord | <arathanis> (edit) "http://ix.io/4D27" => "http://ix.io/4D29" |
02:47:13 | FromDiscord | <arathanis> (edit) "http://ix.io/4D29" => "http://ix.io/4D2a" |
02:49:04 | FromDiscord | <jordan4ibanez> Unless you're using malbolge then it's simply ggnore with 0,1,&2 |
02:51:09 | FromDiscord | <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:44 | FromDiscord | <Chronos [She/Her]> In reply to @_gumbercules "if you want to": Okay, I think I understand that, sounds simple there |
03:26:59 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "https://i.imgur.com/NQPrUsI.gifv": Okay that's cool- |
03:27:26 | FromDiscord | <Chronos [She/Her]> In reply to @_gumbercules "oh there's a 2nd": I'll definitely look into it, thanks y'all! |
03:28:39 | FromDiscord | <Chronos [She/Her]> Thanks everyone, I think now I somewhat understand it now- |
03:30:10 | FromDiscord | <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:39 | FromDiscord | <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:42 | FromDiscord | <Chronos [She/Her]> Sigh |
03:31:26 | * | cm quit (Ping timeout: 260 seconds) |
03:38:54 | FromDiscord | <_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:12 | FromDiscord | <Elegantbeef> Yea leave it to the professionals! |
03:39:25 | FromDiscord | <_gumbercules> Well, Beef does this way too much too - words are powerful |
03:39:42 | FromDiscord | <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:42 | FromDiscord | <_gumbercules> and so is one's subconsious mind |
03:39:57 | FromDiscord | <Chronos [She/Her]> But dw abt it aha, I'm definitely much better than we used to be, in that regard |
03:40:06 | FromDiscord | <Chronos [She/Her]> It's something I'm working on, really |
03:40:22 | FromDiscord | <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:48 | FromDiscord | <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:21 | FromDiscord | <_gumbercules> Night! Try and cheer up! There's nothing to be depressed about, I guarantee it. |
03:42:39 | FromDiscord | <Chronos [She/Her]> Pfffff i wish there was nothing to be depressed about but eh |
03:43:44 | * | ehmry joined #nim |
03:44:44 | FromDiscord | <_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:01 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D2t |
04:55:27 | FromDiscord | <Elegantbeef> \: untyped\` |
04:55:57 | FromDiscord | <Phil> Did typed not give me benefit of checking whether the code generated was type-wise sane? |
04:56:06 | FromDiscord | <Elegantbeef> It's talking about the return value |
04:56:15 | FromDiscord | <Elegantbeef> the result is untyped code |
04:56:20 | FromDiscord | <Phil> Yeh, me too |
04:56:36 | FromDiscord | <Phil> Ahh check, so the NimNode you return does not get checked in that manner |
04:56:42 | FromDiscord | <Phil> (edit) "Ahh check, so the NimNode you return does not get checked in that manner ... " added "at the time of returning" |
04:57:00 | FromDiscord | <Elegantbeef> I mean that's not what it means, but yea |
04:57:18 | FromDiscord | <Elegantbeef> You're returning AST, that AST is not semantically checked so saying `typed` is wrong |
04:58:02 | FromDiscord | <Phil> Ohhh I read the section in macro tutorial wrong |
04:58:16 | FromDiscord | <Phil> typed just means autoconversions, not checking |
04:58:28 | FromDiscord | <Phil> (edit) "Ohhh I read the section in ... macro" added "the" |
04:58:44 | FromDiscord | <Elegantbeef> typed means it's semantically checked |
04:59:10 | FromDiscord | <Elegantbeef> That means symbols are looked up, macros are expanded, it compiles |
04:59:25 | FromDiscord | <Elegantbeef> You are not the compiler so cannot return semantically checked code |
05:00:15 | FromDiscord | <Phil> In reply to @Elegantbeef "You are not the": My dream of becoming a compiler: Crushed |
05:00:39 | FromDiscord | <Elegantbeef> Just go write C or Odin |
05:01:18 | FromDiscord | <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:20 | FromDiscord | <_gumbercules> Maybe you're not THE compiler but that doesn't mean you cannot be A compiler! |
05:01:36 | FromDiscord | <Phil> Learning memory management that is |
05:01:51 | FromDiscord | <Elegantbeef> Memory management isnt that much |
05:03:23 | FromDiscord | <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:43 | FromDiscord | <Elegantbeef> Ehh it's calling `malloc` and `free` 😛 |
05:04:23 | FromDiscord | <Phil> I'd claim getting some knowledge with allocators and the choices there would also fall under that |
05:06:39 | FromDiscord | <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:07 | FromDiscord | <Phil> (edit) "code" => "code/make good design decisions" |
05:09:42 | FromDiscord | <_gumbercules> It really depends |
05:10:13 | FromDiscord | <_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:55 | FromDiscord | <_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:23 | FromDiscord | <_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:09 | FromDiscord | <_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:34 | FromDiscord | <_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:02 | FromDiscord | <_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:05 | FromDiscord | <Elegantbeef> Would be even cooler if statically typed allocators on the builtin types was possible 😄 |
05:14:21 | FromDiscord | <_gumbercules> In reply to @Elegantbeef "Would be even cooler": That sounds like more work than writing one's own stdlib |
05:14:25 | FromDiscord | <_gumbercules> but I agree |
05:14:57 | FromDiscord | <_gumbercules> although I think if I were to do custom allocators I would just make `Allocator` a concept |
05:14:58 | FromDiscord | <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:21 | FromDiscord | <Phil> And surface level how an Allocator in general works |
05:15:23 | FromDiscord | <Elegantbeef> I mean yea gumber the allocator wouldbe a static generic parameter |
05:15:43 | FromDiscord | <_gumbercules> generally it's a tradeoff between a few things- number of sys calls, amount of fragmentation, memory required, latency |
05:15:53 | FromDiscord | <Phil> (edit) "works" => "works, because for now to me that is↵"Variable declarations --> magic involving allocator --> variable in memory"" |
05:16:10 | FromDiscord | <_gumbercules> and number of sys calls can influence latency |
05:20:43 | FromDiscord | <_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:19 | FromDiscord | <_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:03 | FromDiscord | <_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:13 | FromDiscord | <Elegantbeef> Worth noting phil that variables do not call the allocator that most people talk about |
05:22:33 | FromDiscord | <Elegantbeef> In Nim allocations are mostly explicit through constructors or concatenation |
05:24:44 | FromDiscord | <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:28 | FromDiscord | <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:40 | FromDiscord | <Elegantbeef> The only real exception in Nim I can think of it are the collections in Nim being treated as value types |
05:26:00 | FromDiscord | <_gumbercules> In reply to @isofruit "I assume memory area's": https://en.wikipedia.org/wiki/Region-based_memory_management |
05:27:33 | FromDiscord | <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:12 | FromDiscord | <_gumbercules> As does only making one system call to allocate the entire arena |
05:29:30 | FromDiscord | <_gumbercules> or however many the allocator you allocate the arena with, makes |
05:32:10 | FromDiscord | <_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:11 | FromDiscord | <roupi.rb> how do i get the error of a future ? |
08:21:10 | FromDiscord | <roupi.rb> wtf |
08:21:33 | FromDiscord | <roupi.rb> so await and asyncCheck should raise if the future returned a error |
08:21:53 | FromDiscord | <odexine> not always, but oftentimes they do |
08:23:34 | FromDiscord | <roupi.rb> im doing the chat example from the nim book |
08:23:42 | FromDiscord | <roupi.rb> but it connects to the server |
08:23:59 | FromDiscord | <roupi.rb> but the server doest receive any messages |
08:24:05 | FromDiscord | <roupi.rb> from the client |
08:24:09 | FromDiscord | <roupi.rb> on telnet it works |
08:24:42 | FromDiscord | <roupi.rb> i thought i was not catching the error but i it doest seem like it |
08:32:59 | FromDiscord | <enthus1ast> @roupi.rb\: do you send a newline ? |
08:33:09 | FromDiscord | <enthus1ast> telnet sends a newline imho |
08:33:30 | FromDiscord | <enthus1ast> i would try to append a "\\n" to the text you send |
08:33:44 | FromDiscord | <roupi.rb> OHHhhhh |
08:34:28 | FromDiscord | <roupi.rb> one last thing |
08:34:36 | FromDiscord | <roupi.rb> that this error means ? https://media.discordapp.net/attachments/371759389889003532/1139114562289942578/image.png |
08:34:50 | FromDiscord | <roupi.rb> https://media.discordapp.net/attachments/371759389889003532/1139114619395379210/image.png |
08:35:05 | FromDiscord | <roupi.rb> https://media.discordapp.net/attachments/371759389889003532/1139114681798250536/image.png |
08:35:44 | FromDiscord | <enthus1ast> ok i see mutliple things \:) |
08:35:51 | FromDiscord | <odexine> all of the futures finished but you're still polling, iirc technically its not allowed |
08:36:44 | FromDiscord | <enthus1ast> the "unused imports" means, you imported the modules, but do not use them in your application |
08:36:58 | FromDiscord | <roupi.rb> so the event loop doest have any events to poll |
08:37:03 | FromDiscord | <roupi.rb> so it raises ? |
08:37:21 | FromDiscord | <enthus1ast> then change the asyncChecks to waitFor |
08:37:44 | FromDiscord | <enthus1ast> (oh for me the first image did not load) |
08:37:59 | FromDiscord | <roupi.rb> same problem |
08:38:00 | FromDiscord | <enthus1ast> asyncCheck do not block, waitFor does |
08:38:27 | FromDiscord | <enthus1ast> you do not need to poll |
08:38:35 | FromDiscord | <enthus1ast> since waitFor polls on its own |
08:38:45 | FromDiscord | <roupi.rb> oh |
08:38:51 | FromDiscord | <enthus1ast> the thing is, you are not in an async function |
08:39:23 | FromDiscord | <enthus1ast> this is the reason you must use waitFor, in a normal async function you would use await |
08:39:50 | FromDiscord | <roupi.rb> but i dont understand why the poll raises in that case |
08:40:04 | FromDiscord | <enthus1ast> it complains because it has nothing to poll on |
08:40:20 | FromDiscord | <roupi.rb> oh |
08:40:32 | FromDiscord | <roupi.rb> so asyncCheck has its own poll |
08:40:38 | FromDiscord | <enthus1ast> waitFor |
08:40:53 | FromDiscord | <roupi.rb> but then |
08:41:12 | FromDiscord | <roupi.rb> why does the poll raises with asyncCheck |
08:41:23 | FromDiscord | <odexine> Because the futures eventually finish |
08:41:26 | FromDiscord | <roupi.rb> the poll processed the 2 futures |
08:41:27 | FromDiscord | <enthus1ast> asyncCheck should be used inside an async function |
08:41:29 | FromDiscord | <odexine> Then there’s nothing to poll on |
08:41:43 | FromDiscord | <roupi.rb> and after finishing raised |
08:42:08 | FromDiscord | <roupi.rb> how do i check if there are no events left ?event |
08:42:12 | FromDiscord | <roupi.rb> (edit) "?event" => "?" |
08:42:46 | FromDiscord | <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:22 | FromDiscord | <roupi.rb> the book uses asyncCheck on the main function |
08:43:48 | FromDiscord | <enthus1ast> nim in action? |
08:43:55 | FromDiscord | <roupi.rb> yes |
08:44:54 | FromDiscord | <roupi.rb> https://media.discordapp.net/attachments/371759389889003532/1139117155271581736/image.png |
08:45:57 | FromDiscord | <roupi.rb> they should've used waitFor here |
08:46:25 | FromDiscord | <enthus1ast> i would have used waitFor yes |
08:47:01 | FromDiscord | <enthus1ast> mh i do not have my copy of nim in action here unfortunately |
08:47:37 | FromDiscord | <enthus1ast> have a look at this\:↵https://nim-lang.org/docs/asyncnet.html |
08:47:38 | FromDiscord | <enthus1ast> example |
08:48:01 | FromDiscord | <enthus1ast> oh i think i'm wrong ... |
08:48:08 | FromDiscord | <enthus1ast> its early here |
08:48:08 | FromDiscord | <enthus1ast> \:) |
08:49:06 | FromDiscord | <enthus1ast> the server example i mean |
08:49:18 | FromDiscord | <enthus1ast> this is quite a good example for async network code |
08:49:56 | FromDiscord | <enthus1ast> the serve proc never finishes, so it always have something to poll on |
08:50:32 | FromDiscord | <enthus1ast> the server code "block" on server.accept() but then spawn's a "co routine" with asyncCheck to handle the client |
08:51:17 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D39 |
08:52:03 | FromDiscord | <roupi.rb> what the pagma threadvar does there |
08:52:12 | FromDiscord | <roupi.rb> i dont see any spawn |
08:52:37 | FromDiscord | <enthus1ast> i mean starts a "co routine" with asyncCheck |
08:53:26 | FromDiscord | <enthus1ast> in the server code when it would be written like↵`await processClient`↵it could only process 1 client |
08:53:49 | FromDiscord | <enthus1ast> because it would not accept new connections, since the processClient does not return |
08:54:56 | FromDiscord | <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:04 | FromDiscord | <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:35 | FromDiscord | <roupi.rb> i mean what would be the problem if you removed the threadvar pragma of clients ? |
08:58:56 | FromDiscord | <enthus1ast> thats a good question, no idea why its in there |
08:59:20 | FromDiscord | <enthus1ast> no threads are used here |
09:00:09 | FromDiscord | <enthus1ast> in general, when multiple threads access the same variable, you must guard the access with locks |
09:01:20 | FromDiscord | <roupi.rb> now i reached the fun part making unit tests |
09:02:16 | FromDiscord | <enthus1ast> i like them, i like to think of ways to break my code \:) |
09:04:02 | FromDiscord | <roupi.rb> im thinking of spawning a new server process while running the tests |
09:04:25 | FromDiscord | <roupi.rb> and do the assertions using the client code |
09:04:40 | FromDiscord | <enthus1ast> when its pure async, you can do client and server in the same process |
09:05:36 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/8kOP1 |
09:05:49 | FromDiscord | <enthus1ast> idk how the threaded code haves |
09:05:50 | * | ntat quit (Quit: leaving) |
09:05:53 | FromDiscord | <enthus1ast> behaves |
09:07:01 | FromDiscord | <roupi.rb> i should try to do some integration tests |
09:09:01 | FromDiscord | <enthus1ast> we also have two testing utilities in nim,↵unittests↵and testament |
09:10:53 | FromDiscord | <roupi.rb> im using unittest2 |
09:11:23 | FromDiscord | <roupi.rb> it is similar to minitest in ruby |
09:11:30 | FromDiscord | <enthus1ast> with testament you can also test for compile time exceptions |
09:11:34 | FromDiscord | <enthus1ast> https://github.com/enthus1ast/nimja/blob/master/tests/basic/test_tokens_before_extend_error.nim |
09:11:55 | FromDiscord | <enthus1ast> it is controlled by the comment at the top |
09:12:42 | FromDiscord | <enthus1ast> in nimja i use both testament and unittests in some occasions |
09:13:40 | FromDiscord | <enthus1ast> testament to run the differents tests from the test dir, and unittests inside the module |
09:16:14 | NimEventer | New 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:43 | NimEventer | New thread by Qtless: Open file at compile-time [JS backend], see https://forum.nim-lang.org/t/10392 |
09:21:11 | Amun-Ra | that's not a compile time |
09:23:36 | FromDiscord | <enthus1ast> its a macro |
09:37:39 | FromDiscord | <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:51 | FromDiscord | <Phil> (edit) "that" => "the other" |
09:38:02 | FromDiscord | <Phil> (edit) "give" => "send" | "a shoutout," => "amessage," |
09:50:27 | FromDiscord | <roupi.rb> nim doest support monkey patching ? |
09:53:45 | FromDiscord | <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:38 | Amun-Ra | not directly |
09:54:39 | FromDiscord | <enthus1ast> you mean change code at runtime? |
09:54:57 | Amun-Ra | roupi.rb: that's --import and nimscript's patch_file: https://nim-lang.org/docs/nimscript.html#patchFile%2Cstring%2Cstring%2Cstring |
09:55:18 | Amun-Ra | that's → there's |
09:58:17 | FromDiscord | <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:47 | Amun-Ra | yes, there's no monkey-patching like in python/ruby |
10:10:45 | FromDiscord | <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:41 | FromDiscord | <enthus1ast> folks, how you handle secrets in your code? |
10:13:20 | FromDiscord | <enthus1ast> so, when you need to add api keys / password etc to test a thing but still want to commit to git? |
10:14:05 | FromDiscord | <enthus1ast> environment variables? |
10:14:08 | FromDiscord | <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:31 | Amun-Ra | env vars / config files in xfg |
10:14:33 | Amun-Ra | xdg |
10:14:34 | FromDiscord | <Phil> That JSON file I read in on startup in a read-only manner |
10:14:54 | FromDiscord | <enthus1ast> xfg? |
10:14:59 | Amun-Ra | xdg |
10:14:59 | FromDiscord | <enthus1ast> ah |
10:16:05 | FromDiscord | <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:44 | FromDiscord | <odexine> Environment variables and using the SystemD secrets system |
10:17:15 | FromDiscord | <Phil> TIL systemD has a secrets system, that I might actually want to look into instead of writing my own stuff |
10:17:21 | FromDiscord | <enthus1ast> SystemD secrets system, never heared of this |
10:17:22 | FromDiscord | <odexine> Then again I guess a secrets file would work with that too |
10:18:26 | FromDiscord | <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:27 | FromDiscord | <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:58 | FromDiscord | <odexine> https://systemd.io/CREDENTIALS/ |
10:20:08 | FromDiscord | <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:11 | FromDiscord | <roupi.rb> (edit) "then" => "them" |
10:20:21 | FromDiscord | <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:24 | FromDiscord | <roupi.rb> you just update the encrypted file |
10:21:07 | FromDiscord | <roupi.rb> and commit, then you dont have to update anything on the other services |
10:21:37 | FromDiscord | <odexine> I actively try not to have containers on my systems ever :baqua: |
10:21:55 | FromDiscord | <roupi.rb> (edit) "githubaction" => "githubactions" |
10:22:12 | FromDiscord | <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:32 | FromDiscord | <Phil> It's not as boring as the other stuff I really should be learning to deal with better >_> |
10:23:07 | FromDiscord | <enthus1ast> cool i'll read about systemd secrets |
10:24:05 | FromDiscord | <enthus1ast> thing is, i try to not rely on os stuff for my coe |
10:24:06 | FromDiscord | <enthus1ast> code |
10:24:31 | FromDiscord | <enthus1ast> but its still interesting |
10:25:21 | FromDiscord | <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:43 | FromDiscord | <Phil> I feel like assuming a linux environment is an alright base-assumption to make in those scenarios |
10:25:52 | FromDiscord | <Phil> (edit) "I feel like assuming ... a" added "you always deploy to" |
10:26:21 | FromDiscord | <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:28 | FromDiscord | <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:10 | FromDiscord | <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:23 | FromDiscord | <enthus1ast> i have "geinglischt" |
10:27:37 | FromDiscord | <Phil> Not the denglisch! |
10:27:45 | FromDiscord | <enthus1ast> nope not that one \:) |
10:28:01 | FromDiscord | <enthus1ast> yeah it runs on a server |
10:28:45 | FromDiscord | <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:09 | FromDiscord | <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:03 | FromDiscord | <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:37 | FromDiscord | <enthus1ast> haha |
10:30:39 | FromDiscord | <enthus1ast> yeah |
10:30:51 | FromDiscord | <enthus1ast> i also switched to linux as my daily work os |
10:30:55 | FromDiscord | <enthus1ast> works good |
10:31:44 | FromDiscord | <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:00 | FromDiscord | <enthus1ast> teams also blows on macos |
10:32:39 | FromDiscord | <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:51 | FromDiscord | <enthus1ast> my feeling is that is was rushed, because of the sucess of zoom |
10:34:01 | FromDiscord | <enthus1ast> but i do not use it regulary |
10:34:04 | FromDiscord | <enthus1ast> regularily |
10:34:19 | FromDiscord | <Zoom> What success? \:/ |
10:34:39 | FromDiscord | <enthus1ast> the zoom application \:P |
10:34:56 | FromDiscord | <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:08 | FromDiscord | <odexine> In reply to @Zoom "What success? \:/": Oof. |
10:36:27 | FromDiscord | <enthus1ast> what do you think is the correct order of config\:↵↵config file -\> env vars -\> parameters? |
10:37:11 | FromDiscord | <enthus1ast> so env var overwrite settings in the config file, application parameters overwrite env vars and config files settings |
10:37:45 | FromDiscord | <Phil> Application parameters as in flags you start the application with? |
10:37:50 | FromDiscord | <enthus1ast> yes |
10:39:05 | FromDiscord | <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:50 | FromDiscord | <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:55 | FromDiscord | <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:35 | FromDiscord | <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:02 | FromDiscord | <enthus1ast> mh how was the name of the convention "12 steps app" or something.... |
10:41:11 | FromDiscord | <Phil> ? |
10:41:27 | FromDiscord | <enthus1ast> https://12factor.net/ |
10:41:47 | FromDiscord | <enthus1ast> https://12factor.net/config |
10:42:04 | FromDiscord | <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:15 | FromDiscord | <Phil> (edit) "staring at" => "opening" | "openinga ... JSONand" added "single" | "asingleJSON file ... " added "and staring" |
10:44:14 | FromDiscord | <enthus1ast> mh yeah i also like config files better, but the (second) link is sent has some valid points |
10:44:45 | FromDiscord | <enthus1ast> link i sent |
10:46:13 | FromDiscord | <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:45 | FromDiscord | <odexine> if you want to be pretty insane, there's this config language called dhall... |
10:47:46 | FromDiscord | <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:20 | FromDiscord | <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:32 | FromDiscord | <enthus1ast> dhall .. |
10:49:46 | FromDiscord | <odexine> hahaha |
10:50:47 | FromDiscord | <enthus1ast> nim for config files would be nice, and i did explored it a little, but its too complicated |
10:51:11 | FromDiscord | <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:19 | FromDiscord | <Phil> (edit) "don'T" => "don't" |
10:51:52 | FromDiscord | <odexine> some other time then |
10:52:19 | FromDiscord | <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:59 | FromDiscord | <roupi.rb> In reply to @enthus1ast "nim for config files": it would require some fun metaprograming maybe |
10:56:14 | PMunch | enthus1ast, did someone say Nim for configuration? |
10:56:16 | FromDiscord | <Phil> I mean, the configs must be runtime loadable, so like... how? |
10:56:27 | PMunch | I've played around with ideas like this |
10:56:33 | FromDiscord | <roupi.rb> in ruby thats pretty common to use ruby to config things |
10:56:44 | PMunch | (haven't read your conversation, so not sure if this is entirely off-topic) |
10:57:00 | FromDiscord | <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:30 | FromDiscord | <Phil> And all of that seems like too much effort for just needing a config file |
10:58:19 | PMunch | Basically 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:32 | FromDiscord | <roupi.rb> runtime import |
11:00:38 | FromDiscord | <odexine> there's the problem of potentially untrusted "config" to be loaded |
11:00:46 | FromDiscord | <odexine> and ofc the halting problem |
11:01:10 | FromDiscord | <odexine> would you like your program to infinitely stall at your config... |
11:02:58 | FromDiscord | <roupi.rb> if you can debug where it is stalling |
11:03:02 | FromDiscord | <roupi.rb> i dont see the problem |
11:03:52 | FromDiscord | <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:08 | FromDiscord | <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:04 | FromDiscord | <odexine> i dont know why i said again, disregard that lol |
11:09:25 | PMunch | Hmm, is there a Git tutorial that is structured as a Git repository? |
11:09:57 | PMunch | I.e. you just clone the repo, then read the README and learn more and more Git commands as you navigate the repo? |
11:12:32 | FromDiscord | <Phil> Never heard of such a thing |
11:14:20 | PMunch | I feel like it should be a thing.. |
11:14:30 | PMunch | But I haven't heard of it either |
11:14:40 | FromDiscord | <roupi.rb> there are some cool things you can do when you use a programming language as config file |
11:15:43 | FromDiscord | <enthus1ast> yeah nimscript |
11:16:27 | FromDiscord | <enthus1ast> but its a little fragile as you pointed out |
11:17:03 | FromDiscord | <roupi.rb> like running model updates in a migration like here: https://media.discordapp.net/attachments/371759389889003532/1139155445165072446/image.png |
11:17:52 | FromDiscord | <enthus1ast> is this ruby? |
11:17:55 | FromDiscord | <roupi.rb> yes |
11:18:54 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "You'd need to turn": Nimscripter for Nimscript configs, easy, no? |
11:18:57 | FromDiscord | <enthus1ast> after my nimscript config experiments i tried lua with nim, which is actually quite nice, but its not nim \:) |
11:19:16 | FromDiscord | <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:33 | FromDiscord | <Phil> (edit) "ro" => "or" |
11:19:40 | FromDiscord | <Chronos [She/Her]> Fair |
11:19:47 | FromDiscord | <Chronos [She/Her]> In reply to @enthus1ast "after my nimscript config": Yeah agreed |
11:20:21 | FromDiscord | <enthus1ast> i found it quite hard to use the compiler as a lib, i'm too stupid for this i guess |
11:20:36 | FromDiscord | <enthus1ast> or i do not know enough about nim internals |
11:33:42 | FromDiscord | <enthus1ast> if you're interested, this is what i've experimented with |
11:33:53 | FromDiscord | <enthus1ast> https://play.nim-lang.org/#ix=4D3z |
11:36:18 | PMunch | enthus1ast, have you seen NimScripter? |
11:37:27 | FromDiscord | <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:29 | FromDiscord | <enthus1ast> then the config itself looked like this |
11:37:30 | FromDiscord | <enthus1ast> https://play.nim-lang.org/#ix=4D3B |
11:37:39 | FromDiscord | <enthus1ast> with tousands of lines |
11:38:28 | FromDiscord | <enthus1ast> yes, i think this code predates nimscripter↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
11:39:36 | PMunch | My 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:30 | PMunch | Appears to be similar to what you're doing there |
11:40:33 | FromDiscord | <enthus1ast> yes |
11:41:41 | NimEventer | New Nimble package! fastpnm - fast PNM (.pbm .pgm .ppm) parser, see https://github.com/hamidb80/fastpnm |
11:42:44 | FromDiscord | <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:15 | FromDiscord | <enthus1ast> have used, i diched the whole thing |
11:43:33 | PMunch | Why did you ditch it? |
11:44:19 | * | xet7 joined #nim |
11:44:44 | FromDiscord | <enthus1ast> the main reason was that it was way to slow to compile |
11:45:21 | FromDiscord | <enthus1ast> and i was moving fast while experimenting |
11:46:00 | PMunch | I'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:11 | PMunch | Ah the whole NimScript embedded thing was slow? |
11:46:34 | FromDiscord | <enthus1ast> Compiling the compiler was quite slow yes |
11:46:52 | FromDiscord | <enthus1ast> it increased the compile time by maybe 2 - 3 times |
11:47:02 | PMunch | I 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:50 | FromDiscord | <enthus1ast> i thought he's full on the webasm trip |
11:47:52 | FromDiscord | <Phil> I mean configs as dynamic library is the only sensible thing, no? |
11:48:02 | FromDiscord | <Phil> Configs are supposed to be runtime changeable values, is my understanding of them at least |
11:48:30 | FromDiscord | <enthus1ast> yeah the config is in plain text and is interpreted by the nimvm |
11:48:32 | PMunch | Oh I'm talking about having the NimScript evaluation engine as a dynamic library. Config would still be scripts |
11:48:33 | FromDiscord | <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:03 | PMunch | Yeah this is using the Nim VM as a DLL, and that loads NimScript files |
11:49:18 | FromDiscord | <Phil> That sounds like a wild thing to do |
11:49:19 | FromDiscord | <enthus1ast> maybe i could just compile the code above as a dll and |
11:49:24 | PMunch | Of course you could compile Nim modules and execute them to get your configs as well |
11:49:31 | FromDiscord | <jmgomez> Yes, that does work. I do that for NimForUE |
11:49:55 | FromDiscord | <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:34 | PMunch | Well, then everyone who wants to configure anything would need to have the Nim compiler installed |
11:50:47 | FromDiscord | <Phil> Fair |
11:50:57 | PMunch | With NimScript there would only be the NimScripter DLL shipped with your program. |
11:51:06 | PMunch | Well, and the standard library I guess.. |
11:51:33 | FromDiscord | <Phil> Entire std lib? Wouldn't it have to be the subset that works with nimscript? |
11:51:42 | PMunch | Sure |
11:51:57 | PMunch | But it's easier to just ship the entire thing |
11:52:18 | PMunch | I wrote about it here: https://peterme.net/creating-condensed-shared-libraries-embedding-nimscript-pt-3.html |
11:52:29 | FromDiscord | <Chronos [She/Her]> How would I support the `stint` library without declaring it as an explicit dependency... |
11:52:49 | FromDiscord | <Chronos [She/Her]> Like, if it's used, it is supported, but also works on the normal int data types |
11:53:19 | FromDiscord | <Phil> Are the types in stint distinctly different from int? |
11:53:48 | FromDiscord | <Phil> as in, would they be accepting into a proc such as `proc a(x: int) = echo "bla"`? |
11:53:55 | FromDiscord | <Phil> (edit) "accepting" => "accepted" |
11:54:08 | FromDiscord | <enthus1ast> you could overload like↵↵proc a(x\: int \| stintInt) |
11:54:24 | FromDiscord | <Phil> In reply to @enthus1ast "you could overload like": That would require having the dependency to have the types |
11:54:35 | FromDiscord | <enthus1ast> yes true |
11:54:41 | FromDiscord | <enthus1ast> concept? |
11:54:42 | PMunch | Generics I guess |
11:54:43 | FromDiscord | <Phil> The only way to get around that in particular is to swap to concepts |
11:54:44 | PMunch | Or concepts |
11:54:59 | FromDiscord | <Phil> generics with concepts basically |
11:55:10 | PMunch | Well generics by themselves would work, but you'd have to keep them open to anything |
11:55:23 | FromDiscord | <Phil> Yeah fair |
11:57:55 | FromDiscord | <.maverk> https://media.discordapp.net/attachments/371759389889003532/1139165726964461638/442.PNG |
11:57:57 | FromDiscord | <.maverk> why not compiling ? |
11:59:12 | PMunch | .maverk, you appear to not have GCC installed |
11:59:20 | PMunch | Did you run `finish.exe` after installing? |
11:59:40 | FromDiscord | <Phil> What's the name of whatever compiler windows uses by default and could that be substituted in by default? |
11:59:50 | FromDiscord | <Phil> That would teach a valuable lesson in compiler flags! |
11:59:51 | PMunch | vcc? |
11:59:57 | FromDiscord | <leetnewb> mingw? |
12:00:04 | FromDiscord | <.maverk> yes gcc is not installed |
12:00:08 | FromDiscord | <.maverk> should be installed ? |
12:00:50 | PMunch | Yes, 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:53 | FromDiscord | <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:14 | FromDiscord | <.maverk> it is easy to install |
12:02:21 | FromDiscord | <.maverk> i will install it then |
12:04:21 | FromDiscord | <Phil> --cc:mingw ? |
12:04:30 | FromDiscord | <.maverk> pacman -S mingw-w64-ucrt-x86_64-gcc |
12:04:37 | FromDiscord | <.maverk> through msys |
12:04:43 | FromDiscord | <Phil> Or what would the flag be? |
12:04:56 | FromDiscord | <.maverk> pacman -S --needed base-devel mingw-w64-x86_64-toolchain |
12:04:58 | FromDiscord | <.maverk> this |
12:05:22 | FromDiscord | <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:35 | FromDiscord | <.maverk> In reply to @isofruit "The fact you have": hhhhhhh |
12:05:38 | FromDiscord | <Phil> Wait a sec, that is a pacman install command |
12:05:46 | FromDiscord | <.maverk> yeah |
12:06:12 | FromDiscord | <Phil> Are you running the Linux vm on windows thing? |
12:06:37 | FromDiscord | <.maverk> no i am on windows |
12:06:59 | FromDiscord | <Phil> 🤷 to each their own setup then |
12:07:32 | FromDiscord | <.maverk> https://media.discordapp.net/attachments/371759389889003532/1139168151049879562/3.PNG |
12:07:43 | FromDiscord | <heysokam> In reply to @isofruit "The fact you have": mingw has pacman |
12:07:44 | FromDiscord | <.maverk> it is installing |
12:07:52 | FromDiscord | <heysokam> as its default package manager |
12:08:00 | FromDiscord | <.maverk> yeah exactly |
12:08:16 | FromDiscord | <.maverk> i can share the docs if you guys want |
12:08:22 | FromDiscord | <.maverk> 😇 |
12:08:55 | FromDiscord | <Phil> No need, I'm staying as far away from windows as physically possible |
12:09:17 | FromDiscord | <.maverk> hhhhh |
12:09:34 | FromDiscord | <odexine> What in the fuck |
12:09:37 | FromDiscord | <Phil> I have like 3 computers and 3 different Linux distros on them, I'm good |
12:09:38 | FromDiscord | <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:43 | FromDiscord | <.maverk> i use windows for developing software |
12:09:44 | FromDiscord | <odexine> Windows is cursed… |
12:10:13 | FromDiscord | <.maverk> In reply to @heysokam "<@1021771961040375900> next time just": i used to use msys |
12:10:20 | FromDiscord | <.maverk> i used c for many years |
12:10:21 | FromDiscord | <enthus1ast> idk if msys binaries are on the path |
12:10:26 | FromDiscord | <heysokam> ah kk, then all good |
12:10:51 | FromDiscord | <enthus1ast> could be that you must add them |
12:10:52 | FromDiscord | <leetnewb> pretty sure choosenim installs mingw |
12:12:14 | NimEventer | New thread by SmutnyNosacz: Type class that is "anything but X", see https://forum.nim-lang.org/t/10393 |
12:16:18 | FromDiscord | <enthus1ast> but mingw is quite old |
12:16:31 | FromDiscord | <enthus1ast> its perfectly valid to get a recent gcc via msys |
12:17:32 | FromDiscord | <heysokam> sent a long message, see http://ix.io/4D3P |
12:17:44 | PMunch | I thought Nim shipped a compiler with it? |
12:17:54 | PMunch | Or that `finish.exe` grabbed one from somewhere |
12:19:00 | PMunch | Yeah, 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:26 | FromDiscord | <enthus1ast> @heysokam\: re , nre , nitely/nim-regex |
12:19:47 | FromDiscord | <enthus1ast> maybe glob |
12:20:01 | PMunch | Even 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:17 | PMunch | .maverk ^ |
12:20:31 | FromDiscord | <.maverk> what else missing ? https://media.discordapp.net/attachments/371759389889003532/1139171415250182184/rr.PNG |
12:20:57 | PMunch | Please just follow the install instructions.. |
12:20:57 | FromDiscord | <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:40 | FromDiscord | <enthus1ast> i usually try to avoid regex to solve problems |
12:21:40 | PMunch | Or even better, just do it through `choosenim`: https://github.com/dom96/choosenim#installation |
12:22:07 | FromDiscord | <enthus1ast> just gives me more problems \:) |
12:23:45 | FromDiscord | <.maverk> In reply to @PMunch "Or even better, just": hmmm can i trust it ? is it from nim officially ? |
12:23:54 | FromDiscord | <enthus1ast> i use it |
12:24:00 | FromDiscord | <enthus1ast> it works good so far |
12:24:27 | FromDiscord | <enthus1ast> dom96 is well know in the nim community |
12:24:29 | FromDiscord | <leetnewb> might play whack-a-mole with windows defender trying to get it to go right |
12:25:28 | FromDiscord | <heysokam> In reply to @enthus1ast "i usually try to": if you have any ideas, im all ears |
12:25:44 | FromDiscord | <enthus1ast> idk what you wanna do |
12:25:47 | FromDiscord | <heysokam> I just have no single clue how to replace a prefix with another prefix without touching the rest |
12:26:31 | FromDiscord | <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:46 | FromDiscord | <heysokam> I need it to match a pattern, because the letter after needs to remain untouched |
12:27:14 | FromDiscord | <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:49 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "as in, would they": Don't think so |
12:28:14 | FromDiscord | <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:27 | FromDiscord | <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:31 | FromDiscord | <Chronos [She/Her]> Actually no |
12:28:34 | FromDiscord | <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:36 | FromDiscord | <Chronos [She/Her]> Because nimble would throw a fit |
12:28:40 | FromDiscord | <Chronos [She/Her]> Sigh |
12:29:01 | FromDiscord | <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:03 | PMunch | .maverk, it is listed at the bottom of the install page, not sure how much more official you want it |
12:30:33 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/qBQVD |
12:31:18 | FromDiscord | <enthus1ast> or another api, that returns bool on change and accepts a var str idk what fits your needs |
12:32:13 | FromDiscord | <enthus1ast> or maybe i do not understand, it seems more complicated? |
12:34:17 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4D3V |
12:34:45 | FromDiscord | <heysokam> i would have no issues if they were individual strings, like you mentioned with `startsWith` |
12:35:00 | FromDiscord | <enthus1ast> is the file seperated by newline? |
12:35:17 | FromDiscord | <heysokam> yeah, but the matches are not at the start of the line necessarily |
12:35:33 | FromDiscord | <heysokam> as in probably most likely wont be in like 50-60% of the cases or more |
12:35:36 | FromDiscord | <enthus1ast> then march through the line |
12:46:32 | * | xet7 quit (Remote host closed the connection) |
12:53:35 | FromDiscord | <enthus1ast> @heysokam\: this maybe? https://play.nim-lang.org/#ix=4D42 |
12:53:42 | FromDiscord | <enthus1ast> oh bugs |
12:54:31 | FromDiscord | <enthus1ast> https://play.nim-lang.org/#ix=4D43 |
12:57:22 | FromDiscord | <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:44 | FromDiscord | <enthus1ast> > overly complicated↵> maybe |
12:57:46 | FromDiscord | <heysokam> that's the whole reason for the problem, basically |
12:58:56 | FromDiscord | <heysokam> Ideally I would want `Prefix([A-Z][a-zA-Z])` so that I can then `normalize( $1 )` |
12:59:09 | FromDiscord | <heysokam> (edit) "`Prefix([A-Z][a-zA-Z])`" => "to match `SomePrefix([A-Z][a-zA-Z])`" |
12:59:44 | FromDiscord | <heysokam> I guess I could use your method and pattern match every word or something 🤔↵slow, but might work |
13:00:35 | FromDiscord | <enthus1ast> i mean, you're not me, if you like regex then use it \:) |
13:00:51 | FromDiscord | <heysokam> i don't like it, i just want to do the thing in whatever way its doable, that's all |
13:00:58 | FromDiscord | <heysokam> (edit) "i don't like ... it," added "it and I don't dislike" |
13:02:34 | FromDiscord | <odysseus> Hello, can I ask a question (using a simple example implementing the Collatz conjecture) regarding the use of procedures? |
13:02:35 | FromDiscord | <enthus1ast> i think the reason it might be slow is that it scans the string multipe times |
13:04:10 | FromDiscord | <odysseus> sent a long message, see http://ix.io/4D47 |
13:04:41 | FromDiscord | <enthus1ast> odysseus\: i think the identation is messed up |
13:04:47 | FromDiscord | <odysseus> (Assume that the idnentation is correct \:-) ) |
13:05:24 | FromDiscord | <enthus1ast> wrap the code in triple \` |
13:08:38 | FromDiscord | <enthus1ast> in the last one |
13:08:39 | FromDiscord | <enthus1ast> the 7 is a literal and not a var |
13:08:39 | FromDiscord | <odysseus> yes, why? |
13:08:40 | FromDiscord | <enthus1ast> var foo = 7↵echo FindCollatzSeq(foo) |
13:08:41 | FromDiscord | <odysseus> so? |
13:08:41 | FromDiscord | <odysseus> Can I fix it? |
13:08:41 | FromDiscord | <enthus1ast> so this matches at least the proc definition |
13:08:42 | FromDiscord | <odysseus> because I find it stupid to use two vars |
13:09:07 | FromDiscord | <odysseus> Can I use the second way without the literal? |
13:09:18 | FromDiscord | <enthus1ast> `proc FindCollatzSeq(inside: VAR int): seq[int] =`says, `inside` must be a var |
13:09:27 | FromDiscord | <enthus1ast> but 7 is a literal |
13:09:30 | FromDiscord | <enthus1ast> and no var |
13:09:42 | FromDiscord | <odysseus> so how can I convert it? |
13:09:57 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D4a |
13:10:28 | FromDiscord | <odysseus> Still... it tried! |
13:11:12 | FromDiscord | <odysseus> No sorry...is OK |
13:11:20 | FromDiscord | <odysseus> Thank you very much! |
13:11:24 | FromDiscord | <enthus1ast> np |
13:11:56 | FromDiscord | <enthus1ast> btw |
13:12:01 | FromDiscord | <enthus1ast> you can use the results variable |
13:12:05 | FromDiscord | <enthus1ast> result |
13:12:18 | * | rockcavera joined #nim |
13:12:46 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D4b |
13:13:06 | FromDiscord | <enthus1ast> then you can also omit the return Collatz\_sequence sice its implicit |
13:14:29 | FromDiscord | <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:41 | FromDiscord | <enthus1ast> in nim its typical to use the result var |
13:14:47 | PMunch | If you just want it on one line you can always do: https://play.nim-lang.org/#ix=4D4d |
13:16:40 | FromDiscord | <odysseus> sorry, I re-read it...and confused...did you mean something like\: |
13:16:59 | FromDiscord | <odysseus> sent a code paste, see https://paste.rs/FqA1G |
13:17:02 | FromDiscord | <enthus1ast> no need for `return result` |
13:17:07 | FromDiscord | <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:10 | FromDiscord | <enthus1ast> it is implicitly returned |
13:18:38 | FromDiscord | <odysseus> Could you please, modify my example and pass it in here, because I do not get? |
13:18:57 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D4f |
13:19:54 | FromDiscord | <odysseus> Thank you very much |
13:21:22 | FromDiscord | <enthus1ast> i would also name it findCollatzSeq, by convention procs in nim start with a small letter |
13:21:38 | PMunch | Hmm, anyone know how to make gdb ignore #line directives and show me the underlying C code? |
13:21:50 | PMunch | I have a suspicion that it is lying to me.. |
13:21:56 | FromDiscord | <odysseus> thanks ... I am trying to diggest the new version ;-) |
13:23:28 | PMunch | `while inside >= 1: if inside == 1: break`, uhm, couldn't you just say `while inside > 1`? |
13:24:49 | FromDiscord | <enthus1ast> `result` is automatically declared as the return type you specified, and when your proc/func/method ends it is returned automatically |
13:25:49 | FromDiscord | <odysseus> regardless of the return type (int, float, seq, tuple, etc) ? Nice! Thank you... it is my 3rd day in Nim |
13:25:57 | FromDiscord | <odexine> In reply to @odysseus "regardless of the return": yes regardless |
13:26:44 | FromDiscord | <odysseus> Thank you↵(@odexine) |
13:26:48 | FromDiscord | <enthus1ast> odysseus\: i hope you like it, Nim is a wonderful lang \:) |
13:27:21 | FromDiscord | <odysseus> Well, essentially, it is my first language in general (barring Wolfram) |
13:28:07 | FromDiscord | <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:59 | FromDiscord | <odysseus> I have some Scheme in the past... weird... especially the recursive procedures...and computationally expensive |
13:29:33 | FromDiscord | <odysseus> But yes, so far nice... |
13:29:50 | FromDiscord | <odysseus> Thank you again my friends! |
13:30:14 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/QryDA |
13:30:27 | FromDiscord | <enthus1ast> all of them are valid |
13:30:44 | FromDiscord | <odysseus> I prefer the 1st way though...more functional (in the mathematical sense) |
13:32:13 | PMunch | Hmm, there is --lineDir:off. But that doesn't help me debug the crash I have now |
13:32:25 | PMunch | Basically my script crashes every now and again |
13:32:35 | PMunch | Can go days between a crash |
13:33:08 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D4k |
13:33:11 | PMunch | But 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:36 | FromDiscord | <enthus1ast> Do you use threads or dlls? |
13:45:04 | PMunch | Who me? |
13:55:19 | PMunch | I have --threads:off and don't explicitly load any dynamic libraries |
13:55:28 | PMunch | Not sure if any of my dependencies does though.. |
14:10:37 | FromDiscord | <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:07 | FromDiscord | <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:23 | FromDiscord | <Phil> (edit) "Object call" => "`x.method(y)`" |
14:11:45 | FromDiscord | <Phil> `bla(x, y)` if there is no real protagonist/the parameters need to be mixed together anyhow |
14:12:03 | FromDiscord | <Phil> You can express based on your mental model and apply emphasis using this, I really like it |
14:12:23 | FromDiscord | <Phil> (edit) "apply emphasis" => "can emphasize the first parameter if it's important" |
14:12:54 | * | ntat joined #nim |
14:17:49 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4D4u |
14:17:55 | FromDiscord | <enthus1ast> syntax |
14:18:08 | FromDiscord | <enthus1ast> nice for barriers or cleaning up etc. |
14:26:00 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D4x |
14:42:14 | FromDiscord | <acomab> no wonder my computer has been running hot all day... https://media.discordapp.net/attachments/371759389889003532/1139207079333212221/image.png |
14:42:26 | FromDiscord | <acomab> i think this is a bug with the vim vscode extension, not sure |
14:43:29 | * | jmdaemon joined #nim |
14:46:16 | FromDiscord | <djazz> How does nimsuggest work btw? |
14:46:42 | FromDiscord | <djazz> Also noticed the high cpu load |
14:46:59 | FromDiscord | <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:17 | FromDiscord | <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:31 | FromDiscord | <jmgomez> (edit) "first it" => "formerit" |
14:49:04 | FromDiscord | <bung8954> the high cpu usage is wrong, try use devel |
14:49:33 | FromDiscord | <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:35 | FromDiscord | <leorize> nimsuggest eating cpu is a known issue |
14:49:56 | FromDiscord | <leorize> `@#v1.3` suffix |
14:50:08 | FromDiscord | <Phil> One that'll require major work from what I'm aware of |
14:50:11 | FromDiscord | <leorize> drop the `@`, only `#` |
14:52:27 | FromDiscord | <enthus1ast> but now ... |
14:52:28 | FromDiscord | <enthus1ast> hu strange i tried it and failed |
14:52:28 | FromDiscord | <leorize> commits are always safer |
14:52:28 | FromDiscord | <leorize> I'm not gonna recommend doing it like that, since nimble can be very finicky with how it interpret branches |
14:52:29 | FromDiscord | <leorize> (though with lockfiles it might have become less of an issue) |
14:52:29 | FromDiscord | <enthus1ast> strange now it work |
14:52:29 | FromDiscord | <enthus1ast> weird |
14:52:31 | FromDiscord | <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:26 | FromDiscord | <arathanis> i was hoping atlas was going to be part of the toolchain for nim 2.0 |
15:48:43 | FromDiscord | <arathanis> is the correct way to use atlas just to clone it, compile it, and add it to my path? |
15:48:54 | FromDiscord | <arathanis> or did i miss a step somewhere? |
15:57:24 | FromDiscord | <leetnewb> I found that using choosenim had path issues out of the box with atlas |
15:57:52 | FromDiscord | <leetnewb> binary was there, so I dropped a symlink where it needed to be |
16:01:37 | FromDiscord | <roupi.rb> how do i run a proc in as a child process ? |
16:02:20 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D51 |
16:02:29 | * | lucasta joined #nim |
16:03:29 | FromDiscord | <arathanis> In reply to @leetnewb "binary was there, so": oh the binary is present its just hooking it up right? |
16:03:52 | FromDiscord | <arathanis> where should i look for the binary? |
16:05:44 | FromDiscord | <leetnewb> How did you install nim? and what operating system? |
16:06:46 | FromDiscord | <odexine> In reply to @isofruit "Hmmm can I "spread": no |
16:07:06 | FromDiscord | <odexine> maybe you can write a curry/uncurry proc |
16:07:22 | FromDiscord | <odexine> i guess it would be named differently in nim tho |
16:07:31 | FromDiscord | <odexine> prolly tuplise/detuplise or whatever |
16:07:34 | FromDiscord | <leetnewb> it's present for me in ~/.choosenim/toolchains/nim-2.0.0/bin/ |
16:09:00 | FromDiscord | <roupi.rb> wait i cant use async on a new thread ? |
16:09:31 | FromDiscord | <roupi.rb> https://media.discordapp.net/attachments/371759389889003532/1139229044991332442/image.png https://media.discordapp.net/attachments/371759389889003532/1139229045263958108/image.png |
16:09:47 | FromDiscord | <roupi.rb> https://media.discordapp.net/attachments/371759389889003532/1139229115216580669/image.png |
16:10:10 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "maybe you can write": Pack and unpack |
16:10:36 | FromDiscord | <Chronos [She/Her]> Or `` which Python does for unpacking |
16:10:51 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Hmmm can I "spread": Oh there's a macro for this too |
16:10:59 | FromDiscord | <Chronos [She/Her]> `unpackVarargs` iirc in std/macros |
16:18:52 | FromDiscord | <litlighilit> sent a long message, see http://ix.io/4D57 |
16:23:09 | FromDiscord | <bostonboston> How do I access compiler switches in my code |
16:24:12 | FromDiscord | <litlighilit> ?You mean \`compileOption\` |
16:24:46 | FromDiscord | <bostonboston> I think what I was looking for is `defined(x)` |
16:24:46 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D59 |
16:24:54 | FromDiscord | <arathanis> In reply to @bostonboston "I think what I": ohhhh |
16:26:58 | FromDiscord | <odexine> In reply to @roupi.rb "": you can, you need to initialise an event loop per thread IIRC |
16:27:07 | FromDiscord | <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:08 | FromDiscord | <odexine> or smth, i dont use threading with async |
16:27:59 | FromDiscord | <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:15 | FromDiscord | <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:28 | FromDiscord | <Phil> (edit) "`tup[0]," => "`testProc(tup[0]," | "tup[2]...`" => "tup[2]...)`" |
16:28:42 | FromDiscord | <Phil> I'll try unpackVarargs in a sec |
16:30:43 | FromDiscord | <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:17 | FromDiscord | <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:34 | FromDiscord | <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:30 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D5d |
16:32:32 | FromDiscord | <Phil> WIth the easiest syntax available 😄 |
16:32:48 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright, thanks!↵So I can query by Vector too? |
16:33:06 | FromDiscord | <Phil> Pretty much |
16:33:20 | FromDiscord | <Phil> One sec, I assume the vectors are value types? |
16:33:24 | FromDiscord | <System64 ~ Flandre Scarlet> yeah |
16:33:31 | FromDiscord | <System64 ~ Flandre Scarlet> they are not ref |
16:33:41 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1139235127747153930/image.png |
16:33:48 | FromDiscord | <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:00 | FromDiscord | <Phil> (edit) "one" => "a ref-type" |
16:34:10 | FromDiscord | <Phil> I have the sneaking suspicion it might be reference equality |
16:34:36 | FromDiscord | <System64 ~ Flandre Scarlet> for non-ref, should be value equality |
16:34:50 | FromDiscord | <Phil> I mean, must be because the stack ain't got nothing else ^^ |
16:36:43 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D5f |
16:37:06 | FromDiscord | <Phil> It can deal with pointers though |
16:39:04 | FromDiscord | <sirolaf> sent a code paste, see https://play.nim-lang.org/#ix=4D5g |
16:40:41 | FromDiscord | <odexine> nim requires the key on tables to be hashable aka have the hash proc defined |
16:41:07 | FromDiscord | <odexine> either in hashes (no need to import) or before usage (so defined above or in an import) |
16:41:12 | FromDiscord | <odexine> (edit) "hashes" => "std/hashes" |
16:41:49 | FromDiscord | <litlighilit> Just overload \`hash\` |
16:42:36 | FromDiscord | <odexine> yeah, more clearly put |
16:48:28 | FromDiscord | <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:39 | FromDiscord | <litlighilit> Yeah, Emm... I mean I agree |
16:53:06 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/fji0U |
16:53:19 | * | lucasta quit (Quit: Leaving) |
17:03:50 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=4D5v |
17:04:25 | FromDiscord | <arathanis> ahh your current namespace does not have the pairs iterator for tables in it |
17:04:43 | FromDiscord | <arathanis> should flatty use `exports` for this? |
17:04:54 | FromDiscord | <treeform> not if you never need a table? |
17:05:01 | FromDiscord | <arathanis> fair |
17:05:04 | FromDiscord | <Matt> Could someone help me see why this code doesn't compile? https://play.nim-lang.org/#ix=4D5w |
17:05:06 | FromDiscord | <arathanis> but also a weird footgun |
17:05:10 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @treeform "Thats a table error.": Oh alright! thanks!↵The error message is confusing |
17:05:33 | FromDiscord | <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:45 | FromDiscord | <treeform> I wish nim will fix this. There is an RFC for this. |
17:06:14 | FromDiscord | <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:48 | FromDiscord | <Matt> So how could I pass in some amount of iterators to test my function? |
17:07:08 | FromDiscord | <Matt> In another language my function would expect something like an Iterable trait/interface etc |
17:08:58 | FromDiscord | <arathanis> In reply to @x.hat "So how could I": probably pass around the sequences themselves, try using "openArray". |
17:09:06 | FromDiscord | <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:46 | FromDiscord | <System64 ~ Flandre Scarlet> Oh, this works https://media.discordapp.net/attachments/371759389889003532/1139244211623964841/image.png |
17:09:57 | FromDiscord | <Matt> @arathanis could you help me understand when we prefer to use seq/openarray/array? |
17:10:09 | FromDiscord | <Matt> So that I can understand why you suggested doing so |
17:10:21 | FromDiscord | <arathanis> In reply to @x.hat "<@136570191038513152> could you help": looks like `openArray` isnt happy being in varargs. |
17:10:33 | qwr | openarray is nice for arguments, if you don't need to be more specific for some reason |
17:10:33 | FromDiscord | <arathanis> the reason we like `openArray` is it makes the proc more usable since it supports many types. |
17:10:43 | FromDiscord | <arathanis> openArray parameters can use arrays, sequences, etc |
17:12:09 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D5z |
17:12:21 | FromDiscord | <arathanis> (edit) "https://play.nim-lang.org/#ix=4D5z" => "https://play.nim-lang.org/#ix=4D5A" |
17:12:28 | qwr | seq has variable length, for array its part of type |
17:13:59 | FromDiscord | <Matt> So would that be preferable (using a vararg of seq to indicate that something is iterable + using openArrays / sequences everywhere)? |
17:14:11 | FromDiscord | <Matt> For context- the function I am trying to write |
17:14:27 | FromDiscord | <Matt> is something that takes a sequence of some arrays / sequences / iterables and then merges them all together |
17:14:34 | FromDiscord | <arathanis> varargs doesnt seem to support `openArray` |
17:15:08 | FromDiscord | <Matt> so seq then^ |
17:15:12 | FromDiscord | <arathanis> In reply to @x.hat "is something that takes": or array |
17:15:18 | FromDiscord | <arathanis> you may write more than one function for multiple types |
17:15:24 | FromDiscord | <Matt> would require them of being const size / known size then, no? |
17:15:31 | FromDiscord | <arathanis> you can do both |
17:15:36 | FromDiscord | <arathanis> to support both |
17:15:41 | FromDiscord | <Matt> That would work for me |
17:15:45 | FromDiscord | <Matt> Is that idiomatic? |
17:15:45 | FromDiscord | <arathanis> but yes, seq sounds like what you want |
17:15:57 | FromDiscord | <arathanis> In reply to @x.hat "Is that idiomatic?": overloading a function based on the type is idiomatic, yes |
17:16:04 | FromDiscord | <Matt> I could keep it a fixed size- would a seqwcap be considered the way to go, or arrays |
17:16:08 | FromDiscord | <arathanis> or using a generic if it makes sense |
17:16:09 | FromDiscord | <Matt> If you have a strong sense |
17:16:12 | FromDiscord | <arathanis> write it first for seq |
17:16:17 | FromDiscord | <arathanis> then you can decide if you need anything else |
17:16:17 | FromDiscord | <Matt> 👍 |
17:16:23 | FromDiscord | <arathanis> what is this function of yours going to do? |
17:16:58 | FromDiscord | <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:49 | FromDiscord | <arathanis> i think an (input, output) pair would help understand |
17:18:58 | FromDiscord | <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:12 | FromDiscord | <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:28 | FromDiscord | <Matt> It's a very basic key-value lsm tree |
17:19:52 | FromDiscord | <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:47 | FromDiscord | <arathanis> In reply to @qwr ". o O (": why does everyone want to clone C's character vomit in their languages |
17:21:14 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "first param not var": Even if I set to var, I have problems |
17:21:36 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1139247187973382235/image.png |
17:21:52 | FromDiscord | <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:05 | FromDiscord | <odexine> are you totally sure stdtables is imported |
17:22:08 | FromDiscord | <odexine> (edit) "stdtables" => "std/tables" |
17:22:44 | FromDiscord | <System64 ~ Flandre Scarlet> Oh forgot to import that again 🤣 |
17:22:53 | FromDiscord | <odexine> 💀 |
17:25:12 | FromDiscord | <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:36 | FromDiscord | <arathanis> In reply to @x.hat "i.e. here's the Python": yes, i knew what language you were referring too haha |
17:25:38 | FromDiscord | <arathanis> nim is not python |
17:25:40 | FromDiscord | <Matt> All g |
17:26:04 | FromDiscord | <Matt> I mean that I am not trying to make it a literal clone, but a practice in idiomatic rewriting |
17:26:07 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "nim is not python": Nim is not Python↵But Nim is better than Python! |
17:26:15 | FromDiscord | <arathanis> In reply to @sys64 "Nim is not Python": i dont agree with this |
17:26:18 | FromDiscord | <Matt> Eh- they have their tradeoffs |
17:26:27 | FromDiscord | <Matt> But before this goes downhill |
17:26:29 | FromDiscord | <arathanis> https://media.discordapp.net/attachments/371759389889003532/1139248418536042536/image.png |
17:26:31 | FromDiscord | <arathanis> bahahaha |
17:26:33 | FromDiscord | <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:44 | FromDiscord | <Matt> Does that help answer the question regarding what function I am looking to implement? |
17:26:48 | FromDiscord | <arathanis> i use them for different things |
17:26:50 | FromDiscord | <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:53 | FromDiscord | <arathanis> In reply to @x.hat "Does that help answer": implement against `seq` |
17:27:10 | FromDiscord | <System64 ~ Flandre Scarlet> but Nim is much more efficient than Python |
17:27:13 | FromDiscord | <arathanis> In reply to @sys64 "why? Well, if it's": different strengths and weaknesses. |
17:27:22 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4D5D |
17:27:31 | FromDiscord | <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:34 | FromDiscord | <Matt> In reply to @odexine "nim iterators are by": I've seen that before! https://github.com/def-/nim-iterutils/commit/63d2891e5d9964c0949cec197fad8df2e7041189 |
17:27:44 | FromDiscord | <odexine> yesa |
17:27:44 | FromDiscord | <odexine> yes |
17:27:47 | FromDiscord | <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:50 | FromDiscord | <odexine> thats prolly what you want to use yes |
17:27:52 | FromDiscord | <Matt> In reply to @arathanis "depends on what kind": I would be interesting in hearing more about your interop actually |
17:28:02 | FromDiscord | <Matt> Interested |
17:28:17 | FromDiscord | <arathanis> In reply to @sys64 "what are pros and": just off the top of my head:↵↵Python's↵- community |
17:28:32 | FromDiscord | <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:33 | FromDiscord | <Matt> 👁️ where it go 👁️ |
17:28:53 | FromDiscord | <Matt> In reply to @isofruit "There are some things": Can you expand on that |
17:28:54 | FromDiscord | <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:58 | FromDiscord | <Matt> As in where it;s useful |
17:29:06 | FromDiscord | <arathanis> sent a long message, see http://ix.io/4D5F |
17:29:09 | FromDiscord | <Matt> something you were implementing where that tradeoff is emphasized |
17:29:22 | FromDiscord | <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:23 | FromDiscord | <Matt> In reply to @isofruit "Particularly a lot of": ++ |
17:29:28 | FromDiscord | <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:36 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4D5H |
17:29:44 | FromDiscord | <arathanis> In reply to @sys64 "Imo having a strict": Python is strictly typed. |
17:29:53 | FromDiscord | <Matt> Python has a bolt-on type system |
17:30:00 | FromDiscord | <Matt> Same as Ruby's Sorbet |
17:30:11 | FromDiscord | <Matt> As someone who's worked extensively w both and worked on Ruby internals |
17:30:12 | FromDiscord | <Matt> I gotta say |
17:30:15 | FromDiscord | <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:21 | FromDiscord | <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:21 | FromDiscord | <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:23 | FromDiscord | <Matt> I would prefer a language-level type system |
17:30:37 | FromDiscord | <Matt> Flow, incremental... verdict's out on that one. |
17:30:37 | FromDiscord | <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:45 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
17:30:51 | FromDiscord | <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:52 | FromDiscord | <Matt> In reply to @isofruit "Generally serialization was where": I see |
17:30:58 | FromDiscord | <System64 ~ Flandre Scarlet> But I have one big problem with Python : SPEED |
17:31:03 | FromDiscord | <arathanis> In reply to @sys64 "Oh alright": static typing in python is optional |
17:31:12 | FromDiscord | <arathanis> so a quick dirty script or fiddling in a REPL? go to town |
17:31:12 | FromDiscord | <Chronos [She/Her]> In reply to @sys64 "Imo having a strict": Inferred types are great |
17:31:26 | FromDiscord | <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:29 | FromDiscord | <arathanis> but anything anyone has to maintain? you can (and should) use types |
17:31:36 | FromDiscord | <odexine> In reply to @chronos.vitaqua "I mean, you could": sounds like an L to me |
17:31:36 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Inferred types are great": Yeah sadly Nim lacks of that |
17:31:37 | FromDiscord | <odexine> :baqua: |
17:31:47 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "I mean, you could": Oh? Will check that right now |
17:31:47 | FromDiscord | <Chronos [She/Her]> In reply to @sys64 "Yeah sadly Nim lacks": Nim uses inferred types |
17:31:49 | FromDiscord | <Matt> Yeah - what's the state of a Jupyter kernel for Nim |
17:32:03 | FromDiscord | <odexine> who are you asking |
17:32:05 | FromDiscord | <Matt> Until that's a thing, toying around is not as easy in some ways |
17:32:10 | FromDiscord | <Matt> Generally asking |
17:32:26 | FromDiscord | <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:33 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "I mean, you could": I looked for it, didn't found it |
17:32:59 | FromDiscord | <Chronos [She/Her]> https://github.com/lcompilers/lpython second result on google |
17:33:08 | FromDiscord | <Chronos [She/Her]> first is the official websitr |
17:33:18 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D5J |
17:33:29 | FromDiscord | <huantian> generics that make sense! |
17:33:41 | FromDiscord | <Phil> sent a long message, see http://ix.io/4D5K |
17:34:00 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "https://github.com/lcompilers/lpython second result": Didn't found it for me, weird |
17:34:03 | FromDiscord | <Phil> (edit) "http://ix.io/4D5K" => "http://ix.io/4D5L" |
17:34:33 | FromDiscord | <arathanis> I hope that answered your question @System64 ~ Flandre Scarlet . |
17:34:51 | FromDiscord | <Chronos [She/Her]> In reply to @sys64 "Didn't found it for": Fair |
17:35:04 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Fair": Wow incredible! Is it usable now? |
17:35:12 | FromDiscord | <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:31 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "I hope that answered": I think Python will add JIT soon? |
17:35:33 | FromDiscord | <Phil> Well, generics in nim anyway |
17:35:33 | FromDiscord | <Chronos [She/Her]> Can't do `def baz(self, s: S) -> Bar[T, S]` |
17:35:34 | FromDiscord | <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:41 | FromDiscord | <Chronos [She/Her]> You have to use a string for it instead |
17:35:44 | FromDiscord | <Chronos [She/Her]> Is annoying |
17:35:52 | FromDiscord | <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:55 | FromDiscord | <Chronos [She/Her]> In reply to @sys64 "I think Python will": Should already be there in 3.12 |
17:35:56 | FromDiscord | <Matt> :| |
17:36:12 | FromDiscord | <arathanis> In reply to @chronos.vitaqua "https://github.com/lcompilers/lpython second result": You can also use Cython or Nuitka! |
17:36:13 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Should already be there": Oh alright, so should be much more faster |
17:36:22 | FromDiscord | <Chronos [She/Her]> In reply to @sys64 "Wow incredible! Is it": I wouldn't know but you can read the page perhaps |
17:36:29 | FromDiscord | <Chronos [She/Her]> In reply to @arathanis "You can also use": Also true |
17:36:45 | FromDiscord | <arathanis> Python is very much worth learning imo. |
17:37:13 | FromDiscord | <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:15 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "You can also use": So Nuitka is like PyToExe? |
17:38:34 | FromDiscord | <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:37 | FromDiscord | <Chronos [She/Her]> In reply to @arathanis "Python is very much": Learnt it as a kid aha |
17:38:51 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "it seems to convert": Oh wow!! |
17:38:55 | FromDiscord | <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:20 | FromDiscord | <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:41 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D5O |
17:39:54 | FromDiscord | <Phil> (edit) "etc." => "etc.↵And all the other fancy schmancy magic you can do when everything is a dictionary" |
17:40:13 | FromDiscord | <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:27 | FromDiscord | <arathanis> I usually use PyInstaller over PyToExe |
17:40:43 | FromDiscord | <arathanis> since its cross platform 😉 |
17:41:21 | FromDiscord | <System64 ~ Flandre Scarlet> Ah yeah, PyInstaller sorry |
17:42:10 | FromDiscord | <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:22 | FromDiscord | <huantian> yeah pyinstaller is nice but still kinda jank |
17:42:32 | FromDiscord | <arathanis> In reply to @chronos.vitaqua "No worries aha, but": depends what you want |
17:42:35 | FromDiscord | <huantian> compared to actual compiled programs |
17:42:38 | FromDiscord | <arathanis> one of the biggest mistakes is pre-mature optimization |
17:42:42 | FromDiscord | <arathanis> python is slower, yes |
17:42:49 | FromDiscord | <arathanis> but is it too slow for what you are doing? |
17:42:59 | FromDiscord | <arathanis> that is the important question |
17:43:18 | FromDiscord | <Chronos [She/Her]> It's unsuited for threading (currently) which I'd imagine is important for chat applications and games |
17:43:36 | FromDiscord | <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:38 | FromDiscord | <Chronos [She/Her]> Tho there's gonna be W.I.P builds that remove the GIL which will be interesting |
17:43:39 | FromDiscord | <arathanis> In reply to @chronos.vitaqua "It's unsuited for threading": yes, though they are removing the GIL. |
17:43:45 | FromDiscord | <Chronos [She/Her]> Yeah |
17:43:49 | FromDiscord | <huantian> well they aren't just removing it but |
17:43:51 | FromDiscord | <jos7388> is there any way to use a specific object variant as a type |
17:43:53 | FromDiscord | <System64 ~ Flandre Scarlet> @arathanis Do I have to pay if I use Nuitka to make a game I want to sell? |
17:44:10 | FromDiscord | <arathanis> In reply to @sys64 "<@136570191038513152> Do I have": i have no idea |
17:44:26 | FromDiscord | <jos7388> https://media.discordapp.net/attachments/371759389889003532/1139252935608512633/image.png |
17:44:28 | FromDiscord | <jos7388> like something like this |
17:44:41 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @arathanis "i have no idea": https://nuitka.net/doc/commercial.html↵Because that makes me confused |
17:45:22 | FromDiscord | <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:37 | FromDiscord | <Phil> That's kind of what object variants are there for, to allow something to be two things at once |
17:45:43 | FromDiscord | <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:44 | FromDiscord | <jos7388> i think u can with a case statement no |
17:46:00 | FromDiscord | <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:06 | FromDiscord | <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:24 | FromDiscord | <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:31 | FromDiscord | <jos7388> ye but u know the type when ur passing it |
17:46:33 | FromDiscord | <jos7388> to the function |
17:46:34 | FromDiscord | <Phil> (edit) "scenario" => "variant" | "will" => "could" |
17:46:38 | FromDiscord | <jos7388> u know what i mean |
17:46:58 | FromDiscord | <Phil> Does your instance exist at compiletime or at runtime? |
17:47:04 | FromDiscord | <Phil> (edit) "Does your ... instance" added "object variant" |
17:47:06 | FromDiscord | <arathanis> In reply to @sys64 "Oh alright, so even": seems to be the case, read their licensing info |
17:47:12 | FromDiscord | <jos7388> https://media.discordapp.net/attachments/371759389889003532/1139253628327182447/image.png |
17:47:14 | FromDiscord | <jos7388> like this |
17:47:29 | FromDiscord | <jos7388> on line 6 it knows that the literal is a number statically |
17:47:41 | FromDiscord | <jos7388> but i dont wanna have another case statement in parseNumber |
17:47:47 | FromDiscord | <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:55 | FromDiscord | <huantian> i wish nim could do that tbh |
17:47:57 | FromDiscord | <jos7388> i could do that |
17:48:04 | FromDiscord | <jos7388> that works i guess |
17:48:06 | FromDiscord | <huantian> and that it had better tracking of object variant state statically |
17:48:34 | FromDiscord | <Phil> I'm not aware of any other way to do this basically |
17:49:55 | FromDiscord | <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:08 | FromDiscord | <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:00 | FromDiscord | <Phil> But that is solely my opinion, other folks of course have their own view on that |
17:52:45 | FromDiscord | <odexine> In reply to @isofruit "Mandatory disclaimer that generics": compilers are just smart lookup tables and copy pasters |
17:53:37 | FromDiscord | <odexine> oh boy sounds like people want flow typing huh |
17:53:50 | FromDiscord | <Phil> ? |
17:54:29 | FromDiscord | <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:43 | FromDiscord | <odexine> In reply to @isofruit "?": type narrowing from conditions |
17:55:08 | FromDiscord | <odexine> like saying `if a in 0..10:` then inside the statement a's type is "0..10" |
17:55:37 | FromDiscord | <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:50 | FromDiscord | <odexine> pretty much i guess |
17:56:32 | FromDiscord | <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:34 | FromDiscord | <jos7388> u could just pass both i guess |
17:56:42 | FromDiscord | <jos7388> rust has the same issue with enums, variants aren't types |
17:56:50 | FromDiscord | <jos7388> although in nim the issue is a little different |
17:57:13 | FromDiscord | <odexine> well this is kinda the same, just that variant discriminators arent types |
17:57:22 | FromDiscord | <odexine> pattern matching where |
17:57:46 | FromDiscord | <jos7388> ye but in nim the variant discriminator doesn't hold the data, the field it guards on the object variant is |
17:57:47 | FromDiscord | <jos7388> (edit) "is" => "does" |
17:57:53 | FromDiscord | <jos7388> in rust the variant discriminator holds the data |
17:57:55 | FromDiscord | <jos7388> so it's even worse |
17:58:17 | FromDiscord | <odexine> oh elixir how you have ruined me `def something(%{kind: "idk smth"} = a)` |
17:58:27 | FromDiscord | <jos7388> whats that do |
17:58:56 | FromDiscord | <odexine> a is bound to a "map" (just think of it as a struct-ish thing) that has kind == "idk smth" |
17:59:14 | FromDiscord | <odexine> and if it doesnt match then it's an error |
18:00:10 | FromDiscord | <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:20 | FromDiscord | <odexine> wonder what a nice solution for this would be in nims case |
18:07:26 | FromDiscord | <Phil> Somehow writing RxNim could solve this I'm sure! |
18:10:32 | FromDiscord | <odexine> phil pls |
18:11:21 | * | jmd_ joined #nim |
18:18:05 | FromDiscord | <Chronos [She/Her]> Pfffff |
18:23:28 | * | jmd_ quit (Ping timeout: 246 seconds) |
18:32:59 | FromDiscord | <System64 ~ Flandre Scarlet> RxNim? |
18:59:56 | FromDiscord | <jos7388> reactive programming patterns |
19:00:04 | FromDiscord | <jos7388> :nervouscart: |
19:01:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @jos7388 "reactive programming patterns": what is this? |
19:01:44 | qwr | arathanis: don't know, but nim seems to have accidentally (reinvent|copied|?) javascript and go behaviour on for loop binding for lambdas |
19:01:58 | FromDiscord | <jos7388> basically when a value changes other expressions are reevaluated |
19:02:25 | FromDiscord | <jos7388> Rx libs expose it with an observable-style API |
19:02:38 | FromDiscord | <jos7388> u can build big chains of reactive expressions and have some other features for escape hatches and whatever |
19:02:45 | FromDiscord | <jos7388> it’s normally used for UI |
19:03:03 | FromDiscord | <jos7388> Svelte adds it as a first class citizen to JS |
19:03:11 | FromDiscord | <jos7388> builds a ui framework around it |
19:05:43 | FromDiscord | <summarity> sent a code paste, see https://play.nim-lang.org/#ix=4D6u |
19:09:12 | FromDiscord | <odysseus> sent a long message, see https://paste.rs/hn1Xo |
19:09:58 | NimEventer | New 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:51 | FromDiscord | <Chronos [She/Her]> In reply to @summarity "I've got a type": Probably have to use unions |
19:10:59 | FromDiscord | <Chronos [She/Her]> So `Foo | Bar | Yep` |
19:15:37 | FromDiscord | <arathanis> In reply to @qwr "<@136570191038513152>: don't know, but": can you elaborate? |
19:16:03 | FromDiscord | <Matt> If I have an iterator, how can I fetch a single value from it |
19:16:39 | FromDiscord | <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:48 | FromDiscord | <arathanis> that is more of a python thing, not sure Nim iterators work that way |
19:18:48 | FromDiscord | <arathanis> I think you might be able to build iterators that way... |
19:19:32 | FromDiscord | <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:26 | nisstyre | wouldn'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:25 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D6G |
19:43:32 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D6H |
19:43:35 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4D6I |
19:44:57 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4D6J |
19:45:09 | FromDiscord | <arathanis> (edit) "https://play.nim-lang.org/#ix=4D6H" => "https://play.nim-lang.org/#ix=4D6K" |
19:45:31 | FromDiscord | <arathanis> yeah @Matt this seems to work |
19:49:51 | FromDiscord | <arathanis> but really you might just need to rethink your approach |
19:50:11 | FromDiscord | <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:21 | FromDiscord | <arathanis> (edit) "nim" => "Nim" |
19:50:26 | FromDiscord | <arathanis> (edit) "python," => "Python," |
19:51:50 | * | PMunch joined #nim |
19:53:23 | FromDiscord | <demotomohiro> iterator without `{.closure.}` is an inline iterator.↵That works like template and doesn't have status. |
19:53:54 | FromDiscord | <arathanis> isn't that also how `iterator foo(...)` works? |
19:54:15 | FromDiscord | <demotomohiro> Yes. |
19:54:36 | * | PMunch_ quit (Ping timeout: 245 seconds) |
19:55:58 | FromDiscord | <arathanis> do you still need to specify `{.closure.}`? it doesnt seem to matter anymore. |
19:56:06 | FromDiscord | <arathanis> might be implied? |
19:56:20 | FromDiscord | <arathanis> seems like its implied |
20:01:08 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-firstminusclass-iterators |
20:02:25 | FromDiscord | <Matt> thanks |
20:02:38 | FromDiscord | <Matt> I'm starting to see how different iterators are here compared to Python |
20:03:49 | * | def- joined #nim |
20:06:02 | FromDiscord | <wick3dr0se> Is it difficult to import a module made with Nim in C or other languages? |
20:07:13 | FromDiscord | <summarity> No, you just export the symbols you need and call them. |
20:07:30 | FromDiscord | <arathanis> In reply to @wick3dr0se "Is it difficult to": ive had success with both static and dynamic linking |
20:07:47 | FromDiscord | <arathanis> specifically into C/C++ |
20:08:55 | FromDiscord | <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:57 | FromDiscord | <summarity> You also may have to invoke `NimMain()` depending on the platform |
20:13:11 | FromDiscord | <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:34 | FromDiscord | <0xrh0d4m1n> hey guys, anyone is getting problems with Jester in this latest release of Nim 2.0? |
20:39:02 | FromDiscord | <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:05 | FromDiscord | <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:39 | FromDiscord | <0xrh0d4m1n> Thank you so much @elegantbeef |
20:44:32 | FromDiscord | <0xrh0d4m1n> just for someone future reference I was getting this: |
20:44:36 | FromDiscord | <0xrh0d4m1n> https://media.discordapp.net/attachments/371759389889003532/1139298271328751767/image.png |
20:45:18 | FromDiscord | <Elegantbeef> Yea it's a known issue, undecided whether it's an issue with jester or orc |
20:45:38 | FromDiscord | <Elegantbeef> Likely with jester having preconceived ideas of the runtime |
20:45:49 | FromDiscord | <Elegantbeef> Dom no longer uses Nim so I guess "forks welcome" |
20:50:07 | FromDiscord | <jos7388> wha |
20:50:09 | FromDiscord | <jos7388> what’s he use now |
20:50:21 | FromDiscord | <Elegantbeef> No clue |
20:50:26 | FromDiscord | <bung8954> try useStdLib to reduce problem |
20:51:12 | FromDiscord | <0xrh0d4m1n> In reply to @jos7388 "what’s he use now": https://github.com/ringabout/awesome-nim#frameworks |
20:51:14 | FromDiscord | <heysokam> is there a way to get the underlying int representation of an enum set containing flags? 🤔 |
20:51:36 | FromDiscord | <Elegantbeef> `cast[WantedSize](myEnum)` |
20:51:45 | FromDiscord | <heysokam> ty beef ✍️ |
20:52:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4D71 |
20:53:18 | Amun-Ra | what if sizeof(result) > sizeof(source)? |
20:58:14 | FromDiscord | <Elegantbeef> Put an error in |
21:07:17 | FromDiscord | <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:44 | FromDiscord | <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:35 | FromDiscord | <Elegantbeef> `procCall myProc(Base(child))` |
21:09:35 | FromDiscord | <jakraes> I am a little confused by that ngl 💀 |
21:09:48 | FromDiscord | <Elegantbeef> `procCall` forces the code to be evaluated statically |
21:09:54 | FromDiscord | <Elegantbeef> well not evaluated but dispatched |
21:10:31 | FromDiscord | <jakraes> Gotcha, and what's the Base() for? |
21:10:39 | FromDiscord | <Elegantbeef> Type conversion |
21:10:57 | FromDiscord | <jakraes> 🫡 |
21:11:01 | FromDiscord | <jakraes> Understood it now, thank you |
21:11:32 | FromDiscord | <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:05 | Amun-Ra | proccall, TIL |
21:13:33 | FromDiscord | <jakraes> In reply to @Elegantbeef "Can also of course": Gonna keep it simple and use proccall LUL |
21:14:05 | FromDiscord | <Elegantbeef> I mean `Base child` or `child.base` |
21:14:15 | FromDiscord | <Elegantbeef> well `child.Base` |
21:18:58 | FromDiscord | <Chronos [She/Her]> In reply to @sys64 "So if it compiles,": In theory yeah |
21:19:04 | FromDiscord | <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:45 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4D7c |
21:25:40 | FromDiscord | <Chronos [She/Her]> Nice |
21:28:43 | Amun-Ra | what about pypy? |
21:28:43 | FromDiscord | <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:21 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "what about pypy?": PyPy can't produces executables, can it? |
21:30:03 | Amun-Ra | standalone? no |
21:30:32 | FromDiscord | <System64 ~ Flandre Scarlet> It would be so nice to have executables with PyPy |
21:31:35 | FromDiscord | <Chronos [She/Her]> In reply to @sys64 "Nuitka is blue Slower": Idk |
21:39:44 | FromDiscord | <System64 ~ Flandre Scarlet> PyPy is still way faster |
21:40:15 | FromDiscord | <Phil> ~~Pypy is like the majority of the reason Django is even viable~~ |
21:43:05 | FromDiscord | <System64 ~ Flandre Scarlet> Now sad you can't have an exe with PyPy |
21:45:22 | FromDiscord | <Elegantbeef> I'm more sad people want to distibute python binaries |
21:47:22 | Amun-Ra | indeed |
22:00:25 | FromDiscord | <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:29 | FromDiscord | <Matt> I'm trying to install this library for a project of mine using Nim 2.0: https://github.com/haltcase/glob |
22:12:59 | FromDiscord | <Matt> sent a code paste, see https://play.nim-lang.org/#ix=4D7k |
22:13:03 | FromDiscord | <Matt> What might be causing this? |
22:13:32 | * | rockcavera joined #nim |
22:15:26 | FromDiscord | <Elegantbeef> `nimble install glob@#head` |
22:15:27 | FromDiscord | <Elegantbeef> they didnt tag a release |
22:15:37 | FromDiscord | <Matt> https://github.com/haltcase/glob/blob/64f71af2fa4572c2bdf8987a56a427c1d88fc34f/glob.nimble#L1-L10 |
22:15:57 | FromDiscord | <Elegantbeef> Yea they didnt tag a new release so when you install `0.11.2` is got |
22:16:06 | FromDiscord | <Matt> https://github.com/haltcase/glob/releases/tag/v0.11.2 |
22:16:08 | FromDiscord | <Elegantbeef> Make an issue to tag a new release for the 2.0 support |
22:16:16 | FromDiscord | <Matt> Is that not it? |
22:16:23 | FromDiscord | <Elegantbeef> https://github.com/haltcase/glob/commit/64f71af2fa4572c2bdf8987a56a427c1d88fc34f |
22:16:26 | FromDiscord | <Elegantbeef> Look at the commit |
22:16:44 | FromDiscord | <Elegantbeef> The issue with nimble is that it has a manually written version and a git tag, nimble uses the git tag |
22:17:10 | FromDiscord | <Elegantbeef> This is why graffiti exists 😄 |
22:17:14 | FromDiscord | <Matt> Pause |
22:17:33 | FromDiscord | <Matt> Are you looking at a different repo to see which commit is being used |
22:17:40 | FromDiscord | <Elegantbeef> No |
22:17:51 | FromDiscord | <Elegantbeef> https://github.com/haltcase/glob/commit/64f71af2fa4572c2bdf8987a56a427c1d88fc34f look at the tagged commit |
22:17:54 | FromDiscord | <Elegantbeef> It's from octoer |
22:18:02 | FromDiscord | <Elegantbeef> october\ |
22:18:02 | FromDiscord | <Elegantbeef> the 2.0 support was done in novemeber |
22:18:08 | FromDiscord | <Elegantbeef> It needs a new `tag` |
22:18:10 | FromDiscord | <Matt> Oh |
22:18:14 | FromDiscord | <Matt> I'm tripping |
22:18:16 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D7n |
22:18:16 | FromDiscord | <Phil> You'll get the latest from there |
22:18:35 | FromDiscord | <Matt> I totally missed that |
22:18:37 | FromDiscord | <Matt> Ok, thanks |
22:19:03 | FromDiscord | <Elegantbeef> Make an issue so they tag it |
22:23:01 | FromDiscord | <Matt> Did |
22:23:21 | FromDiscord | <Matt> Thanks Mr B :^) |
22:23:51 | qwr | Matt: you could just break in for loop to use only first value |
22:25:15 | FromDiscord | <Elegantbeef> Is there something I'm missing qwr? |
22:25:44 | qwr | he asked how to use only first value from iterator |
22:26:45 | qwr | (and it seemed to me that this solution wasn't mentioned by anyone yet) |
22:26:54 | FromDiscord | <Elegantbeef> Ah |
22:29:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4D7q |
22:30:23 | FromDiscord | <Elegantbeef> Ah actually `next` works even with overloads |
22:30:40 | FromDiscord | <Elegantbeef> so `pop` or `next` would suffice |
22:47:25 | FromDiscord | <Matt> Thanks qwr |
22:52:58 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4D7t |
22:53:06 | FromDiscord | <heysokam> (edit) "https://play.nim-lang.org/#ix=4D7t" => "https://paste.rs/P28pu" |
22:53:58 | FromDiscord | <Elegantbeef> Yes |
22:54:08 | FromDiscord | <Elegantbeef> `(int, int, int)` |
22:54:22 | FromDiscord | <heysokam> do they need to be named mandatory in the typedef? |
22:55:15 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4D7u |
22:55:18 | FromDiscord | <odexine> yes theyd need to be named there |
22:55:22 | FromDiscord | <Elegantbeef> When using the named tuple syntax yes |
22:55:24 | FromDiscord | <odexine> otherwise you use the () style |
22:55:28 | FromDiscord | <Elegantbeef> `appVers: (int, int, int) = (0, 0, 0)` |
22:55:41 | FromDiscord | <heysokam> oh I had no idea that's a valid type |
22:55:44 | FromDiscord | <Elegantbeef> you can do`tuple[_, _, _: int]` probably |
22:55:45 | FromDiscord | <heysokam> im dummy, ty |
22:55:51 | FromDiscord | <Elegantbeef> Assuming metagn handled it |
22:55:56 | FromDiscord | <odexine> In reply to @Elegantbeef "you can do`tuple[_, _,": sounds cursed |
22:59:21 | FromDiscord | <Elegantbeef> Hey I wouldnt suggest it if it wasnt |