<< 28-04-2019 >>

00:13:46*abm joined #nim
00:15:58*abm quit (Client Quit)
00:45:58*smitop joined #nim
01:51:00*rnrwashere quit (Remote host closed the connection)
01:55:42*rnrwashere joined #nim
01:57:53*SenasOzys quit (Remote host closed the connection)
01:58:18*SenasOzys joined #nim
02:00:04*banc quit (Quit: Bye)
02:16:22*leorize quit (Quit: WeeChat 2.3)
02:21:17*banc joined #nim
03:01:20FromGitter<jrfondren> I'm guessing people don't actually use nimgrep that much in its default configuration
03:02:02FromGitter<jrfondren> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cc517aaa4ef0974710f9b4a]
04:10:21*[rg] joined #nim
04:51:38*dddddd quit (Remote host closed the connection)
05:24:21*solitudesf- joined #nim
05:43:25*pi_ quit (Quit: WeeChat 1.6)
05:50:50*nsf joined #nim
05:51:35*pi1 joined #nim
05:51:44*pi1 quit (Client Quit)
06:01:26*fanta1 joined #nim
06:05:06*vlad1777d joined #nim
06:05:34*[rg] quit (Quit: Leaving)
06:07:19*[rg] joined #nim
06:10:02*absolutejam2 joined #nim
06:18:10*absolutejam2 quit (Ping timeout: 250 seconds)
06:33:51*absolutejam2 joined #nim
06:47:29*kapil____ joined #nim
06:52:27*leorize joined #nim
06:57:02*rnrwashere quit (Remote host closed the connection)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:01:46*absolutejam2 quit (Ping timeout: 246 seconds)
07:04:58*gmpreussner joined #nim
07:19:53*SenasOzys quit (Remote host closed the connection)
07:20:40*SenasOzys joined #nim
07:38:12*r4vi quit (Read error: Connection reset by peer)
07:38:26*r4vi joined #nim
07:45:58FromGitter<jrfondren> @Zevv https://gist.github.com/jrfondren/c4ec5f09a682c03786974e39b6c6bfd1 , 125-line npeg parser. and it's incomplete, with the UnparsedArgActs rule
07:46:42*[rg] quit (Quit: Leaving)
07:47:02*fanta1 quit (Quit: fanta1)
08:00:47*Vladar joined #nim
08:10:12FromGitter<gogolxdong> How to support svg in Karax?
08:15:14*fanta1 joined #nim
08:43:11*[rg] joined #nim
08:53:29*NimBot joined #nim
09:21:14*neceve joined #nim
09:44:26*solitudesf- quit (Ping timeout: 250 seconds)
09:45:21*stefanos82 joined #nim
09:54:45*nif quit (Quit: ...)
09:57:40*nif joined #nim
10:19:18FromGitter<mratsim> @noonien because the compiler for overloading the compiler uses the more specific level but both SomeInteger and Array are generics
10:19:49FromGitter<mratsim> in your T: SomeInteger and T: Array
10:20:38FromGitter<mratsim> you probably need to use `func decode*T: SomeInteger (d: Decoder, typ: typedesc[T]): T`
10:32:50*lritter joined #nim
10:49:40*dddddd joined #nim
11:01:23*[rg] quit (Ping timeout: 246 seconds)
12:08:41*solitudesf- joined #nim
13:03:52*SenasOzys quit (Remote host closed the connection)
13:38:21FromGitter<liquid600pgm> dang it, why when using generics with concepts in procs does the VS Code extension just stop working for the whole file!?
13:38:47FromGitter<liquid600pgm> it's painful because I have to program blindly, not knowing what errors have I caused
13:54:51*aziz joined #nim
13:58:23FromGitter<liquid600pgm> is there something similar to Rust's `Self` in Nim?
14:02:01FromGitter<jrfondren> what's Rust's `Self`?
14:02:37FromGitter<liquid600pgm> say you have a struct `Something`, in that struct's implementation, you can use `Self` as an alias to `Something`
14:04:20FromGitter<jrfondren> Nim's type definitions are so brief, I don't think that'd be useful, but anyway I've never seen it. On the contrary what code I've seen often wants to refer specifically to a ref or non-ref version of the 'same' object so this feature couldn't be used anyway
14:06:03FromGitter<jrfondren> nothing like that mentioned here: https://nim-lang.github.io/Nim/manual.html#type-sections
14:08:29FromGitter<liquid600pgm> I thought that might fix my issue with inheritance and procs. I have a `Sprite = ref object of RootObj`, and a `proc init*(spr: var Sprite)`. I cannot call this proc for a `Player = ref object of Sprite`, because the proc expects a `Sprite`, even though `Player` inherits from `Sprite`
14:09:16FromGitter<liquid600pgm> I have to go through a weird type conversion to call the proc: `result.Sprite.init()`
14:10:01FromGitter<liquid600pgm> now thinking about it a `Self` wouldn't help that much, but is there a better way, without the cast?
14:13:00FromGitter<jrfondren> hmm, I've avoided inheritance, so I don't know.
14:14:16*clyybber joined #nim
14:15:39clyybberliauid600pgm: That sounds like a bug.
14:16:35clyybberliquid600pgm: Can you try without `var`?
14:18:25FromGitter<liquid600pgm> yeah that works
14:18:36clyybberReport it I guess
14:19:20FromGitter<jrfondren> it works with var in my test, if they're non-ref objects
14:19:28clyybberYeah.
14:19:37FromGitter<liquid600pgm> my objects *are* ref objects
14:19:47FromGitter<jrfondren> aye. with bare objects, the var's OK
14:20:49clyybberAccording to https://nim-lang.github.io/Nim/manual.html#type-relations-subtype-relation this is a bug.
14:21:56*rnrwashere joined #nim
14:24:57FromGitter<jrfondren> https://gist.github.com/jrfondren/acaa621e19e44080cb113c157a051ff9 <- as an alternative to the cast, calling with a dereference.
14:26:32*rnrwashere quit (Remote host closed the connection)
14:27:06*rnrwashere joined #nim
14:27:46*Tyresc joined #nim
14:28:58*rnrwashere quit (Remote host closed the connection)
14:29:11*rnrwashere joined #nim
14:48:12*vlad1777d quit (Ping timeout: 250 seconds)
14:54:37*aziz quit (Ping timeout: 245 seconds)
15:02:45*rnrwashere quit (Remote host closed the connection)
15:05:11*rnrwashere joined #nim
15:06:56*fanta1 quit (Quit: fanta1)
15:07:17*aziz joined #nim
15:21:34*aziz quit (Ping timeout: 250 seconds)
15:23:26*arecaceae quit (Remote host closed the connection)
15:23:46*arecaceae joined #nim
15:33:44*aziz joined #nim
15:38:57*slugm joined #nim
15:44:20FromGitter<mratsim> @lqdev, there was a pragma {.this: self.} that you could use but it's being deprecated
15:44:31FromGitter<mratsim> it was broken with generics
15:45:15FromGitter<jrfondren> it's unrelated to his problem though, even though it's OO related and self related :)
15:46:45FromGitter<mratsim> also concepts seem to be quite taxing on nimsuggest (along with macros).
15:47:00FromGitter<mratsim> i.e. I think it's nimsuggest fault that the VSCode plugin hangs
15:47:06*Trustable joined #nim
15:47:13FromGitter<liquid600pgm> it doesn't really hang though
15:47:21FromGitter<mratsim> (also if it didn't use 1 nimsuggest per file ...)
15:47:23FromGitter<liquid600pgm> it still suggests things, it just doesn't show errors
15:47:46FromGitter<liquid600pgm> only when I import the module from another module and save that, errors are visible
15:48:56FromGitter<liquid600pgm> by the way, I heard multi-methods are getting sort of deprecated (they have to be enabled using a cmdline switch)
15:49:43FromGitter<mratsim> yes
15:49:47FromGitter<liquid600pgm> are multi-methods basically `method doSth(a: A) {.base.}` then `method doSth(b: B)` for `B = ref object of A`?
15:49:57FromGitter<mratsim> no
15:50:04FromGitter<mratsim> it's the collide example
15:50:12FromGitter<liquid600pgm> what are they, then?
15:50:15FromGitter<mratsim> when you dispatch on multiple arguments
15:50:29FromGitter<liquid600pgm> aah, so regular methods are staying?
15:50:39FromGitter<mratsim> yes
15:51:04FromGitter<liquid600pgm> nice, I thought I'd have to switch to using tuples (which are pretty painful)
15:51:32FromGitter<jrfondren> so with early binding you can have multiple dispatch, but if you want late binding OO methods you can only have single dispatch? that seems fair
15:52:13FromGitter<mratsim> previously you could have ⏎ A = ref object of RootObj ⏎ C= ref object of RootObj ⏎ ⏎ B = ref object of A ... [https://gitter.im/nim-lang/Nim?at=5cc5cc2d990feb4518199bd5]
15:53:28FromGitter<mratsim> but that causes several issues, iirc they are related to optimisation and proving certain safety properties. + methods are broken with generics anyway :P
15:55:15FromGitter<mratsim> I'm still waiting for the VTable.
15:55:41FromGitter<mratsim> They were in Nim docs 3 years ago before being removed from docs a year ago :P https://github.com/nim-lang/Nim/commit/c671356d51488c96b4749a4d109b00d924e1f739
15:57:07FromGitter<liquid600pgm> multi-methods are methods with multiple dynamic dispatch, right?
15:57:14FromGitter<mratsim> yes exactly
15:57:28FromGitter<liquid600pgm> fine, I understood this correctly then
15:57:29FromGitter<liquid600pgm> thanks
15:57:32FromGitter<mratsim> most languages besides Julia iirc have single dispatch methods
15:57:55FromGitter<mratsim> i.e. only runtime type of a single argument is considered.
15:58:12FromGitter<liquid600pgm> ik, that's exactly what I use
15:58:21FromGitter<liquid600pgm> thanks for the clarification
15:59:20FromGitter<liquid600pgm> is there any way to call the base method from an inheriting method, or do I have to create a separate proc?
16:00:09FromGitter<jrfondren> https://nim-lang.github.io/Nim/manual.html#multiminusmethods-inhibit-dynamic-method-resolution-via-proccall
16:01:12FromGitter<liquid600pgm> seems pretty verbose and hard to understand, I'll stay with the separate proc approach
16:01:32FromGitter<mratsim> it really should be called "baseCall"
16:01:48FromGitter<liquid600pgm> not really
16:02:05FromGitter<jrfondren> the way it reads, it can call anything, it's just an explicitly early-bound call
16:02:08FromGitter<jrfondren> that's why it has the cast
16:02:20FromGitter<liquid600pgm> it doesn't just call the base, it calls a method with proc calling semantics (static dispatch)
16:03:08FromGitter<mratsim> oh right
16:03:36FromGitter<mratsim> I actively avoid methods in my codebase anyway.
16:04:30FromGitter<liquid600pgm> I normally use procs, but in my use case (a base sprite class used all throughout my engine's codebase) methods are just what I need
16:05:40FromGitter<jrfondren> ```method m(a: Son) = ⏎ procCall m(GrandFather(a)) ⏎ procCall m(Father(a))``` [https://gitter.im/nim-lang/Nim?at=5cc5cf545b3f941aa5a89c4c]
16:05:45FromGitter<jrfondren> ^ that works for example
16:10:28*slugm quit (Remote host closed the connection)
16:10:35*slugm_ joined #nim
16:14:13*[rg] joined #nim
16:14:40FromGitter<liquid600pgm> oh great, now concepts refuse to work \o/
16:15:05*neceve quit (Remote host closed the connection)
16:16:10FromGitter<liquid600pgm> I think I'm just gonna use a tuple interface for this, concepts are far too unstable and hard to debug rn
16:17:16FromGitter<liquid600pgm> strange that it worked perfectly up until now, I haven't touched the code at all
16:19:49FromGitter<jrfondren> if you only have a few drawables, you could use variants instead.
16:20:15*vlad1777d joined #nim
16:20:37FromGitter<jrfondren> https://nim-lang.github.io/Nim/manual.html#types-object-variants . The only trouble I've run into with these is that you have to define your own `==`. That's straightforward (to the point that you ask why you're doing it) though
16:21:18FromGitter<liquid600pgm> they're not just drawables, they're sprites each with its own behavior, and as the game gets larger and larger this approach will become pretty unmaintainable
16:21:24*aziz quit (Ping timeout: 244 seconds)
16:21:31FromGitter<liquid600pgm> also, I like to split things up into a few different modules
16:21:59FromGitter<jrfondren> *nod*. this isn't one of the canonical examples of inheritance for nothing eh
16:23:16FromGitter<liquid600pgm> I try to use variants whenever inheritance is not needed, but sadly this isn't the case
16:27:11*luis_ joined #nim
16:27:51*luis_ is now known as lf-araujo
16:30:03*vlad1777d quit (Ping timeout: 245 seconds)
16:33:41*aziz joined #nim
16:52:00*[rg] quit (Quit: Leaving)
16:52:25*[rg] joined #nim
16:53:40*jjido joined #nim
17:14:16*lf-araujo quit (Ping timeout: 246 seconds)
17:14:19*ng0 joined #nim
17:21:51*aziz quit (Ping timeout: 244 seconds)
17:33:45*aziz joined #nim
17:37:47*abm joined #nim
17:44:11FromGitter<jrfondren> `let val = (try: $3 except: $2)` ... this crashes on -d:release. huh.
17:44:18*natrys joined #nim
17:45:34*smitop quit (Quit: Connection closed for inactivity)
17:46:41*lritter quit (Ping timeout: 246 seconds)
17:47:49*lf-araujo joined #nim
17:51:18*lritter joined #nim
17:52:16dom96jrfondren: seems like something that's not well tested
17:53:00FromGitter<jrfondren> it's because there are no bounds checks on release. That's fine, but it's surprising to have something run without errors and then segfault on -d:release.
17:53:16FromGitter<jrfondren> I'd rather a "this will segfault on -d:release" kind of error not get caught by an exception handler
17:55:26*kapil____ quit (Quit: Connection closed for inactivity)
18:03:14*rnrwashere quit (Remote host closed the connection)
18:03:33*rnrwashere joined #nim
18:13:31*absolutejam2 joined #nim
18:13:56*rnrwashere quit (Remote host closed the connection)
18:14:15*rnrwashere joined #nim
18:17:58*rnrwashere quit (Remote host closed the connection)
18:21:49*aziz quit (Ping timeout: 246 seconds)
18:30:41*vlad1777d joined #nim
18:33:53*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:34:34*aziz joined #nim
18:35:21*rnrwashere joined #nim
18:38:41*absolutejam2 quit (Ping timeout: 255 seconds)
18:46:33*elrood joined #nim
18:50:07*luis_ joined #nim
18:51:05*lf-araujo quit (Ping timeout: 246 seconds)
18:58:11*rnrwashere quit (Remote host closed the connection)
19:00:56*rnrwashere joined #nim
19:12:04*absolutejam2 joined #nim
19:22:04*aziz quit (Ping timeout: 250 seconds)
19:22:53*a_chou joined #nim
19:24:46*a_chou quit (Client Quit)
19:24:59*jjido joined #nim
19:30:39*nsf quit (Quit: WeeChat 2.4)
19:33:47*aziz joined #nim
19:34:11*clyybber quit (Quit: WeeChat 2.4)
19:36:17*absolutejam2 quit (Ping timeout: 245 seconds)
19:36:53*Vladar quit (Remote host closed the connection)
19:37:18*absolutejam2 joined #nim
19:38:09*luis_ quit (Remote host closed the connection)
19:43:11*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:48:38*Trustable quit (Remote host closed the connection)
19:51:23*aziz quit (Quit: Ex-Chat)
19:56:48*elrood quit (Remote host closed the connection)
19:57:01*lritter quit (Ping timeout: 246 seconds)
20:09:51*[rg] quit (Quit: Leaving)
20:19:51*slugm_ quit (Ping timeout: 258 seconds)
20:33:16shashlick@Araq: is there any value in including nim HTML docs in release binaries? I'm okay running the tests in nightlies but curious if including the HTML is required in the xz file
20:43:06*[rg] joined #nim
20:49:25*leorize quit (Ping timeout: 256 seconds)
21:12:03shashlick@dom96 - fixed the caching issue
21:25:28*ua quit (Ping timeout: 245 seconds)
21:42:09*Jesin quit (Quit: Leaving)
21:48:58*Jesin joined #nim
21:57:22*natrys quit (Quit: natrys)
22:01:20*ng0 quit (Quit: Alexa, when is the end of world?)
22:03:03*[rg] quit (Quit: Leaving)
22:14:05*solitudesf- quit (Ping timeout: 246 seconds)
22:19:30FromGitter<deech> Is `!=` good enough to verify that two `ref`s don't point to the same thing?
22:29:58*stefanos82 quit (Remote host closed the connection)
22:31:11FromGitter<kayabaNerve> @deech IIRC, you need to cast to an uint before.
23:16:00FromGitter<gogolxdong> @federico3 confirmed, entr doesn't work on linux subsystem of windows.
23:18:22*Tyresc quit (Quit: WeeChat 2.5-dev)
23:21:29disrupteki believe identity is equality as far as nim's concerned. you definitely don't need to cast anything.
23:27:37*rnrwashere quit (Remote host closed the connection)
23:27:41*smitop joined #nim
23:38:36*absolutejam2 quit (Ping timeout: 250 seconds)
23:43:24*xet7 quit (Remote host closed the connection)
23:55:10FromGitter<gogolxdong> a modify watched by `inotifywait -m index.nim` is interperated as ⏎ index.nim MODIFY ⏎ index.nim ATTRIB ⏎ twice. [https://gitter.im/nim-lang/Nim?at=5cc63d5e6a84d76ed8109e10]