00:00:38 | * | dadada__ joined #nim |
00:00:51 | * | ftsf joined #nim |
00:04:20 | * | konvertex quit (Ping timeout: 272 seconds) |
00:08:58 | * | zacharycarter quit (Ping timeout: 260 seconds) |
00:11:50 | Prestige | o/ |
00:12:12 | * | avatarfighter quit (Quit: Leaving) |
00:17:14 | * | fredrikhr quit (Ping timeout: 256 seconds) |
00:18:19 | FromDiscord | <Elegant Beef> Does seq.setLen change the capacity? |
00:18:32 | FromDiscord | <Elegant Beef> And hello 😄 |
00:19:05 | Prestige | I believe so, even though it can be expanded again as you add elements |
00:24:44 | * | dadada__ quit (Ping timeout: 265 seconds) |
00:25:23 | bung_ | it almost like js .length |
00:26:35 | * | sz0 quit (Quit: Connection closed for inactivity) |
00:30:36 | * | dadada joined #nim |
00:31:02 | * | dadada is now known as Guest44913 |
00:41:31 | Prestige | @Elegant Beef I have struts being properly allocated for docks now |
00:41:45 | Prestige | looks like polybar is pretty limited though, almost wish I had just written my own bar |
00:42:43 | FromDiscord | <Elegant Beef> Lol |
00:42:54 | FromDiscord | <Elegant Beef> Next thing is the nimdow status bar? |
00:43:55 | Prestige | well one of the two last things before the beta release. Status bar, and actual floating window support |
00:44:06 | Prestige | Everything else seems to be handled |
00:44:19 | FromDiscord | <Elegant Beef> better have super + rmb for resizing floating |
00:44:20 | FromDiscord | <Elegant Beef> 😄 |
00:44:30 | Prestige | Yeah, and lmb for moving |
00:45:07 | Prestige | and I might center floating windows by default.. they seem to anchor with x as 0 for some reason |
00:46:38 | Prestige | https://0x0.st/ipkb.png <- have polybar on both monitors but it doesn't really support workspaces well, and doesn't support tags at all |
00:54:19 | * | Guest44913 quit (Ping timeout: 246 seconds) |
00:54:34 | * | lritter quit (Ping timeout: 256 seconds) |
00:55:03 | * | lritter joined #nim |
01:00:41 | * | dadada__ joined #nim |
01:10:13 | * | Tongir joined #nim |
01:13:22 | * | Tlanger quit (Ping timeout: 272 seconds) |
01:18:43 | * | opal quit (Ping timeout: 240 seconds) |
01:21:53 | * | chemist69 quit (Ping timeout: 272 seconds) |
01:23:20 | * | chemist69 joined #nim |
01:24:46 | * | dadada__ quit (Ping timeout: 272 seconds) |
01:26:49 | * | endragor joined #nim |
01:30:37 | * | dadada joined #nim |
01:31:02 | * | dadada is now known as Guest46778 |
01:34:09 | * | opal joined #nim |
01:42:52 | * | nphg1 joined #nim |
01:45:18 | * | nphg quit (Ping timeout: 258 seconds) |
01:47:56 | FromDiscord | <Technisha Circuit> How would i make a pragma that calls whatever proc it's assigned to |
01:48:21 | FromDiscord | <Technisha Circuit> (edit) 'How would i make a pragma that calls whatever proc it's assigned to ... ' => 'How would i make a pragma that calls whatever proc it's assigned towhenever something happens (like the on_message event for Dimscord)' |
01:48:54 | FromDiscord | <Technisha Circuit> And how would i get the name of the proc that has the specific pragma? |
01:52:21 | FromDiscord | <Rika> A pragma is just a macro that takes a proc nimnode isn't it |
01:52:30 | FromDiscord | <Rika> The name is in the nimnode |
01:53:17 | FromDiscord | <Rika> With that, you might be able to figure out the first problem by yourself, but if not, then I can't help because I'm about to pass out |
01:53:46 | FromDiscord | <Technisha Circuit> Oki :P |
01:53:49 | FromDiscord | <Technisha Circuit> Go to sleep |
01:54:10 | * | Guest46778 quit (Ping timeout: 246 seconds) |
02:00:37 | * | dadada__ joined #nim |
02:17:33 | FromGitter | <DylanModesitt> How would I go about implementing an "unpacking" macro like pythons `f(*args)` or `apply` in lisp that can handle functions both returning void and a type. Is there a type for the union[any, void]? I can do |
02:17:39 | FromGitter | <DylanModesitt> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ecdcdc3b101510b201c79e6] |
02:18:08 | FromGitter | <DylanModesitt> or void / no `: auto` or even generic in return type `T`. |
02:18:19 | FromGitter | <DylanModesitt> Consider the example: `let green: tuple[r, g, b, a: uint8] = (0.uint8, 255.uint8, 0.uint8, 0.uint8)` |
02:20:12 | FromGitter | <DylanModesitt> and wanting to apply unpacking to both ⏎ ⏎ ```proc foo(r, g, b, a: uint8): string = $g``` [https://gitter.im/nim-lang/Nim?at=5ecdce5c4c9b0f060d272454] |
02:20:30 | FromGitter | <DylanModesitt> It seems that the macro needs to be overloaded w.r.t the return type |
02:21:02 | FromDiscord | <Elegant Beef> I must be daft cause i dont know what you're asking |
02:21:55 | FromGitter | <DylanModesitt> Yeah ok - fair that was probably pretty unclear |
02:23:02 | FromGitter | <DylanModesitt> Say I wanted a macro `unpack` that could do the following: |
02:23:07 | FromGitter | <DylanModesitt> ```proc foo(r, g, b, a: uint8): string = $g ⏎ let a = unpack(foo, green) ⏎ echo a``` [https://gitter.im/nim-lang/Nim?at=5ecdcf0bf0b8a2053ab699e7] |
02:23:37 | FromGitter | <DylanModesitt> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ecdcf29ff7a920a7213c4fa] |
02:23:58 | FromGitter | <DylanModesitt> I can use the macro I wrote above to do that just fine |
02:24:06 | * | dadada__ quit (Ping timeout: 256 seconds) |
02:25:06 | FromGitter | <DylanModesitt> However, If I have a function `bar` that returns `void`. like so: |
02:25:20 | FromGitter | <DylanModesitt> ```proc bar(r, g, b, a: uint8) = echo g ⏎ let a = unpack(bar, green)``` [https://gitter.im/nim-lang/Nim?at=5ecdcf8fa91f120a6cc59801] |
02:25:35 | FromGitter | <DylanModesitt> The compiler will complain because the expression has no type |
02:26:46 | FromDiscord | <Elegant Beef> Sorry im now just at "why?" especially at the `# a is now "255"` |
02:27:04 | FromDiscord | <Elegant Beef> oh |
02:27:22 | FromDiscord | <Elegant Beef> i was thinking you wanted to change the value in the tuple a to "255" |
02:27:44 | FromGitter | <DylanModesitt> oh no I was saying that example works with my macro - but fails in the case of `bar` |
02:28:16 | FromDiscord | <Elegant Beef> Well if you dont return something what do you expect? |
02:29:06 | FromGitter | <DylanModesitt> No I understand why it does not work for functions like `bar` and `foo` both - but Is there a way I can. It would make sense that you could make a macro like this IMO. The only thing I can think of is this: |
02:30:29 | FromDiscord | <Rika> @DylanModesitt there's a module called unpack |
02:30:37 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:30:41 | * | dadada joined #nim |
02:30:44 | FromDiscord | <Rika> Nimble module of course |
02:31:05 | * | dadada is now known as Guest26400 |
02:31:55 | FromDiscord | <Elegant Beef> You example doesnt really make sense for a unpack macro |
02:31:59 | FromDiscord | <Elegant Beef> (edit) 'You' => 'Your' |
02:32:24 | * | muffindrake joined #nim |
02:32:43 | FromGitter | <DylanModesitt> sorry but how come? Say instead of bar it was to do an in place fill on an image or something - I feel like unpacking with the same macro makes sense |
02:33:10 | FromDiscord | <Elegant Beef> Well your first example had no reason for a macro 😄 |
02:33:29 | FromDiscord | <Rika> Please read my response T_T |
02:34:41 | FromDiscord | <Elegant Beef> You're asking about unpacking a proc with no return type, so unless you check if the proc has a echo, and then read the std out after it, i have 0 clue how you'd unpack that |
02:35:15 | FromDiscord | <Elegant Beef> But i do attest im a numpty |
02:35:22 | FromDiscord | <Technisha Circuit> How do i cross compile on Nim? |
02:35:24 | FromDiscord | <Technisha Circuit> Nvm |
02:35:30 | FromDiscord | <Rika> He means to unpack the tuple to the arts of the proc |
02:35:35 | FromDiscord | <Rika> Args |
02:35:37 | FromDiscord | <Elegant Beef> ah |
02:35:59 | FromGitter | <DylanModesitt> Yeah - sorry maybe unpack is a bad word here - It looks like the unpack module does more of the python `a, b = (1, 2)` |
02:36:00 | FromDiscord | <Elegant Beef> Need to make better examples to explain yourself imo 😄 |
02:36:15 | FromGitter | <DylanModesitt> I want more of the `f(*(1,2))` |
02:36:22 | FromGitter | <DylanModesitt> ah im sorry :( |
02:37:03 | FromDiscord | <Rika> Dylan: make a proc that takes in a tuple, then use the python style unpacking (actually can be done without the unpack module if it's a tuple), and supply args to the original proc |
02:38:26 | FromGitter | <DylanModesitt> Rika that seems like a good practical thing to do - this is all rather silly but I am wondering if there fundamentally is any way to make this macro |
02:38:26 | FromDiscord | <Elegant Beef> So much for sleep rike, eh? |
02:38:53 | FromDiscord | <Technisha Circuit> Is there a library that makes crosscompiling easy as `compile fileName --os:win --arch:amd64`? |
02:38:59 | FromDiscord | <Rika> Something like ``` proc foo(t: tuple[r, g, b, a: uint8]):string = let (r, g, b, a) = t; foo(r, g, b, a)``` or so |
02:39:18 | FromDiscord | <Technisha Circuit> Or at least a way I don't have to mess around with the compiler |
02:39:25 | FromDiscord | <Elegant Beef> the nim compiler already does |
02:39:27 | FromDiscord | <Rika> Yeah it's macroable dylan |
02:39:29 | FromDiscord | <Technisha Circuit> Because that's hard to do on Termux |
02:39:32 | FromDiscord | <Technisha Circuit> O |
02:39:34 | FromDiscord | <Rika> Just can't elaborate how since macro |
02:39:40 | FromGitter | <DylanModesitt> I want the nim equivalent of the following python code ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ecdd2ec27513a72fbb5a308] |
02:39:57 | FromDiscord | <Elegant Beef> You can make a nimble package also to do the compiling for different platforms |
02:40:09 | FromDiscord | <Elegant Beef> (edit) removed 'a' | 'package' => 'tasks' |
02:40:12 | FromDiscord | <Rika> Dylan: I can't elaborate since I'm on the phone and I'm not Technicae |
02:40:23 | FromDiscord | <Rika> Cough cough @Technisha Circuit |
02:40:31 | FromDiscord | <Elegant Beef> Lol |
02:40:38 | FromDiscord | <Elegant Beef> Guy programs on his phone |
02:40:48 | FromDiscord | <Elegant Beef> Can android even get a mingw compiler? |
02:40:51 | FromDiscord | <Rika> Mr "I program on my phone more than my pc" |
02:40:57 | FromDiscord | <Rika> Black fucking magic I say |
02:41:04 | FromGitter | <DylanModesitt> Right now, The macro I gave above works for cases of `bar`. I can choose to make it work for cases `foo` by changing to return type of `unpack` to void (or leaving it out) - but I want the macro to work for both just because I feel like that is reasonable. |
02:41:32 | FromDiscord | <Technisha Circuit> > Dylan: I can't elaborate since I'm on the phone and I'm not Technicae↵hahaha |
02:41:41 | FromGitter | <DylanModesitt> This is not a super practical problem |
02:41:48 | FromDiscord | <Technisha Circuit> It's not that bad XD |
02:41:58 | FromDiscord | <Rika> Sure it isn't |
02:42:19 | FromDiscord | <Rika> Maybe I'll be even more insane than you by compiling on ios |
02:42:35 | FromDiscord | <Technisha Circuit> Ios sucks |
02:42:39 | FromDiscord | <Technisha Circuit> But it is doable |
02:42:53 | FromDiscord | <Technisha Circuit> With an app called `iSH` |
02:44:17 | FromDiscord | <Technisha Circuit> And my friend ***Cough Cough*** *@codic ↵* ***Cough Cough*** just SSHed into his ipad without iSH or other similar tools and actually managed to compile Ruby |
02:44:56 | FromDiscord | <Technisha Circuit> (edit) '*@codic ↵*' => '*@codic*' |
02:45:01 | FromDiscord | <Rika> Man i don't want to intentionally need to shoot myself in the foot and end up blasting my head off |
02:45:08 | FromDiscord | <Technisha Circuit> Hahahaha |
02:45:32 | FromDiscord | <codic> Wut |
02:45:36 | FromDiscord | <Technisha Circuit> He's here XD |
02:45:38 | FromDiscord | <codic> It has a built in `sh` |
02:45:46 | FromDiscord | <codic> Some really old version but it works |
02:45:48 | FromDiscord | <Technisha Circuit> So does android |
02:45:51 | FromDiscord | <Technisha Circuit> :P |
02:45:54 | FromDiscord | <codic> Yeah of course |
02:46:00 | FromGitter | <kaushalmodi> @DylanModesitt https://play.nim-lang.org/#ix=2nsg |
02:46:08 | FromDiscord | <Rika> @Dylan: so what I think you can do is to make a macro that takes in a proc (a pragma) which constructs a second proc for the tuole |
02:46:08 | FromDiscord | <Technisha Circuit> So how did you compile Ruby anyway? |
02:46:12 | FromGitter | <kaushalmodi> here's one way to interpret your Python code |
02:46:21 | FromDiscord | <codic> like this: |
02:46:30 | FromDiscord | <codic> wait |
02:46:47 | FromDiscord | <codic> https://www.ruby-lang.org/en/documentation/installation/#building-from-source |
02:46:48 | FromDiscord | <codic> :p |
02:46:54 | FromDiscord | <Technisha Circuit> I wonder if i could switch to my android's built-in shell |
02:46:59 | FromDiscord | <Technisha Circuit> Wait |
02:47:02 | FromDiscord | <codic> Well |
02:47:05 | FromDiscord | <codic> That was what I originally tried |
02:47:07 | FromDiscord | <Technisha Circuit> Gcc was installed? |
02:47:07 | FromDiscord | <codic> But failed |
02:47:12 | FromGitter | <DylanModesitt> @kaushalmodi ah sorry - no I am totally cool with that |
02:47:18 | FromGitter | <DylanModesitt> I mean how to do it in the unpacking sense |
02:47:19 | FromDiscord | <Technisha Circuit> (edit) 'I wonder if i could switch to my android's built-in shell ... ' => 'I wonder if i could switch to my android's built-in shellwithout root' |
02:47:26 | FromDiscord | <codic> Also @Technisha Circuit #offtopic |
02:47:29 | FromGitter | <DylanModesitt> Imagine I was not the author of foo and bar - I am not looking for a direct translation |
02:47:40 | FromDiscord | <Elegant Beef> Yall people coding on your phones need jesus |
02:47:58 | * | arecaceae quit (Read error: Connection reset by peer) |
02:48:35 | FromDiscord | <Elegant Beef> I've got it, in any library i make im going to check if it's running on mobile, and if so quit with no error message |
02:48:42 | FromDiscord | <Rika> Dylan, manually unpack the tuple I assume |
02:49:20 | FromGitter | <kaushalmodi> @DylanModesitt I needed to scroll up a bit more.. I didn't understand the problem statement |
02:49:21 | FromGitter | <DylanModesitt> Ok - so that is all. One can not write this macro to support functions both of return type `void` and `any`? |
02:49:47 | FromDiscord | <Rika> Beef: why not run `rm .`? |
02:50:12 | FromDiscord | <Rika> Dylan, I don't see why return types matter |
02:52:02 | FromGitter | <DylanModesitt> Because you get compile errors with the macro - you can only choose one or the other |
02:52:05 | FromGitter | <DylanModesitt> I.e |
02:52:16 | FromGitter | <DylanModesitt> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ecdd5e027513a72fbb5a85f] |
02:52:16 | FromDiscord | <Rika> I mean |
02:52:29 | FromDiscord | <Rika> Why would it matter in the context |
02:52:40 | FromGitter | <DylanModesitt> Or |
02:52:56 | FromGitter | <DylanModesitt> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ecdd608225dc25f54aa46e8] |
02:53:24 | * | arecaceae joined #nim |
02:53:40 | FromDiscord | <Rika> Man i would test this code if I coult |
02:53:42 | FromGitter | <DylanModesitt> So that the macro can be general?. It seems bad if it only works for functions with non-void and it seems extra silly to nly work with functions for void. The examples of `foo` and `bar` *are not real* |
02:54:12 | FromDiscord | <Rika> But I can't ssh into my desktop right now and I would rather torture than code on my phone |
02:54:25 | FromGitter | <DylanModesitt> Rika it sounds like your phone programming skills need to get up to par with @Technisha - though I have just met you both 😉 |
02:54:38 | * | Guest26400 quit (Ping timeout: 260 seconds) |
02:54:40 | FromDiscord | <Rika> It's not that I'm incapsble |
02:54:46 | FromDiscord | <Rika> It's that I'm unwilling |
02:55:32 | FromGitter | <DylanModesitt> Hahaha sure then I mean your willingness for typing on a 3inch wide screen should clearly increase |
02:56:05 | FromGitter | <DylanModesitt> Ill keep poking around on it - its not like this is preventing me from doing anything real. It is more just a question of can you do something like this (which the answer to is probably yes). |
02:56:52 | FromDiscord | <Rika> Know that you can print how the code looks with result.repr |
02:57:03 | FromDiscord | <Rika> And the ast with treeRepr |
02:57:29 | FromGitter | <DylanModesitt> yeah |
02:57:53 | FromGitter | <DylanModesitt> mean I can make it work either way just fine - I used `treeRepr` while writing this. I just can not get it to work for *both at the same time* |
02:57:58 | FromDiscord | <Technisha Circuit> Hahahaha |
02:58:13 | FromDiscord | <Technisha Circuit> Come onnnn, coding on mobile isn't thaaaaat bad |
02:58:48 | FromGitter | <DylanModesitt> its p crazy to me that you're willing to do that @Technisha |
02:58:55 | FromDiscord | <Technisha Circuit> Hahaha |
02:59:00 | FromGitter | <DylanModesitt> I get the romance of the idea of it |
02:59:01 | bung_ | I create a server ,using .close close client, then I re-run client, client cant receive data? |
02:59:12 | FromDiscord | <Technisha Circuit> I started coding on mobile because i had no PC at the time |
02:59:34 | FromDiscord | <Technisha Circuit> And the advantage of me starting on my phone is that it's easy for me to do so |
02:59:36 | FromGitter | <DylanModesitt> I use ios (I know - filth) and have some ssh scripts set up with siri shortcuts and that was fun. But actually writing large programs seems so bad |
02:59:49 | FromDiscord | <Technisha Circuit> Oof |
02:59:51 | FromDiscord | <Technisha Circuit> Well |
02:59:52 | FromGitter | <DylanModesitt> @Technisha dont get me wrong its pretty baller |
03:00:08 | FromDiscord | <Technisha Circuit> I've written some big discord bots (that I've gave up on) |
03:00:11 | FromDiscord | <Technisha Circuit> Soooo |
03:00:24 | FromDiscord | <Rika> I made my ssh to desktop pretty stupidly hard to do on my phone |
03:00:40 | * | dadada__ joined #nim |
03:00:49 | FromDiscord | <Technisha Circuit> sent a code paste, see http://ix.io/2nsk |
03:00:53 | FromDiscord | <Technisha Circuit> That was written on android |
03:01:07 | FromDiscord | <Technisha Circuit> > I made my ssh to desktop pretty stupidly hard to do on my phone↵how? |
03:01:13 | FromDiscord | <Rika> I was thinking "hmm, this doesn't look like nim code" |
03:01:23 | FromDiscord | <Technisha Circuit> Yeah that's Python :P |
03:01:29 | FromDiscord | <Rika> Technisha: port knocking |
03:01:35 | FromDiscord | <Technisha Circuit> ? |
03:01:39 | FromDiscord | <Technisha Circuit> Wdym? |
03:02:02 | FromDiscord | <Rika> I have to send packets to certain ports in a certain order to open the ssh port 22 |
03:02:12 | FromDiscord | <Technisha Circuit> Oo |
03:02:26 | FromDiscord | <Technisha Circuit> That seems like a good security method tbh |
03:02:29 | FromDiscord | <Rika> I installed it to test it out before I put it on my vps |
03:02:36 | FromDiscord | <Rika> Forgot to undo it |
03:02:39 | FromDiscord | <Technisha Circuit> Oof |
03:03:23 | FromGitter | <DylanModesitt> was this to prevent you from programming on your phone as a personal thing or for some security by obscurity thing @Rika |
03:03:49 | FromDiscord | <Rika> Security by obscurity |
03:03:55 | FromDiscord | <Rika> It was for testing out |
03:03:58 | FromDiscord | <Rika> As I said above |
03:04:03 | FromDiscord | <Technisha Circuit> It's a good security method imo |
03:04:05 | FromDiscord | <Rika> Not meant to stay on my desktop |
03:04:09 | FromDiscord | <Technisha Circuit> How would i do it XD |
03:04:19 | FromDiscord | <Technisha Circuit> (edit) 'How would i do it ... XD' => 'How would i do itfor my phone?' |
03:04:28 | FromDiscord | <Rika> Tech: if combined with other security methods sure |
03:04:37 | FromDiscord | <Rika> Tech, go fuck yourself lmaooo |
03:04:43 | FromDiscord | <Technisha Circuit> Hahahaha |
03:04:45 | FromDiscord | <Rika> (check out knocks) |
03:04:49 | FromDiscord | <Rika> Knockd** |
03:04:58 | FromDiscord | <Rika> On github too afaik |
03:04:58 | FromDiscord | <Technisha Circuit> I'll probably use some stupid way to do it via a webserver |
03:05:03 | FromGitter | <DylanModesitt> yo guys im mad dumb |
03:05:05 | FromDiscord | <Technisha Circuit> Ooo |
03:05:07 | FromGitter | <DylanModesitt> This works fine |
03:05:10 | FromDiscord | <Technisha Circuit> What's up? |
03:05:13 | FromDiscord | <Technisha Circuit> Oof |
03:05:29 | FromDiscord | <Rika> Was wondering how it didn't work but I brushed it off as "Nim being weird" |
03:05:35 | FromGitter | <DylanModesitt> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ecdd8feff7a920a7213d93f] |
03:05:42 | FromDiscord | <Rika> Mmm |
03:05:44 | FromDiscord | <Technisha Circuit> https://github.com/jvinet/knock this? |
03:05:48 | FromGitter | <DylanModesitt> It was because I kept experimenting with `auto` and `any` |
03:05:48 | FromDiscord | <Rika> Yes |
03:06:00 | FromGitter | <DylanModesitt> and did not try my experiment together |
03:06:23 | FromGitter | <DylanModesitt> although it is obviously that `auto` should work and `any` should not |
03:06:34 | FromGitter | <DylanModesitt> ugh - sorry folks |
03:06:51 | FromGitter | <DylanModesitt> mad dumb question from the getgo |
03:06:53 | FromDiscord | <Technisha Circuit> Time to recreate this in the most stupid way possible- |
03:07:56 | * | rockcavera quit (Remote host closed the connection) |
03:07:59 | FromDiscord | <Technisha Circuit> How would i make it so even if a port isn't open, it'll respond to a certain key/number? |
03:08:17 | FromDiscord | <Technisha Circuit> Without upnp either |
03:10:48 | FromDiscord | <Rika> Have fun. |
03:11:51 | FromDiscord | <Technisha Circuit> Haha |
03:12:01 | FromDiscord | <Technisha Circuit> I will (not) :P |
03:12:20 | FromDiscord | <Technisha Circuit> Wait, is there a Nim library for upnp? |
03:23:23 | * | chemist69 quit (Remote host closed the connection) |
03:23:45 | * | chemist69 joined #nim |
03:24:24 | * | dadada__ quit (Ping timeout: 256 seconds) |
03:29:25 | * | muffindrake quit (Quit: muffindrake) |
03:30:43 | * | dadada joined #nim |
03:31:06 | * | dadada is now known as Guest94880 |
03:43:35 | FromDiscord | <Zed> how do you clear a sequence?↵so i have a sequence called tokens |
03:43:50 | FromDiscord | <Zed> `var tokens: seq[syntaxObj]` |
03:44:47 | FromDiscord | <Zed> but when running `tokens.setLen(0)` to clear the sequence i'm getting an error that it's a type mismatch? |
03:45:06 | FromGitter | <kaushalmodi> `tokens = @[]`? |
03:46:13 | FromDiscord | <Zed> yeah that worked, and the fact that my dumb ass but it with the wrong indentation |
03:47:18 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:49:13 | FromDiscord | <codic> What is the invalid character constant here? `stdout.styledWrite(fgGreen, " \__/")↵` |
03:49:27 | disruptek | \_ |
03:49:41 | disruptek | use \\_ |
03:52:23 | FromDiscord | <codic> Can I use hex codes for styledWrite? |
03:52:27 | FromDiscord | <codic> With trueclor perhaps |
03:53:01 | FromDiscord | <Technisha Circuit> I also need to know this :P |
03:53:54 | * | Guest94880 quit (Ping timeout: 240 seconds) |
03:54:12 | FromDiscord | <Technisha Circuit> Aaa |
03:54:18 | FromDiscord | <Technisha Circuit> Nothing is loading |
03:54:21 | FromDiscord | <Technisha Circuit> Oh it works now |
03:56:32 | FromDiscord | <Zed> story of my life |
03:56:37 | FromDiscord | <Technisha Circuit> Haha |
04:00:40 | * | dadada__ joined #nim |
04:01:36 | * | muffindrake joined #nim |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:41 | * | supakeen joined #nim |
04:12:16 | * | bunbunbunbunny joined #nim |
04:12:19 | bunbunbunbunny | join #python |
04:22:15 | * | zacharycarter joined #nim |
04:24:18 | * | dadada__ quit (Ping timeout: 256 seconds) |
04:29:23 | FromDiscord | <dayl1ght> how can I split a string using another string (not a char) as a separator? |
04:30:19 | FromDiscord | <dayl1ght> oh, the split in strutils already does that |
04:30:40 | * | dadada joined #nim |
04:31:04 | * | dadada is now known as Guest673 |
04:52:09 | * | kungtotte quit (Read error: Connection reset by peer) |
04:52:38 | * | gangstacat quit (Quit: Ĝis!) |
04:53:41 | * | kungtotte joined #nim |
04:54:16 | * | Guest673 quit (Ping timeout: 256 seconds) |
04:55:09 | * | gangstacat joined #nim |
04:55:17 | voltist | `Error: undeclared identifier: 'expr'` strange... |
05:00:36 | * | dadada__ joined #nim |
05:03:44 | voltist | Oh, the code is just *super* old |
05:05:13 | FromDiscord | <Stuffe> When iterating over enum values, does anyone know if there is a way to only get the valid entries? |
05:05:19 | FromDiscord | <Stuffe> Here is an example of what I mean: https://play.nim-lang.org/#ix=2nsw |
05:08:25 | skrylar[m] | Zevv: "old 2020 nim" but.. five months isn't that old o__o |
05:08:44 | disruptek | pepperidge farm remembers. |
05:11:21 | * | nekits quit (Read error: Connection reset by peer) |
05:12:06 | * | solitudesf joined #nim |
05:13:12 | * | nekits joined #nim |
05:23:54 | * | dadada__ quit (Ping timeout: 240 seconds) |
05:30:40 | * | dadada joined #nim |
05:31:03 | * | dadada is now known as Guest4342 |
05:40:28 | skrylar[m] | well average attention span is sub-goldfish, so i guess 5 months is old now |
05:40:52 | skrylar[m] | people look at me like a mutant when ir emember something they told me 3 days earlier |
05:43:06 | * | dddddd quit (Ping timeout: 260 seconds) |
05:46:18 | voltist | shashlick: Thoughts on this error with Nimterop? https://pastebin.com/GLmugEQ5 |
05:46:42 | voltist | I'm not 100% sure you are the nimterop person but I remember so :) |
05:54:34 | * | Guest4342 quit (Ping timeout: 272 seconds) |
05:56:36 | * | bebarker joined #nim |
06:00:04 | * | bbarker quit (Ping timeout: 256 seconds) |
06:00:38 | * | dadada__ joined #nim |
06:09:49 | livcd | this is such a bad experience...nim formatter stuck in vscode...cant save a file...... |
06:10:31 | * | tdc joined #nim |
06:11:32 | skrylar[m] | turn it off? :doesn't use the formatter :S: |
06:12:58 | * | PMunch joined #nim |
06:13:46 | * | zacharycarter quit (Quit: Lost terminal) |
06:22:53 | * | lritter quit (Ping timeout: 265 seconds) |
06:24:01 | * | dadada__ quit (Ping timeout: 246 seconds) |
06:26:11 | * | NimBot joined #nim |
06:30:38 | * | dadada joined #nim |
06:31:03 | * | dadada is now known as Guest15874 |
06:37:06 | Zevv | skrylar[m]: yeah, but this is the *new* nim, right? |
06:38:11 | skrylar[m] | Zevv: the only 'new' nim i know about is like, newruntime+arc o_O |
06:38:27 | Zevv | You missed some context of my msg I guess :) |
06:38:37 | skrylar[m] | apparently. |
06:38:51 | Zevv | I hacked the Nim parser to parse this: http://ix.io/2n99 |
06:39:01 | skrylar[m] | egads. |
06:40:32 | skrylar[m] | mostly just been working on money projects this week. and tinkering the tesselator here and there. looked in to defold for a bit and it seems very godot-esque, aside from requiring proprietary software to do skeleton anims xD |
06:51:43 | PMunch | Zevv, you added brackets to Nim? :P |
06:52:10 | * | bunbunbunbunny quit (Quit: leaving) |
06:54:13 | * | liblq-dev joined #nim |
06:54:38 | * | Guest15874 quit (Ping timeout: 256 seconds) |
06:54:43 | FromDiscord | <Elegant Beef> Zevv forgot semicolons |
06:55:04 | FromDiscord | <Elegant Beef> Gotta get rid of the significant white space, and then nim can attract more popel |
06:55:08 | FromDiscord | <Elegant Beef> (edit) 'popel' => 'people' |
07:00:40 | * | dadada__ joined #nim |
07:06:45 | * | bung_ quit (Quit: Lost terminal) |
07:09:49 | * | Tlanger joined #nim |
07:11:11 | PMunch | @Elegant Beef, you can already use semicolons in regular Nim |
07:12:17 | * | Tongir quit (Ping timeout: 258 seconds) |
07:16:57 | skrylar[m] | eeh the complaitns about whitespace are almost always noise |
07:17:08 | skrylar[m] | its like complaints about parens in lisp |
07:17:18 | skrylar[m] | the real reason they dont want to use it is because there isn't a superwinner already using it |
07:18:12 | * | neceve joined #nim |
07:18:33 | skrylar[m] | was pondering about lock-free queues but i'm not sure its worth the effort. some of these "lock-free" things really just spinlock until their counter works like they want, which isn't really different from just using a read/write lock |
07:21:55 | skrylar[m] | if its already gonna spinlock, i don't see why not just use the lock test and set http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html |
07:22:03 | skrylar[m] | and a circular buffer |
07:23:07 | * | leorize quit (Remote host closed the connection) |
07:23:37 | * | leorize joined #nim |
07:23:40 | FromDiscord | <Elegant Beef> I know pmunch |
07:23:43 | FromDiscord | <Elegant Beef> That's why i said forgot |
07:24:06 | * | dadada__ quit (Ping timeout: 256 seconds) |
07:24:48 | * | bung joined #nim |
07:26:30 | * | sz0 joined #nim |
07:27:50 | skrylar[m] | well. good night. |
07:30:43 | * | dadada joined #nim |
07:31:06 | * | dadada is now known as Guest45807 |
07:37:41 | Zevv | PMunch: sure, it's soo broken as it is now |
07:42:38 | * | bung quit (Quit: Lost terminal) |
07:44:10 | PMunch | Hmm, I just realised that there are multiple cache modules in the package manager already... |
07:44:16 | PMunch | How did I not see these earlier.. |
07:44:27 | FromDiscord | <Doongjohn> > When iterating over enum values, does anyone know if there is a way to only get the valid entries?↵@Stuffe https://github.com/nim-lang/Nim/pull/14008 |
07:44:28 | disbot | ➥ enummaps: library based generalized typesafe enum with holes ; snippet at 12https://play.nim-lang.org/#ix=2iER |
07:44:32 | PMunch | Now the question becomes, what do I call mine? |
07:45:06 | * | Senny joined #nim |
07:47:45 | Zevv | The Munchinator! |
07:48:41 | PMunch | Haha |
07:48:42 | Zevv | With a name like that I would call *all* of projects The Munchinater and just give them sequence numbers. |
07:48:46 | PMunch | Muncache |
07:49:39 | FromDiscord | <dayl1ght> sent a code paste, see http://ix.io/2nsS |
07:49:48 | FromDiscord | <dayl1ght> Can I do this with templates in nim or does it require emacros? |
07:50:39 | FromDiscord | <dayl1ght> Oh sorry, I forgot that code blocks don't work in IRC, here's a paste: https://ghostbin.co/paste/7esxz |
07:51:03 | PMunch | @daylight, it's actually fixed now :) |
07:51:15 | PMunch | Yardanicos new bot automatically creates links from code pastes |
07:51:19 | FromDiscord | <dayl1ght> nice! |
07:51:37 | PMunch | And the problem was never that they didn't work, just that they were super spammy |
07:53:19 | PMunch | Something like this? https://play.nim-lang.org/#ix=2nsV |
07:53:39 | PMunch | Oh, and with the getA and getB of course, didn't know what they were :P |
07:54:32 | * | Guest45807 quit (Ping timeout: 256 seconds) |
07:55:12 | PMunch | Is there a way to detect that "invalid data" condition: https://play.nim-lang.org/#ix=2nsY = |
07:57:48 | FromDiscord | <dayl1ght> oh, that was simpler than I thought, thanks @PMunch |
07:57:57 | FromDiscord | <dayl1ght> is there a way to do it with infix syntax inside the template? |
08:00:44 | * | dadada__ joined #nim |
08:01:46 | PMunch | @dayl1ght, not sure, don't think so. But why would you want to? |
08:02:00 | PMunch | Nim has universal call syntax so they are the same :P |
08:04:06 | FromDiscord | <dayl1ght> just curious 😛 I guess I was mostly wondering if nim had "dumb" macros like c where code is simply copy pasted |
08:06:28 | PMunch | Not unless you really force it to |
08:06:34 | PMunch | Nim tries to not be dumb |
08:07:50 | * | Tlanger quit (Remote host closed the connection) |
08:08:14 | * | Tlanger joined #nim |
08:13:35 | FromDiscord | <Stuffe> @Doongjohn thanks for the link. i will keep an eye out for the fix |
08:18:59 | * | konvertex joined #nim |
08:20:06 | * | anti[m] quit (*.net *.split) |
08:20:09 | * | Northstrider[m] quit (*.net *.split) |
08:23:02 | * | vqrs quit (Ping timeout: 264 seconds) |
08:23:52 | * | bung joined #nim |
08:24:30 | * | dadada__ quit (Ping timeout: 256 seconds) |
08:25:07 | * | vqrs joined #nim |
08:26:09 | bung | what's the recommand way check server ready for connect? |
08:26:49 | * | Northstrider[m] joined #nim |
08:27:54 | FromDiscord | <Elegant Beef> Typically a handshake is done |
08:28:34 | * | anti[m] joined #nim |
08:30:42 | * | dadada joined #nim |
08:31:06 | * | dadada is now known as Guest18637 |
08:31:12 | FromDiscord | <Elegant Beef> And in some systems it gets a cringey name like a hug and kiss |
08:35:45 | bung | handshake muanually ? not seen it list in document |
08:36:10 | bung | currently I use a loop with limit number |
08:40:57 | skrylar[m] | well if its a very advanced system there's usually a secondary health check server |
08:41:23 | skrylar[m] | but otherwise attempting the connection is fine, though you might want exponential backoff |
08:42:56 | skrylar[m] | but most of the time those health check servers are just running a ping, so that's what they're doing anyway |
08:48:28 | FromDiscord | <Elegant Beef> I do have to note my experience with servers is purely in small game dev scenarios where you want information from the server if a connection is met 😄 |
08:49:52 | FromDiscord | <Elegant Beef> So the client typically sends a name and their customization, then the server responds with the server settings and both are merry |
08:54:14 | * | Tongir joined #nim |
08:57:13 | * | Tlanger quit (Ping timeout: 264 seconds) |
09:18:57 | * | liblq-dev quit (Quit: WeeChat 2.8) |
09:19:46 | * | Vladar joined #nim |
09:30:32 | * | letto quit (Quit: Konversation terminated!) |
09:31:20 | * | letto joined #nim |
09:58:56 | * | kenran joined #nim |
10:00:52 | * | bung quit (Ping timeout: 265 seconds) |
10:02:54 | * | Trustable joined #nim |
10:14:38 | * | Senny quit (Ping timeout: 260 seconds) |
10:30:02 | * | bung joined #nim |
10:31:27 | * | Senny joined #nim |
10:34:17 | * | bung quit (Ping timeout: 246 seconds) |
10:40:29 | * | Senny quit (Ping timeout: 272 seconds) |
10:46:03 | * | fredrikhr joined #nim |
10:51:09 | * | monokrom joined #nim |
10:52:39 | FromDiscord | <Zed> How do you assign nil to a variable? |
10:54:22 | * | Guest18637 quit (Ping timeout: 260 seconds) |
10:55:26 | Prestige | I think only ptrs can be nil, but what are you trying to do @Zed? |
10:55:28 | FromDiscord | <Zed> im trying to implement some blockchain, but when creating the base block there is no previous hash so the value should be nil for that prevHash variable |
10:55:50 | Prestige | You can use an Option[T] and set it to none(T) to start |
10:56:27 | FromDiscord | <Zed> do you have a rough example? |
10:57:06 | PMunch | chainHead = none(BlockType) |
10:57:38 | PMunch | But I guess the type for your block is a ref object? Those should be able to be nil.. |
10:57:53 | Prestige | https://play.nim-lang.org/#ix=2nto @Zed |
10:59:11 | PMunch | How long have you been using Nim now Prestige? |
10:59:12 | * | Tongir quit (Ping timeout: 256 seconds) |
10:59:25 | Prestige | Hmm I think it's been over a month now? |
10:59:54 | Prestige | started about mid april |
11:00:21 | PMunch | It's cool to see how fast you've become acquainted with the stdlib and proficient in Nim |
11:00:42 | FromDiscord | <Zed> PMunch: my blocks just an object, i only what the prevHash variable to be able to be nilled, swift had a neat feature where you could add '?' and it was automatically nil |
11:00:42 | Prestige | Thanks :) I'm loving the language |
11:01:08 | PMunch | Zed, that's what you would do with Options in Nim |
11:02:30 | FromDiscord | <Zed> i cant find anything about them in the nim manual |
11:02:52 | PMunch | https://nim-lang.org/docs/options.html |
11:03:06 | PMunch | It's a module in the standard library |
11:03:18 | FromDiscord | <Zed> Thanks 🙂 |
11:03:25 | PMunch | See also my optionsutils module |
11:04:16 | Prestige | PMunch: I'm pretty certain I never want to touch xlib again though, I'll need a different type of project next.. lol |
11:04:16 | FromDiscord | <Zed> checking it out now |
11:04:52 | PMunch | Prestige, haha xlib is a bit clunky to work with :P |
11:06:03 | PMunch | I've wanted to look into XCB and also Wayland, but I started with xlib as it appeared to be the easiest and it had a nice step by step guide to create a WM :P |
11:07:43 | Prestige | I'm having issues figuring out how to handle a few weird applications (just wine applications right now), been a pain |
11:08:19 | PMunch | Yup.. |
11:08:33 | PMunch | There are always some weird applications that does something different |
11:10:03 | * | Kaivo joined #nim |
11:10:32 | * | dadada joined #nim |
11:10:55 | * | dadada is now known as Guest33830 |
11:12:31 | * | bung joined #nim |
11:13:00 | * | letto quit (Quit: Konversation terminated!) |
11:14:00 | FromDiscord | <Zed> PMunch: How do you assign a value to an optional? |
11:14:11 | PMunch | some(myValue) |
11:14:47 | PMunch | Or myValue.option like Prestige did in their example |
11:14:55 | * | letto joined #nim |
11:15:29 | FromDiscord | <Zed> Why doesn't '=' work with them? |
11:15:49 | PMunch | Because Option[T] != T |
11:15:55 | PMunch | They are two different types |
11:16:21 | FromDiscord | <Zed> ah ok |
11:16:29 | PMunch | You could also write `converter toOpt[T](x: T): Option[T] = option(x)` to allow Nim to automatically convert things to options |
11:17:34 | * | bung quit (Ping timeout: 240 seconds) |
11:17:45 | PMunch | @Zed, so you can have this: https://play.nim-lang.org/#ix=2ntx |
11:18:36 | FromGitter | <matrixbot> `sheerluck` converter makes typesystem weak :( |
11:19:19 | FromDiscord | <Zed> I think im going to have to read up on the nim docs a bit this weekend |
11:20:09 | PMunch | @sheerluck, converter makes some things easier to type :P |
11:20:19 | PMunch | Options in Nim are IMO really annoying to work with.. |
11:21:10 | FromDiscord | <Zed> What's the difference between a `converter` and a normal `proc` |
11:21:11 | PMunch | If you don't use optionsutils and possibly a converter |
11:21:24 | FromGitter | <sheerluck> Explicit is better than implicit. |
11:22:16 | PMunch | Well, it this case it's just a matter of if we have a value or not "x = 100" is pretty explicitly setting a value for x. |
11:23:47 | PMunch | When using Options to determine if a variable has a value or not it all makes sense with "var x: Option[int]" not having a value and "x = 100" having one. |
11:24:49 | FromDiscord | <Zed> hmmm....i'll have to do some testing with this |
11:27:11 | * | Trustable quit (Remote host closed the connection) |
11:28:39 | * | filcuc joined #nim |
11:30:25 | * | gangstacat quit (Quit: Ĝis!) |
11:30:49 | * | krux02 joined #nim |
11:34:09 | PMunch | @Zed, let us know if you need help :) |
11:36:47 | * | gangstacat joined #nim |
11:40:16 | Prestige | PMunch: Is this a known limitation or am I calling this incorrectly? https://play.nim-lang.org/#ix=2ntE |
11:42:27 | PMunch | Known limitation, but there is a way around it |
11:42:32 | PMunch | Give me a sec |
11:45:27 | PMunch | There we go: https://play.nim-lang.org/#ix=2ntH |
11:45:52 | Prestige | oh that was not what I was expecting to be the fix lol |
11:46:09 | Prestige | Thanks :) |
11:46:43 | PMunch | Yeah, it's a feature that not a lot of people know about I think :P |
11:47:01 | Prestige | Also I found out polybar isn't going to work for my wm because I'm using tags instead of workspaces so I'm going to be writing my own bar... soonish. But I need to get some sleep |
11:47:25 | PMunch | Hmm, why does that make it not work? |
11:47:33 | FromDiscord | <Zed> do you have a link to your wm? |
11:48:24 | Prestige | https://github.com/avahe-kellenberger/nimdow |
11:48:30 | PMunch | TBH it should be displayed a bit more prominently in the generics section of the manual, currently it's only in the "Method call syntax" chapter and not in the generics chapter: https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
11:48:31 | Prestige | Still in progress but works pretty well |
11:48:40 | PMunch | Mine is still semi-closed source |
11:48:48 | FromDiscord | <Zed> looks good! |
11:49:08 | Prestige | PMunch: polybar doesn't allow displaying multiple "workspaces" as active at the same time, which is essentially what tags are |
11:49:12 | Prestige | Thanks @Zed |
11:49:39 | PMunch | They're no really active at the same time though are they? |
11:50:00 | Prestige | For a tag system they are |
11:50:16 | PMunch | Like with my multi-head setup only the workspace with the active window is regarded as active, even though three workspaces are currently shown to me |
11:50:20 | Prestige | I haven't handled that functionality in my wm yet though |
11:50:57 | Prestige | I mean I can view windows from multiple tags on the same monitor at the same time |
11:51:13 | PMunch | Do you have anything written about tag vs. workspace based WMs by the way? I remember you telling me the difference but I've forgotten :P |
11:51:29 | PMunch | Ah right.. |
11:51:51 | Prestige | I should do a write-up about it.. I think there's a YouTube vid I could link or maybe dwm's page talks about it |
11:51:58 | PMunch | But still though, you can still tell polybar that only the tag with the active window in it is the active one.. |
11:52:14 | PMunch | I'm not quite sure what polybar wants to use this information for though.. |
11:52:46 | Prestige | Oh I did write about it |
11:52:52 | Prestige | https://blog.avahe.tk/posts/nimdow/part1/ at the bottom |
11:55:53 | * | filcuc quit (Quit: Konversation terminated!) |
11:56:44 | FromDiscord | <Zed> Prestige: Why did you decide to write a wm? |
11:56:46 | PMunch | Oh neat, didn't know you were writing things as well |
11:57:12 | PMunch | @Zed, why not? :P |
11:57:26 | Prestige | @Zed window managers were failing me in different ways so I decided to pick up a new language and make one |
11:58:03 | Prestige | After I figure out how to manage all the weird windows and write a status bar, it should be smooth sailing |
11:58:10 | PMunch | It's the old slippery slope of being able to do anything |
11:58:28 | Prestige | Okay I'm off for now I'm dead tired, ttyl o/ |
11:58:34 | PMunch | Bye |
11:58:46 | FromDiscord | <Zed> fair enough, yup and then you get analysis paralysis because you can do anything |
11:58:49 | PMunch | I don't know how many hours I've spent customising my setup and writing various small programs to make it behave the way I want |
11:59:03 | * | noonien joined #nim |
11:59:32 | PMunch | I mean when I get PiMo done I can have an Arch install with PiMo and pakku, that's a solid Nim based OS :P |
12:00:01 | PMunch | If only I rewrote xlunch in Nim.. But for that I'd need Imlib2 wrappers.. |
12:01:52 | FromDiscord | <Synth> Hello, is it possible to use asnyc procedures that have return type? |
12:02:05 | PMunch | Uhm, yes? |
12:04:15 | FromDiscord | <Synth> How so? When I try, I keep getting erros |
12:04:54 | PMunch | What kind of errors? |
12:05:02 | PMunch | Are you following any kind of examples/tutorial? |
12:05:16 | * | rockcavera joined #nim |
12:05:38 | FromDiscord | <Synth> ```nim↵implementation of 'test()' expected↵``` |
12:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:23 | PMunch | And code? |
12:06:38 | * | supakeen joined #nim |
12:07:10 | FromDiscord | <Synth> ```nim↵proc test*() {.async.}: string =↵ return "test"↵``` |
12:07:52 | FromDiscord | <Synth> When I remove the return type string though, the error goes away |
12:08:13 | PMunch | Ah, that is because you have the async pragma in the wrong place |
12:08:42 | FromDiscord | <Synth> Oh? |
12:08:52 | PMunch | Pragmas for procs go after the return type |
12:08:58 | FromDiscord | <Synth> Ohh? |
12:09:11 | PMunch | This should work: `proc test*(): string {.async.} =` |
12:09:26 | PMunch | Well, it should get rid of that error |
12:09:40 | PMunch | You probably have to define your return type as Future[string] |
12:09:56 | FromDiscord | <Synth> Now I'm getting: `template/generic instantiation of `async` from here` |
12:10:07 | FromDiscord | <Synth> (edit) '`async`' => '\`async\`' |
12:10:10 | PMunch | That is not the error |
12:10:17 | FromDiscord | <Synth> (edit) '\`async\`' => 'async' |
12:10:27 | FromDiscord | <Synth> Oh? |
12:10:28 | PMunch | That is just a hint telling you that another error in your program comes from that place |
12:10:35 | FromDiscord | <Synth> I see |
12:10:54 | FromDiscord | <Synth> And when I call the procedure, I have to do it by `asyncCheck` right? |
12:11:00 | FromDiscord | <Synth> (edit) 'And when I call the procedure, I have to do it by `asyncCheck` ... right?' => 'And when I call the procedure, I have to do it by `asyncCheck`followed by the proc' |
12:11:47 | PMunch | Well, asyncCheck is the same as discard for a regular proc (it will attach a callback that checks if it throws an error and rethrow that exception). |
12:12:15 | FromDiscord | <Synth> Hmm okay |
12:12:32 | FromDiscord | <Synth> Am I able to convert the return type of `Future[string]` into a string? |
12:12:42 | PMunch | If you actually want to get the string return value you'd need `await` if you are in an async context or `waitFor` if you're in a synchronous scope. |
12:12:44 | FromDiscord | <Synth> I'm sorry for being such a noob |
12:12:55 | FromDiscord | <Synth> Ohh alright |
12:12:55 | PMunch | No worries, most people struggle with async |
12:13:34 | FromDiscord | <Synth> So it'd be like: `await test()` right? |
12:13:41 | PMunch | Yes |
12:13:46 | PMunch | That would return a string |
12:13:50 | FromDiscord | <Synth> Mhmm |
12:13:52 | FromDiscord | <Synth> Thank you! |
12:14:04 | PMunch | But it requires that you are in an async context |
12:14:06 | Zevv | I made async wihthout async the other day - any proc can yield. I should see if I can make that beyoud proof-of-concept. |
12:14:31 | PMunch | Async without async? |
12:14:41 | FromDiscord | <Synth> expression 'await test()` has no type (or is ambiguous) |
12:14:45 | FromDiscord | <Synth> (edit) 'test()`' => 'test()'' |
12:14:49 | FromDiscord | <Synth> (edit) 'expression' => '`expression' | 'ambiguous)' => 'ambiguous)`' |
12:14:53 | FromDiscord | <Synth> Now I'm gtting this ;-; |
12:15:02 | PMunch | Code? |
12:15:17 | FromDiscord | <Synth> https://discordapp.com/channels/371759389889003530/371759389889003532/715174254395785276 |
12:15:19 | Zevv | pmunch: ucontext hack; I'm looking for ways to get Lua coro semantics. |
12:15:32 | FromDiscord | <Synth> With the fixed syntaas |
12:15:33 | FromDiscord | <Synth> (edit) 'syntaas' => 'syntax' |
12:15:34 | Zevv | but typing makes it hard as well |
12:15:45 | PMunch | Zevv: Hmm, I know some of those words :P |
12:16:19 | Zevv | I never have to sit on my hands before I type when telling you stuff, so dont pretend now |
12:16:28 | PMunch | Synth, are you able to share a paste? Or just paste into Discord (this creates a paste automatically now) |
12:16:33 | FromDiscord | <Synth> ```nim↵proc test*(): Future[string] {.async.} =↵ return "test"↵``` |
12:18:06 | PMunch | Zevv, wait, you're using Linux' ucontext switching to implement "async"? |
12:18:22 | PMunch | That.. Might actually work.. |
12:19:16 | PMunch | Synth, not quite sure what your issue is: https://play.nim-lang.org/#ix=2ntS |
12:20:05 | FromDiscord | <Synth> Ohh alright, that's weird |
12:20:20 | FromDiscord | <Synth> It fixed |
12:20:26 | FromDiscord | <Synth> I wasn't using `waitFor` |
12:20:32 | FromDiscord | <Synth> I was using `await test()` |
12:20:38 | FromDiscord | <dom96> Zevv: you are aware of the Nim coro module right? |
12:21:03 | Zevv | sure, but it schedules "wrong" |
12:21:26 | PMunch | Nim has a coro module? |
12:21:33 | PMunch | Man, I'm OOTL on this stuff.. |
12:21:42 | shashlick | @voltist cPlugin is a standalone Nim program - it needs its own `import strutils` |
12:21:42 | Zevv | yeah, but it's discouraged I believe |
12:21:58 | Zevv | It's basically some glue logic over fibers/longjmp/ucontext |
12:22:15 | PMunch | I played around with being able to yield to a specific coroutine a while ago: https://github.com/PMunch/nim-coroutines/blob/master/examples/example.nim |
12:23:23 | PMunch | Nothing as complicated/fancy as ucontext, just uses the same kind of approach that asyncdispatch uses |
12:23:29 | FromDiscord | <Recruit_main707> any references for installing vim plugins in windows?? |
12:23:35 | PMunch | So procedures are turned into closure iterators |
12:23:48 | Zevv | yeah, I started with that. But then you keep this problem. |
12:23:53 | PMunch | @Recruit_main707, maybe ask in #vim ? :P |
12:24:07 | PMunch | What problem? |
12:24:12 | Zevv | It took me a while to realize that my problem with async is that you need to go async all the way. |
12:24:17 | PMunch | Yeah.. |
12:24:22 | PMunch | Well, you can call waitFor.. |
12:24:38 | Zevv | yeah, but you can't yield from everywhere |
12:24:55 | FromDiscord | <dom96> coroutines need async all the way too |
12:25:20 | PMunch | What would a yield do if you weren't in an async context? |
12:25:36 | Zevv | throw an exception I guess :) |
12:25:56 | * | Guest33830 quit (Ping timeout: 246 seconds) |
12:26:07 | Zevv | but for example, I can make a closure proc that yields something and pass that as callback to something else |
12:26:16 | Zevv | with coro based, that would work. A proc is just a proc. |
12:26:53 | Zevv | There's always one active context, so if you yield(), the current context swaps with the one activating or "resuming" that context |
12:27:19 | Zevv | That's the way Lua does it. Somehow Lua coros come so natural to me, I use them a *lot* and almost never need to think deep about what I'm doing. |
12:27:41 | Zevv | But with async something is harder, often things dont "fit", but I have a hard time to define even for myself what the exact problem is |
12:28:18 | Zevv | but of course the price you pay for having multiple C stacks/contexts is high. It's so not portable and confuses things. Stack traces get nasty, etc |
12:28:21 | FromDiscord | <dom96> can you give examples of the problems? |
12:28:42 | Zevv | I think I need to do a writeup of that one day. Like I said, it's hard to figure out for myself even. |
12:29:37 | Zevv | Also the fact that iterators arent reentrant sometimes bites me |
12:29:38 | * | abm joined #nim |
12:30:07 | FromDiscord | <Technisha Circuit> Did you know that in python a boolean is just a subclass of an int? |
12:30:07 | FromDiscord | <Technisha Circuit> 1 == True and 0 == False basically |
12:30:10 | Zevv | another also is the way Lua resume/yield pass data two ways |
12:30:38 | * | dadada joined #nim |
12:30:42 | FromDiscord | <dom96> iterators might not be reentrant, but async procs effectively are AFAIK |
12:30:59 | Zevv | makes sense |
12:31:00 | PMunch | Hmm, what if a {.coroutine.} proc would return a Future[T] that held not only room for the return type, but also the closure iterator. That way calling it would just give you a Future no matter where you are, but if you did await on it then await would be the one that registers the iterator? |
12:31:00 | FromDiscord | <Technisha Circuit> Wait.... |
12:31:03 | * | dadada is now known as Guest94415 |
12:31:50 | PMunch | Or something like that.. |
12:32:01 | Zevv | PMunch: that needs to sink in a bit here :) |
12:32:04 | FromDiscord | <Technisha Circuit> Thank god you can't do true + true in Nin |
12:32:07 | FromDiscord | <Technisha Circuit> (edit) 'Nin' => 'Nim' |
12:32:12 | PMunch | Anyways, gotta go |
12:32:15 | * | PMunch quit (Quit: leaving) |
12:32:17 | Zevv | Ciao! |
12:32:31 | Zevv | echnisha Circuit: Well, if you *want* to do that, you could |
12:32:37 | Zevv | proc `+`(a, b: bool) = ... |
12:32:57 | FromDiscord | <Technisha Circuit> Oh god |
12:33:06 | FromDiscord | <Technisha Circuit> Please no |
12:33:14 | FromDiscord | <Technisha Circuit> ;-; |
12:40:00 | * | endragor quit (Remote host closed the connection) |
12:40:56 | FromDiscord | <Rika> you say "PLEASE NO" to + for bools but "sure" for programming on a phone |
12:40:57 | FromDiscord | <Rika> yes |
12:42:03 | FromDiscord | <Zed> well priorities |
12:43:12 | * | endragor joined #nim |
12:43:33 | * | endragor quit (Remote host closed the connection) |
12:47:33 | FromDiscord | <Technisha Circuit> Hahahaha |
12:47:54 | FromDiscord | <Technisha Circuit> So you want me to start adding bools together? |
12:52:59 | Zevv | sure, why not. Anything Python can do, Nim can do better |
12:56:28 | alehander92 | cant we have |
12:56:30 | FromDiscord | <Zed> i will admit, one thing nim doesn't have at the moment is libraries, tutorials and users |
12:56:32 | alehander92 | int64 sets |
12:56:41 | alehander92 | or only hashset? |
12:57:16 | FromDiscord | <Technisha Circuit> That's true |
12:57:48 | FromDiscord | <Chiqqum_Ngbata> I haven't seen much shortage in libraries, but rather applications using Nim |
12:58:02 | FromDiscord | <Technisha Circuit> Yeah |
12:58:33 | FromDiscord | <Zed> true that |
12:58:59 | Zevv | Zed: what tutorials are missing you think |
12:59:11 | Zevv | https://nim-lang.org/learn.html |
12:59:29 | FromDiscord | <Rika> int64 sets would need 2^64 bytes would it not? alehander92 |
12:59:44 | FromDiscord | <Rika> a hashset would work better for int64s |
12:59:55 | alehander92 | sorry yes |
12:59:56 | FromDiscord | <Technisha Circuit> Is it better to compile to C or ObjC? |
13:00:01 | alehander92 | i wondered if i can compile |
13:00:08 | alehander92 | hashsets to {} in javascripts |
13:00:49 | * | bung joined #nim |
13:01:37 | FromDiscord | <Rika> technisha: what kinda question is that? |
13:01:45 | FromDiscord | <Technisha Circuit> No idea |
13:01:51 | FromDiscord | <Rika> objc is the least worked on for nim afaik |
13:01:56 | FromDiscord | <Technisha Circuit> Oh okay |
13:03:32 | FromDiscord | <Zed> Zevv: general purpose usage,writing quick scripts to parse large files, all of those python tutorials but implemented in nim. Maybe a game tutorial, see a lot of them implemented in python↵Mostly things that get things done for the user to see and use |
13:04:07 | Zevv | Ah right |
13:04:12 | Zevv | Well, type away! :) |
13:04:35 | FromDiscord | <Zed> lmao, i have to get a good grasp on the language first 😛 |
13:05:12 | alehander92 | hmm |
13:05:38 | * | bung quit (Ping timeout: 256 seconds) |
13:05:42 | * | dddddd joined #nim |
13:50:23 | * | cgfuh joined #nim |
14:11:04 | * | dcmertens joined #nim |
14:11:45 | dcmertens | Hello all, I have an idea about centralizing and/or synopsizing information about scientific packages for nim |
14:11:51 | dcmertens | this is based in part on the discussion here: https://forum.nim-lang.org/t/5242 |
14:12:07 | dcmertens | Is there a github organization for scientific developments in nim? |
14:12:24 | Araq | dcmertens: welcome, please wait until mratsim replies |
14:12:31 | dcmertens | Araq, thanks |
14:14:08 | * | kenran quit (Quit: leaving) |
14:14:38 | dcmertens | on a separate note, how do I view a package's documentation? I tried "nim doc ggplotnim", but no luck |
14:14:49 | dcmertens | wait... |
14:14:53 | dcmertens | I may not have it installed |
14:15:00 | Araq | 'nim doc -r x' will work in 1.x |
14:17:10 | dcmertens | false alarm, I had installed it on another machine but not my laptop. Sorry about that |
14:24:22 | * | FromDiscord quit (Remote host closed the connection) |
14:24:38 | * | FromDiscord joined #nim |
14:31:40 | dcmertens | I can create a simple figure using ggplotnim, but "nim doc -r ggplotnim" gives the error "cannot open 'ggplotnim.nim'" |
14:31:47 | dcmertens | thoughts? |
14:32:17 | dcmertens | (I gotta run for now, but I'll check back later) |
14:32:19 | * | dcmertens quit (Quit: Leaving) |
14:35:11 | * | MortS joined #nim |
14:39:05 | MortS | Dumb question time. I declared a object with no body as a placeholder. And later forgot, and created a non-empty seq of them. |
14:39:33 | FromDiscord | <Yardanico> That's totally okay, you can have empty objects |
14:39:44 | MortS | And ended up getting memory corruption, with --gc:arc at least. |
14:40:07 | FromDiscord | <Rika> :thonk: |
14:40:09 | FromDiscord | <Yardanico> https://github.com/github/linguist/pull/4866 https://github.com/github/linguist/pull/4871 argh Dafny got it before us |
14:40:12 | disbot | ➥ Revert "Change Nim's colour to better match the logo" ; snippet at 12https://play.nim-lang.org/#ix=2nuH |
14:40:18 | MortS | Ahh, I was unsure if that was allowed. I got suspicious when my debugging pointed out the sizeof(Thing) was 0. |
14:40:19 | FromDiscord | <Yardanico> Will need to find a new colour |
14:41:11 | MortS | I should probably open a defect then if that's allowed. Thanks Yardanico. |
14:41:11 | FromDiscord | <Rika> or maybe not |
14:41:19 | FromDiscord | <Rika> honestly i like the color now |
14:41:29 | FromDiscord | <Rika> its closer to C's color than jS's right now\ |
14:44:55 | FromDiscord | <Yardanico> @MortS do you have a code sample? |
14:45:03 | FromDiscord | <Yardanico> I can test on devel |
14:55:32 | MortS | yes, here. I'm on devel as well. https://gist.github.com/MortimerSnerd/a30c6f163e11e3c523b9259bc21e50e5 |
14:56:26 | livcd | thank go! |
14:56:29 | livcd | god* |
14:56:31 | MortS | On my system malloc will assert if you compile with --gc:arc and -d:useMalloc |
14:57:07 | MortS | But some earlier permutations of this ran, and only showed bad reads with valgrind. |
14:58:46 | Araq | interesting bug |
15:00:03 | Araq | please report it on github |
15:02:22 | MortS | Ok, thanks all. |
15:07:39 | * | waleee-cl joined #nim |
15:14:06 | FromGitter | <mratsim> @dcmertens: https://github.com/scinim |
15:14:34 | * | ftsf quit (Ping timeout: 240 seconds) |
15:22:58 | disruptek | ~stream |
15:22:59 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
15:23:04 | disruptek | launch party, baby |
15:27:14 | * | Kaivo quit (Ping timeout: 246 seconds) |
15:29:50 | * | Kaivo joined #nim |
15:34:35 | * | opDispatch is now known as B4s1l3 |
15:34:36 | * | B4s1l3 is now known as opDispatch |
15:44:09 | * | letto quit (Quit: Konversation terminated!) |
15:45:36 | * | bung joined #nim |
15:46:01 | * | letto joined #nim |
15:50:14 | * | bung quit (Ping timeout: 260 seconds) |
15:53:18 | * | liblq-dev joined #nim |
15:58:04 | Zevv | Bah, it's all touch screen in these modern space pods these days. I like the 60s interiors much better. |
15:58:17 | disruptek | mee too. |
15:58:22 | disruptek | gimme tactile feedback. |
15:58:39 | Zevv | and if it crashes in your back yard, you got tons of nice stuff to recover. |
15:59:47 | alehander92 | i thouight |
15:59:58 | alehander92 | the guys just sit and wait there looking to the screen |
16:00:04 | alehander92 | for like 5 minutes |
16:00:06 | alehander92 | earlier |
16:00:11 | alehander92 | it seemed a bit boring |
16:00:42 | alehander92 | i thought it might be weird to wait for your launch being just livestreamed like that |
16:00:57 | alehander92 | it took me so much time to notice they dont move and the unnatural hand gesture |
16:01:26 | Zevv | these are patient people, there is no telling |
16:02:15 | alehander92 | no wonder i am not in the space program |
16:02:33 | alehander92 | i remember thinking for a few days in a previous life-analysing period |
16:02:46 | alehander92 | "maybe i can just join spacex" |
16:03:12 | alehander92 | before realizing i am not actually a bald eagle or any other kind of us born resident |
16:03:48 | alehander92 | i guess disruptek can join the space force |
16:03:59 | alehander92 | but they might not let him until he changes his nick |
16:07:57 | * | casaca quit (Quit: leaving) |
16:08:07 | * | MortS quit (Quit: leaving) |
16:14:45 | * | tane joined #nim |
16:15:20 | * | casaca joined #nim |
16:17:27 | * | MortS joined #nim |
16:22:59 | * | dcmertens joined #nim |
16:27:45 | dcmertens | Returning to one of my previous questions, I am looking for a place that synopsizes the currently available science-related packages. |
16:27:58 | dcmertens | I am happy to help build that place if it doesn't exist |
16:28:46 | dcmertens | For example, are there no bindings to the GNU Scientific Library on nimble.directory? I don't see anything |
16:29:07 | dcmertens | I can see a few options for plotting |
16:29:35 | dcmertens | what is out there for matrix handling (I know: arraymancer, but what does that give me and what's missing?) |
16:30:02 | dcmertens | Do we have anything for levenburg-marquardt? |
16:30:35 | dcmertens | I feel like this should be on a wiki, except that those quickly go stale |
16:30:53 | dcmertens | so instead we can just create a github project with a README that discusses all of these things and accepts pull requests |
16:31:25 | * | Trustable joined #nim |
16:31:41 | dcmertens | Or, I could bring the topic up periodically---every six months?---on the forum so that there is always a reasonably up-to-date discussion of these things that others can refer to |
16:35:20 | FromDiscord | <mratsim> "Are we scientists yet" |
16:35:32 | FromDiscord | <mratsim> https://github.com/nim-lang/needed-libraries/issues/77 |
16:35:33 | disbot | ➥ [Meta] Are we scientists yet? |
16:35:37 | dcmertens | oh yeah, I remember seeing that a while ago |
16:36:12 | * | bung joined #nim |
16:36:16 | dcmertens | ah ha, thanks! |
16:39:10 | FromDiscord | <Synth> Hello, is it possible to free memory manually like the `free()` function in C? |
16:39:28 | FromDiscord | <Synth> I tried importing segfaults and using `c_free()` but was told it's undeclaired |
16:39:58 | FromDiscord | <mratsim> import system/ansi_c |
16:40:13 | FromDiscord | <Synth> Oh, thank you! |
16:40:30 | dcmertens | mratsim, is the top of that issue regularly updated? |
16:40:43 | FromDiscord | <mratsim> I update it when i get a ping |
16:40:47 | FromDiscord | <Technisha Circuit> What's the downsides of doing this? |
16:40:51 | FromDiscord | <Technisha Circuit> > import system/ansi_c↵@mratsim |
16:41:05 | FromDiscord | <Technisha Circuit> Using `c_free` |
16:41:08 | FromDiscord | <mratsim> no downsides? just manual memory management like in C |
16:41:13 | FromDiscord | <Technisha Circuit> Oki |
16:41:18 | FromDiscord | <mratsim> it needs to be allocated with c_malloc |
16:41:25 | FromDiscord | <Technisha Circuit> Nice |
16:41:58 | FromDiscord | <mratsim> otherwise you can use Nim allocator manually with alloc/dealloc or create/dealloc or allocShared/deallocShared or createShared/freeShared |
16:42:10 | FromDiscord | <Synth> How can I parse a variable's pointer into `c_free()`? |
16:42:14 | FromDiscord | <mratsim> depending if you want thread-local or global alloc |
16:42:22 | dcmertens | mrastim, can you think of any reason that gsl is not on the science discussion? Are these functions available elsewhere? |
16:42:31 | FromDiscord | <mratsim> c_free(myVar.addr) if mutable |
16:42:39 | FromDiscord | <Synth> I see, thank you! |
16:42:45 | FromDiscord | <Synth> How about it it's not mutable? |
16:42:48 | FromDiscord | <mratsim> c_free(mylet.unsafeAddr) |
16:42:55 | FromDiscord | <Synth> I see, thank you! |
16:43:07 | FromDiscord | <mratsim> but if you fre something it should be mutable |
16:43:16 | FromDiscord | <mratsim> otherwise you are lying :p |
16:43:40 | FromDiscord | <mratsim> @dcmertens, no idea, no one uses it? |
16:44:45 | FromDiscord | <mratsim> if you want to do optimization there is nlopt |
16:44:55 | FromDiscord | <mratsim> https://github.com/Vindaar/nimnlopt |
16:45:24 | dcmertens | Ah, nice |
16:47:12 | alehander92 | Technisha i'd say its still very atypical |
16:47:53 | alehander92 | and sometimes people do it just because they copy some c pattern |
16:47:59 | alehander92 | but of course it has valid usages |
16:48:23 | FromDiscord | <Synth> sent a code paste, see http://ix.io/2nvv |
16:48:32 | FromDiscord | <Synth> I am not exactly sure why... |
16:48:39 | FromDiscord | <mratsim> did you allocate the original via c_malloc? |
16:48:51 | FromDiscord | <Synth> Ohh I see |
16:48:54 | FromDiscord | <Synth> No, I did not... |
16:49:09 | alehander92 | but again, are you sure |
16:49:16 | alehander92 | you need to manually malloc/free ? |
16:49:26 | alehander92 | what is your usecase |
16:49:28 | FromDiscord | <Synth> Yes |
16:50:00 | alehander92 | ok |
16:50:04 | FromDiscord | <Synth> I am generating a very huge sequence and my program always crashes due to not enough free memory |
16:50:25 | * | gxt__ quit (Remote host closed the connection) |
16:50:27 | alehander92 | you can also try to call manually `GC_collect` |
16:50:36 | dcmertens | Synth: memmap? |
16:50:38 | FromDiscord | <mratsim> but that shouldn't be a problem with Nim sequences? |
16:50:47 | alehander92 | how huge is it |
16:50:50 | FromDiscord | <mratsim> no memmap is even lower-level and it's very slow |
16:51:09 | FromDiscord | <mratsim> in any case I suggest you wrap your allocator in something like this: https://github.com/mratsim/weave/blob/master/weave/memory/allocs.nim#L47-L57 |
16:51:12 | dcmertens | mratsim, finishing slowly is better than crashing, perhaps |
16:51:17 | alehander92 | like, how does malloc/free helps at all? do you create the seq many times and the gc doesnt release the previous one |
16:51:32 | * | dcmertens wants to know this ^^ too |
16:52:24 | FromDiscord | <mratsim> memmap is very error prone to use, it's easy to get an incorrect program |
16:52:30 | FromDiscord | <mratsim> and it only allocated in power of 2 |
16:52:35 | FromDiscord | <mratsim> allocates* |
16:53:31 | dcmertens | sure, but until Synth tells us how much memory is needed, it's hard to know what the problem is, or which tool is best |
16:53:47 | dcmertens | But if Synth needs many gigabytes, then memmap might be the only game in town |
16:53:51 | FromDiscord | <mratsim> and create/createU/createShared/createSharedU allows you to do manual memory management with the Nim allocator |
16:54:16 | dcmertens | now, why malloc would be expected to handle this, I cannot say |
16:54:19 | FromDiscord | <mratsim> I would be surprised, I can allocates GB of sequences just fine in Arraymancer |
16:54:28 | FromDiscord | <mratsim> it's the deterministic free |
16:54:40 | dcmertens | well my laptop has 4GB |
16:54:45 | dcmertens | :-P |
16:54:56 | dcmertens | So *I* can't allocate 8GB no matter how good the allocator is! |
16:54:57 | dcmertens | :-) |
16:55:03 | FromDiscord | <mratsim> but that can be emulated with either --gc:destructors or wrapping seq in a custom types with destructors |
16:55:12 | FromDiscord | <mratsim> I have 128GB 😛 |
16:55:22 | FromDiscord | <Synth> When it's not crashing, the sequence holds 15018570 items |
16:55:25 | FromDiscord | <Rika> dcmertens: swap's always an option |
16:55:45 | FromDiscord | <mratsim> that's small though |
16:55:52 | FromDiscord | <Synth> Hmm... |
16:55:56 | * | gxt__ joined #nim |
16:56:10 | FromDiscord | <mratsim> how big are the items? int sized or more? |
16:56:32 | FromDiscord | <Synth> They're strings |
16:56:37 | FromDiscord | <mratsim> ah |
16:56:51 | FromDiscord | <mratsim> it's not memory it's fragmentation that is killing you |
16:56:59 | FromDiscord | <Synth> oh? |
16:57:31 | FromDiscord | <Synth> (edit) 'oh?' => 'h?' |
16:57:34 | FromDiscord | <Synth> (edit) 'h?' => 'Oh?' |
16:57:44 | dcmertens | Rika: I have only had bad experiences with swap. Probably I didn't tune the settings properly, though |
16:57:48 | FromDiscord | <mratsim> fragmentation is when you have memory you can allocate but for that you would need to move the unused memory (i;e. defragment) so that you have a big enough contiguous space |
16:58:06 | FromDiscord | <Synth> I see |
16:58:08 | alehander92 | wow is this a discord bot feature Yardanico? amazing |
16:58:25 | FromDiscord | <mratsim> the seq holding the strings is not the issue, but the actual strings may be |
16:58:26 | FromDiscord | <Rika> alehander: what is? |
16:58:36 | alehander92 | the `(edit) .. ` stuff |
16:58:36 | FromDiscord | <mratsim> some will take 3 bytes, some will take 100 bytes |
16:59:02 | FromDiscord | <mratsim> some are deallocated, and then you need say 20 bytes but you only have holes of 10 bytes |
16:59:15 | FromDiscord | <mratsim> so you have memory but not a enough contiguous space |
16:59:24 | FromDiscord | <mratsim> not enough* |
16:59:51 | alehander92 | do gc-s do defragmenation somehow |
17:00:21 | FromDiscord | <mratsim> copy all and delete the old and it will "defragment" |
17:00:34 | FromDiscord | <mratsim> but otherwise fragmentation is a very very hard problem |
17:00:57 | FromDiscord | <Synth> > copy all and delete the old and it will "defragment"↵@mratsim What do you mean by this? |
17:01:12 | FromDiscord | <mratsim> and the issue is that either you create your own strings with their own allocators, or you workaround by copying when the size reaches a certain limit |
17:01:47 | FromDiscord | <mratsim> let myNewCollection = oldCollection |
17:01:55 | FromDiscord | <Synth> Oh that's it? |
17:01:59 | alehander92 | hm it seems memory managers |
17:01:59 | FromDiscord | <mratsim> the copy will be done using contiguous memory |
17:02:09 | alehander92 | seem to group allocations with similar sizes |
17:02:15 | FromDiscord | <mratsim> and don't use oldCollection anymore, |
17:02:17 | alehander92 | so this shouldn't happen as often as it doe |
17:02:18 | dcmertens | Synth, what is the problem you are trying to solve that requires that you have a simple *list* of strings? |
17:02:25 | alehander92 | but with 15 mln probably this is not enough |
17:02:49 | FromDiscord | <mratsim> yeah, usually strings are in a table, not 15 M in a row |
17:03:03 | alehander92 | yeah, i'd guess some kind of `views` into a big string might be better |
17:03:10 | dcmertens | what is log2(15M)? |
17:03:10 | alehander92 | if its e.g. after splitLines |
17:03:24 | alehander92 | ~4k |
17:03:25 | disbot | no footnotes for `4k`. 🙁 |
17:04:11 | dcmertens | log(15_000_000)/log(2) = 24 |
17:04:24 | FromDiscord | <Synth> sent a code paste, see http://ix.io/2nvF |
17:04:28 | FromDiscord | <Synth> This is pretty much what I'm trying to do :p |
17:04:32 | * | dcmertens checks |
17:04:45 | * | sschwarzer joined #nim |
17:04:50 | FromDiscord | <Synth> (edit) 'http://ix.io/2nvF' => 'http://ix.io/2nvG' |
17:04:56 | FromDiscord | <Rika> dont toseq the attemptlist |
17:04:59 | FromDiscord | <Synth> (edit) 'http://ix.io/2nvG' => 'http://ix.io/2nvF' |
17:05:18 | FromDiscord | <Rika> so its `for attempt in product(charlist, repeat=current):` instead |
17:05:27 | FromDiscord | <Rika> i dont see why you need the seq |
17:05:43 | alehander92 | toSeq |
17:05:45 | FromDiscord | <Synth> I will need it as a variable though since I need to get the total amount of items in `product(charlist, repeat=current)` |
17:05:46 | alehander92 | is your problem |
17:05:50 | alehander92 | just iterate directly |
17:05:58 | alehander92 | eh just use a counter variable |
17:05:59 | FromDiscord | <Rika> you can calculate that without the seq |
17:06:03 | FromDiscord | <Synth> Oh? |
17:06:10 | sschwarzer | What's the preferred way to compare against `nil`? `isNil(obj)` or `obj == nil`? |
17:06:23 | alehander92 | and yeah you can just use combinatorics hopefully |
17:06:24 | sschwarzer | I've seen both. |
17:06:25 | FromDiscord | <Rika> there would be some sort of formula for `product` i assume |
17:06:32 | FromDiscord | <Rika> sschwarzer then its either |
17:06:50 | FromDiscord | <Rika> personally i use `obj.isNil` |
17:07:02 | FromDiscord | <Rika> but i try avoiding nil checks anyway |
17:07:20 | FromDiscord | <Synth> How can I get the total amount of items generatied from the product funtion without using `len(seq)`? |
17:07:33 | sschwarzer | Rika: `isNil` looks a bit cleaner to me because it could include additional actions/checks. |
17:07:33 | FromDiscord | <Rika> as alehander said, with combinatorics |
17:07:55 | FromDiscord | <Rika> sschwarzer: it probably doesnt, check the source if you wanna ensure it |
17:08:33 | FromDiscord | <Rika> @Synth https://en.wikipedia.org/wiki/Cartesian_product |
17:08:46 | alehander92 | Synth you really should try to use a bit of combinatorics to solve this |
17:08:52 | alehander92 | its an algo problem |
17:09:10 | FromDiscord | <Synth> Yes, but I will need the total amount during the enumeration? |
17:09:14 | FromDiscord | <Synth> (edit) 'enumeration?' => 'enumeration...' |
17:09:35 | FromDiscord | <Synth> > @Synth https://en.wikipedia.org/wiki/Cartesian_product↵I've read this so multiple times in the past haha |
17:09:43 | FromDiscord | <Synth> (edit) 'https://en.wikipedia.org/wiki/Cartesian_product↵I've' => '<https://en.wikipedia.org/wiki/Cartesian_product>↵I've' |
17:10:10 | FromDiscord | <mratsim> var count = 0:↵for foo in product(charlist, repeat=current):↵ ...↵ count.inc() |
17:10:11 | sschwarzer | Rika: My application for the nil check is that I want to handle a special case by using `nil` for an argument which goes into an attribute/member of a type. The other approach would be using `option`, but this seems overkill because the `nil` value is really an exception. |
17:10:11 | FromDiscord | <Rika> @Synth its just `length of set to the power of (repeats)` afaik. |
17:10:15 | FromDiscord | <Synth> (edit) removed 'so' |
17:10:21 | alehander92 | but you can do this in any moment |
17:10:43 | alehander92 | also, what does `repeat` do |
17:11:01 | FromDiscord | <Rika> so its `len == 62 ^ current` |
17:11:07 | FromDiscord | <Synth> sent a long message, see http://ix.io/2nvJ |
17:11:08 | sschwarzer | Rika: I'm also fine if it doesn't do anything beyond the actual `nil` comparison |
17:11:33 | alehander92 | it shouldn't |
17:11:40 | FromDiscord | <Rika> sschwarzer: if you're looking for python `NoneType`, use options. |
17:11:48 | FromDiscord | <Rika> @Synth see my message |
17:11:52 | FromDiscord | <mratsim> @Synth, binomial coef? https://github.com/mratsim/number-theory/blob/master/src/combinatorics.nim#L4-L7 |
17:11:54 | FromDiscord | <Synth> > so its `len == 62 ^ current`↵This? |
17:11:54 | FromDiscord | <Rika> i think thats what youre looking for |
17:11:57 | FromDiscord | <Rika> i think |
17:12:02 | FromDiscord | <Rika> i got no clue but i think it is |
17:12:07 | FromDiscord | <Synth> Why to the power of 62? |
17:12:16 | * | tane_ joined #nim |
17:12:29 | FromDiscord | <Rika> thats the length of your set |
17:12:53 | FromDiscord | <mratsim> I think if you have k iems to choose with repetition among n items, it's actually binomial coefficient that you need |
17:13:02 | FromDiscord | <Rika> (btw, the `product` function he is using is in `narimiran/itertools` |
17:13:16 | FromDiscord | <mratsim> https://en.wikipedia.org/wiki/Binomial_coefficient |
17:13:39 | sschwarzer | Rika: I'm going to keep it simple for now and use `nil`. I'll most likely offer the code, once it's done, for review in the forum. Then you can give advice within the given context. I'm still not very experienced with Nim and am trying some things out. |
17:13:45 | FromDiscord | <Rika> mratsim: its cartesian product of the set on itself with x repeats |
17:13:58 | sschwarzer | Rika: but thanks anyway :) |
17:14:02 | * | tane_ quit (Client Quit) |
17:14:24 | FromDiscord | <Rika> so product "abc", 2 is [aa, ab, ac, ba, bb,....] |
17:14:48 | FromDiscord | <Rika> sschwarzer that sounds like a good idea |
17:14:48 | FromDiscord | <mratsim> ah I see |
17:15:19 | FromDiscord | <Rika> so length should be `set.len ^ repeats` right? |
17:15:33 | FromDiscord | <Synth> > so its `len == 62 ^ current`↵This should work, I will test it. Thank you! |
17:15:50 | * | haxscramper joined #nim |
17:18:07 | haxscramper | I' |
17:18:51 | FromDiscord | <Rika> I'? |
17:18:57 | Yardanico | i' |
17:19:07 | haxscramper | Sorry, I'n not used to this IRC client. |
17:19:18 | Yardanico | it's okay :) |
17:19:18 | haxscramper | I'm writing full message now |
17:19:22 | FromDiscord | <Rika> okay |
17:19:26 | Yardanico | at least you didn't paste 15 lines of code in IRC XD |
17:20:45 | haxscramper | I'm trying to write parser combinator library mostly based on generics. I declared type `Parser[Val, Tok] = proc(buf: Buffer[Tok]): Val` where `Buffer` is a concept `Buffer[Tok] = concept buf`, `buf[0] is Tok`. When i try to instantiate function that returns parser I get `cannot instantiate |
17:21:06 | haxscramper | 'result:type'. Here is a full code https://play.nim-lang.org/#ix=2nvL |
17:21:42 | * | dcmertens quit (Quit: Leaving) |
17:22:46 | haxscramper | When I try to instantiate parser directly I get internal compiler error `internal error: getTypeDescAux(tyProxy)`. Am I missing something or this is just a bug? |
17:22:57 | Yardanico | well concepts themselves are an experimental feature |
17:23:32 | Yardanico | and your code seems a bit wrong I think |
17:23:52 | Yardanico | you return type "Parser[Val, Tok]" from the parseStr proc |
17:23:54 | alehander92 | why dont you just define it like |
17:23:58 | Yardanico | but don't you want that proc itself to have Parser[Val, Tok] type? |
17:24:52 | alehander92 | yep, if you fix that it works |
17:25:45 | haxscramper | I use these procs to return other procs and usem /generated procs/ for parsing. `parseStr` returns closure proc - I don't use it for parsing. |
17:26:13 | FromDiscord | <mratsim> not sure about the rest but your concept at least is wrong: https://play.nim-lang.org/#ix=2nvL |
17:26:56 | Yardanico | yeah it seems like with the way you're instantiating it you want to get "string" from "char" |
17:27:04 | Yardanico | since you only know Val and Tok and you pass Tok to Buffer |
17:27:53 | haxscramper | Well, yes, that's exactly my the intention: I parse buffer of characters and return some string from it. |
17:28:27 | sschwarzer | Rika: At the moment it looks like the best option isn't `option`, but a variant type. :-D |
17:28:39 | FromDiscord | <Rika> i see |
17:28:50 | FromDiscord | <Rika> options are variant types |
17:28:57 | haxscramper | Or it is wrong from implementation perspective? I'm not sure if `buf[0] is Tok` is exactly what I need to write in concept in this case. |
17:29:20 | sschwarzer | Rika: yes, that makes sense, too :) |
17:34:07 | alehander92 | oh you cant rerturn concepts |
17:34:13 | alehander92 | currently yet* |
17:34:19 | Yardanico | alehander92: or maybe never :P |
17:34:31 | alehander92 | so maybe that's leading to this problem |
17:35:50 | Yardanico | i'm more excited towards https://github.com/nim-lang/Nim/pull/14467 |
17:35:50 | disbot | ➥ more checking for --gc:arc, no need for valgrind |
17:36:05 | Yardanico | ref counting checks to detect memory leaks and stuff |
17:39:01 | haxscramper | Is there any way to treat `string` as `openarray[char]` then? |
17:44:23 | haxscramper | In the end I specified `Buf` as fully template parameter: `Parser[Val, Buf] ...` - not as pretty as using cocepts but works in the end. |
17:44:58 | alehander92 | yeah, string should match openarray[char] indeed |
17:45:11 | alehander92 | but maybe there is some kind of generic edge case issue here |
18:20:38 | leorize | concepts are kinda funky and you shouldn't use it in it's current state |
18:21:09 | xace | quick question: has anyone tried using nim with jupyter? considering jupyter supports c++, it should be possible to support nim too, right? |
18:44:53 | disruptek | it'd be great if ssl didn't crash nimph. |
18:50:54 | FromGitter | <sheerluck> xace https://github.com/apahl/nim_magic |
18:52:55 | FromGitter | <sheerluck> xace https://github.com/stisa/jupyternim |
18:53:51 | FromDiscord | <fer> sent a code paste, see http://ix.io/2nwk |
18:54:17 | * | oprypin_ is now known as oprypin |
18:54:19 | FromDiscord | <fer> (edit) 'http://ix.io/2nwk' => 'http://ix.io/2nwl' |
18:54:29 | FromDiscord | <Rika> sent a code paste, see http://ix.io/2nwm |
18:54:49 | FromDiscord | <Rika> look into the `options` module |
19:13:29 | * | xmon joined #nim |
19:14:10 | * | xmon is now known as aredirect |
19:15:43 | xace | thanks sheerluck |
19:15:56 | * | Vladar quit (Quit: Leaving) |
19:23:03 | * | idf joined #nim |
19:30:01 | * | wowi42 quit (Quit: Kowa Bunga!!!) |
19:30:46 | * | wowi42 joined #nim |
19:46:44 | * | lritter joined #nim |
19:49:23 | * | MortS quit (Ping timeout: 246 seconds) |
19:51:25 | * | martinium joined #nim |
19:51:29 | * | MortS joined #nim |
19:52:29 | martinium | when writing lots of items to a file it suddenly stops writing and stays stuck. No exception, no crash. Anyone ever come across this before? |
19:52:41 | martinium | using writeLine to write to a file in a loop |
19:53:25 | martinium | I was thinking maybe my drive needs time to catch up but doesn't seem to be the case |
19:54:21 | livcd | try in debug mode and gdb and let us know |
19:54:47 | bung | paste code please |
20:00:57 | FromDiscord | <mratsim> @martinium, it may be fast while it can stay in the OS/disk buffer, and then when it's time to flush, it's slow |
20:01:38 | martinium | man is flush File that slow??? |
20:01:58 | martinium | let me add an echo before it performs the flushfile to see if that is the culprit |
20:02:13 | FromDiscord | <mratsim> SSD are about 10k times slower than registers |
20:02:27 | FromDiscord | <mratsim> HDD are about a million times |
20:02:30 | martinium | I am writing this to a separate HDD |
20:02:47 | martinium | maybe it'll be faster if I run on my nvme main drive |
20:02:51 | FromDiscord | <mratsim> USB? |
20:02:58 | martinium | nah, internal sata |
20:03:10 | martinium | but I have a really fast nvme drive as my OS drive |
20:03:21 | FromDiscord | <mratsim> because transfering data via USB tends to slow down everything (I don't understand the subsystems involved though) |
20:03:36 | martinium | yeah I wouldn't be using usb |
20:08:16 | martinium | tested on faster drive and still pauses while still "writing" |
20:08:25 | martinium | before it gets to flushing file |
20:09:59 | martinium | so when I SIGTERM the file is always 166872 rows |
20:10:07 | martinium | always 13.9MB |
20:10:28 | martinium | would flushing the file on each iteration be better? |
20:10:37 | martinium | I do it only after all data is supposed to be written |
20:12:12 | bung | you sure you properly break the loop ? |
20:12:43 | martinium | I've never had to manually break out of a loop |
20:12:47 | martinium | you mean using the break keyword? |
20:13:05 | martinium | I figured once loop completes it would exit automatically no? |
20:13:43 | * | PMunch joined #nim |
20:13:51 | martinium | I assume I'll need to add a condition for it to break |
20:13:51 | bung | but that needs you can make sure your loop test works right |
20:14:39 | bung | you test condition may unexpectedly always true |
20:14:48 | martinium | yeah |
20:15:29 | PMunch | Zevv, did you get anywhere with your coroutines stuff? |
20:18:14 | martinium | bung break keyword is working |
20:18:50 | martinium | but now it flushes file on each iteration once loop breaks |
20:18:51 | martinium | lol |
20:19:10 | martinium | proc is called from another loop |
20:21:07 | bung | dont know another loop process, maybe you can using a buffer size when it exceed flush it |
20:21:25 | martinium | it seems to stop once when it gets to 13.9MB |
20:21:34 | martinium | even with it flushing on each iteration |
20:21:59 | martinium | break keyword caused written file to only be 412KB after sigterm |
20:22:25 | martinium | only like 4.2k lines written vs 166k lines |
20:22:33 | martinium | weird that it freezes like this |
20:23:58 | bung | check your code again, most like human mistake. |
20:29:03 | martinium | yeah |
20:29:50 | Yardanico | btw guys did you notice that github changed quite a few icons? :D |
20:30:28 | martinium | Yardanico, sup dude |
20:30:30 | alehander92 | ha i seee it now |
20:30:39 | Yardanico | martinium: hi |
20:30:48 | Yardanico | I noticed that they did it by the notification icon |
20:30:50 | Yardanico | since I click it quite often |
20:30:57 | bung | star icon changed |
20:33:15 | Zevv | PMunch: didnt work on it anymore. But funnily enough I started this week with an iterator variation that was about 90% similar to your implementation. Same macro, same stuff around it |
20:33:20 | Zevv | never knew you were working on it as well |
20:33:44 | PMunch | The coroutines repo I shared? |
20:34:17 | PMunch | I was basically just trying to implement the coroutines example from wikipedia |
20:35:00 | Zevv | well, it is where I started :) |
20:35:18 | Zevv | This is my latest stuff, not sure what state it is in and if it makes any sense at all |
20:35:19 | Zevv | https://github.com/zevv/nimcoro |
20:35:23 | Zevv | ucontext doesn't perform well |
20:35:46 | Zevv | Is it too silly to even *try* to implement them with threads? Will people laugh at me? |
20:36:00 | disruptek | i will. |
20:36:08 | Zevv | you can |
20:36:14 | Zevv | I know who's laughing, right |
20:37:08 | PMunch | To implement coroutines with threads? Sounds expensive.. |
20:38:06 | Zevv | what part? Spawning them or using them |
20:38:16 | Zevv | becasue I don't want a ton. I usually have a handful |
20:38:43 | * | tdc quit (Ping timeout: 272 seconds) |
20:40:02 | * | MortS quit (Ping timeout: 272 seconds) |
20:40:17 | * | NimBot joined #nim |
20:40:59 | FromDiscord | <Elegant Beef> Dont we already have asyncdispatch, what's the benefit of coroutines over that? |
20:41:17 | PMunch | They work a bit differently |
20:41:39 | PMunch | Zevv, well doing a context switch is pretty pricy isn't it? |
20:42:13 | Zevv | I don't dare answering these kind of questions anymore these days without measuring |
20:42:13 | FromDiscord | <exelotl> coroutines (in Lua) are more pleasant to use than async/await (in JS) |
20:42:33 | Zevv | exelotl: right, that is what I'm after. But I'm having a hard time explaining *why* I find that |
20:42:34 | * | idf quit (Ping timeout: 246 seconds) |
20:42:41 | FromDiscord | <Elegant Beef> In Unity i never touch coroutines the entire system is hideous 😄 |
20:42:52 | Zevv | In Lua I coro *so* much. |
20:43:02 | FromDiscord | <Elegant Beef> Having a `yield return` inside a function that doesnt need a return type |
20:43:31 | FromDiscord | <exelotl> this article does a good job of explaining why they rock: https://leafo.net/posts/itchio-and-coroutines.html |
20:43:48 | Zevv | I did some work on and off in Nim's async stack, from network side or from the async side. It's pretty solid but every time I feel it is all so complicated |
20:43:54 | PMunch | Ooh, that will be an interesting read tomorrow |
20:43:59 | FromDiscord | <Clyybber> Why can't Nim iterators replace lua coroutines? |
20:44:16 | Zevv | iterators are special. If you want to yield, you need to be in an iterator |
20:44:45 | Zevv | you can't just yield from anywhere. You can't pass a proc as a callback that will yield whenever something is ready, for example |
20:44:54 | Zevv | also with Lua coro's I find I never need promises or futures |
20:45:18 | Zevv | what you pass to resume(coro) is the return value for yield(), and what you pass to yield() is the return value for resume(coro) |
20:45:32 | Zevv | so it's nice to make filters, producers, consumers as well |
20:46:07 | Zevv | PMunch: Sure, a context switch is expensive, but my practical use is mostly async, so typically a proc is already waiting for I/O anyway |
20:46:38 | FromDiscord | <Clyybber> But aren't iterators equivalent? You can pass an iterator as a callback |
20:47:12 | FromDiscord | <Elegant Beef> I guess i'd have to see a coroutine implemented in nim to actually say if i like them or not, in unity it always felt ugly to use since you had to do `startCoroutine()` and `stopCoroutine()` |
20:47:12 | PMunch | @Clyybber, closure iterators* |
20:47:17 | PMunch | But yes, they are very similar |
20:47:19 | shashlick | does json work at compile time? |
20:47:33 | FromDiscord | <Clyybber> PMunch: Yeah, I meant closure iterators :P |
20:47:34 | PMunch | shashlick, should do I think |
20:47:41 | Zevv | clybber: sure, they are close cousins, but the semantics are just different |
20:48:40 | Araq | Zevv, I'm researching "continuation passing style" fwiw |
20:48:49 | Zevv | wut! |
20:48:50 | Zevv | \o/ |
20:49:07 | Zevv | when did that come up? |
20:49:09 | martinium | bung, I switched filter to a group with slightly less rows that need to be written and it completed np |
20:49:11 | martinium | so logic is sound |
20:49:34 | PMunch | Zevv, do you have an example of how you'd use coroutines with coro in Lua` |
20:49:36 | PMunch | ?* |
20:49:41 | Araq | Zevv, last two weeks ago. bought a book about it |
20:49:50 | martinium | anyone know if nim writes above a certain amount need a buffer? |
20:49:51 | Zevv | Araq: best reason! |
20:52:15 | bung | better show your code |
20:52:28 | Zevv | PMunch: for my it's typically for async. I have a very lightweight event loop which just calls a callback if a registered fd is readable or a timer expires. This can be used the normal callback way, or you register a function that does a "yield(recv())" |
20:52:29 | * | idf joined #nim |
20:52:37 | Zevv | and voila, you're async. No futures, etc |
20:53:10 | Araq | "async without futures" pretty much nails it |
20:53:12 | Araq | :-) |
20:53:32 | Zevv | right. |
20:53:36 | FromDiscord | <mratsim> the future is bright |
20:53:55 | alehander92 | sounds like a political slogan |
20:54:21 | Zevv | PMunch: my other argument is pretty vague, but with lua coro's I build large stuff and never have to think hard about what is happening, it just flows naturally |
20:54:23 | PMunch | Isn't async without futures just callback hell? |
20:54:28 | Zevv | not with coroutines |
20:54:42 | PMunch | I think I'm still not getting it :P |
20:54:42 | martinium | bung, https://gist.github.com/martinium/e11f0fd1299675e5c7a0d729f3d342dc |
20:54:49 | FromDiscord | <Elegant Beef> I'd like to see an implemention before i complain about coroutines 😄 |
20:54:57 | PMunch | Do you have a short code example of how you'd use them? |
20:55:29 | martinium | I ended up making this code only do one of my BUs at a time since full dump was overloading the server lol |
20:55:41 | FromDiscord | <mratsim> I would expect greenlet is the same philosophy: https://github.com/treeform/greenlet/blob/master/src/cgreenlet/examples/simple-cc.cc#L24 |
20:55:48 | Zevv | PMunch: I'll try to extend my toy coro implementation to actually work, so you can see |
20:56:17 | FromDiscord | <mratsim> or in C: https://github.com/treeform/greenlet/blob/master/src/cgreenlet/examples/simple.c#L31 |
21:09:04 | bung | martinium seems pretty good, in the end you dont close the file? |
21:09:21 | martinium | I had that there also just forgot to readd |
21:09:28 | martinium | error still happens with it |
21:09:37 | * | PMunch quit (Quit: leaving) |
21:11:01 | * | idf quit (Ping timeout: 258 seconds) |
21:14:10 | bung | hmm set a timeout to client see if it works |
21:14:39 | martinium | all the web request complete successfully |
21:14:49 | martinium | it's the writing to file part that eventually just stops |
21:14:56 | martinium | and stays hanging |
21:15:05 | * | rockcavera quit (Remote host closed the connection) |
21:15:11 | martinium | still responsive but no further progress from there |
21:15:22 | martinium | a smaller amount completed successfully |
21:15:28 | martinium | but larger grouping always cries |
21:15:54 | martinium | does anyone have experience rate-limiting number of http requests? |
21:18:15 | bung | I dont see problem with file io |
21:18:57 | bung | martinium better set a timeout |
21:21:17 | bung | and other thing how much File descriptor limit number, usually when it exceed programs will exit with error |
21:24:28 | martinium | file descriptor limit? |
21:24:34 | martinium | I've never set one before |
21:28:27 | Zevv | PMunch still here? I have a tiny "standalony" async coro example |
21:30:15 | Yardanico | doesn't seem so |
21:30:19 | Yardanico | PMunch ([email protected]) has quit (Quit: leaving) |
21:31:34 | Zevv | ah right - I disabled join/leave messages long ago on #nim - too much noise |
21:31:37 | bung | yeah , open too much file for system, might not be the problem as it will exit you program |
21:34:06 | Yardanico | Zevv: well the other way to easily figure it out is tab completion |
21:34:13 | Yardanico | if your IRC client has that |
21:36:39 | * | liblq-dev quit (Quit: WeeChat 2.8) |
21:36:42 | * | tane quit (Quit: Leaving) |
21:38:08 | Zevv | Yardanico: right! |
21:38:52 | * | rockcavera joined #nim |
21:39:15 | martinium | bung, yeah def not that |
21:39:23 | martinium | only one file is open and being written to |
21:39:38 | martinium | seems to be an issue when it's greater than a certain amount |
21:40:14 | bung | your http connection also counts on |
21:40:46 | martinium | http connection at that point is already closed |
21:41:04 | martinium | http connection closes after each request |
21:49:53 | FromGitter | <bung87> OK I have no idea now |
21:57:16 | * | haxscramper quit (Remote host closed the connection) |
21:57:32 | martinium | :) |
21:57:52 | * | sschwarzer quit (Remote host closed the connection) |
21:59:19 | * | neceve quit (Ping timeout: 258 seconds) |
22:02:18 | * | sschwarzer joined #nim |
22:02:42 | Zevv | For those others then PMunch interested in the async/coro discussion, here is my tiny standalone proof of concept project: https://github.com/zevv/nimcoro/. The magic example is happening here: https://github.com/zevv/nimcoro/blob/master/t.nim#L33 |
22:03:08 | Zevv | now I will ZzzZz a bit |
22:04:03 | sschwarzer | Zevv: good night |
22:07:46 | martinium | bung, going to run it on my linux install and see if it still fails |
22:07:47 | martinium | lol |
22:07:55 | martinium | well not fails but "hangs" |
22:08:44 | * | martinium quit (Read error: Connection reset by peer) |
22:10:15 | * | abm quit (Quit: Leaving) |
22:12:24 | * | solitudesf quit (Ping timeout: 256 seconds) |
22:12:54 | * | Trustable quit (Remote host closed the connection) |
22:12:54 | * | martinium joined #nim |
22:16:22 | * | aredirect quit (Ping timeout: 256 seconds) |
22:16:46 | * | aredirect joined #nim |
22:20:47 | * | sschwarzer quit (Quit: leaving) |
22:34:12 | * | Senny joined #nim |
22:35:36 | * | aredirect quit (Quit: Leaving) |
22:47:33 | * | xet7 quit (Quit: Leaving) |
22:48:20 | * | xet7 joined #nim |
22:55:55 | * | lritter quit (Ping timeout: 246 seconds) |
23:05:13 | * | lritter joined #nim |
23:12:24 | * | krux02_ joined #nim |
23:16:03 | * | krux02 quit (Ping timeout: 260 seconds) |
23:17:26 | skrylar[m] | hoi |
23:18:49 | * | Jesin quit (Quit: Leaving) |
23:23:38 | FromDiscord | <exelotl> zevv this is extremely cool, I hope it goes places :) |
23:30:51 | * | Jesin joined #nim |
23:52:18 | bung | how server implement a cursor action ?store state somewhere for specific client next call? |
23:56:50 | * | ftsf joined #nim |