00:00:17 | FromDiscord | <Elegantbeef> the issue with refc vs arc is that arc probably clears the for loop variables after the loop whereas refc doesnt |
00:04:39 | * | pch joined #nim |
00:04:48 | qwr | you're right, capture value: fixes my code |
00:05:28 | qwr | but if its meant to be that way, its a bit insane, like trap |
00:06:00 | qwr | either compiler should give error or preferably automatically capture |
00:06:38 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44S2 |
00:06:45 | qwr | and its not a loop variable in my case |
00:07:03 | FromDiscord | <Elegantbeef> It's derived from one |
00:08:18 | * | qwr thinks that if i get some rest to clear my head, then i'll try to write some issue about that (and i'll have to test, if the previous bug i had is also about capturing) |
00:10:59 | FromDiscord | <Elegantbeef> I'm too dumb to explain why it doesnt automatically create a capture scope, I'd wager a complexity issue |
00:10:59 | FromDiscord | <Elegantbeef> Though i think JS does(did?) have similar behaviour |
00:12:15 | qwr | not really, JS is also insane about loop variable capture, but at least it won't give some zeros out of nowhere |
00:13:14 | qwr | but i think for ... { const x = blaah; foo(() => x); } works as intended in JS |
00:13:46 | * | duuude joined #nim |
00:13:55 | qwr | here it is transitive and really unintuitive |
00:16:43 | FromDiscord | <voidwalker> please tell me how this makes sense: |
00:16:52 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44S4 |
00:17:00 | FromDiscord | <voidwalker> (edit) |
00:17:16 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=44S4" => "https://play.nim-lang.org/#ix=44S5" |
00:17:20 | FromDiscord | <Elegantbeef> run the command again and it'll install |
00:17:32 | FromDiscord | <Elegantbeef> It makes sense cause nimble doesnt like being sensible there |
00:17:32 | FromDiscord | <voidwalker> yeah that's what I wanted to paste 😄 |
00:17:46 | FromDiscord | <voidwalker> I ran it again with --verbose and it installed |
00:18:08 | FromDiscord | <Elegantbeef> It wasnt the verbose |
00:18:09 | FromDiscord | <voidwalker> Looks like a bug to me |
00:18:11 | FromDiscord | <!Patitotective> there should be a `nimble update pkg` command that does `nimble refresh && nimble install pkg` |
00:18:13 | FromDiscord | <Elegantbeef> It was just running the command again |
00:18:15 | FromDiscord | <Elegantbeef> It's a bug |
00:18:45 | FromDiscord | <Elegantbeef> Nimble doesnt properly check the downloaded registry after updating it |
00:18:46 | FromDiscord | <voidwalker> ohhhh the pixels package is new then, after i installed (and refreshed) nimble |
00:18:52 | FromDiscord | <voidwalker> ohhh |
00:19:01 | FromDiscord | <Elegantbeef> So it downloaded the registry |
00:19:10 | FromDiscord | <Elegantbeef> Then it checked against the registry it had before |
00:19:14 | FromDiscord | <Elegantbeef> And errored |
00:19:25 | FromDiscord | <voidwalker> so it's like trying to download a package for your distro with outdated repository info |
00:19:49 | * | matt_13377 left #nim (The Lounge - https://thelounge.chat) |
00:19:59 | FromDiscord | <Elegantbeef> Yea but imagine if your distro went "do you want to me update repository info" then updated it and then said "could not find the package" |
00:20:39 | FromDiscord | <voidwalker> I saw some mention of this the past days, people trying to install "pixels" to try out the code in chapter 1 of the book |
00:21:00 | FromDiscord | <Elegantbeef> Yea it's a bug with nimble that i've seen a fair bit |
00:23:24 | FromDiscord | <Elegantbeef> Relatively mild bug, but probably going to annoy people that dont run the command again |
00:23:52 | FromDiscord | <voidwalker> I just realized I hardly ever did any graphical programming at all, with raw pixels, so that part should be fun ! |
00:24:09 | FromDiscord | <voidwalker> just console and TButtons for me |
00:25:41 | FromDiscord | <!Patitotective> https://github.com/nim-lang/Nim/pull/20063 👀 |
00:27:26 | FromDiscord | <Elegantbeef> Why do you have `rotations` twice? |
00:27:33 | FromDiscord | <Elegantbeef> Same with permutations |
00:27:44 | FromDiscord | <Elegantbeef> Oh nevermind string specialization required |
00:28:42 | FromDiscord | <!Patitotective> i dont really know if that is good because std/algorithm descriptions says↵> _This module implements some common generic algorithms on `openArray`s._ |
00:28:55 | FromDiscord | <!Patitotective> (edit) "std/algorithm descriptions" => "std/algorithms description" |
00:33:31 | FromDiscord | <konsumlamm> i don't really know of that is a good description |
00:34:34 | FromDiscord | <konsumlamm> (edit) "of" => "if" |
00:34:50 | FromDiscord | <Elegantbeef> Personally though I'd always say Iterator \> Procedure for these things |
00:35:32 | FromDiscord | <konsumlamm> that's what std/algorithm currently is, burt if it's only for openarrays, it shouldn't be called "algorithm" tbh |
00:36:23 | FromDiscord | <Elegantbeef> I might be wrong but i imagine in most cases people are needing to iterator over all permutations |
00:36:46 | FromDiscord | <Elegantbeef> iterate over\ |
00:37:57 | FromDiscord | <Elegantbeef> It's easier to do `toSeq(mySeq.permuations)` than it is to convert a proc to an iterator |
00:38:56 | FromDiscord | <!Patitotective> ok gonna change that :] |
00:45:04 | FromDiscord | <demotomohiro> Returning all permutations/rotation aa seq means it likely use a large amount of memory and might slow down execution. |
00:46:06 | FromDiscord | <Elegantbeef> It's already a shame that permutations require a sort and a another allocation |
00:46:12 | FromDiscord | <!Patitotective> In reply to @demotomohiro "Returning all permutations/rotation aa": but it will be as expensive if you do `mySeq.permutations.toSeq` (where `permutations` is an iterator) |
00:46:24 | FromDiscord | <Elegantbeef> Yes if you want all permutations |
00:46:35 | FromDiscord | <Elegantbeef> Most people dont ever want all permutations in memory at once |
00:51:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44S9 |
00:52:14 | FromDiscord | <Elegantbeef> Only two allocations and is can be reset |
00:53:01 | FromDiscord | <Elegantbeef> guess that should be `dup s.sort()` |
00:53:12 | FromDiscord | <Elegantbeef> or `s.dup(sort())` always forget |
00:53:33 | FromDiscord | <!Patitotective> but dup sort is the same as sorted (?) |
00:53:39 | FromDiscord | <Elegantbeef> No it's not |
00:53:44 | FromDiscord | <!Patitotective> 🤨 |
00:54:02 | FromDiscord | <Elegantbeef> `sort` sorts the collection in place so if you use an array it doesnt emit a sequence |
00:54:20 | FromDiscord | <Elegantbeef> Which means your `Permutator` can store all the data it needs on the stack |
00:54:22 | FromDiscord | <Elegantbeef> Or contiguous |
00:54:53 | FromDiscord | <Elegantbeef> Consider if you had a `seq` of these `Permuators` with `sorted` the `current` and `start` would be all over the heap |
00:55:27 | FromDiscord | <Elegantbeef> But if you have an array of 10 items these Permutators would be `sizeof(array[10, T]) 2` and capable of being stored contiguously |
00:55:34 | FromDiscord | <!Patitotective> these checks take forever https://media.discordapp.net/attachments/371759389889003532/999117329965269082/unknown.png |
00:55:42 | FromDiscord | <Elegantbeef> Of course |
00:56:03 | FromDiscord | <Elegantbeef> It's the entire compiler being tested with all your changes in mind |
00:56:08 | FromDiscord | <!Patitotective> :[ |
00:57:45 | FromDiscord | <demotomohiro> You can run these checks on your fork before creating PR. But I forget how to setup it. |
00:58:04 | FromDiscord | <!Patitotective> In reply to @demotomohiro "You can run these": wouldnt it take the same? |
00:58:18 | FromDiscord | <Elegantbeef> CI is relatively slow |
00:58:30 | FromDiscord | <Elegantbeef> it's just `./koch test` to run the entire suite |
01:00:07 | FromDiscord | <demotomohiro> @!Patitotective Yes, it also takes more than an hour. |
01:00:09 | FromDiscord | <Elegantbeef> You can do things like `./koch test cat stdlib` |
01:00:45 | FromDiscord | <Elegantbeef> Locally the entire test suit is a few minutes |
01:01:01 | FromDiscord | <Elegantbeef> Turns out multiple part CIs that run on 3 different OS take some time |
01:01:33 | FromDiscord | <amadan> In reply to @Elegantbeef "Relatively mild bug, but": https://github.com/nim-lang/nimble/pull/962↵Its fixed, just need to wait for next nimble release |
01:01:55 | FromDiscord | <Elegantbeef> lol nice i guess |
01:02:10 | FromDiscord | <Elegantbeef> Nimble 0.14 is only what a decade away? 😄 |
01:02:48 | FromDiscord | <amadan> Thought it was getting released with nim 3.0? |
01:03:03 | FromDiscord | <Elegantbeef> Cant tell if it's a typo or a joke |
01:03:10 | FromDiscord | <amadan> joke lol |
01:03:14 | FromDiscord | <Elegantbeef> Either way i approve of the sentiment |
01:10:00 | FromDiscord | <voidwalker> Lmao chapter 6 in Araq's book is 2/5 of a page |
01:10:22 | FromDiscord | <voidwalker> And the next page is blank.. what a waste of paper |
01:10:48 | FromDiscord | <Elegantbeef> Save the trees buy a physical book! |
01:17:40 | FromDiscord | <creikey> sent a code paste, see https://play.nim-lang.org/#ix=44Sd |
01:17:47 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/999122916027404359/unknown.png |
01:17:50 | FromDiscord | <Elegantbeef> `nnkStrLit` |
01:18:17 | FromDiscord | <Elegantbeef> it's `e.hasCustomPragma` |
01:18:40 | FromDiscord | <creikey> wait k is the string of the field |
01:18:41 | FromDiscord | <creikey> e is the like |
01:18:43 | FromDiscord | <creikey> actual field |
01:18:55 | FromDiscord | <creikey> this is so weird fieldpairs turns like what's inside of it into a compile time thing |
01:18:57 | FromDiscord | <creikey> wait is it a macro |
01:19:17 | FromDiscord | <creikey> no it's compiler magic |
01:19:57 | FromDiscord | <Elegantbeef> it's `name, field` |
01:20:02 | FromDiscord | <Elegantbeef> `field` is the dot expression required to access the field |
01:20:18 | FromDiscord | <Elegantbeef> so so it's `myObj.field` |
01:21:23 | * | duuude quit (Ping timeout: 244 seconds) |
01:21:48 | FromDiscord | <creikey> interesting |
01:22:02 | FromDiscord | <Elegantbeef> It doesnt actually any longer require magic |
01:22:10 | FromDiscord | <Elegantbeef> Since we have ForLoopMacros |
01:24:34 | FromDiscord | <creikey> I have successfully segfaulted nim |
01:25:42 | FromDiscord | <Elegantbeef> Congrats |
01:32:09 | FromDiscord | <voidwalker> welp, the book definitely needs a scan. Turns out you can't read it in the dark |
01:32:15 | FromDiscord | <TryAngle> In reply to @creikey "I have successfully segfaulted": did u do some pointers |
01:32:39 | FromDiscord | <!Patitotective> In reply to @voidwalker "welp, the book definitely": its kinda weird to read a book in the dark, isnt it? |
01:32:40 | FromDiscord | <creikey> In reply to @TryAngle "did u do some": no I just read from nil |
01:32:54 | FromDiscord | <TryAngle> In reply to @creikey "no I just read": 💀 |
01:33:07 | FromDiscord | <Prestige> If anyone scans it let me know, I want a pdf copy |
01:33:08 | FromDiscord | <TryAngle> nim should embrace option types more imo |
01:33:18 | FromDiscord | <voidwalker> I guess I did most of my reading in the dark, on a screen or using a portable light |
01:33:33 | FromDiscord | <TryAngle> nil/null is wayy too 20th cenutry |
01:33:35 | FromDiscord | <creikey> In reply to @TryAngle "nim should embrace option": they kinda clunky |
01:33:40 | FromDiscord | <creikey> why do you have to type some |
01:33:47 | FromDiscord | <creikey> (edit) "why do you have to type some ... " added "or none" |
01:33:50 | FromDiscord | <creikey> I don't remember which I ran into issues with |
01:34:28 | FromDiscord | <Prestige> There are also weird cases like using nil as a type iirc |
01:34:46 | FromDiscord | <creikey> imagine if nim 2 got rid of nil |
01:35:07 | FromDiscord | <Elegantbeef> It's a post 2 plan to default to not nil |
01:35:20 | FromDiscord | <Prestige> Related to https://github.com/nim-lang/Nim/issues/18250 |
01:36:02 | FromDiscord | <creikey> exceptions for control flow seems like it's a problem |
01:36:05 | FromDiscord | <Prestige> I might actually write my own little table module to deal with this |
01:36:13 | FromDiscord | <creikey> also like is async being very allocation heavy a problem or not? |
01:36:24 | FromDiscord | <TryAngle> In reply to @creikey "imagine if nim 2": I think thiis is not the way either |
01:37:34 | FromDiscord | <TryAngle> will we get pattern matching in nim 2? |
01:37:42 | FromDiscord | <Elegantbeef> Exceptions are a problem to whom exactly? |
01:37:59 | FromDiscord | <Elegantbeef> Nim 2.0 is not nearly as magically different as most people seem to think |
01:38:20 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/RFCs/issues/437 |
01:38:27 | FromDiscord | <TryAngle> like↵`if some x = table.get(4):` |
01:38:30 | FromDiscord | <TryAngle> that would be |
01:38:32 | FromDiscord | <TryAngle> great |
01:39:39 | FromDiscord | <Elegantbeef> I dont even get what that does |
01:39:45 | FromDiscord | <creikey> this doesn't seem 2.0 at all |
01:39:53 | FromDiscord | <creikey> this is like 1.76 |
01:39:53 | FromDiscord | <creikey> (edit) "1.76" => "1.7" |
01:40:02 | FromDiscord | <Elegantbeef> It's almost like 2.0 just allows major changes |
01:40:10 | FromDiscord | <Elegantbeef> Wow who'd have thought that semver mattered |
01:40:23 | FromDiscord | <creikey> I'm used to godot where it's all kinda arbitrary |
01:40:36 | FromDiscord | <Elegantbeef> Yea well Nim sticks closer to proper semver |
01:40:37 | FromDiscord | <creikey> they've been putting off features for 4.0 for years |
01:40:39 | FromDiscord | <creikey> all catching up to them |
01:40:59 | FromDiscord | <Elegantbeef> major.minor.patches |
01:41:32 | FromDiscord | <Elegantbeef> Major does not have to be backwards compatible, minor is a change to the major but without backward breaking changes, patches are fixes to issues of course |
01:42:32 | FromDiscord | <huantian> In reply to @TryAngle "like `if some x": you can do that with questionable https://github.com/status-im/questionable#option-binding= |
01:44:21 | FromDiscord | <Elegantbeef> Nim is very extensible, things like proper pattern matching using `case` can be implemented with `casestmt` macros though i know haaaax doesnt like those |
01:45:03 | * | duuude joined #nim |
01:49:10 | FromDiscord | <TryAngle> In reply to @huantian "you can do that": this is beautfiul |
01:49:11 | FromDiscord | <TryAngle> thanks |
01:49:30 | FromDiscord | <TryAngle> is ?int the same as Option[int] ? |
01:49:37 | FromDiscord | <Elegantbeef> Yes |
01:49:45 | FromDiscord | <Elegantbeef> It's a unary operator to create an option typedesc |
01:50:01 | FromDiscord | <TryAngle> lollll |
01:50:21 | FromDiscord | <TryAngle> I didn't think about this at all |
01:50:29 | FromDiscord | <TryAngle> operators on type level 😳 |
01:51:20 | FromDiscord | <Elegantbeef> types can be operated through procedures/templates |
01:51:28 | FromDiscord | <Elegantbeef> They're static values after all |
01:51:50 | FromDiscord | <Prestige> Ngl I think this looks very ugly |
01:52:03 | FromDiscord | <Elegantbeef> I'd agree, but more power to who wants it |
01:52:06 | FromDiscord | <TryAngle> In reply to @Avahe "Ngl I think this": ye using ? instead of Option I agree |
01:52:08 | FromDiscord | <Elegantbeef> You can use words if you prefer |
01:52:13 | FromDiscord | <TryAngle> but ?= is so insane |
01:52:43 | FromDiscord | <creikey> In reply to @TryAngle "but ?= is so": the mystery equality operator. who knows what it sets your variable to |
01:52:51 | FromDiscord | <Elegantbeef> `x.matchSome myStatementHere` is more sane if you ask me |
01:53:05 | FromDiscord | <creikey> beef I did what you said and it worked really well so I opened a PR https://github.com/treeform/jsony/pull/51 |
01:56:06 | FromDiscord | <Elegantbeef> Would you look at that |
01:56:43 | FromDiscord | <Elegantbeef> Now just if we could have `jsonDefault` and `jsonName` companions 😄 |
02:07:18 | FromDiscord | <TryAngle> when u use Arc in Rust, can I use just a plain ref in nim? |
02:07:33 | FromDiscord | <Elegantbeef> Probably |
02:07:50 | FromDiscord | <TryAngle> from what I understand arc is just a shared pointer |
02:08:04 | FromDiscord | <Elegantbeef> Yea Arc and ref will have similar semantics |
02:08:34 | FromDiscord | <TryAngle> the only addition Arc has over ref is being explicit about being for multithreading I think? |
02:09:08 | FromDiscord | <TryAngle> also rust needs that bc of explicit lifetimes, nim doesn't have that so it can just be normal ref? |
02:09:09 | FromDiscord | <Elegantbeef> You can use a guard pragma if you want a thread safe "ref" for ARC/ORC gcs |
02:09:37 | FromDiscord | <TryAngle> In reply to @Elegantbeef "You can use a": hmm but wouldn't that be more analog to mutex / lock? |
02:10:13 | FromDiscord | <Elegantbeef> I mean if you were using ref for multithreading |
02:10:48 | FromDiscord | <TryAngle> can u use ref for multihreading? I haven't tested it but will in some hours lol |
02:11:14 | FromDiscord | <Elegantbeef> You can with Orc/Arc if you use `GcRef` and `cursor` appropriately |
02:11:15 | FromDiscord | <TryAngle> In reply to @TryAngle "the only addition Arc": ah and Arc disallows mutation |
02:11:36 | FromDiscord | <TryAngle> In reply to @Elegantbeef "You can with Orc/Arc": I'm using arc, may u show an example with this? |
02:11:42 | FromDiscord | <Elegantbeef> `refc` doesnt use a shared heap for `ref` as such you cannot use `ref` |
02:11:57 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/9309 |
02:12:07 | FromDiscord | <TryAngle> ah ok I remember u gave me an example with GC ref recenlty |
02:12:47 | FromDiscord | <Elegantbeef> An issue with `ref` and Nim's orc/arc presently is that they will fight over destruction |
02:13:05 | FromDiscord | <TryAngle> In reply to @Elegantbeef "An issue with `ref`": ah I see, so I can't even use ref objects? |
02:13:13 | FromDiscord | <Elegantbeef> I mean you can but you need a brain |
02:13:28 | FromDiscord | <TryAngle> I don't have brain >. < |
02:13:33 | FromDiscord | <Elegantbeef> Well then you cannot |
02:14:01 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/threading has some tools to make life easier |
02:14:58 | FromDiscord | <TryAngle> In reply to @Elegantbeef "https://github.com/nim-lang/threading has some tool": ah I see so rust's Arc would be a `ConstPtr`? |
02:16:21 | FromDiscord | <TryAngle> I'm curius, whats the design decision to use the tuple `val: ptr tuple[value: T, counter: Atomic[int]]`↵over using value and counter as fields? |
02:18:52 | FromDiscord | <Elegantbeef> The type needs to be stack allocated but have heap allocated val, and counter so it's accessible safely across threas |
02:21:24 | FromDiscord | <TryAngle> In reply to @Elegantbeef "https://github.com/nim-lang/threading has some tool": will those things get into std once orc becomes the default? |
02:21:46 | FromDiscord | <Elegantbeef> No clue probably will in the new stdlib in 2.0 |
02:24:51 | FromDiscord | <TryAngle> Hmm OK ty |
02:31:22 | FromDiscord | <Prestige> Odd question, what would be a decent/efficient way to create a unique number from 2 ints? E.g. you are given an `x` and `y` and want to generate a unique int or float from the two |
02:32:09 | FromDiscord | <Elegantbeef> hash them? |
02:33:03 | FromDiscord | <Prestige> Is there a way to hash the two together uniquely? |
02:33:24 | FromDiscord | <Prestige> Like x = 3, y = 5 has to have a different outcome than x = 5, y = 3 |
02:34:43 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=44So |
02:35:37 | FromDiscord | <Elegantbeef> Hashing uses the avalanche effect it's not commutative afaik |
02:35:38 | FromDiscord | <Prestige> Hm do you need that final line? |
02:36:01 | FromDiscord | <Elegantbeef> > Finishes the computation of the hash value.↵> This is only needed if you need to implement a hash proc for a new datatype. |
02:36:55 | FromDiscord | <Elegantbeef> So i think so |
02:37:26 | FromDiscord | <Prestige> Was thinking I could do https://play.nim-lang.org/#ix=44Sr |
02:37:58 | FromDiscord | <Elegantbeef> I mean probably no clue |
02:48:22 | FromDiscord | <huantian> I think what you're looking for is a pairing function? |
02:49:25 | FromDiscord | <Prestige> Sounds right |
02:49:56 | FromDiscord | <Prestige> If it's more efficient than hashing |
02:53:08 | FromDiscord | <huantian> the result will take up more space than the inputs, ie pairing two 16 bits numbers will give you a 32 bit at max in the most optimal situation |
02:56:35 | FromDiscord | <huantian> you could also just slap the two ints next to each other |
02:57:11 | FromDiscord | <Prestige> I don't think that works in the case I described earlier |
02:57:30 | FromDiscord | <Prestige> Just did a little test, creating a Cantor pair seems to be significantly faster |
02:58:01 | FromDiscord | <Prestige> https://play.nim-lang.org/#ix=44St |
02:58:08 | FromDiscord | <Prestige> If I did that correctly, that is |
02:58:19 | FromDiscord | <huantian> I mean consider 2 bit ints, we have 1 (01) and 3(11)↵1 x 3 = 01 x 11 = 0111↵3 x 1 = 11 x 01 = 1101 |
02:58:46 | FromDiscord | <Prestige> oh, I don't think I did it right. Can't read math notations |
02:59:34 | FromDiscord | <Prestige> Hm how would you go about doing that in code? |
03:01:21 | FromDiscord | <Prestige> I think this is actually correct, still a bit faster than hashing: https://play.nim-lang.org/#ix=44Sv |
03:03:38 | FromDiscord | <huantian> you will overflow if your inputs are too big and I'm not sure if it works for negative numbers but looks right |
03:04:09 | FromDiscord | <Prestige> In reply to @huantian "I mean consider 2": I think I could just bitshift but I'd have to convert the numbers to binary, eh? |
03:06:39 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=44Sx |
03:07:08 | FromDiscord | <Prestige> neat, didn't know bitops was a thing |
03:07:24 | FromDiscord | <huantian> yeah I don't know if there's a better way to do a bitwise or |
03:08:10 | FromDiscord | <Elegantbeef> `or` is bitwise or |
03:08:14 | FromDiscord | <huantian> ah |
03:09:24 | FromDiscord | <huantian> <https://stackoverflow.com/questions/919612/mapping-two-integers-to-one-in-a-unique-and-deterministic-way>↵huh reading this looks like there are other pairing functions like https://media.discordapp.net/attachments/371759389889003532/999151010259947550/unknown.png |
03:10:08 | FromDiscord | <Prestige> https://play.nim-lang.org/#ix=44Sy↵It is significantly faster |
03:12:32 | FromDiscord | <huantian> wait why am I using rotate again, `a.uint32 shl 16 or b` should just work |
03:12:51 | FromDiscord | <Prestige> Yeah |
03:13:15 | FromDiscord | <Prestige> Beautiful |
03:18:51 | FromDiscord | <Prestige> Looks like it works just fine |
03:31:37 | NimEventer | New Nimble package! batteries - Module that imports common nim standard library modules for your convenience, see https://github.com/AngelEzquerra/nim-batteries |
03:32:15 | FromDiscord | <Elegantbeef> That seems a bit funny |
03:32:42 | FromDiscord | <Elegantbeef> I have to `nimble install nimbatteries` then add `requires "nim-batters > 0.1.0" to my nimble ifle then `import batteries\` 😄 |
04:17:46 | FromDiscord | <sharpcdf> I don't know why but this popped up in my head: nim vs rust, what are they used for? To me they seem awfully similar other than rust having more safety |
04:18:25 | FromDiscord | <Elegantbeef> They're at the same level |
04:18:59 | FromDiscord | <sharpcdf> Why would one use rust over nim and vice versa? |
04:19:35 | FromDiscord | <Elegantbeef> Cause they prefer rust over nim or vice versa |
04:19:44 | FromDiscord | <# Luke> What's the Nim equivalent of exporting an env var in bash |
04:19:54 | FromDiscord | <TryAngle> In reply to @sharpcdf "Why would one use": rust is full on safety |
04:20:19 | FromDiscord | <Elegantbeef> `putEnv` ripluke |
04:20:32 | FromDiscord | <sharpcdf> In reply to @ripluke "What's the Nim equivalent": putEnv |
04:20:35 | FromDiscord | <# Luke> In reply to @Elegantbeef "`putEnv` ripluke": It doesn't export it tho |
04:20:50 | FromDiscord | <# Luke> Like I'm trying with the PS1 var |
04:21:00 | FromDiscord | <Elegantbeef> It depends on your shell i think |
04:21:06 | FromDiscord | <TryAngle> In reply to @TryAngle "rust is full on": nim is a lot easier to write than rust |
04:21:16 | FromDiscord | <Elegantbeef> You probably have to check which shell and then use the appropriate shell command |
04:21:25 | FromDiscord | <# Luke> In reply to @Elegantbeef "You probably have to": Oh |
04:21:44 | FromDiscord | <Elegantbeef> Export afaik is a temporary operation done in the shell not the program running |
04:22:14 | FromDiscord | <sharpcdf> In reply to @TryAngle "nim is a lot": Well yea but I mean more like what are people using rust for vs nim for |
04:22:35 | FromDiscord | <sharpcdf> what libraries, apps all of thF |
04:22:39 | FromDiscord | <sharpcdf> (edit) "thF" => "that" |
04:22:59 | FromDiscord | <TryAngle> In reply to @sharpcdf "Well yea but I": similar space, although rust covers more right now due to bigger community |
04:42:28 | * | arkurious quit (Quit: Leaving) |
04:44:24 | FromDiscord | <Prestige> And better editor support |
04:50:42 | FromDiscord | <Dale> Hey guys, what's the proc/var for detecting the compile target OS? |
04:50:53 | FromDiscord | <Elegantbeef> `hostOs` |
04:51:01 | FromDiscord | <Elegantbeef> If you want a string |
04:51:23 | FromDiscord | <Dale> Doesn't that return the OS it's running on not compiled for? |
04:51:26 | FromDiscord | <Elegantbeef> If you want to do platform dependant compilation you have `defined(linux)` `defined(windows)` `defined(posix)` and so on depending on the specificity |
04:51:41 | FromDiscord | <Dale> That's what I wanted, yeah thanks :) |
04:51:56 | FromDiscord | <Elegantbeef> Nim's compile time logic emulates the target |
04:52:06 | FromDiscord | <Elegantbeef> So `hostOs` will return the string name of the OS |
04:52:20 | FromDiscord | <Dale> oh I see |
04:53:04 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/Cc3 |
04:57:28 | FromDiscord | <Dale> sent a code paste, see https://play.nim-lang.org/#ix=44SV |
04:57:32 | FromDiscord | <Elegantbeef> Yes |
04:57:38 | FromDiscord | <Dale> \o/ |
04:57:45 | FromDiscord | <Elegantbeef> It's "properly" using modules |
04:57:53 | FromDiscord | <Dale> I could do this with OOP but yeah, I wanna go modular |
04:58:00 | FromDiscord | <Elegantbeef> Modules should ideally be modular in that the API can easily replaced imo |
04:59:30 | FromDiscord | <Dale> yeah that's the idea innit |
05:00:00 | FromDiscord | <Dale> They're just gonna contain a bunch of paths for now |
05:00:12 | FromDiscord | <Dale> But I'm sure the need for more will crop up |
05:02:05 | FromDiscord | <Elegantbeef> For paths atleast |
05:02:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/4Pi |
05:04:04 | FromDiscord | <lantos> is there a specification for idiomatic nim? Like do you guys just read nim code and know what idiomatic looks like |
05:10:02 | FromDiscord | <Dale> I did think of that, but I decided to go for modules because there was something else I wanted, but I can't remember what that was haha |
05:10:38 | FromDiscord | <Dale> In reply to @lantos "is there a specification": There's 'zen of nim' |
05:10:58 | FromDiscord | <Dale> Also, if you understand how nim is different from other languages, it's mostly obvious |
05:11:34 | FromDiscord | <lantos> https://tenor.com/view/patrick-star-dumb-gif-20952040 |
05:11:37 | FromDiscord | <lantos> yeah but this is me ^ |
05:11:54 | FromDiscord | <Dale> I've been reading the nim docs and doing little scripts on my laptop for a couple of months before I started using it properly |
05:12:18 | FromDiscord | <Elegantbeef> Idiomatic nim code to me is readable and easily extensible and only needs to use wackier features if it needs to |
05:12:19 | FromDiscord | <Dale> Think I get the gist of it. There's quite a few fun talks on youtube |
05:12:30 | FromDiscord | <Elegantbeef> There is no objective "idiomatic nim code" |
05:12:37 | FromDiscord | <Phil> Imagine we could somehow define module interfaces that define which procs a module must supply to allow swapping a module out with another |
05:13:00 | FromDiscord | <Dale> Well there's idiomatic in terms of, how certain things are intended to be used, but you can adapt it to your own style |
05:13:03 | FromDiscord | <Elegantbeef> Yea that's on my wish list↵(@Phil) |
05:14:08 | FromDiscord | <Dale> You could do a template with that, with a bunch of asserts, but it's kinda clunky |
05:14:33 | FromDiscord | <Elegantbeef> Idiomatic Nim is really just code that uses Nim's features in a way that makes the code nice to write and extensible |
05:14:35 | FromDiscord | <Elegantbeef> Like using bitsets over bitflags |
05:14:35 | FromDiscord | <gorilla_> Whats the difference between when and if in this case |
05:14:55 | FromDiscord | <Dale> `elif` continues the `when` statement |
05:15:11 | FromDiscord | <Elegantbeef> Only the true statement of a when statement is semantically checked |
05:15:16 | FromDiscord | <Dale> Even though it's the same symbol as `if`, because the block started as `when`, they are `when` |
05:15:19 | FromDiscord | <Elegantbeef> `{.error: "msg".}` will stop compilatioon |
05:15:20 | FromDiscord | <gorilla_> Ah I see |
05:15:28 | FromDiscord | <gorilla_> Thanks |
05:15:39 | FromDiscord | <Elegantbeef> If you need to sepcialize code at compile tiime you use `when` |
05:15:43 | FromDiscord | <Elegantbeef> specialize even |
05:15:58 | FromDiscord | <Elegantbeef> Otherwise you use `if` cause it needs runtime information |
05:16:10 | FromDiscord | <Dale> I really like `when` |
05:16:14 | FromDiscord | <Phil> Agreed |
05:16:20 | FromDiscord | <Elegantbeef> It's nice |
05:16:30 | FromDiscord | <Elegantbeef> You can do a lot at compile time with it 😄 |
05:16:48 | FromDiscord | <Phil> I use it a ton for generating code variations at compile time in generics |
05:17:04 | FromDiscord | <Elegantbeef> There's even the `compiles` feature of Nim which quite odd |
05:17:34 | FromDiscord | <Elegantbeef> "Hey compile if this code compiles emit this other code" is an uncommon feature of any language i think |
05:20:51 | FromDiscord | <Phil> Is useful though |
05:21:21 | FromDiscord | <Phil> Though I used it mostly for writing tests |
05:22:31 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=44T1 |
05:22:42 | FromDiscord | <Elegantbeef> You could but that's awful |
05:23:00 | FromDiscord | <Elegantbeef> It's unneeded cruft that requires that config |
05:23:00 | FromDiscord | <lantos> xd |
05:23:31 | FromDiscord | <Elegantbeef> If you're authoring the library you dont need to use patchfile, patchfile is exactly the opposite, it's when you want a 'fork' of a module |
05:26:41 | FromDiscord | <Rika> In reply to @Isofruit "Imagine we could somehow": Why? |
05:27:18 | FromDiscord | <Elegantbeef> we can already do that just without compile time checks, you just get a compiler error |
05:28:16 | FromDiscord | <Elegantbeef> It's nice if you're adding functionality to a module for a specific OS if you had a concrete implementation you had to meet |
05:28:25 | FromDiscord | <Elegantbeef> It's basically module level concepts |
05:28:36 | FromDiscord | <Rika> I know |
05:28:39 | FromDiscord | <Rika> Why though? |
05:29:15 | * | duuude quit (Ping timeout: 276 seconds) |
05:29:27 | * | pch quit (Quit: Leaving) |
05:30:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44T2 |
05:30:23 | FromDiscord | <Elegantbeef> To figure out what's required you now need to open up one of those implementations and sift through all exported procedures |
05:31:33 | FromDiscord | <Elegantbeef> With the linux module it's the only two procedures there so it's quite easy to see what you need |
05:31:44 | * | duuude joined #nim |
05:32:05 | FromDiscord | <Elegantbeef> The mac version has 80 lines of unrelated code really |
05:32:07 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Let's look at hottie": when using this, whats better:↵using WinObject, LinuxObject etc. with an additional when or using just Object for all? |
05:32:17 | FromDiscord | <Elegantbeef> `Object` |
05:32:28 | FromDiscord | <Elegantbeef> The entire point is the modules have a public interface that is 1\:1 |
05:32:42 | FromDiscord | <TryAngle> because in rust the second is the convention i see everywhere 🤔 |
05:32:43 | FromDiscord | <Elegantbeef> If you have to delimit between them you've designed the code wrong imo |
05:32:56 | FromDiscord | <TryAngle> (edit) "second" => "first" |
05:33:10 | FromDiscord | <Elegantbeef> It's like with Nim's `io` you dont do `FileWindows` and `FilePosix` |
05:33:14 | FromDiscord | <Elegantbeef> You have `File` |
05:34:13 | FromDiscord | <TryAngle> In reply to @Elegantbeef "You have `File`": yeyye as exposed |
05:34:19 | FromDiscord | <TryAngle> I mean for internal |
05:34:34 | FromDiscord | <Elegantbeef> Having different types for internal makes no sense |
05:34:44 | FromDiscord | <Elegantbeef> You're already by design inside a `when` statement |
05:34:47 | FromDiscord | <Elegantbeef> You've delimited the OS |
05:35:17 | FromDiscord | <TryAngle> true tbh |
05:35:44 | FromDiscord | <Elegantbeef> Anyway to continue with Hottie it'd be nice to have a built in way to ensure that procedures/types exist, it's not hard to do with a macro though |
05:38:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44T3 |
05:38:41 | FromDiscord | <Elegantbeef> intend properly of course |
05:38:46 | FromDiscord | <Elegantbeef> indent\ |
05:39:35 | FromDiscord | <# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44T4 |
05:40:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/Obr |
05:40:49 | FromDiscord | <# Luke> i can use it in nimble? |
05:41:00 | FromDiscord | <Elegantbeef> That's in a nimble task |
05:42:35 | FromDiscord | <# Luke> hmm how can i run a task that shares a name with an existing command? |
05:42:53 | FromDiscord | <Elegantbeef> No clue |
05:43:17 | FromDiscord | <# Luke> ah the question that has stymied beef :P |
05:43:37 | FromDiscord | <Elegantbeef> Turns out i'm not the nimble docs |
05:43:46 | FromDiscord | <# Luke> oh |
05:48:35 | FromDiscord | <sharpcdf> That's surprising |
05:48:59 | FromDiscord | <sharpcdf> ~~whats not surprising is how much you can save on Geico~~ |
06:47:48 | FromDiscord | <Asbjørn F> In reply to @ripluke "hmm how can i": I'm pretty sure nimble task looks at your nimble file before using the built-in stuff |
06:47:55 | FromDiscord | <Asbjørn F> because you can "overwrite" build |
06:47:59 | FromDiscord | <Asbjørn F> and test |
06:48:04 | FromDiscord | <Asbjørn F> at least I always do |
06:48:21 | FromDiscord | <# Luke> In reply to @Asbjørn F "because you can "overwrite"": I tried and it didn't wor |
06:48:25 | FromDiscord | <# Luke> (edit) "wor" => "work" |
06:48:31 | FromDiscord | <Asbjørn F> whelp, I guess not all of them |
06:48:47 | FromDiscord | <Asbjørn F> prefix them with c for custom or u for user i dunno |
06:53:37 | * | rockcavera quit (Remote host closed the connection) |
06:54:23 | FromDiscord | <flywind> Is nim's mark and sweep gc conservative? |
08:11:31 | FromDiscord | <# Luke> hmm flywind does fsnotify support nested dirs? |
08:16:01 | FromDiscord | <flywind> No, I didn't consider this feature. |
08:16:55 | FromDiscord | <# Luke> oh ok ill probably create a patch for that |
08:23:24 | FromDiscord | <flywind> In reply to @flywind "Is nim's mark and": Checked, it seems to be conservative indeed. |
08:27:47 | * | clemens3 left #nim (WeeChat 2.7) |
08:34:11 | FromDiscord | <ezquerra> sent a code paste, see https://play.nim-lang.org/#ix=44TL |
08:34:33 | FromDiscord | <Elegantbeef> They're basically identical |
08:34:53 | FromDiscord | <Elegantbeef> You can benchmark them if you're concerned |
08:35:11 | FromDiscord | <ezquerra> OK, in that case, which one would _you_ write? |
08:35:55 | FromDiscord | <TryAngle> In reply to @Elegantbeef "They're basically identical": shouldn't the second one be faster as the first does a full alocation while the second only does pointer copy? |
08:35:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44TM |
08:36:02 | FromDiscord | <TryAngle> (edit) "faster" => "faster/better" |
08:36:18 | FromDiscord | <Elegantbeef> No sequences/strings are copied on assignment |
08:36:29 | FromDiscord | <TryAngle> lollll |
08:36:45 | FromDiscord | <Elegantbeef> This is slightly different with arc, but doesnt really matter to talk about |
08:36:57 | FromDiscord | <Elegantbeef> They're mostly considered value types |
08:37:09 | FromDiscord | <TryAngle> what can I use for a "smart pointer" growable array then? |
08:37:23 | FromDiscord | <TryAngle> ref seq? |
08:37:35 | FromDiscord | <Elegantbeef> `ref seq` |
08:37:44 | FromDiscord | <ezquerra> @ElegantBeef, is there a way to check that both sequences are of the same lenght at compile time rather than at runtime? Perhaps using a concept? |
08:38:09 | FromDiscord | <Elegantbeef> No sequences are runtime specialized↵(@ezquerra) |
08:38:21 | FromDiscord | <Elegantbeef> use an array if you want static typing |
08:38:51 | FromDiscord | <ezquerra> Right, that makes sense in hindsight 😅 |
08:39:02 | FromDiscord | <Rika> how would you know if something that can grow on runtime would be same length on CT |
08:39:09 | FromDiscord | <ezquerra> (edit) "makes sense" => "~makes sense~ is rather obvious" |
08:40:05 | FromDiscord | <ezquerra> Right 😅 |
08:59:41 | FromDiscord | <ezquerra> Let's say I wanted to also support both addition, subtraction, multiplication and division of sequences. I could obviously just repeat most of the code (just changing += into -=, = and /=). Is there a better, equally efficient way? |
09:00:39 | FromDiscord | <Rika> template it? |
09:23:55 | FromDiscord | <gibson> If I tag an object definition `MyType` with my own pragma macro `{.custom.}` that adds the object typename to a compile-time list, how would I later compile-time enumerate the fields and create a minimal efficient new object `MyTypeSaveData` that has the same object fields as in `MyType` if the field name starts with `out`? I can't use RTTI at compile-time, so I'm a bit stuck. I keep trying to solve this incorrectly assuming a nonexistent |
09:25:44 | FromDiscord | <Elegantbeef> "minimal efficient new object"? |
09:26:01 | FromDiscord | <Elegantbeef> Why not just serialize the data efficiently then deserialize it |
09:26:17 | FromDiscord | <gibson> Just meaning, I don't want to just runtime loop over the fields and use them. I'm wondering how efficient I can get. |
09:26:40 | FromDiscord | <Elegantbeef> Iterating fields is inlined, it's as effecient as you can get |
09:27:05 | FromDiscord | <Elegantbeef> > This really transforms the 'for' and unrolls the loop. |
09:28:08 | FromDiscord | <gibson> Okay, yes I did read that. Hmm, I guess I should just try it and see if the fields I skip over are excluded from the generated c. |
09:28:19 | FromDiscord | <Elegantbeef> If you use `when` to skip them they will be |
09:28:24 | FromDiscord | <Elegantbeef> if you use `if` of course not |
09:38:51 | FromDiscord | <gibson> Thanks - was trying way too hard. |
09:51:26 | * | pch joined #nim |
11:22:56 | FromDiscord | <Korleon> Hey, quick question - how do I run async functions inside of test suites? |
11:23:50 | FromDiscord | <Rika> With waitFor? |
11:26:06 | FromDiscord | <Korleon> Thank you |
11:26:07 | FromDiscord | <Korleon> It worked |
11:34:55 | FromDiscord | <ezquerra> sent a code paste, see https://play.nim-lang.org/#ix=44UK |
11:35:28 | FromDiscord | <Rika> That’s because of the auto I assume |
11:35:38 | FromDiscord | <Rika> Use seq[T] instead |
11:36:08 | FromDiscord | <Rika> though I’m aware that it should be okay in some sense |
11:36:23 | FromDiscord | <Rika> I’m just not aware of how to use open arrays like no-copy structures yet |
11:36:41 | FromDiscord | <Rika> (edit) "okay" => "possible to use open array here" |
11:36:47 | FromDiscord | <ezquerra> I'd like the result to be of the same type as the first input |
11:37:24 | FromDiscord | <Rika> I think you have to use something else than open array then |
11:40:17 | FromDiscord | <ezquerra> I guess I can create two versions of the function, one for seq[T] and another for array[T, N]... |
12:09:17 | * | duuude quit (Ping timeout: 244 seconds) |
12:16:32 | * | jmdaemon quit (Ping timeout: 244 seconds) |
12:48:40 | * | yann-kaelig joined #nim |
12:48:52 | * | yann-kaelig left #nim (#nim) |
13:06:24 | * | supakeen joined #nim |
13:18:49 | FromDiscord | <planetis> In reply to @ezquerra "What would be more": the second one with sink a and using high(result) instead of high(a) |
13:19:53 | FromDiscord | <planetis> if it's the last read of a in the caller scope there is no allocation involved, besides seq calling realloc |
13:20:11 | FromDiscord | <planetis> (edit) "involved, besides seq calling realloc" => "involved." |
13:21:52 | FromDiscord | <Korleon> Hey, I am trying to set up unit tests for a web server I am making and the test is hanging (I assume because the server is async) |
13:22:03 | FromDiscord | <Korleon> sent a code paste, see https://play.nim-lang.org/#ix=44Vr |
13:22:12 | FromDiscord | <Rika> In reply to @planetis "the second one with": Would the high part actually do anything? |
13:22:15 | FromDiscord | <Korleon> can I do something like threading? |
13:22:21 | FromDiscord | <Rika> I’d say it’s negligible in that part |
13:22:33 | FromDiscord | <Rika> In reply to @Korleon "can I do something": For what |
13:22:39 | FromDiscord | <Prestige> In reply to @ezquerra "I guess I can": I'm not sure but maybe you could do something like `proc lifted_function[T: auto, N: openarray[T]](x: N, y: N): N =` |
13:23:06 | FromDiscord | <Korleon> In reply to @Rika "For what": I am trying to run tests for my web server |
13:23:31 | FromDiscord | <Korleon> HTTP server is async in Nim |
13:23:37 | FromDiscord | <Korleon> And the test is hanging |
13:23:41 | FromDiscord | <Korleon> How do I solve this |
13:23:49 | FromDiscord | <planetis> In reply to @Rika "Would the high part": yep it would error because it's not the last read of a |
13:24:04 | FromDiscord | <Rika> Oh you mean in combination with the sink |
13:24:09 | FromDiscord | <planetis> yep |
13:25:28 | FromDiscord | <planetis> or not error but create a copy, that was before when sink was strict, it has changed now |
13:26:27 | FromDiscord | <Prestige> @ezquerra https://play.nim-lang.org/#ix=44Vs |
13:27:57 | FromDiscord | <Korleon> can anyone help me? |
13:30:06 | FromDiscord | <Prestige> What's `Layer7` ? |
13:30:17 | FromDiscord | <Korleon> the server I am creating |
13:31:16 | FromDiscord | <Prestige> What is it, an AsyncSocket? |
13:31:24 | FromDiscord | <Prestige> I'd need to see the code |
13:31:40 | FromDiscord | <Korleon> nah it's a framework |
13:32:06 | FromDiscord | <Korleon> an abstraction over asynchttpserver |
13:32:17 | FromDiscord | <Korleon> https://github.com/pasenidis/layer7/blob/main/main.nim |
13:32:25 | FromDiscord | <Korleon> this is not the current code |
13:32:36 | FromDiscord | <Korleon> but it's 90% identical |
13:54:40 | * | CyberTailor joined #nim |
14:22:50 | * | xigoi left #nim (#nim) |
14:22:50 | * | rockcavera joined #nim |
14:22:50 | * | rockcavera quit (Changing host) |
14:22:50 | * | rockcavera joined #nim |
14:35:09 | * | arkurious joined #nim |
15:16:56 | * | pch quit (Quit: Leaving) |
15:17:26 | NimEventer | New thread by Kaushalmodi: Help writing a macro that can accept a list of arguments of any arbitary type, see https://forum.nim-lang.org/t/9311 |
15:23:34 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44Wg |
15:23:45 | FromDiscord | <!Patitotective> even though im wating for the body to be read |
15:30:07 | FromDiscord | <dom96> sounds like an httpclient bug. Try it with `waitFor future` instead of sleeping for 0ms though |
15:39:35 | FromDiscord | <!Patitotective> In reply to @dom96 "sounds like an httpclient": body never finishes |
15:41:35 | FromDiscord | <Rika> you have to also wait for the body? |
15:43:07 | FromDiscord | <dom96> `waitFor future` followed by `waitFor future.read().body` |
15:47:26 | FromDiscord | <!Patitotective> but i dont want to freeze the main thread, thats why im using a while loop |
15:48:14 | FromDiscord | <Rika> what do you mean freeze the main thread |
15:48:19 | FromDiscord | <Rika> theres nothing else you're doing |
15:48:30 | FromDiscord | <Rika> it doesnt really matter if you do freeze it or not |
15:48:59 | FromDiscord | <!Patitotective> well this is meant to be used by my imgui apps |
15:52:39 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=44Wy |
15:52:42 | FromDiscord | <Rika> do something with body ofc |
15:53:22 | FromDiscord | <Rika> in fact its prolly better to do |
15:55:59 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=44WA |
15:57:01 | FromDiscord | <dom96> this is just to verify whether that's the cause |
15:57:04 | FromDiscord | <Rika> (edit) "https://play.nim-lang.org/#ix=44WA" => "https://play.nim-lang.org/#ix=44WB" |
15:57:05 | FromDiscord | <dom96> or whether it's just a httpclient bug |
15:57:14 | FromDiscord | <Rika> oh did i misinterpret smth |
15:58:41 | FromDiscord | <!Patitotective> but rika i want to work similar how downit already works↵https://github.com/Patitotective/downit/blob/devel |
16:00:49 | FromDiscord | <dom96> can you give it a try without the sleepAsync? |
16:00:53 | FromDiscord | <dom96> I'm curious if it works then |
16:01:05 | FromDiscord | <dom96> if it doesn't then httpclient has a bug |
16:01:17 | FromDiscord | <!Patitotective> In reply to @dom96 "can you give it": which code |
16:01:40 | FromDiscord | <!Patitotective> ? |
16:01:43 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44WE |
16:01:57 | FromDiscord | <dom96> yeah, just change the while loop into two waitFors |
16:02:07 | FromDiscord | <dom96> I would do it myself but I can't test code right now |
16:04:14 | FromDiscord | <!Patitotective> In reply to @dom96 "yeah, just change the": i dont think you remember but we talked before about this same problem and that worked↵let me find the msg |
16:04:51 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44WF |
16:06:48 | FromDiscord | <dom96> In reply to @dom96 "Don't be afraid to": so my advice is the same lol |
16:07:13 | FromDiscord | <!Patitotective> :/ |
16:07:22 | FromDiscord | <!Patitotective> shouldnt i report the bug as well |
16:07:41 | FromDiscord | <dom96> sure |
16:14:22 | FromDiscord | <!Patitotective> for the bug report can i crop the output putting ellipsis so it doesnt fill the whole page? |
16:29:02 | FromDiscord | <!Patitotective> https://github.com/nim-lang/Nim/issues/20066 🧐 |
17:15:21 | * | tafa quit (Quit: ZNC - https://znc.in) |
17:16:35 | * | tafa joined #nim |
17:42:16 | * | pch joined #nim |
17:59:21 | * | krux02 joined #nim |
18:43:00 | * | kenran joined #nim |
18:43:04 | * | kenran quit (Client Quit) |
19:20:14 | FromDiscord | <lantos> In reply to @Patitotective "body never finishes": oh I think I ran into this yesterday, if you await resp.body but the endpoint your are querying replies with just a status code and no body it will hang |
19:32:56 | FromDiscord | <!Patitotective> In reply to @lantos "oh I think I": i didnt understand 🤨↵do you have an example? |
19:33:31 | FromDiscord | <jan0809> like there are endpoints out there, which wont send a body |
19:34:29 | FromDiscord | <Rika> So if you send a head request I assume |
19:34:35 | FromDiscord | <jan0809> like alot of post endpoints which just reply with a status code |
19:38:06 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=44XK |
19:38:08 | FromDiscord | <lantos> (edit) "https://play.nim-lang.org/#ix=44XK" => "https://paste.rs/agR" |
19:42:07 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=44XM |
19:42:58 | FromDiscord | <lantos> (edit) "https://play.nim-lang.org/#ix=44XM" => "https://play.nim-lang.org/#ix=44XN" |
19:44:19 | FromDiscord | <jan0809> sent a code paste, see https://play.nim-lang.org/#ix=44XO |
19:44:22 | FromDiscord | <jan0809> no body at all |
19:44:23 | FromDiscord | <sharpcdf> how can i extract a `.tar.xz` with zippy? im trying but its just erroring |
19:44:55 | FromDiscord | <jan0809> oh wait |
19:45:13 | FromDiscord | <jan0809> its the wrong code tho |
19:47:05 | FromDiscord | <jan0809> however, i even saw endpoints, which used status codes instead of returning a single bool |
19:48:12 | * | CyberTailor quit (Remote host closed the connection) |
19:49:16 | * | CyberTailor joined #nim |
19:50:30 | FromDiscord | <jan0809> In reply to @jan0809 "however, i even saw": https://media.discordapp.net/attachments/371759389889003532/999402941561704548/IMG_20220720_215010.jpg |
19:50:38 | FromDiscord | <sOkam!> Is there a way to access the name of the function currently running, similar to `func` in C? |
19:51:09 | FromDiscord | <!Patitotective> In reply to @sharpcdf "how can i extract": error? |
19:52:05 | FromDiscord | <sharpcdf> In reply to @Patitotective "error?": its a `ZippyError`, nothing gets printed though |
19:52:12 | NimEventer | New thread by Niminem: OverflowDefect when executing fibonacci sequence with 'memoization', see https://forum.nim-lang.org/t/9312 |
19:52:37 | FromDiscord | <!Patitotective> In reply to @sharpcdf "its a `ZippyError`, nothing": anyways send the stack trace |
19:52:44 | FromDiscord | <sharpcdf> how do i do that again |
19:53:02 | FromDiscord | <sharpcdf> `--verbose`? |
19:53:04 | FromDiscord | <!Patitotective> well it should get printed automatically |
19:53:08 | FromDiscord | <sharpcdf> yea no |
19:53:10 | FromDiscord | <sharpcdf> nothing gets printed |
19:53:12 | FromDiscord | <!Patitotective> should the full code & output |
19:53:12 | FromDiscord | <sharpcdf> no stack trace |
19:54:08 | FromDiscord | <sharpcdf> In reply to @Patitotective "should the full code": ? |
19:54:49 | FromDiscord | <!Patitotective> just send the code, the command you used to compile/run the code and the output... |
19:55:13 | FromDiscord | <!Patitotective> In reply to @Patitotective "should the full code": oh lol it was show to should lol |
19:55:13 | FromDiscord | <Dale> Anyone know of a really good sparse array/set lib for nim? |
19:55:18 | FromDiscord | <sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44XR |
19:55:29 | FromDiscord | <!Patitotective> (edit) "to" => "niot" |
19:55:32 | FromDiscord | <Dale> The stdlib only has sparse stuff for primitive types |
19:55:50 | FromDiscord | <sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44XS |
19:56:05 | FromDiscord | <sharpcdf> `tb` is zippy/tarballs and `za` is zippy/ziparchives |
19:56:34 | FromDiscord | <!Patitotective> and the command and output? |
19:56:45 | FromDiscord | <Rika> I don’t recall zippy being able to do xz |
19:57:05 | FromDiscord | <sharpcdf> In reply to @Patitotective "and the command and": wdym command and output |
19:57:17 | FromDiscord | <sharpcdf> theres no output other than my explicit prints and wdym by command |
19:57:30 | FromDiscord | <sharpcdf> it says `Failed to extract archive` |
19:57:35 | FromDiscord | <sharpcdf> because of the zippy error |
19:57:37 | FromDiscord | <!Patitotective> In reply to @Rika "I don’t recall zippy": yea, they dont list it in the readme↵so.... |
19:57:44 | FromDiscord | <sharpcdf> oh rip |
19:57:52 | FromDiscord | <sharpcdf> what lib can do .xz? |
19:58:00 | FromDiscord | <Rika> Something that can do LZMA |
19:58:04 | FromDiscord | <!Patitotective> anyway @sharpcdf reraise the error you catch |
19:59:55 | FromDiscord | <sharpcdf> In reply to @Patitotective "anyway <@459463405636419594> reraise the": is that `raise newException(ZippyError, ..)` |
20:00:10 | FromDiscord | <!Patitotective> you can just do `raise` |
20:00:16 | FromDiscord | <sharpcdf> oh ok |
20:00:19 | FromDiscord | <!Patitotective> (edit) "you can just do `raise` ... " added "and it will reraise the last exception" |
20:00:54 | FromDiscord | <amadan> In reply to @sOkam! "Is there a way": You can do `procName` https://nim-lang.org/docs/stackframes.html#procName.t though I think it only works for C/C++ backends |
20:01:09 | FromDiscord | <sharpcdf> nothing printed still @!Patitotective |
20:01:21 | FromDiscord | <sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44XV |
20:01:30 | FromDiscord | <sOkam!> In reply to @amadan "You can do `procName`": dope ty |
20:01:50 | FromDiscord | <!Patitotective> 🤨 ↵how are you compiling it? |
20:02:14 | FromDiscord | <sharpcdf> In reply to @Patitotective "🤨 how are": through nimscript, i just do `nim c` with `--NimblePath` |
20:03:13 | FromDiscord | <!Patitotective> i dont think thats nimscript (?)↵but anyway, by "nothing printed" you mean not even an exception or?? |
20:03:28 | FromDiscord | <sharpcdf> In reply to @Patitotective "i dont think thats": no, nothing |
20:03:57 | FromDiscord | <sharpcdf> and it is, im doing `switch("NimblePath", "...") \n setCommand("c")` |
20:04:05 | FromDiscord | <sharpcdf> in `config.nims` |
20:04:25 | FromDiscord | <!Patitotective> but is it reaching the `raise` part? can you echo there? |
20:04:26 | FromDiscord | <!Patitotective> (edit) "there?" => "there" |
20:04:31 | FromDiscord | <sharpcdf> sure |
20:05:03 | FromDiscord | <sharpcdf> yea it still prints |
20:05:11 | FromDiscord | <sharpcdf> just doesnt raise |
20:05:25 | FromDiscord | <!Patitotective> is the code public? |
20:06:03 | FromDiscord | <!Patitotective> (btw this library seems to support tar.xz https://github.com/genotrance/nimarchive) |
20:06:12 | FromDiscord | <sharpcdf> that doesnt really matter though right? if it doesnt support .tar.xz in the first place |
20:06:21 | FromDiscord | <sharpcdf> In reply to @Patitotective "is the code public?": https://github.com/sharpcdf/jitter |
20:06:35 | FromDiscord | <sharpcdf> src/extract.nim |
20:06:42 | FromDiscord | <sharpcdf> havent updated it yet though |
20:06:49 | FromDiscord | <!Patitotective> In reply to @sharpcdf "that doesnt really matter": what? |
20:08:06 | FromDiscord | <sharpcdf> In reply to @Patitotective "what?": zippy doesnt support .tar.xz in the first place so why do the errors matter |
20:08:12 | FromDiscord | <!Patitotective> In reply to @sharpcdf "src/extract.nim": not a singe empty line lol |
20:08:30 | FromDiscord | <!Patitotective> In reply to @sharpcdf "zippy doesnt support .tar.xz": youve reason but i wanted to see what is happening hehe |
20:08:35 | FromDiscord | <!Patitotective> (edit) "In reply to @sharpcdf "zippy doesnt support .tar.xz": youve ... reason" added "got" |
20:08:56 | FromDiscord | <!Patitotective> (edit) "hehe" => ":p" |
20:09:15 | FromDiscord | <sharpcdf> ah ok |
20:09:20 | FromDiscord | <sharpcdf> here let me push the latest code |
20:10:20 | FromDiscord | <sharpcdf> done @!Patitotective |
20:10:25 | FromDiscord | <sharpcdf> look now |
20:10:56 | FromDiscord | <!Patitotective> also, in jitter how do you plan to deal with github rest api limit? would the user need to put his token? |
20:11:23 | * | jmdaemon joined #nim |
20:12:05 | FromDiscord | <sharpcdf> In reply to @Patitotective "also, in jitter how": i havent really looks at the limit but i dont think it would be a problem but yea im adding a json config file soon with custom bin and token and etc. |
20:12:39 | FromDiscord | <!Patitotective> In reply to @sharpcdf "i havent really looks": its 60 requests per hour |
20:12:52 | FromDiscord | <sharpcdf> oh ok |
20:12:58 | FromDiscord | <!Patitotective> also how do i test `extract.nim`? do i need to download some packages |
20:12:59 | FromDiscord | <sharpcdf> yea then im gonna need to use tokens lol |
20:13:15 | FromDiscord | <sharpcdf> In reply to @Patitotective "also how do i": just install anything and itll use it |
20:13:22 | FromDiscord | <sharpcdf> ive been using vscodium and hastyscribe |
20:13:44 | FromDiscord | <sharpcdf> but to test the .tar.xz files then you need a repo with .tar.xz release assets |
20:13:59 | FromDiscord | <sharpcdf> to do that you can just do `jtr update this` |
20:14:10 | FromDiscord | <sharpcdf> itll download the jitter release which is .tar.xz |
20:15:24 | FromDiscord | <!Patitotective> have you thought about making the cli `jitter` instead of `jtr`↵imo its nicer |
20:16:04 | FromDiscord | <sharpcdf> nah because for some commands you need to type the owner name of the repo so you would need to type a lot |
20:16:14 | FromDiscord | <sharpcdf> like remove or update |
20:16:43 | FromDiscord | <sharpcdf> i want it to be pretty easy to type |
20:17:09 | FromDiscord | <# Luke> How can I recursively loop over a directory |
20:17:40 | FromDiscord | <sharpcdf> `jitter remove h3rald/hastyscribe` vs `jtr remove h3rald/hastyscribe` |
20:17:51 | FromDiscord | <!Patitotective> In reply to @ripluke "How can I recursively": https://nim-lang.org/docs/os.html#walkDirRec.i%2Cstring ? |
20:17:56 | FromDiscord | <sharpcdf> In reply to @ripluke "How can I recursively": `for f in walkDirRec` |
20:17:57 | FromDiscord | <# Luke> In reply to @ripluke "How can I recursively": Like so I can loop over subdirectories to that directory and subdirectories to the subdirectory |
20:18:03 | FromDiscord | <# Luke> In reply to @sharpcdf "`for f in walkDirRec`": Oh |
20:18:19 | FromDiscord | <sharpcdf> and you can check if `f` is a file or a folder |
20:19:47 | FromDiscord | <!Patitotective> In reply to @sharpcdf "`jitter remove h3rald/hastyscribe` vs": i dont really care to have to type 3 letters more↵its just that it looks prettier |
20:20:18 | FromDiscord | <sharpcdf> lmao |
20:20:19 | FromDiscord | <sharpcdf> ig |
20:21:22 | FromDiscord | <!Patitotective> also in the description you say it searches for github executables↵what are github executables, releases? |
20:21:25 | FromDiscord | <!Patitotective> (edit) "releases?" => "releases assets?" |
20:22:42 | FromDiscord | <sharpcdf> In reply to @Patitotective "also in the description": executables in the github release assets |
20:22:56 | FromDiscord | <sharpcdf> so like `codium` in `vscodium.tar.gz` or whatever |
20:23:53 | FromDiscord | <Korleon> anyone who can help me with unit testing on async code? |
20:24:18 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44Y0 |
20:24:29 | FromDiscord | <!Patitotective> for now jitter looks really cool :] |
20:24:58 | FromDiscord | <sharpcdf> In reply to @Patitotective "for now jitter looks": thanks lol |
20:25:06 | FromDiscord | <sharpcdf> ill make the error message better |
20:25:26 | FromDiscord | <sharpcdf> its mainly for personal use to manage compilers but could be used for other stuff too |
20:25:48 | FromDiscord | <ezquerra> In reply to @Avahe "<@974046326088163438> https://play.nim-lang.org/#ix": Thanks, I’ll have a look! |
20:26:09 | FromDiscord | <!Patitotective> In reply to @sharpcdf "its mainly for personal": manage compilers? :facr |
20:26:12 | FromDiscord | <!Patitotective> (edit) ":facr" => "🤨" |
20:28:28 | FromDiscord | <sharpcdf> In reply to @Patitotective "manage compilers? 🤨": basically i typically use compilers through manually downloading them off of github, which is annoying because to update a compiler i need to set everything up again while with jitter i can just do `jtr install nim` and `jtr update nim-lang/nim` |
20:29:46 | FromDiscord | <!Patitotective> and how does jitter find the executable inside the zip? |
20:30:34 | FromDiscord | <sharpcdf> In reply to @Patitotective "and how does jitter": it just looks for files that have executable perms and no file extensions |
20:30:40 | FromDiscord | <sharpcdf> kind of primitive but it works |
20:30:41 | FromDiscord | <Korleon> has anyone here tried unit testing asynchttp? |
20:31:23 | FromDiscord | <!Patitotective> could you perhaps show some code (?) @Korleon |
20:31:59 | FromDiscord | <Korleon> sent a code paste, see https://play.nim-lang.org/#ix=44Y3 |
20:32:05 | FromDiscord | <Korleon> this is testing the framework I am developing rn |
20:32:16 | FromDiscord | <sharpcdf> In reply to @Patitotective "btw if run this": can you make an issue for this so i dont forget lol |
20:32:23 | FromDiscord | <sharpcdf> theres some other things im making rn |
20:32:36 | FromDiscord | <!Patitotective> you can try github projects ;] |
20:32:40 | FromDiscord | <Korleon> I think the problem is that it hangs when I call app.start() since it runs a while true |
20:32:47 | FromDiscord | <sharpcdf> ohhh yea right |
20:33:55 | FromDiscord | <Korleon> @!Patitotective any ideas on how to solve that? |
20:35:30 | FromDiscord | <jan0809> In reply to @Patitotective "btw if run this": whats jtr? |
20:36:07 | FromDiscord | <!Patitotective> In reply to @jan0809 "whats jtr?": @Shiba 's jitter https://github.com/sharpcdf/jitter |
20:36:16 | FromDiscord | <!Patitotective> (edit) "@Shiba" => "@sharpcdf " |
20:36:27 | FromDiscord | <sharpcdf> In reply to @jan0809 "whats jtr?": a binary manager im working on |
20:36:58 | FromDiscord | <jan0809> looks cool, does it properly add to path? |
20:37:15 | FromDiscord | <sharpcdf> In reply to @jan0809 "looks cool, does it": you add it to the path yourself |
20:37:26 | FromDiscord | <sharpcdf> although the debug build of the installer does it automatically |
20:37:29 | FromDiscord | <sharpcdf> which is risky |
20:37:37 | FromDiscord | <jan0809> why is that |
20:37:48 | FromDiscord | <sharpcdf> if soemthing goes wrong |
20:37:51 | FromDiscord | <sharpcdf> like for instance |
20:37:57 | FromDiscord | <sharpcdf> deleting the .bashrc file |
20:38:03 | FromDiscord | <sharpcdf> which is unlikely but still not worth it |
20:38:31 | FromDiscord | <!Patitotective> why would that occur, you just need to append some text (?) |
20:38:49 | FromDiscord | <sharpcdf> i jsut dont want to risk anything ¯\_(ツ)_/¯ |
20:38:59 | FromDiscord | <sharpcdf> beef recommended not auto adding it |
20:39:11 | FromDiscord | <jan0809> isnt there a more shell unrelated place to add those btw? i use quite some diff shells |
20:39:14 | FromDiscord | <!Patitotective> if not it would be cool if you could provide a os-specific single line command to add it at your own risk |
20:39:30 | FromDiscord | <sharpcdf> oh true |
20:39:35 | FromDiscord | <sharpcdf> well its just for linux anyways |
20:39:37 | FromDiscord | <sharpcdf> i could do that |
20:39:43 | FromDiscord | <!Patitotective> oh |
20:39:45 | FromDiscord | <sharpcdf> like `jtr path` |
20:39:56 | FromDiscord | <sharpcdf> In reply to @Patitotective "oh": yea i dont plan to have support for linux or windows |
20:40:03 | FromDiscord | <sharpcdf> (edit) "linux" => "macos" |
20:40:07 | FromDiscord | <jan0809> is there jtr which or something? |
20:40:13 | FromDiscord | <!Patitotective> In reply to @sharpcdf "like `jtr path`": you can't run that if you dont install it first... |
20:40:23 | FromDiscord | <sharpcdf> In reply to @Patitotective "you can't run that": i know |
20:40:30 | FromDiscord | <!Patitotective> i think a shell script to install it would be the best, like choosenim |
20:40:35 | FromDiscord | <sharpcdf> oh wait |
20:40:36 | FromDiscord | <sharpcdf> yea lol |
20:40:38 | FromDiscord | <sharpcdf> true |
20:40:50 | FromDiscord | <jan0809> but why not just add one jtr binary dir to .rc? |
20:40:54 | FromDiscord | <!Patitotective> or even better as a nimble pkg :] |
20:41:17 | FromDiscord | <sharpcdf> i could just include a shell script with the installer maybe |
20:41:22 | FromDiscord | <jan0809> nimble does that wuite well |
20:41:25 | FromDiscord | <sharpcdf> although i barely know bash |
20:41:55 | FromDiscord | <jan0809> nimble just uses 1 central bin dir right? |
20:42:19 | FromDiscord | <!Patitotective> yea |
20:42:40 | FromDiscord | <jan0809> thats totally fine for me, and i dint think its any risk, |
20:42:55 | FromDiscord | <jan0809> (edit) "dint" => "dont" |
20:44:32 | FromDiscord | <sharpcdf> In reply to @jan0809 "but why not just": it is one bin dir, i just dont really want to risk anything, its `~/.jitter/bin` |
20:44:33 | FromDiscord | <jan0809> what kind of software is supported by jtr? |
20:45:00 | FromDiscord | <sharpcdf> anything on github that has a linux release |
20:45:57 | FromDiscord | <jan0809> hmm that could be quite alot, still in alot of cases there might be deps missing |
20:46:18 | FromDiscord | <sharpcdf> yea but thats why its meant for prebuilt binaries |
20:46:23 | FromDiscord | <!Patitotective> appimages? |
20:46:33 | FromDiscord | <sharpcdf> no just executables |
20:46:38 | FromDiscord | <sharpcdf> althogh i should do that |
20:46:51 | FromDiscord | <sharpcdf> it creates symlinks for every executable and adds it to the bin |
20:47:51 | FromDiscord | <jan0809> still need something like the aur but cross distro |
20:48:06 | FromDiscord | <sharpcdf> thats what @.luke was talking about |
20:48:13 | FromDiscord | <sharpcdf> he was looking into making something like that |
20:48:20 | FromDiscord | <jan0809> https://pacstall.dev/ |
20:48:35 | FromDiscord | <sharpcdf> neat |
20:48:45 | FromDiscord | <sharpcdf> only for ubuntu though :/ |
20:48:48 | FromDiscord | <jan0809> https://github.com/pacstall/pacstall |
20:48:50 | FromDiscord | <jan0809> yes |
20:48:50 | FromDiscord | <!Patitotective> In reply to @sharpcdf "no just executables": appimages are executables lol ¯\_(ツ)_/¯ |
20:49:06 | FromDiscord | <jan0809> In reply to @Patitotective "appimages are executables lol": true that |
20:49:10 | FromDiscord | <sharpcdf> yea ik lol |
20:49:39 | FromDiscord | <sharpcdf> ill add it by 1.0 which shouldnt be that far away as ive gone from v0.0.3 to v0.1.0 in less than 24 hours XD |
20:49:59 | FromDiscord | <jan0809> sad desription https://media.discordapp.net/attachments/371759389889003532/999417905634623628/IMG_20220720_224940.jpg |
20:50:15 | FromDiscord | <jan0809> but true |
20:51:45 | FromDiscord | <jan0809> i love arch for having the aur, but thers so much i dont have time for in arch, and sadly none of the ready to use arch based distros even come close to ubuntu in terms of out of the box expereinece |
20:57:39 | FromDiscord | <huantian> In reply to @sharpcdf "it is one bin": Why not .local/share/bin? |
20:58:03 | FromDiscord | <huantian> (edit) ".local/share/bin?" => ".local/bin?" |
21:01:08 | FromDiscord | <sharpcdf> In reply to @huantian "Why not .local/bin?": so that everything it needs will be in one place |
21:01:36 | FromDiscord | <sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44Ya |
21:05:02 | FromDiscord | <huantian> ok but now you're not following the freedesktop specifications |
21:05:48 | FromDiscord | <huantian> that cannot be tolerated |
21:09:11 | FromDiscord | <sharpcdf> you have insulted the empire, you must pay for your crimes |
21:31:41 | FromDiscord | <sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44Yj |
21:33:52 | FromDiscord | <Elegantbeef> You can make your own iterator if you want to have a growable seq while iterating |
21:34:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44Yk |
21:46:48 | FromDiscord | <ghoom> yo nimmers i've joined nim gang |
21:48:13 | FromDiscord | <huantian> hello |
21:48:13 | FromDiscord | <jan0809> nice |
21:48:21 | FromDiscord | <ghoom> 🐸👑 |
21:48:30 | FromDiscord | <jan0809> welcome |
21:48:38 | FromDiscord | <ghoom> tamks |
21:49:34 | FromDiscord | <ghoom> is there a stdlib type that allows storing something that can be of many types? |
21:50:02 | FromDiscord | <ghoom> (edit) "can" => "could" |
21:50:25 | FromDiscord | <ghoom> (edit) "that could be of" => "whose type can vary between" |
21:51:03 | FromDiscord | <Elegantbeef> `import std/json` 😄 |
21:51:14 | FromDiscord | <ghoom> https://tenor.com/view/kermit-suicide-flip-jump-crash-gif-5140737 |
21:51:43 | FromDiscord | <Elegantbeef> You can make your own object variants or use https://github.com/alaviss/union |
21:52:01 | FromDiscord | <ghoom> aight thanks |
21:52:47 | FromDiscord | <Elegantbeef> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-how-to-store-different-types-in-seqqmark |
21:54:09 | FromDiscord | <theangryepicbanana> is there a way to make nim infer integers like this? `const Foo: array[2, (uint8, uint8)] = [(1, 0), (5, 1)]` |
21:54:21 | FromDiscord | <Elegantbeef> Nope |
21:54:30 | FromDiscord | <theangryepicbanana> dang |
21:54:44 | FromDiscord | <Elegantbeef> You need to do `[(1u8, 0u8), (5u8, 1u8)]` |
21:54:58 | FromDiscord | <theangryepicbanana> yeah that kinda sucks because I actually have like 50 of these |
21:55:05 | FromDiscord | <ghoom> XD |
21:55:11 | FromDiscord | <Elegantbeef> Annoyingly array analysis doesnt work with tuples |
21:55:21 | FromDiscord | <theangryepicbanana> it didn't work with nested arrays either |
21:55:24 | FromDiscord | <Elegantbeef> in an ideal world you just do `(1u8, 0u8)` and the rest of the literals are inverred |
21:55:42 | FromDiscord | <theangryepicbanana> `const Foo: array[2, array[2, uint8]] = [[1, 0], [5, 1]]` doesn't work either |
21:55:52 | FromDiscord | <Elegantbeef> Yes i know |
21:56:03 | FromDiscord | <theangryepicbanana> In reply to @Elegantbeef "in an ideal world": yeah this would also be nice |
22:00:09 | * | CyberTailor quit (Remote host closed the connection) |
22:01:11 | * | duuude joined #nim |
22:01:11 | * | CyberTailor joined #nim |
22:08:07 | FromDiscord | <# Luke> In reply to @jan0809 "https://pacstall.dev/": It sucks |
22:08:16 | FromDiscord | <# Luke> Literally nothing is packaged for it |
22:09:07 | FromDiscord | <jan0809> sad but thats what i expexted |
22:10:11 | FromDiscord | <# Luke> How can I check if someone is a release build or a debug build |
22:10:39 | FromDiscord | <jan0809> someone? |
22:10:51 | FromDiscord | <# Luke> (edit) "someone" => "something" |
22:10:57 | FromDiscord | <# Luke> In reply to @jan0809 "someone?": Typo |
22:13:21 | CyberTailor | Luke: `when defined(debug):` |
22:17:16 | * | LuxuryMode joined #nim |
22:17:26 | FromDiscord | <# Luke> In reply to @CyberTailor "Luke: `when defined(debug):`": Ok |
22:46:03 | FromDiscord | <# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44YN |
22:48:37 | FromDiscord | <Elegantbeef> Well what's teh type of EventCallback? |
22:50:01 | FromDiscord | <# Luke> Idk? |
22:50:07 | FromDiscord | <# Luke> That's the name of the type |
22:51:02 | FromDiscord | <# Luke> proc register(watcher: var Watcher; path: string; cb: EventCallback;↵ treatAsFile = false) |
22:51:25 | FromDiscord | <# Luke> (edit) "proc register(watcher: var Watcher; path: string; cb: EventCallback;↵ treatAsFile = false)" => "sent a code paste, see https://play.nim-lang.org/#ix=44YP" |
22:51:31 | FromDiscord | <# Luke> this is the proc in the error |
22:57:46 | FromDiscord | <ghoom> yo how do i compile to chromeos binaries? |
23:01:22 | * | CyberTailor quit (Remote host closed the connection) |
23:03:30 | * | duuude quit (Ping timeout: 240 seconds) |
23:03:43 | * | CyberTailor joined #nim |
23:49:14 | FromDiscord | <Elegantbeef> I'm very ignorant here but isnt it just a linux binary? |
23:50:34 | FromDiscord | <jan0809> exactly what i thought,↵ ↵like here i remeber flutter had chromeos instructions, and like the first step is to enable linux |
23:51:31 | FromDiscord | <jan0809> which links here https://support.google.com/chromebook/answer/9145439 |
23:52:12 | FromDiscord | <jan0809> `linux` seem to have an on/off toggle in chromeos |
23:52:34 | FromDiscord | <Prestige> what sort of abomination is chrome os lol |
23:52:50 | FromDiscord | <Elegantbeef> It's linux without the lin and added s |
23:52:51 | FromDiscord | <Elegantbeef> so it's sux |
23:52:57 | FromDiscord | <Prestige> lol |
23:54:08 | FromDiscord | <jan0809> chrome os - is alive, unlike firefoxos aka boot2gecko |
23:54:35 | FromDiscord | <Elegantbeef> I mean that's hardly a feature more a bug |
23:54:41 | FromDiscord | <Elegantbeef> Google just hasnt rolled over on it yet |
23:55:10 | FromDiscord | <Elegantbeef> I'm kidding fushia is the OS they're killiiing off |
23:55:16 | FromDiscord | <Elegantbeef> jeez my keyboard skills |
23:55:29 | FromDiscord | <Elegantbeef> killing doesnt have that many ls or is |
23:55:45 | FromDiscord | <jan0809> https://media.discordapp.net/attachments/371759389889003532/999464665266520155/IMG_20220721_015520.jpg |
23:56:02 | FromDiscord | <jan0809> 2y |
23:56:27 | FromDiscord | <ghoom> doesn' chrome os require installing a linux vm first? |
23:56:30 | FromDiscord | <ghoom> (edit) "doesn'" => "doesn't" |
23:56:39 | FromDiscord | <Yardanico> for usage? of course no |
23:56:49 | FromDiscord | <ghoom> i mean for running linux bins |
23:56:56 | FromDiscord | <ghoom> (edit) "i mean for running ... linux" added "external" |
23:57:01 | FromDiscord | <Elegantbeef> Chromeos is a linux fork that's locked down, it requires a toggle to run linux native binaries |
23:57:12 | FromDiscord | <Elegantbeef> The entire point of chromeos is there is no native binaries |
23:57:13 | FromDiscord | <Elegantbeef> Everything is a webapp |
23:57:16 | FromDiscord | <jan0809> i bet the linux toggle straps a chroot |
23:57:18 | FromDiscord | <Yardanico> if you want "native" ChromeOS "applications", then you either make a Chrome PWA or an Android app |
23:57:23 | FromDiscord | <Yardanico> there's no other way |
23:57:26 | FromDiscord | <ghoom> In reply to @Elegantbeef "Everything is a webapp": i literally forgot about that |
23:57:34 | FromDiscord | <ghoom> rip XD |
23:57:37 | FromDiscord | <Elegantbeef> How do you forget that it's in the name |
23:57:50 | FromDiscord | <ghoom> ¯\_(ツ)_/¯ |
23:58:01 | FromDiscord | <Elegantbeef> "ChromeOs" "WebBrowserOS" 😄 |
23:58:05 | FromDiscord | <ghoom> In reply to @Yardanico "if you want "native"": 👌🐸 |
23:58:26 | FromDiscord | <Yardanico> or just a website |
23:58:33 | FromDiscord | <ghoom> In reply to @Elegantbeef ""ChromeOs" "WebBrowserOS" 😄": kiosk os |
23:58:52 | FromDiscord | <Prestige> I'm just going to say it, websites were a mistake |
23:58:58 | FromDiscord | <Elegantbeef> Agreed |
23:59:22 | FromDiscord | <Elegantbeef> We should just have a protocol to return data and let the user program parse that data |