<< 31-07-2022 >>

00:01:36FromDiscord<checkersai> Are concepts still an experimental feature?
00:02:01FromDiscord<Elegantbeef> Yes but they're usable
00:02:48FromDiscord<checkersai> What needs to be done to get them out of the experimental stage?
00:03:15FromDiscord<Elegantbeef> No clue, i know there is a new variant that is to replace them
00:03:49FromDiscord<checkersai> Huh, what's the new variant?
00:04:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46af
00:06:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46ag
00:08:04FromDiscord<Elegantbeef> `otherThing(m, int(10)) is bool` rather
00:16:46FromDiscord<checkersai> Sounds good
00:22:18FromDiscord<checkersai> Is there any progress on this yet?
00:25:50FromDiscord<gibson> sent a code paste, see https://play.nim-lang.org/#ix=46ak
00:27:17FromDiscord<gibson> (edit) "https://play.nim-lang.org/#ix=46ak" => "https://play.nim-lang.org/#ix=46al"
01:04:10FromDiscord<that_dude> In reply to @gibson "Why is it this": just a random guess, but couldn't this output something like `type type AType`?
01:04:40FromDiscord<that_dude> There should be ways you can print out the result variable to see what it generates
01:06:26FromDiscord<Prestige> sent a code paste, see https://play.nim-lang.org/#ix=46az
01:07:05FromDiscord<Elegantbeef> Oh god not dumpastgen
01:07:23FromDiscord<Prestige> What do you prefer?
01:07:36FromDiscord<that_dude> I know there is a repr option
01:07:45FromDiscord<checkersai> In reply to @Elegantbeef "Oh god not dumpastgen": What's wrong with dumpastgen?
01:07:46FromDiscord<that_dude> but I think that's only in the macro
01:07:54FromDiscord<Elegantbeef> `treeRepr`/`repr` are better
01:08:39FromDiscord<Prestige> I'm not sure how you use those with a malformed ast
01:09:00FromDiscord<Elegantbeef> How do you use dumpAstGen with malformed AST?
01:09:15FromDiscord<Prestige> It doesn't seem to care
01:09:25FromDiscord<Elegantbeef> Oh you're just trying to dump the ast
01:09:37FromDiscord<Elegantbeef> Then use `dumpTree` like a normal person so you can see the `treeRepr`
01:10:55FromDiscord<Prestige> I'm not sure what would be wrong with it either, if you removed the first `type`
01:11:13FromDiscord<Elegantbeef> Nim type section macros are finicy
01:11:53FromDiscord<Elegantbeef> You actually want to return `nnkTypeDef`
01:12:09FromDiscord<Elegantbeef> It's odd but it makes sense given they evaluate inside a `nnkTypeSection`
01:13:05FromDiscord<Elegantbeef> So in this case it's just `result = definition`
01:44:26FromDiscord<j-james> i think c2nim choked and spit out garbage and i accidentally removed it
01:44:33FromDiscord<Elegantbeef> Yea i know i reimplemented it but forgot to do anything about it
01:45:49FromDiscord<j-james> that `(typedesc)(int)` syntax doesn't make any sense, nor does casting to a cstring there
01:45:51FromDiscord<Elegantbeef> I mean `(sample)(x)` does make sense but only in like a single case 😄
01:45:52FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=46aC
01:45:56FromDiscord<j-james> does it? when does nim use that syntax?
01:45:57FromDiscord<Elegantbeef> type conversions
01:45:58FromDiscord<Elegantbeef> `(type)(someStmt)` is a type conversion
01:46:03FromDiscord<j-james> oh, hmm
01:46:06FromDiscord<j-james> well your cast should accomplish the same thing right
01:46:07FromDiscord<Elegantbeef> My version is the correct one anyway
01:46:08FromDiscord<j-james> okay phew
01:47:57FromDiscord<DaiChimpo> Does nim have a library for fetching the html file of a site?
01:49:08FromDiscord<Elegantbeef> httpclient
01:49:27FromDiscord<DaiChimpo> ty
01:55:59FromDiscord<Elegantbeef> [j-james](https://matrix.to/#/@j-james:matrix.org)\: also the xkb stuff is needed for inputs and the wlr keyboard iirc
01:56:15FromDiscord<Elegantbeef> Wlroots/xkb/wayland are all oddly coupled
02:00:29FromDiscord<Prestige> I'm somewhat patiently awaiting the wayland bindings
02:00:44FromDiscord<Prestige> Keeping myself occupied with game development for my pinephone
02:01:21FromDiscord<Elegantbeef> Crack the whip 😛
02:02:04FromDiscord<Elegantbeef> Using your own engine i take it?
02:02:21FromDiscord<Prestige> Yep, it's been pretty fun
02:02:35FromDiscord<Prestige> Going to port over an android game I made to my engine, and run it on the phone
02:02:48FromDiscord<Elegantbeef> Do you have the phone sensors hooked up with sdl2?
02:03:11FromDiscord<Prestige> Haven't cared to, except for touch support. Have that working
02:03:23FromDiscord<Prestige> Ran some benchmarks on the phone, shaders working, etc
02:03:58FromDiscord<Elegantbeef> Do you know what version of opengl it supports?
02:04:12FromDiscord<Prestige> It was running OpenGL 3
02:04:18FromDiscord<Prestige> but sdl says it supports up to 4
02:04:33FromDiscord<Elegantbeef> I dont mean your engine, i mean the phone 😄
02:04:40FromDiscord<Prestige> Yeah
02:05:03FromDiscord<Elegantbeef> Shame 4.5+ is best opengl
02:05:56FromDiscord<Prestige> I'm not sure which minor version it was, just printed the major versions
02:06:04FromDiscord<Prestige> It might support over 4.0
02:06:04*arkurious quit (Quit: Leaving)
02:06:20FromDiscord<Elegantbeef> Yea i target 4.5 with my framework cause it's the best opengl
02:06:32FromDiscord<Prestige> Why is that? I'm not familiar
02:06:33FromDiscord<Elegantbeef> Much easier and saner to do many thiings
02:06:38FromDiscord<Prestige> ah, cool
02:06:51FromDiscord<Elegantbeef> It has features like compute shaders and easily allocated buffers instead of making textures
02:07:02FromDiscord<Elegantbeef> So you can upload data from the CPU directly and not have to make a texture to sample
02:08:00FromDiscord<Prestige> That's pretty neat
02:08:06FromDiscord<Prestige> I've never directly used opengl before
02:10:20FromDiscord<Elegantbeef> Older opengl had you making your buffers in a texture so you'd waste the CPU to compress it to a texture to upload
02:10:22FromDiscord<Elegantbeef> Modern opengl allows you to just take a buffer and send it
02:11:22FromDiscord<j-james> hmm i swear i wrapped xkb at some point
02:11:31FromDiscord<j-james> it might have just been as shims
02:11:34FromDiscord<Elegantbeef> Perhaps
02:11:42FromDiscord<Elegantbeef> Like i said i have it mostly wrapped with tinwl
02:11:56FromDiscord<Elegantbeef> It's just all pain all around 😄
02:12:20FromDiscord<Elegantbeef> X library depends on Y library which depends on Z but none wrap them so you need to wrap all 3 to write software
02:12:45FromDiscord<Prestige> We should just rewrite it all in Nim, lol
02:13:06FromDiscord<Elegantbeef> I dont know about that one
02:13:07FromDiscord<Prestige> j-james: I am awaiting your work so I can spend way too much time writing a compositor btw
02:13:31FromDiscord<Prestige> I tried forcing my phone to use opengl 4 but the screen was just black, maybe some firmware issue
02:13:36FromDiscord<ajusa> In reply to @Avahe "We should just rewrite": ah yes the treeform approach
02:13:37FromDiscord<Prestige> or I did something wrong
02:13:52FromDiscord<Prestige> In reply to @ajusa "ah yes the treeform": It's the only way
02:14:10FromDiscord<j-james> if xkb is just the stuff in `/usr/include/xkbcommon` that's not so bad
02:14:25FromDiscord<Elegantbeef> Yea it's not that bad
02:14:25FromDiscord<j-james> c2nim seems to handle that fine
02:14:32FromDiscord<Elegantbeef> Except the keysyms are dumb as hell
02:14:42FromDiscord<Elegantbeef> I c2nim'd it then was going through manually rewriting it
02:15:06FromDiscord<Elegantbeef> There are multiple keysyms that mean the same thing in Niim
02:15:26FromDiscord<j-james> ehhhh
02:15:28FromDiscord<j-james> gross
02:15:50FromDiscord<Prestige> Just have to make more explicit names I think, which is fine
02:16:06FromDiscord<Prestige> Beef I know you don't use phones, but you have an android right?
02:16:18FromDiscord<Elegantbeef> Yes
02:16:39FromDiscord<Prestige> This is what I'm remaking in my engine: https://play.google.com/store/apps/details?id=tech.einheit.hexagone
02:16:53FromDiscord<j-james> yeah, okay, identifiers referring to specifically capital and lowercase keys are like the antithesis of style insensitivity
02:16:57FromDiscord<Prestige> It's addicting for no reason. Going to add more "levels" etc
02:17:08FromDiscord<checkersai> I've been gone a while, what's up with nimskull?
02:17:34FromDiscord<Prestige> @checkersai I think they have their own chat server, can see details at https://github.com/nim-works/nimskull
02:17:36FromDiscord<Elegantbeef> Yea well blame the fucko that gave meaning to `_` 😄
02:18:39FromDiscord<checkersai> I see it has a code of conduct, ew
02:19:10FromDiscord<Prestige> Yeah, a lot of projects do, now
02:25:25FromDiscord<j-james> i mean their code of conduct is pretty much just "don't be an asshole" + "moderators have oversight"
02:26:02FromDiscord<j-james> doesn't seem any different from here
02:54:58FromDiscord<Prestige> I'd rather have that be informal tbh
03:01:58FromDiscord<Prestige> Beef you have me checking out wasm for some reason, watching videos about it
03:02:31FromDiscord<Prestige> Well I guess it'd be useful for our future wayland compositor
03:02:52FromDiscord<Prestige> And I need to figure out how to compile my games to wasm... that's been a PITA for a while, haven't really gotten anywhere
03:13:56FromDiscord<gibson> @Prestige @ElegantBeef Thanks!
03:14:51FromDiscord<Prestige> What did we do
03:36:00*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
03:37:46*wallabra joined #nim
03:38:19FromDiscord<gibson> I got lost trying to make pragma macros work, and was doing something stupid. You set me straight.
03:40:13FromDiscord<Prestige> Ah, great
03:47:09FromDiscord<Hi02Hi> In reply to @ElegantBeef "So... carbon does Nim's": which optimization/ whats it called in the nim docs?
03:47:37FromDiscord<Hi02Hi> my guess: strictfuncs
03:48:32FromDiscord<Elegantbeef> It's in the manual somewhere but Nim just passes by reference when it's more performant to do as such
03:49:21FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#procedures-var-parameters mentioned at the very bottom of here
04:09:54*TakinOver joined #nim
04:25:49FromDiscord<Hi02Hi> ah the thing i was guessing off of was a future thing
04:26:51FromDiscord<Hi02Hi> no wait
04:27:21FromDiscord<Hi02Hi> doesnt #4 remind you of strictfuncs? you cant get a pointer to this and change it that way?
04:31:57FromDiscord<Hi02Hi> am i going crazy
04:36:35FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=46b5
04:38:08FromDiscord<Hi02Hi> gave it another look↵point #1 is just nim passing by reference if the type is big else by value↵point #2 doing that transparently↵point #3 ???
04:38:32FromDiscord<Hi02Hi> (edit) "gave it another look↵point #1 is just nim passing by reference if the type is big else by value↵point #2 doing that transparently↵point #3 ???" => "sent a long message, see http://ix.io/46b7"
05:15:28*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
05:17:15*wallabra joined #nim
05:37:41FromDiscord<Elegantbeef> Naming a struct that was declared before i guess
05:37:41FromDiscord<j-james> but see it wasn't declared before
05:37:42FromDiscord<Elegantbeef> Ah then it's just a empty struct declaration
05:37:46FromDiscord<j-james> hmm
05:37:47FromDiscord<j-james> alright beef some pretty 1\:1 xkb wrappers are up at https://github.com/j-james/nim-xkbcommon
05:37:47FromDiscord<Elegantbeef> But does your wlr use it \:D
05:37:49FromDiscord<Elegantbeef> Also you must be a god of patience
05:37:51FromDiscord<j-james> nah wlr uses like three types that are all uint32s
05:37:51FromDiscord<j-james> keysyms was a pain
05:37:52FromDiscord<j-james> regex-find-to-multiple-cursors made it easier though
05:37:53FromDiscord<j-james> hmm should i call it xkbcommon or just xkb
05:37:55FromDiscord<Elegantbeef> I'd say `xkb` is fine
06:29:08FromDiscord<#!/rip/luke> Hmm I’m making a discord bot for dye, and what would be the best way to do it?
06:29:08*pch quit (Read error: Connection reset by peer)
06:29:50FromDiscord<#!/rip/luke> Have the user pass in a url, and then on the server download the image, then convert it, then upload back to discord api, and remove off the server
06:29:55FromDiscord<#!/rip/luke> (edit) "server" => "server?"
06:32:54FromDiscord<wiga> In reply to @ripluke "Have the user pass": what?
06:33:18FromDiscord<wiga> idk if phrasing issue or my brain is just too slow rn
06:33:25FromDiscord<wiga> prolly my brian
06:33:28FromDiscord<wiga> (edit) "brian" => "brain"
06:33:34FromDiscord<#!/rip/luke> So dye is a cli program that can convert an image to any set of colors
06:33:44FromDiscord<#!/rip/luke> In reply to @wiga "idk if phrasing issue": Nah I should probably provide more info
06:33:49FromDiscord<wiga> aok
06:34:03*pch joined #nim
06:34:18FromDiscord<wiga> so wait you want to convert an image with a bot then upload the converted image after
06:34:29FromDiscord<#!/rip/luke> In reply to @wiga "so wait you want": Yea
06:34:37FromDiscord<#!/rip/luke> Pretty much
06:34:49FromDiscord<wiga> in nodejs it would be easy but in nim idk
06:34:58FromDiscord<wiga> you need to parse the attachment url
06:35:04FromDiscord<wiga> then download it
06:35:13FromDiscord<#!/rip/luke> In reply to @wiga "in nodejs it would": Nim has an httpclient so that shouldn’t be to hard
06:35:14FromDiscord<wiga> convert it and upload the image in attachment after
06:35:23FromDiscord<#!/rip/luke> In reply to @wiga "convert it and upload": Yea
06:35:44FromDiscord<#!/rip/luke> But I was wondering if there was a better way
06:35:51FromDiscord<wiga> use harpoon http client
06:35:58FromDiscord<wiga> there's a downloadfile function
06:36:03FromDiscord<#!/rip/luke> Oh
06:36:13FromDiscord<wiga> and its gcsafe thingy
06:36:18FromDiscord<wiga> so you can use threading
06:36:24FromDiscord<#!/rip/luke> In reply to @wiga "and its gcsafe thingy": That’s nice
06:36:28FromDiscord<wiga> ye
06:38:34FromDiscord<wiga> i have a weird problem with git
06:38:59FromDiscord<wiga> for some reason it decided to take my alt account credentials to commit my code
06:39:13FromDiscord<wiga> credentials that i have never set
06:42:48FromDiscord<Rika> Check the config?
06:43:02FromDiscord<Rika> git config --global --list user
06:43:06FromDiscord<Rika> Or dont put the global
06:43:13FromDiscord<Rika> Might be local to the repo
06:43:45FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1003191218374725722/unknown.png
06:44:24FromDiscord<Rika> I forgot the exact command
06:44:26FromDiscord<Rika> Lol
06:44:32FromDiscord<wiga> lemme check rq
06:45:41FromDiscord<wiga> glob and repo has my github main acc
06:45:43FromDiscord<wiga> weird
06:53:25FromDiscord<wiga> wait its not the good email
06:53:28FromDiscord<wiga> bruhb
06:53:33FromDiscord<wiga> how do i remove the user
06:54:39FromDiscord<Rika> You can change it but i forgot how, check the man page
06:54:45FromDiscord<Rika> man git-config
06:55:00FromDiscord<wiga> my eyes hurt https://media.discordapp.net/attachments/371759389889003532/1003194048267440239/unknown.png
06:55:04FromDiscord<wiga> i cant see shit
06:55:10FromDiscord<wiga> im literally drunk
06:55:55FromDiscord<Rika> If you prefer, you can just search how
06:56:01FromDiscord<wiga> i tried
06:56:02FromDiscord<wiga> but
06:56:03FromDiscord<wiga> yeah
06:56:06FromDiscord<Rika> Its just i prefer the man page
06:56:19FromDiscord<wiga> In reply to @wiga "im literally drunk": has i said
06:56:32FromDiscord<wiga> it was a little bit too much vodka i think
06:56:52FromDiscord<Rika> maybe you shouldnt be programming now hahaha
06:57:00FromDiscord<wiga> i really shouldnt
06:57:07FromDiscord<wiga> i should sleep cuz its like 4am
06:57:09FromDiscord<Rika> yes
06:57:09FromDiscord<wiga> (edit) "4am" => "3am"
06:57:16FromDiscord<Rika> good night to you
06:57:20FromDiscord<wiga> yes gn
06:57:37FromDiscord<wiga> gonna change my git config tomorrow instead lol
07:02:43FromDiscord<#!/rip/luke> How can I check if a website is online
07:02:51FromDiscord<#!/rip/luke> And does return 404
07:11:52FromDiscord<Rika> you request it, and see if it returns a 404?
07:14:28FromDiscord<ajusa> I'm trying to figure out whether to use traitor/iface, variant, or just plain Nim methods to implement an instruction interpreter. With variant, I declare an object for each instruction, and then I make a union of all of them for my instruction type. With Nim methods, I guess I would subclass an instruction type.
07:15:01FromDiscord<Elegantbeef> Do not use dynamic dispatch for an interpreter you'll regret it
07:15:29FromDiscord<Prestige> Are there still significant performance problems in Nim with dynamic dispatch?
07:15:46FromDiscord<Elegantbeef> Regardless you do not want to have dynamic dispatch for an interpreter
07:16:07FromDiscord<Elegantbeef> But i think that's been lessened in devel
07:16:30FromDiscord<ajusa> Gotcha, should I stick with variant and many if statements for checking which kind of instruction it is? What's wrong with dynamic dispatch, shouldn't the performance end up being the same?
07:17:03FromDiscord<Elegantbeef> Dynamic dispatch generally means you need to box the data with a pointer, which means you're going to have data all over the heap
07:17:48FromDiscord<ajusa> Oh right, it's a ref object
07:17:50FromDiscord<Elegantbeef> If you really wanted something extensible i'd look more into pointer procs
07:18:08FromDiscord<ajusa> So my seq of instructions can end up scattered
07:18:15FromDiscord<Elegantbeef> Pointer procs still cannot be inlined but they're a simple lookup to procedure calls
07:18:35FromDiscord<Elegantbeef> You then just do something like `myProcTable[opCode](args)`
07:19:46FromDiscord<ajusa> Hm, okay
07:20:40FromDiscord<Prestige> https://github.com/appcypher/awesome-wasm-langs#nim 🤔
07:21:13FromDiscord<Elegantbeef> What?
07:25:16FromDiscord<ajusa> Beef do you know if I could index into a table if I'm using alaviss/union? Or should I just use a case object with an explicit enum
07:25:41FromDiscord<ajusa> I don't like case objects because the fields can't have the same name, I know it's an accepted RFC
07:26:03FromDiscord<Elegantbeef> Why couldnt you index into a table
07:26:39FromDiscord<Elegantbeef> Also dont use a table use an enum indexed array
07:27:12FromDiscord<Elegantbeef> You pretty much have to use a variant object if you want to have good cache locality
07:27:23FromDiscord<Elegantbeef> I know union does that but i dont see the benefit here
07:27:54FromDiscord<ajusa> Okay, so I should drop union I guess. It provides some nice sugar around composing types, that's all
07:28:11FromDiscord<Elegantbeef> Yea but you're not just composing types
07:28:14FromDiscord<Elegantbeef> Atleast i assume you're not
07:35:06FromDiscord<#!/rip/luke> sent a code paste, see https://play.nim-lang.org/#ix=46bU
07:36:00FromDiscord<Elegantbeef> Use a callback or `waitFor` instead
07:37:01FromDiscord<#!/rip/luke> where do i put the waitfor
07:37:16FromDiscord<Elegantbeef> Dont use it as it'd block the program
07:37:31FromDiscord<#!/rip/luke> thats what i want it to do
07:37:31FromDiscord<Elegantbeef> but you could do `waitfor discord.api.sendMessage`
07:37:58FromDiscord<#!/rip/luke> hmm would that work? as the following code isnt top level
07:38:06FromDiscord<Elegantbeef> Why wouldnt it?
07:38:14FromDiscord<Elegantbeef> `waitFor` is async for "blocking operation"
07:38:36FromDiscord<#!/rip/luke> ok
07:39:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46bY
07:40:20FromDiscord<#!/rip/luke> ok
07:42:03FromDiscord<Elegantbeef> And then at the end do `await myFut`
07:42:16FromDiscord<Elegantbeef> I think that should work atleast
07:42:45FromDiscord<#!/rip/luke> ok
07:58:20FromDiscord<Phil> sent a long message, see http://ix.io/46cf
07:59:30FromDiscord<アサダ> sent a code paste, see https://play.nim-lang.org/#ix=46cg
07:59:54FromDiscord<アサダ> (edit) "https://play.nim-lang.org/#ix=46cg" => "https://play.nim-lang.org/#ix=46ch"
08:00:28FromDiscord<Elegantbeef> Nim's type classes are used for constraints they're not dynamically typed
08:00:38FromDiscord<Elegantbeef> For what you want look at object variants
08:10:30FromDiscord<Rika> Beef I think you’re misunderstanding
08:12:02FromDiscord<Elegantbeef> I mean i might be but Nim's typeclasses are not for dynamism in results or variable declaration and are only supposed to be used for generic constraints
08:20:17FromDiscord<Phil> In reply to @Elegantbeef "I mean i might": But num2 is not dynamic. The compiler has the information to figure out that of the 4 types PrimeNumber includes, that the correct type is range[2..2]
08:20:54FromDiscord<Phil> And num2 afterwards isn't used afterwards as if it were type range[3..3] or the like
08:20:57FromDiscord<Elegantbeef> Hey dont look at me, you're not supposed to use typeclasses for variable types
08:21:32FromDiscord<Elegantbeef> 2 is technically valid for all of those ranges
08:21:55FromDiscord<アサダ> I see. On the other hand, how can the `intOrString` type be accepted as the correct grammar? I am interested in whether it is wrong that an ambiguous type is accepted in a variable, or whether it is a `range[T]` specific problem.
08:22:05FromDiscord<Elegantbeef> It's an integer so it can be converted to all the ranges
08:22:25FromDiscord<Phil> It is? I thought it wouldn't fit in the 3..3 range or the like. Or is it that they're all limited ints and the compiler only checks that they are ints and thus which int it should be is ambiguous?
08:22:35*kenran joined #nim
08:23:03FromDiscord<Elegantbeef> The reason it's accepted is cause the way the system works presently(against araq's from what i can tell) is type annotations for variables uses the same mechanisms as everywhere and as such `intorstring` works
08:23:22FromDiscord<Elegantbeef> Phil that requires checking logic, that's not needed
08:24:12FromDiscord<Elegantbeef> You go "Hey is this untyped integer possibly to convert to any of these ranges". The compiler says "Yes" then gives the error it does
08:24:29*kenran quit (Client Quit)
08:25:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46cy
08:25:34FromDiscord<Elegantbeef> `2` is convertible to ever range there so you get an ambiguous error
08:25:42FromDiscord<Elegantbeef> No clue what is intended but i'm on team it's ambiguous
08:28:10FromDiscord<Elegantbeef> Narrowing literals based off ranges does seem like something that could be done, but given most cases never need this it's quite obtrusive 😄
08:28:27FromDiscord<Rika> "most cases never need this" example?
08:28:32FromDiscord<Rika> i mean, source
08:28:59FromDiscord<Elegantbeef> I've seen very few people use subrange typed dispatch on literals
08:29:19FromDiscord<Rika> isnt that survivorship bias? you just mentioned its not possible
08:29:20FromDiscord<Elegantbeef> The only place this is usable is with literals when you have more than 1 subrange type that could be used
08:29:42FromDiscord<Elegantbeef> Not really
08:29:58*pch quit (Remote host closed the connection)
08:30:06FromDiscord<Elegantbeef> How many times do you see subrange type overloads
08:30:27FromDiscord<Rika> just because no one does it doesnt mean it could be useful?
08:30:31FromDiscord<Rika> couldnt
08:30:44FromDiscord<Elegantbeef> I mean you still need to manually convert to the subrange type even with this suggest change
08:30:51FromDiscord<Prestige> This particular use case seems weird to me
08:31:08FromDiscord<Elegantbeef> You still have to convert
08:31:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46cI
08:31:14FromDiscord<Elegantbeef> Unless subrange types are runtime dispatched
08:32:11FromDiscord<Elegantbeef> So it only changes the few cases you have overloaded the expected type on a literal
08:32:27FromDiscord<Elegantbeef> It's a very very small niche group that'd do that given most people dont even use subrange types
08:33:44FromDiscord<Rika> hey i understand it doesnt really make sense im just trying to push if there really is no use
09:50:31NimEventerNew Nimble package! wayland - Nim bindings for Wayland, see https://github.com/j-james/nim-wayland
09:50:31NimEventerNew Nimble package! wlroots - Nim bindings for wlroots, see https://github.com/j-james/nim-wlroots
09:50:31NimEventerNew Nimble package! xkb - A light wrapper over xkbcommon, see https://github.com/j-james/nim-xkbcommon
09:53:54FromDiscord<Rika> thats a lot
10:04:24FromDiscord<Phil> No library is safe
10:04:37FromDiscord<Phil> Beware libraries, jj is coming to wrap you
10:47:52FromDiscord<b1rdf00d> is it possible to get a `ref` of a variable of type `object`? or does the type of the variable need to be `ref object` ?↵e.g. I multithreaded my raytracer and instead of passing the "world" by value (copy) I wanted to pass by ref which meant I had to rewrite the type as a `ref object` ?
10:55:01FromDiscord<hotdog> In reply to @b1rdf00d "is it possible to": If your type is called e.g. `World` you can use `ref World`
10:55:52FromDiscord<hotdog> sent a code paste, see https://play.nim-lang.org/#ix=46dE
10:55:55FromDiscord<hotdog> This is quite common
11:02:25FromDiscord<b1rdf00d> sent a code paste, see https://play.nim-lang.org/#ix=46dI
11:04:11FromDiscord<hotdog> In reply to @b1rdf00d "thanks! I did actually": Yeah that won't work I'm afraid
11:07:01FromDiscord<hotdog> You can do the opposite though, start as a ref and dereference if you want to pull the value out and use it
11:08:49FromDiscord<b1rdf00d> yep! I did do that to init it
11:09:01FromDiscord<eyecon> In reply to @ripluke "Hmm I’m making a": You're using https://github.com/krisppurg/dimscord and https://github.com/ire4ever1190/dimscmd , right?
11:31:38FromDiscord<Rika> In reply to @b1rdf00d "thanks! I did actually": That last point is why you cant make a reference out of that variable
11:39:10FromDiscord<b1rdf00d> Thanks Rika 🙂 It actually makes sense now and I'm glad I'm being prevented from making noob mistakes. This helped explain it: https://www.reddit.com/r/nim/comments/7dm3le/tutorial_for_types_having_a_hard_time/
11:44:45FromDiscord<hotdog> @b1rdf00d this is also a good read if you haven't come across it already, I've recommended it to a few people who are learning Nim's memory stuff - https://zevv.nl/nim-memory/
11:47:50FromDiscord<dom96> In reply to @ripluke "so i have this": Why aren’t you awaiting the downloadFile?
11:54:06FromDiscord<b1rdf00d> In reply to @hotdog "<@775600941985431562> this is also": thanks hotdog! I have read this but I'll read it again
12:50:35*jmdaemon quit (Ping timeout: 252 seconds)
12:56:44*arkurious joined #nim
13:14:30*Guest56 joined #nim
13:20:58*Guest56 quit (Quit: Client closed)
13:38:18*krux02 joined #nim
13:39:46NimEventerNew post on r/nim by rtacconi: Infra Weekly #9, see https://reddit.com/r/nim/comments/wcoy1s/infra_weekly_9/
14:05:57FromDiscord<exelotl> love to find out my app is leaking sockets 😅↵https://git.sr.ht/~exelotl/forum2irc/tree/master/item/src/forum2irc.nim#L62
14:06:06*pch joined #nim
14:06:07FromDiscord<exelotl> need them destructors in the stdlib...
14:09:06FromDiscord<exelotl> dang none of the examples in the docs even call `client.close()`, it really sets you up for failure
14:11:39FromDiscord<!Patitotective> In reply to @exelotl "dang none of the": yea...
14:17:02FromDiscord<!Patitotective> In reply to @ripluke "so i have this": allocations when double split go brrr
14:26:25*kenran joined #nim
14:40:02*wallabra quit (Ping timeout: 245 seconds)
14:47:44*wallabra joined #nim
14:50:05*kenran quit (Quit: WeeChat info:version)
14:51:52FromDiscord<Require Support> im losing my mind. im transforming a json string to an object using jsony (https://github.com/treeform/jsony) and I keep getting jsonerror but if I do a quick test program with that exact string and the exact object it works fine without any errors. Any one have an idea on how to figure out whats the problem?
14:55:09FromDiscord<Rika> Are you sure it’s the exact string?
14:55:29FromDiscord<Rika> Character escaping could be biting you in the ass
14:55:54FromDiscord<gibson> @Require Support Is your object exported and visible to the namespace? Hard to debug without seeing the test case.
14:56:33FromDiscord<Require Support> In reply to @gibson "<@710108871724761128> Is your object": yep exported and visible
14:56:53FromDiscord<Require Support> In reply to @Rika "Character escaping could be": might be , how do i confirm this?
14:57:15FromDiscord<Rika> Code example
15:07:02FromDiscord<sOkam!> Given this json table, how do you parse it into a table of custom colors? `seq[Color]` https://media.discordapp.net/attachments/371759389889003532/1003317872484962375/table.json
15:07:35FromDiscord<sOkam!> I got the color type made, but struggling a lot to understand how to parse each line into a separate object 😔
15:08:34FromDiscord<Rika> that does not look like valid json
15:08:45FromDiscord<!Patitotective> In reply to @sOkam! "Given this json table,": did you mean array `[]`?
15:08:48FromDiscord<!Patitotective> (edit) "In reply to @sOkam! "Given this json table,": did you mean ... array" added "an"
15:09:14FromDiscord<sOkam!> anything that can be iterated, i don't mind the nim table type 🤷‍♂️
15:09:22FromDiscord<Rika> no
15:09:29FromDiscord<Rika> he means the json is not valid as is
15:09:37FromDiscord<Rika> {} is not an array in json, cannot be one either
15:09:55FromDiscord<Rika> you must use `[{"cat": ...}, ...]`
15:10:18FromDiscord<sOkam!> easy fix. lets say it was `[{something, something}, {othersomething, othersomething}]` from moment 1
15:10:34FromDiscord<sOkam!> still have no clue how to convert it
15:10:39FromDiscord<Rika> what are you using
15:10:45FromDiscord<Rika> std/json?
15:10:50FromDiscord<sOkam!> ye
15:11:07FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46fe
15:11:09FromDiscord<!Patitotective> something like that
15:11:21FromDiscord<sOkam!> ✍️
15:12:37FromDiscord<!Patitotective> and if you want to store `lname` as well you better create an custom color object
15:13:00FromDiscord<sOkam!> i have one
15:13:27FromDiscord<sOkam!> i just want to parse that data into the custom type, that contains all items of the json with exact names
15:14:03FromDiscord<!Patitotective> oh
15:14:15FromDiscord<!Patitotective> https://nim-lang.org/docs/json.html#overview-unmarshalling
15:14:19FromDiscord<sOkam!> so i figure `collect` creates an array, from sugar, and `rgb(` creates a `chroma.rgb` of some sort?
15:14:47FromDiscord<!Patitotective> In reply to @sOkam! "so i figure `collect`": collect creates a sequence↵rgb creates a `chroma.ColorRGB`, yes
15:15:08FromDiscord<!Patitotective> if you arent manipulating the color in any way chroma is not needed
15:15:15FromDiscord<sOkam!> right, then that solution is not valid. i need all the data in the json, not just the color value 😔
15:15:25FromDiscord<!Patitotective> In reply to @Patitotective "https://nim-lang.org/docs/json.html#overview-unmars": .
15:15:35FromDiscord<sOkam!> yeah, haven't had the time to click on that yet 😄
15:16:04FromDiscord<sOkam!> oh, that one
15:16:07FromDiscord<sOkam!> yeah, i was there
15:16:12FromDiscord<sOkam!> struggling, and came here to ask
15:16:20FromDiscord<sOkam!> i have no clue how to unmarshal an array
15:16:38FromDiscord<sOkam!> (edit) "i have no clue how to unmarshal an array ... " added "into a sequence (or any other multiple data container)"
15:16:42FromDiscord<sOkam!> which is what started the q
15:16:45FromDiscord<!Patitotective> well, you just iterate through it and unmarshal each entry
15:17:49FromDiscord<sOkam!> i don't follow. the problem in my understanding is how to extract an iterable from the json
15:18:02FromDiscord<sOkam!> that example only takes a single object as an input
15:18:39FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46ff
15:19:38FromDiscord<sOkam!> and `jsonData` you get it from `parseJson` of the raw string?
15:19:42FromDiscord<!Patitotective> yes
15:36:36FromDiscord<huantian> You don’t need the collect, you can directly to(seq[Color])
15:37:10FromDiscord<!Patitotective> smart
15:37:16FromDiscord<huantian> Also does std json support ranges? 0…255 might be better than uint8
15:41:57FromDiscord<sOkam!> In reply to @huantian "You don’t need the": as in doing `jsonData.to(seq[Color])`?
15:42:05FromDiscord<huantian> Yes
15:44:57FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=46fo
15:48:17FromDiscord<!Patitotective> you need to specify the type of the sequence you're returning
15:48:36FromDiscord<!Patitotective> also iirc there's `parseFile`
16:03:34FromDiscord<!Patitotective> is there a way to `execCmd` asynchronously? or in a non-blocking way?↵do i need to use a thread?
16:06:40FromDiscord<huantian> There’s a different proc tor that
16:06:54FromDiscord<huantian> startProcess?
16:10:21FromDiscord<Require Support> sent a code paste, see https://play.nim-lang.org/#ix=46fs
16:11:22FromDiscord<!Patitotective> In reply to @huantian "startProcess?": 🧠
16:28:34FromDiscord<sOkam!> What was the way to check for a file being the main module being executed? 🤔
16:29:04FromDiscord<!Patitotective> In reply to @sOkam! "What was the way": `when isMainModule`
16:29:09FromDiscord<sOkam!> (edit) "for a" => "that" | "being" => "is"
16:40:18FromDiscord<sOkam!> In reply to @Patitotective "also iirc there's `parseFile`": much cleaner indeed. tyty
17:22:01FromDiscord<eyecon> In reply to @eyecon "So I just published": And a second one, almost the same API for another project: https://github.com/EyeCon/smaznim
17:30:37FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=46gB
17:30:55FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=46gD
17:31:08FromDiscord<Rika> oh hey antirez
17:31:27FromDiscord<Phil> ?
17:31:33FromDiscord<Rika> eyecon's package
17:32:57FromDiscord<eyecon> In reply to @Rika "eyecon's package": Hmm?
17:33:13FromDiscord<Phil> I stared at the github page of that package and I'm still not connecting the dots to the word "antirez"
17:33:33FromDiscord<Rika> antirez made smaz
17:33:46FromDiscord<Phil> Ohhhhh
17:33:51FromDiscord<eyecon> Ah, I thought I heard the word recently
17:34:54FromDiscord<sOkam!> How can you truncate a float to X number of decimals?
17:38:06FromDiscord<gibson> sent a code paste, see https://play.nim-lang.org/#ix=46gK
17:38:39FromDiscord<sOkam!> rounding has a number of decimals as input? thats handy↵is there something like that for truncation too?
17:40:51FromDiscord<gibson> You could use `trunc` which truncates to the decimal. Or convert to string and truncate by `echo myvar[0..6]` for very specific control of the textual representation.
17:47:22FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=46gP
17:50:25FromDiscord<domosokrat> `assert 0.9370000000000001 == 0.937`
17:50:25FromDiscord<domosokrat> in other words, 0.9370000000000001 is the closest float to 0.937
17:50:51Amun-Raalmost alwys do (a - b) <= epsilon
17:51:14Amun-Raabs*
17:54:01FromDiscord<sOkam!> right, but I just want all floats to be 3decimals in format↵is there a way to do that, without needing to round or anything?
17:54:22FromDiscord<sOkam!> because I would like for `0.0` to also become `0.000` after the formatting
17:54:54FromDiscord<sOkam!> is there such a tool in strformat, but im not finding it? 🤔
17:55:18Amun-Rafmt"{x:.03f}"
17:55:21FromDiscord<domosokrat> doesn't formatFloat() work for you?
17:55:37FromDiscord<domosokrat> it's from stutils
17:55:48FromDiscord<sOkam!> ahh gotchu
17:57:45FromDiscord<sOkam!> gorgeous. ty! https://media.discordapp.net/attachments/371759389889003532/1003360833419612170/unknown.png
18:07:11FromDiscord<sOkam!> is there a way to do the same, but for left zero padding integers?
18:08:07FromDiscord<sOkam!> as in `0 :int` becoming `000 :string`
18:08:50FromDiscord<demotomohiro> !eval import strformat; echo &"{10:04}"
18:08:55NimBotCompile failed: 0010
18:10:05FromDiscord<demotomohiro> !eval import strformat; echo &"{123:05}"
18:10:10NimBotCompile failed: 00123
18:11:15FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=46gV
18:11:16FromDiscord<demotomohiro> It echo correct output but says compile failed.
18:12:41FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=46gV" => "https://play.nim-lang.org/#ix=46gW"
18:12:51FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=46gW" => "https://play.nim-lang.org/#ix=46gY"
18:13:48FromDiscord<sOkam!> !eval import strformat; echo &""" {"cat" & $10:05} """
18:13:51NimBotCompile failed: cat10
18:14:03FromDiscord<!Patitotective> :/
18:15:14FromDiscord<domosokrat> This is the same as `&""" {(color.cat & $color.id):02} """`↵(@sOkam!)
18:15:51FromDiscord<sOkam!> it only formats the int, and doesn't touch the string?
18:15:55FromDiscord<domosokrat> So, yes you need separate '{}'
18:15:56FromDiscord<sOkam!> didn't know
18:16:03FromDiscord<demotomohiro> Formar specifier works for per `{}` block.
18:16:51FromDiscord<huantian> How do you expect it to know which part of the string is the int if you use one block
18:17:54FromDiscord<sOkam!> `{color.cat}{color.id:02}` worked, didn't realize i could just skip the space in between brackets to skip adding a space 🤷‍♂️
18:18:44FromDiscord<huantian> Lol
18:19:55FromDiscord<demotomohiro> Here is how strformat parse input text: https://github.com/nim-lang/Nim/blob/40e0048a504c1009e143fb62ad260625a2b2a53d/lib/pure/strformat.nim#L580
18:19:58FromDiscord<sOkam!> i get stuck on the stupidest things, if they are small enough 😄
18:20:16FromDiscord<Rika> you're not the only one dont worry too much about it
18:20:28FromDiscord<Rika> i dont know anyone who doesnt do that incl myself xddddd
18:24:43FromDiscord<krisppurg> Is there any alternatives to `osproc`?
18:27:01FromDiscord<!Patitotective> In reply to @krisppurg "Is there any alternatives": what's wrong with it?
18:28:20FromDiscord<domosokrat> you could try the posix module↵(@krisppurg)
18:29:05FromDiscord<domosokrat> But I'm not sure if that's a good alternative
18:29:10FromDiscord<demotomohiro> Or winlean/winim for windows if you need lower level APIs.
18:30:39FromDiscord<demotomohiro> https://github.com/cheatfate/asynctools
18:31:52FromDiscord<!Patitotective> In reply to @demotomohiro "https://github.com/cheatfate/asynctools": :ooooooooooooooooooooooooooooo amazing so useful
18:36:21*jmdaemon joined #nim
18:37:35FromDiscord<krisppurg> Is there any examples for asynctools?
18:39:07FromDiscord<!Patitotective> you have to generate the documentation yourself by cloning the repo↵(i dont think there are more examples than in the stdlib)
18:42:18FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=46hb
18:42:31FromDiscord<eyecon> In reply to @demotomohiro "https://github.com/cheatfate/asynctools": Somewhat old, is it still relevant? https://media.discordapp.net/attachments/371759389889003532/1003372099504701480/unknown.png
18:42:48FromDiscord<!Patitotective> In reply to @krisppurg "Seems like when I": i did `nim doc --project asynctools.nim`
18:43:29FromDiscord<!Patitotective> In reply to @eyecon "Somewhat old, is it": there are no other options 💀 💀
18:45:11FromDiscord<krisppurg> Well if the requirement is an older nim version as minimum it could also mean that code is consistent
18:51:12FromDiscord<Tuatarian> using spacemacs, lsp doesn't seem to work with nimlangserver
18:51:33FromDiscord<Tuatarian> not sure exactly what is going on, and no idea how to troubleshoot since I'm so new to emacs
18:51:44FromDiscord<⃟⃟> is the last name "Rumpf" derived from "rump"
18:52:02FromDiscord<Tuatarian> likely not
18:52:58FromDiscord<Tuatarian> actually, it seems to be descended from the german word that english "rump" is descended from
18:53:07FromDiscord<Tuatarian> not quite the same meaning afai can tell
18:53:09FromDiscord<Tuatarian> https://www.ancestry.com/name-origin?surname=rumpf#:~:text=German%3A%3A%20nickname%20for%20a,German%20rumph%20'bent%20crooked'.
18:53:11FromDiscord<Tuatarian> https://en.wikipedia.org/wiki/Rumpf
19:01:02FromDiscord<!Patitotective> In reply to @eyecon "Somewhat old, is it": it seems a little abandoned :[[
19:06:25*kenran joined #nim
19:07:17FromDiscord<Tuatarian> if yyoncho is online, I think you would be able to help me
19:07:36FromDiscord<Tuatarian> but lsp mode doesn't seem to be working for me, it complains about the file not being compiled as part of the project
19:24:40FromDiscord<Tuatarian> any ideas?
19:24:46FromDiscord<Tuatarian> still haven't been able to fix
19:27:06NimEventerNew thread by Lachu: Compiler bug?, see https://forum.nim-lang.org/t/9334
19:30:51*xet7 quit (Ping timeout: 276 seconds)
19:33:24FromDiscord<Tuatarian> ok I'm giving up on lsp-mode
19:33:32FromDiscord<Tuatarian> even lints using nimsuggest don
19:33:38FromDiscord<Tuatarian> don't seem to be working on windows
19:43:24*xet7 joined #nim
19:52:47FromDiscord<gorilla_> Couldn't get it to work on VSCode though.
19:52:48FromDiscord<gorilla_> lsp mode works well enough on Kate with LSP plugin↵(@Tuatarian)
19:54:07FromDiscord<#!/rip/luke> In reply to @eyecon "You're using https://github.com/krisppurg/dimscord ": Yup
20:03:28FromDiscord<sOkam!> can you make a for loop increase by a certain value each time?
20:04:32FromDiscord<!Patitotective> In reply to @sOkam! "can you make a": no, use a while loop
20:04:36FromDiscord<!Patitotective> nvm
20:04:40FromDiscord<gibson> https://nim-lang.github.io/Nim/system.html#countup.i%2CT%2CT%2CPositive
20:04:43FromDiscord<!Patitotective> yes
20:04:50FromDiscord<!Patitotective> (edit) "yes ... " added "⬆️"
20:05:21FromDiscord<!Patitotective> In reply to @sOkam! "can you make a": yet if you want it to increase by a different value each time you need a while loop
20:18:12FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46hx
20:19:09FromDiscord<#!/rip/luke> In reply to @Patitotective "ok, so i want": Use process.lines
20:19:52FromDiscord<#!/rip/luke> sent a code paste, see https://play.nim-lang.org/#ix=46hy
20:19:55FromDiscord<!Patitotective> In reply to @ripluke "Use process.lines": doesnt that block the main thread?
20:20:15FromDiscord<#!/rip/luke> Oh
20:20:16FromDiscord<#!/rip/luke> Yea
20:20:21FromDiscord<!Patitotective> :/
20:23:39FromDiscord<neon_> why dont you just get its output stream and read it in the main loop?
20:24:30FromDiscord<dom96> use asynctools package's async osproc
20:25:16FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46hA
20:25:24FromDiscord<!Patitotective> In reply to @neon_ "why dont you just": i tried but it still blocks :/
20:25:52FromDiscord<neon_> wait lemme look through my libs
20:25:58FromDiscord<neon_> i think i had a simmilar problem
20:28:49FromDiscord<neon_> In reply to @Patitotective "i tried but it": https://github.com/HookRace/hookrace/blob/master/logger.nim this guy wrote an async logger i think you could adapt it to your process
20:28:57FromDiscord<neon_> the lines at the end are outdated you should use
20:29:12FromDiscord<neon_> sent a code paste, see https://play.nim-lang.org/#ix=
20:29:20FromDiscord<neon_> from std/exitprocs
20:29:31FromDiscord<!Patitotective> 👀
20:30:08FromDiscord<!Patitotective> this is more like use osproc in a thread (?)
20:30:58FromDiscord<neon_> yes i think
20:31:34FromDiscord<neon_> sent a code paste, see https://play.nim-lang.org/#ix=46hD
20:31:46FromDiscord<neon_> and its async so it doesnt wait to write to the log file but continues
20:32:14FromDiscord<neon_> dont want ur http api to crash cause it cant output logs fast enough cause its waiting to flush to a file
20:34:03FromDiscord<!Patitotective> what i'm trying to implement is kind of a terminal↵so i supply i command and i want to get the lines in the moment they're outputted to display them in a GUI
20:34:08FromDiscord<neon_> sent a code paste, see https://play.nim-lang.org/#ix=46hE
20:34:39FromDiscord<neon_> In reply to @Patitotective "what i'm trying to": so you want to wait for the command to finish?
20:35:28FromDiscord<!Patitotective> well, i want to get the output at real time↵not when it finishes
20:36:38FromDiscord<!Patitotective> just like a real terminal
20:37:32*wallabra quit (Ping timeout: 245 seconds)
20:40:29FromDiscord<Elegantbeef> Well time to make a terminal emulator↵(@!Patitotective)
20:44:10FromDiscord<#!/rip/luke> In reply to @dom96 "Why aren’t you awaiting": That gives me an error about futures
20:45:07FromDiscord<!Patitotective> In reply to @Elegantbeef "Well time to make": i just need a non-blocking stdout :[[[[[
20:45:17FromDiscord<neon_> put it in a thread
20:45:19FromDiscord<Elegantbeef> Then use startprocess?↵(@!Patitotective)
20:45:20FromDiscord<neon_> and it wont block
20:45:24FromDiscord<Elegantbeef> Dont use a thread
20:45:47FromDiscord<neon_> then just yield when its not doing anything
20:46:34FromDiscord<!Patitotective> In reply to @Elegantbeef "Then use startprocess? (<@762008715162419261>)": let me push and you can see how it actually blocks (by actually i mean im not using it how its supposed to be used)
20:47:33FromDiscord<dom96> In reply to @ripluke "That gives me an": what error? Are you using AsyncHttpClient?
20:47:46FromDiscord<#!/rip/luke> No I'm using harpoon
20:47:49FromDiscord<dom96> In reply to @Elegantbeef "Dont use a thread": you can put it in a thread
20:48:10FromDiscord<!Patitotective> https://github.com/Patitotective/ImNimble
20:48:16FromDiscord<!Patitotective> just `nimble run`
20:48:25FromDiscord<!Patitotective> and when you click install on any package it lags
20:48:43FromDiscord<!Patitotective> https://github.com/Patitotective/ImNimble/blob/main/main.nim#L140
20:50:12FromDiscord<#!/rip/luke> sent a code paste, see https://play.nim-lang.org/#ix=46hG
20:50:48FromDiscord<dom96> what does `downloadFile` return?
20:51:27FromDiscord<#!/rip/luke> Future[void]
20:52:10FromDiscord<Elegantbeef> Use peekable stream instead no?
20:52:38FromDiscord<!Patitotective> In reply to @Elegantbeef "Use peekable stream instead": let me try
20:54:33FromDiscord<!Patitotective> same
20:54:50FromDiscord<Elegantbeef> Probably has same issue
20:54:51FromDiscord<Elegantbeef> Then thread might be the best option
20:55:20FromDiscord<Elegantbeef> I mean if you're `readLine` instead of `peekLine` of course
20:55:27FromDiscord<Elegantbeef> Dont know if peak is blocking
20:55:29FromDiscord<Elegantbeef> Peek rather
20:55:31FromDiscord<!Patitotective> let me try
20:56:19FromDiscord<Tuatarian> In reply to @gorilla_ "lsp mode works well": I don't even need lsp, I just need some sort of linting
20:56:34FromDiscord<Tuatarian> it was working fine on my linux laptop, doesn't seem to work on my windows desktop either native or via wsl
20:56:46FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46hJ
20:57:17FromDiscord<!Patitotective> would asynctools work better than the thread? https://play.nim-lang.org/#ix=46hI
20:57:20FromDiscord<#!/rip/luke> Are there any other nimble packages that can download stuff
20:57:29FromDiscord<!Patitotective> In reply to @ripluke "Are there any other": downit LMAO
20:57:34FromDiscord<#!/rip/luke> Oh
20:57:56FromDiscord<!Patitotective> https://media.discordapp.net/attachments/371759389889003532/1003406177805275166/unknown.png
20:58:23FromDiscord<!Patitotective> In reply to @ripluke "Oh": ~~(its a joke because downit uses downloadFile)~~
20:58:35FromDiscord<#!/rip/luke> The bottom 2 won't work for my usecase
20:58:45FromDiscord<!Patitotective> dogs images are funny, why not
20:58:53FromDiscord<#!/rip/luke> Puppy always gives puppy errord
20:58:56FromDiscord<#!/rip/luke> (edit) "errord" => "errors"
20:59:05FromDiscord<#!/rip/luke> In reply to @Patitotective "dogs images are funny,": Lol I have that installed actually
20:59:06FromDiscord<!Patitotective> what errors do you expect?
20:59:13FromDiscord<#!/rip/luke> None 💀
20:59:16FromDiscord<Elegantbeef> You know you can catch errors in Nim?
20:59:40FromDiscord<#!/rip/luke> You can do that in any language
21:01:43FromDiscord<neon_> In reply to @neon_ "on another note would": so uuhh would any compiler expert be able to elaborate on this... 😅
21:05:32FromDiscord<Elegantbeef> I can only say the issue is with the generated C 😄
21:05:54FromDiscord<neon_> but the file is a native nim file t.t
21:06:25FromDiscord<Elegantbeef> It imports nativesockets which means it's wrapping the C api
21:08:10FromDiscord<pruno> Is it possible to include .rc resources files like in C/C++ ?
21:09:20FromDiscord<Elegantbeef> You can just do `staticRead("myFile")`
21:10:19FromDiscord<Elegantbeef> I've never used rc files before so no clue what they solve
21:10:21*kenran quit (Quit: WeeChat info:version)
21:10:42FromDiscord<pruno> For example, the icon of the file
21:11:40FromDiscord<!Patitotective> `staticRead("the icon of the file.png")`
21:12:06FromDiscord<!Patitotective> then `loadTheIconOfTheFileFromMemory(data)`
21:13:20FromDiscord<pruno> Well, it won't work if i want to put an icon, which is what i'm trying to do 😅
21:13:36FromDiscord<!Patitotective> why it won't work?
21:13:47FromDiscord<pruno> if i load it from memory
21:13:50FromDiscord<pruno> it's a runtime right ?
21:14:03FromDiscord<!Patitotective> loading yea, reading the file no
21:14:13FromDiscord<pruno> Yeah so there won't be an icon
21:14:15FromDiscord<pruno> Right ?
21:14:56FromDiscord<!Patitotective> i don't think i get what you're saying↵you want your exe to have an icon?
21:15:07FromDiscord<!Patitotective> or what icon are you talking about?
21:15:08FromDiscord<pruno> Yep
21:15:16FromDiscord<pruno> An icon for my exe
21:15:30FromDiscord<!Patitotective> then no idea how that is done
21:15:52FromDiscord<!Patitotective> isnt that a windows thing rather than a nim one?
21:17:05FromDiscord<pruno> Well since the .rsrc section is not only made for icons, wanted to know if there was a way to do it with nim's compiler
21:17:45*pch quit (Remote host closed the connection)
21:18:32FromDiscord<Elegantbeef> You'd just pass the same C compiler flags you'd do with the C compiler
21:22:21FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/DVt
21:22:53FromDiscord<Elegantbeef> Sure
21:24:20FromDiscord<pruno> In reply to @Elegantbeef "You'd just pass the": Will try
21:27:01FromDiscord<!Patitotective> In reply to @Elegantbeef "Sure": but it has global variables :[[[[[[[[[[[[[[[[[↵that ruins everything
21:27:16FromDiscord<neon_> whats wrong with global variables?
21:27:46FromDiscord<!Patitotective> they're creepy little monserts
21:27:49FromDiscord<!Patitotective> (edit) "monserts" => "monters"
21:27:54FromDiscord<!Patitotective> (edit) "monters" => "mosnsert"
21:27:57FromDiscord<!Patitotective> (edit) "mosnsert" => "monsters"
21:28:18FromDiscord<!Patitotective> one day they'll stab you from behind
21:29:06FromDiscord<Elegantbeef> You dont need to use global variables
21:29:18FromDiscord<!Patitotective> :]]]]]]]]]]]]]]]]
21:29:21FromDiscord<Elegantbeef> You can pass the channel as a `ptr Channel` if you heap allocate it with `createShared` but it's even uglier
21:29:33FromDiscord<!Patitotective> oh
21:31:16*wallabra joined #nim
21:37:05*wallabra quit (Ping timeout: 244 seconds)
21:43:50FromDiscord<!Patitotective> this now smooth https://media.discordapp.net/attachments/371759389889003532/1003417731221172335/ImNimble-3.mp4
21:44:28FromDiscord<neon_> In reply to @Patitotective "this now smooth": looks clean af
21:44:37FromDiscord<neon_> what are u using for the gui?
21:45:02FromDiscord<!Patitotective> imgui https://github.com/Patitotective/ImTemplate
21:46:03FromDiscord<#!/rip/luke> Instead of using downloadFile
21:46:13FromDiscord<#!/rip/luke> I used execShellCmd
21:46:16FromDiscord<#!/rip/luke> And wget
21:46:28FromDiscord<#!/rip/luke> It's not async which is good
21:46:51FromDiscord<Tuatarian> Anyone have any idea why linting with flycheck isn't working? Using spacemacs and nim-mode
21:47:02FromDiscord<!Patitotective> but it will only work if you have wget installed
21:47:09FromDiscord<Tuatarian> Am running on win10, happy to provide more info if needed
21:48:03FromDiscord<Elegantbeef> ... luke why not just `waitfor` the request?
21:48:22FromDiscord<#!/rip/luke> errors everywhere
21:48:32FromDiscord<Elegantbeef> What?!
21:48:57FromDiscord<#!/rip/luke> yup
21:49:04FromDiscord<!Patitotective> he says that and sends nothing
21:49:08FromDiscord<Elegantbeef> It's literally just `waitfor` instead of `await`
21:50:24FromDiscord<#!/rip/luke> In reply to @Patitotective "he says that and": Yup
21:50:28FromDiscord<#!/rip/luke> Give me a second
21:57:32FromDiscord<!Patitotective> what is better:↵- close and open the thread each time i want to run a process↵- keep the thread open and wait until it receives a process from a channel↵?
21:57:32FromDiscord<#!/rip/luke> Is it possible to export a var?
21:57:36FromDiscord<!Patitotective> yes
21:57:50FromDiscord<!Patitotective> not recommended at all
22:00:33FromDiscord<neon_> In reply to @Patitotective "what is better: -": probably opening and closing threads
22:00:56FromDiscord<neon_> if u open a thread and keep it waiting its still doing something even though that something is nothing
22:01:15FromDiscord<!Patitotective> 🤔
22:04:24*oprypin quit (Quit: Bye)
22:04:34*oprypin joined #nim
22:06:02FromDiscord<Hi02Hi> sent a code paste, see https://play.nim-lang.org/#ix=46hY
22:18:17FromDiscord<neon_> okay so i figured out then im building for windows the nim library has a conflicting decleration of WSAStartup one taking NI16 (which is just a signed short int) and the other as WORD (which is just 2 bytes so pretty much the same thing)
22:18:51FromDiscord<hotdog> In reply to @Patitotective "what is better: -": Keeping thread open will be fine as long as it's not busy looping waiting on the channel (let it sleep)
22:19:59FromDiscord<!Patitotective> In reply to @hotdog "Keeping thread open will": im doing a while true and then blocking it with `channel.recv`↵is that letting it sleep?
22:24:51*wallabra joined #nim
22:31:22FromDiscord<hotdog> In reply to @Patitotective "im doing a while": Yeah
22:34:49FromDiscord<!Patitotective> In reply to @hotdog "Yeah": and what happens when i want want to finish it? how do i do that?
22:36:50FromDiscord<hotdog> In reply to @Patitotective "and what happens when": Send a message on the channel and tell it to quit
22:36:59FromDiscord<hotdog> It can break the loop if it receives it
22:37:41FromDiscord<hotdog> I usually structure channel messages as an object variant, where one branch is a quit instruction
22:38:52FromDiscord<!Patitotective> 👍
22:38:54FromDiscord<!Patitotective> thanks
22:39:12FromDiscord<!Patitotective> btw how do i get the higest value of float32 that is not infinit?
22:39:13FromDiscord<!Patitotective> (edit) "infinit?" => "infinite?"
22:43:08FromDiscord<Prestige> float32.high
22:43:33FromDiscord<Prestige> huh or not
22:43:33FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46i9
22:43:58FromDiscord<Prestige> Well that is just a const for `0x7FF0000000000000'f64`
22:45:32FromDiscord<!Patitotective> !eval echo float32.high / 10000000000000000000000000000000000000f32
22:45:36NimBotinf
22:45:43FromDiscord<!Patitotective> nice
22:46:46FromDiscord<Prestige> Lol
22:46:56FromDiscord<Prestige> `9218868437227405312` in decimal
22:47:47FromDiscord<!Patitotective> i think ill just use `999999990` i dont think will ever fail with that number
22:47:52FromDiscord<!Patitotective> (edit) "`999999990`" => "`999999999`"
22:49:05FromDiscord<#!/rip/luke> Does Nim have an imgur api?
22:49:17FromDiscord<#!/rip/luke> Or anything where I can upload images
22:50:13FromDiscord<Prestige> I did it with curl, just needed an imgur application id. Just a POST
22:50:18FromDiscord<Prestige> `https://api.imgur.com/3/upload`
22:50:26FromDiscord<#!/rip/luke> Ok
22:52:27FromDiscord<Tuatarian> I can't seem to get linting working using nim-mode and flycheck/flymake on emacs
22:52:30FromDiscord<Tuatarian> anyone have any ideas?
22:53:21FromDiscord<!Patitotective> ~~vscode~~
22:55:49FromDiscord<Tuatarian> lmao
22:56:10FromDiscord<Tuatarian> I went on a month long trip where I had nothing other than a laptop, switched to emacs for fun, and can't switch back
22:56:25FromDiscord<Tuatarian> once you get a taste of mouseless editing it's genuinely hard to go back to gui
22:56:34FromDiscord<Tuatarian> much easier to just use the keyboard
22:56:40FromDiscord<#!/rip/luke> In reply to @Avahe "`https://api.imgur.com/3/upload`": Where do I put the application id
22:57:05FromDiscord<Prestige> for curl?
22:57:55FromDiscord<#!/rip/luke> Yea
22:58:13FromDiscord<Prestige> sent a code paste, see https://play.nim-lang.org/#ix=46id
22:58:23FromDiscord<#!/rip/luke> Ohk
22:58:44FromDiscord<#!/rip/luke> Image is a local file right?
22:59:01FromDiscord<!Patitotective> In reply to @iWonderAboutTuatara "once you get a": ive trying neovim but its so fricking hard to memorize so many shortcuts and moving with hjkl is so confusing
22:59:03FromDiscord<Prestige> Yeah you'd pass in the path to the script
22:59:18FromDiscord<!Patitotective> (edit) "In reply to @iWonderAboutTuatara "once you get a": ive ... trying" added "been"
22:59:30FromDiscord<#!/rip/luke> Ok
22:59:54FromDiscord<Elegantbeef> So use the arrow keys↵(@!Patitotective)
23:00:08FromDiscord<!Patitotective> thats not neovim 💀 💀
23:01:14FromDiscord<#!/rip/luke> In reply to @Patitotective "thats not neovim 💀": Yes it is
23:01:17FromDiscord<Prestige> It's...not neovim?
23:01:30FromDiscord<#!/rip/luke> Arrow keys work fine
23:01:40FromDiscord<Prestige> In reply to @Patitotective "ive been trying neovim": It's very worth it once you get the muscle memory
23:02:06FromDiscord<!Patitotective> In reply to @ripluke "Yes it is": theyre sooo far awayyy
23:02:13FromDiscord<#!/rip/luke> Ngl I memorized hjkl from the amount of wms that use it
23:02:35FromDiscord<Prestige> Don't use arrow keys if you're using neo/vim
23:02:56FromDiscord<!Patitotective> more like [neo]vim
23:03:47FromDiscord<#!/rip/luke> Wym
23:04:39FromDiscord<!Patitotective> In reply to @ripluke "Wym": that neo/vim means neo OR vim↵[neo]vim means vim and optionally neo
23:04:56FromDiscord<!Patitotective> (edit) "vim↵[neo]vim" => "vim↵while [neo]vim"
23:13:19FromDiscord<neon_> how do i override an internal library?
23:15:11FromDiscord<Elegantbeef> You can usse patchfile, but generally you dont
23:18:04FromDiscord<Tuatarian> In reply to @Patitotective "ive been trying neovim": hjkl you get used to after a couple hours
23:18:07FromDiscord<Tuatarian> the shortcuts are harder
23:18:18FromDiscord<Tuatarian> I would recommend spacemacs, it's a bit more intuitive in that sense
23:18:31FromDiscord<Tuatarian> and it has evil, so has many of the benefits of vim from modal editing
23:18:31FromDiscord<that_dude> In reply to @Patitotective "ive been trying neovim": I'd love to try to use vim more, but it doesn't work out with my keyboard layout
23:18:36FromDiscord<that_dude> It's kinda painful lol
23:18:44FromDiscord<Prestige> Wdym?
23:18:50FromDiscord<Tuatarian> yeah if you don't use qwerty you would have to rebind
23:18:58FromDiscord<that_dude> cv are up and down, jp are left and right iirc
23:19:03FromDiscord<Prestige> I use dvorak, and didn't rebind. It's fine
23:19:09FromDiscord<Tuatarian> where do they end up?
23:19:27FromDiscord<that_dude> I use dvorak too lol
23:19:33FromDiscord<Tuatarian> hjkl navigation with dvorak is not usable
23:19:40FromDiscord<Tuatarian> you would want to rebind them
23:19:51FromDiscord<Prestige> it's usable, I use it just fine. Rebinding would be a pain to do
23:19:58FromDiscord<Tuatarian> how?
23:20:02FromDiscord<Tuatarian> they're nowhere near one another
23:20:10FromDiscord<Prestige> They don't need to be
23:20:28FromDiscord<Tuatarian> I guess not
23:20:37FromDiscord<Tuatarian> yeah I guess they don't
23:20:45FromDiscord<Prestige> jk is right below left home row, h and l and right by the right home row
23:21:09FromDiscord<Tuatarian> yeah I guess it's fine
23:21:15FromDiscord<Tuatarian> seems like it would take a bit to get used to though
23:21:25FromDiscord<Prestige> just about as much as learning vim does, lol
23:21:58FromDiscord<that_dude> True
23:29:04*rockcavera joined #nim
23:29:04*rockcavera quit (Changing host)
23:29:04*rockcavera joined #nim
23:31:20*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
23:34:08*Lord_Nightmare joined #nim
23:41:51*krux02 quit (Remote host closed the connection)
23:45:23FromDiscord<Prestige> I'm addicted to vim keybindings now, though. Can't use a "normal" text editor to save my life
23:46:00madpropsi never liked vim keybindings
23:46:20madpropsdo you even use hjkl ?
23:48:05madpropsalso*
23:48:26FromDiscord<Prestige> Yep
23:49:00FromDiscord<!Patitotective> In reply to @Avahe "I'm addicted to vim": sublime has a plugin to behave exactly as neo vim
23:52:02FromDiscord<Prestige> You mean just the keybindins?
23:52:05FromDiscord<Prestige> (edit) "keybindins?" => "keybindings?"
23:52:30FromDiscord<!Patitotective> https://github.com/lunixbochs/actualvim
23:53:11FromDiscord<!Patitotective> > _Issues are closed_↵lmao
23:53:33FromDiscord<Prestige> Seems pointless lol