<< 01-01-2020 >>

00:24:22Araqhmm should a 'return' inside a finally swallow an exception that wasn't handled in an except section at all?
00:24:27*krux02_ joined #nim
00:24:46disrupteki doubt it.
00:25:05Araqthe tests say "yes"
00:25:14Araqmy new implementation complains
00:25:29disrupteki can't think of a way to justify that behavior.
00:25:47Araqit's a 'return'
00:26:00disruptekthe other question is, does `return foo` set the return value to foo?
00:26:11disruptekor does it just return?
00:26:20Araqhuh?
00:26:24disruptekinside the finally.
00:26:29Araqit returns the value 'foo', what else
00:26:47FromGitter<sheerluck> nothing should swallow an exception inside a finally , bc finally is not for swallowing exceptions, it's for some work just before leaving
00:26:49*krux02_ quit (Remote host closed the connection)
00:26:57disruptekso a proc that raises can, during the raise, also return a value.
00:27:13Araqyep
00:27:28Araqso ... the old implementation is wrong and the new one is correct
00:27:41disruptekimo, yeah. i guess i'm in the minority, though.
00:27:44Araqgood for me because I have no clue how to 'fix' my new implementation
00:28:10Araqformal semantics for exception based control flow
00:28:16Araqwould have been nice
00:28:31*krux02 quit (Ping timeout: 268 seconds)
00:28:32Araqnow we're in undefined behaviour land instead
00:28:52Araqlet's see if I can see what Python does for the example
00:28:54disruptekyay, you get to choose.
00:30:36Araqcool, my new impl is now better than the old one
00:30:45Araqwithout the weird edge case
00:30:59disrupteksounds good to me.
00:31:19disruptekwe still get the {.quirky.} right?
00:31:44Araqhighly likely
00:31:51Araqmaybe under a better name
00:31:57Araqremember 'gorge'
00:32:05disruptekoi
00:32:10Araqand 'slurp'
00:32:23disruptekslurp is exactly what you think it is.
00:32:35Araqit's what happens when language developers are allowed to have fun, let's not repeat this.
00:33:15disrupteknim 2020 -- finally fun-free (and free of raise swallows).
00:33:46Araqlacking swallows surely ain't fun
00:33:57disrupteki guess it depends upon perspective.
00:35:19*belamenso joined #nim
00:37:49AraqPython does something weird instead
00:38:36disrupteki'll say.
00:38:42disruptekstay away from the nope rope.
00:39:20Araqin fact
00:39:25Araqit's super weird
00:39:49disruptekdo you have a link to an existing test failure?
00:40:02disrupteki'm curious how we're relying upon this.
00:40:15Araqhttps://gist.github.com/Araq/801153ec4d78c60c457542213b3b64e8
00:40:22Araqthis is my Python translation
00:40:33Araqyou can try to guess the output
00:40:42Araqbut you will never guess correctly
00:40:47disrupteklol
00:41:12AraqI'm still on 2.7 though
00:41:36Araqyeah well, there is no way I'm gonna replicate this "logic"
00:41:47Araqso ... no bugs left, ready for pushing
00:41:58disruptekwow.
00:41:59FromGitter<sheerluck> Wouldn't it be nice just to prohibit `return` in `finally`
00:42:17Araqmy users don't like prohibition
00:42:49*Araq had some wine
00:43:48FromGitter<sheerluck> I don't like it too but `return` in `finally` does not make sense
00:44:04disruptekno?
00:44:17Araqso disruptek... did your father REALLY live next to Peter Falk?
00:44:23disruptekyou don't /have/ to use it.
00:44:27disruptekyeah, he did.
00:44:33disruptekalso sammy davis, jr.
00:45:25Araqbig house?
00:45:28disruptekand, he dated sigourney weaver in high school. jackson browne was a year or two ahead of him. "ricky" dreyfuss was a year or two behind him.
00:45:48disrupteknot very big by today's standards, no.
00:46:18disrupteki have to say, i wasn't surprised by the python.
00:46:25disruptekwhat does goto return?
00:46:45Araqit says you tried to swallow the OSError
00:47:39FromGitter<sheerluck> `return` in `finally` is same as "ok we have some work we MUST do before returning a value or raising exception ... oh wait no just discard all that and return 4" it does not make sense
00:47:45*belamenso quit (Ping timeout: 265 seconds)
00:47:50disruptekbut oserror isn't swallowed; it's caught in the outer block.
00:48:58disrupteksheerluck: sure it does. you can act on the side-effects of the function.
00:49:07disrupteknothing is forcing you to alter the return value.
00:49:17Araqdisruptek, Python doesn't output 'caught' though
00:49:32disruptekhmm, fair point.
00:50:12disrupteknow i'm curious.
00:52:11disruptekis there a reason we'd want to be able to "rehabilitate" a block in the finally?
00:52:27disrupteki cannot come up with any rationale that a broader except: wouldn't solve.
00:53:15disrupteki guess if you wanted to do some work ahead of the return in the finally, but separate, other work in some except clauses.
00:53:32*Jjp137 quit (Read error: Connection reset by peer)
00:54:18disruptekif we `return foo` is `result == foo` inside the finally?
00:54:32Araqyes
00:54:36disruptekgood.
00:55:30*Jjp137 joined #nim
00:55:33disruptekso return wipes the current exception completely.
01:04:16*Hideki_ joined #nim
01:04:17FromGitter<sheerluck> I guess that's exactly why there is no `finally` in c++ -- no solution for `return`
01:07:19Araqno.
01:07:31AraqC++ lacks it because of RAII
01:08:13Araqaccording to Stroustrup himself
01:09:04Araqputting stuff into separate classes to get a 'finally' is an abstraction inversion but back then nobody told him
01:17:45FromGitter<sheerluck> ok how about this: in Python `with` operator is just nice and convenient form of `finally` but you never can swallow an exception with `with`. And why is that? bc you should NEVER swallow an exception in `finally`. I rest my case
01:18:14AraqI don't disagree.
01:18:21disruptekbut, python actually does swallow in finally.
01:18:21AraqNim v1 does and so does Python.
01:29:05Araqgood night
01:30:51*matic quit (Quit: Leaving)
01:33:16*dwdv quit (Ping timeout: 268 seconds)
01:56:35*Hideki_ quit (Remote host closed the connection)
01:57:36*Hideki_ joined #nim
02:02:11*Hideki_ quit (Ping timeout: 265 seconds)
02:03:35*narimiran quit (Ping timeout: 258 seconds)
02:05:22*Hideki_ joined #nim
02:06:38*Hideki_ quit (Remote host closed the connection)
02:10:27*Hideki_ joined #nim
02:15:05*Hideki_ quit (Ping timeout: 258 seconds)
02:18:27*Tyresc joined #nim
02:29:56*Hideki_ joined #nim
02:37:38*leorize joined #nim
02:43:19*Hideki_ quit (Remote host closed the connection)
02:49:02*Hideki_ joined #nim
02:53:14*Hideki_ quit (Ping timeout: 240 seconds)
02:57:43*leorize quit (Ping timeout: 240 seconds)
02:58:32*leorize joined #nim
03:06:12*muffindrake quit (Ping timeout: 248 seconds)
03:08:19*muffindrake joined #nim
03:11:01muffindrakeI want to refer to an element of an array. From what I'm reading, I can't use ref or ptr for that because it's not dynamically allocated with new/alloc. What options do I have besides storing the index?
03:17:49FromDiscord<treeform> ptr should work?
03:17:55disruptekphone a friend?
03:21:35FromDiscord<treeform> https://play.nim-lang.org/#ix=263Z
03:24:46*Hideki_ joined #nim
03:38:16*Hideki_ quit (Ping timeout: 258 seconds)
03:43:46*Hideki_ joined #nim
03:43:49FromDiscord<Skaruts> wasn't there a way to enforce a range for a function parameter? Some like `proc(a:float[0..1]) =`
03:44:15disruptekuse a range type.
03:48:20FromDiscord<Skaruts> hmm, seems a bit too much for a lerp function, which is what I'm doing
03:48:25FromDiscord<Skaruts> nice to know though, thanks
03:49:58*endragor joined #nim
03:50:21muffindrakeOh, so 'ptr' is the type, but 'addr' is how you obtain a pointer
03:50:29muffindrakeDamn, that's strange
03:52:15muffindrakeI'm clearly too tired to read the manual right now
03:52:25muffindrakeIt's all right there :(
03:55:44*endragor quit (Remote host closed the connection)
03:56:43*Hideki_ quit (Remote host closed the connection)
03:58:09*Hideki_ joined #nim
03:58:50*Hideki_ quit (Remote host closed the connection)
03:59:06*Hideki_ joined #nim
04:04:23*endragor joined #nim
04:09:48*endragor quit (Remote host closed the connection)
04:17:19*Tyresc quit (Quit: WeeChat 2.7-dev)
04:17:33*endragor joined #nim
04:20:25*Hideki_ quit (Remote host closed the connection)
04:21:12*Hideki_ joined #nim
04:25:14*Hideki_ quit (Ping timeout: 240 seconds)
04:33:00*nsf joined #nim
04:41:51*Hideki_ joined #nim
04:42:12*chemist69 quit (Ping timeout: 248 seconds)
04:43:10*Hideki_ quit (Remote host closed the connection)
04:44:22*chemist69 joined #nim
04:44:54*Hideki_ joined #nim
04:45:49*marmotini_ joined #nim
04:47:32*marmotini_ quit (Remote host closed the connection)
04:48:06*marmotini_ joined #nim
04:51:50*Hideki_ quit (Ping timeout: 268 seconds)
04:52:15*marmotini_ quit (Read error: Connection reset by peer)
04:52:32*marmotini_ joined #nim
05:05:44*endragor quit (Remote host closed the connection)
05:07:14*endragor joined #nim
05:22:36*Hideki_ joined #nim
05:34:08*marmotini_ quit (Remote host closed the connection)
05:34:41*marmotini_ joined #nim
05:36:20*Hideki_ quit (Ping timeout: 258 seconds)
05:39:24*marmotini_ quit (Ping timeout: 258 seconds)
05:58:18FromDiscord<Rika> Muffindrake, are you doing ffi?
06:03:47FromDiscord<treeform> @Skaruts I would use an asset for something like that.
06:13:26*marmotini_ joined #nim
06:29:15*endragor quit (Remote host closed the connection)
06:30:12*endragor joined #nim
06:34:12*dddddd quit (Remote host closed the connection)
06:42:42FromGitter<deech> Araq, see Scala's add: https://www.scala-lang.org/api/current/scala/collection/immutable/HashMap.html#updatedV1%3E:V (key:K,value:V1):scala.collection.immutable.HashMap[K,V1]
06:42:52FromGitter<deech> Also Happy NYE!
07:33:06Araqhuh?
07:33:21AraqScala's "add" is not called "add" either.
07:33:47Araqthe point is, "coming from lang X, how likely is that you misuse Nim's table.add?"
07:34:09Araqand *add*ing to a table is not a common name/operation at all
07:35:08leorizeare there any actual use of the one key multiple value feature in Nim's tables?
07:35:37leorizeit sounds cool but I never figured out an use case for it
07:36:14AraqI wrote a compiler that supports "overloading" of proc names
07:36:20Araqhow do you think it works?
07:36:51Araqa hash table with multiple identical keys is really nice for this
07:37:40Araqbut the compiler's symbol tables do not use the stdlib's tables so we could deprecate 'add'
07:38:17Zevvyaaay happy happy new year, *sooo* much fun this fireworks. I got like, maybe, a full two hours of sleep with these happy happy neighbours
07:38:46*Zevv dozes off
07:38:48ZevvBAANG
07:38:50Zevvrepeat
07:39:20Zevvsorry to interrupt your technical musings, please proceed
07:41:36Araqyou're showing your age (and I don't even know your age...)
07:43:12Zevvyeah I came to the same conclusion, getting a sour old puss about these things :)
07:45:01Araqping mratsim
07:45:02FromDiscord<treeform> Araq, how does Nim's current GC walk the stack to find live objects? I was experimenting with "greenlet" style concurrency where you had multiple stacks and switch to them. How can I tell Nim's GC about the new stacks?
07:45:34Araqtreeform: there was an API for it, somewhat hidden
07:45:56Araqbut --gc:arc means the stack is all yours
07:46:09Araqand you can be as dirty as you need to be
07:46:28FromDiscord<treeform> yes I did try --gc:arc and it magically worked...
07:46:36FromDiscord<treeform> but I just assumed it freed nothing πŸ™‚
07:46:41AraqI really want you to use --gc:arc, we're fixing the most pressing bugs
07:47:20Araqand the following tools will use it asap: koch, nimgrep, niminst
07:47:42Araq(I'm still struggling with good milestones...)
07:47:43FromDiscord<treeform> Say I have 100 pointers + sizes of the stacks. How can I tell --gc:arc to scan them?
07:47:58Araqyou don't, it doesn't care
07:48:05FromDiscord<treeform> neat
07:48:47Araqit's really "good old refcounting"
07:49:15Araqwe are trying to optimize the heck out of it, but conceptually there is nothing else to it
07:49:33Zevvhow much of your and clybbers gc struggles of last year did actually survive in the :arc?
07:50:40Araqwhat do you mean?
07:51:18Araqif you mean "--newruntime", all of it survived, it's a variation of the same technology
07:51:51Zevvbad phrasing, sorry. right, If in the end it was the right path to get where you ended up now?
07:52:00Araqdefinitely
07:52:38Zevvthats great. I felt the somewhere halfway you were note quite sure if things would work out, and then finally *pop* something happened and it was just right
07:52:47Araqyup
07:52:57Zevvincremental insights, or whatever thats called in english
07:53:06Araqalso my "quirky exceptions" turned into https://github.com/nim-lang/Nim/pull/12977
07:53:08disbotβž₯ --exception:goto switch for deterministic exception handling
07:54:05Zevvgood start of the new year for you then :)
07:55:45FromDiscord<treeform> Araq, this is what I ended up with my stack switching experiments: https://github.com/treeform/greenlet
07:58:13Zevvsweet!
07:58:36*solitudesf joined #nim
07:58:51AraqI can only recommend the approach, keep reading papers, try crazy things, be radical in the beginning and then later figure out how to map it to what you already have.
07:59:18Araqtreeform: Nim already has thread local storage including the emulation layer
07:59:28Araqno need to reinvent it
08:00:00*gmpreussner quit (Quit: kthxbye)
08:05:00*gmpreussner joined #nim
08:07:46*marmotini_ quit (Remote host closed the connection)
08:25:58FromDiscord<treeform> I am trying to figure out how the stack switching works, how is that related to thread local storage?
08:26:59leorizeAraq: are you gonna make a write up about how this new exeception mechanism work?
08:27:11leorizelike what changed compared to the old way?
08:27:37AraqI wrote an article but it's about a "cost model for Nim ARC"
08:27:43Araqand it's unfinished
08:28:31AraqI should probably focus only on the exception handling
08:31:00leorizenice, looking forward to it
08:35:36*Vladar joined #nim
08:39:18*marmotini_ joined #nim
08:39:51*nsf quit (Quit: WeeChat 2.6)
08:41:21FromGitter<kayabaNerve> I have an interesting problem.
08:41:42FromGitter<kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e0c5b4605298604981e5f22]
08:42:19FromGitter<kayabaNerve> I have this code block I run frequently enough. It's a one shot timer. It's raising: `Too many open files (code: 24) [AssertionError]`
08:43:39FromGitter<kayabaNerve> So it looks like that isn't automatically closed, correct? Is the solution to use closeSocket, unregister, or both
08:51:48FromGitter<kayabaNerve> Adding closeSocket didn't help what so ever...
08:58:54AraqI never know about a socket's ownership model either, sorry
08:59:21Araqthankfully we can leave this mess behind really soon now
08:59:27Araq(TM)
08:59:31Araqwith destructors
09:33:26*Hideki_ joined #nim
09:37:58*Hideki_ quit (Ping timeout: 265 seconds)
09:40:13FromGitter<kayabaNerve> Araq: I don't even know why it's classified as a socket, unless every async object is a socket ala every Unix thing is a file.
09:40:59FromGitter<kayabaNerve> ... may be POSIX. Not actually sure, yet I feel I got my point across :P
09:42:49FromGitter<kayabaNerve> All I know is I have a FD, which I assume means File Descriptor, pointing to a file I can't close (as an int). I either need to use one timeout for every instance (pain + less accuracy) or figure out how to close the files.
09:45:37dom96If you're using addTimer then that's an FD
09:46:12dom96it should be automatically closed though
09:46:21dom96if it's not then that's a bug
09:47:04FromGitter<kayabaNerve> Uhhhh I may actually have the answer now that I think about it. It
09:47:14FromGitter<kayabaNerve> It may be because the timeout is pending.
09:47:44FromGitter<kayabaNerve> Is there a way to get the `fd` whenever I call addTimer? Or do I have to reimplement addTimer?
09:47:53dom96yep. You can also use `sleepAsync` to create a timer without an FD
09:48:01*marmotini_ quit (Remote host closed the connection)
09:48:18*marmotini_ joined #nim
09:49:32FromGitter<kayabaNerve> I don't want to block the function though. Would asyncCheck x() where x is the sleepAsync + shouldWait = false work?
09:49:43FromGitter<kayabaNerve> ... I'll try it.
09:49:54dom96sure
09:50:12dom96no idea what `shouldWait = false` means though
09:51:38FromGitter<kayabaNerve> Oh. It's used in a loop after the fact.
09:52:01FromGitter<kayabaNerve> It says while shouldWait and tries to receive a certain network message. It breaks if it receives it.
09:53:55FromGitter<kayabaNerve> Should probably tighten that time up...
10:04:29*dwdv joined #nim
10:08:17*tane joined #nim
10:10:12FromGitter<kayabaNerve> dom96: What'
10:10:27FromGitter<kayabaNerve> *What's the call to create a timer and get the fd when I create it?
10:11:35dom96Don't know off the top of my head
10:12:09*tmp73 joined #nim
10:12:23*tmp73 quit (Remote host closed the connection)
10:12:29FromGitter<kayabaNerve> Alrighty. I can't find it under asyncdispatch. I'll check the other async libs...
10:13:35dom96Why do you need the FD anyway?
10:15:05FromGitter<kayabaNerve> I don't. addTimer takes a Async Callback type which takes one in.
10:15:37FromGitter<kayabaNerve> I tried the following but I think it's inf looping. It's stuck somewhere yet my debug statements keep printing...
10:15:41FromGitter<kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e0c714deac8d1511e9336cc]
10:16:41dom96sleepAsync doesn't create an FD
10:16:48FromGitter<kayabaNerve> Eh. Could use a cpuTime call and another if check. Just requires moving other parts of my code around. Easier than dealing with this though.
10:16:58FromGitter<kayabaNerve> This is my code after I got rid of the addTime
10:17:18FromGitter<kayabaNerve> Or at least the fragments of it that are relevant
10:18:15dom96Why don't you simply assign the `sleepAsync` future above your while loop?
10:18:44dom96var fut = sleepAsync(2000); while not fut.finished: ...
10:19:08FromGitter<kayabaNerve> That would work. Thanks.
10:19:14*solitudesf quit (Ping timeout: 258 seconds)
10:19:29FromGitter<kayabaNerve> Appreciate the help.
10:21:01FromDiscord<Lantos> Happy new year!,
10:21:01FromDiscord<Lantos>
10:21:01FromDiscord<Lantos> dom whats the best way to extend the window in karax?
10:21:01FromDiscord<Lantos> https://play.nim-lang.org/#ix=264J
10:22:22*marmotini_ quit (Ping timeout: 268 seconds)
10:23:34FromGitter<alehander92> i'd say
10:24:36*marmotini_ joined #nim
10:29:58*marmotini_ quit (Ping timeout: 258 seconds)
10:31:11*Hideki_ joined #nim
10:31:47*narimiran joined #nim
10:32:54*marmotini_ joined #nim
10:34:26FromDiscord<Lantos> https://play.nim-lang.org/#ix=264O
10:38:34FromGitter<alehander92> mywindow = castMyWindow (window)
10:38:49FromGitter<alehander92> yeah or this
10:52:42Zevvwow. the fireworks stopped. that was 18 hours straight.
10:54:57FromDiscord<mratsim> > <Araq> I can only recommend the approach, keep reading papers, try crazy things, be radical in the beginning and then later figure out how to map it to what you already have.
10:54:57FromDiscord<mratsim> --> Story of my last 6 months
11:02:21*belamenso joined #nim
11:10:18Zevvand the result is worth it, right?
11:18:23FromDiscord<mratsim> Not sure :P, for 2019 I planned to build a linear algebra compiler, and I didn't work on it at all :p
11:21:49*total_noob joined #nim
11:25:21Zevvyeah but when you now make it in 2020 you can make it hugely parallel in a breeze :)
11:25:34Zevvyou just have been working on the proper tooling!
11:33:12*nsf joined #nim
11:33:27total_noobHello. I hope I'm not disturbing anyone from barrel fever or anything.
11:33:34FromDiscord<mratsim> maybe, I hope I reached the end of the tunnel, because it all started with trying to make arraymancer easier to extend
11:33:50total_noobHere's a rough example of what I'm trying to achieve: https://play.nim-lang.org/#ix=2652
11:33:59*Hideki_ quit (Ping timeout: 258 seconds)
11:34:08total_noobPlease, take a look at the case-statement. It looks like a duct tape 'cause of if-statement within the case.
11:34:29*Vladar quit (Quit: Leaving)
11:34:46total_noobThere what I thought would work but it doesn't: https://play.nim-lang.org/#ix=2653. I must be doing something wrong, right?
11:35:14narimirantotal_noob: why not just `if`, `elif`, `else` and call it a day?
11:36:01narimiranif numInt < 1, elif numInt > 10, else got it
11:37:15FromDiscord<mratsim> case can only have range or fixed values, no comparison
11:37:21total_noobIt'd love it to be a case-statement 'cause it'll be much easier for my project. Remember, it's a rough example
11:37:54total_noobmratsim, ok, thanks
11:40:18total_noobThough it's kinda handy that an if-statement is allowed with a case-statement
11:41:03total_noobwithin*
11:44:20*total_noob left #nim (#nim)
11:47:42FromDiscord<Rika> Then it wouldn't be a case statement anymore
11:50:45FromDiscord<Rika> Perhaps I'm misunderstanding what you want
12:14:36*Hideki_ joined #nim
12:24:12*marmotini_ quit (Remote host closed the connection)
12:38:54*Hideki_ quit (Remote host closed the connection)
12:39:42*narimiran quit (Ping timeout: 265 seconds)
12:40:09*Hideki_ joined #nim
12:42:54lqdev[m]total_noob: by the way, parseInt is a thing
12:44:49*Hideki_ quit (Ping timeout: 268 seconds)
12:56:37*belamenso quit (Ping timeout: 265 seconds)
13:03:14*belamenso joined #nim
13:12:23*nsf quit (Quit: WeeChat 2.6)
13:15:09*Hideki_ joined #nim
13:28:31*marmotini_ joined #nim
13:29:02FromGitter<bung87> does the nim db lib intend to using sql string concate ,why not using bind param?
13:31:09*solitudesf joined #nim
13:33:14*Hideki_ quit (Ping timeout: 240 seconds)
13:46:53*dddddd joined #nim
13:49:49*dddddd quit (Read error: Connection reset by peer)
13:50:18*dddddd joined #nim
13:51:42FromDiscord<Lantos> ! https://play.nim-lang.org/#ix=265
13:51:42FromDiscord<Lantos> unexpected identifier.
14:04:16FromDiscord<Lantos> Doesn't seem to like when you specify a type with module.type
14:27:00*belamenso quit (Ping timeout: 265 seconds)
14:32:21*marmotini_ quit (Remote host closed the connection)
14:33:55*marmotini_ joined #nim
14:42:25FromGitter<alehander92> oy this is java?
14:45:25*belamenso joined #nim
14:49:47*Trustable joined #nim
15:08:29*ng0_ joined #nim
15:11:32*Hideki_ joined #nim
15:12:12*ng0 quit (Ping timeout: 268 seconds)
15:12:38lqdev[m]looks like it. though, there are some things that tell me it might be something else
15:12:47lqdev[m]eg. `Out` and not `System.out`
15:13:01*ng0_ is now known as ng0
15:13:26lqdev[m]either way I don't think this is the right code ;)
15:18:13*nsf joined #nim
15:24:53FromDiscord<Lantos> lol wtf?
15:24:58FromDiscord<Lantos> I didnt mean to share that
15:25:29FromDiscord<Lantos> https://play.nim-lang.org/#ix=265H
15:25:34FromDiscord<Lantos> ahh missed the H
15:35:54*ng0 quit (Quit: leaving)
15:38:13*nsf quit (Quit: WeeChat 2.6)
15:40:53*Hideki_ quit (Remote host closed the connection)
15:45:14FromDiscord<mratsim> That's the typical errors where I'm happy to have a compiler. These kind of errors in Python where you computations fails a couple minute after starting due to "undeclared identifier" would be nerve cracking
15:45:32*Hideki_ joined #nim
15:50:03*Hideki_ quit (Ping timeout: 260 seconds)
16:05:50*muffindrake quit (Quit: muffindrake)
16:30:09disruptekwe really gotta do something about this .so-in-nimcache issue. i cannot develop two packages with different libgit2 versions simultaneously.
16:30:55disruptekshashlick: ^
16:32:41disruptekto restate that so it sounds less whiney, nimph doesn't /run/ because i'm testing a 0.28.4 version of libgit2, which is the latest stable release (but not the one nimph is linked against).
16:33:34*muffindrake joined #nim
16:39:35*ritchie_ joined #nim
16:39:51*fanta1 joined #nim
16:46:22*marmotini_ quit (Remote host closed the connection)
16:46:57*marmotini_ joined #nim
16:49:57shashlickIsn't that because nimterop doesn't embed version in the location?
16:50:32disruptekthat would be one solution, i think.
16:50:46*Hideki_ joined #nim
16:51:05shashlickLocation needs to move sure, and it's a bit hard since I need to use make install with a custom prefix, and hopefully all packages support that
16:51:09disruptekwhat is your current thinking on the "best" solution?
16:51:18*marmotini_ quit (Ping timeout: 260 seconds)
16:51:36shashlickThat combined with the version in the path
16:52:00disrupteki think we should switch to an XDG "local lib" directory instead of .cache.
16:52:08shashlickIn addition, -d:xxxStd also needs to consider version methods
16:52:18shashlickSomehow, not methods
16:52:18disrupteki expect most users think .cache is ephemeral.
16:52:29disruptekwhat is -d:Std?
16:52:42shashlickUsing the library from standard location
16:52:50disruptekoh, ie. a system lib?
16:52:54shashlickYes
16:53:12shashlickSo you could end to linking to a version you don't want
16:53:24disruptekwhy is it our problem to worry about that?
16:53:50shashlickIf a user has some old libgit2 installed, nimgit2 will use it
16:53:51disruptekseems like it might be something we expressly do not want to second-guess.
16:54:03disrupteknimgit2 /should/ use it if the user asked for it.
16:54:15shashlickAnd if you wanted 0.28.4, it won't even check
16:54:30shashlickAnd then your use will run into random issues
16:54:36disruptekmaybe it can fatal if a version define was requested along with Std.
16:55:12shashlickYou'd want to specify right
16:55:27disruptekthe issues will only be as random as the programmer's lack of foresight, but yes.
16:55:27shashlickSame package dependency on a specific version
16:55:40shashlickApplies to C libs too
16:56:01shashlickRight now you can specify Std and Git/Dl together
16:56:09disruptekwut
16:56:18shashlickNimterop will first search Std and then fall back to building
16:56:41shashlickBut Std doesn't do anything with the version
16:56:41disruptekhow does it decide success in the first case?
16:56:55shashlickIf it finds the lib and include
16:56:56*Vladar joined #nim
16:57:05disruptekokay, good.
16:57:29disruptekwhat about XDG "local lib"?
16:57:32disrupteki want it.
16:57:40shashlickYa that's already an issue
16:57:47disruptekcan i put it in?
16:58:47shashlickhttps://github.com/nimterop/nimterop/issues/154
16:58:48disbotβž₯ getHeader should install binaries outside nimcache which can go away
16:58:53shashlickI like PRs
16:59:03disruptekokay, cool.
16:59:52shashlickhttps://github.com/nimterop/nimterop/blob/master/nimterop/build.nim
17:00:18disrupteki love me some trivial code.
17:00:42disruptekstand on the shoulders of giants, i will.
17:08:05FromGitter<Willyboar> dis welcome back to the future
17:08:22FromGitter<Willyboar> do you decide about your project?
17:09:31disruptekgonna polish gittyup and nimph until the future reveals itself.
17:10:22*Hideki_ quit (Ping timeout: 265 seconds)
17:10:33disruptekit's about time i made something pretty and not just functional.
17:11:47FromGitter<Willyboar> yeap you need to add some marketing
17:11:49FromGitter<Willyboar> :)
17:13:12*muffindrake quit (Ping timeout: 260 seconds)
17:13:25Zevvand more dingbats
17:13:37*muffindrake joined #nim
17:14:03Zevvor whatever you kids call those things these days
17:14:18*gangstacat quit (Quit: Ĝis!)
17:15:06FromGitter<Willyboar> I think something it has the same name with an old programming language
17:15:11*marmotini_ joined #nim
17:19:28*gangstacat joined #nim
17:29:05*narimiran joined #nim
17:38:17disruptekcowbell is the name of an old programming language?
17:38:27disruptekclearly, we need MOAR COWBELL
17:43:21FromGitter<Willyboar> nope
17:45:24*rifkik_ joined #nim
17:46:47*rifkik_ quit (Client Quit)
17:48:03*ng0 joined #nim
17:48:03*ng0 quit (Changing host)
17:48:03*ng0 joined #nim
18:03:11*Trustable quit (Remote host closed the connection)
18:03:44*MarquisdeFalbala joined #nim
18:20:57*Vladar quit (Quit: Leaving)
18:32:58ZevvMOAR COBOL?
18:34:03*ng0 quit (Quit: leaving)
18:35:48disrupteki was in a cobol class once (don't ask) and the instructor always pronounced it, "cobalt". drove me nuts.
18:39:29FromDiscord<Clyybber> blue oyster code
18:39:53*clyybber joined #nim
18:46:33*clyybber quit (Quit: WeeChat 2.7)
18:57:14FromGitter<deech> Dumb q, how do I make `HashSet[MyObject]`? It's complaining that `hash` isn't defined on my object.
18:58:18disruptekmake a proc `hash` that takes your obj and returns a Hash.
18:58:19leorizeyou need to define a hashing function for your object
18:59:05FromGitter<deech> Why can't it be derived? It's just a bag of strings and an enum kind variant.
18:59:41lqdev[m]you can use a tuple and it will work, too
19:00:38FromGitter<deech> Yeah I was just looking at that. https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/hashes.nim#L380 Is there a tuple -> object static conversion macro?
19:02:06leorizeit should be possible to make one for objects IMO
19:02:59leorizefor now you should provide your own tbh
19:03:26FromGitter<deech> Ok, just wanted to make sure I wasn't missing something.
19:03:27*MarquisdeFalbala quit (Ping timeout: 260 seconds)
19:08:51disrupteki dunno, i think maybe it should remain explicit. there are a lot of subtleties to the way hashes are used and i think it's better to make the user document the semantics of their objects.
19:10:17leorizetrue, objects can be much more complicated than a tuple
19:10:36*fanta1 quit (Quit: fanta1)
19:10:38FromGitter<deech> Are they more complicated because they allow variants?
19:12:09leorizeyep, and they also have hidden members, accessors, etc.
19:12:24lqdev[m]this, and inheritance
19:12:24*MarquisdeFalbala joined #nim
19:13:59FromGitter<deech> Yeah you're right. Some of these are statically introspectable though so "simple" variants (eg. `option`) should be able to auto derive a `hash`?
19:17:34leorizeit works until you realize that the members are hidden :)
19:17:56FromGitter<deech> argh
19:19:41FromGitter<deech> Note to self: use tuples when possible
19:22:03leorizetbh I don't recommend using tuples unless you have to
19:24:11FromGitter<deech> Then what's the best way to have a set of, eg. an int + 3 strings thing.
19:26:53*marmotini_ quit (Remote host closed the connection)
19:28:32disruptekcreate a hash proc.
19:30:23FromGitter<deech> I'm already doing that now, was just unsure what ways Nim provides for statically structuring data other than object and tuple.
19:30:37*endragor quit (Remote host closed the connection)
19:32:32*fanta1 joined #nim
19:33:07*NimBot joined #nim
19:38:02*marmotini_ joined #nim
19:42:26*Chioque joined #nim
19:42:44*marmotini_ quit (Ping timeout: 258 seconds)
19:46:15*Chioque quit (Quit: WeeChat 2.7)
19:50:30*fanta1 quit (Quit: fanta1)
20:23:24FromGitter<Willyboar> When do you think we will see a NimCon?
20:23:32*letto quit (Quit: Konversation terminated!)
20:25:17*letto joined #nim
20:25:54*Trustable joined #nim
20:31:48FromDiscord<treeform> maybe 2-3 years?
20:32:54FromGitter<Willyboar> It depends
20:34:10FromGitter<Willyboar> Where do you think would be the best place for the first one?
20:34:34FromGitter<Willyboar> I think most of the community lives in europe
20:34:56FromGitter<deech> Talk about it at Strange Loop. :)
20:37:38FromGitter<Willyboar> no i talk about a clean plain nimcon :)
20:38:05FromGitter<Willyboar> Just Nimysts :P
20:45:56*belamenso quit (Ping timeout: 265 seconds)
20:46:00narimiran> When do you think we will see a NimCon?
20:46:05narimiranin 2020 ;)
20:46:42FromGitter<Willyboar> Do you want to announce something?
20:46:52narimirannah :)
20:47:17narimiranit is just my optimistic opinion
20:47:59disrupteknim needs more sponsorship dollars before a con is realistic.
20:51:36FromGitter<deech> Emacs did a purely virtual con this year
20:56:48*endragor joined #nim
20:59:53FromGitter<Willyboar> money rulez everything :(
21:02:08*endragor quit (Ping timeout: 260 seconds)
21:02:25FromGitter<Willyboar> narimiran i think the most optimistic is 2021
21:02:34narimiranok
21:12:57*narimiran quit (Ping timeout: 268 seconds)
21:15:30FromGitter<alehander92> fosdem segment is close to a mini conf
21:20:57FromGitter<Willyboar> I will watch fosdem on youtube
21:21:32*ng0 joined #nim
21:22:21disrupteksolitudesf: i was able to recreate that error message you go inside gittyup test suite on windows; it appeared when i tried to get the last git error (and was expecting none). i guess merely initializing git causes the error to be registered, and somewhere, nimph is outputting it despite not getting an error code from a call.
21:22:30disrupteks/you go/you got/
21:25:17*dwdv quit (Ping timeout: 268 seconds)
21:25:37disruptekima do fosdem this year.
21:29:28FromGitter<Willyboar> i am interest more for pmunch's presentation
21:36:02*dwdv joined #nim
21:43:09FromDiscord<mratsim> wow this looks awesome @treeform @disruptek: https://github.com/treeform/greenlet
21:43:55disruptekyeah, i could see slowly lifting it into pure nim.
21:48:03FromDiscord<treeform> disruptek, @mratsim, yeah that was my goal, take the C library, understand it more... port it to 100% nim + assembly.
21:48:20FromDiscord<mratsim> I'm posting posting my first issue πŸ˜‰
21:48:26FromDiscord<mratsim> maybe you won't need assembly
21:48:32disruptekhah
21:49:11FromDiscord<treeform> I was impressed by the greenlet switching speeds:
21:49:12FromDiscord<treeform>
21:49:12FromDiscord<treeform> https://cdn.discordapp.com/attachments/371759389889003532/662049713838751745/unknown.png
21:49:45FromDiscord<treeform> If you go with setcontext or setjump it way slower.
21:50:08disrupteki used them extensively in python, but i expect they will be much more stable in nim/c.
21:51:00FromDiscord<treeform> I liked gevent and the greenlets its build on in python...
21:51:19FromDiscord<treeform> Why the python community chose asyncio as the standard is beyond me.
21:51:42disrupteki know. i bailed on python rather than switch to asyncio.
21:51:46FromDiscord<mratsim> here you go: https://github.com/treeform/greenlet/issues/1
21:51:49disbotβž₯ Benching against Vyokov coroutines ; snippet at 12https://play.nim-lang.org/#ix=268U
21:51:49FromDiscord<treeform> same
21:52:28disruptekbut i also removed gevent in favor of threads; they become much easier to reason about and fit my cloud architecture better.
21:53:30FromDiscord<treeform> yeah, maybe threads are just good enough ... and we are chasing some marginal improvement
21:54:09FromDiscord<mratsim> I don't agree
21:54:22disruptekme neither. i think coro has its place.
21:54:42FromDiscord<mratsim> I'm working a lot with threads :D, and I'm considering having tasks as augmented coroutines
21:55:00FromDiscord<mratsim> I have a secret branch of Weave with coroutines in mind
21:55:03disrupteki see us doing scheduling across cloud-based threads in the future.
21:55:42FromDiscord<treeform> For work I am thinking of moving a way from async/await system I have not to just processes.
21:57:59FromDiscord<mratsim> I'm always repeating this but this is a very impressive work-stealing scheduler with lower overhead than weave: https://github.com/chaoran/fibril/tree/master/src and it's coroutine based, it's also very compact: https://github.com/chaoran/fibril/blob/master/src/fibrile.h#L14-L24 most files are like 80 lines of code.
21:58:06FromDiscord<treeform> basically start a full process for each task
21:58:18FromDiscord<treeform> so that it can return the memory back to the OS when it quits
21:58:20disruptekisn't that the guy that did highland?
21:58:29disruptekthat guy is a genius.
21:58:31FromDiscord<treeform> my tasks run for about 10min using 10GB of mem
21:58:45FromDiscord<mratsim> chaoran is the author of one of the fastest wait-free MPMC concurrent queue
22:01:53FromDiscord<treeform> On thing that gives cgreenlet speed is the fact that it does not save FPU registers ...
22:02:05FromDiscord<treeform> which it should
22:02:13FromDiscord<treeform> its easy being fast without being accurate πŸ™‚
22:04:07FromDiscord<treeform> I am running into this problem again: https://forum.nim-lang.org/t/4932
22:04:47FromDiscord<treeform> I was working on this yesterday: https://github.com/treeform/asyncssh
22:08:25*Trustable quit (Quit: Leaving)
22:10:25*Trustable joined #nim
22:16:18*Trustable quit (Quit: Leaving)
22:16:40*zyklon quit (Remote host closed the connection)
22:28:15disruptekwhat did you do to solve your memory issue last time?
22:28:38disrupteki agree with dom; forking would be pretty clean.
22:28:53disruptekie. hard to break
22:35:20FromDiscord<treeform> I gave servers more ram so that it would happen less often
22:35:34FromDiscord<treeform> I also restart them more often
22:35:49disruptekdocker-style sysadmin.
22:35:50FromDiscord<mratsim> don't try saving the FPU registers
22:35:56FromDiscord<treeform> But the problem is back
22:35:56FromDiscord<mratsim> nor the SSE/AVX registers
22:36:24FromDiscord<mratsim> no compiler generates FPU code anymore, and SSE/AVX/AVX512 registers are too big
22:36:36*uvegbot joined #nim
22:36:42disruptekif performance doesn't matter, fork is a cheap solution, i think.
22:36:46FromDiscord<mratsim> just mentions not to yield in the middle of compute
22:39:40FromDiscord<treeform> I think setjump saves the extra registers, so it cat beat the custom setjump like code
22:39:57FromDiscord<treeform> I think setjump saves the extra registers, so it can't beat the custom setjump like code
22:54:11*ritchie__ joined #nim
22:57:03*ritchie_ quit (Ping timeout: 260 seconds)
23:00:15*solitudesf quit (Ping timeout: 268 seconds)
23:05:01FromDiscord<mratsim> setjmp saves regular + FPU but doesn't save SSE/AVX
23:05:17FromDiscord<mratsim> the main issue of setjmp I think is syscall
23:05:52FromDiscord<mratsim> syscall takes 150~200 cycles while an addition takes 1 cycles to give you an idea
23:06:37FromDiscord<treeform> yeah I don't know much about this. cgreenlet was my first introduction
23:06:53FromDiscord<treeform> I went down this list: https://github.com/baruch/libwire/wiki/Other-coroutine-libraries
23:06:57FromDiscord<mratsim> I don't know either about setjmp/longjmp
23:06:58FromDiscord<treeform> and tried to get them to work
23:07:09FromDiscord<treeform> some of the worked ok but had bad APIs
23:07:27FromDiscord<treeform> I liked the greenlet API and it worked and was easy to integrate
23:08:30FromDiscord<mratsim> it's missing ARM at least though :/
23:08:51disruptekmratsim: what about your tiny fibre impl you found?
23:08:54FromDiscord<treeform> The only arm hardware I coded on was iOS and Android devices
23:09:19FromDiscord<treeform> don't need super threading there
23:10:44FromDiscord<treeform> I also don't think ARM asm would be hard to add
23:10:45FromDiscord<treeform> https://github.com/treeform/greenlet/blob/master/src/cgreenlet/src/greenlet-asm.S
23:10:50FromDiscord<treeform> its only like 3 asm calls
23:11:09FromDiscord<treeform> _greenlet_savecontext, _greenlet_switchcontext, _greenlet_newstack
23:11:17FromDiscord<treeform> and all the do is push registers for most parts
23:11:38disrupteki'll setup the travis config shashlick made if you wanna write a test or two.
23:11:53FromDiscord<mratsim> yes sure, you can take the code from libmill or boost/context or any of the coro lib πŸ˜‰
23:12:21FromDiscord<treeform> I tried several coro libs and they appear not to work/compile
23:12:49disruptekright, but with tests we can fix them. all we need is a starting point for the asm.
23:14:11FromDiscord<mratsim> For CI, AFAIK I have very thorough scripts here: https://github.com/mratsim/weave/blob/master/.travis.yml and here: https://github.com/mratsim/weave/blob/master/azure-pipelines.yml
23:14:12FromDiscord<mratsim>
23:14:12FromDiscord<mratsim> Travis with Linux, Mac, stable/devel, x86/ARM and Azure pipelines with Linux, mac, WIndows, C/C++.
23:14:12FromDiscord<mratsim>
23:14:12FromDiscord<mratsim> All with caching including for devel
23:14:40FromDiscord<mratsim> 32-bit and 64-bit Linux/Windows as well
23:14:48disrupteknice.
23:18:43*ritchie_ joined #nim
23:19:09*ritchie_ quit (Client Quit)
23:20:09FromDiscord<treeform> nice.
23:21:13*ritchie__ quit (Ping timeout: 268 seconds)