<< 17-07-2022 >>

00:00:36FromDiscord<Dale> I mean, will the ISP even allow that packet to travel?
00:00:45FromDiscord<Dale> Who the hell uses TCP for 1GB transfers
00:01:21FromDiscord<creikey> In reply to @Dale "Who the hell uses": trolls
00:01:31FromDiscord<Dale> > The absolute limitation on TCP packet size is 64K (65535 bytes), but in practicality this is far larger than the size of any packet you will see, because the lower layers (e.g. ethernet) have lower packet sizes.
00:01:31FromDiscord<creikey> In reply to @Dale "I mean, will the": relying on isp for ddos protection
00:01:43FromDiscord<creikey> well nim recv buffers
00:01:53FromDiscord<creikey> until the size specified is received
00:02:00FromDiscord<creikey> so the problem is in websockets you can say in your header you're sending a 1 gigabyte packet
00:02:17FromDiscord<creikey> and then the server will stall waiting for all those packets forver
00:02:18FromDiscord<creikey> (edit) "forver" => "for3ver"
00:02:20FromDiscord<creikey> (edit) "for3ver" => "forever"
00:02:30FromDiscord<creikey> which is why I PR'd to add a maximum
00:02:39FromDiscord<Dale> Websocket is implemented using TCP
00:02:49FromDiscord<creikey> yeah
00:03:57FromDiscord<Dale> Can you not just reject the packet after inspecting the header?
00:04:06FromDiscord<Dale> and close the connection if you want
00:04:07FromDiscord<creikey> In reply to @Dale "Can you not just": yeah this is what my PR was
00:04:15FromDiscord<creikey> raise an exception if the header size is too big
00:04:35FromDiscord<creikey> https://github.com/treeform/ws/pull/40
00:04:46FromDiscord<creikey> but I guess you just need to use cloudflare or something to stop that?
00:06:10FromDiscord<Dale> 1MiB is a massive packet size for the default. I guess it's pretty roomy, which you might want for a default though
00:06:26FromDiscord<creikey> I have a feeling treeform is too busy for this to get merged though
00:06:39FromDiscord<creikey> isn't there an easy way to ship your own nim library in the repo
00:06:41FromDiscord<creikey> and have nimble use it
00:06:44FromDiscord<creikey> I know you can nimble develop
00:06:56FromDiscord<Elegantbeef> fork it then replace the package name with the giturl
00:07:05FromDiscord<creikey> cool
00:07:36FromDiscord<Elegantbeef> Nimble is decentralised so you can use any git/mercurial URL
00:07:42FromDiscord<Dale> I think your error message could be worded better. `Incoming packet size of {size} exceeds maxPacketSize`
00:07:59FromDiscord<Dale> (edit) "maxPacketSize`" => "maxPacketSize {maxPacketSize}`"
00:08:02FromDiscord<creikey> I've had a good experience with nimble so far
00:08:12FromDiscord<Elegantbeef> Personally i'd suggest `const maxPacketSize {.intdefine.} = 1024 1024`
00:08:14FromDiscord<creikey> no 8 billion dependencies
00:08:21FromDiscord<Elegantbeef> or i guess `wsMaxPacketSize`
00:08:31FromDiscord<creikey> In reply to @Elegantbeef "Personally i'd suggest `const": why constant in the module? then you can't set it as a user of the library
00:08:48FromDiscord<Elegantbeef> this way someone can do `-d:wsMaxPacketSize: 1024`
00:08:49FromDiscord<creikey> maybe you want to send large files over websockets
00:08:52FromDiscord<Elegantbeef> I dont know i'm silly and dont think this needs to be dynamic
00:09:04FromDiscord<creikey> In reply to @Elegantbeef "this way someone can": you can do this??
00:09:05FromDiscord<creikey> wild
00:09:07FromDiscord<Dale> Well you might have multiple sockets for different uses
00:09:15FromDiscord<Elegantbeef> Yea there's that
00:09:25FromDiscord<Dale> Yeah you can set compile time constants that way
00:09:37FromDiscord<Elegantbeef> Yes you can do `{.intdefine.}` and `{.strdefine.}`
00:09:45FromDiscord<Elegantbeef> Dont recall if there is a `{.floatdefine.}`
00:10:27FromDiscord<Dale> I'm using it to store info about the machine the program was compiled on (mostly for fun haha)
00:10:55FromDiscord<Elegantbeef> The thing is though if you use a const instead of ` = 1024 1024` you can set it globally if you want
00:11:10FromDiscord<Dale> Why not both
00:11:14FromDiscord<Elegantbeef> This way you dont need to manually do `recieve(mySocket, maxPacketSize)` if you want it to be the same globally
00:11:16FromDiscord<Dale> So have a const for the default
00:11:24FromDiscord<Elegantbeef> That's what i'm saying
00:11:27FromDiscord<Dale> and then when you create the object set it to the default
00:11:43FromDiscord<Dale> Ah
00:46:57FromDiscord<Arathanis> In reply to @Elegantbeef "Dont recall if there": i think there is only `intdefine`, `strdefine`, and `booldefine` pragmas iirc
00:47:05FromDiscord<Arathanis> (edit) "is" => "are"
00:47:48FromDiscord<Arathanis> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas
00:47:58FromDiscord<Arathanis> yeha just those 32
00:47:59FromDiscord<Arathanis> (edit) "32" => "3"
00:49:28FromDiscord<Elegantbeef> You can pretty much get any from those though
00:53:29FromDiscord<Arathanis> agreed
00:53:34FromDiscord<Arathanis> strdefine can be whatever you want
00:53:35FromDiscord<Arathanis> really
01:19:40*TakinOver joined #nim
01:40:50*TakinOver quit (Ping timeout: 240 seconds)
01:44:58*TakinOver joined #nim
02:11:02FromDiscord<# Luke> Is there a guide to threads for dummies?
02:11:05FromDiscord<# Luke> I need it lol
02:12:15FromDiscord<Elegantbeef> 1. use channels↵2. use locks and guard pragma↵3. git gud
02:12:52FromDiscord<# Luke> Idk if you're talking about discord threads or nim ones 😄
02:13:08FromDiscord<Elegantbeef> Why would i talk about Discord threads
02:13:18FromDiscord<Elegantbeef> Channels are a way to pass data between threads
02:13:21FromDiscord<# Luke> Ah
02:13:37FromDiscord<Elegantbeef> you can ensure resources are always safely guarded with the guard pragma
02:14:06FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/ZHh
02:14:16FromDiscord<Elegantbeef> If you attempt to do `myvar` without acquiring `myLock` it'll be a compiletime error
02:14:34FromDiscord<# Luke> So let's say I'm looping over all the pixels in an image, can I spinup like 10 threads and have each one of them do 1 share of the pixels
02:15:00FromDiscord<# Luke> So on theory it would be 10 times as fast?
02:15:04FromDiscord<Elegantbeef> No
02:15:10FromDiscord<# Luke> Oh
02:15:17FromDiscord<Rika> If you can orchestrate the work sure
02:15:34FromDiscord<Elegantbeef> Threads have a spool up time and context switching can be a bitch
02:15:35FromDiscord<Rika> Does the work on some pixels depend on the work on other pixels
02:15:41FromDiscord<Rika> In reply to @Elegantbeef "Threads have a spool": He said in theory
02:15:45FromDiscord<Rika> In practice that applies
02:16:05FromDiscord<# Luke> In reply to @Rika "Does the work on": Nope
02:16:11FromDiscord<Elegantbeef> I dont imagine ripluke actually cares about theory but is using it as a phrase
02:16:20FromDiscord<treeform> In reply to @ripluke "So let's say I'm": I have an example that does this for my threading library: https://github.com/treeform/thready#tutorial---pixie
02:16:22FromDiscord<Rika> “In essence” then
02:16:42FromDiscord<# Luke> In reply to @treeform "I have an example": o.O
02:17:08FromDiscord<treeform> In reply to @ripluke "o.O": My threading library is not ready yet, and might have bugs.
02:17:19FromDiscord<Rika> If your image is sufficiently large enough for the work to be much longer than the time taken to start a thread then the limit of your speed up is roughly 10 given context switching is optimal as well lol
02:17:29FromDiscord<# Luke> In reply to @treeform "My threading library is": Yea my program probably has many of those
02:19:19FromDiscord<# Luke> In reply to @Rika "If your image is": Well without threading I get about a 2-3 minute wait
02:19:34FromDiscord<# Luke> For a 1080p image
02:19:43FromDiscord<Rika> What the hell are you doing
02:19:55FromDiscord<Rika> I think there are better ways to improve the speed
02:20:03FromDiscord<# Luke> In reply to @Rika "What the hell are": Alot, I can send the code lol
02:20:10FromDiscord<Rika> Repo
02:20:19FromDiscord<# Luke> Ye can do that too
02:20:26FromDiscord<Elegantbeef> Are you even on release
02:20:26FromDiscord<Elegantbeef> What are you doing
02:20:40FromDiscord<# Luke> In reply to @Elegantbeef "Are you even on": Yes
02:20:50FromDiscord<# Luke> In reply to @Elegantbeef "What are you doing": Kinda hard to explain
02:21:09FromDiscord<Elegantbeef> You're not waiting 2-3 minutes to iterate 1080p
02:21:55FromDiscord<# Luke> Ah git is being a bitch
02:22:12FromDiscord<# Luke> I'll just make a new repo
02:22:21FromDiscord<treeform> What are you doing that it takes 3min to do a 1080p? Ray tracing?
02:22:30FromDiscord<treeform> Machine Learning?
02:23:13FromDiscord<# Luke> Well I have a list of like 20 colors, and I use a for loop to find the closest color to the current pixel color, then I set the color
02:23:22FromDiscord<# Luke> This is repeated for every pixel
02:23:29FromDiscord<Elegantbeef> that's not that many pixels even for a shitty device to iterate
02:23:31FromDiscord<Elegantbeef> A pentium 2 could iterate it faster!
02:23:31FromDiscord<Elegantbeef> I have a feeling you're copying a lot
02:23:32FromDiscord<Elegantbeef> Are you using `[a..b]` any?
02:23:33FromDiscord<Elegantbeef> provide code at your earliest convience
02:23:43FromDiscord<# Luke> In reply to @Elegantbeef "*provide code at your": Yes
02:24:30FromDiscord<Elegantbeef> Matrix bridge moment
02:24:31FromDiscord<treeform> You are doing some thing like this? https://media.discordapp.net/attachments/371759389889003532/998052548734890075/unknown.png
02:25:09FromDiscord<treeform> That should be really fast... no threads required.
02:25:21FromDiscord<# Luke> In reply to @Elegantbeef "*provide code at your": https://github.com/Infinitybeond1/dye-src
02:25:26FromDiscord<# Luke> heres the code
02:25:41FromDiscord<creikey> yeah the other day I wrote a for loop to flip an image and swap r and b channels unoptimized debug it was like 50 ms
02:26:00FromDiscord<# Luke> Ohh I'm in debug
02:26:10FromDiscord<# Luke> I'll benchmark release
02:26:23FromDiscord<creikey> In reply to @ripluke "Ohh I'm in debug": comment out the bar update
02:26:27FromDiscord<creikey> and see how fast it is
02:26:32FromDiscord<creikey> https://github.com/Infinitybeond1/dye-src/blob/main/src/dye.nim#L85 this
02:26:36FromDiscord<# Luke> In reply to @creikey "comment out the bar": Oh
02:26:43FromDiscord<ElegantBeef> Bridge is dumb
02:26:45FromDiscord<# Luke> Lol I copied off the readme
02:26:47FromDiscord<ElegantBeef> Why are you copying the image
02:26:54FromDiscord<Elegantbeef> Why are you copying the image
02:27:16FromDiscord<ElegantBeef> Line 32 is a useless operation
02:27:28FromDiscord<creikey> that's not what's taking the time though
02:27:31FromDiscord<creikey> it's probably the bar update
02:27:33FromDiscord<# Luke> In reply to @ElegantBeef "Line 32 is a": Oh
02:27:36FromDiscord<creikey> that's like printing every iteration
02:27:43FromDiscord<ElegantBeef> I mean copying a 1080p image isnt helpful either
02:27:49FromDiscord<ElegantBeef> if we're after speed
02:27:56FromDiscord<ElegantBeef> I'm reading code top to bottom 😛
02:28:09FromDiscord<creikey> I'm doing middle out
02:28:16FromDiscord<# Luke> In reply to @ElegantBeef "I mean copying a": Oh
02:28:18FromDiscord<ElegantBeef> Tip to tip?
02:28:24FromDiscord<creikey> In reply to @ElegantBeef "Tip to tip?": yeah fastest way to read nim code
02:28:37FromDiscord<ElegantBeef> Just remember girth matters
02:28:46FromDiscord<# Luke> It does?
02:28:55FromDiscord<creikey> In reply to @ripluke "It does?": depends who you talk to
02:29:01FromDiscord<# Luke> Lol
02:29:17FromDiscord<creikey> uh oh https://media.discordapp.net/attachments/371759389889003532/998053744883277825/unknown.png
02:29:20FromDiscord<ElegantBeef> Cant to tell who's watched the first season of silicon valley
02:29:25FromDiscord<ElegantBeef> (edit) removed "to"
02:29:54FromDiscord<# Luke> In reply to @creikey "comment out the bar": Bar doesn't work anymore💀
02:30:01FromDiscord<creikey> is it fast
02:30:04FromDiscord<creikey> delete all bar
02:30:06FromDiscord<ElegantBeef> You will need an update before the `finish` no?
02:30:13FromDiscord<# Luke> Yea
02:30:34FromDiscord<treeform> This operation should be so fast I doubt you need a bar.
02:30:44FromDiscord<creikey> adding the bar to show progress it what makes it slow lol
02:30:54FromDiscord<# Luke> In reply to @creikey "adding the bar to": Ohh
02:31:06FromDiscord<treeform> I would use `image[x, y] = color` instead of `image.setColor(...)`
02:31:21FromDiscord<ElegantBeef> IO is slow do the least you can
02:31:22FromDiscord<# Luke> In reply to @treeform "I would use `image[x,": K
02:31:46FromDiscord<treeform> and if you want more speed and you know you are never out of bounds, you can use `image.unsafe[x, y] = color` but if you go out of bounds you would just write random memory
02:31:47FromDiscord<# Luke> In reply to @ElegantBeef "IO is slow do": Bar is useful, so I might make a flag to disable it
02:32:00FromDiscord<ElegantBeef> I mean if you want to use the bar update it each horizontal line
02:32:08FromDiscord<# Luke> I got the speed to under a minute tho!
02:32:08FromDiscord<ElegantBeef> so outside your second for loop
02:32:23FromDiscord<ElegantBeef> So instead of 1920 1080 calls you just do 1080 calls
02:32:48FromDiscord<# Luke> In reply to @ElegantBeef "So instead of 1920": Oh
02:33:08NimEventerNew Nimble package! nage - Not Another Game Engine; CLI text adventure engine, see https://github.com/acikek/nage
02:33:44FromDiscord<Elegantbeef> Hmm bridge seems fine now
02:33:55FromDiscord<# Luke> In reply to @ripluke "I got the speed": I'll make a bar disabled mode tho just to see how much I can improve it
02:34:06FromDiscord<treeform> In reply to @ripluke "Oh": also it looks like you are making a command line app, I recommend using this library https://github.com/c-blake/cligen to parse the command line arguments for you.
02:35:03FromDiscord<# Luke> Hmm I'll check that out o.O
02:35:23FromDiscord<# Luke> I found docopt quite convenient tho
02:35:24FromDiscord<Elegantbeef> Oh when i suggest it you ignore me
02:35:27FromDiscord<Elegantbeef> But when treeform does....
02:35:39FromDiscord<treeform> well I am me 🙂
02:35:50FromDiscord<# Luke> In reply to @Elegantbeef "Oh when i suggest": When did u suggest it lol
02:36:15FromDiscord<# Luke> I didn't know that it was the best arg parser lol
02:36:34FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/998055582806319144/image.png
02:37:02FromDiscord<# Luke> In reply to @Elegantbeef "image.png": Oh well I think I only read the argparse one 💀
02:37:09FromDiscord<Elegantbeef> Well open your fucking eyes
02:37:39FromDiscord<Elegantbeef> one day i'll actually be angry and no one will know
02:38:00FromDiscord<treeform> that's your secret, you are always angry
02:38:06FromDiscord<Elegantbeef> "fucking eyes"\
02:38:06FromDiscord<# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44y6
02:38:20FromDiscord<# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44y7
02:38:21FromDiscord<# Luke> In reply to @Elegantbeef ""fucking eyes"\*": lol
02:38:48FromDiscord<Elegantbeef> Only on days that end with y↵(@treeform)
02:40:01FromDiscord<# Luke> lmao
02:40:27FromDiscord<treeform> In reply to @ripluke "I got the speed": you might also want to switch to Y first: `for y in ...: for x in ...` for cache locality and speed.
02:40:46FromDiscord<treeform> So that the access pattern is linear.
02:40:53FromDiscord<# Luke> ok
02:41:12FromDiscord<# Luke> also is there any way that i can get my closest color function any faster?
02:41:25FromDiscord<# Luke> its in the lib/colors.nim file
02:41:51FromDiscord<Elegantbeef> Cause why wouldnt it be in src
02:42:11FromDiscord<treeform> In reply to @ripluke "also is there any": yes you are parsing HTML color every pixel, parse them in a table and store them.
02:42:11FromDiscord<# Luke> In reply to @Elegantbeef "Cause why wouldnt it": i want it organized lol
02:42:27FromDiscord<Elegantbeef> So make another folder in source
02:42:33FromDiscord<Elegantbeef> `colors.nim` is source
02:42:49FromDiscord<# Luke> might move lib to src
02:42:49FromDiscord<treeform> The `parseHex()` does a lot of work. You don't want to do that over and over.
02:43:05FromDiscord<Elegantbeef> Compute everything you can ahead of time
02:43:18FromDiscord<# Luke> In reply to @treeform "yes you are parsing": so do i parse them, then put them in a table lol
02:43:22FromDiscord<Elegantbeef> Caching results is best way to save performance
02:43:26FromDiscord<Elegantbeef> Do you even need a table
02:43:32FromDiscord<Elegantbeef> Isnt it just an array?
02:43:41FromDiscord<# Luke> In reply to @Elegantbeef "Caching results is best": ohh yea
02:43:51FromDiscord<# Luke> that could be good
02:44:06FromDiscord<Elegantbeef> So parse the colours into a `seq[Color`
02:44:11FromDiscord<Elegantbeef> then you're going to vrooooom
02:44:20FromDiscord<Elegantbeef> Also what the hell is this `getFileName`
02:44:25FromDiscord<Elegantbeef> Cmon ripluke
02:44:44FromDiscord<Elegantbeef> Stop using `strip`
02:44:46FromDiscord<treeform> In reply to @ripluke "might move lib to": So yeah, you don't need threads, you just need to not update progress bar, not parse a bunch of colors every pixel.
02:44:53FromDiscord<Elegantbeef> https://nim-lang.org/docs/os.html#extractFilename%2Cstring
02:45:07FromDiscord<# Luke> oh
02:45:18FromDiscord<# Luke> yea thats probably alot better
02:45:27FromDiscord<# Luke> In reply to @treeform "So yeah, you don't": yea
02:45:51FromDiscord<Elegantbeef> Only use split if you want to split a string, if you dont want to split a string there are better tools
02:46:53FromDiscord<Elegantbeef> Not only is it a happy allocating function it's also a very ugly way to solve problems
02:47:27FromDiscord<# Luke> In reply to @Elegantbeef "Not only is it": oh
02:53:03FromDiscord<treeform> so did you make it instant yet?
02:56:09FromDiscord<# Luke> not yet, still working on the bar
02:56:20FromDiscord<# Luke> but got it to 60s
03:05:50*noeontheend quit (Ping timeout: 260 seconds)
03:07:08FromDiscord<Rika> What happened I just took a shower lol
03:07:24FromDiscord<Rika> How’s your 3 minute algorithm 😛
03:07:44FromDiscord<# Luke> In reply to @Rika "What happened I just": intense optomization
03:08:01FromDiscord<# Luke> In reply to @Rika "How’s your 3 minute": now its a 1 minute algo XD
03:08:11FromDiscord<Rika> Still kinda bad
03:08:24FromDiscord<# Luke> yea
03:08:31FromDiscord<Rika> Something that is independent of pixels should run nearly instantaneously haha
03:08:51FromDiscord<Rika> Sounds like it’s time to move to a fragment shader 😛
03:08:55FromDiscord<# Luke> thats why im working on making opt ins like the progress bar
03:09:07FromDiscord<# Luke> the prog bar is slow af
03:09:10FromDiscord<Rika> You don’t need a progress bar if it’s instant
03:09:25FromDiscord<# Luke> hmm thats actually a really good point
03:09:27FromDiscord<Rika> Is this my library? Or some other progress bar
03:09:37FromDiscord<Elegantbeef> it's suru
03:09:41FromDiscord<# Luke> idk its this one i found called suru
03:09:55FromDiscord<# Luke> idek who made it XD
03:10:04FromDiscord<Elegantbeef> I think that's rika's
03:10:18FromDiscord<# Luke> oh lol
03:10:21FromDiscord<# Luke> lemme check
03:10:28FromDiscord<Elegantbeef> Hard to tell the inane anime characters with a forgettable name merges together
03:10:28FromDiscord<Rika> I recall my library not being that slow
03:10:34FromDiscord<Rika> I’m de-odex yes
03:10:39FromDiscord<Rika> In reply to @Elegantbeef "Hard to tell the": Lol
03:11:15FromDiscord<# Luke> In reply to @Rika "I’m de-odex yes": ooohhhh lol thats why i didnt think anything about it
03:11:17FromDiscord<Rika> I’d prolly forget your name as well if you had not been active, beef
03:11:36FromDiscord<Rika> And it’s not like a dog is any better honestly
03:11:50FromDiscord<Elegantbeef> My github profile picture is a slice of beef so checkmate
03:11:53FromDiscord<creikey> I feel like this ws code is bad is this code bad https://media.discordapp.net/attachments/371759389889003532/998064471656378388/unknown.png
03:11:56FromDiscord<# Luke> wait beef is your dog named beef?
03:12:01FromDiscord<Elegantbeef> No
03:12:04FromDiscord<# Luke> oh
03:12:17FromDiscord<Elegantbeef> That's some nesting↵(@creikey)
03:12:31FromDiscord<creikey> In reply to @Elegantbeef "That's some nesting (<@180866243819995136>)": yeah I'm getting code smell
03:12:38FromDiscord<Elegantbeef> Can we see the entire function
03:12:40FromDiscord<Elegantbeef> in raw text
03:12:43FromDiscord<Rika> In reply to @Elegantbeef "My github profile picture": Okay I guess I’d remember that
03:12:53FromDiscord<creikey> In reply to @Elegantbeef "Can we see the": I'm going to expose how insecure my server is
03:12:54FromDiscord<# Luke> In reply to @creikey "I feel like this": to my ameture eyes it doesnt look too bad lmao
03:12:58FromDiscord<creikey> security by obfuscation
03:13:10FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/998064793565016064/message.txt
03:13:12FromDiscord<creikey> here is the entire function right now
03:13:15FromDiscord<creikey> (edit) "function" => "file"
03:13:18FromDiscord<creikey> server between godot and nim
03:14:35FromDiscord<creikey> this feels like beginner nim code it doesn't look like a treeform library
03:15:34FromDiscord<Rika> Aren’t you a beginner at Nim
03:15:36FromDiscord<Rika> I forget
03:15:41FromDiscord<creikey> In reply to @Rika "Aren’t you a beginner": I would say so yeah
03:15:48FromDiscord<creikey> it's only been like 8 months and I haven't written that much code
03:16:21FromDiscord<Rika> You should collapse the error and web socket send lines into one proc or template
03:16:48FromDiscord<creikey> the code where I check the validity of the message sent?
03:16:54FromDiscord<creikey> like that the username is != "" etc
03:17:04FromDiscord<creikey> and then send an error message
03:17:15FromDiscord<Rika> No
03:17:23FromDiscord<Rika> Just the error web socket send part
03:17:52FromDiscord<Rika> Shouldn’t the error raise instead of return? Or are you using a different kind of error handling system
03:17:56FromDiscord<Elegantbeef> Raise an exception with the message you want to send and handle it in your exception handling
03:18:05FromDiscord<Elegantbeef> No they handle exceptions at the bottom of that function
03:18:28FromDiscord<creikey> In reply to @Elegantbeef "Raise an exception with": Interesting
03:18:47FromDiscord<creikey> I mean I want separate messages in the log and what I send to the client
03:19:03FromDiscord<creikey> this would just change asyncCheck ws.send into raise
03:19:30FromDiscord<Elegantbeef> you can do something like `raise (ref MessageError)(msg: "Sent Message is too large", userMsg: "Received message too large from client")`
03:19:47FromDiscord<creikey> makes sense
03:20:05FromDiscord<Rika> Exceptions can hold more data than just a message if you declare more fields in them
03:20:06FromDiscord<Elegantbeef> Then in your exception handling you can do `error myError.userMsg` and `ws.send myError.msg`
03:20:14FromDiscord<creikey> you can do newException though right
03:20:20FromDiscord<Rika> Yes but I don’t recommend it
03:20:21FromDiscord<Elegantbeef> Not with more fields
03:20:26FromDiscord<Elegantbeef> `newException` only works with `msg`
03:20:28FromDiscord<Rika> You can’t put the extra fields yes
03:20:46FromDiscord<Elegantbeef> You can always make a procedure for your message error
03:21:27FromDiscord<Rika> I recommend "nexcMsg" to fuck with people i am joking
03:21:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44ya
03:21:47FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=44yb
03:21:58FromDiscord<creikey> what would make this code simpler is if I could just have like curPlayer instead of lobbyCodeIn and playerID
03:22:03FromDiscord<Elegantbeef> then you can just do `raise messageError("get fucked bud", "yea that tosspot tried to cheat")`
03:22:11FromDiscord<creikey> In reply to @Elegantbeef "then you can just": lol
03:22:31FromDiscord<creikey> In reply to @creikey "what would make this": nevermind this doesn't make sense
03:22:43FromDiscord<creikey> wait yeah it does I can do ref player
03:22:45FromDiscord<Elegantbeef> Anyway that makes your code much cleaner
03:24:04FromDiscord<creikey> what is this this field is in aother object https://media.discordapp.net/attachments/371759389889003532/998067535767416853/unknown.png
03:24:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44yc
03:24:18FromDiscord<Elegantbeef> Exceptiion has `msg`
03:24:24FromDiscord<Elegantbeef> You're using inheritance
03:24:24FromDiscord<creikey> In reply to @Elegantbeef "If you really wanted": this is pretty nice
03:24:31FromDiscord<creikey> In reply to @Elegantbeef "You're using inheritance": ohh it's already calle dmsg
03:24:33FromDiscord<creikey> (edit) "calle dmsg" => "called msg"
03:24:35FromDiscord<creikey> in Exception
03:24:38FromDiscord<Elegantbeef> Yes
03:25:22FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/998067864911220837/unknown.png
03:25:25FromDiscord<creikey> I like this
03:25:27FromDiscord<creikey> much cleaner
03:25:41FromDiscord<creikey> how to make this refactor in a vim macro
03:25:50FromDiscord<Elegantbeef> Welcome to metaprogramming to make more wonderful code
03:26:02FromDiscord<Elegantbeef> Oh you have a bug
03:26:09FromDiscord<Elegantbeef> `userMsg: userMsg` isnt what you want
03:26:23FromDiscord<Elegantbeef> templates replace all instances of the template parameter names
03:26:33FromDiscord<Elegantbeef> so that'll replace `userMsg` with whatever you pass for `userMsg`
03:26:48FromDiscord<creikey> ohhh
03:26:50FromDiscord<creikey> it does string replace?
03:26:51FromDiscord<Elegantbeef> in the case you pass `"hello"` it'll put `"hello": "hello"`
03:26:56FromDiscord<creikey> interesting
03:26:59*arkurious quit (Quit: Leaving)
03:27:01FromDiscord<Elegantbeef> It does identifier replace
03:27:12FromDiscord<Elegantbeef> It doesnt care about the AST if the identifiers match it's the parameter
03:28:46FromDiscord<creikey> nice
03:28:49FromDiscord<Elegantbeef> Hmm does async work with raises annotations...
03:29:10FromDiscord<Elegantbeef> If it does you could also annotate you proc with `{.raises: [].}` to ensure you handle all exceptions
03:29:42FromDiscord<huantian> I don't think so
03:30:03FromDiscord<Elegantbeef> I do find the `return` inside the `JsonError` handling cute
03:30:48FromDiscord<Elegantbeef> finally the correct way to get information from an exception is `except WebSocketError as wse` and then `w.msg`
03:31:05FromDiscord<Elegantbeef> `getCurrentException` and `getCurrentExceptionMsg` should be avoided
03:31:21FromDiscord<Elegantbeef> `wse.msg`\
03:31:43FromDiscord<creikey> In reply to @Elegantbeef "I do find the": deleted that
03:32:18FromDiscord<creikey> what's bothering me about this right now is there are probably logic errors in this I just can't see because of how it's architected
03:32:24FromDiscord<creikey> like I caught a few bugs like that
03:32:41FromDiscord<creikey> where I just missed a field or missed a failure case in one of the messages
03:33:17FromDiscord<Elegantbeef> You can always make each branch a procedure if you want to make it less noisey
03:34:18FromDiscord<Elegantbeef> I guess "finally" wasnt so final
03:34:29FromDiscord<creikey> In reply to @Elegantbeef "You can always make": I kinda don't like this because it adds function noise
03:34:30FromDiscord<creikey> to the file
03:34:34FromDiscord<Elegantbeef> Why the hell dont you just do `let emptyLobbyCode = lobbyCodeIn.len == 0`
03:34:57FromDiscord<creikey> ? what
03:35:27FromDiscord<creikey> why would I put that in a variable when it's only used oncd
03:35:28FromDiscord<creikey> (edit) "oncd" => "once"
03:36:29FromDiscord<Elegantbeef> You have so many `lobbyCodeIn` comparisons
03:36:30FromDiscord<Elegantbeef> That's bound to cause bugs
03:36:30FromDiscord<Elegantbeef> `if not emptyLobbyCode` and `if emptyLobbyCode` will reduce logical errors
03:36:30FromDiscord<Elegantbeef> Cache whether your `lobbyCodeIn` is empty at the start of the iteration to remove all the `!= ""`
03:36:42FromDiscord<Elegantbeef> It's not only used once
03:36:49FromDiscord<Elegantbeef> You compare it so many bloody times
03:37:06FromDiscord<creikey> oh yeah in the main body
03:37:14FromDiscord<Elegantbeef> You compare it 5 times
03:37:32FromDiscord<Elegantbeef> Guess 4 inside the while loop
03:37:55FromDiscord<creikey> I'll make `hasJoinedLobby()`
03:38:47FromDiscord<# Luke> Does chroma have a way to swap luminance?
03:40:10FromDiscord<Rika> Swap as in?
03:41:26FromDiscord<# Luke> Like increment it or something
03:47:32FromDiscord<sharpcdf> hey beef do you know if its possible to run tasks in a `.nims` file
03:47:39FromDiscord<sharpcdf> i asked earlier but nobody really knew
03:47:51FromDiscord<sharpcdf> i know you can do it in nimble files but what about just plain nimscript
03:48:24FromDiscord<sharpcdf> i tried doing it before but nothing really worked
03:49:38FromDiscord<sharpcdf> can it only be in config.nims or something
03:50:06FromDiscord<sharpcdf> also is it possible to change the name of the nimscript to something other than config
03:53:45FromDiscord<Elegantbeef> I told you it's `nim taskname` iirc
03:54:10FromDiscord<Elegantbeef> it should be `config.nims` or `mymainmodule.nims`
04:04:49FromDiscord<sharpcdf> ah ok
04:06:01FromDiscord<sharpcdf> In reply to @Elegantbeef "it should be `config.nims`": it doesnt work when i set it to the main module :/
04:06:14FromDiscord<Elegantbeef> Is it next to the file?
04:06:17FromDiscord<sharpcdf> yea
04:06:38FromDiscord<sharpcdf> im assuming its because im trying to use a task `build`?
04:06:49FromDiscord<sharpcdf> it just uses the default build task
04:06:55FromDiscord<sharpcdf> wait
04:07:10FromDiscord<sharpcdf> ok i set the task to a different name still doesnt work
04:07:12FromDiscord<Elegantbeef> Actually it doesnt have a main module
04:07:21FromDiscord<Elegantbeef> So it has to be `config.nims`
04:07:26FromDiscord<sharpcdf> rip
04:07:34FromDiscord<sharpcdf> i kinda wish there was a way to have a custom name :/
04:07:37FromDiscord<# Luke> Can I swap the luminance of an image?
04:07:39FromDiscord<Rika> How would that work
04:07:45FromDiscord<Rika> You’d have two configuration files then
04:07:58FromDiscord<sharpcdf> a custom name for `config.nims`
04:08:03FromDiscord<Elegantbeef> Make a `myother.nim` and include or import it 😄↵(@sharpcdf)
04:08:11FromDiscord<Elegantbeef> And how would you tell Nim what config file to use?
04:08:18FromDiscord<Rika> In reply to @sharpcdf "a custom name for": That’s what I mean
04:08:18FromDiscord<Elegantbeef> A config file for your config file
04:08:22FromDiscord<sharpcdf> oh yea true
04:08:31FromDiscord<Rika> How would you specify it? In another configuration file?
04:08:37FromDiscord<sharpcdf> maybe just if the first .nims file it finds?
04:08:45FromDiscord<Rika> What’s the “first”
04:08:54FromDiscord<Rika> Alphabetical? Size? Modification time?
04:09:00FromDiscord<# Luke> In reply to @ripluke "Can I swap the": Something like what rust has with invert_luminance
04:09:09FromDiscord<# Luke> (edit) "invert_luminance" => ".invert_luminance()"
04:09:09FromDiscord<sharpcdf> it goes through the directory recursively until it finds a .nims file
04:09:15FromDiscord<sharpcdf> alphabetical ig lol
04:09:20FromDiscord<Elegantbeef> Rika the solution is dot product of the hash to the hash of the nim compiler
04:09:25FromDiscord<sharpcdf> idk i just think it would be nice to have
04:09:38FromDiscord<Elegantbeef> And if it finds two it doesnt do anything
04:09:38FromDiscord<Elegantbeef> I think `config.nims` is a better heuristic
04:09:47FromDiscord<sharpcdf> In reply to @Elegantbeef "Make a `myother.nim` and": what do you mean by that
04:09:50FromDiscord<Rika> I do as well
04:09:57FromDiscord<Elegantbeef> It's in the CWD and a commonality between all projects
04:09:57FromDiscord<sharpcdf> import a nim file into the nimscript?
04:10:15FromDiscord<Elegantbeef> If you need a config you have a `config.nims` instead of a `somefile.nims`
04:10:15FromDiscord<Elegantbeef> Yes
04:10:28FromDiscord<Elegantbeef> It's easier to audit when flags and shit are set from a single point
04:10:50FromDiscord<Elegantbeef> Say you're absolutely shit at documenting your code and i need a `.nims` you have in your project to make my code compile
04:11:00FromDiscord<Elegantbeef> Why would i look at `somefile.nims` to see the config
04:11:29FromDiscord<Elegantbeef> And if you have multiple in your project
04:11:29FromDiscord<Elegantbeef> Oh boy
04:11:41FromDiscord<Rika> It could just be some script file you needed to set something up
04:12:49FromDiscord<creikey> is there a way to not resume the current async function until some other async function finishes?
04:12:59FromDiscord<Elegantbeef> `waitfor`
04:13:03FromDiscord<creikey> waitFor blocks the thread though
04:13:05FromDiscord<creikey> I want to like
04:13:10FromDiscord<Elegantbeef> `await`
04:13:12FromDiscord<Rika> I don’t understand
04:13:13FromDiscord<creikey> suspend the current async function
04:13:13FromDiscord<creikey> await
04:13:13FromDiscord<creikey> yeah
04:13:16FromDiscord<creikey> tip of my tongue thank you
04:13:53FromDiscord<creikey> asyncCheck keeps like the function going
04:13:56FromDiscord<Rika> Yes
04:13:57FromDiscord<creikey> after launching the async operation
04:14:01FromDiscord<Rika> Kinda yeah
04:14:10FromDiscord<creikey> await will "block" (free up the async dispatcher) until the future resolves
04:14:28FromDiscord<creikey> exceptions are still raised even when you await an async function right?
04:14:46FromDiscord<Elegantbeef> https://nim-lang.org/docs/asyncdispatch.html#asynchronous-procedures-handling-exceptions
04:15:15FromDiscord<Rika> I think that’s a bit outdated, I’ve not experienced much of a scenario where an exception wasn’t bubbled up
04:15:30FromDiscord<creikey> In reply to @Elegantbeef "https://nim-lang.org/docs/asyncdispatch.html#asynch": thanks
04:15:53FromDiscord<creikey> I should just read that whole page
04:16:46FromDiscord<Elegantbeef> Probably
04:16:57FromDiscord<Elegantbeef> Read that and asyncfutures aswell probably
04:17:01FromDiscord<Elegantbeef> Some nuggets of information there
04:19:39FromDiscord<creikey> I'm not sure I understand asyncCheck completely
04:19:46FromDiscord<creikey> so like in this while loop https://media.discordapp.net/attachments/371759389889003532/998081551025852477/unknown.png
04:19:58FromDiscord<creikey> the while loop will complete almost instantly
04:20:07FromDiscord<huantian> yes
04:20:08FromDiscord<creikey> but asyncCheck will launch like asyncronous tasks to send the message for all of those
04:20:23FromDiscord<creikey> and if any one of them fails it like goes back to that point in execution where the exception is handled
04:20:26FromDiscord<creikey> and restarts the while loop
04:25:10*jmdaemon joined #nim
04:32:23FromDiscord<sharpcdf> sent a code paste, see https://paste.rs/Hcw
04:33:31FromDiscord<sharpcdf> it also says that it has no opt and `release` isnt defined
04:33:39FromDiscord<sharpcdf> so it just looks like switches arent showing
04:35:05FromDiscord<sharpcdf> im running the switches inside of a task, is that why?
04:43:45FromDiscord<# Luke> Does Nim have something like pdb?
04:43:57FromDiscord<# Luke> The python debugger
04:44:17FromDiscord<Rika> GDB?
04:44:29FromDiscord<# Luke> Oh
04:44:36FromDiscord<# Luke> Well that was a dumb question
04:45:00FromDiscord<# Luke> That's what happens when you code with 5 hours of sleep xd
05:13:59FromDiscord<# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44yu
05:15:12FromDiscord<creikey> In reply to @ripluke "i made this function": does the color constructor expect hsl?
05:16:00FromDiscord<huantian> you want to rethink the ranges of your luminance value
05:16:09FromDiscord<huantian> you divide it by 100, then 1 it
05:16:14FromDiscord<huantian> but then you never 100
05:16:28FromDiscord<# Luke> In reply to @huantian "but then you never": Oh
05:16:45FromDiscord<huantian> why don't you just do `hsl.l = 100 - hsl.l`
05:16:57FromDiscord<# Luke> In reply to @huantian "why don't you just": K I'll try it
05:24:38FromDiscord<Elegantbeef> Why are you still updating the bar every pixel
05:27:15FromDiscord<ripluke> Oh lol yea still have to fix that
05:27:39FromDiscord<ripluke> That does the trick thx↵(@huantian)
05:30:34FromDiscord<sharpcdf> do i use `copyFile` or `moveFile` when creating a new file
05:30:53FromDiscord<Elegantbeef> In Nim or nimscript?
05:30:57FromDiscord<sharpcdf> nim
05:31:49FromDiscord<Elegantbeef> `open`
05:32:16FromDiscord<sharpcdf> oh ok
05:32:31FromDiscord<sharpcdf> is that in `system`?
05:32:37FromDiscord<Elegantbeef> `io`
05:32:38FromDiscord<sharpcdf> i cant see it in os
05:32:40FromDiscord<sharpcdf> oh ok
05:32:43FromDiscord<sharpcdf> thanks
05:32:44FromDiscord<Elegantbeef> So yes it's in system
05:34:25FromDiscord<sharpcdf> what do i pass to the filehandle parameter?
05:34:44FromDiscord<Elegantbeef> you can just do `open("myfilename", fmwrite)`
05:35:06FromDiscord<sharpcdf> oh right, i was looking at the other definitions
05:55:45FromDiscord<Gabben> sent a code paste, see https://play.nim-lang.org/#ix=44yA
05:56:40FromDiscord<Elegantbeef> They're aliases not distinct types
05:56:49FromDiscord<Elegantbeef> so `Bar[T]` and `Foo[T]` are the same
05:58:55FromDiscord<Elegantbeef> This is expected behaviour given this "incorrect" usage of aliases
06:00:22*kenran joined #nim
06:02:09*kenran quit (Client Quit)
06:05:10FromDiscord<sharpcdf> i hate git so much, i just tried to commit to a remote repository and it just deleted every single one of my files
06:05:21FromDiscord<Elegantbeef> `--dry-run`
06:05:24FromDiscord<sharpcdf> and rewrote them with random ass go files
06:05:51FromDiscord<sharpcdf> i saved two files but thats it
06:05:56FromDiscord<sharpcdf> 😩
06:06:31FromDiscord<sharpcdf> https://media.discordapp.net/attachments/371759389889003532/998108419183616061/unknown.png
06:18:33FromDiscord<Dale> How do I use `when` with an integer define?
06:19:21FromDiscord<Dale> Say I have `--d:x=4`, how do I do something like `when define(x > 4)`
06:20:07FromDiscord<Elegantbeef> James that's an odd error
06:20:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44yH
06:20:12FromDiscord<j-james> `required type for resource: ptr WlResource but expression 'resource' is of type: ptr WlResource` is new to me
06:21:37FromDiscord<Dale> Ah, you have to make a static then
06:21:43FromDiscord<j-james> oh looks like the matrix bridge dropped the stack trace
06:21:44FromDiscord<Elegantbeef> No
06:21:54FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=44yJ
06:22:15FromDiscord<Elegantbeef> `const` is compile time constant
06:23:18FromDiscord<Elegantbeef> Can i see the callsite james?
06:23:18FromDiscord<Elegantbeef> Like full context
06:24:47FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=44yK
06:24:51FromDiscord<Dale> Right, but they end up being statics in the binary
06:24:56FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=44yL
06:25:39FromDiscord<Elegantbeef> `importC`ing a procedure call?
06:25:44FromDiscord<Elegantbeef> That doesnt make any sense
06:26:04FromDiscord<Elegantbeef> This is an inlined procedure in the C isnt it?
06:26:27FromDiscord<j-james> ... oh wait, it doesn't
06:26:29FromDiscord<j-james> yeah
06:26:36FromDiscord<j-james> i can just importc it duh
06:27:01FromDiscord<Elegantbeef> Well yea `when` is compile time↵(@Dale)
06:27:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44yM
06:27:18FromDiscord<Dale> I know that, I was referring to the const var
06:27:22FromDiscord<Elegantbeef> Can you just importC it?
06:27:31FromDiscord<Dale> I got it to work anyways, thanks :)
06:28:01FromDiscord<Elegantbeef> If you're loading it from a dynamic library james that procedure doesnt exist
06:28:06FromDiscord<Elegantbeef> Atleast afaik
06:28:22FromDiscord<Elegantbeef> inlined procedures are not shipped in a dynamic library with C i think
06:28:27FromDiscord<Elegantbeef> Since well it doesnt make sense
06:29:47FromDiscord<j-james> hmm
06:30:10FromDiscord<j-james> why are functions inlined in the header file again?
06:30:13FromDiscord<j-james> is it a performance thing?
06:30:35FromDiscord<Elegantbeef> Yes it's a performance thing but it doesnt make sense for a dynamic library iirc
06:30:45FromDiscord<Elegantbeef> Since the signature doesnt exist there, though i could be wrong
06:31:10FromDiscord<Dale> I have a question: what convention do you uys use for filenames? I know lowerCamelCase is the general convention for most things, and I agree with that, but I kinda like my files to be UpperCamel. Would that be considered weird in the nimosphere?
06:31:18FromDiscord<Dale> (edit) "uys" => "guys"
06:31:33FromDiscord<Elegantbeef> module names are all lowercase
06:31:35FromDiscord<Elegantbeef> conventionally
06:31:48FromDiscord<j-james> i try my very hardest to use single words
06:31:59FromDiscord<j-james> but lowercase_snake_case when needed yeah
06:32:24FromDiscord<Elegantbeef> Remember that `import mymodule` adds a symbol named `mymodule` in scope
06:32:39FromDiscord<Elegantbeef> So if you have `import Lists` you're likely to have a `type Lists = ...` in it
06:32:53FromDiscord<Dale> Ah yeah, the implicit var will match the case of the module file
06:33:08FromDiscord<Dale> I say var, it's more like a namespace
06:33:24FromDiscord<Elegantbeef> module symbol is the technobaubble
06:33:25FromDiscord<Dale> What type are those actually
06:33:38FromDiscord<Elegantbeef> They dont have a type, they're just a symbol
06:33:42FromDiscord<Dale> Ah
06:34:08FromDiscord<Elegantbeef> !eval echo typeof(`in`)
06:34:11NimBotvoid
06:34:14FromDiscord<Elegantbeef> Oh cmon nim playground api
06:34:19FromDiscord<Elegantbeef> Dont fail me now
06:34:44FromDiscord<Elegantbeef> The nim playground uses 'in.nim' as the file name
06:34:58FromDiscord<huantian> !eval echo in
06:35:00NimBotCompile failed: /usercode/in.nim(1, 8) Error: expression expected, but found '[EOF]'
06:35:08FromDiscord<huantian> Huh
06:35:13FromDiscord<Elegantbeef> so `in` is the lexical stropped module name
06:35:13FromDiscord<Elegantbeef> !eval echo `in`
06:35:16NimBotCompile failed: /usercode/in.nim(1, 6) Error: type mismatch: got <void>
06:35:25FromDiscord<huantian> Neato
06:35:25FromDiscord<Elegantbeef> Remember huan `in` is a binary operator
06:36:13FromDiscord<Elegantbeef> The module symbol exists in a module but due to shadowing if you have a `Lists.nim` and a `type Lists` the module symbol is shadowed
06:36:43FromDiscord<Elegantbeef> Which does mean you can use the module name you're presently in to remove ambiguity between to functions
06:36:56FromDiscord<huantian> In reply to @Elegantbeef "Remember huan `in` is": Ah yeah
06:42:25FromDiscord<aph> are there some macro training puzzles for nim ? :)
07:03:48*pch joined #nim
07:04:44FromDiscord<Phil> Best I can do you is beefs article about macros
07:09:33FromDiscord<Elegantbeef> Shit this is low↵(@Phil)
07:10:09FromDiscord<Phil> In reply to @Elegantbeef "Shit this is low": Never claimed to have any idea about macros
07:10:28FromDiscord<Phil> I have my "getField" macro and based around that single thing I managed to write a whole bunch of stuff
07:10:40FromDiscord<Phil> And none of it were other macros
07:11:11FromDiscord<Dale> `if tried.dataAvailable:` where does this proc come from?
07:11:21FromDiscord<Dale> (using it for channels)
07:12:16FromDiscord<Elegantbeef> channels
07:13:17FromDiscord<Elegantbeef> https://nim-lang.org/docs/channels_builtin.html
07:13:33FromDiscord<Elegantbeef> Wait a minute does it not exist anymore
07:14:03FromDiscord<Dale> I think it's a tuple?
07:14:04FromDiscord<Elegantbeef> Oh nevermind i'm dumb
07:14:11FromDiscord<Elegantbeef> `tryRecv` returns a tuple and `dataAvailable` is a field
07:14:15FromDiscord<Dale> ` tuple[dataAvailable: bool`
07:14:23FromDiscord<Dale> Right, I haven't used tuples yet, so I was confused
07:15:30FromDiscord<Elegantbeef> Yea you confused me a fair bit 😄
07:16:25FromDiscord<Dale> I thought it was a proc haha
07:16:48FromDiscord<Dale> Also, you can't use a forward declaration when spinning up a thread :(
07:16:59FromDiscord<creikey> can I get a template parameter as a string like the literal text of the code?
07:17:09FromDiscord<Dale> Gotta say, having to define things in an order is my least favourite thing about this lang so far
07:17:16FromDiscord<Elegantbeef> `astToStr`↵(@creikey)
07:17:25FromDiscord<Dale> I saw that there's an experimental flag to reorder, is it worth trying?
07:17:27FromDiscord<Elegantbeef> automatic code reorder soon TM↵(@Dale)
07:17:36FromDiscord<creikey> In reply to @Elegantbeef "`astToStr` (<@180866243819995136>)": no way that's so cool
07:17:39FromDiscord<Elegantbeef> Not really it'll likely be replaced by a proper solution
07:18:16FromDiscord<creikey> but look at this
07:18:20FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=44yR
07:18:24FromDiscord<creikey> now I don't need those messages
07:18:33FromDiscord<Elegantbeef> Nice
07:24:22FromDiscord<creikey> how hard would it be to print the value of every variable used in the condition
07:24:42FromDiscord<creikey> it's some kind of ast tree right
07:24:52FromDiscord<creikey> I just have to get all the identifiers then figure out if it's a function or not
07:25:19FromDiscord<Elegantbeef> https://nim-lang.org/docs/sugar.html#dumpToString.m%2Cuntyped
07:25:22FromDiscord<Elegantbeef> Might tickle your fancy
07:28:10FromDiscord<creikey> interesting
07:28:25FromDiscord<creikey> so it doesn't have the runtime information but compile time constants are resolved
07:30:22FromDiscord<Elegantbeef> If you want more yea you'd need to use a macro
07:42:02FromDiscord<Phil> Say I want to write a proc that works across db_sqlite, db_postgres and db_mysql.↵These all have their own definition of "DbValue", "DbConn", "getAllRows" etc.↵How do I actually go about that? Do I write a core proc with all logic that is generic and then one proc for each of the db_ models with their specific types?
07:42:15FromDiscord<Phil> (edit) "db_sqlite, db_postgres" => "db\_sqlite, db\_postgres" | "db_mysql.↵These" => "db\_mysql.↵These" | "db_" => "db\_"
07:42:27FromDiscord<Phil> (edit) "models" => "modules"
07:43:14FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44yT
07:46:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44yU
07:46:49*pch quit (Remote host closed the connection)
07:46:53FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44yV
07:47:14FromDiscord<Elegantbeef> `mixin`?
07:47:17FromDiscord<Elegantbeef> Anyway i'll wait
07:47:26FromDiscord<Elegantbeef> Dont acknowledge the mixin
07:47:28*pch joined #nim
07:54:55FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44yX
07:56:48*rockcavera joined #nim
07:56:49*rockcavera quit (Changing host)
07:56:49*rockcavera joined #nim
07:56:57FromDiscord<Elegantbeef> Does `[T; Y: AllDBValue]` and then `varargs[Y]` work?
07:57:08FromDiscord<Elegantbeef> There is a minor semantic difference
07:58:36FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44yY
07:59:03FromDiscord<Elegantbeef> Odd
08:00:57FromDiscord<Elegantbeef> Where are the DBValues defined?
08:01:31FromDiscord<Phil> within db_sqlite and db_postgres
08:01:41FromDiscord<Elegantbeef> Link?
08:01:44FromDiscord<Phil> Or do you mean the above? That's all in one file
08:02:23FromDiscord<Phil> Oh wait, no I'm an idiot, that's from norm
08:02:48FromDiscord<Phil> I've been mixing this up way too hard given that I want to work both with raw SQL (which norm doesn't let me do) and norm
08:03:04FromDiscord<Elegantbeef> Ok i found them
08:03:17FromDiscord<Phil> Let me see if it works if I split this up properly
08:05:56FromDiscord<Elegantbeef> Yea the issue here is that those varargs depend on the first parameter
08:07:06FromDiscord<Phil> Ohhh as in, they can't decide on their typing?
08:07:24FromDiscord<Elegantbeef> Yea we're not even at the call yet
08:07:48FromDiscord<Phil> And that's why the compiler errors out because it can't flawlessly determine whether the varargs should be norm/sqlite.DbValue or norm/postgres.DbValue ?
08:08:05FromDiscord<Phil> hmm
08:08:10FromDiscord<Elegantbeef> We might be able to use a concept here
08:08:39FromDiscord<Phil> Can I somehow "tie" types together?↵If you get sqlite.DbConn, you'll also get sqlite.DbValue ?
08:08:42FromDiscord<Elegantbeef> Does this use the stdlib `DBConn`?
08:09:09FromDiscord<Elegantbeef> I mean yea that's what a proc definition is for phil 😛
08:09:09FromDiscord<Phil> Yeah, DbConns from norm sqlite/postgres are interchangeable with the ones from std/db_sqlite and std/db_postgres
08:09:24FromDiscord<Dale> Whoops, I incurred some weird UB
08:09:29FromDiscord<Dale> I made a struct with no members
08:09:32FromDiscord<Phil> In reply to @Elegantbeef "I mean yea that's": Yeah but I mean across 2... what do you call what I did their, limited type generics?
08:09:41FromDiscord<Phil> (edit) "their," => "there,"
08:09:53FromDiscord<Elegantbeef> That shouldnt be UB afaik↵(@Dale)
08:10:01FromDiscord<Elegantbeef> typeclasses in Nim↵(@Phil)
08:10:07FromDiscord<Dale> > 1401 If the struct-declaration-list contains no named members, the behavior is undefined.
08:10:16FromDiscord<Dale> `of` wasn't picking it up
08:10:20FromDiscord<Phil> Alrighty, then basically limit combinations of typeclasses
08:10:26FromDiscord<Phil> Is what I'd like to do
08:10:41FromDiscord<Elegantbeef> Nah we're not going to be able to do that
08:10:45FromDiscord<Elegantbeef> I'll show you what we'll do
08:12:16FromDiscord<creikey> In reply to @Dale "I made a struct": uh oh I'm using this right now
08:12:26FromDiscord<creikey> like this https://media.discordapp.net/attachments/371759389889003532/998140106340843570/unknown.png
08:13:57FromDiscord<Elegantbeef> Nim will force a min size so memberless structs are 1 byte
08:15:24*jmdaemon quit (Ping timeout: 244 seconds)
08:15:26FromDiscord<Dale> Ah cool
08:16:00FromDiscord<Dale> It would work with no fields in C++ I think, but empty C structs are basically just pointers, you can't do anything else with them
08:16:24FromDiscord<Dale> Got my code somewhat working now
08:17:26FromDiscord<Dale> How do I cast a generic? I have `echo cmd[string](x).payload` atm, but it's not printing anything
08:18:43FromDiscord<Dale> Well I guess the nimspeak is type conversion
08:19:09FromDiscord<Elegantbeef> That's the correct wy to do a type conversion assuming `cmd` is your type
08:19:50FromDiscord<Elegantbeef> @Phil\: https://play.nim-lang.org/#ix=44z2 this is probably the way to do it
08:19:56FromDiscord<Elegantbeef> Though doesnt compile presently
08:20:34FromDiscord<Elegantbeef> Are you sur payload has data?↵(@Dale)
08:20:52FromDiscord<Dale> Yup, I'm echo'ing it elsewhere
08:21:10FromDiscord<Elegantbeef> kind is a member silly↵(@creikey)
08:21:22FromDiscord<Dale> sent a code paste, see https://play.nim-lang.org/#ix=44z3
08:21:24FromDiscord<creikey> In reply to @Elegantbeef "kind is a member": so true
08:22:25FromDiscord<Elegantbeef> `StartCmd` is a non ref object?
08:22:39FromDiscord<Dale> Yeah
08:23:00FromDiscord<Dale> I didn't think it'd need to be since the channel would copy it anyway
08:23:42FromDiscord<Dale> I would create it in the send call as well, so it could be move'd
08:23:58FromDiscord<Dale> but atm I need to create it first to debug
08:23:58FromDiscord<Elegantbeef> Can i see the typedef of startcmd
08:24:18FromDiscord<Dale> sent a code paste, see https://play.nim-lang.org/#ix=44z4
08:24:23FromDiscord<Elegantbeef> Ok as i thought
08:24:45FromDiscord<Elegantbeef> Is your channel specialized to [ThreadCmd]\`?
08:24:51FromDiscord<Dale> Yep
08:24:56FromDiscord<Elegantbeef> If so i know what's happening
08:25:03FromDiscord<Dale> The `of` works in the thread
08:25:06FromDiscord<Elegantbeef> Ok so you need `ref object` here
08:25:11FromDiscord<Dale> Ah okay
08:25:11FromDiscord<Elegantbeef> Oh it'll work
08:25:12FromDiscord<Phil> In reply to @Elegantbeef "<@180601887916163073>\: https://play.nim-lang.org/#": Ah, basically generate modules via templates
08:25:30FromDiscord<Elegantbeef> The issue here is it's copying only the type information
08:25:34FromDiscord<Dale> So it's passing a pointer internally?
08:26:09FromDiscord<Elegantbeef> No it's copying only the type information pointer since it's thinking you're passing a `sizeof(ThreadCmd)`
08:26:25FromDiscord<Elegantbeef> The way nim stores type information is the first field is a pointer to the type information
08:26:56FromDiscord<Elegantbeef> So the channel implementation goes "oh threadcmd is only the size of type information, so i'll send that"
08:27:37FromDiscord<Dale> Ah I see
08:27:41FromDiscord<Elegantbeef> The correct thing to do here is only accept `ThreadCmd` and statically error if it's not, but apparently channels doesnt do that
08:28:15FromDiscord<Elegantbeef> And yea you have to use a reference for this API
08:28:29FromDiscord<Elegantbeef> Since `StartCmd[T]` can be any size
08:28:40FromDiscord<Dale> It seems to be working now that they are refs
08:28:47FromDiscord<Elegantbeef> If it wasnt a generic could be using object variants
08:29:06FromDiscord<Elegantbeef> Really you could have two channels, one for payload and another for actions to reduce indirection
08:29:08FromDiscord<Dale> Right, but the `StartCmd` needs data to pass to the thread
08:29:19FromDiscord<Dale> Ah that is a solution
08:29:53FromDiscord<Elegantbeef> Yea i get you need the data and it can be generic
08:30:08FromDiscord<Elegantbeef> I'm just commenting on what the issue is without ref
08:30:29FromDiscord<Phil> sent a long message, see https://paste.rs/T4g
08:30:56FromDiscord<Elegantbeef> Can you not just do `moduleName.dbValue`?
08:31:42FromDiscord<Phil> I can, but I'm not the author of norm and that proc is within norm
08:31:54FromDiscord<Elegantbeef> What's the proc causing problems?
08:31:55FromDiscord<Phil> And I don't want to maintain my own norm fork
08:33:28FromDiscord<Elegantbeef> Dont these APIs generally have identical procedures?
08:33:59FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44z5
08:34:19FromDiscord<Elegantbeef> Ah so it should have a `bind dbType`
08:34:22FromDiscord<Phil> In reply to @Elegantbeef "Dont these APIs generally": Almost, there's some SQL differences but the code is identical
08:34:50FromDiscord<Elegantbeef> Yea i dont know my mind things something like `DbConn[Postgres]` would work
08:34:56FromDiscord<Elegantbeef> thinks rather
08:35:03FromDiscord<Phil> thinks things
08:35:23madpropsthink twice
08:36:05FromDiscord<Phil> Thinking thoughtless thoughts.↵Either way, I'll likely go the "generate 2 modules with identical procs but different explicit types" route
08:36:08FromDiscord<Dale> Thanks for the advice, it works great now :)
08:36:22FromDiscord<Elegantbeef> No problem
08:39:50FromDiscord<Dale> Man, I really like the compile-time stuff
08:40:06FromDiscord<Elegantbeef> Yea static generics and when statements are lovely
08:40:38FromDiscord<Dale> I'm using the compiler flag I set to filter log levels, so I can strip levels, or entire logging, from my project like asserts. How cool is that man
08:41:07FromDiscord<Elegantbeef> Is that what the integer define was for?
08:41:12FromDiscord<Dale> Yeah
08:41:26FromDiscord<Elegantbeef> Why not use an enum instead?
08:41:28FromDiscord<Dale> I should probably make an enum for it
08:41:45FromDiscord<Elegantbeef> `std/strutils` does have a `parseEnum`
08:42:04FromDiscord<Dale> I only just realised before I typed that that I can import an enum in my compile script
08:42:20FromDiscord<Elegantbeef> Yep
08:42:27FromDiscord<Elegantbeef> having a VM for compile time is powerful 😄
08:43:01FromDiscord<Dale> I don't need parseEnum right? They're ordinal types already
08:43:21FromDiscord<Elegantbeef> you can do `MyEnum(myInt)` but the point of enums is you'd have a human memorable name
08:43:45FromDiscord<Dale> But can I not just use the enum in the switch?
08:44:19FromDiscord<Dale> `switch("define", "logLevel=" & info)`
08:44:28FromDiscord<Dale> not sure what the syntax is for the enum at the end there
08:44:41FromDiscord<Elegantbeef> you could do `-d:myLibDebug` or `-d:myLibQuiet`
08:44:42FromDiscord<Elegantbeef> Of course you can but the reason to use a enum would be to have a more memorable name
08:44:43FromDiscord<Elegantbeef> So you'd parse the define
08:45:00FromDiscord<Elegantbeef> it'd be the string name
08:45:21FromDiscord<Elegantbeef> Like `logLevel = verbose`
08:45:38FromDiscord<Elegantbeef> so `& $verbose` i guess
08:45:58FromDiscord<Dale> Using a plain string does seem a little easier
08:46:05FromDiscord<Dale> Doesn't require an import either
08:46:10FromDiscord<Elegantbeef> exactly
08:46:22FromDiscord<Elegantbeef> You just parse it inside the project and then you're golden
08:46:39FromDiscord<Dale> Well in that case I don't need the enum at all really
08:47:14FromDiscord<Dale> It's never gonna be used outside of the log internals, so it's just sitting there doing nothing, may as well just use strings
08:47:20FromDiscord<Elegantbeef> I mean it's easier and covers your case statements
08:47:37FromDiscord<Dale> I don't have any of those for this
08:47:41FromDiscord<Elegantbeef> If you add another level you get a compiler error(if you didnt you else)
08:49:02FromDiscord<Elegantbeef> Well then use strings
08:51:03*CyberTailor joined #nim
08:59:39FromDiscord<creikey> what's up with enums being global in nim and not qualified by name so you add a prefix?
08:59:46FromDiscord<creikey> it's kinda nice now that I'm used to it
08:59:51FromDiscord<Elegantbeef> Overloadableenums didnt exist
08:59:52FromDiscord<creikey> wait nevermind it follows the same rules as package symbols
09:00:03FromDiscord<creikey> In reply to @Elegantbeef "Overloadableenums didnt exist": it doesn't?
09:00:10FromDiscord<Elegantbeef> It does now
09:00:16FromDiscord<Elegantbeef> it's an experimental feature but it's nice
09:00:28FromDiscord<Elegantbeef> Dont have to worry about enum value ambiguity
09:02:09FromDiscord<Elegantbeef> So multiple enums can define the same fields and it's lovely
09:02:12FromDiscord<Elegantbeef> No more prefix
09:09:17madpropsi read rust is 2x faster than nim
09:10:00FromDiscord<Elegantbeef> I thought it was 4/2 times faster
09:10:36madpropswhat makes it so fast?
09:11:18FromDiscord<Elegantbeef> Cant tell if you're meming
09:12:17FromDiscord<Elegantbeef> If not what makes it faster is the programmer wrote it in a way that makes it faster
09:13:06madpropsdon't care still not using rust
09:13:14madpropsthough i heavily used a program i made with it
09:13:18madpropsuse*
09:13:28FromDiscord<Elegantbeef> I mean you can write Nim as fast as rust
09:13:38FromDiscord<Elegantbeef> The issue is many benchmarks are not written in good faith
09:13:46FromDiscord<Elegantbeef> So people read them and go "Rust faster than Nim"
09:14:11madpropslike that web server who had a function specifically for benchmarks lol
09:14:13FromDiscord<IDF> i wish people actually read the benchmark code
09:14:13FromDiscord<pouriya.jamshidi> Hi,↵↵Could someone please tell me how I can use the `writeLine` proc and append to a file instead of overwriting it?↵I can't find it in the docs
09:14:25FromDiscord<Elegantbeef> Fuck no reading is hard
09:14:29FromDiscord<IDF> (edit) "i wish people actually read the benchmark code ... " added "before jumping to the conclusion that a language is faster"
09:15:08FromDiscord<Elegantbeef> `open("myfile", fmAppend)`
09:15:09FromDiscord<IDF> In reply to @pouriya.jamshidi "Hi, Could someone": open the file in `a` mode
09:15:17FromDiscord<Elegantbeef> IDF wrong language
09:15:26FromDiscord<IDF> wow
09:15:38FromDiscord<IDF> i worked too much with syscalls
09:15:59FromDiscord<Elegantbeef> https://nim-lang.org/docs/io.html#FileMode documented here
09:16:22FromDiscord<IDF> right yeah
09:17:30FromDiscord<pouriya.jamshidi> sent a code paste, see https://play.nim-lang.org/#ix=44zc
09:17:35FromDiscord<pouriya.jamshidi> (edit) "sent a code paste, see https://play.nim-lang.org/#ix=44zc" => "what's the syntax? I know I have to open the file in `a` mode and can't really understand how to link this `system/io` to the writeLine proc :S ↵I am just trying to write my first Nim program/script"
09:18:01FromDiscord<IDF> ElegantBeef answered that
09:18:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44zd
09:18:45FromDiscord<pouriya.jamshidi> thanks!
09:20:50FromDiscord<Elegantbeef> Jesus one of these benchmarks is calculating pi and writing each digit to the stdout
09:21:33FromDiscord<Elegantbeef> Went back to the benchmarks linked on the phoronix article from Nim on opensuse
09:21:54FromDiscord<Generic> wait what?
09:22:08FromDiscord<Elegantbeef> https://github.com/hanabi1224/Programming-Language-Benchmarks/blob/main/bench/algorithm/pidigits/1.nim
09:22:21FromDiscord<Elegantbeef> Nim apparently "timeout"s
09:22:29FromDiscord<Elegantbeef> Which i assume means "didnt flush the file"
09:22:31FromDiscord<Generic> yeah, wow how did I not spot that
09:24:05FromDiscord<Elegantbeef> Ah nvm it does function it's just slow
09:27:17*CyberTailor quit (Remote host closed the connection)
09:28:09*CyberTailor joined #nim
09:29:01madpropsMichael Laravel seems to make a lot of articles
09:29:21madpropsLiam Dawe too
09:30:01madpropsphoronix and gamingonlinux respectively
09:34:07FromDiscord<Dale> So now I am trying to add some automatic info to the log kinda like what Unity does. I'm using `currentSourcePath()` in my template, but it always uses the path of the file the template was written in. How I can get it to use the path from the call site instead?
09:35:09FromDiscord<Elegantbeef> `instantiationinfo()`
09:38:09FromDiscord<Dale> Ah! That's the one I wanted in the first place
09:38:18FromDiscord<Dale> I saw it yesterday but couldn't remember the name
09:38:32FromDiscord<Elegantbeef> IT does take args if you didnt see
09:40:16FromDiscord<Dale> Yeah I'm playing around with them
09:40:37FromDiscord<Elegantbeef> Well i'm out so dont ask any more question until you next helper can respond
09:40:39FromDiscord<Dale> What does the index do?
09:40:44FromDiscord<Dale> Ah
09:40:54FromDiscord<Dale> Okay, thanks for all the help :D
09:41:20madpropsare you related to Dall-E 2?
09:43:12madpropsi like midjourney myself
09:43:23madpropshttps://i.imgur.com/utMVTam.png
09:43:30madpropsit drew that train for me
09:49:54FromDiscord<Dale> If that's a reference to something I don't get it :P
09:51:45madpropshttps://openai.com/dall-e-2/
10:23:42FromDiscord<mratsim> In reply to @madprops "i read rust is": My cryptographic code is faster than Rust, and my machine learning code as well
10:24:11FromDiscord<mratsim> In reply to @madprops "https://openai.com/dall-e-2/": superceded by Google Imagen: https://imagen.research.google/
10:30:52FromDiscord<Phil> In reply to @madprops "i read rust is": Example for bad-faith comparisons:↵One of the bench marks between rust and nim has rust using multi-threaded code while nim uses single-threaded code.↵If you want to go into the specifics on how nonsense particularly the benchmarks linked to in a discussion of a phoronix article are, you can have a chat with Generic, he looked at those in detail.
10:41:11FromDiscord<Zodey> Hi guys↵I just wanted to ask, how "smart" the nim compiler is?↵Like will it call by reference, when i pass an object to a method etc...
10:41:38FromDiscord<Zodey> (edit) "etc..." => "etc...↵Is there any reading which says everything what nim does for me?"
10:41:49FromDiscord<Phil> In reply to @Zodey "Hi guys I just": There are reference types and value types in nim, even for objects. It'll pass a reference if the thing you're passing is a reference type, otherwise it'll pass by value
10:42:43*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
10:42:44FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44zx
10:42:59FromDiscord<Zodey> I see, thank you
10:43:28FromDiscord<Phil> Note that none of the objects above allow inheritance, that requires a slightly different type annotation, but for that I recommend looking into the nim tutorials to get started
10:43:37FromDiscord<Phil> Which is something I would recommend in general
10:43:54FromDiscord<Phil> ~~They're so damn useful I still peruse them from time to time~~
10:44:02FromDiscord<Zodey> In reply to @Isofruit "Which is something I": Yeah, totally makes sense 😅
10:44:30FromDiscord<Phil> In reply to @Zodey "Yeah, totally makes sense": Ah, wasn't meant harshly, the general was in regards to the nim tutorial pages, I recommend those in general
10:47:40*wallabra joined #nim
10:49:56FromDiscord<PyryTheBurger> how can i have a seq that accepts all types that inherit from one type
10:50:44FromDiscord<Phil> In reply to @PyryTheBurger "how can i have": SO you have a bunch of object types and they all inherint from the same root object?
10:50:50FromDiscord<PyryTheBurger> yes
10:53:12FromDiscord<Phil> In reply to @PyryTheBurger "yes": That depends, do you want to keep the data specific to the subclasses?
10:53:26FromDiscord<PyryTheBurger> what doe sthat mean
10:54:03FromDiscord<Phil> if a sub-type defines the field "name", do you want to still be able to access that name or are you fine to only have the fields defined in your main-class?
10:54:12FromDiscord<Phil> (edit) "main-class?" => "parent-class?"
10:54:23FromDiscord<PyryTheBurger> i want to have everything
10:54:31FromDiscord<enthus1ast> make a seq of the base type
10:54:36FromDiscord<PyryTheBurger> not working
10:56:53FromDiscord<Phil> In reply to @enthus1ast "make a seq of": That'll cut off all the fields the parent class doesn't have
10:57:12FromDiscord<Phil> At least for value type objects
10:57:13FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44zF
10:57:17FromDiscord<enthus1ast> no, you must of course cast it to the correct subtype
10:57:34FromDiscord<enthus1ast> and test with "elem of B"
10:57:44FromDiscord<enthus1ast> and use ref objects
10:58:01FromDiscord<Phil> With ref objects this works
10:58:59FromDiscord<Phil> So basically, Pyry, if you work with them as ref types you can use the code above (just add ref to the type definitions)
10:59:59FromDiscord<enthus1ast> i mean, we do not know what @PyryTheBurger tried already, just that its "not working"
11:03:46FromDiscord<PyryTheBurger> What does repr do
11:04:17FromDiscord<PyryTheBurger> And it gives me error if i try to add B to the seq of A
11:06:38FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44zK
11:07:05FromDiscord<enthus1ast> think i've written this 5+ times in this chat already, maybe i should start a collection of Faq's
11:12:20FromDiscord<Phil> In reply to @PyryTheBurger "What does repr do": repr gives you a string representation of the object for debug purposes. Pretty neat.↵And did you replace "object" with "ref object" in the type definitions?
11:12:46FromDiscord<PyryTheBurger> Yes i always use ref object
11:12:58FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44zN
11:14:23FromDiscord<PyryTheBurger> What does cast do
11:15:09FromDiscord<Phil> Forces the compiler to interpret the bites it finds for a given variable as a different type
11:15:38FromDiscord<Phil> In reply to @PyryTheBurger "Yes i always use": ... I have no idea why this compiles for me but not for you
11:31:02*CyberTailor quit (Remote host closed the connection)
11:31:58*CyberTailor joined #nim
11:35:08FromDiscord<demotomohiro> @enthus1ast Here is example code without casts: https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-how-to-store-different-types-in-seqqmark
11:36:13*CyberTailor quit (Remote host closed the connection)
11:37:05*CyberTailor joined #nim
11:42:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44zP
11:43:21FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=44zP" => "https://play.nim-lang.org/#ix=44zQ"
11:43:47FromDiscord<enthus1ast> mhh
11:44:14FromDiscord<enthus1ast> have not tested with generics yet
11:45:07FromDiscord<enthus1ast> could you send the expanded macro?
11:46:26FromDiscord<Phil> I'll do so immediately once I googled how to do that again
11:47:38FromDiscord<Dale> Man I’m really enjoying nim so far
11:48:02FromDiscord<Dale> Some stuff is weird, like implicit return, but I’m getting used to it
11:48:38FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/o87
11:48:51FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44zS
11:49:10FromDiscord<enthus1ast> https://nim-lang.org/docs/macros.html#expandMacros.m%2Ctyped
11:49:55FromDiscord<enthus1ast> @Phil\: if you could create a minimal example as an issue, i try to fix it
11:50:18FromDiscord<Phil> The code above is standalone and compiles (well with norm installed)
11:50:28FromDiscord<Phil> Or rather, it compiles as long as con.rawSelect is commented out
11:50:38FromDiscord<enthus1ast> ah ok
11:50:58FromDiscord<Phil> Do I do the "expandMacros" above the "to" call or around the "rawSelect" call?
11:51:52FromDiscord<Phil> Because so far it appears to not get to the point where it prints the expanded macros
11:52:30FromDiscord<Phil> Shall I still open the issue?
11:53:33FromDiscord<enthus1ast> yeah
11:54:03FromDiscord<enthus1ast> guess the ast looks completely different for inherited and generics
11:56:15FromDiscord<Phil> Done
11:58:51FromDiscord<enthus1ast> mh just added a test for inherited objects, that works at least
11:59:05FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44zT
12:00:24FromDiscord<Phil> A row type is just an alias over seq[string]?
12:00:34FromDiscord<Phil> huh
12:00:37FromDiscord<enthus1ast> yes think so
12:01:15FromDiscord<Phil> `Row = seq[string]` It is, fascinating
12:02:29FromDiscord<enthus1ast> ah no, "inherited objects" also does not work
12:02:41FromDiscord<enthus1ast> yeah, will have a look at it, when i'm come back later
12:15:29FromDiscord<Phil> In reply to @enthus1ast "ah no, "inherited objects"": Ahhhh crapbiscuits.↵Yeah, this one will have issues, in ndb, which is what norm uses, Row is defined a seq[DbValue].↵I'mma go ahead and assume you based nisane around Rows of db_sqlite
12:15:34FromDiscord<Phil> (edit) "In reply to @enthus1ast "ah no, "inherited objects"": Ahhhh crapbiscuits.↵Yeah, this one will have issues, in ndb, which is what norm uses, Row is defined a seq[DbValue].↵I'mma go ahead and assume you based nisane around Rows of db_sqlite ... " added "which is seq[string]"
12:21:45FromDiscord<Phil> In reply to @enthus1ast "ah no, "inherited objects"": The nanosecond I eliminate norm from the equation I can compile.↵the code is still not quite right, but the problems are different.↵Here, let me update the issue and ignore it for now
12:28:08FromDiscord<Phil> In reply to @enthus1ast "yeah, will have a": Updated the issue. The current problem is more that nisane incorrectly assigns values to the inherited object.↵The value of the "id" column gets assigned to the "name" field and I believe it's also trying vice versa but failing and thus entering 0.
12:28:47FromDiscord<Phil> Or it's not trying to do that in the first place and thus the field is default initialized to 0
12:29:03FromDiscord<Phil> (edit) "do that" => "assign anything to the field"
12:38:16FromDiscord<# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44A7
12:38:31FromDiscord<# Luke> iss there any way to fix this?
12:39:51FromDiscord<# Luke> hmm the readme says it isnt thread safe
12:57:35FromDiscord<aleclarson> how does nim compare to zig in terms of performance?
12:59:23FromDiscord<Phil> In reply to @aleclarson "how does nim compare": Write equivalent code and they'll be similarly fast.↵We've had several debates over benchmarks, and its a song generic can tell you: They do not compare equivalent code
13:01:42FromDiscord<Generic> I think it's relatively useless to compare programming languages which compile to native code via a proofen backend (gcc or clang/llvm), are statically typed and have value types
13:02:53FromDiscord<Phil> In reply to @aleclarson "how does nim compare": Differences you see tend to come down to details that aren't really about the language itself. Like which allocator you use. Or whether the benchmark implementations of one langauge are multi-threaded while the implementations of the other are single-threaded.
13:03:59FromDiscord<Phil> Basically, if it isn't stuff like python or JS, it's going to run equally well overall
13:04:29FromDiscord<# Luke> ^
13:04:56FromDiscord<Require Support> how does on read binary file and and convert to base64 string 🤔
13:05:01FromDiscord<Require Support> (edit) "on" => "one"
13:05:41FromDiscord<Generic> `base64.encode(readFile(yourfile))`
13:05:57FromDiscord<Generic> you need to import base64 to use encode
13:05:59FromDiscord<Require Support> that reads it as string i think
13:06:08FromDiscord<Yardanico> yes, but there's no difference in Nim
13:06:11FromDiscord<Generic> yeah
13:06:18FromDiscord<Require Support> oh
13:06:23FromDiscord<Yardanico> Nim strings don't have some specific encoding like in Python
13:06:28FromDiscord<Yardanico> They're just a sequences of bytes
13:06:39FromDiscord<Yardanico> That's why for unicode you have to use the std/unicode module
13:07:04FromDiscord<Require Support> cool, thanks ❤️
13:11:39FromDiscord<d4rckh> whats the easiest way of getting everything but the first element in a sequence
13:12:43FromDiscord<Phil> `x[1..^1]`
13:13:18FromDiscord<Phil> Since the first element is index 0, you'll get everything from index 1 to end
13:13:28FromDiscord<d4rckh> ty
13:27:03FromDiscord<# Luke> Does Nim have a dithering library
13:37:26FromDiscord<Rika> No but I made code that does dithering
13:37:31FromDiscord<Rika> Though I can’t access it right now
13:37:42FromDiscord<Rika> Which do you need?
13:40:53FromDiscord<# Luke> What algorithms do u have lol
13:53:10*wallabra_ joined #nim
13:53:39*wallabra quit (Ping timeout: 272 seconds)
13:53:40FromDiscord<Rika> IIRC Floyd Steinberg, Sierra 2 and 3, and uhh
13:53:46FromDiscord<Rika> Sierra lite
13:54:16FromDiscord<Rika> A-dither
13:54:27*wallabra_ is now known as wallabra
13:55:01FromDiscord<Rika> https://pippin.gimp.org/a_dither/
13:56:25FromDiscord<Rika> I’m prolly gonna try implementing void and cluster
13:56:36FromDiscord<ripluke> If you can, can you share the Floyd steinburg
13:57:42*arkurious joined #nim
13:59:52FromDiscord<Rika> Okay but I don’t think I’ll be able to soon
14:00:11FromDiscord<Rika> And it’s not very fast
14:00:16FromDiscord<Rika> What kind of speed do you need
14:00:55FromDiscord<ripluke> For dithering? Probably about 30seconds to a minute
14:02:49FromDiscord<Rika> Photo size is?
14:05:40FromDiscord<ripluke> 1080p
14:08:36FromDiscord<# Luke> Wait it's fine I used the code on Wikipedia
14:08:55FromDiscord<# Luke> And it worked with slight modification
14:22:03FromDiscord<carlosri> I'm triying to parse a csv file using std/parsecsv, but i do not see how to set the separator char.
14:22:36*TakinOver quit (Ping timeout: 272 seconds)
14:23:00FromDiscord<# Luke> If it's csv isnt the char just a comma?
14:23:24FromDiscord<carlosri> no, it's a semicolon
14:23:32FromDiscord<# Luke> Oh
14:27:32FromDiscord<!Patitotective> In reply to @carlosri "I'm triying to parse": look the parameters for the `open` proc↵https://nim-lang.org/docs/parsecsv.html#open%2CCsvParser%2Cstring%2Cchar%2Cchar%2Cchar
14:27:42FromDiscord<!Patitotective> (edit) "In reply to @carlosri "I'm triying to parse": look ... the" added "at"
15:35:34FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44BI
15:38:33FromDiscord<huantian> I don’t think Nim has partial classes like C# no
15:39:42FromDiscord<TryAngle> In reply to @huantian "I don’t think Nim": https://nim-lang.org/docs/manual_experimental.html#package-level-objects
15:40:05FromDiscord<huantian> Oh ig you can
15:41:24FromDiscord<huantian> It looks more like forward declaring a proc than c#’s partial
15:42:25FromDiscord<Phil> So basically, in module A you say "Module B will complete this type for me" ?
15:42:45FromDiscord<huantian> Or rather “some module will complete the type later”
15:43:13FromDiscord<huantian> Though maybe you can have multiple modules add different fields to the object, I haven’t used this before
15:43:35FromDiscord<Phil> If I'm reading the above correctly you have <PREFIX>.<INCOMPLETE_TYPE_NAME>, with <PREFIX> delineating which package will complete the type
15:45:34FromDiscord<TryAngle> how to make this work?
15:45:35FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44BO
15:49:14FromDiscord<Yardanico> you can't, concept types aren't concrete
15:49:40FromDiscord<Rika> You need to use a generic here yes
15:49:52FromDiscord<Phil> Can fields even be annotated with concepts?
15:50:12FromDiscord<Rika> That’s what Yardanico just denied
15:50:17FromDiscord<Phil> Ah, now I understand
15:50:18FromDiscord<Phil> check
15:51:14*pch quit (Remote host closed the connection)
15:51:18FromDiscord<Phil> So you use them basically as type annotations for proc params and... I think that's it
15:51:25FromDiscord<TryAngle> In reply to @Yardanico "you can't, concept types": hmmm, interesting because when using object u get this error, but with ref object the error I just showed
15:51:31FromDiscord<Rika> Generic restrictions
15:51:44*pch joined #nim
15:51:50FromDiscord<Rika> [T: <A concept>]
15:53:13FromDiscord<Phil> sent a code paste, see https://paste.rs/ev9
15:53:36FromDiscord<Rika> I didn’t catch the typedesc one haha nice
15:53:55FromDiscord<Phil> Compiles, echo's out 14
15:54:02FromDiscord<Rika> Do add is not relevant I don’t see where it’s used
15:54:31FromDiscord<Phil> It's only used in the last line for an echo to see that it works, I guess the order in the code is somewhat wonky
15:55:05FromDiscord<Phil> Should be a proc just above the echo call, it's solely an example on how you can use the concept
15:57:02FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44BU
15:59:15FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44BW
15:59:15FromDiscord<# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44BV
15:59:34FromDiscord<TryAngle> java bad all the way but I think in some cases doing a little dyn could be nice :3
15:59:51FromDiscord<Phil> dyn?
16:00:07FromDiscord<Phil> Ah, dynamic typing.
16:01:21FromDiscord<Generic> In reply to @ripluke "how can i optomize": the lowest hanging fruit would probably be to not convert from string everytime and instead do it once and keep that around
16:01:53FromDiscord<# Luke> how? parse it outside the loop?
16:02:06FromDiscord<Generic> split it up into two functions
16:02:36FromDiscord<Generic> one takes a seq of colors in string representation and returns a seq of Color objects
16:02:45FromDiscord<Generic> that's going to be passed into getClosestColor
16:03:12FromDiscord<# Luke> In reply to @Generic "one takes a seq": k
16:03:20FromDiscord<TryAngle> In reply to @Isofruit "Ah, dynamic typing.": yeye
16:03:25FromDiscord<Generic> it'll ofc only make a difference, if you make multiple calls to getClosestColor with the same seq
16:03:27FromDiscord<TryAngle> my language is a bit rusty 😔
16:03:35FromDiscord<TryAngle> literally
16:03:43FromDiscord<TryAngle> 🦀
16:04:06FromDiscord<Generic> the next easiest thing would be that distance probably doesn't work with rgb internally
16:04:06FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44C0
16:04:48FromDiscord<# Luke> oh
16:05:00FromDiscord<Generic> so additionally to converting from string once, you can also do a conversion to the color representation distance uses only once
16:05:09FromDiscord<Generic> you're using pixie, right?
16:05:37FromDiscord<Generic> ah no
16:06:28FromDiscord<Generic> it's chorma
16:06:34FromDiscord<Generic> (edit) "chorma" => "chroma, right?"
16:06:41FromDiscord<Generic> https://github.com/treeform/chroma/blob/master/src/chroma.nim#L352
16:06:55FromDiscord<Generic> see it always has to convert to CIEDE2000
16:07:33FromDiscord<Generic> so you can do that conversion in before hand
16:08:39FromDiscord<Generic> those are all the things I can come up which don't require rewriting the color comparision by yourself
16:09:58FromDiscord<# Luke> In reply to @Generic "so you can do": How tho
16:10:22FromDiscord<Generic> look at the link I sent
16:10:39FromDiscord<# Luke> Yea but how would it optimize the function
16:10:51FromDiscord<# Luke> It will still take the same amount of time won't it
16:11:12FromDiscord<Generic> I'm assuming you compare multiple colors against the same set of colors, right?
16:11:38FromDiscord<# Luke> No I'm comparing multiple colors against one color
16:12:31FromDiscord<Generic> yes, but do you call getClosestColor multiple times with the same value for the parameter colors?
16:12:58FromDiscord<# Luke> Yea
16:13:47FromDiscord<Generic> ok yeah then this will work
16:14:18FromDiscord<# Luke> Does it cache?
16:14:36FromDiscord<Generic> you could call it caching
16:15:05FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=44C5
16:15:26FromDiscord<Generic> (edit) "https://play.nim-lang.org/#ix=44C5" => "https://play.nim-lang.org/#ix=44C6"
16:15:29FromDiscord<# Luke> Thx
16:16:28FromDiscord<Generic> something like this
16:16:29FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=44C7
16:16:48FromDiscord<Generic> I also changed the names to imho more fitting ones
16:16:58FromDiscord<# Luke> Oh ok
16:19:21FromDiscord<Generic> made a small correction
16:20:19FromDiscord<# Luke> Yea I saw that
16:31:09*kenran joined #nim
16:32:41*kenran quit (Client Quit)
16:37:06FromDiscord<Phil> sent a long message, see http://ix.io/44CZ
16:37:13FromDiscord<sharpcdf> how can i get the value of a `--define` term in the app
16:37:31FromDiscord<Phil> `defined()` proc
16:37:40FromDiscord<sharpcdf> does it return the value?
16:37:40FromDiscord<Phil> Example:↵`when not defined(release):`
16:37:49FromDiscord<# Luke> In reply to @Isofruit "Question, when you have": you could probably discard the ones you arent using
16:38:05FromDiscord<sharpcdf> In reply to @Isofruit "Example: `when not defined(release):`": how can i get the value though
16:38:33FromDiscord<sharpcdf> because in my nimscript i have `switch("defined", "version:1.0")` and i want to get the value of version in the actual app
16:38:41FromDiscord<sharpcdf> (edit) "`switch("defined"," => "`switch("define","
16:40:35FromDiscord<Phil> In reply to @sharpcdf "because in my nimscript": Maybe play around some with https://nim-lang.org/docs/system.html#compileOption,string and see if that suits your needs
16:41:13FromDiscord<Phil> (edit) "https://nim-lang.org/docs/system.html#compileOption,string" => "https://nim-lang.org/docs/system.html#compileOption%2Cstring%2Cstring"
16:41:55FromDiscord<sharpcdf> thats just checks if the defined value is either `on` or `off`
16:42:28FromDiscord<sharpcdf> oh maybe the enum version
16:42:40FromDiscord<sharpcdf> wait no
16:42:42FromDiscord<sharpcdf> wouldnt work
16:42:43FromDiscord<sharpcdf> bruh
16:43:20FromDiscord<kots> You probably want the strdefine pragma: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas
16:45:17FromDiscord<sharpcdf> In reply to @kots "You probably want the": thats exactly what i need, thanks :)
16:46:02FromDiscord<Phil> In reply to @ripluke "you could probably discard": Ahh, good one
16:46:04FromDiscord<Generic> In reply to @Isofruit "Question, when you have": use _
16:46:19FromDiscord<Generic> Im Path muss sich lediglich ein Objekt finden, dass eine read()
16:47:20FromDiscord<Generic> sorry for anyone who saw what I sent, that was the wrong thing from my clipboard
16:47:38FromDiscord<Generic> https://nim-lang.org/docs/manual.html#statements-and-expressions-tuple-unpacking that's what I wanted to sent
16:54:05FromDiscord<j-james> if i'm wrapping a c function that has a parameter with a trailing underscore, can i safely remove it?
16:54:55FromDiscord<Phil> In reply to @Generic "use _": Thanks!
17:03:00FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44Eo
17:13:47FromDiscord<flywind> What about hintAsError[XDecl..]:on
17:19:47FromDiscord<Phil> That...errr... I guess works?↵`/usr/lib/nim/system/fatal.nim(13, 9) Error: 'gotoBasedExceptions' is declared but not used [XDeclaredButNotUsed]`
17:21:03FromDiscord<Phil> ... same when I go "UnusedImport" as error:↵`/usr/lib/nim/system.nim(1905, 14) Error: imported and not used: 'coro_detection' [UnusedImport]`↵Is "XAsError" basically partially unuseable because stuff within the systems.nim file itself doesn't follow that?
18:19:25FromDiscord<aleclarson> In reply to @Isofruit "Basically, if it isn't": good to know, thanks!
18:30:52*xet7 joined #nim
18:38:35FromDiscord<sharpcdf> how can i create an exe and copy slurped data into it
18:42:19FromDiscord<Phil> You compiling on windows?
18:42:52FromDiscord<Phil> Because the compiler output under windows is naturally an exe as far as I'm aware
18:43:34FromDiscord<Phil> As for slurped data, not sure what you mean by that. Do you want to have a bunch of text in your binary as compile-time-strings?
18:45:20FromDiscord<mratsim> In reply to @sharpcdf "how can i create": data that you slurp / staticRead is in the binary if it's used
18:46:04FromDiscord<sharpcdf> In reply to @Isofruit "You compiling on windows?": no
18:46:34FromDiscord<sharpcdf> im talking about like if i want to embed a binary into the program and then output it while the program is running
18:46:39FromDiscord<sharpcdf> how would i do that
18:46:42FromDiscord<sharpcdf> or is it not possible
18:47:12FromDiscord<sharpcdf> im on linux
18:48:55FromDiscord<huantian> slurp/staticRead into a const
18:49:00FromDiscord<huantian> Then just use normal open to write the file
18:49:16FromDiscord<sharpcdf> oh ok
18:49:42FromDiscord<sharpcdf> In reply to @huantian "Then just use normal": would i need to do anything else or would it automatically run like an executable?
18:49:58FromDiscord<huantian> Well that’s just writing the exe
18:50:06FromDiscord<huantian> You have to run it like any other exe
18:50:15FromDiscord<sharpcdf> ok
18:50:24FromDiscord<sharpcdf> wait i could just `setFilePermissions`
18:52:35FromDiscord<d4rckh> can i somehow compress pics using pixie?
19:00:40FromDiscord<dom96> sent a code paste, see https://play.nim-lang.org/#ix=44ES
19:00:55FromDiscord<sharpcdf> how can i check the type of shell to add env variables? like bash and fish since they have different ways of adding env variables
19:01:44FromDiscord<sharpcdf> and also how can i make a folder hidden?
19:03:09FromDiscord<Phil> In reply to @dom96 "hm, shouldn't tuple field": I don't work tooooo much with tuples myself, however, reading the nim tut about tuples:↵> meaning different tuple-types are equivalent if they specify fields of the same type and of the same name in the same order.
19:03:24FromDiscord<Phil> According to the tut it's type, name and order that are relevant
19:04:12FromDiscord<Phil> In reply to @sharpcdf "how can i check": I assume you already checked through the procs available in std/os?
19:04:18FromDiscord<dom96> In reply to @Isofruit "I don't work tooooo": I see, bah
19:04:38FromDiscord<sharpcdf> In reply to @Isofruit "I assume you already": yea
19:05:13FromDiscord<sharpcdf> theres `putEnv` and `envPairs` but i think thats just for bash env variables
19:05:28FromDiscord<Phil> Hmm, my next best guess is going over the std lib again and see what sounds reasonable to have that type of knowledge. If that doesn't bring anything up, check the system libs
19:05:41FromDiscord<sharpcdf> o7
19:05:45FromDiscord<huantian> In reply to @sharpcdf "theres `putEnv` and `envPairs`": I assume that would be shell agnostic
19:06:04FromDiscord<Phil> Is there a shell agnostic way to define env vars?
19:06:15FromDiscord<Phil> huh
19:06:40FromDiscord<sharpcdf> i dont think so
19:06:41FromDiscord<sharpcdf> maybe
19:06:50FromDiscord<sharpcdf> actually
19:07:32FromDiscord<sharpcdf> since fish manages the path through the env variable `fish_user_path` i might be able to check if it exists, and if it does then change that env in addition to bash
19:08:01FromDiscord<sharpcdf> i really just want to support fish and bash since afaik those are the two most popular shells
19:08:24NimEventerNew thread by Marcomq: Nim thread memory handling in threads with and without orc, see https://forum.nim-lang.org/t/9309
19:08:46FromDiscord<Phil> Huh, I noticed fsh mostly as a small-ish group, with zsh and bash making up the largest user groups
19:08:55FromDiscord<sharpcdf> oh really
19:09:16FromDiscord<sharpcdf> i use fish but from what i remember it had more stars than zsh
19:09:18FromDiscord<huantian> In reply to @sharpcdf "i dont think so": I mean just check the source code
19:09:19FromDiscord<Phil> That's mostly personal impressions on what I see running through r/Linux, r/Linuxmasterrace and everyday chat
19:09:33FromDiscord<sharpcdf> In reply to @huantian "I mean just check": true
19:10:12FromDiscord<sharpcdf> yea no it isnt agnostic
19:10:18FromDiscord<sharpcdf> it uses `c_setenv`
19:12:20FromDiscord<huantian> What does that do
19:16:19FromDiscord<Phil> In reply to @sharpcdf "i use fish but": Pretty likely, I haven't done any true deep dive on shells tbh. I learned just now that apparently C Shell is a thing. But from what I'm aware, there's the entire bourne shell family (sh, bash, csh, zsh, ksh and whatnot) and the only shell I know that actually noticably diverges from that is fsh as apparently it has better command names or the like.↵shrugs
19:17:13FromDiscord<Phil> ah, dash also exists and I've been told is popular
19:18:37*krux02 joined #nim
19:20:25FromDiscord<huantian> Is c’s setenv not shells gnostic
19:21:10FromDiscord<huantian> (edit) "gnostic" => "agnostic"
19:21:12FromDiscord<huantian> It should be
19:21:51FromDiscord<sharpcdf> really?
19:21:54FromDiscord<sharpcdf> i dont know for sure but i didnt think so
19:23:17FromDiscord<huantian> The man page doesn’t mention the shell at all
19:25:51FromDiscord<sharpcdf> at least for bash and fish
19:25:53FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44F1
19:38:34FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44F7
19:39:07FromDiscord<Phil> What I see is:↵Ident "a" appears to be "there is a symbol, it's name is the stuff in between the brackets"↵StrLit is "There is a string literal, its value is in between the brackets"
19:40:35FromDiscord<Arathanis> its language specific in that its a nim syntax tree but language agnostic in that languages all do something like this
19:41:20FromDiscord<Arathanis> StmtList is very common, its usually the root of the syntax tree of a file since a file containing code is a sequence (a list!) of statements in the language
19:41:21FromDiscord<Phil> Ah shoot, so no googling for some popular official dummy guides
19:41:32FromDiscord<Arathanis> VarSection is because nim lets you do things like
19:41:36FromDiscord<Arathanis> `var a, b, c`
19:41:45FromDiscord<Arathanis> so since you can do mroe than one with a single Var it gets a section
19:41:56FromDiscord<Arathanis> then IdentDefs is Identifier Definitions
19:42:12FromDiscord<Arathanis> Identifier A is defined as the string literal "test"
19:42:25FromDiscord<Arathanis> (edit) "A" => "`a`"
19:42:57FromDiscord<Phil> Is Empty always a standin for the equals sign?
19:43:20FromDiscord<Phil> Well, I assume Empty is what "=" is, since it's the expression between the identifier "a" and the string literal
19:43:27FromDiscord<Arathanis> i think that middle one holds a type?
19:43:34FromDiscord<Arathanis> I think its usually identifier, type, value
19:43:41FromDiscord<Arathanis> so since you are letting it infer the type its empty
19:43:49FromDiscord<Phil> Ohhhh let me see
19:43:49FromDiscord<Arathanis> try changing it to `var a: string = "test"`
19:44:20FromDiscord<Phil> Okay
19:44:23FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44F9
19:44:57FromDiscord<Phil> First, let me start up a txt file to note all of what you're explaining me down
19:50:36FromDiscord<Phil> In reply to @Arathanis "I think its usually": Usually in this case means in IdentDef it's usually exactly 3 pieces, correct? Or is that applicable to other... i dunno what sort of group IdentDefs falls under
19:50:49FromDiscord<Phil> (edit) "In reply to @Arathanis "I think its usually": Usually in this case means ... in" added "that explicitly"
19:51:22FromDiscord<Arathanis> its always 3 pieces
19:51:22FromDiscord<Phil> (edit) "other... i dunno what" => "other things like IdentDef.... whatever" | "under" => "under,"
19:51:31FromDiscord<Arathanis> so by usually I mean
19:51:58FromDiscord<Arathanis> IdentDefs is an AST node that holds 3 values
19:52:32FromDiscord<Arathanis> an identifier for the variable name, an identifier for the type, and an initial value
19:52:37FromDiscord<Arathanis> you might try seeing what happens if you do something like
19:52:56FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=44Fb
19:54:08FromDiscord<deech> How do I run all the Nim tests but show only the failing ones? `./koch tests --failing all` does not suppress the ones that pass.
19:54:10FromDiscord<Phil> Okay, so specifically for AST-Nodes of type IdentDef it has 3 values
19:54:15FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/998316722945794068/unknown.png
19:54:22FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/998316752280756325/unknown.png
19:55:04FromDiscord<Arathanis> In reply to @Isofruit "Okay, so specifically for": yes, in fact the docs for std/macros has a section (or maybe a link to a section) about all the ast nodes
19:55:28FromDiscord<Phil> In reply to @Arathanis "yes, in fact the": Sweet, I'll consult that later, I think this right now is super valuable to get my foot in the door for a basic understanding
19:55:36FromDiscord<Phil> And expand from there
19:56:32FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/998317299339645029/unknown.png
19:56:40FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/998317330138415205/unknown.png
19:56:55FromDiscord<Phil> In reply to @Arathanis "yes, in fact the": In terms of hierarchy, there is ↵StatementList > X-Section > AST-Node > Node Values↵That correct?
19:57:23FromDiscord<Phil> With X-Section being my stand in for "VarSection" and whatever other sections there are, I dunno
19:57:47FromDiscord<Arathanis> kind of
19:57:51FromDiscord<Arathanis> i dont know them all off the top of my head
19:57:54FromDiscord<Arathanis> its best to read about it
19:58:00FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/998317668509692024/unknown.png
19:58:06FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/998317693268664390/unknown.png
19:58:39FromDiscord<Arathanis> that 3rd one can be all sorts of things
19:58:50FromDiscord<Phil> ProcDef is equivalent to a Section, huh
19:59:14FromDiscord<Arathanis> also keep in mind when using macros that what goes in only has to be syntactically valid
19:59:19FromDiscord<Arathanis> it does not have to be semantically valid
19:59:25FromDiscord<Arathanis> but what comes out has to be semantically valid
20:01:01FromDiscord<Phil> syntactically valid = I must follow the constrains of the macro language↵semantically valid = I must follow the constrains of the entire language↵?
20:01:36FromDiscord<Arathanis> syntax means it follows the proper structure or form of the language
20:01:45FromDiscord<Arathanis> semantics is the meaning of the expressions
20:01:52FromDiscord<Phil> e.g. macro language constraint: IdentDefs have exactly 3 values↵e.g. entire language constraint: What comes out can't be let a: string = 5
20:02:02FromDiscord<Arathanis> thats a good example
20:02:09FromDiscord<Arathanis> `var a: string = 5` is syntactically valid
20:02:15FromDiscord<Arathanis> those are all valid nim structures
20:02:16FromDiscord<Arathanis> it can parse them
20:02:21FromDiscord<Arathanis> but its nonsense semantically
20:02:24FromDiscord<Arathanis> cause 5 is not a string
20:02:42FromDiscord<Arathanis> syntax is "well-formed"
20:02:47FromDiscord<Arathanis> semantics is "has meaning"
20:02:50FromDiscord<Arathanis> or valid meaning
20:03:28FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=44Ff
20:03:30FromDiscord<Arathanis> thats syntactically valid
20:03:38FromDiscord<Arathanis> but when it goes to semantic checking its going to die
20:03:45FromDiscord<Arathanis> cause it does have valid semantic meaning
20:03:51FromDiscord<Arathanis> but you can totally give that to a macro
20:04:00FromDiscord<Arathanis> and as long as whatever comes out the other side is semantically valid its all good
20:04:07FromDiscord<Arathanis> thats why macros let you write DSLs
20:04:11FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44Fg
20:04:48FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=44Fh
20:04:59FromDiscord<Arathanis> or are you echoing $PATH in the command line?
20:05:21FromDiscord<Arathanis> the program is only going to change its PATH in its execution context, once its done executing none of those changes will remain in your terminal
20:05:27FromDiscord<sharpcdf> im echoing path in the commandline
20:05:28FromDiscord<sharpcdf> oh ok
20:05:41FromDiscord<sharpcdf> how can i get the changes to stay
20:05:55FromDiscord<Arathanis> if you want nim to do it you are going to have to use shell commands
20:06:03FromDiscord<sharpcdf> oh rip
20:06:09FromDiscord<Arathanis> nim can call the shell
20:06:16FromDiscord<sharpcdf> yea its `exec()` right
20:06:23FromDiscord<Arathanis> not sure
20:06:29FromDiscord<Arathanis> ive never called the shell with nim
20:06:52FromDiscord<Arathanis> looks like `os.execShellCmd` at first googling is an option
20:07:07FromDiscord<Arathanis> oh theres an `osproc` library
20:08:05FromDiscord<voidwalker> https://stackoverflow.com/questions/51533057/how-to-check-each-column-data-type-in-csv-python
20:08:11FromDiscord<voidwalker> do we have something like this fo nim ?
20:08:54FromDiscord<Arathanis> something like that
20:08:57FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=44Fi
20:09:20FromDiscord<Arathanis> that might work, you might have to fiddle with settings so it uses your primary shell instead of using a new one
20:11:40FromDiscord<voidwalker> or, how to get value type from a string ? if it's int/float/bool/string
20:14:43FromDiscord<Phil> In reply to @Arathanis "thats why macros let": Are in the above example only IdentDefs what you call an AST Node or are they all called different types of AST Nodes?
20:15:15FromDiscord<Phil> (edit) "In reply to @Arathanis "thats why macros let": Are in the above example only IdentDefs what you call an AST Node or are they ... all" added "(Sections, the values like Ident "b") "
20:15:31FromDiscord<Phil> (edit) ""b")" => ""b" and more)"
20:16:56FromDiscord<Arathanis> everything is a node
20:17:00FromDiscord<Arathanis> (edit) "a" => "an ast"
20:17:04FromDiscord<Arathanis> its just a kind of it
20:17:26FromDiscord<Arathanis> (edit) "it" => "node"
20:20:22FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44Fo
20:20:24FromDiscord<sharpcdf> still doesnt add it to the path
20:20:49FromDiscord<Arathanis> check the settings for that command
20:21:11FromDiscord<Arathanis> theres probably a way to make it use the current shell
20:21:14FromDiscord<Arathanis> usually they spawn a new shell
20:21:20FromDiscord<Arathanis> (edit) "usually they spawn a new shell ... " added "which is why it wouldnt stick"
20:21:53FromDiscord<sharpcdf> oh wait
20:22:03FromDiscord<sharpcdf> if i want it to stick cant i just append it to `.bashrc`
20:22:17FromDiscord<sharpcdf> lmao ive been using fish for so long i forgot i can do that
20:22:31FromDiscord<Hi02Hi> In reply to @d4rckh "can i somehow compress": does `writeFile` count?↵as in `image.writeFile(img.png)` ↵bmp, png, ppm, and qoi are supported
20:22:52FromDiscord<Hi02Hi> though bmp and ppm arent really compressed
20:22:56FromDiscord<d4rckh> I need to compress it
20:23:29FromDiscord<d4rckh> Im taking a screenshot using the Windows API and the PNG is like 20mb
20:23:43FromDiscord<Hi02Hi> png is already compressed
20:23:49FromDiscord<Hi02Hi> images are big
20:27:17FromDiscord<sharpcdf> does writeLine append to the end of the file or overwrite it
20:28:42FromDiscord<sharpcdf> oh wait it does but only with `fmAppend`
20:29:12FromDiscord<Arathanis> In reply to @sharpcdf "if i want it": ha i assumed you were trying to avoid this for some reason
20:31:12FromDiscord<sharpcdf> no
20:31:13FromDiscord<sharpcdf> well shit
20:31:28FromDiscord<sharpcdf> i appended it to the bashrc but it still doesnt work
20:31:59FromDiscord<sharpcdf> (edit) "no ... " added "lol"
20:32:17FromDiscord<sharpcdf> well now i have to make it append to fish_user_paths too
20:32:51FromDiscord<Arathanis> @sharpcdf do `source ~/.bashrc`
20:32:54FromDiscord<Arathanis> and it should take effect
20:33:06*lumo_e joined #nim
20:35:44FromDiscord<sharpcdf> it doesnt work because fish uses different syntax to append to the path
20:35:54FromDiscord<sharpcdf> well
20:36:07FromDiscord<sharpcdf> i can check the shell variable to see if its fish and if it is then run the fish command
20:36:09FromDiscord<sharpcdf> let me try that
20:43:25*qwr quit (Ping timeout: 272 seconds)
21:10:51FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44FA
21:10:59FromDiscord<sharpcdf> you do need to make a new sesssion to work but thats not a big deal
21:15:31Amun-Rasharpcdf: that depends on the mode you opened file with
21:19:11FromDiscord<Phil> sent a long message, see http://ix.io/44FD
21:20:07FromDiscord<sharpcdf> In reply to @Amun-Ra "<@459463405636419594>: that depends on": wdym?
21:20:48FromDiscord<sharpcdf> i opened it with fmAppend because i dont want to get rid of the rest of the file contents
21:23:30FromDiscord<Phil> sent a long message, see http://ix.io/44FG
21:42:24*oprypin quit (Quit: Bye)
21:42:42*oprypin joined #nim
21:43:53FromDiscord<huantian> In reply to @sharpcdf "if i want it": Ok but like if you’re making a program for someone else please don’t touch their bashrc for them
22:04:41FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/D2i
22:06:27*noeontheend joined #nim
22:07:53FromDiscord<sharpcdf> In reply to @huantian "Ok but like if": then what else should i do to permanently add something to the path?
22:08:12FromDiscord<huantian> You tell the user to add the path to their bashrc
22:08:41FromDiscord<sharpcdf> doesnt homebrew and some other things add itself to the path
22:08:53FromDiscord<Phil> In reply to @Elegantbeef "<@180601887916163073>\: here we go": Hmm I take it the nice "field = value" syntax is only possible when approaching the entire thing via macros as opposed to procs?
22:09:55FromDiscord<huantian> In reply to @sharpcdf "doesnt homebrew and some": No idea my imo it’s bad practice
22:09:58FromDiscord<Phil> Overall, what's really nice is that I can pretty easily understand it, so that's roughly what the AST's do in constructor? Huh
22:10:08FromDiscord<huantian> (edit) "my" => "but"
22:10:23FromDiscord<Phil> Was that mostly an exercise for you to see how far you can get without macros on this oen?
22:10:26FromDiscord<Phil> one
22:11:20FromDiscord<Elegantbeef> Matrix bridge really hates me
22:11:36FromDiscord<Elegantbeef> Anyway yea you can only do the `a: type = val` if you have a macro that removes it
22:12:31FromDiscord<huantian> In reply to @huantian "No idea but imo": Most programs I’ve used tell me to edit my zshrc instead of doing it for m
22:12:31FromDiscord<Elegantbeef> I'm going to alias `sudo` to a post of someones keyring in my program
22:12:35FromDiscord<huantian> (edit) "m" => "me"
22:13:06FromDiscord<Elegantbeef> Of course they do mutating a config file automatically is quite silly
22:13:29FromDiscord<huantian> Modded Minecraft moment
22:15:31FromDiscord<# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44FW
22:16:00FromDiscord<Elegantbeef> Is your program's working directory the directory?
22:16:04Amun-Rasharpcdf: make a package for your OS
22:16:19FromDiscord<Elegantbeef> If not you of course need to use absolute or relative paths
22:16:54FromDiscord<Elegantbeef> Luke luke luke
22:17:01FromDiscord<Elegantbeef> What is this? https://github.com/Infinitybeond1/dye/blob/main/src/dye.nim#L36
22:17:03FromDiscord<sharpcdf> In reply to @Amun-Ra "<@459463405636419594>: make a package": is homebrew a package?
22:17:11FromDiscord<sharpcdf> i actually dont remember how i installed it lol
22:17:30FromDiscord<sharpcdf> oh wait no it was a shell script
22:17:33FromDiscord<huantian> homebrew is macos
22:17:44FromDiscord<huantian> and it is the package manager you would make a package for
22:17:48FromDiscord<# Luke> In reply to @Elegantbeef "What is this? https://github.com/Infinitybeond1/dye": very bad code
22:17:55FromDiscord<# Luke> But it does the job
22:17:58FromDiscord<Elegantbeef> `walkDir` `walkPattern`
22:18:08FromDiscord<huantian> your program should (probably) not be installed in the same way as homebrew
22:18:13FromDiscord<Elegantbeef> No it doesnt cause it is causing the issue
22:18:27FromDiscord<# Luke> In reply to @Elegantbeef "`walkDir` `walkPattern`": Yea but it comes out as a tuple and I need it as a sequence
22:18:32FromDiscord<Elegantbeef> ...
22:18:42FromDiscord<sharpcdf> In reply to @huantian "homebrew is macos": also linux
22:18:46FromDiscord<# Luke> .toSeq doesn't work
22:18:54FromDiscord<Elegantbeef> If only you could access a single field and add it to a sequence
22:18:57FromDiscord<huantian> if you use homebrew on linux I will delete your face
22:19:02FromDiscord<sharpcdf> oh shit
22:19:04FromDiscord<Phil> In reply to @Elegantbeef "If only you could": That sounds impossible
22:19:07FromDiscord<sharpcdf> my face has been deleted
22:19:19FromDiscord<# Luke> In reply to @Elegantbeef "If only you could": Wait lemme try something
22:19:28FromDiscord<sharpcdf> well i dont really want to add it to dnf
22:19:32FromDiscord<sharpcdf> let me see how homebrew does it
22:19:35FromDiscord<Phil> In reply to @sharpcdf "also linux": I find that statement to be questionable
22:19:41FromDiscord<sharpcdf> In reply to @Isofruit "I find that statement": how so
22:19:48FromDiscord<sharpcdf> the support is subpar but its there
22:19:56FromDiscord<Phil> Why use something subpar?
22:20:15FromDiscord<sharpcdf> when you're too lazy to manually do something 😆
22:20:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44FX
22:20:51FromDiscord<sharpcdf> i just have it for the few times where the thing im looking for is on there and it has linux support
22:21:16FromDiscord<huantian> hm let's see how you would install something with homebrew vs dnf:↵`homebrew install package`↵`dnf install package`↵wow homebrew really saved me a lot of time there
22:21:24FromDiscord<Elegantbeef> Luke instead of "oh i need to do something best make a shell call" just ask here 😄
22:21:30FromDiscord<Phil> But every distro has their own in built package manager which I would wager is better supported and comes with vaster software support.↵Except arch, pacman doesn't support all that much, but in that case there's the AUR
22:21:44FromDiscord<sharpcdf> In reply to @huantian "hm let's see how": aCtUallY iTs `brew install package`
22:21:50FromDiscord<sharpcdf> (edit) "package`" => "package`"
22:21:53FromDiscord<huantian> whatever 😛
22:22:00FromDiscord<sharpcdf> and i dont want it to be on a package manager whatsoever
22:22:06FromDiscord<# Luke> In reply to @Elegantbeef "Luke instead of "oh": Oh lol ok
22:22:21FromDiscord<sharpcdf> wouldnt you think it would be weird to have a package manager downloaded from a package manager
22:22:29FromDiscord<huantian> i mean
22:22:34FromDiscord<huantian> I have npm installed from pacman
22:22:46FromDiscord<sharpcdf> (╯°□°)╯︵ ┻━┻
22:22:47FromDiscord<Phil> pip as well I'd wager
22:22:51FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/998354120291397683/image.png
22:22:52FromDiscord<sharpcdf> damn it youre right
22:23:02FromDiscord<sharpcdf> but ill only do it as a last resort lol
22:23:04FromDiscord<Phil> flatpac
22:23:06FromDiscord<Phil> (edit) "flatpac" => "flatpack"
22:23:15FromDiscord<sharpcdf> im gonna see if theres any other way first
22:23:20FromDiscord<sharpcdf> to add it to the path
22:23:26FromDiscord<huantian> but uh tldr don't modify people's config files for them, tell them to modify it themselves, or put your program somewhere thats already in the path
22:23:45FromDiscord<sharpcdf> o7
22:24:01FromDiscord<sharpcdf> i kinda agree now that i think about it i wouldnt really want an app changing my config files without my permission
22:24:06FromDiscord<Phil> In reply to @huantian "but uh tldr don't": Wise words! (I mean that in honesty)
22:24:16FromDiscord<sharpcdf> what if i give the end user an option to change it?
22:24:23FromDiscord<sharpcdf> a prompt or something on installation
22:24:29FromDiscord<sharpcdf> and if no then tell them how to manually do it
22:25:04FromDiscord<huantian> or just put it on their package manager and provide a binary download to those who don't want to use the package manager-ed version
22:25:16FromDiscord<Phil> What's preventing you from putting stuff on the folders that'll already be on their path by default?
22:25:28FromDiscord<Elegantbeef> Elevated permissions↵(@Phil)
22:25:36FromDiscord<huantian> tbh doing that is also kinda annoying cus when I uninstall your program I gotta find all your random symlinks and remove them
22:25:50FromDiscord<Elegantbeef> Just distribute an appimage
22:25:52FromDiscord<sharpcdf> In reply to @Isofruit "What's preventing you from": well what folders are those?
22:25:53FromDiscord<Elegantbeef> Did we solve it?!
22:26:15FromDiscord<sharpcdf> In reply to @huantian "tbh doing that is": im planning on adding an uninstall command thatll delete everything and remove from path
22:26:19FromDiscord<huantian> just put your program in nixpkgs and assume everyone is using nix 😛
22:26:26FromDiscord<sharpcdf> lol
22:26:43FromDiscord<huantian> In reply to @sharpcdf "im planning on adding": dude just use the package manager you don't need this much extra logic if you do
22:27:06FromDiscord<sharpcdf> nooooooooo why use package manager when you can do it all manually
22:27:06FromDiscord<Phil> In reply to @Elegantbeef "Elevated permissions (<@180601887916163073>)": Horrible thing that really
22:27:09FromDiscord<sharpcdf> https://tenor.com/view/crying-emoji-gif-21922016
22:27:10*noeontheend quit (Ping timeout: 240 seconds)
22:27:15FromDiscord<sharpcdf> shit lol
22:27:19FromDiscord<Elegantbeef> Windows moment↵(@sharpcdf)
22:27:22FromDiscord<Phil> In reply to @sharpcdf "nooooooooo why use package": Because users like standardized solutions and package managers are that
22:27:41FromDiscord<huantian> if people are using linux they don't want to be using windows
22:27:58FromDiscord<sharpcdf> i want to have it where you download an installer binary and it sets up everything for you
22:28:03FromDiscord<Elegantbeef> People rice linux to look like windows, checkmate↵(@huantian)
22:28:10FromDiscord<huantian> nooooooo
22:28:20FromDiscord<sharpcdf> In reply to @Elegantbeef "People rice linux to": lmao i do that a little bit
22:28:22FromDiscord<Phil> In reply to @Elegantbeef "People rice linux to": I have seen them. They tend to get bullied on the meme sub
22:28:24FromDiscord<Elegantbeef> Aw dude .msi for linux↵(@sharpcdf)
22:28:36FromDiscord<Elegantbeef> Shit we've returned to the 90s
22:28:44FromDiscord<sharpcdf> In reply to @Elegantbeef "Aw dude .msi for": nooooo why is there no .msi for linux its so helpful and has no problems at all
22:28:58FromDiscord<Elegantbeef> Cause we have package managers with the ability to add sources
22:28:59FromDiscord<Phil> name it something innocuous
22:29:11FromDiscord<Elegantbeef> We're not fucking gremlins that think web browsers are the way to distribute software
22:29:11FromDiscord<Phil> like "totally_not-a--virus Installer.exe
22:29:12FromDiscord<Phil> (edit) "Installer.exe" => "Installer.exe""
22:29:25FromDiscord<sharpcdf> In reply to @Elegantbeef "We're not fucking gremlins": pov web dev
22:29:45FromDiscord<Phil> In reply to @sharpcdf "pov web dev": I'm a web dev and that's not my pov
22:29:50FromDiscord<sharpcdf> rip
22:30:03FromDiscord<Elegantbeef> I knew there was something off with phill
22:30:09FromDiscord<sharpcdf> well lets just assume that i fucking hate package managers and manually uninstalled dnf from my system
22:30:29FromDiscord<Phil> like, I like webpages for what they are, but I wouldn't want to write electron apps
22:30:29FromDiscord<Elegantbeef> Well if we assume that i have to assume you have an intellectual deficiency and that's rude
22:30:32FromDiscord<sharpcdf> what folders are in the path that i can put the app in
22:30:41Amun-Ramake a binary and let the user copy it somewhere into $PATH
22:30:46FromDiscord<huantian> ^
22:30:59FromDiscord<huantian> then delete their linux install becuase they uninstalled their package manager and they deserve it
22:31:10FromDiscord<sharpcdf> o7
22:31:26FromDiscord<Phil> In reply to @sharpcdf "well lets just assume": Like... I haven't used fedora before, but how could it be possibly be that bad?↵I just always set up my aliasses for install and set sudo to "please" and then I can just always "please install X"
22:31:31FromDiscord<Phil> and "please remove X"
22:31:44FromDiscord<sharpcdf> In reply to @Isofruit "Like... I haven't used": i dont hate package managers i just dont want to host it on there 😛
22:31:54FromDiscord<Elegantbeef> Exactly
22:31:55FromDiscord<Elegantbeef> There is no folder guaranteed to be in path
22:31:55FromDiscord<Elegantbeef> Atleast userlevel
22:31:57FromDiscord<Elegantbeef> Some people might just `sudo mv yourBinary /usr/bin/`
22:31:58FromDiscord<Elegantbeef> some people might have a `~/.totallynotmalware/` in their path
22:32:12FromDiscord<sharpcdf> thats the thing
22:32:22FromDiscord<sharpcdf> isnt `/usr/bin/` in the path or something like that
22:32:23FromDiscord<sharpcdf> the thing is
22:32:35FromDiscord<sharpcdf> to mv or touch anything in there it needs sudo
22:32:37FromDiscord<Elegantbeef> I swear if you mention sudo
22:32:39FromDiscord<sharpcdf> shit
22:32:41FromDiscord<Elegantbeef> ...
22:32:41FromDiscord<huantian> don't move your binary into /usr/bin I will delete your face again
22:32:44FromDiscord<sharpcdf> uh
22:32:46Amun-Ra/usr/local/bin too
22:32:51FromDiscord<sharpcdf> you saw nothing
22:33:00FromDiscord<sharpcdf> In reply to @Amun-Ra "/usr/local/bin too": does that need sudo
22:33:07Amun-Rayes
22:33:08FromDiscord<sharpcdf> if not we have our folder
22:33:12FromDiscord<sharpcdf> bruh
22:33:15FromDiscord<Elegantbeef> So we'll say again, either use a package manager or let the user manage it
22:33:26FromDiscord<Elegantbeef> A package manager includes flatpak
22:33:32Amun-Ra^ and don't reinvent the square wheel
22:33:33FromDiscord<sharpcdf> alright ill just let the user manage it
22:33:55FromDiscord<Phil> In reply to @Amun-Ra "^ and don't reinvent": Are you saying you don't like us having 50 wheels already?
22:34:04FromDiscord<Elegantbeef> snapd moment↵(@Phil)
22:34:12Amun-Ra;>
22:34:14FromDiscord<Hi02Hi> centipede phil
22:34:28FromDiscord<sharpcdf> but again, what would the problem be with asking them if they want the .bashrc or config.fish or whatever to be edited to add the binary to the path
22:34:37FromDiscord<sharpcdf> and if they say no then just tell them how to do it manually
22:34:40FromDiscord<Elegantbeef> Cause if you fuck up you ruin it↵(@sharpcdf)
22:34:55FromDiscord<sharpcdf> how would you fuck up that badly
22:35:03FromDiscord<Phil> In reply to @sharpcdf "how would you fuck": DO NOT
22:35:06FromDiscord<Phil> ask that question
22:35:25FromDiscord<sharpcdf> mom, all the linux people are scaring me again
22:35:27FromDiscord<Arathanis> In reply to @sharpcdf "how would you fuck": spoken like someone who is about to cause some prod downtime
22:35:29FromDiscord<Phil> The computer is a wily beast, it will sense your moment of inattentiveness and pounce on your weakness
22:35:32FromDiscord<Elegantbeef> I mean you didnt even create a backup before writing over it
22:35:33FromDiscord<Arathanis> trust us dude, dont take chances
22:35:38FromDiscord<Arathanis> eventually you make a mistake
22:35:40FromDiscord<sharpcdf> alright
22:35:41FromDiscord<Elegantbeef> So like you really are optimistic
22:35:43FromDiscord<Arathanis> try and make sure when you make a mistake it wont be a bad one
22:35:44FromDiscord<sharpcdf> no chances
22:35:58FromDiscord<Arathanis> mistakes happen
22:36:02FromDiscord<Arathanis> dont stick your neck out
22:36:05FromDiscord<Phil> In reply to @Arathanis "spoken like someone who": Gave me a laugh, not gonna lie
22:36:08FromDiscord<Elegantbeef> This and condoms would've solved my 100% of my parents problems↵(@Arathanis)
22:36:33FromDiscord<sharpcdf> In reply to @Elegantbeef "So like you really": not really i just havent really seen an error that could have been super bad
22:37:23FromDiscord<sharpcdf> ive already got everything written that appends to the bashrc and fish.config and so once you have the code i wouldnt really think that errors could happen unless it was deliberate
22:37:48FromDiscord<Elegantbeef> You'd think
22:37:55FromDiscord<Phil> In reply to @sharpcdf "not really i just": People wrote bash scripts not thinking it would be bad since they were certain of what they did and somehow still managed to get a line to evaluate to "nuke your filesystem"
22:38:06FromDiscord<sharpcdf> In reply to @Isofruit "People wrote bash scripts": 😳
22:38:24FromDiscord<huantian> cough cough valve
22:38:26FromDiscord<Elegantbeef> There are multiple ways to install and distribute linux software and none of them involve "detecting used shell and writing to it's config"
22:38:27FromDiscord<sharpcdf> yea ill just take no chances and let the user do it manually
22:38:32FromDiscord<sharpcdf> In reply to @huantian "cough cough valve": actual facts
22:38:47FromDiscord<Elegantbeef> You can detect the shell and prompt with the required addition
22:38:50FromDiscord<Elegantbeef> But do not do it automatically
22:39:10FromDiscord<Elegantbeef> Also you shell detection is a joke
22:39:17FromDiscord<Elegantbeef> your\
22:39:23FromDiscord<sharpcdf> yea i know lol
22:39:26FromDiscord<Elegantbeef> `getEnv("SHELL")` is how you see what shell they're using
22:39:42FromDiscord<Elegantbeef> checking if the binary exists just means you're overwriting a config they may use for other things
22:39:50FromDiscord<sharpcdf> In reply to @Elegantbeef "`getEnv("SHELL")` is how you": thats what i was using before but i thought it would be more effective if i just checked if it existed at all
22:40:10FromDiscord<Elegantbeef> "more effective"
22:40:14FromDiscord<sharpcdf> lmao
22:40:27FromDiscord<Elegantbeef> Yea to fuck someones day over
22:40:32FromDiscord<Elegantbeef> @.luke\: how goes your dye
22:40:37FromDiscord<sharpcdf> well im gonna go eat pizza, thanks for the life lesson
22:40:56FromDiscord<Elegantbeef> Just remember dont forcibly insert the pizza that's how you choke 😛
22:40:56FromDiscord<huantian> Enjoy your pizza
22:41:24FromDiscord<# Luke> In reply to @Elegantbeef "<@704106773660827690>\: how goes your": Well it works
22:41:36FromDiscord<Elegantbeef> Without shell commands for finding files?
22:41:51FromDiscord<# Luke> Lmao yes
22:42:02FromDiscord<Elegantbeef> Niice
22:42:21*Jjp137 quit (Ping timeout: 244 seconds)
22:45:09*Jjp137 joined #nim
22:46:30*krux02 quit (Remote host closed the connection)
23:19:34FromDiscord<acikek> Is there a library where if you pass it a URI with `file` schema, it just reads and provides that file's data, but with an `http(s)` schema it'll try to download the file? or do I have to decode the uri and then handle that myself
23:20:33FromDiscord<huantian> I don’t think so, you’ll probably wanna do it yourself
23:20:46FromDiscord<# Luke> In reply to @Elegantbeef "image.png": tf?
23:21:03FromDiscord<acikek> alright
23:21:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44G7
23:21:24FromDiscord<Elegantbeef> tf what?↵(@.luke)
23:21:25FromDiscord<acikek> hmm
23:22:14FromDiscord<# Luke> In reply to @Elegantbeef "tf what? (<@704106773660827690>)": apt has dnf?
23:22:14FromDiscord<Elegantbeef> It's probably infinitely smarter to reason if it's a path or a website
23:22:20FromDiscord<Elegantbeef> Of course
23:22:34FromDiscord<# Luke> ive never seen that b4
23:22:42FromDiscord<huantian> so does pacman
23:22:43FromDiscord<Elegantbeef> Well debian has dnf
23:22:49FromDiscord<# Luke> In reply to @huantian "so does pacman": it does??
23:23:22FromDiscord<# Luke> lmao installing dnf on arch linux
23:23:23FromDiscord<huantian> most distros have other package managers in their own package manager
23:23:32FromDiscord<Elegantbeef> I mean it's software
23:23:37FromDiscord<# Luke> In reply to @huantian "most distros have other": can i get apt?
23:23:41FromDiscord<# Luke> lmao
23:24:14FromDiscord<Elegantbeef> You probably can
23:24:27FromDiscord<Elegantbeef> Good luck successfully using it though 😄
23:24:51FromDiscord<# Luke> In reply to @Elegantbeef "You probably can": its not in the repos, ill check the aur
23:25:56FromDiscord<# Luke> ah its not in there
23:26:12FromDiscord<# Luke> but now i have a wannabe fedora on archlinux
23:26:29FromDiscord<huantian> wdym https://media.discordapp.net/attachments/371759389889003532/998370134618030223/unknown.png
23:26:50FromDiscord<# Luke> hmm i used apt-git lol
23:27:15FromDiscord<Elegantbeef> They dont ship software sources right?
23:27:29FromDiscord<huantian> who's they?
23:27:38FromDiscord<Elegantbeef> The apt/dnf packages
23:27:46FromDiscord<huantian> probably not yeah
23:28:02FromDiscord<Elegantbeef> Yea that's what i figured it's mostly pointless
23:28:41FromDiscord<voidwalker> what is the optimal way to get a string from a seq[string] ?
23:28:51FromDiscord<Elegantbeef> `join` is the easiest
23:29:16FromDiscord<# Luke> In reply to @Elegantbeef "The apt/dnf packages": yea but i can fix that
23:29:46FromDiscord<# Luke> well i cant fix the packages, but i can get dnf on arch linux
23:32:55FromDiscord<# Luke> https://media.discordapp.net/attachments/371759389889003532/998371753220919436/20220717_18h32m24s_grim.png
23:34:32FromDiscord<huantian> that pixel font is making me think I'm playing minecraft
23:34:43FromDiscord<# Luke> proof im on arch https://media.discordapp.net/attachments/371759389889003532/998372206507737229/20220717_18h34m09s_grim.png
23:35:02FromDiscord<# Luke> In reply to @huantian "that pixel font is": lol yea
23:36:02*toluene quit (Read error: Connection reset by peer)
23:40:50*toluene joined #nim
23:44:39*wallabra is now known as wallabra_
23:44:47*wallabra_ is now known as wallabra