<< 09-08-2020 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:01:46*junland joined #nim
00:11:27*Guest1516 is now known as dadada
00:11:40*vicfred joined #nim
00:11:56dadadahi nim people!
00:12:05Yardanicohello
00:12:25dadadathis day goes down in history with a great new release of moe https://github.com/tobimensch
00:12:33dadadaah sorry, wrong link, that's my github
00:12:35Yardanicowrong link :P
00:12:50Yardanicowaiting for moe lsp or nimsuggest support :P
00:12:56dadadahttps://github.com/fox0430/moe
00:13:16dadadahttps://github.com/fox0430/moe/releases/tag/v0.2.1
00:14:01dadadame too, but it's already useful now, I edit configs with it and so on
00:14:22dadadait's won't be long before developing with it will make sense
00:15:31dadadas/it's/it
00:16:46dadadathere are still a few basic vim operations that I miss, but those can be added quickly
00:17:27dadadahttps://github.com/fox0430/moe/projects/26
00:17:41dadadaSimple auto complete is planned for the next release
00:17:51dadadaLSP/nimsuggest will probably be next after that
00:20:38dadadaa lightweight, really great editor, with sensible defaults, vim keys, great nim support, that's what's it going to be
00:24:28dadadahttps://github.com/fox0430/moe/issues/523 <- help wanted ... If you want LSP support, maybe join the project?
00:24:29disbotLanguage Server Protocol
00:34:29leorizefreshly stale: https://github.com/nim-lang/Nim/issues/6169
00:34:30disbotType inference struggles with `result` inside closures
01:02:58FromDiscord<Elegant Beef> What does freshly stale mean, does it taste stale but is still texturally fine, or is the flavour good and texture off?
01:03:28Yardanicoopen the issue to understand
01:03:58FromDiscord<Elegant Beef> I wasnt being serious, i knew it was the stalebot kicking in on an issue
01:17:59*waleee-cl quit (Quit: Connection closed for inactivity)
01:50:51*endragor joined #nim
02:01:02*apahl quit (Ping timeout: 246 seconds)
02:03:09*apahl joined #nim
02:31:40dadadaanyone know something better than base64 for encoding binary data to store it in a text file?
02:31:51Yardanicowhy do you need to encode it?
02:31:58Yardanicojust write bytes to the file?
02:32:05Yardanicoor you want to have it as ASCII bytes in the end?
02:32:12YardanicoI mean human-readable ascii
02:32:18dadadaYardanico: it's a regular txt file that I'm editing with a text editor
02:32:27Yardanicowell then there's no good alternative]
02:32:35dadadaand I want to put some data in the bottom of the file
02:34:28dadada... yeah, I figured as much...
02:52:47*muffindrake quit (Ping timeout: 240 seconds)
02:55:13*muffindrake joined #nim
02:58:07*Jesin quit (Quit: Leaving)
03:03:43*Jesin joined #nim
03:08:45*Zevv quit (Quit: Lost terminal)
03:09:02*Zevv joined #nim
03:09:25Zevvso, there is your third nim bug
03:11:14disruptekgo back to bed, zevv.
03:20:41Zevvnope
03:21:29Zevvcoffee, then load up the dog and out for a little hike
03:21:52disruptekneat.
03:24:00*Zevv quit (Quit: Lost terminal)
03:24:13*Zevv joined #nim
03:24:31Zevvwow stale bugs get closed automatically, no way
03:24:54disruptekit's pretty awesome, right?
03:25:09Zevvthat is great stuff
03:25:19Zevvwell end up with only a hundred or so
03:25:30Zevvmust be a pretty smart bot if it can do that
03:25:49Zevvwe wont need clyybber anymore
03:25:55disruptekcoffee, zevv, then load up the dog.
03:26:12Zevvyeah doing just that, but its still to hot
03:26:15Zevvthe coffee
03:26:33disrupteki just sat down to mangling.
03:26:40disruptekdid you know it doesn't build in release mode?
03:26:49disruptekwe need to get that bot in here.
03:26:51Zevvnope :(
03:27:11Zevvi browsed through the patch, its super nasty stuff all that
03:27:19disruptekoh c'mon.
03:28:12disruptekit's pretty tame compared to IC.
03:29:13shashlickweave is getting annoying now - mratsim is never around when i run into issues 😐
03:29:42disruptekthere's this new thing called `cps`...
03:29:49shashlickwell, how do I use it
03:29:57disruptekgot me. that's zevv's department.
03:30:24disruptekdid you look at the tests?
03:32:39FromDiscord<flywind> Hi, disruptek. How can I implement timerfd in windows? Many cross platform event libraries use their own cross-platform timer(based on heap or timerwheel). It is hard to implement timerfd in windows because `wepoll` only supports registering socketHandle instead of Handle(waitable timer objects).
03:33:13disrupteki dunno, but there's a work-around in async that solves the problem there, right?
03:33:27disruptekthis is why i asked you about timers... 😉
03:34:06disrupteksomeone starred a tiny timewheel impl that you could port.
03:34:16disruptektimerwheel, too.
03:34:54shashlicklet's just say the doc example and the tests are greek
03:34:56FromDiscord<flywind> I think `asyncdispatch` use its own cross platform timer (based on heap) instead of `timerfd`.
03:35:12*Zevv quit (Quit: Lost terminal)
03:35:14disruptekcan we do that?
03:35:23disruptekshashlick: look at the echo server in stash/
03:35:32disruptekshashlick: or, really, anything in there.
03:35:35*Zevv joined #nim
03:36:05disruptekflywind: timers are outside the scope of cps, anyway; we can do whatever we want, there.
03:37:15Zevvshashlick: but stuff is not really in a functional state all of the time
03:37:18Zevvlike, now, I think
03:37:30disrupteki think it is.
03:37:39Zevvlemme see
03:37:41FromDiscord<flywind> Ok, I will try to implement it in selectors.
03:38:06Zevv type mismatch: got <None> but expected 'proc (c: Cont): Cont'
03:38:11ZevvI need to take out the c: ?
03:39:13Zevvnope, c'est cassée
03:39:27disruptek0.0.13 is solid.
03:39:29disrupteki swear.
03:39:38Zevvyeah ok, but people try master of course
03:39:40Zevv0.0.13 is ok
03:40:47Zevvalmost :)
03:40:53Zevvooh I hear birds, I'm out
03:41:03disrupteki think i left a quit(1) in 0.0.13. but don't worry about it.
03:41:08disruptekjust look at stash stuff.
03:43:34shashlickyou need a simple example - how to run two procs with a sleep each in pseudo parallel - where sleep is a proxy for a io intensive task
03:43:35disruptekflywind: you're going to use the heap impl?
03:43:46disruptekshashlick: that's what tock is.
03:44:34shashlickwhat's yield though
03:44:48disruptekjust a keyword we overloaded.
03:45:00disruptekthe only one we overloaded.
03:45:20shashlickdo you need to use yield or cps or something when you do something io intensive
03:45:43disruptekyou use yield when you call a primitive.
03:45:56disrupteksome primitives are defined in cps/eventqueue.nim.
03:46:01disruptekyou can see how they work...
03:46:36disruptekyou can use that dispatcher or you can supply your own and not even import eventqueue.
03:47:53FromDiscord<flywind> disruptek: Heap version is simpler than `timerWheel` and I'm lazy😜 . I will look into `timerWheel` too.
03:48:43disruptekfair enough.
03:49:50disruptek`yield foo()` is the same as `cps foo()` right now.
03:55:50*vicfred quit (Quit: Leaving)
04:00:56silvernode[m]morning
04:02:09silvernode[m]Isn't there a way to do "from libraryFile import proc"?
04:02:54silvernode[m]I swear I saw that somewhere but apparently "from" is not a keyword
04:03:28disruptekyour syntax is correct.
04:03:33disruptekfrom module import symbol
04:04:30disruptekfrom appears in doc/keywords.txt
04:04:38disruptekwhere did you read that it's not a keyword?
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:40*supakeen joined #nim
04:16:39silvernode[m]<disruptek "where did you read that it's not"> The compiler is yelling at me
04:16:58silvernode[m]Latest stable version of Nim
04:16:59disruptekpay no attention to the man behind the curtain.
04:18:14silvernode[m]It's probably due to me trying to import an incorrectly named module. I just want to use write or writeLine() without typing stdout.write for example.
04:18:31silvernode[m]I figure it's part of the stdout lib but apparently not?
04:18:58disruptekstdout is the name of a filestream.
04:19:16disruptekstdout.write is the same as saying write(stdout).
04:19:33disruptekstdout is a value.
04:20:07silvernode[m]right, I freaking knew that lol, small brain.
04:20:29disruptekUFCS can be confusing.
04:20:46silvernode[m]because stdout.writeLine("hello") is the same as writeLine(stdout, "hello")
04:20:59disruptekindeed.
04:21:02silvernode[m]duh silvernode
04:21:27disruptekthere are two things i really struggle with:
04:21:34disruptekUFCS style, and
04:21:38disruptekregular bathing.
04:23:26silvernode[m]Is there a way to detect when a user sends a signal to the terminal like Ctrl+C?
04:23:32disrupteksure.
04:24:32silvernode[m]I am trying to avoid the error output that appears when cancelling somethng with ctrl+c
04:24:47silvernode[m]I want to replace that with a message of my own so it looks nicer
04:25:01disruptekhttps://nim-lang.org/docs/system.html#setControlCHook%2Cproc%29
04:26:26silvernode[m]perfect, now i just need to figure out how to properly use it. There does not seem to be an example
04:26:31silvernode[m]thanks disruptek
04:27:05disruptekthere's an example in golden; see src/golden.nim
04:27:07disruptek!repo golden
04:27:08disbothttps://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim 🏆 15 22⭐ 0🍴
04:33:36silvernode[m]found the example, playing with it in my code now. It's going to take awhile to wrap my head around how to customize it but that's part of the fun I guess.
04:35:53silvernode[m]Figured it out
04:36:25*vicfred joined #nim
04:36:53disruptek raise newException(BenchmarkusInterruptus, "")
04:37:03silvernode[m]You have to basically create a proc that contains what you want to happen, then pass that proc to setControlCHook
04:37:09disrupteki wouldn't have thought that has hard to grok.
04:37:34silvernode[m]My brain tends to abstract things
04:38:07disruptekwell, my neckbeard smells like vomit.
04:38:15disrupteki guess that makes us even.
04:40:09silvernode[m]hah
04:46:48silvernode[m]time to go clock in for work, have a good night everyone.
05:22:42*solitudesf joined #nim
05:50:38Zevvha
06:51:00*solitudesf quit (Remote host closed the connection)
06:54:10*solitudesf joined #nim
07:12:31*arecacea1 quit (Read error: Connection reset by peer)
07:14:44*arecacea1 joined #nim
07:34:01FromDiscord<ShalokShalom> is there map, reduce and so on?
07:38:23FromDiscord<mattrb> Yeah
07:39:08FromDiscord<mattrb> Does anyone here have experience with nim and emscripten?
07:43:19FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2tFy
07:46:18FromDiscord<mattrb> God I'm dumb
07:47:04FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2tFA
07:48:59FromDiscord<Varriount> @mattrb you didn't set the export babe?
07:49:08FromDiscord<Varriount> name
07:49:29FromDiscord<mattrb> I spelled the function in Nim "testProc" and tried to call "test" from JS :facepalm:
07:49:42FromDiscord<Varriount> Yeah
07:50:08FromDiscord<mattrb> Ah yeah so I could have just set the export in exportc too 🤷‍♀️
07:51:01FromDiscord<mattrb> (edit) "Ah yeah so I could have just set the export in exportc ... too" added "pragma"
07:51:11FromDiscord<mattrb> Gotta love bugs like that
07:56:37FromDiscord<lqdev> @ShalokShalom yes, see sequtils
07:56:37*letto quit (Quit: Konversation terminated!)
07:58:37*letto joined #nim
08:07:51FromDiscord<ShalokShalom> @mattrb In the standard Nim disribution?
08:11:02*NimBot joined #nim
08:13:12FromDiscord<ShalokShalom> thanks a lot
08:17:37FromDiscord<ShalokShalom> And pipes?
08:17:56FromDiscord<ShalokShalom> Like |> passes one function into another, in F# and Haskell.
08:20:42*apahl quit (Ping timeout: 260 seconds)
08:21:32*apahl joined #nim
08:25:18FromDiscord<ShalokShalom> (edit) Like |> passes one function into another, in F# and & in Haskell. Is there something like that?
08:30:39FromDiscord<mattrb> @Varriount Do you have experience with nim/emscripten?
08:35:25FromDiscord<mattrb> Or does anyone else have a clue how to use emscripten's `ccall` to call Nim function with an array? I seem to get receiving empty arrays in nim
08:56:52*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:00:08*k0mpjut0r quit (Quit: Idle for 30+ days)
09:04:27*drewr quit (Ping timeout: 260 seconds)
09:05:57*drewr joined #nim
09:11:29*xet7 joined #nim
09:12:25*maier_ quit (Ping timeout: 244 seconds)
09:17:15FromDiscord<mattrb> Hmm I got it to sort of work by taking a pointer to a seq[byte] and a length as parameters, then reading it into a new seq. Unfortunately, it seems like I’m getting different values in the resulting seq for some reason..
09:29:48Oddmonger[] for dereferencing, that's cute (even if in C [] is not a pointer :þ )
09:37:04*waleee-cl joined #nim
09:47:38*maier joined #nim
10:05:43*Cthalupa quit (Ping timeout: 265 seconds)
10:07:15*Cthalupa joined #nim
10:12:48*Vladar joined #nim
10:13:16*opi joined #nim
10:18:38*clyybber joined #nim
10:32:25*maier quit (Ping timeout: 240 seconds)
10:32:36FromDiscord<lqdev> @ShalokShalom#6109 you can just use the method call syntax, eg. `" hello ".strip.toUpper`
10:34:23*maier joined #nim
10:39:45*maier quit (Ping timeout: 240 seconds)
10:43:12*moerm joined #nim
10:43:31moermHello averyone ;)
10:51:42clyybbersup
11:06:21*Perkol joined #nim
11:07:35*lritter joined #nim
11:10:48*haxscramper joined #nim
11:34:45jkenHow do I make nimble forget links Ive made with nimble develop?
11:36:29moermHave a nice day everybody
11:36:36*moerm quit (Quit: Leaving)
11:36:53*clyybber quit (Quit: WeeChat 2.9)
11:50:18FromDiscord<lqdev> jken: nimble remove?
11:52:37*opal quit (Remote host closed the connection)
11:55:42*opal joined #nim
12:06:02*supakeen quit (Quit: WeeChat 2.8)
12:06:33*xet7 quit (Quit: Leaving)
12:06:48*supakeen joined #nim
12:07:05*xet7 joined #nim
12:11:23*Vladar quit (Quit: Leaving)
12:33:51FromDiscord<XxDiCaprioxX> Is there an image type in nim?
12:46:55FromDiscord<XxDiCaprioxX> how do i declare an array in a type statement?
12:47:56solitudesfhttps://nim-lang.org/docs/tut1.html#advanced-types-arrays
12:50:01FromDiscord<XxDiCaprioxX> thx
13:01:46*Perkol quit (Remote host closed the connection)
13:02:29FromDiscord<abisxir> How is the life cycle of a proc in nim when it is inside another proc?
13:04:30FromDiscord<Clyybber> just as you expect
13:04:32*Vladar joined #nim
13:04:35FromDiscord<Clyybber> probably :)
13:05:26FromDiscord<abisxir> 😅
13:06:00FromDiscord<abisxir> So it is defined like a variable and when we are out of the scope there is no valid proc anymore?
13:06:19FromDiscord<abisxir> For example, is this code valid:
13:06:37FromDiscord<abisxir> sent a long message, see http://ix.io/2tHa
13:06:43FromDiscord<Clyybber> yeah its valid
13:07:02FromDiscord<abisxir> Cool 🙂
13:07:29FromDiscord<Tangil> sent a long message, see http://ix.io/2tHb
13:07:38FromDiscord<Tangil> https://media.discordapp.net/attachments/371759389889003532/742006173192028210/LetterDraftAI.zip
13:07:39FromDiscord<Tangil> https://media.discordapp.net/attachments/371759389889003532/742006175746490419/LetterDraftAINim.zip
13:08:13*joelanglois quit (Quit: Connection closed for inactivity)
13:08:50FromDiscord<abisxir> @Tangil have you compiled nim with -d:release --opt:speed ?
13:09:15FromDiscord<Tangil> i did `-d=danger --panics=on` since someone suggested that. i'll try your suggestion too
13:09:18FromDiscord<Rika> oh wow so many new people, did someone post something to HN?
13:10:14FromDiscord<Tangil> using `-d:release --opt:speed` does not increase the speed
13:10:15FromDiscord<Recruit_main707> I just constanly bombard them with nim ;P
13:10:43FromDiscord<Rika> @Tangil give me a moment, i'll try reading through the nim code to see what's being slow
13:11:29FromDiscord<Tangil> i'm aware that using an array instead of a seq would be faster, but i'm comparing it to c# where i'm using a list instead of an array anyway
13:11:46FromDiscord<Tangil> (edit) "i'm aware that using an array instead of a seq ... would" added "for `allChampions`"
13:12:07*oddp joined #nim
13:13:43FromDiscord<abisxir> @Tangil loadChampions proc is slower?
13:13:55FromDiscord<Tangil> no, that's not what i'm measuring
13:14:13FromDiscord<Tangil> i'm only measuring negamax
13:16:58FromDiscord<Rika> profiling shows validateMove being really slow
13:18:05FromDiscord<XxDiCaprioxX> Creating a hash with a string and array gives me the error `illformed AST: Hash[]`
13:18:25FromDiscord<Rika> code?
13:19:34FromDiscord<XxDiCaprioxX> ``` InfoArray = array[3, Uri] info: InfoArray proc variationHash(x: Variation): Hash =↵ result = x.name.hash !& x.info.hash↵ result = !$result↵```
13:19:55FromDiscord<XxDiCaprioxX> (edit) "``` InfoArray = array[3, Uri] info: InfoArray proc variationHash(x: Variation): Hash =↵ result = x.name.hash !& x.info.hash↵ result = !$result↵```" => "sent a code paste, see https://play.nim-lang.org/#ix=2tHg"
13:20:15FromDiscord<Rika> uh, you dont put code under a `type` block
13:20:24FromDiscord<XxDiCaprioxX> It is not
13:20:33FromDiscord<XxDiCaprioxX> Discord just messed up the formatting
13:20:48FromDiscord<Rika> it still looks like you are
13:20:53FromDiscord<Rika> i'm kinda confused, sorry
13:21:00FromDiscord<XxDiCaprioxX> (edit) "https://play.nim-lang.org/#ix=2tHg" => "https://play.nim-lang.org/#ix=2tHi"
13:21:10FromDiscord<XxDiCaprioxX> Is this more readable?
13:21:27FromDiscord<XxDiCaprioxX> (edit) "https://play.nim-lang.org/#ix=2tHk" => "https://play.nim-lang.org/#ix=2tHj"
13:21:37FromDiscord<XxDiCaprioxX> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2tHl
13:21:55FromDiscord<Rika> ah yes
13:23:10FromDiscord<Rika> what line is the error saying it is happening at?
13:24:08FromDiscord<XxDiCaprioxX> It is `illformed AST: Hash[]` in the line `result x.name.hash !& x.info.hash` at the info.hash
13:26:22FromDiscord<Rika> i'm stumped, i think its because Uri has no hash function
13:26:49FromDiscord<XxDiCaprioxX> Is there a string.toUri?
13:27:13FromDiscord<XxDiCaprioxX> So I can save it as a string and then turn it into an Uri on printout
13:27:32FromDiscord<Rika> parseUri
13:28:37FromDiscord<Rika> @Tangil i know! try using --gc:arc
13:29:03FromDiscord<Tangil> `-d:release --opt:speed --gc:arc` like this?
13:29:04FromDiscord<Rika> wait, one more idea
13:29:12FromDiscord<Rika> make `Champion` a ref
13:29:44FromDiscord<Rika> and then explicitly make shallow copies when they really need to be copies (mutated)
13:30:25FromDiscord<Tangil> using gc:arc made it slower, but i'll try making Champion a ref
13:31:40FromDiscord<Tangil> wow ref made it a lot faster
13:31:49FromDiscord<Tangil> down to 1442ms now
13:31:51FromDiscord<Tangil> thanks
13:31:54FromDiscord<Tangil> (edit) "thanks" => "thanks!"
13:32:26FromDiscord<Rika> using --gc:arc with refs doubles speed too from my test
13:32:35FromDiscord<Rika> but then you have to mind ref semantics
13:32:43FromDiscord<Rika> making explicit copies when needed
13:32:45FromDiscord<XxDiCaprioxX> Okay thanks Rika I got it now
13:33:00Zevven interstingly, most people *think* in ref semantics
13:33:11Zevvbecause that what you get in most languages
13:33:21FromDiscord<Tangil> i don't mutate Champion, and i already wrote the C# with ref in mind since C# objects are reference objects
13:33:28FromDiscord<Tangil> (edit) "i don't mutate Champion, and i already wrote the C# ... with" added "code"
13:33:34FromDiscord<Tangil> (edit) "i don't mutate Champion, and i already wrote the C# code with ref in mind since C# objects are ... reference" added "by" | removed "objects"
13:33:43FromDiscord<Rika> @XxDiCaprioxX i'm sorry i dont really know what went wrong, but the Uri thing is my suspicion
13:33:52FromDiscord<Rika> ah then all is good 😛
13:35:16FromDiscord<Tangil> still quite a bit slower than c# but this was a nice improvement
13:35:32*abm joined #nim
13:36:18*solitudesf quit (Remote host closed the connection)
13:37:47FromDiscord<Tangil> are sequences passed by value or reference in procs?
13:37:54FromDiscord<Rika> value
13:38:18FromDiscord<Rika> everything that isnt "ref" is by value, even if under the hood they are heap allocated
13:40:15Oddmongerref or ptr , isn't it ?
13:40:41Oddmongeror are ptr reserved for C binding ?
13:42:09*krux02 joined #nim
13:42:54FromDiscord<Recruit_main707> ptr to afaik
13:43:00FromDiscord<Recruit_main707> too
13:43:28FromDiscord<Recruit_main707> It can be used without binding to c
13:44:35*Cthalupa quit (Ping timeout: 240 seconds)
13:44:49FromDiscord<abisxir> @Tangil line 58 you copy the seq: var newMove = pickBans
13:45:39FromDiscord<Tangil> yeah, i tried to keep it like C#
13:46:45FromDiscord<abisxir> Then in line 27 maybe you can define your seq as var
13:47:03FromDiscord<abisxir> proc negamaxHeuristicMaxWr(pickBans: seq[Champion]): float to proc negamaxHeuristicMaxWr(pickBans: var seq[Champion]): float
13:47:18*Cthalupa joined #nim
13:47:22FromDiscord<abisxir> It also prevents sequence copy
13:47:40FromDiscord<Tangil> but i need to create a new copy for every iteration of that loop
13:48:01FromDiscord<Tangil> i'm adding a different element to a new copy
13:48:06FromDiscord<Tangil> (edit) "i'm adding a different element to a new copy ... " added "each iteration"
13:48:16FromDiscord<abisxir> But you pass newMove, I think you copied it already
13:48:23FromDiscord<Tangil> ah ok
13:49:34FromDiscord<Tangil> it's not any faster but i see the idea behind the optimisation
13:50:31FromDiscord<Tangil> i tried making all the sequences in the proc parameters var but i didn't get any increase in speed. does var in a parameter make it pass by reference?
13:50:47FromDiscord<abisxir> Any direct pass, with no var or ptr, is a copy and assignment, so you can prevent it as much as your algo allows it
13:51:59FromDiscord<abisxir> I think so
13:53:53FromDiscord<Rika> var uses by ref yes
13:55:12FromDiscord<Tangil> just realised i did `0..10` instead of `0..9` so it was taking an extra trial into account when benchmarking
13:55:42FromDiscord<Tangil> didn't really change the benchmarks but just thought i should let you know just in case
13:56:17FromDiscord<Tangil> what about using ref instead of var in the proc parameters? how would that change things?
13:57:33FromDiscord<Rika> harder to use for no real gain
13:58:49FromDiscord<Tangil> dang
13:59:29FromDiscord<Clyybber> dont use var params to elide copies
13:59:38FromDiscord<Clyybber> its not needed
14:02:04FromDiscord<Tangil> so i shouldn't use var in these procs?
14:02:45FromDiscord<Clyybber> no, if you don't want to modify it its not needed
14:03:04FromDiscord<Clyybber> nim automatically passes by reference if thats faster
14:03:07FromDiscord<Tangil> ah ok
14:03:40FromDiscord<Tangil> explains why i didn't see any change
14:04:35FromDiscord<Clyybber> you could try doing `var newMove: seq[Champion]; shallowCopy(newMove, pickBest)` instead
14:04:39FromDiscord<Clyybber> and try without gc:arc
14:05:12FromDiscord<Tangil> wasn't using gc:arc since it was slowing things down, but i'll try your other suggestion
14:05:25FromDiscord<Clyybber> It shouldn't change anything I think
14:05:34FromDiscord<Clyybber> but if it does, then we'll know more :)
14:06:53FromDiscord<Recruit_main707> Did you use arc and refs?↵I think that was what Rika meant before
14:08:52FromDiscord<Tangil> the shallowCopy change gives me an index out of bounds exception, so i'll try to debug that and then get back to you on how it changed things
14:09:44FromDiscord<Clyybber> oh, no need to debug that
14:09:48FromDiscord<Clyybber> it was just a hunch
14:09:52FromDiscord<Clyybber> it probably won't change much
14:09:56FromDiscord<Tangil> oh ok
14:10:00*solitudesf joined #nim
14:10:05FromDiscord<Clyybber> I'm gonna download and see what I can do
14:10:43FromDiscord<Tangil> cool, thanks
14:18:46*Avatarfighter joined #nim
14:21:32FromDiscord<Clyybber> Huh
14:21:51FromDiscord<Clyybber> Arc improves it from 53 secs to 17
14:22:04FromDiscord<Clyybber> This is without making the objects refs
14:23:41FromDiscord<Clyybber> And gc:arc with refs improves it to 6 secs
14:23:56FromDiscord<Clyybber> @Tangil what version are you on?
14:24:09FromDiscord<Tangil> i installed nim yesterday, so probably the latest version
14:24:22FromDiscord<Clyybber> Ok, so the only change I did was change Champion to be a ref object
14:24:27FromDiscord<Clyybber> And compile with --gc:arc
14:24:46FromDiscord<Clyybber> Adding -d:danger I get 1 sec
14:25:16FromDiscord<Clyybber> @Tangil Do you use choosenim?
14:25:37FromDiscord<Tangil> no i just placed the zip from the website into program files
14:25:40FromDiscord<Clyybber> Ah ok
14:26:04FromDiscord<Clyybber> Can you try these: https://github.com/nim-lang/nightlies/releases/tag/2020-08-07-devel-d9ed816
14:26:21FromDiscord<Clyybber> And are you sure you compiled with --gc:arc?
14:26:31FromDiscord<Clyybber> It makes things tremendously faster for me
14:26:40FromDiscord<Tangil> yep, it slows things down for me
14:27:09FromDiscord<Tangil> i'll try with the nightly build
14:29:53FromDiscord<Tangil> i was using nim 1.2.6 for what it's worth
14:31:10*Avatarfighter quit (Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in)
14:31:20*Avatarfighter joined #nim
14:34:55FromDiscord<Tangil> that was a lot faster on the nightly build
14:34:58*opi quit (Remote host closed the connection)
14:35:10*dadada quit (Ping timeout: 260 seconds)
14:35:13FromDiscord<Tangil> marginally slower than c# but that was a really huge improvement
14:35:18FromDiscord<Tangil> thanks for the suggestions
14:35:23FromDiscord<Clyybber> heh, interesting
14:35:35FromDiscord<Clyybber> how much slower is it now?
14:36:22*dadada joined #nim
14:36:24FromDiscord<Tangil> only 100ms ish
14:36:46*dadada is now known as Guest73425
14:37:47FromDiscord<Clyybber> cool, one thing you could try to do is inlining a few of these procs
14:37:53FromDiscord<Clyybber> so adding {.inline.}
14:38:13FromDiscord<Clyybber> C# does that automatically at runtime once the JIT deems a code path very hot
14:39:12FromDiscord<lqdev> @Tangil the compiler will pass "big" objects (whose size is >= 3pointer) by reference, and it won't copy sequences if you don't pass them as var
14:39:20FromDiscord<lqdev> because after all, the copy is pointless
14:39:25FromDiscord<lqdev> as you can't modify the seq
14:41:03FromDiscord<Tangil> @Clyybber i'll try that now↵@lqdev good to know
14:41:32FromDiscord<Clyybber> Hmm, adding {.inline.} to negamaxHeuristicMaxWr and generateValidMoves improves things a lot
14:41:56FromDiscord<Clyybber> (edit) "negamaxHeuristicMaxWr and" => ""
14:42:33FromDiscord<Clyybber> oh, nevermind
14:42:53FromDiscord<Clyybber> the numbers are flucuating hard on my machine :p
14:44:23FromDiscord<Tangil> it's probably too fast to have any reasonable measurement done to it, might need to increase the depth to have measureable numbers
14:46:44*Perkol joined #nim
14:47:23*Cthalupa quit (Ping timeout: 240 seconds)
14:48:04FromDiscord<Clyybber> @Tangil Removing the `if len(pickBans) == 0:` part improves performance
14:48:34FromDiscord<Clyybber> Oh, eh disregard that, that also makes it incorrect
14:48:47FromDiscord<Clyybber> Adding a unlikely to the condition improves performance too though
14:49:03FromDiscord<Clyybber> `if unlikely len(pickBans) == 0:`
14:49:07FromDiscord<Tangil> cool
14:49:33Zevvwow having a microoptimizing party
14:49:39*Cthalupa joined #nim
14:49:49FromDiscord<Clyybber> Zevv: hell yeah!
14:50:20Zevvlast time I won anything with an 'unlikely' was, let me think, yeah that was somewhere late september 1998 I think
14:50:35FromDiscord<Clyybber> heh
14:50:59Zevvsince then I was structurally outsmarted by ever banch b
14:51:06Zevvpredictor I met
14:52:59Zevvlqdev: dod you know its actually 3 times "float"? that was a bit of a wtf for me when reading the compiler code
14:59:58Zevvyeah yeah Ill be off then, laways the samy thing with parties, i walk in, the music stops and everybody stops talking
15:10:51Zevvoh clyybber, amazing how this typed macro+proc bug holds up all that time
15:11:14ZevvI'd expect something to hit a lot of people, but apparently doing typed macros on procs is not a thing people want to do very often
15:23:53FromDiscord<abisxir> @lqdev thanks for pointing out that, so it is the same for arrays and tuples.
15:29:20FromGitter<dreamer3_twitter> Is there some easy way to compile a static server without the getaddrinfo warning?
15:29:48FromGitter<dreamer3_twitter> or is it just a thing that can often be ignored if glibc is close?
15:30:07FromGitter<dreamer3_twitter> I was hoping to avoid any OS dependencies at all and just link it all statically.
15:30:41Yardanicojust link with musl
15:30:47Yardanicostatically
15:30:53Yardanicoit works pretty well with nim
15:33:23*arecacea1 quit (Read error: Connection reset by peer)
15:33:44*arecacea1 joined #nim
15:39:11FromDiscord<lqdev> @abisxir pretty sure it's the case for arrays, but "small" tuples are passed by copy afaik
15:40:26FromDiscord<lqdev> you can enforce certain passing behavior by adding a {.bycopy.} or {.byref.} pragma to an object type
15:40:27*haxscramper quit (Read error: Connection reset by peer)
15:42:14FromDiscord<lqdev> eg. an Image type that holds a seq of pixels might not reach the required size of 3sizeof(pointer) to be passed byref, so you can do `type Image {.byref.} = object` and it will always be passed by pointer no matter if the size changes in the future
15:45:27FromDiscord<abisxir> Ok, I see, but how compiler handles this type of objects? are they the same like ref objects?
15:45:56FromDiscord<lqdev> no
15:46:00*tane joined #nim
15:46:01FromDiscord<lqdev> they're still on the stack
15:46:15Yardanico@abisxir you can get address of things on the stack
15:46:36FromDiscord<lqdev> it's just that when you pass them as arguments to procs, they're actually a pointer so they're not copied
15:49:09Yardanico@abisxir pretty low-level but: https://play.nim-lang.org/#ix=2tHT
15:49:22Yardanicohere "data" is allocated on the stack, and you get it's pointer and pass it to takePtr
15:49:25disruptekdiscord bot isn't escaping formatting correctly.
15:49:27Yardanicothis code has 0 allocations
15:49:30Yardanicodisruptek: I know
15:49:37YardanicoI mean heap allocs
15:50:51disruptekthe thing about `shower sunday` is that if you miss it, there's always another one around the corner.
15:58:40Zevvjust like flossin' easter
15:59:51Zevvman this new schedule really suits me. up at 500, do stuff until 1300, have lunch, have a nap, wake up at 1700, have a beer, cook dinner, and zevv is like a new man
16:00:10supakeenSounds Spanish!
16:00:37Zevvyeah, most of my life ive been makin fun of lazy spaniards and itialians
16:00:44Zevvbut these guys just have figured it out
16:00:48supakeenIt's perfect for hot days.
16:01:02Zevvthat was kind of the point indeed
16:28:21*clemens3 quit (Read error: Connection reset by peer)
16:30:17*clemens3 joined #nim
16:32:30disruptekthat doesn't make them any less lazy.
16:36:37shashlickEither meow hash is blazing fast or not doing anything - processing 23k files at 860mb takes 0.5s with threadpool, 0.8s with weave
16:37:09supakeen1.4 GB/s?
16:37:35disruptekit's pretty fast.
16:38:05Yardanicoshashlick: weave is not for IO really, maybe it scales incorrectly?
16:38:24shashlickAnd I thought up some more optimizations for duplicate files
16:38:45shashlickBut need to verify if this is really correct
16:39:58shashlickHaving an issue passing an importc object thru channels - doesn't get deep copied correctly
16:40:07shashlickSo having to use a string
16:40:25disruptek!repo frosty
16:40:26disbothttps://github.com/disruptek/frosty -- 9frosty: 11marshal native Nim objects via streams, sockets 15 7⭐ 0🍴
16:40:32Yardanico?
16:40:50Yardanicoserialization/deserialization in the application for itself might be a bit too much
16:41:29shashlickMeow uses m128i which I importc but when going thru a channel, it's not copied
16:41:39Yardanicoadd {.bycopy.} ?
16:41:51shashlickTried overriding deepCopy but no luck
16:41:54shashlickWill try
16:42:01YardanicoI don't think you can override deepCopy
16:42:14shashlickYou can =deepCopy
16:42:17FromGitter<pebauer68> Why does this return chars ? ⏎ for line in stdin.readLine: ⏎ ⏎ ```echo "Got:",line``` [https://gitter.im/nim-lang/Nim?at=5f30276865e829425e7124f8]
16:42:21shashlickBut it doesn't get called
16:42:35Yardanico@pebauer68 because you're iterating over chars in a single line
16:42:41*opi joined #nim
16:42:45Yardanicoshashlick: well, that's what I mean
16:42:54Yardanico@pebauer68 with stdin.readLine() you get a string already
16:42:57Yardanicoone single string
16:42:59Zevvshashlick: did you find something for the C macro calling yet?
16:43:04Yardanicolet line = stdin.readLine()
16:43:05Yardanicoecho line
16:43:13FromGitter<pebauer68> but I am using readLine ?
16:43:19Yardanicoyhes, that reads a single line
16:43:27Yardanicobut you're iterating over characters in the line you got
16:43:39FromGitter<pebauer68> ok
16:44:03Yardanicoin "for line in stdin.readLine:" stdin.readLine() reads a *single* line, and then calls the items() iterator for a line impliciyl
16:44:05Yardanicoimplicitly
16:44:10Yardanicowhich iterates over all chars in the string
16:44:18Yardanicoso in "Got" you get each char individually
16:44:36Yardanicoif you want to read all stdin lines until it's empty, you need to do it a bit differently
16:45:25Yardanicolike https://play.nim-lang.org/#ix=2tIj
16:48:10FromGitter<pebauer68> ok, thank you
16:53:36shashlick@Zevv I had to write a proc which means I had to add type info
16:53:45shashlickCan't do that automatically
16:54:16Zevvno right, that's the whole problem of coure :/
16:54:42shashlickC2nim was smart enough to convert the implementation of the macro into Nim but that wouldn't work either since the procs being called aren't mapped
16:56:46shashlickI can't think of a generic solution
16:57:01*superbia2 joined #nim
16:59:48*superbia1 quit (Ping timeout: 256 seconds)
16:59:52ZevvI looked into c2nim as well, and "huh?" was also my reaction. Looks smart, but is wrong
17:00:28FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2tIo
17:01:30FromGitter<pebauer68> but "lines" returns really lines and not chars: ⏎ for line in stdin.lines:
17:01:31FromDiscord<lqdev> use `ptr UncheckedArray[uint8]`, `seq`s have a different memory layout
17:01:41Yardanico@pebauer68 that's different
17:01:44FromDiscord<lqdev> which includes the length and capacity
17:02:00Yardanicostdin.lines != stdin.readLine
17:02:03Yardanicothey are different
17:02:04FromDiscord<mattrb> Perfect 👌 Thank you!
17:02:08*krux02 quit (Remote host closed the connection)
17:02:22Yardanicofirst one is an convenience iterator over "while stdin.readLine(line): yield line"
17:02:27Yardanicosecond one is literally "read a single line"
17:02:56*krux02 joined #nim
17:02:56Yardanicocompare https://nim-lang.org/docs/io.html#lines.i%2CFile
17:02:59Yardanicoto https://nim-lang.org/docs/io.html#readLine%2CFile
17:04:06shashlick@Zevv I wouldn't say wrong but that you also need to wrap those procs
17:04:10shashlickIt's not unreasonable
17:04:33shashlickBut for meow hash it means wrapping some intrinsics
17:10:12*Perkol quit (Remote host closed the connection)
17:21:44FromGitter<adrianperreault> Hi y'all, so with the latest devel build of Nim with --gc:arc I've been getting a compiler exception of "Error: unhandled exception: index 1 not in 0 .. 0 [IndexDefect]". The project is fairly large (a game engine) and it's been tricky for me to pinpoint where or what's causing this. The project was compiling fine with --gc:arc on a devel build from about a week and a half to two weeks ago. ⏎ ⏎ How can I
17:21:44FromGitter... get more debug information about what's up? Has anyone had this type of error and know generally what it's related to?/Can anyone point me in the right direction? Thanks
17:22:10*iwanttobeanimnin joined #nim
17:22:18iwanttobeanimninsup
17:24:34FromDiscord<Elegant Beef> My ceiling
17:26:32iwanttobeanimninwhich nim web framework do you recommend as a server backend language? I would like to develop a website backend and use nim in place of PHP.
17:27:13iwanttobeanimninI've been looking at Jester, however I'm worried about it handling higher loads
17:27:25iwanttobeanimninhttps://github.com/dom96/jester
17:27:41supakeenMaybe don't worry about things that aren't and might never be, problems.
17:29:00*natrys joined #nim
17:29:39FromDiscord<Rika> worry when testing shows it actually happens
17:30:30FromDiscord<Rika> you're likely prematurely optimizing
17:31:57Zevvadrianperreault: stupid question, but you do get a stack trace on that exception, pointing to the source of your problem, right?
17:32:11FromGitter<adrianperreault> Negative :(
17:32:20ZevvYou compile with -d:release or -d:danger?
17:32:26FromGitter<adrianperreault> correcto
17:32:30FromGitter<adrianperreault> Turn that off?
17:32:32Zevvwell, don't do that :)
17:32:33Zevvright
17:33:13FromGitter<adrianperreault> derp... XD
17:33:32Zevvgot'em
17:33:33Zevv?
17:36:06FromGitter<adrianperreault> No luck :( compiling with: nim c -d:arcgc -d:nimV2 --gc:arc
17:36:24*disruptek sighs.
17:37:20disruptekyou have some bad ast in a macro.
17:37:47disruptekyou won't get a stack because it's a compile-time exception.
17:37:52disruptekwhy are you using those defines?
17:37:58disrupteki'm just curious.
17:38:20FromGitter<adrianperreault> Thought it might be related to a macro :( It was working exact same code with a previous devel build though?
17:38:25Zevvoooh compile time - I didn't read that right, sorry
17:38:55disrupteki cannot speak to the past.
17:39:05Zevvyou can, but it won't listen
17:39:12disruptekstory of my life.
17:39:54FromGitter<adrianperreault> Not sure about those defines... should I just be using --gc:arc?
17:40:22disruptekif you don't know what they do, don't use them.
17:40:34FromGitter<adrianperreault> XD
17:40:57federico3c2nim really needs to improve
17:41:27Yardanico@adrianperreault just use --gc:arc
17:43:18FromGitter<adrianperreault> Is there a way to step through compilation to atleast get the name of the offending macro?
17:43:41disruptekwhat platform?
17:43:47FromGitter<adrianperreault> arch linux
17:44:16disruptekyou're using devel, #head?
17:44:21FromGitter<adrianperreault> yup
17:44:25disruptek~gitnim
17:44:26disbotgitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek
17:44:37disruptekyou can step through past releases easily.
17:45:09disrupteki will push the nightly in a moment.
17:45:42FromGitter<adrianperreault> Recommending I rollback to a previous nim build?
17:46:10disruptekit would be helpful to know if this is your fault.
17:46:58FromGitter<adrianperreault> Okee, will do
17:47:13disruptekyou say the same code worked a week or two ago?
17:47:31disruptekgitnim has >1 month of nightlies, roughly every 2-3 days.
17:48:45FromGitter<adrianperreault> Exact same code, one minute it was compiling *choosenim update devel --latest* --> index 1 not in 0 .. 0
17:51:35disruptekwell, i don't use choosenim.
18:06:26FromDiscord<mattrb> Any reason arrays can't be created with `..<` or `..^` ranges?
18:07:12disruptekcan you provide an example?
18:09:22*hnOsmium0001 joined #nim
18:09:24FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2tII
18:10:04disruptekoh, you want it to make an array[4, uint8]?
18:10:29FromDiscord<mattrb> Didn't even realize that shorthand was allowed, cool!
18:10:30disruptekoh, you want it to make an array[5, uint8]?
18:10:37disrupteki should say. 😉
18:10:56disruptek~manual
18:10:57disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek
18:11:14disruptekdisbot: you're pretty cute, you know that?
18:11:15disbotyep. 😊
18:11:26disruptekdisbot: stay frosty, buddy.
18:11:26disboton it. 👍
18:11:34*aenesidemus joined #nim
18:11:46*opi quit (Quit: Leaving)
18:14:43FromDiscord<mattrb> To be fair, I don't believe the manual explicitly states that lol. The only place I see it used is down in the Align Pragma section... https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-align-pragma
18:15:07disruptekneat.
18:16:01FromDiscord<mattrb> Yup.
18:18:26*superbia2 is now known as superbia
18:21:59*lritter quit (Quit: Leaving)
18:22:36*nimatar joined #nim
18:26:25FromDiscord<lqdev> PRs welcome
18:29:07Zevvwell, it is kind of funny actually that ..< does not compute
18:29:28disruptekagree.
18:31:58*arecacea1 quit (Remote host closed the connection)
18:32:17*arecacea1 joined #nim
18:33:16*nimatar quit (Remote host closed the connection)
18:33:36ZevvWould this do? "An array type can be defined using the `array[count, T]` syntax, or using
18:33:40Zevv`array[lo..hi, T]` for arrays that start at an index other then zero."
18:34:04ZevvI find the nim manual not very strict on nomenclature like 'declarations' and 'definitions'
18:34:18Zevvbut that's probably because I've been infected by the filth of C standards
18:34:32disruptekdisgusting.
18:35:57Zevvis that text ok like that then
18:37:25Zevvwell then https://github.com/nim-lang/Nim/pull/15173
18:37:26disbotAdded array type definition to manual
18:37:26Zevvwhatever
18:38:04disruptekthat's your good deed for the day, zevv.
18:38:09disrupteknow you can go back to being a prick.
18:38:10ZevvI can now rest
18:38:14*Kaivo quit (Ping timeout: 256 seconds)
18:38:15disruptekor that.
18:38:21ZevvI'll do the prick-thing
18:38:26Zevvgo fix your cps boi
18:38:39disrupteki'm working on mangling.
18:38:43Zevvsomehow I don't do any of the typing, isn't that interesting
18:38:56Zevvoh work on mangling then
18:39:00Zevv++
18:39:00disruptekcps is blocked by so many things...
18:39:25*narimiran joined #nim
18:39:27Zevvno, you can just create a new proc prepend with "prick_" and use that until clyybber fixes the bugs
18:40:34*Kaivo joined #nim
18:40:44disruptekhmm, it might be worth a shot.
18:49:19FromGitter<adrianperreault> Ok, @disruptek, I've tried a few different snapshot commits and have narrowed it down a bit. ⏎ ⏎ #d6161 (Aug 1st) -- index 1 not in.. (compilation error) ⏎ ⏎ #2629d (Jul 29th) -- works fine ... [https://gitter.im/nim-lang/Nim?at=5f30452f4c89605c7f8613c7]
18:49:40disrupteknice.
18:50:31FromGitter<adrianperreault> I'll try to narrow it further if that would be helpful to you, or... suggest a commit that you think might be suspect
18:50:34disruptekthat shouldn't be hard to figure out. are you using the gitnim builds or just recompiling the compiler?
18:51:12FromGitter<adrianperreault> choosenim update "#a62bc559..." :P
18:52:04disruptek2629d works fine? wild.
18:52:17FromGitter<adrianperreault> XD... your tool rocks though
18:52:25FromGitter<adrianperreault> oh, nvm
18:52:28FromGitter<adrianperreault> ya
18:53:42*iwanttobeanimnin quit (Ping timeout: 260 seconds)
18:54:55*narimiran quit (Quit: leaving)
18:54:58*iwannagetgudatni joined #nim
18:55:05*iwannagetgudatni left #nim (#nim)
18:55:09*iwannagetgudatni joined #nim
18:55:14disruptekhmm, i don't see much that's obvious. other than clyybber's patch.
18:55:37disruptekis this only a problem in arc?
18:56:44*lritter joined #nim
18:58:23FromGitter<adrianperreault> yes
18:58:38disruptekahh.
18:58:46FromGitter<adrianperreault> latest devel compiling fine
18:59:56disruptekd130175342f2b7c1bf87dd05c86509f04cf78154?
19:00:15disruptekbasically, i'd test all of araq's commits. 😁
19:00:50disruptekbut, we're going to have to find a way to narrow down the problematic code.
19:00:54FromGitter<adrianperreault> I'll give that one a go next ;)
19:06:35FromGitter<adrianperreault> d130175342f2b7c1bf87dd05c86509f04cf78154 no worky XD
19:07:21FromGitter<adrianperreault> (Trying the commit before now)
19:11:45disruptekis it an in-house engine, or...?
19:13:09FromGitter<adrianperreault> in-house, ya, guess I'll go with that XD (not commercial... as of yet)
19:14:21FromGitter<adrianperreault> Ok, #32c614 checks out... so #d1301 is the winner
19:14:30disruptekyeah, i had a feeling.
19:15:28FromGitter<adrianperreault> Is there a way to log the names of the macros as they're being processed by the compiler?
19:15:44FromDiscord<Elegant Beef> Ah shit gitter bridge borked on discord, look crazy disruptek
19:16:00disruptekeh?
19:16:14disruptekmacros... no.
19:16:19Yardanico123
19:16:21FromDiscord<Yardanico> 123
19:16:28Yardanicoidk why FromGitter isn't transmitted lol
19:16:32FromDiscord<Elegant Beef> The gitter messages arent coming through here so you look like you're talking to yourself
19:16:39Yardanicono clue
19:16:52Yardanico!status
19:16:53FromDiscordUptime - 2 days, 22 hours, and 33 minutes
19:17:00FromDiscord<Elegant Beef> I mean you could always echo at the begining of the macro, but that's manual
19:17:07FromDiscord<Elegant Beef> Does the bridge work to gitter?
19:17:14Yardanicoyes, we see messages in IRC
19:17:17Yardanicolemme try to restart the bridge
19:17:19*FromDiscord quit (Remote host closed the connection)
19:17:32*FromDiscord joined #nim
19:17:45FromDiscord<Yardanico> 13
19:17:48FromGitter<Yardanico> 123
19:17:51Yardanicoweird
19:17:55YardanicoI
19:18:03Yardanicoi'll rollback to the old version for now
19:18:07disruptekadrian: you could try --sinkinference:off but i'm not super confident.
19:18:14*jeko joined #nim
19:18:27Yardanicorestarting it again
19:18:28*FromDiscord quit (Remote host closed the connection)
19:18:45*FromDiscord joined #nim
19:18:49FromGitter<Yardanico> 123
19:18:57Yardanicook will keep that for now
19:19:41FromGitter<adrianperreault> Sounds good Yardanico. Ok, I'll give that a go, disruptek... thanks for all the help btw :)
19:20:22disrupteki guess if it were me, i'd write some smaller tests until i found where the compiler was losing its mind.
19:20:59disruptekoh, you can play with my testes if you are feeling adventurous.
19:21:04disruptek!repo disruptek/testes
19:21:05disbothttps://github.com/disruptek/testes -- 9testes: 11a small unittest framework with decent support 🔴🟡🟢 15 2⭐ 0🍴
19:21:16FromGitter<adrianperreault> No luck with the sink inference off
19:21:30Yardanicodid you test on the very latest commit in devel?
19:21:34Yardanicoif so, try to disable cursor inference
19:21:35disruptekit can handle tests that don't compile, but you will probably still suffer crashes.
19:21:58disruptekthat's what he needs.
19:22:07disruptekwhat's the cli option?
19:22:10Yardanicobut enabling cursor inference isn't very simple
19:22:11Yardanicohttps://github.com/nim-lang/Nim/blob/devel/compiler/injectdestructors.nim#L1005
19:22:15Yardanicoyou need to comment that line :)
19:22:31FromGitter<adrianperreault> latest commit in devel as of a few hours ago
19:22:41Yardanicowell arc still has bugs, yes
19:22:59Yardanicohttps://github.com/nim-lang/Nim/issues/15122 https://github.com/nim-lang/Nim/issues/15147 are the ones which are open
19:23:01disbot[ARC] SIGSEGV with tuple unpacking caused by cursor inference ; snippet at 12https://play.nim-lang.org/#ix=2tJo
19:24:29FromGitter<adrianperreault> Would it be feasible for me to hack some echo statement somewhere in the compiler to get the name of the macro? Or is that not really how it works?
19:25:07disrupteki mean, sure.
19:25:21Yardanicowait with --gc:arc it crashes at comptime?
19:25:27disruptekyeah.
19:25:36Yardanicohrm
19:25:49disruptekit's likely not a macro, though, but the arc xfrm.
19:25:53FromGitter<adrianperreault> "Error: unhandled exception: index 1 not in 0 .. 0 [IndexDefect]"
19:26:10Yardanicowell you can try to minimize the tests/code :)
19:26:28disruptekthat's what i suggest as well. it will have more utility to you going forward.
19:27:01disruptekyou might be able to narrow it down to a particular file using `nim check`.
19:27:19disrupteki doubt it, though. 🙁
19:27:51FromGitter<adrianperreault> Alrighty. I'll start commenting out stuff
19:28:45disruptekpretty rare problem.
19:35:54*Vladar quit (Quit: Leaving)
19:36:57*lritter quit (Quit: Leaving)
19:51:51*Kaivo quit (Ping timeout: 256 seconds)
19:59:09*NimBot joined #nim
20:18:54*hnOsmium0001 quit (Quit: Connection closed for inactivity)
20:35:15*s4mu3lbk joined #nim
20:47:30FromGitter<adrianperreault> Alrighty... sniffed out the problem... she compiles again on the latest devel with arc :) ⏎ ⏎ https://pastebin.com/0K6fM4dK
20:54:43FromGitter<benash> Hi everyone, did the `jsonName` pragma ever make it into the codebase? I'm new to nim, experimenting with json unmarshalling, and looking for a way to handle keys that start with underscore. Here's the related (closed) PR: https://github.com/nim-lang/Nim/pull/11416/files
20:54:45disbot`doNotSerialize`, `jsonName` pragmas for JSON serialization closes #8104, #10718, also fixes #11415 ; snippet at 12https://play.nim-lang.org/#ix=24Gg
20:54:54Yardanicono
20:59:49FromGitter<benash> Got it, I took a closer look and saw some people preferring to wait till this one is merged: https://github.com/nim-lang/Nim/pull/11526
20:59:50disbotgetCustomPragma is split up in more usable chunks
21:02:16FromGitter<ServiceDog_gitlab> Newer to Nim, had a question: I'm aware that for procedures, passing by reference is possible through `proc fxn(x: var string)` (including var). Say though that I wanted to store a reference to a stack variable in a table, so that later I can iterate through the table and assign values to those variables. As far as I can tell, there's no C++-esque '&x' syntax to store a reference or address of a variable
21:02:16FromGitter... that's on the stack without having to declare custom types that use the 'ref' keyword. Is there documentation on this that I've missed?
21:02:40disruptekaddr somevarOnstack
21:08:51FromGitter<ServiceDog_gitlab> would the resulting type be 'ptr string'? Looking at https://nim-lang.org/docs/system.html#addr%2CT, getting an error saying an ordinal type is expected; does it not work with strings?
21:09:14Yardanicohow are you calling addr?
21:09:17Yardanicoand btw, addr is unsafe :)
21:09:28Yardanicobecause generally it's unsafe to get pointers to variables on the stack
21:09:28FromGitter<ServiceDog_gitlab> x.addr
21:09:38Yardanicoit should work just fine if "x" is a "var"
21:10:42nikita`which nim compiler switch do i want to make bootstrap of koch more verbose than this in a sandboxed build:
21:10:45nikita`fatal.nim(49) sysFatal
21:10:48nikita`Error: unhandled exception: value out of range: -1 notin 0 .. 9223372036854775807 [RangeError]
21:10:57Yardanico./koch temp
21:11:07Yardanico./koch temp c path/to/file.nim
21:11:52nikita`ok but this is for building koch from source. ommitting lots of code before that, for us it's ./bin/nim c --skipUserCfg --skipParentCfg koch
21:12:11nikita`i forgot to add, while building nim for a system as a packager
21:12:21Yardanicooh, bootstrap of koch
21:12:24Yardanicohrm, very weird
21:12:29nikita`yeah
21:12:34nikita`outside it works just fine
21:13:31nikita`https://github.com/NetBSD/pkgsrc/blob/trunk/lang/nim/Makefile#L28
21:20:03nikita`of course i could be wrong, i don't know anymore where i sourced these lines from. i see gentoo doesn't do all of them
21:21:27nikita`i think the --skip* were added to prevent picking up other configs
21:21:41*natrys quit (Quit: natrys)
21:26:43*opal quit (Ping timeout: 240 seconds)
21:32:16FromGitter<adrianperreault> "oh, you can play with my testes if you are feeling adventurous." -- disruptek ⏎ 😲... XD... What a name... 😂 ⏎ ... testes looks great but dayuum... your cps is what really excites me
21:39:50*solitudesf quit (Ping timeout: 264 seconds)
21:44:01*tane quit (Quit: Leaving)
21:45:37FromDiscord<mattrb> Hey, I can't seem to find docs on this but I might be searching in the wrong place. How would I define a function that takes a type and returns an instance of that type? For example, a proc that takes the _type_ `uint8`, which would return some `uint8`?
21:45:51YardanicoI don't know if that's actually possible
21:45:55Yardanicotypes are a compile-time only thing
21:46:01Yardanicoidk if a compile-time proc will work
21:46:05Yardanicoyou can try with a macro
21:46:13FromDiscord<mattrb> How would I define that with a macro?
21:47:11FromDiscord<mattrb> Eh, it's not really actually that important. I'll just write a few procs :p
21:47:20FromDiscord<mattrb> Just thought it would be cool :p
21:48:17*s4mu3lbk quit (Remote host closed the connection)
21:48:24FromDiscord<Rika> yardanico: cant you do `proc a(t: typedesc): t`?
21:48:28Yardanicoidk :)
21:49:06FromDiscord<Rika> !eval proc a(t: typedesc): t = discard; echo typeof a(uint8);
21:49:07NimBotCompile failed: /usercode/in.nim(1, 56) Error: invalid indentation
21:49:15FromDiscord<Rika> eeeeeeeeeeee
21:49:20Yardanicohehe
21:49:23FromDiscord<Rika> do i have to () the proc
21:49:29FromDiscord<Rika> i'm lazy to fix this
21:50:47FromGitter<benash> Hi, would anonymous types ever be possible in Nim, e.g.: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5f306fb6d28b99685e52eb05]
21:51:01Yardanicothere are tuples
21:51:44FromDiscord<Rika> tuples in nim can be named (aka fields can have names)
21:52:02FromDiscord<Rika> so tuple[city: string, country: string]
21:52:21Yardanicobut really @benash I don't think it would be supported
21:52:28Yardanicoyou can just easily declare another type
21:57:57FromGitter<benash> Got it, so `tuple` with `[ ]` would do it
21:59:57FromGitter<benash> But this wouldn't work: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5f3071dc9b76045d5b8b6444]
22:00:08Yardanicoyes, for that you need []
22:00:20Yardanicotuple[city: string, country: string]
22:01:17*oprypin quit (Quit: Bye)
22:01:26*oprypin joined #nim
22:02:03FromGitter<benash> Makes sense. Any simple rule of thumb for deciding between tuples and objects?
22:04:35FromDiscord<Rika> not really i dont think
22:04:55FromDiscord<Rika> choose whichever works best for you (imo that would usually be an object)
22:05:25FromGitter<benash> OK, got it.
22:20:33disruptekadrianperreault: yeah, cps could be huge.
22:21:59disruptek!last clyybber
22:22:01disbotclyybber spoke in 12#nim 7 hours ago 12https://irclogs.nim-lang.org/09-08-2020.html#14:50:35
22:24:51FromDiscord<Clyybber> disruptek: sup sup
22:26:22*stefantalpalaru quit (Quit: ZNC 1.7.5 - https://znc.in)
22:26:30*stefantalpalaru joined #nim
22:26:46FromGitter<adrianperreault> Most definitely. Massive potential in that direction.
22:26:56*arecacea1 quit (Remote host closed the connection)
22:27:39*arecacea1 joined #nim
22:27:39disruptekclyybber: my proc types have unique ids but they differ only by pragma; the c++ backend encodes their type names and then the signatures don't match. 🤦
22:27:54disruptekthis is mangling stuff.
22:31:21FromDiscord<Clyybber> hmm
22:31:27disruptekbenash: use objects unless you have a reason not to.
22:31:28FromDiscord<Clyybber> how does the C backend do it
22:31:30FromDiscord<Clyybber> wait
22:31:35FromDiscord<Clyybber> how can they differ by pragma
22:31:38FromDiscord<Clyybber> if they are the same
22:31:44disruptekthe c backend doesn't use the first arg in signatures.
22:31:51*clyybber joined #nim
22:32:34disrupteki think mangling only fails 2 tests now. both cpp and both due to the same problem.
22:32:57FromDiscord<Clyybber> damn, nice!
22:33:26FromDiscord<Clyybber> I don't think I entirely understood the problem yet
22:33:39FromDiscord<Clyybber> so the two proc types have different ids?
22:33:52disruptekdifferent uniqueIds, yes.
22:33:59FromDiscord<Clyybber> and different pragmas?
22:34:13disruptekyes. one is closure and i forget what the other is.
22:34:14disrupteknoconv
22:34:20FromDiscord<Clyybber> but they should still have the same signature?
22:34:29disruptekand they do, afaik.
22:34:36FromDiscord<Clyybber> but should they?
22:34:44disruptekunless the tests are broken.
22:35:31FromDiscord<Clyybber> hmm
22:36:14FromDiscord<Clyybber> > /usr/home/build/Nim/compiler/mangler.nim(168, 48) Error: generic instantiation too nested↵oof
22:36:28disruptekhow did you get that?
22:36:47clyybberI looked at your PR
22:36:55clyybberI wanted to see which test it is that fails
22:37:06disruptekit's texitprocs.
22:37:16disruptekthat's the simplest one, and the one i include debugging for.
22:37:46disruptekit'll `debug sometype` for the offenders.
22:38:13clyybberah ok
22:38:33clyybberI don't quite understand how they can end up with the same signature
22:38:39clyybberafaict they have different names
22:38:42clyybberfun1 vs fun2
22:38:56disruptekit's the proc type that is the problem.
22:39:07disruptekwe rename it to pro_1233434 (some uniqueId)
22:39:22clyybberaah
22:39:41clyybberso fun1/3 and fun2/4 should share it but don't?
22:40:06disrupteki never actually looked at the test, i don't think.
22:40:13clyybberheh
22:40:46disruptekah, yes.
22:40:54clyybberi'm blue on discord \o/
22:41:11clyybberzima blue
22:41:18disruptekthey should all work, in theory, but addExitProc doesn't take more than one type of proc as input.
22:42:58clyybberbut theres two addExitProc
22:43:07clyybberone for noconv and one for closure
22:43:33disruptekgood.
22:43:59disruptekbut we're only compiling one version.
22:44:15clyybbermaybe thats the problem
22:45:00disruptekaddExitProc_pro_5855060_stdlib_exitprocs(fun1_5866014_texitprocs);
22:45:53disruptekoh that's c.
22:46:41disrupteklooks correct in both cases.
22:48:36disruptekthe problem is that the compiler is only generating symbols for addExitProc_pro_5835056_stdlib_exitprocs11pro_5831021 and not addExitProc_pro_5835056_stdlib_exitprocs11pro_5835056
22:48:39*krux02 quit (Remote host closed the connection)
22:49:15clyybberhmm
22:53:45disruptekthe stdlib prototype: N_LIB_PRIVATE N_NIMCALL(void, addExitProc_pro_5835056_stdlib_exitprocs)(pro_5831021 cl)
22:54:13*iwannagetgudatni quit (Quit: leaving)
22:54:28disruptekbut this is the declaration in the test.cpp: N_LIB_PRIVATE N_NIMCALL(void, addExitProc_pro_5835056_stdlib_exitprocs)(pro_5835056 cl);
22:54:58*theelous3 joined #nim
22:55:30disruptekso, it's our fault, but how?
22:55:35disrupteka rewrite somewhere?
23:04:10clyybberhmm
23:04:28clyybberso it ends up in stdlibwhatever.cpp *and* in test.cpp?
23:05:49clyybberhttps://www.youtube.com/watch?v=Xis7RT7JCDA
23:06:30disruptekit's like we give it a prototype after defining the type in the test.cpp.
23:07:11disruptekthen it's getting a proto according to our new type names, which renames the proc but not its param.
23:07:26disruptekor something.
23:14:29disruptekmaybe assignParam is over-reaching.
23:24:10clyybberdamnit, can't think anymore
23:24:41clyybberbest of luck with that bug, I'll be sleeping
23:24:46clyybbergood night
23:24:47disruptekaight, gn
23:24:50*clyybber quit (Quit: WeeChat 2.9)
23:44:51*stefantalpalaru quit (Changing host)
23:44:51*stefantalpalaru joined #nim
23:58:10*vicfred quit (Quit: Leaving)
23:59:18*vicfred joined #nim