<< 03-02-2023 >>

00:00:11FromDiscord<PunchCake> You literally write your app once and run it anywhere even in embedded systems
00:00:19FromDiscord<Hourglass [She/Her]> Oh neat
00:00:41FromDiscord<PunchCake> The neat thing is that now c# support aot so you dont need to bundle a runtime at all
00:00:56FromDiscord<PunchCake> Which reduces the size of the app by like what 20 mb
00:02:08FromDiscord<PunchCake> In reply to @Hourglass, When the Hour Strikes "Oh neat": Forgot to mention that it runs on android and ios too
00:05:57FromDiscord<Gumbercules> I think I'd rather stab my eyeballs with a rusty fork than write more C#
00:06:07FromDiscord<Gumbercules> it's slightly less terrible than writing Java
00:06:14FromDiscord<Gumbercules> Nim and Elixir have spoiled me though
00:06:55FromDiscord<PunchCake> In reply to @Gumbercules "I think I'd rather": Wdym c# is OK
00:07:11FromDiscord<PunchCake> Or maybe because I've been writing java a lot nowadays
00:07:14FromDiscord<Gumbercules> I've been programming a long time
00:07:23FromDiscord<Gumbercules> easy to get jaded by certain languages
00:07:24FromDiscord<PunchCake> But even java isnt that bad
00:07:32FromDiscord<Gumbercules> I'd rather code in C than C# or Java
00:07:36FromDiscord<PunchCake> Why
00:07:36FromDiscord<Gumbercules> I actually like C
00:07:42FromDiscord<auxym> the quality of tooling around c# (and even modern java TBH) makes it not that bad
00:07:53FromDiscord<Gumbercules> because I dislike being forced into certain paradigms
00:07:55FromDiscord<PunchCake> Nah java tooling is ass
00:08:00FromDiscord<Gumbercules> especially object oriented paradigms
00:08:07FromDiscord<PunchCake> Nowdays no decent ui lib exists for java
00:08:19FromDiscord<PunchCake> You'd say javafx try bundling an app
00:08:30FromDiscord<auxym> Nim is nice, but then you have to deal with nimble, nimsuggest, no refactoring tools, nimpretty is pretty useless, and debugging in gdb vs idea/vs
00:08:40FromDiscord<Gumbercules> I also dislike languages that have weighty runtimes - which is why I don't use Rust or Zig or any LLVM language atm
00:08:51FromDiscord<PunchCake> Tbh
00:09:02FromDiscord<PunchCake> Nimble should install package like npm
00:09:05FromDiscord<PunchCake> Not globally
00:09:06FromDiscord<Gumbercules> although if Vale materializes I'd be interested in trying it out
00:09:10FromDiscord<Gumbercules> yeah Nimble is terrible
00:09:14FromDiscord<Gumbercules> but the author write it when they were like 15 years old
00:09:23FromDiscord<auxym> no decent UI lib exists for nim either 😉
00:09:23FromDiscord<Gumbercules> in their defense - although I don't know why I'm defending them....
00:09:26FromDiscord<PunchCake> Cant we just for and improve
00:09:40FromDiscord<PunchCake> Wont take much work to make it install in the default workplace dir
00:09:42FromDiscord<Gumbercules> I'd start from scratch, but tha'ts just me
00:09:47FromDiscord<Gumbercules> way too many bad design decisions made
00:09:48FromDiscord<PunchCake> (edit) "for" => "fork it"
00:10:03FromDiscord<PunchCake> Why they still rolling with it
00:10:12FromDiscord<PunchCake> Just make a new one and deprecate it
00:10:22FromDiscord<Gumbercules> well you'd need someone with the initiative to do that
00:10:24FromDiscord<Gumbercules> there are alternatives
00:10:26FromDiscord<Gumbercules> like nimph
00:10:31FromDiscord<Gumbercules> and probably others as well
00:10:39FromDiscord<Gumbercules> I just use git submodules which are also terrible, but less so than Nimble
00:10:48FromDiscord<PunchCake> Gumb lets make a new package manager
00:10:54FromDiscord<PunchCake> And call it nympho
00:11:04FromDiscord<PunchCake> Its a done deal bro
00:11:19FromDiscord<Gumbercules> lol
00:11:29FromDiscord<Gumbercules> I barley have time for my project
00:11:36FromDiscord<Gumbercules> barely even
00:11:40FromDiscord<PunchCake> Rip
00:11:45FromDiscord<Gumbercules> having a kid puts a damper on your programming life
00:11:52FromDiscord<PunchCake> Just
00:11:59FromDiscord<PunchCake> Let your wife handle it
00:12:02FromDiscord<Gumbercules> until I teach him to program
00:12:03FromDiscord<PunchCake> Easy
00:12:07FromDiscord<Gumbercules> In reply to @PunchCake "Let your wife handle": HAH
00:12:12FromDiscord<Gumbercules> I wish
00:12:19FromDiscord<PunchCake> Wdym I wish
00:12:28FromDiscord<auxym> TBH if I was going to dump time in nim tooling, I'd prioritize a nice LSP and formatting tool (replacing nimsuggest/nimpretty) over nimble
00:12:32FromDiscord<PunchCake> Its easy
00:12:41FromDiscord<PunchCake> You say do this she does this
00:12:47FromDiscord<Gumbercules> she does take care of him a lot, but right now I'm on parental leave
00:12:54FromDiscord<Gumbercules> until April 1
00:12:56FromDiscord<PunchCake> Whats that
00:13:00FromDiscord<PunchCake> Vacation?
00:13:07FromDiscord<Gumbercules> my employer gave me four months of paid leave to hang out with the baby
00:13:07FromDiscord<Gumbercules> yeah
00:13:09FromDiscord<Gumbercules> basically
00:13:19FromDiscord<PunchCake> Wait how old is your child?
00:13:33FromDiscord<Gumbercules> if I was still in Finland I would have had a year, but I left Finland to get hitched
00:13:49FromDiscord<Gumbercules> he turned six months last Sunday
00:13:49FromDiscord<PunchCake> Finland cold
00:13:52FromDiscord<PunchCake> Cold bad
00:13:53FromDiscord<Gumbercules> twas
00:13:58FromDiscord<Gumbercules> eh, you get used to it
00:14:02FromDiscord<Gumbercules> just gotta put on layers
00:14:07FromDiscord<PunchCake> In reply to @Gumbercules "he turned six months": Damn bro thats crazy congrats on the new born
00:14:11FromDiscord<Gumbercules> danke
00:14:17FromDiscord<PunchCake> Teach him chess
00:14:22FromDiscord<PunchCake> And make him be a grandmaster
00:14:26FromDiscord<Gumbercules> lol there's a Bluey episode about that
00:14:30FromDiscord<Gumbercules> which is our new favorite cartoon
00:14:40FromDiscord<PunchCake> Chess can never go wrong
00:14:54FromDiscord<PunchCake> I have yet to meet someone who's life got ruined by chess
00:15:07FromDiscord<Gumbercules> we're working on eating goop rn
00:15:13FromDiscord<Gumbercules> chess might be next
00:15:25FromDiscord<PunchCake> Hopefully
00:15:29FromDiscord<PunchCake> Do you play?
00:16:01FromDiscord<Gumbercules> Nah - I mean occasionally when I'm bored on my phone or something but not with any dedication
00:16:11FromDiscord<PunchCake> Hm yeah
00:16:17FromDiscord<PunchCake> Its practically my life now
00:16:23FromDiscord<Gumbercules> my hobbies are - astrophotography, programming, kid and dog pretty much
00:16:29FromDiscord<Gumbercules> not in that order
00:16:35FromDiscord<Gumbercules> (edit) "dog" => "dogs"
00:16:51FromDiscord<PunchCake> What in the living hell is astropornography
00:17:25FromDiscord<PunchCake> Astrophotography
00:17:31FromDiscord<PunchCake> God damn so hard to spell
00:17:38FromDiscord<Gumbercules> space porn sounds cooler
00:17:49FromDiscord<PunchCake> futurama rule 34
00:18:18FromDiscord<PunchCake> Let me look up astro photo whatever it is
00:18:32FromDiscord<Gumbercules> https://media.discordapp.net/attachments/371759389889003532/1070860803164602378/andromeda_processed.png
00:18:37FromDiscord<Gumbercules> I was trying to find a picture
00:18:48FromDiscord<Gumbercules> shot that last summer
00:18:55FromDiscord<PunchCake> So you take pictures of stars and planets?
00:19:01FromDiscord<PunchCake> In reply to @Gumbercules "shot that last summer": No way you did bro
00:19:07FromDiscord<PunchCake> It looks insane
00:19:13FromDiscord<Gumbercules> https://media.discordapp.net/attachments/371759389889003532/1070860977303720132/orion_small.png
00:19:23FromDiscord<PunchCake> How the hell do you manage to zoom in that much
00:19:26FromDiscord<Gumbercules> I started the hobby last summer - that shot of Andromeda was about two months in
00:19:34FromDiscord<Gumbercules> to starting the hobby
00:19:58FromDiscord<Gumbercules> second pic was more recent - but I haven't really gotten the subs I want yet to spend the amount of time required to make a decent pic of the Orion Nebula
00:20:05FromDiscord<Gumbercules> In reply to @PunchCake "How the hell do": https://williamoptics.com/redcat-51-ii
00:20:34FromDiscord<PunchCake> For 840 i can take pictures like that
00:20:38FromDiscord<Gumbercules> no way
00:20:39FromDiscord<PunchCake> What a steal
00:20:47FromDiscord<Gumbercules> my setup costs more around $2500
00:20:53FromDiscord<PunchCake> I knew it
00:21:04FromDiscord<Gumbercules> about to spend another $2000 on it
00:21:13FromDiscord<PunchCake> lmaoo
00:21:17FromDiscord<Gumbercules> on https://astronomy-imaging-camera.com/product/zwo-am5-harmonic-equatorial-mount
00:21:23FromDiscord<PunchCake> Just buy a car and throw a turbo on it
00:21:31FromDiscord<Gumbercules> if a car could take me to space
00:21:36FromDiscord<PunchCake> Its way more fun than taking pictures of the sky
00:21:45FromDiscord<Gumbercules> meh
00:21:52FromDiscord<PunchCake> Wdym meh
00:21:59FromDiscord<PunchCake> Whats the fastest car you've been in
00:22:17FromDiscord<Gumbercules> I think I got my 1.8t up to 130ish when I was drunk and young
00:22:22FromDiscord<Gumbercules> that's probably the fastest I've ever driven
00:22:29FromDiscord<Gumbercules> don't drink and drive kids
00:22:41FromDiscord<PunchCake> 130 mph?
00:22:45FromDiscord<Gumbercules> yeah
00:22:55FromDiscord<PunchCake> Shit thats like what 260 km?
00:23:07FromDiscord<Gumbercules> little bit more but yeah
00:23:08FromDiscord<Gumbercules> around there
00:23:20FromDiscord<Gumbercules> 209.215
00:23:22FromDiscord<PunchCake> How did you not crash bro I can barley go that fast even when im sober
00:23:23FromDiscord<Gumbercules> apparently
00:23:38FromDiscord<Gumbercules> I wasn't that drunk - just kind of drunk
00:23:44FromDiscord<PunchCake> Tipsy
00:24:05FromDiscord<Gumbercules> yeah - it was very early in the morning and my friends and I were heading back to our uni from the beach
00:24:15FromDiscord<Gumbercules> got kicked out of our motel and everyone wanted to be back
00:24:31FromDiscord<Gumbercules> was a 2 lane highway and there wasn't any traffic at whatever ungodly hour it was
00:24:59FromDiscord<PunchCake> lmao classic
00:25:20FromDiscord<PunchCake> At what age did you actually have the most fun?
00:26:04FromDiscord<PunchCake> Everyone I ask says from 20 to 25
00:27:27FromDiscord<Gumbercules> mmm I dunno - I had very little self-awareness when I was younger and that caused me quite a bit of personal drama later in my young adult life
00:27:36FromDiscord<Gumbercules> late twenties / early thirties to be more specific
00:28:08FromDiscord<Gumbercules> basically undiagnosed ADHD / autism - not really sure
00:28:26FromDiscord<Gumbercules> but I drank a lot and got into a lot of trouble and then into problem drinking, two rehab stints
00:28:28FromDiscord<PunchCake> Little self awareness is good
00:28:42FromDiscord<Gumbercules> well, for me it just ended in lots of grief
00:28:58FromDiscord<PunchCake> Yeah
00:29:01FromDiscord<Gumbercules> early twenties were fun -but mostly just lots of binge drinking
00:29:08FromDiscord<Gumbercules> ingesting various substances
00:29:14FromDiscord<PunchCake> Drinking sucks man
00:29:16FromDiscord<Gumbercules> I'd say I'm having the best time I've had in my life, now
00:29:22FromDiscord<Gumbercules> yeah, I'm not a big fan anymore
00:29:33FromDiscord<Gumbercules> a beer every now and then is fine, anymore than that is no bueno
00:29:50FromDiscord<PunchCake> Unless its jack Daniels of course its not
00:30:00FromDiscord<Gumbercules> the only drug I really enjoy anymore is mushrooms and I can't really eat mushrooms around kids
00:30:23FromDiscord<Gumbercules> but if my wife ever gives me the thumbs up and I have zero responsibilities, that's what I'd go for
00:30:34FromDiscord<Gumbercules> we're very off topic btw
00:30:35FromDiscord<Gumbercules> lol
00:30:43FromDiscord<PunchCake> Extremely yes
00:30:57FromDiscord<Array in ∀ Matrix> sir this is the nim programming language kek
00:31:03FromDiscord<PunchCake> But eh i think the only time i ever enjoyed life is when i has endless women
00:31:07FromDiscord<Gumbercules> it's okay - I used to be a mod so I can tell the other mods to shut up, but yeah let's try to steer it back towards Nim
00:31:07FromDiscord<Girvo> Any reason why `std/httpclient` would be running my server out of sockets? It seems to not re-use them, and it's keeping them all in `ESTABLISHED` for way too long, long after the request/response has completed from the looks of it
00:31:16FromDiscord<Phil> In reply to @PunchCake "But eh i think": Nim, shrooms, what's the difference
00:31:19FromDiscord<Gumbercules> true
00:31:30FromDiscord<Gumbercules> I gotta run anyway - it's been fun
00:31:40FromDiscord<Gumbercules> be back later tonight
00:31:43FromDiscord<PunchCake> take care bro
00:31:46FromDiscord<Gumbercules> you too!
00:31:47FromDiscord<Phil> In reply to @Girvo "Any reason why `std/httpclient`": Without having any closer clue since I never dealt with sockets that closely... maybe it's got something to do with that clients can only deal with one request at a time?
00:31:53FromDiscord<PunchCake> The night is over for me its 3 30 am
00:33:42FromDiscord<Girvo> In reply to @Isofruit "Without having any closer": Possibly. Each api function creates it's own httpclient instance, and sends a request, then returns the response (async, via std/asyncdispatch). Now, our devices _are_ hitting this server quite hard, but not "65K concurrent connections" hard, orders of magnitude less
00:34:13FromDiscord<Girvo> But `netstat -an | grep ESTAB | wc -l` just keeps ticking up and up and up
00:34:38FromDiscord<Girvo> Its like it's not closing the connection even after the function is returned
00:34:59FromDiscord<Phil> Is the client maybe thrown away before the connection can close?
00:35:09FromDiscord<Girvo> It's possible
00:35:45FromDiscord<Girvo> I'm honestly not super up to date with how the internals of that gets handled in Nim. I do know it's likely our collector thread that's causing the issue
00:36:16FromDiscord<Girvo> Hmm. Maybe that's the issue: it's in a thread, but the rest of it was refactored to be asyncdispatch based
00:38:07FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4mVc
00:38:24FromDiscord<Girvo> The rest of the system is just regular old async stuff now, this is the only direct thread that remains
00:38:42FromDiscord<Phil> Ever since I notced that the async-client can't do 2 requests at once I've found the std/httpclient api dodgy enough that it not properly closing things would be my first assumption
00:38:50FromDiscord<Girvo> Yeah
00:38:56FromDiscord<Girvo> I might just rip it out, replace it with something more robust
00:39:18FromDiscord<Girvo> I'm likely replacing asyncdispatch with chronos too, so might be worth using it's http stuff for this part
00:39:31FromDiscord<Girvo> (Once I figured out how to use Chrono's stuff for raw TCP sockets anyway)
01:28:18*xet7 quit (Remote host closed the connection)
02:35:02FromDiscord<Gumbercules> back
02:35:14FromDiscord<Gumbercules> time to draw some shit with wgpu
02:37:45FromDiscord<Gumbercules> really tho, probably going to spend all night figuring out how to implement this render graph
02:42:45FromDiscord<Elegantbeef> Seems like a lot of work to draw faeces
02:46:28FromDiscord<Gumbercules> this isn't ordinary shit
03:43:26*peterhil quit (Remote host closed the connection)
03:43:58*peterhil joined #nim
03:45:18*arkurious quit (Quit: Leaving)
05:57:23*rockcavera quit (Remote host closed the connection)
06:43:51*kenran joined #nim
07:44:00*PMunch joined #nim
07:53:04*peterhil quit (Ping timeout: 248 seconds)
07:56:08*peterhil joined #nim
08:01:53*peterhil quit (Ping timeout: 256 seconds)
08:04:42*peterhil joined #nim
09:26:08FromDiscord<EyeCon> In reply to @Amun-Ra "I started the project": That's a beautiful collection, thanks!
09:57:53*PMunch quit (Quit: Leaving)
10:12:10*PMunch joined #nim
11:13:36*jmdaemon quit (Ping timeout: 248 seconds)
11:37:51*m33mt33n joined #nim
11:39:42*m33mt33n quit (Client Quit)
13:06:48FromDiscord<Piqueiras> Is it okay if I learn metaprogramming from Nim without any idea on it or I should look onto other stuff first lol↵↵(I swear after a year and a half of using C at uni I learned from online code you can #define MAX(a, b))
13:20:07FromDiscord<hotdog> In reply to @Piqueiras "Is it okay if": I think you can probably just start with Nim and see how you get on. Look at templates and very simple macros to begin with
13:28:58FromDiscord<Piqueiras> I saw that like... Templates are similar to those C preprocessor macros?
13:29:05FromDiscord<Piqueiras> Yeah I need to get into it
13:29:23FromDiscord<Piqueiras> Are tutorials II and III the best for it?
13:29:41FromDiscord<leorize> not really
13:31:18FromDiscord<leorize> nim templates are very different from C macros, though it behaves somewhat the same for common cases
13:41:15*derpydoo joined #nim
13:46:25FromDiscord<hotdog> In reply to @Piqueiras "Are tutorials II and": Yeah try the stuff linked on nim-lang.org docs page
13:46:51Amun-RaEyeCon: thank you :)
13:49:37FromDiscord<Piqueiras> Time to go into std/macros and see random examples
13:58:37FromDiscord<leorize> except that there are none in there \:p
14:00:02FromDiscord<auxym> In reply to @Piqueiras "Time to go into": beef's tutorial is a pretty good introduction for macros IMO: https://dev.to/beef331/demystification-of-macros-in-nim-13n8
14:00:34FromDiscord<firasuke> can you use escape sequences in multiline strings?
14:01:06FromDiscord<Piqueiras> I mean I think the main problem would be that I havent stumbled on a problem where I thought "mmm I might need macros" cuz idk what they are lol
14:01:17FromDiscord<auxym> see also: https://nim-by-example.github.io/macros/
14:01:36FromDiscord<auxym> In reply to @firasuke "can you use escape": yes
14:01:42FromDiscord<Piqueiras> (havent even used templates)
14:02:00FromDiscord<firasuke> In reply to @auxym "yes": how? for multiline strings I can only use `"""` which doesn't support escape sequences
14:03:58FromDiscord<auxym> oh my mistake. I remembered they did... apparently not. I guess you can use string formatting to insert characters, or write an array of lines and `.join("")` them
14:05:07FromDiscord<leorize> if you have a lot of boilerplate that requires some adjustment based on some user-defined parameters, then macros are pretty nice↵(@Piqueiras)
14:05:18FromDiscord<leorize> most people are not gonna need it, though
14:05:27FromDiscord<firasuke> In reply to @auxym "oh my mistake. I": it's for a constant lol
14:05:33FromDiscord<auxym> In reply to @Piqueiras "(havent even used templates)": the debug log example in https://nim-lang.org/docs/tut2.html is a decent motivating example for templates
14:05:47FromDiscord<auxym> In reply to @firasuke "it's for a constant": both things I suggested will work for a const
14:06:01FromDiscord<auxym> the formatting/joining will run at CT in the nim vm
14:06:38FromDiscord<firasuke> this is frustrating really, why aren't escape sequences supported on multiline strings?
14:07:06FromDiscord<firasuke> or why can't regular strings that support escape sequences span multiple lines?
14:17:35*derpydoo quit (Ping timeout: 260 seconds)
14:19:05*rockcavera joined #nim
14:38:53FromDiscord<4zv4l> I don't find in which file does `GetModuleFileNameW` is defined in `winim` ↵Also I feel like it misses a lot of doc from https://khchen.github.io/winim/winim.html
14:41:16FromDiscord<4zv4l> ok found it in `winbase`
14:45:22FromDiscord<Piqueiras> Im also trying modular arithmetics, how do I do this lmao https://media.discordapp.net/attachments/371759389889003532/1071078950895362068/image.png
14:57:43FromDiscord<sOkam!> I have to process a bunch of files, that shouldn't be processed always, only when they have changed↵What would be a good way to approach that with nim?↵Is there an existing proc in the std to check for this?
14:58:05FromDiscord<sOkam!> (edit) "shouldn't" => "sometimes don't need to" | "processed always," => "processed,"
14:58:48FromDiscord<leorize> just store the hash of those files somewhere so you know that you can skip them
14:59:15FromDiscord<sOkam!> how would you store those hashes, and how do you calculate them?
14:59:32FromDiscord<sOkam!> i guess a file for the first, but is there a proc in std for the second?
14:59:55FromDiscord<leorize> std/sha1 is probably what you need
15:00:02FromDiscord<sOkam!> kk ty
15:02:36FromDiscord<sOkam!> @leorize any reason for sha1 and not md5? or the opposite?
15:03:23FromDiscord<crow> aren't both hashes severely outdated with no good use case?
15:03:30FromDiscord<crow> (both md5 and sha1)
15:03:41FromDiscord<leorize> sha1 is better than md5
15:04:00FromDiscord<leorize> a good middle ground between somewhat secure and fast enough for a non-sensitive job
15:04:11FromDiscord<sOkam!> kk
15:04:31FromDiscord<leorize> for sha2 and stuff you need nimcrypto or just use openssl
15:05:18FromDiscord<sOkam!> as long as its fast, then im fine. its just for a buildsystem after all
15:06:52FromDiscord<crow> In reply to @sOkam! "I have to process": another idea would be to use the system wide `sha256sum` program maybe?
15:07:03FromDiscord<sOkam!> json good for storing the hashes, or better in some other way?↵was thinking of storing key:value as filepath:hash
15:07:46FromDiscord<crow> sha256sum displays hashes in the `hash<space>filename` format
15:07:59FromDiscord<crow> you can `sha256sum ` in a folder to get the hash of everything
15:08:17FromDiscord<crow> (edit) "`hash<space>filename`" => "`hash<whitespace>filename`"
15:08:22FromDiscord<sOkam!> how do you access it?
15:08:41FromDiscord<sOkam!> meaning the function name, i cant seem to find it in the docs
15:09:00FromDiscord<crow> sha256sum is an executable, not part of nim
15:09:17FromDiscord<sOkam!> oh!
15:09:35FromDiscord<crow> also, should've mentioned that it's called something else on windows
15:09:44FromDiscord<crow> so i guess not the best idea in the end
15:09:45FromDiscord<sOkam!> well i would rather not make the buildsystem non-portable. i went that way before, and no thanks it always backfires
15:10:37FromDiscord<jtv> OpenSSL has sha256 in there somewhere, tho it's not well documented how to access from Nim. I actually pull a 3rd-party implementation that's solid because it's easy
15:11:06FromDiscord<leorize> a database is probably better, try sqlite↵(@sOkam!)
15:11:14FromDiscord<sOkam!> isn't md5 fast and simple enough for avoiding file clashes?
15:11:20FromDiscord<jtv> 'nimsha2' is the package
15:11:31FromDiscord<sOkam!> In reply to @leorize "a database is probably": good thinking
15:12:21FromDiscord<jtv> Yeah, but you will also have people scoff at you if you're using it in any context. The file system IO dominates the cost, sha256 vs md5 doesn't really matter
15:12:31*PMunch quit (Quit: Leaving)
15:12:33FromDiscord<jtv> Disk access is SLOOOW
15:12:35FromDiscord<sOkam!> i assume its gonna be faster to query the sqlite database than searching in a json 🤔
15:13:13FromDiscord<sOkam!> In reply to @jtv "Yeah, but you will": k makes sense
15:14:43FromDiscord<leorize> sha2 is hw-accelerated on common x86 processors too, but not as fast as naive sha1
15:20:29FromDiscord<auxym> In reply to @Piqueiras "Im also trying modular": you probably want to use a distinct type, the way you defined it is a plain type alias, so any `0..(N-1)` is also a `Modulo` and vice versa↵`type Modulo[N: static int] = distinct range[0 .. (N - 1)]`
15:21:37FromDiscord<Piqueiras> I tried some code I found which just did distinct int and then ensured it doesnt go over the limit
15:21:45FromDiscord<auxym> @sOkam! do you really need to hash files? AFAIK make and build systems like that just check the mtime
15:22:29FromDiscord<jtv> I've run into clock issues 1m times that have led to unnecessary work
15:22:38FromDiscord<jtv> I always hash for that kind of thing now personally
15:22:50FromDiscord<Piqueiras> but im having such a mess with generics rn
15:23:41FromDiscord<Piqueiras> https://media.discordapp.net/attachments/371759389889003532/1071088594875334686/image.png https://media.discordapp.net/attachments/371759389889003532/1071088595177308160/image.png https://media.discordapp.net/attachments/371759389889003532/1071088595366064309/image.png
15:24:01FromDiscord<Piqueiras> how can I make it so i dont have to write [13](10)
15:24:24FromDiscord<Piqueiras> maybe↵var x = 10 modulo 13
15:24:39FromDiscord<jtv> N is a type, 13 isn't a type, so I don't understand why you're even doing that
15:25:04FromDiscord<jtv> Why try to have a generic type that is just always an int??
15:25:41FromDiscord<Piqueiras> intention would be that if x=10 mod 13 and y=5 mod 13 then x+y=2
15:27:28FromDiscord<planetis> N must be static int @Piqueiras
15:30:44FromDiscord<Piqueiras> can I then make the initModeInt[N](n) function "prettier"?
15:31:55FromDiscord<jtv> Again, it would help to understand what you're trying to accomplish over just using mod directly?
15:32:12FromDiscord<jtv> Because the prettiest would be to make N a const and just do a mod N
15:32:27FromDiscord<Piqueiras> a different type I guess
15:32:30FromDiscord<jtv> The rest just seems to be needless complexity doing nothing
15:32:32FromDiscord<Piqueiras> im trying random stuff tbh
15:33:09FromDiscord<Piqueiras> based from this https://rosettacode.org/wiki/Modular_arithmetic#Nim
15:33:32FromDiscord<Piqueiras> but thought this was kinda ugly https://media.discordapp.net/attachments/371759389889003532/1071091072077406229/image.png
15:33:33FromDiscord<sOkam!> In reply to @auxym "<@186489007247589376> do you": if you `touch` a file by accident, without modifying, it rebuilds or rechecks even if its not needed↵that's what happens in make, and when i switched to scons it felt so much better to have md5 checks instead
15:34:31FromDiscord<auxym> In reply to @Piqueiras "can I then make": it's already a single line, not sure how much you expect to be able to simplify it
15:34:45FromDiscord<auxym> you can remove `result =`, it's implicit, if you want to
15:34:56FromDiscord<Piqueiras> I mean the function call
15:35:27FromDiscord<Piqueiras> I know its useless but was looking for a way to turn it into sth like "var x = 10 modulo 13"
15:36:17*jmdaemon joined #nim
15:36:20FromDiscord<auxym> IIRC nim doesn't support arbitrary infix operators like that
15:36:54FromDiscord<Piqueiras> 10.modulo(13) might be enough tbh
15:37:08FromDiscord<auxym> symbols would work, you'd have to define some sort of operator like `10 %|| 13` or something
15:37:09FromDiscord<jtv> That can just be a function that take two ints
15:37:27FromDiscord<jtv> If it's not generic in particular, a.func(b) and func(a, b) are the same
15:38:23FromDiscord<Piqueiras> I tried doing a function and it raises an error in the other function lol
15:39:50FromDiscord<auxym> ``template `%||(a: int, b: static int): untyped = Modulo[b](a)``
15:39:54FromDiscord<Piqueiras> sent a code paste, see https://play.nim-lang.org/#ix=4mZH
15:40:35FromDiscord<auxym> you probably have to use static int somewhere in there
15:42:09FromDiscord<Piqueiras> oh lmao now it works
15:42:16FromDiscord<Piqueiras> thats what I was looking for all along
15:42:17FromDiscord<Piqueiras> tysm
15:43:44FromDiscord<auxym> In reply to @sOkam! "if you `touch` a": sure just be aware it'll be slow if you have large files. no matter which hash you choose, you have to read the full file contents from disk
15:43:49FromDiscord<EyeCon> 5'm(10) is also a possibility, see: http://nim-lang.github.io/Nim/manual.html#numeric-literals-custom-numeric-literals
15:46:09FromDiscord<sOkam!> In reply to @auxym "sure just be aware": true that. will remember. its a good point for non-source-code files ✍️
15:53:30*jmdaemon quit (Ping timeout: 255 seconds)
15:54:35*jmdaemon joined #nim
16:21:15*arkurious joined #nim
16:23:38FromDiscord<Piqueiras> is there an operator to make -3 mod 7 return 4?
16:28:29FromDiscord<Piqueiras> I guess.. https://media.discordapp.net/attachments/371759389889003532/1071104901897261176/image.png
16:29:22FromDiscord<planetis> In reply to @Piqueiras "is there an operator": math.floorMod
16:32:27*uics joined #nim
16:43:55*jmdaemon quit (Ping timeout: 252 seconds)
16:51:07*kenran` joined #nim
16:52:43*kenran quit (Ping timeout: 252 seconds)
16:57:44*kenran` quit (Remote host closed the connection)
17:04:08*uics quit (Remote host closed the connection)
17:05:37*jmdaemon joined #nim
17:12:17*jmdaemon quit (Ping timeout: 268 seconds)
17:36:26*uics joined #nim
17:41:38*uics quit (Remote host closed the connection)
18:01:41*uics joined #nim
18:24:02*uics quit (Remote host closed the connection)
18:30:09FromDiscord<mratsim> In reply to @jtv "OpenSSL has sha256 in": The sha256 is not accessible from C in one of their latest version↵↵https://github.com/mratsim/constantine/blob/95114bf7079e0d037c4333bde76ddc14d8e7bf42/tests/t_hash_sha256_vs_openssl.nim#L31
18:52:47FromDiscord<Tuatarian> can I use valgrind on nim code?
18:53:05FromDiscord<Tuatarian> using ARC and `-d:useMalloc`
18:53:53Zevvsure you can
19:01:07*uics joined #nim
19:10:24*jmdaemon joined #nim
19:26:46*uics quit (Remote host closed the connection)
19:32:21*rockcavera quit (Remote host closed the connection)
19:50:17*azimut quit (Ping timeout: 255 seconds)
19:57:04*rockcavera joined #nim
20:00:51*uics joined #nim
20:39:20FromDiscord<jtv> Anyone have any best practices for exposing nim data structures to C? Just tag types with exportc to avoid mangling, and then copy the type declarations to a header file, or?
20:44:47FromDiscord<Elegantbeef> That's one way of doing it, though with how Nim generates some types probably should run it through `gcc -E`
20:45:25FromDiscord<Elegantbeef> Nim does have a `--header` flag that is deprecated but did generate a header file
20:53:19FromDiscord<jtv> Cool, thanks
20:55:56*uics left #nim (#nim)
20:56:07FromDiscord<Phil> In reply to @mratsim "The sha256 is not": Wait, they ripped SHA256 out of access for openssl? I access that shit for pbkdf2-hmac-sha256! WTF
20:57:16FromDiscord<Phil> What is this, "Break password hashing" month?
21:00:47FromDiscord<exelotl> `--header` being deprecated is a right pain, cause I have a Nim codebase with some C code that needs to access my Nim types. Telling the compiler to output a .h file with my types in it is by far the easiest way to do this.
21:02:50FromDiscord<jmgomez> In reply to @exelotl "`--header` being deprecated is": Yeah, I dont get the reasoning behind it, especially without a replacement. Hopefully it doesnt get remove any time soon
21:14:46*rockcavera quit (Remote host closed the connection)
21:16:48*rockcavera joined #nim
21:21:28*Guest38 joined #nim
21:24:44*Guest38 quit (Client Quit)
21:31:34FromDiscord<Elegantbeef> Something like Genny or Rustbindgen is certainly something that needs to be first classed↵(@exelotl)
21:32:11FromDiscord<Elegantbeef> Sorry i think i mean cbindgen
21:33:11FromDiscord<treeform> In reply to @jtv "OpenSSL has sha256 in": like https://github.com/guzba/crunchy/blob/master/src/crunchy/sha256_simd.nim ?
21:35:03FromDiscord<deech> In reply to @jmgomez "Yeah, I dont get": IIRC it was buggy.
21:35:54FromDiscord<deech> (edit) "In reply to @jmgomez "Yeah, I dont get": IIRC it was ... buggy.I" added "(is)" | "(is)buggy. ... " added "I tried using it and had issues, I can't remember the specifics but since it was deprecated I didn't report them."
21:36:49FromDiscord<Elegantbeef> Seems like using the compiler as a library and making your own codegen pass is the best outcome here
21:38:45FromDiscord<Elegantbeef> Not too dissimilar to cbindgen for rust, any procedure marked `exportc` and any types it's parameters are gets exported to a header
21:43:10FromDiscord<Elegantbeef> Sounds like a fun project at the very least 😄
21:43:35FromDiscord<Elegantbeef> @Phil\: hey were is my PR for kashae!? 😛
21:43:38FromDiscord<Elegantbeef> where even
21:45:20FromDiscord<Phil> In reply to @Elegantbeef "<@180601887916163073>\: hey were is": Nowhere, I noticed that I have to upgrade my nimstoryfont frontend to bootstrap 5 and formly 6 and that's been eating up my entire day
21:46:45FromDiscord<Elegantbeef> Ah then I'll do it 😄
21:50:54FromDiscord<Phil> Might I note that CSS is painful and bad and why does ng-bootstrap have to hurt me so deeply
21:54:26FromDiscord<Arathanis> try tailwind instead 😎
21:58:04*ltriant quit (Ping timeout: 260 seconds)
22:01:11FromDiscord<Phil> In reply to @Arathanis "try tailwind instead 😎": The issue is more general rules on how hover in CSS was applied rather than not knowing where the rules came from.↵I struggled with coming up with an HTML/CSS combo that would actually do what I wanted simply because of how components encapsulate CSS. Tailwind wouldn't really have helped there 😛
22:04:52FromDiscord<!&luke> hi
22:05:20om3gaHello! is it ok that newFileStream is faster than newMemMapFileStream?
22:05:26FromDiscord<!&luke> is there an easy way to turn an object into a sequence
22:06:02FromDiscord<huantian> what do you want that sequence to look like
22:06:39FromDiscord<Phil> Is there any way to... I dunno, structure my code in a way that flto doesn't start taking up half my lifetime, god damn
22:06:58FromDiscord<!&luke> ok so i have a json file that im serializing into an object all of the same type and i want to put them all into one array
22:07:12FromDiscord<!&luke> i could always do it manually
22:07:20FromDiscord<!&luke> but is there an easier way
22:07:35FromDiscord<huantian> wait do you have an array of objects
22:07:39FromDiscord<huantian> or what
22:07:40FromDiscord<!&luke> no
22:07:46FromDiscord<!&luke> i can send you my code
22:08:25FromDiscord<!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4n1r
22:08:47FromDiscord<huantian> gosh what is that Colors object
22:09:03FromDiscord<!&luke> im trying to parse a pywal config
22:09:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4n1s
22:09:16FromDiscord<Elegantbeef> `Colors = array[16, string]`
22:09:17FromDiscord<Elegantbeef> QED
22:09:25FromDiscord<huantian> ^
22:09:41FromDiscord<!&luke> oh i didnt know that that was possible with jsony
22:09:56FromDiscord<Elegantbeef> What does jsony have to do with this?
22:10:13FromDiscord<!&luke> well its what im using to parse the json
22:10:14FromDiscord<huantian> you think so little of jsony that you don't think it can (de)serialize arrays? lmao
22:10:30FromDiscord<Elegantbeef> You can define custom hooks on top of it
22:10:53FromDiscord<!&luke> oh
22:11:14FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4n1t
22:19:42FromDiscord<!&luke> that doesnt seem to work as jsony expects an array
22:20:04FromDiscord<!&luke> maybe itll help if i send the json in question
22:20:19FromDiscord<!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4n1w
22:21:28FromDiscord<Elegantbeef> Time to write a json hook
22:23:57FromDiscord<!&luke> should i use a dump or a parse hook
22:26:33FromDiscord<Elegantbeef> Are you dumping or parsing?
22:26:53FromDiscord<Elegantbeef> @Phil\: well kashae is now cleaner and depends on micros, cause i'm a bastard that loves micros 😄
22:27:09FromDiscord<Phil> Self plug 11111!!!11 einself
22:27:26FromDiscord<Elegantbeef> No spekensy the dutch
22:27:45FromDiscord<Elegantbeef> Please be triggered by that
22:27:59FromDiscord<Phil> I don't actually know what that references
22:28:41FromDiscord<Elegantbeef> sprechen sie deutsch
22:29:08FromDiscord<Phil> I mean, I understood that one, still no idea if that references sth
22:31:22FromDiscord<Elegantbeef> Nah i was just saying dutch instead of deutsch cause you said einself
22:37:27FromDiscord<Dakedres> sent a long message, see https://paste.rs/Jx6
22:37:44FromDiscord<Dakedres> (edit) "long message," => "code paste," | "http://ix.io/4n1E" => "https://play.nim-lang.org/#ix=4n1D"
22:37:51FromDiscord<Elegantbeef> `newSeq[Model]()`
22:37:52FromDiscord<Phil> Types don't exist at runtime
22:37:57FromDiscord<Elegantbeef> you are not calling `newSeq`
22:37:58FromDiscord<Phil> You can have dummy instances
22:38:02FromDiscord<Phil> But not types themselves
22:38:08FromDiscord<Phil> So you can't have a seq of them
22:38:12FromDiscord<Dakedres> ohh ok
22:38:15FromDiscord<Elegantbeef> Phil you're misreading the error
22:39:08FromDiscord<Phil> But that's a general issue, you don't do seq's of types, never worked for me at least
22:39:21FromDiscord<Elegantbeef> they are not doing a seq of types
22:39:23FromDiscord<Dakedres> In reply to @Elegantbeef "`newSeq[Model]()`": Oh, I just still need to call it even if I'm not passing a length
22:39:24FromDiscord<Dakedres> durr
22:39:27FromDiscord<Dakedres> my bad
22:39:32FromDiscord<Elegantbeef> `newSeq[model]()` makes a `seq[Model]`
22:39:36FromDiscord<Dakedres> yeah
22:39:49FromDiscord<Elegantbeef> It doesnt make a `seq[typedesc[Model]]`
22:39:56FromDiscord<Elegantbeef> A typedesc in a generic param strips `typedesc`
22:40:16FromDiscord<Phil> Ah, I read the intention being seq of type based on the initial code
22:40:25FromDiscord<Dakedres> Yeah, I wanted a seq[Model]
22:41:08FromDiscord<Elegantbeef> `newSeq` cannot be captured in a pointer proc is the procvar issue
22:43:03FromDiscord<Elegantbeef> Worth noting `newSeq` isnt required
22:43:13FromDiscord<Elegantbeef> so `var name: seq[Model]` is valid
22:44:15*ltriant joined #nim
22:44:37FromDiscord<Dakedres> oh, that's much nicer
22:53:18*ltriant quit (Ping timeout: 268 seconds)
23:11:26FromDiscord<PunchCake> whos the real pmunch here
23:11:36FromDiscord<PunchCake> there is 2 https://media.discordapp.net/attachments/371759389889003532/1071206348055908413/image.png
23:17:04om3gaBoth are PMunch
23:24:17FromDiscord<Piqueiras> can you do array.map(sum(5))?
23:25:20FromDiscord<Elegantbeef> `map` takes an openArray so yes
23:25:59FromDiscord<Piqueiras> so it sums 5 to every element
23:26:45FromDiscord<Piqueiras> does it work with templates tho https://media.discordapp.net/attachments/371759389889003532/1071210159579353178/image.png
23:27:10FromDiscord<Elegantbeef> What's the error?
23:27:51FromDiscord<Piqueiras> expression '' has no type (or is ambiguous)
23:28:16FromDiscord<Piqueiras> https://media.discordapp.net/attachments/371759389889003532/1071210541328125993/image.png
23:28:41FromDiscord<Elegantbeef> Full error please
23:28:52*dropkick joined #nim
23:29:08FromDiscord<Elegantbeef> you likely want `mapIt`
23:29:17FromDiscord<Elegantbeef> since `%%%5` is not a procedure
23:29:27FromDiscord<Elegantbeef> `so `v.mapIt(it%%%5)\`
23:29:31FromDiscord<Piqueiras> In reply to @Elegantbeef "you likely want `mapIt`": oh, very likely
23:29:36FromDiscord<Piqueiras> very very likely
23:30:00FromDiscord<Piqueiras> yes, ty
23:32:24FromDiscord<PunchCake> whats currently the most stable and actively developed nim gui lib?
23:33:16FromDiscord<Dakedres> I can't find anything about extending types in Nim?
23:34:12FromDiscord<Elegantbeef> extending types?
23:34:53FromDiscord<Dakedres> sent a code paste, see https://play.nim-lang.org/#ix=4n1Z
23:35:06FromDiscord<Dakedres> (edit) "https://play.nim-lang.org/#ix=4n1Z" => "https://play.nim-lang.org/#ix=4n20"
23:35:22FromDiscord<Dakedres> (edit) "https://play.nim-lang.org/#ix=4n20" => "https://play.nim-lang.org/#ix=4n21"
23:35:25FromDiscord<PunchCake> In reply to @Dakedres "Maybe "extending" isn't exactly": so something like inheritance yeah?
23:35:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4n22
23:35:29FromDiscord<Dakedres> yeah
23:35:36FromDiscord<Elegantbeef> Nim has OOP but it's not the best idea in many cases
23:35:57FromDiscord<Dakedres> I don't really want OOP, I'm just using these for JSON serialization
23:35:59FromDiscord<PunchCake> oop is very rarely the best idea
23:36:06FromDiscord<Dakedres> My code is mainly data oriented
23:36:15FromDiscord<PunchCake> In reply to @Dakedres "My code is mainly": why not python?
23:36:40FromDiscord<Dakedres> Why not Java?
23:36:54FromDiscord<PunchCake> python works best with data oriented stuff
23:36:55om3gaI really not appreciate python
23:36:57FromDiscord<PunchCake> and R
23:36:57FromDiscord<Dakedres> It's slower, I don't like it, and it doesn't have half the features I want
23:37:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4n23
23:37:09om3gaand Java is the vorse
23:37:10FromDiscord<Elegantbeef> It doesnt give any mechanisms of OOP aside from inheriting fields/procedures
23:37:42FromDiscord<Dakedres> Yes
23:37:50FromDiscord<PunchCake> idk whats the best way to make a production gui in nim
23:38:02FromDiscord<PunchCake> i chose nim because it doesnt run on a vm nor does it have a runtime
23:38:15om3ganigui
23:38:30FromDiscord<Dakedres> sent a code paste, see https://play.nim-lang.org/#ix=4n25
23:38:35om3gawhat you mean "production"
23:38:37FromDiscord<Dakedres> (edit) "https://play.nim-lang.org/#ix=4n25" => "https://play.nim-lang.org/#ix=4n26"
23:38:38FromDiscord<Elegantbeef> `ref` allows converting to the base type
23:38:45FromDiscord<Elegantbeef> it's not needed if you only use value types
23:38:53FromDiscord<Elegantbeef> And do not want to have a heterogenous collection
23:39:13FromDiscord<PunchCake> In reply to @om3ga "what you mean "production"": something thats stable, i can rely on if something breaks its always my code not the gui lib
23:40:01om3gaPunchCake everything can brake, I use nigui, it works well
23:40:23FromDiscord<Dakedres> In reply to @Elegantbeef "it's not needed if": Ah ok
23:40:27om3gaIt might be not very beautiful , but it works
23:40:51FromDiscord<PunchCake> In reply to @om3ga "It might be not": it has to be beautiful
23:41:07FromDiscord<PunchCake> or is there any other language thats nearly as simple as nim and is aot compiled?
23:41:07om3gawell, it depends on taste
23:41:09om3ga)))
23:41:31om3gaalso I hope Mac native support will be in near future
23:41:45FromDiscord<auxym> go?
23:41:54om3gayou can compile and expect the same layout on three main os
23:42:10FromDiscord<PunchCake> In reply to @auxym "go?": go is weird
23:42:21FromDiscord<PunchCake> zig?
23:43:01om3gavery strange, MMapEd file should be faster, but regular stream beats it by speed
23:43:10FromDiscord<Dakedres> In reply to @PunchCake "python works best with": Anyway to answer your confusion I guess↵↵Nim can do it better. It has really good immutability support, procs help you pipe more elegantly, and pretty much anything it's missing can be added with macros
23:43:23om3gaseems memfiles not oprimized
23:43:24FromDiscord<auxym> zig is still very young, I wouldn't expect it to have a very mature gui lib. But maybe?
23:43:49FromDiscord<PunchCake> In reply to @Dakedres "Anyway to answer your": write in python↵code slow write slow part in nim and use nimpy
23:43:59FromDiscord<PunchCake> thats what i've been doing a lot lately
23:44:36om3gaI replaced almost anything with nim
23:44:47om3gaeven scripts in bash
23:45:07FromDiscord<PunchCake> i just like python because of how many packages exist in its ecosystem
23:45:26om3gaare you use them all?
23:45:46FromDiscord<Dakedres> Who needs packages when you can write a library faster than you can learn it
23:45:51FromDiscord<PunchCake> In reply to @om3ga "are you use them": a lot yes
23:46:10om3gaIprefer not to have deps
23:46:20FromDiscord<PunchCake> i think nim is amazing for the backend
23:46:33om3gafor anything
23:46:54FromDiscord<PunchCake> i was trying to rewrite this https://github.com/lukasmonk/lucaschessR2 gui in nim so i can reduce the bundle sizes by a lot