00:00:02 | * | ftsf joined #nim |
00:08:07 | FromDiscord | <Yardanico> @Avatarfighter the best one is probably getFileInfo |
00:08:22 | FromDiscord | <Yardanico> https://nim-lang.org/docs/os.html#getFileInfo,string |
00:13:41 | * | krux02_ quit (Remote host closed the connection) |
00:21:25 | * | ljoonal quit (Quit: ljoonal.xyz) |
00:22:12 | * | Guest21672 quit (Ping timeout: 256 seconds) |
00:25:06 | * | ljoonal joined #nim |
00:25:44 | * | adnan338 joined #nim |
00:26:29 | * | gangstacat quit (Quit: Ĝis!) |
00:28:08 | * | dadada__ joined #nim |
00:29:54 | * | gangstacat joined #nim |
00:31:05 | * | zacharycarter quit (Ping timeout: 272 seconds) |
00:40:29 | * | nekits quit (Quit: The Lounge - https://thelounge.chat) |
00:42:02 | * | nekits joined #nim |
00:51:31 | * | dadada__ quit (Ping timeout: 246 seconds) |
00:58:10 | * | dadada joined #nim |
00:58:34 | * | dadada is now known as Guest74631 |
01:05:12 | * | rockcavera quit (Remote host closed the connection) |
01:05:31 | * | rockcavera joined #nim |
01:13:18 | * | chemist69 quit (Ping timeout: 260 seconds) |
01:14:32 | * | Tlongir joined #nim |
01:15:21 | * | chemist69 joined #nim |
01:17:26 | disruptek | zedeus: it's broken for me today, i dunno. maybe i was stoned when i pushed it. |
01:18:11 | disruptek | zedeus: i know i can do what i want with a stream. i like the idea of bundling a channel api. not sure about anything else, but if the design is right, future abstraction is pretty much unlimited. |
01:19:23 | * | konvertex quit (Ping timeout: 256 seconds) |
01:21:54 | * | Guest74631 quit (Ping timeout: 240 seconds) |
01:24:56 | zedeus | it's not a must, but writing (or thawing) straight to the socket would be nice to avoid a copy |
01:26:23 | * | opal quit (Ping timeout: 240 seconds) |
01:26:27 | disruptek | just make a stream api for your thing, i guess. |
01:27:15 | zedeus | sockets have `write` and `read`, do you need anything else? |
01:27:44 | disruptek | i mean, if i cannot setPosition/getPosition then that changes things. |
01:27:54 | zedeus | ah. |
01:27:55 | disruptek | i don't exploit this now, but i was planning on it. |
01:28:11 | * | dadada__ joined #nim |
01:28:14 | disruptek | but it's `whatever`. we need to make this animal in any event. |
01:33:26 | * | dgb quit (Quit: WeeChat 2.2) |
01:33:37 | disruptek | and i need to solve recursion differently. |
01:34:05 | disruptek | well, not recursion, but stack overflow. |
01:43:45 | * | clemens3 joined #nim |
01:46:14 | * | dddddd quit (Ping timeout: 256 seconds) |
01:52:20 | * | dadada__ quit (Ping timeout: 258 seconds) |
01:53:06 | * | rockcavera quit (Remote host closed the connection) |
01:55:05 | * | opal joined #nim |
01:58:06 | * | dadada joined #nim |
01:58:12 | * | rockcavera joined #nim |
01:58:31 | * | dadada is now known as Guest72120 |
02:19:55 | * | sendell sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/wYkROJIraZreFWlUuHVuzSMK > |
02:20:14 | sendell | isnt this supposed to emit a performance warning ? |
02:20:38 | sendell | "passing a copy to a sink parameter" |
02:22:25 | * | Guest72120 quit (Ping timeout: 264 seconds) |
02:22:27 | * | muffindrake quit (Ping timeout: 246 seconds) |
02:24:47 | * | muffindrake joined #nim |
02:28:12 | * | dadada__ joined #nim |
02:39:59 | * | Senketsu quit (Ping timeout: 252 seconds) |
02:51:54 | * | dadada__ quit (Ping timeout: 240 seconds) |
02:56:09 | * | ljoonal quit (Quit: ljoonal.xyz) |
02:56:28 | * | ljoonal joined #nim |
02:58:11 | * | dadada joined #nim |
02:58:33 | * | dadada is now known as Guest60363 |
03:02:41 | FromDiscord | <Elegant Beef> Im currently attempting wrap `pty.h` and when i attempt to compile this it says "Undefined reference to `openpty`"↵https://play.nim-lang.org/#ix=2o91 |
03:02:59 | FromDiscord | <Elegant Beef> What am i missing? 😄 |
03:09:06 | * | rockcavera quit (Remote host closed the connection) |
03:19:46 | * | Tongir joined #nim |
03:22:00 | * | Guest60363 quit (Ping timeout: 256 seconds) |
03:22:42 | * | Tlongir quit (Ping timeout: 272 seconds) |
03:28:04 | * | dadada__ joined #nim |
03:28:38 | * | lritter joined #nim |
03:31:08 | * | B4s1l3 is now known as opDispatch |
03:36:23 | * | opal quit (Ping timeout: 240 seconds) |
03:39:34 | * | opal joined #nim |
03:42:27 | * | opal quit (Excess Flood) |
03:44:38 | * | opal joined #nim |
03:46:27 | * | zacharycarter joined #nim |
03:47:10 | * | Tongir quit (Ping timeout: 265 seconds) |
03:52:02 | * | dadada__ quit (Ping timeout: 260 seconds) |
03:55:02 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:58:08 | * | dadada joined #nim |
03:58:32 | * | dadada is now known as Guest58692 |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:39 | * | supakeen joined #nim |
04:08:32 | * | Tlongir joined #nim |
04:11:04 | * | zacharycarter quit (Ping timeout: 256 seconds) |
04:22:13 | * | Guest58692 quit (Ping timeout: 258 seconds) |
04:23:16 | * | Tongir joined #nim |
04:25:52 | * | Tlongir quit (Ping timeout: 256 seconds) |
04:28:07 | * | dadada__ joined #nim |
04:50:06 | * | narimiran joined #nim |
04:52:06 | * | dadada__ quit (Ping timeout: 256 seconds) |
04:58:09 | * | dadada joined #nim |
04:58:33 | * | dadada is now known as Guest19028 |
05:02:05 | * | opDispatch quit (Quit: Konversation terminated!) |
05:06:12 | disruptek | zedeus: added socket support... maybe. untested. see if it works or hack it until it does? |
05:06:16 | disruptek | !repo frosty |
05:06:17 | disbot | https://github.com/disruptek/frosty -- 9frosty: 11marshal native Nim objects via streams 15 6⭐ 0🍴 |
05:06:43 | zedeus | oh great, thank you. will test when I wake up |
05:07:00 | disruptek | cool. |
05:07:11 | FromDiscord | <Elegant Beef> Disruptek save me, before i go crazy! |
05:07:23 | disruptek | nope, i'm out. |
05:07:32 | zedeus | after a few hours of painful attempts at memory optimizations, I tried simply making it not display images, and the memory usage decreased to negligible levels |
05:07:34 | FromDiscord | <Elegant Beef> I mean the appropriate response was "Arent you already" |
05:07:45 | zedeus | now, to make a zero-copy request proxy.. |
05:07:59 | disruptek | memory copies aren't /that/ expensive. |
05:08:10 | disruptek | it's allocs that suck. |
05:08:34 | zedeus | sure, but it gets expensive when you're serving hundreds of images per second |
05:08:35 | disruptek | beef: what's your problem? |
05:09:06 | disruptek | zedeus: you make the job harder on yourself, so it's hard to feel compassionate. |
05:09:36 | FromDiscord | <Elegant Beef> I cant get pty.h functions to be included properly, seems im doing something slightly wrong |
05:09:55 | disruptek | which pty functions? |
05:09:57 | FromDiscord | <Elegant Beef> Since complains about undefined reference to the openpty function |
05:10:05 | FromDiscord | <Elegant Beef> openpty and forkpty |
05:10:13 | FromDiscord | <Elegant Beef> The only two in the pty.h file 😄 |
05:10:37 | disruptek | where is the code? |
05:11:02 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2o9b |
05:11:07 | disruptek | hmm. |
05:11:31 | FromDiscord | <Elegant Beef> I did look at the nim termios implementation to see how that's done |
05:12:17 | FromDiscord | <Elegant Beef> No clue why it compiles on the playground |
05:12:21 | leorize[m] | fun fact, that example compiles on the playground |
05:12:31 | disruptek | yeah, i was just about to say. |
05:12:45 | disruptek | what's your output? |
05:13:03 | FromDiscord | <Elegant Beef> https://hatebin.com/haoqepytnl |
05:13:24 | leorize[m] | well you shouldn't use them anyway |
05:13:50 | disruptek | link with -lutil |
05:13:53 | leorize[m] | switch to `posix_openpt` |
05:14:25 | leorize[m] | go posix-compatible |
05:20:08 | FromDiscord | <Elegant Beef> Well thanks disruptek, and uhh leorize that just seems like more aimless work for me:D |
05:21:08 | leorize[m] | well you want to create a badass terminal emulator |
05:21:17 | leorize[m] | it should be proper badass and work cross-platform |
05:21:34 | * | Guest19028 quit (Ping timeout: 240 seconds) |
05:21:57 | FromDiscord | <Elegant Beef> Im not disputing that, but i couldnt even get pty.h to work 😄 |
05:22:37 | disruptek | -lutil doesn't work? |
05:22:44 | FromDiscord | <Elegant Beef> No it did |
05:23:06 | disruptek | cool. |
05:23:29 | disruptek | well, i have a fuckton of porn to catch up on. |
05:23:35 | FromDiscord | <Elegant Beef> lol |
05:23:44 | FromDiscord | <Elegant Beef> They make so much daily, i dont know how you do it |
05:23:55 | disruptek | it's my cross to bear. |
05:23:57 | disruptek | bare. |
05:23:59 | disruptek | whatever. |
05:24:00 | leorize[m] | well posix_openpt is a syscall and it's implemented directly in libc, so you don't need `-lutil` |
05:24:03 | FromDiscord | <Elegant Beef> Both work in this case |
05:24:34 | FromDiscord | <Elegant Beef> Well ill look into it, but i have absolutely 0 idea where to |
05:25:05 | FromDiscord | <Elegant Beef> I know the man page exists |
05:26:41 | FromDiscord | <Elegant Beef> Do you know the posix equivlent of forkpty? |
05:26:49 | * | kenran joined #nim |
05:27:04 | silvernode | So I just found this language https://min-lang.org which is apparently written in Nim |
05:27:28 | silvernode | Looks like Lisp style syntax |
05:27:56 | leorize[m] | @Beef forkpty is a convenience wrapper on top of openpty |
05:28:12 | * | dadada__ joined #nim |
05:28:12 | leorize[m] | which is a convenience wrapper on top of `posix_openpt` :P |
05:28:52 | FromDiscord | <Elegant Beef> I mean my understanding was you open a pty then split that for you clients and give them a slave which does magic and works somehow |
05:28:56 | FromDiscord | <Elegant Beef> I really have 0 idea how pty works |
05:30:04 | leorize[m] | read posix_openpt man page, it covers how to create a slave device |
05:30:26 | FromDiscord | <Elegant Beef> I mean im starring at it |
05:36:16 | FromDiscord | <Elegant Beef> Do you know of documentation that gives more detail on how to use PTYs? |
05:36:34 | FromDiscord | <Elegant Beef> Like even if i wrap these i have less than 0 idea what to do with the file handles to get function with these |
05:37:15 | FromDiscord | <Elegant Beef> Nevermind a search got that |
05:43:29 | leorize[m] | lol |
05:43:54 | FromDiscord | <Elegant Beef> After reading that it's still a very blurry image |
05:44:00 | Prestige | Is there a way to return early from a proc at any point? E.g. https://play.nim-lang.org/#ix=2o9i |
05:44:24 | * | endragor quit (Remote host closed the connection) |
05:44:38 | leorize[m] | uhmm just use return? |
05:44:56 | leorize[m] | and maybe not using that `if false` to block your `return`? |
05:45:09 | Prestige | wow i am tired |
05:51:23 | leorize[m] | @Beef what are you trying to do? |
05:51:47 | FromDiscord | <Elegant Beef> Get CLI application support |
05:51:55 | * | dadada__ quit (Ping timeout: 258 seconds) |
05:52:24 | leorize[m] | you're basically trying to spawn an application attached to that terminal? |
05:52:30 | FromDiscord | <Elegant Beef> Yea |
05:52:51 | leorize[m] | so first do all that pts setup magic |
05:53:55 | leorize[m] | then `fork()` |
05:54:36 | leorize[m] | in the child process, close fds 0, 1, 2, or just close stdout, stdin, stderr |
05:56:12 | leorize[m] | then call `setsid()` |
05:57:35 | leorize[m] | now `open()` the slave terminal, then `dup2()` the resulting `fd` to 0, 1 and 2 |
05:57:40 | leorize[m] | setup completed |
05:58:03 | leorize[m] | now `execve()` to a new session leader |
05:58:10 | * | dadada joined #nim |
05:58:34 | * | dadada is now known as Guest24122 |
06:02:50 | FromDiscord | <Elegant Beef> I do have to ask, how the fuck did you learn this |
06:05:32 | FromDiscord | <Elegant Beef> Seems setsid already forks |
06:05:42 | Zevv | APUE |
06:06:12 | Zevv | http://www.apuebook.com/ |
06:06:50 | Zevv | ptys and session handling are everybody's nightmares |
06:07:05 | FromDiscord | <Elegant Beef> I mean it's vastly under documented online |
06:07:09 | FromDiscord | <Elegant Beef> Same with Xlib imo |
06:07:53 | FromDiscord | <Elegant Beef> It's been long enough i'd expect a well written explanation of the steps required to support CLI applications in a terminal emulator |
06:07:56 | Zevv | it's considered so common basic knowledge among unix beards that no one bothers writing about it I guess |
06:08:03 | FromDiscord | <Elegant Beef> Apparently so |
06:08:13 | FromDiscord | <Elegant Beef> If i get a working terminal im certainly going to |
06:08:30 | Zevv | just like the beginners frustration "How the H*LL doe I read a single key from a terminal?!" |
06:08:50 | FromDiscord | <Elegant Beef> non blockingly do it* |
06:08:54 | Zevv | well, says the beard, you just have to set your terminal to non-canonical mode |
06:09:15 | Zevv | with a dazzling sequence of tcsetattr arguments |
06:09:54 | FromDiscord | <Elegant Beef> The fuck does `*const` mean in C land? |
06:10:10 | Zevv | well, non-blockingly is something everyone runs into at one point in her career, and it's just complicated on all os's |
06:10:31 | FromDiscord | <Elegant Beef> Hey i tried to manually read the inputs from the keyboard |
06:10:31 | Zevv | https://cdecl.org/ |
06:10:39 | FromDiscord | <Elegant Beef> Which ended aswell as you'd expect |
06:11:45 | FromDiscord | <Elegant Beef> > declare args as array of const pointer to char↵Ah yes that doesnt hurt to read |
06:12:13 | FromDiscord | <Elegant Beef> So it's an array cstrings? |
06:12:39 | Zevv | what's your whole line? need more context for a sensible answer :) |
06:12:50 | FromDiscord | <Elegant Beef> `char *const args[]` |
06:13:17 | FromDiscord | <Elegant Beef> Or is it an array of pointers to the first element in the string |
06:13:46 | leorize[m] | @Beef how did I learn that? I read the man pages and guess :P |
06:14:06 | FromDiscord | <Elegant Beef> See i like guessing but not guessing aimlessly |
06:14:12 | FromDiscord | <Elegant Beef> some intuition behind the guesses is nice |
06:14:21 | Zevv | args[] is an array of pointers to char, which are typically used as strings in C |
06:14:54 | Zevv | well, if you guess often enough, you learn to steady your aim |
06:15:26 | FromDiscord | <Elegant Beef> You dont get better at something practising it wrong 😄 |
06:15:51 | * | endragor joined #nim |
06:17:07 | FromDiscord | <Elegant Beef> Well the first two functions work atleast↵https://play.nim-lang.org/#ix=2o9p |
06:17:11 | FromDiscord | <Elegant Beef> So im on some path |
06:18:50 | Zevv | you *do* get better, as long as you are effective at observing your results. |
06:19:33 | FromDiscord | <Elegant Beef> Some programmers write shitty code an never improve so, yea let's hope im in colum b 😛 |
06:20:03 | * | opal quit (Ping timeout: 240 seconds) |
06:20:24 | Zevv | I also know lousy programmers who write teriffic code, and terrific programmers who write lousy code. It's a difficult subject. |
06:22:00 | FromGitter | <waghanza> @dom96 I have update results https://github.com/the-benchmarker/web-frameworks/tree/cloudify#results |
06:22:02 | * | Guest24122 quit (Ping timeout: 256 seconds) |
06:22:25 | leorize[m] | @Beef: please import them as their real name :P |
06:22:45 | leorize[m] | pty is not the same as pts (i know, i know) |
06:23:59 | FromDiscord | <Elegant Beef> you dont mean 1:1 just without the y right? |
06:27:54 | leorize[m] | yea |
06:28:08 | FromDiscord | <Elegant Beef> pedant |
06:28:09 | * | dadada__ joined #nim |
06:28:45 | leorize[m] | @waghanza once Nim 1.2.2 is out can we see an another update? there are some hot optimization coming with that one :D |
06:29:50 | FromGitter | <waghanza> @loerize probably not ... but I hope so |
06:30:30 | FromGitter | <waghanza> tbh, the infrascture is fully sponsored (by digitalocean) and I have first to publicize results |
06:30:34 | Avatarfighter | wow I did not expect to see nim so high on the list |
06:30:55 | FromGitter | <waghanza> to thanks them about the awesome stuff I can do since I have a free cloud |
06:30:59 | FromDiscord | <Elegant Beef> I mean it's a mid level language 😄 |
06:31:22 | FromGitter | <waghanza> @Elegant beef what do you mean ? |
06:32:08 | FromDiscord | <Elegant Beef> Nim is a mid or low level language depending on you view, so if it lost to interpreted languages it'd be quite disconcerning |
06:32:14 | FromDiscord | <Elegant Beef> Unless i'm missing something |
06:33:49 | FromDiscord | <Elegant Beef> I didnt even notice C/CPP o nhere |
06:33:52 | FromDiscord | <Elegant Beef> on here* |
06:33:54 | FromDiscord | <Elegant Beef> Lol |
06:34:02 | FromGitter | <waghanza> I think I understand you, but I don't know, tbh, if it's lower or mid level, since I do not code in `nim` ⏎ but seems to be quite the same level as `crystal` |
06:35:36 | FromDiscord | <Elegant Beef> It's at the same level as C/C++/Rust AFAIK |
06:37:41 | * | PMunch joined #nim |
06:40:26 | * | fredrikhr joined #nim |
06:41:27 | FromDiscord | <Elegant Beef> And yea leorize you're now going to get bugged by me whenever i actually go to attempt using the pt |
06:47:00 | leorize[m] | lol |
06:51:49 | * | dadada__ quit (Ping timeout: 264 seconds) |
06:58:15 | * | dadada joined #nim |
06:58:38 | * | dadada is now known as Guest27436 |
07:14:19 | * | opal joined #nim |
07:14:53 | voltist | So I'm writing a proc to read PNG image data, and I'm getting this really weird problem. When I read a 4-byte unsigned int with streams.readUint32, it gives a number that is deffo wrong (in billions not 13), despite seeming to read the correct amount of data. Any ideas? |
07:15:26 | voltist | Reading from the right place of course |
07:15:27 | supakeen | Endianness? |
07:16:21 | voltist | supakeen: Can that be changed with the streams library? |
07:16:36 | supakeen | I don't know, but it might be the problem here, see if you get \x13\x00\x00 |
07:16:39 | supakeen | Or the reverse. |
07:17:40 | supakeen | Oh there is endians.swapEndian32 here: https://nim-lang.org/docs/endians.html#swapEndian32%2Cpointer%2Cpointer |
07:17:57 | bung | !repo buffer |
07:17:58 | disbot | https://github.com/oswjk/nimpb -- 9nimpb: 11Protocol Buffers for Nim 15 21⭐ 4🍴 7& 7 more... |
07:18:04 | bung | wrong |
07:19:14 | bung | try this https://github.com/bung87/buffer |
07:19:42 | * | adnan338 quit (Ping timeout: 258 seconds) |
07:19:48 | bung | also you can take https://github.com/bung87/icon as example |
07:20:05 | voltist | supakeen "see if you get \x13\x00\x00" How could I see a hex version? |
07:20:15 | voltist | bung: I'll have a look at that, thanks |
07:20:22 | bung | repr youvar |
07:20:48 | voltist | Oh I could just read a single byte and check if its 13 |
07:22:00 | * | Guest27436 quit (Ping timeout: 258 seconds) |
07:22:03 | supakeen | voltist: I can also ask you, did you get the number `318767104`? |
07:22:19 | voltist | Yeah I've solved it now |
07:22:29 | voltist | It is indeed endianness |
07:22:33 | supakeen | Nice ok :) |
07:22:33 | voltist | And yes that is the number |
07:22:40 | supakeen | Then my crystal ball worked well today! |
07:22:48 | voltist | Indeed |
07:23:11 | voltist | I considered calling this project crystal actually, but settled on ezra :) |
07:23:47 | PMunch | (by the way binaryparse was written with the recent knowledge of parsing PNGs, so it should be capable of doing them) |
07:25:18 | voltist | PMunch: What do you mean 'doing them'? Decoding, reading the chunks, endianness, etc? |
07:25:27 | PMunch | Yes |
07:25:37 | PMunch | Well not the endianness part IIRC |
07:25:53 | PMunch | But it should be the right endianness for PNGs I think |
07:26:07 | FromGitter | <sheerluck> Nim ball is crystal ball implemented in Nim |
07:26:19 | PMunch | Haha :P |
07:27:31 | Prestige | that's hilarious |
07:28:08 | * | dadada__ joined #nim |
07:28:27 | * | ljoonal quit (Quit: ljoonal.xyz) |
07:28:46 | * | ljoonal joined #nim |
07:28:53 | supakeen | Perhaps the readInt* in streams could take an endianness flag (or it could be set on the stream?) |
07:29:01 | * | supakeen thinks of a weekend thing to do |
07:29:32 | * | supakeen edits nimdeas.txt |
07:30:31 | voltist | PMunch: Could you provide an example of binaryparse's PNG powers? |
07:31:08 | * | konvertex joined #nim |
07:31:23 | PMunch | Not really, the most complex thing I did with it was for my old work.. |
07:31:25 | PMunch | https://github.com/PMunch/binaryparse/blob/master/binaryparse.nim#L687 |
07:31:36 | PMunch | That is the most complex example in the wild |
07:32:06 | voltist | Ok |
07:32:10 | voltist | I'll have a look at it |
07:32:40 | voltist | Oooo looks whats coming https://github.com/nim-lang/RFCs/issues/27 |
07:32:41 | disbot | ➥ [RFC] Option for endianness in streams |
07:33:37 | FromDiscord | <Elegant Beef> I think it's clear if you detect big endianness just crash and say "try again later, with different hardware" |
07:33:45 | PMunch | For PNG you'd need to use the call procedure syntax and write a procedure that can tell which block is next and trigger that parser. |
07:34:59 | * | Senketsu joined #nim |
07:37:17 | voltist | How is this swapEndian32 meant to work in https://nim-lang.org/docs/endians.html ? I feel like I'm missing something because of its strange argument order |
07:45:16 | voltist | Oh got it now |
07:46:51 | * | Vladar joined #nim |
07:47:53 | voltist | WTF PNG why is the image a different endianness to everything else |
07:48:15 | PMunch | Haha, because reasons |
07:48:31 | voltist | It wishes to hurt me |
07:50:20 | PMunch | Isn't the image data just in bytes? |
07:51:44 | * | dadada__ quit (Ping timeout: 256 seconds) |
07:52:35 | voltist | I meant image size |
07:54:02 | PMunch | Oh, that is indeed a bit odd |
07:54:29 | PMunch | Sure it's not just the magic at the beginning that is a certain endianness? |
07:55:59 | voltist | Oh actually it could be because the rest of the IHDR header is single bytes (so I wouldn't notice) |
07:56:22 | voltist | Or something like that |
07:56:24 | voltist | It works anyway |
07:58:20 | * | dadada__ joined #nim |
08:00:39 | * | ljoonal quit (Quit: ljoonal.xyz) |
08:01:41 | * | ljoonal joined #nim |
08:22:11 | * | dadada__ quit (Ping timeout: 265 seconds) |
08:28:08 | * | dadada joined #nim |
08:28:17 | * | ftsf quit (Ping timeout: 246 seconds) |
08:28:33 | * | dadada is now known as Guest14069 |
09:20:35 | voltist | Anyone here worked with zip/zlib much? |
09:22:21 | FromDiscord | <Firefell> sent a long message, see http://ix.io/2o9X |
09:22:51 | FromDiscord | <Firefell> (edit) 'http://ix.io/2o9X' => 'http://ix.io/2o9Z' |
09:23:54 | PMunch | voltist, not much, but I have tried it |
09:24:18 | voltist | PMunch: Did you have any trouble with Z_VERSION_ERROR? |
09:24:30 | voltist | I can't seem to track down why it is happening |
09:24:52 | PMunch | Yup |
09:25:39 | PMunch | Just a sec |
09:25:46 | voltist | All good |
09:26:48 | PMunch | Change this line to be a uint instead of a uint32: https://github.com/nim-lang/zip/blob/master/zip/zlib.nim#L14 |
09:26:51 | PMunch | That fixes it |
09:27:25 | voltist | Ah ok |
09:27:29 | voltist | I'll try it out |
09:27:49 | voltist | Have you submitted the fix as a pull request? |
09:28:33 | PMunch | Well... https://github.com/nim-lang/zip/issues/39 |
09:28:35 | disbot | ➥ ZlibStreamError due to size mismatch of data types (Linux) ; snippet at 12https://play.nim-lang.org/#ix=2iJQ |
09:29:44 | voltist | Huh OK |
09:30:04 | FromDiscord | <willyboar> PMunch: I just rode this https://peterme.net/scraps/web-frameworks-in-nim.html |
09:30:37 | voltist | Honestly I don't see why it can't be used as a temporary fix until the 'proper' solution is |
09:31:08 | PMunch | @willyboar, any input? |
09:31:19 | PMunch | voltist, well, ask Araq :P |
09:31:35 | PMunch | It's been a year and that library is still broken on Linux which is a shame.. |
09:31:43 | voltist | Might do |
09:32:04 | PMunch | I wouldn't even mind a when defined(linux) and defined(amd64): uint else: uint32 or something like that |
09:32:17 | PMunch | Just someone please make it work.. |
09:33:48 | voltist | Yeah an ever so slightly unsightly fix is better than a library that doesnt work IMO |
09:34:58 | PMunch | Agreed |
09:35:21 | FromDiscord | <willyboar> I like the doc part |
09:37:39 | PMunch | Yeah I've been toying some more with that idea |
09:37:57 | FromDiscord | <willyboar> in the explanations repo? |
09:39:09 | PMunch | Nah, just on paper so far |
09:40:22 | FromDiscord | <willyboar> ## comments really don't work w/ jester? |
09:41:02 | PMunch | Well, they don't break anything |
09:41:18 | PMunch | But they can't be used to create API documentation AFAIK |
09:42:07 | PMunch | The idea here was to be able to add them to the routes and then have something similar to "nim doc" that would generate API documentation like swagger. |
09:43:58 | FromDiscord | <willyboar> something like this? |
09:43:59 | FromDiscord | <willyboar> http://redocly.github.io/redoc/ |
09:45:03 | FromDiscord | <willyboar> This looks very cool |
09:48:31 | PMunch | Yes, although they are more typically rendered like this: http://petstore.swagger.io/ |
09:48:59 | * | chemist69 quit (Ping timeout: 252 seconds) |
09:49:49 | FromDiscord | <willyboar> great tool |
09:50:12 | * | chemist69 joined #nim |
09:50:31 | FromDiscord | <willyboar> Also I would like something similar to rails error pages |
09:51:17 | FromDiscord | <willyboar> This things makes the developers life easy but they are beautiful the same time |
09:51:19 | FromDiscord | <willyboar> 😛 |
09:51:39 | PMunch | Example? |
09:52:02 | FromDiscord | <willyboar> wait i think crystal have something similar |
09:52:31 | FromDiscord | <willyboar> https://github.com/crystal-loot/exception_page |
09:55:52 | PMunch | Huh, those are actually pretty neat! |
09:56:11 | FromDiscord | <willyboar> this is inspired by rails |
09:57:22 | FromDiscord | <willyboar> also the rails routes command |
09:59:33 | FromDiscord | <willyboar> https://blog.codemy.net/rails-routes-http-methods-and-sql-queries/ |
09:59:36 | * | Vladar quit (Quit: Leaving) |
10:01:36 | PMunch | I have PTSD from using Rails.. |
10:01:57 | * | dddddd joined #nim |
10:02:43 | FromDiscord | <willyboar> Rails is the best tool to create fast a slow app |
10:02:52 | PMunch | Haha :P |
10:02:59 | PMunch | I spent two days trying to change a route |
10:03:20 | FromDiscord | <willyboar> But it has some wonderful tools |
10:03:23 | PMunch | Changed every instance I could possibly think of, but some magic somewhere had it fucked.. |
10:04:01 | PMunch | That's one of the things I've written down, everything should just be "normal" Nim code. You should be able to manually do everything and override everything |
10:05:22 | FromDiscord | <willyboar> I agree. |
10:05:31 | * | Guest14069 quit (Ping timeout: 260 seconds) |
10:05:38 | FromDiscord | <willyboar> Also i would love a nice plugin system |
10:06:22 | PMunch | That is another thing I've written down :P |
10:07:01 | PMunch | Basically an easy way to add things like authentication and such |
10:09:25 | FromDiscord | <willyboar> someone create a PR to add to jester this functionality |
10:10:38 | PMunch | I think it'd be easier to rewrite the whole thing |
10:10:45 | PMunch | I mean you could add some of it |
10:10:57 | PMunch | But the type-safety would be a big breaking change |
10:12:03 | FromDiscord | <willyboar> it is crucial to decide the path of the framework from the beginning |
10:12:34 | FromDiscord | <willyboar> jesters path was to be simple |
10:13:13 | * | dadada joined #nim |
10:13:20 | FromDiscord | <willyboar> This PR adding plugins it is a huge change |
10:13:37 | * | dadada is now known as Guest21617 |
10:14:51 | * | gamut joined #nim |
10:16:19 | gamut | Hi can I get the const name as a string when I only have its value (37) ? const ERROR_CODE* = 37 |
10:23:00 | * | Senketsu quit (Ping timeout: 246 seconds) |
10:36:14 | * | Guest21617 quit (Ping timeout: 240 seconds) |
10:40:56 | * | gamut quit (Remote host closed the connection) |
10:43:07 | Zevv | you need an enum |
10:43:38 | * | dzamo[m] joined #nim |
10:44:36 | Zevv | https://play.nim-lang.org/#ix=2oab |
10:44:44 | Zevv | Idiom in Nim is not to use CAPITAL_CONSTS, though |
10:49:15 | * | naught-fowl quit (Remote host closed the connection) |
10:54:21 | * | Vladar joined #nim |
11:08:35 | silvernode | Man I wish I could read programming documents without loosing attention and forgetting everything in 5 minutes. |
11:08:50 | FromDiscord | <Rika> add? |
11:08:59 | FromDiscord | <Rika> or adhd i dont know the difference |
11:09:53 | silvernode | Yeah I have one of those. It seems to be more common now than ever before. Every new people I meet these days warns me they have A.D.H.D. |
11:10:14 | silvernode | every new person* |
11:11:43 | FromDiscord | <j$> it's really easy to not focus, compared to the past, no practice |
11:12:26 | FromDiscord | <Rika> there are times where i'm laser focused on programming for hours and times where i cant even write a single line in an hour so i dont know if i have it or not |
11:15:50 | FromDiscord | <willyboar> Ι τηινκ τηισ ηαππενσ το εωερυονε |
11:16:07 | FromDiscord | <willyboar> (edit) 'Ι τηινκ τηισ ηαππενσ το εωερυονε' => 'I think this happens to everyone' |
11:16:10 | FromDiscord | <willyboar> sorry |
11:17:22 | FromDiscord | <Rika> sorry for what |
11:17:39 | FromDiscord | <Rika> its not exactly a great thing to have adhd is it |
11:17:48 | FromDiscord | <willyboar> Gitter users will understand 😛 |
11:17:52 | FromDiscord | <Rika> oh |
11:17:54 | FromDiscord | <Rika> edits lmao |
11:18:06 | FromDiscord | <willyboar> exactly... |
11:20:46 | FromDiscord | <willyboar> PMunch this is great too : |
11:20:47 | FromDiscord | <willyboar> https://github.com/samueleaton/sentry |
11:22:29 | FromDiscord | <Rika> sounds like something thats kinda easy to recreate at a glance no? |
11:23:51 | FromDiscord | <willyboar> I don't have an idea |
11:24:15 | FromDiscord | <willyboar> I didn't try :p |
11:26:39 | FromDiscord | <KrispPurg> Does rlocks requires threads to be on? And is it better to handle 429s on a http request, using rlocks or locks? |
11:26:46 | FromDiscord | <KrispPurg> (edit) 'requires' => 'require' |
11:29:26 | * | NimBot joined #nim |
11:29:26 | * | FromDiscord joined #nim |
11:34:17 | PMunch | @Willyboar, that solves a similar goal to what I did in webexperiments |
11:34:26 | PMunch | Although that was more geared towards production |
11:34:33 | PMunch | And the entire program didn't have to be re-run |
11:39:47 | FromDiscord | <willyboar> I was talking mostly for development env |
11:40:45 | * | theelous3 joined #nim |
11:44:19 | silvernode | The other day things were just so clear when I was trying to design a program for the first time. Any other time I just stare at one line trying to think of what the next design concept should be |
11:44:47 | silvernode | Then 3 hours have passed and I am still in one spot, with 2 lines of code now instead of one. |
11:44:55 | PMunch | @willyboar, yeah for that a system like sentry is nice. Should be easy to throw together in Nim though |
11:45:39 | PMunch | silvernode, that's why I like to type up some stuff on paper first |
11:45:48 | PMunch | And explain them to myself as I take a walk |
11:46:06 | PMunch | That way I get a better picture of what I'm actually trying to do, and what my problems will be |
11:47:15 | silvernode | I think I need to try having all of us get together in one editor in real time, then press the record button, get on voice chat, and call it a Nimcast. The end result of every Nimcast episode is a program written on the fly |
11:47:54 | silvernode | Someone shouts out an idea and that's what we make |
11:48:50 | silvernode | Anyone from the IRC or Forum can join and the main goal is to laugh, have fun and make something cool. |
11:49:34 | silvernode | I learn better that way I think |
11:50:46 | silvernode | Someone can be appointed as the director so people can be given a feature to work on. |
11:51:17 | silvernode | All of that can be planned before each episode. |
11:51:22 | FromDiscord | <willyboar> silvernode: you can do something similar to disruptek |
11:51:35 | FromDiscord | <Rika> omg i want to join that shit |
11:51:37 | silvernode | Yeah he sits on twitch and writes code |
11:51:58 | FromDiscord | <willyboar> I mean the tools |
11:52:00 | FromDiscord | <willyboar> 😛 |
11:52:10 | * | krux02 joined #nim |
11:52:27 | FromDiscord | <Recruit_main707> silvernode: when you talk about all, how many people is that? |
11:52:58 | FromDiscord | <Rika> prolly 8 is around max |
11:53:10 | FromDiscord | <Rika> any more than 8 people editing code in real time is prolly @_@ |
11:53:19 | FromDiscord | <Rika> even 8 is prolly @_@ level |
11:54:06 | FromDiscord | <Recruit_main707> and what code would they/we write? |
11:54:08 | silvernode | idk, maybe 5 people per episode? A forum post will created prior to each episode and tell people they can reserve their slot. I think of it in terms of a RPG party in a game during a dungeon run. |
11:54:37 | FromDiscord | <Recruit_main707> that would be cool |
11:54:40 | silvernode | The forum post will also have a vote on the next topic for the program |
11:55:02 | FromDiscord | <Recruit_main707> i might try to extrapolate it to another servers (if you dont mind) |
11:55:05 | FromDiscord | <willyboar> you can do it with a separate nimcasts site |
11:55:10 | silvernode | if not a vote, then just a bunch of ideas that get mixed up and randomly selected |
11:55:30 | FromDiscord | <willyboar> and add votelink, twitch link, etc in forum |
11:56:06 | silvernode | The rules would be that topic submissions have to be very focused so that it can't be a crazy program and can be written in a couple of hours. |
11:56:32 | silvernode | yeah I would make a nimcast site |
11:56:35 | FromDiscord | <willyboar> Maximum 2-3 epidodes is better |
11:57:10 | FromDiscord | <willyboar> it is nice to wait for Fancy Library in Nim episode 2 😛 |
11:57:20 | FromDiscord | <Rika> ~~add custom editor support~~ |
11:57:27 | silvernode | yeah maybe an episode would need to be spit up into parts. Those can be bigger programs occasionally. Then we can tell people to turn in next week to see the conclusion. |
11:57:33 | FromDiscord | <willyboar> but more than 2-3 epidodes is too much |
11:57:48 | silvernode | tune* |
11:58:34 | silvernode | I think most programs would be small enough to fit in one show. |
11:58:46 | silvernode | or at least should be |
12:00:11 | * | rockcavera joined #nim |
12:00:50 | * | lritter quit (Quit: Leaving) |
12:00:55 | silvernode | I am thinking that all 5 slots will be laid out in the forums post. Each slot will be a role and responsibility , so like slot 1 is the party leader, slot 2 is designer, slot 3 is some other role role |
12:01:27 | silvernode | Each episode can follow that format |
12:01:50 | silvernode | Each episode will have different people filling those roles. |
12:03:29 | silvernode | You will get noobs to fill a role sometimes too which is a great chance to teach and learn in a fun way. Also a good way to learn teamwork skills and fast adaption skills |
12:04:30 | FromDiscord | <willyboar> well different people in each episode it is difficult |
12:04:44 | FromDiscord | <willyboar> at least in the beginning |
12:04:47 | silvernode | Maybe one slot can always be reserved for a programming noob who is new to the community |
12:05:11 | silvernode | that way you don't have the leader slot potentially be a noob. |
12:05:37 | silvernode | the leader slot should always be someone who is a seasoned developer. |
12:05:56 | silvernode | or at least experienced to some degree |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:41 | * | supakeen joined #nim |
12:06:51 | silvernode | Lots of potential here but I would like for all of us to contribute ideas to form a solid format that works like a machine. Somethiing streamlined. |
12:07:31 | silvernode | The number one goal is that it has to be really fun. |
12:07:46 | silvernode | for the participants and the viewers. |
12:08:07 | silvernode | Which ultimately means the project topic has to be fun |
12:08:25 | silvernode | Examle: write a joke generator. |
12:09:07 | FromDiscord | <Recruit_main707> can projects be somewhat "serious", more than a joke generator for instance? |
12:09:28 | FromDiscord | <Zed> for all the zeds in this channel i have found our editor! |
12:09:30 | FromDiscord | <Zed> https://github.com/zedapp/zed |
12:09:30 | silvernode | Sure, but they have to be fun in some way |
12:09:35 | FromDiscord | <Recruit_main707> complex rather than serious |
12:10:43 | FromGitter | <Vindaar> @voltist: sorry, wasn't around lately. Should be here again regularly now! |
12:10:57 | silvernode | Zed, how come the main website is a whois notice? |
12:10:58 | PMunch | @Zed, "Welcome to Zed, a code editor built using web technologies" welp that's a shame |
12:11:09 | FromDiscord | <Zed> lol yeah |
12:11:47 | FromDiscord | <Zed> but hey it's named after me so im using it |
12:11:48 | silvernode | The only web technologies editor I am remotely willing to use is VSCode |
12:12:37 | silvernode | I can admit that VSCode does a great job at fooling me that it's not web browser code. |
12:12:45 | FromDiscord | <Zed> silvernode: not sure about the website, i didn't even notice it |
12:12:47 | PMunch | Hmm, I should really give Kakoune another go |
12:13:12 | FromDiscord | <Recruit_main707> vscode supports multi client edition |
12:13:17 | livcd | How do you pronounce `Kakoune` ? |
12:13:36 | FromDiscord | <willyboar> I am using moe just to try it |
12:13:52 | PMunch | I pronounce it like cocoon, but with an a instead of the first o and a slightly harder k sound |
12:14:00 | FromDiscord | <willyboar> https://github.com/fox0430/moe |
12:14:07 | PMunch | No idea if that's how you're supposed to pronounce it though :P |
12:14:13 | silvernode | I quite like Micro, it's one of those editors where you try a hotkey that makes sense and it just works. |
12:14:26 | PMunch | moe? micro? |
12:14:36 | silvernode | it also has linting out of the box |
12:14:46 | silvernode | micro |
12:15:33 | FromDiscord | <willyboar> PMunch there are so many... |
12:15:38 | silvernode | I was writing a quick nim function for testing the other day with Micro and when I saved it, Micro underlined lines of code that had errors. |
12:15:56 | FromDiscord | <Zed> did they? |
12:15:57 | PMunch | willyboar, yeah.. |
12:16:15 | PMunch | I mean Vim³ is of course the best one |
12:16:43 | PMunch | (That's a small 3 for those who don't have a big enough font :P) |
12:17:02 | FromDiscord | <Zed> how many vims are there? |
12:17:19 | FromDiscord | <willyboar> original or with the clones? |
12:17:31 | PMunch | https://github.com/oakes/vim_cubed |
12:18:05 | FromDiscord | <Zed> i love it |
12:18:28 | FromDiscord | <willyboar> I have seen it. The #2 Nim library in github stars |
12:18:35 | PMunch | Haha :P |
12:18:39 | PMunch | #2? |
12:18:47 | PMunch | What's #1? |
12:19:02 | FromDiscord | <willyboar> Nim itself |
12:19:04 | FromDiscord | <willyboar> 😛 |
12:20:20 | PMunch | Ah, makes sense |
12:20:25 | PMunch | What's #3? |
12:21:19 | FromDiscord | <willyboar> nitter |
12:22:08 | PMunch | Oh really? |
12:22:10 | PMunch | Huh |
12:22:28 | PMunch | Oh right, that thing |
12:22:42 | PMunch | I thought it was like a Twitter clone in karax or something :P |
12:22:44 | FromDiscord | <willyboar> https://github.com/search?q=stars%3A%3E%3D500+language%3Anim |
12:33:00 | FromDiscord | <willyboar> PMunch i suggest to create a new repo or even a new org to discuss this framework ideas in the issues |
12:33:17 | PMunch | The web framework thing? |
12:33:25 | FromDiscord | <willyboar> yes |
12:33:39 | FromDiscord | <willyboar> because we will lose them in this chat 😛 |
12:33:57 | PMunch | I guess that might be a good idea, but it could easily devolve into design by comity.. |
12:34:39 | PMunch | I was thinking about discussing it first with alehander92 and potentially others that have shown a particular interest. Then maybe create an MVP before getting feedback |
12:35:18 | FromDiscord | <willyboar> There is not better place to discuss it |
12:36:35 | FromDiscord | <willyboar> this is a great way to get some feedback before the MVP |
12:37:21 | FromDiscord | <flywind> I think we need a better async ecosystem first. Even a robust async database package is rare.😀 |
12:39:22 | * | adnan338 joined #nim |
12:41:20 | FromDiscord | <willyboar> @waghanza it would be nice to the framework results to add in the end of the line (or somewhere else) an icon with what kind of tool is. Something similar to techempower. |
12:42:46 | * | lritter joined #nim |
12:43:15 | FromDiscord | <willyboar> @flywind i think nim could be a leading language in web dev |
12:48:39 | FromDiscord | <flywind> I agree. |
12:50:54 | * | adnan338 quit (Ping timeout: 258 seconds) |
12:53:18 | * | adnan338 joined #nim |
13:18:39 | silvernode | nitter is pretty cool |
13:18:48 | silvernode | never came across it until now |
13:19:40 | silvernode | Nim is so simple to compile and get an efficient web server going |
13:22:48 | * | waleee-cl joined #nim |
13:26:25 | PMunch | Hmm, kakoune still seems to lack a feature or two that I'd like.. |
13:27:33 | * | Vladar quit (Quit: Leaving) |
13:28:00 | * | lritter quit (Quit: Leaving) |
13:47:50 | alehander92 | hm |
13:50:11 | alehander92 | we can do that with willbyoar and PMunch |
13:51:02 | alehander92 | the web framework repo, but i think it might be best to just have a simple chat first, e.g. twitch/mumble or zoon |
13:51:04 | alehander92 | zoom* |
13:52:26 | PMunch | Sounds like a good idea |
13:52:35 | alehander92 | also, it's good to see what https://github.com/dom96/jester/issues/226 |
13:52:37 | alehander92 | is about |
13:52:38 | disbot | ➥ Adding support for "plugins" to Jester ; snippet at 12https://play.nim-lang.org/#ix=2obd |
13:53:37 | alehander92 | ok, when would be a good time for you guys |
13:56:22 | alehander92 | willyboar i know the guy who did the rails error button thing |
13:57:40 | alehander92 | actionable errors* |
13:57:53 | alehander92 | not sure if you were talking about them when you said error pages |
14:04:43 | FromDiscord | <Zachary Carter> Aren't "plugins" just middleware? |
14:04:53 | PMunch | Yes |
14:05:02 | FromDiscord | <Zachary Carter> most web application server frameworks have this concept |
14:05:07 | FromDiscord | <Zachary Carter> maybe we should call them that then |
14:05:53 | PMunch | That's what I was expecting to call them in docs and such :) |
14:06:02 | FromDiscord | <Zachary Carter> because I think people in the web dev world are more familiar with the term middleware |
14:06:03 | FromDiscord | <Zachary Carter> gotcha |
14:08:11 | * | zacharycarter joined #nim |
14:11:03 | PMunch | alehander92, hadn't seen that issue before. That is similar to what I was thinking of |
14:16:19 | * | Trustable joined #nim |
14:16:28 | disruptek | IT'S ALL ABOUT THE BENJAMINS |
14:16:28 | alehander92 | one thing i want is |
14:16:46 | alehander92 | to use stuff like nim-json-serialization or similar light-er json impl-s |
14:16:56 | alehander92 | without intermediate json nodes |
14:17:14 | alehander92 | for more effectiveness + type safety |
14:18:02 | FromDiscord | <Rika> why would intermediate json nodes be less type safe |
14:18:05 | FromDiscord | <Rika> or less effective |
14:18:07 | alehander92 | and to also to somehow reuse how much we can from type info for validations + api generation + model access |
14:18:37 | alehander92 | Rika because you access dynamic-like values which take more space and have all the same JsonNode type |
14:18:53 | alehander92 | and imho very often one has a clear schema mappable to a type |
14:19:05 | alehander92 | of course, when one doesn't, then JsonNode is very useful |
14:19:20 | disruptek | zedeus: i just realized i dunno if your socket handles endian for you. |
14:19:39 | alehander92 | but it's a very ruby/python way to do things, not very nim-ish to me when you can just deal with typed values |
14:20:02 | * | Vladar joined #nim |
14:20:04 | alehander92 | otherwise the JohnAD plugin stuff looks superb |
14:20:33 | FromDiscord | <Rika> hm makes sense |
14:21:27 | disruptek | alehander92: you are all over it, agree. |
14:21:45 | disruptek | just proper types. |
14:23:48 | disruptek | i might just write the type system, honestly. |
14:24:11 | disruptek | i have so much experience with this crap and i hate it so much. |
14:24:20 | disruptek | maybe that's how we figure out our expertise. |
14:24:28 | disruptek | mine is package management, because i hate it so much. |
14:24:33 | disruptek | and json, because i hate it so much. |
14:24:51 | alehander92 | what do you mean, write the type system |
14:25:14 | disruptek | a new json that is actually nimish. |
14:25:28 | disruptek | idiomatic. |
14:25:32 | alehander92 | but why , if you can just auto-typify it |
14:25:38 | alehander92 | btw! |
14:25:47 | disruptek | because the semantic is determined by json. |
14:25:48 | alehander92 | that's a great tool. take some json, infer schema/types |
14:25:52 | alehander92 | probably somebody did it |
14:25:53 | alehander92 | tho |
14:25:57 | disruptek | !repo openapi |
14:25:58 | disbot | https://github.com/disruptek/openapi -- 9openapi: 11OpenAPI Code Generator for Nim 15 27⭐ 3🍴 7& 4 more... |
14:26:02 | disruptek | yeah, me. |
14:26:08 | alehander92 | awesome :D |
14:26:20 | alehander92 | but you base it on some existing schemas? |
14:26:32 | disruptek | you give me the schema, i give you the nim api. |
14:26:52 | alehander92 | but what i am saying is, one can do it without preexisting schema |
14:26:56 | alehander92 | you give tool the json |
14:26:59 | alehander92 | it gives you a schema |
14:27:07 | disruptek | you give me the json, i give you the nim api. |
14:27:17 | disruptek | you give me the yaml, i give you the nim api. |
14:27:25 | alehander92 | something like that yeah |
14:27:27 | disruptek | you give me the aws gateway, i give you the nim api. |
14:27:35 | disruptek | this is already a thing. |
14:27:36 | alehander92 | i give you a cake? |
14:27:42 | disruptek | bentley eats cake. |
14:27:48 | disruptek | it's about his only trick. |
14:27:50 | alehander92 | isn't this no ok for dogs |
14:27:57 | disruptek | he can make a cheesecake disapear. |
14:28:05 | alehander92 | ah, no chocolate |
14:28:06 | alehander92 | smart |
14:28:33 | disruptek | he's a dog with spots. |
14:28:37 | disruptek | ~bentley |
14:28:38 | disbot | bentley: 11https://imgur.com/gallery/yEXiWWG -- disruptek |
14:28:38 | disbot | bentley: 11a good boy |
14:28:53 | disruptek | he's a very handsome dog. |
14:28:54 | alehander92 | good stuff |
14:29:08 | alehander92 | i was in the mountains with a dog yesterday |
14:29:14 | disruptek | yeah? |
14:29:18 | alehander92 | its relationship with his owner |
14:29:23 | disruptek | which mountains? |
14:29:27 | alehander92 | pushed me to a lot of happy places |
14:29:35 | alehander92 | the .. local mountains |
14:29:41 | alehander92 | not totally sure which one |
14:29:46 | alehander92 | i am very bad at this stuff |
14:29:53 | alehander92 | it had trees |
14:30:00 | disruptek | this dog is ridiculous with me. i never had a dog that was so loyal. |
14:30:13 | alehander92 | it feels good |
14:30:24 | disruptek | it sucks for him, because when i'm coding, he isn't playing outside. |
14:30:37 | disruptek | but he will never leave my side. |
14:30:47 | alehander92 | you just |
14:30:54 | alehander92 | throw exceptions |
14:30:58 | alehander92 | and yell "catch" |
14:31:08 | disruptek | jesus. |
14:31:19 | alehander92 | sorry |
14:31:34 | disruptek | there are states in the union where you can be shot for such an offense. |
14:31:45 | alehander92 | i am in the european union |
14:31:48 | disruptek | let us not speak of it. |
14:31:53 | alehander92 | we dont get offended so easily |
14:31:55 | FromDiscord | <Rika> ._. |
14:32:30 | alehander92 | cool dogs |
14:32:32 | FromDiscord | <Recruit_main707> disruptek, about openapi, we would need a flatbuffers parser |
14:32:36 | alehander92 | ok guys, bb |
14:32:42 | FromDiscord | <Recruit_main707> see ya |
14:32:59 | disruptek | what's your application? |
14:33:23 | * | naught-fowl joined #nim |
14:33:24 | FromDiscord | <Recruit_main707> wdym, what im gonna use it for? |
14:33:29 | disruptek | yeah. |
14:33:54 | FromDiscord | <Recruit_main707> to add support for a nim framework |
14:34:16 | disruptek | what does this have to do with openapi? |
14:34:41 | FromDiscord | <Recruit_main707> flatbuffers are also based on schema files |
14:34:50 | FromDiscord | <Rika> ?? |
14:35:17 | FromDiscord | <Recruit_main707> the api part is already done |
14:35:40 | disruptek | flatbuffers looks awesome. |
14:35:43 | disruptek | do you have an impl? |
14:35:55 | FromDiscord | <Recruit_main707> ideally, it would be done using cpp and the things they have, i have personally started porting the go generator, but its though |
14:36:00 | PMunch | Hahaha, that catch joke alehander92 :P |
14:36:00 | FromDiscord | <Recruit_main707> > do you have an impl?↵yes |
14:36:11 | disruptek | where is it? |
14:36:17 | disruptek | !repo flatbuffers |
14:36:18 | disbot | https://github.com/Skrylar/skflatbuffers -- 9skflatbuffers: 11FlatBuffers implementation in pure Nim. 15 3⭐ 0🍴 7& 1 more... |
14:36:27 | FromDiscord | <Recruit_main707> those are the other ones |
14:36:29 | FromDiscord | <Recruit_main707> https://github.com/Albus70007/NimFlatbuffers |
14:36:40 | FromDiscord | <Recruit_main707> i have to commit the latest changes |
14:38:40 | FromDiscord | <Recruit_main707> if i finish the codegen (in cpp) i could try to add them to the official repo |
14:38:47 | * | Vladar quit (Quit: Leaving) |
14:38:50 | disruptek | fuck cpp. |
14:38:55 | FromDiscord | <Recruit_main707> i know... |
14:39:15 | zacharycarter | why do you need to use C++? |
14:39:25 | zacharycarter | and why are there multiple flatbuffers repos now? |
14:39:37 | zacharycarter | what's the point in having two implementations? |
14:39:40 | FromDiscord | <Recruit_main707> those of google are stubborn |
14:39:55 | zacharycarter | but surely there are other implementations impelmented in other languages? |
14:40:29 | FromDiscord | <Recruit_main707> becuase i dont know how skylar's one works, and my idea was to be able to add them to their repo, so i based mine on the other existing implementations of the other languages |
14:40:47 | zacharycarter | hmm okay |
14:40:55 | zacharycarter | I still don't get the C++ part |
14:41:09 | FromDiscord | <Recruit_main707> its a requirement |
14:41:15 | disruptek | why aren't you using skrylar's impl? |
14:41:33 | FromDiscord | <Recruit_main707> > becuase i dont know how skylar's one works |
14:41:40 | disruptek | does it work? |
14:41:45 | FromDiscord | <Recruit_main707> idk |
14:42:07 | FromDiscord | <Recruit_main707> i also asked if it was being maintained and he didnt answer |
14:42:07 | zacharycarter | https://github.com/google/flatbuffers/tree/master/rust/flatbuffers/src |
14:42:12 | zacharycarter | I don't see any C++ there |
14:42:25 | disruptek | you don't think you have anything to learn from existing code but you think you'll learn something from a from-scratch impl? |
14:42:35 | FromDiscord | <Recruit_main707> the implementation its done in each language, the code generator in cpp |
14:42:36 | disruptek | after you impl it, won't it be existing code? |
14:43:05 | disruptek | what makes you think you know more about this than skrylar? |
14:43:13 | disruptek | he actually successfully implement it, right? |
14:43:24 | disruptek | do you think he learned anything? |
14:43:45 | zacharycarter | okay now i get the C++ part |
14:43:48 | FromDiscord | <Recruit_main707> i dont get what you are going at, im sure skrylar knew what he was doing, probably even better than me |
14:44:03 | zacharycarter | until the codegen part is done though - this is all pretty useless right? |
14:44:08 | * | BehrangDadsetan joined #nim |
14:44:24 | * | BehrangDadsetan is now known as BenIsCoding |
14:44:30 | FromDiscord | <Recruit_main707> ye, essentially, bigger projects need codegen |
14:44:48 | alehander92 | recruit_main707 i think he is trying to say that it's wiser to try to learn/reuse a lib first |
14:44:57 | alehander92 | before redoing it from scratch |
14:45:13 | FromGitter | <kaushalmodi> > i think he is trying to say that it's wiser to try to learn/reuse a lib first ⏎ ⏎ +1 |
14:45:17 | alehander92 | but we often do the second thing because it sounds more fun |
14:45:39 | FromDiscord | <Rika> i dont know, making a library from scratch doesnt sound so fun to me |
14:45:47 | disruptek | look, i'm guilty of it, too. |
14:45:53 | alehander92 | well, its' just NIH |
14:46:17 | FromDiscord | <Recruit_main707> flatbuffers are not that complex, and how they were implemented i doubt google would let us add them to their repo, and if i was writing a codegen, i wouldnt know how skylars implementation managed things |
14:46:20 | disruptek | frosty is probably better impl in skflatbuffers. |
14:46:50 | disruptek | who fucking cares about google. |
14:47:09 | FromDiscord | <Recruit_main707> well, 1st its free propaganda |
14:47:19 | disruptek | doesn't sound that cheap to me. |
14:47:29 | FromDiscord | <Rika> arent there better ways to do propaganda |
14:47:36 | disruptek | you have to replace a good library with another one which may not be as good and doesn't even fucking exist. |
14:47:43 | FromDiscord | <Recruit_main707> 2nd writing a parser and codegen from scratch is the unfun part of reimplementing flatbuffers |
14:47:59 | disruptek | tell a friend about nim. |
14:48:01 | FromDiscord | <Rika> why do we need a codegen |
14:48:02 | BenIsCoding | Hey everyone! Are Nimmers primarily Windows/Linux users? Does anyone else have a bad time with MacOS in an environment with brew/xcode mix? Any advice for me? |
14:48:08 | FromDiscord | <Rika> dont we have macros for that or something |
14:48:14 | FromDiscord | <Rika> there are some people who use macos here |
14:48:17 | FromDiscord | <Rika> a good amount actually |
14:48:20 | disruptek | BenIsCoding: it does seem to be mostly windows/linux. |
14:48:35 | alehander92 | it should be usable with osx tho |
14:48:35 | zacharycarter | I don't have any issues with osx and Nim |
14:48:38 | disruptek | you won't have a problem with osx. |
14:48:41 | alehander92 | if it has objc codegen |
14:48:43 | PMunch | Yeah brew puts Nim files in weird places which breakssome tools |
14:48:44 | BenIsCoding | So maybe doing my work mostly in a docker container might make sense? |
14:48:45 | FromDiscord | <Rika> dont use brew to install nim is all i know |
14:48:56 | FromDiscord | <Recruit_main707> Rika, i know macros would be very well fitted for that, but the parser part... |
14:48:58 | zacharycarter | why are you using xcode with Nim? |
14:49:03 | disruptek | just download it and build it. you'll be fine. |
14:49:05 | zacharycarter | or do you just mean the xcode developer tools? |
14:49:08 | FromDiscord | <Rika> what about the parser part @Recruit_main707 |
14:49:09 | PMunch | BenIsCoding, just install Nim through choosenim and you should be fine |
14:49:28 | zacharycarter | also remember that on osx gcc == clang due to aliaising |
14:49:29 | BenIsCoding | I tried to download it and just build it. 1.2.0 and 1.0.6 won't build outside clean docker containers. |
14:49:33 | disruptek | choosenim is pretty iffy on osx. |
14:49:44 | zacharycarter | they build fine for me |
14:49:45 | disruptek | what is the error? |
14:49:45 | BenIsCoding | choosenim 1.2.0 won't work for me |
14:49:45 | FromDiscord | <Rika> so is brew isnt it |
14:49:56 | zacharycarter | I don't use choosenim |
14:50:09 | disruptek | neither is ben. |
14:50:09 | FromDiscord | <Recruit_main707> Rika, well, you are criticising that i reimplement an already existing implementation of flatbuffers, but want me to create a .fbs parser and codegen by hand also? |
14:50:13 | BenIsCoding | Things like docker run -ti zuazo/irssi \ -c irc. freenode.net -p 6667 \ |
14:50:20 | BenIsCoding | oops :) |
14:50:37 | BenIsCoding | I get errors like use of undeclared identifier '__stdinp' |
14:50:38 | disruptek | no ssl? |
14:50:43 | disruptek | use ssl, dude. |
14:50:58 | BenIsCoding | wait.. is the ssl comment for me? |
14:51:02 | disruptek | yes. |
14:51:04 | BenIsCoding | is that in relation to irssi? |
14:51:06 | zacharycarter | do you have xcode developer tools installed? |
14:51:11 | disruptek | yes. |
14:51:17 | BenIsCoding | I had no clue that IRC entered the SSL world :) |
14:51:24 | disruptek | yes. |
14:51:25 | FromDiscord | <Rika> @Recruit_main707 i fail to understand what you mean |
14:51:28 | BenIsCoding | Yes, I have XCOde and everything installed |
14:51:36 | zacharycarter | not just xcode |
14:51:39 | zacharycarter | the developer tools |
14:51:45 | disruptek | command-line tools |
14:51:48 | zacharycarter | and what compiler are you using |
14:51:57 | zacharycarter | clang or gcc installed via brew? |
14:52:07 | disruptek | but it makes him install that when he runs clang from cli. |
14:52:10 | zacharycarter | it sounds to me like you're missing system header files |
14:52:16 | BenIsCoding | I followed Arak's advice and tried to manually patch lib/system/io.nim so that it does not use macros but apparently there is stuff in c_code that still is failing even after my manual patching |
14:52:29 | disruptek | why would you need to do any of this? |
14:52:36 | disruptek | run clang. |
14:52:38 | disruptek | what does it say? |
14:52:52 | zacharycarter | yeah you shouldn't have to do any of this |
14:52:58 | zacharycarter | Nim should just work on macOS |
14:52:58 | BenIsCoding | (base) Bent:nim-1.2.0 ben$ clang -v |
14:52:58 | BenIsCoding | Apple clang version 11.0.3 (clang-1103.0.32.62) |
14:52:58 | BenIsCoding | Target: x86_64-apple-darwin19.5.0 |
14:52:58 | BenIsCoding | Thread model: posix |
14:52:58 | BenIsCoding | InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin |
14:52:58 | disruptek | don't patch anything. |
14:53:18 | BenIsCoding | I was also surprised that a newbie is asked to manually patch core files :) |
14:53:21 | disruptek | and show me the output from a clear sh build_all.sh |
14:53:28 | disruptek | s/clear/clean/ |
14:53:28 | BenIsCoding | But I figured.. it's Arak who suggested it |
14:53:36 | disruptek | that's nuts. |
14:53:40 | alehander92 | but it wasn't araq man |
14:53:40 | zacharycarter | well he uses windows so he doesn't know |
14:53:42 | * | kenran quit (Quit: leaving) |
14:53:46 | alehander92 | just kidding |
14:53:47 | disruptek | i'm sure he was confused if so. |
14:53:49 | zacharycarter | he's probably just trying to get it working for you |
14:54:01 | disruptek | ~paste |
14:54:01 | disbot | paste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek |
14:54:16 | BenIsCoding | I was about to ask where to best paste :) |
14:54:39 | disruptek | if you use ix.io, the bot will move the url into playground. |
14:54:47 | disruptek | and broadcast it here: |
14:54:49 | disruptek | ~news |
14:54:49 | disbot | news: 11the #nim-news channel has a Nim news feed of updates to pull requests, issues, and packages. -- disruptek |
14:55:22 | FromDiscord | <Recruit_main707> @Rika, they said that why would i implement flatbuffers for nim if it was already done, i said it was because in order to create a codegen, it would be easier if it was based on the "official" implementations and if i actually knew how things where being done (unliky with skylar's impl) |
14:55:32 | BenIsCoding | Here is my gist https://gist.github.com/bdadsetan/7d9ef3677afa1968336e965e8619ec55 |
14:55:52 | FromDiscord | <Recruit_main707> and as we said, flatbuffers without a codegen, are not useful |
14:55:56 | disruptek | ~news is the #nim-news channel has a Nim news feed of updates to pull requests, issues, and packages. The bot also broadcasts ix.io -> playground URLs here automatically. |
14:55:57 | disbot | news: 11the #nim-news channel has a Nim news feed of updates to pull requests, issues, and packages. The bot also broadcasts ix.io -> playground URLs here automatically. |
14:55:57 | BenIsCoding | wow.. ix.io looks fun! |
14:56:15 | disruptek | there's a nim ix paster in here: |
14:56:20 | disruptek | !repo xs |
14:56:22 | disbot | https://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 2⭐ 0🍴 |
14:56:32 | zacharycarter | something is very screwed up with your environment |
14:56:45 | zacharycarter | but I'm not sure what you've done |
14:56:59 | zacharycarter | did you install clang or gcc or something with brew? |
14:57:08 | zacharycarter | and how are you clonining / building Nim? |
14:57:20 | alehander92 | recruit_main ok, it was more about the fact |
14:57:28 | alehander92 | you can try to ask skylar |
14:57:33 | BenIsCoding | I do want to learn nim, I love how expressive it is. I love the idea of having a much better front-end to clang than C++, I love the idea of meta-programming with nim style templates and macros. |
14:57:45 | BenIsCoding | But this is a tough start. |
14:57:47 | alehander92 | to see if one can reuse his impl, that's all |
14:57:50 | BenIsCoding | I downloaded the .xz file |
14:57:57 | zacharycarter | well this isn't Nim's fault... |
14:57:59 | BenIsCoding | did not clone from git |
14:57:59 | disruptek | can you build c programs? |
14:58:00 | FromDiscord | <Recruit_main707> and they also say i shouldnt be using cpp despite having half of the job done, and that i should use macros because they are (obviously) better fitter |
14:58:01 | alehander92 | if it can't be adapted easily, yeah |
14:58:10 | zacharycarter | you've done something to your environment |
14:58:21 | zacharycarter | plenty of people install Nim on macOS and don't have issues |
14:58:30 | BenIsCoding | I was using C and C++ to compile stuff for my mega2560 microcontroller and wanted to use Nim instead |
14:58:31 | zacharycarter | including myself |
14:58:51 | disruptek | which osx is this? |
14:58:52 | BenIsCoding | So compiling C/C++ generally works, although it partially uses avr compile tools |
14:58:59 | FromDiscord | <Recruit_main707> alehander92 i tried to ask him if it was being maintained before jumping into doing it myself :P |
14:59:03 | BenIsCoding | Catalina 10.5.5 |
14:59:11 | disruptek | is that current? |
14:59:20 | BenIsCoding | I believe it's the most current |
14:59:24 | disruptek | okay, cool. |
14:59:36 | disruptek | i just want to know if this might be the first of many such queries. |
14:59:52 | disruptek | but i wouldn't expect a patch release to break us. |
14:59:57 | FromDiscord | <Recruit_main707> and ive just remembered, skylars impl is not even complete (it doesnt have a builder) |
14:59:58 | disruptek | but on the other hand, it's clang 11. |
15:00:05 | disruptek | it's not like clang 6 or clang 8. |
15:00:20 | BenIsCoding | I believe I recently upgraded my XCode and the Build tools |
15:00:23 | alehander92 | well targetting a microcontroller |
15:00:29 | alehander92 | and using custom tools/targets |
15:00:35 | alehander92 | sounds very specific to me |
15:00:43 | disruptek | it's xcode clang, though. |
15:00:46 | alehander92 | as often one might use crosscompilers/different headers etc |
15:00:46 | disruptek | c'mon. |
15:00:56 | FromDiscord | <willyboar> alehander92 i meant exception pages |
15:01:11 | FromDiscord | <willyboar> error pages is 404,500 etc |
15:01:16 | BenIsCoding | I am not even close to using nim to compile for my microcontrollers yet. I am just trying to build nim without using brew on macosx |
15:01:20 | alehander92 | so one should make sure super-normal compilation just targetting osx works normally |
15:01:35 | BenIsCoding | ok, let me try that then |
15:01:39 | BenIsCoding | will do a hello world |
15:01:56 | * | aeverr joined #nim |
15:02:00 | zacharycarter | brew shouldn't even be in the picture |
15:02:12 | zacharycarter | I think your problem is you're compiler isn't finding the correct system headers |
15:02:15 | alehander92 | keep in mind `gcc.exe` and `linker.exe` if one has more than one versions |
15:02:21 | alehander92 | willbyoar ah ok |
15:02:29 | FromDiscord | <willyboar> PMunch i found another crystal reloader |
15:02:31 | alehander92 | recruit ok, i thought you havent talked, sorry |
15:02:31 | FromDiscord | <willyboar> https://github.com/f/guardian |
15:02:33 | disruptek | i think it's 64 versus 32. |
15:02:52 | alehander92 | recruit if you've done your research, then it sounds ok, sorry |
15:02:52 | disruptek | you're pointing at 32-bit headers somewhere. |
15:03:36 | BenIsCoding | Ok, plain C works. At least my 4 liner hello world example does. |
15:03:55 | disruptek | what file type is the output? |
15:04:09 | zacharycarter | how are you compiling the plain C file? |
15:04:12 | zacharycarter | with what command? |
15:04:32 | BenIsCoding | $ file a.out > a.out: Mach-O 64-bit executable x86_64 |
15:04:48 | BenIsCoding | I used gcc and clang |
15:05:00 | zacharycarter | what do you mean gcc and clang? |
15:05:11 | zacharycarter | you were able to build it with both? |
15:05:17 | disruptek | tell me something more about what "arak" told you to do. |
15:05:19 | zacharycarter | keep in mind, on macOS gcc is aliased to clang |
15:05:31 | BenIsCoding | Yes. I built once with gcc and once with clang. Both times successfully. |
15:05:38 | zacharycarter | if you type in `gcc -v` you'll see |
15:05:39 | disruptek | we already know he typed clang. |
15:05:45 | zacharycarter | okay |
15:06:13 | disruptek | i wish i was on my osx right now. |
15:06:19 | BenIsCoding | > **<Araq>** patch io.nim and set stdioUsesMacros to false |
15:06:34 | zacharycarter | you definitely don't need to do any of that |
15:06:42 | disruptek | but what was he thinking? |
15:07:02 | zacharycarter | no clue |
15:07:06 | disruptek | !last Araq |
15:07:06 | disbot | Araq spoke in 12#nim 25 hours ago 12https://irclogs.nim-lang.org/02-06-2020.html#13:41:16 |
15:08:21 | PMunch | @willyboar, writing those shouldn't be hard.. |
15:08:24 | BenIsCoding | The conversation was https://irclogs.nim-lang.org/01-06-2020.html#15:23:22 |
15:08:44 | PMunch | !last Zevv |
15:08:44 | disruptek | cool |
15:08:44 | disbot | Zevv spoke in 12#nim 4 hours ago 12https://irclogs.nim-lang.org/03-06-2020.html#10:44:44 |
15:09:18 | disruptek | dude. |
15:09:24 | PMunch | Zevv, I was toying around with my idea of containing all of async in the returned Future: http://ix.io/2oby |
15:09:32 | disruptek | is it brew clang or not? |
15:10:13 | BenIsCoding | No, it's XCode clang. |
15:10:57 | BenIsCoding | All I am trying to do is to create a simple UI with nim that shows what comes through bluetooth from my microcontroller that I was hoping to program in nim. Nim is a good candidate for these tasks right? |
15:10:59 | disruptek | why would xcode clang load headers from /usr/local? |
15:11:12 | zacharycarter | they shouldn't |
15:11:16 | zacharycarter | did you install clang with brew? |
15:11:20 | BenIsCoding | It might not have. It was my assumption because of the error messages. |
15:11:21 | disruptek | yes, nim is good for that. |
15:11:27 | Zevv | disruptek: features and closures are no-no, says mr A. |
15:11:27 | disruptek | stick with it; we'll sort you out. |
15:11:45 | PMunch | Zevv, basically the Future you get back has a pointer to an iterator. You should set this pointer to a place where you want to get any new iterators. Then the caller is responsible for checking if it has updated after every call and clear it, and also run all the iterators passed on there to completion. |
15:12:18 | disruptek | Zevv: what is this cryptic shit? |
15:12:25 | Zevv | not you, I was talking to PMunch! |
15:12:28 | PMunch | disruptek, I believe that was directer at me :P |
15:12:29 | BenIsCoding | brew list and brew cask list do not show any clang |
15:12:35 | disruptek | lol |
15:12:47 | Zevv | PMunch: let me grok that |
15:12:57 | disruptek | you understand how confused i am, right? |
15:13:05 | Zevv | aren't we all |
15:13:10 | PMunch | I've gotta walk the dog, so I'll be AFK for a while |
15:13:11 | disruptek | so this is the link you gave us: |
15:13:14 | disruptek | "@Araq, currently when I run choosenim 1.2.0 it won't compile because it is looking for the __stderr symbol which is not defined in my /usr/local/include because it assumes I am using the XCode compiler and the XCode system includes |
15:13:35 | disruptek | "my /usr/local/include and clang are from brew and apparently behave differently than the XCode system includes such as stdio.h |
15:13:41 | Zevv | PMunch: that makes sense indeed. Problem is that I kind of gave up on iterators and am into this continuation passing thing up to my elbows |
15:13:49 | BenIsCoding | I might have jumped the shark there. I noticed they are different and it would fit my error. |
15:14:07 | PMunch | Zevv, what is the problem with iterators? |
15:14:09 | disruptek | Zevv: i wanna work on it. |
15:14:28 | Zevv | disruptek: please please do. I can't do it. I started six times, but I can't seem to get there |
15:14:44 | disruptek | so whatever is head is current? |
15:14:46 | Zevv | PMunch: well, it's all part of a bigger story. Did you follow any of this CPS stuff? |
15:14:47 | * | D_ quit (Ping timeout: 260 seconds) |
15:15:11 | PMunch | I did have a look at it, but not much more than that |
15:15:37 | Zevv | I was whining here about wanting to have Lua coroutines, and did this mockup coro thing with ucontext. Then you came with your coros and we all had fun. Then Ar4q reached out and told me he was looking into CPS - which disruptek also happened to mention a few weeks ago. |
15:16:05 | Zevv | I kind of knew about that but never understood it fully. So I got some papers from ar4q, and I feel that CPS might be _the_ way to go. |
15:16:20 | Zevv | Is sense that ar4q also thinks that, given he calls it "the big game changer" |
15:16:41 | Zevv | properly implemented it will allow for true coroutines, async, and can also be used to properly implement interators |
15:16:56 | FromDiscord | <mratsim> if we can fix iterator chaining and make closures more convenient I'm all for it |
15:16:58 | disruptek | it's a paradigm changer, though. |
15:17:20 | disruptek | it enables a style of concurrent programming that is unbelievably natural and ergonomic. |
15:17:27 | Zevv | anyay, I do now grok what it does, I did some baby steps to do a poc in macros, and it has the potential to be pretty great |
15:17:31 | Zevv | It also unifies async and threads |
15:17:34 | * | tane joined #nim |
15:17:50 | disruptek | and memory graph movement among threads. |
15:17:52 | Zevv | disruptek is rambling about styles of programming, but that's just not the point - we *hide* that style of programming |
15:17:54 | * | D_ joined #nim |
15:18:02 | disruptek | which means you get free arc in threaded compute. |
15:18:53 | Zevv | there's only the problem that someone will need to come up with a proper algorithm to do a transformation from the code you type in and chop it up into a number of separate functions which all do tail calls |
15:19:12 | PMunch | Hmm, I see |
15:19:13 | Zevv | the effect is that you get code that runs without a stack - and that's the gist of it. |
15:19:25 | Zevv | All "memory" is no longer in the stack, but in tiny objects living on the heap. |
15:19:35 | PMunch | What? It would still have a stack wouldn't it? |
15:19:39 | disruptek | nope. |
15:19:44 | Zevv | You can store this object in your fridge, take it out next week and continue where it left off |
15:19:48 | Zevv | no stack. |
15:19:54 | disruptek | just data in memory. |
15:19:59 | FromGitter | <waghanza> yeah, we have plenty of features to add ❤️ |
15:20:05 | PMunch | Ah right, but that's just because you're storing its stack frame on the heap |
15:20:06 | disruptek | as fast as you can move the data, you can move compute. |
15:20:16 | Zevv | and that was the insighed I gained from playing with this. You lose the stack, and so you are free to jump wherever you want, whenever you want |
15:20:21 | FromGitter | <waghanza> however, we are focusing on producing results now |
15:20:22 | Zevv | You can make any type of control flow *in coed* |
15:20:24 | Zevv | in code |
15:20:38 | PMunch | So to "thaw" it you just copy it back onto the stack and execute it |
15:20:44 | Zevv | so iterators, exceptions, coroutines, it can all be expressed in normal code. No magic from languages or compiles. |
15:20:48 | disruptek | you could say that. |
15:20:52 | FromGitter | <waghanza> but a nice `UI` with plenty of documentation |
15:21:03 | FromDiscord | <mratsim> you don't need ARC for multithreaded tasks |
15:21:09 | FromDiscord | <mratsim> there is a single owner |
15:21:11 | Zevv | PMunch: basically, what you get from a function is a "continuation" - that's nothing more than a proc pointer with some data to pass it. |
15:21:20 | Zevv | So you do `cont->fn(cont->data)` |
15:21:24 | PMunch | I guess that is similar to what I'm doing in my thing |
15:21:30 | PMunch | But it's the revere |
15:21:30 | Zevv | This function has a contract to return a new continuation. |
15:21:39 | PMunch | reverse* |
15:21:40 | Zevv | So `while cont: cont = cont->fn(cont)` |
15:22:01 | PMunch | It returns a structure with a place to register continuations |
15:22:20 | Zevv | it takes continuation and returns a continuation. |
15:22:21 | FromDiscord | <mratsim> https://github.com/mratsim/weave/blob/master/weave/workers.nim#L41 |
15:22:26 | * | BenIsCoding quit (Quit: leaving) |
15:22:34 | FromGitter | <waghanza> for example, some php frameworks use nginx, and other use swoole, I think it deserve a documentation |
15:22:34 | Zevv | You can also have an event looop with a special function: it takes a continuation, and returns nothing. |
15:22:50 | Zevv | But secretly it stored your continuation somewhere, and calls it when a timer expires |
15:22:56 | Zevv | So there you have event handling -> async |
15:23:01 | FromDiscord | <mratsim> continuations are basically generalized closures: https://github.com/mratsim/weave/blob/master/weave/datatypes/sync_types.nim#L32 |
15:23:06 | Zevv | you can also have a pool of continuations, and call them in round robin order |
15:23:15 | Zevv | So you get fibers |
15:23:23 | * | BenIsCoding joined #nim |
15:23:31 | disruptek | all of computation is available. |
15:23:34 | Zevv | you can also make a proc that passes two continuations back and forth. Thats producer-consumer coroutines |
15:23:40 | disruptek | but first we have to make it work. |
15:23:46 | Zevv | right |
15:23:49 | * | fredrikhr quit (Read error: Connection reset by peer) |
15:23:58 | Zevv | that's just details :/ |
15:25:44 | Zevv | anyway, it would allow a lot of stuff that otherwise would need help from the language implementation. |
15:25:55 | PMunch | This does indeed seem very similar to what I'm doing. Just that I'm not calling a continuation, I'm registering it so that my caller can call it. |
15:26:34 | * | fredrikhr joined #nim |
15:27:21 | Zevv | I'm first cooking dinner and all, but I will take a proper look at your snippet. In the mean time if you are bored: https://github.com/zevv/nimcsp |
15:27:22 | PMunch | Hmm, well not quite.. |
15:27:52 | Zevv | The most important thing of it all is https://github.com/zevv/nimcsp/blob/master/eventqueue.nim#L30 |
15:29:53 | disruptek | are you sure you cannot represent goto? |
15:29:58 | disruptek | i thought we talked about this. |
15:30:19 | PMunch | Oh well, I really have to walk the dog and get some dinner now |
15:30:51 | Zevv | disruptek: well, I can represent it by a stub function |
15:31:02 | Zevv | that was try #3 and #4 |
15:31:13 | Zevv | and the target I tried to represent with a block: |
15:31:35 | Zevv | problem is that i also seem to need 2 nested macros |
15:31:40 | Zevv | one untyped, and one typed |
15:31:58 | Zevv | (I hate these names, but i need 1 before semcheck, and one post-semcheck) |
15:32:13 | Zevv | so the before semcheck gets code thats not valid nim - it needs to transform it to thaat |
15:32:24 | Zevv | it can do the basic splitting and all |
15:32:48 | disruptek | fuck dude, we'll just do it in the compiler. |
15:32:54 | Zevv | but then comes the lambda lifting. Cant do that afer semheck because it is not valid with free variables |
15:33:16 | Zevv | so need to do the splitting after that and abuse the scope of nested functions as intermediate step |
15:34:41 | Zevv | so my current path is: untyped macro does the splitting with temporary virtual gotos. The result is the function properly split into tail calls, but these are still nested so that all locals are valid through the nested scopes |
15:35:17 | Zevv | untyped macro does not have enough info to do lambda lifting though - everything is just and "ident" still - so it is passed out and eaten by a typed macro |
15:35:58 | Zevv | that will figure out that it is actually symbols and not idents, and that might be able to lift the lambdas. FOr each nested proc it will create a Cont derived object with members that correspond to the locals in that proc |
15:36:22 | Zevv | it will then take the local out and add it to the preamble like "var foo = cont.MyCont.foo" |
15:36:32 | Zevv | so the function body never has to know this happened |
15:36:46 | Zevv | if that is done it can take the proc out of it parent scope and make it top level. |
15:37:01 | Zevv | does any of that make sense? |
15:37:51 | disruptek | yes, just digesting the last part. |
15:38:01 | * | narimiran quit (Ping timeout: 264 seconds) |
15:38:37 | Zevv | oh PMunch I see now, thats pretty slick, why didnt I think of that |
15:46:39 | * | Trustable quit (Remote host closed the connection) |
15:53:19 | * | dadada joined #nim |
15:53:22 | dadada | hello |
15:53:49 | dadada | why is it legal to overwrite a parameter with let parameterName = something? |
15:53:57 | disruptek | seems to me this code works. |
15:54:08 | disruptek | what don't you like about it? |
15:55:24 | dadada | for one thing, the inconsistency that normally you can define a identifier only once, for example, let a = 1; let a = 1; would not be legal |
15:55:55 | disruptek | oh, i was talking to zevv. sorry. |
15:56:12 | disruptek | do you have a playground? |
15:57:22 | disruptek | it's legal for technical reasons. it turns out it's handy because of the `var a = a` idiom to give you a mutable version of an immutable parameter. |
15:57:35 | FromDiscord | <Generic> that's one reason |
15:57:45 | FromDiscord | <Generic> shadowing can be useful so you don't have to come up with akward names after casting |
15:57:59 | disruptek | but this is a bad idea. |
15:58:09 | FromDiscord | <Generic> why is it a bad idea? |
15:58:11 | disruptek | we talked about making it an error/warning. |
15:58:28 | FromDiscord | <Generic> that would break a ton of code |
15:58:28 | disruptek | because at two points in the same scope, the symbol had different types. |
15:58:36 | disruptek | of course. |
15:58:45 | disruptek | that doesn't mean that code isn't already broken. |
15:59:25 | disruptek | it's magic that is invisible to me as code reviewer. |
15:59:42 | disruptek | i may have no idea what types are arriving from different calls. |
15:59:52 | FromDiscord | <Generic> ah yeah, having in the same scope multiple variables with the same name is confusing |
16:00:03 | FromDiscord | <Generic> though I would allow it to override variables from a previous scope |
16:00:03 | disruptek | this is valid code? var s = 3.float; var s = 3.int; var s = "3" |
16:00:23 | disruptek | of course. |
16:00:37 | disruptek | but that's not the same for more important reasons. |
16:00:56 | FromDiscord | <Generic> that doesn't seem to be valid code |
16:01:21 | disruptek | this is valid code? var s = 3.mayProduceFloat; var s = 3.mayProduceInt; var s = "3".mayProduceStr |
16:01:35 | FromDiscord | <Generic> it seems to be incidently to be the behaviour I described |
16:01:46 | FromDiscord | <Generic> so you can only describe variables from a previous scope |
16:01:59 | disruptek | what? |
16:01:59 | FromDiscord | <Generic> *override |
16:02:10 | FromDiscord | <Generic> https://play.nim-lang.org/#ix=2obU |
16:02:14 | FromDiscord | <Generic> try removing the block statements |
16:04:11 | disruptek | we're talking about changing type of a symbol introduced in a proc parameter within the body of the proc, right? |
16:04:22 | disruptek | i'm saying it should not be allowed. |
16:04:27 | disruptek | you're saying it should, right? |
16:05:06 | FromDiscord | <Generic> ah, I thought we we're only talking about local variables shadowing other local variables |
16:05:25 | disruptek | i'm saying i can pass you x today and i have no idea what i'm getting back. the return time is not on my screen due to type inference. |
16:05:34 | disruptek | tomorrow you might change the type. |
16:05:49 | disruptek | is that okay? |
16:06:44 | disruptek | does the consumer choose how to use the data or does the producer? |
16:06:59 | disruptek | imagine that your code follows your types, not the other way around. |
16:07:13 | FromDiscord | <Generic> that's a general problem with type interference |
16:07:58 | FromDiscord | <Generic> that if I change the return type of a proc, it might not immediately produces an error everywhere where changes would be necessary |
16:08:04 | disruptek | maybe, but i don't think it's too much to ask that we have this small limitation in symbol lookup in order to prevent bugs. |
16:08:14 | disruptek | it could always be relaxed later. |
16:08:34 | disruptek | it costs you almost nothing to permit it and it saves bugs. |
16:08:49 | disruptek | what do you want to do? quibble over a character substitution? |
16:09:45 | disruptek | procs follow types. fite me. |
16:11:23 | FromDiscord | <Generic> I think there are legit uses for shadowing parameters |
16:11:34 | FromDiscord | <Generic> say you cast the parameter so some other type |
16:12:05 | FromDiscord | <Generic> if some rest of the proc still depends on the type of the parameter |
16:12:21 | * | Senketsu joined #nim |
16:12:32 | FromDiscord | <Generic> the difference between those two types will be great enough that it would generate an error |
16:14:17 | Zevv | disruptek: "seems to me this code works", referring to PMunch snippet? |
16:16:18 | * | BenIsCoding quit (Quit: leaving) |
16:17:16 | * | disruptek quit (Ping timeout: 272 seconds) |
16:17:36 | * | disbot quit (Ping timeout: 256 seconds) |
16:18:36 | * | Senketsu quit (Ping timeout: 246 seconds) |
16:23:16 | * | disruptek joined #nim |
16:23:44 | * | disrupte1 joined #nim |
16:23:47 | disrupte1 | ugh. |
16:24:07 | disrupte1 | prolly gonna lose electricity again, but... |
16:24:14 | * | disbot joined #nim |
16:24:40 | disrupte1 | my point was, we don't know when we might have to destroy the parameter symbol. it's not something you can predict. |
16:24:58 | disrupte1 | rather, we want the liberty to choose how to specify its behavior. |
16:28:20 | * | disrupte1 quit (Client Quit) |
16:48:17 | * | bebarker joined #nim |
16:51:08 | * | bbarker quit (Ping timeout: 246 seconds) |
17:00:30 | * | FromDiscord quit (Remote host closed the connection) |
17:00:44 | * | FromDiscord joined #nim |
17:07:19 | * | FromDiscord quit (Remote host closed the connection) |
17:07:32 | * | FromDiscord joined #nim |
17:13:48 | FromDiscord | <Shucks> Using the winim library. How could I convert a wchar array to a nim string? Pretty old same question here: https://forum.nim-lang.org/t/580 |
17:16:33 | disruptek | !last zevv |
17:16:34 | disbot | Zevv spoke in 12#nim 26 hours ago 12https://irclogs.nim-lang.org/02-06-2020.html#14:34:29 |
17:18:06 | disruptek | Zevv: no, your code works. do you just want to remove hacks? |
17:18:25 | FromDiscord | <willyboar> disruptek do you know C#? |
17:18:35 | disruptek | not really. |
17:18:47 | disruptek | i only hack it. |
17:19:11 | FromDiscord | <willyboar> a streamer has a problem with |
17:19:15 | FromDiscord | <willyboar> https://www.twitch.tv/lana_lux |
17:19:54 | disruptek | they probably know more about it than i do. |
17:20:09 | disruptek | i only hacked in ffi cache between python and c#. |
17:23:21 | FromDiscord | <willyboar> by the way i hope you return to streams soon |
17:23:47 | disruptek | i just can't afford it, honestly. |
17:24:14 | FromDiscord | <willyboar> I totally understand |
17:24:30 | Prestige | time cost? |
17:24:41 | disruptek | opportunity cost. |
17:24:47 | Prestige | makes sense |
17:27:52 | * | sagax quit (Ping timeout: 256 seconds) |
17:33:06 | Zevv | disruptek: it works, but indeed, the "hacks" need to go. And it works only for trivial cases |
17:33:32 | Zevv | but this code skips the "goto" part, and I can think things with an 'if' and a 'break' where it is just wrong |
17:33:50 | Zevv | so I think it is safer to first do as the paper says, including the intermediate (virtual) goto step |
17:34:10 | Zevv | when that's done in the untyped macro, the typed macro picks it up and figures out which locals to lift and put in the derived Cont |
17:34:18 | disruptek | okay. |
17:34:27 | Zevv | and when it is all kind of working, we throw it away and someone does it properly in the compiler |
17:34:34 | Zevv | because I'm 100% sure this will not fly with a macro only |
17:34:40 | disruptek | really? |
17:34:43 | Zevv | really! |
17:34:58 | Zevv | like, using a variable injecting template - no way to tell |
17:35:19 | Zevv | and how the hell do we split up a non-closure iterator 'for' loop? |
17:36:01 | Zevv | so this is strictly proof-of-concept only |
17:36:23 | Zevv | but it should be sufficient to write a few simple networking apps, some coro filters, an alternative iterator implementation and things like that |
17:36:27 | disruptek | it's a limited subset of what you want, maybe, but you start somewhere. |
17:37:25 | Zevv | right. And as a playground it's way friendlier then compiler hacking. The basic algo should be the same in NimNodes or PNodes, I guess |
17:37:39 | disruptek | why do you say you cannot tell with a template injection? |
17:37:51 | disruptek | isn't the input typed? |
17:38:11 | Zevv | i mean; if I have a piece of code that calls an unhygienic template, that template will inject locals into scope |
17:38:23 | Zevv | but I can't see that in a macro - I can only see a template invocation |
17:39:06 | Zevv | I'm not even sure lifting locals is universally possible in a macro |
17:39:19 | disruptek | why is the first pass untyped? |
17:39:31 | Zevv | btw, your "!last" is broken. |
17:39:39 | disruptek | well, i lost power there. |
17:39:40 | Zevv | It says 26 houres, but it was like, 01:02 |
17:39:44 | Zevv | ah right :) |
17:39:59 | disruptek | i doesn't write at every message. |
17:44:26 | * | disbot quit (Ping timeout: 246 seconds) |
17:44:34 | * | disruptek quit (Ping timeout: 260 seconds) |
17:48:05 | * | disruptek joined #nim |
17:48:10 | disruptek | damnit. |
17:48:33 | FromDiscord | <Zachary Carter> huh.... how is this possible? https://github.com/septag/rizz/blob/8d3d4e11fee51c2153c970485a2289218272b6a0/src/rizz/graphics.c#L2267 & https://github.com/septag/rizz/blob/8d3d4e11fee51c2153c970485a2289218272b6a0/3rdparty/sokol/sokol_gfx.h#L12582 |
17:48:52 | FromDiscord | <Zachary Carter> `_sg_lookup_pipeline` is static but it's accessed in another c file... |
17:49:03 | * | disbot joined #nim |
17:49:57 | disruptek | btrfs can fsck right the fsck off. |
17:58:18 | * | dcmertens joined #nim |
17:59:19 | Zevv | disruptek: I can think of more complications. What about `if a() and b(): ...`. If a() is false, b will not be evaluated - effectively control flow needing goto's |
18:00:31 | disruptek | but so what? |
18:00:44 | disruptek | first of all, we can put gotos in if we want. |
18:01:06 | Zevv | I guess so. |
18:01:27 | disruptek | why not? |
18:01:53 | Zevv | not sure. it still doesn't click for me somehow |
18:02:16 | Zevv | I can do it by hand, but I can't seem to write an algo to do it for me |
18:10:14 | * | Trustable joined #nim |
18:10:27 | disruptek | why doesn't Cont_tocker_2 inherit from Cont_tocker_1? |
18:10:56 | Zevv | hm I guess it could, and probably should, as they come from nested scopes |
18:10:59 | Zevv | good point |
18:11:29 | disruptek | we know who is in which scope by looking at the parent type. |
18:11:46 | Zevv | true |
18:12:17 | disruptek | so that lets us write the prelude, right? |
18:12:50 | Zevv | that's the idea - if we have a good way to make out the locals. |
18:13:54 | Zevv | also, this first try starts by transforming a proc. I have another start where I start from a block, this might be easier because it doesn't need a special case for handling the proc itself: https://github.com/zevv/nimcsp/blob/ico/xfrm2.nim#L108 |
18:14:04 | Zevv | 'spwanPre' is a bad name, but that's where the transormation starts. |
18:14:46 | Zevv | not sure if it is better or worse in usability, but it makes the xfrm proc a bit simpler as it does not have to care about nnkProcDef |
18:16:11 | disruptek | of course, if we change the type then we may not be able to fold identical continuations. |
18:16:20 | dcmertens | I am writing a function that takes to arrays that should be the same length. If they are not the same length, which kind of exception should I raise? |
18:16:32 | disruptek | value error |
18:16:33 | dcmertens | I saw a list here: https://github.com/nim-lang/Nim/issues/8363 |
18:16:35 | disbot | ➥ Rework Nim's exception handling ; snippet at 12https://play.nim-lang.org/#ix=27OQ |
18:16:50 | dcmertens | disruptek, cool, thanks |
18:19:04 | disruptek | Zevv: makes sense. |
18:21:19 | disruptek | Zevv: really, we only care about symbols that get used, right? |
18:22:14 | disruptek | we can just drop everything else off the stack. |
18:22:28 | * | natrys joined #nim |
18:23:31 | disruptek | some of it we can probably even lower. |
18:28:41 | Zevv | well, you *only* want to pick up what is used in that scope |
18:28:59 | Zevv | you don't want to move around stuff that's not needed |
18:30:58 | disruptek | right, so we drop stuff and lower stuff. |
18:31:18 | disruptek | basically, we cut the scope in half. some stays, some goes. |
18:31:42 | disruptek | always the parent goes. so now it's /some/ of what remains between the continuation and the start of scope. |
18:31:58 | disruptek | we could start by shipping everything. |
18:32:10 | disruptek | what's the worst that could happen? |
18:32:25 | disruptek | if you use what we give you, then it's in use. |
18:32:33 | Zevv | I think if we can do this in one recursive pass it will happen by magic. You descend the AST depth first, until you come to an inner block, goto-ify as needed and lift what you find. Being done the recursion goes up one level, but it will only find a nested proc there, which it can effectively discard as it is guarenteed not to use anything from its outer scope |
18:32:35 | disruptek | else, it's just a pointer that is needlessly copied. |
18:32:53 | Zevv | the question is still: why does the author take the 'goto' route - is there a reason this can not be done in one pass? |
18:33:14 | Zevv | I think we're kind of on the same track here |
18:33:15 | disruptek | i was thinking we'd start from the bottom, but now i'm not so sure. |
18:33:33 | Zevv | well, the bottom of the AST tree I guess |
18:34:34 | Zevv | it's not linear. It's blocks. I think it's only block: while: and for: that create a true block. |
18:35:13 | Zevv | I'm just not sure of the exact algorith. Every time I do it by hand it's kind of fiddling about, intuitin. I don't have a strict set of rules yet, and the papers are too vague about that step |
18:36:03 | disruptek | why is it guaranteed not to use anything from its outer scope? |
18:36:23 | Zevv | because all its locals are lifted at that time. |
18:36:49 | Zevv | well, not only locals, all free variables also |
18:37:02 | disruptek | oh, so you just start from a scope that you know holds only used variables. |
18:37:10 | disruptek | then you work backwards. |
18:37:25 | Zevv | depth first |
18:37:47 | Zevv | but then again - if the author has a good reason to do the goto's first, that probably means there's no straight resursive way |
18:38:18 | disruptek | i cannot see why, though. to me, it's way better. |
18:38:39 | disruptek | when i jump to the next cont, i can also free any portion of my env that i don't need. |
18:38:57 | disruptek | i get it for free, basically. |
18:39:01 | Zevv | sure, the only thing that counts it what the next cont wants |
18:39:05 | Zevv | the rest is discardable |
18:39:25 | Zevv | I have problems writing this code. "kont" means "ass" in dutch. |
18:39:46 | disruptek | perfect. |
18:39:59 | Zevv | I do like the inheritence tree of continuation types tho - makes perfect sense |
18:40:22 | disruptek | well, not any more. |
18:40:54 | disruptek | it might end up being more efficient, though. |
18:40:55 | Zevv | we also need a postamble by the way, to put locals back into the contination of the next call |
18:41:08 | Zevv | postlude |
18:41:13 | Zevv | what the hell do you call that |
18:41:26 | disruptek | you call it the ass, of course. |
18:41:35 | Zevv | haha, that might stick :) |
18:41:41 | Zevv | "epilogue" |
18:42:25 | Zevv | anway, these are the ContXXX constructors in the 'returns' |
18:42:41 | disruptek | i guess technically we could repack the env each call. |
18:42:51 | Zevv | it changes over calls. |
18:43:06 | disruptek | i know. maybe it makes more sense to let the c compiler optimize it. |
18:43:21 | Zevv | Oh right, I assume the packing/unpacking itself will get mostly optimized away as well |
18:43:37 | disruptek | we just pass a link to the parent. |
18:43:48 | disruptek | everything's a pointer. |
18:44:23 | Zevv | hmm not sure about that |
18:44:36 | Zevv | nothing is a pointer, it's only data |
18:44:46 | Zevv | please copy away and let the compiler do the smarts here |
18:44:53 | Zevv | waht if you want to send a closure to a different thread |
18:45:08 | disruptek | what if you have a large object in scope? |
18:45:16 | disruptek | there's no stack. |
18:45:22 | Zevv | copy it into the contiuation |
18:45:27 | Zevv | it's the only way |
18:45:36 | disruptek | only when you need to move the graph. |
18:45:40 | disruptek | else, why copy it? |
18:45:48 | Zevv | if 'next' needs it, you copy it |
18:46:02 | disruptek | why copy, though? |
18:46:05 | Zevv | threads |
18:46:30 | disruptek | but this only makes sense if you are actually moving. |
18:46:37 | disruptek | that can be done outside of this. |
18:46:40 | Zevv | hm ok, fair enough |
18:46:50 | Zevv | but still, what do you pointerize and what do you copy? |
18:46:59 | Zevv | I'd rather start with copy only |
18:47:22 | disruptek | look, i already know what's in scope. everything else, i delegate to the parent. |
18:47:36 | disruptek | i do my stuff, you do yours. |
18:47:54 | Zevv | doesn't feel good. |
18:48:07 | disruptek | you can always copy it if you want. |
18:48:47 | Zevv | don't go there. |
18:48:48 | disruptek | if you do, you're just copying a chunk of memory. not bad. you have the type so you know what everything is; it's a singly alloc. |
18:48:53 | Zevv | Stuff that needs to be reffed is already a ref, probably |
18:49:08 | Avatarfighter | What would be a good way of reducing the memory footprint of gigabytes of strings in a program? I'm thinking of implementing a radix tree to reduce my programs memory but I'd like to know what you guys do to optimize memory lol |
18:49:09 | Zevv | copying is virtually free in 2020 |
18:49:22 | disruptek | but not memory consumption. |
18:49:38 | disruptek | Avatarfighter: why keep them in memory? |
18:49:39 | * | natrys quit (Quit: natrys) |
18:49:40 | Zevv | disruptek: it's no differetn from a stack. There's always only 1 contination 'live' holding the data |
18:49:59 | disruptek | then there's no reason to copy anything. |
18:50:25 | Zevv | There is. You ref something and you store your continuation away. Someone else goes messing with your reffed data. |
18:50:28 | Zevv | that was not in the contract |
18:50:34 | Avatarfighter | disruptek: I'm currently keeping urls to be scraped when my workers are available in memory in a sort of queue atm but I ran into a problem with a certain site where gigabytes of urls are in memory forcing my kernal to reap my process |
18:50:47 | disruptek | Zevv: use the heavier version of cps, then. |
18:50:54 | disruptek | who gets to choose the semantic? |
18:51:11 | Zevv | So, does reffing make it more simple or more complicted to make a poc? |
18:51:22 | Zevv | because you don't want to ref a bool |
18:51:31 | Zevv | so you need 2 ways to do stuff - copying and reffin |
18:51:35 | Zevv | 2 ways is more work then 1 way |
18:51:53 | Zevv | Avatarfighter: same question again: why keep them in memory? |
18:52:27 | disruptek | 2 ways is twice as many ways. |
18:52:37 | Zevv | right |
18:52:37 | Avatarfighter | Zevv: I dont really know where else to put them tbh |
18:52:42 | Avatarfighter | I'm looking for ideas lol .-. |
18:52:59 | disruptek | so you copy your refs. where is your god, now? |
18:53:17 | disruptek | Avatarfighter: files are a good place to keep data. |
18:54:15 | Avatarfighter | they are, aren't they :P |
18:54:44 | Zevv | Right. And if you think files are for grandpa's only, you can whip yourself up some nice database |
18:54:57 | Zevv | or an apacha kafka instance might fit well, since you're queuing |
18:55:23 | disruptek | amazon sqs and just run 1000 scrapers at once. |
18:55:30 | * | fredrikhr quit (Ping timeout: 260 seconds) |
18:55:30 | Zevv | You can also encapsulate the url's in ICMP ping packets and send them on a round trip to new zealand. By the time they come back they have the same payloud and you can handle them again. |
18:55:40 | Avatarfighter | To be honest I was keeping stuff in memory because the sites I usually scraped weren't too big so I didn't get too much memory usage lol |
18:55:46 | Zevv | effectively you're storing your data in tubes only. |
18:56:09 | disruptek | you're storing it in other hosts. |
18:56:21 | disruptek | may as well use email; it generally has a 4-day retention. |
18:56:26 | Zevv | no, you're storing it in the cables |
18:56:40 | disruptek | it spends most of its time in hosts. |
18:56:52 | disruptek | the speed of light is pretty fast these days. |
18:56:53 | Avatarfighter | Store your data in ping requests and fold your router with gigabytes worth of pings |
18:57:01 | Avatarfighter | flood* |
18:57:13 | Zevv | I made this project once that did that - it was a fuse block device on top of raid, and the underlying blocks were managed by a little program juggling packets to far away hosts. |
18:57:23 | Zevv | I was able to store a few kb of that on that, but it was not on my machine. |
18:57:41 | Zevv | If you want to read a file you need to wait for the proper pings to come back. And every ping that comes back in is sent out again. |
18:57:53 | Avatarfighter | yeah that seems really interesting actually lol |
18:57:58 | disruptek | lose a packet, lose a file. |
18:58:13 | Avatarfighter | spend the file 3 times for that redundancy |
18:58:14 | Zevv | ^^ "bevice on top of raid" |
18:58:15 | Avatarfighter | send* |
18:58:36 | disruptek | i need something just a hair more reliable than this to replace btrfs. |
18:58:44 | Zevv | just a *hair* right |
18:58:53 | disruptek | yeah, i'm not aiming high here. |
18:58:56 | Avatarfighter | Dang I might have to start hoarding data via packets |
18:58:57 | disruptek | i'm aiming hair. |
19:00:04 | disruptek | gonna try bcachefs i thinks. |
19:10:28 | * | FromDiscord quit (Remote host closed the connection) |
19:10:45 | * | FromDiscord joined #nim |
19:20:58 | * | narimiran joined #nim |
19:23:17 | * | Senketsu joined #nim |
19:24:07 | FromDiscord | <willyboar> !last yardanico |
19:24:08 | disbot | Yardanico spoke in 12#nim 28 hours ago 12https://irclogs.nim-lang.org/02-06-2020.html#14:26:03 |
19:33:24 | * | terps joined #nim |
19:46:47 | * | dcmertens quit (Quit: Leaving) |
19:47:35 | * | FromDiscord quit (Remote host closed the connection) |
19:47:50 | * | FromDiscord joined #nim |
19:48:20 | Zevv | disruptek: still here? |
19:52:20 | * | NimBot joined #nim |
20:10:11 | Zevv | in case you're reading up: I need to do this more structurally. I'll try to write up collection of patterns and their transformation equivalents, and see how they compose. With luck this will work recursively directly transforming to procs. If not, it will be harder to traverse the AST since parts of the tree will move about. |
20:10:33 | Zevv | I can write a bunch of minimal transforms like this: http://ix.io/2odg and use those as unit tests as we go |
20:11:03 | disruptek | makes sense. |
20:11:19 | Zevv | and maybe we can even use this to drive the macro by using pattern substitutions instead of manual AST handling code |
20:11:24 | Zevv | but don't count on it :) |
20:12:26 | Zevv | also, I don't think there is a way to iterate non-closure iterators without 'for', so I'm not sure if for loops are transformable at this time. Probably not. |
20:12:51 | Zevv | these iterators are inlined, but we can't see that |
20:12:55 | disruptek | one thing at a time. |
20:13:13 | disruptek | but i'm not sure what pattern subs would buy us. |
20:14:31 | disruptek | seems like not having for loops is ideal. |
20:17:12 | * | terps quit (Ping timeout: 260 seconds) |
20:17:35 | PMunch | Zevv, you liked my approach? |
20:19:32 | * | dgb joined #nim |
20:23:38 | * | silvernode quit (Ping timeout: 272 seconds) |
20:23:43 | Zevv | yeah, altough there is still the nested iterator, but i liked it! |
20:24:10 | disruptek | using procs probably makes the most sense so far. |
20:25:04 | Zevv | not using for loops or injecting templates, but both should be just fine |
20:25:17 | * | qwertfisch quit (Read error: Connection reset by peer) |
20:25:32 | Zevv | anyway, doing the napnap now |
20:25:35 | Zevv | later! |
20:25:38 | disruptek | peace |
20:25:42 | Zevv | peace |
20:26:52 | * | qwertfisch joined #nim |
20:27:26 | * | narimiran quit (Ping timeout: 272 seconds) |
20:44:58 | * | gangstacat quit (Quit: Ĝis!) |
20:47:42 | * | gangstacat joined #nim |
20:53:44 | * | terps joined #nim |
20:55:05 | disruptek | skrylar[m]: what's your skflatbuffers license? |
20:57:35 | * | qwertfisch quit (Remote host closed the connection) |
20:58:01 | * | qwertfisch joined #nim |
21:17:36 | FromDiscord | <KrispPurg> Quick question: Can you jump a nimble pkg version to a much bigger version number like from v0.0.9 to v1.0.0? |
21:18:14 | FromDiscord | <Yardanico> Yeah sure why not |
21:18:27 | FromDiscord | <Yardanico> Just don't forget to tag a release |
21:18:44 | FromDiscord | <KrispPurg> what happens if you do? |
21:19:02 | FromDiscord | <Yardanico> If you don't have releases at all, it'll install latest commit |
21:19:12 | FromDiscord | <Yardanico> If you have some release tag, it'll install the tag |
21:19:34 | FromDiscord | <KrispPurg> ah |
21:19:45 | FromDiscord | <Yardanico> Nimble by default install latest commit if there are no tags, otherwise last release tag |
21:20:31 | FromDiscord | <KrispPurg> alright |
21:24:22 | * | PMunch quit (Quit: leaving) |
21:31:31 | * | tiorock joined #nim |
21:31:31 | * | tiorock quit (Changing host) |
21:31:31 | * | tiorock joined #nim |
21:31:31 | * | rockcavera is now known as Guest75063 |
21:31:31 | * | Guest75063 quit (Killed (barjavel.freenode.net (Nickname regained by services))) |
21:31:31 | * | tiorock is now known as rockcavera |
21:35:11 | * | tiorock joined #nim |
21:35:11 | * | tiorock quit (Changing host) |
21:35:11 | * | tiorock joined #nim |
21:35:11 | * | rockcavera is now known as Guest69753 |
21:35:11 | * | Guest69753 quit (Killed (orwell.freenode.net (Nickname regained by services))) |
21:35:11 | * | tiorock is now known as rockcavera |
21:43:51 | * | tane quit (Quit: Leaving) |
21:45:05 | FromDiscord | <Shucks> Is there something built in which could convert a byte array/seq to its numeric value? In my case the bytes represent an integer. |
21:45:54 | FromDiscord | <Rika> seq[byte] to seq[int]? |
21:47:55 | FromDiscord | <Shucks> seq[byte] to int |
21:48:06 | FromDiscord | <Shucks> with 4 stored bytes |
21:49:41 | * | exelotl quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
21:50:22 | FromDiscord | <Elegant Beef> This is a silly way but it works :D↵https://play.nim-lang.org/#ix=2odG |
21:53:06 | FromDiscord | <Shucks> indeed oO |
21:53:48 | FromDiscord | <Shucks> was hoping there is some more "api" like way. Since I want to convert byte arrays into different types aswell. |
21:53:53 | * | terps quit (Ping timeout: 252 seconds) |
21:54:30 | FromDiscord | <Rika> maybe converting that seq[byte] to a string then using a StringStream or something |
22:05:52 | * | rockcavera quit (Ping timeout: 246 seconds) |
22:06:09 | * | rockcavera joined #nim |
22:11:00 | FromDiscord | <Elegant Beef> More silliness from me |
22:11:00 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2odK |
22:11:06 | FromDiscord | <Elegant Beef> Making silly code is fun |
22:17:28 | leorize[m] | Can someone with the latest macOS run this command and give me the output? `openssl s_client -showcerts -servername incomplete-chain.badssl.com -verify 10 -connect incomplete-chain.badssl.com:443 ` |
22:20:32 | * | fredrikhr joined #nim |
22:28:22 | FromDiscord | <Shucks> > More silliness from me↵No clue how your magic works. But it does |
22:51:35 | * | brainproxy joined #nim |
22:52:21 | * | Trustable quit (Remote host closed the connection) |
22:59:03 | * | couven92 joined #nim |
23:01:56 | * | fredrikhr quit (Ping timeout: 258 seconds) |
23:05:22 | * | naught-fowl quit (Remote host closed the connection) |
23:09:47 | FromDiscord | <Elegant Beef> @Shucks it basically makes an int64 with the bit stream and then returns it, it will only work for less than 8 byte types |
23:10:12 | * | krux02_ joined #nim |
23:10:44 | FromDiscord | <Elegant Beef> it abuses the fact you can use bitwise on int64 and the cast |
23:10:50 | FromDiscord | <Elegant Beef> Cast converts the bit stream from A to B |
23:11:01 | FromDiscord | <Elegant Beef> Without any validational logic |
23:12:47 | * | krux02 quit (Ping timeout: 260 seconds) |
23:13:22 | * | tiorock joined #nim |
23:13:22 | * | rockcavera is now known as Guest60163 |
23:13:22 | * | Guest60163 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
23:13:23 | * | tiorock is now known as rockcavera |
23:14:04 | * | tiorock joined #nim |
23:14:04 | * | rockcavera is now known as Guest33821 |
23:14:04 | * | Guest33821 quit (Killed (card.freenode.net (Nickname regained by services))) |
23:14:04 | * | tiorock is now known as rockcavera |
23:16:23 | * | Senketsu quit (Ping timeout: 252 seconds) |
23:17:29 | * | beatmox quit (Read error: Connection reset by peer) |
23:19:14 | * | beatmox joined #nim |
23:49:09 | * | sagax joined #nim |
23:51:46 | * | beatmox quit (Quit: ZNC 1.8.0 - https://znc.in) |
23:51:59 | * | beatmox joined #nim |
23:53:26 | Prestige | Looks like we don't have bindings for xft, how would I got about creating it? |
23:56:01 | FromDiscord | <willyboar> What is xft? |
23:56:30 | Prestige | X FreeType lib: https://www.x.org/releases/X11R7.6/doc/man/man3/Xft.3.xhtml |
23:56:42 | Prestige | Wanting to use it to write a status bar for linux |
23:57:06 | FromDiscord | <Elegant Beef> You'd start making a wrapper 😛 |
23:57:32 | FromDiscord | <Elegant Beef> Look at the importc and header pragmas |