00:05:17*couven92 quit (Read error: Connection reset by peer)
00:11:25FromGitter<timotheecour> @araq what do you suggest for https://github.com/nim-lang/Nim/pull/9853#discussion_r239007640 ?I tried a few stuff and found that to be clearest : ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ but I’m open for suggestions (the goal being to clearly delimit what’s part of the code being displayed [https://gitter.im/nim-lang/Nim?at=5c08692d33d9e1199188d60b]
00:42:19*jakob0094 quit (Remote host closed the connection)
00:51:16*ftsf quit (Quit: Leaving)
01:08:22*lritter quit (Ping timeout: 244 seconds)
01:09:17*lritter joined #nim
01:31:42TangerHey, has anybody here added code hot-loading to any of their programs? I found a few (fairly outdated) articles, was looking for more recent code to pore through
01:33:57TangerHaha, should rtfm first
01:34:18TangerSo the compiler supports JS hot reloading'
01:34:58FromGitter<rayman22201> This is an area actively being worked on: https://github.com/nim-lang/Nim/issues/8927
01:37:31TangerNice, very exciting feature, super handy
01:38:42FromGitter<rayman22201> Yeah. A lot of people are excited about it (including me). Hopefully it will be ready about the end of February next year.
01:44:36FromGitter<zetashift> Is there a way to check if all items in a sequence is unique? I'm currently doing a conversion to a set and see if the lengths match, is there a more Nim(TM) way?
01:48:19*xet7 quit (Remote host closed the connection)
01:54:28Tangerzetashift: https://nim-lang.org/docs/tables.html#CountTable Count Table perhaps? Or maybe overload add() so that it verifies that the item doesn't exist on adding?
02:11:59FromGitter<zacharycarter> @arnetheduck - thanks for sharing that Nimbus dev update - hoping to use JSON RPC in my new project
02:12:03FromGitter<zacharycarter> among others
02:18:23*abm quit (Quit: Leaving)
02:42:25*revere quit (Ping timeout: 250 seconds)
02:42:34*revere joined #nim
02:54:26*dddddd quit (Remote host closed the connection)
02:59:38leorizezetashift: converting to a `set` is probably the Nim-est way I believe
03:00:28leorizeif your data is too big for a `set`, you could use `deduplicate` from `sequtils`
03:03:03FromGitter<citycide> @alehander42 apparently Nim still does bounds checking on arrays even in an unreachable case like `if false and nums[2] == 2`, which is why the same logic used in gara for seqs fails for arrays
03:05:02FromGitter<citycide> (unless you're in `-d:release` obviously, which turns off those checks)
03:07:07FromGitter<citycide> Araq: could the compiler avoid an unnecessary bounds check in unreachable cases like that? not sure how reasonable that is
03:07:43*banc quit (Quit: ZNC - http://znc.in)
03:25:16*banc joined #nim
04:04:08FromGitter<citycide> to add to that ^ it's not even just that it's unreachable - there *would* be a length check there that's generated by gara but it seems to be elided and replaced with `false` (because it's an array with a known length), which then causes the out of bounds error
04:04:14FromGitter<citycide> so maybe this is a downright bug?
04:06:15leorizeI think it's a bug, short-circuiting should have worked here and prevent the array from being accessed
04:32:11*vlad1777d quit (Ping timeout: 268 seconds)
04:41:15*lritter quit (Ping timeout: 246 seconds)
04:41:33*nsf joined #nim
04:44:37*narimiran joined #nim
05:03:22*endragor joined #nim
05:07:32*junland quit (Quit: Disconnected.)
05:10:15*junland joined #nim
05:42:51*MyMind joined #nim
05:46:11*Sembei quit (Ping timeout: 268 seconds)
06:15:15FromDiscord_<technicallyagd> Well, that was painful.
06:16:14FromGitter<Vindaar> still is for me... test works out fine, real result is wrong and it's hard to debug :P
06:19:47FromDiscord_<technicallyagd> Are you comparing the (id,distance) pair or the distance?
06:20:06FromDiscord_<technicallyagd> This bug costs me 40min
06:30:36narimiranthere is a bug on some inputs!!
06:30:56narimiran(but regardless of it, i decided to skip today's task for now)
06:31:51FromGitter<Vindaar> ugh
06:32:31FromGitter<Vindaar> that means now I don't know whether I'm too stupid to find my mistake or if I'm affected by that bug :|
06:34:16FromDiscord_<technicallyagd> You can take some solution on reddit and check with your input
06:34:27FromDiscord_<technicallyagd> I don't think that's cheating 😛
06:34:32FromGitter<Vindaar> that's a good point
06:35:33FromDiscord_<technicallyagd> I failed so many times the final timeout I got was 10 min
06:35:53FromGitter<Vindaar> I'm still "only" at 5 minutes, haha
06:36:48FromDiscord_<technicallyagd> lol not so far away
06:39:42FromGitter<Vindaar> haha
06:39:43FromGitter<Vindaar> yes
06:39:50FromGitter<Vindaar> took some python solution, spits out my result
06:42:57FromGitter<Vindaar> yay, it works
06:43:54FromGitter<Vindaar> anyways, gonna do part 2 later today
06:44:12FromDiscord_<technicallyagd> So it's solved now?
06:46:06FromDiscord_<technicallyagd> don't! part 2 is super easy
06:47:38*narimiran quit (Ping timeout: 250 seconds)
06:47:51FromGitter<Vindaar> Ok, I can at least read it I guess...
06:55:23FromGitter<Vindaar> well, ok. you were right :)
06:59:10FromDiscord_<technicallyagd> 😄
07:09:27*krux02 joined #nim
07:11:26FromDiscord_<technicallyagd> Is there a standard way of turning `seq[seq[int]]` into `seq[(int,int)]` by taking the first two value from each inner seq?
07:13:52leorize`sequtils.mapIt` should do
07:16:59FromDiscord_<technicallyagd> so just `theSeq.mapIt((it[0],it[1]))` ?
07:17:52FromDiscord_<technicallyagd> but if I need 10 or more values, I would have to manually specify them as well?
07:18:59leorizeare you really sure you'd want to do that?
07:20:07FromDiscord_<technicallyagd> Well, if I have to access the values in `seq` many times, wouldn't it be better to turn them into tuple first?
07:21:43FromDiscord_<technicallyagd> Because tuple access seems to be 10x faster than seq access
07:22:08leorizeare you compiling with `-d:release`?
07:22:11FromDiscord_<technicallyagd> yep
07:22:48leorizethat's just weird and could be a bug
07:23:13leorizebut for maintainability, I don't think using a tuple of 10 would do any good
07:25:11FromDiscord_<technicallyagd> how is that so?
07:25:25FromDiscord_<technicallyagd> is it any different than array[10,int]?
07:28:42leorizeyou certainly wouldn't want your proc to take a param of type `(int, int, int, ...)`
07:29:39FromDiscord_<technicallyagd> oh, you are right, lol
07:30:32FromDiscord_<technicallyagd> well I guess turning seq into array is even better
07:30:52leorizethere's toOpenArray, but I'm not really sure what it does exactly
07:32:39FromDiscord_<technicallyagd> hmm, doesn't seem to work
07:33:33FromDiscord_<technicallyagd> wait, so should sequence access be as efficient as array/tuple access?
07:33:49leorizeyep, it's quite weird that you found it to be slower
07:34:25leorizedo you have a reproducible sample?
07:34:31FromDiscord_<technicallyagd> Yeah, I will try to write a minimal example now
07:44:43*kapil____ quit (Quit: Connection closed for inactivity)
07:51:45FromDiscord_<technicallyagd> Done. https://gist.github.com/technicallyagd/b4bce3d5932ba43ee28ab0a324c9cf4a
07:54:11FromDiscord_<technicallyagd> It's not as drastic of a difference here, only about 4.5 fold. I think it's due to the length of the outer seq in this example is shorter
08:03:13FromDiscord_<technicallyagd> And my hunch was correct, updated the gist to include the one with longer outer seq
08:26:14*dddddd joined #nim
08:27:53*stefanos82 joined #nim
08:29:53*Vladar joined #nim
08:43:34*nolanv quit (Ping timeout: 246 seconds)
08:47:04*nolanv joined #nim
08:52:53*jxy quit (Read error: Connection reset by peer)
08:53:08*jxy joined #nim
08:54:41FromGitter<alehander42> @citycide yeah, not sure if that's easily fixable in the compiler
08:55:25FromGitter<alehander42> (if it's a bug at all: maybe it's just a conservative decision, after all using out of bounds element in dead code seems like something the compiler should stop you from :D)
08:55:32FromGitter<alehander42> one workaround is of course
08:55:46FromGitter<alehander42> to use when: it's used in other places in gara as well
08:56:17FromGitter<alehander42> so the conditions for arrays would look like when a.len > ..: other condition else: false
08:58:32FromGitter<alehander42> alll right
08:58:50FromGitter<alehander42> it works: its a veery simple change of one-two lines, your refactoring really helps here
09:02:39*kungtotte quit (Remote host closed the connection)
09:08:03*kungtotte joined #nim
09:09:40FromGitter<alehander42> the maybeMatches error is more weird tho..
09:10:04*floppydh joined #nim
09:20:19*leorize quit (Ping timeout: 246 seconds)
09:21:24*leorize joined #nim
09:24:14*kungtotte quit (Remote host closed the connection)
09:25:58*kungtotte joined #nim
09:27:50*PMunch joined #nim
09:32:35*kapil____ joined #nim
09:43:49*krux02_ joined #nim
09:44:44*krux02 quit (Remote host closed the connection)
10:22:27*dom96_w joined #nim
10:33:53ZevvCan anyone tell me why I get an 'cannot instantiate' error when calling a method as a.make() instead of make(a) form?
10:34:50FromGitter<alehander42> well, how would make know what T is
10:34:57FromGitter<alehander42> ah wait, nvm
10:35:00PMunchIt has to do with the fact that Nim needs to evaluate a to figure out what can be called on it
10:35:52PMunchOh wait..
10:35:58PMunchThis is not that
10:36:00Zevv'a' is a Thing in both cases, right? Naively, I'd assume that the foo.bar() notation is nothing more then syntactic sugar for bar(foo)
10:36:28ZevvHappy to see two "Oh wait" responses. That was my first thought as well :)
10:37:27PMunchHaha, yeah I thought it was the classic template taking untyped issue
10:37:52PMunchThis I think is just a straight up bug..
10:39:47PMunchHmm, todays AoC was a bit trickier than the last couple
10:40:00PMunchI have a solution, but I'm pretty sure it won't work for the general case
10:40:38ZevvDidn't get to it yet
10:40:44Zevvwork work
10:44:11leorizeZevv: you'd need to use `a.make[:Blob]()` IIRC
10:44:12*pwntus quit (Read error: Connection reset by peer)
10:44:54ZevvThank you:
10:44:55ZevvThe [: ] notation has been designed to mitigate this issue: x.p[:T] is rewritten by the parser to p[T](x), x.p[:T](y) is rewritten to p[T](x, y). Note that [: ] has no AST representation, the rewrite is performed directly in the parsing step.
10:47:09*pwntus joined #nim
10:47:09*pwntus quit (Changing host)
10:47:09*pwntus joined #nim
10:50:22FromGitter<alehander42> wtf
10:59:04*krux02_ quit (Read error: Connection reset by peer)
10:59:10*krux02__ joined #nim
11:01:01*ng0 joined #nim
11:02:00*krux02__ is now known as krux02
11:25:09*nolanv quit (Ping timeout: 246 seconds)
11:57:59Araqfoo.bar() is complex syntax sugar, unfortunately
11:58:44Araqand it requires to semcheck 'foo', that is not surprising IMO
12:01:39*kapil____ quit (Quit: Connection closed for inactivity)
12:01:51FromGitter<mratsim> oh that’s why we sometimes cannot use that syntax with templates
12:06:28Araq'o.x' means "if o has not field x, try x(x)"
12:06:47Araqand that doesn't work with 'untyped', how could it...
12:07:46FromGitter<mratsim> I don’t think it was with untyped templates
12:08:08Araqnever seen anything else where it fails
12:09:42*kapil____ joined #nim
12:30:27*Snircle joined #nim
12:32:25ZevvIts a bit of a gotcha. The 'why' is in the manual, but the error message does not really point you there
12:32:40Zevvluckily there's always #nim
12:34:34*krux02 quit (Ping timeout: 246 seconds)
12:36:49*Snircle_ joined #nim
12:37:27*Snircle quit (Ping timeout: 240 seconds)
12:37:58*krux02 joined #nim
12:43:02*Snircle joined #nim
12:44:19*Snircle_ quit (Ping timeout: 244 seconds)
12:44:41Araqit is a gotcha yes, it's also quite unfixable.
12:45:16Araqwell, there are proposals so that 'untyped' can be avoided and 'typed' used instead
12:48:29*Snircle_ joined #nim
12:52:04*Snircle quit (Ping timeout: 244 seconds)
12:57:37oprypinwhy am i getting this error `Error: 'destroy' or 'deepCopy' expected for 'override'` in 0.19?
12:57:37oprypinfor this line https://github.com/oprypin/nim-csfml/blob/c41b8f7b/src/csfml/private/system_gen.nim#L92 + https://github.com/oprypin/nim-csfml/blob/c41b8f7b/src/csfml/private/common.nim#L28
12:57:37oprypinis there information on the current situation with destructors?
12:58:30Araqthe syntax is now
12:58:38Araqproc `=destroy`(x: var T)
12:58:55Araqbut you also better overload `=` and `=sink`
12:59:27oprypinis there any way to use this in a way that is compatible with old Nim?
13:00:22Araqremove the 'destroy' annotation
13:00:28*masquino quit (Ping timeout: 245 seconds)
13:01:33Araqit never worked reliably previously and this feature is only now getting stable.
13:02:34*masquino joined #nim
13:03:17FromGitter<narimiran> (how) can i do something like `type MyRange = 5..50; for i in MyRange: ...`?
13:04:59FromGitter<narimiran> oh, it seems that i can do `for i in MyRange.low .. MyRange.high`
13:06:35PMunchYeah, you can of course also create an iterator for your type
13:10:32*vlad1777d joined #nim
13:10:41FromGitter<narimiran> PMunch: thanks, my first type-iterator :)
13:12:20PMunchSomething like that
13:14:25FromGitter<narimiran> PMunch: here is how i did it: http://ix.io/1vni/
13:15:45PMunchDoes that work?
13:15:57FromGitter<narimiran> it does :)
13:16:34FromGitter<Vindaar> @narimiran wait, but in your case `Range` within the iterator is *any* `typedesc`, no?
13:17:03FromGitter<narimiran> @Vindaar hmm, maybe :D
13:17:09PMunchYeah that's what I was curious about
13:17:45FromGitter<narimiran> ok, changed to PMunch's version
13:18:54PMunchAre you working on your AoC puzzle?
13:20:10FromGitter<narimiran> but of course :D
13:20:16PMunchThat range seemed familiar :P
13:20:34FromGitter<narimiran> my initial solution is probably the ugliest nim-code i've ever written
13:20:52FromGitter<narimiran> now i have nicer code. but wrong result :D
13:21:15PMunchMine seem to end up pretty simple, but not very optimized
13:21:26PMunchI should probably chuck them in a repo as well..
13:21:47FromGitter<Vindaar> mine are ugly and unoptimized. Does that mean I win? :D
13:22:42FromGitter<narimiran> @Vindaar only if it is worse than mine. and i assure you it isn't. (no, i won't show it to anyone ever)
13:23:51FromGitter<Vindaar> haha, I just accepted it and got rid of my pride :P
13:24:51FromGitter<Vindaar> well, ok. My solutions mainly end up being very verbose
13:25:32*nsf quit (Quit: WeeChat 2.3)
13:35:41FromGitter<alehander42> that's usually not bad
13:42:22*zakora joined #nim
13:48:59*platoff joined #nim
13:50:34FromGitter<narimiran> ok, i've managed to make my code a bit nicer: now i don't instantaneously vomit when i see it
13:52:15*endragor quit (Remote host closed the connection)
13:56:21*kobi7 joined #nim
13:56:31kobi7hi folks, has anyone used nimx here?
13:57:12kobi7I don't know how to set the android environment vars
13:58:07kobi7What should I set for NDK_PROJECT_PATH ?
14:00:16kobi7or if it's not an env var, how to set things up correctly?
14:03:22Araqdunno but it sounds like an Internet search will quickly give you the answer
14:03:36PMunchNDK_PROJECT_PATH is used by the Android compiler IIRC
14:04:40kobi7I follow the nimx nake instructions, but that variable is project specific I think.
14:05:09kobi7I'm very new to this
14:08:31kobi7(nimx is my first try on android)
14:08:53kobi7true, it is kind of offtopic
14:09:19PMunchI've gotten Nim with SDL to work on Android before
14:09:27PMunchBut that was before nimx was a thing
14:09:42PMunchNot entirely sure what changed between those projects
14:09:53PMunchMaybe you can find something that uses nimx?
14:15:11*endragor joined #nim
14:19:36*endragor quit (Ping timeout: 250 seconds)
14:26:31*nsf joined #nim
14:32:43kobi7good idea
14:32:51kobi7will pursue when i have some time.
14:32:53kobi7see you
14:32:54*kobi7 quit (Quit: Leaving)
14:46:11*Vladar quit (Remote host closed the connection)
14:48:14*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:53:38*Pisuke joined #nim
14:55:08*MyMind quit (Ping timeout: 250 seconds)
15:00:53*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:13:13*PMunch quit (Remote host closed the connection)
15:13:31*PMunch joined #nim
15:16:00*narimiran joined #nim
15:27:57*shadowbane quit (Remote host closed the connection)
15:28:22*shadowbane joined #nim
15:37:10*nsf quit (Quit: WeeChat 2.3)
15:37:55*gmpreussner quit (Ping timeout: 244 seconds)
15:43:54*gmpreussner joined #nim
15:44:49*endragor joined #nim
15:49:24*endragor quit (Ping timeout: 246 seconds)
15:49:49FromGitter<alehander42> how is aoc going
15:52:44narimiran@alehander42: officially (as the one who is promoting Nim leaderboard): great, we have over 100 players! unofficially: also nice, but it takes me so much time to write the solutions i'm satisfied with
15:53:34narimirani see that you solved day 5. for me, that one was the most interesting so far
15:54:48PMunchDay 5 wasn't that bad
15:55:01PMunchDay 6 was more interesting IIRC
15:55:37FromGitter<alehander42> yeah, 5 was fun for me, because it was easy to get big complexity using lang strings incorrectly
15:55:41FromGitter<alehander42> i tried it in several langs
15:55:50FromGitter<alehander42> and I almost always started with the wrong usage
15:56:05narimirani'm down to single-digit milliseconds for both parts of day5
15:56:11PMunchOh yeah, I just used delete from strutils, which is definitely not the best :P
15:56:50narimiranboth parts meaning the complete day5 is complete in that time. not each part.
15:57:29*stefanos82 quit (Remote host closed the connection)
15:58:33FromGitter<alehander42> I just used setLen :D :D
15:58:48PMunchBut then you chop the end of?
15:59:05FromGitter<alehander42> well I setLen(a.length - 1)
15:59:16FromGitter<alehander42> basically the same
15:59:19PMunchThat's my naïve solution day 5
16:00:26FromGitter<alehander42> hm, I compared with swapcase, as I started from a discussion of the crystal ppl solutions
16:00:36FromGitter<alehander42> 1) and 32 is smarter
16:00:41FromGitter<alehander42> `-` *
16:03:08*dddddd quit (Remote host closed the connection)
16:03:08PMunchOh yeah, using abs(ord-ord) == 32?
16:03:29FromGitter<alehander42> yes
16:08:07*floppydh quit (Quit: WeeChat 2.3)
16:08:26narimiranyou can use xor instead of abs, it should be somewhat faster
16:10:34*lritter joined #nim
16:13:01PMunchYeah I guess, but if I was going for speed I should've fixed the string delete part :P
16:17:13*endragor joined #nim
16:19:55*dom96_w joined #nim
16:21:14*Trustable joined #nim
16:23:37*endragor quit (Remote host closed the connection)
16:24:56*PMunch quit (Remote host closed the connection)
16:25:58*endragor joined #nim
16:28:34*stefanos82 joined #nim
16:30:28*endragor quit (Ping timeout: 250 seconds)
16:34:07narimirannow this is strange. if i define `var finite = {1 .. 50}`, i can do `for n in <array of ints>: finite.excl n` (n is int, not int16)
16:34:56narimiranbut when i move that to a function where the result is `set[(u)int16]`, then i cannot exclude `n` without first converting it to (u)int16 :/
16:38:54narimiranhmmm. if i just define my proc as `proc foo(x: myArray): auto` then everything is once again fine
16:53:49*endragor joined #nim
16:56:22*rockcavera quit (Remote host closed the connection)
17:07:28*Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com)
17:34:59*Snircle joined #nim
17:59:10*gangstacat quit (Quit: Ĝis!)
18:07:33*nsf joined #nim
18:18:46*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:20:17*Pisuke quit (Ping timeout: 268 seconds)
18:22:09Zevv\o/ todays stars are in
18:27:39*Pisuke joined #nim
18:30:35narimiranZevv: congrats! who are you on the leaderboard?
18:40:55*dddddd joined #nim
18:42:33*gangstacat joined #nim
18:44:39*rockcavera joined #nim
19:16:24*Snircle quit (Ping timeout: 268 seconds)
19:17:24Zevvsome anynymous halfway on the nim board :)
19:22:21*Vladar joined #nim
19:23:18*Snircle joined #nim
19:28:44*krux02 quit (Remote host closed the connection)
19:36:27*endragor quit (Remote host closed the connection)
19:40:28*platoff joined #nim
19:57:42*nsf quit (Quit: WeeChat 2.3)
19:58:32*lritter quit (Remote host closed the connection)
20:00:13xacehow do you view the nim aoc board?
20:01:08FromGitter<Vindaar> @xace: did you join it already? otherwise you can't I believe
20:06:12FromGitter<Vindaar> Anybody familiar with nimble being unable to find Nim's stdlib on travis?
20:06:57FromGitter<mratsim> uh? you don’t need to find it though
20:07:40FromGitter<Vindaar> Well, nimble tells me it fails to parse the nimble file, because it can't find the stdlib
20:07:42FromGitter<Vindaar> one moment
20:08:34FromGitter<Vindaar> https://travis-ci.org/bluenote10/NimData/jobs/464601261 ⏎ the irony is, it even explicitly says "last try in nim-master/lib", which is totally correct
20:12:33*endragor joined #nim
20:12:49*ng0 quit (Remote host closed the connection)
20:13:13*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:13:51*ng0 joined #nim
20:14:56FromGitter<mratsim> fun
20:15:46FromGitter<Vindaar> yup
20:17:06*endragor quit (Ping timeout: 250 seconds)
20:27:15*narimiran quit (Remote host closed the connection)
20:29:18*Trustable quit (Remote host closed the connection)
20:30:40*Snircle quit (Ping timeout: 264 seconds)
20:37:04FromGitter<Vindaar> Ok, I fixed it by adding the nim directory location to PATH with the full path, instead of just these weird "travis like" paths, which start from the local project
20:45:52FromGitter<timotheecour> @araq quick question if you’re here?
20:49:23*lritter joined #nim
20:55:08*theelous3_ joined #nim
21:01:01*zachk joined #nim
21:02:10*Snircle joined #nim
21:04:45*Snircle_ joined #nim
21:08:06*Snircle quit (Ping timeout: 268 seconds)
21:19:24*xet7 joined #nim
21:20:04*zakora quit (Quit: WeeChat 2.2)
21:40:19*Vladar quit (Remote host closed the connection)
21:45:06*resethard joined #nim
21:45:47*resethard quit (Client Quit)
21:56:33*martin__ joined #nim
22:01:32*zachk quit (Changing host)
22:01:32*zachk joined #nim
22:11:04*martin__ quit (Ping timeout: 250 seconds)
22:13:53*endragor joined #nim
22:18:26*endragor quit (Ping timeout: 250 seconds)
22:31:01xacevindaar: no i didnt join, i just wanted to peek on the problems and solutions and maybe learn a thing or 2
23:01:19*stefanos82 quit (Remote host closed the connection)
23:38:35*platoff joined #nim