00:00:08 | Yardanico | https://i.imgur.com/wiAMMqK.png :P |
00:02:11 | codic | hm |
00:02:11 | FromGitter | <Knaque> Right, well, it's become clear to me that it's not the most straightforward thing to do. I only *really* care about Windows for what I'm working on, so I can skip on Linux support. I could also do it in something other than Nim, if that would be easier. |
00:02:26 | Yardanico | @Knaque well I just gave you a link to registry module |
00:02:28 | Yardanico | and it seems quite easy |
00:02:39 | Yardanico | just make sure your app is started with admin privileges and set the registry variable |
00:02:52 | codic | btw, what font is that? :P |
00:02:52 | codic | Knaque: just setUnicodeValue the reg key, you'll have to do this in all languages anyways |
00:02:59 | Yardanico | codic: IBM Plex |
00:03:01 | FromGitter | <Knaque> And that should be permanent? |
00:03:05 | Yardanico | yes |
00:03:07 | codic | ah ok |
00:03:08 | codic | yes |
00:03:21 | codic | for linux, just append to /etc/environment `KEY=VALUE` |
00:03:32 | Yardanico | " To programmatically add or modify system environment variables, add them to the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment registry key, then broadcast a WM_SETTINGCHANGE message with lParam set to the string "Environment"." |
00:03:44 | codic | or /etc/profile |
00:03:47 | codic | both are systemwide, of course, and both require root permissions to launch the app (ya can't work around that) |
00:03:52 | codic | it's just a limitation with windows and linux |
00:04:21 | codic | yeah, so setUnicodeValue HKEY_LOCAL_MACHINE and add the key. not really familiar with how win registry works so cant help more |
00:04:33 | Yardanico | neither am i :D |
00:04:39 | codic | also, the registry module has a const HKEY_LOCAL_MACHINE if neded it |
00:04:43 | codic | *if it's needed |
00:04:47 | codic | :p |
00:05:36 | FromGitter | <Knaque> I'll give that a shot, then. Thanks for the help. |
00:08:21 | FromDiscord | <Technisha Circuit> Is Tensorflow a good choice for making a chat bot in Nim? |
00:08:34 | Yardanico | wat |
00:08:38 | Yardanico | maybe you meant dialogflow? |
00:08:45 | FromDiscord | <Technisha Circuit> (edit) 'bot' => 'ai' |
00:08:58 | FromDiscord | <Technisha Circuit> I meant ai, not bot :p |
00:09:04 | Yardanico | well if you have time to wrap tensorflow in nim, sure |
00:09:16 | Yardanico | it could be done since tensorflow can be used from c++ |
00:09:18 | * | dadada quit (Ping timeout: 265 seconds) |
00:09:27 | Yardanico | but I doubt that you would be able to do that on the phone :P |
00:09:31 | Yardanico | no offence |
00:10:00 | Yardanico | since tensorflow is quite big |
00:10:14 | FromDiscord | <Technisha Circuit> Already a C++ wrapper for it |
00:10:27 | Yardanico | well then it should be possible |
00:10:34 | FromDiscord | <Technisha Circuit> https://goo.gl/search/Tensorflow+for+Nim↵MartinR20/tensorflow.nim |
00:10:59 | FromDiscord | <Technisha Circuit> https://github.com/MartinR20/tensorflow.nim |
00:11:02 | Yardanico | why not try arraymancer first though? :P |
00:11:08 | Yardanico | depends on what you want to do of course |
00:12:06 | Yardanico | for a chat bot I'd really suggest trying dialogflow |
00:12:40 | FromDiscord | <Technisha Circuit> What's arraymancer? And i want to try making a chat ai and then some cli games with an ai |
00:12:48 | Yardanico | what do you mean by "ai" |
00:12:55 | Yardanico | https://github.com/mratsim/Arraymancer |
00:12:56 | FromDiscord | <Technisha Circuit> Well |
00:13:03 | Yardanico | and why dialogflow isn't enough for you |
00:13:23 | FromDiscord | <Technisha Circuit> A neural network to complete the game i made |
00:13:34 | Yardanico | well that's not easy to do, but sure |
00:13:42 | FromDiscord | <Technisha Circuit> Nice |
00:14:42 | FromDiscord | <Technisha Circuit> Where's dialogflow? I can't find it |
00:14:50 | Yardanico | https://dialogflow.com/ |
00:14:55 | FromDiscord | <Technisha Circuit> O |
00:15:06 | Yardanico | google's cloud-based NLP solution |
00:15:25 | * | dadada joined #nim |
00:15:30 | FromDiscord | <Technisha Circuit> Oo |
00:15:42 | Yardanico | well it wasn't made by google initially, but google bought the startup |
00:15:49 | * | dadada is now known as Guest78561 |
00:15:57 | FromDiscord | <Technisha Circuit> Nice |
00:15:58 | Yardanico | "Google bought the company in September 2016[6] and was initially known as API.AI" |
00:16:18 | zacharycarter | wit.ai is pretty good too |
00:16:25 | zacharycarter | I used that recently in a hackathon for a chat bot |
00:16:32 | Yardanico | oh yeah i need to try wit.ai too |
00:16:43 | Yardanico | but dialogflow actually has some more functionality :P |
00:16:49 | Yardanico | but wit.ai is completely free |
00:17:04 | zacharycarter | well except fb owns all your data |
00:17:09 | zacharycarter | but google probably does too with dialogflow |
00:17:30 | Yardanico | oh wit.ai is by facebook? didn't know |
00:28:07 | FromDiscord | <Technisha Circuit> How to use choosenim to install the latest nightly version? |
00:34:40 | FromDiscord | <lex> hi hi! |
00:34:45 | FromDiscord | <Technisha Circuit> Heya |
00:34:58 | FromDiscord | <lex> sent a long message, see http://ix.io/2nM9 |
00:35:08 | FromDiscord | <lex> (edit) 'long message,' => 'code paste,' | 'http://ix.io/2nM9' => 'http://ix.io/2nMa' |
00:35:11 | Yardanico | do you have docopt installed? |
00:35:15 | FromDiscord | <lex> yep |
00:35:18 | FromDiscord | <lex> (edit) 'http://ix.io/2nMa' => 'http://ix.io/2nMb' |
00:35:20 | Yardanico | well doesn't seem so :P |
00:35:21 | FromDiscord | <lex> I ran `nimble install docopt` |
00:35:25 | FromDiscord | <lex> I know ffs |
00:35:30 | FromDiscord | <lex> its likely a local/global package issue |
00:35:34 | FromDiscord | <lex> i had this with conan as well |
00:35:35 | Yardanico | ah you're running nimble build? |
00:35:39 | FromDiscord | <lex> yep |
00:35:41 | FromDiscord | <lex> am i not meant to |
00:35:41 | Yardanico | if you run that you need to specify docopt in your .nimble file too |
00:35:50 | FromDiscord | <lex> wait |
00:35:54 | FromDiscord | <lex> why wouldnt it be in there automatically |
00:36:08 | Yardanico | because nimble reads your .nimble file for all packages it requires |
00:36:13 | Yardanico | "nim c" and "nimble c" are different |
00:36:15 | FromDiscord | <lex> doesnt it add it in there already like `npm` or `yarn` with `package.json`? |
00:36:23 | Yardanico | with "nim c -r" it will work, yes |
00:36:32 | Yardanico | but not with "nimble build" unless you add it in your .nimble file in your project |
00:36:36 | FromDiscord | <lex> ok, so I've gotta add it to the nimble file manually |
00:36:37 | FromDiscord | <lex> ok |
00:36:38 | FromDiscord | <lex> awesome |
00:36:41 | FromDiscord | <lex> thanks man! lets give it a try |
00:37:35 | FromDiscord | <lex> yeah, worked fine. cheers |
00:37:37 | FromDiscord | <lex> though |
00:37:42 | FromDiscord | <lex> are there any other CLI parsers that I could use |
00:37:52 | FromDiscord | <lex> if im honest, docopt isn't really my cup of tea but its the best thing I found |
00:37:55 | Yardanico | cligen |
00:38:05 | Yardanico | https://github.com/c-blake/cligen |
00:38:09 | FromDiscord | <lex> cligen seems a bit odd |
00:38:11 | FromDiscord | <lex> dunno why |
00:38:27 | FromDiscord | <lex> might need to peep some examples |
00:38:51 | FromDiscord | <lex> ugh lool |
00:39:01 | FromDiscord | <lex> all these cli frameworks are based so heavily on python ones |
00:39:09 | * | Guest78561 quit (Ping timeout: 258 seconds) |
00:39:15 | Yardanico | https://nim-lang.org/docs/parseopt.html then |
00:40:17 | FromDiscord | <lex> id rather use docopt man thanks though hahaha |
00:40:28 | FromDiscord | <lex> could write a wrapper around it to make it more procedure based |
00:40:30 | FromDiscord | <lex> also |
00:40:40 | FromDiscord | <lex> procedures are basically functions right |
00:41:03 | Yardanico | nim has both procedures and functions, which more accurately represents them in a mathematical sense |
00:41:12 | Yardanico | "func" is a proc with {.noSideEffect.} |
00:41:23 | FromDiscord | <Zed> How hard would it be to implement offline docs for standard libraries? ↵eg: `nim --help:strutils` would show all the documentation for that library and so on for all standard libraries |
00:41:38 | Yardanico | i think that's already been done a few times with different libraries/tools |
00:41:40 | FromDiscord | <lex> oh I see |
00:41:42 | FromDiscord | <lex> question mate |
00:41:54 | FromDiscord | <lex> so obviously ive got this |
00:41:57 | FromDiscord | <lex> sent a code paste, see http://ix.io/2nMh |
00:42:02 | FromDiscord | <lex> what do i do regarding, well |
00:42:06 | FromDiscord | <lex> getting anything that comes after `init` |
00:42:31 | Yardanico | well, refer to docopt docs? |
00:42:42 | Yardanico | https://github.com/docopt/docopt.nim the first example is quite explanatory I think |
00:42:46 | FromDiscord | <lex> true lol |
00:42:48 | FromDiscord | <lex> thanks |
00:45:15 | FromDiscord | <Technisha Circuit> > How to use choosenim to install the latest nightly version?↵:p |
00:45:18 | Yardanico | idk |
00:45:21 | Yardanico | i dont use choosenim |
00:45:23 | * | dadada joined #nim |
00:45:46 | * | dadada is now known as Guest98013 |
00:45:49 | Yardanico | afaik choosenim supports two notions of "nightly" though |
00:45:54 | Yardanico | latest commit and latest nightly build |
00:45:57 | Yardanico | which one do you need? |
00:46:59 | FromDiscord | <lex> what am I doing wrong |
00:47:05 | FromDiscord | <lex> doesnt seem to want to work |
00:47:05 | FromDiscord | <lex> sent a code paste, see http://ix.io/2nMi |
00:47:30 | FromDiscord | <lex> ah shit |
00:47:33 | FromDiscord | <lex> gotta use <> |
00:47:59 | FromDiscord | <lex> im assuming I can write modular code with nim right |
00:48:09 | Yardanico | yes |
00:48:28 | Yardanico | https://nim-lang.org/docs/manual.html#modules |
00:48:36 | * | lritter quit (Ping timeout: 256 seconds) |
00:48:56 | FromDiscord | <lex> thanks!! |
00:49:08 | * | lritter joined #nim |
00:53:59 | FromDiscord | <lex> how can i iterate through an array |
00:54:00 | FromDiscord | <lex> i.e. |
00:54:01 | FromDiscord | <lex> "args" |
00:54:38 | Yardanico | for val in args["somevar"]: stuff |
00:54:46 | Yardanico | I think |
00:54:48 | Yardanico | I didn't really use docopt :_) |
00:54:55 | FromDiscord | <lex> ahha thats alright man |
00:54:58 | FromDiscord | <lex> see |
00:55:00 | FromDiscord | <lex> what im trying to do |
00:55:01 | Yardanico | there are https://github.com/docopt/docopt.nim/tree/master/examples |
00:55:08 | FromDiscord | <lex> alright yeah |
00:55:09 | FromDiscord | <lex> thats cool |
00:55:10 | FromDiscord | <lex> thanks man |
00:55:17 | Yardanico | like https://github.com/docopt/docopt.nim/blob/master/examples/odd_even.nim |
00:55:44 | Yardanico | docopt documentation is on http://docopt.org/ |
00:55:51 | FromDiscord | <lex> cheers! |
00:55:52 | Yardanico | this lib is a nim implementatiuon of docopt |
00:57:58 | FromDiscord | <lex> whats the diff between a proc and method again |
00:58:03 | FromDiscord | <lex> and which is better to youu |
00:58:05 | FromDiscord | <lex> (edit) 'youu' => 'use' |
00:58:09 | Yardanico | static vs runtime dispatch |
00:58:14 | Yardanico | in most cases you should be fine with proc |
00:58:18 | FromDiscord | <lex> ah alright |
00:58:22 | FromDiscord | <lex> could you elaborate? |
00:58:27 | FromDiscord | <lex> I just wanna know what im getting into 😅 |
00:58:29 | Yardanico | runtime dispatch (methods) is only needed when you have inheritance |
00:58:31 | Yardanico | OOP |
00:59:07 | FromDiscord | <lex> aha |
00:59:07 | FromDiscord | <lex> I see |
00:59:08 | FromDiscord | <lex> alright |
00:59:11 | FromDiscord | <lex> cheers!! |
00:59:12 | Yardanico | you don't exactly need OOP in nim, like the compiler itself doesn't use methods at all |
00:59:24 | FromDiscord | <lex> yeah no thats fair enough |
00:59:25 | Yardanico | there are other ways like generics, object variants, etc |
01:00:49 | * | konvertex quit (Ping timeout: 264 seconds) |
01:08:59 | * | Guest98013 quit (Ping timeout: 246 seconds) |
01:11:04 | FromDiscord | <codic> Does choosenim support unstable? |
01:11:10 | FromDiscord | <codic> The latest nightly binary specifically |
01:11:10 | Yardanico | depends on what you mean |
01:11:16 | Yardanico | i think it does |
01:11:25 | FromDiscord | <codic> Since path configuration with the tar xz is a big pain. |
01:11:27 | FromDiscord | <codic> ah, yay. how? |
01:11:48 | FromDiscord | <codic> do I make use of it |
01:12:03 | Yardanico | choosenim update devel |
01:12:15 | Yardanico | and choosenim update devel --latest build latest commit |
01:12:24 | Yardanico | "choosenim update devel" download latest nightly |
01:12:34 | FromDiscord | <codic> Niice |
01:12:47 | Yardanico | well first of all you need "choosenim devel" |
01:13:04 | FromDiscord | <codic> where do i get choosenim from |
01:13:11 | Yardanico | https://github.com/dom96/choosenim |
01:13:15 | FromDiscord | <codic> ah |
01:13:16 | FromDiscord | <codic> ok |
01:13:18 | Yardanico | https://github.com/dom96/choosenim#unix |
01:13:30 | FromDiscord | <codic> Ik |
01:13:31 | FromDiscord | <codic> Getting that |
01:14:02 | FromDiscord | <codic> Uhhh |
01:14:06 | FromDiscord | <codic> sent a code paste, see http://ix.io/2nMr |
01:14:07 | FromDiscord | <codic> But I have clang... |
01:14:14 | * | krux02 joined #nim |
01:14:17 | Yardanico | but is it the default one? |
01:14:20 | FromDiscord | <codic> which clang and which clang++ both work |
01:14:22 | Yardanico | try "cc" |
01:14:23 | FromDiscord | <codic> how do i set the default? |
01:14:28 | FromDiscord | <codic> command not found |
01:14:30 | * | krux02 quit (Remote host closed the connection) |
01:14:34 | Yardanico | that's your problem |
01:14:58 | Yardanico | also what are you trying to install choosenim on? |
01:14:58 | FromDiscord | <codic> ah hold on, solus provides that via system.devel |
01:15:01 | FromDiscord | <codic> solus |
01:15:06 | Yardanico | ah ok then |
01:15:07 | FromDiscord | <codic> 64bit |
01:15:10 | FromDiscord | <codic> amd64 specifically |
01:15:14 | Yardanico | but yeah, you need "cc" or have $CC |
01:15:22 | Yardanico | @codic I know solus is amd64 only anyway |
01:15:24 | FromGitter | <kaushalmodi> codic: https://gist.github.com/genotrance/fb53504a4fba88bc5201d3783df5c522/raw/travis.sh |
01:15:25 | * | dadada__ joined #nim |
01:15:29 | FromGitter | <kaushalmodi> Use the `--latest` switch |
01:15:36 | Yardanico | @kaushalmodi that's not what he wanted |
01:15:42 | Yardanico | he wants a nightly build, not latest commit |
01:15:42 | FromDiscord | <codic> Yeah ofc↵No, I want the binaries |
01:15:53 | FromDiscord | <codic> cc works now |
01:15:56 | Yardanico | nice |
01:15:57 | Yardanico | try it agian |
01:15:57 | FromDiscord | <lex> solus!! |
01:16:00 | FromDiscord | <codic> i am |
01:16:07 | FromDiscord | <codic> nice, it's installing |
01:16:08 | FromDiscord | <lex> send us your neofetch | lolcat |
01:16:20 | FromDiscord | <codic> can i remove the normal version and get devel? |
01:16:23 | FromDiscord | <codic> umm... sure |
01:16:59 | Yardanico | @codic did you really read choosenim readme? |
01:17:03 | Yardanico | "Optional: You can specify the initial version you would like the init.sh script to install by specifying the CHOOSENIM_CHOOSE_VERSION environment variable." |
01:17:18 | Yardanico | idk how to remove though |
01:17:32 | FromDiscord | <codic> @lex here, although I just had to reinstall because i broke something, so still gotta configure it https://media.discordapp.net/attachments/371759389889003532/716097930200875018/unknown.png |
01:17:34 | FromDiscord | <codic> oh, nice |
01:17:39 | FromDiscord | <Technisha Circuit> > latest commit and latest nightly build↵Preferably newest commit :p |
01:17:46 | FromDiscord | <codic> --latest |
01:17:50 | Yardanico | choosenim devel --latest |
01:17:53 | FromDiscord | <codic> choosenim update devel --latest |
01:17:56 | FromDiscord | <codic> oh |
01:18:00 | FromDiscord | <Technisha Circuit> Thanks :P |
01:18:00 | FromDiscord | <lex> @codic https://media.discordapp.net/attachments/371759389889003532/716098049545338910/unknown.png |
01:18:01 | Yardanico | update is when you already have it |
01:18:11 | FromDiscord | <codic> @lex nice, #offtopic? |
01:18:16 | FromDiscord | <lex> ya sure |
01:18:42 | * | chemist69 quit (Ping timeout: 260 seconds) |
01:20:14 | * | chemist69 joined #nim |
01:20:16 | FromDiscord | <codic> aaaaah can't figure out how to remove |
01:21:45 | Yardanico | remove the foler |
01:21:47 | Yardanico | folder* |
01:21:52 | Yardanico | in ~/.nimble/toolchains somewhere |
01:21:57 | Yardanico | or ~/.choosenim idk |
01:22:19 | FromDiscord | <codic> rm -rf .{choosenim,nimble} |
01:22:20 | FromDiscord | <codic> there |
01:23:00 | Yardanico | nice |
01:23:06 | Yardanico | you also removed all your nimble packages with that command |
01:23:16 | Yardanico | and even choosenim itself maybe |
01:23:32 | FromDiscord | <codic> i didn't have any |
01:23:40 | FromDiscord | <codic> and i can redownload anyways |
01:24:49 | FromDiscord | <codic> just to be safe, `CHOOSENIM_CHOOSE_VERSION=devel wget -qO - https://nim-lang.org/choosenim/init.sh | sh`? |
01:25:35 | Yardanico | I guess |
01:25:40 | Yardanico | as I said I don't use choosenim at all |
01:25:44 | Yardanico | last time I used it was in 2018 maybe |
01:25:50 | FromDiscord | <codic> ¯\_(ツ)_/¯ |
01:26:02 | FromDiscord | <codic> aah that installed stable |
01:26:03 | FromDiscord | <codic> whatever |
01:33:40 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ed1b7f4b101510b20271b39] |
01:33:50 | FromGitter | <bung87> am I doing right ? |
01:36:27 | FromDiscord | <codic> aaa i need a good way to get the nightly |
01:37:20 | Yardanico | just download it |
01:38:42 | * | bjornroberg quit (Quit: leaving) |
01:39:02 | * | dadada__ quit (Ping timeout: 256 seconds) |
01:39:34 | FromDiscord | <codic> i did |
01:39:37 | FromDiscord | <codic> keeps complaining nim isnt in path |
01:39:57 | FromDiscord | <codic> also i cant find v1.3 for amd64 |
01:40:01 | FromDiscord | <codic> only 1.2.1 |
01:40:41 | Yardanico | @codic well you should either add the dir in path or symlink the binary to a place which is in path |
01:40:55 | Yardanico | @codic https://github.com/nim-lang/nightlies/releases/tag/2020-05-28-devel-fe7a2d6 |
01:40:59 | Yardanico | ah nvm |
01:41:13 | FromDiscord | <codic> no amd in there |
01:41:16 | FromDiscord | <codic> > @codic well you should either add the dir in path or symlink the binary to a place which is in path |
01:41:20 | FromDiscord | <codic> ok, will do in /etc/environment |
01:43:49 | bung | I realize no need to do that |
01:45:23 | * | dadada joined #nim |
01:45:47 | * | dadada is now known as Guest89423 |
01:46:24 | FromDiscord | <Technisha Circuit> How do i use symlinks :∆ |
01:46:31 | Yardanico | ln --help |
01:46:39 | FromDiscord | <Technisha Circuit> I've never used them before 😅 |
02:03:51 | FromDiscord | <Technisha Circuit> Is there a way to make it so when I'm using the js backend, any variable names i define are the exact name and not `name_829292` or something like that? |
02:04:44 | FromDiscord | <Technisha Circuit> I'm focusing on nodejs specifically |
02:04:46 | Yardanico | why would you want that? |
02:05:19 | FromDiscord | <Technisha Circuit> Because then my friends bot wouldn't be able to register commands made with Nim |
02:05:55 | FromDiscord | <Technisha Circuit> (edit) 'Because then my friends bot wouldn't be able to register commands made with Nim ... ' => 'Because then my friends bot wouldn't be able to register commands made with Nimvia the js backend' |
02:06:03 | * | opal quit (Ping timeout: 240 seconds) |
02:06:08 | Yardanico | still don't really understand what you mean |
02:06:17 | Yardanico | you know "asm" exists, right? it allows you to write js code inline in nim code |
02:06:18 | Yardanico | also emit |
02:06:24 | Yardanico | also importc |
02:06:54 | FromDiscord | <Technisha Circuit> Basically, the command handler he made needs the exact variable name `name` in the code to register a command |
02:06:58 | FromDiscord | <Technisha Circuit> Otherwise it won't work |
02:07:15 | FromDiscord | <Technisha Circuit> (edit) 'command' => 'command, similar issue for the rest of the code' |
02:07:41 | Yardanico | var name {.exportc.} = 5 |
02:07:46 | Yardanico | and in JS it will be just "name" |
02:08:18 | FromDiscord | <Technisha Circuit> But I'm using the js backend :P |
02:08:21 | Yardanico | same |
02:08:25 | Yardanico | importc works for the JS backend too |
02:08:27 | Yardanico | and exportc |
02:08:33 | Yardanico | (I just tried) |
02:08:37 | FromDiscord | <Technisha Circuit> (also i never knew variables work with pragmas) |
02:08:39 | FromDiscord | <Technisha Circuit> Oh nice |
02:08:43 | FromDiscord | <Technisha Circuit> Thanks! |
02:09:17 | * | Guest89423 quit (Ping timeout: 256 seconds) |
02:15:22 | * | dadada__ joined #nim |
02:24:13 | * | dddddd quit (Ping timeout: 264 seconds) |
02:25:10 | * | theelous3 quit (Read error: Connection reset by peer) |
02:26:46 | * | opal joined #nim |
02:27:05 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:28:45 | * | muffindrake joined #nim |
02:29:11 | * | rockcavera quit (Remote host closed the connection) |
02:38:56 | * | dadada__ quit (Ping timeout: 246 seconds) |
02:45:30 | * | dadada joined #nim |
02:46:02 | * | dadada is now known as Guest77347 |
02:46:53 | * | monok joined #nim |
02:49:25 | * | mono quit (Ping timeout: 264 seconds) |
03:09:49 | * | Guest77347 quit (Ping timeout: 264 seconds) |
03:15:27 | * | dadada__ joined #nim |
03:39:38 | * | dadada__ quit (Ping timeout: 272 seconds) |
03:45:25 | * | dadada joined #nim |
03:45:48 | * | dadada is now known as Guest39276 |
03:50:23 | * | arecaceae quit (Read error: Connection reset by peer) |
03:50:55 | * | arecaceae joined #nim |
03:53:32 | * | nsf joined #nim |
03:54:26 | disruptek | my serializer takes 0.37s to write 140mb of data with refc, 0.85s to deserialize it from a file. 0.65s to deserialize it from a string. this data takes a full second to check the hash. |
03:55:05 | disruptek | under arc, the serialization takes 0.45s but the read takes 0.36s and reading from a string is only 0.22s. just checking the hash is 0.40s. |
03:55:16 | disruptek | arc is starting to lay down some big numbers. |
03:56:00 | disruptek | not bad for just changing a cli option. |
03:58:55 | zacharycarter | you get a job yet? |
03:59:17 | disruptek | not yet. |
03:59:23 | zacharycarter | slacker |
03:59:30 | zacharycarter | come be a disgruntled python developer with me |
03:59:51 | disruptek | hmm. |
03:59:56 | disruptek | it's austin, right? |
04:00:02 | zacharycarter | yeah |
04:00:14 | disruptek | where's the ad? |
04:00:22 | zacharycarter | our company got listed in Forbes 25 startups most likely to reach a billion dollar valuation |
04:00:26 | zacharycarter | like two days ago |
04:00:38 | disruptek | you make coffins? |
04:00:48 | zacharycarter | if you give any creedence to those types of articles - which I don't |
04:01:02 | zacharycarter | we ship them |
04:01:16 | disruptek | oh right, it's logistics? |
04:01:31 | zacharycarter | https://shipwell.com/careers/ |
04:01:33 | zacharycarter | yeah |
04:02:26 | disruptek | is that a real photo of the pen? |
04:02:29 | disruptek | the bullpen? |
04:02:30 | disruptek | christ. |
04:02:45 | zacharycarter | I'm so glad I never have to work in a office again |
04:02:50 | zacharycarter | an office |
04:03:05 | zacharycarter | they need to get rid of that photo, especially post-covid |
04:03:31 | zacharycarter | but yeah - when I was applying that photo made me hesitate - thankfully the dev teams were ina wework office across the street |
04:03:42 | zacharycarter | also - I don't think you'd need to move to Austin necessarily |
04:03:51 | zacharycarter | they'd probably hire you and let you work where you're at |
04:04:35 | disruptek | i can't scroll this web-page without it jumping around like cypress fucking hill. |
04:04:41 | zacharycarter | lol |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:36 | * | supakeen joined #nim |
04:06:43 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:07:24 | disruptek | you do backend stuff? |
04:07:49 | zacharycarter | yeah backend and devops |
04:08:00 | zacharycarter | right now they have me building out a data pipeline for the data science team |
04:08:05 | zacharycarter | which is like four people fresh out of college |
04:08:18 | zacharycarter | and I'm totally shirking the responsibility by telling them to buy databricks |
04:08:30 | zacharycarter | but that's just because I don't feel like writing terraform for the rest of my time there |
04:08:36 | zacharycarter | which is the alternative |
04:08:49 | disruptek | you're making my sphincter clench. |
04:08:56 | zacharycarter | mine is already in my mouth |
04:09:12 | * | Guest39276 quit (Ping timeout: 256 seconds) |
04:09:20 | zacharycarter | I'd just go find a job doing systems programming honestly |
04:09:28 | zacharycarter | that's what I'd do if I was better at comp sci |
04:09:48 | zacharycarter | and will do once I complete about a billion more leet code problems |
04:10:11 | zacharycarter | app development is the pits |
04:10:51 | disruptek | it's a grind. |
04:11:22 | zacharycarter | I mean - I think it's fine if you work with smart people |
04:11:44 | zacharycarter | or people that actually care about computer science |
04:12:07 | zacharycarter | but the vast majority of app dev jobs now a days are filled with programmers who don't care |
04:13:00 | disruptek | i dunno, i don't care enough to win contests or interviews. |
04:13:01 | zacharycarter | and who do stupid shit - like build tons of microservices that all communicate with eachother using HTTP / JSON |
04:13:43 | disruptek | the thing is, that's the fabric we have to work with. |
04:14:24 | disruptek | it's like the '90s and word documents. |
04:15:13 | zacharycarter | well - I think there are smart people out there and you don't need to pass a google / amazon / microsoft / fb interview to work with them |
04:15:26 | zacharycarter | just need to be a bit selective during your application process |
04:15:26 | * | dadada__ joined #nim |
04:15:40 | zacharycarter | I just went with Shipwell because it was a ticket back to the US and Austin |
04:15:40 | * | rockcavera joined #nim |
04:15:59 | disruptek | right. it doesn't look bad. |
04:16:04 | zacharycarter | it's okay |
04:24:49 | bung | a wraped c object has extro field as proc type , when pass it to c api it will work ? |
04:49:44 | leorize | wdym? |
04:56:13 | bung | https://github.com/nim-lang/Nim/blob/3105909f887f2240c2a7a7071b37e1253a70e3e2/lib/wrappers/mysql.nim#L768 |
04:56:51 | bung | the c structure only have fields uppon this line |
05:00:29 | leorize | you mean our structure is bigger than the C version? |
05:00:50 | * | narimiran joined #nim |
05:04:08 | bung | yes, I just wonder the proc fields will also pass to c api ? |
05:05:30 | leorize | it will, but the C api will work under it's own idea of the object and wouldn't access the additional fields |
05:05:55 | leorize | seems like we get a pass since the API works via pointers |
05:06:44 | bung | ok , I understand that. |
05:13:11 | FromDiscord | <SeanOMik> What's the easiest way to parse a ISO8601 timestamp |
05:13:26 | FromDiscord | <SeanOMik> The timestamp is given in a string btw |
05:18:57 | bung | !repo timestamp.nim |
05:19:27 | bung | !status |
05:19:37 | bung | ok, https://github.com/jackhftang/timestamp.nim |
05:19:43 | Prestige | rip bot |
05:19:54 | leorize | disruptek: did you turn disbot off again? |
05:21:36 | * | disruptek quit (Ping timeout: 272 seconds) |
05:21:36 | * | disbot quit (Ping timeout: 272 seconds) |
05:23:37 | * | disbot joined #nim |
05:25:03 | * | disruptek joined #nim |
05:28:30 | bung | @leorize I double checked the fields even not considering procs fields, they are also differient fields number and order |
05:29:12 | bung | guess that will not be compatible ? |
05:29:14 | leorize | oh now that's a problem |
05:29:16 | leorize | yea |
05:29:56 | bung | https://dev.mysql.com/doc/refman/5.6/en/c-api-prepared-statement-data-structures.html |
05:30:27 | bung | I checked it from document, let me check some other programming language source code. |
05:34:15 | leorize | I'd say check mariadb docs |
05:34:21 | leorize | that's what everyone uses nowadays |
05:38:17 | bung | ok |
05:50:30 | * | opDispatch quit (Quit: Konversation terminated!) |
05:55:23 | leorize[m] | bung: actually double check with the headers |
05:55:44 | leorize[m] | the docs might not reflect how the structure is defined |
05:59:29 | * | dadada__ quit (Ping timeout: 246 seconds) |
06:00:21 | * | dadada joined #nim |
06:00:55 | * | dadada is now known as Guest71876 |
06:01:03 | bung | yeah, I downloaded the c source from mariadb |
06:01:21 | bung | https://file.io/3KfazvzI see they are differient |
06:04:16 | bung | @leorize |
06:19:38 | * | narimiran quit (Quit: leaving) |
06:22:54 | * | solitudesf joined #nim |
06:32:47 | leorize | got 404 |
06:40:32 | bung | https://file.io/kqGz3ns1 |
06:41:00 | bung | oh ,I forgot it's one time click limited. |
06:53:43 | Yardanico | transfer.sh or ix.io |
06:55:30 | bung | ok I'v configered transfer.sh |
06:56:05 | bung | https://transfer.sh/J7nhl/Screenshot-2020-05-30-at-1.58.08-PM.png |
06:57:12 | * | aeverr_ joined #nim |
06:57:13 | * | aeverr quit (Read error: Connection reset by peer) |
07:01:27 | Araq | community, please help this guy https://forum.nim-lang.org/t/6389 |
07:01:45 | Araq | (I am too busy fixing bugs) |
07:02:36 | bung | let me check |
07:04:12 | Yardanico | Araq: fwiw their code works for me on latest devel :P |
07:04:22 | Yardanico | ah nvm no |
07:05:55 | * | Romanson joined #nim |
07:06:32 | * | tdc joined #nim |
07:09:26 | bung | my guess he should always using kstring |
07:09:37 | Yardanico | it fails in actionAddThing |
07:10:03 | Yardanico | because nodes are null |
07:10:35 | Yardanico | well .isNil returns false but if I try to echo them I get a null exception in js :P |
07:10:58 | bung | the dollar Thing returns string |
07:11:29 | Yardanico | nah i'm not about that |
07:11:39 | Yardanico | it fails because getVNodeById returns nothing |
07:11:40 | Yardanico | null |
07:11:43 | Yardanico | (in JS it's null) |
07:13:29 | Yardanico | oh wait so actually the nodes aren't null |
07:13:33 | Yardanico | but .value() returns null |
07:16:55 | bung | hmm cant be that I guess , It just call .value isn't it ? |
07:17:00 | Yardanico | well it can |
07:17:02 | Yardanico | .value() returns null |
07:17:06 | Yardanico | nil in nim |
07:17:23 | Yardanico | maybe calling value is incorrect there? idk js or karax really :D |
07:21:54 | bung | hmm it's a property I searched the karax doc |
07:22:27 | Yardanico | I don't think it's the right way to get a value from input |
07:23:12 | Yardanico | value only exists for VNodeKind.text |
07:23:36 | Yardanico | and input itself *is not* text |
07:23:58 | bung | so inputNode.value |
07:24:01 | Yardanico | no |
07:24:38 | bung | https://github.com/pragmagic/karax/search?p=1&q=.value&unscoped_q=.value |
07:24:51 | Yardanico | yes, so as you can see there's no place where it's set implicitly |
07:24:56 | Yardanico | so you have to create your own component to have it |
07:29:29 | bung | ah , he mixed the traditional web tecnics and vdom |
07:29:59 | Yardanico | ye |
07:30:43 | bung | hmm , got no benefit by using karax.. |
07:31:55 | bung | let me give some tip to him |
07:43:14 | FromGitter | <eagledot> Are there nim bindings available for openCV based on C++ Api ? |
07:44:45 | Yardanico | don't think so |
07:44:56 | Yardanico | ah well there's https://github.com/xomachine/opencv2-nim but last commit in 2015 |
07:48:00 | * | gargle joined #nim |
07:48:33 | gargle | Hi. What would be the best way to start with a rest api server in Nim? |
07:48:51 | Yardanico | gargle: I guess reading https://nim-lang.org/docs/json.html and using https://github.com/dom96/jester ? |
07:49:50 | Yardanico | for the DB you can use https://github.com/moigagoo/norm |
07:50:07 | FromGitter | <eagledot> Is there anyway i can access webcam using any nim's library? |
07:50:28 | Yardanico | don't know, sorry :( you might ask on the forum |
07:50:38 | gargle | will this work on Windows? How is it with concurrency/parallelism? |
07:50:45 | gargle | i want something like go |
07:50:50 | gargle | go's net/http |
07:50:53 | Yardanico | gargle: 1) yes 2) on windows - not really good, but on *nix it's fine |
07:51:01 | gargle | hmmmmmm |
07:51:04 | Yardanico | jester uses httpbeast on *nix platforms which allows it to have threaded async |
07:51:29 | Yardanico | well I mean concurrency will be fine |
07:51:32 | Yardanico | async works fine on windows |
07:51:53 | Yardanico | not parallelism though, for that you'll have to create threads yourself or use something like Weave (for computational heavy tasks) |
07:52:33 | * | solitudesf quit (Remote host closed the connection) |
07:53:04 | * | nsf quit (Quit: WeeChat 2.8) |
07:53:23 | gargle | thankie |
07:53:57 | * | solitudesf joined #nim |
07:56:37 | * | gargle quit (Remote host closed the connection) |
07:59:15 | * | idf joined #nim |
08:03:08 | * | defection joined #nim |
08:03:43 | * | defection quit (Client Quit) |
08:24:09 | * | fredrikhr joined #nim |
08:27:29 | * | neceve joined #nim |
08:42:54 | * | Guest71876 quit (Ping timeout: 256 seconds) |
08:45:25 | * | dadada joined #nim |
08:45:49 | * | dadada is now known as Guest8421 |
08:45:50 | * | Trustable joined #nim |
09:14:30 | * | Romanson quit (Quit: Connection closed for inactivity) |
09:20:21 | * | konvertex joined #nim |
09:28:47 | * | chemist69 quit (Ping timeout: 246 seconds) |
09:29:45 | * | chemist69 joined #nim |
09:35:47 | alehander92 | oi |
09:35:51 | alehander92 | blessed morning |
09:36:25 | alehander92 | i am going to try to write some todo-s now |
09:37:30 | Zevv | maybe you should put trying to write some todo-s on the top of your todo list |
09:37:51 | Zevv | you know that feeling, when you are trying to accomplish something, you end up in this recursive tree of trivialities? |
09:40:48 | FromGitter | <bung87> or finished a todo liat then create another todo list |
09:43:26 | alehander92 | yeahhh |
09:43:36 | alehander92 | actually no |
09:43:39 | alehander92 | i just like todos |
09:50:23 | * | Guest8421 quit (Ping timeout: 258 seconds) |
09:58:36 | * | dddddd joined #nim |
10:00:26 | * | dadada joined #nim |
10:00:56 | * | dadada is now known as Guest55682 |
10:01:25 | dom96 | 'morning |
10:02:20 | livcd | evening ) |
10:18:55 | FromDiscord | <KrispPurg> Is there an libopus library for Nim? |
10:19:01 | FromDiscord | <lex> like |
10:19:02 | FromDiscord | <KrispPurg> (edit) 'libopus' => 'opus' |
10:19:04 | FromDiscord | <lex> for opus-voice |
10:19:05 | FromDiscord | <lex> discord bots |
10:19:10 | FromDiscord | <KrispPurg> yes |
10:19:25 | FromDiscord | <lex> I have no clue, best taking a look at discordnim |
10:19:34 | Yardanico | LMAO |
10:19:38 | FromDiscord | <KrispPurg> wow |
10:19:46 | FromDiscord | <lex> ???? |
10:19:50 | FromDiscord | <lex> why LMAO fffffssssss |
10:19:56 | Yardanico | krisppurg is the creator of dimscord |
10:19:58 | FromDiscord | <KrispPurg> discordnim doesn't have voice lol |
10:20:02 | FromDiscord | <lex> oh |
10:20:02 | Yardanico | and discordnim is pretty bare |
10:20:05 | FromDiscord | <lex> fuck sake |
10:20:09 | Yardanico | and abandoned |
10:20:12 | Yardanico | @krisppurg https://github.com/search?q=language%3Anim+opus&type=Code |
10:20:17 | FromDiscord | <lex> oh ffs |
10:20:17 | FromDiscord | <KrispPurg> its okay |
10:20:18 | FromDiscord | <lex> you are |
10:20:19 | FromDiscord | <lex> LMAO |
10:20:56 | FromDiscord | <lex> oop- |
10:20:57 | FromDiscord | <lex> sorry mate |
10:21:13 | FromDiscord | <KrispPurg> holy damn, looks like I'm off to voice making then. |
10:21:22 | FromDiscord | <lex> good luck mate |
10:22:00 | FromDiscord | <KrispPurg> thanks I guess. |
10:23:44 | * | FromDiscord quit (Remote host closed the connection) |
10:23:59 | * | FromDiscord joined #nim |
10:24:35 | * | Guest55682 quit (Ping timeout: 265 seconds) |
10:29:54 | alehander92 | dom96 |
10:29:59 | alehander92 | how is it |
10:30:18 | alehander92 | how is the game going? |
10:30:22 | dom96 | good |
10:30:27 | * | dadada__ joined #nim |
10:30:29 | dom96 | Submitted to Google Play |
10:30:44 | dom96 | Gonna do some final things today and hopefully attempt to advertise it more widely |
10:31:06 | dom96 | Could use someone help in breaking it though :) |
10:32:45 | alehander92 | awesome |
10:33:24 | alehander92 | hm, i am trying to decide between a vm debugger / and detecting blocking calls to play with today |
10:33:58 | Zevv | alehander92: I got something to play with for you :) |
10:34:06 | alehander92 | coro? :D |
10:34:09 | alehander92 | ok |
10:34:22 | Zevv | Well, that will be one of the end results |
10:34:31 | alehander92 | ? |
10:34:32 | Zevv | but we will also replace iterators and closure iterators |
10:34:38 | Zevv | :) |
10:34:52 | alehander92 | i dont know |
10:34:52 | Zevv | and finally properly join async and threads |
10:35:00 | alehander92 | i can help but wouldnt raise my hopes too much :D |
10:35:14 | alehander92 | so how? |
10:35:19 | Zevv | I'm stuck myself anyway, so it can never get worse, haha |
10:35:36 | alehander92 | is there some kind of irc log for it |
10:35:40 | alehander92 | or repo |
10:35:44 | Zevv | not really, araq dumped me some papers |
10:35:51 | Zevv | this is my repo: https://github.com/zevv/nimcsp |
10:36:00 | alehander92 | and said "lets rewrite half of nim concepts" |
10:36:10 | Zevv | There's a computer science trick of transforming a piece of code to fold your control logic inside out |
10:36:23 | alehander92 | ok sounds useful. |
10:36:28 | Zevv | when doing that, you effectively get rid of the stack |
10:36:56 | Zevv | there is no classical control flow anymore. Everything always goes "forward" only. I've heard of it and played with it some times in the past but never properly got into it. |
10:37:49 | Zevv | The idea is that after this transformation a function or proc gets cut up in a number of seprate new procs, and at the end of a proc it returns an object with a pointer to the next function, and the data it should take |
10:38:10 | Zevv | Its officialy called a "continuation" |
10:38:27 | Zevv | You can call this function right away, but you can also store it and call it when a timeout occures, or when a socket is ready for reading. |
10:38:32 | Zevv | And then suddenly it is called "asyn" |
10:38:34 | Zevv | async |
10:39:27 | Zevv | So what I was trying to do is digest these papers (parts of it, because some parts of it I don't dare come near) and understand the transform. I've done two tiny transforms by hand to make an async socket server thingy, and put it in an event queue. |
10:39:46 | Zevv | All proves to work, so where I want to go is making a macro that does this transformation for me |
10:39:48 | alehander92 | so what is the problem |
10:40:20 | Zevv | the last sentence: this transformation. There's some rules to follow, split up, get local variables out, etc - the README shows a tiny example. |
10:40:32 | Zevv | And I want to know if it would be possible to build a macro that does just that |
10:40:51 | alehander92 | ok |
10:41:00 | Zevv | If that would work, Nim could transfer any proc to a series of continuations, effectively allowing you to run stuff in parallel by magic |
10:41:00 | alehander92 | maybe? |
10:41:13 | alehander92 | so is there an example |
10:41:32 | alehander92 | of the current manual async code AND |
10:41:33 | Zevv | check the repo. The readme shows the transformation in some steps, and there's two tiny working examples. |
10:41:39 | alehander92 | the expected cleaned up api |
10:42:03 | Zevv | The API should probably just a proc with a pragma that invokes the macro. |
10:42:16 | FromDiscord | <dom96> TIL there are android phones that have x86 processors |
10:42:26 | Zevv | The end result should be that the macro transforms the given proc to the split up procs as given in the examples. But the user will never see that, of course |
10:42:49 | Zevv | Anyway, if this kind of stuff sparks your interest, and you're bored, drop in! :) |
10:43:08 | Zevv | dom96: right! But it's mostly settop boxes, not phones. |
10:43:54 | alehander92 | ok, thank God, i was looking for something useful! |
10:43:55 | Zevv | I've been working on a hefty project over the last year where we're running androids in docker and remoting the video and opengl to tiny embedded devices that will then act as if they are running android |
10:44:13 | alehander92 | so let's call it `{.cps.}` |
10:44:24 | Zevv | That's in my file right now. macro cps() = discard |
10:44:27 | Zevv | and now I'm stuck :) |
10:44:29 | alehander92 | or `{.cont.}` |
10:44:42 | alehander92 | i have to read exactly cps def |
10:44:47 | alehander92 | hmmm |
10:44:50 | alehander92 | so lets see |
10:45:15 | Zevv | There's two papers in the top of the readme, they're from the same author but some years apart. The second goes much deeper. |
10:45:57 | FromDiscord | <dom96> Yeah, there is actually some ASUS phones that ran x86 |
10:46:05 | Zevv | CPS is one of these things that CS guys in the functional world love to do, just like playing with monads and all these kind of poche constructs normal computer engineers don't understand bollocks about |
10:46:08 | FromDiscord | <dom96> The Google play dashboard let's you check the devices your APK supports |
10:46:10 | FromDiscord | <dom96> it's quite cool |
10:46:14 | alehander92 | french people are good with lang design man |
10:46:20 | Zevv | ha :) |
10:46:31 | livcd | wait what where |
10:48:14 | alehander92 | so cps conversion/lambda lifting/splitting |
10:49:20 | Zevv | right. The paper is about doing this in C, and they also have a step they call "boxing", where they move local variables to the heap when someone takes the address, but I think that's something that can wait until later. |
10:49:32 | alehander92 | ok |
10:49:41 | Zevv | Araq mentioned there's some hidden magic available in Nim to do these things, like lifting, but it's undocumented and hardly tested. |
10:50:14 | alehander92 | i read a "thought tool" link yesterday, so embarrasing, so i will apply one : why do we need it |
10:50:48 | alehander92 | to make iterators/async/threads simpler/more well cointegrated/more powerful/other? |
10:51:16 | Zevv | To get proper coroutines, or call them fibers. These can be used as tools for doing any "unconventional" program flow without needing compiler/language support. |
10:51:18 | alehander92 | also, is the lack of stack useful, or is it just a side effect |
10:51:34 | Zevv | It is useful. When you want coroutines, you need a stack for each thread. |
10:51:42 | alehander92 | ok, so e.g. how would iterators look on top of them |
10:51:50 | Zevv | But in C there is just one stack. There are hacks to get multiple stacks, but these are all slow and/or not portable. |
10:52:06 | Zevv | When you lose the stack, you are free to continue anywhere in your coded, independed from where you came from. |
10:52:13 | alehander92 | call the callsite with the yield |
10:52:20 | Zevv | So coroutines, iterators, maybe exception handlers, etc. |
10:52:26 | alehander92 | e.g. items => yield(to callsite, value) ? |
10:53:51 | Zevv | something like that. In my toy implementation a continuation is an object of type Cond, which has just a proc pointer. Specific continuations inherit from that object and add the data they want to pass to the proc, like a socket or whatever. These are typically the local variables that used to be on the stack, they get moved into the continuation structure by the lambda lifting. |
10:54:17 | alehander92 | ok |
10:54:32 | * | lritter quit (Quit: Leaving) |
10:54:33 | Zevv | The classical CPS approach uses tail calls to go to the next step, but in practice this usually uses trampolines. You don't call the next guy, but you return the address of the next guy. |
10:54:35 | * | dadada__ quit (Ping timeout: 256 seconds) |
10:54:43 | Zevv | The trampoline does "while c: c = c.fn(c.data)" |
10:55:30 | Zevv | that will run until there is nothing more to run. Either your program is done, or the continuations are waiting to be called later by an event queue when a timer expires or a socket is ready |
10:55:58 | Zevv | Also a *very* cool thing is that these continuations could be run on another thread - real thread - if you want. |
10:56:22 | Zevv | So you can make a continuation with a real blocking system call, throw it in a thread pool, and move it back into your own trampoline when it is done. |
10:57:19 | Zevv | anyway, that should conclude my ramblings for now, lunchy time! |
10:57:21 | alehander92 | :) |
10:57:27 | alehander92 | i will try to write down cps |
10:57:31 | alehander92 | without understanding ! |
10:57:44 | Zevv | haha :) |
10:57:57 | alehander92 | but i will |
10:58:05 | alehander92 | try to understand the examples |
10:58:07 | alehander92 | and think |
10:58:08 | alehander92 | oook |
10:58:34 | alehander92 | are there other languages |
10:58:41 | Zevv | The biggest problem is that one of this steps is done be inserting gotos and then moving the goto labeled blocks into procs. That's not something that can be easily represented with NimNodes, so I'm kind of stuck on how to do that part. |
10:58:43 | alehander92 | which do it in the same way? there should be many i guess |
10:58:52 | Zevv | Yeah, haskell, ocaml, all the nerdy ones |
10:58:54 | alehander92 | what i mean is, is there something very unusual about this setup |
10:58:58 | alehander92 | ah nerd stuff |
10:59:10 | Zevv | it's very functional |
10:59:20 | Zevv | and not common in imperative languages |
10:59:59 | Zevv | also I think it's just one of those things that does not make sense for mortals. It live in the same dimension as Y-combinators and monads |
11:00:24 | * | dadada joined #nim |
11:00:53 | * | dadada is now known as Guest13878 |
11:01:01 | alehander92 | ok |
11:03:44 | Zevv | araq started this byw, so blame him |
11:08:59 | * | aeverr_ quit (Quit: Konversation terminated!) |
11:09:16 | * | aeverr_ joined #nim |
11:09:21 | * | aeverr_ is now known as aeverr |
11:11:16 | * | Guest13878 quit (Ping timeout: 258 seconds) |
11:12:47 | * | dadada__ joined #nim |
11:15:47 | * | Trustable quit (Remote host closed the connection) |
11:23:57 | FromGitter | <mratsim> @Zevv: https://github.com/zevv/nimcsp#converting-gotos-to-nested-procs |
11:24:00 | FromGitter | <mratsim> This is not true |
11:24:07 | FromGitter | <mratsim> you have access to gotos in Nim |
11:24:26 | Zevv | {.emit.:"goto foo".} ? |
11:24:53 | FromGitter | <mratsim> No |
11:25:00 | Zevv | my point also was that these goto's are not really needed - they are a intermediate step for the transformation only |
11:25:11 | FromGitter | <mratsim> Run synthesis example state machine with -d:debugSynthesis - https://github.com/mratsim/Synthesis/blob/master/synthesis/factory.nim#L425 |
11:25:39 | FromGitter | <mratsim> basically "var myEnum {.goto.}: MyEnum" |
11:26:00 | Zevv | oh right - I forgot about those. I played with those for npeg once, but could not get them to do what I needed. In the end I just use a computerGoto case in a loop, which gets totally compiled away at the C level. |
11:26:03 | FromGitter | <mratsim> and when you assign a new enum value to "myEnum" it goes to that part of the "switch" statement |
11:26:55 | Zevv | I'll have to look into these again one day. But then again, it's tied to the switch right? Which doesn't allow the kind of goto's needed in the transformation, which goes in and out blocks and scopes |
11:27:01 | FromGitter | <mratsim> you can compile this to study the Nim code generated: https://github.com/mratsim/Synthesis/blob/master/examples/water_phase_transitions.nim |
11:27:27 | Zevv | yeah, I've studied that, its funny how it resembles npeg |
11:27:28 | FromGitter | <mratsim> if the switch is the "main" top level thing it can |
11:27:43 | FromGitter | <mratsim> well you need state machines to implement a parser ;) |
11:27:49 | Zevv | true, that |
11:28:50 | FromGitter | <mratsim> now, we probably want this to work in JS (do we?) so I'm not sure we can make goto work like that there but I might be wrong |
11:29:11 | Zevv | no, but see above: the goto's are merely virtual |
11:29:31 | Zevv | they are used as an intermediate step in the transformation as it is described in the docs Araq pointed me to. |
11:30:01 | Zevv | But in the step right after, all goto label blocks are changed into procs and the goto's go away |
11:30:09 | FromGitter | <mratsim> okay |
11:30:12 | alehander92 | mratsim is the guy ! |
11:30:19 | alehander92 | otherwise yeah |
11:30:21 | Zevv | sure, tell me about it |
11:30:29 | alehander92 | one can simulate those with other nodes i think |
11:30:32 | alehander92 | if its just temp |
11:30:44 | Zevv | you don't have to represent them in-tree I guess |
11:31:02 | Zevv | you can just make notes in your own administration telling "here is a goto" and "here is a destination" |
11:31:03 | FromGitter | <mratsim> I don't mind having an in-tree representation |
11:31:06 | Zevv | and pick up the SAT from there |
11:31:08 | Zevv | AST |
11:31:28 | FromGitter | <mratsim> Tasks can be represented as continuation |
11:31:36 | Zevv | that's the whole point |
11:31:54 | Zevv | that's where this should go. |
11:32:05 | FromGitter | <mratsim> If those stuff can be saved on the heap with a custom allocator that may be used in Weave |
11:32:25 | Zevv | it absolutely makes sense to snuggle with Weave if this will work |
11:33:08 | FromGitter | <mratsim> basically ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ed2447427513a72fbc17232] |
11:33:40 | Zevv | right |
11:33:41 | FromGitter | <mratsim> Executormetadata can be async or multithreading specific |
11:33:49 | FromGitter | <mratsim> or simple threadpool |
11:34:29 | Zevv | it should be possible to mix and match. You can offload a task to a threadpool if it will do blocking things, and adopt it back in another thread when it is completed. |
11:34:30 | alehander92 | i think |
11:34:33 | alehander92 | you should use |
11:34:37 | alehander92 | a simple seq |
11:34:42 | alehander92 | or something |
11:34:56 | FromGitter | <mratsim> for what? |
11:36:00 | alehander92 | the |
11:36:06 | alehander92 | virtual goto stuff in macros sorry |
11:36:39 | FromGitter | <mratsim> ah, well I don't really care what is used at compile-time as long as it doesn't increase compile-time too much |
11:36:40 | alehander92 | ok, the custom allocator thing: is it a part of meta |
11:36:49 | FromGitter | <mratsim> no |
11:36:58 | FromGitter | <mratsim> it's for the ptr object |
11:37:07 | FromGitter | <mratsim> but we might want to make it a simple object |
11:37:34 | FromGitter | <mratsim> Memory allocation is the overhead bottleneck in Weave and Rust AsyncIO |
11:37:38 | Zevv | first make something work, optimize later :) |
11:37:53 | alehander92 | yeah i see |
11:38:05 | alehander92 | so about the stack and variables |
11:38:06 | FromGitter | <mratsim> I solved it by having a memory pool to handle my channels/futures/flowvar and my Task allocations |
11:38:35 | FromGitter | <mratsim> Rust solved it by making the Task an "inline" field of their Future implementation |
11:38:38 | alehander92 | one thing i dont get is : i can pass them to another thread because the 'stack' would be replaced by heap values / structs |
11:38:44 | FromGitter | <mratsim> so they only allocate once instead of 2 |
11:38:49 | alehander92 | can this somehow be applied for process-es too |
11:39:02 | alehander92 | yeah a custom allocator would make sense |
11:39:05 | FromGitter | <mratsim> you should use sockets to share between processes |
11:39:15 | alehander92 | ok, so one copies between them |
11:39:25 | alehander92 | yeah thats probably inevitable |
11:39:32 | alehander92 | but we can use mmap right ? |
11:39:37 | Zevv | don't go there |
11:39:43 | alehander92 | if we are sure that *some* values are read-only or something |
11:39:45 | FromGitter | <mratsim> but mmap is POSIX only |
11:39:57 | alehander92 | well yeah, but it can still be a valid optimization |
11:40:20 | alehander92 | it seems windows does have |
11:40:24 | alehander92 | something similar |
11:40:27 | FromGitter | <mratsim> mmm sure but I think this goes beyond the scope of Nim stdlib |
11:40:45 | alehander92 | but maybe such a file |
11:40:59 | FromGitter | <mratsim> I expect if you share huge chunk of data between processes it would be a read-only file on disk or via a DB |
11:41:02 | alehander92 | mratsim yeah, probably |
11:41:25 | alehander92 | but this can be slower |
11:41:33 | alehander92 | i am thinking of stuff like parallel compilation |
11:41:36 | alehander92 | and similar |
11:41:44 | FromGitter | <mratsim> sure, but when you are concerned about sharing speed you use threads anyway not processes |
11:41:47 | alehander92 | where you might want to just share some shared trees/all kinds of objects |
11:41:59 | alehander92 | but with threads you dont get multicore parallelism |
11:42:07 | Zevv | sure you get |
11:42:13 | FromGitter | <mratsim> you get multithreading |
11:42:25 | FromGitter | <mratsim> it uses all my cores |
11:42:34 | alehander92 | hm, so can one do data parallelism |
11:43:03 | FromGitter | <mratsim> Run this demo, it will use all your cores: https://github.com/mratsim/weave/tree/master/demos/raytracing |
11:44:21 | alehander92 | hm ok |
11:44:43 | alehander92 | i also used `||` and openmp |
11:44:48 | alehander92 | i just didnt realize how it works |
11:44:48 | FromGitter | <mratsim> For me, processes are used to isolate memory addresses |
11:44:50 | alehander92 | internally |
11:44:56 | * | xet7 quit (Remote host closed the connection) |
11:45:11 | FromGitter | <mratsim> it transforms the inner "for" scope into a closure |
11:45:19 | FromGitter | <mratsim> that captures all the variables used inside |
11:45:20 | alehander92 | i know weave is different! |
11:45:34 | FromGitter | <mratsim> Weave really does the same when you call "parallelFor" |
11:45:42 | FromGitter | <mratsim> except that the capturing is explicit |
11:45:46 | alehander92 | i see |
11:45:50 | FromGitter | <mratsim> what is different is the load balancing |
11:45:55 | alehander92 | ok, sorry for the offtopic |
11:46:44 | alehander92 | so about the |
11:46:46 | alehander92 | macro |
11:47:44 | alehander92 | one can mostly generate a PNode with calls |
11:47:48 | alehander92 | directly zevv |
11:47:55 | alehander92 | i dont see why you should generate goto-s |
11:48:02 | alehander92 | if you just replace them with equivalent calls anyway |
11:48:32 | alehander92 | just you generate a call<n> instead of goto n |
11:48:34 | alehander92 | etc |
11:52:40 | Zevv | right that was my point |
11:52:54 | Zevv | its just a trick to illustrate the transform in the paper |
11:53:28 | Zevv | the problem is that you cant "just generate a call" because you dont know what goes into what proc until youre done |
11:53:43 | Zevv | the gotos are just markers to see where you need tp cut your cake |
11:54:15 | Zevv | but you need to be done cutting before you can wrap them up in procs |
11:54:34 | alehander92 | then the variables no |
11:54:39 | Zevv | thats why I mentioned just making out-of-tree notes of your calls and your targets |
11:54:40 | alehander92 | ops |
11:54:44 | alehander92 | maybe |
11:54:47 | alehander92 | but why do you need it |
11:54:50 | alehander92 | my understanding is that |
11:55:16 | alehander92 | if you a while/if: you put a label |
11:55:30 | alehander92 | so you just start a new procedure with the branch/block anyway instead |
11:55:35 | alehander92 | and add a call before that |
11:56:30 | alehander92 | if you have a jump(e.g.cps/ break/continue/return etc) you put a goto |
11:58:08 | alehander92 | sorry |
11:58:13 | alehander92 | maybe this doesnt make sense |
11:58:19 | alehander92 | but i think we can try |
11:58:29 | alehander92 | otherwise one can always do what you say of course |
11:59:29 | alehander92 | and you guys are right: one can still just use a seq of indices+goto/label annoation or |
11:59:57 | alehander92 | even a NimNode with `:cps_reserved_goto` |
12:00:06 | alehander92 | or something which shouldn't clash |
12:00:59 | Zevv | sure |
12:05:02 | alehander92 | <3 |
12:05:15 | alehander92 | so i guess you would do that |
12:05:23 | alehander92 | i can work on the macro debugging |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:43 | * | supakeen joined #nim |
12:14:43 | Araq | Zevv: please make fn*: proc(c: Cont): Cont to be {.nimcall.} so that no hidden state can be accidentically introduced |
12:14:53 | Zevv | good point |
12:15:28 | Zevv | how do you feel about inheriting from Const and genereting a little prelude that takes out the locals, for now |
12:15:44 | Zevv | I expect that will get optimized away mostly, and if not, we can do that later |
12:16:03 | Zevv | /from Cont/ |
12:16:44 | Zevv | that saves me from messing with marshalling for now |
12:16:59 | Zevv | and continuations just go on the heap for now as well, I dont care |
12:18:24 | alehander92 | so |
12:18:29 | alehander92 | how would exceptions work? |
12:19:02 | FromDiscord | <Clyybber> lets ignore them for now :p |
12:19:04 | alehander92 | one would always pass two paths? one with next function and one with last catch |
12:19:09 | alehander92 | except* |
12:19:27 | alehander92 | so one can directly continue to the nearest except instead of going back through each frame |
12:19:49 | alehander92 | this can make conditins possible |
12:19:54 | alehander92 | e.g. restart parse |
12:20:12 | alehander92 | where you jump to a particular checkpoint up in the algorithms |
12:20:24 | Araq | alehander92: that's one solution, the proc simply takes 2 continuations, one for the happy path, one for the error path |
12:21:04 | FromDiscord | <exelotl> Zevv: will it be zero allocation / work on embedded? i.e. would I be able to use it as a replacement for https://github.com/exelotl/ecolo |
12:21:29 | alehander92 | awesome |
12:21:37 | alehander92 | so i read on a ocaml forum about the happy/error path |
12:21:45 | * | luis_ joined #nim |
12:21:53 | alehander92 | but would the restart idea |
12:21:55 | alehander92 | make sense |
12:22:09 | alehander92 | (basically a port of the common lisp concept) |
12:23:30 | Araq | exelotl: well the point is to avoid the stack, so the cont would be on the heap, but ideally we regain control over the allocations and you can pool them |
12:23:50 | FromDiscord | <Recruit_main707> `x := &BoostPadState{}` this code in go, would be transpiled to nim as: `cast[ptr BoostpadState](alloc(sizeof(BoostpadState)))` ? or the gc will hande this in other easier way |
12:24:29 | Araq | sounds more like 'x = new BoostPadState' |
12:25:16 | FromDiscord | <Recruit_main707> so id rather use refs instead of ptrs? |
12:25:53 | FromDiscord | <Recruit_main707> this code will *hopefully* be automatically generated, so i want it to be fast rather than elegant |
12:26:31 | Araq | refs are fine for performance |
12:27:05 | FromDiscord | <Recruit_main707> ok, thank you |
12:28:53 | Zevv | exelotl: I have no clue how and where this will or will not work. I'm just starting to understand the problem domain |
12:29:31 | Zevv | I do *feel* though, that with the absence of stacks, some other form of non-linear memory needs to be provided. That sounds like a heap or pools to me. |
12:30:04 | Zevv | wait, what, ecolo |
12:30:40 | FromDiscord | <exelotl> Haha that's fair |
12:31:05 | Zevv | I'll have to see what's under the hood of ecolo - seems its at least partially doing what I'm trying to do |
12:33:39 | FromDiscord | <exelotl> ecolo only works with a few constructs (if, while), and you can only yield from the main script body |
12:34:13 | FromDiscord | <exelotl> but its good enough for writinf dialogue scripts in my GBA game :) |
12:34:29 | FromDiscord | <exelotl> *writing |
12:36:10 | FromDiscord | <exelotl> It's a pretty brute force approach, not based on any papers or formal technique |
12:37:31 | Zevv | I'm never feel hindered by my lack of formal techniques. Although I did found out by now that if I really want to get something done, I usually *do* need to get into the formal techniques first. |
12:37:40 | Zevv | it's a pain in the behind. |
12:53:29 | alehander92 | hmm |
12:53:36 | alehander92 | i feel similarly often |
12:53:53 | alehander92 | but i do want to get a bit better |
12:54:04 | Zevv | nah, I'm over that |
12:54:07 | alehander92 | it seem that those guys researched many problems that one clashes with |
12:54:23 | Zevv | I just do as I like and enjoy the moment |
12:54:29 | alehander92 | yeah thats also good |
12:55:59 | zacharycarter | https://github.com/zacharycarter/frag/blob/master/src/fiber.nim |
12:56:10 | zacharycarter | basic building blocks for coroutines |
12:56:16 | zacharycarter | for posix anyway |
12:56:35 | zacharycarter | which will work in a multithreaded env |
12:56:57 | Araq | fibers take up more memory and are less portable than what Zevv is working on |
12:56:59 | Zevv | yeah, I looked at that as well. But it is all heavy and non portable |
12:57:03 | zacharycarter | ah |
12:57:32 | zacharycarter | well, eager to see what you come up with :) |
12:57:34 | Araq | and Zevv's stuff is based on formal methods even though he denies it :P |
12:57:51 | Zevv | says the guy who bought the book |
12:58:23 | Araq | I also read it |
12:58:32 | zacharycarter | which book? |
12:58:53 | Araq | https://www.amazon.de/Compiling-Continuations-Andrew-W-Appel/dp/052103311X |
12:58:56 | zacharycarter | thanks |
12:59:12 | zacharycarter | ohhh so work is starting to be done on that white paper? |
12:59:43 | zacharycarter | that one disruptek was going nuts over a few weekeneds ago |
13:00:04 | Zevv | I don't know. I just whined again about not having the flavour of coroutines I prefer, and then this happened |
13:00:07 | Zevv | what paper is that? |
13:00:15 | zacharycarter | let me try to find it |
13:00:32 | Araq | Zevv: the one you already know |
13:00:39 | Zevv | ah ok, cool |
13:01:21 | Zevv | dang, my repo is even named wrong. It should be nimcps, not nimcsp, haha |
13:01:22 | zacharycarter | good I don't have to find it :P I was struggling |
13:02:26 | leorize | oh, Zevv invented yet another cool thing? |
13:02:30 | leorize | !repo nimcsp |
13:02:30 | disbot | https://github.com/zevv/nimcsp -- 9nimcsp: 11Nim CPS (Continuation Passing Style) experiments 15 10⭐ 0🍴 |
13:03:35 | Zevv | its just toying around really |
13:04:27 | zacharycarter | I think it's pretty easy to rename github repos now |
13:04:29 | zacharycarter | :P |
13:04:32 | leorize | technically you can imitate goto in Nim :P |
13:04:45 | Zevv | I'll rename i if it works |
13:04:47 | leorize | named blocks and break are useful for this |
13:04:54 | Zevv | leorize: the goto's are a hoax. |
13:05:08 | Zevv | they're not really there |
13:08:53 | * | luis_ quit (Quit: luis_) |
13:09:23 | alehander92 | https://github.com/zacps/blocked |
13:09:27 | alehander92 | very smart! |
13:09:52 | alehander92 | one can do this idea for similar ct langs like nim/zig/d probably |
13:10:10 | alehander92 | i guess also a bit "come on people do this" but its a cool example |
13:12:18 | Araq | you can also accept the fact that compilers still lack the AI technology and some bugs are found by testing |
13:13:58 | * | luis_ joined #nim |
13:15:27 | alehander92 | :) |
13:15:34 | alehander92 | that's true! |
13:15:43 | alehander92 | which reminds me to try the vm thing |
13:16:22 | Araq | and sometimes performance problems are found by profiling. but it's not as much fun as thinking over type and effect system extensions which we don't base on solid computer science and we then we don't prove correct |
13:17:06 | alehander92 | that's true |
13:17:15 | alehander92 | but after all, we know profiling works |
13:17:33 | alehander92 | searching for alternative ways to check things is not always bad |
13:18:03 | Zevv | "prove correct", like on page 28 and on in "the paper" |
13:19:04 | Zevv | I printed the paper, took out those pages and use the backside for notes, and one for making a paper plane. Much more fun. |
13:19:40 | Zevv | I know lambdas, but you can keep the lemmas |
13:20:30 | Araq | alehander92: I prefer "re-search" over "search" |
13:20:57 | Zevv | I prefer "re-creation" over "creation" |
13:21:53 | FromGitter | <sheerluck> I like mashups |
13:23:01 | Zevv | what kind of mashups |
13:25:26 | Araq | Zevv: you don't have to read the proof but without it I wouldn't have considered their approach |
13:26:10 | Araq | as we already have enough unsound stuff in Nim |
13:26:12 | Araq | ;-) |
13:27:01 | alehander92 | Araq sorry, prooving and soundness are much better indeed! |
13:27:10 | Zevv | I feel the same about these things. I'm glad other peoples spent months or years of their lives making sure everthing is provable so I can just use it. |
13:27:31 | Zevv | Just as the whole PEG thing. In the end I only learned all the details after implementing, but it is nice to know that someone else made sure it actually works |
13:27:47 | * | crem quit (Ping timeout: 240 seconds) |
13:29:43 | Araq | does it though? how do you handle left-recursive rules? |
13:30:38 | Zevv | By spinning forever and burning your precious CPU cycles until the world comes to an end |
13:30:44 | Araq | nah it's ok, you can detect them and produce an error message |
13:30:58 | Zevv | I do detect some of them. Others I just added to the doc as "don't do that" |
13:31:23 | Zevv | and of course there's pratt precedence in there these days, which helps out for most practical reasons |
13:31:58 | Araq | fair enough, most important is that you're aware |
13:32:14 | Zevv | I am very aware :) |
13:32:28 | Zevv | would be kind of a shame if I weren't by now, right |
13:33:10 | FromDiscord | <mratsim> mmmh there is no codegenDecl for type section?↵↵I want to define a vector type as "VecIntrin[N: static int, T: SomeNumber] {.codegenDecl: "$# __attribute__ ((vector_size (16)))".} = object" |
13:34:12 | leorize | I guess you will have to walkaround this via {.emit.} then importc :P |
13:34:20 | FromDiscord | <mratsim> meeeh |
13:34:23 | zacharycarter | now both mratsim and I have wanted this feature |
13:34:49 | zacharycarter | the emit / importc solution isn't a goo done |
13:34:50 | Araq | and *now* I'm listening :P |
13:35:16 | zacharycarter | I just makes sense - if we're compiling to C code we should be able to influence the codegen for type defs |
13:35:20 | FromDiscord | <mratsim> https://github.com/numforge/laser/blob/master/benchmarks/vector_math/vector_extension.nim#L2 |
13:35:21 | zacharycarter | it* |
13:36:08 | FromDiscord | <mratsim> bonus point if the 32 and the 8 in the Float32x8 name can be interpolated from static int and the typedesc without forcing C++ compilation mode |
13:36:18 | FromDiscord | <mratsim> sott the FLoat32* |
13:36:23 | FromDiscord | <mratsim> sorry the float32* |
13:39:33 | Araq | Zevv: speaking of exceptions, they are very important indeed, you need the same mechanism for timeouts. in fact, timeouts and cancellation should be baked into the design from that start |
13:40:59 | alehander92 | yeah |
13:41:00 | Zevv | Well, I was hoping to get the basic contiuation stuff separate from things like timouts and events. It seems to me that it is a building block that can be used in tons of things, and not only in event loops. That's tier 2 |
13:41:04 | alehander92 | i wanted to ask about cancellation |
13:41:14 | alehander92 | but i thought its mostly an async thing |
13:41:29 | Zevv | cancellation is a matter of aborting the trampoline, not calling the next continuation |
13:41:38 | Zevv | and *poof* it's gone |
13:41:41 | alehander92 | until the cancellation site |
13:41:49 | alehander92 | its similar to an exception maybe |
13:42:05 | Zevv | but when talking timouts, you already imply things like event loops and schedulers |
13:42:23 | Zevv | but you can also build iterators out of this stuff, and then you don't timeout or cancel |
13:42:27 | leorize | I think once you got cancellation working timeout can be trivially implemented :P |
13:42:29 | Zevv | well, you might cancel |
13:42:38 | Araq | Zevv: good point but you may need to close sockets on cancel |
13:42:52 | alehander92 | shouldn't this stuff work even on bare metal |
13:43:07 | alehander92 | so event loops/timeout should be somehow configurable at least |
13:43:08 | Zevv | Araq: all the hard work put in finalizers, and still *I* need to close sockets |
13:43:25 | Araq | well maybe not |
13:43:37 | Araq | we'll see |
13:43:47 | Zevv | alehander92: it should work anywhere, as far as I am concerned it is all about the transform into continuation form for now. The rest comes after that. |
13:44:01 | Araq | yup, that's the way |
13:44:20 | alehander92 | <3 |
13:44:21 | alehander92 | ok |
13:44:30 | FromDiscord | <mratsim> I wouldn't bake timeouts and cancellations into the design right away |
13:44:51 | Zevv | I was afraid this had to be done at the compiler level, so I was not even considering going there. But it might be able to work with macros as well |
13:44:52 | FromDiscord | <mratsim> it makes sense for async but not for multithreading for example |
13:45:00 | Zevv | mratsim: right |
13:45:05 | FromDiscord | <mratsim> second, it's a really really tricky part |
13:45:22 | FromDiscord | <mratsim> let me find you some Rust inner doc on their v0.3 futures |
13:45:59 | leorize | mratsim: after some experimentation I find threads to not cause as much of an overhead in I/O |
13:46:01 | alehander92 | did they get it right |
13:46:22 | leorize | in fact it can be faster than async |
13:46:26 | leorize | throughput-wise |
13:46:47 | leorize | spawning a ton of threads come with the cost of virtual memory though (at least on linux) |
13:47:00 | Araq | mratsim: as I said, "baking it into the design right away" might amount to "ok, it actually takes two continuations" |
13:47:16 | Araq | not much of a burden |
13:48:00 | alehander92 | nope, i think threads should be reserved for explicit requests/syscalls/similar |
13:48:19 | alehander92 | other thing i am wondering is : can one somehow |
13:48:22 | alehander92 | stop the process |
13:48:26 | alehander92 | and resume it later |
13:48:34 | alehander92 | if one can save all the frames |
13:48:35 | alehander92 | on disk |
13:48:38 | FromDiscord | <mratsim> https://github.com/rust-lang/rfcs/blob/master/text/2592-futures.md#rationale-drawbacks-and-alternatives |
13:49:28 | FromDiscord | <mratsim> In particular↵> What seems to be perhaps new with this RFC is the idea of melding the "trampoline" technique with an explicit, open-ended task/wakeup model. |
13:50:00 | FromDiscord | <mratsim> i.e. we might be able to extend Rust async model with continuations |
13:50:54 | FromDiscord | <mratsim> The trick seems to be in the poll method implemented that all futures: https://aturon.github.io/tech/2016/09/07/futures-design/ |
13:51:02 | FromDiscord | <mratsim> that is an alternative to callbacks |
13:51:23 | FromDiscord | <mratsim> > In the demand-driven model, cancellation largely “falls out”. All you have to do is stop polling the future, instead “dropping” it (Rust’s term for destroying the data). And doing so is usually a natural consequence of nested state machines like Join. Futures whose computation requires some special effort to cancel (such as canceling an RPC call) can provide this logic as part of their Drop implementation. |
13:52:52 | alehander92 | yeah i never really understood the Drop for cancelation concept before |
13:55:46 | * | bjornroberg joined #nim |
13:58:48 | FromDiscord | <mratsim> it's push vs pull |
13:59:21 | FromDiscord | <mratsim> you tell whatever holds the resource (future/socket/ ...) that you are not waiting anymore |
14:00:07 | alehander92 | i have to read more about it |
14:02:32 | * | NimBot joined #nim |
14:03:38 | FromDiscord | <mratsim> me too 😛 |
14:03:52 | FromDiscord | <mratsim> I completely killed the highlighter with emit https://media.discordapp.net/attachments/371759389889003532/716290784294338580/unknown.png |
14:11:53 | Araq | mratsim: the problem with the state machine model is that you have 2 dispatch ops, one indirect call for the function handler and inside the function a 'case state of' construct |
14:12:37 | Araq | and with continuations you only have one dispatch operation |
14:13:31 | Araq | that seems to be the biggest difference, the rest that Rust does amounts to allocation merging which I think we can do too. I hope |
14:14:46 | Araq | for example in C++ you can use a "small string optimization" for std::function |
14:15:18 | Araq | I think we can do the same for our Cont |
14:16:28 | FromDiscord | <dom96> So there is really only 1 day until the deadline for NimConf submissions: https://nim-lang.org/blog/2020/05/14/nim-conference.html |
14:16:40 | FromDiscord | <dom96> Everyone submitted their talks? |
14:20:07 | alehander92 | ooo |
14:22:15 | FromGitter | <alehander92> praise the Lord, it finally worked |
14:22:46 | FromGitter | <alehander92> so my nimvm debugger already gives me breakpoints and next-s and stuff |
14:23:17 | FromDiscord | <Recruit_main707> nice |
14:23:22 | FromGitter | <alehander92> i should add source rendering + locals introspection + some kind of eval |
14:24:04 | FromGitter | <alehander92> and callstack |
14:27:04 | FromDiscord | <Recruit_main707> if i create a function by writing its ast in a macro, it can then be used as if it was manually written? |
14:27:43 | FromDiscord | <Rika> i dont see why not |
14:28:05 | FromDiscord | <Rika> theres no real distinction between a handwritten proc and a macro written proc ain there |
14:28:09 | * | crem joined #nim |
14:28:14 | FromDiscord | <Recruit_main707> ok |
14:28:44 | FromDiscord | <Recruit_main707> it could be interesting to write the flatc-nim tool w/ macros then |
14:41:44 | FromGitter | <dawkot> is it safe to ignore gcsafe warnings in asynchttpserver and asynchttpbeast? |
14:46:57 | FromGitter | <dawkot> Also why can't I silence it |
14:46:58 | FromGitter | <dawkot> `````` |
14:47:01 | FromGitter | <dawkot> ```invalid pragma: hint[GcUnsafe2]: off``` |
14:53:47 | * | Vladar joined #nim |
14:59:32 | Araq | isn't it warning[X]:off ? |
15:08:58 | * | luis_ quit (Quit: luis_) |
15:13:08 | FromDiscord | <mratsim> doesn't really work: https://github.com/nim-lang/Nim/issues/4044 |
15:13:11 | disbot | ➥ {.push hint[XDeclaredButNotUsed]: off.} is not working ; snippet at 12https://play.nim-lang.org/#ix=2nP4 |
15:13:17 | FromDiscord | <mratsim> this has a workaround but no true fix |
15:13:48 | FromDiscord | <mratsim> https://github.com/nim-lang/Nim/issues/11826 |
15:13:50 | disbot | ➥ {.warning[XXX]: off.} doesn't work ; snippet at 12https://play.nim-lang.org/#ix=2nP5 |
15:13:59 | * | luis_ joined #nim |
15:18:42 | FromDiscord | <mratsim> sent a long message, see https://discordapp.com/channels/371759389889003530/371759389889003532/716309618346688572 |
15:27:43 | FromGitter | <dawkot> Araq, you're right |
15:28:09 | FromGitter | <dawkot> ```pragma: hint[GcUnsafe2]: off``` seems to be working |
15:28:21 | FromGitter | <dawkot> I mean, ```{.push warning[GcUnsafe2]: off.}``` |
15:29:28 | FromGitter | <dawkot> Still, is it safe? |
15:29:34 | FromGitter | <dawkot> in the case of asynhttpbeast |
15:32:40 | Araq | probably not |
15:32:50 | * | rockcavera quit (Remote host closed the connection) |
15:38:07 | FromGitter | <dawkot> Jester doesn't show this warning though, I wonder why |
15:58:41 | dadada__ | hello ladies and gents |
15:58:47 | * | dadada__ is now known as dadada |
16:00:23 | FromDiscord | <Rika> hello fake (xd) dadada |
16:01:23 | dadada | I tried to optimize the type for a 255 color setting by making it uint8, the result was a lot of ugly code, because I needed to cast it for different abs() and toHex() operations ... in the end with all those casts I'm not sure there's any net positive... by just using int the code becomes simpler |
16:01:41 | dadada | but I might waste some memory, ... |
16:02:07 | FromDiscord | <Rika> theres a color module |
16:02:18 | FromDiscord | <Rika> https://nim-lang.org/docs/colors.html |
16:02:53 | FromDiscord | <Rika> unless you're instantiating billions of these, you're prematurely optimizing |
16:03:47 | dadada | Rika: no, only about 255 * 3 |
16:04:07 | FromDiscord | <Rika> and where are you running this program |
16:04:16 | FromDiscord | <Rika> on a computer with kbs of ram? |
16:04:19 | dadada | Rika: in my living room :D why do you care :D |
16:04:38 | FromDiscord | <Rika> thats not what i mean lmao |
16:04:43 | dadada | I know lmao |
16:05:12 | dadada | Rika: my computer has a whopping 16gb of RAM, not bragging :D |
16:06:25 | FromDiscord | <Rika> so why are you worried about 3 bytes of ram per color |
16:06:26 | dadada | it could make a difference on an embedded device, but only a little one :D |
16:06:38 | * | filcuc joined #nim |
16:07:03 | dadada | Rika: well, moe wants to replace vi/vim, and they run on embedded devices, too, rightß |
16:07:06 | dadada | ? |
16:07:10 | dadada | :D I probably worry too much |
16:07:29 | FromDiscord | <Rika> yeah and 3 bytes aint much is it |
16:07:41 | FromDiscord | <Rika> how many colors are you using anyway |
16:07:46 | dadada | 255 |
16:07:52 | FromDiscord | <Rika> worry about it when you get to it |
16:07:59 | FromDiscord | <Rika> when you encounter issues |
16:08:44 | FromDiscord | <Rika> theres prolly some fine line you balance on whether to "solve problems as they come" and "solve problems before they happen" |
16:15:34 | * | luis_ quit (Read error: Connection reset by peer) |
16:17:44 | * | filcuc quit (Ping timeout: 272 seconds) |
16:37:49 | dadada | Rika: true, I think I should solve them before they happen, but this is at the cost of time I could do other things with |
16:39:13 | FromDiscord | <Rika> as i said, theres a balance |
16:39:35 | FromDiscord | <Rika> if the cost is too big then i guess solve it when it happens |
16:46:22 | * | clyybber joined #nim |
16:53:32 | * | clyybber quit (Quit: WeeChat 2.8) |
16:54:23 | * | clyybber joined #nim |
17:02:45 | * | natrys joined #nim |
17:06:15 | * | sschwarzer joined #nim |
17:13:51 | FromDiscord | <Recruit_main707> after trying a few things i am starting to see some errors with my flatbuffers, fixing a lot and no big issues luckily |
17:30:36 | Prestige | Is there a way to have a proc declared with an optional argument, or should I just use a default value? |
17:30:42 | FromDiscord | <codic> can i extract a tar.xz in nim? i want to iterate over each file in archive and only extract it if a certain condition is true |
17:31:05 | FromDiscord | <codic> Prestige: why not just accept a table |
17:31:15 | FromDiscord | <codic> but that'd be kinda messy |
17:31:17 | Prestige | a table? |
17:31:23 | FromDiscord | <Recruit_main707> im commiting changes, everyting should be ok now |
17:31:39 | FromDiscord | <codic> yeah, a table |
17:32:42 | Prestige | Maybe my wording was unclear - In this particular case I'm wanting this proc to have a string as a param, but the caller of the function could either pass in a string or have the parens be empty like myFunc("something") or myFunc() |
17:32:49 | Prestige | I suppose a default value is fine |
17:33:05 | FromDiscord | <Rika> Prestige: proc overloading |
17:33:20 | FromDiscord | <codic> ah, then a default value should be fine |
17:33:24 | FromDiscord | <Rika> you can just remove the argument in the other proc w/ same name |
17:33:27 | Prestige | Yeah thought about that too but is probably more trouble that a default val |
17:33:29 | * | konvertex quit (Quit: quit) |
17:33:37 | Prestige | than a* |
17:33:43 | FromDiscord | <Rika> depends on the use case i guess |
17:33:52 | Prestige | True |
17:34:02 | FromDiscord | <codic> ok so time to reask: can i extract a tar.xz in nim? i want to iterate over each file in archive and only extract it if a certain condition is true |
17:34:41 | FromDiscord | <Rika> with an archive library sure |
17:35:02 | Prestige | If there are no libs for it, you could just call `tar` with startProcess or similar |
17:36:09 | zacharycarter | or just bind to some C library that can do it |
17:38:57 | sschwarzer | Prestige: I think it depends on whether there's a _sensible_ default value. |
17:40:21 | sschwarzer | Prestige: That is, not a default value you only come up with to make the argument optional. It shouldn't feel forced. |
17:40:37 | * | narimiran joined #nim |
17:42:15 | * | filcuc joined #nim |
17:45:05 | * | chemist69 quit (Ping timeout: 265 seconds) |
17:45:28 | * | chemist69 joined #nim |
17:48:02 | leorize[m] | @codic: use nimarchive |
17:48:09 | leorize[m] | !repo nimarchive |
17:48:11 | disbot | https://github.com/genotrance/nimarchive -- 9nimarchive: 11libarchive wrapper for Nim 15 11⭐ 0🍴 |
17:51:37 | Zevv | Hey, did Nim ever get this magical float2string implementation integrated? |
17:52:31 | clyybber | Nope, it exists in our repos |
17:52:46 | clyybber | I think leorize has a reimplementation and I have a port |
17:53:10 | clyybber | And disrtupekt has something in between? |
17:54:05 | Zevv | Aw, too bad |
17:54:12 | Zevv | Why is this wrong: https://play.nim-lang.org/#ix=2nPI |
17:54:28 | Zevv | I am again missing something trivia; |
17:54:30 | Zevv | l |
17:55:55 | Zevv | it goes away when I use 'untyped' in the macro |
17:57:26 | leorize[m] | well if you ever want to work on ryu, look at go |
17:57:28 | disruptek | give your macro a return value. |
17:58:16 | leorize[m] | they're doing some pretty nice reimplementation work with a lot of analysis |
17:58:22 | leorize[m] | we can learn a few things or two from them |
17:58:38 | disruptek | why don't you port it if you aren't going to continue your impl? |
17:59:11 | disruptek | !repo yourang |
17:59:12 | disbot | https://github.com/disruptek/yourang -- 9yourang: 11Thread-safe performant async I/O for Linux 15 6⭐ 0🍴 |
17:59:23 | disruptek | Zevv: for your cps i/o benchmarks. |
17:59:35 | disruptek | mostly unimplemented, of course. |
18:01:26 | * | Vladar quit (Quit: Leaving) |
18:01:37 | * | filcuc quit (Ping timeout: 246 seconds) |
18:03:33 | FromDiscord | <codic> does nimarchive support this?↵> i want to iterate over each file in archive and only extract it if a certain condition is true |
18:04:11 | FromDiscord | <codic> and tar with startprocess is what im doing rn but for the above, i need to scrape the text, and the output could change at any time, which would actually literally wipe the whole system |
18:20:46 | Zevv | disruptek: much appreciated |
18:20:50 | Zevv | but for now there is only hurt |
18:20:52 | Zevv | it hurts so much |
18:21:22 | disruptek | c'mon, it's not that hard. |
18:21:29 | Zevv | dude |
18:21:57 | Zevv | I did make My First Transform just now, tho |
18:22:02 | Zevv | with cheating on the lambda lifting |
18:22:40 | clyybber | there can be no progress without struggle |
18:23:23 | clyybber | if you struggle hard, you'll progress hard :D |
18:23:34 | * | fredrikhr quit (Ping timeout: 265 seconds) |
18:24:40 | Zevv | sure, sure |
18:24:43 | Zevv | but still |
18:25:13 | Zevv | I wonder how this happend. My plan was to complain so the nice coroutines would just appear by magic |
18:25:23 | disruptek | i thought all you have to do is write a macro. |
18:25:34 | Zevv | true, true |
18:25:41 | Zevv | on it! |
18:25:52 | Zevv | https://github.com/zevv/nimcsp/blob/master/xfrm.nim |
18:26:48 | disruptek | it'll be one of three things that make nim the language to beat. |
18:26:58 | Zevv | the others being? |
18:27:06 | disruptek | shhh |
18:27:44 | Zevv | ˢˢˢʰ |
18:43:48 | * | dadada quit (Ping timeout: 256 seconds) |
18:45:27 | * | dadada joined #nim |
18:45:49 | * | dadada is now known as Guest31416 |
18:45:53 | FromDiscord | <Rika> so when are you renaming the repo to cps like it is on the readme |
18:45:54 | * | narimiran quit (Ping timeout: 240 seconds) |
18:46:19 | * | waleee-cl joined #nim |
18:57:56 | Zevv | when it works, not before |
18:58:01 | Zevv | the name is just as wrong as the code |
19:00:08 | Zevv | well well, I can run my first - absolutely trivial - tasks |
19:00:16 | * | narimiran joined #nim |
19:00:30 | Zevv | with some stuff hardcoded. I have no clue how to do lambda lifting yet |
19:01:07 | Zevv | T-00:21 |
19:09:38 | * | Guest31416 quit (Ping timeout: 256 seconds) |
19:10:30 | FromDiscord | <Intexisty> how would i make a constructor for my class |
19:11:12 | Zevv | There is no such thing in Nim - idiom is to make a `newThing(...): Thing` proc for that |
19:12:12 | FromGitter | <zetashift> I don't know much about concurrency except for dabbling with Elixir, what is the difference between nimcsp/coro and Weave? |
19:12:42 | Zevv | Weave is a thread pool implementation, mratsim style |
19:12:56 | Zevv | i.e.: 150% optimized and efficient |
19:13:31 | FromGitter | <zetashift> So Weave is like a runtime and you could say nimcsp is an implementation of how to (easily) program concurrently? |
19:13:37 | FromGitter | <zetashift> Everything mratsim style is :D |
19:14:23 | Zevv | nimcsp is just me toying around with some CS theories - the idea is that code can be transformed so it does exactly the same thing, but does not need a stack. |
19:14:36 | Zevv | Effectively it chops functions up in smaller pieces which get "chained" |
19:15:15 | Zevv | but you can play with the program flow and run snippets in any order, so tie it up to event queues, use it for "concurrent" code flow, or implement iterators |
19:15:28 | * | dadada__ joined #nim |
19:15:52 | * | zacharycarter quit (Ping timeout: 256 seconds) |
19:16:01 | Zevv | but I'm not sure if I will get there eventually, it's just an experiment |
19:16:09 | FromDiscord | <Intexisty> so can i just do |
19:16:16 | FromGitter | <zetashift> How is the chopping up of functions and chaining them not a stack with smaller elements? |
19:16:40 | FromDiscord | <Intexisty> ```nim↵method x_new(this: x) = ↵``` |
19:16:54 | FromDiscord | <Intexisty> wait no |
19:17:09 | FromDiscord | <KrispPurg> use proc |
19:17:15 | FromDiscord | <Recruit_main707> or func |
19:17:30 | Zevv | zetashift: the call flow and local variables do not go on the stack. These are stored in small objects ("continuations") which say "sometime in the future, call this function with these arguments" |
19:18:02 | Zevv | You can call them all in a row and then would run just as before the transform, but you could also run them in any order you like |
19:18:20 | Zevv | you could programmatically make custom program flow constructs without needing support from the language or compiler |
19:18:20 | FromDiscord | <Intexisty> i got it |
19:18:34 | FromDiscord | <Recruit_main707> sent a code paste, see http://ix.io/2nPY |
19:18:38 | FromDiscord | <Intexisty> ok |
19:19:43 | FromDiscord | <KrispPurg> I have never seen a constructor in Nim using func instead. |
19:20:04 | Zevv | well, it's not wrong :) |
19:20:16 | FromDiscord | <Rika> thats prolly because some people arent aware |
19:20:25 | FromDiscord | <Recruit_main707> if possible use func right? so i use func :) |
19:21:39 | FromDiscord | <KrispPurg> I like proc, but func is proc too. |
19:21:45 | sschwarzer | Is there a syntax to set a field in a object type definition to a default? I get "initialization not allowed here". It's not super-important because I can set the field in the `init...` proc, but I'm still curious if there is a syntax to define a default value. |
19:22:35 | FromDiscord | <Generic> there is none |
19:22:37 | FromDiscord | <Rika> no |
19:22:44 | FromDiscord | <Generic> though there has been some debate about this |
19:22:48 | FromDiscord | <Rika> use the init proc as much as possible, i guess |
19:22:59 | sschwarzer | Thanks everyone :) |
19:23:00 | Zevv | *BOOM* |
19:23:12 | FromDiscord | <Rika> though i think we should be able to override default(typedesc[AType]) |
19:23:48 | FromDiscord | <Generic> https://github.com/nim-lang/RFCs/issues/48 |
19:23:51 | disbot | ➥ [RFC] Another proposal for a standardized object construction/initialization. ; snippet at 12https://play.nim-lang.org/#ix=2nQ2 |
19:28:14 | FromGitter | <zetashift> I usually use func for those constructor type functions too |
19:37:48 | sschwarzer | Generic: The RFC seems to be stalled. :-/ |
19:38:03 | sschwarzer | zetashift: yes, why not :) |
19:38:32 | sschwarzer | zetashift: just looked at my code and saw that I also use `func` there. :) |
19:38:46 | sschwarzer | for the "constructors" |
19:39:27 | * | dadada__ quit (Ping timeout: 265 seconds) |
19:42:00 | sschwarzer | It looks there's no way to send private messages via the Nim forum software, right? (Not having this _may_ even be considered a feature to avoid spam, but still.) |
19:42:07 | Yardanico | sschwarzer: yeah |
19:45:27 | * | dadada joined #nim |
19:45:49 | * | haxscramper joined #nim |
19:45:50 | * | dadada is now known as Guest40129 |
19:47:13 | FromDiscord | <Generic> I have a pretty complex macro which produces almost C++ like compile times |
19:47:45 | FromDiscord | <Generic> should I cache it's result to file? |
19:48:18 | FromDiscord | <Rika> if it doesnt change often, yes |
19:48:28 | FromDiscord | <Generic> it doesn't change often |
19:48:31 | FromDiscord | <Rika> then delegate the "generation" to a define |
19:48:37 | FromDiscord | <Rika> like -d:generateXXXXXX |
19:48:39 | FromDiscord | <Rika> or something |
19:48:42 | FromDiscord | <Rika> thats what i did once |
19:48:50 | FromDiscord | <Generic> oh thank you for that idea |
19:49:05 | FromDiscord | <Generic> you saved me from writing some kind of complex caching mechanism |
19:49:32 | haxscramper | I'm writing macro will provide relatively complex DSL with several operators that should be availiable only inside of a macro. Right now I see two options for implementing such macro: (1) take `body` AST and rewrite it, replacing operators with code /or/ (2) declare template/proc inside of a macro. Which one would you recommend? |
19:49:34 | FromDiscord | <Rika> you should know of the caveats |
19:49:45 | FromDiscord | <Rika> "forgetting to run the generate define when it does change" or something |
19:50:08 | FromDiscord | <Generic> it's still better than the way this is done usually |
19:50:20 | disruptek | haxscramper: (1) |
19:50:27 | FromDiscord | <Generic> it's a dispatcher for an the interpreter of an emulator |
19:51:03 | FromDiscord | <Rika> haxscramper: 1 imo also |
19:51:27 | FromDiscord | <Generic> I basically have one proc which fills in a const structure where I specify all the encodings and a second one to dispatch based on that generated const |
19:52:23 | FromDiscord | <Generic> for haxscramper why not 2? |
19:52:43 | FromDiscord | <Generic> it could be a lot easier to implement |
19:52:47 | FromDiscord | <Rika> more efficient on run for 1 |
19:53:02 | FromDiscord | <Rika> i dont think templates would work in macros |
19:53:15 | FromDiscord | <Generic> the templates would be inside the generated code |
19:53:24 | FromDiscord | <Generic> that's atleast how I understood it |
19:54:02 | haxscramper | That's correct. Right now I have test implementation that defines `iterator` inside of a macro - it works as expected. |
19:54:17 | FromDiscord | <Rika> iterator and proc would work |
19:54:22 | FromDiscord | <Rika> but i dont think templates do |
19:57:14 | * | zacharycarter joined #nim |
19:58:15 | haxscramper | First option seems easier to implement and has less possible edge cases (like templates in macros) so I will try to use AST rewriting. There is `krux02/ast-pattern-matching` which looks like exactly what I need for this sort of task. Thanks for feedback. |
19:58:43 | FromDiscord | <Rika> 2nd actually sounds easier to implement |
19:58:46 | FromDiscord | <Rika> but yeah |
19:59:56 | * | natrys quit (Quit: natrys) |
20:01:02 | * | narimiran quit (Ping timeout: 258 seconds) |
20:01:51 | * | clyybber quit (Quit: WeeChat 2.8) |
20:02:03 | * | gangstacat quit (Quit: Ĝis!) |
20:03:36 | * | gangstacat joined #nim |
20:08:21 | * | haxscramper quit (Remote host closed the connection) |
20:18:01 | * | drewr joined #nim |
20:23:39 | * | Trustable joined #nim |
20:26:38 | * | zacharycarter quit (Ping timeout: 272 seconds) |
20:37:49 | FromDiscord | <Recruit_main707> my flatc-nim tool already parses and creates structs and enums 😁, getters and setters which will probably the hard ones are not done yet though. |
20:37:53 | FromDiscord | <Recruit_main707> and tables... |
20:42:40 | FromGitter | <JohnAD> Hey all. I'm hoping to have my `jesterwithplugins` library (by arrangement with Dom96) followed by four plugin library up on *nimble.directory* long before the Nim conference. Is there a best person to contact about moving it along or making needed changes? The PR (#1491) is only two days old; so I would normally wait; but the conference is 7 days from now. Is there a recomemnded person to chat with? |
20:42:41 | disbot | https://github.com/nim-lang/Nim/issues/1491 -- 5Almost all examples compiled with Visual C++ 2013 crash on startup |
20:44:35 | Yardanico | @JohnAD nimble.directory is updated automatically |
20:44:52 | Yardanico | the creator of nimble.directory is federico3 |
20:46:25 | * | zacharycarter joined #nim |
20:46:28 | * | tdc quit (Ping timeout: 246 seconds) |
20:47:17 | dom96 | hm? The conference isn't 7 days away AFAIK |
20:47:21 | Yardanico | yeah |
20:47:25 | Yardanico | it's 20 days away :P |
20:48:55 | FromGitter | <JohnAD> @Yardanico . Nice; I did not know that. So, once the PR is merged the rest happens automatically? |
20:50:40 | Yardanico | yes of course |
20:50:45 | Yardanico | https://nimble.directory/ is fully automated |
20:50:52 | Yardanico | src is in https://github.com/FedericoCeratto/nim-package-directory |
20:50:54 | FromGitter | <JohnAD> Oh, I'd better fix my calendar :) . ..just looked it up... June 20th. In that case, I'll not worry about it. |
20:51:06 | dom96 | What PR are you referring to? |
20:51:17 | dom96 | PRs adding the packages to our central repo? |
20:51:20 | dom96 | PRs fixing Nim? |
20:51:24 | FromGitter | <JohnAD> https://github.com/nim-lang/packages/pull/1491 |
20:51:25 | disbot | ➥ Add package jesterwithplugins |
20:51:28 | dom96 | PRs fixing nimble.directory? |
20:51:41 | dom96 | Okay, I got confused by disbot |
20:51:51 | dom96 | then yes, it's all automatic |
20:52:36 | FromGitter | <alehander92> disruptek |
20:52:49 | FromGitter | <alehander92> i started a macro/vm debugger |
20:52:53 | FromGitter | <alehander92> yay me |
20:53:05 | FromGitter | <alehander92> oh man nimconf is on my birthday |
20:53:23 | FromGitter | <alehander92> i'll spam some stuff in the comments probably |
20:53:51 | FromGitter | <alehander92> awesome zevv |
20:53:59 | FromGitter | <alehander92> would love to play with it next week |
20:59:50 | leorize[m] | disruptek: well I'm having a lot on my hands |
21:00:14 | Zevv | alehander92: well, not too much to play with yet, it's fragile and full of hardcoded stuff |
21:05:17 | * | Jesin quit (Quit: Leaving) |
21:08:28 | * | Jesin joined #nim |
21:10:12 | sschwarzer | alehander: re nimconf being on your birthday: is that good or bad? Or both? :) |
21:11:42 | * | idf quit (Ping timeout: 256 seconds) |
21:13:49 | * | Trustable quit (Remote host closed the connection) |
21:16:16 | FromGitter | <alehander92> i am not sure :D |
21:16:27 | FromGitter | <alehander92> zevv completely normal |
21:16:35 | FromGitter | <alehander92> disruptek the rocket guys |
21:16:39 | FromGitter | <alehander92> managed to fly gg! |
21:18:38 | dom96 | Am I missing context or is disruptek responding to you on stream? |
21:22:54 | * | solitudesf quit (Ping timeout: 260 seconds) |
21:23:46 | * | sacredfrog quit (Quit: ZNC 1.8.0 - https://znc.in) |
21:29:19 | FromGitter | <alehander92> i am just spamming him, because i watched the first rocket stream there, sorry |
21:29:40 | FromGitter | <alehander92> i just talk without context in real life |
21:30:11 | dom96 | If you're talking to him on stream then you should do that in a separate dedicated twitch channel or at least in offtopic |
21:30:54 | disruptek | look, mom, he's not in offtopic or on a stream. |
21:30:56 | disruptek | christ. |
21:31:07 | disruptek | rocketry is pretty fucking sexy, i have to admit. |
21:31:22 | disruptek | but i will never work for musk. the guy is an asshole. |
21:32:01 | livcd | proud american! |
21:32:08 | Zevv | I've spent too much of my life doing KSP |
21:32:12 | disruptek | tomato, tomatoe. |
21:32:19 | Zevv | Jebediah sais hi |
21:32:37 | FromGitter | <alehander92> sorry dom96 i didnt watch stream today |
21:32:46 | FromGitter | <alehander92> but the conversation was still pretty offtopic indeed |
21:33:17 | disruptek | sshhhh, dom wants to talk about something nim-related. |
21:33:28 | FromGitter | <alehander92> well, I agree that worklife balance seems not good in spacex, but i guess this is typical for many SV-style companies |
21:33:36 | FromGitter | <alehander92> slash startups |
21:33:59 | FromGitter | <alehander92> its probably like game companies: you're passionate about X, so lets work that 60 hours |
21:35:01 | FromGitter | <JohnAD> @dom96. If you have a few moments to discuss. What was the use-case for the `before` and `after` directives in a jester router? Because of the macro-created blocks, it can only change globals or already existing vars in the context of the thread (such as request). So, it's goal has been eluding me. |
21:36:28 | FromGitter | <alehander92> oh sorry i skip messages |
21:38:47 | dom96 | JohnAD: honestly it's been likely directly copied from Sinatra |
21:39:29 | dom96 | but one use case might be calling authReq in a `before` block |
21:39:37 | dom96 | which I guess your plugins solve slightly differently |
21:39:38 | dom96 | bbl |
21:41:27 | alehander92 | what is happening with jester btw |
21:41:45 | alehander92 | is it becoming more rails-like |
21:42:47 | alehander92 | with that plugins addition i mean |
21:43:44 | disruptek | !repo disruptek/gram |
21:43:45 | disbot | https://github.com/disruptek/gram -- 9gram: 11Generic graphs in Nim 15 2⭐ 0🍴 |
21:43:57 | disruptek | ^ demonstrates arc bug; run gram.nim |
21:45:17 | sschwarzer | Just checking ... I think I read that you can use Nim iterators only in for loops, right? Or can I get hold of an "iterator object" as in Python? |
21:45:30 | disruptek | see closure iterators. |
21:49:13 | Avatarfighter | Is there a max recursive depth in nim? |
21:49:21 | disruptek | around 2000 |
21:49:45 | Avatarfighter | Ok yeah that matches to about what I'm seeing |
21:49:47 | Yardanico | Avatarfighter: by default it's 2k |
21:49:48 | disruptek | you can override it, but... why |
21:49:49 | Yardanico | you can change it |
21:49:51 | Yardanico | yeah |
21:50:08 | sschwarzer | disruptek: Hm, I need to think about how this might help. Another approach could be to get hold of an object with an `items` method that I can use in a `for` loop. |
21:50:13 | Avatarfighter | I'm having a slight issue with my webscraper bc of some recursive shenanigans |
21:50:27 | Yardanico | why too much recursion though |
21:51:04 | Avatarfighter | I'm not entirely sure yet, I'm messing with an ungcsafe async callback |
21:53:00 | sschwarzer | I'm still on the XML tree iterator with in-place changes and am thinking about a better _and_ more robust API. At the moment I think it's a brittle idea to let client code manipulate the tree (deletions/insertions) in the loop body. I'm rather thinking now of "methods" on an iterator or similar object, so that the iterator gets "notified" of the tree manipulations. |
21:53:59 | Avatarfighter | What are you working on sschwarzer? |
21:54:04 | Avatarfighter | Sounds interesting ! |
21:54:18 | sschwarzer | At the moment I'm working with the approach that I can/could call methods on the individual items "returned" by the loop/iterator. |
21:54:38 | bung | he want something like cheerio in js |
21:54:51 | disruptek | eh nah |
21:54:57 | sschwarzer | Avatarfighter: https://forum.nim-lang.org/t/5697 , especially https://forum.nim-lang.org/t/5697#39423 |
21:56:30 | Avatarfighter | sschwarzer: That sounds like a super interesting project :) |
21:57:55 | sschwarzer | Avatarfighter: thanks for the encouragement, I need it. :) It started with a smaller problem (that I have solved), cleaning up an XML tree. Than in the forum, someone (I think cblake) had the idea to generalize it and encouraged me. :-) |
21:58:14 | sschwarzer | I'm actually relatively new to Nim, but the language is super-interesting. |
21:59:24 | Avatarfighter | I'm loving the language, I'm pretty bad with how efficient my programs are and I usually need to be spoonfed help but this language is one of the few with friendly, helpful people and not a toxic cult like other languages |
21:59:37 | disruptek | give it time. |
22:00:08 | Zevv | yeah, you wait and we'll dissapoint you |
22:01:53 | Avatarfighter | lmao |
22:02:03 | Avatarfighter | Nah no way I'll get disappointed |
22:02:22 | sschwarzer | What I particularly like is the decoupling of objects/types and the operations on them (supported by argument overloading). That's a really awesome desig feature. |
22:02:35 | sschwarzer | *design |
22:02:41 | Avatarfighter | I really enjoy the ffi |
22:02:49 | Zevv | I enjoy the toxic cult |
22:03:58 | Avatarfighter | haha |
22:06:47 | sschwarzer | Zevv *lol* |
22:10:48 | Avatarfighter | The only cult im in is the Loving Araq Cult |
22:11:48 | alehander92 | no need to be in a cult |
22:11:51 | alehander92 | to love |
22:12:03 | alehander92 | open your heartszz |
22:12:46 | Zevv | closing my eyes |
22:19:29 | FromDiscord | <Generic> has someone ever thought of jitting nimscript? |
22:24:01 | sschwarzer | Generic: Maybe. But usually you don't write long-running programs in Nimscript, so it may not pay off that much. On the other hand, if Nimscript was faster, maybe people would use it more? :) |
22:25:15 | FromDiscord | <Generic> yeah, most of the time macros stay relatively small |
22:25:43 | FromDiscord | <Generic> though I'm not the first one to make a macro where compile times become an issue |
22:26:23 | FromDiscord | <Generic> those resources are probably better spent with incremental compilation anyway |
22:27:28 | * | zacharycarter quit (Ping timeout: 256 seconds) |
22:32:06 | bung | https://play.nim-lang.org/#ix=2nSF these do same work as stream lib' `write` ? |
22:35:12 | disruptek | generic: how slow are we talking? |
22:35:33 | disruptek | we were just talking about how useless incremental compilation is. |
22:35:53 | FromDiscord | <Generic> so slow that incremental compilation will probably make a difference |
22:36:01 | FromDiscord | <Generic> wait a moment I'll use a stop watch |
22:36:27 | disruptek | talk to me when you have a macro that takes ~2min. |
22:37:08 | disruptek | anyway, macros are in general a more significant challenge for ic. |
22:38:19 | FromDiscord | <Generic> interestingly it's only nim check which is so slow |
22:38:26 | FromDiscord | <Generic> the nim compiler is super fast |
22:39:15 | FromDiscord | <Recruit_main707> Hey, I have a question, would someone like/want to collaborate on getting Nim flatbuffers into the google repo and on the process make them much more usable?↵The thing is that the implementation it’s finished, but the code generator is crucial (with docs and tests, but that’s easy), and it should be done in c++ using their “library” or tooling system. |
22:40:55 | FromDiscord | <Recruit_main707> I have on c++ experience, and although I might be able to get something working, it is probably a better idea to have it done by a c++ programmer |
22:41:09 | FromDiscord | <Recruit_main707> I have no* |
22:41:43 | FromDiscord | <Generic> I think I know what the real bottleneck is! |
22:41:54 | * | neceve quit (Ping timeout: 240 seconds) |
22:42:03 | FromDiscord | <Generic> my code currently produces quite a lot of errors |
22:42:19 | FromDiscord | <Generic> I think it's vscode nim's diagnostics parser which is the so slow |
22:43:06 | FromDiscord | <Generic> @Recruit_main707 that sounds stupid |
22:43:31 | FromDiscord | <Generic> like they have never heared of macros 😉 |
22:43:51 | FromDiscord | <Recruit_main707> What part sounds stupid |
22:44:12 | FromDiscord | <Generic> that the code generator needs to be written in C++ and that it's an external program |
22:44:42 | FromDiscord | <Generic> in Nim you could just have a macro which spits the code out |
22:45:18 | FromDiscord | <Recruit_main707> Yeah, but if we want nim to be in there, it needs to be done that way |
22:45:44 | FromDiscord | <Recruit_main707> I know macros would be the “ideal” solution |
22:46:00 | * | mwbrown quit (Quit: Exiting) |
22:46:13 | FromDiscord | <exelotl> vscode nim plugin works like 10% of the time for me 😅 |
22:47:06 | disruptek | you can lead whores to water, but you can't make them drink. |
22:48:05 | FromDiscord | <exelotl> I see like 10% of what you did there |
22:48:42 | disruptek | use macros. if they don't like it, it's tough titties. |
22:49:45 | bung | nimsuggest have problems while you using nested templates or `{.dirty.}` |
22:50:03 | FromDiscord | <Generic> I experienced that as well |
22:50:12 | FromDiscord | <Generic> it also doesn't like recursive imports |
22:51:19 | bung | I think it mainly related to the vm.nim, I know where it is, but am not able to fix |
22:54:03 | voltist | Seeing as shashlick doesn't seem to be around at the moment, does anyone else have enough experience with nimterop for me to get some help? |
22:57:42 | * | mwbrown joined #nim |
23:07:16 | FromDiscord | <codic> Going to rephrase my old question to this: Is it possible to do something like this with pure nim? https://hastebin.com/fapujixiyu.bash |
23:07:48 | * | xet7 joined #nim |
23:07:53 | * | sschwarzer quit (Quit: leaving) |
23:10:07 | bung | codic you just need check nim's zip lib |
23:11:26 | bung | I can tell you it is possible, and basiclly just replace your proc call to zip lib api. |
23:11:44 | * | xet7 quit (Remote host closed the connection) |
23:21:29 | FromDiscord | <Recruit_main707> disruptek, but as they said, having nim in that repo is worth the “sacrifice” |
23:26:43 | * | Faulander_ joined #nim |
23:26:44 | * | Faulander quit (Read error: Connection reset by peer) |
23:27:53 | FromDiscord | <codic> zip library supports .tar.xz? |
23:28:05 | FromDiscord | <Elegant Beef> Should support tarballs |
23:28:20 | FromDiscord | <codic> nice, where are the docs? |
23:28:35 | FromDiscord | <Elegant Beef> Not a clue |
23:28:38 | FromDiscord | <Elegant Beef> I use nimarchive |
23:28:45 | FromDiscord | <codic> oh here, https://nimble.directory/docs/zip |
23:28:56 | FromDiscord | <codic> I'd be happy to use nimarchive but does it have that functionality? |
23:29:01 | FromDiscord | <codic> something like https://hastebin.com/fapujixiyu.bash |
23:29:05 | Avatarfighter | quick question, do I still need to await my async procs even if I have a loop constantly polling ? |
23:29:21 | Yardanico | Avatarfighter: depends on what you mean exactly |
23:29:28 | FromDiscord | <codic> aaaah there isn't a xz section in https://nimble.directory/docs/zip welp |
23:29:36 | Yardanico | if you want to _continue_ but still run the async proc you need to do asyncCheck mycall() |
23:29:43 | Yardanico | if you want to _wait_ until a future complets you use 'await" |
23:29:59 | Yardanico | @codic what about https://github.com/genotrance/nimarchive |
23:30:26 | FromDiscord | <codic> It doesn't seem to have the functionality I asked for :\ |
23:30:31 | Yardanico | why? |
23:30:35 | Yardanico | libarchive has lzma and tar support |
23:30:40 | Yardanico | and nimarchive just wraps libarchive |
23:30:45 | Yardanico | https://github.com/libarchive/libarchive |
23:30:47 | FromDiscord | <codic> it doesn't allow me to loop thru each file in the archive |
23:31:12 | FromDiscord | <codic> and only extract if a condition passes↵at least from what i can cee |
23:31:14 | FromDiscord | <codic> (edit) 'cee' => 'see' |
23:31:36 | Avatarfighter | Yardanico: I ask because Leorize helped me and we were able to create futures and get them to resolve without actually awaiting/asyncChecking them via a while loop that endless polled so I was curious to know if that was meant to work lol |
23:31:55 | Yardanico | Avatarfighter: I don't really understand what you mean :) |
23:32:08 | Yardanico | you can create and get futures, yes, but you should never do "discard asyncCall()" |
23:32:23 | Yardanico | if you do something like "let fut = myFut(); if fut.failed: print error else: get data" then it's ok |
23:32:37 | Avatarfighter | Wait let me copy what I meant |
23:33:18 | Avatarfighter | https://play.nim-lang.org/#ix=2nSY "startTask" is an async proc leorize and I were able to get those procs to resolve without doing anything to them and I'm trying to understand why |
23:33:39 | Prestige | dom96: how reliable is nimbox for an actual application? |
23:34:50 | Yardanico | Avatarfighter: well the first thing I see is that you don't handle errors at all |
23:34:54 | Yardanico | unless you do it in startTask |
23:35:05 | Avatarfighter | I do in startTask :) haha |
23:35:09 | Yardanico | but yeah mostly it's fine, although your queueLoop doesn't need to be async then |
23:35:23 | Yardanico | also I see why it's recursion limit |
23:35:43 | Avatarfighter | yeah that's why I asked earlier about recursion limits in nim haha :D |
23:35:49 | bjornroberg | codic: Isn't this something that might be what you want? https://github.com/libarchive/libarchive/wiki/Examples#list-contents-of-archive-with-custom-read-functions |
23:35:54 | Yardanico | each async proc is like 3-7 calls |
23:36:01 | Yardanico | because of all iterators and stuff which is made by the async macro |
23:36:02 | FromDiscord | <codic> Wait what, let me take a look at that |
23:36:18 | FromDiscord | <codic> That does seem like what I want, but it's c which i don't know |
23:36:38 | FromDiscord | <codic> So I wouldn't know how it'd look in nim |
23:36:48 | Yardanico | you can write c-like nim :P |
23:37:00 | FromDiscord | <codic> There should be an idiomatic way to do it though |
23:37:33 | FromDiscord | <codic> :\ |
23:38:09 | FromDiscord | <codic> I see callbacks https://genotrance.github.io/nimarchive/nimarchive/archive.html#archive_read_open%2Cptr.archive%2Cpointer%2Cptr.archive_open_callback%2Cptr.archive_read_callback%2Cptr.archive_close_callback but not sure how to use |
23:38:39 | leorize[m] | use them like how you would in c :p |
23:39:17 | Yardanico | @codic well it's all about abstractions and wrapping c-style things in nim-style things |
23:40:15 | Avatarfighter | In theory when I create a future I should just be able to resolve it via a poll() right? |
23:40:46 | Yardanico | wdym "resolve" |
23:40:56 | Yardanico | with poll you just run all tasks in the dispatcher |
23:41:18 | Avatarfighter | sorry when I say resolve I mean run |
23:41:25 | Yardanico | well you can just do |
23:41:30 | Yardanico | while hasPendingOperations(): poll() |
23:41:46 | FromDiscord | <codic> But I don't *get* how it works in C |
23:41:49 | Yardanico | and remove async from queueLoop - that proc isn't async |
23:42:00 | Yardanico | @codic you just create a nim proc |
23:42:09 | Yardanico | then pass addr myproc to this proc |
23:42:17 | Yardanico | it's quite easy to understand, no? |
23:43:04 | FromDiscord | <codic> that's easy to understand, what isn't is the content of the proc. like, how do i port the structs, malloc, `->`, etc? could you give a quick example? |
23:44:26 | Yardanico | you just create an object |
23:44:31 | bjornroberg | codic: there's an example in the test for nimarchive https://github.com/genotrance/nimarchive/blob/master/tests/tnimarchive.nim |
23:44:45 | * | lritter joined #nim |
23:44:56 | FromDiscord | <codic> that's doing it manually? |
23:45:01 | Yardanico | "->" is field access, in nim it's . |
23:45:08 | Yardanico | malloc is not needed in nim usually since nim allocates memory for you |
23:45:50 | bjornroberg | var arch = archive_read_new() # does a malloc in the background (or similar) |
23:45:57 | FromDiscord | <codic> so in https://github.com/genotrance/nimarchive/blob/master/tests/tnimarchive.nim, where are they actually extracting the file? |
23:46:34 | Yardanico | they're not extracting it, they're reading it |
23:46:37 | bjornroberg | no, in that test there's simply assertions that the content is correct |
23:47:04 | bjornroberg | yes, what Yardanico said :) |
23:47:43 | bung | `z.open(filename, fmRead);let outStream = newStringStream("");z.extractFile("foo.bar", outStream)` |
23:48:10 | bjornroberg | also, seems like there's a utility: extract("tests/nimarchive.7z", "destDir") |
23:48:33 | bung | I guess you just need do it with nim's zip lib |
23:49:12 | bung | or `z.extractAll("files/td")` extractAll file to a dir |
23:49:19 | Yardanico | bung: he wants to check files in the archive |
23:49:26 | Yardanico | and based on that extract or something |
23:51:29 | bung | oh it's `zip_fopen(z.w, filename, 0'i32)` |