<< 03-12-2020 >>

00:00:05FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GhX
00:01:24*xet7 joined #nim
00:13:05*not_lum quit (Quit: Lum: Bye!)
00:13:48*lritter quit (Quit: Leaving)
00:14:48*lum joined #nim
00:17:27*hmmm quit ()
00:24:43*sagax quit (Quit: Konversation terminated!)
00:26:23*NimBot joined #nim
00:56:37FromDiscord<Cohjellah> Hello! New to Nim, and excited to join this community as this language looks really fun and like it has potential.โ†ตComing across from Python - curious what everyone uses Nim to create?โ†ตCurrently reading through Nim in Action
00:58:04FromDiscord<Esbeesy> PIggybacking off that ^ Is Nim in Action still relevant? I noticed it was published in 2017 and was wonder how much had been deprecated/added since then
00:58:38FromDiscord<Avatarfighter> @dom96 might be able to answer the second question better than most
00:59:13FromDiscord<j-james> @Cohjellah I've been working on a lightweight Slack export viewer recently: https://github.com/j-james/static-slack
00:59:46FromDiscord<flywind> see readme for nim-in-action codes https://github.com/dom96/nim-in-action-code
01:01:26FromDiscord<nikki> this question keeps coming up so maybe https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html should be easily findable wherever the book is referenced
01:01:54FromDiscord<Esbeesy> Or someone could just write a new book right I mean how hard can it be... ๐Ÿ˜›
01:02:11FromDiscord<nikki> you don't need a new book, it's basically all relevant
01:02:33FromDiscord<nikki> i used it when studying / learning nim fresh about 1.5 months ago
01:10:04leorize[m]1~errata: Nim in Action errata: https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html
01:10:04disbotno footnotes for `errata:`. ๐Ÿ™
01:10:17leorize[m]1~errata is Nim in Action errata: https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html
01:10:18*Tanger joined #nim
01:10:18disboterrata: 11Nim in Action errata: https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html
01:26:03voltistDoes anyone know if it's possible to kill the NiGui app without killing everything else?
01:29:51FromDiscord<ElegantBeef> You mean close the window but leave nim running?
01:30:15voltistYeah
01:30:29voltistJust closing the window quits the app which stops nim
01:30:38voltistFor some reason
01:31:21FromDiscord<ElegantBeef> there is a `quitOnWindowClose` bool
01:31:37FromDiscord<ElegantBeef> (edit) "`quitOnWindowClose`" => "`quitOnLastWindowClose`"
01:32:02FromDiscord<ElegantBeef> If that's set to true when all windows close it calls `quit()`, so just set that to false and be happy
01:33:14voltistOh that looks promising thanks
01:33:43voltistIf it doesn't quit it, does that mean that the app is still hanging around the in the background and using memory?
01:34:00FromDiscord<ElegantBeef> If there is anything after `app.run`
01:34:17FromDiscord<ElegantBeef> app.run is blocking, so when it stops blocking anything after it will be ran
01:34:22FromDiscord<ElegantBeef> If nothing is ran it closes
01:34:26FromDiscord<Cohjellah> Interesting, I would think not TOO much has changed since 1.0? At least it's some reading to do while there's nothing else available
01:38:02voltistIs it possible to make something run after app.run is called? Basically, I have a proc that creates a window to prompt the user about something, and I want the proc to close the window and return a value when done. With quitOnLastWindowClose set to false, I still can't figure out how to get it to end the proc all together in order to return
01:38:27FromDiscord<ElegantBeef> Well any code after `app.run` should be called after closing all windows i believe
01:38:38FromDiscord<ElegantBeef> I could be wrong, i havent used nigui much
01:39:28voltistUnfortunately that doesn't seem to work :(
01:39:59*Gustavo6046 joined #nim
01:40:09FromDiscord<Cohjellah> Are there any examples of Karax I can find?
01:40:32FromDiscord<Cohjellah> Writing client side webpages without JS seems magical
01:42:46FromDiscord<ElegantBeef> Ok so voltist you'll want to overwrite the `quit(app: App)` so it sets a `app.running` bool to false and stop blocking
01:42:56FromDiscord<ElegantBeef> https://github.com/trustable-code/NiGui/blob/07225b1737d56e8f93c8b5500f2c76f5ea7936cb/src/nigui.nim#L1152
01:43:34FromDiscord<ElegantBeef> Could even make a fork for `quit` so it has a `terminate` bool which is defaulted to true
01:45:02FromDiscord<ElegantBeef> It's a relatively small change with a benefit so i personally thing it's a nice thing to make a PR for
01:45:08FromDiscord<ElegantBeef> (edit) "thing" => "think"
01:45:18FromDiscord<ElegantBeef> I editted the wrong think... i'm smart
01:45:31voltistSounds like a plan
01:46:16voltistDo you know what other quit proc the quit proc at this line refers to?
01:46:17voltisthttps://github.com/trustable-code/NiGui/blob/07225b1737d56e8f93c8b5500f2c76f5ea7936cb/src/nigui.nim#L1160
01:46:39voltistConfusing grammar in that question but hopefully you get the picture
01:46:52FromDiscord<ElegantBeef> Forward declaration is here https://github.com/trustable-code/NiGui/blob/07225b1737d56e8f93c8b5500f2c76f5ea7936cb/src/nigui.nim#L453
01:47:14FromDiscord<ElegantBeef> I assume that's what you meant?
01:47:58voltistYep
01:48:31voltistDoesn't help as much as I thought it would though, since I can't find any of the actual code that is executed on app.quit
01:48:46FromDiscord<ElegantBeef> what you first showed me was it
01:48:48voltistBut maybe I'm just not understanding the structure of this libraru
01:48:51FromDiscord<ElegantBeef> it just calls quit by default
01:49:36FromDiscord<ElegantBeef> You need to add a bool to app of `running` then if you pass a true to `app.quit` terminate, else set that bool to false and let the app take the natural path
01:50:01voltistOoohhh, system.quit right? Idk why that took me so long to figure out
01:50:13FromDiscord<ElegantBeef> dont ask me ๐Ÿ˜„
01:50:18FromDiscord<ElegantBeef> Yea system.quit
01:50:28FromDiscord<ElegantBeef> Does your editor not have a goto defintition?
01:50:36FromDiscord<ElegantBeef> Or were you just reading on git?
01:50:43voltistJust reading on git
01:50:49voltistgithub
01:50:53FromDiscord<ElegantBeef> Ah i was aswell, and just assumed
01:51:07voltistOr gith-oob as someone I know calls it
01:52:29voltistRight yeah I've got my head around this now, so I'll try out the change and then do a PR
01:53:29*lbart joined #nim
01:53:29*lbart quit (Changing host)
01:53:29*lbart joined #nim
01:53:50FromDiscord<ElegantBeef> Nice
02:15:07*^Q-Master^ joined #nim
02:16:00*Q-Master quit (Read error: Connection reset by peer)
02:16:32*apahl quit (Ping timeout: 260 seconds)
02:18:36*apahl joined #nim
02:34:57*abm quit (Read error: Connection reset by peer)
02:35:53FromDiscord<ElegantBeef> If i continue writting aoc, i might just endup only using templates ๐Ÿ˜„ https://play.nim-lang.org/#ix=2Gif
02:35:56FromDiscord<ElegantBeef> My day2 version
02:36:43mipriI just get "Unable to load ix paste, file too large, or download is too slow" from that
02:46:00FromDiscord<ElegantBeef> Think something is wrong with nim playground atm
02:46:08FromDiscord<ElegantBeef> https://hatebin.com/idvskoibyv
02:46:14FromDiscord<ElegantBeef> That should work
03:03:07*xet7 quit (Quit: Leaving)
03:06:28*xet7 joined #nim
03:07:13*kiwi_83 joined #nim
03:11:31kiwi_83is iterative compilation available in main release yet?
03:12:23FromDiscord<flywind> incremental compilation?
03:12:30kiwi_83yes yes thath one
03:13:37FromDiscord<flywind> I don't think they are stable enough to use. But they will come soon(maybe in Next big feature release).
03:13:41FromDiscord<flywind> https://forum.nim-lang.org/t/7185
03:14:01FromDiscord<flywind> and https://github.com/nim-lang/RFCs/issues/46
03:14:02disbotโžฅ Incremental compilation
03:14:22FromDiscord<treeform> How does JAI (Jonathan Blow Language) go so fast without incremental compotation?
03:14:24kiwi_83thanks! can't wait to see this in action
03:15:17kiwi_83flywind are you xflywind
03:15:32FromDiscord<flywind> yes
03:15:53kiwi_83any suggestions on how to get started with tinkering with nim itself?
03:16:01kiwi_83I don't know much about compilers tbh
03:16:04FromDiscord<nikki> @treeform there's a few videos where jblow goes around the codebase and esp. works on perf, which may be insightful
03:16:33FromDiscord<flywind> @kiwi see https://dev.to/xflywind/how-to-contribute-to-nim-language-4ad8
03:16:34FromDiscord<nikki> the main thing is they seem to have a tight compiler dev <-> using the compiler on a project workflow and optimize / dev it for that particular project
03:17:00FromDiscord<flywind> And this is very useful to read before contributing to Nim: https://nim-lang.org/docs/contributing.html
03:20:27kiwi_83thank you, great links
03:20:50kiwi_83if I import something in a nim program and dont use the imported stuff, will it be removed in -d:release ?
03:20:54kiwi_83as optimization
03:22:37FromDiscord<flywind> Nim has Dead Code Elimination so dead code are removed.
03:23:11mipriyou can see this by having a large dead literal in your code
03:23:28mipriand comparing binary sizes as is and after you use it somewhere
03:23:52FromDiscord<flywind> But these still increase compilation time a bit. Because symbols still need to be searched.
03:26:56kiwi_83hmm and incremental compilation would help here right?
03:27:20kiwi_83like if it found out once and performed dce, next time it wont do it if that part exists right
03:27:34mipridce?
03:27:45kiwi_83dead code elimination
03:28:48leorize[m]1yes
03:30:24leorize[m]1though what's exciting about IC would be the tech that's coming with it
03:30:39kiwi_83 you mean the autocomplete etc?
03:31:36leorize[m]1that's already possible now
03:31:52kiwi_83flywind idk how to /q you but in https://github.com/xflywind/awesome-nim s/Serializtion/Serialization
03:32:06kiwi_83hmm what are you referring to leorize?
03:32:22leorize[m]1ic will bring a redesigned AST (compiler side, not the user side)
03:32:34FromDiscord<flywind> Feel free to make a PR.
03:32:40kiwi_83oh wow that sounds like a significant change
03:32:53kiwi_83will it help making macros easier
03:32:56kiwi_83sure flywind
03:33:23FromDiscord<flywind> Who is working on IC?
03:34:16leorize[m]1will be in the future, but what it can do now is drastically reducing the compiler memory usage, and also allowing the AST to be (de)serialized efficiently
03:37:23leorize[m]1it would also enable pluggable compiler passes (my fav feature) and of course, static inspection of the code for use with nimsuggest
03:37:34leorize[m]1all of this is in development though, so no promises
03:37:55leorize[m]1@flywind 4raq and disruptek afaik
03:38:06kiwi_83'pluggable compiler passes' eli5 pls
03:40:18FromDiscord<flywind> I see, thanks.
03:43:49leorize[m]1kiwi_83: the compiler basically works by running macros over your code until you get the final result. We call these "macros" passes.
03:44:59leorize[m]1The current architecture requires that passes be a part of the compiler since it's not possible to (de)serialize the AST effectively.
03:46:14leorize[m]1with the new AST in development this would allow for passes outside of the compiler to be run, and these can even be written in user code
03:46:51leorize[m]1that's what I call "pluggable passes"
03:47:04leorize[m]1hope that makes sense
04:04:41FromDiscord<ElegantBeef> Oh, so that means you could add onto analysis for things like `options` accessing?
04:05:24FromDiscord<ElegantBeef> If so, sounds nice ๐Ÿ˜„
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:37*supakeen joined #nim
04:13:41*spiderstew_ joined #nim
04:17:23*spiderstew quit (Ping timeout: 244 seconds)
04:17:23*spiderstew_ is now known as spiderstew
04:30:27*waleee-cl quit (Quit: Connection closed for inactivity)
04:36:17*mbomba quit (Quit: WeeChat 3.0)
04:40:39FromDiscord<the condor> what are some great nim modules or package to learn to get comfortable with nim
04:41:19FromDiscord<the condor> like those related to networking, cryptography and low level stuffs
04:42:21kiwi_83awesome-nim
04:42:28kiwi_83google that you will find it on github
04:42:57FromDiscord<the condor> thanks man
04:43:05kiwi_83sure thing bruv
04:46:56*narimiran joined #nim
04:51:24FromDiscord<Rebel> Are there any tips and tricks to make a binary as small as possible in Nim. As drastic as the tactics employed by this guy idc if I need to modify stdlib.
04:51:27FromDiscord<Rebel> https://medium.com/@MStrehovsky/building-a-self-contained-game-in-c-under-8-kilobytes-74c3cf60ea04
04:51:56FromDiscord<Cohjellah> Are there any statistics on the growth of Nim?
04:52:28FromDiscord<Rebel> I can tell you with 100% certainty it is growing within the security community more specifically for red teaming ๐Ÿ˜ˆ
04:52:41FromDiscord<Cohjellah> Red teaming?
04:57:35*kiwi_83 quit (Ping timeout: 256 seconds)
04:57:49FromDiscord<Rebel> Red teaming = On a team emulating threat actors and attempting to hack into an organization basically just acting as adversaries to a company
04:58:35FromDiscord<Rebel> fun stuff
04:58:42FromDiscord<ElegantBeef> `--opt:size`
04:58:55FromDiscord<Rebel> https://media.discordapp.net/attachments/371759389889003532/783920175116058644/4.png
04:59:59FromDiscord<Rebel> `'extreme' not in '--opt:size'`
05:00:15FromDiscord<ElegantBeef> Nim has dead code elimination, but some modules import a lot of code, so aside from checking what a module uses not much
05:00:16FromDiscord<Rebel> (edit) "'--opt:size'`" => "'--opt:size' == true`"
05:00:19FromDiscord<ElegantBeef> Atleast that i know of
05:00:26FromDiscord<Rebel> hmmm I need to test my game theory
05:00:27FromDiscord<ElegantBeef> opt is for speed or size
05:00:29FromDiscord<Rebel> that using nlvm
05:00:34FromDiscord<Rebel> and optimizing the IR
05:00:37FromDiscord<Rebel> might be the move
05:01:02FromDiscord<ElegantBeef> I mean just optimize the C
05:01:04FromDiscord<ElegantBeef> ๐Ÿ˜›
05:01:47FromDiscord<Rebel> well isn't that what I'm basically optimizing if I go the nlvm route?
05:02:18FromDiscord<ElegantBeef> I was more implying optimizing the C output jokingly
05:02:38FromDiscord<Cohjellah> Ok I found some stats. Definitely has grown a lot
05:02:46FromDiscord<Cohjellah> Biggest growth in the last year, go figure with a stable release
05:03:01FromDiscord<Cohjellah> Was 5k stars in 2018, now past 10k
05:14:54voltistHas nimsuggest been having really bad memory leaks for anyone else lately?
05:15:04voltistWhen used with the vscode extension
05:17:59narimiranvoltist: lately as in last 3 years? :P
05:19:52ee7[m]AoC still easy today :)
05:23:12FromDiscord<ThatTrollzer> I went from 7th to 8th H O W
05:26:36FromDiscord<ThatTrollzer> now I'm 9th why am I going down when I have completed all the challenges?
05:27:20narimiranbecause in the mean time somebody who was above you yesterday completed it
05:27:33FromDiscord<ThatTrollzer> ah that makes sense
05:28:40FromDiscord<ElegantBeef> Also why are we so worried about our aoc ranks? ๐Ÿ˜„
05:29:25FromDiscord<wad35dam> Hello, i have a question, is Nim have Ternary Operator?
05:29:45FromDiscord<ElegantBeef> No we use an if expression
05:29:54FromDiscord<wad35dam> Ok, thanks
05:30:08FromDiscord<ElegantBeef> `if cond: a else: b`
05:34:54voltistnarimiran: I only noticed it recently but maybe its a coincidence
05:35:45*thomasross quit (Ping timeout: 240 seconds)
05:38:49*kiwi_83 joined #nim
05:49:59FromDiscord<Idefau> wow today's aoc has grids
05:52:03FromDiscord<j-james> Speaking of Advent of Code, is there a nice way to get the iteration of an iterator?
05:52:46FromDiscord<j-james> Right now I'm throwing a `var i: int = 0` outside of a for loop and `inc(i)` inside
05:55:43miprihttps://nim-lang.org/docs/enumerate.html#enumerate.m%2CForLoopStmt
06:05:04FromDiscord<j-james> This might be a dumb question, but how do I import that?
06:10:00narimiran`for i, x in myIterator` works
06:10:48FromDiscord<j-james> That doesn't seem to work for `lines()`
06:10:53FromDiscord<JSGRANT> @Cohjellah oh, funny seeing you here. Lol
06:11:02*vicfred_ joined #nim
06:12:09mipri...
06:12:14mipriit doesn't work at all.
06:12:23mipriimport std/enumerate is how you import it anyway.
06:13:01mipriah correction, it doesn't work at all nuder 1.4.0
06:13:06mipriforgot I had choosenim'd back to that for some reason
06:13:58*vicfred quit (Ping timeout: 260 seconds)
06:18:43*vicfred_ quit (Quit: Leaving)
06:19:11FromDiscord<Cohjellah> I just wanted the sick crown emoji
06:24:46FromDiscord<j-james> mipri: What's the distinction between modules that need to be imported with `std` and others like `htmlparser`?
06:25:21miprino idea
06:26:13miprialthough at a guess, there was an old flat namespace corresponding to the pure/ and impure/ contents, and std/ is new, and the stuff in std/ is not grandfathered into the flat namespace
06:27:04mipri!eval import pure/strformat; echo &"{1+2}"
06:27:08NimBot3
06:27:43miprithis creates a documentation failure however
06:27:45FromDiscord<ElegantBeef> Yea i think `std/` will be enforced eventually but only some of them currently have it
06:27:55mipriin that the docs assume that you don't have to ask this question
06:31:34*mbomba joined #nim
06:38:10*habamax joined #nim
06:42:45voltistIs there a `times` proc to get time after the UNIX epoch in seconds for any given datetime?
06:44:14FromDiscord<JSGRANT> @Cohjellah Well, welcome to the :nimAngry:
06:47:23voltistNevermind, found it
06:47:30mipriwhat did you find?
06:48:54*sagax joined #nim
06:58:17*kinkinkijduet quit (Ping timeout: 260 seconds)
07:11:41*jaens[m] joined #nim
07:20:31miprithis would be good comedy timing for someone else to have the same question.
07:27:23voltistThe Nim vscode extension just stopped my computer in its tracks for 15 minutes
07:28:20voltistTime to disable nimsuggest
07:28:27narimiranvoltist: did you start to use some macro-heavy code?
07:29:04voltistNope
07:29:17voltistNot that much code at all either
07:37:18FromDiscord<lqdev> can't wait for IC.
07:40:47voltistIC?
07:41:47FromDiscord<lqdev> incremental compilation
07:42:00FromDiscord<lqdev> it's said to improve the compiler by a ton
07:42:05FromDiscord<lqdev> incl. nimsuggest stability
07:43:33voltistSounds awesome
07:51:56FromDiscord<ElegantBeef> But does it write code for me?
07:54:58*habamax_ joined #nim
07:56:35Zevvwell narimiran, going for the terse ones this year, are we :)
07:57:48narimiranZevv: trying hard :)
07:59:38narimiranZevv: now looked at your solution. i had no idea we have `countIt`
08:00:38narimiran...and i've never used `/%`
08:00:39FromDiscord<ElegantBeef> I hate day2, have to hardcode it ๐Ÿ˜„
08:00:49narimiranhuh? why hate?
08:01:07FromDiscord<ElegantBeef> Cause you need to hardcode code the two cases ๐Ÿ˜„
08:01:16FromDiscord<ElegantBeef> Day one you could write a solution for N number of cases
08:01:58FromDiscord<ElegantBeef> My day1 solution isnt overkill https://hatebin.com/mflmrrgydp
08:02:39FromDiscord<ElegantBeef> Using that pull is faster than a closure iterator if you're wondering "why?"
08:06:22narimiranthe first think i'm wondering is - why it takes you so many lines to solve it :P
08:07:34FromDiscord<ElegantBeef> It doesnt
08:07:39FromDiscord<ElegantBeef> It's cause i overengineered it ๐Ÿ˜„
08:08:31narimiranheh, i tend to under-engineer my aoc submissions :)
08:09:03FromDiscord<ElegantBeef> I apparently do the complete opposite, after doing pt1 i looked at pt2 and went "Ok i can do both of these in a general solution"
08:09:24narimiranuse itertools.combinations ;)
08:10:58FromDiscord<Idefau> im still stuck at the part 2 because i am an idiot, and somehow i got the first part working
08:11:15narimiranrun it on the example to be sure it works correctly
08:11:48FromDiscord<ElegantBeef> I'm not doing pt3 until after i sleep, so... i guess i'll consistantly lose since i'm doing it a day behind ๐Ÿ˜›
08:11:52FromDiscord<ElegantBeef> day3
08:13:02narimiranthis "who is fastest" is usually replaced by "who solved it at all" by day15 or so
08:13:09narimiranso don't worry
08:13:46FromDiscord<ElegantBeef> Oh i'm not worried, i dont really care about the rank
08:14:35FromDiscord<ElegantBeef> I dont quite see why you suggested combinations
08:15:09narimiranthat's for after you sleep
08:15:21narimiran(it is for day1)
08:16:09narimiranp.s. don't forget to read day3 before your sleep, so you can work on the solution in your dreams
08:16:16FromDiscord<ElegantBeef> lol
08:18:46FromDiscord<ElegantBeef> Well i'm not sleeping for another hour or two, so eh
08:20:52FromDiscord<Idefau> weird, running my code on the example it works
08:23:46FromDiscord<Idefau> no fucking way
08:23:52FromDiscord<Idefau> my code was correct all along
08:24:19FromDiscord<Idefau> except the last part where i multiplied all of it....
08:24:37FromDiscord<Idefau> i did like slope(1,2) instead of slope(2,1)
08:24:45FromDiscord<Idefau> im mad
08:29:45*alexander92 quit (Ping timeout: 240 seconds)
08:30:29*habamax_ quit (Quit: leaving)
08:30:45*habamax_ joined #nim
08:31:55narimiran:)
08:32:02*Tanger quit (Quit: Leaving)
08:32:13narimirani like that final twist, exactly because stories like this
08:33:44FromDiscord<Idefau> atleast im still above my friendly competitor
08:33:57FromDiscord<Idefau> (edit) "competitor" => "rival"
08:34:59narimiranbtw Zevv, no more "the top guy in our leaderboard uses kotlin" ;) :)
08:42:38Zevvgood for you. But let's see at day 15 or so, who solves it all ;) :)
08:42:44*habamax_ quit (Quit: Lost terminal)
08:43:05*habamax_ joined #nim
08:45:27*habamax_ quit (Client Quit)
08:57:21narimiran:P
08:57:48FromDiscord<Idefau> is day 15 that hard
08:58:03narimiransometimes day7 is hard
08:58:11narimiranusually tasks on weekend are harder
08:58:40narimiranbut it is not that it is always increasing complexity
08:58:46kiwi_83can i do this later
08:58:49kiwi_83like next year?
08:58:52narimiranyou might have one hard task, then 3 easy ones after it, etc.
08:58:59narimirankiwi_83: whenever you like
08:59:08kiwi_83phew that's good news to me
08:59:11narimirankiwi_83: but you'll miss this community part of it
08:59:17kiwi_83huh what do you mean
09:00:00narimiraneverybody is solving it now. in one year, we will do AoC 2021, not tasks from this year
09:02:01*mbomba quit (Quit: WeeChat 3.0)
09:07:44*PMunch joined #nim
09:13:31FromDiscord<Rika> I just stopped trying after the first year I did
09:13:40FromDiscord<Rika> Not my thing I guess
09:13:49FromDiscord<Rika> Feels useless for me
09:14:40narimirani find it great for learning basics of some new language
09:15:37FromDiscord<Idefau> i find it nice so i dont get bored
09:18:32FromDiscord<Rika> I found it nice at first but after a few problems I felt like I was doing nothing productice
09:19:04FromDiscord<Idefau> im doing nothing productive anyway
09:20:21FromDiscord<Rika> I don't have much time to do nothing productive and there are more enjoyable ways for me to use time unproductively
09:24:21FromDiscord<Idefau> alright
09:30:25*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:34:00PMunchI like them, they're like as small little puzzle to start the day off with
09:44:15FromDiscord<Idefau> yea
09:48:04FromDiscord<wad35dam> is nim have garbage collector?
09:48:47PMunchYes, Nim has multiple garbage collectors/garbage collection policies
09:48:52PMunchBut you can disable it
09:49:05FromDiscord<wad35dam> Its good, Thanks
09:49:24FromDiscord<lqdev> this year i have better things to do than AoC
09:49:40FromDiscord<lqdev> i give up after 2 days each year anyways so eh
09:50:07PMunchSo far they've been really simple
09:51:07PMunchOnly the first one really had some room for optimisation
09:52:12FromDiscord<Idefau> i liked last years first day
09:52:32supakeenIt always ramps up so one can give up around day 10-20 :)
09:52:34FromDiscord<Idefau> (edit) "years" => "year's"
09:54:08FromDiscord<Idefau> i just realised i might not be able to do tommorow's AoC early, since i have to present something at school
09:54:22FromDiscord<Idefau> so i cant just solve the thing while in the meeting
09:57:53kiwi_83fk school. all my homies h8 skool
09:58:14FromDiscord<Idefau> this
09:58:42PMunchI don't see why everyone appears to hate school
09:58:47PMunchI kinda liked it
09:59:33kiwi_83tis but a meme mr pmunch https://knowyourmeme.com/memes/fuck-x-all-my-homies-use-y
09:59:44PMunchAight :P
10:03:07supakeen`Error: invalid type: 'openArray[char]' in this context: 'proc (data: openArray[char], n: int): openArray[char]' for proc` send help.
10:03:16supakeenWhy is it invalid in this context and what context is it talking about?
10:03:43kiwi_83type is openarray?
10:04:02narimiranyou cannot return openArray
10:04:11supakeenAh.
10:04:36supakeenBut I can take an openarray and write to that I presume.
10:05:04supakeenOr what is the common way to do this, it might just be that I'm missing some knowledge on how a signature like this should be.
10:06:08narimirando what exactly?
10:06:34supakeenMy goal is to have a function that reads an array up until a certain number and returning the slice of that.
10:06:59supakeenAnd before 'just use slice', I have some custom exceptions and the like when there's not enough data.
10:07:34supakeenAnd for example also a `readTo(data: openArray[char], to: openArray[char])`
10:07:57narimirancan https://nim-lang.github.io/Nim/strutils.html#find%2Cstring%2Cchar%2CNatural%2Cint be of help?
10:08:28supakeenMy data contains null bytes and I wrongly assumed that `string` treats those specially.
10:08:37supakeenMaybe wrongly?
10:09:18kiwi_83narimiran your nick is a palindrome huh?
10:09:27narimirankiwi_83: indeed
10:09:29FromDiscord<ache of head> oh dang
10:09:30FromDiscord<ache of head> you're right
10:09:41PMunchHow have I never noticed that before..
10:09:47kiwi_83no wonder my mind was itchy
10:09:47narimiranPMunch: hahaha, really?
10:09:57kiwi_83do i get a cookie or something lol
10:10:22*^Q-Master^ quit (Ping timeout: 246 seconds)
10:10:37PMunchnarimiran, yeah really
10:10:44supakeenI think I should go with `readTo(data: openArray[char], to: openArray[char], out: openArray[char]) =` signature, bit too C-ish for my liking.
10:10:46PMunchFeel a bit daft now tbh
10:10:54narimiranbtw, once i was in some other irc channel, and noticed there is a guy who has nick: nalimilan
10:11:14narimiranand i was "yeah yeah, i know your name now"
10:12:57supakeenOh, or seq[char].
10:13:29narimiransupakeen: don't forget `var` for your `out`
10:13:34supakeenSi.
10:13:46supakeenBut I think I'll solve it with seq[char] instead of openArray[char] :)
10:13:58*kiwi_83 is now known as kiwiwiki
10:14:14kiwiwikii like this palindrome
10:14:29kiwiwikitwo words that have meaning independently but also a palindrome
10:14:38kiwiwikium
10:14:42kiwiwikii need sleep nvm
10:15:04PMunchHaha :P
10:17:04FromDiscord<Idefau> kek
10:19:22supakeenSo for now until I run into problems I'll use: `proc readN*(data: seq[char], n: range[1..high(int)]): seq[char] =` :)
10:19:45narimiranuse `n: Positive` for a start
10:20:16supakeenGrr, I only had natural in my head.
10:20:33narimiranyou must be Positive in your head!!
10:20:48supakeenThanks :)
10:22:40supakeenFor the life advice!
10:24:07kiwiwikiBut don't be covid positive!
10:24:13kiwiwikithank me later for the medical advice xD
10:42:34*Q-Master joined #nim
10:44:58*kiwiwiki left #nim (#nim)
10:47:16*Q-Master quit (Ping timeout: 240 seconds)
10:55:06FromDiscord<Cohjellah> Is there a benefit of AoC over leetcode?
10:55:14FromDiscord<Cohjellah> Apart from Nim not being on Leetcode ahah
10:55:28FromDiscord<Cohjellah> More realistic questions?
10:59:41supakeenNah, AoC is just flavor of the month each year :)
11:01:23PMunchAoC is just an advent calendar :)
11:01:50PMunchAnd it doesn't "support" any languages, in theory you could do all the tasks manually without programming anything
11:02:02PMunchWell, maybe not the later ones..
11:07:21*Q-Master joined #nim
11:24:03PMunchGot bored, now my part2 runs in 0.64ms
11:24:11PMunchAverage of 500 runs
11:24:46PMunchMost of that is probably the file reading and data massaging though
11:28:03Zoom[m]For those who's been doing AOC since the start, did it change much? Is it more/less fun now?
11:30:16triblystill the same, i'd say
11:34:49PMunchDown to 0.52ms when I pre-converted my file to binary :P
11:35:29triblyp2: 348ฮผs
11:36:51*apahl quit (Ping timeout: 272 seconds)
11:36:57narimiranZoom[m]: for me 2019 was the worst; i like this year so far
11:37:22narimiranZoom[m]: but i might be in the minority, i heard lots of people praise intcode tasks from 2019
11:37:32*apahl joined #nim
11:38:53Zoom[m]I just logged in and I'm on day 19 of 2015 ๐Ÿฅด That's a lot of stuff to catch up
11:39:14Zoom[m]wdym intcode?
11:40:06narimiranZoom[m]: in 2019 there were lots of interconnected tasks (you need to solve one before the other) where you build an "intcode" computer
11:40:12Zoom[m]Worst of all, I suspect my solutions won't compile cleanly today :)
11:40:14narimiran*build and then later on - use
11:41:07narimiranZoom[m]: IMO leave previous years for the remaining 11 months; use december to solve current AoC
11:42:27Zoom[m]I know I won't be able to do it in time anyway, usually too much stuff happens IRL and at works in December. :(
11:43:26Zoom[m]Isn't there any interconnection between years? (besides the general setting)
11:43:48narimirannope
11:44:07narimiranand most of the time, there isn't one between the tasks either (except for the story)
11:44:25narimiran2019 invalidated ^ quite a bit
11:45:32Zoom[m]I remember there was some build-up in 2015 too, but I didn't like the interpreter direction much.
12:01:04*spiderstew quit (Quit: spiderstew)
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:33*supakeen joined #nim
12:50:33*abm joined #nim
12:59:48*lritter joined #nim
13:05:03FromDiscord<shadow.> this challenge is interesting
13:05:11FromDiscord<shadow.> im still tryna figure it out lol
13:05:28FromDiscord<shadow.> at first i was gonna just cycle fill it on x but then i realized that it's a pattern so that would be stupid
13:05:42PMunch`mod` is your friend ;)
13:05:52FromDiscord<shadow.> yeye thats what i was thinking too
13:06:24FromDiscord<shadow.> for clarification, the entire 300 or so line pattern cycles on the x axis?
13:07:05FromDiscord<shadow.> (edit) "300 or so" => "300-or-so" | "300-or-soline ... pattern" added "long"
13:07:36PMunchYes
13:07:43FromDiscord<shadow.> OHHH
13:07:44PMunchIt just repeats over and over again
13:07:46FromDiscord<shadow.> ok that makes more sense
13:07:52FromDiscord<shadow.> i thought it was that 11 y block gave in the example
13:07:57FromDiscord<shadow.> and i was like "am i seeing things bc this is not tiling-"
13:08:00FromDiscord<shadow.> loll
13:08:15FromDiscord<shadow.> ok now i get it haha
13:09:56*hmmm joined #nim
13:11:44FromDiscord<shadow.> ooooh
13:11:46FromDiscord<shadow.> i did it without mod haha
13:12:03FromDiscord<shadow.> well i guess i did an incremental mod
13:12:06PMunchJust manually?
13:12:25PMunchLike `while pos > trees[i].len: pos -= trees[i].len` or something like that?
13:12:37FromDiscord<shadow.> `if pos.x >= width: pos.x = pos.x - width`
13:12:42FromDiscord<shadow.> i suppose i shoulda used a while lol
13:12:50FromDiscord<shadow.> and yeah -=
13:14:17FromDiscord<shadow.> somehow i got away with using an if statement
13:14:21FromDiscord<shadow.> im guessing because of the low deltaX
13:14:57FromDiscord<shadow.> also, is there a better way to dynamically read all lines of a txt than `readFile("input.txt").split("\p")` lol?
13:15:07FromDiscord<shadow.> because i saw the old 1-arg `readLines()` proc is deprecated
13:15:31*natrys joined #nim
13:15:53narimiranbtw, this "manual mod" was useful for one of AoC tasks in previous years, if you wanted some performance because you were dividing by a large prime
13:16:27FromDiscord<shadow.> yeah that was my idea
13:16:35FromDiscord<shadow.> that you'd be wasting time doing mods on very large numbrs
13:17:41FromDiscord<shadow.> is there a way to accept unlimited arguments?
13:18:25PMunchUnlimited?
13:18:35FromDiscord<shadow.> like
13:18:42PMunchAnd for reading I've been using `toSeq(lines("input.txt"))`
13:18:48FromDiscord<shadow.> ohh smart
13:18:59FromDiscord<shadow.> here like for instance
13:19:15PMunchOr if I don't plan on pre-processing just `for line in lines("input.txt")`
13:19:25ZevvPMunch: where's your aoc code then
13:19:36FromDiscord<shadow.> sent a code paste, see https://paste.rs/sRc
13:19:36FromDiscord<shadow.> something like that?
13:19:41PMunchDoes the lines iterator have a pairs counterpart by the way?
13:19:59PMunchZevv, this is today: http://ix.io/2Gmc
13:20:25FromDiscord<shadow.> ix is still buggin
13:20:35PMunchReally?
13:20:41FromDiscord<shadow.> yeah
13:20:42narimiranlooks fine to me
13:20:45*Q-Master quit (Ping timeout: 240 seconds)
13:20:46FromDiscord<shadow.> oh fr?
13:20:54narimiranfr
13:20:55FromDiscord<shadow.> welp
13:20:58FromDiscord<shadow.> ix doesnt like me maybe
13:21:01FromDiscord<shadow.> lol
13:21:11PMunchNah I'm seeing errors as well
13:21:14FromDiscord<shadow.> rip
13:21:21FromDiscord<shadow.> so is there a way to accept arguments of any size?
13:21:27*kinkinkijduet joined #nim
13:21:32FromDiscord<shadow.> like so you could pass 2 or 5 strings to a function, and it would put them in a seq[string]?
13:21:39narimiranvarargs?
13:21:39FromDiscord<shadow.> (edit) "size?" => "quantity?"
13:21:43FromDiscord<shadow.> yes
13:21:45FromDiscord<shadow.> thank you lol
13:21:54FromDiscord<shadow.> how did i forget abt varargs-
13:22:39narimiranPMunch: why `height+down` on line 9?
13:22:51narimiranah, because you increase it first
13:23:21narimiranand if there was a tree on (0, 0), you would have off-by-one ;)
13:23:43FromDiscord<shadow.> wait it counts (0, 0)?
13:23:53PMunchAccording to the task "You start on the open square (.) in the top-left corner" ;)
13:24:02PMunchSo there should never be a tree at 0, 0
13:24:02FromDiscord<shadow.> yeah thats what i was thinking haha
13:24:06narimiranPMunch: ok, you win
13:24:13FromDiscord<shadow.> well this sure is odd, my solvePartOne() works but not my solvePartTwo
13:24:18PMunchHaha, don't think you can come here and trick me like that
13:24:31narimiransee you tomorrow!!
13:24:50PMunchThis is my bits and masking solution, with optional pre-parsing into a binary format: http://ix.io/2Gmi
13:25:09FromDiscord<shadow.> smart
13:25:45FromDiscord<shadow.> sent a code paste, see https://paste.rs/nGa
13:25:47FromDiscord<shadow.> i think i know where i messed up
13:25:47FromDiscord<shadow.> LOL
13:25:52FromDiscord<shadow.> that seems a bit of a leap-
13:26:03FromDiscord<shadow.> but it said answer was too low i am very confused lmao
13:26:10PMunchNah that looks fine
13:26:22PMunchBut yeah, those numbers look a bit low
13:26:27FromDiscord<shadow.> hmm
13:26:46FromDiscord<shadow.> whats odd is im not getting the same answer for part one i did using my part two func
13:27:47PMunchThen you probably messed it up :P
13:27:56FromDiscord<shadow.> rip
13:28:30FromDiscord<shadow.> ah i see
13:29:03FromDiscord<shadow.> tuple backwards
13:29:16FromDiscord<shadow.> there we go gottem
13:29:56PMunchtuple?
13:30:07PMunchI'm starting to think our solutions are very different :P
13:31:25FromDiscord<shadow.> aha yeah
13:31:26FromDiscord<shadow.> https://hatebin.com/idhwiplzsk
13:31:27FromDiscord<shadow.> here's mine
13:32:23FromDiscord<shadow.> oh i should just use prod
13:32:41FromDiscord<shadow.> eh nvm lol
13:33:43FromDiscord<Esbeesy> Here's my day 3 solution, finally find an excuse to write an iterator โ†ตhttps://github.com/sambeckingham/advent-of-code-2020/blob/main/day3/day3.nim
13:34:14FromDiscord<shadow.> hmm
13:34:20PMunchQuite different indeed
13:34:21FromDiscord<Esbeesy> Ah I love that var args, didn't know Nim could do that
13:34:30FromDiscord<shadow.> thanks haha
13:34:34FromDiscord<shadow.> how so pmunch
13:34:35PMunchWhy do you use four spaces for indentation by the way?
13:34:42PMunch@shadow. didn't you see mine?
13:34:47FromDiscord<shadow.> no idea its by habit haha
13:34:47FromDiscord<Esbeesy> Code just keeps defaulting to that
13:34:54FromDiscord<shadow.> oh i thought your bit masking and shifting one was not your normal one?
13:34:55FromDiscord<shadow.> was it?
13:35:06FromDiscord<Esbeesy> Is there a format/lint tool for nim somewhere?
13:35:09FromDiscord<shadow.> also i use 4 spaces because that's what i have tab bound to and i think it's default
13:35:11PMunchNah I had another one that was more "traditional"
13:35:18FromDiscord<shadow.> ohh i didn't see that one
13:35:23FromDiscord<shadow.> send it over
13:35:23PMunch@Esbeesy, yes
13:35:46FromDiscord<Esbeesy> It's not something obvious like `nim fmt` is it
13:35:50FromDiscord<shadow.> lol
13:36:05PMunchThis one: http://ix.io/2Gmu
13:36:37PMunchWell... https://github.com/FedericoCeratto/nimfmt
13:36:44PMunchIt's all one word :P
13:37:27*rockcavera quit (Remote host closed the connection)
13:37:52FromDiscord<shadow.> @Esbeesy RIP-
13:37:59FromDiscord<shadow.> sent a code paste, see https://paste.rs/iq9
13:38:05FromDiscord<shadow.> there, now my code is properly fp-obfuscated
13:39:01FromDiscord<shadow.> ah pmunch i quite like your solution haha
13:40:25PMunchPretty simple and straight-forward :P
13:40:31FromDiscord<shadow.> haha yeah
13:40:54FromDiscord<shadow.> i just wanted an excuse to try `in` with hslice's
13:40:58FromDiscord<Quibono> How do you download nimfmt?
13:42:47hmmmI think it's called nimpretty
13:43:02PMunchnimble install nimfmt
13:43:08hmmmoh it exist!
13:43:08PMunchYeah nimpretty is another one
13:43:49hmmmI'll try nimfmt too, nimpretty doesn't do much for all my messy whitespaces
13:44:18FromDiscord<Quibono> nimble install nimfmt isn't working for me on 1.4.2, I'mma try nimpretty
13:44:18PMunchHmm, I wonder why I can't get my x11 window reparenting to work..
13:44:28FromDiscord<Esbeesy> Okay so weird, nimfmt doesn't come with `scoop install nim`, I found nimpretty, tried that and it's changed the file according to git but.. not actually changed anything
13:44:41PMunchMaybe it's because the i3 window framing messes it up..
13:44:44FromDiscord<Esbeesy> Also yeah I cant nimble install nimfmt at all
13:44:59ZevvPMunch: put that shit in git man
13:44:59PMunchWhy not?
13:45:10hmmmye nimpretty it's pretty cool it sees your file and says "good enough mate"
13:45:15Zevvppl want to peek at and steal
13:45:22PMunchnimfmt isn't in the official Nim distribution it's a separate package
13:45:30FromDiscord<Quibono> Apparently Treeform made morepretty lol
13:45:42PMunchZevv, "please put your stuff up, people want to steal it" not the strongest argument :P
13:45:48Zevvsure is
13:46:44FromDiscord<Quibono> @Esbeesy Nimpretty works.
13:46:52FromDiscord<Quibono> Or morepretty I mean
13:47:28FromDiscord<Esbeesy> is morepretty a separate package?
13:47:28Zevvonly reason I put it up is I like to tell people the stole from me
13:47:31Zevvhear me, narimiran?!
13:47:35FromDiscord<Quibono> https://github.com/treeform/morepretty
13:47:49FromDiscord<Quibono> Seems pretty good.
13:47:52FromDiscord<Quibono> lol
13:48:00hmmm"remove blank lines" yes morepretty is what I need
13:48:45FromDiscord<Quibono> My problem is I like blank lines for formatting, but I guess I'll get over it
13:49:37triblyhm, aoc day3 part 2 down to 95ฮผs
13:50:19FromDiscord<Esbeesy> Yeah morepretty is good. Still at 4 space indent though, so I'm guessing that's ok for Nim?
13:50:33FromDiscord<shadow.> rip im in 59th
13:50:40FromDiscord<shadow.> in my timezone i cant do it until like 8 hours after its posted
13:50:46PMunchThere, happy now Zevv. https://github.com/PMunch/aoc2020
13:50:57FromDiscord<Quibono> Esbeesy it didn't mess with my two space indents
13:51:11FromDiscord<Quibono> I suspect it just keeps whatever you've already got
13:51:15FromDiscord<Esbeesy> Yeah I think it just keeps it consistent
13:52:34FromDiscord<wad35dam> Hello sir, i have a question, what the best nim's gui library?
13:52:46PMunchtribly, what kind of solution are you doing?
13:53:04PMunchAt that speed I half expect a purely compile-time solution :P
13:53:10narimiranZevv: who's stealing from you and your cryptic stuff?
13:53:19Zevvxor dude
13:53:20Zevvxor
13:53:32PMunch@wad35dam, depends on what you mean by best
13:53:33Zevvno one under 30 knows what xor is
13:53:35narimiranyou invented xor?! wow!!!
13:53:40FromDiscord<shadow.> im under 30
13:53:43PMunchEy, I know what xor is
13:53:44*Q-Master joined #nim
13:53:50Zevvliars
13:53:51narimiranPMunch: you're under 30?
13:53:54FromDiscord<shadow.> xor is an exclusive or operator / logic gate that only returns positive if one input is positive?
13:54:01FromDiscord<shadow.> im certainly under 30... lol
13:54:01narimiranIFF
13:54:30Zevvand my stuff is not cryptic. it's concise
13:54:39FromDiscord<lqdev> and cryptic
13:54:44narimiran^
13:54:51narimiran(and that was not xor)
13:54:55Zevvhehe
13:54:59FromDiscord<shadow.> hm?
13:55:06FromDiscord<Esbeesy> I typed xor in my day2 solution in the chance that it worked and it actually did ๐Ÿ˜‚ Was elated
13:55:07narimiranno, he goes by hmmm
13:55:18FromDiscord<shadow.> wait in the scope of booleans isnt xor just != lol
13:55:23FromDiscord<Esbeesy> Yeah
13:55:32narimiranto be honest, `!=` feels a bit more appropriate than `xor`
13:55:43FromDiscord<shadow.> eh for me xor feels better
13:55:48FromDiscord<shadow.> i feel like it's more readable
13:56:20Zevvall my solutions run in 0s. I just do it all compile time
13:56:25FromDiscord<shadow.> big brain asf
13:56:47triblyand down to 58ยตs
13:56:55triblyPMunch: mathetmatical one
13:57:01narimirantribly: ooooh, nice
13:57:38narimiranPMunch: you separately do each part? that's cheating!
13:58:16*Q-Master quit (Ping timeout: 240 seconds)
13:58:46FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GmU
13:58:49*Q-Master joined #nim
13:59:03PMunchnarimiran, what do you mean cheating? I get them individually, I solve them individually
13:59:13narimiranbooooriiing
13:59:33PMunchI mean my part2 solutions can all be used to solve the part1 puzzle as well :P
14:00:10narimiranbut then you can't measure how fast your solution is for both parts :P
14:00:13PMunchStill not sure what a mathematical solution to this would look like tribly
14:00:33FromDiscord<Esbeesy> Same, I'm interested to see it too
14:00:36PMunchOf course I can, I can just insert an extra call in my part2 solutions
14:00:57FromDiscord<shadow.> is there a `mod=` op?
14:01:13narimiranhow would you use that?
14:01:24FromDiscord<shadow.> var x = 10; x mod= 3; x == 1
14:01:49narimiranso something like `x %= 3` would do that?
14:01:52FromDiscord<shadow.> yeah
14:02:06FromDiscord<shadow.> i suppose i could just make a template
14:02:13narimiranif we don't even have `%` for `mod`..... ;)
14:02:20FromDiscord<shadow.> fair enough
14:02:23FromDiscord<shadow.> time to make a template
14:03:58FromDiscord<lqdev> what's so bad about just doing x = x mod 3
14:04:10FromDiscord<shadow.> verbose idk its reallly not an issue haha
14:04:15*lpy joined #nim
14:04:17FromDiscord<lqdev> also if your numbers are negative you're probably looking for math.floorMod
14:04:17FromDiscord<shadow.> i was just wondering
14:04:22FromDiscord<shadow.> not negative
14:04:25FromDiscord<shadow.> they're naturals
14:04:29FromDiscord<lqdev> kay
14:06:51*sagax quit (Read error: Connection reset by peer)
14:07:41FromDiscord<shadow.> can you map an iterator?
14:08:37narimirannah
14:08:37FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GmX
14:08:40FromDiscord<shadow.> this is giving me an error
14:08:42FromDiscord<shadow.> ah ok
14:08:46FromDiscord<shadow.> i suppose i can use collect
14:09:51PMunch@lqdev, it's annoying if you have long variable names to do `x = x mod y`
14:10:16PMunchI also want `shl=` and `and=`
14:10:19FromDiscord<lqdev> guess i should extend my scripting lang to support `x mod= y` then
14:11:26*natrys quit (Quit: natrys)
14:11:30FromDiscord<shadow.> ye probably
14:11:34narimiran`modeq`
14:11:38narimiran`shleq`
14:11:47*natrys joined #nim
14:11:55FromDiscord<Idefau> now i feel bad for letting the number just be big and then `mod`ing it when accessing the array
14:12:22FromDiscord<shadow.> lmao
14:12:49FromDiscord<shadow.> im sure in this problem it doesnt matter
14:12:53FromDiscord<Idefau> yea
14:13:04FromDiscord<shadow.> sent a code paste, see https://paste.rs/VXy
14:13:32FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gn0
14:13:54FromDiscord<Idefau> i got that too some times
14:14:03FromDiscord<shadow.> yeah im unsure of the cause
14:15:52PMunchIt means that you are trying to call the `lines` iterator like a procedure
14:16:12FromDiscord<shadow.> ah i see
14:16:22PMunchThat's why I'm using `toSeq`
14:16:58FromDiscord<shadow.> so is there any good way to map a function to an iterator?
14:17:05FromDiscord<shadow.> `lines("dictionary.txt").map(parseInt)`
14:17:45PMunch`toSeq(lines("dictionary.txt")).map(parseInt)`
14:17:45FromDiscord<shadow.> im guessing turning it into a seq is slower
14:18:45FromDiscord<shadow.> hmm fair enough
14:18:48FromDiscord<shadow.> `collect(newSeq, for line in lines("input.txt"): parseInt(line))`
14:18:51FromDiscord<shadow.> do you think that's any faster?
14:18:58FromDiscord<shadow.> albeit a bit more verbose
14:19:11PMunchThere is also this: https://nimble.directory/pkg/iterutils
14:19:28FromDiscord<shadow.> yeah i saw that but it didn't seem to like me using lines()
14:19:29FromDiscord<shadow.> same error
14:20:02PMunchDid you by any change try to call it like `lines("input.txt").map(<whatever>)`?
14:20:13FromDiscord<shadow.> `toIter(lines("input.txt")).map(parseInt)`
14:20:21FromDiscord<shadow.> is that incorrect?
14:20:26narimirantoSEQ
14:20:37PMunchnarimiran, he is using iterutils
14:20:41FromDiscord<shadow.> ye
14:20:47PMunchInstead of `map(lines("input.txt", <whatever>)`
14:21:00FromDiscord<shadow.> ahh
14:21:05FromDiscord<shadow.> you have to use it like that?
14:22:06PMunchHmm, same error
14:22:30FromDiscord<shadow.> yeah
14:22:54FromDiscord<shadow.> odd
14:23:16PMunchIndeed
14:23:45FromDiscord<shadow.> i suppose using collect or toSeq wont kill me
14:23:59FromDiscord<shadow.> but toSeq() is def slower than an iter map
14:24:01FromDiscord<shadow.> i suppose ill use collect
14:24:02narimiranRIP shadow.
14:25:41FromDiscord<shadow.> rip me
14:25:48FromDiscord<shadow.> my FP looking ass can't map an iterator
14:25:49FromDiscord<shadow.> how sad
14:26:00FromDiscord<Idefau> sad!
14:26:12FromDiscord<shadow.> smh the VERBOSITY!
14:26:14FromDiscord<shadow.> `collect(newSeq, for line in lines("input.txt"): parseInt(line))`
14:26:22FromDiscord<Idefau> at this point why not just
14:26:30FromDiscord<Idefau> for line in lines: dothing
14:28:57FromDiscord<shadow.> eh
14:29:02FromDiscord<shadow.> ehh
14:29:10FromDiscord<shadow.> that would require more than one line
14:29:15FromDiscord<shadow.> and i like writing bad code
14:29:49narimiran`toSeq(lines("dictionary.txt")).map(parseInt)` is nicer than this
14:31:51*natrys quit (Quit: natrys)
14:32:02FromDiscord<shadow.> i agree
14:32:14FromDiscord<shadow.> but doesn't that require two iterations?
14:32:37narimiranargh, it might
14:32:51FromDiscord<shadow.> eh whatever its fine
14:32:53FromDiscord<shadow.> the txt is only 200 lines anyways lma o
14:32:54FromDiscord<shadow.> (edit) "lma o" => "lmao"
14:33:30narimiranpremature optimization? we would never!!
14:34:50FromDiscord<Quibono> lol
14:35:04ZevvPremature Optimization. Causes and Symptons. Talk to your doctor.
14:35:37FromDiscord<Quibono> It's only premature if your coding partners want to wait.
14:36:43FromDiscord<shadow.> lol
14:37:23Zevvfor AOC it's always premature
14:37:59Zevvthey never have a single puzzle that relies on processing power.
14:38:25Zevvyou can complete all of aoc on whatever old hardware you want. If you find you're waiting longer then a few seconds, you're not looking at the right solution.
14:38:50narimiranZevv: oooh, you just wait here till i find a link
14:39:20narimirani think it was this one: https://adventofcode.com/2016/day/11
14:40:04FromDiscord<shadow.> oh thanks zevv, in that case i suppose i shouldn't have immediately jumped two a one-pass hash set for part one lmao
14:40:10FromDiscord<shadow.> nested loops woulda been way easier
14:40:29FromDiscord<shadow.> (edit) "two" => "to" | "part" => "day"
14:40:35FromDiscord<shadow.> (edit) "oh thanks zevv, in that case i suppose i shouldn't have immediately jumped to a one-pass hash set ... for" added "solition"
14:40:38FromDiscord<shadow.> (edit) "solition" => "solution"
14:41:47narimiranthere were some tasks where without optimizations you would still by this day wait for your part2 solution
14:42:09FromDiscord<shadow.> lol
14:42:36Zevvthat's the whole point.
14:42:45ZevvJust recursively hammering the total problem space will not get you there
14:44:57ZevvI'm hoping to pull in cmae-es and z3 this year
14:47:27ZevvMy nim cache is sometimes frigged up if I have a file with the same name in different folders
14:47:32Zevvis that a known issue?
14:47:48narimirani haven't experienced it myself
14:47:54ZevvSo I have two projects both with 'main.nim' in two different dirs
14:48:00Zevvnim throws in the wrong cached version
14:48:30*vicfred joined #nim
14:56:43PMunchUhm, that's weird
14:57:23*hmmm quit ()
14:57:49*waleee-cl joined #nim
14:58:33*tane joined #nim
14:59:32*natrys joined #nim
15:16:06FromDiscord<kenran> I have some `array[100, uint8]`. How can I get a string from that? That is, what part of the documentation should I be looking at?
15:17:20PMunch@kenran, `$`
15:19:09narimiran`a.mapIt(chr(it.int))`
15:20:22PMunchHow would that help him?
15:20:39PMunchcast[array[100, char]] is way faster
15:20:49*natrys quit (Ping timeout: 246 seconds)
15:20:56narimirantrue
15:21:16PMunchI mean it depends on what kind of string he wants
15:24:38PMunchhere are some options for you: https://hastebin.com/mifareyeva.nim
15:24:38*natrys joined #nim
15:24:57Zevvif youre 0-terminated you should be able to cast to cstring
15:25:10Zevvbut as soon as you use that as a nim string, nim wil $ify that
15:25:15Zevveffectively copying the payload
15:25:58*PMunch quit (Quit: leaving)
15:26:28triblyok, down to 7ยตs :D
15:26:36narimirantribly: show us!
15:28:41triblyhttps://play.nim-lang.org/#ix=2Gno
15:28:51triblynot very nimy, since i'm still new to the language
15:30:08*jxy quit (Quit: leaving)
15:30:22*jxy joined #nim
15:30:25narimirani don't see what would make it *that* fast
15:30:42narimiranare you sure you're using microseconds correctly? :D :D
15:31:13FromDiscord<Idefau> i think aoc is making ix really slow
15:31:14FromDiscord<Idefau> since i cant load it
15:31:50FromDiscord<shadow.> yeah im guessing thats why ix is being used so much
15:31:50narimirantribly: does your code maybe run in 7 ms? :)
15:32:34FromDiscord<shadow.> im going to assume that's the case haha
15:32:46FromDiscord<shadow.> microseconds are a very very small amount of time
15:33:16FromDiscord<Idefau> thats very similar to how i did it
15:33:32FromDiscord<Idefau> kinda
15:35:18triblycompile and see :P
15:35:34narimirani can tell without compiling ;)
15:35:38FromDiscord<Idefau> lel
15:36:09FromDiscord<shadow.> lol
15:36:16triblynarimiran: compile it
15:36:20narimiranok
15:36:34FromDiscord<shadow.> lol
15:36:36FromDiscord<shadow.> we'll see i suppose
15:36:48FromDiscord<shadow.> 7u just sounds quite speedy for code that isn't crazily optimized
15:38:24narimiranyour benchmark is optimized out
15:38:51narimiranwith `perf` i get similar results as for my code: around 0.5ms
15:42:03narimiranyour benchmarking tool gives 24 ns for my solution
15:42:30FromDiscord<Idefau> whats perf btw
15:42:32narimiran(when i use {.discardable.} just like you did)
15:43:21narimiranhttps://perf.wiki.kernel.org/index.php/Main_Page
15:43:38FromDiscord<Idefau> thanks
15:44:56FromDiscord<kenran> thanks!
15:45:48narimirantribly: is my code really ~300x faster than yours? :P
15:46:43FromDiscord<Idefau> i ran perf on day 3 and it says 1,31 msec
15:46:47FromDiscord<Idefau> fuck
15:47:22FromDiscord<shadow.> f
15:47:30FromDiscord<shadow.> time to see if `xperf` exists
15:47:34FromDiscord<shadow.> windows kiddy things i suppose
15:47:36narimiranrun it multiple times: `perf stat -r 50 --table -o $out_file ./day03 > /dev/null`
15:47:56ForumUpdaterBotNew thread by Geohuz: Need help for db_postgres usage, see https://forum.nim-lang.org/t/7195
15:48:22narimiranand then you'll get results of 50 runs in $out_file
15:48:32*natrys quit (Quit: natrys)
15:48:52*natrys joined #nim
15:49:12FromDiscord<Idefau> 0,8
15:49:23FromDiscord<Idefau> welp
15:50:18FromDiscord<kenran> sent a code paste, see https://play.nim-lang.org/#ix=2Gnv
15:50:46FromDiscord<Idefau> im reading it at compile time
15:51:10FromDiscord<kenran> sent a code paste, see https://play.nim-lang.org/#ix=2Gnw
15:52:23FromDiscord<kenran> I'm actually reading from the master FD of a PTY, and I expect to receive a "shell prompt" from reading the buffer. The error seems to happen whenever I try to read more than there actually is. But in that case I'd have expected `actualLen` to be a lower number, and not an exception.
15:52:33FromDiscord<kenran> Did I misunderstand anything with `readBuffer`?
15:53:00FromDiscord<kenran> (edit) sent a code paste, see https://paste.rs/CNZ
15:53:22FromDiscord<shadow.> oh i think i remember having this exact issue lmfao
15:53:24FromDiscord<shadow.> lemme see how i fixed it
15:54:01FromDiscord<shadow.> @kenran any reason you cant use a higher-level function?
15:54:07FromDiscord<shadow.> addr is typically bad practice
15:55:28FromDiscord<shadow.> in addition, prolly makes more sense to use a `let` for `actualLen` but ill leave that up to you
15:57:09*hnOsmium0001 joined #nim
15:58:40FromDiscord<enthus1ast> or use @flywind 's nice timit module: https://github.com/xflywind/timeit
15:59:21FromDiscord<enthus1ast> this generates output like this:โ†ต`[1ms 10ฮผs 246.60ns] ยฑ [33ฮผs 723.53ns] per loop (mean ยฑ std. dev. of 7 runs, 1000 loops each)`
15:59:43*rockcavera joined #nim
15:59:57FromDiscord<enthus1ast> (which is my day3)
16:00:27narimirani think he's using that module
16:00:45FromGitter<HJarausch_gitlab> valgrind output - is that to be expected? โŽ I get LOTS of โŽ Use of uninitialised value of size 8 โŽ and โŽ Conditional jump or move depends on uninitialised value(s) ... [https://gitter.im/nim-lang/Nim?at=5fc90bad657e0c48225be3bb]
16:01:17FromDiscord<kenran> I don't know any. These are my "first step" (I took a long break) with Nim. Can you point me to one? (The `var` is just there from me duplicating the same code below to see where the problem happened).
16:01:23FromDiscord<shadow.> i am quite confused timeit says `51ms` for one of my benchmarking programs but powershell Measure-Command says `18ms` lmao
16:01:25FromDiscord<kenran> (edit) "step"" => "steps""
16:01:35FromDiscord<shadow.> @kenran take a look at the `streams` module perhaps
16:01:38FromDiscord<kenran> Can you point me to a higher-level module/function I could try?
16:01:44FromDiscord<kenran> Ah thanks
16:01:49FromDiscord<shadow.> i mean
16:01:52FromDiscord<shadow.> you're just reading uint8's right?
16:01:54triblynarimiran: well, then tell xflywind his 'timeit' is wrong :P
16:02:24FromDiscord<kenran> But doesn't this smell buggy in some way? I could read one `uint8` after another, but even then I wouldn't know when I'd have read the one that was "too much".
16:02:30FromDiscord<shadow.> ohh wait
16:02:36FromDiscord<shadow.> lemme take a look at my file transfer client lol
16:02:40FromDiscord<shadow.> i remember reading bytes in that
16:03:19FromDiscord<enthus1ast> can you peek on the stream @keran ?
16:03:19FromDiscord<shadow.> maybe `readBytes()` ?
16:03:28FromDiscord<enthus1ast> (edit) "@keran" => "@kenran "
16:04:52FromDiscord<shadow.> tho im guessing that's similar to readBuffer
16:05:01FromDiscord<flywind> or use https://github.com/disruptek/criterion
16:05:05FromDiscord<kenran> I tried `readBytes` before
16:05:28FromDiscord<flywind> (edit) "or use https://github.com/disruptek/criterion ... " added " It is very convenient."
16:05:49FromDiscord<kenran> I'm now taking a look at the streams. I could probably create a `FileStream` from my `File` then see what I can do with that.
16:05:58narimiranbut beware of stuff getting optimized out
16:06:11FromDiscord<shadow.> lemme look over streams again
16:06:41FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gny
16:06:42FromDiscord<shadow.> thats what i used apparently
16:06:47FromDiscord<shadow.> back on 11/13 when i first asked lol
16:07:12*kinkinkijduet quit (Read error: Connection reset by peer)
16:07:26triblynarimiran: what does you code look like?
16:07:42narimirantribly: like this: https://github.com/narimiran/AdventOfCode2020/blob/master/nim/day03.nim
16:09:43FromDiscord<shadow.> may i ask why you use func?
16:10:32narimiranso the compiler can yell at me if i use some global variable
16:10:36FromDiscord<shadow.> ohhhh
16:10:48FromDiscord<shadow.> func's doesn't allow global or io operations right?
16:10:54FromDiscord<shadow.> (edit) "func's doesn't" => "funcs dont"
16:13:01FromDiscord<kenran> I tried using `while (strm.readLine(line):`, but get the same error. I gotta leave now, but I'll check back later. I wanna get this to work...
16:13:15FromDiscord<kenran> will try that next, ty
16:13:38FromDiscord<shadow.> ofc
16:22:59FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2GnB
16:25:51triblynarimiran: shouldn't just reading the file via 'readFile' and just going over it be a bit faster than doing a 'toSeq'?
16:26:16narimirantribly: readfile and then splitlines?
16:26:33narimirani think i tried to measure both and didn't see a measurable difference
16:26:40triblynarimiran: no, just readFile
16:27:01narimiranbut then i would need to know how long is each line, no?
16:27:11narimiran(that's cheating :))
16:27:40triblyhm, true
16:29:01triblybut since everyone has the same line-length, maybe it's not!
16:29:06FromDiscord<lqdev> @ajusa because you're effectively discarding the Heartbeat's fields by converting it to a smaller type Data, and then trying to widen that small Data into a bigger Client
16:29:21FromDiscord<lqdev> try using `ref object of <whatever>` on all your objects
16:29:31narimirantribly: the example has shorter lines ;)
16:29:42FromDiscord<lqdev> this will make them into pointers so these conversions will be mostly legal
16:29:51FromDiscord<lqdev> except the last conversion from Data to Client
16:29:51triblynarimiran: and is the same for everyone :P
16:30:00FromDiscord<lqdev> because Heartbeat is a different object type
16:30:25FromDiscord<ajusa> So I can't convert from the parent object type to a different child object like this then?
16:30:25narimirantribly: but the same code won't work both for the example and real input
16:30:55triblynarimiran: is this cheating then aswell? https://en.wikipedia.org/wiki/Fast_inverse_square_root
16:30:58narimiranthe example - one inside the text of the task
16:31:05FromDiscord<lqdev> @ajusa nope. how would you expect this to work anyways?
16:31:42FromDiscord<ajusa> What I would like to do is assign all of the fields that both Data and Heartbeat share into an new Client.
16:31:58narimirantribly: for these initial tasks i prefer as least amount of "cheating" as possible
16:32:16narimiranlater on: bring all the hackr
16:32:20narimiran*hacks
16:33:02FromDiscord<lqdev> @ajusa that's not possible
16:33:18FromDiscord<lqdev> initially you're allocating an object with the size of `Heartbeat`
16:33:33FromDiscord<lqdev> but `Client` and `Heartbeat` have different sizes and memory layouts
16:33:43FromDiscord<lqdev> so that sort of conversion simply isn't possible
16:35:20FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2GnD
16:35:36FromDiscord<lqdev> yes
16:35:43FromDiscord<lqdev> otherwise it will raise
16:35:46FromDiscord<ajusa> Oh god I'm dumb the next line literally says that
16:35:47FromDiscord<kenran> damn, same problem. I have to figure out what is actually being read. I can for instance read, say, 50 bytes into a 100-byte buffer. It returns 50, but I can see that there are only zeroes after a certain point anyway (like, position 15 or so).
16:35:50FromDiscord<kenran> I don't get it...
16:36:00FromDiscord<ajusa> (edit) "that" => "that,โ†ต"The InvalidObjectConversionDefect exception is raised if x is not a Student""
16:36:22FromDiscord<shadow.> yeah i remember getting weird behaviour from this
16:36:25FromDiscord<shadow.> i just dont remember how i fixed it
16:36:30FromDiscord<shadow.> @kenran whats the exact problem again
16:38:15FromDiscord<kenran> I'm beginning to get a better grasp now. If I try to read "too much" in some way from the PTY (given to me as an FD, and I use `open` to get a `File`), then I get an error "resource temporarily unavailable". But I just found something that says that this is an `EAGAIN` error (whatever that means). In some way, I cannot read as much from the FD.
16:39:15FromDiscord<ajusa> sent a code paste, see https://paste.rs/z3P
16:39:37FromDiscord<lqdev> you can actually convert a Heartbeat to a Client because Client is its parent type
16:40:06FromDiscord<lqdev> this will produce a Client that is in reality a Heartbeat
16:40:09FromDiscord<lqdev> however
16:40:21FromDiscord<lqdev> ah wait
16:40:26FromDiscord<ajusa> Data is the parent type
16:40:29FromDiscord<lqdev> i meant Data yes
16:40:29FromDiscord<lqdev> my bad
16:40:49FromDiscord<lqdev> so yeah that's your only solution for that
16:41:09FromDiscord<shadow.> @kenran are you stopping once the number is less than the amount of bytes ur tryna read?
16:42:53FromDiscord<kenran> I only have one call to `readXXX` now, which tries to read 50 bytes on first try. This works. If I increase this number to for instance 250, it fails on first try. So I'm actually not getting any length back, it crashes immediately.
16:43:01*sagax joined #nim
16:43:26FromDiscord<kenran> I now found out that this has to do with the access being nonblocking. Not sure how exactly, but it's a start.
16:44:13*narimiran quit (Ping timeout: 256 seconds)
16:45:42FromDiscord<shadow.> fair enough haha
16:46:21*narimiran joined #nim
16:48:34FromDiscord<kenran> I think I have to find out how to find out when I'm allowed to read anything. This is supposed to become a terminal emulator, and I still haven't quite understood how that whole thing works at all. That is, there are three "threads": one that reads from the stream/pipe/fd/pty/whatever, one that displays the terminal using what has been read, and one that writes user input to the fd.
16:49:10FromDiscord<kenran> That is, one has to continuously read while another one has to write to the same FD. No idea yet how that's supposed to go well ๐Ÿ˜„
16:57:29FromDiscord<shadow.> ohh you're on threads?
16:57:35FromDiscord<shadow.> still odd how inconsistent it is
16:59:49FromGitter<sealmove> how to add a child to NimNode in specific index?
17:00:00FromGitter<sealmove> basically I want to add it before the last child
17:01:24FromGitter<sealmove> for example I have `children = @[a, b, c]` and after adding `d` I want to have `children = @[a, b, d, c]`
17:01:34FromDiscord<lytedev> is there some reason this wouldn't work? https://nim-lang.org/docs/macros.html#insert%2CNimNode%2Cint%2CNimNode
17:02:05Zoom[m]How are you guys benchmarking your stuff?
17:02:19*Q-Master quit (Ping timeout: 246 seconds)
17:03:00Zoom[m]Any lib to streamline the process?
17:03:17FromDiscord<Vindaar> @lytedev Well, it might not work if the length of the node `n` is smaller than `pos` but should work otherwise
17:03:36FromGitter<sealmove> oh thank lytedev, this looks file, just missed the proc
17:03:41FromDiscord<kenran> no no, it will be at some point, or rather it has to
17:03:55FromDiscord<shadow.> oh ok
17:04:05FromDiscord<shadow.> zoom you can use perf
17:04:07FromDiscord<shadow.> or timeit
17:04:42*letto quit (Quit: Konversation terminated!)
17:04:54FromDiscord<kenran> Right now I'm trying to get a scenario to work where I write something to the FD, then read the resulting stuff, that is, the shell prompt with the stuff I've written to it and the result thereof (if I've written something like "ls -l")
17:05:30Zoom[m]It would be great to have some benchmarking facilities included in a testing library.
17:06:28*letto joined #nim
17:06:30FromDiscord<kenran> My main problem is that I've never done low-level stuff before and that I can't read C very well. I tried reading the `st` source code, but lots of it is X stuff, plus it's even lower-level than I'd like my Nim code to be.
17:07:50FromDiscord<shadow.> zoom maybe try criterion?
17:07:53FromDiscord<shadow.> or timeit yeah
17:08:01FromDiscord<shadow.> depends on how much you need
17:09:34Zoom[m]Thanks @shadow.
17:09:48FromDiscord<shadow.> np
17:11:04FromDiscord<nim> hi
17:11:09FromDiscord<nim> i joined just bc my name is nim
17:11:53*ehmry quit (Ping timeout: 272 seconds)
17:12:44FromDiscord<Idefau> lmfao
17:12:59Clonkk[m]Isn't that copyright infringement ?
17:13:11Clonkk[m]๐Ÿ˜€
17:13:15FromDiscord<nim> what
17:13:31FromDiscord<nim> its short for nimuriell
17:13:46FromDiscord<Idefau> its actually short for nimrod
17:14:19FromGitter<sealmove> wtf, insert is weird, it is 1-indexed
17:14:29FromDiscord<shadow.> well
17:14:33FromDiscord<nim> nono when i played lotro in like 2010 i took that name
17:14:33FromDiscord<nim> :3
17:14:41FromDiscord<shadow.> nimrod has been around since what, 2004?
17:14:44*a_chou joined #nim
17:14:48FromDiscord<nim> dunno
17:14:55FromDiscord<nim> ive heard of nim the language like
17:14:58mipriplease change your name. You are infringing on our copyright.
17:14:58FromDiscord<nim> 2 years ago
17:15:01FromDiscord<nim> id l ike to learn it
17:15:01FromDiscord<shadow.> lol
17:15:10FromDiscord<nim> ok time to leave and change my name iog
17:15:12FromDiscord<nim> (edit) "iog" => "ig"
17:15:14FromDiscord<shadow.> LOL
17:15:17FromGitter<sealmove> or maybe not, but I did `insert(node.len, child)` and it worked, don't know what that means
17:15:24FromDiscord<shadow.> brb changing my name to google so someone arrests me
17:15:44miprigoogle's a big evil company. They can afford to send an assassin instead.
17:15:48*a_chou quit (Remote host closed the connection)
17:15:49FromDiscord<shadow.> true
17:16:08Clonkk[m]They don't really have to send an assassin, they can just threaten to send your search history to your mother
17:16:13FromDiscord<shadow.> hmm
17:16:17FromDiscord<shadow.> let me find my search history
17:16:27FromDiscord<shadow.> "macros
17:16:31FromDiscord<shadow.> (edit) ""macros ... " added "in nim""
17:16:35FromDiscord<shadow.> "how old is nim language"
17:16:42FromDiscord<shadow.> "github"
17:16:51FromDiscord<shadow.> and then
17:16:54FromDiscord<shadow.> some advent of code stuff
17:16:55FromDiscord<shadow.> school work
17:17:01FromDiscord<shadow.> lmao
17:17:03FromDiscord<Idefau> yeah bro i totally believe you didnt search rule34
17:17:04FromDiscord<shadow.> nothing my mother would kill me for
17:17:15FromDiscord<shadow.> i mean
17:17:23FromDiscord<shadow.> i cant send pictures bc my name is in my schoolwork searches lmao
17:17:31FromDiscord<Idefau> fair
17:17:46FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/784106113347354644/unknown.png
17:17:50FromDiscord<shadow.> mostly me searching shit abt the odyssey
17:18:03FromDiscord<shadow.> lmfao
17:19:10FromDiscord<shadow.> n e way
17:19:24FromDiscord<shadow.> i suppose we'll know where most people fail on aoc once ix comes back up
17:21:33FromGitter<sealmove> @PMunch please merge https://github.com/PMunch/binaryparse/pull/10 It should be very easy to review, only 3 lines added and 1 edited.
17:21:33disbotโžฅ Generate extra parameters and arguments for custom write proc
17:26:59*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
17:28:41*Lord_Nightmare joined #nim
17:29:58*Q-Master joined #nim
17:34:44*Q-Master quit (Ping timeout: 265 seconds)
17:46:52*Vladar joined #nim
17:48:20planetis[m]@sealmove I made a small binary marshal lib https://github.com/planetis-m/bingod would you be interested?
17:49:38FromGitter<sealmove> hey planetis, busy rn, I'll check it later
17:50:51planetis[m]cool, usecase is just saving and loading game state
17:53:45*habamax quit (Ping timeout: 240 seconds)
17:54:50*spiderstew joined #nim
17:56:35FromDiscord<shadow.> im just curious, what are the benefits of using irc rather than discord?
17:56:40FromDiscord<shadow.> since i see a large amount of people are on irc
17:57:05*Q-Master joined #nim
18:00:16*zarlet joined #nim
18:01:08FromDiscord<lytedev> not having to have a web or electron app is nice
18:01:56FromDiscord<zetashift> also Discord could be doing all kinds of things with your info
18:02:42FromDiscord<zetashift> also IRC is one of the best "old school" things ever๐Ÿคญ
18:03:18FromDiscord<shadow.> ah fair enough haha
18:03:51mipritrivial-to-implement servers and clients. open source servers. self-hostable servers. easy tooling. clients you can run from a VPS. client software that doesn't feel the need to constantly scan your memory for 'features' like telling people what game you're playing, etc.
18:04:25mipriplanetis[m] is probably using Matrix though, and only showing up as coming from IRC.
18:05:01FromDiscord<lytedev> I love being able to just ripgrep through my logs, personally -- just being able to own your data is so nice
18:06:03FromDiscord<zetashift> Discord is really just, really easy to use. That's pretty much it
18:06:17ForumUpdaterBotNew thread by Snej: Unicode "sortkey" API?, see https://forum.nim-lang.org/t/7196
18:08:17ForumUpdaterBotNew thread by Snej: Meta: Can't change category of a thread after creating it, see https://forum.nim-lang.org/t/7197
18:11:39FromDiscord<shadow.> yeah idk i just like discord because of easy file uploads and code formatting
18:11:46FromDiscord<shadow.> but i suppose i could get use to ix lol
18:15:49FromDiscord<lytedev> if you're in the terminal all the time, uploads are definitely easier there -- especially if you setup a reasonable aliasโ†ตโ†ตI prefer 0x0.st
18:16:48FromDiscord<Idefau> yeah 0x0.st is nice
18:17:29FromDiscord<shadow.> i suppose i could always make my own
18:17:30FromDiscord<shadow.> lol
18:17:42FromDiscord<Idefau> i mean you can host 0x0.st yourself afaik
18:17:58FromDiscord<shadow.> oh lol
18:18:02FromDiscord<shadow.> " anything related to crypto currencies"
18:18:09FromDiscord<shadow.> why's this a rule? just curious
18:20:00FromDiscord<Idefau> probably just to prevent bitcoin scams or whatever
18:20:23FromDiscord<Idefau> just share your address in pgp B)
18:23:51FromDiscord<shadow.> lmao fair enough haha
18:23:59FromDiscord<shadow.> i dont use crypto so doesnt affect me i was just wondering
18:48:29*natrys quit (Quit: natrys)
18:58:48*thomasross joined #nim
19:03:20*wiml joined #nim
19:03:59FromDiscord<shadow.> should i be using `\n` or `\p`?
19:04:16FromDiscord<shadow.> \p is platform-specific newline right
19:04:19FromDiscord<shadow.> and \n is line feed?
19:04:33FromDiscord<shadow.> or am i mixing something up
19:07:05*PMunch joined #nim
19:07:08FromDiscord<lqdev> yeah
19:07:17FromDiscord<lqdev> you can't use \p in char literals
19:07:23FromDiscord<shadow.> hmm ok
19:07:41FromDiscord<shadow.> wait
19:07:46FromDiscord<shadow.> \n isnt allowed either as a char right?
19:08:18FromDiscord<lqdev> it is allowed
19:08:20FromDiscord<lqdev> \p isn't
19:08:29FromDiscord<lqdev> because it can actually be 2 characters
19:08:59FromDiscord<shadow.> > The newline escape sequence \n isnโ€™t allowed inโ†ต> a character literal as it may be composed of multiple characters on some platforms.
19:09:01FromDiscord<shadow.> very confused
19:09:06FromDiscord<shadow.> - nim in action
19:09:11FromDiscord<Idefau> \n is a singular special character
19:09:16FromDiscord<Idefau> \p is not
19:09:17FromDiscord<Idefau> so its
19:09:30FromDiscord<Idefau> (edit) "its" => "it can be 2 chars"
19:09:32FromDiscord<shadow.> ah ok
19:09:40FromDiscord<shadow.> any reason why the book says \n cant be a char?
19:09:47FromDiscord<shadow.> not calling anything out im just wondering lmao
19:10:24FromDiscord<Idefau> !eval echo typeof('\n')
19:10:28NimBotchar
19:10:56FromDiscord<Idefau> i assume the behaviour of older nim was that in the book
19:11:30mipriyeah, that's why there are two escape codes for ascii 10
19:11:56FromDiscord<$not> :rooHacker:
19:11:58FromDiscord<lqdev> @dom96 being the author probably knows the history
19:11:59FromDiscord<$not> im nimrod now
19:12:16FromDiscord<Idefau> yup
19:13:01FromDiscord<$not> <a:D7_ThonkLeave:765378344589066242>
19:13:42FromDiscord<shadow.> ah makes sense
19:13:47FromDiscord<shadow.> welcome
19:15:05FromDiscord<shadow.> how come echo can be called without parentheses but other procs cant?
19:15:07FromDiscord<shadow.> is echo not a proc
19:15:28mipriit's a proc.
19:15:37FromDiscord<kenran> @shadow. well, non-blocking IO on pipes/ptys is the reason after all. I can't test it right now, but getting an 11/`EAGAIN` from `read()` (which is most likely the function used underneath `readBuffer` and such) is normal and one might just try again, but the better alternative would be to use `select()` in some way to read as soon as it's readable again.
19:15:40mipriother procs can be called without parens.
19:16:24FromDiscord<shadow.> wait
19:16:26FromDiscord<shadow.> really?
19:16:29mipriyes.
19:16:33FromDiscord<shadow.> WHAT
19:16:34FromDiscord<shadow.> MY BRAIN-
19:17:22*hmmm joined #nim
19:17:27FromDiscord<shadow.> @kenran yeah sounds abt right
19:18:15miprihttps://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax
19:21:31FromDiscord<Idefau> if i wanted i could do
19:21:37FromDiscord<Idefau> !eval echo typeof '\n'
19:21:42NimBotchar
19:22:30wimlhey, is there documentation on how to write type guards for generics? the "language manual" doesn't really cover it, but there are some examples that show it, and the grammar is way too general for me to infer it
19:23:43*vicfred quit (Ping timeout: 246 seconds)
19:31:48FromDiscord<shadow.> oh ok good to know thanks
19:34:06hmmmhey my dudes, "if not @seq" works like in python?
19:35:22FromDiscord<shadow.> !eval echo not @impbox
19:35:24FromDiscord<shadow.> bruh
19:35:25FromDiscord<shadow.> autocomplete
19:35:25NimBotCompile failed: /usercode/in.nim(1, 11) Error: undeclared identifier: 'impbox'
19:35:44FromDiscord<Idefau> nice ping
19:35:53FromDiscord<shadow.> !eval echo not newSeq[int]()
19:35:55FromDiscord<shadow.> autocomplete
19:35:56NimBotCompile failed: /usercode/in.nim(1, 6) Error: type mismatch: got <seq[int]>
19:36:09FromDiscord<shadow.> :hmmm i dont think it does
19:36:38hmmmbummer
19:36:58FromDiscord<shadow.> i mean `.len`
19:37:09FromDiscord<shadow.> lemme whip open inim
19:37:41FromDiscord<shadow.> yeah there's no bool converter for seq's
19:37:55hmmmyea if xyz.len = 0 works just the same
19:38:05hmmmstill if not xyz is cooler
19:38:09FromDiscord<shadow.> == but ye ik wym
19:38:24FromDiscord<Idefau> < 1
19:38:29FromDiscord<shadow.> eh i guess it could be "cooler" but it is a bit less clear for a non-python programer
19:38:41FromDiscord<shadow.> (edit) "programer" => "programmer"
19:41:06wimlshadow. you can also just locally define a seq[T] to bool converter if you want that kind of implicit falsy-ness
19:41:58FromDiscord<shadow.> no i would not want that lmao
19:42:01FromDiscord<shadow.> that's what im saying
19:42:24FromDiscord<shadow.> idk imo its harder to read and it's really not that hard to type `s.len > 0`
19:44:05mipriand such a converter will apply in all cases that you pass a seq to something expecting a bool, not just the few ifs you're thinking of. If you come back later after you've forgotten it, and change some code, you might get code that compiles but doesn't do what you want due to a blatant error that would normally fail to typecheck
19:44:49mipriI'd rather just define an .empty
19:44:54FromDiscord<shadow.> yeah same
19:45:40FromDiscord<shadow.> ?
19:45:41FromDiscord<shadow.> sent a code paste, see https://paste.rs/6WE
19:45:57FromDiscord<shadow.> i suppose openArray would work too
19:45:59FromDiscord<Idefau> what about a template
19:46:01FromDiscord<shadow.> fair
19:46:11FromDiscord<shadow.> i thought of that too but i didnt know the speed difference
19:46:13FromDiscord<Idefau> or an inline
19:46:54FromDiscord<shadow.> sent a code paste, see https://paste.rs/UwB
19:47:27FromDiscord<Idefau> hmmm
19:47:35FromDiscord<shadow.> might want parentheses for precedence
19:47:38FromDiscord<shadow.> nvm
19:47:44FromDiscord<shadow.> doesn't == have low precedence
19:47:56FromDiscord<shadow.> nvm ive no idea lmao
19:48:24*NimBot joined #nim
19:48:32FromDiscord<Idefau> (edit) "https://play.nim-lang.org/#ix=2GoA" => "https://paste.rs/9so"
19:48:45FromDiscord<Idefau> (edit) "https://paste.rs/d11" => "https://paste.rs/P14"
19:48:49FromDiscord<shadow.> that's incorrect is it not
19:48:51FromDiscord<shadow.> that's notEmpty
19:49:10FromDiscord<Idefau> works in nim playground :^)
19:49:14FromDiscord<shadow.> wtf
19:49:16FromDiscord<shadow.> confused
19:49:18FromDiscord<Idefau> oh
19:49:21FromDiscord<shadow.> lol
19:49:23FromDiscord<Idefau> yeah thats notempty
19:49:25FromDiscord<lqdev> @shadow. why parentheses?
19:49:29FromDiscord<lqdev> nim's templates are not dumb
19:49:32FromDiscord<shadow.> ohh ok
19:49:33FromDiscord<shadow.> whew
19:49:33FromDiscord<shadow.> lol
19:49:35FromDiscord<lqdev> like C macros are
19:50:06FromDiscord<shadow.> sent a code paste, see https://paste.rs/ywh
19:50:18FromDiscord<shadow.> unnecessary obfuscation we love that here
19:50:53FromDiscord<Idefau> yeah thats not gonna look well for a template
19:50:59FromDiscord<shadow.> LMAO
19:51:03FromDiscord<shadow.> i agree
19:51:25FromDiscord<Idefau> like for every occurence of .empty you would have to do conversion from int to bool
19:51:29FromDiscord<Idefau> which isnt a lot but still
19:51:30FromDiscord<Idefau> odd
19:51:32FromDiscord<shadow.> i know it was sarcastic lol
19:53:33FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GoF
19:53:34FromDiscord<shadow.> best function just saying
19:53:58FromDiscord<Idefau> bruh
19:54:06FromDiscord<shadow.> doesn't work f
19:54:11FromDiscord<shadow.> ah prefix
19:54:39hmmmhey how do I stringtuple a seq
19:54:45FromDiscord<shadow.> (edit) "https://play.nim-lang.org/#ix=2GoF" => "https://paste.rs/QWn"
19:54:47FromDiscord<shadow.> wdym
19:55:03FromDiscord<shadow.> has it not been made better?
19:57:45FromDiscord<Idefau> yeah dude, way better
19:59:36EvolverIs the var `a_bc` the same as `ab_c` or are they two different vars?
20:00:22PMunchThey're the same
20:01:32FromGitter<sealmove> @PMunch :> did you see my mention?
20:04:02FromGitter<sealmove> @planetis interesting. Essentially it saves and loads back any nim object?
20:04:47FromGitter<sealmove> @Evolver: https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality
20:05:00PMunch@sealmove, no, when was that?
20:05:45FromGitter<sealmove> 1-2 hours ago. I fixed the issue with write proc, it's a 4-line edit PR, pls merge https://github.com/PMunch/binaryparse/pull/10
20:05:46disbotโžฅ Generate extra parameters and arguments for custom write proc
20:08:13hmmmnim version for f"hello I'm {name}"
20:08:28narimiranhmmm: huh?
20:08:36FromDiscord<lqdev> import strformat
20:08:42narimiranit is `fmt` in nim land, not `f`
20:08:49hmmmoh
20:08:49narimiranor, better yet, use `&`
20:08:52FromDiscord<sealmove> sent a code paste, see https://paste.rs/7qs
20:08:56hmmmI see
20:08:59hmmmlove u all <3
20:09:13narimiranif only you would love our documentation too :'(
20:09:17hmmmD:
20:09:20FromDiscord<Idefau> brutal
20:09:22FromDiscord<sealmove> fmt is less surprising, & has some catches
20:09:59FromDiscord<sealmove> oh sorry, it's the other way around
20:10:38ForumUpdaterBotNew thread by Araq: Macros that compose (and work well with auto-completion tooling), see https://forum.nim-lang.org/t/7199
20:11:03FromDiscord<sealmove> & less surprising, fmt does raw strings, for example you can't do `fmt"{smthg\n}` and get a line feed
20:13:31FromDiscord<shadow.> whats the difference between quote and quote do?
20:14:07PMunchThat stuff gets done
20:14:21PMunchSorry sealmove, I was in a video chat
20:14:33FromDiscord<sealmove> np
20:14:44PMunchBut yeah I was probably offline when you tried to highlight me
20:17:02hmmmwhy stuff so important as strformat and strutils need to get imported
20:17:08hmmmthey should be std :o
20:17:14FromDiscord<lqdev> no they shouldn't
20:17:19PMunchWell for one they require the GC
20:17:25narimiraneverybody has their own "X should work without import"
20:17:28FromDiscord<lqdev> not everyone needs to extend their compile times with strformat and strutils
20:17:29PMunchWhich would mean that Nim could no longer be compiled without it
20:17:33FromDiscord<sealmove> @PMunch thx
20:17:45hmmmhmm
20:17:48hmmmI see
20:17:58narimiranfor some people neither of those two is important
20:18:10FromDiscord<shadow.> id rather type one line for imports rather than have gc required and longer compile-time
20:18:16PMunchNot sure if I've ever used strformat myself
20:18:28FromDiscord<lqdev> i use it when i'm lazy
20:18:30FromDiscord<sealmove> really? wow
20:18:46FromDiscord<sealmove> never needed to print something? ๐Ÿ˜›
20:18:52PMunchI don't use it when I'm lazy, because I've never used it so that would require me to look up the documentation :P
20:19:01narimiranyou can print without stringformat, you know?
20:19:09narimiran!eval echo "printing a string"
20:19:13NimBotprinting a string
20:19:28FromDiscord<sealmove> sure but it's very useful when printing
20:19:45narimiran...sometimes
20:20:00FromDiscord<shadow.> i mean depends where you come from
20:20:03FromDiscord<shadow.> as a python dev sure
20:20:10narimirani come from python ;)
20:20:16FromDiscord<shadow.> but if you're a c++ dev im sure `cout << a << b << c` would make more sense
20:20:26FromDiscord<shadow.> which is similar to `echo a & b & c`
20:20:36FromDiscord<shadow.> (edit) "c`" => "c;`"
20:20:41FromDiscord<shadow.> or yk using varargs
20:23:09*jaggz joined #nim
20:25:24jaggzif line =~ re"\s*(\w+)\s*\=\s*(\w+)":
20:25:31jaggzcan " be substituted with another char?
20:25:43FromDiscord<shadow.> single equals?
20:25:44jaggz(using: template `=~`(s: string; pattern: Regex): untyped )
20:25:51FromDiscord<shadow.> oh lmfao
20:26:06mipribe warned: =~ adds an implicit ^ to the beginning of the regex.
20:26:17mipriyou can use """ with re
20:26:26jaggzthat's not nice. I want my perl =~ .. :)
20:26:58mipriyeah, it's disappointing, .contains with an explicit matches works as well
20:27:03jaggzalso, the ability to swap out the quote with a different delimiter
20:27:38*vicfred joined #nim
20:28:57mipriI'd prefer either D or Rust solutions, but at least with Nim there's always the option of putting a readable string in your code and then fixing it at up at compile-time
20:30:15*tiorock joined #nim
20:30:15*rockcavera is now known as Guest42063
20:30:15*tiorock quit (Changing host)
20:30:15*tiorock joined #nim
20:30:15*Guest42063 quit (Killed (beckett.freenode.net (Nickname regained by services)))
20:30:15*tiorock is now known as rockcavera
20:30:22mipria good literal for that use is a raw string, r"", where your inner " get doubled instead of escaped
20:32:45jaggzmipri, thanks
20:33:10*narimiran quit (Ping timeout: 256 seconds)
20:36:05hmmmerror invalid indentation and error type mismatch are like 90% of my builds D:
20:36:16hmmmis there a way to check without compiling all the stuff?
20:39:02miprinim check
20:39:31jaggz<nim> I don't want to
20:40:24hmmmyea it works mipri :o
20:40:30FromDiscord<lqdev> i'd say that using `nim c -o:/dev/null file.nim` is a better idea than `nim check`
20:40:40FromDiscord<lqdev> because sometimes `nim check` just has a stroke for no reason
20:40:44hmmmbut I lose the handy F6 vscode integration :|
20:40:51mipriif you don't want to produce output, just 'nim r file'
20:41:02FromDiscord<lqdev> and it reports warnings that don't occur when you nim c
20:41:32jaggzr?
20:42:15FromDiscord<lqdev> that's a new thing in 1.4
20:42:32FromDiscord<lqdev> almost a shortcut to c -r, but better :)
20:42:40FromDiscord<lqdev> because it doesn't clutter your dir with executables
20:43:39planetis[m]sealmove, sry i was excercising, yes that's right
20:43:44FromGitter<timotheecour> โ€ฆ or js files; (`nim r -b:js main`)
20:43:58FromDiscord<exelotl> Bruh
20:44:10FromDiscord<exelotl> I didn't know about nim r
20:44:14FromDiscord<exelotl> That's amazing
20:44:56FromGitter<timotheecour> always read changelogs :)
20:44:57planetis[m]I anounced my package at https://forum.nim-lang.org/t/7198 but irc wasn't
20:44:57planetis[m]updated
20:47:45FromDiscord<Quibono> Is there a guide anywhere for using async?
20:48:27jaggznim (v.) "to take, take up in the hands in order to move, carry, or use; take unlawfully, steal" (archaic), Old English niman "to take, accept, receive, grasp, catch," ...
20:50:35hmmmBinGod like a binary divinity?
20:53:12hmmmthat almost tops not iFish in a shower in the nim metatitle leaderboard
20:54:14jaggznim android hello.nim
20:54:57planetis[m]hmmm: i understood some of what you said
20:55:01planetis[m]but i agree
20:56:50hmmmyesterday we were joking about PMunch project named notifishower that makes people cross eyes and pop veins trying to parse it
20:57:50mipri"not if I shower!" is a great name though
20:57:56hmmmlol
20:58:03PMunch<_<
20:58:27PMunchI think I might have to rename it though, it just does too many things now
20:58:40hmmmrunning on windows in not one of them :|
20:58:42PMunchIt's not really only for notifications
20:58:46mipriimport notifishower; stink_up_place() # <-- never happens due to program abort if notifishower detects a recent cleaning
20:59:05PMunchPfft, nah Windows user can go roll around in the mud or something to have their fun
20:59:08PMunchThey are simpler folk
20:59:32hmmmmunchie if I'm online I will watch your next stream
20:59:51PMunchFirst I need to find something to stream..
21:00:05*Jesin quit (Quit: Leaving)
21:00:24PMunchI kinda want to try and get my 3rd party window framer working
21:00:39PMunchBut that might just be two hours of desk smashing
21:01:03supakeenA nice change from the usual 8 hours of desk smashing :)
21:01:05hmmmthat things that retiles windows? I think I've seen you talk about it
21:01:21PMunchAh no, that is the window manager
21:01:34PMunchThis is what creates the decoration around your windows
21:01:40PMunchWhich is typically done by your window manager
21:01:45PMunchBut doesn't really have to be
21:04:54*WilhelmVonWeiner quit (Read error: Connection reset by peer)
21:08:42*junland quit (Quit: %ZNC Disconnected%)
21:09:31*junland joined #nim
21:12:41*Jesin joined #nim
21:26:39*bunbunbunbunny joined #nim
21:32:35*ehmry joined #nim
21:41:22*Vladar quit (Quit: Leaving)
21:46:08FromGitter<iffy> Besides "everything" what am I doing wrong to cause this compiler error? https://play.nim-lang.org/#ix=2GoX
21:47:39miprihttps://nim-lang.org/docs/tables.html#TableRef
21:49:23FromGitter<iffy> mipri: is that for me?
21:49:30mipriyes.
21:49:41mipriwhat you've got there is like a parameter with at type of just 'seq' or 'array'
21:50:37FromGitter<iffy> oh, derp...
22:06:43FromDiscord<j-james> !eval echo(toInt("5"))
22:06:46NimBotCompile failed: /usercode/in.nim(1, 11) Error: type mismatch: got <string>
22:07:29mipri!eval import strutils; echo "5".parseInt
22:07:34NimBot5
22:07:46mipriif you're doing aoc, try strscans
22:08:22*hmmm left #nim (#nim)
22:09:07FromDiscord<j-james> oh, interesting
22:09:35FromDiscord<j-james> i need to read through the nim libraries sometime
22:11:27PMunchThat'll take you a while :P
22:11:40PMunchOr do you mean the standard library?
22:11:49PMunchStill take you a while, but at least a bit shorter
22:11:57PMunchIt's quite comprehensive though
22:13:45FromDiscord<j-james> the standard library, yes ๐Ÿ˜…
22:24:49*sagax quit (Remote host closed the connection)
22:27:23FromDiscord<Avatarfighter> nim r?
22:27:30ehmryis there documentation for the nim.cfg parser?
22:27:49ehmryor the syntax?
22:28:34PMunchYes, but you really should use the much newer nims syntax
22:30:32ehmryok, *where* is the documentation for nim.cfg?
22:31:20ehmrythough if I can avoid the old style completly that would be ideal
22:32:11PMunchhttps://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files
22:36:26FromGitter<iffy> Do you see any memory-leak problems with this heterogeneous object storage thinger? https://play.nim-lang.org/#ix=2Gpd
22:37:22ehmryPMunch: could I rewrite nim.cfg to nims?
22:37:47PMunchYup
22:39:09FromGitter<iffy> I think maybe I need some `reset()` calls on the object members, right?
22:41:44*apahl quit (Ping timeout: 240 seconds)
22:42:14*apahl joined #nim
22:44:55FromDiscord<j-james> why does `var program: seq[int] = map(split(readFile(input), ','), parseInt)` error out with a `unhandled exception: invalid integer: 0`?
22:45:14ehmryPMunch: I don't believe you
22:45:15FromDiscord<j-james> passing the contents of the file as a string in place of `readFile(input)` works fine
22:45:39*mbomba joined #nim
22:46:06voltistNim does astronomy now: https://raw.githubusercontent.com/dizzyliam/randomImgs/master/graph.png
22:46:09*bunbunbunbunny quit (Quit: Lost terminal)
22:46:42miprij-james: there's a newline after 0
22:46:45PMunchProbably it's something like 0\n
22:46:57PMunchAnd ehmry well what can I say :P
22:47:26PMunchvoltist, what're you plotting there?
22:47:51ehmryPMunch: is using nims documented?
22:47:51FromDiscord<Avatarfighter> ^ Yeah I'm really interested
22:48:41PMunchhttps://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files
22:49:09PMunchI meant this: https://nim-lang.org/docs/nims.html
22:49:11voltistIt's the magnitude of a star over time, with each point being an image I took at my local observatory
22:49:34voltistI got dissatisfied with existing open source software that does this kind of image processing, so I made a Nim library :)
22:49:52ehmrylooks like strace is the documentation
22:50:03FromDiscord<Avatarfighter> voltist: got a github I can look at?
22:50:06PMunchvoltist, nice
22:50:33PMunchWhy are the observations so chunked?
22:50:44PMunchehmry, it's not that bad
22:50:59PMunchAt least you can have a look at what other people do
22:51:03ehmryPMunch: no it is that bad, this is pure shit
22:51:26voltisthttps://github.com/dizzyliam/astroNimy
22:51:32voltistNo documentation at the moment
22:51:46voltistI'll do that very soon
22:51:49PMunchehmry, oh yeah don't get me wrong
22:51:52PMunchIt's not great
22:52:23voltistThe observations are in bursts like that because they were taken over multiple days, and each of the bursts is one clear evening
22:53:02*tane quit (Quit: Leaving)
22:55:55PMunchRight, that's kinda what I expected
23:00:07voltistMy goal is to build a node based GUI for image processing, but for now I'm just designing it have a nice programmatic interface
23:00:56*lum quit (Quit: Lum: Bye!)
23:04:09*lum joined #nim
23:04:33FromDiscord<shadow.> lol pmunch i revised my solution
23:04:34FromDiscord<shadow.> https://hatebin.com/kvqmqtddao
23:04:40FromDiscord<shadow.> i just realized how much i was overcomplicating it
23:05:04PMunchHaha, simple is often the best
23:05:18FromDiscord<shadow.> haha yeah
23:05:29FromDiscord<shadow.> i realized instead of using a while loop and incrementing a value statically
23:05:33FromDiscord<shadow.> (edit) "statically" => "linearly"
23:05:37FromDiscord<shadow.> i can just use a for loop countup lol
23:05:39FromDiscord<shadow.> forgot abt step
23:08:49FromDiscord<Quibono> So Iโ€™ve been thinking about maybe making a currency library.
23:09:12PMunchDamn it.. I think my clocks tick faster at night..
23:09:15PMunchGood night
23:09:16*PMunch quit (Quit: leaving)
23:11:18FromDiscord<shadow.> good night haha
23:20:01FromDiscord<shadow.> what are inlines?
23:20:11FromDiscord<shadow.> i've heard them mentioned but i'm not sure what they are or what they do lmao
23:20:25FromDiscord<shadow.> i'm pretty sure i've seen the inline pragma
23:38:40FromDiscord<Quibono> Uhh I tried googling it and it doesnโ€™t make any more sense having read what google says
23:40:31FromDiscord<shadow.> lmfao
23:40:38FromDiscord<shadow.> that is often the case with nim
23:40:40FromDiscord<shadow.> lemme check the book
23:41:16FromDiscord<shadow.> no mention of inline in the book lol
23:49:32FromDiscord<Quibono> I feel like Nim is a little bit like a rare monastic sect. Very powerful, but you need to be initiated into its secrets
23:50:57FromDiscord<shadow.> lol i agree
23:53:24FromDiscord<j-james> Speaking of obscure parts of Nim, there's a slightly-nicer way to do `proc foo(bar: int) = var bar: int = bar`, and I can't remember what it was
23:54:19FromDiscord<shadow.> my brain is hurting from this code
23:54:27FromDiscord<shadow.> what does that even do
23:54:32FromDiscord<shadow.> shadows an argument?
23:54:35FromDiscord<shadow.> (edit) "shadows" => "shadow"
23:54:49FromDiscord<j-james> Oh
23:55:26FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=2GpD
23:55:58FromDiscord<j-james> (edit) "https://play.nim-lang.org/#ix=2GpD" => "https://play.nim-lang.org/#ix=2GpE"
23:57:14FromDiscord<shadow.> im so confused
23:57:24FromDiscord<shadow.> why are you shadowing bar with itself
23:57:57FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpG
23:58:36FromDiscord<j-james> No, sorry, my examples are bad
23:58:47FromDiscord<shadow.> you mean incrementing a value by one?
23:58:51FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=2GpH
23:58:56FromDiscord<shadow.> oh hm
23:59:06FromDiscord<shadow.> OHHH
23:59:10FromDiscord<shadow.> you mean getting a mutable argument?
23:59:20FromDiscord<j-james> A couple of days ago, someone posted a slightly-nicer way to do `var program: seq[int] = program`
23:59:21*wiml quit (Quit: Leaving)
23:59:25FromDiscord<shadow.> that?
23:59:26FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpI
23:59:33FromDiscord<shadow.> (edit) "https://play.nim-lang.org/#ix=2GpI" => "https://play.nim-lang.org/#ix=2GpJ"
23:59:36FromDiscord<j-james> I don't think it's a mutable argument
23:59:43FromDiscord<shadow.> well they sure are mutating it...
23:59:46FromDiscord<shadow.> lmfao