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