00:00:12 | FromDiscord | <Clyybber> oh, thats more than I expected |
00:00:17 | FromDiscord | <Clyybber> thats plenty of space |
00:00:26 | FromDiscord | <exelotl> yeah! and we're not doing compression or anything yet |
00:00:51 | FromDiscord | <Clyybber> I have this weird old sd card lying around that has 32MB of space |
00:01:04 | FromDiscord | <Clyybber> I store my game on it, for funzies |
00:01:10 | FromDiscord | <Clyybber> "game" |
00:01:36 | FromDiscord | <exelotl> what does the game run on? xD |
00:02:03 | FromDiscord | <Clyybber> previously it was lua + loeve2d, then I started porting it to nim and vulkan |
00:02:10 | FromDiscord | <Clyybber> but got stock somewhere in engine development |
00:02:38 | FromDiscord | <exelotl> ah, classic move |
00:02:47 | FromDiscord | <Clyybber> and now I'm constantly switching between wanting to make a music thingy, compiler stuff, engine stuff and a roguelike |
00:03:44 | FromDiscord | <Clyybber> I think I'm gonna try implementing a framegraph next |
00:15:47 | * | krux02_ joined #nim |
00:18:12 | * | krux02 quit (Ping timeout: 248 seconds) |
00:29:37 | FromDiscord | <treeform> Does nim's CLI produce performance numbers that can be graphed over days? So we can see it going up or down over time? |
00:30:01 | disruptek | that's the idea of golden, but i got side-tracked. |
00:30:09 | disruptek | i do test it every so often. |
00:30:31 | FromDiscord | <treeform> do you have a site with a graph? |
00:30:46 | disruptek | no, i don't. |
00:30:58 | disruptek | i tested openapi today; no significant slowdown. |
00:31:53 | FromDiscord | <treeform> disruptek, oh about jwt remember with the google openAPI thingy? |
00:32:16 | disruptek | gc:arc json test is ~2.8s versus ~2.2s markAndSweep. |
00:32:23 | FromDiscord | <treeform> disruptek, I did a ton of changes on my fork: https://github.com/treeform/jwt |
00:32:48 | disruptek | does it work? |
00:33:04 | disruptek | should we switch to your fork? |
00:33:09 | FromDiscord | <treeform> disruptek, but it turns out that yglukhov done a ton on his, including using bareSSL instead of openSSL, https://github.com/yglukhov/nim-jwt |
00:33:28 | disruptek | yeah, we've been using his. |
00:33:40 | FromDiscord | <treeform> ok, I though you been using mine |
00:34:09 | disruptek | i had to fix something in his, too, but it was due to nim iirc. yours didn't work for me. |
00:34:27 | FromDiscord | <treeform> I cut down my lib to about 180 lines, his grew a ton because of bearSSL |
00:34:58 | disruptek | oh, y'know what it was? |
00:35:07 | disruptek | you broke his use of base64 when you changed it in stdlib. |
00:35:10 | disruptek | funny. |
00:35:29 | FromDiscord | <treeform> yeah π¦ maybe I was too rash with the change. |
00:35:33 | disruptek | anyway, if you would rather use yours, that's fine with me. |
00:35:49 | FromDiscord | <treeform> naa feel free to use what you feel is best |
00:36:13 | disruptek | ok, just let me know if gcplat stops working. i don't really test it very often. |
00:36:25 | disruptek | i wrote a google search tool to test it, but that's it. |
00:36:41 | FromDiscord | <treeform> I don't use gcplat at the moment, some thing about the API makes it harder to use then just passing JSON. |
00:36:46 | FromDiscord | <treeform> Maybe we can talk about that more. |
00:37:04 | disruptek | yeah, it's not exactly polished. |
00:37:04 | FromDiscord | <treeform> I would like to use gcplat, but it's just too awkward at the moment. |
00:37:28 | disruptek | give me some idea of how you want the code to look and we can change it. |
00:37:43 | FromDiscord | <mratsim> --gc:plat |
00:38:42 | FromDiscord | <treeform> Honestly I think its just easy to build json trees with *%{} while its hard to do so with nim objects. Also unclear how nils are handled. |
00:38:52 | FromDiscord | <treeform> Last time I tried to use it you and I ran into errors. |
00:39:24 | disruptek | well, you can pass raw json to it right now. |
00:39:41 | disruptek | i think that's what you ended up doing because the alternative was for nilable fields to inherit default(T) values. |
00:39:53 | disruptek | and that might provoke a meaningless query. |
00:40:37 | disruptek | so what we can do is exclude fields that are equal to their default(T). that's one idea i had, i mean. |
00:40:47 | FromDiscord | <treeform> Google APIs are add in that the they take values in headers, in query params and in the post body... |
00:41:07 | disruptek | right, but gcplat handles that just fine. |
00:41:17 | disruptek | also openapi handles that for any api. |
00:42:30 | FromDiscord | <treeform> well I think there are a ton of defaults that are not "true" defaults, but basically need to go there in order for it it work. |
00:42:49 | FromDiscord | <treeform> for example here, https://github.com/treeform/googleapi/blob/master/src/googleapi/sheets.nim#L34 |
00:43:44 | FromDiscord | <treeform> `valueInputOption=USER_ENTERED` almost everyone should pass, but its kind of tribal knowledge that I think openAPI does not have? |
00:44:27 | disruptek | i don't follow... |
00:44:49 | disruptek | openapi knows what that url means and how to fill it with values you've passed. |
00:45:11 | FromDiscord | <treeform> I am not sure it know that you need to pass X values to make it even work. |
00:45:25 | FromDiscord | <treeform> because google API is dumb and basically requires you to pass X=Y |
00:45:29 | FromDiscord | <treeform> if you don't know that it does not work |
00:45:42 | disruptek | well, i know openapi works. |
00:45:46 | disruptek | i use it all the time. |
00:45:58 | disruptek | i mean, the bot is using it, as an example. |
00:46:03 | disruptek | nimph uses it. |
00:46:24 | disruptek | and my google api works fine. |
00:46:30 | disruptek | !repo disruptek/xs |
00:46:31 | disbot | https://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 1β 0π΄ |
00:47:09 | disruptek | the "tribal knowledge" problem is really that we don't know what defaults we should assume for these inputs. |
00:47:09 | FromDiscord | <treeform> no your work is great, I am saying google as a company exposes an API that is hard to use. |
00:47:23 | disruptek | okay, just checking. |
00:47:46 | disruptek | one thing is, there is an enum syntax that i don't think my openapi code really knows how to work with. |
00:47:48 | FromDiscord | <treeform> so you almost have to wrap it into some thing else in order to use it first. |
00:47:52 | disruptek | i can't remember if that is fully implemented. |
00:48:03 | disruptek | yeah, i mean, we could make it so it's option-based. |
00:48:12 | disruptek | that's a totally plausible and complete solution afaik. |
00:48:26 | disruptek | but i don't know if i like the way that api looks, to use. |
00:48:35 | disruptek | maybe it's not crazy. |
00:48:55 | disruptek | also, we could support it alongside the other two apis -- json-based and raw nim-type based. |
00:49:22 | disruptek | i just pictured tons of .some everywhere. |
00:49:34 | disruptek | maybe we use a maybe. |
00:50:37 | disruptek | maybe that's how we solve the representation of nil in JsonNode. |
00:52:24 | * | couven92 quit (Quit: Client Disconnecting) |
01:17:02 | disruptek | gc:arc is still 3.9s versus 1.4s for the base64 benchmark. |
01:22:35 | * | krux02_ quit (Remote host closed the connection) |
01:28:17 | * | icebattle quit (Ping timeout: 268 seconds) |
01:40:45 | * | icebattle joined #nim |
01:43:49 | * | icebattle quit (Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac) |
01:48:02 | FromDiscord | <treeform> My base64 lib? |
01:49:09 | disruptek | stdlib, yeah. |
01:55:18 | * | ng0 quit (Quit: leaving) |
02:02:12 | * | gangstacat quit (Ping timeout: 248 seconds) |
02:17:25 | * | lxbarbosa quit (Remote host closed the connection) |
02:19:56 | FromDiscord | <treeform> What do you think makes it slower? |
02:34:41 | * | icebattle joined #nim |
02:36:15 | FromGitter | <codenoid> evening |
02:41:28 | * | icebattle quit (Ping timeout: 258 seconds) |
03:08:45 | * | uu91 quit (Remote host closed the connection) |
03:18:54 | * | gangstacat joined #nim |
03:54:05 | * | marmotini_ joined #nim |
03:55:48 | * | muffindrake quit (Ping timeout: 248 seconds) |
03:57:48 | * | thomasross is now known as Guest9174 |
03:57:48 | * | thomasross_ joined #nim |
03:57:48 | * | Guest9174 quit (Killed (hitchcock.freenode.net (Nickname regained by services))) |
03:57:49 | * | thomasross_ is now known as thomasross |
03:58:06 | * | muffindrake joined #nim |
04:16:48 | * | marmotini_ quit (Ping timeout: 265 seconds) |
04:49:11 | * | dddddd quit (Remote host closed the connection) |
04:50:13 | * | thomasross_ joined #nim |
04:50:13 | * | thomasross quit (Killed (orwell.freenode.net (Nickname regained by services))) |
04:50:13 | * | thomasross_ is now known as thomasross |
04:52:11 | * | gangstacat quit (Quit: Δis!) |
04:52:26 | * | nsf joined #nim |
04:55:51 | * | gangstacat joined #nim |
05:36:50 | * | thomasross quit (Ping timeout: 240 seconds) |
05:38:24 | * | thomasross joined #nim |
05:43:29 | * | narimiran joined #nim |
05:49:17 | * | ltriant quit (Quit: leaving) |
05:56:12 | * | marmotini_ joined #nim |
06:01:12 | FromGitter | <IamRifki> Question: When do I use Const? |
06:01:38 | FromGitter | <IamRifki> I understand Let and Var |
06:01:44 | FromGitter | <IamRifki> but I'm puzzled with const |
06:03:12 | narimiran | for compile-time constants. see if this maybe helps: https://narimiran.github.io/nim-basics/#_immutable_assignment |
06:31:17 | * | Jjp137 quit (Read error: Connection reset by peer) |
06:31:45 | * | Jjp137 joined #nim |
06:42:46 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
06:46:32 | FromGitter | <matrixbot> `silvernode` Procrastination, for the last 3 weeks I have been putting off continuing learning nim so shame on me. |
07:25:10 | * | icebattle joined #nim |
07:29:44 | * | icebattle quit (Ping timeout: 258 seconds) |
07:31:13 | * | solitudesf joined #nim |
07:31:40 | * | PMunch joined #nim |
07:53:02 | * | marmotini_ quit (Read error: Connection reset by peer) |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:05:06 | * | gmpreussner joined #nim |
08:10:20 | * | marmotini_ joined #nim |
08:28:23 | * | marmotini_ quit (Remote host closed the connection) |
08:32:59 | FromGitter | <adilhasan> Hello I have a quick question. Does anyone else have problems logging into the nim-lang forum? For me the login panel is greyed out. |
08:34:58 | * | kapzyl joined #nim |
08:35:28 | * | kapzyl quit (Client Quit) |
08:41:06 | * | JustASlacker joined #nim |
08:41:39 | FromGitter | <garuse> hello. does anyone knows an online nim ide that works? |
08:43:58 | FromGitter | <adilhasan> Hello @garuse I am not sure if the playground helps https://play.nim-lang.org/ |
08:46:47 | * | xet7 quit (Remote host closed the connection) |
08:47:49 | * | xet7 joined #nim |
08:50:58 | * | ng0 joined #nim |
08:50:58 | * | ng0 quit (Changing host) |
08:50:58 | * | ng0 joined #nim |
08:52:44 | * | xet7 quit (Remote host closed the connection) |
08:52:59 | FromDiscord | <demotomohiro> Hello garuse, Wandbox also has Nim https://wandbox.org/ |
08:53:42 | * | xet7 joined #nim |
08:54:01 | * | floppydh joined #nim |
08:59:13 | solitudesf | daily reminder that repl.it is still on 0.17 |
08:59:57 | Araq | 0.17 was good enough for everybody |
09:05:35 | FromDiscord | <Rika> keyword: was? |
09:07:58 | * | Vladar joined #nim |
09:16:32 | FromGitter | <alehander92> so what happened with os:standalone |
09:16:58 | FromGitter | <alehander92> much less important than other stuff, just wondering if a consensus was reached :P |
09:17:05 | * | marmotini_ joined #nim |
09:17:12 | * | marmotini_ quit (Read error: Connection reset by peer) |
09:17:19 | * | marmotini_ joined #nim |
09:18:19 | * | tiorock joined #nim |
09:18:19 | * | tiorock quit (Changing host) |
09:18:19 | * | tiorock joined #nim |
09:18:19 | * | rockcavera is now known as Guest31271 |
09:18:19 | * | Guest31271 quit (Read error: Connection reset by peer) |
09:18:19 | * | tiorock is now known as rockcavera |
09:21:52 | PMunch | solitudesf, the playground is up to the latest pushed tag at any time (hopefully) :) |
09:26:11 | * | marmotini_ quit (Remote host closed the connection) |
09:26:37 | * | marmotini_ joined #nim |
09:28:36 | * | marmotini_ quit (Remote host closed the connection) |
09:28:43 | * | marmotini_ joined #nim |
09:29:32 | * | uu91 joined #nim |
09:30:56 | * | marmotini_ quit (Remote host closed the connection) |
09:31:23 | * | marmotini_ joined #nim |
09:36:04 | * | marmotini_ quit (Ping timeout: 268 seconds) |
09:41:43 | Zevv | araq, you got a few seconds for me? |
09:42:10 | Zevv | I'd like to get rid of this allocator object if possible, you mentioned something was legacy there |
09:42:38 | Zevv | and what should I change in osalloc to make it not wrong |
09:43:13 | * | JustASlacker quit (Ping timeout: 245 seconds) |
09:46:57 | * | marmotini_ joined #nim |
09:50:47 | Araq | Zevv, hi |
09:51:18 | Araq | I don't understand the question, the allocator is not required but it's also not harmful as it understands -d:useMalloc |
09:52:17 | * | marmotini_ quit (Ping timeout: 268 seconds) |
09:56:15 | * | krux02 joined #nim |
09:56:19 | * | marmotini_ joined #nim |
09:57:12 | federico3 | Araq: do you see my point about exceptions in https://github.com/nim-lang/RFCs/issues/180 ? Maybe the same safety features can be enabled using nim.cfg instead of a new compiler flag? |
09:57:13 | disbot | β₯ Introduce safety modes |
09:58:04 | Araq | probably not, no. -d:release keeps the runtime checks (since version 0.20 or something) |
09:59:26 | Zevv | Araq: it's not harmful per se, but I was hoping to really minimize memory usage so PMunch can put it in its atmel AVR as well |
10:00:55 | Zevv | it is now wasting 13 whole kilobytes on this 'allocator' |
10:01:39 | * | rubendv joined #nim |
10:02:05 | Zevv | for a lot of targets a bit more code in the .text segment is ok, but RAM is often scarce |
10:02:57 | federico3 | Araq: my point is that there should be a simple way to ensure safety. The manual is unclear on this. |
10:03:35 | Araq | how is it unclear? there is 'addr', 'ptr' and 'cast', everything else is safe |
10:03:49 | PMunch | 13 kilobytes is waay to much to be paletable on AVR chips |
10:04:04 | federico3 | Araq: I'm referring to "Whether a checked runtime error results in an exception or in a fatal error is implementation specific" |
10:04:10 | Araq | Zevv, where do the 13KB come from? |
10:04:51 | Zevv | The MemRegion `allocator` |
10:05:01 | Araq | ok so remove it |
10:05:36 | Araq | but it doesn't come from allocators.nim |
10:05:41 | Araq | hence my confusion |
10:05:58 | federico3 | Araq: with some flag or config for safety, the developer should be reassured that risks in RFC #4 are handled |
10:06:09 | Araq | federico3, well it depends on the implementation, currently on the --exceptions switch |
10:06:21 | Zevv | no it comes from mmdisp |
10:06:56 | federico3 | Araq: I get it. I'm saying that, without some global flag, there's no obvious way to ensure good safety. |
10:07:23 | Araq | I consider the little wiggle room that the spec gives us is essential for Nim targetting both small and big machines |
10:07:36 | federico3 | e.g. the developer has to keep up to date with various flags and compiler changes over time and something can slip |
10:08:20 | Araq | meh, he only has to keep up with the changelog when we actually change the defaults |
10:09:20 | Araq | and we don't change the defaults frequently, it'll be a new major release |
10:10:00 | Araq | but more importantly: what's the difference between 'raise' and 'quit' when it comes to "safety"? |
10:12:26 | federico3 | it's a huge difference in how unexpected errors, including bugs, can be recovered. Very often large parts of a program can fail with an exception but the core functions keep running. Without this assurance, a less important component can crash the most important one |
10:13:11 | federico3 | (and it's enough to completely rule out Nim as an option if that cannot be avoided :( ) |
10:13:51 | Araq | if Nim is rules out because of that, what isn't ruled out? |
10:15:29 | federico3 | a lot of languages would very rarely crash out and are used for relatively critical stuff. Python for example. |
10:16:34 | Araq | not sure I'm buying it :-) |
10:17:21 | Araq | who knows how many paths to exit() exist in Python's > 100_000 C codebase |
10:17:53 | federico3 | not enough to be a problem in production |
10:18:17 | Araq | ah so it was tested well and then put into production |
10:18:54 | Araq | can we shorten this discussion a little |
10:19:17 | Araq | just say it directly: You want to be able to recover from bugs. |
10:19:32 | Araq | This is a fair thing to want. |
10:20:14 | * | marmotini_ quit (Remote host closed the connection) |
10:20:40 | * | marmotini_ joined #nim |
10:22:07 | federico3 | Araq: sorry if I didn't make it more clear. Part of the safety aspect is to be promised that new version of the compiler will not get less safe (at least not without a very big warning) |
10:24:57 | Araq | I probably lived too much in internet-land where "exceptions are bad" and "stack unwinding and cleanup cause code bloat" |
10:25:24 | * | marmotini_ quit (Ping timeout: 268 seconds) |
10:26:32 | Zevv | just depends on who you ask |
10:27:10 | FromGitter | <sheerluck> I like Nim regardless of safety. It brings fun back |
10:27:49 | federico3 | (on a side note, Nim could probably use the effect system to detect unexpected calls to quit() or similar disasters) |
10:31:34 | Araq | how about this: we push for intrinsics so that we can really get the cost down to "1 instruction per call" |
10:32:06 | Araq | and then continue to map IndexError to a catchable exception |
10:32:07 | * | rubendv quit (Remote host closed the connection) |
10:33:02 | * | marmotini_ joined #nim |
10:36:59 | Araq | federico3, ok, sorry, I'm beginning to understand your point |
10:37:12 | Araq | I would prefer to use a different term as "safety" is overloaded |
10:37:19 | Araq | but I get it now |
10:37:42 | federico3 | oh I see.. I meant safety in general, not memory safety strictly speaking |
10:38:15 | * | Vladar quit (Remote host closed the connection) |
10:38:38 | * | Vladar joined #nim |
10:39:51 | Araq | somebody wrote an RFC introducing a "recover" statement that can deal with "subsystem" failures |
10:40:09 | Araq | but then we have both 'try' and 'recover' |
10:41:00 | Zevv | Araq: I could probably you just get there now with some arch specific inline asm |
10:41:10 | Zevv | english is hard |
10:41:17 | Zevv | s/you could probably just get there now/ |
10:41:50 | Zevv | so to get the proof of concept right and do performance tests |
10:42:14 | Zevv | and fallback to the current implementation when you have no asm available for a target |
10:42:54 | Araq | inline asm targetting labels inside the C code? |
10:42:59 | Araq | does that even work? |
10:43:56 | Zevv | it might be possible to add an asm-level label as well |
10:44:29 | Zevv | good question though :) |
10:47:22 | federico3 | https://github.com/nim-lang/RFCs/issues/77 this one? |
10:47:23 | disbot | β₯ [RFC] Exceptions that inherit from `system.Defect` should not be tracked |
10:49:21 | Zevv | Araq: works on gcc: http://ix.io/26Vd |
10:49:47 | Araq | federico3, no but yeah there has been plenty of discussion on this topic |
10:50:36 | Araq | Zevv, not good enough, this messes with GCC's control flow graph, I think |
10:51:21 | Araq | and who knows what optimizations are disabled just because the function contains the __asm__ keyword |
10:51:42 | Zevv | sure |
10:52:19 | * | krux02 quit (Remote host closed the connection) |
10:54:24 | * | krux02 joined #nim |
10:54:57 | * | krux02 quit (Remote host closed the connection) |
10:58:18 | FromDiscord | <inv> Hello. Quick PR into nimble: https://github.com/nim-lang/nimble/pull/761 |
10:58:19 | disbot | β₯ Run can work without additional option if only one bin in .nimble |
11:01:22 | * | dddddd joined #nim |
11:26:32 | * | marmotini_ quit (Remote host closed the connection) |
11:26:50 | * | marmotini_ joined #nim |
11:30:02 | * | marmotini_ quit (Remote host closed the connection) |
11:30:29 | * | marmotini_ joined #nim |
11:35:04 | * | marmotini_ quit (Ping timeout: 258 seconds) |
11:44:28 | * | nsf quit (Quit: WeeChat 2.7) |
11:45:59 | * | lritter joined #nim |
11:55:25 | * | marmotini_ joined #nim |
11:56:51 | * | marmotini_ quit (Remote host closed the connection) |
11:56:58 | * | marmotini_ joined #nim |
12:05:04 | Zevv | well, pretty neat: I'm just able to use stdlib basics in the linux kernel as-is |
12:05:08 | Zevv | seqs, exceptions, all works |
12:06:19 | FromGitter | <alehander92> ohh |
12:06:21 | FromGitter | <alehander92> example? |
12:07:52 | Zevv | lemme push some suff |
12:08:34 | Zevv | https://github.com/zevv/nim-linux-kernel/blob/master/src/hello.nim |
12:09:21 | Zevv | only needed to stuff some trivial stdlib stuff: https://github.com/zevv/nim-linux-kernel/blob/master/src/stubs/stubs.c |
12:09:40 | Zevv | so now we ask someone to do nimterop on the linux headers and all is well :) |
12:10:51 | FromGitter | <alehander92> hm, what is an example of an useful kernel module |
12:11:17 | FromGitter | <alehander92> like, i see how it is useful, but i cant think of an obvious simple example |
12:11:30 | Araq | move httpbeast into the Linux kernel to remove the context switch overheads |
12:11:30 | Zevv | it's more about running nim in an 'alien' environment |
12:11:59 | Zevv | I could as well have put it on a bare ARM chip, but I'm visiting my mom for the week and don't have any hardware here :) |
12:12:15 | FromGitter | <alehander92> probably good for even finergrained debugging/tracing stuff |
12:12:49 | FromGitter | <alehander92> your mum cooks her own hardware chips right |
12:13:49 | Zevv | potato chips, yes |
12:14:17 | FromGitter | <alehander92> now thats a foreign environment for a runtime |
12:14:44 | FromGitter | <alehander92> ok workk |
12:18:41 | * | kahiru quit (Ping timeout: 265 seconds) |
12:20:57 | Zevv | can I pull my own Nim branch through CI without PR'ing to upsteam? |
12:22:52 | Araq | dunno I'm awaiting your PR |
12:23:40 | * | kahiru joined #nim |
12:24:22 | Zevv | I don't dare PR'ing |
12:24:27 | Zevv | it's full of shit |
12:27:01 | Araq | so ... who can patch llvm and gcc and add some intrinsics? |
12:27:15 | Zevv | but please feel free to help me out: https://github.com/zevv/Nim/commit/4c99533a31e60d49c27fada126bee3c5bca17cc1 |
12:28:09 | Zevv | for the mmdisp path I felt it made sense to join the 'nogc' and 'useMalloc' path since that has most of the stuff in place. But that branch of the 'when' was broken already so it might be dead in practice. |
12:28:32 | Zevv | then I had to disable your addQuitProc/SIGABRT hack for the gotoBasedExecptions |
12:28:47 | Zevv | and I still don'not know how to fix osalloc, you said I did that wrong |
12:28:57 | Zevv | apart from those things, stuff "works for me" |
12:29:27 | Zevv | I also moved some things around in excpt to prevent tempFrames from being put in RAM when no excpetions are used |
12:29:36 | Zevv | no *stack traces*, that is |
12:30:58 | Araq | yeah, seems really useful |
12:36:09 | Zevv | so, I'll just PR it like this and see what burns |
12:36:41 | Araq | sure |
12:47:57 | Araq | Zevv, the addQuitProc hack isn't required anymore anyway |
12:48:16 | Araq | might as well remove it and see if it breaks a test |
12:49:10 | Zevv | how is it done now then? |
12:49:45 | Zevv | anway, removed it, see what happens |
12:50:08 | Araq | by compilerproc injection into main() |
12:50:11 | * | abm joined #nim |
12:50:45 | Zevv | good. I'm also running with nomain, let me check what I miss then |
12:52:00 | * | lxbarbosa joined #nim |
12:54:34 | FromGitter | <zah> https://www.reddit.com/r/programming/comments/em93ke/c_as_assembly_20_hello_nim_a_generalpurpose/ |
12:55:31 | FromGitter | <zah> Viktor's latest talk on Nim has been uploaded, let's uptove him |
12:56:01 | * | Hideki_ joined #nim |
12:57:49 | narimiran | @zah thanks for the link, i shared it on twitter |
12:58:34 | FromDiscord | <Rika> updooted |
12:58:48 | FromDiscord | <Rika> zah, are you dyslexic? ;w; |
13:01:14 | FromDiscord | <Rika> is this a small event? the reactions sound pretty weak ;; |
13:02:44 | * | uu91 quit (Remote host closed the connection) |
13:05:54 | * | Vladar quit (Quit: Leaving) |
13:08:27 | * | marmotini_ quit (Remote host closed the connection) |
13:08:53 | * | marmotini_ joined #nim |
13:09:46 | FromDiscord | <Rika> YOU CAN BORROW EVERYTHING?!?!? |
13:10:09 | FromDiscord | <Rika> god ive been writing macros to do that wtf |
13:10:09 | Zevv | as long as you bring it back |
13:10:47 | FromDiscord | <Rika> zevv ;; no i mean you can borrow all procs of a T of a disctint T |
13:10:49 | * | ptdel joined #nim |
13:10:58 | Zevv | yeah I know :) |
13:11:02 | FromDiscord | <Rika> ;; |
13:11:06 | FromDiscord | <Rika> bully |
13:11:07 | PMunch | Haha |
13:12:05 | PMunch | Looks like a pretty big event just from the very first seconds |
13:12:13 | FromGitter | <alehander92> Rika its not the world cup mate |
13:12:48 | FromGitter | <alehander92> <3 |
13:13:23 | PMunch | Oh wow, that joke from the host without any laughter.. |
13:13:26 | FromGitter | <alehander92> btw Araq is there a particular reason func cant report the internal side-effect call on error |
13:13:35 | * | marmotini_ quit (Ping timeout: 258 seconds) |
13:15:28 | FromDiscord | <gingerBill> "C++ as Assembly 2.0" That's a weird title. |
13:15:52 | PMunch | Not really, Nim targts C/C++ instead of Assembly |
13:15:55 | FromDiscord | <gingerBill> "C as Assembly 2.0" is more correct and pretty much the true. Most architectures kind of target C now as its "virtual platform" |
13:16:06 | PMunch | Ah that's fair |
13:16:24 | FromDiscord | <gingerBill> Nim targeting C is fine. |
13:16:24 | PMunch | But I guess this might be a C++ based event |
13:16:33 | FromDiscord | <gingerBill> Could be. |
13:16:56 | FromDiscord | <Rika> alehander92, ive never listened to more than 10 talks |
13:17:45 | PMunch | Definitely seems C++ heavy at the very least: https://codedive.pl |
13:17:53 | PMunch | (if you look at the schedule) |
13:19:41 | FromDiscord | <gingerBill> Looks like a good talk! |
13:20:03 | FromDiscord | <Rika> its info dense but i dont know, the conveying of the information isnt that good |
13:20:30 | FromDiscord | <gingerBill> `{} braces? really? :D (nitpicking...)` Ha |
13:21:02 | FromDiscord | <gingerBill> I like `{}` or off-side rule. I prefer `{}` but I'm not bothered. Having written enough Pascal-family code with `begin` and `end`, I am not writing that ever again. |
13:21:55 | FromDiscord | <gingerBill> If I had the choice between the three styles, that is. |
13:21:57 | FromDiscord | <Rika> offside ~= braces >>>>>>>>>> end/begin keywords |
13:22:11 | PMunch | Hmm, pattern matched borrow would be nice.. Like borrow everything where this type is the only argument. |
13:22:48 | FromDiscord | <gingerBill> But I'm not really bothered by syntax the end of the day. |
13:25:56 | FromDiscord | <treeform> @gingerBill what are your thoughts on exceptions? Say, vs explicit error returns. Are they good/bad? |
13:28:29 | FromGitter | <alehander92> no need for begin/end with indentation |
13:30:44 | * | kungtotte quit (Read error: Connection reset by peer) |
13:31:13 | * | marmotini_ joined #nim |
13:33:27 | * | Hideki_ quit (Remote host closed the connection) |
13:33:33 | * | kungtotte_ joined #nim |
13:34:21 | * | Hideki_ joined #nim |
13:34:40 | FromDiscord | <Clyybber> Zevv: sneak in an os:sanic alias |
13:35:25 | Zevv | Sanic (the Hedgehog)? |
13:36:40 | FromDiscord | <Clyybber> yeah |
13:38:24 | FromDiscord | <gingerBill> @treeform I have am article on that: https://www.gingerbill.org/article/2018/09/05/exceptions-and-why-odin-will-never-have-them/ |
13:38:28 | FromGitter | <sheerluck> https://github.com/huge-success/sanic |
13:38:53 | * | Hideki_ quit (Ping timeout: 258 seconds) |
13:39:20 | narimiran | Zevv: i see you're the xkcd fan :) |
13:39:33 | * | marmotini_ quit (Remote host closed the connection) |
13:39:59 | * | marmotini_ joined #nim |
13:40:16 | Zevv | you are *what*? |
13:40:48 | FromDiscord | <gingerBill> To add the article, exceptions are good in dynamic languages because of the lack of static typing. They add a way of doing a "switch" statement on types. |
13:40:52 | * | marmotini_ quit (Read error: Connection reset by peer) |
13:40:59 | * | marmotini_ joined #nim |
13:41:00 | narimiran | Zevv: today's comic https://xkcd.com/ |
13:41:26 | FromDiscord | <gingerBill> "good" is the wrong term but more of a the least worse compromise |
13:41:29 | Zevv | nah, it is just my hobby: whenever I mention anyone called "<name> the <x>", I put "The <x>" in parentheses, like I added it as a clarification |
13:41:54 | narimiran | :P |
13:43:37 | Zevv | can anyone verify if http://ix.io/26W0 crashes on devel? |
13:44:30 | narimiran | Zevv: prints "caught" on the playground with the latest devel: https://play.nim-lang.org/#ix=26W1 |
13:45:45 | Zevv | yeah I tested playground as well |
13:45:46 | Zevv | thus my confusion |
13:47:37 | * | rockcavera quit (Ping timeout: 265 seconds) |
13:47:37 | FromGitter | <IamRifki> Advice on doing Composition in Nim? |
13:47:56 | FromGitter | <IamRifki> All the examples I saw are about inheritance |
13:48:14 | FromGitter | <mratsim> just use proc |
13:48:41 | FromGitter | <IamRifki> wdym? |
13:49:11 | FromGitter | <mratsim> foo().bar().baz() |
13:49:19 | FromGitter | <mratsim> function calls compose naturally |
13:49:25 | FromGitter | <IamRifki> Oh |
13:49:26 | FromGitter | <IamRifki> I see |
13:50:42 | Zevv | well. I compile this snippet in /tmp and it crashes. I compile it somewhere else and it doesn't. \o/ |
13:52:12 | Zevv | well there was a nim.cfg in the dir wher it *didn't* crash :( |
13:52:51 | * | ng0_ joined #nim |
13:52:51 | * | ng0_ quit (Changing host) |
13:52:51 | * | ng0_ joined #nim |
13:54:59 | * | ng0 quit (Ping timeout: 258 seconds) |
13:56:35 | FromGitter | <gogolxdong> Someone saw https://www.youtube.com/watch?v=8SoJR3sCaR4 ? |
13:57:33 | disruptek | Zevv: wut |
13:59:31 | FromDiscord | <Rika> im almost done watching the whole thing |
14:00:27 | FromDiscord | <Rika> i liked the C++ discussion portion but it felt like an advertisement to me, i dont know, im prolly being unreasonable |
14:00:33 | * | nsf joined #nim |
14:02:58 | FromDiscord | <Rika> ok at the qna, the talk improved massively during the C++ discussion, i like it, very nice talk |
14:03:15 | PMunch | narimiran, "latest" on the playground is not devel |
14:03:21 | PMunch | It is the latest tagged version |
14:03:21 | narimiran | PMunch: oh! |
14:03:52 | * | rockcavera joined #nim |
14:04:01 | Zevv | disruptek: no clue, still hunting |
14:04:16 | * | Hideki_ joined #nim |
14:05:18 | * | thomasross quit (Ping timeout: 260 seconds) |
14:06:02 | * | floppydh quit (Quit: WeeChat 2.6) |
14:07:55 | PMunch | Hey, he's using my protobuf package :) |
14:08:50 | Zevv | yay, you got a user, congrats! |
14:08:58 | PMunch | Haha |
14:09:15 | PMunch | I'm also surprised about the amount of people who seem to use `dumpAstGen` |
14:10:14 | FromDiscord | <Rika> your protobuf package is pretty good though so its no surprise he presented it |
14:10:23 | Araq | gingerBill: well "Exceptions require unwinding the stack; this is much slower when an exception happens compared to the fixed small cost of a return value." is objectively false |
14:10:36 | FromGitter | <onqtam> I'll greatly appreciate any feedback on what to improve in the talk, since I'll probably be giving it at least once more in 2020 |
14:11:11 | disruptek | i'm just scanning through this video at 2x, but it seems like the best intro to nim that i've seen boiled down to 1hr. |
14:11:15 | PMunch | Rika, thanks :) Haven't actually used it much myself |
14:11:54 | PMunch | onqtam, cool talk, but you sound a bit stressed to begin with (goes very fast) |
14:12:00 | Zevv | arrrgh. There was a fake setjmp.h in my /tmp which got included :) |
14:12:35 | FromGitter | <onqtam> well it was an awful lot of content to go through in 1 hour... I always push it too far. I don't know what to cut out of it :| |
14:12:39 | PMunch | I'm at about 28m in now, and you've slowed down considerably to a more comfortable pace |
14:12:51 | PMunch | Yeah that's always the hard part! |
14:13:00 | disruptek | it's hard, no doubt. |
14:13:46 | Araq | "One βadvantageβ many people like with exceptions is the ability to catch any error from a block of code" that's also wrong, the virtue of exceptions that they enable function composition |
14:14:12 | disruptek | let's talk when #11081 works. |
14:14:13 | disbot | https://github.com/nim-lang/Nim/issues/11081 -- 3DateTime field on Exception produces inconsistent C/++ handling ; snippet at 12https://play.nim-lang.org/#ix=20PX |
14:14:26 | Araq | you can dislike exception all day long, I don't mind, I personally don't like it either. |
14:14:39 | PMunch | Some nitpick, you say that procedures are functions in Nim. Which makes sense in a C++ context, but Nim also has functions (with the `func` keyword), they are just closer to what a functional language would call a function. And you mention that parenthesis are optional when calling, but you don't mention the universal call syntax |
14:14:47 | * | thomasross joined #nim |
14:14:51 | Araq | but I dislike false statements even moreso. |
14:14:58 | disruptek | i dislike it as much as i dislike anything that introduces three different behaviors from one piece of code. |
14:15:41 | disruptek | believe me, i wouldn't have created the ticket if i wasn't trying to use exceptions. i wouldn't have tried to use exceptions if i didn't think they had a place. |
14:15:51 | PMunch | I had some more nitpick as well, but I've forgotten it :P |
14:16:40 | FromGitter | <onqtam> I think I do mention UCS at slide 8: https://slides.com/onqtam/hello_nim#/8 |
14:16:51 | FromDiscord | <mratsim> coming soon, Araq removes "when false" from the language as it's a false statement |
14:17:17 | FromDiscord | <Rika> lmao |
14:17:27 | FromDiscord | <Rika> araq removes bools as they allow for false statements |
14:18:07 | Araq | "This means that the culture of pass the error up the stack for βsomeone elseβ to handle. I hate this culture ..." this is not a "culture" thing, you can count how often you *have to* pass the error up and can make it the default action. I thought programming is about automation. |
14:18:36 | PMunch | onqtam, oh yeah you do mention that func(obj) == obj.func() |
14:19:06 | PMunch | I forgot about that, maybe a throwback to that when you mention that func(obj) == func obj |
14:19:46 | Araq | disruptek, I have a fix for that in the works (finally!) |
14:19:57 | disruptek | nice. |
14:20:01 | Araq | but supporting 2 or 3 different exception implementations is costly... |
14:20:40 | disruptek | sadly, it's a cost every programmer has to bear if they want people to be able to use their exceptions on 3 different implementations that yield different behavior. |
14:20:54 | FromDiscord | <treeform> @gingerBill thank you for the link! |
14:23:20 | FromDiscord | <Clyybber> One can think of `raise e` as `result.exc = e; return e` no? |
14:23:37 | * | thomasross quit (Ping timeout: 268 seconds) |
14:23:39 | FromDiscord | <Clyybber> So its completely equivalent? |
14:23:45 | Araq | Clyybber: exactly |
14:23:58 | FromDiscord | <Clyybber> s / return e / return |
14:24:22 | Araq | there is an isomorphism to 'return' (and indeed I don't like 'return' either) |
14:24:36 | FromDiscord | <Clyybber> Its bail-out-control-flow |
14:24:41 | Araq | (but I'm not removing it from Nim) |
14:25:21 | FromDiscord | <gingerBill> @treeform No problem. |
14:25:57 | * | thomasross joined #nim |
14:26:13 | FromDiscord | <Clyybber> So `try except` could be thunk of as a macro that checks every call in a body for an .exc in its result |
14:26:37 | FromDiscord | <treeform> well an parent functions too |
14:26:42 | FromDiscord | <treeform> all the way up to main |
14:26:59 | FromDiscord | <Clyybber> So theoretically we could try to unify Result[T] and exceptions |
14:27:32 | FromDiscord | <treeform> its like each function can returns 2 things result and and exception and everyone everywhere checks for them |
14:27:40 | FromDiscord | <Clyybber> yeah |
14:27:56 | FromDiscord | <treeform> I like exceptions in scripts that are meant to be used only once in a while |
14:28:23 | FromDiscord | <treeform> at my day job, Data Analysis, stuff that happens a ton. |
14:29:06 | FromDiscord | <Clyybber> What I wonder about, is what is faster, exceptions or result |
14:29:10 | FromDiscord | <treeform> soo many one off scripts |
14:29:21 | FromDiscord | <mratsim> We can keep Result and Exceptions, Result makes sense in places were you a failure is normal (user input) |
14:30:35 | FromDiscord | <treeform> @gingerBill I like your Memory Allocation Strategies 1-4 reading now. |
14:31:39 | FromDiscord | <mratsim> Ha, I knew I knew this @gingerBill name, it was from Odin |
14:33:45 | * | Hideki_ quit (Remote host closed the connection) |
14:34:02 | * | thomasross_ joined #nim |
14:34:02 | * | thomasross quit (Killed (livingstone.freenode.net (Nickname regained by services))) |
14:34:02 | * | thomasross_ is now known as thomasross |
14:34:23 | * | Hideki_ joined #nim |
14:35:23 | FromDiscord | <treeform> I met @gingerBill face to face at Handmade con in Seattle. He seemed cool. |
14:36:46 | * | floppydh joined #nim |
14:37:13 | FromDiscord | <gingerBill> Thank you π |
14:37:42 | FromDiscord | <gingerBill> I need to upload Part 5, the most technical of the series, explaining virtual memory and how it works and how to use it. |
14:38:30 | * | ng0_ is now known as ng0 |
14:39:28 | * | Hideki_ quit (Ping timeout: 268 seconds) |
14:45:04 | FromDiscord | <gingerBill> Regarding exceptions, as my article points out, my issue is not with how they are implement (even if unwinding the stack is not great), but how to use them. Handling "errors" ought to be just the same as handling any other code. I don't like languages that treat "error values" as special in terms of either exceptions (`Exception`) or error types (`error`) |
14:46:49 | PMunch | onqtam, not really your fault, but some of the questions could be answered better :P |
14:47:57 | FromGitter | <onqtam> couldn't agree more :D β it doesn't help that I'm not active around Nim. Any specific corrections? I'll probably get asked similar things in the future |
14:48:55 | FromDiscord | <treeform> @gingerBill its a valid view point. Thank you for the article. |
14:48:57 | FromDiscord | <mratsim> @gingerBill, for your pool allocator article, the "free" does not need to have the pool as argument if you align the pool to power of 2, and the backing buffer is intrusive. |
14:48:57 | FromDiscord | <mratsim> Then you can just modulo the alignment to get the pool data structure head |
14:49:21 | FromDiscord | <mratsim> this way you have the same API as malloc/free |
14:49:41 | PMunch | onqtam, hold on, I'll have to rewatch it |
14:49:57 | FromDiscord | <treeform> @mratsim, I think he was following his allocator API |
14:50:01 | FromDiscord | <treeform> which other allocators share |
14:50:58 | FromDiscord | <gingerBill> @mratsim The backing buffer is intrusive but useful in many cases. I usually make it a switchable thing, keep it on during development and see what is "leaking". As for the power of two thing, that is true. My pool was mainly the show the logic rather than make something efficient. |
14:52:33 | * | thomasross quit (Ping timeout: 260 seconds) |
14:54:28 | Araq | gingerBill: well I no interest in your excuses. you claimed exceptoin handling is slower than return values but since you can map exception handling to return values it's objectively false. |
14:58:08 | * | thomasross joined #nim |
14:58:39 | Araq | there are enough valid reasons to exclude exception handling from a language, you don't have to make up falsehoods |
14:58:52 | FromDiscord | <gingerBill> That's not what I meant. |
14:58:55 | FromDiscord | <treeform> hmm looking at the {.noSideEffect.} I wonder if its possible to create something like {.noLeaks.} or {.noObjectsEscape.} pragma, in the --gc:arc world that can make sure that no heap allocated objects can leak out, so everything that had a sink/lent pair is accounted for. |
14:59:16 | FromDiscord | <gingerBill> Zig (another language) has pretty much exception-like behaviour but by returning the error code as part of the type system. |
14:59:33 | FromDiscord | <gingerBill> It's a clever approach and pretty much the best approach _iff_ you want exception-like error handling. |
15:00:02 | Araq | it's largely the same as Java's checked exceptions or Nim's exception tracking |
15:00:20 | FromDiscord | <gingerBill> So I am not sure what "falsehoods" I am making up you speak of. |
15:00:51 | FromDiscord | <treeform> falsehood: exceptions are slower then return values? |
15:01:05 | Araq | I quoted the sentences from your article. |
15:05:09 | FromDiscord | <gingerBill> Exception handling in most implementations is slower. Trampolines and stack unwinding is not free. |
15:05:09 | FromDiscord | <gingerBill> |
15:05:09 | FromDiscord | <gingerBill> Encoding it in the return value is not the same as what most people commonly mean by "exceptions". |
15:05:52 | Araq | there are different implementation strategies to do it, what "people commonly mean" is irrelevant to me. |
15:06:04 | FromDiscord | <treeform> onqtam, I don't know if you are taking criticism, I really dig the slides, but on https://slides.com/onqtam/hello_nim#/22 I think the title() and the p() ... the () could go a way just like you do with p "Example" to make it look cleaner. |
15:06:17 | Araq | I would expect that commonly they don't know the implementation at all. |
15:06:34 | FromDiscord | <gingerBill> Araq: ignoring the "common meaning" is irrelevant to me π |
15:07:16 | Araq | when you just made it up, then yes. |
15:08:40 | FromDiscord | <gingerBill> Also, I didn't see your quote of my text. I was sorry about that. It got lost in the messages. |
15:08:52 | Araq | https://swtch.com/~rsc/regexp/regexp1.html "Regular Expression Matching Can Be Simple And Fast |
15:08:52 | Araq | (but is slow in Java, Perl, PHP, Python, Ruby, ...)" |
15:09:07 | FromGitter | <onqtam> treeform, ofc I take criticism - I'll collect a bunch of such notes for changes to apply to the slides for the future. |
15:09:18 | Araq | so now what? it is common knowledge that regexes are slow? |
15:09:28 | Araq | should we all avoid regexes because of that? |
15:09:33 | disruptek | is it normal for my object initialization to zero memory twice? just two redundant nimZeroMem calls on the same addresses. |
15:09:45 | Zevv | Noo, we move to NPeg instead! |
15:09:48 | Araq | disruptek, yeah and it's optimized away, I checked it |
15:09:53 | disruptek | okay. |
15:09:54 | FromDiscord | <gingerBill> You are arguing about the abstract idea of exceptions rather than the implementation. |
15:10:09 | FromDiscord | <gingerBill> Zig, is a brilliant example of "exceptions" done correctly, in my opinion. |
15:10:29 | FromDiscord | <gingerBill> My issue is that I don't like the "unstructured" (wrong term) nature of exceptions. |
15:10:42 | Araq | *shrug* in my opinion Swift got it right. |
15:11:08 | Araq | and Nim of course :P |
15:11:28 | FromDiscord | <gingerBill> Of course π |
15:11:36 | * | Hideki_ joined #nim |
15:11:40 | FromDiscord | <gingerBill> Nim's approach is very good. |
15:11:46 | FromDiscord | <gingerBill> If you like that kind of thing. |
15:12:01 | * | ng0_ joined #nim |
15:12:01 | * | ng0_ quit (Changing host) |
15:12:01 | * | ng0_ joined #nim |
15:12:48 | shadowbane | C++ is my gold standard for what exceptions should look like. Nim's exceptions are largely similar. |
15:13:10 | FromDiscord | <gingerBill> So my statement in my article is not "objectively false", but it does assumes a particular view of what an "exception" is and its implementation. |
15:13:34 | Araq | it's really false, sorry. |
15:13:47 | FromDiscord | <gingerBill> So unwinding the stack is fast now? |
15:14:00 | Araq | it's a 'return' either way. |
15:14:10 | Araq | is 'return' now really slow and to be avoided? |
15:14:50 | * | ng0 quit (Ping timeout: 240 seconds) |
15:14:51 | * | endragor_ quit (Remote host closed the connection) |
15:15:18 | * | thomasross quit (Killed (orwell.freenode.net (Nickname regained by services))) |
15:15:18 | * | thomasross joined #nim |
15:15:49 | shadowbane | Stack unwinding speed depends on the approach taken for stack unwinding. C++'s table based stack unwinding is slow because it is pessimized to optimize the non-throwing case. Implementations that don't assume non-throwing and optimize for that are much faster for the throwing case, but slow down the non-throwing case a bit. |
15:16:25 | Araq | and they slow it down by that 'bit' that you otherwise do manually. |
15:17:57 | shadowbane | I'm pretty sure that people have put together benchmarks and C++ exceptions are slower than if checks and returns if you have lots of throws, but if you don't have errors the code using exceptions will be faster than the manual if/return error checking code. |
15:17:57 | FromDiscord | <gingerBill> Would you be happier if I made a caveat that "most implementations of exceptions are slow"? My issue is that of the languages that implement exceptions, very few implement it in the basic approach you are talking about. |
15:18:14 | FromDiscord | <gingerBill> In theory, a stack unwind should be fast as N-returns. |
15:18:57 | Araq | well as it happens, Nim got a faster implementation, C++ is getting one too, Swift already has one and Java and C# always were good at it iirc |
15:19:42 | shadowbane | gingerBill: Why? Should the compiler not optimize for what it can recognize as the hot path (the non-error case) if it means that the cold path is slower? |
15:21:25 | Araq | gingerBill: but I'll be happy indeed if you fix your article |
15:22:15 | PMunch | onqtam, my replies to the questions you were asked: http://ix.io/26WD |
15:22:36 | Araq | we already have enough new languages that lack exceptions or automatic memory management just because LLVM happens not to ship with it and both are somewhat hard to implement (but then so is a good register allocator) |
15:22:39 | * | PMunch quit (Quit: Leaving) |
15:22:55 | FromGitter | <onqtam> PMunch, much appreciated, will use in the future :) |
15:23:07 | * | marmotini_ quit (Remote host closed the connection) |
15:24:27 | Araq | (but LLVM has a register allocator so I don't get to read articles like "why X will make you do your own register allocation and it'll make your systems more reliable") |
15:25:52 | disruptek | ~intro is C++ as Assembly 2.0; one of the better Nim introduction talks, by Viktor Kirilov at code::dive 2019: https://invidio.us/embed/8SoJR3sCaR4 (~1hr) |
15:25:53 | disbot | intro: 11C++ as Assembly 2.0; one of the better Nim introduction talks, by Viktor Kirilov at code::dive 2019: https://invidio.us/embed/8SoJR3sCaR4 (~1hr) |
15:26:25 | Zevv | that's what *you* say. I find it overly dense and on the chaotic side. |
15:26:26 | FromDiscord | <treeform> onqtam, about "Q: Can you introduce Nim gradually?" I would add js and make it C/C++/JS. I been gradually eating my large JS app by replacing it with nim (js compiled) functions. |
15:28:41 | FromGitter | <onqtam> btw on the exceptions debate - have you come across this post? β http://nibblestew.blogspot.com/2017/01/measuring-execution-performance-of-c.html |
15:30:02 | * | Hideki_ quit (Ping timeout: 240 seconds) |
15:31:59 | disruptek | okay, i think i know what this arc bug is. |
15:32:06 | disruptek | here's my theory: |
15:32:52 | Araq | onqtam: I remember reading it |
15:32:56 | Araq | but thanks for sharing |
15:34:43 | disruptek | i think the problem is that we're assuming that we can scribble on sunk iterator variables, but maybe my c data is clashing with that assumption somehow. |
15:37:07 | Zevv | disruptek: do you have something small failing? |
15:37:31 | disruptek | i mean, i would call it small but it's not minimal. |
15:37:39 | disruptek | gittyup test. |
15:37:52 | Zevv | share? |
15:37:58 | disruptek | !repo disruptek/gittyup |
15:38:00 | disbot | https://github.com/disruptek/gittyup -- 9gittyup: 11higher-level git bindings that build upon nimgit2 15 0β 0π΄ |
15:38:32 | FromDiscord | <Clyybber> disruptek: I think I know your bug |
15:38:32 | Zevv | "Error: Exception raised during nimble script execution" ? |
15:38:45 | FromDiscord | <Clyybber> Or reasons for your bug |
15:39:01 | disruptek | the iterator yields Result[ValueType, ErrorType] and my value type os an object that holds a ptr to a c-alloc'd c struct. |
15:39:13 | disruptek | clyybber: do tell. |
15:39:23 | FromDiscord | <Clyybber> x = a[i]; inc i; a[i] = y |
15:39:34 | FromDiscord | <Clyybber> here those two statements are wrongly sinked |
15:39:36 | FromDiscord | <gingerBill> Dwarf |
15:39:36 | FromDiscord | <gingerBill> SJLJ,SEH |
15:39:54 | FromDiscord | <gingerBill> Ignore that random thing |
15:39:54 | FromDiscord | <Clyybber> well for the first one its wrong |
15:40:19 | Araq | clyybber: can we get a bugfix for that that is not part of your refactorings? |
15:40:25 | FromDiscord | <Clyybber> it is part |
15:40:26 | * | thomasross quit (Ping timeout: 240 seconds) |
15:40:30 | FromDiscord | <Clyybber> oh |
15:40:40 | FromDiscord | <Clyybber> umm, kinda tricky |
15:40:56 | FromDiscord | <Clyybber> because its not enough to patch isAnalysableFieldAccess |
15:41:07 | FromDiscord | <Clyybber> it also affects firstWrite analysis |
15:41:19 | Araq | ok |
15:41:55 | Araq | gingerBill: that's like saying regexes are slow because of Perl |
15:43:51 | FromDiscord | <mratsim> Is there a way in macros to know if LHS will be returned? |
15:43:51 | FromDiscord | <mratsim> I need to know that to improve allocation on stack/heap of my futures/flowvars. |
15:44:27 | Araq | what do you mean? |
15:44:48 | Araq | macros cannot go up in the AST |
15:45:05 | disruptek | pretty sure he knows this. π |
15:45:16 | Araq | indeed |
15:45:56 | FromDiscord | <mratsim> let's say we have "let foo = spawn(myFunc(a, b, c)) |
15:45:56 | FromDiscord | <mratsim> foo will be a flowvar for the result of myFunc |
15:45:56 | disruptek | he wants a hint. i guess it might not be that hard to provide, but it could later be wrong due to evaluation of the ast post-macro. |
15:46:08 | disruptek | so i don't think it makes sense as a feature. |
15:46:24 | FromDiscord | <mratsim> but I need to know if foo will outlive the current scope or not |
15:46:33 | disruptek | welcome to the party. |
15:46:46 | Araq | mratsim: I used 'parallel' + spawn for that |
15:47:06 | FromDiscord | <mratsim> well parallel is a magic, and spawn too so I can't use them |
15:47:11 | Araq | and so I know inside 'parallel' there is a join at the end and nothing outlives |
15:47:30 | FromDiscord | <mratsim> ah |
15:47:33 | FromDiscord | <mratsim> I see |
15:47:34 | Araq | of course you cannot use them, but you can reimplement them |
15:47:37 | disruptek | that's clever. |
15:48:03 | FromDiscord | <mratsim> so parallel is just a named block that define something that tells spawn that nothing will escape? |
15:48:28 | disruptek | ~nimcache is the best way to figure out where it is located is to specify that location with --nimcache |
15:48:28 | disbot | nimcache: 11the best way to figure out where it is located is to specify that location with --nimcache |
15:49:04 | FromDiscord | <mratsim> well, I guess it's simpler for me to always allocate them on the heap, or just say that futures/flowvars cannot escape the spawning function. |
15:49:30 | FromDiscord | <mratsim> and maybe relax that later when there are escape analysis |
15:49:33 | FromDiscord | <gingerBill> Araq: I think how we view the world is quite different. "X is not hypothetically slow, but the vast majority of real world implementations of X are slow" My first question is "why was it implemented the way it was and not a faster way?". My second question is "what is the cost to implementing it the faster way?". My third question is "if the implementation of this instantiation of 'X' is very different to the commonly known implementatio |
15:50:03 | disruptek | error: buffer exhausted |
15:50:45 | FromDiscord | <gingerBill> I am not a big fan of these "definition fights". They just end up arguing of minute semantic things which at the end of the day is not the most productive thing. |
15:53:25 | * | ng0_ is now known as ng0 |
15:54:18 | Araq | "vast majority of real world implementations" is highly debatable but I have no desire in continuing this conversation either |
15:55:30 | Araq | so go and allocate registers manually because GCC 1.0 did it poorly, I don't care. |
15:55:56 | FromDiscord | <gingerBill> Hahaha |
15:57:19 | FromDiscord | <gingerBill> I don't agree with your analogy but okay π |
15:57:29 | * | floppydh quit (Quit: WeeChat 2.6) |
15:59:58 | * | nsf quit (Quit: WeeChat 2.7) |
16:01:01 | * | Trustable joined #nim |
16:01:26 | * | NimBot joined #nim |
16:04:41 | * | lxbarbosa quit (Ping timeout: 252 seconds) |
16:11:21 | * | marmotini_ joined #nim |
16:12:38 | disruptek | clyybber: i don't see how your bug points to my bug. |
16:13:12 | FromDiscord | <Clyybber> disruptek: I thought many of your bugs are related to iterators? |
16:13:43 | FromDiscord | <Clyybber> disruptek: maybe you don't see the a[i] but its there, in the generated code |
16:13:59 | disruptek | what does it represent? |
16:14:09 | FromDiscord | <Clyybber> array/seq access? |
16:14:22 | disruptek | these iterators aren't arrays. |
16:14:40 | * | icebattle joined #nim |
16:14:53 | FromDiscord | <Clyybber> do you never do `for e in someseq` ? |
16:15:11 | disruptek | i do, but that's not where my bug is. |
16:15:25 | FromDiscord | <Clyybber> oh, I thought you were hittin multiple bugs |
16:15:33 | FromDiscord | <Clyybber> and worked around a few |
16:15:33 | disruptek | i wouldn't rule that out. |
16:15:55 | disruptek | i've been slowly tightening everything up memory-wise to reduce my surface. |
16:16:09 | disruptek | here's my scenario: |
16:16:48 | disruptek | i have a lazy iterator that fetchings some git data (c) and wraps it in a Result and yields it. |
16:16:58 | disruptek | another lazy iterator is consuming that and yielding another Result. |
16:17:27 | disruptek | i'm trying to save the values in an array, and after adding a value to that array, i dump the array. |
16:17:44 | disruptek | after the third value is added, corruption is noticed. |
16:17:56 | FromDiscord | <Clyybber> hmm |
16:17:58 | disruptek | to render the values, i need to call into c. |
16:18:33 | disruptek | there are lots of c calls sprinkled on these iterators. |
16:20:56 | * | marmotini_ quit (Remote host closed the connection) |
16:32:07 | Zevv | I'm kind of trying to get truly minimal overhead when doing nim on small systems. Currently the biggest stuff is pulled in by the exception handling to print unhandled exceptions: some dollars, addInts. I'm now at 14K .text, 696 bytes .data and 392 bytes .bss. Does it make sense to persue this, are we *really* targeting 8 bit cpus from the 90's? |
16:32:30 | Araq | yeah we are |
16:40:10 | disruptek | i have a debug branch where there's no seq holding these objects; i still get a double free just trying to render an iterator value. |
16:40:24 | * | Hideki_ joined #nim |
16:40:27 | * | endragor joined #nim |
16:44:50 | * | endragor quit (Ping timeout: 240 seconds) |
16:45:00 | * | Hideki_ quit (Ping timeout: 265 seconds) |
16:49:26 | Zevv | Did yo mama never tell you? "Little disruptek, boi, do'nt render iterator values when theres no seqs holding objects!" |
17:03:02 | disruptek | https://github.com/disruptek/gittyup/commit/8324854adbdd58f3c03b1b27414b38154dd3c9c2#diff-3624edfe32a9fc6d2fb4d9f62f2d5aebL1430 |
17:04:14 | disruptek | the comment is misleading, actually. |
17:04:32 | disruptek | it's the gc that crashes after two iterations. |
17:07:01 | * | Vladar joined #nim |
17:12:25 | * | marmotini_ joined #nim |
17:17:44 | * | Kaivo quit (Quit: WeeChat 2.7) |
17:20:21 | * | kapzyl joined #nim |
17:20:48 | Zevv | ok, how can I reproduce? |
17:21:09 | disruptek | clone debug branch and try to run the test with and without arc. |
17:21:22 | Zevv | I can't even install nimgit2 :( ... Reading as ini file failed with: |
17:21:22 | Zevv | ... Invalid section: . |
17:21:23 | disruptek | i use --exceptions:goto in both cases to minimize disturbance. |
17:21:33 | disruptek | yes, welcome to the ecosystem. |
17:21:46 | disruptek | i'm pushing another simplification. |
17:22:49 | Zevv | the problem is in nimgit2? |
17:22:58 | Zevv | Error: Could not read package info file in /tmp/user/1000/nimble_1434713/githubcom_genotrancenimgit2/nimgit2.nimble; |
17:23:15 | disruptek | no, that's just snafu. |
17:23:36 | disruptek | don't feel you have to get this stuff working if you don't have the time. |
17:23:41 | Zevv | I have time |
17:23:47 | disruptek | but if you want to get sorted, i'm happy to help do that. |
17:23:55 | * | tane joined #nim |
17:23:55 | Zevv | and I can't stand your complaining here all the time |
17:24:00 | disruptek | lol |
17:24:15 | disruptek | the thing is, there aren't enough people bloodletting over this shit. |
17:24:15 | Zevv | well, hold my hand then: how the hell do I install nimgit2? |
17:24:20 | disruptek | are you using nimph? |
17:24:25 | Zevv | nope, not yet |
17:24:32 | disruptek | nimble install nimterop |
17:24:43 | FromDiscord | <mratsim> complain to nimble, there is a thread with 50 replies on that issue |
17:24:52 | Zevv | that will help I guess |
17:25:00 | stefantalpalaru | How can I initialise a FFI Nim object in one go, for it to work with const members in the C struct that it represents? I need something like "struct foo f = {1, 2}" but Nim generates multiple assignments instead ("struct foo f; f.bar = 1; f.baz = 2;"). This is obviously rejected by the C compiler. |
17:25:01 | disruptek | yeah, that'll help a lot. |
17:25:01 | Zevv | ok, my nimterop is old, one moment |
17:25:14 | * | abm quit (Ping timeout: 240 seconds) |
17:25:25 | * | abm joined #nim |
17:25:26 | FromDiscord | <mratsim> https://github.com/nim-lang/nimble/issues/696 |
17:25:27 | * | abm quit (Remote host closed the connection) |
17:25:28 | disbot | β₯ fails to evaluate .nimble file ; snippet at 12https://play.nim-lang.org/#ix=26Xa |
17:25:32 | Zevv | #metoo |
17:26:03 | disruptek | honestly, i just don't even bother submitting issues anymore. |
17:26:15 | disruptek | it was easier to write a new package manager. |
17:26:26 | Zevv | well, the fun I have: Prompt: Build failed for '[email protected]', would you like to try installing 'nimterop@#head' (latest unstable)? [y/N] |
17:26:33 | disruptek | hey, why not. |
17:26:46 | Zevv | failed breaking your leg, do you want to break an arm instead? |
17:26:58 | * | FromGitter quit (Read error: Connection reset by peer) |
17:27:07 | Araq | stefantalpalaru, put it into a 'const f = ...'? I am sure I don't understand the question |
17:27:17 | * | FromGitter joined #nim |
17:27:58 | disruptek | why does it say it doesn't want to build? |
17:28:06 | Zevv | course not |
17:28:19 | disruptek | lol |
17:28:34 | Araq | http://mcg.cs.tau.ac.il/papers/amir-levy-msc.pdf narimiran, Latex document detected ;-) |
17:28:35 | disruptek | i had to reparse both your response and my question. |
17:28:49 | Araq | (page 18) |
17:29:21 | disruptek | nothing will ever work if you don't have nimterop installed in ~/.nimble/pkgs |
17:29:33 | Zevv | rm -rf ~/.nimble |
17:29:55 | disruptek | you can do that, but even with nimph, you can't get around it. |
17:30:04 | disruptek | due to gentotrance/nimterop#154 |
17:30:39 | Zevv | ok that helped |
17:30:48 | Zevv | nimgit2 now also installs |
17:31:13 | stefantalpalaru | Araq, the C definition is something like "struct foo {const int bar; const int baz;}" so these const members can only be initialised all at once and never changed again. |
17:31:17 | disruptek | okay, good. |
17:32:18 | Zevv | ok, "nimble test"? |
17:32:30 | disruptek | i gues. |
17:32:36 | Zevv | /tmp/gittyup/gittyup.nim(30, 8) Error: cannot open file: results |
17:33:03 | narimiran | Araq: hahaha, classic :D |
17:33:08 | disruptek | nimble install https://github.com/disruptek/results |
17:33:27 | disruptek | i wouldn't bother with nimble test; it's verbose and designed for travis. |
17:33:35 | disruptek | just nim c -r tests/tgit.nim |
17:34:14 | disruptek | so the current situation is that if the loop loops, gc double frees on scope cleanup. |
17:34:23 | disruptek | if the loop doesn't loop, everything is fine. |
17:34:50 | Zevv | there you have it: [FATAL] unpaired dealloc |
17:34:55 | disruptek | also -d:debugGit to see some hot pointer on pointer action. |
17:35:46 | Araq | stefantalpalaru, ok well, Nim doesn't support that (yet?), we target C89 |
17:36:47 | Araq | you can usually come far when you ignore the .header business and target the ABI instead |
17:38:34 | stefantalpalaru | Not in this case. |
17:41:01 | stefantalpalaru | As an API user, I can only provide a VM by initialising this struct: https://github.com/ethereum/evmc/blob/eb64e60621cc347d6ba7d15bc7272a02ad498c7e/include/evmc/evmc.h#L855 |
17:43:54 | stefantalpalaru | "Maybe write more Nim code." :-) https://github.com/status-im/nim-libbacktrace/issues/1 |
17:43:55 | disbot | β₯ success_callback has memory leaks |
17:44:07 | stefantalpalaru | Oh, how the mighty have fallen back to C... |
17:44:23 | * | endragor joined #nim |
17:46:24 | * | kapzyl quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/) |
17:48:30 | FromGitter | <Albus70007> can somebody help me to install nimtorch? or reference me a guide different to the README one? |
17:49:27 | Zevv | disbot: not sure how much you found out yet |
17:49:39 | Zevv | disarm thing at line 574 triggers the boom |
17:50:23 | * | thomasross joined #nim |
17:50:32 | disruptek | not for me. |
17:51:31 | disruptek | what i cannot understand is that if you just break after one trip through the loop, it's fine. two trips? no beuno. |
17:51:46 | disruptek | but, disarm doesn't do anything. |
17:52:14 | Zevv | then my gdb is talking nonsense |
17:52:17 | disruptek | it's just supposed to be a semantic indication that the gc can cleanup the target; it's an `x = nil` template. |
17:54:27 | Zevv | BWAAH it makes my nvim crash. I HATE NVIM |
17:55:21 | * | Hideki_ joined #nim |
17:55:27 | * | kungtotte_ is now known as kungtotte |
17:55:44 | Zevv | ok, what gdb ment to say is the leaving the 'free()' proc triggers the crash |
17:55:48 | Zevv | disarm was simply the last statement |
17:56:03 | disruptek | what is it they say? |
17:56:09 | disruptek | leave free and die hard? |
17:56:26 | Zevv | die hard III |
17:56:32 | disruptek | die hard free() |
17:57:59 | Zevv | :) |
17:58:12 | * | nsf joined #nim |
17:59:10 | leorize | Zevv: why is your nvim keeps crashing :p |
17:59:33 | Zevv | beats me |
17:59:38 | * | Hideki_ quit (Ping timeout: 240 seconds) |
17:59:44 | Zevv | I don't have the patience to figure that out |
18:00:12 | leorize | my nvim used to crash a lot, then it stopped doing that for whatever reason :P |
18:04:24 | Zevv | GOOD FOR YOU |
18:05:04 | disruptek | i think my nvim doesn't do completion anymore. |
18:08:02 | * | tane quit (Ping timeout: 240 seconds) |
18:08:21 | Zevv | disruptek: the 'unpaired' error is thrown because of a global counter keeping track of the number of allocs alive |
18:08:36 | Zevv | the free when it throws is not necisserily the one *causing* the issue, i guess |
18:08:56 | leorize | disruptek: did you switch it to manual then forget to trigger it when you need? :p happens to me a lot |
18:10:54 | Araq | stefantalpalaru, well as a last resort there is always .emit |
18:14:18 | * | abm joined #nim |
18:19:22 | stefantalpalaru | Yeah. |
18:19:51 | * | Trustable quit (Remote host closed the connection) |
18:20:36 | nisstyre | is there a reason the terminal package doesn't include a proc to get the cursor position? Too hard to make it cross-platform? |
18:24:34 | FromGitter | <Albus70007> how do i set my exe to receive some args: (-port) |
18:24:55 | FromDiscord | <mratsim> @Albus70007, the easiest way to install nimtorch is probably through conda |
18:25:09 | FromDiscord | <mratsim> for command-line arguments |
18:25:12 | FromDiscord | <mratsim> !repo cligen |
18:25:13 | disbot | https://github.com/c-blake/cligen -- 9cligen: 11Nim library to infer/generate command-line-interfaces 15 136β 10π΄ 7& 1 more... |
18:25:18 | FromDiscord | <mratsim> !repo confutils |
18:25:19 | disbot | https://github.com/status-im/nim-confutils -- 9nim-confutils: 11Simplified handling of command line options and config files 15 10β 1π΄ |
18:28:07 | FromGitter | <Albus70007> Thank you, i will insist because now its really possible, if someone wants to make rocket league bots (soon even in nim :D) go to rlbot.org |
18:29:44 | FromDiscord | <mratsim> so people are using Torch to train their bots? |
18:30:39 | FromGitter | <Albus70007> yes, there is a whole framework and community, torch was something i was hoping to learn while i learned nim and developed my bot |
18:31:07 | FromGitter | <Albus70007> ML is still not as good as hardcoded bots because of the difficulty of such a task |
18:31:43 | FromDiscord | <mratsim> I still need to finish my pong/space-invaders bot :/ |
18:32:59 | FromGitter | <Albus70007> well, we love newcomers, so you ever want to come, you already know where to find us |
18:33:14 | FromDiscord | <mratsim> if you are looking for some ideas, I suggest you download OpenAI-Gym + the Atari module |
18:33:34 | FromDiscord | <mratsim> let me ready Arraymancer for reinforcement learning first and then I'll play :p |
18:33:51 | FromDiscord | <mratsim> reinforcement learning on GPU* |
18:34:08 | FromDiscord | <Chiqqum_Ngbata> People still use Torch? |
18:34:16 | FromGitter | <Albus70007> i am not using torch yet, i am going for a hardcoded bot for now... |
18:34:24 | FromGitter | <Albus70007> oh, they do |
18:34:39 | FromDiscord | <Chiqqum_Ngbata> I was under the impression that everyone moved to Pytorch |
18:34:43 | FromDiscord | <mratsim> well, I said Torch but here it's libtorch |
18:35:06 | FromGitter | <Albus70007> well, by torch i meant Pytorch and C++torch |
18:35:16 | * | golechwi quit (Ping timeout: 248 seconds) |
18:35:29 | FromGitter | <Albus70007> i am the only Nim programmer in there and the only Boolang programmer also |
18:35:29 | FromDiscord | <mratsim> actually nimtorch uses raw ATen not even libtorch |
18:38:07 | Zevv | Im kind of lost disruptek |
18:38:42 | shashlick | Zevv: what version of nimble do you have |
18:39:04 | Zevv | no idea, my laptop batery just died |
18:39:25 | * | mv34 joined #nim |
18:40:23 | * | mv34 quit (Remote host closed the connection) |
18:41:59 | shashlick | okay, will help to know what version of nim/nimble, OS |
18:45:56 | * | thomasross quit (Ping timeout: 258 seconds) |
18:48:51 | * | Ven`` joined #nim |
18:48:53 | Zevv | sure |
18:58:39 | * | golechwi joined #nim |
19:03:13 | disruptek | i think i fixed it. omg was it stupid. |
19:05:06 | Zevv | tell me |
19:05:35 | Zevv | i was just about to grok your code when my computer hibernated |
19:06:19 | disruptek | nope, i'm dumb. |
19:06:38 | disruptek | i thought i was mixing use of cloned and repo; one is the repo we cloned, one is the repo we're sitting in. |
19:06:42 | disruptek | but, that wasn't it. |
19:06:42 | FromDiscord | <treeform> Albus70007, I did some Boolang in Unity. |
19:06:59 | Zevv | if you dont tell me, your git logs will |
19:07:03 | Zevv | try to hide that |
19:07:10 | disruptek | i'll try. |
19:07:29 | disruptek | even without freeing, walking isn't working. |
19:09:22 | disruptek | damn, i was sure it was simple. |
19:10:14 | * | marmotini_ quit (Remote host closed the connection) |
19:11:17 | Zevv | so not solved? |
19:11:27 | disruptek | no. |
19:11:30 | disruptek | but i have an idea. |
19:11:30 | Zevv | dang |
19:11:58 | disruptek | i'm diffing the two c outputs. |
19:12:36 | disruptek | i think i do have it, actually. |
19:12:54 | Zevv | is it you or is it nim |
19:13:06 | Araq | bikeshed ahead https://github.com/nim-lang/Nim/pull/13092 |
19:13:07 | disbot | β₯ added operateOn to sugar.nim to give Nim the chaining mechanism it deβ¦ |
19:13:10 | Zevv | the suspense is *killing* me |
19:13:29 | Araq | I probably got it completely wrong but it's to start an implementation |
19:14:03 | * | nsf quit (Quit: WeeChat 2.7) |
19:15:25 | Zevv | i think i hate it, but i cant find a good reason why |
19:15:33 | disruptek | jeeze, i guess i don't know after all. this is crazy. |
19:16:04 | disruptek | arc is running my free() on a copy of the var that --gc:default frees. |
19:16:06 | Zevv | disruptek: refsv2 or whatever its called has tracing built in with some -d, enabled that yet? |
19:16:08 | disruptek | why would it matter... |
19:16:23 | disruptek | no, i haven't bothered to lookup gc flags. i know that's dumb. |
19:17:15 | Zevv | its not that big, you dont have echo in that file but yiu can do c_printf |
19:17:46 | Zevv | thats is where that funny global counter is |
19:18:07 | disruptek | originally, i thought it was as simple as nim trying to free a ptr i alloc'd (and already freed) in c-land. |
19:18:27 | Zevv | I think I saw it goes wrong early. The crash comes after 4 loop iteratios for me, but in the first iteration i alreadt saw a double free i thinj |
19:18:40 | disruptek | yeah, i'm able to do four loops. |
19:18:45 | Zevv | but to be honest, I do not understand what you are doing yet |
19:18:56 | disruptek | maybe what i'm doing with oid is confusing arc. |
19:19:11 | Araq | do we have something easily reproduced? |
19:19:21 | Zevv | pretty easy |
19:19:29 | Zevv | clone some repos and run a nim c somethig |
19:19:30 | disruptek | i mean, it's easy for people with their feet in the ecosystem. |
19:19:36 | disruptek | not so easy for compiler devs. |
19:19:40 | Zevv | haha |
19:20:05 | FromGitter | <timotheecour> @araq quick question: styleCheck and `nim βfullhelp` disagree: is the correct thing passC or passc ? passL or passl ? not that i care but some code is broken and iβd like to change it only once |
19:20:45 | disruptek | i should look at generated c more; it's still pretty opaque to me. |
19:22:04 | FromDiscord | <Clyybber> "easy" |
19:22:10 | Zevv | --embedsrc helps sometimes disruptek |
19:22:34 | disruptek | yeah, i know i've used this stuff before and for some reason i'm just being stupid on this bug. |
19:23:11 | Zevv | if stuff fails I often fall down to the c level completely. run nim once and from then on bughunt in .nimcache |
19:23:16 | FromDiscord | <Clyybber> Araq: Afaict its the same as inserting a few outplaces |
19:23:24 | disruptek | that's a little better. |
19:23:24 | FromDiscord | <Clyybber> So maybe it should use outplace |
19:23:28 | * | xet7 quit (Remote host closed the connection) |
19:24:02 | * | icebattle quit (Quit: leaving) |
19:24:07 | Araq | timotheecour: canonPragmaSpelling does not list passC/L so the spelling is 'passc' and 'passl' |
19:24:22 | Araq | if in doubt, styleCheck is correct |
19:24:22 | * | marmotini_ joined #nim |
19:24:28 | * | xet7 joined #nim |
19:26:52 | disruptek | i'm starting to wonder if it's not unittest that is complicating this. |
19:27:19 | FromGitter | <timotheecour> ok thx; and while weβre at it, i supposed styleCheck could also have a say for things like `defined(js)` etc (ref: https://github.com/nim-lang/Nim/pull/13069#discussion_r364575791) |
19:27:20 | disbot | β₯ System cleanup, part 1 |
19:27:58 | Araq | I think that's just an oversight given how special-cased 'defined' is |
19:29:02 | FromGitter | <timotheecour> btw would u support introducing scoped define (precise semantics TBD) but in short: allows `defined(myproj.myFlag)` |
19:29:41 | disruptek | no, it's not unittest. |
19:29:42 | FromGitter | <timotheecour> (I meant namespaced, not scoped) |
19:30:56 | Zevv | disruptek: just minimize and throw it over the wall to araq |
19:31:06 | FromDiscord | <Clyybber> timotheecour: What for? |
19:31:06 | disruptek | yeah, i'm closing in on it. |
19:32:07 | FromGitter | <timotheecour> would encourage ppl to namespace their custome defines instead of polluting global namespace, eg : `defined(mypkg.debug)` is not gonna clash but `defined(debug)` is definitely likely to clash |
19:32:40 | * | Hideki_ joined #nim |
19:32:47 | FromGitter | <timotheecour> (and would be same thing w strdefine, intdefine, booldefine) |
19:32:51 | disruptek | why the heck is it calling disarm? |
19:34:28 | Zevv | disarm is nothing, its just x = nil to tell the gc it can clean things up |
19:34:48 | Zevv | someone once told me |
19:35:01 | disruptek | lol |
19:36:02 | disruptek | i think it might be an --embedsrc defect. |
19:36:33 | Zevv | enjoying yourself, are you? |
19:36:40 | disruptek | it's pretty great. |
19:37:18 | Zevv | my day in alloc and friends was also great |
19:37:33 | * | Hideki_ quit (Ping timeout: 265 seconds) |
19:37:41 | Araq | scoped defines? do we have so many of them? |
19:37:59 | Araq | I think prefixes serve us well for the time being |
19:38:19 | FromDiscord | <Clyybber> yeah |
19:38:20 | Araq | esp since there is declared(module.symbol) |
19:38:27 | FromDiscord | <Clyybber> namespaces are just prefixes with a dot |
19:48:16 | * | thomasross joined #nim |
19:51:20 | * | tane joined #nim |
19:52:14 | FromGitter | <timotheecour> > *<Araq>* scoped defines? do we have so many of them? β β we have 363 unique defined symbols. Just for nim repo. β β https://gist.github.com/timotheecour/8b2286478083a6068731a63114ee9dd0 [https://gitter.im/nim-lang/Nim?at=5e17846ea74ac853777f9c32] |
19:54:12 | FromGitter | <timotheecour> things like `defined(testing)` are likely to clash; namespaces is simple, obvious way to deal with that |
20:00:47 | FromGitter | <timotheecour> (not sure how `declared(module.symbol)` helps with currentl lack of `defined(module.symbol)`; declared doesnβt work with a defined symbol) |
20:05:43 | FromDiscord | <mratsim> Gotta love C++ deleting functions under your feet |
20:05:47 | FromDiscord | <mratsim> |
20:05:47 | FromDiscord | <mratsim> https://cdn.discordapp.com/attachments/371759389889003532/664922792147550250/unknown.png |
20:06:49 | * | zyklon quit (Remote host closed the connection) |
20:07:10 | * | zyklon joined #nim |
20:11:10 | FromDiscord | <demotomohiro> I think it is actually not deleting, but not generating operator= which is automatically generated in default for classess/structs. |
20:16:30 | * | Vladar quit (Quit: Leaving) |
20:17:52 | FromDiscord | <demotomohiro> C++ lang automatically generate copy constructor or operator= for class/struct. But if you dont want them, you declare them with `delete` keyward. |
20:21:57 | FromDiscord | <mratsim> Here it's saying: tyObject_PledgeImpl__Vo57D64UViVBWyaz9c9bgMJQ::operator=(const tyObject_PledgeImpl__Vo57D64UViVBWyaz9c9bgMJQ&)β is implicitly deleted because the default definition would be ill-formed |
20:22:41 | * | marmotini_ quit (Remote host closed the connection) |
20:23:23 | FromDiscord | <Clyybber> timotheecour: Namespacing won't change anything here |
20:23:38 | FromDiscord | <Clyybber> its exactly the same as a prefix, just with a dot |
20:24:09 | FromDiscord | <Clyybber> but since you don't get an error for typos like modul.esymbol there is literally no advantage |
20:24:48 | FromGitter | <Clyybber> @timotheecour ping |
20:25:52 | FromDiscord | <mratsim> ah, managed to reproduce, somehow it's coming from a typedesc bug |
20:26:01 | * | lxbarbosa joined #nim |
20:26:39 | FromDiscord | <demotomohiro> I think tyObject_PledgeImpl has a uncopyable member variable (class with operator= deleted) or reference and cannot generate default operator=. |
20:27:57 | * | icebattle joined #nim |
20:28:09 | * | marmotini_ joined #nim |
20:30:04 | * | thomasross quit (Remote host closed the connection) |
20:34:37 | FromDiscord | <mratsim> here you go: https://github.com/nim-lang/Nim/issues/13093 |
20:34:39 | disbot | β₯ C++ Atomics: is implicitly deleted because the default definition would be ill-formed ; snippet at 12https://play.nim-lang.org/#ix=26Y8 |
20:37:06 | * | icebattle quit (Ping timeout: 258 seconds) |
20:37:24 | FromDiscord | <demotomohiro> if you use 2 modules both have something like `when defined(enableGUI):` and you want to enableGUI in only one of them, not both, namespaced define might usefull. |
20:39:46 | FromDiscord | <Clyybber> ah, I see. |
20:40:43 | disruptek | just scope it in the config. |
20:40:50 | FromDiscord | <Clyybber> It could also cause many issues |
20:41:14 | FromDiscord | <Clyybber> with people using -d:a.symbol = 10 |
20:41:15 | * | marmotini_ quit (Remote host closed the connection) |
20:41:32 | FromDiscord | <Clyybber> but module b also containing a `defined(symbol)` |
20:42:27 | FromDiscord | <Clyybber> and putting the scope prefix itself in the defined like so: `defined(a.symbol)` doesn't provide any benefit over a simple prefix |
20:44:06 | * | narimiran quit (Ping timeout: 268 seconds) |
20:45:29 | * | icebattle joined #nim |
20:46:13 | * | sealmove joined #nim |
20:49:17 | FromDiscord | <mratsim> I just tag WV everywhere to avoid conflicting with others: https://github.com/mratsim/weave/blob/master/weave/config.nim#L104 |
20:49:25 | FromDiscord | <mratsim> I have like 40 defines in weave |
20:51:09 | * | natrys joined #nim |
20:52:45 | FromDiscord | <demotomohiro> Multiple module can have same `defined(symbol)`, and you can specify different values to each module with -d:moduleA.symbol=1 -d:moduleB.symbool=2 |
21:04:36 | FromDiscord | <Clyybber> exactly |
21:04:41 | FromDiscord | <Clyybber> but that might be a problem |
21:05:13 | FromDiscord | <Clyybber> because currently many defined(someSymbol) are used in multiple modules |
21:06:01 | disruptek | that's why we just add scoped config. |
21:06:59 | FromDiscord | <Clyybber> and it will cause all kinds of unepected behaviour if the values are different |
21:07:01 | disruptek | scoped config lets us break diamond dependencies. |
21:07:28 | disruptek | the values won't be different, but yes, the behavior will differ. that's the point. |
21:07:50 | FromDiscord | <Clyybber> the value could be different? |
21:08:22 | disruptek | the way it works is, we copy the current config and then lay the new scope over it. |
21:08:27 | FromDiscord | <Clyybber> `defined(someSymbol)` in module a != `defined(someSymbol)` in module B |
21:08:41 | FromDiscord | <Clyybber> disruptek: I'm talking about scoped defines |
21:08:43 | disruptek | yes, the values will differ when intentionally so. |
21:08:53 | FromDiscord | <Clyybber> but it might not be intentional |
21:09:06 | disruptek | well, then you've made an error. |
21:09:17 | FromDiscord | <Clyybber> but the error is on the user |
21:09:22 | FromDiscord | <Clyybber> which kinda sucks |
21:09:23 | disruptek | yes, it's user error. |
21:09:31 | disruptek | for all you know, it's intentional. |
21:09:34 | FromDiscord | <Clyybber> which won't have an error message |
21:09:49 | disruptek | neither does deref'ing nil. |
21:10:01 | FromDiscord | <Clyybber> but derefing nil isn't undefined behaviour |
21:10:06 | FromDiscord | <Clyybber> this is |
21:10:09 | disruptek | neither are scoped defines. |
21:10:14 | FromDiscord | <Clyybber> they are |
21:10:17 | disruptek | they are not. |
21:10:53 | FromDiscord | <Clyybber> do you know what it does? |
21:11:01 | disruptek | sure. |
21:11:21 | FromDiscord | <Clyybber> I don't think so |
21:11:29 | disruptek | that's okay. |
21:11:45 | FromDiscord | <Clyybber> do -d:someCompilerModule.someCompilerDefine |
21:11:53 | FromDiscord | <Clyybber> and expect havok |
21:11:58 | disruptek | that's not what i'm talking about. |
21:12:13 | FromDiscord | <Clyybber> its what I was talking about π |
21:12:59 | disruptek | i'm talking about having the compiler pick up nim configs from modules and applying the contents over the project's context to form a new config for that module. |
21:13:35 | FromDiscord | <Clyybber> disruptek: > disruptek: I'm talking about scoped defines |
21:13:39 | FromDiscord | <Clyybber> :p |
21:13:49 | disruptek | you put the defines in the configs. |
21:15:02 | FromDiscord | <Clyybber> ah |
21:20:22 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
21:20:32 | FromGitter | <timotheecour> > @Clyybber its exactly the same as a prefix, just with a dot β β thatβs not true, prefixSuffix + case insensitivity causes clashes that namespaces donβt , see https://gist.github.com/timotheecour/182fce669ff217c6b0bc87d918303c3e which shows 233 nimble packages that are prefixes of each other, so mypkg.myflag causes 0 conflicts whereas mypkgMyflag can cause conflicts |
21:21:24 | * | abm quit (Quit: Leaving) |
21:21:28 | disruptek | only because i registered packages named {'a'..'z'} and {'aa'..'zz'} |
21:22:02 | disruptek | you're welcome, btw. |
21:24:23 | * | tane quit (Quit: Leaving) |
21:24:48 | FromDiscord | <Clyybber> @timotheecour: I don't get it |
21:25:49 | FromDiscord | <Clyybber> so you want to disallow `defined(somePrefix)` too? to make somePrefix.someFlag work? |
21:26:23 | disruptek | suffixes, THAT'S what we need. |
21:27:52 | FromDiscord | <Clyybber> nothing |
21:27:57 | FromDiscord | <Clyybber> thats what we need |
21:28:19 | disruptek | i'm less than 0 when you add up the sum. |
21:29:11 | * | filcuc joined #nim |
21:35:07 | * | krux02 joined #nim |
21:36:43 | * | icebattle quit (Quit: leaving) |
21:43:56 | FromDiscord | <demotomohiro> If you define a symbol `soundIOFoo` in sound package and `soundioFoo` in soundio package, these symbol are clash as defined symbols are case insensive. |
21:45:39 | FromDiscord | <demotomohiro> If you define them as `sound.IOFoo` and `soundio.Foo`, there is no clash |
21:46:38 | disruptek | they are both problems of naming. whether you use a capital or a period, you're just moving the problem around. |
21:48:21 | disruptek | what you want is a naming scheme, like, say, URLs. |
21:49:32 | disruptek | we build the package manager into the compiler and the compiler can automate asset collection, trust, distribution, etc. |
21:50:17 | * | lritter quit (Quit: Leaving) |
21:50:35 | disruptek | you could have your requirements specified right in the source as an import statement. |
21:51:01 | disruptek | instantly switch requirements simply by altering the source. |
21:51:13 | disruptek | and recompiling, of course. |
21:51:31 | disruptek | unless those requirements (packages) are shared objects. |
21:51:47 | disruptek | in which case, we can precompile them all and just run your program with different dynlibs. |
21:52:10 | disruptek | test your code on any set of versions without recompiling anything. |
21:52:46 | disruptek | don't just know under which platforms your code runs, but where it doesn't, and at which git commit it broke, and how. |
21:54:15 | disruptek | sorry, i'm a little stoned right now. |
21:56:30 | * | Ven`` quit (Read error: Connection reset by peer) |
21:56:40 | disruptek | we could actually checksum the inputs and outputs and then we'd know when a given input gave a novel output. |
21:58:26 | disruptek | you could actually just ask a peer for the output of the given input. so you don't actually need a compiler; you just need to know the input and you can ask a peer for the output. |
22:00:01 | disruptek | maybe that's just a slow way to move truth. |
22:01:09 | disruptek | no, i think it's useful. |
22:01:39 | disruptek | okay, check this out. we checksum the generated c of a nim program given certain platform qualities, etc. |
22:01:54 | disruptek | we save the output. |
22:02:24 | disruptek | now we can link this output to a test framework that mixes it with other outputs. |
22:02:52 | disruptek | now we can test your program with myriad combinations of other nim programs, c libs, etc. |
22:03:22 | disruptek | we can probably even determine graph characteristics for bugs. |
22:04:19 | disruptek | like, status introduces a lot of fails into the network via x lib. maybe we should fix that lib. |
22:04:39 | Zevv | /join #disruptek |
22:04:55 | disruptek | yeah? |
22:05:03 | disruptek | this isn't that crazy. |
22:05:33 | disruptek | is it? |
22:05:44 | Zevv | no, I'm sincerely impressed by all the stuf you're doing and have been doing |
22:05:44 | disruptek | i mean, we could build this. |
22:07:29 | disruptek | we'd need to find a really good systems programming language to use, but yeah. |
22:07:33 | disruptek | we could build this. |
22:07:42 | disruptek | i've heard good things about rust. |
22:07:43 | Zevv | I can see where you want to go, but it will not be lke, simple |
22:08:05 | disruptek | okay, let's talk about why. |
22:08:40 | Zevv | I'd love to, but not at this time. in my timezone it's way after sesame street |
22:08:56 | disruptek | fair enough. π |
22:09:02 | Zevv | I'll be taking my daily napnap in a few minutes |
22:10:05 | Zevv | and you'll be fixing your free's |
22:10:19 | disruptek | yeah, i need to get to that. |
22:10:28 | Zevv | so I say: so long and until we meet again! o/ |
22:10:33 | disruptek | g'nite zevv |
22:10:38 | Zevv | same! |
22:12:32 | disruptek | the aws apis are at version 2.600.0 today. |
22:12:47 | disruptek | they usually go up by 0.1.0 increments. |
22:13:31 | disruptek | when i cut a new version of the nim<->aws bindings, i give it a new major, because i can't be bothered to changelog what actually changed. |
22:13:44 | disruptek | so the atoz package is at version 2600.0.0 today. |
22:13:59 | disruptek | so the question is... |
22:14:17 | disruptek | how will my version scheme break first? |
22:14:30 | Araq | integer overflow |
22:15:21 | disruptek | i would think that'd be last. |
22:15:49 | disruptek | that's how much faith i have in araq. |
22:18:41 | * | filcuc quit (Ping timeout: 258 seconds) |
22:22:01 | * | Kaynato joined #nim |
22:22:31 | * | krux02 quit (Remote host closed the connection) |
22:32:29 | Araq | thanks, unfounded, but thanks |
22:33:00 | disruptek | this isn't a crazy idea. |
22:35:07 | disruptek | is it? |
22:35:18 | * | natrys quit (Quit: natrys) |
22:48:21 | * | disruptek π¦π¦π¦ |
22:50:51 | dom96 | Wish the compiler could infer that HttpRequestError is raised for these: https://nim-lang.org/docs/httpclient.html#getContent%2CAsyncHttpClient%2Cstring |
22:53:28 | FromGitter | <Varriount> disruptek: You have an AWS library for Nim? |
22:53:47 | disruptek | yeah, via openapi. |
22:53:56 | disruptek | !repo disruptek/atoz |
22:53:57 | disbot | https://github.com/disruptek/atoz -- 9atoz: 11Amazon Web Services (AWS) APIs in Nim 15 13β 0π΄ |
22:55:11 | FromGitter | <Varriount> disruptek: I'll have to look at your signature code, and compare it to mine. |
22:55:11 | * | filcuc joined #nim |
22:55:28 | disruptek | oh yeah? |
22:55:55 | FromGitter | <Varriount> disruptek: Yeah, I wrote some signing code a while back, optimized for memory usage |
22:56:04 | disruptek | !repo sigv4 |
22:56:04 | disbot | https://github.com/disruptek/sigv4 -- 9sigv4: 11Amazon Web Services Signature Version 4 15 4β 0π΄ |
22:56:26 | disruptek | be gentle, i think i wrote it a long time ago. |
22:57:20 | FromGitter | <Varriount> disruptek: https://gist.github.com/Varriount/076f406c475b5369301a2fcd7b4527af |
22:58:01 | FromGitter | <Varriount> disruptek: The signing scheme is quite convoluted, and not very well documented, especially corner cases. |
22:58:07 | Yardanico | oh no, I thought I removed class macro from nimpylib, but it's stil there (and it's one of the most horrible examples of what you can do with macros in nim) - https://github.com/Yardanico/nimpylib/blob/master/examples/example2.nim#L7 |
22:58:19 | disruptek | what if you could specify a trust relationship in your source and as a result, the compiler could just pull in assets from the trust web. failing the web, ... tbd. |
22:59:48 | FromGitter | <Varriount> Yardanico: What about allowing tabs in Nim files via template filters? |
23:00:33 | Yardanico | thats illegal |
23:00:42 | Yardanico | FBI is coming |
23:01:07 | * | filcuc quit (Read error: Connection reset by peer) |
23:01:21 | * | filcuc joined #nim |
23:03:05 | disruptek | varriount: neat, wish i'd seen this before i wrote mine. |
23:05:22 | * | filcuc quit (Remote host closed the connection) |
23:05:46 | * | filcuc joined #nim |
23:06:38 | * | solitudesf quit (Ping timeout: 260 seconds) |
23:06:43 | disruptek | i will have to see if i can steal your path routines to fix my version, which i swear araq sabotaged just to prove a point. |
23:07:18 | disruptek | he flat out told me it was stupid to use path tools from stdlib to build strings. |
23:07:34 | disruptek | and i'm like, "huh huh they're all strings huh huh" π |
23:07:59 | disruptek | and in the next version, my path-based signing mysteriously breaks. |
23:08:11 | disruptek | it was, like, the most surgical practical joke ever. |
23:08:47 | disruptek | here. i'm gonna get some sucker to submit a PR to my language that breaks ONLY your library. Ever. |
23:09:06 | disruptek | because, "see, i told you." |
23:11:23 | * | filcuc quit (Quit: Konversation terminated!) |
23:11:41 | * | filcuc joined #nim |
23:12:32 | disruptek | savage. |
23:12:44 | disruptek | i believe that's what the kids are calling it these days. |
23:13:21 | disruptek | oh, and then he teases me about it... "so, did your tests catch it?" |
23:13:30 | disruptek | yeah, they caught it. π€£ |
23:13:45 | disruptek | yeah, they caught it, buddy. π |
23:15:27 | disruptek | then he reverted it. |
23:15:52 | disruptek | i mean, i hadn't stopped bleeding and he just twists the knife. |
23:16:31 | * | filcuc quit (Client Quit) |
23:16:46 | * | filcuc joined #nim |
23:16:50 | * | ltriant joined #nim |
23:21:44 | * | filcuc quit (Quit: Konversation terminated!) |
23:21:54 | * | filcuc joined #nim |
23:27:38 | * | filcuc quit (Ping timeout: 240 seconds) |
23:34:31 | * | Hideki_ joined #nim |
23:37:29 | shashlick | looks like I need to drop 0.19.6 support for nimterop |
23:37:35 | shashlick | maybe it is time |
23:38:45 | disruptek | it's not like what already exists will cease to exist. |
23:39:01 | disruptek | people can still use everything that you've written to date. |
23:39:03 | * | Hideki_ quit (Ping timeout: 268 seconds) |
23:42:18 | shashlick | true |
23:42:50 | disruptek | varriount: it's funny you mention the documentation of the signing. |
23:43:15 | disruptek | so i sat down to write that thing finally, and it was such a joy. |
23:43:32 | FromGitter | <Varriount> disruptek: I won't say the code is simple... optimization has its costs |
23:43:34 | disruptek | i had totally forgotten what it's like to write on spec. |
23:43:53 | disruptek | how optimized could it possibly need to be? |
23:44:10 | disruptek | i mean, you're kidding me right now, right? |
23:44:14 | FromGitter | <Varriount> *shrug* It was something of a challenge for myself. |
23:44:38 | disruptek | i think i benchmarked my test at about 100,000 signings per second. |
23:45:16 | disruptek | how much memory does it take? |
23:45:44 | * | uu91 joined #nim |
23:45:58 | FromGitter | <Varriount> I don't recall, I just remember getting the number of heap allocations down to a fairly small amount. |
23:46:11 | FromGitter | <Varriount> I think I profiled it, once upon a time. :/ |
23:46:13 | disruptek | oh, gotcha. |
23:47:43 | disruptek | i don't know if i've ever written to spec unless it was my own. |
23:47:46 | disruptek | it was zen-like. |
23:52:43 | FromGitter | <Varriount> disruptek: For example, the crypto library used supports streaming updates to the sha256 structure, so rather than piece together a string containing the entire structure to feed into a crypto function, already allocated pieces are used: https://gist.github.com/Varriount/076f406c475b5369301a2fcd7b4527af#file-aws-nim-L330 |
23:54:29 | * | uu91 quit (Remote host closed the connection) |
23:56:50 | disruptek | ah, sure. |