<< 04-12-2018 >>

00:05:28*theelous3_ quit (Ping timeout: 245 seconds)
00:12:37FromGitter<arnetheduck> reading from a db means parsing the db and splitting it up into records that you then have to explode into an ast.. it's not a given that source code is that much more efficient, as long as you only have linear ops in the semcheck part
00:13:40FromGitter<arnetheduck> I had that as a distribution idea for `nlvm` though, that it could precompile the std lib and embed that into a single executable so it could be distributed without an accompanying folder.. it's a bit tricky though
00:14:01FromGitter<timotheecour> @yyc514 do you have a link?
00:14:32FromGitter<arnetheduck> `llvm` also gives you a jit, so the hot code reloading could be done without the dll tricks.. again, tricky, but doable
00:16:56FromGitter<timotheecour> also, it depends on impedence mismatch bw the db and the AST
00:19:06FromGitter<timotheecour> sqlite may be ill suited for storing certain types of objects (eg with nesting and repeated elements); maybe other db’s (document dbs like mongodb) or graph dbs could be more performant; but we still need to know what are the performance bottlenecks before doing anything
00:29:37*kapil____ joined #nim
01:00:38*jakob0094 quit (Remote host closed the connection)
01:07:03FromGitter<yyyc514> @timotheecour https://gist.github.com/yyyc514/403a645acfbab533687c7f76a361d3f1 something like that
01:07:21FromGitter<yyyc514> just makes a case statement to determine the type at runtime
01:09:53FromGitter<yyyc514> i have another macro that creates types so it just rolls up all the different types available into a compile time seq
01:12:08*lritter quit (Ping timeout: 245 seconds)
01:13:12*lritter joined #nim
01:21:16*zachk quit (Quit: Leaving)
01:22:53*MightyJoe quit (Remote host closed the connection)
01:32:23*vlad1777d joined #nim
01:59:06*lritter quit (Ping timeout: 250 seconds)
02:04:17*king3vbo joined #nim
02:24:14*couven92 quit (Ping timeout: 250 seconds)
02:49:00*Tyresc quit (Quit: WeeChat 2.3-dev)
03:07:42*banc quit (Quit: ZNC - http://znc.in)
03:17:24*dddddd quit (Remote host closed the connection)
03:24:37*banc joined #nim
04:27:03*narimiran joined #nim
04:51:58narimirangood morning @Vindaar, are you ready? :)
04:58:46FromDiscord_<technicallyagd> Morning!
04:58:57FromDiscord_<technicallyagd> 1 min to go
04:59:28*endragor joined #nim
05:17:00*nsf joined #nim
05:52:42FromDiscord_<technicallyagd> lol, strong typing gets really annoying today
05:57:12narimiraneverything gets really annoying today ;) i've completely failed, and i plan to take a rest before starting all over again
05:59:34FromDiscord_<technicallyagd> yeah, I was on the brink of breaking down as well
06:00:21FromDiscord_<technicallyagd> I really should take the time to read through the whole description
06:10:01FromGitter<kdheepak> I spent sooo long on this one (doing it in Python). Still working on a nim solution. I feel so dumb today.
06:13:27FromGitter<timotheecour> what’s the context? was there some coding challenge?
06:13:40FromDiscord_<technicallyagd> Yeah adventofcode.com
06:14:38FromDiscord_<technicallyagd> It's has a speed coding competition layer
06:47:53FromDiscord_<technicallyagd> Is there a way to see how much time the compiler spent on compiling each module?
07:13:42*narimiran quit (Ping timeout: 250 seconds)
07:32:47FromGitter<alehander42> @yyyc514 ah nice, I also have something like this but i call it genCase
07:45:56*dddddd joined #nim
07:57:58*tiorock joined #nim
07:57:58*tiorock quit (Changing host)
07:57:58*tiorock joined #nim
07:57:58*rockcavera quit (Killed (barjavel.freenode.net (Nickname regained by services)))
07:57:58*tiorock is now known as rockcavera
08:03:07*Vladar joined #nim
08:04:50*krux02 joined #nim
08:06:21edcragghi, is there any convenience function to get the item in a table (or array even) by maximum value? i've been looking around but i can't see one
08:08:18*stefanos82 joined #nim
08:08:44*kapil____ quit (Quit: Connection closed for inactivity)
08:15:47*endragor quit (Remote host closed the connection)
08:16:06*dddddd quit (Ping timeout: 250 seconds)
08:17:47*endragor joined #nim
08:18:14FromGitter<mratsim> in countTable there should be a max
08:18:41FromGitter<mratsim> https://nim-lang.org/docs/tables.html#largest%2CCountTableRef%5BA%5D
08:19:41FromGitter<mratsim> otherwise fold(low(T), max(a, b), yourseq) don’t remember the parameter orders
08:20:29FromGitter<mratsim> yourseq.fold(max(a, b), low(YourType))
08:20:48FromGitter<mratsim> foldl*
08:28:54*dddddd joined #nim
08:30:17*endragor quit (Remote host closed the connection)
08:31:36*endragor joined #nim
09:08:42*floppydh joined #nim
09:10:59*couven92 joined #nim
09:21:20*stefanos82 quit (Remote host closed the connection)
09:25:52*ftsf joined #nim
09:39:37*nandraj joined #nim
09:40:14nandrajHi
09:47:52*zakora joined #nim
09:48:39*stefanos82 joined #nim
09:52:17Araqnandraj, welcome
09:52:49nandrajThanks.
09:53:04nandrajJust started to use Nim
09:53:10*xace quit (Ping timeout: 250 seconds)
09:53:19nandrajAfter python
09:56:06*PMunch_ joined #nim
09:56:24*PMunch_ is now known as PMunch
09:57:15*nandraj is now known as Nandraj
10:00:09*dom96_w joined #nim
10:02:14*xace joined #nim
10:28:56*PMunch quit (Remote host closed the connection)
10:29:14*PMunch joined #nim
10:32:34FromGitter<mratsim> welcome
10:35:54*platoff joined #nim
10:36:24FromGitter<alehander42> what are your impressions
10:55:00*noonien quit (Quit: Connection closed for inactivity)
11:01:08FromGitter<timotheecour> welcome :)
11:03:00FromGitter<Vindaar> @narimiran for once I stayed in bed. Colleague got his PhD yesterday and my professor always has a party that evening at his place. Will do it after lunch. Back tomorrow morning :)
11:05:04FromGitter<narimiran> hey @Vindaar! i wish i could swap with you :) i was awake (before my alarm clock) from 5:10, and all for nothing — i've overcomplicated my solution and took me lots of trial and error to finally get the correct solution
11:06:39FromGitter<Vindaar> Ouch, you need sleep! Or were you so exited for the challenge? ;)
11:07:16FromGitter<narimiran> i have no idea what's going on, but i guess today i'll be in my bed at 9 pm :D
11:08:06FromGitter<narimiran> btw, for those who are not involved: Nim private leaderboard for AoC has more than 100 members!! (i am very pleasantly surprised)
11:08:24FromGitter<Vindaar> Sounds like a good plan. I try to go to bed early every day so that I can stay awake after the challenge is done. But I always stay up late anyways :|
11:16:14FromGitter<mratsim> I guess after the standard lib we need the aoclib
11:17:21FromGitter<narimiran> @mratsim even just tuple unpacking in for-loops would already make our solutions much nicer :)
11:18:53FromGitter<mratsim> oh yeah tuple unpacking would be nice
11:25:32*CcxWrk quit (Read error: Connection reset by peer)
11:25:46*CcxWrk joined #nim
11:26:11Araqfor a, b in items() ?
11:26:27Araqthere was a syntax for it...
11:27:36*Ven`` joined #nim
11:27:52FromGitter<narimiran> Araq: this: https://github.com/nim-lang/Nim/issues/7486
11:34:46Araqyeah, see? I'm right
11:36:49FromGitter<narimiran> true, i forgot about `items`, but as mentioned there, it doesn't solve the problem when you want to have both index and tuple unpacking.
11:39:30*freddy92 joined #nim
11:42:56*fredrik92 quit (Ping timeout: 244 seconds)
11:52:55*ng0 joined #nim
12:11:09AraqI found out why IC is slow
12:11:36Araqthe AST is serialized multiple times
12:14:09*Ven`` quit (Ping timeout: 268 seconds)
12:15:27*Ven`` joined #nim
12:23:11FromGitter<mratsim> @narimiran important comment: https://github.com/nim-lang/Nim/issues/7486#issuecomment-444081693
12:23:33edcraggmratsim: ah cool, thanks i'll have a look. didn't realise nim had fold either, nice
12:25:05edcraggi'm also new and liking nim a lot so far, coming from C, python and rust as main languages, it's a great middleground, the type system is reassuringly handy so far
12:27:19FromGitter<mratsim> if you like functional programming, this has a lot of utilities: https://github.com/vegansk/nimfp
12:27:38FromGitter<mratsim> or zero-functional to use that on base seqs: https://github.com/zero-functional/zero-functional
12:28:02FromGitter<mratsim> or my own lib if you want to work with optimised for loop: https://github.com/numforge/loop-fusion
12:30:33PMunchUhm, Error: unhandled exception: invalid integer: 0: [ValueError]
12:35:27PMunchOh never mind
12:48:40edcraggmratsim: very fancy :) ta
12:48:44edcraggany monads? (kidding of course :P)
12:49:45FromGitter<mratsim> here you go: https://github.com/unicredit/emmy
12:49:58FromGitter<mratsim> Monoid, Groups, Euclidean rings
12:50:36edcragghmmm
12:51:12FromGitter<mratsim> implementing a lift proc is easy as well: https://github.com/numforge/laser/blob/master/laser/private/lift.nim
12:51:27FromGitter<mratsim> I’m trying to find again the haskell like instance package
12:51:52*Vladar quit (Remote host closed the connection)
12:51:59FromGitter<mratsim> ah, here you go: Functors - https://github.com/nigredo-tori/classy
13:02:06*CcxWrk quit (Ping timeout: 250 seconds)
13:06:31*PrimHelios joined #nim
13:09:24FromGitter<alehander42> wow, impressive :D
13:27:52*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:31:04*zakora quit (Quit: WeeChat 2.2)
13:31:23*jakob0094 joined #nim
13:31:53*Vladar joined #nim
13:37:13*nsf quit (Quit: WeeChat 2.3)
13:42:23*platoff joined #nim
13:45:58FromDiscord_<technicallyagd> Ah, so private leader board can have more than 100 people
13:46:27FromDiscord_<technicallyagd> Ah, so private leader board for AoC can have more than 100 people
13:55:37FromGitter<zacharycarter> Not sure if this is an issue or not - it doesn't appear to cause any issues during runtime - but I figured I'd share it nonetheless - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c0687586c3c565096d175d6]
13:56:51FromGitter<narimiran> @technicallyagd the limit is 200, IIRC
14:03:40*eubn quit (Quit: ZNC 1.6.5+deb2build2 - http://znc.in)
14:05:31FromDiscord_<technicallyagd> @narimira cool! wonder if we can reach that limit this year.
14:07:45*PrimHelios quit (Ping timeout: 246 seconds)
14:08:01FromGitter<narimiran> well, even this (103 currently) is impressive!
14:08:10*ng0 quit (Quit: Alexa, when is the end of world?)
14:10:14*lritter joined #nim
14:11:37FromGitter<arnetheduck> hey, @Araq, @krux02 - any thoughts on ETA for https://github.com/nim-lang/Nim/issues/9494 fix? it's causing us some grief in an integer library where we put in an ugly workaround - the kind that scales poorly
14:12:56*endragor quit (Remote host closed the connection)
14:14:11*PrimHelios joined #nim
14:30:16*Trustable joined #nim
14:30:30FromDiscord_<technicallyagd> I wrote a sequence/object unpacking/destructuring library to help with AoC. Just gonna leave it here if anyone is interested. https://github.com/technicallyagd/unpack
14:32:44*endragor joined #nim
14:36:10FromGitter<narimiran> @technicallyagd re your nimble submission: you need to put that link in the `url` field
14:36:20FromDiscord_<technicallyagd> @narimiran yeah, I think we only had 91 people yesterday
14:36:41FromDiscord_<technicallyagd> @narimiran oh, ok
14:37:08*endragor quit (Ping timeout: 246 seconds)
14:37:48FromGitter<narimiran> see some other packages in that .json to get an idea
14:40:18FromGitter<zacharycarter> more things to love about macOSX - the default installation of llvm / clang doesn't include address sanitizer support for leak detection, in newer versions of the operating system
14:40:30FromGitter<zacharycarter> so you're forced to install a newer non-apple version of llvm
14:40:49FromGitter<zacharycarter> but I finally got asan dumps of my leaking processes to share with bgfx author
14:45:50*Notkea quit (Ping timeout: 244 seconds)
14:47:50FromDiscord_<technicallyagd> @narimiran done, thank you. I just `nimble publish` in the first attempt, everything seemed auto-magical so I didn't realize you have to fill in info in nim-lang/packages fork as well.
14:51:22*Vladar quit (Remote host closed the connection)
14:55:16king3vbo@technicallyagd Thanks for the link, I can see that package being helpful for AoC challenges
14:56:28*Vladar joined #nim
14:56:54*CcxWrk joined #nim
14:58:36FromGitter<zacharycarter> technicallyagd: awesome work!
14:59:03FromGitter<zacharycarter> does it support the js backend too?
14:59:30FromGitter<zacharycarter> looks like it should have no problem doing so...
15:00:00FromGitter<zacharycarter> now we just need a spread operator :P
15:00:20*Perkol joined #nim
15:01:44*kapil____ joined #nim
15:02:01*ofelas quit (Remote host closed the connection)
15:08:12FromGitter<alehander42> @technicallyagd : very nice work
15:08:26FromDiscord_<technicallyagd> @king3vbo you're welcome, it's indeed a direct consequence of the frustration caused by AoC tasks
15:08:29FromGitter<alehander42> still, I think there can be a better API
15:08:38FromGitter<alehander42> the name = otherName thing
15:08:40FromGitter<alehander42> is very confusing
15:09:06FromGitter<alehander42> (or does it actually mean otherName = name ) ?
15:09:09FromDiscord_<technicallyagd> @alehander42 yeah... I hesitated for quite a while there
15:09:49FromDiscord_<technicallyagd> @alehander42 I could switch them up though
15:10:33FromDiscord_<technicallyagd> @zacharycarter I haven't tried on js backend yet, don't see any reason why it would not work though.
15:10:58FromGitter<alehander42> @technicallyagd : and overally if we can have assigned value being left of the rvalue
15:11:02FromGitter<alehander42> it would be best
15:11:12FromGitter<alehander42> e.g. `(d, e) <- someSeq`
15:12:12FromGitter<alehander42> I have something similar in https://github.com/alehander42/gara
15:12:14*narimiran joined #nim
15:12:20FromGitter<alehander42> maybeMatches, but its more verbose
15:12:27FromGitter<alehander42> because it returns an option
15:12:50FromGitter<alehander42> however, maybe we can combine them with your lib and have more powerful direct unpacking
15:13:59FromDiscord_<technicallyagd> Sure, I will try making it work with <-
15:14:39FromDiscord_<technicallyagd> I preferred `.unpack(x,y)` only because it took me less key stroke with auto-complete
15:15:09FromGitter<alehander42> e.g. ⏎ ⏎ [(b: 1), *(b: @others)] <- [(b: 1), (b: 3), (b: 5)] ⏎ echo others # [(b: 3), (b: 5)] [https://gitter.im/nim-lang/Nim?at=5c0699fd1c439034af190b63]
15:15:47FromGitter<alehander42> (if we combine gara & <-/unpack, we can use most of the pattern matching niceties for unpacking)
15:20:06narimiranthat sounds nice
15:20:12*Perkol quit (Ping timeout: 272 seconds)
15:21:22*krux02 quit (Ping timeout: 246 seconds)
15:22:23*seni joined #nim
15:31:27*gangstacat quit (Quit: Ĝis!)
15:34:15*Perkol joined #nim
15:34:17*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:36:39*ftsf quit (Ping timeout: 246 seconds)
15:36:58FromGitter<mratsim> @zacharycarter Apple doesn’t include OpenMP as well in OSX (aka, use Grand Central Dispatch). So you need to use GCC or upstream LLVM compiled from source.
15:38:42*endragor joined #nim
15:39:58*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:41:13*PMunch quit (Remote host closed the connection)
15:43:10*Trustable quit (Remote host closed the connection)
15:43:18*endragor quit (Ping timeout: 250 seconds)
15:45:28FromGitter<arnetheduck> why is it that var parameters cannot be captured? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c06a1188fa4333e393af305]
15:46:55leorizein `devel` there's an error message saying that it messes with memory safety so it's forbidden afair
15:47:11*Tyresc joined #nim
15:54:05FromGitter<alehander42> @arnetheduck aren't captured args just copied somewhere? how would that work with var (just speculating)
15:54:06*gangstacat joined #nim
15:54:36narimirani have a `Table[int, array[60, int]]` is there a way to simplify `var bleh: array[60, int]; myTable[key] = bleh`?
15:55:20*floppydh quit (Quit: WeeChat 2.3)
15:55:33Araqnot really
15:56:40AraqmyTable[key] = [0] &* 60
15:56:55Araqbut we don't have a &* operator
15:57:05FromGitter<mratsim> lol for a moment I stopped
15:57:21FromGitter<arnetheduck> @alehander42 well, that code is the moral equivalent of: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c06a3e0500e8e37285c15c5]
15:57:39narimiran@mratsim you're not the only one :)
15:57:45FromGitter<arnetheduck> (the echo was wrong in the example, but that's beside the point)
15:58:15FromGitter<mratsim> otherwise @miran: ⏎ ⏎ ```type array60 = array[60, int] ⏎ myTable[key] = array60()``` [https://gitter.im/nim-lang/Nim?at=5c06a4179aec405095c71738]
15:58:35FromGitter<mratsim> actually it might not work with arrays
15:59:01Araqarnetheduck: hiding the 'var' in a tuple is not supposed to change anything
15:59:35narimiran@mratsim: "Error: object constructor needs an object type" it seemed too good to be true :)
15:59:47FromDiscord_<technicallyagd> @mratsim make a proc called array60 and return array[60,int] lol
16:00:28FromGitter<alehander42> you can have initArray(n: int) template which makes block: with blah
16:00:47FromGitter<arnetheduck> @narimiran ⏎ ⏎ ```proc empty(T: typedesc): T = discard ⏎ myTable[key] = empty(array[60, int)``` [https://gitter.im/nim-lang/Nim?at=5c06a4afa6c29a1037e1face]
16:00:53narimiran@technicallyagd that would make it like my yesterday's attempt to use template, and in the end i saved whopping 2 lines :D
16:00:58FromGitter<alehander42> m[key] = initArray(60)
16:01:02FromGitter<alehander42> or even
16:01:19FromGitter<alehander42> m[key] = initArray60 (0)
16:01:29FromGitter<alehander42> ugh `initArray60 ()`
16:01:37FromGitter<mratsim> I’d like a `&*` operator in Nim sugar. Python uses [0] * 30 a lot
16:01:47narimiran`initArray` seems like most idiomatic solution
16:01:48FromDiscord_<technicallyagd> @narimiran lol
16:02:05FromGitter<mratsim> initArray exists?
16:02:09narimirannope
16:02:35FromGitter<mratsim> @Araq do you agree on the `&*` name?
16:02:40FromGitter<mratsim> in Nim sugar
16:02:56FromGitter<arnetheduck> @alehander42 you need to pass `int` as well for an array
16:02:59FromGitter<mratsim> maybe with initArray alias
16:03:07FromGitter<mratsim> or initArrayWith*
16:03:20FromGitter<arnetheduck> `empty` solves that generically, not just for arrays...
16:03:37narimiran@mratsim can you give some examples where you would use `&*`?
16:04:08narimiranbtw, this problem of mine would be in python be solved by using defaultdict ;)
16:04:12FromGitter<mratsim> [0] &* 10 to initialize an array with 10 zeros
16:04:42FromGitter<mratsim> or [1, 2] &* 5 to initialize an array [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]
16:04:48FromGitter<alehander42> @arnetheduck I didn't know of empty, it sounds better probably
16:05:06FromGitter<alehander42> @mratsim why not just repeat([0], 10)
16:05:13narimiraneh, zeros are poor example, because i thought "why don't you do it with `array[10, int]`, but non-zero values make kinda sense
16:05:14FromGitter<alehander42> we already have a repeat for seq/string
16:05:18FromGitter<mratsim> repeat creates a seq
16:05:35FromGitter<mratsim> to mimic Python `*` operator.
16:05:44FromGitter<alehander42> yeah, but repeat *is* `*`
16:05:45FromGitter<mratsim> and he suggested `&*`
16:05:54FromGitter<alehander42> hm
16:05:59FromGitter<arnetheduck> @Araq, I don't understand you comment - I just used `tuple` to show how captures are implemented
16:06:51FromDiscord_<technicallyagd> does `*` do anything with arrays now?
16:07:18FromDiscord_<technicallyagd> Would there be any problem if we just use `[0] * 60`
16:07:21FromDiscord_<technicallyagd> Would there be any problem if we just use `[0] * 60`?
16:07:24FromGitter<alehander42> yeah, in this case why not just overloading `*`, technicallyagd is right
16:07:45narimiranone might say... he is technicallycorrect!
16:07:55*narimiran shows himself out
16:08:07FromDiscord_<technicallyagd> best kinda correct!
16:08:13*dom96_w joined #nim
16:09:56FromDiscord_<technicallyagd> but seriously, I think it would be nice to just mimic python's syntax here, since it's familiar to most people.
16:10:08FromDiscord_<technicallyagd> but seriously, I think it would be nice to just mimic python's syntax here, since most people is familiar with it.
16:10:20FromDiscord_<technicallyagd> but seriously, I think it would be nice to just mimic python's syntax here, since most people are familiar with it.
16:10:43narimiran(every your edit is another message for us on irc ;))
16:11:14FromDiscord_<technicallyagd> LOL sorry for the bad grammar then.
16:11:54*Perkol quit (Ping timeout: 250 seconds)
16:13:50FromGitter<Vindaar> simple and works :) https://gist.github.com/Vindaar/6d0e550e9b8944b30f6b030deda271fc
16:16:25FromDiscord_<hotdog> Any idea why this would happen:
16:16:28FromDiscord_<hotdog> /usr/bin/ld: stdlib_system.c.o: in function `systemDatInit000': undefined reference to `NTI_hmZoNQaqzZALvVp0rE7faA_'
16:17:13FromDiscord_<hotdog> Can't get a small example to reproduce it, but it keeps happening in a fairly large program
16:19:16Araq[0] * 60 == [0], that's why...
16:19:29leorizehotdog: have you tried cleaning the nimcache?
16:19:42Araq[0, 1, 2] * 60 == [0, 60, 120]
16:20:09Araq&* is a repeated concatenation, not a multiply
16:21:36FromDiscord_<hotdog> @leorize yeah, and tried stable and devel
16:22:00FromGitter<arnetheduck> @Araq, should i open a bug about `var` capture, or is it intended that way? ie if the capture leaks outside the context of the var, it's kind of dangerous..
16:22:40FromGitter<arnetheduck> but then it should be disallowed for local `var`'s as well
16:26:05*Perkol joined #nim
16:26:57Araqwell it's intended that it doesn't compile
16:27:06Araqand what are local vars?
16:30:28FromDiscord_<technicallyagd> @Vindaar That is cool! You can even do this https://gist.github.com/technicallyagd/9626195fee66d3ea71aaee2f2234ee71
16:33:06FromDiscord_<technicallyagd> @Araq do you mean the `*` operator's connotation in general? Or is that how it's going to be implemented in the future?
16:33:15FromGitter<arnetheduck> ```code paste, see link``` ⏎ ⏎ this compiles and effectively does the exact same thing [https://gitter.im/nim-lang/Nim?at=5c06ac4a9f38cc0fd5a40da7]
16:33:54FromGitter<arnetheduck> or no? I always forget how var is handled in that case
16:35:23FromGitter<arnetheduck> a nevermind, my bad
16:35:47FromGitter<arnetheduck> that one will modify a local copy, right?
16:37:39FromGitter<Vindaar> @technicallyagd nice, indeed! Added the same to my gist after I saw @mratsim's comment about that :)
16:38:20FromDiscord_<hotdog> How can I figure out what is causing stdlib_system.c to generate incorrectly?
16:40:07FromDiscord_<technicallyagd> @Vindaar would there be any difference between using `array.len` and `static[int]` ?
16:40:30FromDiscord_<technicallyagd> in terms of compilation speed
16:41:43FromGitter<arnetheduck> so.. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ if I do that, c will capture y from x's stack and.. what happens when the returned capture is called? [https://gitter.im/nim-lang/Nim?at=5c06ae47464b6c0fd68dfe03]
16:41:48leorizehotdog: only big programs face this problem? can you try to strip your program down to pieces and see if there can be any reproducible snippet?
16:42:28leorizetechnicallyagd: shouldn't be any
16:42:48FromGitter<arnetheduck> if I get all the pointers right, it'll have a pointer to x's stack that it writes to (invalidly), and xxx remains unmodified
16:43:10FromGitter<Vindaar> @technicallyagd well, even if there was a difference, the access to `len` of a should hardly matter time wise. But your solution is clearer, imo
16:43:54FromDiscord_<technicallyagd> @Vindaar @leorize I see, thank you.
16:44:25FromDiscord_<hotdog> @leorize I've tried to get a simple reproduction, but even small changes to the program make it go away. And then a while later it reappears
16:44:55FromDiscord_<hotdog> I'll keep on and see if I can get a small example
16:49:41FromDiscord_<hotdog> If I switch to js output I get `Error: internal error: genTypeInfo(tyEmpty)`. Not sure what's causing that
16:51:55FromGitter<zacharycarter> @mratsim - annoying
16:52:24leorizehotdog: have you tried the c++ generator?
16:53:49FromDiscord_<hotdog> leorize: Yeah cpp gives same error as c - `/usr/bin/ld: stdlib_system.cpp.o: in function `systemDatInit000()': undefined reference to `NTI_hmZoNQaqzZALvVp0rE7faA_'`
16:54:40leorizeweird, maybe check the cpp file to see what is `NTI_<some hash>_`?
16:56:55FromDiscord_<hotdog> There are two references to it, `extern TNimType NTI_hmZoNQaqzZALvVp0rE7faA_;` and `NTI_77YVzYb2AOu2vP0iI0b8Dw_.base = (&NTI_hmZoNQaqzZALvVp0rE7faA_);`
17:02:45FromDiscord_<hotdog> What is TNimType? Can't find much about it
17:08:06leorizemaybe Araq can help with that
17:11:10FromGitter<arnetheduck> `TNimType` is runtime type information - if you haven't already, clear your nim cache and try again - if it still fails, it's probably a bug where it's not getting generated properly
17:11:24FromGitter<arnetheduck> ^ @hotdog
17:15:08FromDiscord_<hotdog> arnetheduck: thanks - Just cleared cache but issue still there
17:15:24FromDiscord_<hotdog> Is there any way I can find which type is causing it?
17:15:58*PrimHelios quit (Quit: Leaving)
17:20:24leorizehotdog: try searching for the hash in the .cpp files
17:21:30FromDiscord_<hotdog> The only references to it are the two I pasted above
17:27:04leorizeyou mean looking for 'hmZoNQaqzZALvVp0rE7faA' in the cache only result in two occurrences?
17:27:47FromDiscord_<hotdog> leorize: Yeah
17:27:49leorizethen that'd mean the type info was generated for a type that doesn't exist somehow...
17:27:56FromDiscord_<hotdog> Well two for c, two for cpp
17:28:02FromDiscord_<hotdog> Pretty much identical
17:29:30FromDiscord_<hotdog> @leorize: I do have a lot of generic types/procs going on
17:31:24*PrimHelios joined #nim
17:31:31leorizecan you check in which function was that typeinfo object being assigned to?
17:31:54leorizehmm, during initialization of the system module
17:32:18*nsf joined #nim
17:32:35*PrimHelios quit (Client Quit)
17:32:52shashlickam trying gprof - its not quite as helpful to tell what to optimize in my nim code
17:34:31FromDiscord_<hotdog> @leorize: you mean `systemDatInit000()`?
17:35:24*PrimHelios joined #nim
17:35:57*PrimHelios quit (Client Quit)
17:36:46leorizewait, can you search for this hash '77YVzYb2AOu2vP0iI0b8Dw'?
17:38:54FromGitter<alehander42> shashlick: I used perf today, and it helped me after a bit battling
17:39:03FromGitter<alehander42> what do you want to find out? hotspots?
17:39:38shashlicktrying to optimize nimterop a bit - it's slower than i'd like
17:39:45shashlickis pegs faster than nim-regex
17:40:00narimiranshashlick: in my limited experience, it was
17:40:15FromGitter<matrixbot> `rad_wagon` Hey all, I'm having an issue with threads and channels. Here (https://pastebin.com/wFwMQzLj) is a pastebin. The compiler is giving an error that `Channel` is an invalid type to assign to a `var` Not exactly sure what the proper way to handle this since most of the examples I've seen are this way
17:40:16narimiranbut i guess it might be on case-by-case basis
17:40:27shashlickok i'm wondering if i should move to pegs or compile my regex patterns at compile time
17:41:53narimiranshashlick: sorry, i somehow mis-read and thought you're asking about nre. i didn't use pegs
17:42:11FromDiscord_<hotdog> @leorize: that gives more results, referencing `tySequence_77YVzYb2AOu2vP0iI0b8Dw*1`
17:42:16FromDiscord_<hotdog> Where did that hash come from?
17:42:22shashlicknarimiran: no worries, will try it out
17:45:39leorizehotdog: that hash come from the assignment you found earlier
17:46:32FromGitter<Vindaar> @rad_wagon: Your channel needs specific type! E.g. `Channel[string]`
17:49:20*kapil____ quit (Quit: Connection closed for inactivity)
17:50:14FromDiscord_<hotdog> @leorize ah yeah I see. So is it likely this problematic type is in a seq?
17:50:32leorizeyea
17:51:31FromGitter<matrixbot> `rad_wagon` > <@gitter_vindaar:matrix.org> @rad_wagon: Your channel needs specific type! E.g. `Channel[string]` ⏎ ⏎ Ah, thanks! I then see that the compiler tells me that my `channel.open()` call has no type. Shouldn't the type be infered from the `var` declaration if I declare it like `var channel: Channel[string]` ?
17:51:42*zachk joined #nim
17:53:07*zachk quit (Changing host)
17:53:07*zachk joined #nim
17:53:58leorizewhy is there a matrixbot on gitter? :P
17:55:29*kapil____ joined #nim
17:56:02FromGitter<Vindaar> rad_wagon: Not entirely sure, but I reckon the error you see on `channel.open()` is that you write `discard` before it. Thus the compiler is telling you that `channel.open()` has no type, meaning it doesn't return anything. Remove the `discard` and it'll work
17:58:31FromDiscord_<hotdog> @leorize: thank you so much for your help! I think I've narrowed it down to a few troublesome type definitions that may be causing it
17:59:05FromDiscord_<hotdog> I'm going to carry on tomorrow and see if I can get a small reproducible example, and fix the issue
17:59:18leorizeyou're welcome :)
18:00:41*junland quit (Quit: Disconnected.)
18:01:14*junland joined #nim
18:02:56FromGitter<matrixbot> `rad_wagon` > <@gitter_vindaar:matrix.org> rad_wagon: Not entirely sure, but I reckon the error you see on `channel.open()` is that you write `discard` before it. Thus the compiler is telling you that `channel.open()` has no type, meaning it doesn't return anything. Remove the `discard` and it'll work ⏎ ⏎ Works! Thanks!
18:03:13FromGitter<Vindaar> happy to help :)
18:09:26narimiran@Vindaar less helping others, more AoC solving! :P
18:10:02FromGitter<arnetheduck> what's the best way to get a reference to an item in a list? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c06c2fa43c68b3727fca2a2]
18:11:29*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:12:35narimiran@arnetheduck ` var x = addr v[1]; x[] = 42`?
18:13:42shashlickAraq: I didn't see much improvement in speed going from closure to proc but they are procs inside a proc
18:13:55FromGitter<arnetheduck> @narimiran thanks, that's a good one, though it's easy to overlook / forget the `addr`
18:14:06shashlick0.3 seconds reduction from 8 seconds
18:15:22FromGitter<arnetheduck> shashlick, not sure what you're doing, but generally closures can get inlined just like normal functions when enough information is available to the compiler..
18:16:19FromGitter<arnetheduck> for example, as long as the closure doesn't escape its context there "should" be no difference between a closure call and a regular call
18:17:27*Perkol quit (Ping timeout: 240 seconds)
18:18:01FromGitter<arnetheduck> conversely, if the problem requires an escaping closure, any alternate solution will require you to manually do what the closure did - or it didn't require it after all and you were just sloppy :)
18:18:52FromGitter<arnetheduck> (there are some specific cases where that doesn't apply)
18:19:29FromGitter<Vindaar> @narimiran :D will head home soon and it's AoC time :)
18:20:06narimiran@Vindaar you better! :P and tomorrow morning you'll be ready?
18:20:15FromGitter<Vindaar> Yes, I will!
18:20:34narimiran:)
18:23:31*endragor joined #nim
18:28:46FromDiscord_<technicallyagd> @alehander42 I have added the <- syntax to unpack https://github.com/technicallyagd/unpack let me know how you feel about it.
18:29:45shashlickthanks @arnetheduck
18:30:02narimiranat one point in readme you have `<--` is this a typo, or is it valid (and means something different than `<-`)?
18:31:03shashlick@arnetheduck: here's what i'm doing - https://github.com/genotrance/nimterop/blob/master/nimterop/grammar.nim#L5
18:32:55*theelous3_ joined #nim
18:33:57narimiranok, now i see in the tests: "<-- should assign data to existing variables"
18:34:40*nsf quit (Quit: WeeChat 2.3)
18:38:38shashlickis @nitely here?
18:44:05FromGitter<alehander42> @techicallyagd oh looks much better
18:44:19FromGitter<alehander42> is it possible to do for let the same as for `[var d2, e2] <- someSeq`
18:44:43FromGitter<alehander42> and then `[a, b] <- ` can be for existing variables: more uniform
18:44:50FromGitter<alehander42> and easy to sport let declarations still
18:45:12narimiran@technicallyagd 'unpack' looks really nice! will follow its development
18:45:55FromDiscord_<technicallyagd> @narimiran Thank you! 😄
18:46:54FromDiscord_<technicallyagd> @alehander42 unfortunately `[let d2, e2] <- someSeq` causes compile error
18:47:06narimiranunpack + gara = very powerful combo
18:47:15FromDiscord_<technicallyagd> That's why I had to use `<--` for assignment
18:47:31FromGitter<alehander42> yeah it makes sense
18:48:06FromGitter<alehander42> narimiran, I think `<-` can be made to work with gara, but it would need to use `@name` for captures(variables)
18:48:44shashlickhow come you cannot store a Regex object in nim-regex? if I put it into an object or seq, it stays uninitialized and unusable
18:48:48FromDiscord_<technicallyagd> Because I think assignment will be used less often, so making people to type one more repetitive key stroke seemed reasonable
18:48:59*abm joined #nim
18:49:21narimiran@alehander42 gara already uses `@name`, so that would be consistent. (i haven't used that feature just yet)
18:49:54narimiranshashlick: code example please?
18:51:35FromDiscord_<technicallyagd> Lol, I haven't got time to check out what gara does. Will definitely do that later. I got to go now. see you guys later.
18:52:15FromGitter<arnetheduck> @shashlick, doesn't look like you're actually capturing anything in there (on a very quick look), so it's basically equivalent to an indirect function call (ie call a function through a pointer).. you could move those closures to stand-alone functions and it wouldn't be any different
18:52:46shashlickso I don't get any performance gains or losses in either case
18:53:03shashlick@arnetheduck - I just want the strings and procs adjacent
18:55:37shashlicknarimiran: never mind, figured out my mistake
18:55:44narimiran:)
18:56:05FromGitter<alehander42> @narimiran @techicallyagd well the problem is that gara does the capturing itself, so it would have to expose this directly as a capture(input, pattern) ⏎ which can be called by into pattern <- input ⏎ ⏎ so most work would be to expose this `capture` and add support for tweaking let/var directly into the patterns [https://gitter.im/nim-lang/Nim?at=5c06cdc543c68b3727fceb91]
18:56:31FromGitter<alehander42> I am not sure if there is a way to make that without it being inside gara's internals
18:56:53shashlicknarimiran: i think the problem i have is that if I just say var rgx: Regex, i have no way to check if that regex is initialized or not
18:57:14FromGitter<alehander42> otherwise maybe just simpler unpacking with `<-` being separate from gara is cool too, I dont know
18:57:20Araqyay, from 25s down to 4s
18:57:27Araqthat's some progress.
18:57:55Araqnow if we can get it down to 0.4s we've won
18:58:07FromGitter<alehander42> how much is it without incremental?
18:58:12Araq4s :P
18:58:16FromGitter<alehander42> haha
18:58:19narimiran:D :D
18:58:37Araqbut I did no low level optimizations yet
18:58:42Araqand the logic is still incomplete
18:58:43FromGitter<alehander42> your pc is more powerful than mine!
18:59:17Araqbut I think it's fair to say we are now at "in the worst case the cache doesn't hurt"
19:02:34*endragor quit (Remote host closed the connection)
19:05:38FromGitter<alehander42> wirth's law: now we can write way slower/more complex macros :D
19:06:20shashlickoh man what an improvement - i was compiling regex patterns thousands of time - fixed that and now nimterop runs in 0.369 seconds, down from 8 seconds
19:06:36shashlickand this is still not release mode
19:07:13narimiranshashlick: you had your pattern inside of some loop?
19:07:34shashlickya and its still a crappy workaround since i have no way to check if a regex is initialized or not
19:08:02shashlicki'll improve it but this was just for testing
19:09:02narimiranshashlick: sorry for the stupid question, but what do you mean when you say "initialized (or not) regex"?
19:10:02shashlickso if you do var rgx: Regex, it gets initialized with something. if i later want to check and then initialize it, like you would with something that's nil, you cannot
19:12:39*masquino quit (Quit: WeeChat 1.9.1)
19:12:58narimiranhmm, it's been a long time since i used regex in nim (last year's AoC), but i don't remember stumbling on these kinds of problems :/
19:13:17shashlickthat's because in most cases, you just create and use your regex right away
19:13:49narimirantrue
19:15:06*Vladar quit (Remote host closed the connection)
19:20:36leorizeshashlick: you could use 'Option[T]' to abstract away the uninitalized state
19:21:37shashlickleorize: good idea - will keep in mind
19:22:32shashlickso in case anyone cares, using re (pcre) vs regex in nimterop, I see 0.07 vs 0.095 in release mode as far as time is concerned
19:29:26*narimiran quit (Remote host closed the connection)
19:43:30*kungtotte joined #nim
19:44:19shashlickcan you create an object at compile time that contains pointers to procs?
20:00:43*tdc quit (Quit: Leaving)
20:06:25*PMunch joined #nim
20:09:20*kapil____ quit (Quit: Connection closed for inactivity)
20:15:45Araqshashlick, yeah
20:28:27*Yardanico quit (Ping timeout: 240 seconds)
20:48:51shashlickmeh - i created a table of objects at compile time and consumed at runtime - it is slower than doing everything at runtime
21:03:04*endragor joined #nim
21:07:54*endragor quit (Ping timeout: 272 seconds)
21:19:24Araqer, yglukhov[m] in lambdalifting.nim why are nkFuncDef not handled like nkProcDef? This makes no sense whatsoever
21:23:45*noonien joined #nim
21:38:10*PMunch quit (Read error: Connection reset by peer)
21:49:46*stefanos82 quit (Remote host closed the connection)
21:51:27*Jesin quit (Quit: Leaving)
21:54:10*Jesin joined #nim
22:04:49FromGitter<Vindaar> @narimiran phew, day4 took me 53 minutes for both parts :O
22:29:18FromGitter<zetashift> I'm stuck on day3
22:29:25*vlad1777d quit (Ping timeout: 246 seconds)
22:37:33*xet7 quit (Quit: Leaving)
22:45:01*shpx joined #nim
22:50:01FromGitter<zetashift> Does nim-csfml support 2.4?
22:55:26*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:55:29FromGitter<citycide> @technicallyagd I like unpack, the new operators look great. anyone know why the `[let a, b] <- foo` syntax doesn't with though?
22:55:54FromGitter<citycide> work*. and could it
23:04:52FromGitter<citycide> @alehander42 really starting to love gara btw. was working on array support but got a bit confused by the condition that's generated
23:06:25FromGitter<citycide> considering it doesn't seem called whatsoever. if you use a capture the `repr` shows a let declaration right in the middle of the `and` chain
23:06:50FromGitter<citycide> doesn't seem valid*
23:09:04FromGitter<Vindaar> @citycide I guess `[let a, b] <- foo` isn't supported, because the default `[a, b] <- foo` means just that? ⏎ @zetashift anything specific you struggle with on day 3?
23:09:59FromGitter<citycide> @Vindaar no it's actually not syntactically possible apparently
23:10:19FromGitter<Vindaar> oh, I see
23:10:36FromGitter<zetashift> @Vindaar nothing I shouldn't be able to do with some proper problem solving thinkering :P
23:10:39FromGitter<zetashift> tinkering*
23:14:18FromGitter<citycide> I suppose the "why" is that `let` isn't a type like `var`, `ref` etc. which means that syntax likely would never be possible unfortunately
23:50:10*Tyresc quit (Quit: WeeChat 2.3-dev)
23:55:02*kapil____ joined #nim