00:10:21 | * | vicfred quit (Remote host closed the connection) |
00:10:44 | * | vicfred joined #nim |
00:12:49 | * | oddp quit (Ping timeout: 264 seconds) |
00:23:05 | * | fredrikhr quit (Read error: Connection reset by peer) |
00:23:30 | * | fredrikhr joined #nim |
00:24:10 | * | fredrikhr quit (Read error: Connection reset by peer) |
00:24:35 | * | fredrikhr joined #nim |
01:05:38 | * | Tlongir joined #nim |
01:08:19 | * | Tongir joined #nim |
01:10:25 | * | Tlongir quit (Ping timeout: 240 seconds) |
01:19:31 | * | apahl quit (Ping timeout: 272 seconds) |
01:21:07 | * | apahl joined #nim |
01:23:03 | FromDiscord | <Anuke> sent a code paste, see https://play.nim-lang.org/#ix=2spM |
01:24:31 | voltist | Is anyone on here the developer of NiGui? |
01:31:36 | FromDiscord | <slymilano> jiro4989 just posted a github actions for cross-platform build/release. it's really great! |
01:31:49 | FromDiscord | <Yardanico> @Anuke that's the wrong command |
01:31:58 | FromDiscord | <slymilano> git tag v0.0.1 and boom you got your app for all three major's easily reachable for your end user. |
01:32:00 | FromDiscord | <Yardanico> Replace arm with arm64 |
01:32:01 | FromDiscord | <slymilano> shmexy |
01:32:09 | FromDiscord | <Yardanico> arm is armv7 |
01:33:03 | FromDiscord | <Yardanico> arm64 is aarch64 and is armv8a |
01:33:37 | FromDiscord | <Yardanico> @voltist yes, he's there sometimes, but it's better to open an issue in NiGui to ask something about it |
01:33:46 | FromDiscord | <Yardanico> !seen TrustableCode |
01:33:47 | disbot | TrustableCode never seen. |
01:34:00 | FromDiscord | <Yardanico> !seen trustable-code |
01:34:01 | disbot | trustable-code never seen. |
01:36:26 | FromDiscord | <Yardanico> Hmmm |
01:38:19 | bung | https://github.com/nim-lang/Nim/issues/5768 this should close |
01:38:21 | disbot | ➥ db_sqlite can't correctly quote binary data ; snippet at 12https://play.nim-lang.org/#ix=2spS |
01:41:27 | bung | I've read all stdlib,js lablled issues till now |
02:03:37 | FromDiscord | <Yardanico> Why it should be closed? I don't understand |
02:10:01 | bung | https://github.com/nim-lang/Nim/pull/14408/files#diff-0285f3281e8cf19b0275e85bc908d119R774 |
02:10:02 | disbot | ➥ add bindParams to db_sqlite |
02:10:11 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:10:38 | bung | db_sqlite now have bind params api, can bind binary data null etc. |
02:11:27 | FromDiscord | <impbox> nice |
02:11:45 | * | muffindrake joined #nim |
02:25:48 | * | outtabwz quit (Quit: leaving) |
02:38:54 | * | fredrikhr is now known as couven92 |
02:42:23 | FromDiscord | <Varriount> impbox: Who did the music for smalltrek? It's nice. |
02:42:38 | FromDiscord | <Varriount> Reminds me of one of my favorite schmups |
02:48:20 | * | Cthalupa quit (Ping timeout: 244 seconds) |
02:48:47 | * | Cthalupa joined #nim |
02:52:05 | * | lritter quit (Ping timeout: 240 seconds) |
02:52:58 | * | lritter joined #nim |
02:58:47 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:03:31 | * | arecacea1 quit (Read error: Connection reset by peer) |
03:03:34 | * | B4s1l3 joined #nim |
03:04:08 | * | arecacea1 joined #nim |
03:06:23 | FromDiscord | <Varriount> Reminds me music by [Slimegirls](https://slimegirls.bandcamp.com/) |
03:06:42 | FromDiscord | <Varriount> (edit) '[Slimegirls](https://slimegirls.bandcamp.com/)' => 'Slimegirls (https://slimegirls.bandcamp.com/)' |
03:09:30 | * | FromDiscord quit (Remote host closed the connection) |
03:09:45 | * | FromDiscord joined #nim |
03:15:20 | * | Tlanger joined #nim |
03:18:17 | * | Tongir quit (Ping timeout: 265 seconds) |
03:19:20 | FromDiscord | <impbox> @Varriount i did |
03:19:42 | FromDiscord | <impbox> it was very rushed on my gameboy |
03:20:32 | FromDiscord | <impbox> i see the resemblance, very gameboy sound |
03:23:42 | FromDiscord | <impbox> https://soundcloud.com/luna-and-the-spacebaes/spatial-anomaly a song me and my partner created out of the smalltrek music |
03:23:50 | shashlick | shared data across threads again - when is this going to be solved |
03:24:24 | FromDiscord | <Varriount> shashlick: When we finally come up with a solution for world hunger and global peace. |
03:24:36 | FromDiscord | <impbox> you can't share data across threads? |
03:25:08 | FromDiscord | <impbox> pretty sure i've been doing that |
03:25:34 | FromDiscord | <Varriount> Not without either using the Boehm GC, or pointers. |
03:25:47 | shashlick | how are you - cannot use any nim types |
03:25:50 | FromDiscord | <Varriount> Or copying data |
03:26:07 | FromDiscord | <impbox> hmm maybe i'm using boehm, is that the default? |
03:26:21 | shashlick | nope |
03:26:37 | * | B4s1l3 is now known as opDispatch |
03:26:45 | FromDiscord | <impbox> is this a recent change you're talking about? |
03:27:06 | shashlick | this is why arc/orc exist |
03:27:08 | FromDiscord | <impbox> i haven't played with threads lately, but nimsynth was sharing global data between threads |
03:27:25 | shashlick | cause the refc gc doesn't support it |
03:27:28 | FromDiscord | <Varriount> impbox: What method were you using to share data, channels? |
03:27:36 | FromDiscord | <impbox> nah, just accessing globals |
03:27:39 | FromDiscord | <impbox> with locks |
03:27:58 | FromDiscord | <Varriount> Did the globals have any reference types in them? |
03:28:43 | FromDiscord | <impbox> i'll check the code so i'm not giving misleading data |
03:28:49 | FromDiscord | <Varriount> Where you get into trouble is if you store a reference from thread A in a global, then copy it into thread B |
03:29:09 | FromDiscord | <impbox> hmm is it copying? i thought both threads could access the same data |
03:29:13 | FromDiscord | <Varriount> (copy the reference, not the data the reference points to) |
03:29:45 | shashlick | i cannot opt for boehm here, it works great for this |
03:29:52 | shashlick | have to use pure nim stdlib |
03:30:05 | shashlick | and cannot assume boehm is installed |
03:30:58 | FromDiscord | <Varriount> To put it another way, a thread cannot handle references (either directly, or indirectly through an object) that were not created in that thread |
03:31:18 | FromDiscord | <Elegant Beef> The default GC has seperate heaps per thread, right? |
03:31:28 | FromDiscord | <Varriount> Yes |
03:32:53 | shashlick | one option is to have one thread that manages the data and use channels back and forth with that thread |
03:33:08 | shashlick | just a mess though - just trying to parallelize some code |
03:33:36 | FromDiscord | <Varriount> shashlick: Launch separate processes. >:D |
03:34:19 | shashlick | doesn't help cause they still need to coordinate |
03:34:37 | FromDiscord | <Varriount> Pipes? |
03:35:00 | shashlick | basically i'm experimenting with parallelizing nimble |
03:35:33 | FromDiscord | <Varriount> Parallel downloads? |
03:35:41 | shashlick | ya and processing dependencies |
03:35:51 | shashlick | but cannot install the same dependency multiple times |
03:36:07 | shashlick | has to be some coordination |
03:36:13 | FromDiscord | <Varriount> Isn't that the kind of thing channels are good at? |
03:36:25 | shashlick | then i'll need a thread keeping track of this |
03:36:33 | FromDiscord | <Varriount> Have each thread push/pull jobs onto/from the channel |
03:37:02 | FromDiscord | <impbox> can you just use async instead of threads? |
03:37:17 | shashlick | i would have but am spawning processes which need to be parallelized |
03:37:33 | shashlick | for that i'll need asynctools which isn't stdlib |
03:37:42 | disruptek | so put it in. |
03:38:01 | shashlick | i might just ditch this experiment |
03:38:33 | FromDiscord | <impbox> is nimble such a bottleneck that it needs optimising? |
03:38:36 | shashlick | doubt i can improve performance very drastically without major rework |
03:39:57 | shashlick | let's just call it a fun experiment that originated from @PMunch's https://github.com/nim-lang/nimble/issues/722 |
03:39:58 | disbot | ➥ Concurrent downloads of packages |
03:40:04 | * | fredrik92 joined #nim |
03:40:31 | FromDiscord | <impbox> mmm concurrent downloads sounds like it shouldn't require threads |
03:40:51 | FromDiscord | <impbox> spawn a bunch of processes, wait for them all to finish |
03:41:09 | * | jeko quit (Quit: Leaving) |
03:42:13 | shashlick | one point worth consideration is that most packages only have 2-3 deps so the tree could get wide but you don't know child deps unless you download the parent |
03:43:04 | FromDiscord | <impbox> could be stored as metadata in the ... whatever it's called that nimble talks to |
03:43:50 | * | couven92 quit (Ping timeout: 260 seconds) |
03:43:58 | shashlick | the package repo only includes urls to repos, not deps and version info |
03:44:06 | FromDiscord | <impbox> so far! |
03:44:16 | shashlick | it isn't a db - just a json file |
03:45:32 | shashlick | performance is a distraction after all, let's just call it a useless Sunday and move on |
03:45:44 | shashlick | some day data sharing across threads will be easy |
03:45:46 | FromDiscord | <impbox> but even without threads, check when one process finishes and check if new deps are added by it |
03:45:57 | FromDiscord | <impbox> then spawn processes for those deps |
03:46:03 | FromDiscord | <impbox> and keep a queue of processes |
03:48:19 | shashlick | some day, will consider this again, for now need to focus on bugs again |
03:50:31 | shashlick | someone pick a defect |
03:51:05 | FromDiscord | <impbox> better error messages for nimble scripts |
03:51:18 | shashlick | that should be improved with recent changes |
03:51:26 | FromDiscord | <impbox> \o/ |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:39 | * | supakeen joined #nim |
04:09:05 | * | altarrel quit (Quit: Konversation terminated!) |
04:17:06 | * | narimiran joined #nim |
04:17:54 | disruptek | !repo cps |
04:17:55 | disbot | https://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 15⭐ 0🍴 7& 1 more... |
04:18:29 | disruptek | bad news: |
04:18:35 | disruptek | tomorrow is shower sunday. |
04:19:01 | FromGitter | <kennymalac> Hey, out of curiousity, is it possible to override default keywords such as if, else, and = |
04:19:38 | disruptek | !eval var `if` = "woot" |
04:19:40 | NimBot | <no output> |
04:21:13 | FromDiscord | <impbox> kennymalac you can use them as non keywords by quoting with backticks i think |
04:21:17 | FromDiscord | <Elegant Beef> you can strop variables |
04:21:17 | FromDiscord | <Elegant Beef> Yea |
04:21:19 | FromDiscord | <impbox> not the same as overriding them |
04:21:37 | FromGitter | <kennymalac> I'm trying to compare nim to a lisper |
04:22:10 | FromGitter | <kennymalac> nim to Common lisp to a lisper* |
04:22:18 | disruptek | !repo belamenso/v |
04:22:19 | disbot | https://github.com/belamenso/v -- 9v: 11Write Nim only with 'v' 15 24⭐ 3🍴 |
04:25:40 | FromDiscord | <Rika> *flashbacks to the last lisper who was here* |
04:28:47 | skrylar[m] | that is horrifying |
04:45:38 | * | opDispatch left #nim ("Konversation terminated!") |
04:47:54 | * | fredrikhr2 joined #nim |
04:48:07 | * | fredrikhr2 is now known as fredrikhr |
04:51:52 | * | fredrik92 quit (Quit: Client Disconnecting) |
04:58:07 | * | fredrikhr quit (Quit: The Lounge - https://thelounge.chat) |
05:02:07 | * | fredrikhr joined #nim |
05:30:02 | Zevv | disruptek: so, how many nim bugs have you summoned over the last weeks again? |
05:55:01 | * | maier joined #nim |
06:09:38 | * | Vladar joined #nim |
06:29:13 | * | jjido joined #nim |
06:38:40 | * | aurelius joined #nim |
06:44:14 | * | hoijui joined #nim |
06:46:19 | * | solitudesf joined #nim |
06:55:00 | * | lritter quit (Quit: Leaving) |
07:11:00 | Zevv | who wants a fun little puzzle |
07:11:01 | Zevv | http://ix.io/2sqi |
07:11:20 | Zevv | winners gets a large beer at next fosdem |
07:17:36 | * | nikita` joined #nim |
07:18:09 | FromDiscord | <Rika> what if we dont drink beer |
07:20:55 | FromDiscord | <Rika> Zevv: checking the two's "bits" by casting them into an int64 shows that theyre exactly the same in memory, it seems |
07:21:26 | Zevv | A kebab or falafel good for you? |
07:21:30 | FromDiscord | <Rika> so it seems that its impossible to distinguish them |
07:21:46 | Zevv | right so |
07:21:53 | FromDiscord | <Rika> uh i dont live in europe so its extremely unlikely you'll ever meet me |
07:22:18 | Zevv | Who cares. you have local deliveries I bet :) |
07:22:21 | * | Tongir joined #nim |
07:23:13 | FromDiscord | <Rika> wait, let me redo my "observation" |
07:23:19 | Zevv | haha |
07:23:41 | Zevv | the fun thin is: disruptek has a case where there is different behaviour depending on cast vs conversion |
07:23:50 | Zevv | but it's pretty convoluted |
07:24:25 | * | Tlanger quit (Ping timeout: 240 seconds) |
07:24:31 | FromDiscord | <Rika> so maybe its not minimized correctly |
07:25:00 | Zevv | sure, but then again. His code does A with casting and B when converting. |
07:25:36 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:26:54 | FromDiscord | <Rika> then maybe its not just "when a type inherits another", maybe theres another thing in combination that causes the issue |
07:27:03 | Zevv | there must be. |
07:27:27 | Zevv | I think there's some funny AST going on in all the macros in the code |
07:27:32 | Zevv | but I don't understand that code :/ |
07:57:02 | * | hoijui quit (Ping timeout: 260 seconds) |
08:11:02 | FromDiscord | <Varriount> Zevv: Could the behavior be C compiler related? |
08:11:08 | Araq | shashlick, awesome work on Nimble! Thank you! |
08:11:10 | Zevv | I don't know. There *is* different codegen |
08:11:17 | * | Araq is going through his github related emails |
08:18:17 | * | dzamo joined #nim |
08:21:13 | * | dzamo quit (Client Quit) |
08:21:32 | * | dzamo joined #nim |
08:25:46 | * | jjido joined #nim |
08:26:22 | Araq | Zevv, don't understand your snippet |
08:26:34 | Araq | if you explain it once again, I might help out |
08:29:02 | Zevv | well, disruptek "fixed" something in CPS yesterday by casting between derived object types |
08:29:05 | Zevv | instead of converting |
08:29:21 | Zevv | I don't understand his CPs code anymore, but my point was that if he needed to cast, something is wrong |
08:29:35 | Zevv | because everthing should be perfectly fine, typewise, after CPS transformations |
08:29:48 | Zevv | but he seems to have a case where his bug is "fixed" by casting instead of converting |
08:29:56 | Zevv | There is an actual difference in the codegen |
08:30:13 | Zevv | but I don't understand what the different behaviour could be between a casted and converted object |
08:30:23 | Zevv | because the end result is exactly the same, it is only a different path of going there |
08:30:52 | Zevv | But I strongly oppose between putting in any kind of casting in the CPS code, because we basically lose the help of the compiler there if we mess up |
08:31:27 | Zevv | so this snippet is just a way of showing two ways to get to the same result, and my question was if there is any distinguishable difference between these two objects - one casted and one converted |
08:31:34 | Zevv | because the C-code *is* different |
08:31:44 | Zevv | does that make sense? |
08:34:23 | FromDiscord | <Varriount> Zevv: Wouldn't the conversion code have conversion checks? |
08:34:38 | FromDiscord | <Varriount> (assuming you're not turning them off) |
08:35:14 | Araq | Zevv, I agree with you |
08:35:31 | Araq | and 'cast' shouldn't be used |
08:35:52 | FromDiscord | <impbox> just so i can follow along, what's CPS? |
08:36:05 | Araq | we have different code paths in the Nim compiler though because type conversions are checked at runtime |
08:37:06 | Araq | and I hunted a maybe related codegen bug for the last days |
08:38:06 | Zevv | that would make sense. |
08:38:20 | Zevv | The problem is that this bug is triggered after all this CPS juggling with the AST |
08:38:46 | Zevv | so it might also be that his problem is caused by funny AST which is not right but also not quite wrong |
08:39:01 | Zevv | I'm not sure how strict the compiler is on AST that it does not generate from the Nim parser |
08:39:20 | Zevv | I've seen the occasional 'ill formed' message, but I bet there's a million ways to get the C-gen to mess up with custom AST |
08:39:34 | Araq | it's strict but I suppose e.g. nkConv is usually not generated by a macro |
08:39:47 | Araq | and yeah, getting it to "strict" was a pita :-) |
08:40:17 | Zevv | makes perfect sense. |
08:40:42 | Zevv | Problem is that I do not understand the underlying stuff of disruptek issue. I do understand that I am right and he is wrong, but I needs some time to realize that |
08:40:55 | Zevv | s/he needs/ |
08:43:06 | FromDiscord | <Varriount> @impbox I'll PM you, to avoid cluttering up the chat |
08:45:46 | * | xet7 quit (Ping timeout: 260 seconds) |
08:47:05 | * | aurelius quit () |
08:47:34 | * | xet7 joined #nim |
08:48:14 | * | aurelius joined #nim |
09:07:37 | * | oddp joined #nim |
09:14:12 | FromGitter | <alehander92> ok |
09:15:22 | * | Tlanger joined #nim |
09:18:13 | * | Tongir quit (Ping timeout: 264 seconds) |
09:20:23 | * | ofelas quit (Ping timeout: 258 seconds) |
09:40:56 | * | dzamo quit (Quit: dzamo) |
09:41:18 | * | dzamo joined #nim |
09:50:33 | Zevv | Varriount: sure, but I turned everything off with -d:danger |
09:54:49 | * | Tongir joined #nim |
09:56:59 | * | Tlanger quit (Ping timeout: 240 seconds) |
10:09:47 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:14:12 | FromDiscord | <Varriount> Araq: Regarding closures (and closure iterators) do you know why they are slower than regular function calls? Is it the accesses to the closure environment? |
10:18:41 | Araq | well it's a closure call, closure calls introduce an 'if' that good optimizers can optmize out but when I checked years ago they didn't |
10:20:01 | Araq | the environment and heap allocations don't help either but look |
10:20:34 | Araq | the real costs here come from the Future + callbacks + closure iterator interactions |
10:21:07 | Araq | if you could only use Futures, or only callbacks or only closure iterators it would be better |
10:25:25 | FromGitter | <alehander92> can you inline many calls |
10:25:29 | FromGitter | <alehander92> to just goto-s |
10:25:39 | FromGitter | <alehander92> like, can one write a simple compiler for no-async code |
10:25:45 | FromGitter | <alehander92> that just generates a single big call |
10:25:56 | FromGitter | <alehander92> without creating new frames etc |
10:26:21 | FromGitter | <alehander92> and just rearranging everything into different parts of the code (and limiting stack variables ) |
10:26:27 | Araq | that's how my Lego Mindstorm Not quite C implementation worked |
10:26:38 | Araq | it's terrible and you lose recursion but it works |
10:26:48 | FromGitter | <alehander92> oh yeah recursion |
10:26:54 | Araq | it was a valid strategy for Fortran code before they added recursion to Fortran |
10:27:04 | FromGitter | <alehander92> interesting |
10:27:13 | FromGitter | <alehander92> but does it help somehow performance |
10:27:32 | FromGitter | <alehander92> or is it just a cool-that-it-can be done |
10:27:40 | FromGitter | <alehander92> thing |
10:28:58 | FromGitter | <alehander92> like, frames are just there, so it's not really a matter of creating them, and moving vars to heap is probably not cool |
10:36:50 | * | outtabwz joined #nim |
10:39:57 | FromDiscord | <Clyybber> Araq: Is there a way I can access the template scope of a template generated symbol? |
10:40:26 | FromDiscord | <Clyybber> In semProcAux |
10:43:33 | Zevv | wait what |
10:43:35 | Zevv | did you make NQC? |
10:46:13 | FromDiscord | <Yardanico> Implementation for Lego Mindstorm it seems |
10:48:49 | Zevv | yeah man I grew up with that stuff |
10:49:13 | Zevv | mindstorms software sucked big time, but luckily there was NQC |
10:51:44 | FromDiscord | <Yardanico> Oh nice so the closure leak was a real one |
10:52:09 | FromDiscord | <Yardanico> That's nice to know, I hope we won't have other leaks with async after that one is fixed |
10:52:33 | FromDiscord | <Yardanico> 1 line fix :D |
10:56:35 | FromDiscord | <Clyybber> that 1 line fix is only temporary afaict |
10:56:54 | FromDiscord | <Clyybber> because in general we still want to have the isDecl firstwrite optimization |
10:57:37 | FromDiscord | <Yardanico> Oh |
11:00:03 | FromDiscord | <Yardanico> Also @Clyybber is it fine to merge #15085 ? |
11:00:04 | disbot | https://github.com/nim-lang/Nim/pull/15085 -- 3Add test-cases for #12576 and #12523 |
11:00:20 | FromDiscord | <Clyybber> Oh, I was just looking at it |
11:02:03 | * | NimBot joined #nim |
11:03:02 | FromDiscord | <Yardanico> And yeah, I can probably do some comment renamings in the test suite to our new scheme |
11:03:11 | FromDiscord | <Yardanico> I mean the # bug #12345 stuff |
11:03:12 | disbot | https://github.com/nim-lang/Nim/issues/12345 -- 3Confusing error with static parameters ; snippet at 12https://play.nim-lang.org/#ix=26CQ |
11:03:18 | FromDiscord | <Clyybber> not needed IMO, but if you want to go ahead :) |
11:04:35 | Araq | Zevv, ah no, that was poorly worded, it was "my Mindstorm" |
11:04:43 | Araq | but I didn't write the software |
11:05:31 | Araq | <Yardanico> that fix fixes your reduced test case |
11:05:49 | Araq | but the async leak remains, well it got a little better |
11:06:48 | Araq | a different reduction would be sweet ;-) |
11:07:03 | FromDiscord | <Yardanico> Oh okay I'll see |
11:08:49 | Araq | Clyybber: the 'isFirstWrite' rule is mostly unaffected |
11:09:14 | Araq | only closures were affected |
11:10:45 | Araq | Clyybber: alternatively you can work on making forward declarations obsolete |
11:11:22 | Araq | they make things more complex with almost no known benefits |
11:15:08 | FromDiscord | <Clyybber> yeah |
11:15:38 | FromDiscord | <Clyybber> Araq: But you changed the only call that sets isDecl to true in var/let sections |
11:16:15 | Araq | but for n.kind != nkSym which means it's a "lifted" variable |
11:16:38 | Araq | it's var env.v = 3 which should really be evn.v = 3 |
11:16:45 | FromDiscord | <Clyybber> oh, I missed that part |
11:16:49 | FromDiscord | <Clyybber> right, makes sense |
11:17:32 | * | krux02 joined #nim |
11:19:41 | * | fredrikhr quit (Read error: Connection reset by peer) |
11:20:48 | Araq | alehander92, on a modern CPU it's not an optimization anyway. But thinking about it, it's how GPUs work |
11:20:59 | Araq | afaik |
11:21:16 | FromDiscord | <Yardanico> Also I forgot about -d:nimAllocStats , guess reducing would be easier with it |
11:21:25 | * | fredrikhr joined #nim |
11:27:27 | * | dulsi quit (Quit: Leaving) |
11:29:49 | * | fredrikhr quit (Read error: Connection reset by peer) |
11:30:30 | * | fredrikhr joined #nim |
11:30:52 | * | dulsi joined #nim |
11:33:18 | * | hoijui joined #nim |
11:39:27 | * | oriba joined #nim |
11:45:07 | * | fredrikhr quit (Read error: Connection reset by peer) |
11:45:31 | * | fredrikhr joined #nim |
11:50:52 | * | waleee-cl joined #nim |
11:59:03 | icyphox | any good examples for xmlparser? |
12:01:03 | FromDiscord | <Yardanico> Idk, it's not that hard |
12:01:21 | FromDiscord | <Yardanico> E.g. https://github.com/Yardanico/nim-snippets/blob/master/logcheck/main.nim#L82 |
12:01:51 | FromDiscord | <Yardanico> https://github.com/Yardanico/nim-snippets/blob/master/tg_export_parse.nim#L6 |
12:02:03 | icyphox | yeah i was wondering what to do with the XmlNode object |
12:02:09 | icyphox | found some procs i can use in xmltree |
12:02:32 | FromDiscord | <Yardanico> nimquery is a good lib |
12:02:43 | FromDiscord | <Yardanico> For using CSS selectors to parse html |
12:02:56 | icyphox | ah no, this is pure XML |
12:03:01 | icyphox | xmpp stanzas |
12:03:32 | FromDiscord | <Yardanico> It'll still work |
12:03:50 | FromDiscord | <Yardanico> Current html parser is built on top of the XML one |
12:04:06 | FromDiscord | <Yardanico> https://github.com/GULPF/nimquery |
12:04:17 | FromDiscord | <Yardanico> parseHtml returns a XmlNode |
12:05:08 | icyphox | nice |
12:05:11 | icyphox | i'll check this out |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:39 | * | supakeen joined #nim |
12:13:00 | FromDiscord | <dom96> > if you could only use Futures, or only callbacks or only closure iterators it would be better↵@Araq[IRC]#0000 what makes you think you can't? |
12:13:28 | Araq | async's design uses all three |
12:13:37 | FromDiscord | <dom96> > Oh nice so the closure leak was a real one↵@Yardanico what's the context on this? |
12:13:53 | Yardanico | https://github.com/nim-lang/Nim/issues/15076 the last comment repro was fixed |
12:13:54 | disbot | ➥ Memory leaks with async (closure iterators?) under ORC ; snippet at 12https://play.nim-lang.org/#ix=2snX |
12:13:55 | Araq | context is --gc:orc + async |
12:14:11 | Araq | and it's still leaking, I'm looking into the problem right now |
12:14:16 | FromDiscord | <dom96> Araq: async /await/'s design |
12:14:26 | Araq | (but it leaks less now, yay) |
12:14:46 | FromDiscord | <dom96> Nothing stops you from using futures on their own, except the mess that brings to your code 🙂 |
12:15:12 | FromDiscord | <dom96> but maybe there is a way to reduce that mess by creating an async await macro which doesn't use closure iterators |
12:15:40 | * | fredrikhr quit (Read error: Connection reset by peer) |
12:16:24 | Araq | yeah but |
12:18:08 | Araq | in the end it doesn't matter much. I prefer to do things differently. |
12:18:41 | Yardanico | "(allocCount: 600092, deallocCount: 499967)" oh i see |
12:18:44 | Yardanico | from my first example hm |
12:18:57 | * | fredrikhr joined #nim |
12:19:47 | Yardanico | btw I was labeling some issues yesterday, we still have ~300 unlabeled ones (although some of them are hard to properly label) |
12:19:59 | Yardanico | i mean open unlabeled issues |
12:20:15 | FromDiscord | <dom96> Araq: that's a shame, because async is very stable and used in production by many. |
12:21:52 | Araq | dom96: well my way has the benefit that we might get rid of "closure iterators" entirely |
12:22:03 | Araq | and end up with a smaller Nim |
12:23:21 | Araq | with your proposed way all we get is refactorings for our async. |
12:24:36 | * | fredrikhr quit (Read error: Connection reset by peer) |
12:25:18 | * | fredrikhr joined #nim |
12:25:49 | Araq | or maybe in the end we understand closure iterators better and can write a decent spec and eliminate edge cases |
12:26:48 | FromDiscord | <dom96> > with your proposed way all we get is refactorings for our async.↵I guess, but you said that only using Futures would be an improvement. I assume that's a win in and of itself. Even if we get there by refactoring async. |
12:34:51 | Yardanico | ok I minimized the original leak to only importing asyncfutures :P |
12:35:01 | Yardanico | "(allocCount: 30020, deallocCount: 25018)" for 5k iterations |
12:36:28 | * | sagax quit (Remote host closed the connection) |
12:37:24 | Yardanico | ah wait |
12:37:24 | * | aurelius quit (Remote host closed the connection) |
12:38:13 | Yardanico | Araq: did you test the original snippet (the first one from the issue) so you said there's still a leak? |
12:38:21 | Yardanico | because it seems like this leak comes from debugging info of futures |
12:38:56 | Araq | Yardanico: yeah, valgrind suggests that |
12:39:13 | Yardanico | if you compile with -d:release you get "(allocCount: 500090, deallocCount: 499967)", although this might still mean a leak |
12:39:22 | Yardanico | and it does, valgrind still shows a bit of leaks |
12:41:50 | silvernode[m] | Tonight was my last night off work, I had 10 days off. I got about 6 more hours to kill before sleep time and need to motivate myself to work on code. -_- |
12:43:38 | Yardanico | oh lol |
12:43:51 | Yardanico | it might have to do something with Future[T] inheriting from FutureBase |
12:44:03 | Yardanico | if I replace every Future[void] with FutureBase (everywhere in the code), that leak goes away |
12:44:29 | * | sagax joined #nim |
12:45:06 | * | jjido joined #nim |
12:45:50 | Yardanico | leaks in - https://gist.github.com/Yardanico/694ae199eac7b864bc3fb822ae401d15, doesn't leak with - https://gist.github.com/Yardanico/a58949aea5653c4163c3f91b60a2b657, whole diff - https://gist.github.com/Yardanico/a3e1ba90f9d0e34e5edac07b88b59153 |
12:46:21 | FromDiscord | <XxDiCaprioxX> Anybody here who used Discordnim? |
12:46:30 | Yardanico | you should use dimscord instead :) |
12:46:32 | Oddmonger | are there differents ways of writing a cast ? |
12:47:16 | Yardanico | Oddmonger: not really, there's only one way of writing a real "cast" in nim |
12:47:27 | Yardanico | @XxDiCaprioxX discordnim is unmaintained really |
12:47:28 | Oddmonger | ie i want to cast a cstring to a string, so i did (naively): print_string( (string) foo() ) |
12:47:29 | FromDiscord | <XxDiCaprioxX> Okay, but is that a good library? |
12:47:29 | Yardanico | dimscord OTOH is |
12:47:40 | FromDiscord | <XxDiCaprioxX> I mean dimscord |
12:47:42 | Yardanico | @XxDiCaprioxX well the current IRC bridge uses it |
12:47:45 | Yardanico | the author is active here |
12:47:54 | Yardanico | Oddmonger: well that'll work |
12:47:57 | Yardanico | but it's not a "cast" |
12:47:59 | Yardanico | it's a conversion |
12:48:03 | Yardanico | conversions are safe, casts are not |
12:48:13 | Oddmonger | ah |
12:48:14 | Yardanico | and what you did is possible due to command syntax |
12:48:16 | Yardanico | e.g. |
12:48:21 | Yardanico | !eval (echo)5 |
12:48:23 | NimBot | 5 |
12:48:50 | FromDiscord | <XxDiCaprioxX> Okay thank you @Yardanico[IRC]#0000 |
12:48:59 | Oddmonger | whooo |
12:49:00 | Oddmonger | ok |
12:49:10 | Oddmonger | thank you |
12:49:11 | Yardanico | the more readable way is |
12:49:21 | Yardanico | print_string(string(foo())) |
12:49:24 | Yardanico | or foo().string |
12:49:26 | Yardanico | or string foo() |
12:49:32 | Oddmonger | ah |
12:49:34 | Yardanico | UFCS |
12:49:43 | Oddmonger | i did: cast[string](foo()) |
12:49:47 | Yardanico | don't do that |
12:49:59 | Yardanico | there's a $ operator for cstring defined which converts it to a string |
12:50:02 | Araq | do not 'cast'! |
12:50:17 | Araq | read the tutorials once again please |
12:50:41 | Oddmonger | yes i think i need to |
12:51:13 | Oddmonger | usually i read once, understand everything, write something trickier than «hello world» and read it again |
12:51:47 | FromDiscord | <dom96> I've got a project on my ideas list to rate Nim packages in terms of how many `cast`, `ptr`, `pointer`, `addr` etc. are used in the code. Avoid these features as much as you can. |
12:52:02 | FromDiscord | <Rika> Cast only needed if you want to do super dumb shit like I do lol |
12:52:06 | Yardanico | I can do that I guess @dom96 |
12:52:12 | Yardanico | because I already have the code for pkgraph |
12:52:17 | Yardanico | to clone all nimble packages :D |
12:52:19 | FromDiscord | <Rika> @dom96 so basically a code quality analyzer? |
12:52:30 | FromDiscord | <Rika> Or rather, one component to it |
12:52:31 | Yardanico | need to clone them again though since I had to delete them |
12:52:43 | Yardanico | also Araq btw I parsed all #nim IRC logs |
12:52:59 | Yardanico | from when nimbot started working |
12:53:02 | Yardanico | !ping |
12:53:02 | NimBot | pong |
12:53:02 | FromDiscord | <dom96> I mean if you want go for it |
12:53:05 | Yardanico | !lag |
12:53:05 | NimBot | 19ms between me and the server. |
12:53:09 | Yardanico | fast |
12:53:15 | FromDiscord | <dom96> But I wasn't thinking about doing it for all packages |
12:53:24 | FromDiscord | <dom96> it's something that you should be able to run on specific packages |
12:53:33 | FromDiscord | <dom96> and it was inspired by a Rust program that looks for `unsafe` |
12:53:37 | FromDiscord | <dom96> can't remember it's name though |
12:53:45 | FromDiscord | <Rika> runsafe |
12:53:49 | FromDiscord | <Rika> I'd name a program that |
12:54:02 | FromDiscord | <Rika> Lol (I don't know the name, I'm just guessing) |
12:54:05 | * | Kaivo joined #nim |
12:56:54 | FromDiscord | <Varriount> Wow, lots of PRs popping up today |
12:57:15 | FromDiscord | <Clyybber> Araq: Hmm, WDYT about attaching scopes to symbols? |
12:57:29 | FromDiscord | <Clyybber> This would make template scope mixing perhaps easier |
12:57:33 | Araq | I don't like it |
12:57:57 | Araq | scopes are mutable |
12:58:12 | Araq | and poorly understood |
12:58:53 | FromDiscord | <Varriount> Poorly understood from an implementation perspective, or a conceptual perspective? |
13:00:55 | Yardanico | Araq: well I seem to have minimized it to less than 100 loc |
13:01:12 | Yardanico | "(allocCount: 30020, deallocCount: 25018)" |
13:01:14 | Yardanico | https://gist.github.com/Yardanico/817a7a7c71344ddb8f5aa1374ee466d0 |
13:01:35 | Yardanico | if you just do Future and not Future[T] - leak disappears |
13:01:41 | Yardanico | maybe because then the type is just aliased |
13:01:55 | Yardanico | or if you use FutureBase directly |
13:02:01 | FromDiscord | <Clyybber> Araq: Should `template a: untyped = proc p() {.gensym.}; proc p() {.gensym.} = discard` work? |
13:03:23 | Yardanico | seems to be related to " stackTrace: seq[StackTraceEntry]" directly |
13:03:34 | Yardanico | if I remove that field and it's initialization - there's "almost" no leak |
13:03:38 | Yardanico | "(allocCount: 25018, deallocCount: 25017)" |
13:04:17 | Yardanico | yeah seems like it doesn't dealloc this stackTrace field |
13:04:45 | Araq | Clyybber: good question |
13:05:20 | Araq | so ... |
13:05:41 | Araq | Telegram tells me I can only use it until September the 1st unless I update my OS |
13:05:46 | Yardanico | wat |
13:06:05 | Yardanico | huh, do they want to not support win7 anymore? |
13:06:08 | Araq | problem is updating my OS (X) is impossible because my hard disk lacks the space for an update |
13:06:12 | Yardanico | oh osx |
13:06:21 | Yardanico | ah sorry you're on win10 right |
13:06:37 | Yardanico | there are two Telegram apps for macOS - one is telegram desktop, other is "native" one |
13:06:38 | Araq | and I cannot attach an external disk either because OSX doesn't support NTFS |
13:06:52 | Araq | any solutions? |
13:07:17 | Yardanico | which telegram do you use? |
13:07:29 | Yardanico | there's https://apps.apple.com/us/app/telegram/id747648890 which is the native telegram I was talking about |
13:07:35 | Yardanico | "Compatibility |
13:07:35 | Yardanico | OS X 10.11 or later, 64-bit processor" |
13:08:16 | Araq | I'll probably simply buy a new laptop tbh |
13:08:57 | Araq | don't know a single feature I'll miss from mac. certainly not the broken keyboard and the lack of games |
13:09:04 | Yardanico | hehe |
13:09:38 | FromDiscord | <Rika> Perhaps the trackpad |
13:10:11 | Araq | ah damn, will miss valgrind |
13:10:30 | Araq | maybe the sanitizers have become good enough though |
13:12:16 | Yardanico | well if I try to run that leak example with clang's memory sanitizer (with orc and -d:useMalloc), it exits on "use of uninitialized value" in orc.nim |
13:12:23 | Yardanico | in collectWhite |
13:12:25 | Yardanico | :D |
13:12:39 | FromDiscord | <dom96> valgrind works on Linux right? |
13:12:43 | Yardanico | not on windows |
13:12:52 | Yardanico | and 4raq doesn't like linux a lot :P |
13:12:53 | federico3 | dom96: yes |
13:13:04 | FromDiscord | <dom96> Araq can use WSL |
13:13:07 | Yardanico | ah right |
13:13:09 | Yardanico | that's a thing now |
13:13:47 | FromDiscord | <Clyybber> I doubt it works with valgrind though |
13:13:52 | Yardanico | it does |
13:14:01 | Yardanico | wsl2 virtualises the whole kernel with HyperV |
13:14:02 | FromDiscord | <Clyybber> hardware watchpoints too? |
13:14:21 | Yardanico | not sure about that :P |
13:14:23 | Araq | Yardanico: do we use uninited data in collectWhite? |
13:14:36 | Yardanico | Araq: well clang errors on line 244 in orc.nim |
13:14:43 | Yardanico | "if t.color == colWhite and (t.rc and isCycleCandidate) == 0:" |
13:15:55 | Oddmonger | is it possible to have 0 padding with strformat ? Like {foo:03.2f} (which compiles but does not add zeros before) |
13:15:56 | FromDiscord | <Clyybber> gensymmed but untyped (as in no symbols but idents) doesn't really make sense does it? |
13:16:00 | Yardanico | maybe the stack trace is wrong |
13:16:48 | Oddmonger | strangely in the sample of strformat page, it seems to be the right way to do |
13:17:19 | FromDiscord | <Clyybber> Araq: Do we support such stuff? Gensymmed untyped idents? |
13:17:27 | Oddmonger | well, never mind. > is better |
13:18:05 | Araq | Clyybber: yeah |
13:18:25 | Araq | in fact, gensymed symbols usually start with "untyped" (sym.typ == nil) |
13:18:43 | Araq | as type checking is done after symbol lookup |
13:19:36 | FromDiscord | <Clyybber> Oh, yeah, I meant to say: Do we support gensymmed, non-symbol-lookuped idents |
13:19:49 | FromDiscord | <Clyybber> If that makes any sense :p |
13:20:07 | Araq | no, idents cannot be gensymed |
13:20:13 | FromDiscord | <Clyybber> Ok, good |
13:20:43 | Araq | Yardanico: so what's the best test case that leaks? |
13:20:54 | Yardanico | Araq: the one I posted in the issue |
13:21:00 | Yardanico | it's the one related to debug stack trace info |
13:21:09 | Yardanico | https://github.com/nim-lang/Nim/issues/15076#issuecomment-664382380 |
13:21:10 | disbot | ➥ Memory leaks with async (closure iterators?) under ORC ; snippet at 12https://play.nim-lang.org/#ix=2snX |
13:21:39 | Yardanico | if i rremove stack trace lines (the field and it's initialization) - there's basically no leak |
13:22:12 | Yardanico | also it only leaks with object inheritance, if you directly use FutureBase - it doesn't leak |
13:24:03 | * | hoijui quit (Ping timeout: 272 seconds) |
13:25:56 | Yardanico | i tried removing one of the closure iterators (or even just the closure proc), but they seem to be needed |
13:26:45 | Yardanico | but at least even now async leaks much, much less with orc (with -d:release or -d:danger) |
13:28:13 | * | pietroppeter joined #nim |
13:28:34 | Yardanico | with 100mil iterations of the first snippet in the issue (the one with async macro) with orc and danger - "(allocCount: 500080010, deallocCount: 499960007)" |
13:29:05 | Yardanico | btw, about getAllocStats - should allocCount and deallocCount always match for ARC, and always match for ORC after GC_fullCollect() ? |
13:31:38 | Araq | not yet as we don't free the gDisp variable |
13:31:50 | Yardanico | oh |
13:32:00 | Yardanico | I mean for cases other than async :) |
13:32:15 | Yardanico | and when there's no cycles (for arc) |
13:32:34 | Araq | yes but in general you need to beware that globals can keep things alive |
13:32:45 | Yardanico | ah right |
13:33:18 | FromDiscord | <dom96> what do these alloc/dealloc numbers look like for the default GC? |
13:33:26 | Yardanico | it doesn't support them I think |
13:34:49 | FromDiscord | <dom96> hrm, would it be difficult to introduce? Might be useful to see if A) the default GC also leaks B) the globals are to blame. |
13:35:42 | Araq | dom96: we do support -d:nimTypeNames and listing the alive objects with the old GCs |
13:35:59 | Araq | and we know it's quite free of leaks |
13:36:26 | FromDiscord | <dom96> sure, I know, I used that to find some leaks myself |
13:36:42 | Araq | but the numbers are never as precise as ORC because of the conservative stack tracing |
13:37:01 | FromDiscord | <dom96> would be nice to have the same alloc/dealloc numbers though |
13:37:25 | Zevv | disruptek awake yet? |
13:37:31 | Araq | well in theory the numbers should be the same, we don't elide allocations |
13:37:39 | Araq | (though we should...) |
13:38:52 | Yardanico | Araq: well for 100 thousand futures with refc getAllocStats() says "allocCount: 33" |
13:38:58 | Yardanico | and deallocCount: 25 |
13:39:16 | Yardanico | which is kinda wrong I think |
13:39:42 | Araq | maybe it counts blocks requested from the OS |
13:40:39 | Yardanico | btw will when defined(gcOrc): still be available in the future? |
13:41:01 | Araq | sure |
13:42:32 | Yardanico | seems like the nimyaml creator is okay with supporting orc in the future (when it doesn't leak for sure), and they said they'll look into removing the "source" pointer used in the lexer |
13:42:33 | Yardanico | https://github.com/flyx/NimYAML/issues/85 |
13:42:34 | disbot | ➥ NimYAML compatibility with ARC/ORC. |
13:43:34 | FromDiscord | <dom96> Why don't we finally introduce a nice ``gc`` enum instead of ``gcOrc`` and whatever else? |
13:43:44 | FromDiscord | <Clyybber> we do have something like that |
13:43:50 | FromDiscord | <Clyybber> but its not an enum rn afaik |
13:44:05 | FromDiscord | <Clyybber> but a string |
13:52:07 | Araq | wow |
13:52:16 | Araq | if I comment out |
13:52:23 | Araq | #result.stackTrace = getStackTraceEntries() |
13:52:34 | Araq | the deallocation count is off by one only |
13:52:44 | Yardanico | exactly |
13:52:47 | Yardanico | :P |
13:52:48 | FromDiscord | <Clyybber> so its stackTraces not getting freed |
13:52:55 | FromDiscord | <dom96> nice |
13:53:02 | FromDiscord | <Clyybber> and if you comment that out, only the last one is not getting freed |
13:53:15 | Yardanico | I said the thing about stack trace before btw :P |
13:53:29 | leorize[m] | is @euantorano here? |
13:53:46 | leorize[m] | I'm not sure what's their irc handle |
13:54:00 | Araq | and cursor inference makes ORC so much faster ... |
13:54:10 | Araq | (in theory) |
13:54:19 | Araq | it's a pure beauty |
13:54:45 | Yardanico | did you look into the cursorifier issue I reported yet? although it's still not truly minimized (depends on lists module) |
13:54:49 | leorize | euantor: are you euantorano on github? |
13:55:12 | Araq | Yardanico: no, that's scheduled as my next bugfix |
13:55:15 | Yardanico | ah nice :D |
13:55:39 | FromDiscord | <dom96> does ARC work wellish with JS backend (yet)? |
13:55:51 | leorize | arc doesn't exist for js :P |
13:56:03 | leorize | the entire gc switch is now ignored on js fwiw |
13:56:15 | Yardanico | @dom96 it wouldn't make sense |
13:56:21 | Yardanico | you can't control memory in JS really |
13:56:32 | Araq | you can, ArrayBuffer etc |
13:56:34 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:56:35 | Yardanico | oh |
13:56:46 | Yardanico | would that be faster than using the native JS's gc though? |
13:56:53 | leorize | obviously not :P |
13:57:07 | FromDiscord | <dom96> What I'm trying to get at is: are the ARC improvements going to enable less NimCopy's? |
13:57:15 | FromDiscord | <dom96> or rather, have they already? |
13:57:20 | leorize | already |
13:57:29 | FromDiscord | <dom96> I recall Araq saying that they would |
13:57:35 | Araq | yeah |
13:57:43 | Araq | but not yet implemented |
13:57:54 | leorize | a side effect of arc is that destructors and move semantics are developed further and optimized :P |
13:57:59 | Araq | maybe there is a fortunate interaction that I'm unaware of |
13:58:19 | FromDiscord | <dom96> leorize: `:P :P :P :P :P` |
13:58:26 | Araq | leorize: the JS backend doesn't take advantage of moves though |
13:58:27 | Yardanico | :P is nice! |
13:58:40 | FromDiscord | <Clyybber> :p |
13:59:16 | leorize[m] | it's a habit of mine to mask my poor english to avoid offending people xd |
13:59:33 | Yardanico | oh right about the ircord bridge - a few days ago I added irc formatting -> markdown and markdown -> irc, but didn't test it extensively though |
13:59:41 | Yardanico | since I have nim irc logs parsed, maybe I can try to test it on that |
13:59:47 | * | jjido joined #nim |
14:00:04 | FromDiscord | <dom96> Your English is indistinguishable from someone that's a native speaker IMO |
14:00:24 | Yardanico | yeah, leorize[m]'s english is pretty nice |
14:00:29 | Yardanico | mine is kinda worse :P |
14:00:59 | Araq | problem with ArrayBuffers is DOM interop |
14:01:15 | Araq | otherwise I would have tried them for Karax back then |
14:01:17 | FromDiscord | <dom96> Also I actually do use ArrayBuffers in my game |
14:01:42 | * | vicfred quit (Quit: Leaving) |
14:02:02 | * | vicfred joined #nim |
14:02:05 | FromDiscord | <dom96> Otherwise serializing the data structures into thrift binary would have been a bigger pain than it was |
14:02:41 | leorize[m] | I'm terrible at figuring out the tone though, so my messages might come across as offensive |
14:02:45 | leorize[m] | but thanks for the compliment :) |
14:03:34 | FromDiscord | <dom96> Maybe it's just me, but I'm starting to associate the use `:P` with a negative tone. |
14:03:41 | FromDiscord | <dom96> (edit) 'Maybe it's just me, but I'm starting to associate the use ... `:P`' => 'Maybe it's just me, but I'm starting to associate the useof' |
14:03:43 | FromDiscord | <Clyybber> the trick is to actively spout bad english so when you accidentally insult someone, they'll know its because of your bad english |
14:04:04 | Yardanico | thanks |
14:04:08 | Yardanico | i'll remember that |
14:04:18 | Yardanico | + |
14:04:31 | FromGitter | <Lecale> I think it depends on the size of the toungue :p or :P |
14:04:32 | Yardanico | sory diden't men to sent "+" |
14:04:48 | FromDiscord | <Clyybber> lol, its the opposite for me, I use `:p` to turn something that could be interpreted in a negative way into a tongue-in-cheek, nicey way :p |
14:05:20 | FromDiscord | <Rika> I think I'm slowly transitioning from :P to xd |
14:05:31 | Yardanico | that's worse |
14:05:32 | Yardanico | imo |
14:05:47 | Yardanico | and then you'll also start using "bruh" |
14:05:50 | leorize | @dom96 #15093 should address the getAppFilename issue by documenting it |
14:05:51 | disbot | https://github.com/nim-lang/Nim/pull/15093 -- 3os: documents potential security implications of getAppFilename |
14:06:13 | FromDiscord | <dom96> Obviously need to transition to :Þ |
14:06:49 | Yardanico | sure :P |
14:06:52 | Yardanico | what about :) |
14:07:05 | FromDiscord | <Clyybber> what about :)))))))))) |
14:07:17 | Yardanico | but yes, I think I use ":P" so it doesn't sound harsh or rude too |
14:07:24 | FromDiscord | <Clyybber> fits the honeybadger |
14:07:25 | leorize | `:)` is context-dependent, the facebook version of that emoji looks like you're dead inside |
14:07:38 | FromDiscord | <Clyybber> appropriate emoji, thanks |
14:07:40 | Yardanico | well it's true |
14:07:49 | FromDiscord | <dom96> It doesn't matter what emote you use, if what you're saying sounds rude to someone then an emote won't help. It'll just cause an association between that emote and rudeness. |
14:07:59 | FromDiscord | <Recruit_main707> 🙂 discord one also looks pretty dead |
14:08:00 | FromDiscord | <Clyybber> fuck you :) |
14:08:08 | FromDiscord | <Clyybber> :p |
14:08:14 | FromDiscord | <Rika> Yardanico: okay. |
14:09:19 | Yardanico | @Clyybber fuck you /s :) :P :D xd bruh |
14:09:32 | FromGitter | <Lecale> An I know nothing about compilation question - is there an obvious solution to the issue I raised here https://github.com/halonium/halonium/issues/1 , short of wearing a tin foil hat :p :p xd stfuartfm |
14:09:33 | disbot | ➥ Compilation Error |
14:09:49 | FromDiscord | <Clyybber> @Yardanico reported to the discord server admins |
14:09:49 | Yardanico | hrm |
14:09:52 | FromDiscord | <dom96> What I'm guessing happens is: you write a message that you know may be construed as rude, so you throw in a `:P`. The person that reads it can see that it's rude and the `:P` loses it's cheeky interpretation. |
14:11:05 | Yardanico | @Lecale I think you need libzip |
14:11:16 | Yardanico | but I'm not sure how zip package imports libzip |
14:11:25 | leorize | they might be missing zlib, not sure |
14:11:55 | FromDiscord | <Clyybber> @dom96 just out of curiousity, did you think that about this message https://discordapp.com/channels/371759389889003530/371759389889003532/736940642336374816 too ? |
14:12:17 | Yardanico | btw, as I said yesterday - I published #nim message sqlite db |
14:12:29 | Yardanico | in https://github.com/timotheecour/Nim/issues/126#issuecomment-663849153 |
14:12:32 | disbot | ➥ need a way to access raw db for gitter, irc, forum, enables more powerful search on local clients via raw db access ; snippet at 12https://play.nim-lang.org/#ix=2srB |
14:12:42 | Yardanico | we really need a DB for the forum too |
14:12:50 | Yardanico | it contains a lot of useful info which can be kinda hard to find |
14:12:53 | Araq | Yardanico: if I remove the [T] it also works |
14:13:01 | Yardanico | Araq: yes I know :P |
14:13:03 | Araq | so it's not inheritance |
14:13:07 | Yardanico | oh |
14:13:10 | Araq | it's generic inheritance |
14:13:21 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:13:34 | FromGitter | <Lecale> cool |
14:13:36 | Yardanico | well I know that it works when removing [T], maybe I should've left that in the comments |
14:13:49 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:14:26 | * | fredrikhr joined #nim |
14:14:33 | FromDiscord | <dom96> @Clyybber I wouldn't call it rude, but it definitely annoyed me at the time. |
14:15:06 | FromDiscord | <Clyybber> yeah, thats why I added the :p, because I thought it might be annoying |
14:15:13 | FromDiscord | <dom96> lol |
14:15:14 | FromDiscord | <Clyybber> didn't work :p |
14:15:18 | Yardanico | there are only 23k messages with :P in #nim |
14:15:29 | FromDiscord | <dom96> and hence my hatred for `:P` grew |
14:15:32 | Yardanico | out of ~1238755 total |
14:15:33 | FromDiscord | <Clyybber> lol |
14:15:44 | * | mbuchel joined #nim |
14:15:53 | Yardanico | https://i.imgur.com/Ho9O4fx.png |
14:16:04 | mbuchel | is there a way to have a circular reference? |
14:16:06 | mbuchel | in nim |
14:16:07 | Yardanico | yes |
14:16:19 | mbuchel | i mean recursive import |
14:16:26 | Yardanico | well it's partially possible |
14:16:36 | mbuchel | how would i do it? |
14:16:43 | FromDiscord | <dom96> Yardanico: You should see how many of those started showing up recently 😄 |
14:16:50 | Yardanico | I know :( |
14:17:08 | Yardanico | there are 714 messages containing 🙂 |
14:17:10 | FromDiscord | <Clyybber> lol :( |
14:17:14 | leorize[m] | mbuchel: you don't, the "partial" way is buggy at best and should be avoided |
14:17:20 | Yardanico | is it? |
14:17:24 | FromDiscord | <Clyybber> its not buggy |
14:17:26 | Yardanico | I think 4raq said it actually works pretty well |
14:17:31 | Yardanico | if you actually use it properly |
14:17:33 | leorize[m] | currently the best we can do is to bundle everything into one file |
14:17:49 | Yardanico | oh yeah I also found some nice troll messages in the DB |
14:18:00 | FromDiscord | <lqdev> mbuchel: see the example here https://nim-lang.org/docs/manual.html#modules |
14:18:08 | mbuchel | i am really against bundling everything inside one file, especially with the protocol i am working on currently |
14:18:10 | FromDiscord | <dom96> Monorepo? Let's go a step further and create monofiles 😄 |
14:18:12 | leorize[m] | if `a <-> b` and you setup `b` so that `import a` works, `import b` explodes. |
14:18:29 | Yardanico | nimx uses circular imports btw |
14:18:42 | FromDiscord | <dom96> mbuchel: you're best off using the utils/types pattern in my experience |
14:18:52 | mbuchel | yep that is what i am doing |
14:19:03 | mbuchel | but the protocol i am working on was very poorly designed |
14:19:08 | mbuchel | and has recursive imports |
14:19:18 | Yardanico | does that matter really? |
14:19:27 | Yardanico | you can always kinda restructure it |
14:19:30 | leorize[m] | why does recursive import have anything to do with a protocol? |
14:19:33 | mbuchel | you have a file ei, which requires pyld, but pyld requires ei |
14:19:49 | mbuchel | i am trying to match the same as the xsd file they provide for the protocol |
14:20:07 | mbuchel | so it would be easier to expand in the future |
14:20:55 | Yardanico | english language be like https://i.imgur.com/7xWUxyk.png |
14:20:56 | mbuchel | also thanks for that modules section |
14:21:04 | mbuchel | there are some things from there i can use |
14:21:24 | Yardanico | oh no there's dom using :P in that screenshotr |
14:21:25 | Yardanico | busted |
14:21:45 | leorize | lol |
14:22:05 | Yardanico | uhh guess my english was influenced a bit by this chat :P |
14:22:11 | Yardanico | https://i.imgur.com/UpQcNFj.png |
14:23:08 | FromDiscord | <dom96> Yardanico: fake news |
14:23:09 | FromDiscord | <Clyybber> you turned the so yeah into well yes |
14:23:17 | Yardanico | well yes, well yes |
14:23:41 | FromDiscord | <dom96> I like how most of what I write ends with a period. |
14:23:53 | Yardanico | I wonder what can happen if I use markov chains on this DB |
14:23:56 | Yardanico | https://i.imgur.com/kFMdpWd.png |
14:23:59 | FromDiscord | <dom96> But yeah, I did use `:P` in the past |
14:25:00 | supakeen | :p |
14:25:22 | Yardanico | :) has been used more times than :P in total |
14:25:27 | Yardanico | only 1k message difference though |
14:25:30 | supakeen | dom96: what library did you rock for the star game or something by yourself? |
14:25:59 | FromDiscord | <dom96> supakeen: I wrote one: gamelight |
14:26:11 | FromDiscord | <Clyybber> Araq: This doesn't seem to be needed anymore https://github.com/nim-lang/Nim/blob/devel/compiler/semexprs.nim#L1206 (checked with the tests), is it ok to remove? |
14:26:29 | FromDiscord | <dom96> Ugh, I thought I could disable link previews in Discord |
14:26:34 | Yardanico | you can't :( |
14:26:42 | FromDiscord | <dom96> but it also disables them when someone pastes image links |
14:26:53 | FromDiscord | <dom96> pretty sure that's a bug because it displays a white space |
14:26:58 | FromDiscord | <dom96> and not the image link itself |
14:27:20 | Araq | clyybber, yeah if the CI says everything is fine it's safe to be removed |
14:27:25 | FromDiscord | <dom96> Maybe it's time I transition to IRC again |
14:27:26 | supakeen | Ah I see, I've been toying with `nico` :) |
14:28:11 | FromDiscord | <dom96> supakeen: yeah, nico is cool but has some specific limitations AFAIK |
14:28:20 | FromDiscord | <dom96> like I don't think I'd be able to build Stardust using it |
14:28:26 | Yardanico | well that's what nico was made for |
14:28:28 | Yardanico | something like pico8 |
14:28:37 | Yardanico | create pixel games easily |
14:28:42 | FromDiscord | <dom96> yeah |
14:28:46 | supakeen | Yea I'm currently scratching my game-building itch for a dungeon crawler with nico and so far i'm ok. |
14:28:55 | supakeen | Love the simplistic pico8 api indeed. |
14:29:47 | FromDiscord | <dom96> Yeah, it's good to have restrictions. They help creativity especially with games. |
14:29:48 | Yardanico | well I have a small game-buildting itch, but either for an osu!mania clone or an RTS (which is much harder than an osu!mania clone) |
14:30:10 | FromDiscord | <dom96> Yardanico: just gotta c2nim 0 A.D. 😄 |
14:30:14 | Yardanico | lol |
14:30:25 | Yardanico | maybe Zero-K instead? :) |
14:30:35 | supakeen | RTS sounds cool too. |
14:30:42 | Yardanico | There's an open source Spring engine for RTS |
14:30:45 | Yardanico | and Zero-K - https://github.com/ZeroK-RTS/Zero-K |
14:30:46 | supakeen | Any specific ideas about it if you just think freely without being realistic? :) |
14:31:20 | Araq | no matter what game you program |
14:31:29 | Araq | if you make it "text based" I'm gonna kill you |
14:31:33 | Yardanico | nonono |
14:31:37 | Araq | I hate this terminal bullshit |
14:31:46 | Yardanico | I was born after the text-based games era :) |
14:31:47 | FromDiscord | <Clyybber> you will kill *me* |
14:31:48 | Araq | even DOS had better stuff |
14:32:05 | FromDiscord | <dom96> nethack ftw |
14:32:10 | supakeen | nimhack |
14:32:18 | FromDiscord | <Clyybber> I don't know why, but theres something that intrigues me about text based games |
14:32:36 | FromDiscord | <dom96> now can we create a multiplayer nethack hmmmm |
14:32:39 | supakeen | what if i pretend to draw a terminal with sdl? |
14:32:46 | FromDiscord | <Clyybber> now that, that is shit |
14:32:48 | Yardanico | there's an imgui-like lib for terminal btw |
14:32:49 | FromDiscord | <Clyybber> that I hate |
14:33:07 | Araq | supakeen: that's the start of every good game engine with hot code reloading |
14:33:12 | Araq | :D |
14:33:23 | supakeen | i think that's how dwarf fortress does it nowadays |
14:33:31 | supakeen | though perhaps they still have different backends :) |
14:33:33 | FromDiscord | <Clyybber> dwarf fortress still has TEXT_MODE |
14:33:52 | Araq | press tab and get quake's console. and even that one is better than iTerm |
14:33:53 | FromDiscord | <Clyybber> but with the steam release it will get a nice graphical mode |
14:34:11 | Araq | (Nah, iTerm is ok) |
14:35:07 | supakeen | Is that the one that does DNS lookups for all the text you select? |
14:35:48 | supakeen | Ah yes, and the one that had code execution if you look at the wrong bytes (e.g. a logfile). |
14:36:18 | supakeen | I will not understand why that terminal is so complex at least they fixed column redraws on it. |
14:40:18 | euantor | leorize: Apologies for the delay; yes I'm `euantorano` on GitHub :) |
14:40:26 | Yardanico | i have to agree, some people try to add some stupid features to terminal emulators |
14:40:31 | Yardanico | like why would you need images in the terminal |
14:40:33 | Yardanico | use a proper GUI then |
14:40:46 | Yardanico | (looking at people who use it exclusively for neofetch) |
14:40:57 | FromDiscord | <Rika> :BlobSweatAnimated: |
14:41:19 | leorize | euantor: can you help me figure out why stdlib/tssl in #15066 just exit with error code 1 on freebsd? thanks :) |
14:41:20 | disbot | https://github.com/nim-lang/Nim/pull/15066 -- 3asyncnet, net: don't attempt SSL_shutdown if a fatal error occurred |
14:41:30 | FromDiscord | <Rika> Ngl I was considering using a term emu for that feature |
14:42:23 | euantor | leorize: I can certainly take a look, though I'm at work right now. I'll try have a quick look now and might have to get back to you later |
14:45:16 | * | FromDiscord quit (Remote host closed the connection) |
14:45:31 | * | FromDiscord joined #nim |
14:50:13 | FromDiscord | <exelotl> about text-based games... someone released a beautiful looking ascii tileset for my favourite roguelike https://github.com/PropFeds/terminal-blues |
14:50:37 | FromDiscord | <exelotl> I find it really hard to play though |
14:50:48 | FromDiscord | <exelotl> i've been playing with the default graphical tiles for years |
14:52:12 | FromDiscord | <exelotl> now I have to remember that a yellow "b" is a fire beetle, a pink "b" is a grid bug |
14:59:12 | FromDiscord | <Varriount> dom96: It's a shame there are no when-case statements. They would be helpful (at least internally for the compiler/standard library) |
15:00:02 | FromDiscord | <Varriount> exelotl: What is POWDER like? Hardcore and intricate, or more forgiving? |
15:00:17 | solitudesf | its not forgiving |
15:00:43 | solitudesf | its like a less complicated nethack, i suppose |
15:00:45 | FromDiscord | <Rika> well its a roguelike |
15:02:40 | disruptek | !last zevv |
15:02:40 | disbot | Zevv spoke in 12#nim 85 minutes ago 12https://irclogs.nim-lang.org/27-07-2020.html#13:37:25 |
15:02:42 | disruptek | so. |
15:02:54 | Zevv | so. |
15:03:02 | disruptek | do we write ast that is correct or ast that works? |
15:03:04 | Zevv | this town is too small for the both of us |
15:03:08 | disruptek | lol |
15:03:15 | disruptek | g'day zevv |
15:03:20 | Zevv | moin disruptek |
15:03:22 | Zevv | slept well? |
15:03:35 | disruptek | too many bugs up here. |
15:03:51 | Zevv | know the feeling |
15:04:01 | * | audiofile joined #nim |
15:04:09 | disruptek | TIL nnkConv |
15:04:21 | Zevv | what is that stuff even |
15:04:35 | Zevv | you just put in a dotExpr and hoped that made sense, right |
15:04:53 | disruptek | no, it was nnkCall. |
15:05:13 | Araq | using nnkCall to construct type conversion is correct btw |
15:05:17 | disruptek | but, nnkConv doesn't seem to work. |
15:05:24 | disruptek | hence my query. |
15:05:28 | disruptek | do we write ast that is correct or ast that works? |
15:05:45 | Araq | nnkConv isn't correct, it's part of Nim's black hole |
15:05:47 | Zevv | let me draw a little venn diagram |
15:05:53 | Araq | which is sem'checked ASTs |
15:06:16 | Zevv | so, what would you recommend |
15:06:59 | disruptek | he's going to recommend typed. |
15:07:11 | disruptek | but we shouldn't have to go there yet. |
15:07:25 | Araq | construct untyped ASTs |
15:07:40 | disruptek | l0rd knows i'm trying. |
15:09:05 | * | altarrel joined #nim |
15:10:25 | * | maier quit (Ping timeout: 240 seconds) |
15:10:34 | Zevv | so, we could go with the cast, but only if we cna properly isolate the underlying problem of the conversion going wrong and file a proper nim issue for that |
15:10:41 | Zevv | because I would really hate to have the cast in cps |
15:10:53 | Zevv | I feep cps might end op being provable somehow, and with a cast you throw that away |
15:11:03 | disruptek | it's already proven. |
15:11:16 | disruptek | anyway, i don't care. |
15:11:35 | Zevv | cast away, then |
15:11:37 | disruptek | i'm trying to develop semantics. the machinery isn't important to me. |
15:12:24 | disruptek | oh, the root cast /was/ a dotexpr |
15:12:39 | Zevv | right |
15:12:57 | Zevv | not sure if nim understands your intention there. |
15:13:04 | disruptek | the child cast /is/ a call. |
15:13:11 | FromGitter | <alehander92> why cast |
15:13:12 | Zevv | should also be nnkConv |
15:13:15 | Zevv | WHY CAST?! |
15:13:17 | FromGitter | <alehander92> why is it such a problem |
15:13:18 | Zevv | WHYYYYYYY |
15:13:19 | disruptek | AIIEEEE! |
15:13:19 | FromGitter | <alehander92> to cast |
15:13:22 | FromGitter | <alehander92> i cast often |
15:13:25 | FromGitter | <alehander92> like i get it |
15:13:27 | Zevv | you cast, you fail |
15:13:29 | disruptek | OMGOMGOMGOMG |
15:13:32 | FromGitter | <alehander92> but sometimes he compiler should trust me |
15:13:39 | FromGitter | <alehander92> i mean i am a human |
15:13:43 | Yardanico | but why cast |
15:13:45 | Yardanico | if it's not needed |
15:13:46 | FromGitter | <alehander92> AND I NEED TO BE LOVED |
15:13:52 | disruptek | look, it's like when i used to teach esl to spanish kids in nyc. |
15:14:03 | Yardanico | ============================== |
15:14:08 | disruptek | they were always so confused about the difference between `right` and `correct`. |
15:14:12 | FromGitter | <alehander92> can i interview yourself |
15:14:21 | FromDiscord | <dom96> plz dont cast bois |
15:14:28 | Zevv | screw you guys, I'm going home |
15:14:34 | FromGitter | <alehander92> but how can you have AST without CAST |
15:14:38 | disruptek | i'd tell them, listen, you can stick a banana up your ass -- it fits `right`, but it's not `correct`. |
15:14:51 | Zevv | alehander92: are you pulling legs? |
15:15:09 | Zevv | it's just a tree of sum types. Where is the casting? |
15:15:17 | FromGitter | <alehander92> yeah i have no idea |
15:15:24 | FromGitter | <alehander92> i am just trying to make puns |
15:15:32 | Zevv | ooooh I see it C-AST |
15:15:33 | Zevv | dude |
15:15:41 | Zevv | it's actually pretty good. Too bad I let you explain it |
15:15:47 | FromGitter | <alehander92> it's basic |
15:15:49 | FromGitter | <alehander92> but thank you |
15:15:54 | Zevv | :slow clap: |
15:16:08 | FromGitter | <alehander92> disruptek but what is correct |
15:16:10 | FromGitter | <alehander92> but not right |
15:16:17 | FromGitter | <alehander92> is it a correction facility |
15:16:20 | Zevv | anway disruptek: nnkConv does not solve it for you, so there might be a hole in nnConv - is that a safe conclusion of this adventure>? |
15:16:40 | FromGitter | <alehander92> because i think they might have imperfect work there |
15:16:49 | disruptek | Zevv: not really. |
15:17:23 | disruptek | per araq nnkConv is the domain of typed ast and not our baliwick. |
15:17:39 | disruptek | bailiwick, too. |
15:18:37 | disruptek | i thought my solution to shadowing proc params was pretty cute. |
15:19:25 | Zevv | oh i missed that, tell it to me |
15:19:41 | disruptek | just put the body in a block: |
15:20:34 | disruptek | i'm thinking that we can use the block to do something interesting. |
15:20:42 | disruptek | like exception handling. |
15:21:34 | Zevv | ooh right, why not |
15:21:51 | disruptek | remember that we know the return type and we can stuff the exception in on the way out. |
15:21:58 | Zevv | I spent a few minutes this afternoon to build some primitives like iterators and coroutines |
15:22:08 | disruptek | some day it will generate a nim compiler error, of course. |
15:22:29 | disruptek | where is your commit? |
15:22:46 | Zevv | not there yet |
15:22:56 | * | Zevv is now known as Zevv[m] |
15:23:21 | * | disruptek is now known as disruptek[o] |
15:23:39 | * | Yardanico is now known as yardanico[ok] |
15:23:51 | yardanico[ok] | ok |
15:24:11 | * | yardanico[ok] is now known as Yardanico |
15:24:58 | disruptek[o] | wtf someone stole my asd nick. |
15:25:01 | Yardanico | wtf |
15:25:20 | disruptek[o] | that's bs |
15:27:06 | * | vicfred quit (Quit: Leaving) |
15:27:20 | * | disruptek[o] is now known as disruptek |
15:27:22 | * | disruptek growls. |
15:30:40 | * | hoijui joined #nim |
15:35:10 | Zevv[m] | disruptek: https://github.com/disruptek/cps/blob/master/stash/iterator.nim |
15:35:15 | Zevv[m] | pretty basic stuff |
15:38:56 | Zevv[m] | ore reload, if you like Option[] |
15:39:04 | disruptek | looks good to me. |
15:39:25 | Zevv[m] | we need more trampolining then strictly necessary, maybe |
15:39:28 | Zevv[m] | but I don't care for now |
15:39:36 | Yardanico | btw, why you still need to specify the type ? |
15:39:43 | Yardanico | https://github.com/disruptek/cps/blob/master/stash/iterator.nim#L29 here for example |
15:39:45 | Yardanico | what's the reason |
15:39:51 | disruptek | the ast is untyped. |
15:39:53 | Yardanico | so? |
15:40:00 | disruptek | we cannot infer the type. |
15:40:08 | disruptek | we need the type in order to construct the continuation. |
15:40:09 | Yardanico | just use auto :P |
15:40:19 | disruptek | hard to define objects with auto. |
15:40:55 | disruptek | hmm, i wonder if we could use a fuckton of generics, though. |
15:41:07 | Yardanico | but i hope that this limitation will eventually be removed, right? :P |
15:41:10 | Yardanico | current way looks kinda ugly |
15:41:24 | disruptek | i'm not bothered. |
15:41:24 | Yardanico | also do you really need a while loop in each proc which uses the cps macro? |
15:41:28 | disruptek | no. |
15:43:06 | Zevv[m] | so, there is really no way to punch your code through two macros, right? First do an untyped pass, then a typed one after that |
15:43:27 | Zevv[m] | Yardanico: no, but that's one of the reasons you'd *want* to do this |
15:43:29 | disruptek | i haven't done it, but someone told me it was a thing. |
15:43:56 | Zevv[m] | Yardanico: but do note how cool this is: the concept of 'yield' and 'resume' is all in that file. |
15:44:00 | Zevv[m] | there is no magic |
15:44:50 | disruptek | it's a big deal. eventually, people will understand. |
15:45:01 | disruptek | it'll take time. people need to use this stuff. |
15:45:04 | Zevv[m] | it's like monads |
15:45:48 | * | rockcavera joined #nim |
15:45:50 | disruptek | it's like mescaline, but monads works, too. |
15:46:24 | Zevv[m] | disruptek: I'd like to talk to you |
15:46:25 | Zevv[m] | about rvalues |
15:46:28 | Zevv[m] | or is it too soon for that |
15:46:31 | Zevv[m] | in our relationship |
15:46:48 | Yardanico | about types |
15:46:51 | Yardanico | I know it's a bit of a hack |
15:46:55 | disruptek | we should think about this generics idea first. |
15:46:56 | Yardanico | but what about using typeof |
15:47:15 | Yardanico | var a: typeof(expression) = expression |
15:47:16 | disruptek | it's not possible because the types need to be defined before they are inferred. |
15:47:19 | Yardanico | var a: typeof(5) = 5 |
15:47:42 | Zevv[m] | var a = doThis() |
15:47:52 | Zevv[m] | var a: typeof(doThis()) = doThis() ? |
15:48:03 | Yardanico | yes |
15:48:53 | Araq | this is so weird |
15:49:00 | Yardanico | the leak? :P |
15:49:10 | Araq | Future[T] = ref object of RootObj # about 30_000 allocs |
15:49:21 | Araq | Future[T] = ref object # about 25_000 allocs! |
15:49:22 | Yardanico | :DD |
15:49:37 | Araq | but it's inheriting from nothing, what causes 5000 more allocations? |
15:49:54 | disruptek | method names? |
15:49:55 | FromDiscord | <dom96> wat |
15:50:00 | FromDiscord | <dom96> it's inheriting from RootObj? |
15:50:06 | Yardanico | FutureBase does, yes |
15:50:09 | FromDiscord | <dom96> That's not nothing |
15:50:25 | Yardanico | disruptek: nim async doesn't use methods even if it uses inheritance |
15:50:49 | disruptek | the names are constants but we dispatch dynamically. |
15:51:11 | Yardanico | ah maybe the isObj thing you mean? |
15:51:28 | FromDiscord | <Shucks> ❤️ |
15:51:32 | disruptek | i dunno, it's mere intuition. |
15:53:15 | Zevv[m] | so disruptek, what's next on the list |
15:53:20 | disruptek | generics. |
15:53:56 | Araq | dom96: RootObj is an empty object, inheriting from it doesn't cause more allocations |
15:54:05 | Zevv[m] | disruptek: how generics, tell me |
15:54:10 | Zevv[m] | what do you need to genericize |
15:54:24 | Zevv[m] | because I don't think I needed this yet? |
15:54:26 | disruptek | noroutine field values. |
15:54:33 | Zevv[m] | hmmm |
15:54:58 | Zevv[m] | is that something we need *now* |
15:55:03 | Zevv[m] | and please don't call'em that |
15:55:14 | disruptek | lol |
15:57:03 | Zevv[m] | yarn. floss. twine. |
15:57:04 | Zevv[m] | pick one |
15:57:31 | FromDiscord | <dom96> Araq: and yet it seems it does? 🙂 |
15:57:35 | Zevv[m] | I think generics can wait. It's cool and all but will complicate your macros and will not bring essential stuff on the table now |
15:58:01 | disruptek | it brings type inference, which isn't nothing. |
15:58:19 | Zevv[m] | type inference for what parts? |
15:59:06 | disruptek | noroutine field values. |
15:59:28 | Zevv[m] | yeah but not for stuff on the environment |
15:59:32 | Zevv[m] | which is more painful |
15:59:38 | disruptek | yes, stuff on the environment. |
15:59:44 | Zevv[m] | mo way |
15:59:47 | Zevv[m] | var i = 3 |
15:59:50 | Zevv[m] | 'give i a type' |
15:59:52 | Zevv[m] | you won't solve that |
16:00:24 | Zevv[m] | you want this? http://ix.io/2ss2 |
16:01:21 | Araq | dom96, yeah, it's not explainable |
16:01:32 | Yardanico | wait you can't find the cause of it? |
16:01:39 | Yardanico | i mean not yet :P |
16:01:47 | * | audiofile quit (Quit: Default Quit Message) |
16:02:06 | disruptek | i will solve that. |
16:02:25 | disruptek | Cont[typeof(rando)](fn: ..., rando: rando) |
16:02:26 | Yardanico | now where's our color change on github |
16:02:29 | Yardanico | a month passed |
16:02:40 | Zevv[m] | disruptek: sure, nice. but you wont solve local variables to get type by magic |
16:02:56 | disruptek | the local vars don't need a type; it's inferred. |
16:03:18 | Zevv[m] | no way. |
16:03:22 | disruptek | var rando = env_3(locals_3).rando |
16:03:22 | Zevv[m] | surprise me |
16:03:36 | disruptek | yard gave us the hint. |
16:03:57 | Zevv[m] | no that was wrong |
16:04:04 | Zevv[m] | I just tried, doesnt compute |
16:04:08 | disruptek | why don't you make us `:=`() mr. go lover? |
16:04:16 | Zevv[m] | bah |
16:04:31 | Zevv[m] | neverr |
16:04:57 | disruptek | you tried what? |
16:05:17 | Zevv[m] | var a: typeof(foo()) = foo() |
16:05:53 | disruptek | i dunno what that is. |
16:05:55 | Zevv[m] | var a: typeof(5) = 5 might |
16:06:04 | Yardanico | !eval import strutils; var a: typeof("a b".split()) = "a b".split(); echo a |
16:06:04 | disruptek | i'm talking about something different, i guess. |
16:06:06 | NimBot | Compile failed: /usercode/in.nim(1, 54) Error: type mismatch: got <seq[string]> but expected 'string' |
16:06:27 | disruptek | holdon, i will create an example. |
16:06:34 | Zevv[m] | yes sir please sir |
16:06:47 | Yardanico | disruptek: we're talking about the fact that you have to resort to specifying the type |
16:06:50 | Yardanico | like in that zevv's exampole |
16:06:52 | Yardanico | example* |
16:06:55 | Yardanico | which is IMO quite ugly :) |
16:06:57 | disruptek | i know, chucklehead. |
16:07:12 | disruptek | i mean, yardanico. |
16:07:24 | Zevv[m] | dude |
16:07:26 | Zevv[m] | rude |
16:07:37 | Zevv[m] | I will fry my fries and eat them not. bbl |
16:07:45 | Zevv[m] | s/not/now/ |
16:07:49 | disruptek | http://ix.io/2ss4/nim |
16:08:22 | disruptek | typeless type inference. |
16:09:51 | * | FromDiscord quit (Remote host closed the connection) |
16:10:08 | * | FromDiscord joined #nim |
16:13:42 | FromDiscord | <jcs224> I have a question about convention. If I have a `proc` called `readLine`, which is already in the standard library, what would be the "proper" way to avoid a namespace collision with that existing function? There are quite a lot of keywords in Nim. Coming from JavaScript. |
16:14:02 | Yardanico | well, does your readLine proc have the same signature as the one in stdlib? |
16:14:43 | Yardanico | if signatures are different, there wouldn't be any collisions |
16:14:54 | FromDiscord | <jcs224> Yeah, it takes a `Socket` as the first argument, same as the stdlib one. That's the only argument. |
16:14:57 | Yardanico | if there are collisions, you can always specify the module name before the identifier |
16:15:04 | FromDiscord | <dom96> You don't have to do anything, your `readLine` will already be in a different module and therefore different namespace |
16:15:23 | disruptek | just don't import the stdlib version. |
16:15:26 | Yardanico | lol |
16:16:29 | FromDiscord | <jcs224> Ok thanks. I tried just naming it `readLine` and it works fine. I have to get used to the automatic nature of importing, importing in JS and PHP is much more explicit. I've used Python but very little. |
16:17:18 | Yardanico | you can always use the python way of importing but it's not really needed most of the time :) |
16:19:56 | FromDiscord | <jcs224> and thanks for the super-prompt responses. Loving this language so far! |
16:24:21 | disruptek | leorize: we're missing half the nightlies for devel last couple nights...? |
16:24:53 | leorize | disruptek: it's a bug caused by fusion, only fixed today |
16:24:59 | disruptek | cool. |
16:25:12 | disruptek | i'm loving this new fusion thing. |
16:25:15 | disruptek | really great. |
16:25:47 | disruptek | what else can i do to help? 😉 |
16:27:58 | euantor | leorize: I've had a quick look and posted a comment on the PR. Looks like the process gets a `SIGSEV` |
16:28:57 | * | vicfred joined #nim |
16:29:34 | leorize | thanks for looking |
16:29:45 | leorize | seems to be a bug with threads |
16:40:31 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
16:41:48 | Zevv[m] | whats fusion |
16:42:18 | FromDiscord | <dom96> (bad answers only) |
16:43:10 | disruptek | an innovation to shorten ci runs. |
16:45:45 | bung | old problem, how I test unittest ? |
16:46:27 | Yardanico | just test it ? |
16:46:33 | Yardanico | expected output |
16:47:10 | Yardanico | see e.g. https://github.com/nim-lang/Nim/blob/devel/tests/stdlib/tunittest.nim |
16:47:58 | bung | oh, that's easy, so I just copy paste my console outputs |
16:51:25 | bung | hmm, there's file name line column |
16:51:29 | Yardanico | yes |
16:54:40 | bung | how I hanlde the line column things ? hard code will make it hard to change |
16:55:09 | Yardanico | well don't handle it |
16:55:21 | Yardanico | just insert it in the test, and then tune so the output is the same |
16:57:28 | bung | oh, basically just change some line number ,that's ok |
16:58:34 | * | superbia1 joined #nim |
16:58:39 | * | someunknownuser joined #nim |
16:59:37 | someunknownuser | Hello |
16:59:43 | Zevv[m] | Hello |
17:00:08 | someunknownuser | does anyone know why osproc's hasData proc blocks until data is available? |
17:00:23 | someunknownuser | (at least on linux) |
17:00:30 | * | WilhelmVonWeiner joined #nim |
17:00:45 | * | superbia quit (Ping timeout: 240 seconds) |
17:01:22 | someunknownuser | It looks like it calls select internally, but passes nil for the timeout argument, which results in it blocking until data becomes available. |
17:01:28 | FromDiscord | <dom96> Wow. Julia is doing an AMA on the main IAmA subreddit https://reddit.com/r/IAmA/comments/hyva5n/we_are_the_creators_of_the_julia_programming/ |
17:01:46 | * | pangey quit (Ping timeout: 256 seconds) |
17:01:58 | disruptek | someunknownuser: sounds like a bug. |
17:02:58 | someunknownuser | currently the behavior suggests that the proc should be named/called waitData (or something similar) instead. |
17:03:13 | * | pangey joined #nim |
17:03:30 | Zevv[m] | ej disruptek |
17:03:45 | someunknownuser | The bool return values becomes basically useless, since obviously data is available after it waited for it to become available xD |
17:04:08 | Zevv[m] | we now have 'cps foo()' where foo is `proc foo(c: MyCont, ...): MyCont` right. CPS is a magic keyword |
17:04:23 | disruptek | hai |
17:04:26 | Zevv[m] | what if we make cps an implicit variable in cps functions which is just the current cont |
17:04:33 | Zevv[m] | then we do `cps.foo()` |
17:04:39 | Zevv[m] | and there is less magic. |
17:04:52 | disruptek | jesus it almost makes sense. |
17:05:32 | Zevv[m] | the good thing is that the cps closure is available in the .cps. proc. But the bad thing is that the cps closure is available in the .cps. proc. |
17:05:37 | disruptek | why make it implicit, though? we'll just use cps as our locals. |
17:06:01 | Zevv[m] | yeah, but the user does not declare 'cps' somewhere, or do we take it a argument #1 |
17:06:04 | Zevv[m] | in .cps. procs |
17:06:17 | disruptek | we rewrite them. |
17:06:27 | disruptek | it solves the problem really elegantly. |
17:06:32 | Zevv[m] | yeah but where does the ident "cps" come in, where is it declared? |
17:06:34 | disruptek | see, i knew there was a reason i kept you around. |
17:06:37 | Zevv[m] | Write me an example of how it would look |
17:06:53 | Zevv[m] | Well, I have acres to sniff, but if you put me outside I just bark |
17:07:06 | * | maier joined #nim |
17:07:13 | disruptek | `proc after_17860210(locals_17860216: Cont): Cont` turns into `proc after_17860210(cps: Cont): Cont` |
17:07:22 | Zevv[m] | yeah, right, but 'cps' is implicit for the user |
17:07:32 | Zevv[m] | You don't see where `cps` is declared |
17:07:36 | disruptek | correct. |
17:07:40 | Zevv[m] | right, that's what I mean |
17:07:49 | disruptek | you want to make it explicit? |
17:07:56 | Zevv[m] | not sure. What does it add or solve? |
17:08:11 | Zevv[m] | The good thing is that the state is available from within your .cps. procs, if you like that kind of thing |
17:08:28 | Zevv[m] | but I'm not sure if that's opening pandoras box |
17:08:31 | Zevv[m] | ' |
17:08:37 | disruptek | i agree, it's a little creepy. |
17:09:12 | Zevv[m] | But then again. Imagine our Big Best eventqueue, which will eventualle become the default in the stdlib, is a derivable type |
17:09:28 | Zevv[m] | you can just make your own "Foo as EventQueue" |
17:09:31 | Zevv[m] | put stuff in it |
17:09:33 | Zevv[m] | and have it there |
17:09:40 | Zevv[m] | it's powerful, but maybe a bit too |
17:10:00 | Zevv[m] | All the parent stuff is hidden because not exported, but your stuff is |
17:10:41 | disruptek | i mean, it's not a problem. you have that power anyway -- just call `cps myproc()` and you'll get the continuation. just, not in the same scope. |
17:10:52 | Zevv[m] | right |
17:10:59 | disruptek | once we give you cps, we don't care what you do with it. |
17:11:04 | Zevv[m] | it's Nim, right |
17:11:10 | disruptek | pretty sure, yes. |
17:11:11 | Zevv[m] | I'll take the red one |
17:11:42 | Zevv[m] | I do like explicit over implicit, I think. Problem is that it will not be used in 95% of the cases, probably |
17:11:58 | Zevv[m] | only as a thing to hang your `cont.func()` calls on |
17:12:05 | * | maier quit (Ping timeout: 240 seconds) |
17:12:08 | disruptek | it's easier for people to grok. |
17:12:14 | Zevv[m] | and wait, there's more: can you recognize a cps call if its not a fixed string? |
17:12:18 | disruptek | or is it? i mean, it's magical. |
17:12:32 | Zevv[m] | you need to save the id of arg #1 and match for that |
17:14:00 | * | rockcavera quit (Remote host closed the connection) |
17:14:35 | * | waleee-cl joined #nim |
17:15:51 | Zevv[m] | and probably handle the case where stupid/smart people shadow that, etc |
17:16:04 | Zevv[m] | because you're not *really* calling that thing, you can't know because you are untyped |
17:16:15 | Zevv[m] | it's just a nnkDotExpr |
17:16:24 | disruptek | well, we'll know if it's shadowed. |
17:16:52 | disruptek | but, yeah, it's tricky. i'm wondering if we're going about this all wrong. |
17:17:19 | Zevv[m] | probably. |
17:17:20 | disruptek | now that early return is a thing, maybe we want `return cps.foo()` to be supplied by the user. |
17:17:33 | Zevv[m] | argh |
17:17:53 | disruptek | well, it's explicit. |
17:17:58 | Zevv[m] | yeah but but |
17:18:35 | Zevv[m] | wow btw, what do we do with real 'returns' now, do you handlet them? |
17:18:42 | disruptek | of course. |
17:18:47 | Zevv[m] | because you shouldn't change return semantics |
17:18:53 | Zevv[m] | That'll confuse the hell out of people |
17:19:28 | Zevv[m] | bah then better keep it like it is |
17:19:33 | Zevv[m] | and find a good keyword for 'cps' |
17:19:35 | * | pietroppeter quit (Quit: Connection closed for inactivity) |
17:19:48 | disruptek | you idea is good. |
17:19:53 | disruptek | your idea is good, too. |
17:20:10 | Zevv[m] | yeah, but I now start to crawl back |
17:20:22 | Zevv[m] | like it is now we make 'cps' a keywordy kind of thing |
17:20:34 | disruptek | we can ban shadowing, which is fine. we can always ban renaming the 1st arg. it's cps, always. |
17:20:35 | Zevv[m] | so you can look at code and know for sure that *there* it will go out |
17:20:41 | * | ofelas joined #nim |
17:20:56 | Zevv[m] | if you go cps.yield(), it doesn't show. if cps is called 'foo' in my proc, there's 'foo.this()' and boom you're out |
17:21:10 | disruptek | we ban renaming. |
17:21:23 | Zevv[m] | I can hardle read other peoples code or my own code after two days. but this will be messy |
17:21:26 | disruptek | anyway, "you're out" isn't a thing. |
17:21:28 | FromGitter | <alehander92> are we in USSR |
17:21:28 | FromGitter | <alehander92> now |
17:21:40 | Zevv[m] | no, forget all this. It's a baaad idea mkayy |
17:21:44 | * | pangey quit (Ping timeout: 260 seconds) |
17:21:51 | Zevv[m] | we need to treat it as a keyword |
17:22:01 | Zevv[m] | ask leorize to make it stand out for us |
17:22:09 | FromGitter | <alehander92> CCP or CPS |
17:22:10 | Zevv[m] | because you should read code and know funny stuff is happening |
17:22:24 | disruptek | mmm nah |
17:22:28 | FromGitter | <alehander92> what is this ban renaming thing |
17:22:32 | Zevv[m] | hmmm jah |
17:22:35 | Zevv[m] | read up boi |
17:22:57 | disruptek | the reason we don't use continuations in imperative code is that it's too hard to follow. |
17:22:59 | Zevv[m] | it's not important anyway, because it was a baaaahd idea |
17:23:10 | FromGitter | <alehander92> keywords sound good |
17:23:19 | FromGitter | <alehander92> i believe they are a good idea |
17:23:23 | disruptek | what we're doing is bringing easy style to a hard design. |
17:23:26 | Zevv[m] | like, in general |
17:23:30 | Zevv[m] | you're not the lisp kind of guy |
17:24:02 | FromGitter | <alehander92> disruptek is not a lisp kind of guy |
17:24:13 | Zevv[m] | disruptek: yeah, but it's just too special to hide it. |
17:24:14 | disruptek | if we do our job right, no one has to know how this shit works. |
17:24:18 | Zevv[m] | it is *like* a return |
17:24:26 | Zevv[m] | or a `yield` or a `await` |
17:24:29 | FromGitter | <alehander92> i was such a guy, but then i realized one can quote non-homoiconic code |
17:24:33 | FromGitter | <alehander92> in nim |
17:24:46 | FromGitter | <alehander92> did you decide to do monads after all |
17:24:59 | disruptek | i'm doing nomads. |
17:25:00 | Zevv[m] | ohh wait I see what you mean |
17:25:10 | Zevv[m] | you want to go so far as to hide the fact you're scheduled out |
17:25:11 | Zevv[m] | at all |
17:25:15 | disruptek | i have a sign on the door of my rv that says, "knock if you're horny" |
17:25:43 | FromGitter | <alehander92> if i even knock, dont trust the sign |
17:25:45 | Zevv[m] | dude, it *was* a good idea |
17:25:48 | Zevv[m] | but then we must hide the return |
17:26:03 | Zevv[m] | doing magic io, you do 'magicio.recv()' |
17:26:05 | Zevv[m] | and you get your result |
17:26:14 | disruptek | that's how it works now. |
17:26:14 | Zevv[m] | you don't want to make the 'return magicio.recv()' |
17:26:18 | * | arecacea1 quit (Remote host closed the connection) |
17:26:19 | Zevv[m] | right |
17:26:25 | FromGitter | <alehander92> really sounds like do notation |
17:26:28 | Zevv[m] | because return will just return from your innermost function |
17:26:31 | Zevv[m] | don't go changing that |
17:26:41 | * | arecacea1 joined #nim |
17:27:08 | Zevv[m] | well, I learned that with choices I can't choose from, there's a *reason* i can not choose. |
17:27:20 | Zevv[m] | Either it doesn't make a difference whatever I choose, or I just have not enough information |
17:27:28 | * | endragor quit (Remote host closed the connection) |
17:27:34 | Zevv[m] | this is case #2. I'd like to give it a go |
17:27:35 | disruptek | it's usually dom96's fault, let's be honest here. |
17:27:55 | * | endragor joined #nim |
17:28:37 | Zevv[m] | disruptek: leave dom alone and go type that in |
17:28:46 | Zevv[m] | make it explicit, and renamable |
17:28:54 | disruptek | did you read any donald norman, ever? |
17:29:06 | Zevv[m] | I read a Donald once |
17:29:12 | * | sputny joined #nim |
17:29:20 | disruptek | everyone should read `the design of everyday things` at least. |
17:29:20 | Zevv[m] | the design of things something |
17:29:23 | Zevv[m] | right, that one I read |
17:29:44 | disruptek | so one of the ideas is that people need to form a mental model of how the thing works. |
17:30:01 | disruptek | but in our case, it doesn't need to be based upon reality. |
17:30:21 | disruptek | we give them `cps.foo()` to hang their hat on, but it's just a magical device. |
17:30:43 | Zevv[m] | that was about people smashing into glass doors, right? |
17:30:52 | Zevv[m] | I just remember the parts with blood & violence |
17:31:03 | disruptek | that was the stallone remake. |
17:31:17 | Zevv[m] | right, I do agree. Give them `cps.foo()`, but make `cps` whatever you pass |
17:31:38 | Zevv[m] | because it differs. If it is an event queue I'll call it `evq`. If it is an iterator I'll call it `it`, and for coroutines I'll call it `co` |
17:32:15 | * | endragor quit (Ping timeout: 256 seconds) |
17:32:18 | disruptek | okay, that probably does make some sense. |
17:32:24 | disruptek | but we deny shadows? |
17:32:38 | Zevv[m] | nope |
17:32:48 | Zevv[m] | if you shadow it and call it, it will just be caught by the compiler |
17:32:52 | Zevv[m] | you're just calling the wrong thing |
17:33:08 | disruptek | you could shadow it with the same type, though. |
17:33:14 | Zevv[m] | for good reasons, probably |
17:33:22 | Zevv[m] | it's not differnet then shadowing any var |
17:33:24 | * | pangey joined #nim |
17:33:28 | disruptek | fair enough. |
17:33:32 | Zevv[m] | dude, am I smart or what |
17:33:52 | disruptek | let me get back to you on that. |
17:33:56 | Zevv[m] | do |
17:34:24 | Zevv[m] | also, I don't want to see the word 'cps' in everyday use of this thing |
17:34:40 | Zevv[m] | you implement a coroutine with cps, and from then on you're working with coroutines. Not with cps |
17:35:04 | Zevv[m] | also, beacuse I keep typing csp and can't see the difference between the two |
17:35:59 | disruptek | make some packages, then. |
17:36:24 | Zevv[m] | no, I mean, when you're using the coroutine thingy, you don't need to know what "cps" is |
17:36:34 | Zevv[m] | when you *make* it you do, of course, but not when you *use* it |
17:36:39 | disruptek | i know, so publish a coroutine package named whatever. |
17:36:46 | Zevv[m] | sure, that's what I mean |
17:36:52 | Zevv[m] | but I don't want coroutine users to type "cps" all the time |
17:37:06 | disruptek | then don't make them create their own coroutines. |
17:37:11 | disruptek | provide them a new symbol. |
17:37:24 | Zevv[m] | right |
17:38:12 | disruptek | there are a lot of people that want a properly broad iterator package based on cps. |
17:38:38 | * | ForumUpdaterBot quit (Remote host closed the connection) |
17:38:45 | * | ForumUpdaterBot joined #nim |
17:39:05 | Zevv[m] | yeah sure, but you get what I mean |
17:39:07 | disruptek | okay, there are 3 people. |
17:39:13 | Zevv[m] | they work with 'it', not with 'cps' |
17:39:14 | Yardanico | "we can now pass an int and a float variable with devil compiler. Its fine of course, see" lol |
17:39:27 | Zevv[m] | one day we will say "there's dozens of us", just like the Nim users |
17:41:00 | Zevv[m] | I want 'for' to understand this stuff |
17:41:41 | disruptek | i hope we can rewrite it. |
17:41:55 | Zevv[m] | no, the other way around. Not this stuff to understand `for` |
17:42:03 | Zevv[m] | I want to be able to use `for` to run my iterator |
17:42:26 | disruptek | hmm, i don't know how hard that is. |
17:42:29 | Zevv[m] | I can already do `var a = 3 .. 7`: http://ix.io/2ssv |
17:42:41 | Zevv[m] | can't do that without support from the language, `for` is not reprogrammable |
17:42:50 | Zevv[m] | unless you put the whole caller block into a macro call |
17:43:32 | disruptek | for loop macros are a thing. |
17:43:37 | Zevv[m] | wait waht |
17:43:47 | Yardanico | Zevv[m]: yes |
17:43:49 | * | endragor joined #nim |
17:43:50 | Zevv[m] | dude! |
17:43:51 | Yardanico | we have for loop macros |
17:43:52 | Yardanico | experimental |
17:44:15 | Zevv[m] | \o/ |
17:44:15 | Yardanico | only in devel I think |
17:44:23 | Zevv[m] | good enough for me. Let me whip that up |
17:44:32 | Yardanico | https://nim-lang.github.io/Nim/manual_experimental.html#case-statement-macros-for-loop-macros |
17:44:40 | disruptek | honestly, these are not limitations afaic. |
17:44:48 | disruptek | i mean, consider the alternative. |
17:44:59 | Yardanico | no one stops you from writing "myfor" though |
17:45:11 | disruptek | !repo foreach |
17:45:12 | disbot | https://github.com/disruptek/foreach -- 9foreach: 11A sugary for loop macro with syntax for typechecking loop variables 15 6⭐ 0🍴 |
17:45:36 | Zevv[m] | yeah, but you cnat do "myfor a in myit:" |
17:45:40 | Yardanico | yes |
17:45:47 | Yardanico | it's valid nim syntax |
17:45:52 | Zevv[m] | oh dang |
17:45:54 | Yardanico | so you can make it into real working stuff with macros |
17:45:59 | Zevv[m] | you just ignore the "in" |
17:46:11 | disruptek | foreach a, b in pairs(foo) as int, string: |
17:46:20 | Zevv[m] | let me try the for loop macro |
17:46:25 | Yardanico | Zevv[m]: https://i.imgur.com/9MKXrwE.png |
17:46:48 | Zevv[m] | Yardanico: right, like I say, you ignore the 'in' |
17:46:57 | Zevv[m] | but then you have to call it from within a macro, that's not fair |
17:47:01 | Zevv[m] | oh no that's not true |
17:47:06 | Zevv[m] | right |
17:47:50 | Zevv[m] | hmm but for loop macros require something explicit |
17:48:02 | Zevv[m] | if my iterator is 'it', i need to make a 'each' and do `for a in each(it)` |
17:48:05 | Zevv[m] | I can't make `for a in it:` |
17:48:08 | disruptek | anyway, i'm gonna finish 22 and maybe manage to fix 9 at the same time. |
17:48:18 | Zevv[m] | nooo gimme my explict cps.call() |
17:48:46 | Zevv[m] | oh, or, right fix #22 and maybe #9 at the same time |
17:49:27 | disruptek | give me {.cps: Cont.} which also gives us `cps Cont:` |
17:49:48 | disruptek | and i think `cps foo()` out-of-context should be a trampoline, too. |
17:50:06 | Zevv[m] | yeah, I played with that, but that won't work because 'cps' is taken |
17:50:13 | Zevv[m] | or can you distinguish? |
17:50:17 | disruptek | why not? |
17:50:36 | disruptek | one is a procdef, one is a call, one is a type. |
17:51:15 | Zevv[m] | anyway, that will go away when we do `cps.foo()` |
17:51:20 | Zevv[m] | there is no free-floating cps anymore |
17:51:22 | Zevv[m] | which is good |
17:51:27 | disruptek | sure there is. |
17:51:37 | Zevv[m] | only the .cps. |
17:51:50 | disruptek | the .cps. is what does cps Cont: and cps foo(). |
17:52:06 | Zevv[m] | right, only that. But no fake keyword. |
17:52:11 | disruptek | but whatever, i can write it if it's too hard for you. 😘 |
17:52:21 | Zevv[m] | how is `{.cps: Cont.}` better? |
17:52:46 | disruptek | i forget. |
17:52:50 | * | dmi0 quit (Remote host closed the connection) |
17:52:51 | Zevv[m] | I guess it is. I could only half grasp all this when I wrote it myself |
17:52:55 | Zevv[m] | but now you wrote it I lost it |
17:53:01 | * | endragor quit (Ping timeout: 264 seconds) |
17:53:17 | * | dmi0 joined #nim |
17:54:22 | disruptek | it seems less important now, but the idea was that foo() out-of-context would yield useful error messages. |
17:54:34 | Zevv[m] | that's something different |
17:54:43 | disruptek | now that we are explicit with input and output, it may not be worth worrying about. |
17:54:45 | Zevv[m] | as it should. But if we do cps.foo(), you can not even call it out of context |
17:54:48 | Zevv[m] | because there is no out-of-context |
17:54:54 | Zevv[m] | right'o |
17:55:21 | disruptek | well, cps.foo() would need to be discarded. |
17:55:22 | Zevv[m] | co.resume(), it.produce(), evq.recv() |
17:55:53 | Zevv[m] | oh. Yeah, technically it doesn't be cause it is a fake call |
17:55:58 | Zevv[m] | but if you look at the signatures, it makes sense |
17:56:08 | Zevv[m] | and I still want my rvalue |
17:56:16 | Zevv[m] | I want co.resume() to return something |
17:56:26 | Zevv[m] | but that's not in the signature of resume() |
17:56:30 | Zevv[m] | but wait |
17:56:31 | Zevv[m] | there's more |
17:56:40 | Zevv[m] | because resume is .cps. we can make that |
17:56:45 | disruptek | okay, lemme get to work on this other stuff. |
17:56:57 | Zevv[m] | yeah but I'm just getting started |
17:56:59 | disruptek | i don't think `let foo := cps.bar()` is too hard. |
17:57:11 | disruptek | i just want to do exceptions, too. |
17:57:39 | Zevv[m] | if you put the type in the .cps:Thing., you can drop the explicit return type of the proc |
17:57:44 | Zevv[m] | and put it on by magic, right |
17:58:10 | Zevv[m] | so `proc foo(): Cont {.cps.}` would become `proc foo() {.cps:Cont.}`, is that true? |
17:58:29 | disruptek | maybe we do our casting in the trampoline instead. |
17:58:47 | Zevv[m] | because I was hoping we could make something like `proc foo(): int {.cps: Cont.}` |
17:59:02 | Zevv[m] | and then do my `let a = it.foo()`, somehow |
17:59:17 | Zevv[m] | but indeed, one step at a time |
17:59:19 | disruptek | it seems really doable to me. |
17:59:23 | Zevv[m] | \o/ |
17:59:28 | Zevv[m] | Lua coroutines! |
17:59:51 | disruptek | we need an issue for while: for: while: for: break somewhere |
17:59:57 | Zevv[m] | what you pass to `resume(...)` goes to `yield`, what you pass to `yield(...)` goes to resume |
18:00:20 | disruptek | maybe we just use the yield keyword instead of return. |
18:00:28 | disruptek | it's kinda what we want. |
18:00:39 | Zevv[m] | true, you can just hijack it in the .cps. I guess |
18:01:04 | Zevv[m] | but then again, do we need it |
18:01:31 | disruptek | i think it helps the mental map. |
18:01:32 | Zevv[m] | `let msg = evq.recv(fd)` or `let msg = yield evq.recv(fd)` |
18:01:37 | Zevv[m] | then use `await` instead |
18:01:43 | disruptek | no, we won't use yield there. |
18:02:10 | Zevv[m] | So there's a choice to be made |
18:02:13 | disruptek | hmm, maybe we should. |
18:02:25 | Zevv[m] | will we tell the user what's happening here, make stuff clear and explicit "here you are scheduled out" |
18:02:36 | Zevv[m] | or hide it all as in goroutines. You want to recv? You go recv. |
18:02:44 | ForumUpdaterBot | New thread by Serge: Linking neo to openblas.dll ?, see https://forum.nim-lang.org/t/6605 |
18:03:19 | disruptek | if it's magical and there's a crack in the mirror, the illusion is broken. |
18:03:36 | Zevv[m] | right. So that's the choice |
18:03:54 | disruptek | yield can be optional, too. |
18:03:58 | Zevv[m] | bwaah |
18:04:21 | * | outtabwz quit (Quit: Lost terminal) |
18:04:34 | Zevv[m] | baby steps |
18:05:42 | Zevv[m] | can I ask one more thing and then shut up? |
18:06:35 | Zevv[m] | I think we should drop the concept and make an (empty) base type all CPS's derive from, instead of RootObj |
18:07:05 | Zevv[m] | it's more clear what you are making there (a CPS thing), and if we ever want to put things in CPS for like debugging etc, we can put it somewhere |
18:07:49 | * | oriba quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
18:09:24 | disruptek | eh we have a concept. |
18:09:26 | disruptek | it works. |
18:09:32 | Zevv[m] | listen to me |
18:10:05 | Araq | what? CPS needs a base class |
18:10:07 | Zevv[m] | The concept does not add anything. All iterators will be a ref object that's inheritable anyway |
18:10:26 | disruptek | the concept adds expectation. |
18:10:35 | disruptek | cps doesn't need a base class. |
18:10:44 | disruptek | you supply whatever you want. |
18:10:50 | disruptek | we use it. we love it. |
18:10:53 | disruptek | it's elegant. |
18:11:02 | Araq | need to study it |
18:11:05 | Zevv[m] | right. But now you or I want to add some -d:cpsDebug logic to the CPS impelmentation, and you want ot be able to store stuff somewhere |
18:11:17 | disruptek | and i do. |
18:11:19 | Zevv[m] | if we have a base class (which is just empty usually) |
18:11:21 | Zevv[m] | we have a place |
18:11:26 | disruptek | witness cpsDebug and cpsTrace. |
18:11:35 | Zevv[m] | No, that's for debugging *your particular event queue* |
18:11:37 | Araq | last time I argued successfully it's never gonna work without inheritance (or closures but these use inheritance too) |
18:11:38 | Zevv[m] | not for CPS itself |
18:11:47 | Zevv[m] | it's gonna work |
18:12:02 | Zevv[m] | disruptek: ok, nevermind, it was just a loose idea, it's not important for now |
18:12:05 | disruptek | it works without inheritance (but i think inheritance will ultimately make it faster). |
18:12:19 | Zevv[m] | if you don't use inheritance, you'll need to cast :) |
18:12:19 | disruptek | also, it currently uses inheritance. |
18:12:26 | Araq | ah |
18:12:47 | disruptek | more assumptions are always good when we can get them for free. |
18:12:54 | Oddmonger | i don't find the != equivalent in nim /o\ |
18:13:04 | Oddmonger | i find only doc with == |
18:13:11 | disruptek | != is a template in system. |
18:13:21 | disruptek | it's impl as not(a == b) |
18:13:51 | Oddmonger | ah so != is valid… i was sure it wasn't |
18:13:54 | Oddmonger | thank you |
18:14:10 | disruptek | the two things i want to change about cps, that actually matter, are scopes and generics. |
18:14:12 | FromDiscord | <Rika> if it isnt then maybe the type has no `==` |
18:14:41 | disruptek | generics buys us type inference and scopes buys us simplicity and correctness, not to mention speed. |
18:14:57 | disruptek | but anyway, i need to get to work. bbiab |
18:15:13 | * | someunknownuser quit (Quit: someunknownuser) |
18:15:14 | Araq | Oddmonger: also covered in our tutorials |
18:16:13 | disruptek | Zevv[m]: one last thing... did you actually play with the stack traces? it's pretty cool. |
18:16:20 | Zevv[m] | no, how? |
18:16:40 | * | tane joined #nim |
18:16:48 | disruptek | send stuff to my evq trampoline and enable --cpsTrace and raise an exception at the end of a bunch of calls. |
18:17:05 | Zevv[m] | oh but I never use your trampoline :) |
18:17:07 | Zevv[m] | Will take a look! |
18:23:42 | Zevv[m] | hm stupid question - is there a way to "manually" run a Nim closure iterator? |
18:23:55 | disruptek | sure. |
18:24:01 | Zevv[m] | how? |
18:24:17 | disruptek | there's some syntax, it's like python. |
18:24:56 | Zevv[m] | oh magical finished() |
18:25:06 | Zevv[m] | got it |
18:25:19 | Zevv[m] | ah I knew that |
18:25:47 | Oddmonger | Araq: i'm sure , but didn't find it in the «test» section of tutorial 1 |
18:26:18 | Araq | tutorials are documents you're supposed to read from top to bottom |
18:26:58 | disruptek | holy shit, i been doin' it dumb all this time. |
18:27:17 | Zevv[m] | *it* |
18:29:09 | Zevv[m] | our iterators are only 15 times slower then native nim closure iterators |
18:29:28 | disruptek | no wonder our web-server is so fast. |
18:29:50 | Araq | fixed the leak! |
18:29:57 | Araq | now testing for regressions... |
18:32:00 | Zevv[m] | Soo, what caused the leak? |
18:32:34 | Araq | stupid convoluted logic inside liftdestructors.nim |
18:33:29 | bung | https://github.com/nim-lang/Nim/issues/6136 this should be close, not reproduciable |
18:33:31 | disbot | ➥ Hash function can't handle leading zeroes ; snippet at 12https://play.nim-lang.org/#ix=2ssM |
18:37:45 | shashlick | what's this observable stores warning |
18:38:16 | Zevv[m] | yeahy what's this observable stores warning |
18:38:40 | disruptek | it means your result is mutating despite a possible exception. usually. |
18:38:48 | Zevv[m] | shashlick: https://github.com/nim-lang/RFCs/issues/230 |
18:38:51 | disbot | ➥ Nim's NRVO is C++'s inplace construction (placement new) ; snippet at 12https://play.nim-lang.org/#ix=2oor |
18:39:23 | Zevv[m] | ooh burn: "The message by the compiler in the latest stable release is now Warning: observable stores to 'x', which is even more cryptic than the original message suggested in this RFC. No link to an article is provided." :) |
18:39:34 | * | endragor joined #nim |
18:39:45 | disruptek | they knew just how to hurt me. |
18:40:18 | Araq | yeah, I know |
18:40:26 | Araq | will improve the warning message |
18:40:39 | Araq | could also disable it again since it never found any bug anywhere |
18:40:42 | Zevv[m] | ooh burn: "The message by the compiler in the latest stable release is now Warning: observable stores to 'x', which is even more cryptic than the original message suggested in this RFC. No link to an article is provided." :) |
18:40:46 | Zevv[m] | dang sorry |
18:40:51 | Araq | but let's all be paranoid about everything |
18:40:57 | shashlick | still I'm too dumb/lazy to know what to do here |
18:41:00 | disruptek | there was a bug in nimble. |
18:41:31 | Araq | disruptek: hmm maybe |
18:41:47 | Araq | nimble relied on the behaviour that we then didn't fix because it caused performance regressions |
18:42:08 | Araq | so arguably nimble relied on sticky stuff |
18:44:05 | FromDiscord | <dom96> what did Nimble rely on? |
18:44:31 | FromDiscord | <Skaruts> is it easy to embed lua with nim? I was looking at this example code, but I can't tell how to adapt to nim, if possible: https://gist.github.com/Vesnica/3672425 |
18:44:33 | disruptek | mutating a result prior to an exception. |
18:44:40 | disruptek | and then consuming the result. |
18:44:42 | FromDiscord | <Skaruts> (edit) 'https://gist.github.com/Vesnica/3672425' => '<https://gist.github.com/Vesnica/3672425>' |
18:44:55 | FromDiscord | <dom96> ahh yes, I remember that one |
18:45:08 | * | endragor quit (Ping timeout: 256 seconds) |
18:48:22 | Araq | Skaruts: It's pretty simple, there should be examples in the Nim Lua wrapper |
18:49:27 | FromDiscord | <Skaruts> @Araq this one? <https://github.com/jangko/nimLUA> |
18:49:40 | Araq | iirc there is more than one |
18:49:52 | Zevv[m] | disruptek: were too slow, really too slow |
18:50:35 | Zevv[m] | outrun 15 times by closure iterators. I expected 3, maybe 5. but 15 |
18:50:55 | FromDiscord | <Skaruts> at a glance I only found that one and one fork of it |
18:50:59 | FromDiscord | <Rika> 3 times 5 😉 |
18:51:38 | Araq | Zevv[m]: huh? shouldn't it be faster than closure iterators? |
18:51:52 | Zevv[m] | nope. with --arc we're 7 times slower still |
18:53:41 | Zevv[m] | well, we trampoline one time too many, due to the way the stuff is split for now, so that might be solvable |
18:53:59 | Zevv[m] | but of course for each in/out jump we do a fresh continuation alloc |
18:54:25 | Zevv[m] | which is kind of sucky |
18:54:44 | Zevv[m] | we should be reusing these somehow |
18:54:48 | disruptek | see, i had hoped that with inheritance we could do a realloc and then omit some assignments. |
18:55:18 | Zevv[m] | that's not up to us. We just create a new thingy at the end of each split part |
18:55:30 | disruptek | no, it's up to us. |
18:55:32 | disruptek | why is it not? |
18:55:42 | disruptek | we can pass whatever we want. |
18:55:55 | Zevv[m] | oh so if your env groes if you go deeper, you realloc and add stuff |
18:56:03 | disruptek | of course. |
18:56:09 | Zevv[m] | of your env shrinks if you go up, you can even choose not to realloc |
18:56:37 | disruptek | so if only control flow changes, we just `result.fn = foo; return` |
18:56:38 | * | Jesin quit (Quit: Leaving) |
18:56:40 | disruptek | that's pretty fast. |
18:56:46 | Zevv[m] | if you know how deep you can go, you should realloc the whole thing on the first invication |
18:56:49 | disruptek | faster than an alloc. 😉 |
18:56:53 | Araq | here is my advice: focus on the performance right now. otherwise you repeat my mistake where you debug a slow ARC implementation, then add optimizations and then debug it all once again |
18:57:16 | disruptek | sure thing, boss. |
18:57:20 | disruptek | well anyway, that's the idea of the inheritance. |
18:57:36 | * | NimBot joined #nim |
18:57:46 | disruptek | we'll figure out how best to use it eventually. |
18:57:51 | disruptek | but it clearly buys us something. |
18:58:03 | disruptek | and remember, this is an object that the user defined. completely. |
18:58:19 | FromDiscord | <dom96> what performance are you expecting out of this? |
18:58:20 | disruptek | just think about that, i mean, really. |
18:58:22 | * | nikita` quit (Read error: Connection reset by peer) |
18:58:30 | disruptek | pretty damned fast. |
18:58:33 | Zevv[m] | disruptek: euh wait, you gather the contents of that thing during lifting, right? |
18:58:40 | Zevv[m] | it's the locals |
18:58:47 | disruptek | right. |
18:58:51 | Zevv[m] | so how is that "user defined" |
18:59:05 | disruptek | the user provided the Cont type, wholecloth. |
18:59:13 | disruptek | it can be anything they want. |
18:59:14 | Zevv[m] | yeah right, but not "the whole thing" |
18:59:23 | Zevv[m] | it's that, plus what you put on top of it |
18:59:47 | disruptek | i mean, technically, we could add a pointer to the object definition and now the continuation is one piece of memory. |
19:00:07 | Zevv[m] | that's an extra dereference? |
19:00:11 | disruptek | right. |
19:00:13 | Zevv[m] | don't |
19:00:16 | disruptek | to wherever the continuation is destined. |
19:00:34 | disruptek | wait, it's not an extra dereference. |
19:00:42 | Zevv[m] | then I don't understand yet |
19:00:56 | disruptek | well, a continuation right now. |
19:00:58 | disruptek | what is it? |
19:00:59 | Zevv[m] | right now |
19:01:02 | disruptek | yes. |
19:01:15 | disruptek | like, simple answer. |
19:01:16 | Zevv[m] | it's an object of type X wich has children with extra genes |
19:01:24 | Zevv[m] | ref object |
19:01:32 | Zevv[m] | and a pointer to a proc |
19:01:40 | disruptek | no, it's a ref object that inherits and has a ptr to a fn. |
19:01:52 | Zevv[m] | right that's what I mean |
19:01:54 | Zevv[m] | said |
19:01:55 | disruptek | so it's an object that can be extended, and it points to some code. |
19:02:08 | Zevv[m] | right. The env extends it |
19:02:11 | disruptek | but, like, you don't extend this object. |
19:02:14 | Zevv[m] | I do |
19:02:19 | disruptek | no, you truly do not. |
19:02:20 | Zevv[m] | oh |
19:02:21 | disruptek | i promise you. |
19:02:23 | Zevv[m] | tell me |
19:02:31 | disruptek | it's just a concept. |
19:02:37 | disruptek | the concept is the words on the screen. |
19:02:42 | disruptek | same as i've repeated to you. |
19:02:46 | Zevv[m] | repeat it once more |
19:02:55 | disruptek | it's a ref to an obj that inherits and has a ptr to a piece of code. |
19:03:16 | disruptek | a piece of code that knows how to run with nothing more than some data as input. |
19:03:23 | Zevv[m] | ok but then again |
19:03:24 | disruptek | some data it may or may not mutate. |
19:03:30 | disruptek | add to. |
19:03:35 | disruptek | rewrite. |
19:03:43 | Zevv[m] | if you go deeper into the original stack, you inherit and inherit and keep adding stuff to the inherited type |
19:03:46 | Zevv[m] | is that right or wrong |
19:03:58 | disruptek | you can strip stack whenever you pass it. |
19:04:04 | Zevv[m] | is that right or wrong |
19:04:06 | disruptek | you only pass what you want to use. |
19:04:07 | disruptek | that's good. |
19:04:23 | disruptek | obviously, you pass the fn. |
19:04:27 | disruptek | so that's 8 bytes. |
19:04:28 | Zevv[m] | no go back |
19:04:33 | Zevv[m] | if you go deeper into the original stack, you inherit and inherit and keep adding stuff to the inherited type, is that right |
19:04:38 | disruptek | no. |
19:04:49 | Zevv[m] | so where am I wrong. I mean as it is *now* |
19:04:51 | disruptek | whenever you create a proc, that is when you define the environment. |
19:05:04 | disruptek | the environment that you're working in has whatever you want in it. |
19:05:09 | disruptek | any subset of your input. |
19:05:23 | disruptek | put anything at all in this env; it's yours to keep. |
19:05:32 | Zevv[m] | you totally lost me, sorry |
19:05:33 | disruptek | no one will have access to it. |
19:05:48 | disruptek | zevv, YOU are `fn`. |
19:05:51 | Zevv[m] | back. Talking as it is *now* or talking as you want it to *be* |
19:05:57 | disruptek | this is how it is now. |
19:05:59 | Zevv[m] | ok |
19:06:14 | disruptek | so you, YOU, are fn. |
19:06:20 | Zevv[m] | ok |
19:06:20 | disruptek | i give you some input. |
19:06:23 | disruptek | a banana |
19:06:25 | Zevv[m] | yeah |
19:06:26 | disruptek | a coconut. |
19:06:28 | Zevv[m] | also |
19:06:38 | disruptek | a gallon of rum. |
19:06:45 | Zevv[m] | yeah yeah go on |
19:07:23 | disruptek | you give me the name of a friend and a cocktail that i can give to them. |
19:07:38 | Zevv[m] | sure |
19:07:43 | disruptek | then we see if i'm getting lucky tonight. |
19:07:59 | disruptek | and so on and intercourse. |
19:08:03 | * | maier joined #nim |
19:08:03 | disruptek | er, so forth. |
19:08:46 | disruptek | let's say i don't use the banana. i give the banana back to you. |
19:09:02 | disruptek | look, i say, don't go to this friend. go to this other friend; she's love the banana. |
19:09:20 | disruptek | she gets the banana, i get the cocktail, you get fucked. |
19:09:22 | disruptek | or something. |
19:09:27 | disruptek | who cares, it doesn't matter. |
19:09:28 | Zevv[m] | dude |
19:09:37 | disruptek | the point is that you can use it or lose it or pass it. |
19:10:15 | Zevv[m] | ok. real example, gimme a sec |
19:10:24 | disruptek | maybe you took the banana and gave someone else your nut. |
19:10:33 | disruptek | whatever peels your banana, dude. |
19:10:45 | disruptek | i am not going to judge you on your banana. |
19:10:50 | disruptek | i'm more of a coconut man, myself. |
19:10:55 | Zevv[m] | real stuff: I have a proc with a few nested scopes, right |
19:10:58 | Zevv[m] | outer scope has only int i |
19:10:58 | * | Jesin joined #nim |
19:11:00 | disruptek | right. |
19:11:03 | Zevv[m] | one scope deeper int j comes in |
19:11:05 | * | dzamo quit (Quit: dzamo) |
19:11:13 | disruptek | intj's, know 'em. love 'em. |
19:11:15 | Zevv[m] | halfway first cps call I have env_1, which contains only int i |
19:11:23 | disruptek | right. |
19:11:28 | Zevv[m] | now we go one deeper, we get env_2, which inherits env_1 and adds int j |
19:11:30 | disruptek | i'm right there whitcha, boss. |
19:11:30 | Zevv[m] | still true? |
19:11:40 | disruptek | yes, yes, yes. |
19:11:47 | Zevv[m] | so the deeper you go, the further you inherit, the more you add |
19:11:51 | Araq | seriously? bananas and nuts? |
19:11:53 | disruptek | you put the lime in the coconut. |
19:11:56 | Zevv[m] | still true? |
19:11:57 | disruptek | you shake it all up. |
19:12:01 | disruptek | yes, yes. |
19:12:07 | Araq | stop it. use better terms |
19:12:15 | Zevv[m] | ok, earlier when I asked that, you said that was wrong |
19:12:26 | Zevv[m] | so you add to your inherited environment by inheriting deeper and adding members |
19:12:38 | Zevv[m] | you go a few scopes up, and you have another branch of inheriting |
19:12:39 | disruptek | you have i and j. but when you tell me the result, you can tell me as much or as little as you want. |
19:12:46 | disruptek | you can tell me i. |
19:12:48 | disruptek | you can tell me j. |
19:12:52 | Zevv[m] | shut up |
19:12:52 | disruptek | you can tell me k. |
19:12:54 | Zevv[m] | you go a few scopes up, and you have another branch of inheriting |
19:12:59 | disruptek | fine. |
19:13:03 | Zevv[m] | so, first call we construct env_1 with only i on it |
19:13:09 | Zevv[m] | gets malloced and on the heap |
19:13:14 | disruptek | fine. |
19:13:17 | Zevv[m] | we go to the first split fn, and pass that thing in |
19:13:23 | disruptek | stop. |
19:13:25 | * | maier quit (Ping timeout: 264 seconds) |
19:13:26 | Zevv[m] | it just throws it away, and constructs a new env_2 |
19:13:27 | Zevv[m] | ok |
19:13:34 | disruptek | we got to the first split fn. |
19:13:37 | disruptek | where is that fn? |
19:13:44 | disruptek | where is the ptr to that proc? |
19:13:45 | Zevv[m] | the pointer to it is in the continuation |
19:13:52 | disruptek | okay, so it's in "our" memory. |
19:13:59 | disruptek | the memory we know how to find. |
19:14:02 | disruptek | right? |
19:14:08 | disruptek | we know the continuation. |
19:14:11 | disruptek | it was passed to us. |
19:14:16 | disruptek | so we know where the fn is on it. |
19:14:17 | disruptek | right? |
19:14:19 | disruptek | with me? |
19:14:28 | disruptek | the fn, of course, is ourselves. |
19:14:35 | disruptek | so we can identify ourselves. |
19:14:42 | disruptek | and we know, what stuff, in the world is around us. |
19:14:44 | disruptek | memory. |
19:14:49 | disruptek | we know what's in that memory. |
19:14:52 | disruptek | it's variables. |
19:14:54 | disruptek | we have the list. |
19:14:56 | Zevv[m] | right |
19:14:58 | disruptek | it's in our type. |
19:15:01 | Zevv[m] | right |
19:15:10 | disruptek | in fact, everything we're going to speak of, is in our type. |
19:15:19 | disruptek | all symbols that might be interesting to know about. |
19:15:27 | disruptek | any name->value sorta thing. |
19:15:27 | Zevv[m] | but as we pass the continuation to the next, we create a whole new continuation |
19:15:35 | Zevv[m] | that's what happens *now* |
19:15:36 | disruptek | but also anything in global scope that's like that. |
19:15:42 | disruptek | yes. |
19:15:45 | disruptek | that happens now. |
19:15:47 | Zevv[m] | right |
19:15:51 | Zevv[m] | that is what I wanted to say |
19:15:51 | disruptek | and what do we put into that object? |
19:16:07 | disruptek | do we put the whole world into it? all the memory we've amassed? |
19:16:07 | Zevv[m] | all the stuff that is in scope of the next one to receive this |
19:16:19 | disruptek | but who chooses what that is? |
19:16:23 | Zevv[m] | the receiver |
19:16:25 | disruptek | how do you pick? |
19:16:29 | Zevv[m] | it was picked for me |
19:16:31 | Zevv[m] | I don't know |
19:16:43 | disruptek | okay, so someone says to you, here, let's do business. |
19:16:51 | disruptek | they tell you what they want. |
19:16:56 | disruptek | you give them a result. |
19:17:04 | disruptek | right? |
19:17:07 | Zevv[m] | right |
19:17:08 | disruptek | they tell you. |
19:17:34 | disruptek | they say, "i don't care where you're from, who you are. or what you know." |
19:17:41 | disruptek | "i want x, y, z." |
19:17:46 | disruptek | "that's all i want. i don't care." |
19:17:57 | Zevv[m] | right, so I create another env type and put that stuff in there |
19:17:59 | disruptek | "give me x, y, z. and i will give you the world." |
19:18:05 | disruptek | right. |
19:18:07 | Zevv[m] | but that new env, is new and goes on the heap |
19:18:08 | Zevv[m] | another alloc |
19:18:15 | disruptek | right, but it could be a realloc. |
19:18:25 | disruptek | in fact, aren't there cases where it doesn't need to change? |
19:18:33 | Zevv[m] | right, that is where I want to go |
19:18:38 | Zevv[m] | but you went on your coconut tour |
19:18:40 | disruptek | it's it the case that sometimes you will get a request and just pass it somewhere else? |
19:18:45 | Zevv[m] | and also, if you know the deepest you could ever get |
19:18:53 | disruptek | it doesn't matter. |
19:18:54 | Zevv[m] | you could make 1 thing that you just pass all over, and mutate it |
19:19:02 | disruptek | sure, but it doesn't matter. |
19:19:03 | Zevv[m] | you alloc once, and everybody only uses what they need |
19:19:06 | Zevv[m] | no reallocs |
19:19:09 | Zevv[m] | no growing, no shrinking |
19:19:11 | disruptek | sure, whatever. |
19:19:26 | Zevv[m] | it can still be a hierarchy of different objects, but you can *start with the biggest possible thing |
19:19:28 | Zevv[m] | * |
19:19:34 | disruptek | if you want to work is a certain sized swimming pool, one way to do that is to get a lot of water in one place at the same time. |
19:19:54 | Zevv[m] | dude talk nim, I'm too stupid for that stuff |
19:20:10 | disruptek | you can do whatever you want with this memory. |
19:20:22 | Zevv[m] | yeah yeah but as it is *NOW* |
19:20:23 | Zevv[m] | it is no good |
19:20:30 | disruptek | why? |
19:20:34 | Zevv[m] | all the frigging reallocs |
19:20:35 | disruptek | arc sinks these values for us. |
19:20:43 | disruptek | oh, as it is NOW. |
19:20:45 | disruptek | yes, yes. |
19:20:47 | disruptek | of course. |
19:20:47 | Zevv[m] | YEEESSSS |
19:20:50 | disruptek | sorry. |
19:20:50 | Zevv[m] | LISTEN YOU MORON |
19:20:52 | Zevv[m] | I typed *NOW* |
19:20:54 | Zevv[m] | right |
19:20:55 | Zevv[m] | soooo |
19:20:55 | disruptek | sorry. |
19:20:57 | Zevv[m] | I love you too |
19:20:59 | Prestige | Is there a way to have a variable be a sort of alias for another var that is a ref object? |
19:20:59 | Zevv[m] | need to read the kids |
19:21:06 | Zevv[m] | doing quantum mechanics tonight |
19:21:08 | disruptek | okay. |
19:22:19 | Prestige | Trying to replicate this behavior: https://github.com/avahe-kellenberger/dwm/blob/master/src/dwm.c#L962 - my Client is a ref object of RootObj |
19:24:36 | disruptek | why do we even bother with arc? |
19:24:49 | disruptek | why don't we just manage the memory for you? |
19:24:55 | disruptek | we're doing that anyway. |
19:25:09 | disruptek | i mean, we're alloc'ing this stuff. |
19:25:11 | disruptek | we're copying it. |
19:25:21 | disruptek | we know it by name. |
19:25:28 | disruptek | we know what it is. |
19:25:32 | disruptek | it's not a guess, we KNOW. |
19:26:00 | leorize | Prestige: I'm not sure how this is supposed to work |
19:27:01 | Prestige | I believe that c->mon->clients is being reassigned |
19:27:35 | Prestige | clients is just a Client that has a pointer to the next client |
19:28:24 | Prestige | So I think tcc is sort of like an alias here, for c->mon->clients |
19:29:11 | leorize | yes |
19:30:26 | Prestige | I'm wondering if this is possible in Nim, where my Client is a ref object |
19:31:05 | leorize | yes |
19:32:22 | leorize | you just need a `ptr Client` to serve as your alias |
19:32:33 | leorize | `std / byaddr` have a pragma to do just that |
19:33:21 | disruptek | Zevv[m]: i think we can do ideal-alloc with just a single pointer. should be like one line of code. |
19:33:38 | Prestige | Thanks, I'll give it a try |
19:38:40 | Zevv[m] | 'ideal-alloc' meaning the right size so we do not have to realloc any time during the lifetime of the whole chain of continuations? |
19:39:11 | * | aurelius joined #nim |
19:39:15 | disruptek | not, like, literally ideal, but based upon name clashes. |
19:39:57 | Zevv[m] | ok, so where you want to go: instead of throwing away the continuation with its env, you want to mutate it and pass that on |
19:39:59 | disruptek | so, like, it's not about size, it's about allocs. |
19:40:01 | Zevv[m] | so we don't realloc, right? |
19:40:19 | Zevv[m] | no, "so we dont throw away and allocate a whole new one" |
19:40:22 | disruptek | right. |
19:40:41 | Zevv[m] | right. |
19:40:42 | disruptek | i mean, currently. |
19:40:58 | Zevv[m] | but now we *do* make a new one every call |
19:41:09 | disruptek | yeah. |
19:41:12 | Zevv[m] | ok |
19:41:42 | disruptek | how can we get the static sizes of all this stuff? |
19:41:48 | Zevv[m] | so, do we make this thing just a block of memory which we pass along and grow when needed, and just cast it to the type it happens to have during this place in its lifetime? |
19:42:08 | Zevv[m] | or do we figure out the whole possible tree of inheritance, and pre-alloc the largest of those |
19:42:13 | Zevv[m] | and pass that around, so that any other type would fit in |
19:42:44 | disruptek | we can compute size at runtime, certainly. |
19:43:04 | Zevv[m] | if my mental image is right, every var that goes into an env has the same location in the memory block in all possible tree-permutations |
19:43:15 | disruptek | so we'll be able to make the assumption at compile-time that we got the size right. |
19:43:15 | Zevv[m] | so we never have to move stuff around. The outer scope 'i' will always be at the same offset |
19:43:41 | disruptek | that's fine. |
19:43:51 | disruptek | i'm just thinking that it doesn't matter. |
19:43:55 | Zevv[m] | The only downside will be that if you stash away a million of these things for later calling, you possible stash away a lot of unused memory |
19:43:56 | * | bung quit (Quit: Lost terminal) |
19:43:58 | disruptek | if i know how big i am, i can tell you where i end. |
19:44:14 | Zevv[m] | but I think araq is right, we should make this work soon |
19:44:14 | disruptek | so whatever. |
19:44:41 | * | vicfred_ joined #nim |
19:45:02 | disruptek | really, it's just a chunk of memory Cont[N]. |
19:45:38 | Zevv[m] | right'o |
19:45:46 | disruptek | we setup the vars for you. you can use any string to name them. |
19:45:56 | * | vicfred_ quit (Client Quit) |
19:46:05 | * | aurelius quit (Ping timeout: 240 seconds) |
19:46:14 | * | vicfred_ joined #nim |
19:46:43 | * | altarrel quit (Quit: Konversation terminated!) |
19:47:28 | * | vicfred quit (Ping timeout: 256 seconds) |
19:48:04 | * | MightyJoe joined #nim |
19:50:34 | * | cyraxjoe quit (Ping timeout: 265 seconds) |
19:50:40 | Zevv[m] | I still don't know what you're saying here, but I think we mean the same thing about the memory block used for continuations |
19:51:25 | * | endragor joined #nim |
19:51:30 | Zevv[m] | does it make sense to alias locals to directly use the stuff stored in the env, or is nim smart enough to understand we're peeking it from there and poking it back at the end? |
19:51:38 | Zevv[m] | otherwise that could be a good optimization as well. |
19:51:52 | Zevv[m] | just rewrite `i` to `myenv.i` |
19:51:56 | disruptek | i'm thinking that anything stropped. |
19:52:11 | disruptek | so it's `i` versus 'i'. |
19:52:32 | disruptek | we just rewrite those. 🤷 |
19:52:44 | Zevv[m] | eh wait. My original code does "i = 3" |
19:52:48 | Zevv[m] | waht do you rerwrite that to |
19:52:55 | disruptek | myenv.i = 3 |
19:52:59 | Zevv[m] | right |
19:53:04 | Zevv[m] | where does the stropping come in |
19:53:15 | disruptek | so, i mean if it's stropped. |
19:53:24 | disruptek | i = 3 means, local i = 3. |
19:53:37 | disruptek | `i` = 3 means myenv.i = 3 |
19:53:37 | Zevv[m] | ok |
19:53:57 | disruptek | it's cute, too. |
19:54:09 | Zevv[m] | so, we can keep the inheritance, or make a tons of objects that are tree-wise compatible |
19:54:16 | Zevv[m] | which at the C-level is about the same thing |
19:54:49 | disruptek | you make a fair point. |
19:54:55 | * | MightyJoe quit (Ping timeout: 265 seconds) |
19:55:06 | * | cyraxjoe joined #nim |
19:55:52 | Zevv[m] | but to make sure: we have an outer scope with i and j, next scope uses i, j and k so we add one. One deeper j is not used, so it only needs i and k. We still pass the whole thing, but the hole were j was is just not accessed |
19:55:56 | Zevv[m] | does that make sense |
19:56:10 | Zevv[m] | it's just the same memory block, but we must make sure that layout-wise k is always on the same address |
19:56:20 | disruptek | yes, of course. |
19:56:33 | Zevv[m] | so if you go to deeper scope, you still need to put in stuff from outer scopes, evne it if it is not used |
19:56:55 | Zevv[m] | there's a beauty to this stuff |
19:57:03 | disruptek | yes, but remember it's not just about used. |
19:57:10 | disruptek | you have to worry about the clashes, too. |
19:57:13 | Zevv[m] | I see these things in my minds eyes, but I couldn't draw a picture of it if I had to |
19:57:19 | Zevv[m] | clashes of what |
19:57:23 | Zevv[m] | names? |
19:57:25 | disruptek | yeah. |
19:57:29 | Zevv[m] | yust number them? |
19:57:33 | Zevv[m] | i_1, i_2, i_3? |
19:57:42 | Zevv[m] | in your 3d part you rewrite `i` to `env.i_3` |
19:57:45 | Zevv[m] | or whatever |
19:57:53 | disruptek | maybe. |
19:57:54 | Zevv[m] | they all live on the exact same place in the memory block |
19:58:04 | Zevv[m] | just with differetn names |
19:58:18 | * | endragor quit (Ping timeout: 265 seconds) |
19:58:26 | disruptek | but now you're saying that we'll find the largest chunk that your continuation ever has and make that the size of every continuation. |
19:58:52 | Zevv[m] | maybe. It avoids realloc during its life time, but it is overhead you might need to keep stashed away for a longer time |
19:59:45 | Zevv[m] | the good thing is that if you have a bunch of the same continuations, we could use some kind of presized memory pool and get 0 fragmentation |
20:00:01 | Zevv[m] | In real life, how big is your typical stack frame? |
20:00:09 | disruptek | well, we can certainly do that. |
20:00:12 | Zevv[m] | in my C time these were always pretty small, handfull of KB's |
20:00:21 | Zevv[m] | but with nim I tend to put much more stuff on the stack, so they might grow |
20:00:51 | Zevv[m] | but then again, as soon as your data structures get more complex to store more stuff, you're more likely to use refs and things go to the heap |
20:01:12 | Zevv[m] | so in practice I think closure size will exponentially go down pretty fast |
20:01:26 | Zevv[m] | most will be handful or tens of bytes, for simple iterators and stuff |
20:02:15 | disruptek | heap or not, you have the size of the memory to think about. |
20:02:44 | Zevv[m] | we could code it up so the user has a choice, somewhere somehow |
20:02:51 | disruptek | you cannot predetermine what people will do. |
20:03:02 | disruptek | why they will do the things they do. |
20:03:03 | Zevv[m] | either pre-alloc the full size, or grow and/or shrink during its life time |
20:03:17 | disruptek | the terrible, naughty, kinky things they do. |
20:03:28 | Zevv[m] | I try to understand the things mratsim does sometimes, and I think he's all for preallocs and pools and all that |
20:03:33 | Zevv[m] | you want to go fast, you pay |
20:03:36 | Zevv[m] | makes perfect sense |
20:03:47 | disruptek | i know. |
20:03:53 | disruptek | nothing is more expensive than memory. |
20:04:03 | Zevv[m] | so a continuation will be as large as the original funcions worst case stack size |
20:04:19 | disruptek | but i'm not comfortable with that. |
20:04:26 | Zevv[m] | then you need to realloc in flight |
20:04:28 | disruptek | why do you want to give that up? |
20:04:31 | Zevv[m] | but that'll cost performance |
20:04:36 | disruptek | hol' up. |
20:04:39 | disruptek | who gets to choose? |
20:04:46 | disruptek | why can't i say when i pay that penalty? |
20:04:47 | Zevv[m] | the implementer of the thing built on CPS |
20:04:58 | Zevv[m] | or the end user of the thing |
20:05:04 | disruptek | it's it the same to say that you can always go smaller? |
20:05:12 | disruptek | it's that safer? |
20:05:20 | Zevv[m] | don't understnd the question |
20:05:26 | Zevv[m] | "huh" |
20:05:33 | disruptek | you can pass memory the same size or smaller. |
20:05:54 | Zevv[m] | lost you again - who passes to who |
20:06:16 | disruptek | you, the cont.fn can return memory the same size, or smaller. |
20:06:27 | Zevv[m] | right |
20:06:36 | Zevv[m] | or larger |
20:06:49 | Zevv[m] | so either we start out at max size |
20:06:56 | Zevv[m] | or we do reallocs on every pass |
20:07:03 | Zevv[m] | that's a compile time choice in your macro |
20:07:09 | Zevv[m] | just inject a realloc or not |
20:07:33 | disruptek | hmm, i dunno. |
20:07:45 | Zevv[m] | ¿problem? |
20:07:58 | disruptek | i dunno if i want that to be compile-time. |
20:08:02 | Araq | it makes me mad |
20:08:10 | disruptek | i mean, look at araq. |
20:08:13 | Araq | 5000 allocations because of 'of RootObj' |
20:08:25 | disruptek | that's a lot. |
20:08:29 | Araq | so strange, valgrind says everything is not corrupted |
20:08:43 | disruptek | what was the actual problem? |
20:17:36 | Zevv[m] | disruptek: what do you propose then |
20:17:57 | Zevv[m] | so either you have the max size prealoced or keep it, or you realloc shrink/grow while traveling |
20:18:18 | disruptek | i think when you add to an env, you set your parent's "ideal" to yourself. clearly. |
20:18:26 | * | MightyJoe joined #nim |
20:18:40 | disruptek | there's no way to delete from envs, so it seems pretty correct. |
20:18:52 | disruptek | it just recurses. |
20:19:14 | Zevv[m] | you can't delete from envs, but when you get down the end of the call chain, where the original fucntion would bubble up scopes, you could lose the tail |
20:19:15 | FromDiscord | <Clyybber> whats crakcin |
20:19:28 | Zevv[m] | shrinking back to 0 as you ascend back to the surface |
20:19:47 | Zevv[m] | Clybber: we're way to slow and need to get rid of the environment allocs for every pass |
20:19:47 | disruptek | bubble up scopes? |
20:19:56 | Zevv[m] | wrong wording |
20:20:07 | Zevv[m] | a proc has a bunch of nested scops. Ifs, blocks whiles |
20:20:13 | Zevv[m] | if you are deep, you have a large stack = large environment |
20:20:13 | FromDiscord | <Clyybber> Zevv: Hmm, there is a PR for putting them on the stack |
20:20:26 | disruptek | yeah? |
20:20:29 | Zevv[m] | if you get out of one of these nested scopes, you lose a bit of your steack, smaller env |
20:20:30 | FromDiscord | <Clyybber> oh, eh |
20:20:46 | Zevv[m] | so the continaiton env can shrink sometimes |
20:21:02 | disruptek | how do i lose a bit of my env? |
20:21:08 | * | cyraxjoe quit (Ping timeout: 256 seconds) |
20:21:13 | Zevv[m] | the tail |
20:21:27 | Zevv[m] | it's as big as the stack would be if you didn't chop up the proc |
20:21:31 | Zevv[m] | stacks grow and shrink all the time |
20:21:37 | disruptek | these don't. |
20:21:56 | Zevv[m] | you nest into an if and declare a var, you env grows. You get out of the if block, that var is no longer in scope, your stack shrinks. |
20:22:03 | Zevv[m] | So any calls happening after that have a smaller env |
20:22:49 | disruptek | no, when i setup the continuation, i map every growth to point every prior env to myself. |
20:23:14 | disruptek | ie during the process where i register locals. |
20:23:24 | FromDiscord | <Clyybber> Araq: Hmm why does the inheritance cause allocs? |
20:23:28 | * | oriba joined #nim |
20:23:29 | FromDiscord | <Clyybber> Maybe because of the RTTI? |
20:23:29 | FromGitter | <alehander92> Araq so can't you diff |
20:23:34 | * | vicfred_ quit (Quit: Leaving) |
20:23:46 | FromGitter | <alehander92> the alloc callsites |
20:23:48 | Araq | found it |
20:23:55 | Zevv[m] | tell it |
20:23:56 | * | audiofile joined #nim |
20:24:02 | disruptek | yeah, jeeze. |
20:24:04 | * | vicfred joined #nim |
20:24:04 | Araq | when we use inheritance the cycle collector assumes there can be cycles |
20:24:17 | FromDiscord | <Clyybber> And that causes leaks/ |
20:24:19 | FromDiscord | <Clyybber> ? |
20:24:19 | Araq | and that causes init/deinit calls for its internal data structure |
20:24:27 | FromDiscord | <Clyybber> or are you chasing leaks? |
20:24:30 | Araq | it doesn't leak, but it allocates more |
20:24:34 | FromDiscord | <Clyybber> ah ok |
20:24:39 | Araq | the leaks are fixed in my other PR |
20:24:46 | FromDiscord | <Clyybber> oh nice, gotta check it out |
20:25:02 | Araq | so now I know. only the cursor inference left and then I can focus on bootstrapping |
20:25:12 | Araq | 4 days left |
20:25:20 | disruptek | lol |
20:25:27 | disruptek | you can do it, dude. |
20:26:13 | Araq | hmm I might want to optimize this though |
20:26:17 | disruptek | maybe if we try hard we can keep from filing more arc bugs between then and now. |
20:28:43 | FromDiscord | <dom96> Araq: don't burn yourself out. Now that you know the cause it would be a good time to stop and rest until tomorrow 🙂 |
20:29:25 | FromDiscord | <Clyybber> nah, arc fixing is a drug |
20:29:32 | FromDiscord | <Clyybber> a drug with benefits |
20:29:34 | FromGitter | <alehander92> and drug addiction is bad |
20:29:46 | Zevv[m] | all drugs have benefits |
20:29:53 | FromGitter | <alehander92> say no to drugs clybber |
20:29:55 | FromGitter | <alehander92> choose life |
20:30:01 | FromDiscord | <Clyybber> a drug without disadvantages |
20:30:25 | FromDiscord | <Clyybber> drug: no |
20:30:38 | FromDiscord | <Clyybber> there I said it |
20:30:49 | FromDiscord | <Clyybber> even pinged the douche |
20:31:05 | FromGitter | <alehander92> choose refining optimization |
20:32:09 | FromDiscord | <Clyybber> Araq: Is there already a proc to compare idents discarding the gensym part? |
20:32:53 | FromDiscord | <Clyybber> I think equalParams needs that |
20:33:54 | shashlick | all calls in the stdlib to tables.add need to be cleaned up - stdlib is grumbling about itself |
20:37:57 | disruptek | wow, this would give me my `while: else:` feature for free. |
20:38:35 | Zevv[m] | what would |
20:39:52 | FromDiscord | <Clyybber> oh no |
20:39:55 | disruptek | the fact that break is not flow-through control flow. |
20:40:39 | FromDiscord | <Clyybber> inb4 while: else: gets built into cps |
20:41:52 | FromDiscord | <KingDarBoja> Ar4q must be happy after seeing how Python 3.10 is going to implement Pattern matching (because he was right) |
20:41:58 | FromDiscord | <KingDarBoja> 🤔 |
20:42:13 | FromDiscord | <Clyybber> Araq: Should we actually gensym params of procs that are {.inject.} ? |
20:42:28 | disruptek | oh |
20:42:42 | disruptek | that would be awesome. |
20:43:44 | FromDiscord | <Clyybber> what would? |
20:45:52 | * | hoijui quit (Ping timeout: 260 seconds) |
20:46:03 | * | rockcavera joined #nim |
20:47:52 | * | tane quit (Quit: Leaving) |
20:48:55 | disruptek | well, you get more than break. |
20:49:36 | disruptek | you get continue, no-start, and post-work exit, right? |
20:49:48 | Araq | KingDarBoja: I don't care what Python does, it's a silly scripting language |
20:50:24 | Araq | Clyybber: ask me again tomorrow, cannot think right now, it's late |
20:50:35 | FromDiscord | <Clyybber> ok, haha |
20:54:03 | FromDiscord | <Clyybber> gn8 |
20:54:09 | disruptek | cps lives in the corners of your while loops. |
20:54:15 | disruptek | it comes for you. it comes. |
20:54:38 | FromGitter | <alehander92> no please |
20:54:51 | FromGitter | <alehander92> gentrification |
20:55:00 | disruptek | just a tiny programming-language virus. i swear it'll be tiny. |
20:55:05 | FromGitter | <alehander92> we've had enough of this |
20:55:19 | disruptek | nim lives matter. |
20:56:04 | FromGitter | <alehander92> your life matters |
20:58:08 | * | endragor joined #nim |
21:02:06 | * | lritter joined #nim |
21:02:36 | Zevv[m] | yay, finally I have goto's in Nim: https://github.com/disruptek/cps/blob/master/stash/goto.nim |
21:05:04 | Zevv[m] | this is all so silly |
21:05:06 | * | narimiran quit (Ping timeout: 256 seconds) |
21:07:25 | * | endragor quit (Ping timeout: 264 seconds) |
21:08:56 | * | maier joined #nim |
21:10:45 | FromDiscord | <Clyybber> thats ugh |
21:10:52 | FromDiscord | <Clyybber> fucking amazing haha |
21:11:43 | Zevv[m] | I know I should be able to build a try/catch/throw with this, but I can't |
21:13:45 | * | maier quit (Ping timeout: 240 seconds) |
21:19:05 | * | dulsi_ joined #nim |
21:19:40 | * | sputny quit (Remote host closed the connection) |
21:20:57 | * | apahl quit (Ping timeout: 272 seconds) |
21:21:12 | * | dmi0 quit (Quit: Leaving) |
21:21:23 | * | apahl joined #nim |
21:21:55 | * | dulsi quit (Ping timeout: 265 seconds) |
21:22:45 | * | Trustable joined #nim |
21:25:13 | Zevv[m] | disruptek: you here still |
21:26:27 | FromDiscord | <Avatarfighter> disruptek is lost in the for loops |
21:26:40 | Araq | try and catch is easy, Zevv[m] |
21:26:54 | Zevv[m] | yeah, it's easy but it doesn't fit our current infra |
21:26:56 | Araq | see how --exceptions:goto do it |
21:26:59 | Zevv[m] | I need state to carry stuff over closures |
21:27:03 | Zevv[m] | it's just an implementation thing |
21:27:06 | disruptek | it does fit. |
21:27:16 | Zevv[m] | it fits, but I can't store my state anywhere right now |
21:27:17 | disruptek | it kills two birds with one stone, actually. |
21:27:37 | Zevv[m] | I want to store something in my Cont that carries over to all successive conts |
21:27:45 | disruptek | go ahead. |
21:27:46 | Zevv[m] | a ref to something |
21:27:54 | Zevv[m] | yeah but not sure how to nicely pass it in initially |
21:27:54 | disruptek | yeah, it's called e. |
21:28:05 | disruptek | the same way you pass anything. |
21:28:45 | disruptek | we gensym "fn" and "e". |
21:29:02 | Zevv[m] | oh right |
21:29:03 | disruptek | i don't feel bad about this. |
21:29:08 | Zevv[m] | i didn't know |
21:29:12 | disruptek | throw result in there, too. |
21:29:22 | Zevv[m] | dude your documentation is *so* bad |
21:29:34 | disruptek | i'm trying to write some now. |
21:29:54 | Zevv[m] | e is not in your concept |
21:30:09 | disruptek | no, neither is result. |
21:31:41 | Zevv[m] | where do I new() my e? |
21:31:54 | disruptek | we can probably put `punch` in pretty trivially. |
21:32:14 | disruptek | prettier nimions new it for you. |
21:32:31 | disruptek | or not at all. |
21:32:37 | disruptek | who's to say? |
21:32:42 | FromDiscord | <Clyybber> Araq: Kind of related, wdyt about making the gensym hash part of an ident consistent per template? |
21:33:31 | Araq | what does that mean |
21:33:59 | disruptek | it's caught from below. |
21:34:01 | FromDiscord | <Clyybber> It means that i and i in the same template will be gensymmed to the same |
21:34:47 | FromDiscord | <Clyybber> i`gensymSAME |
21:35:59 | Zevv[m] | disruptek: you're speaking in riddles |
21:36:01 | Zevv[m] | with your 'e' |
21:36:06 | FromDiscord | <Clyybber> This would allow us to get rid of the symbol searching we do |
21:36:50 | FromDiscord | <Clyybber> to make `when ...: var a else: var a\necho a` work |
21:37:43 | * | dulsi_ is now known as dulsi |
21:37:44 | FromDiscord | <Clyybber> and would make gensymmed forward decls work too without adding a mode that ignores gensym param name differences to searchForProc |
21:38:31 | Araq | listen to me |
21:40:28 | Araq | touch the gensym implementation as little as possible it took me at least 3 iterations to get into its current, semi-working state |
21:41:26 | Zevv[m] | Aller guten Dinge sind drei |
21:48:48 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:49:48 | * | Vladar quit (Quit: Leaving) |
21:52:20 | * | endragor joined #nim |
21:52:54 | Zevv[m] | disruptek: https://github.com/disruptek/cps/blob/master/stash/trycatch.nim |
21:53:12 | Zevv[m] | tell me where I should store 'err', 'msg' and 'where'. |
21:56:58 | * | endragor quit (Ping timeout: 246 seconds) |
22:04:25 | * | endragor joined #nim |
22:12:13 | * | endragor quit (Ping timeout: 264 seconds) |
22:13:23 | Zevv[m] | #20 is in a PR, I'm off to Zzz |
22:13:36 | disruptek | g'night old man. |
22:15:49 | FromGitter | <bung87> `result = prefix & result` araq how this can without copy ? |
22:17:07 | FromGitter | <bung87> and when assign a char still a copy ? i dont know how to optimize string manipulation |
22:20:25 | Araq | well you start by scanning the prefix |
22:20:36 | Araq | while you do that you can already append to result |
22:20:49 | Araq | and then there is no need for 'result = prefix & result' |
22:21:16 | Araq | the slice into 's' can be avoided with a simple prefixLen integer variable (you almost have it inside 'idx' but its scope is off) |
22:21:26 | Araq | and that's about it I think |
22:24:40 | FromGitter | <bung87> let me think of it |
22:34:24 | FromGitter | <bung87> then `result = newString(L)` no need ? I just do all .add char ? |
22:37:48 | Araq | you can use result = newStringOfCap(L) and .add chars |
22:39:35 | * | audiofile quit (Quit: Default Quit Message) |
22:40:33 | FromGitter | <bung87> L depends on partsLen, I cant declare it then add prefix char to it |
22:41:56 | FromGitter | <bung87> in the first loop |
22:45:01 | FromGitter | <bung87> I've modified follow your suggestion, except the end line |
22:45:57 | Araq | L is only an estimate |
22:46:08 | Araq | it doesn't have to be exact |
22:50:00 | Araq | oh the cursor bug looks easy to do tomorrow |
22:50:27 | Araq | but it'll make the optimization less effective |
22:55:03 | FromGitter | <bung87> ok I got it |
22:57:30 | FromGitter | <bung87> i have to change to countup easier for understanding when use .add |
23:01:41 | Araq | bung87: btw, exceptional work with your PRs, please continue |
23:02:12 | Araq | good night |
23:03:22 | FromGitter | <bung87> Thanks ! I done the work, only result string now. |
23:04:21 | FromGitter | <bung87> always get benefit from code reviews |
23:06:33 | * | krux02_ joined #nim |
23:09:23 | * | krux02 quit (Ping timeout: 260 seconds) |
23:09:47 | * | maier joined #nim |
23:15:13 | * | maier quit (Ping timeout: 264 seconds) |
23:15:59 | * | aurelius joined #nim |
23:20:58 | * | aurelius quit (Ping timeout: 246 seconds) |
23:34:17 | * | endragor joined #nim |
23:36:42 | Yardanico | ok so there's still some async leak left, but it's much smaller |
23:36:59 | Yardanico | from a nim compiler 1 month ago, after stress-testing asynchttpserver with wrk, the RAM usage was 1.5gb |
23:37:03 | Yardanico | now it's 100mb |
23:37:12 | Yardanico | that's for ~400-500k requests |
23:41:37 | * | vicfred quit (Quit: Leaving) |
23:48:09 | Yardanico | seems like it leaks in processBasicCallbacks |
23:48:45 | * | oddp quit (Ping timeout: 240 seconds) |
23:50:30 | Yardanico | oh it has some shallowCopy in there |
23:57:17 | Yardanico | for ~80k requests in debug mode "(allocCount: 6908857, deallocCount: 6558581)" |
23:58:54 | FromDiscord | <Clyybber> niice |
23:59:05 | Yardanico | yeah it's still much less than before |
23:59:12 | Yardanico | ~100mb leak for asynchttpserver for ~400k requests |
23:59:13 | disbot | no footnotes for `100mb`. 🙁 |
23:59:22 | disruptek | might create some real competition here. |