00:24:22 | Araq | hmm 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:46 | disruptek | i doubt it. |
00:25:05 | Araq | the tests say "yes" |
00:25:14 | Araq | my new implementation complains |
00:25:29 | disruptek | i can't think of a way to justify that behavior. |
00:25:47 | Araq | it's a 'return' |
00:26:00 | disruptek | the other question is, does `return foo` set the return value to foo? |
00:26:11 | disruptek | or does it just return? |
00:26:20 | Araq | huh? |
00:26:24 | disruptek | inside the finally. |
00:26:29 | Araq | it returns the value 'foo', what else |
00:26:47 | FromGitter | <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:57 | disruptek | so a proc that raises can, during the raise, also return a value. |
00:27:13 | Araq | yep |
00:27:28 | Araq | so ... the old implementation is wrong and the new one is correct |
00:27:41 | disruptek | imo, yeah. i guess i'm in the minority, though. |
00:27:44 | Araq | good for me because I have no clue how to 'fix' my new implementation |
00:28:10 | Araq | formal semantics for exception based control flow |
00:28:16 | Araq | would have been nice |
00:28:31 | * | krux02 quit (Ping timeout: 268 seconds) |
00:28:32 | Araq | now we're in undefined behaviour land instead |
00:28:52 | Araq | let's see if I can see what Python does for the example |
00:28:54 | disruptek | yay, you get to choose. |
00:30:36 | Araq | cool, my new impl is now better than the old one |
00:30:45 | Araq | without the weird edge case |
00:30:59 | disruptek | sounds good to me. |
00:31:19 | disruptek | we still get the {.quirky.} right? |
00:31:44 | Araq | highly likely |
00:31:51 | Araq | maybe under a better name |
00:31:57 | Araq | remember 'gorge' |
00:32:05 | disruptek | oi |
00:32:10 | Araq | and 'slurp' |
00:32:23 | disruptek | slurp is exactly what you think it is. |
00:32:35 | Araq | it's what happens when language developers are allowed to have fun, let's not repeat this. |
00:33:15 | disruptek | nim 2020 -- finally fun-free (and free of raise swallows). |
00:33:46 | Araq | lacking swallows surely ain't fun |
00:33:57 | disruptek | i guess it depends upon perspective. |
00:35:19 | * | belamenso joined #nim |
00:37:49 | Araq | Python does something weird instead |
00:38:36 | disruptek | i'll say. |
00:38:42 | disruptek | stay away from the nope rope. |
00:39:20 | Araq | in fact |
00:39:25 | Araq | it's super weird |
00:39:49 | disruptek | do you have a link to an existing test failure? |
00:40:02 | disruptek | i'm curious how we're relying upon this. |
00:40:15 | Araq | https://gist.github.com/Araq/801153ec4d78c60c457542213b3b64e8 |
00:40:22 | Araq | this is my Python translation |
00:40:33 | Araq | you can try to guess the output |
00:40:42 | Araq | but you will never guess correctly |
00:40:47 | disruptek | lol |
00:41:12 | Araq | I'm still on 2.7 though |
00:41:36 | Araq | yeah well, there is no way I'm gonna replicate this "logic" |
00:41:47 | Araq | so ... no bugs left, ready for pushing |
00:41:58 | disruptek | wow. |
00:41:59 | FromGitter | <sheerluck> Wouldn't it be nice just to prohibit `return` in `finally` |
00:42:17 | Araq | my users don't like prohibition |
00:42:49 | * | Araq had some wine |
00:43:48 | FromGitter | <sheerluck> I don't like it too but `return` in `finally` does not make sense |
00:44:04 | disruptek | no? |
00:44:17 | Araq | so disruptek... did your father REALLY live next to Peter Falk? |
00:44:23 | disruptek | you don't /have/ to use it. |
00:44:27 | disruptek | yeah, he did. |
00:44:33 | disruptek | also sammy davis, jr. |
00:45:25 | Araq | big house? |
00:45:28 | disruptek | and, 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:48 | disruptek | not very big by today's standards, no. |
00:46:18 | disruptek | i have to say, i wasn't surprised by the python. |
00:46:25 | disruptek | what does goto return? |
00:46:45 | Araq | it says you tried to swallow the OSError |
00:47:39 | FromGitter | <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:50 | disruptek | but oserror isn't swallowed; it's caught in the outer block. |
00:48:58 | disruptek | sheerluck: sure it does. you can act on the side-effects of the function. |
00:49:07 | disruptek | nothing is forcing you to alter the return value. |
00:49:17 | Araq | disruptek, Python doesn't output 'caught' though |
00:49:32 | disruptek | hmm, fair point. |
00:50:12 | disruptek | now i'm curious. |
00:52:11 | disruptek | is there a reason we'd want to be able to "rehabilitate" a block in the finally? |
00:52:27 | disruptek | i cannot come up with any rationale that a broader except: wouldn't solve. |
00:53:15 | disruptek | i 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:18 | disruptek | if we `return foo` is `result == foo` inside the finally? |
00:54:32 | Araq | yes |
00:54:36 | disruptek | good. |
00:55:30 | * | Jjp137 joined #nim |
00:55:33 | disruptek | so return wipes the current exception completely. |
01:04:16 | * | Hideki_ joined #nim |
01:04:17 | FromGitter | <sheerluck> I guess that's exactly why there is no `finally` in c++ -- no solution for `return` |
01:07:19 | Araq | no. |
01:07:31 | Araq | C++ lacks it because of RAII |
01:08:13 | Araq | according to Stroustrup himself |
01:09:04 | Araq | putting stuff into separate classes to get a 'finally' is an abstraction inversion but back then nobody told him |
01:17:45 | FromGitter | <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:14 | Araq | I don't disagree. |
01:18:21 | disruptek | but, python actually does swallow in finally. |
01:18:21 | Araq | Nim v1 does and so does Python. |
01:29:05 | Araq | good 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:01 | muffindrake | I 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:49 | FromDiscord | <treeform> ptr should work? |
03:17:55 | disruptek | phone a friend? |
03:21:35 | FromDiscord | <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:49 | FromDiscord | <Skaruts> wasn't there a way to enforce a range for a function parameter? Some like `proc(a:float[0..1]) =` |
03:44:15 | disruptek | use a range type. |
03:48:20 | FromDiscord | <Skaruts> hmm, seems a bit too much for a lerp function, which is what I'm doing |
03:48:25 | FromDiscord | <Skaruts> nice to know though, thanks |
03:49:58 | * | endragor joined #nim |
03:50:21 | muffindrake | Oh, so 'ptr' is the type, but 'addr' is how you obtain a pointer |
03:50:29 | muffindrake | Damn, that's strange |
03:52:15 | muffindrake | I'm clearly too tired to read the manual right now |
03:52:25 | muffindrake | It'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:18 | FromDiscord | <Rika> Muffindrake, are you doing ffi? |
06:03:47 | FromDiscord | <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:42 | FromGitter | <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:52 | FromGitter | <deech> Also Happy NYE! |
07:33:06 | Araq | huh? |
07:33:21 | Araq | Scala's "add" is not called "add" either. |
07:33:47 | Araq | the point is, "coming from lang X, how likely is that you misuse Nim's table.add?" |
07:34:09 | Araq | and *add*ing to a table is not a common name/operation at all |
07:35:08 | leorize | are there any actual use of the one key multiple value feature in Nim's tables? |
07:35:37 | leorize | it sounds cool but I never figured out an use case for it |
07:36:14 | Araq | I wrote a compiler that supports "overloading" of proc names |
07:36:20 | Araq | how do you think it works? |
07:36:51 | Araq | a hash table with multiple identical keys is really nice for this |
07:37:40 | Araq | but the compiler's symbol tables do not use the stdlib's tables so we could deprecate 'add' |
07:38:17 | Zevv | yaaay 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:48 | Zevv | BAANG |
07:38:50 | Zevv | repeat |
07:39:20 | Zevv | sorry to interrupt your technical musings, please proceed |
07:41:36 | Araq | you're showing your age (and I don't even know your age...) |
07:43:12 | Zevv | yeah I came to the same conclusion, getting a sour old puss about these things :) |
07:45:01 | Araq | ping mratsim |
07:45:02 | FromDiscord | <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:34 | Araq | treeform: there was an API for it, somewhat hidden |
07:45:56 | Araq | but --gc:arc means the stack is all yours |
07:46:09 | Araq | and you can be as dirty as you need to be |
07:46:28 | FromDiscord | <treeform> yes I did try --gc:arc and it magically worked... |
07:46:36 | FromDiscord | <treeform> but I just assumed it freed nothing π |
07:46:41 | Araq | I really want you to use --gc:arc, we're fixing the most pressing bugs |
07:47:20 | Araq | and the following tools will use it asap: koch, nimgrep, niminst |
07:47:42 | Araq | (I'm still struggling with good milestones...) |
07:47:43 | FromDiscord | <treeform> Say I have 100 pointers + sizes of the stacks. How can I tell --gc:arc to scan them? |
07:47:58 | Araq | you don't, it doesn't care |
07:48:05 | FromDiscord | <treeform> neat |
07:48:47 | Araq | it's really "good old refcounting" |
07:49:15 | Araq | we are trying to optimize the heck out of it, but conceptually there is nothing else to it |
07:49:33 | Zevv | how much of your and clybbers gc struggles of last year did actually survive in the :arc? |
07:50:40 | Araq | what do you mean? |
07:51:18 | Araq | if you mean "--newruntime", all of it survived, it's a variation of the same technology |
07:51:51 | Zevv | bad phrasing, sorry. right, If in the end it was the right path to get where you ended up now? |
07:52:00 | Araq | definitely |
07:52:38 | Zevv | thats 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:47 | Araq | yup |
07:52:57 | Zevv | incremental insights, or whatever thats called in english |
07:53:06 | Araq | also my "quirky exceptions" turned into https://github.com/nim-lang/Nim/pull/12977 |
07:53:08 | disbot | β₯ --exception:goto switch for deterministic exception handling |
07:54:05 | Zevv | good start of the new year for you then :) |
07:55:45 | FromDiscord | <treeform> Araq, this is what I ended up with my stack switching experiments: https://github.com/treeform/greenlet |
07:58:13 | Zevv | sweet! |
07:58:36 | * | solitudesf joined #nim |
07:58:51 | 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. |
07:59:18 | Araq | treeform: Nim already has thread local storage including the emulation layer |
07:59:28 | Araq | no 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:58 | FromDiscord | <treeform> I am trying to figure out how the stack switching works, how is that related to thread local storage? |
08:26:59 | leorize | Araq: are you gonna make a write up about how this new exeception mechanism work? |
08:27:11 | leorize | like what changed compared to the old way? |
08:27:37 | Araq | I wrote an article but it's about a "cost model for Nim ARC" |
08:27:43 | Araq | and it's unfinished |
08:28:31 | Araq | I should probably focus only on the exception handling |
08:31:00 | leorize | nice, 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:21 | FromGitter | <kayabaNerve> I have an interesting problem. |
08:41:42 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e0c5b4605298604981e5f22] |
08:42:19 | FromGitter | <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:39 | FromGitter | <kayabaNerve> So it looks like that isn't automatically closed, correct? Is the solution to use closeSocket, unregister, or both |
08:51:48 | FromGitter | <kayabaNerve> Adding closeSocket didn't help what so ever... |
08:58:54 | Araq | I never know about a socket's ownership model either, sorry |
08:59:21 | Araq | thankfully we can leave this mess behind really soon now |
08:59:27 | Araq | (TM) |
08:59:31 | Araq | with destructors |
09:33:26 | * | Hideki_ joined #nim |
09:37:58 | * | Hideki_ quit (Ping timeout: 265 seconds) |
09:40:13 | FromGitter | <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:59 | FromGitter | <kayabaNerve> ... may be POSIX. Not actually sure, yet I feel I got my point across :P |
09:42:49 | FromGitter | <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:37 | dom96 | If you're using addTimer then that's an FD |
09:46:12 | dom96 | it should be automatically closed though |
09:46:21 | dom96 | if it's not then that's a bug |
09:47:04 | FromGitter | <kayabaNerve> Uhhhh I may actually have the answer now that I think about it. It |
09:47:14 | FromGitter | <kayabaNerve> It may be because the timeout is pending. |
09:47:44 | FromGitter | <kayabaNerve> Is there a way to get the `fd` whenever I call addTimer? Or do I have to reimplement addTimer? |
09:47:53 | dom96 | yep. 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:32 | FromGitter | <kayabaNerve> I don't want to block the function though. Would asyncCheck x() where x is the sleepAsync + shouldWait = false work? |
09:49:43 | FromGitter | <kayabaNerve> ... I'll try it. |
09:49:54 | dom96 | sure |
09:50:12 | dom96 | no idea what `shouldWait = false` means though |
09:51:38 | FromGitter | <kayabaNerve> Oh. It's used in a loop after the fact. |
09:52:01 | FromGitter | <kayabaNerve> It says while shouldWait and tries to receive a certain network message. It breaks if it receives it. |
09:53:55 | FromGitter | <kayabaNerve> Should probably tighten that time up... |
10:04:29 | * | dwdv joined #nim |
10:08:17 | * | tane joined #nim |
10:10:12 | FromGitter | <kayabaNerve> dom96: What' |
10:10:27 | FromGitter | <kayabaNerve> *What's the call to create a timer and get the fd when I create it? |
10:11:35 | dom96 | Don'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:29 | FromGitter | <kayabaNerve> Alrighty. I can't find it under asyncdispatch. I'll check the other async libs... |
10:13:35 | dom96 | Why do you need the FD anyway? |
10:15:05 | FromGitter | <kayabaNerve> I don't. addTimer takes a Async Callback type which takes one in. |
10:15:37 | FromGitter | <kayabaNerve> I tried the following but I think it's inf looping. It's stuck somewhere yet my debug statements keep printing... |
10:15:41 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e0c714deac8d1511e9336cc] |
10:16:41 | dom96 | sleepAsync doesn't create an FD |
10:16:48 | FromGitter | <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:58 | FromGitter | <kayabaNerve> This is my code after I got rid of the addTime |
10:17:18 | FromGitter | <kayabaNerve> Or at least the fragments of it that are relevant |
10:18:15 | dom96 | Why don't you simply assign the `sleepAsync` future above your while loop? |
10:18:44 | dom96 | var fut = sleepAsync(2000); while not fut.finished: ... |
10:19:08 | FromGitter | <kayabaNerve> That would work. Thanks. |
10:19:14 | * | solitudesf quit (Ping timeout: 258 seconds) |
10:19:29 | FromGitter | <kayabaNerve> Appreciate the help. |
10:21:01 | FromDiscord | <Lantos> Happy new year!, |
10:21:01 | FromDiscord | <Lantos> |
10:21:01 | FromDiscord | <Lantos> dom whats the best way to extend the window in karax? |
10:21:01 | FromDiscord | <Lantos> https://play.nim-lang.org/#ix=264J |
10:22:22 | * | marmotini_ quit (Ping timeout: 268 seconds) |
10:23:34 | FromGitter | <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:26 | FromDiscord | <Lantos> https://play.nim-lang.org/#ix=264O |
10:38:34 | FromGitter | <alehander92> mywindow = castMyWindow (window) |
10:38:49 | FromGitter | <alehander92> yeah or this |
10:52:42 | Zevv | wow. the fireworks stopped. that was 18 hours straight. |
10:54:57 | FromDiscord | <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:57 | FromDiscord | <mratsim> --> Story of my last 6 months |
11:02:21 | * | belamenso joined #nim |
11:10:18 | Zevv | and the result is worth it, right? |
11:18:23 | FromDiscord | <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:21 | Zevv | yeah but when you now make it in 2020 you can make it hugely parallel in a breeze :) |
11:25:34 | Zevv | you just have been working on the proper tooling! |
11:33:12 | * | nsf joined #nim |
11:33:27 | total_noob | Hello. I hope I'm not disturbing anyone from barrel fever or anything. |
11:33:34 | FromDiscord | <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:50 | total_noob | Here'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:08 | total_noob | Please, 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:46 | total_noob | There 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:14 | narimiran | total_noob: why not just `if`, `elif`, `else` and call it a day? |
11:36:01 | narimiran | if numInt < 1, elif numInt > 10, else got it |
11:37:15 | FromDiscord | <mratsim> case can only have range or fixed values, no comparison |
11:37:21 | total_noob | It'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:54 | total_noob | mratsim, ok, thanks |
11:40:18 | total_noob | Though it's kinda handy that an if-statement is allowed with a case-statement |
11:41:03 | total_noob | within* |
11:44:20 | * | total_noob left #nim (#nim) |
11:47:42 | FromDiscord | <Rika> Then it wouldn't be a case statement anymore |
11:50:45 | FromDiscord | <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:54 | lqdev[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:02 | FromGitter | <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:42 | FromDiscord | <Lantos> ! https://play.nim-lang.org/#ix=265 |
13:51:42 | FromDiscord | <Lantos> unexpected identifier. |
14:04:16 | FromDiscord | <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:25 | FromGitter | <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:38 | lqdev[m] | looks like it. though, there are some things that tell me it might be something else |
15:12:47 | lqdev[m] | eg. `Out` and not `System.out` |
15:13:01 | * | ng0_ is now known as ng0 |
15:13:26 | lqdev[m] | either way I don't think this is the right code ;) |
15:18:13 | * | nsf joined #nim |
15:24:53 | FromDiscord | <Lantos> lol wtf? |
15:24:58 | FromDiscord | <Lantos> I didnt mean to share that |
15:25:29 | FromDiscord | <Lantos> https://play.nim-lang.org/#ix=265H |
15:25:34 | FromDiscord | <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:14 | FromDiscord | <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:09 | disruptek | we really gotta do something about this .so-in-nimcache issue. i cannot develop two packages with different libgit2 versions simultaneously. |
16:30:55 | disruptek | shashlick: ^ |
16:32:41 | disruptek | to 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:57 | shashlick | Isn't that because nimterop doesn't embed version in the location? |
16:50:32 | disruptek | that would be one solution, i think. |
16:50:46 | * | Hideki_ joined #nim |
16:51:05 | shashlick | Location 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:09 | disruptek | what is your current thinking on the "best" solution? |
16:51:18 | * | marmotini_ quit (Ping timeout: 260 seconds) |
16:51:36 | shashlick | That combined with the version in the path |
16:52:00 | disruptek | i think we should switch to an XDG "local lib" directory instead of .cache. |
16:52:08 | shashlick | In addition, -d:xxxStd also needs to consider version methods |
16:52:18 | shashlick | Somehow, not methods |
16:52:18 | disruptek | i expect most users think .cache is ephemeral. |
16:52:29 | disruptek | what is -d:Std? |
16:52:42 | shashlick | Using the library from standard location |
16:52:50 | disruptek | oh, ie. a system lib? |
16:52:54 | shashlick | Yes |
16:53:12 | shashlick | So you could end to linking to a version you don't want |
16:53:24 | disruptek | why is it our problem to worry about that? |
16:53:50 | shashlick | If a user has some old libgit2 installed, nimgit2 will use it |
16:53:51 | disruptek | seems like it might be something we expressly do not want to second-guess. |
16:54:03 | disruptek | nimgit2 /should/ use it if the user asked for it. |
16:54:15 | shashlick | And if you wanted 0.28.4, it won't even check |
16:54:30 | shashlick | And then your use will run into random issues |
16:54:36 | disruptek | maybe it can fatal if a version define was requested along with Std. |
16:55:12 | shashlick | You'd want to specify right |
16:55:27 | disruptek | the issues will only be as random as the programmer's lack of foresight, but yes. |
16:55:27 | shashlick | Same package dependency on a specific version |
16:55:40 | shashlick | Applies to C libs too |
16:56:01 | shashlick | Right now you can specify Std and Git/Dl together |
16:56:09 | disruptek | wut |
16:56:18 | shashlick | Nimterop will first search Std and then fall back to building |
16:56:41 | shashlick | But Std doesn't do anything with the version |
16:56:41 | disruptek | how does it decide success in the first case? |
16:56:55 | shashlick | If it finds the lib and include |
16:56:56 | * | Vladar joined #nim |
16:57:05 | disruptek | okay, good. |
16:57:29 | disruptek | what about XDG "local lib"? |
16:57:32 | disruptek | i want it. |
16:57:40 | shashlick | Ya that's already an issue |
16:57:47 | disruptek | can i put it in? |
16:58:47 | shashlick | https://github.com/nimterop/nimterop/issues/154 |
16:58:48 | disbot | β₯ getHeader should install binaries outside nimcache which can go away |
16:58:53 | shashlick | I like PRs |
16:59:03 | disruptek | okay, cool. |
16:59:52 | shashlick | https://github.com/nimterop/nimterop/blob/master/nimterop/build.nim |
17:00:18 | disruptek | i love me some trivial code. |
17:00:42 | disruptek | stand on the shoulders of giants, i will. |
17:08:05 | FromGitter | <Willyboar> dis welcome back to the future |
17:08:22 | FromGitter | <Willyboar> do you decide about your project? |
17:09:31 | disruptek | gonna polish gittyup and nimph until the future reveals itself. |
17:10:22 | * | Hideki_ quit (Ping timeout: 265 seconds) |
17:10:33 | disruptek | it's about time i made something pretty and not just functional. |
17:11:47 | FromGitter | <Willyboar> yeap you need to add some marketing |
17:11:49 | FromGitter | <Willyboar> :) |
17:13:12 | * | muffindrake quit (Ping timeout: 260 seconds) |
17:13:25 | Zevv | and more dingbats |
17:13:37 | * | muffindrake joined #nim |
17:14:03 | Zevv | or whatever you kids call those things these days |
17:14:18 | * | gangstacat quit (Quit: Δis!) |
17:15:06 | FromGitter | <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:17 | disruptek | cowbell is the name of an old programming language? |
17:38:27 | disruptek | clearly, we need MOAR COWBELL |
17:43:21 | FromGitter | <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:58 | Zevv | MOAR COBOL? |
18:34:03 | * | ng0 quit (Quit: leaving) |
18:35:48 | disruptek | i was in a cobol class once (don't ask) and the instructor always pronounced it, "cobalt". drove me nuts. |
18:39:29 | FromDiscord | <Clyybber> blue oyster code |
18:39:53 | * | clyybber joined #nim |
18:46:33 | * | clyybber quit (Quit: WeeChat 2.7) |
18:57:14 | FromGitter | <deech> Dumb q, how do I make `HashSet[MyObject]`? It's complaining that `hash` isn't defined on my object. |
18:58:18 | disruptek | make a proc `hash` that takes your obj and returns a Hash. |
18:58:19 | leorize | you need to define a hashing function for your object |
18:59:05 | FromGitter | <deech> Why can't it be derived? It's just a bag of strings and an enum kind variant. |
18:59:41 | lqdev[m] | you can use a tuple and it will work, too |
19:00:38 | FromGitter | <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:06 | leorize | it should be possible to make one for objects IMO |
19:02:59 | leorize | for now you should provide your own tbh |
19:03:26 | FromGitter | <deech> Ok, just wanted to make sure I wasn't missing something. |
19:03:27 | * | MarquisdeFalbala quit (Ping timeout: 260 seconds) |
19:08:51 | disruptek | i 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:17 | leorize | true, objects can be much more complicated than a tuple |
19:10:36 | * | fanta1 quit (Quit: fanta1) |
19:10:38 | FromGitter | <deech> Are they more complicated because they allow variants? |
19:12:09 | leorize | yep, and they also have hidden members, accessors, etc. |
19:12:24 | lqdev[m] | this, and inheritance |
19:12:24 | * | MarquisdeFalbala joined #nim |
19:13:59 | FromGitter | <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:34 | leorize | it works until you realize that the members are hidden :) |
19:17:56 | FromGitter | <deech> argh |
19:19:41 | FromGitter | <deech> Note to self: use tuples when possible |
19:22:03 | leorize | tbh I don't recommend using tuples unless you have to |
19:24:11 | FromGitter | <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:32 | disruptek | create a hash proc. |
19:30:23 | FromGitter | <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:24 | FromGitter | <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:48 | FromDiscord | <treeform> maybe 2-3 years? |
20:32:54 | FromGitter | <Willyboar> It depends |
20:34:10 | FromGitter | <Willyboar> Where do you think would be the best place for the first one? |
20:34:34 | FromGitter | <Willyboar> I think most of the community lives in europe |
20:34:56 | FromGitter | <deech> Talk about it at Strange Loop. :) |
20:37:38 | FromGitter | <Willyboar> no i talk about a clean plain nimcon :) |
20:38:05 | FromGitter | <Willyboar> Just Nimysts :P |
20:45:56 | * | belamenso quit (Ping timeout: 265 seconds) |
20:46:00 | narimiran | > When do you think we will see a NimCon? |
20:46:05 | narimiran | in 2020 ;) |
20:46:42 | FromGitter | <Willyboar> Do you want to announce something? |
20:46:52 | narimiran | nah :) |
20:47:17 | narimiran | it is just my optimistic opinion |
20:47:59 | disruptek | nim needs more sponsorship dollars before a con is realistic. |
20:51:36 | FromGitter | <deech> Emacs did a purely virtual con this year |
20:56:48 | * | endragor joined #nim |
20:59:53 | FromGitter | <Willyboar> money rulez everything :( |
21:02:08 | * | endragor quit (Ping timeout: 260 seconds) |
21:02:25 | FromGitter | <Willyboar> narimiran i think the most optimistic is 2021 |
21:02:34 | narimiran | ok |
21:12:57 | * | narimiran quit (Ping timeout: 268 seconds) |
21:15:30 | FromGitter | <alehander92> fosdem segment is close to a mini conf |
21:20:57 | FromGitter | <Willyboar> I will watch fosdem on youtube |
21:21:32 | * | ng0 joined #nim |
21:22:21 | disruptek | solitudesf: 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:30 | disruptek | s/you go/you got/ |
21:25:17 | * | dwdv quit (Ping timeout: 268 seconds) |
21:25:37 | disruptek | ima do fosdem this year. |
21:29:28 | FromGitter | <Willyboar> i am interest more for pmunch's presentation |
21:36:02 | * | dwdv joined #nim |
21:43:09 | FromDiscord | <mratsim> wow this looks awesome @treeform @disruptek: https://github.com/treeform/greenlet |
21:43:55 | disruptek | yeah, i could see slowly lifting it into pure nim. |
21:48:03 | FromDiscord | <treeform> disruptek, @mratsim, yeah that was my goal, take the C library, understand it more... port it to 100% nim + assembly. |
21:48:20 | FromDiscord | <mratsim> I'm posting posting my first issue π |
21:48:26 | FromDiscord | <mratsim> maybe you won't need assembly |
21:48:32 | disruptek | hah |
21:49:11 | FromDiscord | <treeform> I was impressed by the greenlet switching speeds: |
21:49:12 | FromDiscord | <treeform> |
21:49:12 | FromDiscord | <treeform> https://cdn.discordapp.com/attachments/371759389889003532/662049713838751745/unknown.png |
21:49:45 | FromDiscord | <treeform> If you go with setcontext or setjump it way slower. |
21:50:08 | disruptek | i used them extensively in python, but i expect they will be much more stable in nim/c. |
21:51:00 | FromDiscord | <treeform> I liked gevent and the greenlets its build on in python... |
21:51:19 | FromDiscord | <treeform> Why the python community chose asyncio as the standard is beyond me. |
21:51:42 | disruptek | i know. i bailed on python rather than switch to asyncio. |
21:51:46 | FromDiscord | <mratsim> here you go: https://github.com/treeform/greenlet/issues/1 |
21:51:49 | disbot | β₯ Benching against Vyokov coroutines ; snippet at 12https://play.nim-lang.org/#ix=268U |
21:51:49 | FromDiscord | <treeform> same |
21:52:28 | disruptek | but i also removed gevent in favor of threads; they become much easier to reason about and fit my cloud architecture better. |
21:53:30 | FromDiscord | <treeform> yeah, maybe threads are just good enough ... and we are chasing some marginal improvement |
21:54:09 | FromDiscord | <mratsim> I don't agree |
21:54:22 | disruptek | me neither. i think coro has its place. |
21:54:42 | FromDiscord | <mratsim> I'm working a lot with threads :D, and I'm considering having tasks as augmented coroutines |
21:55:00 | FromDiscord | <mratsim> I have a secret branch of Weave with coroutines in mind |
21:55:03 | disruptek | i see us doing scheduling across cloud-based threads in the future. |
21:55:42 | FromDiscord | <treeform> For work I am thinking of moving a way from async/await system I have not to just processes. |
21:57:59 | FromDiscord | <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:06 | FromDiscord | <treeform> basically start a full process for each task |
21:58:18 | FromDiscord | <treeform> so that it can return the memory back to the OS when it quits |
21:58:20 | disruptek | isn't that the guy that did highland? |
21:58:29 | disruptek | that guy is a genius. |
21:58:31 | FromDiscord | <treeform> my tasks run for about 10min using 10GB of mem |
21:58:45 | FromDiscord | <mratsim> chaoran is the author of one of the fastest wait-free MPMC concurrent queue |
22:01:53 | FromDiscord | <treeform> On thing that gives cgreenlet speed is the fact that it does not save FPU registers ... |
22:02:05 | FromDiscord | <treeform> which it should |
22:02:13 | FromDiscord | <treeform> its easy being fast without being accurate π |
22:04:07 | FromDiscord | <treeform> I am running into this problem again: https://forum.nim-lang.org/t/4932 |
22:04:47 | FromDiscord | <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:15 | disruptek | what did you do to solve your memory issue last time? |
22:28:38 | disruptek | i agree with dom; forking would be pretty clean. |
22:28:53 | disruptek | ie. hard to break |
22:35:20 | FromDiscord | <treeform> I gave servers more ram so that it would happen less often |
22:35:34 | FromDiscord | <treeform> I also restart them more often |
22:35:49 | disruptek | docker-style sysadmin. |
22:35:50 | FromDiscord | <mratsim> don't try saving the FPU registers |
22:35:56 | FromDiscord | <treeform> But the problem is back |
22:35:56 | FromDiscord | <mratsim> nor the SSE/AVX registers |
22:36:24 | FromDiscord | <mratsim> no compiler generates FPU code anymore, and SSE/AVX/AVX512 registers are too big |
22:36:36 | * | uvegbot joined #nim |
22:36:42 | disruptek | if performance doesn't matter, fork is a cheap solution, i think. |
22:36:46 | FromDiscord | <mratsim> just mentions not to yield in the middle of compute |
22:39:40 | FromDiscord | <treeform> I think setjump saves the extra registers, so it cat beat the custom setjump like code |
22:39:57 | FromDiscord | <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:01 | FromDiscord | <mratsim> setjmp saves regular + FPU but doesn't save SSE/AVX |
23:05:17 | FromDiscord | <mratsim> the main issue of setjmp I think is syscall |
23:05:52 | FromDiscord | <mratsim> syscall takes 150~200 cycles while an addition takes 1 cycles to give you an idea |
23:06:37 | FromDiscord | <treeform> yeah I don't know much about this. cgreenlet was my first introduction |
23:06:53 | FromDiscord | <treeform> I went down this list: https://github.com/baruch/libwire/wiki/Other-coroutine-libraries |
23:06:57 | FromDiscord | <mratsim> I don't know either about setjmp/longjmp |
23:06:58 | FromDiscord | <treeform> and tried to get them to work |
23:07:09 | FromDiscord | <treeform> some of the worked ok but had bad APIs |
23:07:27 | FromDiscord | <treeform> I liked the greenlet API and it worked and was easy to integrate |
23:08:30 | FromDiscord | <mratsim> it's missing ARM at least though :/ |
23:08:51 | disruptek | mratsim: what about your tiny fibre impl you found? |
23:08:54 | FromDiscord | <treeform> The only arm hardware I coded on was iOS and Android devices |
23:09:19 | FromDiscord | <treeform> don't need super threading there |
23:10:44 | FromDiscord | <treeform> I also don't think ARM asm would be hard to add |
23:10:45 | FromDiscord | <treeform> https://github.com/treeform/greenlet/blob/master/src/cgreenlet/src/greenlet-asm.S |
23:10:50 | FromDiscord | <treeform> its only like 3 asm calls |
23:11:09 | FromDiscord | <treeform> _greenlet_savecontext, _greenlet_switchcontext, _greenlet_newstack |
23:11:17 | FromDiscord | <treeform> and all the do is push registers for most parts |
23:11:38 | disruptek | i'll setup the travis config shashlick made if you wanna write a test or two. |
23:11:53 | FromDiscord | <mratsim> yes sure, you can take the code from libmill or boost/context or any of the coro lib π |
23:12:21 | FromDiscord | <treeform> I tried several coro libs and they appear not to work/compile |
23:12:49 | disruptek | right, but with tests we can fix them. all we need is a starting point for the asm. |
23:14:11 | FromDiscord | <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:12 | FromDiscord | <mratsim> |
23:14:12 | FromDiscord | <mratsim> Travis with Linux, Mac, stable/devel, x86/ARM and Azure pipelines with Linux, mac, WIndows, C/C++. |
23:14:12 | FromDiscord | <mratsim> |
23:14:12 | FromDiscord | <mratsim> All with caching including for devel |
23:14:40 | FromDiscord | <mratsim> 32-bit and 64-bit Linux/Windows as well |
23:14:48 | disruptek | nice. |
23:18:43 | * | ritchie_ joined #nim |
23:19:09 | * | ritchie_ quit (Client Quit) |
23:20:09 | FromDiscord | <treeform> nice. |
23:21:13 | * | ritchie__ quit (Ping timeout: 268 seconds) |