<< 03-02-2021 >>

00:01:00*abm joined #nim
00:01:20FromDiscord<konsumlamm> so, it works
00:02:23FromDiscord<konsumlamm> but if i put the `dump` block for example at the top, it breaks
00:03:24FromDiscord<konsumlamm> so apparently, all uses of `x` after the `{.inject.}` (in the template, not just in the lexical scope) are injected
00:03:50*FlammableDuck[m] joined #nim
00:05:33FromGitter<timotheecour> ah now i see what you mean by “works by luck”, ok ….
00:08:56FromGitter<timotheecour> looks like several bugs are essentially the same (at least more than 1 refer to that inject bug refs https://github.com/nim-lang/Nim/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+in%3Atitle+inject) => we should fix!
00:18:07*qwertfisch quit (Quit: ZNC - http://znc.in)
00:20:18*irchaxwell_ joined #nim
00:21:16*qwertfisch joined #nim
00:24:37*irchaxwell_zzz quit (Ping timeout: 272 seconds)
00:27:07*couven92 quit (Ping timeout: 256 seconds)
00:28:48*rockcavera joined #nim
00:59:15ForumUpdaterBotNew thread by Timothee: Compiling and running nim progam via wine on osx: almost works, help welcome, see https://forum.nim-lang.org/t/7464
01:01:08*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:01:34*njoseph joined #nim
01:28:06*Tanger joined #nim
01:30:27*Tlangir quit (Ping timeout: 258 seconds)
01:42:19*abm quit (Quit: Leaving)
01:58:50*a_chou joined #nim
02:12:43*irchaxwell_zzz joined #nim
02:16:43*irchaxwell_ quit (Ping timeout: 272 seconds)
02:33:56*Gustavo6046 quit (Ping timeout: 272 seconds)
02:35:06*rockcavera quit (Remote host closed the connection)
02:39:41*Gustavo6046 joined #nim
03:26:39*a_chou quit (Ping timeout: 246 seconds)
03:43:29*qwertfisch quit (Ping timeout: 272 seconds)
03:49:04*beatmox quit (Ping timeout: 240 seconds)
03:52:19*irchaxwell_ joined #nim
03:56:09*irchaxwell_zzz quit (Ping timeout: 272 seconds)
03:57:38*muffindrake quit (Ping timeout: 264 seconds)
03:59:05*muffindrake joined #nim
04:00:20PrestigeThat title is a rollercoaster
04:03:50FromDiscord<iWonderAboutTuatara> yeah
04:04:10FromDiscord<iWonderAboutTuatara> my favorite part is that the title contains a link to another post
04:04:32FromDiscord<iWonderAboutTuatara> nevermind, that's the bot adding it
04:06:36*irchaxwell_zzz joined #nim
04:10:43*irchaxwell_ quit (Ping timeout: 272 seconds)
04:29:09*qwertfisch joined #nim
04:29:25*beatmox joined #nim
04:50:57*mmohammadi9812 quit (Ping timeout: 264 seconds)
04:51:28*mmohammadi9812 joined #nim
04:56:07*beatmox quit (Ping timeout: 260 seconds)
05:00:46*a_chou joined #nim
05:02:31*mmohammadi9812 quit (Ping timeout: 256 seconds)
05:06:29*mmohammadi9812 joined #nim
05:06:33*mmohammadi9812 quit (Client Quit)
05:09:02*Yardanico quit (Ping timeout: 264 seconds)
05:09:10FlammableDuck[m]How can I get the number of lines in a file?
05:09:26*ForumUpdaterBot quit (Ping timeout: 268 seconds)
05:09:49leorizeyou count them
05:10:31leorizea quick way would be: `var lines = 0; for i in lines("/path/to/file"): inc lines`
05:11:29FlammableDuck[m]thanks
05:11:49*a_chou quit (Remote host closed the connection)
05:16:41*ForumUpdaterBot joined #nim
05:16:56*Yardanico joined #nim
05:19:01FromDiscord<ElegantBeef> assuming you want to do anything to the lines using `sequtils.toseq` and doing `let a = toSeq(lines(file))` is probably smarter so you cache the strings and dont require multiple iterations
05:23:30*irchaxwell_ joined #nim
05:27:59*irchaxwell_zzz quit (Ping timeout: 272 seconds)
05:37:09*beatmox joined #nim
05:42:05FromDiscord<Rika> Or just do all the stuff you want to do within the line increment loop?
05:56:55ForumUpdaterBotNew thread by Halloleo: Anybody using `self` or `this` for procedures operating on "class" style object types?, see https://forum.nim-lang.org/t/7465
06:01:59*wiltzutm[m] joined #nim
06:28:33*a_chou joined #nim
06:29:08*waleee-cl quit (Quit: Connection closed for inactivity)
06:29:54*a_chou quit (Remote host closed the connection)
06:40:51i_use_arch_btw[mguy, can the `times` module get an update please. It dosent support a few datetime formats currently :(
06:42:12FromDiscord<ElegantBeef> what doesnt it support?
06:43:17i_use_arch_btw[mthe ISO 8601 formats basically
06:44:24FromDiscord<ElegantBeef> How isnt it supported?
06:45:23i_use_arch_btw[mcurrently i'm manually right striping the ISO format down to seconds. Which iis somewhat ok for now
06:45:31FromDiscord<ElegantBeef> !eval import times; echo now()
06:45:36NimBot2021-02-03T06:45:35+00:00
06:45:39FromDiscord<ElegantBeef> Isnt this the same iso standard?
06:45:42i_use_arch_btw[m2021-02-01T14:28:58.983432014Z
06:45:43leorizeit doesn't do the parsing correctly
06:45:54i_use_arch_btw[mThis one too
06:46:02FromDiscord<ElegantBeef> Doesnt the parse util allow you to specify?
06:47:03leorizeturns out just specifying some matching atoms don't get you the actual format
06:47:12i_use_arch_btw[mit does allow, but the formats wont match
06:47:48FromDiscord<ElegantBeef> Yea i was just trying to figure out where the issue was, so seems we need a `parse(input, pattern, standard)`
06:47:54i_use_arch_btw[mi have tried a lot. The timezone and nanosecond formatters dont work.
06:49:26i_use_arch_btw[m<FromDiscord "<ElegantBeef> Yea i was just try"> that'd be very helpfull btw. If the module has predefined standard paterns it'd be cool.
06:49:57i_use_arch_btw[mFound a few iso patterns while searching. Might come handy
06:49:58i_use_arch_btw[mhttps://git.jdb-labs.com/jdb/nim-time-utils/src/08c0962b40f9d2617805a96a69235f4c38a8c454/timeutils.nim
06:51:30FromDiscord<ElegantBeef> Yea i clearly dont know much about time standard so i'm just looking at what would need to be done
06:52:13*i7sDream joined #nim
06:52:30i_use_arch_btw[mThanks. It's ok take time. no problem
06:54:02saemIs there an issue filed for it?
06:55:20i_use_arch_btw[mi saw an old one, it was closed due to inactivity a few years ago. A Guy created his own module to parse iso 8601, but it broke later.
07:00:20i_use_arch_btw[mas a temporary solution `parse(str[0..str.rfind(".") +1 ], "yyyy-MM-dd'T'HH:mm:ss.fff')` works for now lol
07:01:25*liblq-dev joined #nim
07:03:35*couven92 joined #nim
07:04:29FromDiscord<ElegantBeef> Insult me if it doesnt but doesnt `parse("2021-02-01T14:28:58.983432014Z", "yyyy-MM-dd'T'HH:mm:ss'.'fffffffff'Z'")`↵work?
07:11:28FromDiscord<ElegantBeef> Guess.... we'll never know if that works for them
07:13:25*krux02 joined #nim
07:17:35FromDiscord<treeform> that looks like just standard ISO 8601 time string with my lib you would just use: https://treeform.github.io/chrono/#parseIsoTs%2Cstring
07:17:51FromDiscord<treeform> or https://treeform.github.io/chrono/#parseIsoCalendar%2Cstring
07:21:09FromDiscord<treeform> hmm I don't think i support the sub seconds
07:22:33*couven92 is now known as fredrikhr
07:23:26*zedeus joined #nim
07:33:44saem@Araq: It's late and I'm pretty tired, but presently this fix makes sense to me, what do you think? https://github.com/nim-lang/Nim/pull/16922 (I ran some of the tests locally and it came out clean) 🤞
07:35:25FromDiscord<treeform> I support second fractions now: https://github.com/treeform/chrono/blob/master/tests/test_calendars.nim#L75
07:35:47FromGitter<Araq> saem: looks ok
07:35:54saem\o/
07:36:41saemI think all those little fixes are going to mean some very good things.
07:36:54saemMight get bumpy as other things shake out, but it feels good.
07:38:03FromDiscord<treeform> @i_use_arch_btw, I am able to parse times like: `2021-02-01T14:28:58.983432014Z` in my chrono library.
07:43:56*i7sDream quit (Quit: WeeChat 3.0)
07:46:37FromDiscord<treeform> @PMunch going to add benchy to nimble, just forgot to: https://github.com/nim-lang/packages/pull/1803
07:47:41FromDiscord<ElegantBeef> Also treeform your dumpincludes PR was messed up
07:47:47FromDiscord<treeform> oh
07:47:50FromDiscord<ElegantBeef> Just thought i'd mention it now that you're hear talking about it
07:47:56FromDiscord<ElegantBeef> you wrote `dumpimports`
07:48:04FromDiscord<ElegantBeef> Not the git urls
07:48:05FromDiscord<ElegantBeef> (edit) "urls" => "url"
07:48:15FromDiscord<treeform> oh crap will fix
07:48:50FromDiscord<ElegantBeef> ~~i'm not stalking you i was looking at the nimble package directory PRs~~ 😄
07:49:20*i7sDream joined #nim
07:50:20FromDiscord<treeform> if you notice my stuff broken please let me know
07:50:43*i7sDream quit (Client Quit)
07:51:24FromDiscord<ElegantBeef> Yea i just seen it tonight, so dont worry too much
07:51:35i_use_arch_btw[m<FromDiscord "<treeform> @i_use_arch_btw, I am"> Ok
07:51:56i_use_arch_btw[m@treeform ok
07:53:10FromDiscord<treeform> Just: `parseCalendar("{year/4}-{month/2}-{day/2}T{hour/2}:{minute/2}:{second}.{secondFraction}Z", "2021-02-01T14:28:58.983432014Z")`
07:53:28i_use_arch_btw[m@ElegantBeef that works. I'm an idiot lol. Thanks btw
07:53:36saeminteresting... why didn't that test crash on my machine.
07:53:54FromDiscord<ElegantBeef> Yea that's why i was super confused what the problem was
07:54:08FromDiscord<ElegantBeef> I didnt see anything that wasnt supported so i just assumed one of the fields was different
07:54:33FromDiscord<ElegantBeef> The CI's are often fickle beasts
07:54:56saemI get that, but it's something else in this case.
07:55:01i_use_arch_btw[myou used the 'Z' as a literal, I was trying to parse it as timezone.
07:55:02saemor I'm certain it is.
07:55:16FromDiscord<ElegantBeef> Is the `Z` a time zone?
07:55:35*PMunch joined #nim
07:55:40FromDiscord<treeform> Its more of a time zone marker like the `T`
07:55:54FromDiscord<ElegantBeef> Yea i assumed so but, idk they were trying to parse it 😄
07:56:08FromDiscord<treeform> many libraries will output it that way
07:56:35*narimiran joined #nim
07:56:49i_use_arch_btw[m@ElegantBeef it indicates UTC.
07:57:13saemoh... something about windows. hrmmm
07:58:01FromDiscord<treeform> you right I was wrong, if you don't have the Z you need to say the tz offset like `"1969-12-31T16:00:00-08:00"`
07:58:28PMunchUhm, the Z isn't just a timezone marker
07:58:38saemoh, maybe it's something to do with caching? Can't brain it right now.
07:58:45i_use_arch_btw[m@ElegantBeef 'T' is the date and time separator literal.
07:59:03PMunchA-Y are UTC+1 through UTC+12 and UTC-1 through UTC-12 with Z being UTC
07:59:22PMunchZ is the only one that's commonly used though AFAIK
07:59:26i_use_arch_btw[mI too am from python and java so i dont really know about time formats. Just looked up this for reference.
07:59:32i_use_arch_btw[mhttps://stackoverflow.com/questions/2201925/converting-iso-8601-compliant-string-to-java-util-date
07:59:53FromDiscord<treeform> I don't think the second fractions are common
08:00:48i_use_arch_btw[m<PMunch "A-Y are UTC+1 through UTC+12 and"> Oh
08:01:10FromDiscord<ElegantBeef> Well someone add that as a parser to the times module 😄
08:01:27FromDiscord<treeform> A-Y does not appear to be in the spec: https://www.w3.org/TR/NOTE-datetime ?
08:03:47saemah, there we go, now I can replicate it.
08:04:24PMunchhttps://en.wikipedia.org/wiki/List_of_military_time_zones
08:04:37PMunchIt's a military thing, as I said the Z is the most commonly used
08:04:57PMunchSo I guess that's the only one that's made it into civilian specs
08:05:00FromDiscord<treeform> Thank you for the link. Maybe I should add them too.
08:05:05saemOK, I think I simply uncovered a separate but related issue. I'll have a look at it later.
08:05:08saemnight
08:05:15i_use_arch_btw[m<PMunch "It's a military thing, as I said"> as long as the api im using dosent change overnight i'm cool.
08:05:21PMunchThey are mostly used to quickly and easily transfer timezone information over dodgy radio links :P
08:05:49i_use_arch_btw[m<PMunch "They are mostly used to quickly "> Interesting
08:06:36i_use_arch_btw[mnight @freenode_saem:matrix.org
08:06:52PMunchOr a favourite of my superiors in the army "I want this done ASAP Zulu" since we're in UTC+1 that means I want this done as soon as possible an hour ago
08:08:56i_use_arch_btw[m<PMunch "Or a favourite of my superiors i"> Alpha, Zulu, Tango, Charlie as identifiers. confusing times
08:09:18PMunchNot confusing at all!
08:09:43PMunchAs long as you memorize the letters it's a great way to spell stuff over radio or phone
08:10:11PMunchThe words are designed to be very distinct from each other, so that even with the most deteriorated connection you won't mix them up
08:11:29PMunchLike if some dunce try to spell something and just make up their own letters, "Is that Tim or Jim you're saying?"
08:13:56FromDiscord<ElegantBeef> Whiskey Tango Foxtrot is going on
08:14:11i_use_arch_btw[mLmao
08:15:02FromDiscord<ElegantBeef> Also pmunch, clear your cache if you play linerino, made jump tiles more informative with flashing lights
08:15:29FromDiscord<ElegantBeef> And added a move indicator on the player
08:15:39PMunchOoh, nice
08:15:59jjidowhat time is mratrim usually online?
08:16:10FromDiscord<ElegantBeef> In an hour or so
08:17:13PMunchStill haven't fixed the portal colours though :(
08:17:39FromDiscord<lqdev> jjido: you can @ him, he'll get a notification on discord and respond whenever he's available
08:17:53FromDiscord<ElegantBeef> I did implement progression though
08:18:00FromDiscord<ElegantBeef> So you got 7 hand crafted levels to play in order 😛
08:20:58jjido@mratsim: regarding https://github.com/weavers-guild/weave-io/blob/master/design/design_2_continuations.md
08:21:19jjidoto do error handling, the "except" path is its own continuation
08:21:41jjidoso when you resume a continuation you supply two continuations
08:21:42*wgetch quit (Quit: :-))
08:22:08jjidoone for success and one for error, so the program knows what to do next in both cases
08:23:31jjidoif the continuation has self-recovery (e.g. micro-services) you may want to store errors somewhere instead and load them explicitly in the caller.
08:25:33jjidoin my implementation, a generator returns two continuations: one to fetch next value and one to abort, for clean-up work (release its frame...)
08:30:09*haxscramper joined #nim
08:44:31FromDiscord<iWonderAboutTuatara> I was thinking of doing a Nim tutorial series
08:45:13FromDiscord<iWonderAboutTuatara> Except unlike most tutorials I'd waste very little time
08:45:43FromDiscord<iWonderAboutTuatara> Do I start by making a quick start guide for people who know what they're doing programming wise, or a guide for complete beginners?
08:45:53FromDiscord<iWonderAboutTuatara> I don't imagine many people will learn programming via Nim
08:48:18FromDiscord<mratsim> it's better if you use a channel for cooperative cancellation
08:48:24FromDiscord<mratsim> @jjido
08:49:08FromDiscord<mratsim> because if you resume with new arguments it's like your resumable function has polymorphic signature
08:49:19FromDiscord<mratsim> in the middle of the function suddenly new parameters pop up
08:49:33FromDiscord<mratsim> That's uncharted territory
08:52:21ForumUpdaterBotNew thread by Miran: This Month with Nim: January 2020, see https://forum.nim-lang.org/t/7466
08:52:53FromDiscord<ElegantBeef> Eh it's been posted!
08:58:36*casaca quit (Ping timeout: 240 seconds)
09:05:33FromDiscord<ElegantBeef> narimiran you messed up the year on the posting! 😄
09:05:52narimiranlol
09:08:55narimiranfixed
09:09:18FromDiscord<ElegantBeef> Travelled a year in a moment
09:09:36FromDiscord<ElegantBeef> When someone noted it in the forum i was like "I know damn well i didnt fuck it up" 😛
09:09:38Clonkk[m]``Error: type mismatch: got <int64> but expected 'int'`` I thought int was defined as int64 on 64bit CPU ?
09:09:59FromDiscord<ElegantBeef> `int` != `int64` type signature
09:10:04Clonkk[m]Damn
09:10:29PMunchI mean you can throw in a converter if you want
09:10:58PMunch`converter intToSystemInt(x: int): int64 = x.int64`
09:11:50PMunchProbably want to hide that behind a `when sizeof(int) == 8` though
09:12:24Clonkk[m]Or I just fix my int to be declared as int64
09:12:42Clonkk[m]I just thought it was identical signature
09:13:20PMunchNope, Nim is pretty strict with types
09:14:09FromDiscord<Rika> ints are int64 in 64 bit systems but not all systems are 64 bit so they are not equal
09:14:10Clonkk[m]I understand for type of different length or type (like not converting uint16 to uint32 or float32 to int32. But ``int`` being an integer on 64 bit being different than ``int64`` is weird
09:14:29*abm joined #nim
09:14:45FromDiscord<Rika> it will cause different behavior when compiled in 32 bit if it were "equivalent"
09:15:19Clonkk[m]I would argue that that ``int`` should be fixed size 64 bit no matter the system length (float are like this If I'm not mistaken).
09:15:52FromDiscord<Rika> well they are not in nim hence
09:16:11Clonkk[m]Yeah it would be un-intuitive coming from C
09:16:17PMunchWell that causes other problems
09:16:27FromDiscord<Rika> C isnt strongly typed
09:17:36Clonkk[m] * It's just un-intuitive coming from C
09:18:31FromDiscord<Rika> well somethings gotta be unintuitive when you switch languages
09:18:43FromDiscord<Rika> unless you can switch to the same language (which makes no sense)
09:18:54FromDiscord<ElegantBeef> C++20 has entered the chat
09:19:21FromGitter<Araq> `int` could have been defined as an alias type but wasn't
09:19:58FromGitter<Araq> it's unclear what downsides a type alias would have
09:19:59Clonkk[m]<FromDiscord "<Rika> well somethings gotta be "> I know, I'm just surprised of having to write code to convert an integer of size 64bit to an integer of size 64 bit. I understand that there are several size of integer between systems and that getting a consistent behaviour between system is not trivial. I expect that from a strongly typed language between 32 and 64 bits. But writing a 64bit int to 64bit int just seems like
09:19:59Clonkk[m]boilerplate code.
09:20:58FromGitter<Araq> the trick is to start with int64 if you need 64bit integers
09:20:58FromDiscord<ElegantBeef> Weird idea use `int64` instead of `int` 😄
09:21:41Clonkk[m]I use norm, which used ``int``in version 2.2.2 and switch to ``int64`` in devel
09:21:50FromDiscord<Rika> think of it like this: int is not guaranteed to be 64 bit
09:22:22FromGitter<Araq> for norm `int64` seems to make more sense assuming it's about IDs
09:22:25FromDiscord<Rika> its like saying `long long int` instead of `int64_t` or something
09:22:26FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2Ocn - this code fails on C codegen stage unless I separate declaration and instantiaion of `{.global.}` - this is an intended behavior or a bug?
09:23:02Clonkk[m]int64 does make more sense, I'm just surprised ``int`` wasn't an alisa (even if the alias vary between ``int32`` and ``int64`` depending on your platform)
09:23:05jjido@mratsim I agree new parameters on resume is slightly sketchy. I don't think I mentioned anything like that though?
09:23:07FromDiscord<lzoz> if i use int64, is it going to work on 32-bit arch
09:23:08Clonkk[m]Is all
09:23:25FromGitter<Araq> ah! the `global` pragma.
09:23:39*FromGitter * Araq mentions it for removal for Nim v2
09:23:39jjido@mratsim cooperative cancellation is overboard for a simple generator in my opinion
09:23:54FromDiscord<ElegantBeef> Cant tell if araq likes global or dislikes it
09:24:01FromDiscord<ElegantBeef> I personally like it so i wager the latter
09:24:32PMunchWait, how did you get FromGitter to do a mention?
09:24:35FromDiscord<mratsim> @jjido, you can just drop the continuation
09:24:55PMunchOr a /me thing
09:25:34FromDiscord<mratsim> when you mentionned passing 2 continuations on resume I thought you meant that "resume()" could accept new parameters
09:25:46FromDiscord<ElegantBeef> We didnt get the mention in discord
09:25:51FromDiscord<ElegantBeef> So i see he dislikes it 😄
09:28:57FromGitter<Araq> it's 10:30, my children are watching youtube
09:29:38FromGitter<Araq> school is over since 9:00
09:29:38FromDiscord<lqdev> yo germany's in a different timezone??? it's 10:29 where i live /s
09:29:55FromGitter<Araq> (I'm rounding)
09:30:34FromDiscord<lqdev> ik ik, i was joking
09:31:00FromDiscord<ElegantBeef> And here folks you can see the german comedic detection at work
09:31:07FromGitter<Araq> home school: do in one hour what used to take 4
09:31:37PMunchIs there a way to check which effects are in place in a procedure?
09:33:13FromDiscord<haxscramper> https://nim-lang.org/docs/effecttraits.html
09:38:38jjido@mratsim yes it's a design choice. Mine requires the caller to abort if it doesn't want to fetch more values
09:39:15FromDiscord<mratsim> yes, that depends if you're readiness or completion-based
09:56:33*vicfred quit (Ping timeout: 246 seconds)
10:06:52*hmmm joined #nim
10:20:20FromDiscord<mratsim> @gogolxdong: https://github.com/Netflix/p2plab
10:28:30*def- quit (Quit: -)
10:30:06*def- joined #nim
10:42:44*irchaxwell_zzz joined #nim
10:46:40*irchaxwell_ quit (Ping timeout: 258 seconds)
10:47:07PMunchHmm, doesn't callbacks get called when you do asyncCheck?
10:56:14*casaca joined #nim
10:58:21PMunchHmm, do I need to use ORC for async? .choosenim/toolchains/nim-1.4.2/lib/pure/asyncstreams.nim(58, 13) Warning: ':env.future2.cb = (named, :env)' creates an uncollectable ref cycle; annotate 'future2' with .cursor [CycleCreated]
11:02:23FromGitter<Araq> yes, you do
11:02:44*vicfred joined #nim
11:03:32PMunchThanks
11:04:38FromDiscord<Goel> For constants coming from a C/C++ wrapper, ALL_UPPERCASE are allowed, but ugly. (Why shout CONSTANT? Constants do no harm, variables do!)↵# I must admit this made me laugh
11:05:44PMunchHaha, yeah the Nim docs do have some funny stuff like that in them :P
11:21:33*hmmm quit (Quit: WeeChat 2.8)
11:22:15*synthmeat quit (Quit: WeeChat 3.0)
11:22:36*synthmeat joined #nim
11:22:50*Tlangir joined #nim
11:25:05*Tanger quit (Ping timeout: 240 seconds)
11:44:42*blitzworks joined #nim
11:48:06*mmohammadi9812 joined #nim
11:50:28*Vladar joined #nim
12:00:30*rockcavera joined #nim
12:08:20*irchaxwell_ joined #nim
12:12:41*irchaxwell_zzz quit (Ping timeout: 272 seconds)
12:14:39krux02regarding funny documentation, I still remember the blitz basic tutorial that I did almost 20 years ago, It told a story about a fancy villa and aliens obducting people and the result that you programmed was just the crudest line art possible to represent a house and colored elipses on a black background that were the alien obduction beam (with lots of imagination)
12:15:11krux02I think funny stuff like this makes reading documentation and tutorials a pleasure and you want to continue.
12:15:58krux02Late I saw the fun aspect of the tutorial was turned down. I think either the original author became tired of his own joke or something else happed.
12:18:24PMunchClojure for the Brave and True is also like that
12:18:36PMunchJust generally a good read, while also teaching you Clojure
12:19:57*vicfred quit (Read error: Connection reset by peer)
12:20:11*vicfred joined #nim
12:29:47FromDiscord<mratsim> Clojure as the funniest programming talk I ever watched: https://www.youtube.com/watch?v=jlPaby7suOc
12:29:50FromDiscord<mratsim> has
12:32:00PMunchHaha, yeah that is a classic
12:55:21*irchaxwell_zzz joined #nim
12:56:55*xet7 quit (Remote host closed the connection)
12:58:10*irchaxwell joined #nim
12:59:08*irchaxwell_ quit (Ping timeout: 260 seconds)
12:59:31*irchaxwell_ joined #nim
12:59:36krux02I didn't know it, but I already like it.
12:59:47krux02Maybe I need to learn some clojure now
13:01:27*irchaxwell_zzz quit (Ping timeout: 272 seconds)
13:01:37PMunchIt's a pretty nice language
13:01:48FromDiscord<mratsim> (too ((much) parenthesis)))
13:02:09FromDiscord<mratsim> Clojure is the most used langauge in Status though Nim is approaching that as well
13:03:21*irchaxwell quit (Ping timeout: 272 seconds)
13:03:45PMunchMuch used by number of devs, lines of code, dev hours, liters of coffee drank while coding, CPU cycles, cursewords?
13:04:45FromDiscord<mratsim> devs, commits LOC and CPU cycles yes: https://github.com/status-im/status-react
13:07:47PMunchLOC comparisons between imperative and functional languages tend to be a bit wonky though
13:07:56PMunchMy Clojure code tends to be wider than it is long :P
13:08:58FromDiscord<mratsim> I tend to go next line often in my Haskell code
13:09:38FromDiscord<mratsim> also tabs are 8-space wide on Github which is really horrible: https://github.com/mratsim/haskell-numbertheory/blob/master/FactoringCFRAC.hs#L83-L93
13:17:46FromDiscord<zetashift> Am I tripping? Wasn't there a `with` macro as an alternative to `this:self` pragma in the Nim stdlib?
13:18:22FromDiscord<exelotl> There is but it's extremely limited :(
13:18:30PMunchThere is this as well: https://github.com/zevv/with
13:18:31FromDiscord<exelotl> you have to `import std/with`
13:19:27FromDiscord<zetashift> I know zevv's one actually but I was like wasn't there a stdlib one and searching for it is a PITA
13:19:58PMunchHaha, yeah "nim with" is a difficult search term
13:20:10FromDiscord<zetashift> yup haha
13:20:50FromDiscord<konsumlamm> as said above, `std/with`: https://nim-lang.org/docs/with.html
13:21:29FromDiscord<zetashift> Damn, how did you get the docs of it so fast?
13:22:21FromDiscord<konsumlamm> search for "nim lang with"
13:22:22FromDiscord<haxscramper> There is a search in documentation, so you could've just used it
13:22:26FromDiscord<zetashift> I did
13:22:36FromDiscord<konsumlamm> with duckduckgo
13:22:42FromDiscord<konsumlamm> or that
13:22:48FromDiscord<zetashift> ah damn
13:22:51FromDiscord<zetashift> I used the wrong search
13:22:55FromDiscord<konsumlamm> speaking of, maybe we should propose some duckduckgo bangs for nim...
13:23:04FromDiscord<exelotl> when I run `nim doc --project` on my lib I get `Error: unknown substition variable: attype` - anyone know what this means or how I could narrow it down?
13:23:14FromDiscord<zetashift> noted for next time
13:24:05FromDiscord<haxscramper> @exelotl most likely this is related to configuration in `nimdoc.cfg` - if you are doing some custom configuration for output it might raise suchh errors
13:34:30PMunchhmm, I have a library and I want it to be imported by either `homeassistant/base` or `homeassistant/managed` how would I structure that nimble package?
13:38:41*Vladar quit (Quit: Leaving)
13:38:52FromDiscord<dom96> It’s not about the nimble package structure, but rather how you’re going to duplicate the module, unless I’m missing something.
13:39:24FromDiscord<dom96> You could probably use ‘export’
13:40:06*grobe0ba quit (Quit: ZNC 1.7.5 - https://znc.in)
13:41:37*grobe0ba joined #nim
13:42:47PMunchDuplicate it?
13:42:59PMunchI have one module with two files, base.nim and managed.nim
13:51:19FromDiscord<exelotl> @haxscramper I haven't messed with the nimdoc.cfg in any way - my project looks like this: https://media.discordapp.net/attachments/371759389889003532/806522206406049812/unknown.png
13:52:13FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Odw
13:52:21*mmohammadi9812 quit (Read error: Connection reset by peer)
13:52:59*mmohammadi9812 joined #nim
14:01:19FromDiscord<haxscramper> If regular compilation procedes normally, but documentation generation fails my only guess is `nimdoc.cfg`, or something related to documentation templating (because the only place where such error can be generated is `compiler/docgen.nim`). I have absolutely no idea how `nim doc` searches for configuration files, so I would probably just look in all parent directories, or `rg` for `$attype`
14:01:39FromDiscord<dom96> PMunch: oh I misunderstood. Just put those files in a homeassistant directory
14:01:53PMunchYeah I figured it out :)
14:04:09*vicfred quit (Quit: Leaving)
14:05:00*hmmm joined #nim
14:11:25*zedeus quit (Ping timeout: 240 seconds)
14:23:16*mmohammadi9812 quit (Ping timeout: 240 seconds)
14:37:01*hmmm quit (Quit: WeeChat 3.0)
14:39:00*D_ quit (Ping timeout: 246 seconds)
14:40:33*D_ joined #nim
14:47:06*mmohammadi9812 joined #nim
14:53:25ForumUpdaterBotNew thread by Dude_the_builder: There's a Yankees fan writing the Nim tutorial... lol, see https://forum.nim-lang.org/t/7467
15:06:23*vicfred joined #nim
15:09:43PrestigeThat's actually pretty funny
15:15:43FromGitter<gogolxdong> @mratsim thanks will check it further.
15:18:00*xet7 joined #nim
15:25:44FromDiscord<Goel> Why the latest dev version of Choosenim is only available for Linux and OS and not Windows?
15:30:07*clyybber joined #nim
15:35:15*evbo joined #nim
15:44:41PMunchProbably because dom uses Linux and/or OSX and only pushes stable versions to be built on Windows
15:44:45PMunchOr something like that
15:49:26FromDiscord<Meowx> If I would like to publish a binary package with nimble which requires external dependencies. Couldn't I just ship them with the package instead of: https://github.com/nim-lang/nimble#external-dependencies
15:51:00PMunchWell you could, but as a Linux user, please don't
15:51:23PMunchI bit dependent on what you're doing of course
15:54:02FromDiscord<Meowx> I've made that little nimble frontend which requires imgui 1.79. I would like to ship the binaries for linux and windows. https://media.discordapp.net/attachments/371759389889003532/806553083026735145/nimble.png
15:54:35FromDiscord<Meowx> (edit) "I've made that little nimble frontend which requires imgui 1.79. I would like to ship the ... binaries" added "imgui"
15:55:28FromDiscord<zetashift> That looks really cool Meowx
16:06:42FromDiscord<Meowx> thank you
16:11:26FromDiscord<dom96> You can create a little tarball and ship that
16:11:36ForumUpdaterBotNew thread by B3liever: Karax and inline svg elements, what's the recommended way?, see https://forum.nim-lang.org/t/7468
16:11:38FromDiscord<dom96> but I would only include DLLs on windows
16:11:53FromDiscord<dom96> Linux isn't really a platform where users expect to get DLLs shipped with the program
16:12:55FromDiscord<Clyybber> @Meowx looks awesome!
16:18:11FromDiscord<haxscramper> How to determine if error message passed to `ConfigRef.structuredErrorHook` is actually fatal or caused by `compiles()` check (or some other non-fatal error).
16:18:57FromDiscord<haxscramper> Right now I just print everything, but this creates just incomrehensible amount of noise
16:18:58FromDiscord<mratsim> when compiles(compiles())
16:19:15*hmmm joined #nim
16:20:46*Vladar joined #nim
16:31:24Amun_RaI've encountered pretty weird error message: https://dpaste.com/ATYNRAVBR
16:33:38FromDiscord<mratsim> technically the truth :p
16:33:58Amun_Ra;)
16:35:08Amun_Ragot it, I used multisync pragma in async-only world
16:43:47*hmmm quit (Quit: WeeChat 2.8)
16:46:19*mmohammadi9812 quit (Read error: Connection reset by peer)
16:46:31*mmohammadi9812 joined #nim
16:47:34*waleee-cl joined #nim
16:51:12*azed joined #nim
17:01:43ForumUpdaterBotNew thread by Steven: NewAsyncHttpServer() & wrapSocket(), see https://forum.nim-lang.org/t/7469
17:23:53*tane joined #nim
17:26:09FromGitter<haxscramper> @Araq I've looked into current implementation of semcheck/error handling and I think general approach of storing original AST and running semcheck on it again should work as a starting position. This would require some minor modifications to things like `trackCase` - right now it just sets appropriate flags for `PEffects`, and in the end mismatches are just reported using on toplevel with any details.
17:27:40FromGitter<haxscramper> I think that running same semcheck steps again with additional diagnostics enabled would allow creating good enough error messages for effects/exceptions etc.
17:30:33FromGitter<haxscramper> But in 'top-down' mode, where effect annotations are not inferred based on body, but instead each statement (I'm not sure if side effect analysis is cached though) is compared with expected list of annotations, and if any differences found - they will be reported.
17:33:23FromGitter<haxscramper> This is for side effect analysis. For type mismatches storing original list of candidates and original expression would also work for the most cases I guess.
17:41:18FromGitter<haxscramper> I also thought about supporting user-defined error annotations for AST - for example if I have `newCall("test", newLit(123))` - adding error message that would be shown if semcheck fails for this node (I think just string message should suffice, though it might be something else). ⏎ ⏎ So `newCall()` with custom error could look like `var call = newCall("test", newLit(123)); call.onError = "Missing declaration
17:41:18FromGitter... of <test(int)> for MyDSL"` that would be shown with type mismatch message.
17:41:40*NimBot joined #nim
17:45:21FromGitter<haxscramper> This is mainly for making better assertion checking in DSLs possible - while ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ might work for now, it is *too* hacky IMO [https://gitter.im/nim-lang/Nim?at=601ae13155359c58bf1c91cb]
17:51:54FromGitter<haxscramper> > For type mismatches storing original list of candidates and original expression would also work for the most cases I guess. ⏎ ⏎ Though it would require rerunning `semOverlodedCall` (which IIUC is not really repeatable because it requires using context and all sort of other information), so it looks like `nkError` might need to store `TCandidate` that resulted from overloaded call resolution.
17:58:06FromGitter<haxscramper> And this is not really related, but I've finally made sourcetrail analyzer into somewhat useable state, and stats for current compiler implementation are ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=601ae42e9d5c644f664a6631]
18:03:34FromDiscord<Yardanico> btw, I was trying to use it but couldn't even compile it because of missing deps (even after installing them manually)
18:04:14FromDiscord<Yardanico> can you provide some minimal instructions? :D
18:14:07*zedeus joined #nim
18:14:34giacoI'm learning nim experimenting into vscode, how would you set command line arguments when running compiler (F6)?
18:15:00giaconot sure if I should look for a solution into vscode or into nim (maybe nims file?)
18:15:19FromDiscord<treeform> I use vscode, I just use the vscode terminal, up enter most of the time.
18:15:32FromDiscord<treeform> really easy to change command line arguments but just editing the command line.
18:15:47giacotreeform, yeah I've being doing the same for days
18:15:52FromDiscord<treeform> My keyboard does not even have a real F6 key 🙂
18:15:58giacobut I'd like to improve it
18:16:15giacotreeform, buy a new keyboard, seems broken
18:16:29FromDiscord<treeform> I prefer the terminal as I can run 100s of different things per day
18:16:45FromDiscord<treeform> main progrma, tests, benchmarks, dependency tests etc...
18:17:00FromDiscord<treeform> compile with debug and release to see how it performs
18:17:07FromDiscord<treeform> I don't think the F6 would work for me
18:17:31FromDiscord<haxscramper> There are no instructions right now, it just all uses hardcoded paths and cobbled together hacks on top of other hacks to make it work
18:17:54FromDiscord<haxscramper> Maybe at the end of the week I will get to it
18:18:30giacotreeform, yeah, I already use cfg and nims for that, but I am developing a program that spits help/version when no args are provided, and I don't like to hardcode test args into code
18:18:44FromDiscord<treeform> I also realy like my keyboard: https://ergodox-ez.com/ but the f6 is behind a layer.
18:19:28giacoyeah, it is broken, literally :D
18:19:40giacoseems nice
18:19:46FromDiscord<haxscramper> And I also need to figure out a way to bundle C++ libraries as submodules and compiling them when installed
18:20:52FromDiscord<haxscramper> Is it possible to compile custom binary and then run it after `nimble install` of some package? I know `after build` might be a thing
18:23:28giacohaxscramper: seems something for makefiles
18:23:46FromDiscord<haxscramper> no
18:24:05FromDiscord<treeform> @haxscramper when building gets complex I make builder scripts in nim.
18:24:23FromDiscord<haxscramper> @treeform do you have an example?
18:24:47FromDiscord<treeform> such as download new versions of priority software, running tests, running steamsdk uploader thingy, crushing pngs etc...
18:26:03FromDiscord<treeform> I don't have any open source examples. But just yesterday I was working on a new thing. I want to build for all platforms at once. I was setting up virtual box to load each VM, macOS, Ubuntu32/64 so I can start stop them.
18:26:54FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=2Ofd
18:27:10FromDiscord<treeform> I have scripts like that for a ton of things
18:28:31FromDiscord<haxscramper> And `vm.resume()` just executes appropriate CLI to manage vm vm runner?
18:28:41FromDiscord<treeform> yeah
18:29:30FromDiscord<treeform> Here is a simple one for my google-docs based blog: https://github.com/treeform/blog/blob/master/src/blog.nim
18:30:10FromDiscord<treeform> My writing always sucked so I have friends proof read my blogs and leave edits/comments.
18:32:59FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Ofg
18:33:12FromDiscord<haxscramper> And use any necessary build dependencies in the script
18:33:25FromDiscord<treeform> yeah that would work
18:40:46*mmohammadi9812 quit (Read error: Connection reset by peer)
18:40:57*mmohammadi9812 joined #nim
19:02:48giacoI'm using fmt"""foobar""" but I need to end my string with '"', but it doesn't like fmt"""foobar"""", do I have to rely on add/concat?
19:04:33giacooh, nervermind, it works, it is the vscode plugin that doesn't handle that
19:22:04leorizeare you using saem's plugin?
19:31:04*zedeus quit (Ping timeout: 258 seconds)
19:36:49Clonkk[m]Docs are down ?
19:37:06Clonkk[m]nvm it's back
19:39:09*hmmm joined #nim
19:39:52FromDiscord<ElegantBeef> Clonkk out here ddossing the docs and playing it off
19:40:14Clonkk[m]Got a 503 error for a moment
19:40:18Clonkk[m]I'm innocent
19:40:20Clonkk[m]You can't prove anything
19:40:35Clonkk[m]😛
19:41:24*muffindrake quit (Quit: muffindrake)
19:42:06FromDiscord<zetashift> h-h-holy moly that's $300 for a keyboard
19:42:09FromDiscord<ElegantBeef> I can prove the forum is full of necromancers 😄
19:53:12FromDiscord<treeform> I got 2 one for work (quite) and one for home (clicky).
19:53:15FromDiscord<Zachary Carter> I was about to purchase one and then saw the price and thought - I can just sit up straight
19:53:28FromDiscord<lytedev> yeah right
19:53:29FromDiscord<Zachary Carter> don't need a keyboard for good posture!
19:53:53FromDiscord<treeform> I actually sit between my keyboards
19:54:12FromDiscord<Zachary Carter> it does look really nice though... I'm imagining how much nicer it would be to not have to move my right arm over to type
19:54:15FromDiscord<lytedev> split keyboards are wonderful
19:54:51FromDiscord<treeform> https://media.discordapp.net/attachments/371759389889003532/806613686767845416/ACtC-3eO8ZOM1GCUzkMySM5vPb3pWvTrDONduseF2_eyY4fRyqlWwe7EIXQo_obmt-dLuW8HqeJvCixVak-A-VRio3oumRUCGRJr.png
19:54:54FromDiscord<Zachary Carter> I'm going to buy one - I can just write it off
19:55:12FromDiscord<lytedev> if you can write it off, why wouldn't you?!
19:55:19PrestigeI had those and wasn't a fan of the split tbh
19:55:24FromDiscord<Zachary Carter> really?
19:55:35Prestigecould never find a comfortable position, everything felt awkward
19:55:41FromDiscord<Zachary Carter> @lytedev well I didn't know I needed one until today 🙂
19:55:44FromDiscord<Zachary Carter> really?
19:55:52PrestigeReally really
19:56:00FromDiscord<Zachary Carter> huh
19:56:10PrestigeI have a preonic board now
19:56:34FromDiscord<lytedev> man, I feel the opposite -- everything suddenly feels comfortable -- the ortholinear layout adjustment does take some getting used to -- especially if you had bad typing habits like I did
19:57:01PrestigeI love ortholinear, I just dislike the split
19:57:04Prestigemy board is like https://i.imgur.com/EgxoQAX.png
19:57:45FromDiscord<lytedev> yeah I have a planck, but the split is the real win for me =D silly humans and their ability to be different...
19:57:59Prestigeheh
19:58:43*mmohammadi9812 quit (Remote host closed the connection)
19:58:45FromDiscord<lytedev> (edit) man, I feel the opposite -- everything suddenly feels comfortable -- the ortholinear/columnar layout adjustment does take some getting used to -- especially if you had bad typing habits like I did
19:59:01*mmohammadi9812 joined #nim
20:01:08giacois there anything in nim similar to python's numpy to perform multidimensional and vectorized operations?
20:03:29FromDiscord<InventorMatt> Arraymancer and neo
20:03:55FromDiscord<InventorMatt> Both are good matrix libraries
20:06:51giacogreat! thanks
20:10:12FromDiscord<Zachary Carter> hmm... their return policy is unfortunate
20:13:45*hmmm quit (Quit: WeeChat 3.0)
20:15:30*antholop[m] joined #nim
20:17:03FromDiscord<lytedev> how so?
20:17:10FromDiscord<lytedev> "you can't?"
20:17:15FromDiscord<lytedev> (edit) "can't?"" => "can't"?"
20:19:38*FromDiscord quit (Remote host closed the connection)
20:19:55*FromDiscord joined #nim
20:22:07*liblq-dev quit (Quit: WeeChat 3.0)
20:22:13*FromDiscord quit (Remote host closed the connection)
20:22:30*FromDiscord joined #nim
20:25:08*haxscramper quit (Remote host closed the connection)
20:25:56*haxscramper joined #nim
20:38:23FromDiscord<ElegantBeef> Ah that picture explains why treeform always has good libraries, when you lounge that hard you automatically become a 90% better programmer 😄
20:38:27*hmmm joined #nim
20:42:27*jess quit (Quit: Leaving)
20:45:06*jess| joined #nim
20:46:58FromDiscord<Zachary Carter> @lytedev - no you have to pay to ship the keyboard back to Taiwan which supposedly runs about $90
20:47:06*jess| is now known as jess
20:47:14FromDiscord<Zachary Carter> from the US anyway
21:00:06FromGitter<Araq> haxscramper: I just pushed more things to my araq-nkerror branch
21:03:31FromGitter<haxscramper> What do you think about my idea for storing additional information in `nkErrer` & re-running semcheck in detailed mode?
21:14:22FromDiscord<Meowx> could nimbles `--ver` flag be used on a single package?
21:14:47FromDiscord<Meowx> instead of `nimble list --ver`
21:18:04FromDiscord<dom96> It works with ‘search’ too iirc
21:21:27*azed quit (Quit: WeeChat 3.0)
21:21:53FromGitter<Araq> @haxscramper before we add features, let's make nkError solid first
21:22:25FromDiscord<Avatarfighter> Does anyone know of a good strategy for making a "timeout" for async operations specifically when reading data from a socket ?
21:22:57FromDiscord<Avatarfighter> I hope that made sense I don't think it did, but I am trying to do something along the lines of if I don't receive data after X seconds do something
21:23:53FromDiscord<IndianGoldSmith> Hi, how to import the a nim file on the same folder in my "main.nim" ?
21:24:09FromDiscord<IndianGoldSmith> (edit) removed "the"
21:24:26FromDiscord<Avatarfighter> you should be able to do `import filename` if the file is in the same directory @IndianGoldSmith
21:24:43FromDiscord<IndianGoldSmith> @Avatarfighter Thanks. Let me check
21:25:29FromDiscord<Avatarfighter> replace "filename" with the actual name of the nim file you're trying to import of course 😛
21:26:07FromDiscord<IndianGoldSmith> @Avatarfighter Yeah, i know
21:27:38FromDiscord<Avatarfighter> Just making sure ! I made this error once when I first started learning to program 🙂
21:28:25FromDiscord<IndianGoldSmith> Oh, i see. No problem here, but this is the result.↵Error: execution of an external program failed: 'e:\Programming\Nim\main.exe '
21:29:07FromDiscord<IndianGoldSmith> proc Sample() = ↵ echo "Sample Get called"↵This is the code in second file
21:29:54FromDiscord<Avatarfighter> What is the code in `main.nim` ?
21:30:44FromDiscord<IndianGoldSmith> import secondFile↵↵echo "Sample proc is calling"↵secondFile.Sample()
21:31:55FromDiscord<IndianGoldSmith> I think it is compiled successfully. See this --↵Hint: 22383 lines; 2.030s; 25.57MiB peakmem; Debug build; proj: E:\Programming\Nim\main.nim; out: E:\Programming\Nim\main.exe [SuccessX]
21:32:54FromGitter<haxscramper> > before we add features, let's make nkError solid first ⏎ ⏎ @Araq Yes, of course I don't plan to jump on it and implement everything at once. So for now you propose to just put everything as string literals into `nkError` nodes and then expand it with better handling?
21:33:13FromGitter<haxscramper> Although I was asking about your general opinion on the idea
21:33:39FromDiscord<Avatarfighter> IndianGoldSmith: can you upload the full compilation output to a paste so I can read it by any chance?
21:34:07*superbia joined #nim
21:34:24FromDiscord<IndianGoldSmith> Okay @Avatarfighter
21:35:05*narimiran quit (Ping timeout: 240 seconds)
21:35:27FromGitter<haxscramper> And changing error representation later might require additional time to re-discuss things, and re-write them to use error representation that finally doesn't loose context/information
21:36:00FromDiscord<IndianGoldSmith> sent a long message, see http://ix.io/2Oge
21:36:27FromDiscord<IndianGoldSmith> Sorry, i just changed the file names. 1. mFile, 2. sFile
21:36:36FromDiscord<Avatarfighter> no worries
21:38:26FromDiscord<IndianGoldSmith> @Avatarfighter I am sorry again, but i found the problem
21:38:34FromDiscord<IndianGoldSmith> It was my antivirus
21:38:53FromDiscord<dom96> @Avatarfighter you can use withTimeout or (`await recv() or sleepAsync`). Note that you’ll need to close the socket to cancel the recv operation.
21:39:30FromDiscord<Avatarfighter> @IndianGoldSmith that was a simple solution 😛
21:40:05FromDiscord<Avatarfighter> @dom96 yeah I had a suspicion I needed to close the socket lol 😛
21:40:22FromDiscord<Avatarfighter> Thanks for the tip, I just noticed that httpclient doesn't have a timeout for requests
21:40:26superbiaoff topic, but what screenrecorders do you guys use on windows ?
21:40:41FromDiscord<IndianGoldSmith> @Avatarfighter Yeah.
21:40:53FromDiscord<haxscramper> @konsumlamm I've implemented most of the fixes for pattern matching that we have discussed, and marked PR as ready for review. Documentation is updated too
21:43:11FromDiscord<haxscramper> Also included more examples in tests do show how things should be used - feel free to comment on any changes - until this is merged misdisigned parts can be changed
21:44:55*superbia1 joined #nim
21:46:07*superbia quit (Ping timeout: 276 seconds)
21:49:32FromDiscord<konsumlamm> @haxscramper nice! you may also want to document and add tests for using object patterns on ref objects (or anything really) and `of` patterns on objects
21:52:24FromDiscord<haxscramper> Something in addition to https://github.com/haxscramper/fusion/blob/e4cd2235c18b42cdc25f5c012c525e409e521918/tests/tmatching.nim#L1305 ?
21:52:48FromDiscord<ElegantBeef> superbia i use obs everywhere
21:53:17FromDiscord<haxscramper> @konsumlamm and there is a small test for regular ref objects
21:54:46FromDiscord<haxscramper> Ref object use is re-documented, though I just pasted test as an example - it illustrates all use cases (nil, derived, base object, different fields).
22:04:34FromDiscord<konsumlamm> i don't see any tests/documentation for using normal (non ref) objects with of patterns (i.e. `of ObjectName()`)
22:05:40FromDiscord<konsumlamm> also, there's still a typo in line 22 of matching.rst, it should be `echo a`
22:09:14FromDiscord<haxscramper> There are no`of` examples because you use `of` for ref objects
22:11:48FromDiscord<mratsim> you can use "of" for "object of Something" without them being ref
22:12:04FromDiscord<haxscramper> I'm talking about pattern matching DSL
22:12:09FromDiscord<mratsim> ah
22:12:52FromDiscord<haxscramper> I'm also always doing `isNil` check so it makes it even more useles for non-ref/ptr objects
22:14:01FromDiscord<haxscramper> And I was actually quite surprised that `of` returns true for `nil` objects
22:17:06*superbia1 quit (Quit: WeeChat 3.0)
22:20:40FromDiscord<konsumlamm> hmm, i think being able to use `of` in patterns for normal objects would have been useful since you can use inheritance with normal objects and that way you can assert the type of an object (when matching on a generic or something)
22:21:19FromDiscord<ElegantBeef> You mean if you have a `var a: YourRef = nil; assert a of YourRef` passes?
22:21:34FromDiscord<haxscramper> !eval var a: YourRef = nil; assert a of YourRef
22:21:37NimBotCompile failed: /usercode/in.nim(1, 8) Error: undeclared identifier: 'YourRef'
22:21:57FromDiscord<ElegantBeef> Lol hax the bot isnt smart enought to intuit that "your ref" is an ref object 😄
22:22:18FromDiscord<ElegantBeef> !eval var a: ref int; assert a of int
22:22:23NimBotCompile failed: /usercode/in.nim(1, 26) Error: 'of' takes object types
22:22:44FromDiscord<ElegantBeef> I'm great at this
22:22:57FromDiscord<haxscramper> Playground died when I tried to copy link, but this returns true too
22:22:58*PMunch quit (Quit: leaving)
22:23:05*tane quit (Quit: Leaving)
22:23:07FromDiscord<ElegantBeef> Well yea that makes sense
22:23:13FromDiscord<haxscramper> It is actually replaced by `true` at semcheck stage
22:23:42FromDiscord<haxscramper> Maybe, though I expected `nil` to not be of any type
22:24:06FromDiscord<ElegantBeef> Yea i dont expect it either, but it makes sense that it does
22:24:11FromDiscord<haxscramper> I'm not sure if inheritance for non-ref objects is even used anywhere
22:24:24FromDiscord<ElegantBeef> Inheritance of non ref's is just a pain
22:24:47FromDiscord<haxscramper> Because it is basically useless - methods don't work, I'm not even sure you can put them into `seq`
22:24:55FromDiscord<ElegantBeef> Dont think you can
22:25:18FromDiscord<haxscramper> And `of` is probably really weird too
22:25:27*rockcavera quit (Read error: Connection reset by peer)
22:25:28FromDiscord<haxscramper> for non-ref inheritance
22:25:56*rockcavera joined #nim
22:30:55FromDiscord<konsumlamm> if the language supports inheritance on normal object, i would expect pattern matching to support that in `of`-patterns as well... and it shouldn't be hard at all to support it too, afaict all that's needed is to only insert the nil check if it's a ref type
22:31:31FromDiscord<ElegantBeef> The general suggestion is "Only use inheritance on non-ref's if you know exactly how to unfuckery it"
22:31:47FromDiscord<konsumlamm> also, i think it's a nice workaround for not being able to match on `NameOfMyObject(field: @a)`
22:32:10FromDiscord<haxscramper> This can be fixed by editing `hasKidn`
22:32:14FromDiscord<haxscramper> (edit) "`hasKidn`" => "`hasKind`"
22:32:28FromDiscord<haxscramper> If you want this fixed I can do it
22:32:40FromDiscord<konsumlamm> `hasKind`? not `kind`?
22:33:03FromDiscord<haxscramper> But non-ref inheritance is implementing features for non-existent users of barely working feature that is not advised to be used
22:33:12FromDiscord<konsumlamm> i'd prefer this to be fixed, especially since it doesn't require any big effort, even if it ends up not being used much
22:33:13*zedeus joined #nim
22:33:47FromDiscord<konsumlamm> you can add a note in the docs that inheritance on objects is not encouraged
22:37:59FromDiscord<haxscramper> done
22:38:50FromDiscord<haxscramper> This is general 'everyone knows that', but I've added ↵> Due to ``isNil()`` check this pattern only makes sense when working with ``ref`` objects.
22:39:06FromDiscord<haxscramper> to documentation to clarify when `of` should be used
22:39:46FromDiscord<haxscramper> Pushed update for `matches(NameOfMyObject(), NameOfMyObject())` matching
22:41:31FromDiscord<konsumlamm> :o so now `NameOfMyObject(field: @a)` works?
22:42:36FromDiscord<haxscramper> yes
22:42:52FromDiscord<konsumlamm> <3
22:43:03FromDiscord<haxscramper> wait a sec
22:43:03FromDiscord<konsumlamm> though that still needs to be documented afaict
22:43:52FromDiscord<konsumlamm> did you just push the same changes twice?
22:44:26FromDiscord<konsumlamm> ah, you added a test for fields
22:44:27FromDiscord<haxscramper> Expanded test with examples - https://github.com/haxscramper/fusion/blob/3bb7bb64686e8948bdc9cbbdcf056c5260566c81/tests/tmatching.nim#L1346
22:44:51FromDiscord<konsumlamm> remember to document that behaviour though
22:46:08FromDiscord<haxscramper> I'm not really sure if this is necessary actually. E.g. I want to make accent on `Kind()` patterns - `ObjectName()` is good for consistency reasons, but I don't want to empathize it
22:46:56FromDiscord<haxscramper> E.g. if someone accidentally writes `ObjectName()` this is no longer an error, but in `Kind()` still takes priority whenever possible
22:47:33FromDiscord<konsumlamm> it's still worth mentioning at least imo ¯\_(ツ)_/¯
22:54:57*Gustavo6046 quit (Ping timeout: 246 seconds)
22:55:01*zedeus quit (Ping timeout: 276 seconds)
22:59:29FromDiscord<haxscramper> The one thing I'm still missing is benchmarking this
23:00:16FromDiscord<ElegantBeef> In comes benchy 😄
23:00:44FromDiscord<haxscramper> Thought with more stable view types it all will be zero-copy, single-call for the most part
23:03:35*Gustavo6046 joined #nim
23:07:10*haxscramper quit (Remote host closed the connection)
23:08:10*zedeus joined #nim
23:09:08*clyybber quit (Quit: WeeChat 3.0)
23:12:16*fredrikhr quit (Ping timeout: 240 seconds)
23:32:05*zedeus quit (Ping timeout: 240 seconds)
23:35:08*zedeus joined #nim
23:36:33*hyiltiz quit (Ping timeout: 264 seconds)
23:47:35*hyiltiz joined #nim
23:47:35*hyiltiz quit (Changing host)
23:47:35*hyiltiz joined #nim
23:48:45*hmmm quit (Quit: WeeChat 3.0)
23:51:57*abm quit (Quit: Leaving)
23:55:15*zedeus quit (Quit: zedeus)