00:37:37 | * | vicecea quit (Remote host closed the connection) |
00:38:07 | * | vicecea joined #nim |
00:44:13 | arkanoid | This is cool! https://godbolt.org/ |
00:47:17 | NimEventer | New thread by Dom96: HttpBeast 0.4.0 is here, see https://forum.nim-lang.org/t/8714 |
00:52:39 | FromDiscord | <eyis> I am trying to understand slices, but I'm a bit confused.↵This is using a slice: `val[2 .. 4] = [4, 3, 10]` |
00:52:58 | FromDiscord | <eyis> (edit) "10]`" => "10]`↵but this create a new seq: `var slice = val[2 .. 4]`" |
00:53:28 | FromDiscord | <Elegantbeef> `[]=` and `[]` are different operators |
00:53:42 | FromDiscord | <eyis> I see |
00:54:13 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/system.nim#L2621 if you want to see the impl |
00:54:14 | FromDiscord | <eyis> so you can't have a slice of an array like you can in go, can you? |
00:54:46 | FromDiscord | <Elegantbeef> You can using unsafe methods or `toOpenArray`(cannot be held in a variable) |
00:55:26 | FromDiscord | <Elegantbeef> There is also the experimental views which does allow holding openarrays in variables |
00:57:01 | FromDiscord | <pyautogui> sent a code paste, see https://play.nim-lang.org/#ix=3Irw |
00:57:50 | FromDiscord | <eyis> my next question was about openArray :D are they the recommended way to pass an array of unknown size to a proc? |
00:58:00 | FromDiscord | <Elegantbeef> They are indeed |
00:58:00 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Iry |
00:58:07 | FromDiscord | <eyis> and practically when do you use slices? |
00:58:21 | FromDiscord | <eyis> (edit) "do" => "would" |
00:58:29 | FromDiscord | <Elegantbeef> They're a hidden conversion which allows arrays/sequences to colesce into a API that can be written once |
00:58:45 | FromDiscord | <Elegantbeef> Cause enum arrays/non zero indexed arrays can cause errors in generics |
01:00:23 | FromDiscord | <Elegantbeef> Dont know what to say py, havent looked at aoc in a while so i dont know the intended logic |
01:00:56 | FromDiscord | <eyis> I see. And are openarrays views into the array/seq? |
01:01:07 | FromDiscord | <Elegantbeef> Yes |
01:01:22 | FromDiscord | <pyautogui> Thanks @ElegantBeef I will keep working by myself. |
01:01:48 | FromDiscord | <Elegantbeef> Openarray is internally a pointer/len but is checked it does not get assigned to a variable without the aforementioned experimental feature |
01:02:17 | FromDiscord | <Elegantbeef> The views feature gives a borrow checker allowing safe usage of openArrays |
01:03:01 | FromDiscord | <Elegantbeef> But as the experimental name suggests it has code gen/design issues, but can be used |
01:03:09 | FromDiscord | <eyis> Great! Thank you for answering :D that covers pretty much all I was wondering about |
01:03:52 | FromDiscord | <Elegantbeef> If you're purely looking at iteration you can now implement slice operators for borrowing slices |
01:04:15 | FromDiscord | <Elegantbeef> Which i do here https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L10-L18 |
01:07:25 | * | xet7 quit (Quit: Leaving) |
01:07:53 | * | xet7 joined #nim |
01:08:49 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3IrC |
01:08:52 | FromDiscord | <Rika> I replied to the wrong thing |
01:09:33 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3IrD |
01:10:25 | FromDiscord | <pyautogui> Got it |
01:10:28 | FromDiscord | <pyautogui> Deleting it |
01:10:42 | FromDiscord | <Rika> AFAIK it's GG for those in IRC now |
01:11:07 | FromDiscord | <Rika> Actually no I think it's fine |
01:11:16 | FromDiscord | <Rika> Since code blocks go into pastes |
01:11:41 | FromDiscord | <Rika> Anyway feel free to repost in aoc but the code goes in a paste link |
01:13:37 | * | mahlon quit (Ping timeout: 256 seconds) |
01:26:14 | FromDiscord | <pyautogui> got it |
01:31:43 | FromDiscord | <evoalg> oooo I figured out how to do: `myseq.toHashSet.toSeq` to get rid of duplicates in a list |
01:38:33 | * | src_ quit (Quit: Leaving) |
02:00:53 | * | mahlon joined #nim |
02:01:18 | FromDiscord | <Yardanico> In reply to @evoalg "oooo I figured out": why |
02:01:20 | FromDiscord | <Yardanico> there's deduplicate |
02:01:33 | FromDiscord | <Yardanico> https://nim-lang.org/docs/sequtils.html#deduplicate%2CopenArray%5BT%5D%2Cbool |
02:02:55 | FromDiscord | <evoalg> oh thank you! |
02:19:46 | * | neurocyte0132889 quit (Ping timeout: 260 seconds) |
02:46:27 | * | huantian joined #nim |
02:48:00 | * | noeontheend quit (Quit: noeontheend) |
02:48:13 | * | noeontheend joined #nim |
02:56:07 | * | huantian quit (Quit: WeeChat 3.3) |
02:56:30 | * | huantian joined #nim |
03:02:53 | * | noeontheend quit (Quit: noeontheend) |
03:03:09 | * | noeontheend joined #nim |
03:22:16 | * | arkurious quit (Quit: Leaving) |
03:48:37 | * | noeontheend quit (Ping timeout: 252 seconds) |
04:04:01 | * | rockcavera quit (Ping timeout: 252 seconds) |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:31 | * | supakeen joined #nim |
04:10:00 | * | huantian quit (Quit: WeeChat 3.3) |
04:57:29 | * | noeontheend joined #nim |
06:28:57 | * | Colt quit (Quit: Leaving) |
06:36:33 | * | noeontheend quit (Ping timeout: 252 seconds) |
07:15:05 | * | Guest1650 joined #nim |
07:22:11 | * | Guest1650 quit (Quit: Client closed) |
07:35:04 | FromDiscord | <rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=3IsE |
07:53:58 | * | PMunch joined #nim |
08:45:47 | * | PMunch quit (Quit: leaving) |
09:20:02 | * | pro joined #nim |
09:31:07 | * | pro quit (Quit: WeeChat 3.3) |
09:34:49 | FromDiscord | <Elegantbeef> @pietroppeter\: like i was saying overloads are handled seemlessly though some caveats exist |
09:35:27 | FromDiscord | <Elegantbeef> `proc(a, b: int or float)` presently generates a `proc(a, b: int)` and `proc(a, b: float)` but not a `proc(a: int, b: float)` |
09:35:36 | FromDiscord | <pietroppeter> ah nice! (we are continuing a discussion that was originally in #fosdem channel) |
09:36:32 | FromDiscord | <Elegantbeef> But if you have `proc doThing(a: int)` and `proc doThing(a: string)` it'll properly handle overloads |
09:36:36 | FromDiscord | <pietroppeter> I was referring to the line in nimscripter's readme when I thought overloads would not work: "Any exported non overloaded and non generic procedures can be called from Nim" |
09:36:54 | FromDiscord | <Elegantbeef> Yea "from Nim" is key |
09:37:28 | FromDiscord | <pietroppeter> 🤦♂️ |
09:38:50 | FromDiscord | <Elegantbeef> Eitherway i do need to work on documentation, it's as big black box presently |
09:39:35 | FromDiscord | <Elegantbeef> After helping my friend fight with godot-nim for the past few days i'm feeling very self conscious about docs and my code now |
09:39:59 | FromDiscord | <Elegantbeef> As nice as the bindings are, they're hell to use |
09:53:40 | FromDiscord | <Michal58> In reply to @Yardanico "there's deduplicate": Contrary to .toHashSet.toSeq that seems to have quadratic complexity? |
10:13:07 | FromDiscord | <lumi> what's the reasoning for allowing proc call without parenthesis? Is it just for the convenience or is there another reason? (like: `echo "hello world"`)↵I find it hard when reading code to know if `foo.bar` is accessing a field or calling a proc |
10:14:16 | FromDiscord | <Elegantbeef> Well in the case of the method call syntax it's for fields |
10:14:23 | FromDiscord | <Elegantbeef> well properties i should say |
10:15:33 | FromDiscord | <Elegantbeef> So yes mostly for convience/elegance |
10:15:52 | FromDiscord | <Elegantbeef> It's more convient to drop `()` when it's a property than to do `foo.body()` for instance |
10:18:49 | FromDiscord | <Michal58> I guess the idea is we shouldn't treat those two cases as different? Like `text.len` could very well just be a field of the string the usage would be the same |
10:19:19 | FromDiscord | <Michal58> Also, it's similar to for example C# getters |
10:19:37 | FromDiscord | <Michal58> except Nim is less explicit about it? |
10:19:39 | FromDiscord | <Elegantbeef> Well just properties all together |
10:19:48 | FromDiscord | <Elegantbeef> Nah Nim is equally implicit |
10:20:08 | FromDiscord | <Elegantbeef> If you have a property in C# it's 100% identical to a Nim property |
10:20:22 | FromDiscord | <Elegantbeef> It runs code on field access/assignment |
10:20:33 | FromDiscord | <Elegantbeef> Nim arguably more explicit since there is a proc definition |
10:22:23 | FromDiscord | <Michal58> yeah, so this behaviour in Nim is not even something unusual/suprosing, just the syntax is different? |
10:22:47 | FromDiscord | <Michal58> lol what is suprosing |
10:22:57 | FromDiscord | <Elegantbeef> The syntax they have an issue with is the dropping of `()` which i'd argue means you have badly named functions if you think they could be misconstrude as fields |
10:23:42 | FromDiscord | <Michal58> In reply to @Elegantbeef "The syntax they have": yes, but you droop the () in C# too |
10:23:47 | FromDiscord | <Michal58> (edit) "droop" => "drop" |
10:24:03 | FromDiscord | <Michal58> (edit) "In reply to @Elegantbeef "The syntax they have": yes, but you drop the () in C# too ... " added "so I'm just saying this is not only related to Nim" |
10:24:05 | FromDiscord | <Elegantbeef> No you cannot drop `()` on any proc calls |
10:24:17 | FromDiscord | <Michal58> In reply to @Elegantbeef "No you cannot drop": I mean for properties |
10:24:43 | FromDiscord | <Elegantbeef> Yea i know but they're not talking about properties i just brought it up as one reason why `()` is droppable |
10:25:21 | FromDiscord | <Elegantbeef> Chaining is another reason why you can drop them, since `10d.int.mod(2).float` is much more nice to write than `10d.int().mod(2).float()` |
10:25:26 | FromDiscord | <Michal58> And if in Nim, somebody uses that syntax, arguable that are conveying an additional semantics - meaning that the call can be viewed as accessing a property |
10:25:47 | FromDiscord | <Michal58> (edit) "syntax," => "syntax (dropping ())," |
10:25:54 | FromDiscord | <Elegantbeef> Yea if there is ambiguity it's almost certainly a case of badly named procedures |
10:25:55 | FromDiscord | <Michal58> (edit) "arguable that" => "arguably they" |
10:27:13 | FromDiscord | <Elegantbeef> procedures afterall should be verby |
10:28:07 | FromDiscord | <Elegantbeef> @lumi\: anywho hope that gives you some stuff to reason why they're optional 😛 |
10:29:39 | FromDiscord | <Michal58> right, if it's a noun than usually it can be defined as a `func` instead and be treated like a `property` and in that case it doesn't matter that you cannot tell if it is a field or calling that `func` do I make sense, @ElegantBeef ? |
10:30:23 | FromDiscord | <Elegantbeef> Yea ideally it should be a function if it's a property |
10:30:46 | FromDiscord | <Elegantbeef> Property vs field doesnt matter if your properties are properly written and not expensive |
10:32:23 | FromDiscord | <Elegantbeef> This comes down to a case of user ambiguity, really it doesnt matter if something is a proc call or a field, if it looks like a field and it's a property what's the issue "performance"? There are properties that are templates so that's not the case... it's a nothing burger to me |
10:32:30 | FromDiscord | <Michal58> In reply to @Elegantbeef "Property vs field doesnt": yeah that was my idea when I said Nim enforces us to not treat those differently |
10:33:24 | FromDiscord | <Elegantbeef> I do hope lumi chimes in really making me feel like i scared them away |
10:38:24 | FromDiscord | <lumi> Ahah sorry, I had a call. |
10:38:32 | FromDiscord | <lumi> yeah it does! Not sure I like that feature but it does make sense in the context of nim |
10:38:39 | FromDiscord | <lumi> at least your reasoning is sound |
10:39:35 | FromDiscord | <Elegantbeef> Well it's a relatively common thing in languages now, so it's here to stay 😛 |
10:40:28 | FromDiscord | <lumi> yes I'm not asking for nim to change for me :D |
10:43:29 | FromDiscord | <Elegantbeef> The interesting thing to note, is that allowing dropping of `()` on proc calls actually means that only setters need to be handled specially |
10:43:51 | FromDiscord | <Elegantbeef> Since all procs can be used as if they're fields the compiler doesnt have to do anything special for getters |
10:44:28 | FromDiscord | <Elegantbeef> I suppose that's only interesting if you like compiler developing any |
10:47:03 | FromDiscord | <Michal58> In reply to @Elegantbeef "The interesting thing to": yeah, that is what I meant when I said in Nim it was less explicit - in Nim everything behaves like a getter implicitly |
10:47:27 | FromDiscord | <Elegantbeef> Ah we were talking about different sides of the coin |
10:47:37 | FromDiscord | <Elegantbeef> I was talking about implementation and you about calling 😀 |
10:48:08 | FromDiscord | <Elegantbeef> Anyway i'm off so directly all questions to the nearest paper shreader |
10:57:25 | * | xet7 quit (Remote host closed the connection) |
10:58:37 | * | xet7 joined #nim |
11:08:43 | * | PMunch joined #nim |
11:56:07 | FromDiscord | <Michal58> sent a code paste, see https://play.nim-lang.org/#ix=3ItO |
11:56:35 | FromDiscord | <Michal58> (edit) "https://play.nim-lang.org/#ix=3ItO" => "https://play.nim-lang.org/#ix=3ItP" |
12:00:17 | FromDiscord | <haxscramper> toplevel procs are not mixined in generics |
12:00:23 | FromDiscord | <SuperFola> i'm guessing this is due to scope rules, you are using functions from heapQueue and HashSet which must call said operator, but they can access only what is top level? |
12:00:34 | FromDiscord | <haxscramper> when you define `>` in a local scope it is defined as `>_somelocalid`, and can't be mixined in generic |
12:01:25 | FromDiscord | <haxscramper> heapqueu looks for `>` visible in the instantiation scope, but `>` is defined locally, and has some additional data to disambiguate it, so it is not considered by gensym |
12:02:23 | FromDiscord | <haxscramper> Although I'm not sure if this is a 100% correct explanation from the compiler implementation standpoint |
12:03:15 | FromDiscord | <Michal58> I see |
12:03:29 | FromDiscord | <Michal58> makes sense actually |
12:03:57 | FromDiscord | <Michal58> but then is there another way of achieving the same? |
12:04:26 | FromDiscord | <Michal58> without having to define it globally |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:18 | FromDiscord | <haxscramper> heapqueue does not have an additional generic parameter that would allow you to specify a comparator (like `std::map` from C++ does for example), so your only option is to define `<` globally. |
12:06:30 | * | supakeen joined #nim |
12:06:34 | FromDiscord | <haxscramper> Do you need to sort data in two different orders? |
12:06:41 | FromDiscord | <Michal58> hmm, I was afraid you'd say so |
12:06:47 | FromDiscord | <haxscramper> With different behaviors for `<`? |
12:07:07 | FromDiscord | <Michal58> In reply to @haxscramper "With different behaviors for": yes, that would be handy |
12:07:54 | FromDiscord | <haxscramper> You can define `PointSortedOneWay = distinct Point` and `PointSortedAnotherWay = distinct Point`, and define `<` for them, I think currently it is the only solution |
12:08:22 | FromDiscord | <haxscramper> There was an RFC for Table parametrization, I don't remember whether it required to change the language code |
12:08:23 | FromDiscord | <haxscramper> (edit) "code" => "core" |
12:08:35 | FromDiscord | <haxscramper> Maybe it has a library-only solution that is not as dirty as `distinct` |
12:08:49 | FromDiscord | <Michal58> In reply to @haxscramper "You can define `PointSortedOneWay": that doesn't work for what I was trying to do - I don't now the sorting methods nor their count at compile time |
12:09:27 | FromDiscord | <Michal58> by that I mean I'd like to define < inside the function and use nonlocal values in there |
12:10:21 | FromDiscord | <Michal58> so < would be different for each call of shortestDistance in my case |
12:12:03 | FromDiscord | <Michal58> I don't miss OOP in Nim but with OOP you don't have those kinda problems 😄 |
12:13:46 | FromDiscord | <Tanguy> You can create a `method >` if you want to do oop |
12:16:47 | FromDiscord | <Michal58> would defining `<` as a `method` inside the function solve the problem? |
12:16:58 | FromDiscord | <Tanguy> I don't think that works |
12:19:23 | FromDiscord | <Tanguy> sent a code paste, see https://paste.rs/4mQ |
12:19:34 | FromDiscord | <Tanguy> (edit) "https://play.nim-lang.org/#ix=3ItU" => "https://paste.rs/Yu1" |
12:20:27 | FromDiscord | <Michal58> that is kinda funny, but very clever 🙂 |
12:20:45 | FromDiscord | <Rika> Cursed |
12:27:25 | FromDiscord | <Michal58> thanks |
12:30:41 | FromDiscord | <haxscramper> In reply to @haxscramper "There was an RFC": I was unable to find this RFC/issue/PR |
12:31:02 | FromDiscord | <haxscramper> But I believe it was by timotheecour |
13:04:33 | * | noeontheend joined #nim |
13:27:32 | * | rockcavera joined #nim |
13:27:32 | * | rockcavera quit (Changing host) |
13:27:32 | * | rockcavera joined #nim |
13:31:43 | FromDiscord | <narimiran> we have a release candidate for Nim 1.6.2: https://forum.nim-lang.org/t/8712 - please try it and see if you encounter any regressions |
13:38:40 | * | noeontheend quit (Remote host closed the connection) |
13:39:52 | * | noeontheend joined #nim |
13:43:10 | * | dtomato quit (Quit: The Lounge - https://thelounge.chat) |
13:43:49 | * | dtomato joined #nim |
13:51:22 | * | noeontheend quit (Ping timeout: 260 seconds) |
14:12:52 | * | arkurious joined #nim |
14:27:12 | * | xet7 quit (Quit: Leaving) |
14:51:37 | * | fputs quit (Quit: The Lounge - https://thelounge.chat) |
14:53:39 | * | fputs joined #nim |
14:57:22 | * | ecs quit (Ping timeout: 268 seconds) |
14:57:52 | * | ecs joined #nim |
14:58:33 | * | blackbeard420 quit (Ping timeout: 250 seconds) |
15:20:54 | * | xet7 joined #nim |
15:23:25 | * | xet7 quit (Remote host closed the connection) |
15:44:06 | * | blackbeard420 joined #nim |
15:54:46 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3Iv5 |
15:55:52 | FromDiscord | <Tanguy> sent a code paste, see https://play.nim-lang.org/#ix=3Iv6 |
15:56:18 | FromDiscord | <hmmm> oh this look cool except I need to import an entire module to do it. what is it |
15:56:21 | FromDiscord | <Tanguy> (edit) "https://play.nim-lang.org/#ix=3Iv6" => "https://play.nim-lang.org/#ix=3Iv7" |
15:56:22 | FromDiscord | <hmmm> "it" |
15:57:11 | FromDiscord | <Tanguy> https://nim-lang.org/docs/sequtils.html#keepItIf.t%2Cseq%2Cuntyped↵↵keepItIf will call what you give in parameter for each value in the sequence, replacing the magic `it` by the current value |
15:57:26 | FromDiscord | <hmmm> I see |
15:58:09 | FromDiscord | <Tanguy> sequtils has a lot of useful stuff, if you don't use it you'll have to do it manually, like you did, more or less |
16:03:00 | FromDiscord | <Rosen> Hold on, what's the difference between keepItIf and filterIt? |
16:03:53 | FromDiscord | <hmmm> damn sequtils is like heroi- I mean magicks |
16:04:17 | FromDiscord | <hmmm> pmunchie should do a tutorial series on sequtils tbh |
16:04:29 | FromDiscord | <hmmm> summoning pmunchie 🧔♂️ |
16:05:18 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3Ivf |
16:05:29 | FromDiscord | <el__maco> perhaps unsurprisingly the runtime isn't happy with this |
16:06:26 | FromDiscord | <hmmm> maco this is the saner version I couldn't think of when I yoloed my while instead. But the sequtils one looks so much better than both |
16:06:52 | FromDiscord | <el__maco> mine doesn't work. You cannot delete from the container you're iterating over |
16:07:04 | FromDiscord | <hmmm> maybe you need to use mitems? |
16:07:17 | FromDiscord | <el__maco> maybe someone knows how to express it in a way it actually works 😅 |
16:07:30 | FromDiscord | <Rosen> What do you guys use to measure runtime? I want to try a few different ways |
16:08:19 | PMunch | epochTime or monotimes |
16:08:20 | FromDiscord | <hmmm> In reply to @Rosen "What do you guys": yea I'm interested too, also I want to know how to debug without echo like a champ without hassling setups |
16:08:52 | PMunch | You can do debugging with GDB if you like |
16:09:04 | FromDiscord | <hmmm> munchie direct me to an example |
16:09:17 | FromDiscord | <hmmm> do you use echo munchie? |
16:09:21 | PMunch | Of gdb usage? |
16:09:26 | FromDiscord | <hmmm> yes |
16:09:28 | PMunch | `gdb myprogram` |
16:09:39 | FromDiscord | <hmmm> oh really |
16:09:48 | PMunch | Huh? |
16:10:11 | FromDiscord | <hmmm> sorry for the confusion I know absolutely nothing about gdb 😅 |
16:12:49 | FromDiscord | <Rika> In reply to @el__maco "maybe someone knows how": It is required to use two containers |
16:13:02 | FromDiscord | <Rika> In reply to @Rosen "Hold on, what's the": Keep on true versus remove on true |
16:13:38 | FromDiscord | <Rosen> But filter keeps on true as well |
16:14:28 | FromDiscord | <Rosen> Oh! keepItIf is in-place while filterIt is creating a new seq |
16:14:44 | FromDiscord | <Rika> ? |
16:14:59 | FromDiscord | <Rika> Let me check I was pretty sure filter was remove on true |
16:15:33 | PMunch | @hmmm, this is probably helpful: https://internet-of-tomohiro.netlify.app/nim/gdb.en.html |
16:15:48 | FromDiscord | <Rika> That’s right I guess |
16:15:56 | FromDiscord | <Rika> Strange break of naming tradition |
16:16:15 | FromDiscord | <el__maco> In reply to @Rika "It is required to": hmm, so you have to basically create a duplicate container when you remove items from it? If so, is the sequtils solution more efficient? |
16:16:48 | FromDiscord | <Rika> In reply to @el__maco "hmm, so you have": Actually I can think of a way to do filtering on one container |
16:17:12 | FromDiscord | <Rika> “Sort” the proper elements and resize the container |
16:17:13 | FromDiscord | <el__maco> I guess if a seq is dynamic array then you kinda have to copy if you want to maintain the order of the items |
16:17:21 | FromDiscord | <Rika> No resizes during iteration but swaps occur |
16:17:55 | FromDiscord | <Rika> Only extra data needed is a tracked index for the next “sorted” location I guess |
16:18:04 | NimEventer | New question by How2: Pythonic dir(module_name) in Nim?, see https://stackoverflow.com/questions/70366960/pythonic-dirmodule-name-in-nim |
16:19:48 | FromDiscord | <Gready> hello, i can't get this simple macro example to compile : https://stackoverflow.com/questions/65519270/nim-custom-macro-pragma-to-get-ast-of-complete-module-but-get-cannot-attach-a, but i get undeclared identifer for the proc when i add the pragma to the function, any idea why? https://play.nim-lang.org/#ix=3Ivj |
16:20:48 | FromDiscord | <hmmm> In reply to @PMunch "<@887269570765791243>, this is probably": thanks munchie! I skimmed it and for my purposes looks totally overkill unless my apps grow so much I end up needing it. I was thinking along the line of some automatic logger that is not a hassle to setup |
16:21:04 | FromDiscord | <Rika> In reply to @Gready "hello, i can't get": For the proc you must return the ast again |
16:21:16 | FromDiscord | <Rika> Because the macro consumes the code |
16:21:31 | FromDiscord | <Rika> So now you can’t call it because it technically doesn’t exist |
16:21:47 | PMunch | @hmmm, automatic logger? What kind of stuff would you like to log? |
16:22:30 | FromDiscord | <Gready> @Rika thanks! |
16:24:53 | FromDiscord | <hmmm> In reply to @PMunch "<@887269570765791243>, automatic logger? What": hmm don't know how to explain. the kind of stuff I usually echo for debug. Like something that can be disabled and reenabled massively, or makes a copy on file |
16:25:20 | FromDiscord | <Rika> so literally just std/logging |
16:25:21 | FromDiscord | <Rika> ? |
16:25:27 | FromDiscord | <hmmm> hmm possibly? |
16:25:32 | FromDiscord | <hmmm> I should look into it |
16:25:39 | PMunch | @Rika, he wants it to log automatically |
16:26:08 | FromDiscord | <Rika> log...what |
16:27:45 | PMunch | Exactly |
16:29:39 | FromDiscord | <hmmm> basically something that records the echo of all the variables of interest without actually peppering all the program of echo statements. I don't even know if it exist lol |
16:30:32 | PMunch | It doesn't, and it can't really :P |
16:30:41 | FromDiscord | <hmmm> oh I see 😦 |
16:30:47 | PMunch | How would the program know what variables are interesting? |
16:31:08 | FromDiscord | <hmmm> hmm I can mark them |
16:31:13 | PMunch | I guess you could write a macro that does something, but I've never seen anything like that |
16:32:47 | FromDiscord | <Rika> In reply to @hmmm "hmm I can mark": then its not automatic lol |
16:33:29 | FromDiscord | <hmmm> I mean the pain point is having to clean up all the echoes after fixing the broken program, and when it breaks again maybe you want all the previous echoes back and it's just a hassle |
16:34:56 | FromDiscord | <Rika> std/logging then |
16:35:03 | FromDiscord | <Rika> can turn it on and off easy |
16:35:11 | FromDiscord | <hmmm> I'll look into it |
16:35:24 | FromDiscord | <Rika> can also direct debug into a file and everything else into stdout |
16:35:30 | FromDiscord | <Hamid_Bluri> have you seen this btw?↵https://github.com/hamidb80/uncomment/ |
16:39:05 | FromDiscord | <hmmm> In reply to @hamidb80 "have you seen this": this is very gud my man! Now just make a version that actually comments stuff out based on a switch and you have a sell! |
16:39:54 | PMunch | You could just create a small wrapper pragma that either adds uncomment or nothing to the pragmas set based on a switch |
16:40:09 | * | rockcavera quit (Remote host closed the connection) |
16:40:23 | FromDiscord | <hmmm> you could but I cannot since I never made a pragma in my life lol |
16:41:41 | PMunch | Time to learn something new then I guess :) |
16:42:32 | FromDiscord | <Hamid_Bluri> https://media.discordapp.net/attachments/371759389889003532/920717470782869534/unknown.png |
16:42:40 | FromDiscord | <hmmm> oh he can't see |
16:42:42 | FromDiscord | <Hamid_Bluri> he's really pmunch |
16:43:03 | PMunch | Haha :P |
16:43:09 | nrds | <Prestige99> Lol |
16:45:25 | * | PMunch quit (Quit: leaving) |
16:45:50 | * | fputs7 joined #nim |
16:47:39 | FromDiscord | <Rosen> Trying to mess around with macros, I'm wondering how to generate an unused Ident. I'm trying to make some sort of thing that will insert a timing around some code, but when I use for example ↵`result.add newLetStmt(newIdentNode("startTime"), newCall("getMonoTime"))`, if one declares the variable startTime in the block I'm passing to this macro, the compiler complains |
16:47:45 | * | fputs quit (Ping timeout: 250 seconds) |
16:47:45 | * | fputs7 is now known as fputs |
16:47:50 | FromDiscord | <Rosen> Anyone know how to solve that? |
16:49:04 | FromDiscord | <Hamid_Bluri> https://nim-lang.org/docs/macros.html#genSym%2CNimSymKind%2Cstring |
16:49:19 | FromDiscord | <Rosen> Aha! That's exactly what I was looking for, thank you! |
16:50:04 | * | rockcavera joined #nim |
16:50:04 | * | rockcavera quit (Changing host) |
16:50:04 | * | rockcavera joined #nim |
17:21:54 | FromDiscord | <z3nchada> Has anyone run across a tool for statically finding call traces? I wanted to generate call graphs for nim code and hoped to not need to go the path of regex. Also if there is a better way then regex I am all ears. |
17:22:15 | FromDiscord | <z3nchada> (edit) "Has anyone run across a tool for statically finding call traces? I wanted to generate call graphs for nim code and hoped to not need to go the path of regex. Also if there is a better way then regex I am all ears. ... " added "It would need to be across files and libraries." |
17:23:07 | * | vicecea quit (Read error: Connection reset by peer) |
17:23:43 | * | vicecea joined #nim |
17:56:05 | FromDiscord | <hmmm> with std/options an int that is 0 is different from an int that is none right? |
17:57:39 | FromDiscord | <Rika> yes |
17:57:42 | FromDiscord | <hmmm> still it's a bit verbose |
17:57:48 | FromDiscord | <Rika> yes |
17:57:49 | FromDiscord | <hmmm> how does python do the same? |
17:57:57 | FromDiscord | <Rika> it has the None type |
17:58:07 | FromDiscord | <hmmm> oh |
17:58:12 | FromDiscord | <hmmm> and where is our none |
17:58:22 | FromDiscord | <Rika> semantics are similar to nil but applicable for everything because dynamic typing |
17:58:29 | * | Colt joined #nim |
17:58:35 | FromDiscord | <hmmm> ah ok it's a dynamic vs static thingy |
17:58:39 | FromDiscord | <Rika> yes |
17:58:56 | FromDiscord | <Rika> well no, a lot of verbosity can be reduced in std/options |
17:58:57 | FromDiscord | <Rika> if |
17:59:07 | FromDiscord | <Rika> we had "reverse" type inference |
17:59:14 | FromDiscord | <Rika> rhs -> lhs inference |
17:59:31 | FromDiscord | <Rika> wait |
17:59:37 | FromDiscord | <Rika> no l -> r inference i think is what i mean |
17:59:58 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3IvL |
18:00:06 | FromDiscord | <Rika> what? |
18:00:08 | FromDiscord | <hmmm> lol |
18:00:14 | FromDiscord | <hmmm> it was a dumb question don't worry |
18:00:18 | FromDiscord | <Rika> that makes no sense, you mean to build in options? |
18:00:18 | FromDiscord | <hmmm> 😅 |
18:03:30 | FromDiscord | <Rika> i shall go, it is 3 am |
18:04:53 | FromDiscord | <hmmm> good sleep rika |
18:40:28 | * | src joined #nim |
19:01:24 | * | krux02 joined #nim |
19:21:51 | * | noeontheend joined #nim |
19:35:13 | FromDiscord | <spazzy> so im trying to translate a c header file and c2nim doesnt like (...) in any macro |
19:35:22 | FromDiscord | <spazzy> where its trying to load a file |
19:36:53 | FromDiscord | <spazzy> https://media.discordapp.net/attachments/371759389889003532/920761352316928060/unknown.png |
19:37:15 | FromDiscord | <spazzy> any ideas |
19:43:16 | FromDiscord | <Solitude> yeah, parser is incomplete, c2nim requires manual pre/postprocessing |
19:46:05 | FromDiscord | <spazzy> if i define it as a def it doesn't help |
19:54:08 | * | neurocyte0132889 joined #nim |
19:54:08 | * | neurocyte0132889 quit (Changing host) |
19:54:08 | * | neurocyte0132889 joined #nim |
20:00:53 | FromDiscord | <IsaacPaul> delete the macro |
20:02:26 | FromDiscord | <IsaacPaul> if you set up clangd with vscode and create a `compile_commands.json` at the root of your project you should have an option to resolve the macro into code. |
20:04:53 | FromDiscord | <geekrelief> In reply to @spazzy "so im trying to": What's the macro c2nim is failing on? |
20:09:58 | FromDiscord | <spazzy> all of them that have a variadic function |
20:10:11 | FromDiscord | <spazzy> which is most of them lol |
20:10:36 | FromDiscord | <spazzy> im trying to translate https://github.com/krychu/wfc |
20:11:23 | FromDiscord | <geekrelief> Cool library, I was hoping to do some WFC eventually. |
20:11:37 | FromDiscord | <spazzy> yeah i thought i might as well go ahead and make it a package |
20:12:20 | FromDiscord | <spazzy> it would save me a lot of time with the thing im working on |
20:12:46 | FromDiscord | <spazzy> and i might as well pass it forward |
20:13:22 | FromDiscord | <geekrelief> is `...` a preprocessor operator? |
20:14:13 | FromDiscord | <geekrelief> found it https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html |
20:14:23 | FromDiscord | <geekrelief> I wonder if this works in nimterop |
20:14:42 | FromDiscord | <spazzy> yeah if it wasnt one it wouldnt work at all right? |
20:16:13 | FromDiscord | <spazzy> so ive never used nimterop |
20:16:26 | FromDiscord | <spazzy> but doesnt it not output a nim file like c2nim does? |
20:16:35 | FromDiscord | <spazzy> its mostly for inline stuff? |
20:17:10 | FromDiscord | <geekrelief> nimterop is a separate binding generator based on tree-sitter. It's been abandoned, but I forked it to wrap The Machinery. |
20:17:17 | FromDiscord | <geekrelief> I've had success so far. |
20:17:29 | FromDiscord | <spazzy> how well does your wrap work anyway |
20:17:44 | FromDiscord | <spazzy> (edit) "wrap" => "wrapper" |
20:18:10 | FromDiscord | <spazzy> i was thinking about using it for something but i settled with raylib |
20:18:56 | FromDiscord | <IsaacPaul> You could try this.. but I don't think it will help.. https://github.com/izackp/c2nim - It's a fork that recovers from errors better (in the cases I've tried) |
20:21:08 | FromDiscord | <geekrelief> In reply to @spazzy "how well does your": converted the first person example so far https://media.discordapp.net/attachments/371759389889003532/920772484607909938/Umtezvizeu-1.mp4 |
20:22:06 | FromDiscord | <spazzy> nice |
20:23:06 | FromDiscord | <IsaacPaul> 😮 ... are your keywords.. glowing |
20:23:10 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3IwD |
20:23:18 | FromDiscord | <geekrelief> In reply to @IsaacPaul "😮 ... are your": maybe 🙂 |
20:24:01 | FromDiscord | <Elegantbeef> Geek uses that weird extension that simulates phosphorus displays |
20:24:01 | FromDiscord | <hmmm> In reply to @geekrelief "converted the first person": what is this wizardry and how can I play with it |
20:24:08 | FromDiscord | <Recruit_main707> In reply to @geekrelief "just tried nimterop on": iirc nimterop just ignored issues and emitted the c code as a comment instead of stopping |
20:24:50 | FromDiscord | <geekrelief> In reply to @Recruit_main707 "iirc nimterop just ignored": yea pretty much. |
20:24:57 | FromDiscord | <spazzy> huh |
20:25:17 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3IwE |
20:26:55 | FromDiscord | <geekrelief> In reply to @hmmm "what is this wizardry": yeah I have it up here: https://github.com/geekrelief/tm-nim but it's a work in progress. I've only converted the first person example so far, but it took quite a bit of work to get there. I'm currently working on my genit macro before I continue with TM. |
20:28:17 | FromDiscord | <spazzy> you know for a language that compiles to c, i feel like the wrapping is kind of weird |
20:28:34 | FromDiscord | <spazzy> (edit) "wrapping" => "wrapping/translating" |
20:30:09 | FromDiscord | <Recruit_main707> i felt the same, but then got used to it |
20:30:15 | FromDiscord | <spazzy> or at least inconsistent |
20:30:32 | FromDiscord | <Recruit_main707> what was that other lib that everyone was using for wrapping c now? |
20:30:33 | FromDiscord | <Elegantbeef> The wrapping isnt that weird |
20:30:53 | FromDiscord | <Elegantbeef> Are you talking about futhark? |
20:30:59 | FromDiscord | <Recruit_main707> yeah |
20:31:06 | FromDiscord | <Recruit_main707> it used c2nim too didnt it? |
20:31:15 | FromDiscord | <Elegantbeef> I think it's kinda expected to be this way since Nim is a language that really uses the type system atleast imo |
20:31:29 | FromDiscord | <spazzy> doesnt futhark just import the header to be used with incline c? |
20:31:39 | FromDiscord | <spazzy> kind of? |
20:31:55 | FromDiscord | <Elegantbeef> Atleast when i wrap stuff i try to make it the best Nim experience which means it doesnt align with C's implementation |
20:32:02 | FromDiscord | <Elegantbeef> Futhark uses clang |
20:32:59 | FromDiscord | <spazzy> i mean its not the same as what im trying to do |
20:33:10 | FromDiscord | <spazzy> since im trying to make a header file a nimble package |
20:33:27 | FromDiscord | <Elegantbeef> It does automatic bindings, so not idiomatic but if you need/want a library you can get it done |
20:33:29 | FromDiscord | <spazzy> its more to use in projects iirc |
20:34:03 | FromDiscord | <Recruit_main707> In reply to @Elegantbeef "It does automatic bindings,": no tool does that and probably wont ever |
20:34:18 | FromDiscord | <Elegantbeef> Hey i just popped in here answering questions! 😛 |
20:34:45 | FromDiscord | <Elegantbeef> I didnt imply otherwise, but it doesnt emit source so making it idiomatic is more tedious |
20:35:51 | FromDiscord | <Recruit_main707> ah, fair enough↵i surely prefer that to messing with c headers until c2nim likes it tho |
20:36:13 | FromDiscord | <Elegantbeef> Yea i'm daft so i prefer wrapping stuff myself, but it's tedious |
20:36:37 | FromDiscord | <hmmm> In reply to @geekrelief "yeah I have it": woa this looks so cool, and the nim code seems very readable |
20:36:49 | FromDiscord | <spazzy> so i should just use futhark for the time being and deal with wrapping it later? |
20:37:05 | FromDiscord | <Recruit_main707> its worth a try |
20:37:32 | FromDiscord | <Recruit_main707> check how it works in practice here https://github.com/arkanoid87/nimarrowglib |
20:38:16 | FromDiscord | <geekrelief> In reply to @hmmm "woa this looks so": yeah a little more concise than C at least 😄 |
20:38:34 | FromDiscord | <spazzy> In reply to @Recruit_main707 "check how it works": OH |
20:38:37 | FromDiscord | <spazzy> okay |
20:38:37 | FromDiscord | <Elegantbeef> No dumb namespacesless namespaces 😛 |
20:40:35 | FromDiscord | <bananahead> Quick one all. I have 2 hashSets which I am using to find a diff. How do I extract the diffed values. The docs suggest using the [], but this does not work for me, and causes an error. |
20:40:36 | Amun-Ra | Elegantbeef: same here, I always wrap stuff myself, and I always hide raw C stuff |
20:40:57 | FromDiscord | <spazzy> so realistically it would probably be faster to futhark the macros and c2nim the rest of it that c2nim actually likes than just messing with the header until it wraps itself? |
20:42:58 | FromDiscord | <bananahead> Oh maybe I should use a set insted of a hashset |
20:47:28 | Amun-Ra | bananahead: s1 -+- s2 (hashsets); otherwise (s1 - s2) + (s2 - s1) |
20:49:30 | Amun-Ra | hmm, -+- doesn't work the way I thought it works |
20:49:46 | FromDiscord | <bananahead> In reply to @Amun-Ra "<@451387344109568011>: s1 -+- s2": So the diff isn't so much the issue. if I echo it I'm left with `{'d'}` which is a new hashset. I want to get `'d'` as a string |
20:50:51 | FromDiscord | <Elegantbeef> you can do `for x in yourSet` |
20:50:52 | FromDiscord | <Elegantbeef> or do `yourSet.toSeq` with `import std/sequtils` |
20:54:32 | FromDiscord | <bananahead> Thanks as always @ElegantBeef |
20:55:07 | FromDiscord | <Elegantbeef> and yes if you're doing `HashSet[char]` stop playing games and do `set[char]` 😀 |
20:55:30 | FromDiscord | <kevin> does nim have something to convert from a char array to a string and vice versa? |
20:56:08 | FromDiscord | <Elegantbeef> Are we talking about `array[10, char]` or a cstring? |
20:56:12 | FromDiscord | <kevin> c2nim formatted all of the c char array struct members into Nim char arrays |
20:56:24 | FromDiscord | <Elegantbeef> Ah those should be `cstring` |
20:56:42 | FromDiscord | <bananahead> In reply to @Elegantbeef "and yes if you're": Im having trouble getting string into a set format, without nim complaining with me |
20:57:00 | FromDiscord | <Elegantbeef> cstring is a `ptr UncheckedArray[char]` and there are easy conversions to/from |
20:57:14 | FromDiscord | <Elegantbeef> Nim's built in set only works with ordinals |
20:57:33 | FromDiscord | <Elegantbeef> So a string will not work, i assumed you had a bitset of chars which is why i mentioned it |
20:57:37 | FromDiscord | <Elegantbeef> hashset of chars\ |
20:57:45 | Amun-Ra | kevin: join from strutils |
20:58:20 | FromDiscord | <Elegantbeef> I should clarify that Nim's bitsets work for ordinals in the range of `0..uin16.high` |
20:58:36 | FromDiscord | <bananahead> Nope, Im attempting the AOC day 8 part 2. So and creating and diffing sets made up from strings. |
20:58:56 | FromDiscord | <Elegantbeef> Then yea disregard the set comment by me |
20:59:02 | FromDiscord | <Elegantbeef> I just seen `{'d'}` and assumed it was a char set |
20:59:11 | FromDiscord | <Elegantbeef> Cause that is not a string 😛 |
20:59:21 | FromDiscord | <bananahead> Haha fair point! |
21:00:14 | * | jmdaemon quit (Ping timeout: 252 seconds) |
21:03:15 | FromDiscord | <kevin> sent a code paste, see https://play.nim-lang.org/#ix=3IwN |
21:03:44 | FromDiscord | <Elegantbeef> Those are global char arrays? If so the Nim type is right imo |
21:03:47 | FromDiscord | <kevin> I'm pretty sure I'm missing something simple |
21:04:24 | FromDiscord | <kevin> It's a C type originally: `typedef struct _S_CONFIG {` |
21:04:45 | FromDiscord | <kevin> lots more members in the struct but basically the same all the way thru. |
21:05:04 | FromDiscord | <Elegantbeef> Then yes those should be cstrings |
21:05:07 | FromDiscord | <Elegantbeef> afaik atleast |
21:05:23 | FromDiscord | <Elegantbeef> Can i see the C struct and c2nim output? |
21:06:03 | FromDiscord | <kevin> https://github.com/TheWover/donut/blob/master/lib/donut.h |
21:06:30 | FromDiscord | <kevin> https://media.discordapp.net/attachments/371759389889003532/920783902405165096/donut.nim |
21:06:55 | FromDiscord | <kevin> slightly tweaked output since some things broke |
21:07:19 | FromDiscord | <Elegantbeef> Ok so yea the original type is right imo |
21:08:22 | FromDiscord | <kevin> So then if I use a Nim array[char], it's: `Error: type mismatch: got 'string' for '"asdf"' but expected 'array[0..255, char]'` |
21:08:31 | FromDiscord | <Elegantbeef> Yep one second |
21:11:08 | nrds | <Prestige99> duds: there are tutorials on the nim website that are good to read |
21:11:33 | nrds | <Prestige99> https://nim-lang.org/documentation.html |
21:11:39 | nrds | <duds99> NOT YET omg omg |
21:11:49 | nrds | <duds99> thank u but i have to wait........ |
21:11:49 | nrds | <Prestige99> Haha |
21:12:00 | nrds | <duds99> do not tempt me or i will be all over the place lol |
21:12:14 | nrds | <duds99> too much picking up and dropping langs and stuff already |
21:12:22 | nrds | <duds99> adhd impulses u know |
21:13:05 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3IwP\ |
21:13:05 | FromDiscord | <Elegantbeef> You probably need something like taht |
21:13:10 | FromDiscord | <Elegantbeef> Since afaik the char arrays in C are fixed size regardless what you put in them |
21:15:03 | Amun-Ra | or something as generic as https://play.nim-lang.org/#ix=3IwR |
21:18:44 | Amun-Ra | hmm |
21:20:16 | Amun-Ra | that wouldn't work es expected if there's junk after null terminator |
21:21:22 | FromDiscord | <kevin> So i guess Nim does not have a stdlib converter from c char array to cstring? |
21:21:33 | * | neurocyte0132889 quit (Read error: Connection reset by peer) |
21:21:47 | FromDiscord | <kevin> if not that's ok but i would have thought there would be |
21:22:27 | FromDiscord | <Elegantbeef> Well the issue there Amun is that in their example there are a bunch of char arrays that are 256 characters so going to/from is going to be tedious still |
21:22:28 | FromDiscord | <Elegantbeef> For safety i think using a distinct there is the best |
21:22:30 | * | neurocyte0132889 joined #nim |
21:22:30 | * | neurocyte0132889 quit (Changing host) |
21:22:30 | * | neurocyte0132889 joined #nim |
21:24:38 | FromDiscord | <Elegantbeef> Well we have `cstring` but those arent cstrings afaik |
21:24:39 | FromDiscord | <Elegantbeef> Those are fixed size char arrays, but pretend to be cstrings cause C "has a type system" |
21:24:39 | FromDiscord | <Elegantbeef> That's kinda the point amun, these are max 256 characters, and you probably(didnt look at the actual impl, just assumed) use nul termination for ending these early |
21:24:57 | FromDiscord | <Elegantbeef> That's my assumption at least, i could be wrong |
21:29:05 | Amun-Ra | pretty much |
21:37:29 | FromDiscord | <spazzy> for anyone that cares: the openbsd port of nim is still on 1.2 |
21:38:48 | FromDiscord | <spazzy> for some reason |
21:39:42 | FromDiscord | <Elegantbeef> Generally it's suggested to use choosenime or gitnim to install Nim regardless where you are, though no clue if it plays well with BSD(i'd assume so) |
21:39:54 | FromDiscord | <Elegantbeef> choosenim even |
21:45:59 | FromDiscord | <spazzy> it doesnt |
21:46:21 | FromDiscord | <spazzy> it assumes the os flag is linux |
22:34:11 | * | krux02 quit (Remote host closed the connection) |
23:02:43 | * | noeontheend quit (Ping timeout: 256 seconds) |
23:16:02 | FromDiscord | <pyautogui> Hi - I am wondering, why is "ansi_c.nim" not importable from my code? "https://github.com/nim-lang/Nim/blob/69aabdab800077e9aaa08344494c83138a02f57c/lib/system/ansi_c.nim". There are a lot of situations in which it would be useful. |
23:19:54 | FromDiscord | <VideoCarp> I'm having an error with types while creating a Fibonacci series program. https://play.nim-lang.org/#ix=3Ixj↵It says it expects int32 but got string, and when I add `int32(nterms)` at the end of the variable block, it says it expects string but got int32. I am stuck. |
23:21:59 | * | sagax joined #nim |
23:22:08 | FromDiscord | <Elegantbeef> `readLine(stdin)` returns a string |
23:23:04 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Ixk |
23:23:27 | FromDiscord | <Elegantbeef> Though worth noting this will error if you give a value outside of int32 range |
23:24:51 | FromDiscord | <VideoCarp> how do I fix it though? |
23:27:37 | FromDiscord | <VideoCarp> oh I found something. thanks |
23:28:22 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Ixn something like this is nice, but better to just use a procedure for the parsing logic/checks |
23:31:20 | FromDiscord | <VideoCarp> what is wrong with https://play.nim-lang.org/#ix=3Ixp |
23:31:50 | FromDiscord | <Elegantbeef> If you give a non parsable string to `parseInt` it'll crash the program |
23:32:01 | FromDiscord | <VideoCarp> will put in try |
23:32:04 | FromDiscord | <Elegantbeef> For instance if you do `hfjdjkafhda` in tesponse |
23:32:15 | FromDiscord | <VideoCarp> but it's telling me it expects string now but got int |
23:32:34 | FromDiscord | <Elegantbeef> Well type mismatches are generally helpful so read the line and the expression |
23:34:08 | FromDiscord | <Elegantbeef> You can even compile with `--hint[source]:on` to get exactly where the issue is if that helps you |
23:34:17 | FromDiscord | <VideoCarp> sent a code paste, see https://play.nim-lang.org/#ix=3Ixq |
23:34:28 | FromDiscord | <VideoCarp> oh wait |
23:34:30 | FromDiscord | <VideoCarp> that is right |
23:34:41 | FromDiscord | <Elegantbeef> You're parsing an int so that's what you expect |
23:34:44 | FromDiscord | <VideoCarp> I had another `readLine` |
23:53:07 | * | jmdaemon joined #nim |