<< 17-01-2020 >>

00:08:13*krux02 quit (Ping timeout: 245 seconds)
00:21:38*krux02 joined #nim
00:22:15disruptekwe should treeshake our own symbols at least.
00:23:07shashlickok what now
00:23:27disruptekasync cycles driving me batty.
00:25:33rayman22201proc `=destroy`*[T](fut: var DisposableFuture[T]) = is giving me Error: signature for '=destroy' must be proc[T: object](x: var T)
00:25:34rayman22201wat
00:25:51rayman22201what am I doing wrong here?
00:26:00disruptek[T] != DisposableFuture[T]
00:26:05*FromGitter quit (Read error: Connection reset by peer)
00:26:24*FromGitter joined #nim
00:26:33rayman22201ok, so how do I write it?
00:26:55disruptek`=destroy`[T](fut: var T) =
00:27:28*FromGitter quit (Remote host closed the connection)
00:27:46*FromGitter joined #nim
00:27:47disrupteki don't want to compile procs that can never be called.
00:27:50rayman22201that doesn't make sense. How can Nim know it must be a Disposable future?
00:27:55disruptekkinda old-fashioned that way.
00:28:15disruptek`=destroy`[T: DisposableFuture] ...
00:28:41rayman22201nope. that doesn't work either
00:28:51rayman22201proc `=destroy`*[T:DisposableFuture](fut: var T) =
00:28:57disruptekmy dog is cute and he's not a tiny dog, but his breath is worse than any tiny dog i've known.
00:29:18rayman22201cool story
00:29:23*FromGitter quit (Read error: Connection reset by peer)
00:29:27disruptekit's ridiculous.
00:29:29*abm quit (Quit: Leaving)
00:29:33disrupteki can't take it anymore.
00:29:42*FromGitter joined #nim
00:30:20*EvergreenTree quit (Quit: The Lounge - https://thelounge.chat)
00:30:22rayman22201must take serious action. dog mints to the rescue
00:30:39disrupteki think i'm being punished.
00:30:50FromDiscord<Clyybber> no pig-ears :(
00:30:58*EvergreenTree joined #nim
00:32:30rayman22201tests disagree with you on syntax disruptek: https://github.com/nim-lang/Nim/blob/12d2b980e833c4747dea497add60f4e934cac512/tests/destructor/tdestructor3.nim#L66
00:33:14rayman22201and yet every form I try fails to compile, so wtf
00:33:23FromGitter<dumjyl> is it a `ref`?
00:34:43*icebattl1 quit (Ping timeout: 260 seconds)
00:35:02rayman22201why does that matter?
00:35:20rayman22201the error is: Error: signature for '=destroy' must be proc[T: object](x: var T)
00:35:52*FromGitter quit (Remote host closed the connection)
00:35:53rayman22201it is a ref though
00:36:10*FromGitter joined #nim
00:36:11rayman22201a ref type
00:36:56FromGitter<dumjyl> `=destroy` is for object and distinct only, try `typeof(default(DisposableFuture[T])[])`
00:37:07rayman22201I see
00:37:44rayman22201that error message is terrible...
00:37:56rayman22201thanks dumjyl
00:38:36*voltist joined #nim
00:53:32*donpdonp left #nim ("WeeChat 2.6")
01:02:46rayman22201good news. using DisposableFuture causes the Nim compiler to immediately recognize the cycle lol
01:02:51rayman22201https://www.irccloud.com/pastebin/IWKVmrAb/
01:03:13rayman22201so, what is the syntax for .cursor?
01:15:17rayman22201it's a pragma on fields
01:15:45rayman22201now I have to untangle the Callback list bs in asyncfutures again to find out where to put the cursor pragma. fun....
01:16:35*dddddd quit (Read error: Connection reset by peer)
01:22:51*lritter quit (Ping timeout: 265 seconds)
01:23:14*lritter joined #nim
01:26:31rayman22201ughh. I nead weak assign to make this work I think
01:26:55rayman22201bbl
01:40:43*krux02 quit (Remote host closed the connection)
02:15:48*dcmertens joined #nim
02:21:38*dcmertens quit (Ping timeout: 240 seconds)
02:38:55FromDiscord<Skaruts> What's a quick way to pass a ref object by value into another one? (as in `a = b`)
02:40:49*treeform joined #nim
02:46:43*lritter quit (Quit: Leaving)
02:52:12*jholland__ quit (Quit: Connection closed for inactivity)
03:00:52FromDiscord<Skaruts> I tried dereferencing it but then I don't know if it can be re-referenced. `addr()` returns a `ptr`...
03:04:51disrupteki love looking at old code.
03:04:59disruptekthat was generated by nim. just brilliant.
03:07:49disrupteki'm not good at it, but i really enjoy it.
03:07:58disruptekprogramming, that is.
03:10:32*endragor joined #nim
03:24:48disruptekyeah, weak assign, it feels like a bit of a cop-out this early.
03:25:11disruptekor maybe you just know something i don't. 😁
03:31:28disrupteki really should think more about the customer when i write software.
03:31:53disruptekjust jump here at any time.
03:34:02disruptekima put a compile-time warning in this code that reminds the developer that they need an environmental variable set to use the api. but only if that variable is unset at compile-time.
03:34:13disruptekthat's my good deed for the day.
03:34:33disruptekfor every amazon api.
03:53:52FromDiscord<Rika> Am I delusional or is disruptek speaking to himself
03:56:35Yardanicouhh, I probably forgot, how can I get a string representation of code passed to a template as untyped?
03:56:52*muffindrake quit (Ping timeout: 260 seconds)
03:57:48disruptekuse a macro and echo foo.treeRepr?
03:58:39*muffindrake joined #nim
03:58:40Yardanicoah, nvm, astToStr
03:58:50Yardanicodisruptek: thanks but astToStr works for me :)
03:59:00Yardanicosurprisingly I found the answer here xdd https://stackoverflow.com/questions/31565006/how-to-get-string-representation-of-an-expr-in-nim-template
04:00:36disruptekoh, right. i forget what i use to do this but it isn't either of those. now i wonder if i'm doing it right.
04:11:08*Jjp137 quit (Ping timeout: 260 seconds)
04:11:52*Jjp137 joined #nim
04:23:38*rockcavera quit (Remote host closed the connection)
04:32:26*ptdel joined #nim
04:35:18*martinium joined #nim
04:40:31disrupteki figured out how golden works.
04:40:57Yardanicobut golden is your project, isn't it?
04:41:02Yardanico0_0
04:41:05disruptekoh shit.
04:41:17disruptekthere's a macro that wraps your main loop of your app.
04:41:22Yardanicoare you trying to impersonate real disruptek ?!
04:42:08disruptekit listens for input, like in the env. you can hook into this to prevent the main loop and instead run other code.
04:42:25disruptekthe beauty of it is that the code you run is baked into the binary you run.
04:42:39disruptekso we don't have to solve the question of which-is-which.
04:43:15disruptekwe'll know what compiler you used to build it because we'll have looked at that info at compile-time.
04:43:44disruptekthe "other code" you might run? instrumentation.
04:43:56disruptekbut it runs in your process, automatically.
04:43:58Yardanicoso can golden be used for simple microbenchmarking?
04:44:09Yardanicorunning some proc 10 million times and calculating mean time and stuff like that
04:44:13Yardanicolike criterion or nimbench
04:44:27disrupteki was gonna embed criterion into it and then have golden just consume criterion for what it calls "stages".
04:44:42disrupteki think i'm maintaining criterion now, if you have any patches.
04:45:02disruptekyeah, so we'll do that with criterion most likely.
04:45:31disruptekbut i think this is very much the right way to build this product.
04:45:46disruptekbuild it right into the release.
04:46:19disruptekone define elides it entirely from the ast.
04:47:05Yardanicobtw I'm surprised nimbench stull works
04:47:08Yardanicolast commit 4 years ago lol
04:47:16disrupteki should check that out.
04:47:26Yardanicoit even uses "strfmt" (string formatting when strformat didn't exist)
04:48:10disruptekwhen i saw that name, i was sure i'd worked with someone with that same moniker.
04:48:21disrupteki think i'm thinking of raph koster, though.
04:49:19disruptekwe support the best of these tools.
04:49:23disruptekwhy not?
04:49:32disruptekeverything and everyone.
04:50:10disruptekso, yeah, we'll get someone to do a gui for us and then you'll be able to do live introspection of your program.
04:50:30disruptekimgui with memory alloc activity, we can monitor threads, the gc, etc.
04:53:14disrupteki used to use services for instrumentation but i have no idea what's current now. what are people using? what's the hot sexy one i should look at?
04:56:22disruptekmaybe we bake the repl into the gui. why not?
04:56:38disruptekyou can hcr into your code with a gui. why not?
04:58:03disruptekbecause we don't have scoped imports. 😭
05:00:33*nsf joined #nim
05:02:51TangerAny good generic Factory libraries for tests out in the wild?
05:04:53disruptekFactory libraries?
05:05:13disruptekyou mean like predicates?
05:05:23disrupteklike "missing" or "is" or whatever?
05:05:52TangerLike type factories for testing etc. Closest parallel I can think of is Python' https://factoryboy.readthedocs.io/en/latest/
05:05:59Tanger*Python's Factory boy
05:06:57disrupteki get it.
05:07:02disruptekthat's a cool idea.
05:07:08disrupteki wonder why i never came across it before.
05:19:57*silvernode joined #nim
05:20:25*silvernode quit (Client Quit)
05:51:33*narimiran joined #nim
06:01:43*martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:26:26*ptdel quit (Remote host closed the connection)
06:26:40FromGitter<Varriount> Tanger: Unfortunately that's an area where Nim needs some love - mocks and testing
06:28:13FromGitter<Varriount> All the machinery is there - you can overload `.` to capture attribute access, do things with term rewriting macros, etc.
06:43:34*treeform quit (Remote host closed the connection)
06:44:20TangerVarriount: Yeah, I've been diving into macros for the first time in the last couple of weeks and I can already see how one would go about doing it
06:44:30TangerDidn't realize you could overload `.` though :o
06:44:56TangerAny examples of that implemented in a meaningful way
06:44:58Tanger?
06:48:54*actuallybatman joined #nim
07:01:54TangerNevermind, found the experimental part of the docs
07:02:26*marmotini_ joined #nim
07:06:56*marmotini_ quit (Remote host closed the connection)
07:16:49TangerHmmm, what am I doing wrong? I would have thought that this would hit the `.` template: https://play.nim-lang.org/#ix=27Cv
07:18:06*EvergreenTree quit (*.net *.split)
07:18:06*ljoonal quit (*.net *.split)
07:18:06*shadowbane quit (*.net *.split)
07:18:06*euantor quit (*.net *.split)
07:18:07*Araq quit (*.net *.split)
07:18:08*Ekho quit (*.net *.split)
07:19:14*shadowbane joined #nim
07:22:13FromGitter<gogolxdong> https://github.com/microsoft/verona/blob/master/docs/faq.md
07:24:21*Ekho- joined #nim
07:27:08*solitudesf joined #nim
07:27:33*marmotini_ joined #nim
07:32:47*marmotini_ quit (Ping timeout: 272 seconds)
07:36:15leorizeTanger: note that native access trumps these templates
07:42:30*PMunch joined #nim
07:43:50TangerAh
07:43:56TangerAaaah
07:57:39*voltist quit (Remote host closed the connection)
08:00:00*gmpreussner quit (Quit: kthxbye)
08:05:03*gmpreussner joined #nim
08:05:50*EvergreenTree joined #nim
08:05:50*ljoonal joined #nim
08:05:50*euantor joined #nim
08:05:50*Araq joined #nim
08:16:49*oculux quit (Ping timeout: 258 seconds)
08:18:01*JustASlacker joined #nim
08:19:15Araqnarimiran, does 1.0.6 contain the fixes to distros.nim?
08:20:50FromDiscord<Rika> Tanger: https://nim-lang.github.io/Nim/manual_experimental.html#special-operators-dot-operators
08:20:50*actuallybatman quit (Ping timeout: 240 seconds)
08:21:48narimiranAraq: it doesn't, neither the NixOS one, nor `uname -a` one
08:21:50FromDiscord<Rika> oh, i didnt read far back enough
08:22:10Araqwhy not? didn't I use the [backport] tag?
08:22:25narimirannope :)
08:24:26Araqwell damn
08:24:45Araqit's kinda showstopper bug it doesn't even work for Ubuntu
08:25:01narimirani'll backport it, no problem
08:25:15Araqok thanks
08:25:29narimiranit's not like we released 1.0.6 yet, it is still 1.0.5
08:25:53Araqsee also https://github.com/nim-lang/Nim/pull/13172 distros.nim was a super bad idea
08:25:56disbotFix OS detection in a docker container ; snippet at 12https://play.nim-lang.org/#ix=27CP
08:26:30Araqit's lots of work just to get better nimble integration with the OS's package manager
08:36:06*floppydh joined #nim
08:46:06*natrys joined #nim
09:00:04FromDiscord<Rika> hey Yardanico are you here?
09:00:24FromDiscord<Rika> do you know why handlers in discordnim are pointers instead of proc() types?
09:00:56*ofelas quit (Quit: shutdown -h now)
09:03:21*JustASlacker quit (Ping timeout: 272 seconds)
09:15:26*JustASlacker joined #nim
09:17:25*ng0 quit (Quit: leaving)
09:28:14*ng0 joined #nim
09:28:14*ng0 quit (Changing host)
09:28:14*ng0 joined #nim
09:35:25AraqNim is written in itself once again, https://github.com/nim-lang/Nim/pull/13170
09:35:26disbotmake case-object transitions explicit, make unknownLineInfo a const, …
09:36:07Araqin other words, the Nim compiler itself adheres to version 1.0 of the language
09:37:54PMunchHooray!
09:39:42Araqit was easier than I thought it would be because somebody else did the hard work.
09:52:07*JustASlacker quit (Ping timeout: 272 seconds)
10:09:37*drewr quit (Ping timeout: 260 seconds)
10:10:58PMunchAlways easier when someone else does it :)
10:11:31*silvernode joined #nim
10:14:55*natrys quit (Ping timeout: 272 seconds)
10:29:17*dddddd joined #nim
10:38:10*nsf quit (Quit: WeeChat 2.7)
10:48:07silvernodeGood morning
10:48:14silvernodeIt's my night off
10:48:24silvernodeAnything interesting going on?
10:49:27Araqalways
10:49:57Araqsomebody ported the Nim compiler itself over to Nim version 1.0
10:53:46*natrys joined #nim
10:56:31Zevvwhat version did it run on before then?
10:58:07narimiran0.19 or whatever was the version that had `nimOldCaseObjects` by default
11:00:20Araqdidn't we change that only for version 1?
11:00:41AraqI mean 0.20 had the old case objects and 1.0 got the new ones? I probably misremember
11:04:07*krux02 joined #nim
11:10:25*krux02_ joined #nim
11:29:10*silvernode quit (Remote host closed the connection)
11:37:49FromDiscord<Clyybber> morning
11:38:07FromDiscord<Clyybber> Araq: Did you see https://github.com/nim-lang/Nim/pull/13180 ?
11:38:08disbotFix docs for subdirs too
11:38:15FromDiscord<Clyybber> I fixed the docs for subdirs too
11:38:30FromDiscord<Clyybber> But the tests fail on windows since it uses backslash in the path
11:39:07*krux02_ quit (Remote host closed the connection)
11:39:58*krux02_ joined #nim
11:45:12*floppydh quit (Quit: WeeChat 2.7)
11:47:10*floppydh joined #nim
12:01:22*xet7 joined #nim
12:08:29FromGitter<zacharycarter> are concepts still usable / working? I have some old code that used them but I'm getting an error now:
12:09:03FromGitter<zacharycarter> `cannot instantiate: 'path[Spaceship, tuple[x, y: int], float]'` when I try to call a method where Spaceship is supposed to satisfy the concept
12:10:38FromGitter<zacharycarter> I tried using the `{.explain.}` pragma but I don't notice any additional output
12:15:01FromGitter<zacharycarter> I'll just rewrite it without concepts
12:16:44*marmotini_ joined #nim
12:27:13FromDiscord<mratsim> concepts do work
12:27:26FromDiscord<mratsim> I use them in several places in Weave
12:32:06*rockcavera joined #nim
12:35:53FromDiscord<Rika> concepts do work yes
12:45:53*jken quit (Disconnected by services)
12:46:25*jken_ joined #nim
12:46:46FromGitter<zacharycarter> hmm
12:46:57FromGitter<zacharycarter> okay thanks - must be something else then
12:50:23*nsf joined #nim
12:59:31*krux02 quit (Quit: Leaving)
13:04:03FromGitter<alehander92> can you give an example
13:06:10*logand joined #nim
13:06:18logandhi, i am trying to understand union types. what does the error in https://0x0.st/zhCI.nim mean? how should the code look like for nim to compile this?
13:06:55logandthe error mesage is rec.nim(12, 31) Error: attempting to call routine: 'Tree' found 'rec.Tree [declared in rec.nim(3, 3)]' of kind 'type'
13:06:58FromDiscord<Rika> use "Tree(k: INT, i: x)" not =
13:07:43logandi see
13:10:23logandafter fixing that, i get https://0x0.st/zFrZ.nim with error in https://0x0.st/zFrT.txt
13:10:53FromDiscord<Clyybber> Araq: Can we merge https://github.com/nim-lang/Nim/pull/13180 ?
13:10:54disbotFix docs for subdirs too
13:11:12*Hideki_ joined #nim
13:11:17logandi suppose it is trying to convert Tree to string but I don't see why should that happen
13:11:18FromDiscord<Rika> logand, you dont have a `$` proc defined
13:11:24FromDiscord<Rika> that's needed for echo
13:11:30FromDiscord<Rika> or stdout write
13:11:35logandhmm but I use write
13:11:57logandat which point is echo used?
13:11:57FromDiscord<Rika> if you want python like printing then use stdout.write tree(42).repr
13:12:07FromDiscord<Rika> stdout.write needs it too
13:12:36FromDiscord<Rika> the signature for write prolly looks like (s: varargs[string, `$`]) or so
13:12:47logandok, i though that "stdout.write tree 42" would call my write method
13:12:49FromDiscord<Rika> which means it does an implicit call to `$`
13:12:59FromDiscord<Rika> huh you have that
13:13:00FromDiscord<Rika> odd wait
13:13:06FromDiscord<Rika> i dont think stdout is a File
13:13:17logandok i should not use write but a different name wich doesn't clash
13:13:48FromDiscord<Clyybber> logand: If you have a write method defined appropriately it should use it
13:14:00FromDiscord<Clyybber> But its better to define your own $
13:14:05logandyeah i probably dont
13:14:20FromDiscord<Rika> hmm, stdout is a File yeah
13:14:44FromDiscord<Rika> oh oh
13:14:48FromDiscord<Rika> check line 29
13:15:00FromDiscord<Rika> `f.write i` where i is a Tree
13:15:09FromDiscord<Rika> huh
13:15:18FromDiscord<Rika> im still kinda confused
13:15:21FromDiscord<Rika> that should work
13:15:28logandthat's intentional, it is a recursive structure after all
13:15:51FromDiscord<Rika> yeah i think you should move from write to `$`
13:16:00logandi'll try that
13:16:03FromDiscord<Rika> (aka, what if someone called echo tree 42)
13:16:25*endragor quit (Remote host closed the connection)
13:17:02logandrenaming write to mywrite works
13:17:09FromDiscord<Rika> interesting
13:17:15FromDiscord<Rika> weird proc resolution
13:17:17FromDiscord<Clyybber> hmm, that is weird
13:17:19logandso it was somehow clashing with the built-in write
13:18:27logandi did not want to define $ because if the tree is huge, it should not be converted to a string but simply serialized to the file.
13:18:44logandmaybe i should not be concerned about it at the beginning
13:19:32FromDiscord<Rika> you'd have a half written file if the program errors in the middle
13:19:36*Vladar joined #nim
13:20:01FromDiscord<Clyybber> hmm, I think this is a bug
13:20:16FromDiscord<Clyybber> logand: Can you open an issue?
13:20:18logandwell that's life, but at least it would not eat all RAM
13:20:31logandand other processes could carry on
13:21:15logandok, i'll try to open an issue
13:22:16*abm joined #nim
13:26:11logandin a lot of nim examples, i see lots of conversions to string and string appending. in other languages, such string operations are usually expensive. does nim do something clever with strings so that these operations are reasonably efficient?
13:29:47Zevvthere is no string copy done
13:29:56Zevvnim resizes the buffer and adds in-place
13:30:32logandok thanks for clarification
13:30:51logandi suppose that is true for c cpp and objc backends
13:30:57logandbut not for js backend
13:31:45logandhow can i message people FromDiscord?
13:32:04logandClyybber: hi
13:32:12logandhmm that did not work
13:33:28FromDiscord<Rika> uh
13:33:30FromDiscord<Rika> you cant
13:33:47FromDiscord<Rika> @Clyybber logand wants to talk to you
13:34:13logandno thats ok, i was just asking how it works
13:34:39*ng0 quit (Quit: leaving)
13:35:07Zevvtoo late. clyybber will now talk to you.
13:35:08FromDiscord<Clyybber> logand: Oh, sorry missed your ping 🙂
13:35:23FromDiscord<Clyybber> Zevv: i cannot be stopped
13:35:28Zevvi know, i know
13:35:45*tane joined #nim
13:35:54FromDiscord<Clyybber> <talk>
13:36:08FromDiscord<Rika> clyybber will now commence talking
13:36:20FromDiscord<Clyybber> <talk>
13:36:25*ng0 joined #nim
13:36:25*ng0 quit (Changing host)
13:36:25*ng0 joined #nim
13:36:26FromDiscord<Clyybber> </talk>
13:36:38FromDiscord<Clyybber> thank you for listening!
13:37:08narimiranany of you listens 'talk talk'?
13:37:42FromDiscord<Rika> Clyybber: you forgot to close the top level talk
13:37:58Zevvhe's not done yet
13:37:59FromDiscord<Clyybber> narimiran: what does it bother you, It's my Life!
13:38:01*nsf quit (Quit: WeeChat 2.7)
13:38:11narimiran;)
13:38:26FromDiscord<Clyybber> Rika: Sorry I only understand parsable parser error messages
13:44:15*floppydh quit (Quit: WeeChat 2.7)
13:46:20logandClyybber: issue at https://github.com/nim-lang/Nim/issues/13182
13:46:22disbotwrite requires conversion to string ; snippet at 12https://play.nim-lang.org/#ix=27DY
13:46:49*lritter joined #nim
13:46:56FromDiscord<Clyybber> logand: Nice, thanks!
13:48:27logandnim playground, nice
13:55:52*lesshaste quit (Quit: Leaving)
14:00:26PMunchYeah it's a nice little tool :)
14:25:55stefantalpalaruWhy is {.importc.} by itself generating a "nimcall" declaration? It should be "cdecl", in order to work on 32-bit Windows.
14:27:05*uvegbot quit (Ping timeout: 268 seconds)
14:33:39*zyklon joined #nim
14:43:14*Vladar quit (Remote host closed the connection)
14:53:36*PMunch quit (Quit: Leaving)
14:53:51FromDiscord<mratsim> on windows it's often stdcall though
14:57:14leorizestefantalpalaru: because you might be importing a nim proc? :p
14:57:41leorizeusually I just annotate it myself with {.cdecl.}, etc.
15:15:22disruptektime to grow my neckbeard out for fosdem.
15:15:23*ng0_ joined #nim
15:15:23*ng0_ quit (Changing host)
15:15:23*ng0_ joined #nim
15:16:49stefantalpalaruleorize: why would you import a Nim proc with {.importc.}?
15:16:55disruptekJjp137: also, do we want a command to remove deps? and how does it work?
15:17:37stefantalpalarumratsim, no, it's nimcall. I saw the stack being corrupted by that.
15:17:42leorizestefantalpalaru: because you exported it for dynamic library usage?
15:18:09leorizethough it still doesn't make sense that nimcall is the default :p
15:18:17*ng0 quit (Ping timeout: 272 seconds)
15:18:23leorizebut I don't know if it's too late to change
15:19:10*luis_ joined #nim
15:20:55Araqimportc is a name import really and the calling convention is orthogonal
15:20:57*dcmertens joined #nim
15:21:38dcmertensis there anything in "Nim in Action" that is out of date? Is it still a good book for getting started?
15:22:50leorizeprobably the case objects :P
15:23:01leorizebut I never read the book so I don't know if it's even in there
15:23:07Araqdcmertens, it is ok, most important change is that 'nil' for strings and seqs is gone
15:34:53Araqhow about this: instead of "guessing", make the compiler warn about an 'importc' without a specified calling convention
15:37:18FromDiscord<Clyybber> Araq: ping
15:37:23disrupteksupport 'auto'?
15:37:37dcmertensAraq, thanks
15:37:42dcmertensleorize, thanks
15:45:11stefantalpalaruAraq: warning is fine, warning and defaulting to cdecl is even better.
15:46:40AraqClyybber: pong
15:46:57FromDiscord<Clyybber> Araq: Sup, can we merge https://github.com/nim-lang/Nim/pull/13180 ?
15:46:58disbotFix docs for subdirs too
15:47:08FromDiscord<Clyybber> Its the continuation of my last fix
15:47:33FromDiscord<Clyybber> it just adds `../` to the href if the generated html is in a subdir
15:47:46FromDiscord<Clyybber> *to the href pointing to nimdoc.out.css that is
15:50:21Araqk merged
15:51:06FromDiscord<Clyybber> nice
15:51:37lqdev[m]is there a way of getting the current stack trace inside of a macro on compile time, just like you can do on runtime?
15:52:22lqdev[m]need to debug where a proc is called in a macro.
15:52:39Araqsystem.instantiationInfo
15:53:01Araqthe 'index' parameter
15:53:27Araqbut I never used any other value than the default -1
15:54:59lqdev[m]I suppose -1 returns where the topmost macro was called?
15:58:04Araqdunno, try it out
15:59:59*luis_ quit (Quit: luis_)
16:00:24*Vladar joined #nim
16:03:11*luis_ joined #nim
16:07:45CcxWrknarimiran: Hi, could you look at https://github.com/nim-lang/Nim/pull/10992 as it's kind of blocking being able to use the async libs for writing simple unix-style utilities?
16:07:46disbotselectors.nim: Add define to select event loop implementation
16:09:03*icebattl1 joined #nim
16:09:32shashlickis it possible to have asynchttpserver not read the full body automatically and to repond back in chunks?
16:09:56*NimBot joined #nim
16:16:38*Hideki_ quit (Remote host closed the connection)
16:17:26*Hideki_ joined #nim
16:18:33*marmotini_ quit (Remote host closed the connection)
16:21:28*ng0_ is now known as ng0
16:22:03*Hideki_ quit (Ping timeout: 265 seconds)
16:23:16*Tungki joined #nim
16:26:49*endragor joined #nim
16:27:33*nsf joined #nim
16:28:19*marmotini_ joined #nim
16:29:15*luis_ quit (Ping timeout: 240 seconds)
16:33:08*actuallybatman joined #nim
16:34:54*leorize quit (Quit: WeeChat 2.6)
16:38:03FromGitter<Varriount> CcxWrk: How is it blocking?
16:39:03CcxWrkYou can't use async libs with most non-network file descriptors (since epoll inherently doesn't support them).
16:40:44CcxWrkEpoll is rather bad default for eventloop mechanism, but even worse Nim libraries currently hardcodes it for Linux.
16:42:55AraqCcxWrk, rebase the PR please and I'll merge it once the tests are green
16:43:08Araqsome documentation and a changelog entry would be nice too
16:43:52FromDiscord<mratsim> wow the storm is brewing: https://github.com/actix/actix-web
16:44:30CcxWrkAraq: Okay, I'll try to do that on Monday.
16:44:57FromDiscord<mratsim> the original Actix is one of Rust largest web framework with 6.3 stars: https://github.com/fafhrd91/actix-web
16:49:33Araqmratsim: well open source development has its downsides :-)
16:51:31disruptekdon't worry, Araq, everyone loves you.
16:51:59stefantalpalaruIf you can't take the heat, don't play the game.Taking your toys from the playground and leaving in protest is a shit move at any age.
16:53:04*Trustable joined #nim
16:54:54*Hideki_ joined #nim
17:02:19FromDiscord<yewpad> I did read the readme of actix-web but still, it feels kinda like a "douchebag move". There's no place in open source for personal feelings and whatnot, that's my opinion at least. You're not having fun anymore? Get another maintainer on the board, leave it to him, bye bye open source and have fun.
17:02:21FromDiscord<yewpad> I just don't get it.
17:02:38FromDiscord<yewpad> Moving the repository alone broke a lot of dependencies I think.
17:02:52disrupteki agree it's spiteful.
17:03:41FromDiscord<Clyybber> Its a pity, but I do not think theres no place for personal feelings in open source
17:03:45FromDiscord<Rika> @mratsim SIX POINT 3 STARS
17:03:52FromDiscord<mratsim> apparently it's due to his uncompromising focus on performance and he was using unsafe code that had aliasing issue and refused a patch to remove that unsafe code: https://www.reddit.com/r/rust/comments/epoloy/ive_smoketested_rust_http_clients_heres_what_i/feksq2i/
17:03:53FromDiscord<Rika> who gave just 0.3 a star?
17:04:18disrupteki gave 0.1 stars 5 times and -0.1 stars twice.
17:04:31*Tungki quit (Read error: Connection reset by peer)
17:04:49FromDiscord<mratsim> @yewpad no dependency broken, when you upload a new version to cargo the whole source tree is snapshotted. In Nim that would break everything though.
17:04:57*Tungki joined #nim
17:06:20FromDiscord<yewpad> Hm aight. Thankfully it didn't break anything but imagine like it would. Oof.
17:06:47*seni joined #nim
17:06:59*Hideki_ quit (Ping timeout: 268 seconds)
17:07:50FromDiscord<yewpad> And yes, I also agree on what stefantalpalaru said. If you can't take the heat, don't play the game. There's nothing else to say.
17:08:09FromDiscord<yewpad> Well, leave it to the Rust community. Here's Nim the main topic. 😅
17:08:57FromDiscord<mratsim> Well it's not about Rust or Nim in general but about open-source, maintainers, contributors, users
17:09:22FromDiscord<mratsim> Thankfully Nim is fundamentally unsafe so there is no "unsafe zealots" (yet) 😉
17:09:31FromDiscord<yewpad> 😄
17:09:32FromDiscord<Rika> sorry, my english error correction is not good enough to decipher the actix/actix readme thing
17:09:40FromDiscord<yewpad> xD
17:14:45stefantalpalaruWhat's relevant to Nim and its ecosystem is the concept of a social contract applied to open source projects. We all have an implied social responsibility to our users, despite declining any legal responsibility in our licenses.
17:16:27*logand quit (Ping timeout: 240 seconds)
17:17:21disrupteknah, when you're user you're a user all the way.
17:17:30disruptekfrom your first git clone till your last dyin' day
17:18:11FromDiscord<mratsim> it's all about managing expectations
17:18:49disrupteksure, expect peoples to be peoples.
17:19:59FromDiscord<mratsim> People coming to Rust feel very strongly about unsafe code, it's the whole deal. So using unsafe code is not expected. Where it went wrong is that a PR that fixed the bug triggered the author. (and since it's deleted it's a bit hard to have more context)
17:20:30*opal quit (Remote host closed the connection)
17:20:54Araqhey, and I thought I'm such an "unsafe zealot"
17:21:35disruptekbut it's silly to assume that people with agency will not use that agency.
17:21:43*opal joined #nim
17:22:00Araqdisruptek: can 'nimph' now create tagged releases for me?
17:22:05disrupteksure.
17:24:21disruptekwell, it creates release tags dated according to when the version arrived in your .nimble file. it doesn't create github releases (which are a separate animal).
17:25:24disrupteki can't think of any decent reason /not/ to add that, though.
17:25:25*ptdel joined #nim
17:26:32*actuallybatman quit (Quit: leaving)
17:41:24AraqI mean "git tags", not github releases
17:41:35disruptekyeah, it does the right thing.
17:47:01FromGitter<Varriount> disruptek: So is `nimph` an alternative to `nimble`?
17:47:18disruptekit currently relies on nimble for some stuff.
17:47:57*abm quit (Quit: Leaving)
17:48:11shashlickThink of nimph as a package manager and nimble as a build tool in that context
17:48:45shashlickThinking of adding more functionality to asynchttpserver
17:49:12disrupteki don't believe the http stuff in stdlib is fixable.
17:49:37shashlickAlternative is to wrap libevhtp
17:49:44disruptekthe last time i looked at, anyway, i decided that it had to be replaced wholesale due to api reasons.
17:50:10disruptekwrappers are crutches and i wish they didn't exist in stdlib.
17:51:57FromGitter<Varriount> disruptek: I'd look at the API Go provides
17:52:22FromGitter<kaushalmodi> disruptek: Just chiming in to give a pointer to https://github.com/kdheepak/github-release
17:52:50disruptekneat, but i already have the complete github api impl.
17:52:57shashlickwell, first would be to optionally read the body, second to add procs to write back responses in increments
17:53:06FromGitter<kaushalmodi> I was just replying to your: ⏎ ⏎ > it doesn't create github releases (which are a separate animal).
17:53:15disruptekshashlick: there's a stream object you can use.
17:53:53disruptekyeah, i mean, i will add them. but i will do so using the dependencies i already have. 😉
17:54:40disrupteki guess github-release almost replaces bump; just missing the key bump functionality.
17:55:53disruptekso you want changelogs in the releases? is that a good thing?
17:56:01*icebattle quit (Quit: leaving)
17:56:13FromGitter<kaushalmodi> A link would be fine
17:56:17*icebattl1 quit (Quit: leaving)
17:56:26disruptekwell, github adds a link.
17:56:32shashlickdisruptek: ya but i don't want the server to read everything - if it is a post, it will read files in full
17:56:34disruptekeg. "14 commits since the last release"
17:56:42*icebattle joined #nim
17:56:55FromGitter<kaushalmodi> I used to manually type in these links: https://github.com/OrgTangle/ntangle/releases/tag/v0.6.0
17:56:57shashlickhttps://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/asynchttpserver.nim#L241
17:56:58disruptekshashlick: yes, we need a new third-party impl.
17:57:09FromGitter<kaushalmodi> `https://github.com/OrgTangle/ntangle/compare/v0.5.1...v0.6.0`
17:57:28disruptekbut, i think it should be based upon the rfcs, not some other language's idiomatic api.
17:58:24disruptekoh, you just want links to compare release X with release Y<X?
17:58:25FromGitter<kaushalmodi> > eg. "14 commits since the last release" ⏎ ⏎ Those links are always `tag...master`. I would think that the user would like to see `prev_tag...this_tag`
17:58:33disruptekgotcha. that makes a lot of sense.
17:58:46disrupteklet's do that thing.
17:58:54FromGitter<kaushalmodi> 👍
18:01:43*marmotini_ quit (Remote host closed the connection)
18:02:19*marmotini_ joined #nim
18:05:22*ng0_ joined #nim
18:05:22*ng0_ quit (Changing host)
18:05:22*ng0_ joined #nim
18:05:41*Tungki quit (Ping timeout: 264 seconds)
18:07:14*marmotini_ quit (Ping timeout: 268 seconds)
18:07:23*ng0 quit (Ping timeout: 272 seconds)
18:09:14*actuallybatman joined #nim
18:17:47*nsf quit (Quit: WeeChat 2.7)
18:18:13*Hideki_ joined #nim
18:18:31*jholland__ joined #nim
18:23:16*Hideki_ quit (Ping timeout: 268 seconds)
18:24:45disrupteki guess what we want for golden is not imgui, just because "portability".
18:24:57disruptekso, immediate-mode text ui, instead.
18:27:38AraqIMHO the sooner we kill "text mode" the better. I want to live in a world where my programs can output diagrams and progress bars easily
18:28:26disrupteki want to get basic ui from programs running on servers, and i don't want to send imgui over ssh.
18:28:40disruptek!repo illwill
18:28:40disbothttps://github.com/johnnovak/illwill -- 9illwill: 11 15 76⭐ 8🍴
18:30:08disruptekwhat i really want is proper gui. but i just don't know how to handle in-situ monitoring with that.
18:30:36rayman22201what kind of monitoring?
18:31:25rayman22201like Datadog or splunk or something?
18:31:30disrupteki wanna bake golden right into the binary and then invoke the binary and have it check the environment. if it sees some direction from golden, it will run a different main loop.
18:31:47disruptekyeah, so i can toggle instrumentation without changing the binary.
18:32:17rayman22201interesting. That's some HCR type stuff. neat
18:32:30disrupteki mean, if i build the repl into it, yeah.
18:32:39disruptekbut initially, i wouldn't care so much about that.
18:33:15rayman22201It's a path quickly leads to there :-P but I get you.
18:33:39disruptekyep.
18:35:10rayman22201The cop out for the UI problem is to just have it web based. I.E. a tiny http server (or websocket server if you want to get fancy)
18:35:23rayman22201then build a JS based UI
18:35:50disrupteki know, but the hatred runs deep with this one.
18:36:20rayman22201lol. I know you feel
18:36:24disruptekthis is basically how plotly works afaik, btw.
18:36:27disruptek!repo plotly
18:36:29disbothttps://github.com/brentp/nim-plotly -- 9nim-plotly: 11plotting library for nim-lang 15 77⭐ 8🍴 7& 8 more...
18:36:39rayman22201yup. I <3 plotly
18:38:12*endragor quit (Remote host closed the connection)
18:38:49disruptekmaybe we use figlet and then have the web-ui for portability concerns.
18:39:06disruptekfidget
18:39:21*donpdonp joined #nim
18:39:24disrupteksorry treeform, i just have figlet stuck in my brain for some reason. 😁
18:39:54*marmotini_ joined #nim
18:40:21donpdonpthis nim file compiles fine with "import redis; redis.open();" etc etc. but when I build with 'nimble test' I get .nimble/pkgs/redis-0.3.0/redis.nim(50, 40) Error: undeclared identifier: 'Socket'
18:45:38*xet7 quit (Remote host closed the connection)
18:48:12*xet7 joined #nim
18:48:20rayman22201Araq are you around?
18:56:04FromDiscord<Clyybber> Hmm, that would actually be a cool feature
18:56:12FromDiscord<Clyybber> A shell + terminal emulator
18:56:33FromDiscord<Clyybber> that displays images which are output to stdout
18:56:39*logand joined #nim
18:57:00disruptekgolden already had that and i took it out. 😊
18:57:09FromDiscord<Clyybber> 😦
18:57:14rayman22201I think kitty supports that kind of thing right?
18:57:29FromDiscord<Clyybber> heh, I was about to ask if kitty supports that 😄
18:57:35disruptekyeah, it used kitty and generated graphs in png and displayed them on the console.
18:58:03FromDiscord<Clyybber> thats pretty cool
18:58:10disruptekit was hack.
18:58:29FromDiscord<Clyybber> how so?
18:59:49disruptekseveral ways... the kitty interface is a hack, the png was expensive to create and annoying to render, and because it's not dynamic, you have to basically corrupt your own reading to keep a consistently interesting graph.
19:00:39disruptekmaybe the right way to do it is to simply have a live mode against the golden database.
19:00:40rayman22201So on the arc async front, one thought I had was to make the callback field into a ref callback, but it turns out that is a huge api change that breaks my brain (and a lot of code.)
19:01:50FromDiscord<Clyybber> disruptek: WDYM corrupt your own reading?
19:02:31disruptekyou're throwing out outliers so that you can zoom. but outliers are data, too.
19:02:45disrupteksee golden-3.0.12 if you wanna play with kitty graphs.
19:03:15FromDiscord<Clyybber> kk
19:04:02*natrys quit (Quit: natrys)
19:04:15*gangstacat quit (Quit: Ĝis!)
19:05:28disruptekis `choosenim devel` HEAD, nightly, or something else?
19:05:41disruptekasking for my friend travis...
19:06:00*Vladar quit (Quit: Leaving)
19:08:11*ng0_ is now known as ng0
19:10:13shashlickHead
19:32:32*ptdel quit (Ping timeout: 260 seconds)
19:34:18*gangstacat joined #nim
19:40:22shashlickanyone uses scoop on windows?
19:44:30FromDiscord<treeform> I dont
19:52:05FromGitter<matrixbot> `grantmwilliams` Are iterators lazy in Nim? (I cant find any concrete answers online).
19:53:26*Hideki_ joined #nim
19:55:24lqdev[m]@grantmwilliams what do you mean, "lazy"? also, please join #freenode_#nim:matrix.org and not the gitter version
19:57:53*Hideki_ quit (Ping timeout: 260 seconds)
19:57:56FromGitter<mratsim> @grantmwilliams closure iterators are probably lazy
19:58:20FromGitter<mratsim> Inline iterators are state machines
20:05:47disruptekshashlick: thanks, boss.
20:06:01disruptekshashlick: yeah, some nimph user uses it and says it's the right way to install cmake.
20:08:14*actuallybatman quit (Quit: leaving)
20:09:02*nsf joined #nim
20:13:42*voltist joined #nim
20:15:22shashlicknimble install cmake also works 😉
20:15:42shashlickwell at least on Windows
20:23:50voltistI hate the feeling of seeing your code get more and more messy and fragmented over the course of a project
20:23:59voltistIt's like loosing control over it
20:25:44shashlickentropy
20:26:57*oculux joined #nim
20:28:23FromDiscord<AGNiMA> How can install a nimble package in project directory
20:28:34FromDiscord<AGNiMA> How can I install a nimble package in project directory
20:29:08disruptek!repo nimph
20:29:09disbothttps://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 52⭐ 2🍴 7& 1 more...
20:29:46FromDiscord<AGNiMA> Thank you 🙂
20:38:47*luis_ joined #nim
20:39:39disruptekhey, don't be afraid to write nim.
20:43:38disruptekjust because zevv won't, doesn't mean you can't. ya dig?
20:46:19FromDiscord<AGNiMA> /nimph/src/nimph.nim(591, 16) Warning: optionally upgrade a gitless install to clone [User]
20:46:19FromDiscord<AGNiMA> ... fatal.nim(39) sysFatal
20:46:19FromDiscord<AGNiMA> ... Error: unhandled exception: index out of bounds, the container is empty [IndexError]
20:46:33FromDiscord<AGNiMA> trying to cmake it
20:55:23*Trustable quit (Remote host closed the connection)
20:55:57*marmotini_ quit (Remote host closed the connection)
20:56:31*marmotini_ joined #nim
21:01:08*marmotini_ quit (Ping timeout: 268 seconds)
21:03:21*JustASlacker joined #nim
21:12:06disruptekagnima: you need nim 1.0.6 (unreleased) or nim 1.1.x
21:13:27*narimiran quit (Ping timeout: 258 seconds)
21:14:58*marmotini_ joined #nim
21:17:23disruptekyeah, we should have a way to visualize code churn.
21:19:13disruptekmaybe an editor hook that lets you color by age? or maybe you get a popup with the revision log for your current block. or, up to the outer-most closure?
21:21:49*dcmertens quit (Ping timeout: 272 seconds)
21:21:53disrupteki love this: among tricky async code, frequently insufficiently commented, this needless gem:
21:21:56disruptekresult.add newVarStmt(futSym, asyncProc) # -> var future<x> = y
21:22:13disruptekhey, thanks, there, buddy.
21:22:20disruptek'preciate you.
21:24:01disruptekdom96: you just convinced me to use more than one line for a commit message. and i don't mean that in a deprecating way; i'm appreciating your message now.
21:27:39*marmotini_ quit (Ping timeout: 240 seconds)
21:28:27*marmotini_ joined #nim
21:34:04disruptekwe should do pair programming tomorrow. i'll keyboard on-stream and code whatever you want.
21:34:21disruptekif my audio works, i mean. i can't remember if i fixed it.
21:35:30dom96disruptek, http://bit.ly/2RuYu9J
21:35:44disrupteklol
21:35:55*logand quit (Remote host closed the connection)
21:36:00disrupteki don't mean just you, sweetheart.
21:36:21disruptek😍
21:37:29disrupteki know, i'm really sending mixed signals. i'm sorry. i'm not trying to be a dick, i promise.
21:38:27disrupteki'm thinking about streaming because i'm trying to write a nim tutorial and there's just too much to say about why it matters that we choose nim.
21:39:39Zevvso instead of choosing for the high density medium of written text that can be consumed or skipped at ones own prefered pacing, you choose to go rambling into a mic for 90 minutes
21:40:03disruptekyeah, because i /want/ to wax philosophic about it.
21:40:20Zevv"there's just too much to say" is an excellent reason to *write*
21:40:24*logand joined #nim
21:40:33disruptekwell, that's true.
21:41:07disruptekbut it's hard to put that in a tutorial.
21:41:47Zevvphilosophing is done over beer, not in youtube channels
21:42:02*marmotini_ quit (Ping timeout: 268 seconds)
21:42:03disrupteki can drink on camera, sure.
21:42:18Zevvyou got me there. go for it!
21:42:23*ptdel joined #nim
21:42:35*marmotini_ joined #nim
21:42:35disruptekbut the fact is, we wouldn't be meeting at fosdem if there wasn't more information conveyed via audio-visual methods.
21:43:03Zevvnope, purely a social thing
21:43:24disruptekyes, and philosophing is a social thing as well.
21:43:32Zevvtrue, that
21:43:35disruptekunless you're merely doing it with beer.
21:44:04disruptekyou probably know a lot more about youtube than i do.
21:44:29logandwhat is the difference between type File and type Stream? why is stdout a File and not Stream?
21:44:37rayman22201Beer + streaming is excellent marketing. We need more of this for Nim 😛
21:44:54Zevvdisruptek: you'd be surprised. I spent *weeks* staring at youtube videos over the last months
21:45:11Zevvbut that was for technical reasons.
21:45:11disruptekno, i know. that's not the bit that surprises me.
21:45:17disruptekunless you mean the staring part.
21:45:25disruptekthat surprises /and/ troubles me, zevv.
21:45:29Zevv"work"
21:45:34disrupteki really think we should talk to your doctor.
21:46:39disrupteki mean, seriously, is there a "why nim" article somewhere?
21:46:49disrupteki can't think of any.
21:47:06disrupteki will write the shit out of it if i have to.
21:47:47*marmotini_ quit (Ping timeout: 272 seconds)
21:48:25FromGitter<zetashift> there are some, but I think they are quite old
21:48:47rockcaveraI was writing wyhash in nim, but I was disappointed with the result. For wyrand: my pure nim code was 6.66x slower than code C. The nim code importing the C function is 4.04x slower. For wyhash: my pure nim code was 12.99x slower than code C. The nim code importing the C function is 2.37x slower than code C.
21:48:53FromGitter<zetashift> https://hookrace.net/blog/what-is-special-about-nim/
21:49:00FromGitter<zetashift> and the followup article
21:49:00rockcaveraIs this performance gap normal? I had never compared the performance of a Nim and C code.
21:49:44disruptekwe should build some benchmarks.
21:50:33dom96disruptek, well, I was referring to what you said directly to me. I don't recall suggesting you write more in your commit messages
21:50:34rayman22201logand: https://nim-lang.org/docs/streams.html#FileStream
21:50:37disrupteki think maybe the solution is to publish a list of benchmarks that nim is in (or that we want it to be in).
21:50:50FromDiscord<gingerBill> What was you Nim code that was slower than C?
21:50:58FromDiscord<gingerBill> Did you just transliterate it from C to Nim?
21:51:02disruptekdom96: no; i was reading some async code and got a treat: a nice long commit message. it was great.
21:51:09FromDiscord<gingerBill> And how were you calling it?
21:51:55rayman22201logand: also, https://nim-lang.org/docs/streams.html#basic-usage-filestream-example
21:51:58disruptekusers will come asking why we aren't in a given benchmark, or why we're slow, and we'll know to fix it. otherwise, we never need to worry about managing the benchmarks ourselves.
21:52:23dom96disruptek, ahh, cool
21:52:39disruptekthat'll normalize our performance dramatically, too, because it will be spread/risked by the publisher.
21:52:46logandrayman22201: thanks, thats a good start
21:53:16rockcaveragingerBill https://pastebin.com/ihiUh0cf
21:53:17rockcaveramy code
21:53:27disruptek!repo nim-problem
21:53:28disbothttps://github.com/pb-cdunn/nim-help -- 9nim-help: 11Need help debugging gc problem in Nim 15 0⭐ 2🍴 7& 7 more...
21:53:41disruptek!repo rockcavera/nim-problem
21:53:41disbothttps://github.com/rockcavera/nim-problem -- 9nim-problem: 11problem with speed to exclude equals using hashset 15 0⭐ 1🍴
21:55:15disruptekif you know of a benchmark, please share it. i'll collect results and we can at least teach a link to the bot.
21:55:43FromDiscord<gingerBill> Thank you rockcavera
21:55:47FromDiscord<gingerBill> So it is a transliteration
21:56:03rockcaverayes
21:56:18rockcaveraI transcribed the C code to Nim
21:56:23FromDiscord<gingerBill> How did you time it?
21:56:37FromDiscord<gingerBill> Did you time the execution of that section of code or the entire program?
21:57:15rockcaverajust from the code session using monotimes
21:57:25FromDiscord<gingerBill> Okay, there's the problem.
21:57:44FromDiscord<gingerBill> Wait...
21:57:45*brainproxy joined #nim
21:57:46FromDiscord<gingerBill> Ignore me.
21:58:16rockcaveraAnd for C I also used the same scheme as Nim's monotimes.
21:59:09FromDiscord<gingerBill> Interesting.
21:59:27FromDiscord<gingerBill> And you say the C call through Nim is slower than in normal C?
21:59:44FromDiscord<gingerBill> Are you using the same optimization levels for both compilers?
21:59:44rockcaverayes
21:59:54FromDiscord<gingerBill> Hmmmmm That is interesting.
22:00:10FromDiscord<gingerBill> Because the C call should be identical.
22:00:18FromGitter<Varriount> You used `-d:release`?
22:00:19rockcaverausing the importc pragma is also slower than C code
22:00:20rockcaverayes
22:00:23rockcavera-d:danger -d:release
22:00:28FromGitter<Varriount> O_o
22:00:38rockcaveraC code compile with gcc -O3
22:00:44disrupteki don't even so how that's possible.
22:00:49disrupteks/so/see/
22:01:03FromGitter<Varriount> Hm, can you try with LTO?
22:01:12disruptekhow could that matter?
22:01:25rockcaveraI would not be scared if the difference in execution time was minimal, but it is very big.
22:01:53disruptekis this in the nim-problem repo?
22:01:59rockcaveradisruptek noo
22:02:13disruptekcan you add it?
22:02:14FromGitter<Varriount> disruptek: Link-time optimization optimizes across file boundaries
22:02:33FromGitter<Varriount> It can allow more inlining to be done
22:02:53disruptekokay, fair enough.
22:03:21disrupteki was getting the impression that this was, like, a c call executed from nim code, once.
22:03:29rockcaveradisruptek yes, i can add.
22:03:41disruptekit's still surprising that there could be any overhead.
22:04:05disruptekalso, with the way nim writes c, we're not talking about x-file boundaries.
22:04:39disruptekrockcavera: cool, that sounds like something worth looking into.
22:05:59FromGitter<Varriount> rockcavera: To enable link-time optimization, try `--passC:'-flto' --passL:'-flto'`
22:07:00disruptekso that base64 performance is pretty bad, even after treeform's fix.
22:08:09rockcaveraVarriount nice
22:08:34FromGitter<Varriount> Usually it doesn't result in much of a performance gain, just a smaller executable
22:10:10disruptekpretty big deal on something like chromium. everywhere else, kinda meh.
22:10:31dom96Yay, big thanks to shashlick for choosenim 0.5.1!
22:11:00disruptekshashlick is like the mom i always wanted.
22:11:07rockcaveraNow it's so fast I can't even benchmark
22:11:10rockcaverahahahaha
22:11:37FromGitter<Varriount> rockcavera: Is it possible the call might have been optimized away?
22:11:54FromGitter<Varriount> A compiler might do that, if it knows that the function being called has no side effects
22:17:22dom96Anyone benchmark httpbeast with --gc:arc for me yet? :P
22:19:28disruptekstill trying to break the async cycle.
22:20:46dom96Depending on how quickly I can create a presentation for FOSDEM this weekend I may even play around with it a little
22:21:23disrupteksometimes it's hard to believe that the pinnacle of mass-market human-computer interfaces is these text/gui systems. we are animals playing in the mud.
22:22:03*solitudesf quit (Ping timeout: 240 seconds)
22:33:16*nsf quit (Quit: WeeChat 2.7)
22:37:27rayman22201dom96: until we can figure out how to deal with the cycle in async we are kind of stuck...
22:38:05rayman22201It works, but leaks
22:38:09dom96ahh
22:38:19dom96Araq had an idea on how to fix that
22:38:32dom96It requires breaking changes, but still
22:39:41rayman22201I have a few ideas, but I want to get Araqs thoughts
22:40:28dom96I'd love to hear your ideas :)
22:40:51rayman22201I was really hoping for a non breaking change, but that might not be possible 😭
22:45:01rayman22201Well, essentially, we either need to re architect async to get rid of the cycle, or create some new feature to help arc handle the cycle, or some escape hatch: essentially, "I know this is a cycle, but I know what I'm doing, free it anyway"
22:45:50FromDiscord<exelotl> uhh, got something weird with my config.nims
22:48:21FromDiscord<exelotl> so I'm using a cross compiler toolchain by doing `put "arm.standalone.gcc.exe", "arm-none-eabi-gcc"` etc.
22:48:51FromDiscord<exelotl> and I was previously passing options to the C compiler using --passC
22:49:17FromDiscord<exelotl> except, I would get the following error: `arm-none-eabi-gcc.exe: error: unrecognized command line option '-mno-ms-bitfields'`
22:49:50FromDiscord<exelotl> where -mno-ms-bitfields is not a flag that I'd passed myself, but rather something that the Nim compiler decided to add.
22:50:52FromDiscord<exelotl> but I was able to get that error to go away by using `put "arm.standalone.gcc.options.always", " ..... "` instead of passC
22:51:34FromDiscord<exelotl> but then I realised, my project wouldn't build on macos because the default C compiler on that platform is clang
22:57:36FromDiscord<exelotl> anyways the problem is, after I got it to compile on macos using --cc:gcc
22:57:44FromDiscord<exelotl> the -mno-ms-bitfields error comes back
22:57:50FromDiscord<exelotl> on windows
23:02:00*smitop joined #nim
23:03:36disruptekrayman22201: maybe what we really want is a simple three-value switch where you can run wipe with increasingly advantageous (ie. safe) results. putting a name to it lets us track it, too.
23:06:34rayman22201I don't follow
23:09:50*blueberrypie quit (Quit: leaving)
23:10:13disrupteki'm saying that maybe the operations are additive. you move and assign in two steps which sum to a single move.
23:11:11rayman22201sorry. I don't see how that helps with the cycle?
23:12:08disruptekbecause you can have the first instance be "weak".
23:12:23*blueberrypie joined #nim
23:13:40rayman22201isn't that the same as "weakasgn"?
23:14:04disruptekyeah, if there are only two states.
23:14:23rayman22201what is the third state?
23:14:53disrupteki dunno, but we might want to reposition states, add states, etc.
23:18:18disruptekdon't you look at the way it works and think of all kinds of marvelous allocators and other machinery?
23:18:44disruptekmaybe it's just me.
23:19:02rayman22201check this out: https://play.nim-lang.org/#ix=27GH
23:19:33rayman22201lol. I do, but I also like less states :-P
23:19:51rayman22201This "modified" version of the expanded async macro makes the cycle very explicit
23:20:00rayman22201the closure is capturing itself
23:20:28disrupteki can't even build it, but i can read it i guess.
23:20:40rayman22201It doesn't build for you?
23:20:56disrupteknot on playground.
23:21:44rayman22201I forgot the imports
23:21:45rayman22201https://play.nim-lang.org/#ix=27GJ
23:21:46rayman22201here you go
23:22:02rayman22201you really need to build it with arc to see the issue though
23:22:17disrupteki am.
23:22:27disrupteki just thought maybe you wanted me to run it on pg for some reason.
23:22:38rayman22201naw, pg is just a good paste bin :-P
23:23:33rayman22201I think there are two issues. One is "cycle management", the other is controlling what a closure captures.
23:23:52disruptekokay, i had to fix my async first. 😁
23:23:58disrupteklemme run it in my tester
23:24:00rayman22201lol
23:24:20rayman22201I.E. the problem is the closure needs the ability to "weak" capture.
23:24:35rayman22201but we have no explicit control over how things get captured.
23:27:24*luis_ quit (Quit: luis_)
23:28:20disruptekhow did you get this output?
23:29:05rayman22201what output?
23:29:08rayman22201the macro?
23:29:18disruptekyeah, how did you render it?
23:29:25rayman22201--expandMacro:async
23:29:37rayman22201then I had to fix the syntax errors
23:29:39rayman22201:-P
23:29:47disruptek🤯
23:30:07rayman22201yeah, it used to work flawlessly, but expandMacro broke recently I guess
23:30:28rayman22201I then massaged it in the way I mention in the comments :-P
23:30:39disruptekit's funny, i wrote a ton of ast code but very naively.
23:31:37rayman22201lol, that's how we all start
23:31:49rayman22201expandMacro was a gift from the gods for debugging this crap
23:32:09rayman22201I say crap, but I'm a macro junky. I love them
23:40:13disruptekyeah, i think this is the bit i rewrote. but it didn't help.
23:40:29disruptektook me a minute.
23:40:40rayman22201what bit?
23:41:08disruptekmaybe i broke it. 😁
23:41:13rayman22201you did something similar independently you mean?
23:41:22Araqif you mean the backticks
23:41:35Araqhad to add them to finally fix the last template related bugs
23:41:41Araqfor version 1.0
23:41:41rayman22201Hi Araq
23:41:46Araqhi
23:42:15rayman22201that makes sense. Unfortunately the backticks seem to cause issues when they aren't used in macros
23:42:21rayman22201but that really is minor
23:42:31Araqthey are invalid Nim code by design
23:42:36Araqbut anyhow, please look at
23:42:41Araqtasync_prototype.nim
23:42:49Araqin tests\destructor
23:42:54*logand quit (Remote host closed the connection)
23:43:11AraqNim does offer you the "weak capture" via .cursor, I hope
23:43:33rayman22201the problem is, I can't add a .cursor to a closure capture. That's what is needed here I think
23:43:39*logand joined #nim
23:43:40disruptekno, the bit i rewrote was callbacklist processing.
23:44:10rayman22201I originally thought it was callbacks causing the problem too. Now I don't think so
23:44:28Araqthere is no "capture"
23:44:37Araqthere is only "I use X in a closure"
23:44:46Araqand you can annotate the 'X' as .cursor
23:44:53Araqunless it's a parameter :P
23:44:56rayman22201how?
23:45:08Araqtasync_prototype.nim line 35
23:45:16rayman22201ok looking
23:46:15rayman22201Is it on devel? I can't find it
23:46:22rayman22201nvm
23:46:24rayman22201I'm blind
23:46:42Araqthe other thing that I told you guys is the design of
23:46:43Araq CallbackFunc = proc () {.closure, gcsafe.}
23:47:06Araqit invites capturing the future inside the closure and then attaching the closure to the future
23:47:11Araqbad, bad
23:47:18Araqtry instead
23:47:28AraqCallbackFunc = proc (fut: FutureBase) {.closure, gcsafe.}
23:47:46rayman22201indeed. I found that as well
23:47:52AraqI remember doing that for speed reasons earlier, got a 3% speedup
23:47:52disruptekyeah, but i couldn't figure out how to curry it.
23:48:10Araqand then dom96 complained "it's a breaking change" :P
23:48:25disrupteknot if it's just curried somehow.
23:48:28rayman22201it is. It's really embedded now. the stdlib explodes when I try to change it
23:48:48Araqthe fixes I had to do were minimal
23:49:10Araqyeah, stdlib "explodes" but it's only a couple of lines I had to fix
23:49:23AraqI probably forgot a couple of places though :P
23:49:29disruptekand by fix you mean improve.
23:49:31rayman22201orly? I gave up after a few files. it kept going
23:49:40rayman22201but maybe I did it wrong
23:50:22Araqfuture.addCallback(
23:50:22Araq proc() =
23:50:22Araq cb(future)
23:50:22Araq )
23:50:26Araq^ yay...
23:50:56voltistAnybody got any suggestions for what version management 'good practice' is when re-writing a project in a new language?
23:51:34Araqmono-repo and use git commit hashes for external dependencies
23:51:40*luis_ joined #nim
23:51:51rayman22201I was also experimenting with making the callback a ref, so maybe I conflated the two things
23:52:18Araqmaking the callback a ref sounds crazy :P
23:53:06dom96lol
23:53:11dom96I want to avoid breaking changes
23:53:19dom96You can't blame me for that
23:53:27dom96but if there is no other way I won't stand in the way
23:53:33dom96as long as it's behind a switch
23:53:38dom96'night
23:53:43*luis_ quit (Client Quit)
23:53:44Araqnight
23:53:49disruptekgn
23:54:11*luis_ joined #nim
23:54:57rayman22201fn
23:55:04rayman22201gn even
23:55:09*Hideki_ joined #nim
23:55:12Araqpub fn
23:55:28Araqfun in the pub
23:55:42rayman22201I don't understand why this doesn't leak: https://play.nim-lang.org/#ix=27GR
23:55:42Araqoh I finally get the joke
23:55:43disrupteksomeone write this down.
23:55:49rayman22201hahahaha
23:55:59rayman22201👏
23:56:51Araqhow do you know it doesn't leak?
23:58:57Araqdisruptek, 'nimph tag' is awesome
23:59:06Araqused it for Karax and packedjson
23:59:10disruptekglad it worked.
23:59:53disruptekyou do any other stuff with nimph?