<< 26-01-2020 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:00:49*junland joined #nim
00:05:16*disruptec joined #nim
00:09:40disruptecso we can build compile nim tests in 100mb of ram but i have a feeling we will need a little more oomph for linking.
00:09:52disruptecs/build//
00:11:01*krux02_ joined #nim
00:14:48*krux02 quit (Ping timeout: 260 seconds)
00:16:17*gangstacat quit (Quit: Ĝis!)
00:18:27FromGitter<kennymalac> hey, best practices for destructing objects you intend to use as as ref objects ?
00:18:34FromGitter<kennymalac> thinking TaskSink* = ref TaskSinkObj
00:18:38FromGitter<kennymalac> and then TaskSinkObj = object
00:18:50FromGitter<kennymalac> and all methods refer to self as var TaskSinkObj ?
00:24:28*Guest50261 quit (Ping timeout: 265 seconds)
00:26:19disruptecno, you will use the ref for most ops and then sink the obj.
00:29:53*dadada joined #nim
00:30:17*dadada is now known as Guest93348
00:33:35*ptdel_ joined #nim
00:34:27*ptdel quit (Ping timeout: 268 seconds)
00:36:15*ptdel joined #nim
00:36:36*ptdel_ quit (Read error: Connection reset by peer)
00:38:55Yardanicodisruptec: what happened to disruptek?!?!
00:47:47disrupteche aroun'
00:50:25FromGitter<kennymalac> @disruptec so what about in the destructor? in the destructor I need to call a couple of methods, should those methods refer to the obj then?
00:50:57disruptecyeah; the destructor runs on the obj.
00:52:44FromGitter<kennymalac> okay thanks
00:53:02FromGitter<kennymalac> on an unrelated note, my startup is using nim heavily in our stack, it's our secret weapon >:)
00:53:44disruptecwhat's the product?
00:54:16*Trustable quit (Remote host closed the connection)
00:55:27FromGitter<kennymalac> a big data visualization platform for creating dashboards with their own pages and APIs
00:55:53disruptecnice.
01:00:47*Hideki_ joined #nim
01:03:29*ng0 quit (Quit: leaving)
01:04:47*lritter quit (Ping timeout: 265 seconds)
01:05:03*lritter joined #nim
01:09:31leorizeI guess we need better integration of destructors with ref objects
01:14:16*ng0 joined #nim
01:14:16*ng0 quit (Changing host)
01:14:16*ng0 joined #nim
01:19:02*theelous3 quit (Ping timeout: 268 seconds)
01:29:43*ng0 quit (Ping timeout: 265 seconds)
01:33:34*Hideki_ quit (Remote host closed the connection)
01:33:48*Hideki_ joined #nim
01:43:00disrupteci really hope this plague doesn't reach brussels.
02:03:27*couven92 quit (Quit: Client Disconnecting)
02:04:55disruptekwhat's wrong with our destructors and ref objects?
02:05:40disruptekkennymalac: if we can help, don't hesitate to reach out.
02:44:28*cron joined #nim
02:45:00leorizedisruptek: we don't have any syntax to define destructors for ref objects
02:46:25FromDiscord_<Kami> lol
02:46:32FromDiscord_<Kami> how fucking unpopulated is this language
02:52:53*lritter quit (Ping timeout: 260 seconds)
03:01:13*Hideki_ quit (Remote host closed the connection)
03:01:58*Hideki_ joined #nim
03:04:47FromGitter<zetashift> what does that even mean, even the cursing seems unnecessary
03:06:35*Hideki_ quit (Ping timeout: 265 seconds)
03:15:39Zevvleorize: how do you mean? Is `=destroy(o: var obj)` not enough?
03:15:41*Hideki_ joined #nim
03:16:04leorizeZevv: type Obj = ref object
03:16:17leorizethat's a valid pattern that we should support
03:23:46disrupteci think the language shouldn't abstract the fact that memory is memory.
03:28:41Zevvleorize: I dont understand your problem. It destructs ref objects fine, but you want to be able to differentiete between object destructors and ref object destructors?
03:40:43*disruptec quit (Ping timeout: 260 seconds)
03:47:41*muffindrake quit (Ping timeout: 246 seconds)
03:50:01*muffindrake joined #nim
03:52:21*a_chou joined #nim
03:53:09*a_chou quit (Remote host closed the connection)
03:53:36*a_chou joined #nim
03:57:33*a_chou quit (Remote host closed the connection)
03:59:04*Hideki_ quit (Remote host closed the connection)
03:59:50*Hideki_ joined #nim
04:01:18leorizeZevv: you can't define a destructors for a type Obj = ref object
04:01:33leorizeyou gotta use the old style type Obj = object; Ref = ref object
04:04:38*Hideki_ quit (Ping timeout: 260 seconds)
04:23:53disruptekbut that's /what it is/.
04:24:25disruptekit's not a ref when you're operating on it in a destructor. it's a chunk of memory, not a pointer.
04:25:02FromDiscord_<demotomohiro> @leorize you can define a destructor for ref object types like this:
04:25:02FromDiscord_<demotomohiro> https://wandbox.org/permlink/RtqOIvY4WsKY0hxK
04:26:14disruptekmadness.
04:28:59*chemist69 quit (Ping timeout: 246 seconds)
04:31:17*chemist69 joined #nim
04:33:24*gangstacat joined #nim
04:33:45*krux02_ quit (Remote host closed the connection)
04:35:33*Guest93348 quit (Ping timeout: 260 seconds)
04:37:21*dadada joined #nim
04:37:45*dadada is now known as Guest76816
06:16:33*narimiran joined #nim
06:37:44*dddddd quit (Remote host closed the connection)
06:38:50*nsf joined #nim
06:40:03*Pqzcih5 quit (Remote host closed the connection)
07:46:22*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
07:50:22*solitudesf joined #nim
07:59:22ZevvAh now I get your point. If you definition skips the object itself, you do not have the type available to pass to the =destruct
08:00:00*gmpreussner quit (Quit: kthxbye)
08:05:12*gmpreussner joined #nim
08:27:09*nsf quit (Quit: WeeChat 2.7)
08:35:52*cron quit (Quit: Leaving.)
08:41:42*ng0 joined #nim
08:41:48*ng0 quit (Changing host)
08:41:48*ng0 joined #nim
08:55:57*Vladar joined #nim
09:52:53*tane joined #nim
09:55:36*nsf joined #nim
10:00:04*libercv joined #nim
10:02:01FromDiscord_<Zachary Carter> so thinking more bout my issue - I don't think parallelism is going to help me
10:02:20FromDiscord_<Zachary Carter> right now I have a bottleneck in my procedural level generation, where pathfinding on larger maps is taking forever
10:02:45FromDiscord_<Zachary Carter> but I can't parallelize the pathfinding, because the next pathfinding iteration is dependent on the previous one having been completed
10:03:10FromDiscord_<Zachary Carter> so I guess I need to either optimize the pathfinding algorithm implementation or figure out a way to not perform so many iterations
10:03:23FromDiscord_<Zachary Carter> essentially I have a map which represents a spaceship with a bunch of rooms
10:03:31FromDiscord_<Zachary Carter> so I iterate over all of the rooms twice and run A* between them
10:03:44FromDiscord_<Zachary Carter> to figure out where I can place hallways / corridors between the rooms
10:10:57*liber joined #nim
10:11:38*liber quit (Client Quit)
10:14:25Zevvhttps://factorio.com/blog/post/fff-317
10:14:30Zevvzachary ^
10:19:45FromDiscord_<Zachary Carter> thanks! I'll check this out
10:32:44*libercv quit (Quit: Leaving)
11:15:27*chemist69 quit (Ping timeout: 260 seconds)
11:16:30*chemist69 joined #nim
11:24:19*NimBot joined #nim
11:28:17*narimiran quit (Ping timeout: 265 seconds)
11:53:50*krux02 joined #nim
12:02:39*couven92 joined #nim
12:09:50*Hideki_ joined #nim
12:24:10*nsf quit (Quit: WeeChat 2.7)
12:24:57*dddddd joined #nim
12:27:26*Hideki_ quit (Remote host closed the connection)
12:35:26*dddddd_ joined #nim
12:37:41*dddddd quit (Ping timeout: 265 seconds)
12:37:57*dddddd_ is now known as dddddd
12:54:44Yardanicobtw, what's the status of --gc:arc with async? should I test it or it's too early? :P
12:54:53Yardanicovalgrind + -d:useMalloc --gc:arc right?
13:17:23Zevvright
13:22:52Zevvright
13:23:54Yardanicook xd
13:24:34Zevvnah that was a mere up+enter in the wrong window :)
13:40:43*nsf joined #nim
14:18:07*Jesin joined #nim
14:21:17*couven92 quit (Read error: Connection reset by peer)
14:21:42*couven92 joined #nim
14:35:35Yardanicodamn forum.nim-lang.org's main JS script is compiled by 0.18.1 lol
14:35:37Yardanico"/* Generated by the Nim Compiler v0.18.1 */"
14:44:26*Hideki_ joined #nim
14:56:36*sentreen quit (Ping timeout: 265 seconds)
14:57:20FromDiscord_<Recruit_main_70007> parseInt() doesnt work with a cstring?
14:57:27FromDiscord_<Recruit_main_70007> what should i use then
14:57:54*sentreen joined #nim
14:59:10*jholland__ joined #nim
14:59:16FromDiscord_<Rika> convert it to a string i think?
14:59:36FromDiscord_<Recruit_main_70007> how?
15:01:05Zevv$ it
15:01:11ZevvparseInt($v)
15:02:01FromDiscord_<Recruit_main_70007> thx
15:03:12*lritter joined #nim
15:04:48FromDiscord_<Recruit_main_70007> i dont know if this is intended,
15:04:49FromDiscord_<Recruit_main_70007> you have to call it this way:
15:04:49FromDiscord_<Recruit_main_70007> parseInt($currentval)
15:04:49FromDiscord_<Recruit_main_70007> and
15:04:49FromDiscord_<Recruit_main_70007> $currentval.parseInt()
15:04:49FromDiscord_<Recruit_main_70007> wont work.
15:07:17Yardanicobecause ambiguity I think
15:07:29Yardanicodoes $ here relate to currentval or result of parseInt ?
15:07:37Yardanico($currentval).parseInt will work btw
15:09:22FromDiscord_<Recruit_main_70007> thats enough for me, i think it would be nice if those parenthesis were not neccesary though
15:09:38Yardanicowell as I said it would be ambiguous
15:10:09FromDiscord_<Recruit_main_70007> why
15:10:35Yardanicoshould it do $ on currentvar.parseInt()
15:10:42Yardanicoor on currentvar and then parseInt?
15:11:44Yardanicowell I think that it's because of this
15:11:55*theelous3 joined #nim
15:12:15FromDiscord_<Recruit_main_70007> do you prefer to have those parenthesis, rather than using one of those two as a default way of parsing it?
15:12:30Zevv$ has lower precedence.
15:12:33Yardanico^
15:12:47YardanicoI think it would actually break code if you were to change that, and some other horrible things
15:13:29Zevvthe precedence of $ is usually right, there is a reason why it is what it is
15:14:23FromDiscord_<Recruit_main_70007> oh, ok, i feel like that should not be that way, but who am i to decide how it should go, thats the only syntax dislike i have of nim for know
15:14:42FromDiscord_<Recruit_main_70007> now*
15:14:49Zevvfor exmple, what would you expect from $time.now()
15:15:41FromDiscord_<Recruit_main_70007> true, it basically depends on what are you trying to do
15:19:17*ng0_ joined #nim
15:19:17*ng0_ quit (Changing host)
15:19:17*ng0_ joined #nim
15:22:13*ng0 quit (Ping timeout: 265 seconds)
15:28:59*nsf quit (Quit: WeeChat 2.7)
15:34:24*Hideki_ quit (Remote host closed the connection)
15:35:11*Hideki_ joined #nim
15:39:51FromDiscord_<Rika> ah, classic "importing monotimes" again
15:40:06*Hideki_ quit (Ping timeout: 265 seconds)
15:51:16*couven92 quit (Read error: Connection reset by peer)
15:51:43*couven92 joined #nim
15:54:56*Hideki_ joined #nim
16:08:14*disruptec joined #nim
16:17:12*abm joined #nim
16:30:10*ptdel joined #nim
16:41:05*cron joined #nim
16:47:14*Hideki_ quit (Remote host closed the connection)
16:48:01*Hideki_ joined #nim
16:52:36*Hideki_ quit (Ping timeout: 265 seconds)
17:00:17*Hideki_ joined #nim
17:02:01*Hideki_ quit (Remote host closed the connection)
17:02:46*Hideki_ joined #nim
17:04:23*nsf joined #nim
17:07:23*Hideki_ quit (Ping timeout: 265 seconds)
17:15:29disruptekleorize: seems like ]## isn't terminating the comment syntax.
17:30:19*Guest76816 is now known as dadada
17:41:46*Hideki_ joined #nim
17:47:05*dadada quit (Remote host closed the connection)
17:47:46*couven92 quit (Read error: Connection reset by peer)
17:48:12*couven92 joined #nim
17:55:00*seni joined #nim
17:57:32AraqI'm back.
17:57:41disruptekwb
17:57:51Araqgot the binary trees benchmark down to 7.8s
17:58:08disruptekthat's, like, a real performance win.
17:58:09Araqmanual alloc() is still 1s faster
17:58:25disruptekwithin striking distance, though.
17:58:40Araqyup
17:58:59disruptekwhat did you change?
17:59:14Araqbut with =destroy I can also implement object pooling and then I'm at 2.4s
17:59:39disruptekthat always was the promise of this architecture.
18:00:00disruptekanyway, what's avoiding manual alloc worth to you?
18:00:24Araqquite a lot, MM is a hard problem
18:00:37disruptekyes. i don't mind waiting another second.
18:01:31disrupteki think we'll be able to do pools and stuff automagically.
18:01:57Araqquite.
18:02:11AraqI have some ideas how to do that, yes
18:02:24Araqbut currently it's semi-manual, very nice too
18:03:04disruptekyeah, people have to look at this stuff with a longer development horizon.
18:03:25disruptekthat's why i don't understand the consternation...
18:04:39Araqanyhow the pool is 30 lines of code
18:04:45Araqcould put it into the stdlib
18:05:45disruptekseems like it's too early; don't want it to become day-one-debt.
18:06:03disruptekthere's so much room to manuever right now.
18:06:25Araqwe have std / x though and 'std' means 'experimental'
18:06:31Araq:P
18:06:39disruptekonly in araqlogic.
18:07:12Araqthe other logics are all defective
18:07:17disruptekmy sub-3s ci is running at 15s. so far, you're right. but it is early days.
18:07:53Araqso... does nimph run with --gc:arc?
18:08:00disrupteknot unless you fixed nre.
18:08:12Yardanicohe did
18:08:37Yardanicoand btw, why not nim-regex? it didn't work for you?
18:08:46YardanicoI mean https://github.com/nitely/nim-regex
18:09:09Yardanico"syntax is similar to PCRE but lacks a few features that can not be implemented while keeping the space/time complexity guarantees, i.e.: backreferences and look-around assertions."
18:09:35disruptekbecause i wanted bump to not have the extra requirement. nimph didn't exist and reqs were a pita.
18:09:53*cron quit (Quit: Leaving.)
18:10:02Yardanicobut I think having a nim lib as a requirement is better than having a pcre lib as a requirement :D
18:10:03*salewski joined #nim
18:10:19disruptekbump works in arc.
18:10:25*Hideki_ quit (Ping timeout: 265 seconds)
18:10:54disruptekyou're right, of course.
18:10:59disrupteknimph works in arc.
18:11:15Araqbetter wait for the CI results
18:11:30Yardanicojust clone all nim libs/projects from github and check them all with --gc:arc XD
18:11:50Yardanicowasn't there a repo where some guy made a local distro made out of all packages in nimble
18:11:55YardanicoI can't remember the name of that repo now
18:11:57disruptekso the way my ci works is that you can use lambda layers to create "distributions".
18:12:26disruptekyou mix/match up to 5 layers with the compiler of choice.
18:12:42disruptekobviously, this can all happen JIT.
18:13:26FromGitter<kennymalac> Hey all, how do I get a ptr to a C-style array? nim-zmq does this to call zmq's poll function: proc poll*(items: ptr TPollItem, nitems: cint, timeout: clong): cint{. ⏎ cdecl, importc: "zmq_poll", dynlib: zmqdll.}
18:13:36disruptekso every git tree for every package, including the compiler, is a layer. and layers can mix even if they overwrite each other.
18:13:49FromGitter<kennymalac> I have an array like so let items: array[2, TPollItem] = [TPollItem(...), ...]
18:14:08FromGitter<Yardanico> addr items[0]
18:14:14FromGitter<kennymalac> trying to do poll(addr(items), 2, -1)
18:14:25FromGitter<kennymalac> oh okay
18:14:41FromGitter<Yardanico> well I think it should work with addr items[0], basicall you get the pointer to the first element in an array
18:14:47FromGitter<kennymalac> indeed
18:15:09disruptekAraq: great work.
18:16:25salewskigcc 10 can generate really small executables!
18:16:34salewskinim c --gc:arc -d:danger --passC:-flto board.nim
18:16:59Yardanicodoes code compiled with LTO benefit both in binary size and performance?
18:17:01salewskiExecutable size is only 126k, was 154k with gcc 9.2
18:17:26Yardanicolike is it worth using it in nim programs (well, of course where most performance is needed) ?
18:17:28disruptekis it tree shaking?
18:18:33salewskiPerformance is generally good for LTO, but with gcc 9.2 I had a test where performance without LTO was better.
18:18:40Yardanicohttps://github.com/search?q=language%3Anim+--gc%3Aarc&type=Code
18:18:51Yardanicosome packages already run tests with --gc:arc too :P
18:19:32FromGitter<kennymalac> @Yardanico I still get Error: expression has no address; maybe use 'unsafeAddr'
18:19:38Yardanicoah right
18:19:38salewskiWill push ARC enabled gintro version tomorow, bye.
18:19:42Yardanicoyou should declare it as "var", not "let"
18:19:44*salewski quit (Quit: WeeChat 2.6)
18:19:46FromGitter<kennymalac> oh shit
18:19:55FromGitter<kennymalac> I shouldn't be calling it items as well XD
18:20:09Yardanico"let" is considered immutable, and you can't get it's pointer with "addr"
18:20:15Yardanicoyou can with unsafeAddr, but you really shouldn't xd
18:20:33FromGitter<kennymalac> ye
18:21:04Yardanicodisruptek: btw, I found out cutelog, looks nice
18:21:17Yardanicoalthough I made this little snippet for myself for simple logging https://gist.github.com/Yardanico/0bcf50c05b71ae8990529ea0913ac068
18:21:40FromGitter<kennymalac> is one of the guys behind the nim mongodb client here?
18:21:54FromGitter<kennymalac> it's incomplete and I was thinking at some point I could sponsor the project
18:21:58Yardanicoyou mean SSPkrolik?
18:22:15FromGitter<Yardanico> @SSPkrolik ^
18:22:24FromGitter<Yardanico> i'm not sure if he's active here though, never seen him really
18:22:57FromGitter<Yardanico> maybe you can try opening an issue in the repo
18:23:17Yardanicohonestly as bad as it sounds I wouldn't mind it if GitHub had a private message feature
18:23:35Yardanico(of course with the ability to turn it off if you don't want to)
18:24:52FromGitter<kennymalac> indeed
18:24:58FromGitter<kennymalac> does github sponsors charge fees?
18:25:22Yardanico"GitHub will not charge fees for GitHub Sponsors. And to celebrate the launch, we’ll cover payment processing costs for the first year of the program—through May 2020! "
18:25:34FromGitter<kennymalac> nice
18:26:15Yardanicoalthough minimal payout is $100
18:34:11FromGitter<kennymalac> I could probably do $100/month
18:34:21FromGitter<kennymalac> well, my company :P
18:35:18Yardanicowell, sadly it seems like the author didn't really do any changes himself for a very, very long time
18:36:03FromGitter<kennymalac> https://github.com/SSPkrolik/nimongo/issues/80
18:36:04disbotGithub sponsors for this repo
18:36:09FromGitter<kennymalac> added an issue
18:36:19Yardanicowell, he did one code change in 2018 (to fix nim 0.19) and one change in 2016
18:36:22Araqhe switched carriers
18:36:27Yardanicoall others are either doc changes or merges
18:36:32Araqhe is a teacher now iirc
18:36:44FromGitter<kennymalac> carriers?
18:36:49FromGitter<kennymalac> oh careers
18:36:49Yardanicocareers :P
18:36:59Araqyeah, too tired
18:37:00Araqsorry
18:37:04YardanicoI think that most people in this chat are not native english speakers anyway :)
18:37:25Araqin my defense, I knew it was wrong :P
18:37:31FromGitter<kennymalac> winners don't say sorry @Araq and you're a winner
18:37:56disruptek~araq
18:37:57disbotaraq: 11👑 the powers that He 👑 -- disruptek
18:38:16FromGitter<kennymalac> yeah we're using mongodb and nim, we probably have to use the mongo HTTP API which kind of sucks
18:38:22YardanicoI prefer not to ping important people unless there's a reason to :P
18:38:26FromGitter<kennymalac> and is slow in comparison
18:38:33Yardanicojust do it like ar*q or d0m96
18:39:00FromGitter<kennymalac> ehh I highlite people all the time on IRC just using gitter because I don't do freenode
18:39:04Araqkennymalac: please ask on Nim's forum
18:39:09disruptekkennymalac: there's no mongo adapter?
18:39:18Yardanicodisruptek: there is, but it's far from being complete
18:39:19FromGitter<kennymalac> there is, but it's incomplete. so would like to sponsor
18:39:22FromGitter<kennymalac> :)
18:39:24AraqI'm sure somebody will volunteer to develop nimmongo2 for you under sponsoring
18:39:42Araqin the worst case I'll make narimiran do it :P
18:39:44disrupteksure, what's it worth to you?
18:41:00FromGitter<kennymalac> probably a lot at a certain point, if my company is successful I will try to make the nim community more successful to, as it is our secret weapon here
18:41:09FromGitter<kennymalac> well, *when* not if ;)
18:41:14disrupteksounds like you should hire me.
18:41:19Yardanicolol
18:41:27disruptek😉
18:41:42Araqkennymalac do you use ARC?
18:41:46disruptekbut first i wanna finish this ci. i think it's gonna be killer.
18:41:51Yardanico@kennymalac if you didn't do it yet please add your company to https://github.com/nim-lang/Nim/wiki/Companies-using-Nim :)
18:42:08Araqor don't if it's your secret weapon :-)
18:43:08FromGitter<kennymalac> I haven't tried it out yet araq
18:43:50FromGitter<kennymalac> but I probably should because I was trying to copy into a closure into a separate thread and someone told me that's just not possible with the default GC.
18:45:50Araqah yeah
18:49:11FromGitter<kennymalac> started a thread here: https://forum.nim-lang.org/t/5862#36344
18:50:13FromGitter<kennymalac> @disruptek will poke around here a lot, will poke even more if I need nim devs. lol
18:50:19FromGitter<kennymalac> s/if/when
18:50:50disrupteknice, we'll keep our fingers crossed.
18:55:50FromGitter<kennymalac> where are you from again araq?
18:56:06Yardanicogermany i guess?
18:57:36Araqyes
18:58:38FromGitter<kennymalac> nice
19:00:52*Trustable joined #nim
19:04:51Araqif you say so... ;-)
19:07:57*ptdel quit (Read error: Connection reset by peer)
19:18:04*nsf quit (Quit: WeeChat 2.7)
19:19:10FromGitter<kennymalac> oh just and I guess
19:19:35chemist69Hi, how do I use `runnableExamples` in a module that needs to be compiledin cpp mode and needs linking to a shared library?
19:19:57FromGitter<kennymalac> nvm https://nim-lang.org/docs/bitops.html#testBit%2CT%2CBitsRange%5BT%3A+SomeInteger%5D
19:20:54*narimiran joined #nim
19:22:14FromGitter<deech> Nim docs transform comma separators between arguments in a `proc` to semicolons, is this valid syntax?
19:22:29disruptekyep, i prefer it.
19:22:36FromGitter<deech> Nice.
19:23:16YardanicoI really don't get how a guy in code-golf made so short nim code
19:23:24Yardanicolike task "An odious number is a non-negative number that has an odd number of 1s in its binary expansion.Print all the odious numbers from 0 to 50 inclusive, each on their own line."
19:23:28Yardanicohe did it in 37 characters in Nim
19:24:14Yardanicowith countSetBits from bitops I can do it in 58 chars
19:24:26FromGitter<deech> Yeah I saw that, biggest takeaway was that Nim syntax can be made insensitive to indentation with parens and semicolons.
19:24:41Yardanicoalso kinda funny but "for x in..50:" works (no spaces after in and no 0)
19:24:50Yardanico@deech well yeah, but 37 still seems too low
19:24:52Yardanicoto be true xd
19:24:53*marmotini_ joined #nim
19:25:14*couven92 quit (Read error: Connection reset by peer)
19:25:41*couven92 joined #nim
19:25:53FromGitter<deech> Haha yeah, I don't like Python like indentation and now I know I don't have to use it. Wonder if nimpretty can still format it.
19:26:16Yardanicopls don't use semicolons or parens for indentation in real nim code though :((
19:26:27Yardaniconim also had syntax skins before but they were removed for obvious reasons
19:26:32Yardanico(yes, you could literally write nim with BRACES)
19:26:42FromGitter<deech> Why? It's valid syntax.
19:27:01FromDiscord_<DeltaPHC> Whitespace indents is considered the idiomatic way
19:27:04Yardanicowell proc b(x:int):int=(result=5;(if x>5:(if x<3:(if x==0:(echo x;echo x-1)))elif x==0:(echo 0;echo 5)else:return 5))
19:27:09Yardanicothat wouldn't look good even with newlines
19:27:12Yardaniconim is not lisp :D
19:28:08FromGitter<deech> Looks fine to me. Unambiguous indentation is worth a lot. By that logic all C and JS is also unreadable. But I agree it doesn't seem to be Nim culture to use it since I just found out about it.
19:29:46FromDiscord_<DeltaPHC> The advantage of whitespace-significant syntax is that the way the code is formatted is exactly how it works. Brace-style and semicolons give you more freedom, at the cost of misleading indentation being a problem
19:30:23Yardanicohmm wait I thought you can write all nim code in one line hmm
19:30:33Yardanicoseems like you still need a newline with the code I sent above
19:30:43YardanicoI can't seem to but echo b(5) on the same line after that
19:34:10*marmotini_ quit (Remote host closed the connection)
19:37:42*marmotini_ joined #nim
19:38:47FromGitter<kennymalac> crap, I have a method that is proc stop(self: var TaskSinkObj) because TaskSink is a ref object and I call stop in my destructor
19:39:25FromGitter<kennymalac> but I'm trying to call that stop method with a TaskSink, is that possible
19:39:40disruptekfoo[].stop
19:39:49Yardanicowhy not "ref TaskSinkObj" instead of "var TaskSinkObj" ?
19:39:58Yardanicoor that wouldn't work in your case?
19:40:10FromGitter<kennymalac> where TaskSink is just ref TaskSinkObj
19:40:24Yardanicoproc stop(self: ref TaskSinkObj)
19:40:26Yardanicomaybe
19:41:22FromGitter<kennymalac> that worked @disruptek does this just mean I can do the [] thing but in the destructor rather than anywhere I need to call those methods?
19:41:33FromGitter<kennymalac> i.e. make stop() take a TaskSink and the destructor calls self[].stop()
19:41:44disruptek[] is the deref operator.
19:41:56disruptekuse it anywhere you want to deref a ref.
19:43:00FromGitter<kennymalac> nvm what I said doesn't make sense. I'll just define stop for a TaskSink and make it deref
19:43:20disruptekyou could define stop for ref TaskSink and then (ref self).stop in your destructor.
19:44:07FromGitter<kennymalac> TaskSink is already ref object? so what would ref TaskSink mean
19:44:20dom96why can't `stop` take a TaskSink?
19:44:20Yardanicoreference to a reference to an object XD
19:44:45FromGitter<kennymalac> I call stop in my destructo
19:44:50FromGitter<kennymalac> destructor
19:44:54disruptekin your destructor, self is an obj. so you (ref self).stop so that you can use stop on your ref objects elsewhere.
19:44:56dom96do destructors need a non-ref?
19:45:01disruptekyes.
19:45:17FromGitter<kennymalac> making stop an alias for self[].stop() works
19:45:22dom96destructors + ref sounds like you're mixing things
19:45:33dom96objects allocated on the heap already have their own finaliser mechanism
19:45:47FromGitter<kennymalac> I'm doing RAII
19:45:57dom96https://nim-lang.org/docs/system.html#new%2Cref.T%2Cproc%28ref.T%29
19:46:00FromGitter<kennymalac> like a C++ plebian
19:46:24disruptekyou're doing fine.
19:46:30disruptekkeep doing what you're doing.
19:46:36FromGitter<kennymalac> haha
19:50:26*marmotini_ quit (Ping timeout: 240 seconds)
19:50:36Yardanicofrom telegram: I'm trying to restart the whole program on exception with 2 async procs running https://play.nim-lang.org/#ix=28qB. currently my problem is that when first proc fails, 2nd continues. is there any way to kill 2nd proc too?
19:51:40disrupteksure, just complete it.
19:51:56disruptekchronos offers cancellation.
19:53:47dom96Yardanico: store some state, then `while state.running`
19:55:06zedeusdom96: have you had time to look at #12982 yet?
19:55:08disbothttps://github.com/nim-lang/Nim/pull/12982 -- 3Implement file streaming for httpclient's MultipartData
19:55:35dom96nope, it's a busy few week right now for me so won't get a chance to look at this
19:55:48dom96probably until after January ends
19:56:05dom96*weeks
19:56:27zedeusah, no problem
20:05:48FromGitter<kristianmandrup> What is the best way to `trim` a string from whitespace ?
20:05:58Yardanicostrutils.strip
20:06:23Yardanicoor you mean fully remove whitespace?
20:06:45FromGitter<kristianmandrup> Similar to https://nim-lang.org/docs/strutils.html#trimZeros%2Cstring
20:06:55Yardanicostrutils.strip :)
20:06:56FromGitter<kristianmandrup> remove whitespace at beginning and end of string
20:07:05FromGitter<kristianmandrup> Thanks :)
20:12:23ZevvAnyone here who knows a bit about RTTI, repr and where this should go with arc? Is there anything repr can do that `$` could not, and does it make sense to have/keep two different implementations?
20:12:51YardanicoI sometimes use repr for debugging when I'm lazy to implement $ :P
20:13:02*Vladar quit (Quit: Leaving)
20:13:47Zevvright. The idea is that "everthing should be reprable". But why should not everything be `$`able as well?
20:14:23ZevvfieldPairs should be able to $ any object. With some simple procs like http://ix.io/28qW any ptr or ref can be walked up to the destination. What is the use of keeping repr then?
20:14:38ZevvAnd what does RTTI bring in?
20:15:40Yardanicowell, also repr is useful to debug string contents
20:15:43YardanicoI mean raw characters
20:15:50Yardanicofor example \13\10 instead of simply newlines
20:15:56YardanicoI've used it when debugging my nim-adbv
20:15:58Yardaniconim-adb*
20:16:36FromGitter<kristianmandrup> How do I join three numbers into a string (version) with `.` as separator
20:16:50FromGitter<kristianmandrup> `strutils.join`?
20:16:53Yardanicoyeah
20:16:55Zevvyeah, ok, that is the *usage*. But I mean implementation. repr does magic stuff requiring run time type information. I understand --gc:arc does lack this info, and thus does not do a proper repr (yet). But if the repr can be implemneted just like $, what use is the extra RTTI then?
20:17:02Yardanicoidk
20:17:16YardanicoI would use $ or some "debug" proc if it would work the same :)
20:17:17Zevvkristianmandrup: $n0 & "." & $n1 & "." & $n2
20:17:40Zevvor if n is an array something like n.mapIt($it).join(".")
20:18:32*couven92 quit (Quit: Client Disconnecting)
20:19:21Zevvkristianmandrup: https://play.nim-lang.org/#ix=28r1
20:21:22FromGitter<kristianmandrup> Thanks. Playing now. Can I destructure the result of a string split?
20:21:45Zevv"destructure"?
20:21:48FromGitter<kristianmandrup> ```let version = n.mapIt($it).join(".") ⏎ let m = version.split(".") ⏎ echo m``` [https://gitter.im/nim-lang/Nim?at=5e2df4dc1a883c61961402ef]
20:22:20FromGitter<Yardanico> ah, you mean unpack?
20:22:23FromGitter<kristianmandrup> I end up with `@["5", "6", "22"]` but would like it in vars `major`, `minor` and `patch`
20:22:37FromGitter<Yardanico> var (major, minor, patch) = (m[0], m[1], m[2])
20:22:39FromGitter<kristianmandrup> I guess. I come from JS world
20:24:25FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2df579a420263e03a44cfc]
20:24:51FromGitter<kristianmandrup> Trying to add default to minor and patch values if not present in version string
20:26:38FromGitter<kristianmandrup> type mismatch on `or` however. No idea what convention is with nim. `||` would work in JS
20:26:57Zevvnim is statically typed here, but you are trying to mix strings and numers too freely
20:29:55disruptekZevv: yes, $ should replace repr.
20:30:07disruptekot
20:30:08FromGitter<Yardanico> @kristianmandrup what "or" does in your case?
20:30:16FromGitter<Yardanico> or what do you want it to do?
20:30:23disruptekit's too much to ask that nim rtti just for repr.
20:31:41Zevvdisruptek: right, I think I remember araq saying that.
20:31:54ZevvI can pick that up
20:31:56disruptekit's just self-evident.
20:32:23ZevvI also have some opinons about getting repr output more readable and structured
20:32:41AraqZevv, IMHO the new repr implementation is better
20:32:48ZevvOh is there one already?
20:32:51Araqand can be made the one implementation for all GCs
20:32:56disruptekmaybe there should be a new repr operator.
20:33:02Araqand yeah you can tweak it to make it beautiful
20:33:10Zevvbut does it use any magic apart from what "normal" nim can do?
20:33:14disruptekthen $ doesn't have to semantically confuse the two.
20:33:19Yardanicodisruptek: pls no
20:33:26Araqnope, it's currently copy-pasta
20:33:26YardanicoI still think that repr is mostly for debugging
20:33:30Araqfrom '$'
20:33:37disruptekit should be, yes.
20:34:23disruptekthe only reason we're having this conversation is because repr != $.
20:34:30ZevvAraq: right. So what are the ideas about what `$` should do and what `repr` should do. Could they not share mos of the code, instead of copypaste?
20:35:20Yardanicowell I guess $ is for "pretty" printing and "repr" for "ugly" printing :P
20:35:38Zevvthat's kind of ill defined like that :)
20:35:49ZevvBut why can nim not $ anything I pass it. Its trivial
20:36:20ZevvNo longer these lists of complaints from the compiler if it can not convert my whatever-I-pass-it to a string.
20:36:51ZevvMy guess would be that `repr` is more techincal in depth, showing addresses and all types, while `$` is more minimal showing only contents.
20:36:54Zevvis that the gist of it?
20:37:45Zevvor should repr output valid parsable nim code which "reconstructs" what you feed it?
20:38:05disruptekhonestly, it needs to be renamed and then given tighter semantics, imo.
20:38:11YardanicoI think that's more related to macros:P
20:38:24disruptekyou can see how it's used and abused in stdlib.
20:38:25Zevvsigh. this will be bikeshedding and rfcs again
20:38:29disruptekof course.
20:38:38disruptekso give us the shed already.
20:38:55YardanicoZevv: cost of having 1.0 release :P
20:39:03Zevvdisruptek: paint it Pantone 448 C
20:39:20disruptekdo it in color. people love color.
20:40:51*ptdel joined #nim
20:41:22ZevvHmm we should organize a few discussion topics at fosdem. Get a room somewhere and a box of doughnuts and decided stuff. Just keep out the other 98% of the community to speed things up! :)
20:41:59Yardanicomaybe I should save some money to come for the next year's FOSDEM from Russia :P
20:42:22FromGitter<kristianmandrup> I'm working on a PR to add automatic `git tag` support to `nimble` ;)
20:42:23FromGitter<kristianmandrup> https://github.com/nim-lang/nimble/issues/525#issuecomment-578541084
20:42:24disbotImplement `tag` command
20:42:36FromGitter<garuse> Hi everybody. Kindly as for you help. I am trying a simple thing and I am stuck :( I am trying to interact with a shell via osproc.startProcess (send commands and receive the output. But nothing happens. Here is what I did: https://play.nim-lang.org/#ix=28r9.
20:42:55disruptekgaruse: good demo of how to do this in golden.
20:42:57disruptek!repo golden
20:42:58disbothttps://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim 🏆 15 15⭐ 0🍴
20:43:11disruptekkristianmandrup: good demo of how to do this in nimph.
20:43:13disruptek!repo nimph
20:43:14disbothttps://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 52⭐ 2🍴 7& 1 more...
20:43:57kungtottekristianmandrup: use scanf instead of jumping through hoops with the version splitting: https://play.nim-lang.org/#ix=28rg
20:44:30FromGitter<garuse> thank you! I will check it now. gasho /\
20:45:02kungtottekristianmandrup: scanf will populate the variables with anything found with the appropriate format, and leave anything else with the default value (0).
20:49:33FromGitter<kristianmandrup> okay, thanks
20:53:08FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2dfc34e177666195d3a6d8]
20:53:19FromGitter<kristianmandrup> Not sure how to fix this
20:56:04*Trustable quit (Remote host closed the connection)
20:56:05FromGitter<kristianmandrup> Trying with seq `@`
20:56:12FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2dfcec183449313be1ecb6]
20:56:22FromGitter<kristianmandrup> complains about return type
20:56:44FromGitter<kristianmandrup> https://play.nim-lang.org/#ix=28rk
20:58:03FromGitter<garuse> @kristianmandrup you need to return a seq[int]: https://play.nim-lang.org/#ix=28rl
20:58:44YardanicoI'd suggest you to read Nim tutorials at first :) and in this case it's better to use a tuple I guess
21:00:32FromGitter<kristianmandrup> I've read most of the Nim in Action book and also much of the Language Guide etc. I need real practice
21:00:45FromGitter<kristianmandrup> I tried with a `Semver` type now
21:00:50FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2dfe02a9b30639e2f01621]
21:02:25*narimiran quit (Ping timeout: 268 seconds)
21:02:33FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2dfe699ad22d5bd5e5ca48]
21:05:18kungtotteKristianmandrup: https://play.nim-lang.org/#ix=28ru
21:08:02FromGitter<kristianmandrup> ah yes, now I get it :)
21:11:17FromGitter<kayabaNerve> Anyone have a clean example of crafting a Future? I'm reading over asyncdispatch and it's not helping too much :/
21:12:19FromDiscord_<Skaruts> is there a way to read input from the command line without committing it, so that I can make the cursor stay still if the user presses enter without entering a command?
21:12:20dom96newFuture[T]?
21:12:23FromGitter<kayabaNerve> Eh. I'll just experiment with it. I believe it can be ultimately simplified to newFuture/complete/fail, with complete/fail called in a callback.
21:13:04FromGitter<kayabaNerve> dom96: No, I got that. I was reading over asyncdispatch's recv and it manually manipulates the ref count + uses `PCustomOverlapped`
21:13:21dom96kayabaNerve: what are you trying to do?
21:13:24FromGitter<kayabaNerve> May just be that it's a very complex example to start with if I can simplify it
21:13:28dom96"manually crafting a Future" is too vague
21:13:57FromGitter<kayabaNerve> Simply put? await doX() where doX doesn't use the async pragma, returns a future, and returns a string once another function registers that string in a table.
21:14:38FromGitter<kayabaNerve> Is it as simple as fut.complete() when I set the string in the table?
21:14:43dom96yes, it is
21:14:55dom96see how sleepAsync is implemented
21:15:04dom96IIRC it's fairly simple
21:15:17dom96or you can also look at `or` and `and` procs
21:15:23dom96those are definitely simple
21:15:24FromGitter<kayabaNerve> Thanks for the confirmation.
21:15:48dom96but my question then is, why are you using Future for what seems to be non-IO operations?
21:16:03FromGitter<kayabaNerve> My issue with `sleepAsync` is it uses the global dispatcher's timers, and those weren't documented AFAICT
21:16:05FromGitter<kayabaNerve> It's IO
21:16:20FromGitter<kayabaNerve> I'm requesting data from multiple servers and completing the future when any of them resolve
21:16:29FromGitter<kayabaNerve> *any of them respond with the data
21:16:50FromGitter<kayabaNerve> Previously I iterated over the servers, requesting from each and then the next. It was pretty bad.
21:17:37FromGitter<kayabaNerve> So now I'm trying to handle multiple requests to various servers and using the first one as servers aren't confirmed to respond at all.
21:17:50FromGitter<kayabaNerve> If they were confirmed to resolve, I'd take the performance dip for now and not craft a Future.
21:17:55FromGitter<kayabaNerve> *confirmed to respond
21:18:00disrupteksounds fine to me.
21:18:54FromGitter<kayabaNerve> I use a lot of async code. I'm really focusing on getting a MVP though and my existing async code didn't fit the V part. Having to rewrite it earlier than I wanted to.
21:20:35dom96You can create an `any` proc that's similar to https://nim-lang.org/docs/asyncfutures.html#all%2Cvarargs%5BFuture%5BT%5D%5D
21:20:46dom96Keep in mind that cancelling futures isn't supported though
21:21:14*a_b_m joined #nim
21:21:56*a_b_m quit (Client Quit)
21:23:16*abm quit (Ping timeout: 265 seconds)
21:23:39leorize[m]Araq: I believe I have built a reasonable amount of flags to enable fd inheritance for sockets in #13201
21:23:40disbothttps://github.com/nim-lang/Nim/pull/13201 -- 3Make file descriptors from stdlib non-inheritable by default
21:24:41leorize[m]I can add -d:nimInheritHandles, but that might encourage bad practices of not cloning fd before passing to child processes
21:25:40Araqwhat's more important is that every proc where it's applicable gets a 'flags: set' argument so that it remains possible to inherit
21:26:25Araqand ideally we design this properly with an RFC first
21:26:45AraqIO is both too important also too adhoc in Nim, see also
21:26:59Araqhttps://github.com/nim-lang/Nim/pull/13232
21:27:01disbotfix #9634 retry c_fgets on EINTR : debugging a nim program does not crash on `execCmdEx` / `readLine` ; snippet at 12https://play.nim-lang.org/#ix=286c
21:28:46Zevvuhm, you can always disable FD_CLOEXEC on a fd later, if you still want it to be inherited?
21:29:08disruptekthat was my understanding.
21:29:13FromGitter<kayabaNerve> `or` won't work thanks to the loop I have. I don't actually have individual futures. I have network messages which when parsed are what matches a pending async request.
21:29:22FromGitter<kayabaNerve> The lack of cancelling is fine.
21:30:01FromGitter<kayabaNerve> Oh. I do have a question about Peek if you have a second. Is it still not supported on Windows/will it ever?
21:30:46Zevvso why adding flags to all the API's?
21:31:14disrupteki think so existing code works.
21:31:18leorize[m]saving a syscall :p
21:33:15dom96kayabaNerve: afaik it's not, but I very vaguely remember this feature
21:33:40dom96leorize[m]: your PR looks like a good idea to me
21:34:04Araqthe Python PEP hasn't been implemented yet
21:34:08Araqafaik
21:34:16Araqso I'm cautious
21:34:34dom96but yeah, we should be careful and take whatever lessons Python learned
21:34:40dom96we may also wish to delay this until 2.0
21:35:55disruptekdoesn't seem that impactful to me.
21:40:03AraqStatus says the changes to ioselectors_*.nim would be harmful for them
21:42:10shashlickdoes nimsuggest work as expected if using vscode with remote ssh
21:42:18dom96huh? they've forked all of async did they not?
21:42:36Araqno, they use some stuff from us.
21:43:59FromGitter<kristianmandrup> How do I correctly escape a `"` match condition in re?
21:44:07FromGitter<kristianmandrup> ```fileStr.replace(re"version\s+=\s+\"(\D+)", "1.12.0")```
21:44:25Araqhttps://fraserblog.codewise.org/rust-and-file-descriptors/
21:44:31FromGitter<kristianmandrup> ie. matching on `version = "0.11.0"`
21:44:36Araq"Rust, being a safe-by-default language, sensibly creates all file descriptors with the FD_CLOEXEC flag, which means they automatically close on an exec system call, without needing to be explicitly closed."
21:44:41Araqso Rust does the same...
21:48:17disruptekthe fools.
21:48:43dom96ahh, cool, so at least they reuse those modules
21:49:27disruptekkristianmandrup: bump has some re for version matching.
21:49:29disruptek!repo bump
21:49:30disbothttps://github.com/disruptek/bump -- 9bump: 11a tiny tool to bump nimble versions 🍻 15 11⭐ 1🍴 7& 1 more...
21:51:31FromGitter<kristianmandrup> ```let expr = re"\"(\D+)\"" ``` ⏎ ⏎ Stuck on this. Terminates `re` on first `"` encountered after beginning `"` it seems, no matter the escape `\"` [https://gitter.im/nim-lang/Nim?at=5e2e09e3f85dba0aab1db305]
21:59:58FromGitter<kristianmandrup> Thanks for `bump` :)
22:01:04disruptekhope it helps.
22:10:41FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2e0e61da04a624f48b33d4]
22:11:00FromGitter<kristianmandrup> Complains: `imported and not used: 'bump' [UnusedImport]`
22:11:18FromGitter<kristianmandrup> https://github.com/disruptek/bump/blob/master/bump.nim
22:11:26*krux02 quit (Remote host closed the connection)
22:11:45disrupteksyntax.
22:11:51FromGitter<kristianmandrup> https://disruptek.github.io/bump/bump.html#bump%2Cstring%2Cstring%2Cstring%2Cseq%5BT%5D%5Bstring%5D
22:12:06disruptekmanual = "..."
22:12:28FromGitter<kristianmandrup> ?
22:12:42disruptekbump is a proc and not an object.
22:12:49FromGitter<kristianmandrup> I need to send all the args?
22:13:03disruptekno, you need to specify them with = and not :.
22:13:19*ng0_ quit (Quit: leaving)
22:13:32FromGitter<kristianmandrup> I've only used positional args so far
22:13:41FromGitter<kristianmandrup> ```proc writeNewVersion(newVersion: string) = ⏎ bump(manual = newVersion)``` [https://gitter.im/nim-lang/Nim?at=5e2e0f15183449313be2686c]
22:14:01FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2e0f294c3dae24f5f4b341]
22:14:16disruptekbump.bump
22:14:46FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2e0f56a420263e03a509c3]
22:14:47*rockcavera joined #nim
22:14:56FromGitter<kristianmandrup> `expression 'bump.bump(manual = newVersion)' cannot be called`
22:15:38disruptekwhy not?
22:16:15FromGitter<kristianmandrup> ```proc writeNewVersion(newVersion: string) = ⏎ bump.bump(manual = "1.0.2")``` [https://gitter.im/nim-lang/Nim?at=5e2e0fae183449313be26c2f]
22:16:19FromGitter<kristianmandrup> Same here
22:16:47disruptekyou didn't supply a message.
22:17:13FromGitter<kristianmandrup> aha
22:17:28disruptekbump.bump(manual = "1.2.3", message = @["goats", "are", "sexy"])
22:17:49FromGitter<dumjyl> It probably thinks both are bump, the module.
22:18:01disruptekor message = @[] if you don't like goats.
22:18:17*ng0 joined #nim
22:18:17*ng0 quit (Changing host)
22:18:17*ng0 joined #nim
22:18:44FromGitter<kristianmandrup> Works :)
22:18:48FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2e1048f85dba0aab1ddf97]
22:19:02disruptekof course.
22:19:06FromGitter<kristianmandrup> Returns an `int`. Status code?
22:19:33disruptekyes, the result passed as the return code for the tool.
22:19:57disruptekthis is a cli tool and you're invoking the proc that is effectively its `main()`.
22:20:18disruptekit's also designed to be a library.
22:20:56FromGitter<kristianmandrup> ah yes
22:21:02FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2e10ce01914e3e0453aa45]
22:21:21disruptekthe sad panda. 🐼
22:23:02*tane quit (Quit: Leaving)
22:23:25*ng0_ joined #nim
22:23:25*ng0_ quit (Changing host)
22:23:25*ng0_ joined #nim
22:23:31FromGitter<kristianmandrup> Ok, thanks. Helped a lot. Still don't get how to match a `"` in a RegExp in Nim
22:23:34*ritchie__ joined #nim
22:23:44disruptekthere's regexp in there that does that.
22:24:21disruptekthough i would use strscans if i were to do it again.
22:24:52*ng0 quit (Ping timeout: 268 seconds)
22:25:01FromGitter<kristianmandrup> Yeah, you seem to use a more low level approach, not matching on the `"` in the version line but only on the preceding part
22:25:21disruptekwhat can i say? i'm a wild man.
22:25:22FromGitter<kristianmandrup> for line in lines($target): ⏎ ⏎ ``` if not line.contains(re"^version\s*="):``` [https://gitter.im/nim-lang/Nim?at=5e2e11d2cd53a80aac2f2ba1]
22:25:34disruptekkeep searching.
22:25:38*ritchie_ quit (Ping timeout: 240 seconds)
22:33:08*ptdel quit (Ping timeout: 248 seconds)
22:35:25*ptdel joined #nim
22:40:56*sekao joined #nim
22:42:03*solitudesf quit (Ping timeout: 265 seconds)
22:45:51sekaois it possible for a `case` expression to return different types in each branch? i'm trying to conditionally pull values out of an object variant to store in a variable. i can see why the type checker doesn't like it, but there must be some way...
22:46:19disruptekof course.
22:46:23disruptekshow us some code.
22:46:24disruptek~paste
22:46:25disbotpaste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek
22:48:15Yardanicosekao: well, I think you'll need an object variant for that variable too
22:49:01YardanicoThe thing is that you decide on a kind of object variant at runtime so there's no way for compiler to do that I think
22:50:30sekaoi tried something like this: https://play.nim-lang.org/#ix=28s2
22:52:32disruptekah, that won't work.
22:57:16sekaoyeah it makes sense why it doesn't work now that i think about it
23:09:12*zedeus quit (Changing host)
23:09:12*zedeus joined #nim
23:23:41FromGitter<kristianmandrup> https://play.nim-lang.org/#ix=28s7 Finally got `re` working with `"` substitution :)
23:36:35FromGitter<nothratal> good evening
23:37:32FromGitter<nothratal> is there an each/eachIt template somewhere in the standard library?
23:38:37FromGitter<nothratal> something like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2e22fda420263e03a58033]
23:39:15FromGitter<nothratal> or is there something different/equivalent?
23:40:28disruptekyeah, we have for loops.
23:41:49disrupteksee sequtils module, i guess.
23:44:06*ng0_ quit (Quit: leaving)
23:46:27*disruptec quit (Ping timeout: 268 seconds)
23:47:08*disruptec joined #nim
23:57:21*muffindrake quit (Quit: muffindrake)
23:57:40*muffindrake joined #nim