00:00:57 | * | konvertex quit (Ping timeout: 258 seconds) |
00:03:55 | * | pbb quit (Ping timeout: 272 seconds) |
00:04:29 | * | pbb joined #nim |
00:04:46 | Prestige | Hm can anyone assist with something? Probably should be some sort of template if it's possible.. |
00:04:57 | Prestige | Essentially converting this block of C code: https://github.com/i3/i3/blob/next/src/handlers.c#L291 |
00:05:38 | Prestige | Basically accessing a property on an object by its name |
00:06:19 | Prestige | the `event->event_member` part in particular - event_member is passed in as the name of the property on `event` |
00:07:08 | FromDiscord | <Rika> make a macro |
00:07:15 | FromDiscord | <Rika> actually maybe a template works |
00:07:46 | Prestige | Yeah I'm not sure, still trying to wrap my head around macros/templates |
00:08:02 | FromDiscord | <Rika> template copyMaskMember(maskMember, eventMember) = ... event.`eventMember` ... |
00:08:26 | Prestige | oh you can do that? hm |
00:08:44 | * | bok quit (Read error: Connection reset by peer) |
00:09:39 | FromDiscord | <Rika> honestly it's making me more and more surprised that i understood macros and templates quickly, im not sure why i did |
00:09:58 | Prestige | I feel like I understood macros mostly but not templates |
00:10:42 | FromDiscord | <Rika> thats weird, usually its the other way around isnt it |
00:10:57 | Prestige | 🤷♂️ |
00:12:38 | * | mal`` joined #nim |
00:17:49 | * | oats left #nim ("WeeChat 2.7.1") |
00:23:18 | * | fredrikhr quit (Ping timeout: 265 seconds) |
00:24:16 | Prestige | @Rika would you mind taking a min to assist with it? |
00:24:36 | Prestige | Must be doing something incorrectly |
00:25:45 | Prestige | https://0x0.st/iLbZ.png and https://0x0.st/iLbN.png |
00:28:40 | * | dddddd quit (Ping timeout: 256 seconds) |
00:40:59 | FromDiscord | <Rika> 1 moment |
00:41:07 | FromDiscord | <Rika> dont use a string |
00:41:10 | FromDiscord | <Rika> just an x |
00:41:26 | FromDiscord | <Rika> so copyMaskMember(e, 1, x) |
00:41:39 | leorize | is that jetbrains mono? |
00:41:55 | Prestige | Should I do that and make it untyped in the template? |
00:42:02 | Prestige | leorize: good eye, yes it is |
00:42:12 | FromDiscord | <Rika> no need, it's automatically untyped |
00:42:13 | leorize | it renders better on your pc than mine :P |
00:42:22 | Prestige | Huh weird |
00:42:27 | FromDiscord | <Rika> perhaps its the font size leorize |
00:42:40 | Prestige | I keep hearing font rendering on Linux is bad but it looks good to me |
00:42:40 | FromDiscord | <Rika> certain font sizes work better on certain fonts |
00:43:17 | Prestige | Rika automatically as in I don't need to provide a type in the template declaration? |
00:43:33 | leorize | font rendering always require a tweak or two on my systems :P |
00:43:50 | Prestige | What are you running leorize? |
00:43:54 | * | lritter quit (Ping timeout: 240 seconds) |
00:43:56 | leorize | gentoo |
00:44:01 | * | Trustable quit (Remote host closed the connection) |
00:44:02 | Prestige | Ah nice |
00:44:42 | FromDiscord | <Rika> yes |
00:45:00 | * | lritter joined #nim |
00:45:11 | Prestige | Are there any good tuts on templates? I found some for macros |
00:46:01 | Prestige | leorize: I used Dina for a long time but it doesn't scale size so I switched recently |
00:46:16 | leorize | I'm running iosevka |
00:46:20 | leorize | it's been serving me nicely :) |
00:46:58 | Prestige | Not bad |
00:47:13 | FromDiscord | <Rika> prestige, templates are essentially macros that're just a bare "quote do" |
00:47:26 | FromDiscord | <Rika> thats at least the best super-compressed tutorial i can give |
00:47:40 | Prestige | Oh that makes sense, thanks |
00:47:41 | leorize | https://play.nim-lang.org/#ix=2lWl |
00:47:48 | leorize | Rika: you beat me to it :P |
00:48:07 | FromDiscord | <Rika> prestige: also, the backticks are optional on templates |
00:48:09 | Prestige | Hehe |
00:48:15 | * | pbb quit (Quit: No Ping reply in 180 seconds.) |
00:48:16 | FromDiscord | <Rika> but i like to put them anywhere applicable anyway |
00:48:25 | FromDiscord | <Rika> theyre more clear to me |
00:48:30 | leorize | backticks have special meanings in templates |
00:48:35 | Prestige | Yeah I think it's better for readability, thanks for the help |
00:48:40 | FromDiscord | <Rika> also you can combine idents in templates but not quote do |
00:48:44 | leorize | they are used for identifier construction |
00:48:47 | FromDiscord | <Rika> which is the meaning for ``s |
00:49:11 | FromDiscord | <Rika> `someUntyped =` will combine whatever value the someUntyped is w/ an = |
00:49:16 | FromDiscord | <Rika> easy setter proc generation 🙂 |
00:49:38 | * | pbb joined #nim |
00:49:41 | leorize | that's not the main usecase though :P |
00:49:59 | FromDiscord | <Rika> Prestige: ^ make sure to see this, i dont know if leaving ``s on the args has an extra compile time cost |
00:50:11 | leorize | the main use case is to produce something like: proc `prefix Identifier`() |
00:50:19 | FromDiscord | <Rika> leorize: technically there's no main usecase for something so generic |
00:50:31 | leorize | I'm just stating what in the manual :P |
00:50:41 | leorize | (and yes I do use that case a lot) |
00:50:45 | Prestige | Hmm okay |
00:50:46 | FromDiscord | <Rika> generic -> wide in use |
00:51:05 | Prestige | This language is so awesome |
00:51:22 | leorize | yes, yes it is |
00:51:45 | * | blackbeard420 quit (Quit: ZNC 1.7.5 - https://znc.in) |
00:51:45 | * | hpyc9 quit (Quit: FREENODE IS FUCKING GAY) |
00:52:28 | * | Guest71164 quit (Ping timeout: 256 seconds) |
00:53:51 | * | hpyc9 joined #nim |
00:54:33 | * | blackbeard420 joined #nim |
00:57:04 | * | dadada joined #nim |
00:57:29 | * | dadada is now known as Guest55226 |
00:58:18 | FromDiscord | <Rika> TIL an intlit w/ an f suffix is a float32 |
01:00:08 | FromGitter | <kaushalmodi> Rika: ? |
01:00:15 | FromGitter | <kaushalmodi> !eval echo $type(123) |
01:00:17 | NimBot | int |
01:00:31 | Prestige | If a template has a return type, it should still implicitly create `result` right? |
01:00:56 | FromGitter | <kaushalmodi> Rika: or did you mean: |
01:01:06 | FromGitter | <kaushalmodi> !eval echo $type(123'f) |
01:01:08 | NimBot | float32 |
01:01:24 | leorize | Prestige: nope |
01:01:24 | FromDiscord | <Rika> yes |
01:01:32 | FromDiscord | <Rika> thats what i mean |
01:01:37 | FromGitter | <kaushalmodi> if so, there are "suffixes" for all |
01:01:44 | Prestige | Thanks |
01:01:45 | FromDiscord | <Rika> yeah, i know |
01:01:51 | FromGitter | <kaushalmodi> ok |
01:01:59 | FromDiscord | <Rika> but i mean, shouldn't `f` mean `float`? |
01:02:09 | FromGitter | <kaushalmodi> f is shorthand |
01:02:20 | FromDiscord | <Rika> and so |
01:02:22 | FromGitter | <kaushalmodi> float64 would be f64, I guess |
01:02:29 | FromDiscord | <Rika> but f should be float |
01:02:32 | FromDiscord | <Rika> not float32 |
01:02:33 | FromGitter | <kaushalmodi> similarly there's i32, i64, .. |
01:02:38 | FromDiscord | <Rika> i'm not on a 32bit system |
01:02:44 | FromGitter | <deech> Aside from nimsuggest what are non-trivial examples of using the compiler as a library? |
01:03:32 | FromGitter | <kaushalmodi> https://play.nim-lang.org/#ix=2lWn |
01:03:42 | leorize | deech: nimfind, nimpretty |
01:04:02 | leorize | old nimble was also one of the compiler-based tool |
01:04:17 | Prestige | Hmm.. https://0x0.st/iLby.png not sure what to make of this? |
01:04:30 | FromDiscord | <Rika> sigh |
01:04:32 | FromDiscord | <Rika> whatever |
01:04:37 | leorize | Prestige: templates are not procs |
01:04:40 | FromDiscord | <Rika> you dont seem to understand what i mean |
01:04:45 | FromDiscord | <Rika> ¯\_(ツ)_/¯ |
01:05:27 | leorize | Prestige: imagine it from the quote do stand point :) |
01:06:17 | leorize | Rika: we also have the `d` suffix too |
01:07:41 | FromGitter | <kaushalmodi> Rika: cool, wasn't aware aware of 'd |
01:07:58 | FromGitter | <kaushalmodi> that's nonintuitive |
01:08:10 | FromGitter | <kaushalmodi> for me, d is decimal, h is hex, b is binary |
01:08:20 | Prestige | hm I've seen macros executed in the same syntax like someMacro(args) though, unless you mean something else |
01:08:54 | Prestige | Can I just not return values? |
01:09:02 | FromDiscord | <Rika> yall i know what the prefixes mean, what i am questioning is why would f be float32 and not float |
01:11:57 | Prestige | perhaps I just need an out param for my values array |
01:12:51 | Prestige | Okay I think I got it |
01:18:25 | * | krux02_ quit (Remote host closed the connection) |
01:21:04 | * | Guest55226 quit (Ping timeout: 258 seconds) |
01:27:04 | * | dadada joined #nim |
01:27:27 | * | dadada is now known as Guest44339 |
01:36:07 | * | chemist69 quit (Ping timeout: 240 seconds) |
01:38:31 | * | chemist69 joined #nim |
01:38:37 | leorize | Prestige: what came out of your template is the AST :P |
01:39:31 | leorize | @Rika probably for C users |
01:40:15 | Prestige | oml my status bar was just placed in the correct location |
01:40:17 | Prestige | woo |
01:43:57 | leorize | ooh, I never know that iosevka got a "wide" variant |
01:44:51 | leorize | the wide variant makes it look kinda like jetbrains mono :P |
01:45:44 | Prestige | leorize: this is what I ended up doing: https://0x0.st/iLbd.png |
01:45:58 | Prestige | probably is some way to clean it up futher but it's working |
01:47:08 | leorize | well it looks fine enough I suppose :P |
01:50:58 | * | Guest44339 quit (Ping timeout: 258 seconds) |
01:51:12 | leorize | gentoo is pretty good at being outdated :p |
01:57:03 | * | dadada__ joined #nim |
02:04:36 | disruptek | shhh |
02:06:26 | leorize[m] | the font I use has been outdated for 2 major releases |
02:07:21 | disruptek | eh, keep it forever. |
02:13:37 | * | muffindrake quit (Ping timeout: 244 seconds) |
02:16:00 | * | muffindrake joined #nim |
02:21:06 | * | dadada__ quit (Ping timeout: 256 seconds) |
02:27:06 | * | dadada joined #nim |
02:27:29 | * | dadada is now known as Guest76731 |
02:37:45 | * | ptdel quit (Remote host closed the connection) |
02:39:02 | * | ptdel joined #nim |
02:40:42 | * | zacharycarter quit (Ping timeout: 272 seconds) |
02:43:02 | leorize | disruptek: we might wanna research how go does their floating point stuff |
02:43:34 | leorize | they're implementing a variant of ryu from scratch that doesn't inflate your binary size |
02:43:40 | * | zacharycarter joined #nim |
02:48:14 | * | zacharycarter quit (Ping timeout: 260 seconds) |
02:50:54 | * | Guest76731 quit (Ping timeout: 256 seconds) |
02:52:59 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
02:55:50 | * | zacharycarter joined #nim |
02:57:08 | * | dadada__ joined #nim |
03:05:54 | disruptek | hmm. |
03:06:10 | disruptek | i guess that's probably worth copying. |
03:06:30 | FromDiscord | <Gary M> sent a long message, see http://ix.io/2lWI |
03:06:37 | FromDiscord | <Gary M> but how do I initialize the set in the array |
03:06:46 | * | cgfuh quit (Quit: WeeChat 2.7.1) |
03:09:13 | FromDiscord | <Gary M> the set(s) rather heh |
03:11:44 | FromDiscord | <Technisha Circuit> How would i check if a file exists in Nim? |
03:11:56 | FromDiscord | <Gary M> I guess it's `for x in signatures.mitems: x = {}` but idk |
03:12:33 | FromDiscord | <Gary M> https://nim-lang.org/docs/os.html#fileExists%2Cstring @Technisha Circuit |
03:12:50 | FromDiscord | <Technisha Circuit> Thanks |
03:12:58 | FromDiscord | <Gary M> existsFile or fileExists either or |
03:13:50 | FromGitter | <kaushalmodi> Rika: because in C, (f)loat is 32 bits and (d)ouble is 64 bits |
03:14:06 | FromDiscord | <Technisha Circuit> Oh yeah, for an if statement, is `if true` and `if not true` okay? |
03:14:21 | FromDiscord | <Rika> @Gary M sets are initialized by default? |
03:14:26 | FromDiscord | <Gary M> I guess |
03:14:39 | FromDiscord | <Rika> so what's the issue? |
03:14:57 | FromDiscord | <Technisha Circuit> Thanks |
03:15:00 | FromDiscord | <Gary M> just trying to do std::bitset type stuff in nim but I'm not sure 😄 |
03:15:06 | FromDiscord | <Technisha Circuit> (edit) 'Thanks' => 'Thanks, I'ma just try' |
03:15:11 | FromDiscord | <Rika> sets are 0'd ({}) by default |
03:15:12 | FromGitter | <kaushalmodi> You were wondering why 'f is 32 bits and not 64 bit float |
03:15:25 | FromDiscord | <Rika> kaushalmodi: wasnt replying to you |
03:15:27 | FromDiscord | <Rika> but thanks |
03:15:34 | FromGitter | <kaushalmodi> I later figured :) |
03:15:35 | FromDiscord | <Rika> i was talking to gary |
03:16:08 | FromDiscord | <Gary M> so I want to set a bit in the set |
03:16:23 | FromDiscord | <Gary M> I'm not sure if `a.SetSignature({1'u8})` is correct |
03:16:23 | FromDiscord | <Rika> by "default"? |
03:16:26 | FromDiscord | <Gary M> no |
03:16:37 | FromDiscord | <Rika> that should by fine |
03:16:53 | FromDiscord | <Gary M> moving on from the and 2'u8 would set a different bit yeah? 😄 |
03:17:04 | FromDiscord | <Gary M> moving on from the init stuff* |
03:17:39 | FromDiscord | <Rika> yes |
03:17:55 | disruptek | use enums instead. |
03:18:41 | FromDiscord | <Gary M> is it functionally the same? |
03:18:48 | FromDiscord | <Rika> ah yeah, {2} != 2, bitwise |
03:18:51 | FromDiscord | <Rika> yes it is |
03:19:04 | disruptek | no, it's superior because it composes better and offers type safety. |
03:19:54 | disruptek | examples here: |
03:19:56 | disruptek | !repo gittyup |
03:19:58 | disbot | https://github.com/disruptek/gittyup -- 9gittyup: 11higher-level git bindings that build upon nimgit2 15 3⭐ 0🍴 |
03:20:00 | disruptek | !repo gully |
03:20:02 | disbot | https://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 2⭐ 0🍴 |
03:21:14 | * | dadada__ quit (Ping timeout: 272 seconds) |
03:23:49 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:24:00 | FromDiscord | <Gary M> sent a code paste, see http://ix.io/2lWL |
03:24:02 | FromDiscord | <Gary M> according to the manual |
03:24:09 | FromDiscord | <Gary M> `a.SetSignature({Pos})` |
03:24:15 | * | lritter quit (Quit: Leaving) |
03:24:31 | FromDiscord | <Rika> yes |
03:27:06 | * | dadada joined #nim |
03:27:29 | * | dadada is now known as Guest73029 |
03:28:18 | FromDiscord | <Technisha Circuit> How would i import a file using a string? There isn't any other options i can use with my project |
03:29:49 | FromDiscord | <Gary M> do you mean to read the file into a string? |
03:30:50 | * | zacharycarter quit (Ping timeout: 265 seconds) |
03:33:57 | FromDiscord | <Technisha Circuit> I want to do something similar to `__import__("path.to.file")` from Python |
03:34:02 | FromDiscord | <Technisha Circuit> If it's possible |
03:35:09 | FromDiscord | <Gary M> I don't know what that does in Python |
03:35:44 | FromDiscord | <codic> It imports a file the same way as `import .file`, except the path is a string. |
03:36:00 | FromDiscord | <codic> So instead of nim's `import file` they want to have `file` as a string |
03:36:45 | FromDiscord | <Gary M> well, Araq says just use import "path/here" |
03:36:45 | FromDiscord | <Technisha Circuit> ^^^ |
03:37:06 | FromDiscord | <Technisha Circuit> And "path/here" is a string? |
03:37:21 | FromDiscord | <Gary M> " " implies it's a string |
03:37:30 | FromDiscord | <Technisha Circuit> Thanks :p |
03:37:37 | FromDiscord | <Gary M> I mean it's compile time isn't it |
03:37:37 | * | chemist69 quit (Ping timeout: 260 seconds) |
03:37:44 | FromDiscord | <Technisha Circuit> Wasn't in a codeblock so i was double checking |
03:38:41 | * | chemist69 joined #nim |
03:48:58 | FromDiscord | <Technisha Circuit> If i import a module and just use `function` without using the module namespace, then i import another module with the same name for a function, does the file i import last take precedence? |
03:51:08 | * | Guest73029 quit (Ping timeout: 265 seconds) |
03:52:05 | FromDiscord | <codic> In Jester (https://github.com/dom96/jester) how do I serve a html file manually as a response to a request, like `get "/page"`? (Not talking about the auto render thing where it looks for static files in ./public) |
03:56:33 | leorize | @Technisha Circuit no, if there are conflicts Nim will force you to qualify the name |
03:57:07 | leorize | codic: this is the, uh, not so nice part about jester |
03:57:12 | * | dadada__ joined #nim |
03:57:26 | leorize | `resp readFile "yourfile.html"` :P |
03:57:28 | FromDiscord | <Rika> It will match whichever matches the signature, and if many do it forces fill qual |
03:57:30 | FromDiscord | <Rika> Full* |
03:58:10 | FromDiscord | <codic> what's so 'not so nice' about it? |
03:58:27 | FromDiscord | <codic> `resp(readFile("whatever.html"))` seems perfectly decent |
04:02:43 | leorize | it's not a streaming interface |
04:03:04 | leorize | so this is basically: read the file to memory, then start streaming it to your client |
04:03:30 | leorize | extremely inefficient for large files, but should be fine for small ones like html |
04:03:49 | FromGitter | <Willyboar> Doesn't have render? |
04:05:13 | FromDiscord | <codic> Any way to have it work for large ones as well? |
04:05:22 | FromDiscord | <codic> With decent speed |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:46 | * | supakeen joined #nim |
04:09:00 | FromDiscord | <codic> Anyways in jester how do I return a response code and html? |
04:09:09 | FromGitter | <Willyboar> Look tweeter example with source code filters |
04:09:32 | FromGitter | <Willyboar> Or you can use mustache |
04:09:33 | FromDiscord | <codic> No idea how to usea source code filter |
04:09:50 | FromDiscord | <codic> Which file should I look at? |
04:10:14 | FromGitter | <Willyboar> It is in doms nim in action repo |
04:10:59 | FromGitter | <Willyboar> https://github.com/dom96/nim-in-action-code |
04:11:14 | FromDiscord | <codic> there's a lot of files though |
04:11:18 | FromDiscord | <codic> inside tweeter |
04:11:23 | FromGitter | <Willyboar> Look tweeter at the views folder |
04:11:31 | FromDiscord | <codic> k |
04:11:50 | FromDiscord | <codic> nope, can't find it there :( |
04:12:18 | FromGitter | <Willyboar> Also there is an interrsting video series in jester basics |
04:12:44 | FromDiscord | <codic> Do you know how to return html + resp code tho |
04:13:16 | FromDiscord | <codic> `resp "thing"; return 200` or something? |
04:14:07 | FromGitter | <Willyboar> https://www.youtube.com/playlist?list=PL6RpFCvmb5SGw7aJK1E4goBxpMK3NvkON |
04:14:30 | FromDiscord | <codic> So I should watch the whole series just to find one thing? Not trying to be mean, but.. |
04:15:24 | FromGitter | <Willyboar> Nope. You will find three ways of using templates in jester |
04:15:45 | FromGitter | <Willyboar> Karax, mustache and SCF |
04:16:30 | FromDiscord | <codic> I don't want to use templates, though |
04:16:35 | FromDiscord | <codic> I just want to return a response code |
04:17:28 | FromGitter | <bung87> @rika oh i see |
04:17:51 | FromDiscord | <codic> Seems that I can do `request.status`. I'll do that? |
04:17:53 | * | rockcavera quit (Remote host closed the connection) |
04:19:44 | FromGitter | <bung87> @rika sorry for late, sleeped and now wake |
04:20:28 | * | dadada__ quit (Ping timeout: 258 seconds) |
04:20:59 | FromGitter | <Willyboar> @codic you want to print status code ? |
04:21:12 | FromGitter | <bung87> !eval let x: [string, float];x = ('hello', 10) |
04:21:14 | NimBot | Compile failed: /usercode/in.nim(1, 31) Error: missing closing ' for character literal |
04:21:39 | FromGitter | <bung87> !eval let x: [string, float];x = ("hello", 10) |
04:21:41 | NimBot | Compile failed: /usercode/in.nim(1, 8) Error: type expected, but got: [string, float] |
04:22:09 | FromGitter | <bung87> !eval var x:(string,float);x = ("hello",10) |
04:22:11 | NimBot | Compile failed: /usercode/in.nim(1, 26) Error: type mismatch: got <tuple of (string, int)> but expected 'tuple of (string, float)' |
04:27:05 | * | dadada joined #nim |
04:27:29 | * | dadada is now known as Guest15599 |
04:28:46 | leorize | @codic resp optionally take a HttpCode |
04:31:04 | leorize | @codic also sendFile is what you need |
04:31:53 | * | nsf joined #nim |
04:51:06 | * | Guest15599 quit (Ping timeout: 256 seconds) |
04:57:05 | * | dadada__ joined #nim |
04:58:40 | Prestige | Is it common practice when working with C libs to use unsafeAddr when casting types? |
05:00:42 | Prestige | I'm attempting to invoke this in Nim: https://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html and have been getting mem access errors, so I am probably doing something incorrectly |
05:01:24 | FromDiscord | <Rika> use unsafeAddr only if you cannot use addr is what i'd say |
05:01:28 | FromDiscord | <Rika> but i got no clue how |
05:01:59 | FromGitter | <bung87> it is common |
05:03:46 | Prestige | Maybe I had an incorrect type cast or something, will have to keep at it tomorrow. Getting too tired |
05:12:26 | FromDiscord | <Elegant Beef> Oh hey we got a good bot finally here |
05:12:46 | FromDiscord | <FromIRC> Uptime - 14 hours, 49 minutes, 34 seconds, 188 milliseconds, 265 microseconds, and 139 nanoseconds |
05:12:47 | FromDiscord | <Elegant Beef> !status |
05:16:36 | FromDiscord | <Rika> just noticed? |
05:16:36 | FromDiscord | <__ibrahim__> hey, is there a way to pipe function calls in nim? |
05:16:41 | FromDiscord | <Rika> pipe? |
05:16:44 | FromDiscord | <Rika> what do you mean |
05:16:48 | FromDiscord | <__ibrahim__> | |
05:16:54 | FromDiscord | <Rika> nim is not a shell? |
05:16:58 | FromDiscord | <Elegant Beef> Yea i just notice rika, dont think i was here |
05:17:10 | FromDiscord | <Elegant Beef> Doesnt pipe just send it in through the stdin? |
05:17:20 | FromDiscord | <Rika> no thats another pipe |
05:17:25 | FromDiscord | <Rika> rather thats another redirector |
05:17:28 | FromDiscord | <Elegant Beef> Ah |
05:17:33 | FromDiscord | <Elegant Beef> `>` eh |
05:17:38 | FromDiscord | <Elegant Beef> ? |
05:17:44 | FromDiscord | <Rika> `>` is stdout |
05:18:01 | FromDiscord | <__ibrahim__> say u wanna transform then accumulate then fold |
05:18:21 | FromDiscord | <Rika> just call with UFCS? |
05:19:02 | FromDiscord | <Rika> !eval import sequtils; echo @[1,2,3,4].foldl(a+b) |
05:19:05 | NimBot | 10 |
05:19:31 | FromDiscord | <Rika> !eval import sequtils; echo @[1,2,3,4].mapIt(it * 2).filterIt(it > 4).foldl(a+b) |
05:19:34 | NimBot | 14 |
05:19:45 | FromDiscord | <Rika> look into sequtils |
05:19:48 | FromDiscord | <__ibrahim__> oh sweet |
05:20:13 | FromDiscord | <Elegant Beef> the UFCS is one of the nicest syntaxial things about nim imo |
05:20:23 | FromDiscord | <Rika> i think its syntactic |
05:20:25 | FromDiscord | <__ibrahim__> thank youu that looks great |
05:20:31 | FromDiscord | <Elegant Beef> probably rika |
05:20:33 | * | dadada__ quit (Ping timeout: 265 seconds) |
05:20:41 | FromDiscord | <Elegant Beef> I dont pretend to know how to use english, i just use it |
05:20:53 | FromDiscord | <Rika> or syntactical |
05:21:08 | FromDiscord | <Rika> i'm just some idiot who knows a few words |
05:21:26 | FromDiscord | <__ibrahim__> def not syntaxial, but i like your style Beef |
05:21:44 | FromDiscord | <Elegant Beef> See my name says dont listen to me but you guys did |
05:21:51 | FromDiscord | <Elegant Beef> Follow the manuals guys! |
05:22:32 | FromDiscord | <__ibrahim__> cant hear you sry |
05:22:34 | FromDiscord | <Elegant Beef> Also it's not `def` in nim it's `proc` |
05:22:37 | FromDiscord | <Elegant Beef> 😛 |
05:22:50 | FromDiscord | <Rika> did someone say something? |
05:23:56 | FromDiscord | <__ibrahim__> nope |
05:24:16 | FromDiscord | <Rika> i must be going insane... |
05:24:26 | FromDiscord | <__ibrahim__> `proc` no one said anything |
05:25:57 | FromDiscord | <Rika> (use deffo :P) |
05:26:27 | FromDiscord | <__ibrahim__> `func` |
05:27:04 | * | dadada joined #nim |
05:27:27 | * | dadada is now known as Guest21172 |
05:27:45 | FromDiscord | <Elegant Beef> mefunecdureintion |
05:28:38 | FromDiscord | <Elegant Beef> Im now replacing every reference in nim's repo and replacing proc with the above |
05:28:44 | * | narimiran joined #nim |
05:30:06 | FromDiscord | <Elegant Beef> The previous abomination of a sentence clearly shows i shouldnt ever speak |
05:35:23 | FromDiscord | <__ibrahim__> add some <> and ull have c++ |
05:42:50 | * | muffindrake quit (Quit: muffindrake) |
05:50:34 | * | Guest21172 quit (Ping timeout: 240 seconds) |
05:52:32 | FromGitter | <bung87> any suggestion for contributing to Nim repo that I can handle ? |
05:57:00 | * | dadada__ joined #nim |
06:00:48 | livcd | mratsim: so even andrew himself told you he is not using webview :D |
06:03:08 | Yardanico | oh nice the bot didn't actually crash even once |
06:03:10 | Yardanico | !status |
06:03:10 | FromDiscord | Uptime - 15 hours, 39 minutes, 58 seconds, 620 milliseconds, 739 microseconds, and 366 nanoseconds |
06:03:25 | Yardanico | good morning everyone btw :P |
06:03:36 | FromGitter | <bung87> good morning |
06:04:15 | * | silvernode joined #nim |
06:05:28 | livcd | so who is the notRobot on HN? :P |
06:05:50 | Yardanico | what happened? :P |
06:06:51 | Yardanico | @treeform about source maps - they're implemented in devel |
06:07:08 | FromDiscord | <Elegant Beef> Hello yard |
06:07:21 | Yardanico | @treeform https://github.com/nim-lang/Nim/pull/7508 |
06:07:23 | disbot | ➥ Sourcemap for JS |
06:09:33 | * | muffindrake joined #nim |
06:09:53 | * | mwbrown quit (Ping timeout: 260 seconds) |
06:10:24 | honger | Hey folks, I'm trying to start a process in a test, write to it's stdin and compare the stdout. This is kinda what I'm doing: https://play.nim-lang.org/#ix=2lX1 but I get a PIPE CLOSED error when I get to the outputStream.readLine(). Any suggestions as to what I'm doing wrong? |
06:12:19 | Yardanico | oh nice seems like another arc move/sink bug with the same havlak benchmark :P gonna minimize |
06:12:44 | FromDiscord | <Elegant Beef> What module is startCommand from? |
06:13:09 | FromDiscord | <Elegant Beef> or do you mean startProcess? |
06:15:23 | FromDiscord | <Elegant Beef> Yea idk i've done similar to you and never had any issues |
06:20:25 | * | dadada__ quit (Ping timeout: 246 seconds) |
06:20:57 | Yardanico | @clyybber seems like I found another arc move/sink bug (SIGSEGV at runtime only with arc/orc), and tested it with ping-pong PR and it still fails, gonna try to minimize :P |
06:22:34 | honger | Elegant Beef sorry, I definitely meant startProcess |
06:23:46 | FromDiscord | <Gary M> One of my favorite syntaxial things |
06:24:03 | FromDiscord | <Elegant Beef> Shut the fuck up gary, no one likes you 😛 |
06:24:18 | FromDiscord | <Gary M> See it's funny because people do like me |
06:24:36 | FromDiscord | <Elegant Beef> I thought it was funny cause i **was** your friend |
06:24:49 | FromDiscord | <Gary M> And that's why you're special beef |
06:25:15 | FromGitter | <bung87> `Error: unhandled exception: Connection was closed before full request has been made [ProtocolError]` when `nimble publish` dont know whether request blocked by GFW |
06:25:27 | Yardanico | well that's not nimble's fault |
06:25:42 | Yardanico | and it's not in nimble's scope of tasks to handle that |
06:27:02 | * | dadada joined #nim |
06:27:11 | FromGitter | <bung87> I would like to get the request url when this error come |
06:27:25 | * | dadada is now known as Guest83034 |
06:27:41 | * | solitudesf joined #nim |
06:29:49 | * | mwbrown joined #nim |
06:42:08 | FromGitter | <bung87> I just noticed It created pr successed even this error throwed |
06:51:10 | * | Guest83034 quit (Ping timeout: 256 seconds) |
06:51:51 | * | dadada__ joined #nim |
06:56:20 | * | silvernode quit (Ping timeout: 256 seconds) |
07:08:07 | * | gokr joined #nim |
07:18:13 | * | Vladar joined #nim |
07:19:59 | * | letto_ quit (Read error: Connection reset by peer) |
07:27:42 | * | letto_ joined #nim |
07:34:01 | * | Trustable joined #nim |
07:38:19 | * | tane joined #nim |
07:43:14 | FromDiscord | <Zed> weird question, how much work would it be to implement braces into the language instead of using the colon and indentation? |
07:43:23 | Yardanico | they already were in the language but were removed |
07:43:32 | Yardanico | the thing is that you need to support two different syntaxes at the same time |
07:43:32 | FromDiscord | <Zed> bummer |
07:43:48 | Yardanico | and indentation syntax is the hardest out of indentation/braces/begin|end |
07:44:03 | FromDiscord | <Zed> could you modularise the syntax |
07:45:08 | FromDiscord | <Zed> change the parser to interpret the syntax and generate the correct syntax the compiler wants |
07:45:37 | Yardanico | well I think it was done in a similar way |
07:45:51 | Yardanico | but it still requires more work to update two syntaxes at the same time |
07:46:39 | FromDiscord | <Rika> then you would also have no tools that supported the new syntax im guessing |
07:47:13 | Yardanico | well you can check how they were implemented in the compiler if you download the tree from somewhere between 2017~2018 |
07:47:18 | Yardanico | i mean braces |
07:47:38 | Yardanico | see https://github.com/nim-lang/Nim/commit/10bd488daafa79f52fec0d5e7ea76ec8d5902465 |
07:48:05 | FromDiscord | <Rika> also you'll have syntax clash with the key-val tuple constructor and the set constructor |
07:48:14 | Yardanico | wdym? |
07:48:21 | Yardanico | that can be solved of course |
07:48:38 | FromDiscord | <Rika> i mean yeah of course but that's still extra work |
07:48:54 | Yardanico | yeah that's why they were removed |
07:48:59 | Yardanico | and they weren't used by people anyway |
07:52:37 | FromDiscord | <Rika> NGL braced nim looks SUPER DUPER funky |
07:52:43 | Yardanico | XD |
07:53:30 | FromDiscord | <Rika> it looks both normal and wrong |
07:53:39 | FromDiscord | <Rika> like it looks "oh, c style language" |
07:53:43 | * | PMunch joined #nim |
07:53:50 | FromDiscord | <Rika> but also super wrong like "this should not be |
07:53:52 | Yardanico | well braces don't neccessarily mean "c style language" :P |
07:54:00 | FromDiscord | <Rika> i mean, of course |
07:54:04 | FromDiscord | <Rika> but that's my first idea |
07:54:29 | Yardanico | see what I found https://python-with-braces.appspot.com/ |
07:54:40 | FromDiscord | <Rika> import braces |
07:54:47 | Yardanico | no, this is not the joke one |
07:55:11 | FromDiscord | <Rika> ```↵Add indentation support to C language↵Add braces to Ruby↵``` |
07:55:13 | FromDiscord | <Rika> w hat |
07:55:27 | Yardanico | https://github.com/eshirazi/python-with-braces/commit/9c9c0079e4ac5b2ccec1056ac90c94daf89165a6 |
07:55:35 | Araq | fwiw I wouldn't mind optional 'end if' in the language |
07:55:46 | FromDiscord | <Rika> end if? |
07:55:50 | Yardanico | yeah, like lua |
07:55:56 | Araq | if foo: x else: y end if |
07:56:15 | PMunch | Isn't there one? |
07:56:18 | FromDiscord | <Rika> wanna be bash and use fi? |
07:56:19 | FromDiscord | <Rika> xd |
07:56:27 | Yardanico | PMunch: it was never implemented |
07:56:30 | PMunch | At least for when you use syntax filters for HTML stuff |
07:56:31 | Araq | 'end' is a keyword, PMunch, but it remains unused |
07:56:34 | Yardanico | if you mean the "endx" syntax skin |
07:56:46 | Araq | well it is a thing in source code filters |
07:56:49 | FromDiscord | <Rika> i dont know about the end if thing, i kinda dont like it |
07:56:58 | Yardanico | "optional" |
07:57:04 | PMunch | Yeah, this stuff: https://nim-lang.org/docs/filters.html#available-filters-stdtmpl-filter |
07:57:07 | FromDiscord | <Rika> ahhh, then that's fine |
07:57:15 | FromDiscord | <Rika> i |
07:57:17 | FromDiscord | <Rika> i didnt see it |
07:57:22 | FromDiscord | <Rika> i think my head is skipping words |
07:57:26 | Yardanico | !status |
07:57:27 | FromDiscord | Uptime - 17 hours, 34 minutes, 15 seconds, 573 milliseconds, 239 microseconds, and 504 nanoseconds |
07:57:31 | PMunch | "Because indentation-based parsing is not suited for a templating engine, control flow statements need end X delimiters." |
07:58:01 | PMunch | Yardanico, what happens when you edit a message on the new bridge? |
07:58:08 | Yardanico | well for simple cases it works |
07:58:18 | FromDiscord | <Yardanico> hello world |
07:58:21 | PMunch | Define works |
07:58:21 | FromDiscord | <Yardanico> (edit) 'world' => 'word' |
07:58:28 | PMunch | Oh cool |
07:58:32 | FromDiscord | <Yardanico> (edit) 'hello ... word' => 'helloadd' |
07:58:38 | Yardanico | this is a bit broken though |
07:58:44 | Yardanico | when inserting in the middle |
07:59:16 | FromDiscord | <Yardanico> (edit) |
07:59:22 | Yardanico | this is even more broken it seems |
07:59:33 | FromDiscord | <Rika> is it bren? |
07:59:37 | FromDiscord | <Rika> (edit) 'bren?' => 'broken?' |
07:59:39 | FromDiscord | <Rika> 😛 |
07:59:52 | Yardanico | and the edit handling rn is kinda spaghetti code because it's kinda complicated |
08:00:07 | Yardanico | https://github.com/Yardanico/ircord/blob/master/src/ircord.nim#L298 |
08:01:18 | PMunch | Hmm, I see |
08:01:30 | Yardanico | I'm using "diff" - difflib (Pythn) port to Nim |
08:01:33 | PMunch | Still pretty good though |
08:01:54 | Yardanico | although I also use both regex and npeg :D |
08:02:05 | Yardanico | also parsetoml for config |
08:04:31 | PMunch | Maybe you should use NimScript for config ;) |
08:04:42 | Yardanico | yeah, embed the whole compiler :D |
08:04:44 | Yardanico | like nimph |
08:04:47 | * | dddddd joined #nim |
08:04:49 | PMunch | I found the bug in my custom stdlib stuff yesterday :) |
08:04:55 | PMunch | FinallyI |
08:05:10 | FromGitter | <Willyboar> Hello guys! |
08:05:17 | Yardanico | hmm maybe I should use npeg to replace IRC formatting with markdown |
08:05:19 | PMunch | I mean my test file only comes out to 1.3MB |
08:05:20 | Yardanico | would not be that hard |
08:05:33 | FromGitter | <Willyboar> Do you know the nim lib with the most stars except the nim itself? |
08:05:35 | PMunch | Ooh, that'd be neat |
08:05:41 | Yardanico | @Willyboar library or any repository? |
08:05:47 | FromGitter | <Willyboar> any |
08:05:52 | Yardanico | https://github.com/oakes/vim_cubed |
08:06:05 | Yardanico | it's a joke project :P |
08:06:09 | PMunch | Haha :P |
08:06:14 | PMunch | Of course that has the most stars :P |
08:06:36 | Yardanico | @Willyboard you can easily search yourself |
08:06:42 | Yardanico | https://github.com/search?o=desc&q=language%3Anim+stars%3A%3E100&s=stars&type=Repositories |
08:06:54 | FromGitter | <bung87> @alehander92 found I can tranpile source file .ts and .d.ts , so it will generate source translation version and bridge version. |
08:07:16 | FromGitter | <Willyboar> Yardanico i used exact the same search query |
08:07:20 | FromGitter | <Willyboar> :P |
08:08:12 | livcd | Yardanico: is deepcopy working with arc/orc already? |
08:08:18 | Yardanico | not yet |
08:08:22 | Yardanico | https://github.com/nim-lang/Nim/issues/13997 |
08:08:24 | disbot | ➥ ARC: deepCopy in new runtime feature missing, do we have alternatives? |
08:08:40 | FromGitter | <Willyboar> @PMunch alehander92 watching for you yesterday |
08:08:42 | Yardanico | well it will probably be available :P |
08:09:03 | PMunch | Willyboar, oh? |
08:09:07 | Yardanico | hmm I want to try something interesting |
08:09:10 | Yardanico | compile https://github.com/nim-lang/Aporia with latest nim |
08:09:22 | Yardanico | poor aporia :c |
08:09:26 | FromGitter | <Willyboar> Something about web framework ideas |
08:10:03 | Yardanico | "import asyncio" oh lol |
08:11:51 | FromGitter | <Willyboar> @yardanico it would be interesting to see aporia alive |
08:12:03 | Yardanico | well at this point it would be easier to rewrite it from scratch :P |
08:12:06 | Yardanico | it's gtk2 |
08:13:20 | FromGitter | <Willyboar> by the way aporia means question |
08:13:38 | PMunch | Yardanico, make it compile with --gc:arc :P |
08:13:43 | Yardanico | PMunch: sure /s |
08:13:52 | Yardanico | well I mean it could be possible |
08:13:54 | Yardanico | but why |
08:13:58 | PMunch | Willyboar, really? What language? |
08:14:05 | FromGitter | <Willyboar> Greek |
08:14:12 | PMunch | Yardanico, you know me, I don't need a why :P |
08:14:20 | Yardanico | did the compilation finish? |
08:15:14 | PMunch | Nope |
08:15:33 | FromGitter | <Willyboar> @PMunch if you decide to start a web framework with alehander i am in |
08:15:46 | PMunch | Been running for 147h atm, currently sitting at 60.5GB of RAM usage, up after the dip yesterday |
08:15:57 | PMunch | CPU usage is still low, so I think it's doing IO or swapping to cache |
08:16:10 | PMunch | I've used 47GB of my cache now |
08:17:04 | PMunch | @Wyllyboar, oh neat. Yesterday we were just talking about comparing notes to see if we wanted to go in the same direction with it |
08:18:08 | FromDiscord | <Rika> the big 308 million argument function project |
08:18:12 | FromGitter | <Willyboar> Well i am not in the level to help a lot writing one but i can help as a user |
08:18:48 | FromGitter | <Willyboar> also i can help with designs, websites, examples and other dirty stuff |
08:19:29 | PMunch | All definitely useful contributions |
08:19:50 | PMunch | @Rika, place your bets now for when it finishes compiling! |
08:19:56 | livcd | I would welcome a performant http server that is cross platform |
08:20:28 | PMunch | My focus has been primarily on features |
08:20:50 | PMunch | But Jester has pretty good performance, no? |
08:21:04 | FromGitter | <Willyboar> yeap |
08:21:05 | livcd | on linux |
08:21:24 | PMunch | Oh, is the performance poor on Windows? |
08:21:44 | livcd | httpbeast does not work on Windows |
08:21:46 | FromGitter | <Willyboar> Because of httpbeast |
08:21:48 | PMunch | TBH though, if I could sacrifice performance on Windows for performance on Linux for a webserver I'd definitely do it |
08:22:07 | PMunch | Pretty much every single production webserver runs on Linux |
08:22:24 | FromGitter | <Willyboar> I don't think anyone will host an application is not C# in a windows server |
08:22:32 | livcd | We do a lot |
08:22:38 | livcd | but that's not the point |
08:23:06 | FromDiscord | <Rika> PMunch: a month |
08:23:33 | livcd | If you exclude the pure backend service your "desktop" application could still use a performant http server |
08:25:19 | FromGitter | <Willyboar> Yes but i think asynchttpserver is not that slow |
08:25:23 | PMunch | Oh for sure, I was just saying that if I could pick one or the other |
08:25:33 | FromGitter | <Willyboar> just httpbeast is very fast |
08:25:40 | livcd | Willyboar: Absolutely!. |
08:27:49 | FromGitter | <Willyboar> i would like to see something between flask and rails/django |
08:28:30 | livcd | jester++ |
08:28:33 | FromGitter | <Willyboar> let's say a flask with blueprints |
08:29:08 | livcd | There are numerous efforts already...it's hard to pick something that is maintained and actively used. |
08:30:04 | FromGitter | <Willyboar> yes there is a lot but none of them have a nice website with an example or a simple tutorial |
08:32:26 | Araq | =deepcopy is so simple to do... |
08:32:31 | * | Araq sighs |
08:34:52 | Yardanico | LOL |
08:34:56 | Yardanico | I actually made aporia compile with latest nim |
08:34:57 | Yardanico | what |
08:35:18 | Yardanico | the hardest part was to change some async code to use asyncdispatch |
08:35:42 | Yardanico | although there are still places where it crashes because null terminator isn't accessible anymore |
08:38:01 | Yardanico | https://i.imgur.com/j0YDcdz.png |
08:38:54 | Araq | so now I know that "CPS macros" always compose |
08:39:04 | * | dadada__ quit (Ping timeout: 256 seconds) |
08:39:21 | Araq | now I only need to know what the heck a "CPS macro" is |
08:39:31 | FromGitter | <Willyboar> looks a nice @Yardanico |
08:39:31 | PMunch | Wait, is Aporia not using a monospace font :S |
08:40:00 | Yardanico | it didn't require so many changes either https://github.com/Yardanico/Aporia/commit/7226d251bcc18dd614ccf133ecc71b9b33c3ec3f |
08:40:10 | Yardanico | well in some places it will still crash I think |
08:40:22 | Yardanico | because it was made when you could do case object transitions and access null terminator |
08:40:25 | FromDiscord | <Recruit_main707> can you change the theme of the ide? |
08:41:13 | narimiran | Yardanico: off by one? https://github.com/Yardanico/Aporia/commit/7226d251bcc18dd614ccf133ecc71b9b33c3ec3f#diff-456c5aab7b3f0fbb350c6c1a23a9b424R26 |
08:41:29 | Yardanico | narimiran: ah lol :P |
08:41:43 | narimiran | utils.nim, line 503, the same |
08:42:11 | * | dadada joined #nim |
08:42:14 | narimiran | `for i in 0 .. tasks-1:` --> using `..<` is nicer, IMO |
08:42:24 | Yardanico | well don't blame me :P |
08:42:29 | narimiran | i don't :) |
08:42:30 | PMunch | This is actually a bit of a success story for those who worry about Nim compatibility |
08:42:32 | Yardanico | I just did the bare minimum to make it compile |
08:42:34 | * | dadada is now known as Guest19094 |
08:43:17 | narimiran | and you did a really good job, make no mistake! |
08:43:28 | Yardanico | "while i < text.len" should work I guess? |
08:43:36 | Yardanico | ah no wait |
08:44:28 | narimiran | nope, now i see :) |
08:44:34 | narimiran | `var j = i+1` |
08:44:36 | Yardanico | yeah |
08:45:06 | narimiran | but the first example should be ok without `- 1` part, from what i'm seeing |
08:47:00 | Yardanico | it actualy looks quite nice with fira code |
08:47:11 | Yardanico | https://i.imgur.com/JrvG4Yj.png |
08:48:12 | FromGitter | <Willyboar> Doesn't support file tree? |
08:48:39 | FromDiscord | <Rika> you know whats a mindfuck for me? `..<` is idiomatic but `..^` technically isnt |
08:50:40 | FromDiscord | <mratsim> @Araq send a mail to the author 😛 |
08:50:45 | Yardanico | lol |
08:51:09 | Yardanico | narimiran: I changed some stuff, not sure if it's correct though https://github.com/Yardanico/Aporia/commit/5b9f4355dbc4442b77d4aafc1ecb876c026eb617 |
08:51:55 | FromDiscord | <mratsim> I suppose you stumbled upon:↵https://pdfs.semanticscholar.org/7525/75dc24b2bb6e74ee6146df71860e10e3aee9.pdf↵https://staff.fmi.uvt.ro/~mircea.marin/lectures/FP/L-10.pdf |
08:53:01 | Araq | Yardanico, write a guest blog post about it, it's very nice |
08:53:29 | FromDiscord | <mratsim> > Thispaperdiscussesthecom-putationalpoweroftheSchememacrosystemasafunc-tionallanguageinitself,considersitslimitationsinexpres-siveness,andrelateshowthetechniqueofwritingmacrosinacontinuation-passingstyle|onethathasbeenusedbyseriouspractitionersforsometime|providesawaytogetaroundsomeoftheselimitations.↵yeah broken PDF copy |
08:53:44 | FromDiscord | <mratsim> "serious practictioners" |
08:54:04 | Araq | mratsim: oh nice, that's a document I haven't seen |
08:54:15 | PMunch | Araq, second the post! |
08:55:22 | FromDiscord | <mratsim> https://www.csee.umbc.edu/courses/undergraduate/331/resources/lisp/onLisp/20continuations.pdf↵↵20.2 Continuation Passing Macros |
08:56:33 | FromDiscord | <mratsim> handout: program transformation to CPS: https://www.cs.toronto.edu/~david/csc324/assignments/a2/handout.html |
08:57:24 | narimiran | +1 on Yardanico writing a blog post about it |
08:57:25 | FromDiscord | <mratsim> This seems quite deep as well: https://www.brics.dk/RS/06/15/BRICS-RS-06-15.pdf |
08:57:32 | narimiran | or maybe even Nim Conference talk ;) |
08:57:49 | Araq | mratsim: I know CPS, but I'm too stupid to apply it to macros |
08:58:05 | Araq | I mean, I can guess how it would look like |
08:58:20 | Araq | but it would need language support |
08:59:03 | FromGitter | <Willyboar> @narimiran or both... |
08:59:11 | Yardanico | hah |
08:59:12 | PMunch | Ooh, I think I just found my NimConf topic! |
08:59:55 | FromDiscord | <mratsim> @Araq I find continuation quite useful but I don't understand CPS 😛 |
09:00:09 | Yardanico | PMunch: it finished?! |
09:00:16 | PMunch | Haha, no |
09:00:40 | PMunch | Maybe it'll complete some time before NimConf :P |
09:00:43 | Araq | mratsim: I'm thinking about using CPS to unify Nim's iterators, closure iterators, async, threading and as an IR for injectdestructors and DrNim |
09:01:09 | FromGitter | <Willyboar> @PMunch it''complete the day of the conference |
09:01:26 | PMunch | Wouldn't that be something ! |
09:02:03 | Yardanico | what's the day of nimconf? which day of june? |
09:02:04 | FromDiscord | <mratsim> I just read Intel TBB on continuation passing and I don't understand 😛 https://software.intel.com/en-us/node/506106 |
09:02:11 | PMunch | 6th I think |
09:15:34 | * | Guest19094 is now known as dadada |
09:15:40 | dadada | yo |
09:16:19 | dadada | is there a std proc that splits a sequence into many parts of the same size (except for the last part => rest) |
09:16:38 | * | Vladar quit (Quit: Leaving) |
09:16:41 | FromGitter | <bung87> (https://files.gitter.im/nim-lang/Nim/PHhe/Screenshot-2020-05-14-at-5.16.22-PM.png) |
09:17:56 | FromGitter | <bung87> I can steal many node modules now |
09:18:34 | FromDiscord | <Recruit_main707> dadada: i dont think so, thats pretty specific (not sure though) |
09:19:22 | Yardanico | dadada: there's https://nim-lang.org/docs/sequtils.html#distribute%2Cseq%5BT%5D%2CPositive |
09:19:31 | Yardanico | I guess it's what you need? |
09:20:03 | * | vqrs quit (Ping timeout: 260 seconds) |
09:21:21 | dom96 | Yardanico, bet you can still get the asyncio module from an old Nim |
09:21:27 | dom96 | (or just use an old Nim ;)) |
09:21:31 | Yardanico | dom96: yes but I compiled without it :P |
09:21:38 | Yardanico | idk if everything works correctly though, didn't test yet really |
09:22:34 | * | vqrs joined #nim |
09:23:23 | * | letto joined #nim |
09:25:56 | * | letto_ quit (Ping timeout: 256 seconds) |
09:26:34 | * | konvertex joined #nim |
09:34:06 | Yardanico | ah also btw, about nimconf - is it decided where it will be hosted? |
09:34:16 | Yardanico | which platform |
09:34:34 | dom96 | nope |
09:35:30 | PMunch | Jitsi? |
09:35:43 | PMunch | Quick, someone throw together a Nim video conferencing app! |
09:36:27 | Yardanico | haha |
09:36:38 | Yardanico | don't forget to embed tracking and fake e2e encryption too |
09:36:45 | Yardanico | and say that it was made in V |
09:43:04 | FromDiscord | <Gary M> sent a code paste, see http://ix.io/2lYf |
09:43:05 | livcd | :D evil |
09:43:18 | FromDiscord | <Gary M> I'm having issues with this generic |
09:43:39 | FromDiscord | <Gary M> the components array is an array[MaxEntities, T] |
09:44:03 | FromDiscord | <Gary M> I can access it fine with the int literal but not with a variable int |
09:46:28 | Yardanico | !status |
09:46:29 | FromDiscord | Uptime - 19 hours, 23 minutes, 17 seconds, 279 milliseconds, 403 microseconds, and 443 nanoseconds |
09:47:57 | * | abm joined #nim |
09:48:44 | FromDiscord | <mratsim> @Gary M what's the error? |
09:49:05 | FromDiscord | <Gary M> https://i.imgur.com/BZ2usnj.png |
09:49:29 | FromDiscord | <Gary M> it's just blowing up lol |
09:49:38 | Yardanico | can you show the end of that error? |
09:49:43 | Yardanico | the bottom |
09:49:50 | Yardanico | it shows which types mismatched |
09:50:08 | FromDiscord | <Gary M> https://i.imgur.com/hWbBJKA.png |
09:50:11 | FromGitter | <nothratal> The documentation says that if I'm using the js backend I won't have file management capabilities. Is this also the case if I'm using it with nodejs? With nodejs I can handle files too. |
09:50:18 | Yardanico | no, even more at bottom @nothratal |
09:50:29 | Yardanico | @nothratal yes, because JS backend is mainly targeted at frontend |
09:50:35 | FromDiscord | <Gary M> that's the end of the error |
09:50:38 | Yardanico | nim's IO is not really ported to nodejs |
09:50:38 | FromDiscord | <Gary M> when I compile |
09:50:45 | Yardanico | except simple stuff like "echo" |
09:50:50 | Yardanico | no stdin/stdout, no files |
09:50:58 | Yardanico | you'll have to wrap them manually but it's not so hard |
09:51:07 | FromGitter | <nothratal> ok |
09:51:10 | FromGitter | <nothratal> just asking |
09:51:21 | Yardanico | it's not so hard really |
09:51:23 | FromGitter | <nothratal> you right, interop-examples are also listed there |
09:51:34 | Yardanico | you can just go away with emit and a few nim bindings :P |
09:52:15 | Yardanico | a bit of a problem is that nodejs is evented (async), so you'll have to write a blocking JS function to read from stdin for example (for stdin) |
09:53:39 | FromGitter | <nothratal> oookey...I have to admit that I don't have an actual use case yet :P ⏎ Just reading through the documentation |
09:54:00 | Yardanico | nodejs is really only used for the test suite, all other work is mostly concentrated on the frontend (JS in browsers) |
09:54:15 | FromGitter | <nothratal> but good to know, I try to keep it in mind |
09:59:38 | FromDiscord | <Gary M> meanwhile still trying to understand why a variable isn't working as an array accessor |
09:59:51 | Yardanico | wait what is T() |
09:59:53 | Yardanico | is T == int ? |
10:00:39 | FromDiscord | <Solitude> can you reduce it to minimal example we can run? |
10:00:49 | Yardanico | oh nice solitude now you're in discord :D |
10:00:53 | FromDiscord | <Gary M> sent a code paste, see http://ix.io/2lYh |
10:00:54 | FromDiscord | <Gary M> I'll try |
10:02:21 | Yardanico | Reducing an example is fun https://gist.github.com/Yardanico/3de13a8e8cfdbd59b80d5ebd2ac2c80e/revisions |
10:02:26 | Yardanico | read from bottom up :D |
10:03:49 | PMunch | Haha from 256 lines down to 14? |
10:04:16 | Yardanico | yeah, see https://github.com/nim-lang/Nim/issues/14345 |
10:04:19 | disbot | ➥ [ORC] Incorrect sink inference ; snippet at 12https://play.nim-lang.org/#ix=2lYi |
10:06:35 | skrylar[m] | so i was looking at ways to handle events and came up with one that seems neat, but haven't decided if it sucks or not. its basically the typical tagged union message stack, but i was looking at having a macro where it takes a bunch of `when <event>` statements, creates the dispatcher from that, as well as the hidden variant type and enum, and makes shims using the `_: type[something]` trick so you can subscribe random event |
10:06:35 | skrylar[m] | emitters to the mailboxes and they hide the whole variant repacking steps from you |
10:07:10 | Yardanico | a lot of text but sounds good :P |
10:07:31 | FromGitter | <nothratal> ok, now a question to a real "issue". I'm gathering information about a huge java project we have (don't ask why, the project is a mess). For doing this I use nim to go over all files, calling some regex methods and also counting some things....For better understanding I'm logging the time for processing all the files. ⏎ Now the actual "issue": ⏎ ⏎ ⏎ output of the first run: ... |
10:07:32 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=5ebd1863519b852e93ef78f6] |
10:07:32 | Yardanico | also make it threadsafe :D |
10:07:36 | skrylar[m] | downside is each unique mailbox ends up adding a bunch of tiny procs to the symbol table just to copy stuff around :/ |
10:07:45 | FromDiscord | <Gary M> https://play.nim-lang.org/#ix=2lYl |
10:07:55 | FromDiscord | <Gary M> @Solitude this is the bare minimum for the example |
10:09:15 | Yardanico | of course it wouldn't work ? |
10:09:20 | Yardanico | ah wait |
10:09:22 | Yardanico | hmm |
10:09:46 | FromDiscord | <Gary M> it's just an int |
10:09:53 | skrylar[m] | Yardanico: you end up with a bunch of these `proc acceptor(mailbox: type[Mailbox]; letter: type[CollisionStarted]): PostboxAcceptor =` |
10:09:56 | FromDiscord | <Gary M> but it only works with a literal, not a variable |
10:10:14 | Yardanico | of course |
10:10:18 | Yardanico | your variable is int |
10:10:20 | Yardanico | EntityId is uint32 |
10:10:43 | FromGitter | <nothratal> By the way I'm not caching anything. I don't want to complain that it's blazing fast the second time. I just want to know why it isn't the first time |
10:11:23 | FromDiscord | <Gary M> ah that was it, thanks 🙂 |
10:12:45 | narimiran | NimConf 2020: https://nim-lang.org/blog/2020/05/14/nim-conference.html |
10:12:51 | Yardanico | 20th ? |
10:13:01 | Yardanico | PMunch: you were *just a little bit* wrong :P |
10:13:01 | narimiran | yeah, we decided to move the date a bit |
10:13:04 | Yardanico | well it's fine |
10:13:07 | * | honger quit (Ping timeout: 260 seconds) |
10:14:35 | Yardanico | a small nitpick: the google form still says "Event Timing: Saturday, June 6th, 2020" |
10:14:49 | FromGitter | <Willyboar> when did you publish the programm? |
10:14:55 | Yardanico | @Willyboar ? |
10:15:00 | * | honger joined #nim |
10:15:03 | narimiran | Yardanico: thanks for catching that, fixing it ASAP |
10:15:39 | * | JustASlacker joined #nim |
10:15:44 | narimiran | now it should be ok |
10:15:52 | Yardanico | that was fast :P |
10:16:00 | narimiran | that's what she said |
10:16:05 | Yardanico | ohno |
10:16:12 | narimiran | that too :) |
10:16:34 | PMunch | Yardanico, only slightly :P |
10:16:41 | PMunch | Yeah, that's where I got my date from |
10:16:46 | PMunch | The Google sheet that is |
10:21:11 | alehander92 | morning |
10:22:53 | PMunch | Good morning |
10:23:27 | Yardanico | ohayo |
10:25:32 | * | dadada quit (Ping timeout: 265 seconds) |
10:26:56 | FromGitter | <Willyboar> good morning @alehander92 |
10:27:52 | alehander92 | finally in Sofia |
10:27:56 | alehander92 | first time since March |
10:28:15 | FromGitter | <Willyboar> where are you pass the lockdown? |
10:28:44 | alehander92 | i was in plovdiv, we had police checks on roads between cities unless you fill a declaration |
10:29:32 | FromGitter | <Willyboar> yes we have too |
10:29:55 | FromGitter | <Willyboar> but we make it good |
10:31:28 | FromGitter | <bung87> @alehander92 I thought I could translate source file and .d.ts, so the result package has both source version and bridge version. |
10:32:27 | FromGitter | <bung87> when source version is not good ,just using bridge version |
10:43:14 | alehander92 | bung87 ok, sounds interesting |
10:43:30 | alehander92 | Willyboar were you from thessalonici? |
10:43:49 | * | fredrikhr joined #nim |
10:43:52 | FromGitter | <Willyboar> I born in thessaloniki |
10:44:08 | FromGitter | <Willyboar> also lived here until 17 |
10:45:19 | FromGitter | <Willyboar> my parents live there |
10:54:19 | alehander92 | awesome |
10:57:06 | * | dadada joined #nim |
10:57:30 | * | dadada is now known as Guest68640 |
11:07:06 | FromDiscord | <Technisha Circuit> Are there any alternative Nim compilers? |
11:07:21 | FromDiscord | <Technisha Circuit> I'm just curious rn :P |
11:07:40 | FromDiscord | <Recruit_main707> nlvm |
11:07:44 | FromDiscord | <Recruit_main707> linux only |
11:07:50 | FromDiscord | <Technisha Circuit> Oh? |
11:07:59 | FromDiscord | <Recruit_main707> compiles nim directly to llvm |
11:08:36 | alehander92 | nope |
11:08:39 | FromDiscord | <Technisha Circuit> Is there any advantages/disadvantages compared to the normal compiler? |
11:08:39 | alehander92 | no other frontends |
11:08:50 | alehander92 | but yeah, nlvm is a different backend |
11:08:59 | FromDiscord | <Technisha Circuit> :P |
11:09:07 | alehander92 | yes, it compiles to llvm |
11:09:16 | Yardanico | for nim it's just like another backend, yeah |
11:09:18 | alehander92 | you have to ask arnetheduck |
11:09:27 | Yardanico | he's on discord, not here |
11:09:29 | Yardanico | you can ping him :P |
11:09:32 | alehander92 | @arnetheduck |
11:09:39 | FromDiscord | <Recruit_main707> you can also ;) |
11:10:00 | * | Guest68640 is now known as dadada |
11:10:40 | FromDiscord | <Technisha Circuit> Nlvm apparently doesn't work on arm |
11:11:12 | Yardanico | well it's not that *hard* to do it if you know stuff |
11:11:39 | Yardanico | nlvm is linux x86_64 only because of lack of interested people who actually participate in development :P |
11:11:40 | alehander92 | so, `except`: doesnt catch Defects, right? |
11:11:49 | FromDiscord | <Technisha Circuit> I'm attempting to compile it :p |
11:11:55 | Yardanico | alehander92: in --panics:on it doesn't afaik |
11:12:00 | Yardanico | not sure about without them |
11:12:38 | alehander92 | hm, so it directly panics |
11:12:39 | alehander92 | ? |
11:12:48 | alehander92 | is there a way to raise an exception that |
11:12:58 | alehander92 | is not .. catched by default .. |
11:13:02 | alehander92 | this doesnt make a lot of sense, right |
11:13:15 | Yardanico | it does |
11:14:22 | FromDiscord | <Doongjohn> does nim have weak ref built in? |
11:14:28 | FromDiscord | <Technisha Circuit> This is my issue now :/ https://media.discordapp.net/attachments/371759389889003532/710449946674855976/Screenshot_20200514_121415_com.termux.jpg |
11:14:45 | FromDiscord | <Technisha Circuit> > does nim have weak ref built in?↵@Doongjohn i think it's something similar to weakref |
11:15:01 | FromDiscord | <Technisha Circuit> I can't use GCC because of Termux |
11:15:27 | FromDiscord | <Technisha Circuit> I'm using clang |
11:16:01 | dadada | Araq: hi, sorry for taking time away from your day, but is there really no way to get the macro/template/pragma expanded version of all sources? like nimcache for the C target source? |
11:16:17 | Yardanico | @Technisha don't even try |
11:16:27 | Yardanico | LLVM is really big to compile |
11:16:35 | Yardanico | and nlvm is only x86_64 including the backend itself |
11:16:39 | Yardanico | it won't magically work on arm |
11:17:02 | FromDiscord | <Recruit_main707> clang compiles to llvm if im not mistaken also |
11:17:02 | FromDiscord | <Technisha Circuit> Eh |
11:17:09 | FromDiscord | <Technisha Circuit> It does iirc |
11:17:12 | Yardanico | @Recruit_main707 yes it does |
11:17:23 | Yardanico | but clang in termux is probably not using llvm 10 |
11:17:41 | FromDiscord | <Doongjohn> > @Doongjohn i think it's something similar to weakref↵@Technisha Circuit what's "it"? |
11:17:46 | FromDiscord | <Recruit_main707> you are enjoying your new @ s :P |
11:17:55 | FromDiscord | <Technisha Circuit> I am not sure @Doongjohn, sorry |
11:18:53 | FromDiscord | <Technisha Circuit> I'm going to try and get gcc aswell :P |
11:19:01 | Yardanico | @Technisha how much RAM do you have? |
11:19:18 | FromDiscord | <Technisha Circuit> 4 gb :P |
11:19:25 | FromDiscord | <Technisha Circuit> But it's on my phone sooooooo |
11:19:26 | Yardanico | and how much cores? |
11:19:39 | FromDiscord | <Technisha Circuit> I am not sure, let me check |
11:20:09 | FromDiscord | <Technisha Circuit> Octacore apparently |
11:20:28 | FromDiscord | <Technisha Circuit> It's a Huawei p30 lite |
11:22:50 | Yardanico | you might be able to compile llvm 10 if you use like 4 cores |
11:23:01 | FromDiscord | <Technisha Circuit> Oh? |
11:23:47 | Yardanico | you need a lot of memory to compile in parallel |
11:24:00 | FromDiscord | <Technisha Circuit> Oof |
11:24:08 | Yardanico | so yeah, I wouldn't recommend you even trying |
11:24:11 | FromDiscord | <Technisha Circuit> I think it'll be fine :P |
11:24:27 | Yardanico | it won't :) |
11:24:31 | FromDiscord | <Technisha Circuit> (Then my phone crashes) |
11:24:48 | FromDiscord | <Technisha Circuit> Eh, I'm stubborn so i say it's better to try then not |
11:26:27 | * | gokr quit (Quit: Leaving.) |
11:26:50 | dadada | disruptek: hey, as you implemented IC, maybe you know something about it too, does Nim save the expanded macros/templates/pragmas version of sources somewhere where I can access them? |
11:27:04 | Yardanico | well not in the files for sure :P |
11:27:55 | FromDiscord | <Technisha Circuit> :P |
11:57:50 | * | theelous3 joined #nim |
12:03:00 | * | monokrom joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:40 | * | supakeen joined #nim |
12:15:15 | alehander92 | dadada you can expandMacros: |
12:15:18 | alehander92 | otherwise |
12:15:27 | alehander92 | we want something like that optionally |
12:15:35 | alehander92 | i've implemented it in a branch |
12:16:00 | alehander92 | where one can get something like a sourcemap between normal code and expanded code (iirc) |
12:16:09 | dadada | alehander92: man, I've been here for a few months now, so I know about expandMacros ..., can you show me your branch? |
12:16:19 | alehander92 | so it's not quite similar, but maybe we can make a RFC |
12:16:44 | alehander92 | hm, it's a work one, so i have to see if it's open |
12:17:40 | PMunch | Ooh, that would actually be really neat alehander92 |
12:18:03 | alehander92 | we |
12:18:30 | alehander92 | hooked it in sem.nim `semAfterMacrocall` |
12:18:45 | Yardanico | alehander92: also I had this idea - a "dummy" nim backend |
12:18:55 | Yardanico | which outputs processed _nim_ after all transformations |
12:19:36 | alehander92 | http://ix.io/2lZ0 |
12:20:02 | alehander92 | but this lacks the sourcemap code |
12:20:40 | PMunch | That would be exactly what I'd need to minify the nimscript stdlib right? |
12:21:09 | PMunch | Hmm, well maybe not after all transformations.. |
12:21:25 | alehander92 | hm, it has somehing in renderer.nim as well |
12:21:33 | alehander92 | ok, i have to separate that |
12:21:35 | PMunch | Basically what I want to do is read through all the files and remove comments and stuff behind "when not defined(nimscript)" and such |
12:21:39 | alehander92 | into a separate branch sorry dadada |
12:21:53 | alehander92 | because its a part of big branch and i dont have time for this now |
12:22:04 | alehander92 | but you can just plug some of this code in sem.nim |
12:22:39 | alehander92 | and try to append it to <filename>.expanded.nim |
12:22:49 | alehander92 | and remove all the sourcemap-related stuff |
12:23:41 | alehander92 | PMunch interesting, sounds like other people need it to, i heard complaints about hcr breaking because of `when`-s in arc |
12:24:39 | alehander92 | yardanico, yeah, sounds also useful! |
12:25:11 | PMunch | Hmm, yeah I also found a weird when related to HCR in system.nim |
12:25:23 | dadada | alehander92: when do you want this to be ready? |
12:25:25 | PMunch | when not defined(nimhcr): import hcr |
12:25:29 | PMunch | Or something like that |
12:25:54 | dadada | alehander92: I can wait, but it'd be nice to know what your plan is |
12:26:00 | alehander92 | dadadanope |
12:26:06 | alehander92 | my plan is to RFC it eventually |
12:26:16 | alehander92 | so not really soon |
12:26:47 | alehander92 | i also feel that i need it sometimes :D |
12:27:28 | dadada | in my case, sometimes is now :D ... it'd be a nice to have |
12:28:20 | * | NimBot joined #nim |
12:31:00 | Araq | dadada: what do you need again? |
12:32:50 | dadada | Araq: hi, I think I got the answer from alehander92, there's no way currently to retrieve the expanded macros version of a nim source file currently from a file or a database, I thought maybe that it might exist in the DB for incremental compilation |
12:35:18 | alehander92 | dadada, it might be even easier |
12:35:23 | alehander92 | to plug somehwere else |
12:35:30 | alehander92 | i do it there because i think i needed for the sourcemaps |
12:35:42 | alehander92 | but there must be a place where the c generator takes the nim ast |
12:35:55 | alehander92 | and you need to mostly plug a simple call to renderer and writeFile there |
12:36:07 | alehander92 | e.g. in the beginning of cgen |
12:36:20 | PMunch | Hmm, "nim genDepend" outputs the .dot file and a rendered .png file in the directory of the file your calling it on. But also a .deps file in the folder that you're currently in |
12:36:34 | PMunch | Is there a way to only get the .deps file? |
12:37:07 | alehander92 | e.g. myOpen |
12:37:08 | PMunch | I want to have the minimal stdlib, but with an easy way of adding in whatever modules you need. |
12:37:27 | PMunch | And that file tells me exactly what I need to copy in to make stuff work |
12:38:26 | Yardanico | alehander92: I tried but it wasn't so simple :D |
12:38:35 | Yardanico | and yes, in myOpen in the entrypoint for the c backend |
12:38:41 | Yardanico | or maybe I did something wrong |
12:38:52 | alehander92 | it should be |
12:38:54 | alehander92 | just a second |
12:39:19 | * | rockcavera joined #nim |
12:40:03 | * | kradnoel joined #nim |
12:44:44 | PMunch | Hmm, looking at depends.nim it looks like it would actually be pretty simple to use the compiler to write your own passes and such |
12:44:53 | Yardanico | well yes, that's not hard |
12:45:16 | PMunch | I was thinking about my usecase |
12:45:23 | PMunch | To minify Nim code |
12:50:24 | * | Vladar joined #nim |
12:53:32 | alehander92 | hmm |
12:53:45 | alehander92 | zah is right, cgen has changed quite a bit |
12:53:51 | alehander92 | myOpen* |
12:54:36 | Yardanico | alehander92: so how do I access the ast of the modules in myOpen so I can dump them? |
12:55:04 | alehander92 | i am trying to do it locally |
12:55:08 | Yardanico | ah ok |
12:55:13 | alehander92 | it should be in `module` |
12:55:24 | * | waleee-cl joined #nim |
12:56:19 | * | dadada quit (Ping timeout: 272 seconds) |
12:57:10 | Araq | PMunch: the compiler isn't hard to work with, IMHO |
12:57:23 | * | dadada joined #nim |
12:57:27 | PMunch | No that's what I'm coming to realise |
12:57:43 | PMunch | It's actually pretty well structured once you start to understand where everything goes |
12:57:47 | * | dadada is now known as Guest78757 |
12:57:58 | PMunch | It would help with a handy "map" though |
12:58:17 | PMunch | It's not always obvious where various things are called from |
12:58:39 | Yardanico | there is one |
12:58:55 | Yardanico | https://nim-lang.org/docs/intern.html#the-compiler-s-architecture-short-description-of-nim-s-modules |
12:59:01 | Araq | alehander92: from https://www.microsoft.com/en-us/research/uploads/prod/2019/04/beyond_structured_report_v2.pdf |
12:59:06 | Yardanico | but yeah it's quite minimal |
12:59:15 | Araq | „The BOSQUE language takes a similar approach by introducing the rec keyword which is used at both declaration |
12:59:15 | Araq | sites to indicate a function/method is recursive and again at |
12:59:15 | Araq | the call site so to affirm that the caller is aware of the recursive |
12:59:17 | Araq | nature of the call.“ |
12:59:28 | Araq | see? I'm always right, recursion is dangerous |
12:59:34 | alehander92 | sorry, i think it should be myProcess |
12:59:48 | alehander92 | Araq hm |
12:59:55 | alehander92 | what was this discussion about? |
13:00:00 | PMunch | Yardanico, yeah I was more thinking of a diagram that shows how the execution flows back and forth through the different callbacks and such |
13:00:32 | alehander92 | PMunch callgraph :) |
13:01:55 | FromGitter | <bung87> Bosque Language... |
13:04:56 | alehander92 | yardanico i confused cgen.nim with sem.nim :D :D :D |
13:05:01 | Yardanico | lol |
13:05:54 | Yardanico | i wanted to get the more "low-level" nim code though, isn't it still kinda high-level in sem.nim? with all stuff like closures |
13:09:37 | alehander92 | so basically |
13:09:39 | alehander92 | yeah yeah |
13:09:46 | alehander92 | you plug in myProcess in cgen.nim |
13:09:53 | alehander92 | i meant i confused the opposite in my code |
13:10:51 | alehander92 | you use renderTree, and i *think* you can use completeCfilepath and changeFileExt |
13:10:58 | * | kradnoel quit (Remote host closed the connection) |
13:11:08 | alehander92 | that's what i try |
13:14:07 | * | kradnoel joined #nim |
13:16:18 | * | zacharycarter joined #nim |
13:17:58 | alehander92 | sorry, you should plug it in myOpen, myProcess and myClose: start collecting in myOpen, add for each node in myProcess and save in myClose |
13:18:09 | alehander92 | probably wrong , but still closer to truth i hope |
13:23:25 | * | liblq-dev joined #nim |
13:28:03 | alehander92 | https://github.com/alehander92/Nim/commit/445158da8942a29ab6eea54126b1757f74fc8fa0 |
13:28:08 | alehander92 | praise God, it worked |
13:28:14 | alehander92 | pfff |
13:28:28 | alehander92 | i need to improve my compiler knowledge |
13:28:44 | alehander92 | btw why does my repo trigger CI |
13:30:07 | alehander92 | dadada ^ you can try it now |
13:30:32 | alehander92 | it generates nimcache/cfile-like.expanded.nim files |
13:36:03 | PMunch | Okay, stupid questions time: http://ix.io/2lZL |
13:36:20 | PMunch | That yields this error: /home/peter/Projects/Nim/lib/system.nim(275, 25) Error: invalid pragma: unchecked |
13:36:36 | PMunch | So I'm obviously missing some bits and pieces |
13:36:55 | alehander92 | PMunch btw you can try this commit / patch up there to see code without `when`-s i think |
13:37:59 | PMunch | The generateExpanded thing? |
13:37:59 | alehander92 | hm, not really |
13:38:24 | PMunch | Not really what? |
13:38:46 | alehander92 | sorry, i lied |
13:38:53 | alehander92 | it seems it still has `when-s` |
13:38:58 | alehander92 | i am not sure why |
13:39:03 | PMunch | Haha |
13:40:00 | alehander92 | i imagined they are all somehow "calculated" before cgen |
13:42:23 | alehander92 | it seems it *does* show it correctly for my user code |
13:42:34 | alehander92 | but somehow not for stdlib files |
13:42:54 | alehander92 | oh maybe |
13:43:04 | alehander92 | their code isn't expanded or is dead code eliminated |
13:43:08 | alehander92 | for procs which arent used |
13:43:37 | alehander92 | so i have to maybe find out the dead-code-eliminated version of ast |
13:49:02 | PMunch | Okay, so initDefinesProg solved that error |
13:49:05 | PMunch | Now I have a thousand more |
13:50:47 | * | JustASlacker quit (Ping timeout: 272 seconds) |
13:53:29 | alehander92 | ok |
13:53:46 | alehander92 | the async docs say that `try` is still not recommended for async |
13:53:47 | PMunch | Oh wait, that wasn't errors :P |
13:53:56 | PMunch | That was just hints :P |
13:53:58 | alehander92 | is this still true? or just not updated dom96 |
13:53:59 | PMunch | It works now .) |
13:54:03 | alehander92 | PMunch oh ! |
13:54:14 | alehander92 | so is your install now ready |
13:54:19 | PMunch | Huh? |
13:54:29 | PMunch | This was just to get all dependencies for a given file |
13:54:57 | PMunch | I'm going to use it to create a tool to build a minimal standard library for what you want to include in your nimscript build |
13:57:18 | alehander92 | sorry! |
13:57:20 | alehander92 | sounds good :) |
14:04:20 | * | gokr joined #nim |
14:06:27 | FromGitter | <kaushalmodi> Technisha Circuit: Try the tcc compiler? https://github.com/termux/termux-packages/issues/3459 |
14:06:29 | disbot | ➥ Package Request: TinyCC |
14:08:18 | * | Vladar quit (Quit: Leaving) |
14:17:20 | zacharycarter | that UE5 demo is pretty amazing |
14:20:09 | Yardanico | alehander92: thanks a ton! |
14:25:09 | Araq | alehander92: it's supported for a long time now, we need to update the docs |
14:27:00 | disruptek | zacharycarter: it really is. |
14:27:15 | PMunch | Okay, so this works and gets all the required modules: http://ix.io/2m03 |
14:27:17 | Yardanico | disruptek: stream soon? :P |
14:28:12 | PMunch | http://ix.io/2m04 example getting all you need for system.nim and tables.nim |
14:28:33 | PMunch | Now just to make it copy all that into a folder and voila |
14:28:57 | PMunch | (If I can't figure out how to parse out comments and such though) |
14:34:21 | FromDiscord | <treeform> @Yardanico about source maps, thanks! I been waiting for that PR for like a year. |
14:35:15 | Yardanico | :P |
14:39:33 | * | krux02 joined #nim |
14:42:01 | * | lritter joined #nim |
14:43:13 | * | JustASlacker joined #nim |
14:49:41 | disruptek | Araq: so you want module names in every mangled symbol name in a module? regardless of scope? |
14:50:10 | Araq | module name in everything top level, not for local variables |
14:50:26 | disruptek | okay. |
14:50:38 | * | JustASlacker quit (Ping timeout: 264 seconds) |
14:50:39 | disruptek | and just first param for procs. |
14:52:13 | Araq | disruptek: it's crucial that you get the order right, it's procname_type_module |
14:52:20 | disruptek | yep. |
14:52:28 | Araq | most important thing first for auto completion |
14:58:09 | * | arecaceae quit (Remote host closed the connection) |
14:58:34 | * | arecaceae joined #nim |
14:59:49 | FromDiscord | <Technisha Circuit> heya |
15:00:04 | FromDiscord | <codic> While trying to use the example bot for dimscord, i get:↵```↵Exception message: socket closed↵``` |
15:00:06 | FromDiscord | <codic> at some point |
15:00:08 | FromDiscord | <codic> and the bot doesnt run. |
15:00:15 | Yardanico | you need websocket 0.4.0 |
15:00:22 | FromDiscord | <Technisha Circuit> me and codic are having an issue with dimscord, we need the zlib.dll but we are running linux |
15:00:23 | Yardanico | dimscord doesn't run with "websocket" lib > 0.4.0 :D |
15:00:28 | FromDiscord | <Technisha Circuit> lemme check |
15:00:38 | Yardanico | you don't need zlib really |
15:00:41 | Yardanico | unless you use compression |
15:00:51 | FromDiscord | <codic> Why do you need websocket < 0.4.0? |
15:01:07 | Yardanico | websocket == 0.4.0 * |
15:01:08 | FromDiscord | <codic> Does nim have something like python virtualenvs to keep packages isolated |
15:01:14 | FromDiscord | <codic> <= so |
15:01:17 | Yardanico | you can install multiple versions of packages at the same time |
15:01:18 | FromDiscord | <codic> Or ==? |
15:01:20 | FromDiscord | <codic> Ah |
15:01:26 | FromDiscord | <codic> But how do you specifiy which one to use |
15:01:29 | Yardanico | nimble |
15:01:46 | Yardanico | "nimble c" "nimble build" etc |
15:01:53 | disruptek | ~stream |
15:01:54 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
15:01:56 | disruptek | compiler stuff. |
15:02:12 | FromGitter | <kaushalmodi> codic: You can specify the pkg version to be used in nimble files |
15:02:31 | FromGitter | <kaushalmodi> e.g. `requires "nim >= 1.2.0", "cligen 0.9.45", "glob >= 0.9.0", "p4ztag_to_json >= 0.11.0"` |
15:02:58 | FromGitter | <kaushalmodi> that shows the minimum req pkg version for all, except for the exact pkg version for cligen |
15:02:58 | FromDiscord | <codic> ah. |
15:02:59 | FromDiscord | <codic> thank you |
15:04:34 | FromDiscord | <codic> Yardanico: websocket 4.0 was installed via `nimble install [email protected]`, but now it just freezees, the bot isnt running |
15:04:41 | Yardanico | well ask @Krisp not me :P |
15:05:02 | FromDiscord | <kodkuce> can i check minie type from nim or do i need to call file --mime-type image.png |
15:05:04 | FromDiscord | <codic> ah, they are the developer of the library? |
15:05:15 | FromDiscord | <Technisha Circuit> yea |
15:05:21 | FromDiscord | <codic> With dimscord |
15:05:22 | FromDiscord | <codic> sent a code paste, see http://ix.io/2m0g |
15:06:05 | FromDiscord | <Technisha Circuit> lets try the dev branch |
15:06:09 | Yardanico | ah right |
15:06:11 | Yardanico | use devel of course |
15:06:13 | Yardanico | not the master |
15:07:12 | FromDiscord | <Technisha Circuit> how do i install it via nimble? |
15:07:37 | FromDiscord | <codic> Maybe `nimble install dimscord@devel` |
15:07:38 | FromDiscord | <codic> idk |
15:07:53 | Yardanico | dimscord@#devel |
15:07:57 | Yardanico | nimble install that |
15:08:06 | FromDiscord | <codic> nice |
15:08:08 | FromDiscord | <codic> worked |
15:08:10 | * | PMunch quit (Quit: leaving) |
15:08:27 | FromDiscord | <codic> same error though |
15:08:44 | Yardanico | well you have both dimscord installed right? |
15:08:47 | FromDiscord | <codic> yeah |
15:08:48 | Yardanico | make sure you're using the devel |
15:08:50 | FromDiscord | <codic> uninstalling the old one |
15:09:00 | FromDiscord | <codic> uninstalled. progress! |
15:09:02 | FromDiscord | <codic> ```↵/home/raees/projects/nim/Nim-bot/main.nim(6, 23) Error: type mismatch: got <proc (s: Shard, r: Ready){.gcsafe, locks: 0.}> but expected 'proc (s: Shard, r: Ready): Future[system.void]{.closure.}'``` |
15:09:09 | Yardanico | what's your nim version? |
15:09:30 | FromDiscord | <codic> 1.2.0 |
15:09:54 | alehander92 | Araq |
15:09:57 | alehander92 | they also dont like loops |
15:10:21 | alehander92 | or at least it seems they prefer map/filter/others |
15:11:18 | alehander92 | hm, do they require this for mutual rec |
15:15:11 | Araq | alehander92: yeah I know and they argue well, so I might reconsider my opinion |
15:17:47 | * | JustASlacker joined #nim |
15:22:52 | * | JustASlacker quit (Ping timeout: 256 seconds) |
15:24:01 | * | ftsf quit (Ping timeout: 258 seconds) |
15:24:50 | alehander92 | yeaaah |
15:25:15 | alehander92 | otherwise some limit to recursion |
15:25:18 | alehander92 | seems interesting to me |
15:25:35 | alehander92 | but no idea how this would work |
15:26:11 | * | nekits quit (Read error: Connection reset by peer) |
15:26:12 | * | nekits6 joined #nim |
15:34:28 | * | Guest78757 is now known as dadada |
15:34:53 | FromGitter | <bung87> ` 64-bit double` is cdouble? |
15:34:59 | dadada | using a generic value Object[T] is not possible it seems |
15:35:07 | dadada | for a table value I mean |
15:35:19 | Yardanico | dadada: why? |
15:35:30 | dadada | I want the table to contain different types of Object[T] it could be int or string |
15:35:33 | dadada | or anything else |
15:35:48 | Yardanico | it should all be the same type even if it's generic |
15:36:00 | Yardanico | use object variants if you want to store different kinds of types in a table |
15:39:23 | * | leorize quit (Ping timeout: 240 seconds) |
15:40:16 | FromDiscord | <kodkuce> https://nim-lang.org/docs/terminal.html am i blind or there is no select with cursor, i just want to mark like 5files |
15:40:28 | FromDiscord | <kodkuce> *5 chars |
15:42:56 | Araq | write UI applications instead, it's 2020 |
15:44:08 | FromGitter | <kaushalmodi> kodkuce: That would be a nice addition to that library |
15:44:19 | FromGitter | <kaushalmodi> don't worry, there are many CLI/terminal fans here |
15:44:23 | FromGitter | <kaushalmodi> :) |
15:45:39 | * | JustASlacker joined #nim |
15:50:39 | FromDiscord | <kodkuce> i cut you with swrod |
15:53:20 | stefantalpalaru | Do you guys know why the stack size varies wildly in this simple Nim program? (between 2 KiB and 9 KiB, or so) https://gist.github.com/stefantalpalaru/72808acc8b6a6749f8d5a92a67c63c6d |
15:54:07 | stefantalpalaru | The C version has the same small value between runs (276 bytes): https://gist.github.com/stefantalpalaru/7eb2f9d5d34677ca47bd658e5a5faae8 |
15:54:35 | FromDiscord | <jasonfi> I've posted a few basic articles regarding Nim on my new blog: https://onlinetechinfo.com/tag/nim |
15:54:39 | FromDiscord | <jasonfi> not sure if this helps someone |
15:55:14 | FromDiscord | <mratsim> nimporter is for Python calling Nim |
15:55:21 | FromDiscord | <mratsim> Nimpy is for Nim calling Python |
15:55:36 | FromDiscord | <jasonfi> that's strange because I am calling Python from Nim and I use nimporter |
15:55:40 | FromDiscord | <Recruit_main707> not really |
15:55:48 | Yardanico | @mratsim you don't have to use nimporter though |
15:55:51 | Yardanico | it's just extra convenience |
15:55:54 | FromDiscord | <Recruit_main707> nimporter literally uses nimpy |
15:56:07 | FromDiscord | <jasonfi> I read that it makes it easier to use nimpy? |
15:56:09 | Yardanico | you can call nim from python after you build your nim library to a .so file (or .pyd on windows) |
15:56:23 | Yardanico | with nimpy |
15:56:32 | FromDiscord | <Recruit_main707> but it makes it simpler, (by compiling the nim code at python runtime) |
15:57:29 | FromGitter | <bung87> compiling nim code at python runtime? |
15:57:42 | Yardanico | yes, it compiles after you do "import" |
15:57:47 | Yardanico | in python |
15:57:53 | Yardanico | so it's just extra convenience as I said |
15:58:09 | FromDiscord | <mratsim> the article is about wrapping Python, so it's nimpy that should be mentionned |
15:58:21 | FromDiscord | <jasonfi> I will make a change then, thanks |
15:59:08 | FromGitter | <bung87> why is that all need is import a .so |
15:59:20 | Yardanico | @bung87 for faster development process I guess |
16:02:54 | FromGitter | <bung87> oh, `ext_modules=nimporter.build_nim_extensions()` |
16:03:20 | FromGitter | <bung87> it has a building extension process |
16:05:37 | FromGitter | <bung87> ok, found document also says on import |
16:17:28 | FromDiscord | <FromIRC> Uptime - 1 day, 1 hour, 54 minutes, 15 seconds, 860 milliseconds, 792 microseconds, and 327 nanoseconds |
16:17:28 | FromDiscord | <Yardanico> !status |
16:18:57 | * | leorize joined #nim |
16:22:21 | FromDiscord | <Technisha Circuit> Nice |
16:39:02 | * | fredrikhr quit (Ping timeout: 256 seconds) |
16:42:17 | * | PMunch joined #nim |
16:54:03 | * | ptdel joined #nim |
16:57:30 | wgetch | if you call new on a ref object type with a ref object type member, do you have to call new on the ref member? |
16:57:35 | Yardanico | yes |
16:57:50 | Yardanico | "new" is not recursive it all, it only creates a new instance of the object itself |
16:57:50 | wgetch | thought so. pretty much malloc? XD |
16:58:46 | Yardanico | you have to consider the GC and all that |
16:58:52 | Yardanico | so no, not malloc, far from malloc |
16:59:34 | wgetch | well, just in terms of you have to explicitly call new |
16:59:48 | Yardanico | well you don't need to if you use object constructor syntax |
17:00:08 | Yardanico | let a = MyNewThing() |
17:00:11 | Yardanico | if MyNewThing is a type |
17:01:11 | Yardanico | let a = MyNewThing(field1: 1, field2: "hello") |
17:01:16 | Yardanico | you can span it over multiple lines as well |
17:02:19 | wgetch | but you'd still have to construct the ref members |
17:02:26 | wgetch | even using that constructor syntax? |
17:02:27 | Yardanico | yes, so? |
17:02:36 | Yardanico | I mean with a macro you can create a recursive "new" if you want |
17:02:40 | wgetch | just making sure I'm reading right |
17:03:02 | wgetch | I have no need for recursive new, just grasping semantics |
17:03:13 | Yardanico | https://nim-lang.org/docs/manual.html greatly helps for that :) |
17:03:14 | wgetch | but that is pretty cool |
17:04:28 | wgetch | I noticed I couldn't echo() ref types, but if I apply [] operator to them it derefs and works |
17:04:42 | Yardanico | yes |
17:04:53 | wgetch | the manual says (generally) you dont need to use [] explicitly but I'm guessing thats an exception? |
17:05:06 | wgetch | I guess its only for members, you dont have to [] |
17:05:14 | Yardanico | wgetch: it doesn't really say so |
17:05:29 | Yardanico | "The . (access a tuple/object field operator) and [] (array/string/sequence index operator) operators perform implicit dereferencing operations for reference types" |
17:05:46 | Yardanico | so for a.b or a[b] you don't need to derefence explicitly |
17:05:49 | Yardanico | but otherwise you need to |
17:05:58 | Yardanico | "a.b" covers like 90% of cases though |
17:06:17 | Yardanico | but "echo a" is not a `.` or `[]` |
17:06:31 | wgetch | yeah, that makes sense. thank you! |
17:15:38 | FromGitter | <bung87> param as optional should assign a value? is there other way? |
17:15:45 | Yardanico | ?? |
17:15:54 | Yardanico | ah, no, of course not |
17:16:01 | Yardanico | you can use "options" module though |
17:16:02 | Yardanico | like |
17:16:12 | Yardanico | "proc a(a: string, b = none(string))" |
17:16:29 | Yardanico | so b will have an Option[string] type and contain nothing, but it'll still be an optional argument |
17:16:41 | FromGitter | <bung87> ah, omg I wrongly use it |
17:17:04 | FromGitter | <bung87> I declare it as b:Option[string] |
17:17:13 | Yardanico | well then it'll still be mandatory |
17:19:30 | FromGitter | <bung87> yeah , the editor shows that, and then I recheck the doc, no example use it as param |
17:20:59 | Yardanico | well it's just an ordinary type, you don't need any special docs :) |
17:22:54 | Zevv | narimiran: could you add Salweski's writeup to the Nim learning section? |
17:23:19 | FromGitter | <bung87> yeah, my bad |
17:25:48 | * | audiofile joined #nim |
17:26:32 | * | audiophile joined #nim |
17:30:23 | * | audiofile quit (Ping timeout: 265 seconds) |
17:30:27 | * | audiophile is now known as audiofile |
17:31:03 | * | leorize quit (Ping timeout: 240 seconds) |
17:33:07 | audiofile | where are my fellow nimmers?! >_> |
17:33:21 | FromDiscord | <Recruit_main707> porting code |
17:33:23 | disruptek | ~stream |
17:33:23 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
17:33:56 | Prestige | o/ |
17:34:18 | * | silvernode joined #nim |
17:34:29 | audiofile | oooh nice |
17:34:33 | audiofile | I will join |
17:34:36 | Yardanico | ok |
17:37:15 | * | silvernode quit (Client Quit) |
17:39:17 | FromDiscord | <kodkuce> so there no way to read mime type whitout using file -b --mime-type |
17:39:21 | FromDiscord | <kodkuce> ? |
17:39:30 | Yardanico | wat? |
17:39:44 | Yardanico | "file" doesn't just "read" a mime type |
17:39:51 | Yardanico | it has a lot of heuristics to detect the correct mimetype |
17:40:02 | Yardanico | based on the file contents |
17:40:06 | FromDiscord | <kodkuce> i want to check mimi want to open only text kinda files in my tmux+micro vscode |
17:40:33 | FromDiscord | <kodkuce> yes but with file -b --mime-type i will get mime type |
17:40:38 | FromDiscord | <kodkuce> only 🙂 |
17:41:10 | FromDiscord | <kodkuce> just duno if calling for each file in dir from nim "file -b --mime-type" is a expensive operation |
17:41:13 | FromGitter | <bung87> using libmagic |
17:49:03 | * | rockcavera quit (Remote host closed the connection) |
17:50:00 | FromDiscord | <kodkuce> https://github.com/threatstack/libmagic |
17:50:09 | FromDiscord | <kodkuce> need to wrap this i guess |
17:51:20 | FromGitter | <bung87> there is I remenber |
17:52:07 | FromDiscord | <KrispPurg> @codic use websocket 0.4.0 |
17:52:36 | FromDiscord | <codic> i did |
17:52:43 | FromDiscord | <KrispPurg> huh |
17:52:46 | FromDiscord | <codic> removed both versions and then installed @0.4.0 |
17:52:49 | FromDiscord | <codic> The error is gone |
17:52:52 | FromDiscord | <codic> But the bot just doesn't start |
17:52:53 | FromDiscord | <codic> it hangs |
17:53:00 | FromDiscord | <codic> I did compile with `-d:ssl` |
17:53:00 | Yardanico | do you use compress=true |
17:53:10 | Yardanico | if so, remove it |
17:53:12 | Yardanico | and try again |
17:53:13 | FromDiscord | <codic> lemme see |
17:53:15 | FromDiscord | <kodkuce> try treeform webscokets at least those worked for me |
17:53:37 | FromDiscord | <codic> yeah |
17:53:40 | FromDiscord | <codic> Im using compress=true |
17:53:41 | FromDiscord | <KrispPurg> treeform's ws doesn't not work for me and I won't use it. |
17:53:47 | Yardanico | @codic remove it |
17:53:48 | FromDiscord | <KrispPurg> turn it off. |
17:53:50 | FromDiscord | <codic> I'll remove ``compress=true` and then check later |
17:53:51 | FromDiscord | <codic> ok |
17:53:52 | Yardanico | it didn't work for me either |
17:53:56 | FromDiscord | <codic> gotta do school stuff rn tho |
17:54:01 | FromDiscord | <KrispPurg> dll files |
17:54:11 | FromDiscord | <KrispPurg> gl on your school stuff |
17:54:26 | FromDiscord | <codic> thanks↵dll files? |
17:54:39 | FromDiscord | <KrispPurg> ignore my msg lol |
17:54:46 | FromDiscord | <KrispPurg> that msg* |
17:54:46 | FromDiscord | <kodkuce> duno form me treeform worked np, but it was like year ago aprox |
17:55:01 | FromDiscord | <codic> alright |
17:55:11 | FromDiscord | <KrispPurg> I get protocol errors, but I like websocket.nim. |
17:55:15 | FromDiscord | <codic> dimscord actually seems really feeature complete |
17:55:25 | FromDiscord | <codic> Alrady |
17:55:28 | FromDiscord | <codic> *already |
17:55:33 | FromDiscord | <kodkuce> nice there is allread a wraped libmagic |
17:56:23 | FromDiscord | <KrispPurg> I just need some couple of fixes and just 14 more api endpoints to finish up and then submit it to the official api docs. |
17:56:35 | Yardanico | and fix all crashes |
17:56:36 | Yardanico | !status |
17:56:37 | FromDiscord | Uptime - 1 day, 3 hours, 33 minutes, 24 seconds, 878 milliseconds, 964 microseconds, and 284 nanoseconds |
17:56:43 | Yardanico | good so far |
17:56:45 | FromDiscord | <KrispPurg> oh oops lmao |
18:01:08 | audiofile | PMunch do you see the northern lights then |
18:02:14 | PMunch | audiofile, I assume you meant to ask in #offtopic, but yes we do get northern lights :P |
18:19:48 | FromDiscord | <kodkuce> could not load: libmagic.so |
18:19:55 | Yardanico | well you need libmagic installed |
18:20:01 | FromDiscord | <kodkuce> do i need to use some copile flag |
18:20:05 | FromDiscord | <kodkuce> i have it |
18:20:11 | Yardanico | are you sure? same architecture as well? |
18:20:13 | Yardanico | same version? |
18:20:32 | FromDiscord | <kodkuce> meybe i need devel version |
18:21:01 | FromDiscord | <kodkuce> hmm there is no devel |
18:21:12 | FromDiscord | <kodkuce> [*] libmagic-5.38_1 File type identification library |
18:21:46 | FromDiscord | <KrispPurg> what is libmagic |
18:21:55 | FromGitter | <bung87> where is install location |
18:22:15 | FromGitter | <bung87> a lib of magic |
18:22:41 | FromDiscord | <kodkuce> usr/bin i think will check |
18:23:10 | FromGitter | <bung87> no ,definately wrong |
18:28:09 | dadada | is there a test I can do on runtime to see if a type works as a container in a for in loop? |
18:28:31 | dadada | I tried to wrap for test in thingy: discard with a try block, but it wont catch it |
18:28:32 | FromDiscord | <kodkuce> /usr/lib/libmagic.so.1.0.0 |
18:28:41 | FromDiscord | <kodkuce> /usr/lib/libmagic.so.1 -> /usr/lib/libmagic.so.1.0.0 |
18:29:12 | PMunch | https://github.com/nim-lang/Nim/pull/14351 |
18:29:13 | disbot | ➥ Improve nimeval, changes some defaults |
18:29:39 | FromDiscord | <kodkuce> do i need to copy it to dir, shouldent nim auto get that lib, or meybe it searching for difrent name |
18:29:48 | PMunch | Some of the changes I've made locally to make this easier to work with |
18:30:28 | FromDiscord | <kodkuce> i know i head to symbolic link for 1 so lib to make some game work to just 1 version up |
18:30:34 | FromGitter | <bung87> kodkuce see the nim source |
18:30:51 | FromDiscord | <kodkuce> nim or magic |
18:31:20 | FromGitter | <bung87> binding lub |
18:31:26 | FromGitter | <bung87> lib |
18:32:53 | FromDiscord | <kodkuce> this https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f? |
18:33:30 | PMunch | Hmm, why does the tests on devel always seem to be broken.. |
18:33:38 | PMunch | I don't think I've ever had a all tests passed run.. |
18:34:56 | Yardanico | PMunch: flaky tests |
18:35:01 | Yardanico | mostly async stuff |
18:35:07 | Yardanico | or OS-related |
18:35:14 | Yardanico | last commit passed though :P |
18:35:33 | FromGitter | <bung87> blocked by GFW,check the name and get tool that can check info of so, if the tool can find |
18:37:51 | FromDiscord | <kodkuce> i think i am tarded |
18:37:52 | PMunch | tests/newconfig/tfoo.nim fails with command line(1, 2) Error: invalid command line option: '--hint' for me |
18:38:00 | PMunch | And I pulled a couple minutes ago.. |
18:38:09 | PMunch | tests/parser/tstatementoperators.nim also fails.. |
18:42:24 | * | audiofile quit (Ping timeout: 265 seconds) |
18:44:53 | FromDiscord | <kodkuce> beh i just symbolic link libmagic.so.1 to libmagic.so and it worked |
18:45:07 | FromDiscord | <kodkuce> duno why you pointed me to read some other stuff 🙂 |
18:45:44 | * | Vladar joined #nim |
18:46:28 | * | fredrikhr joined #nim |
18:51:13 | FromGitter | <bung87> oh ,you paste the path i assuming you dont know where it installed |
18:57:08 | FromDiscord | <kodkuce> sword you too |
18:57:10 | FromDiscord | <kodkuce> xD |
19:00:48 | FromDiscord | <kodkuce> to clear seq there is no clear proc, do i have to craete new or what i frogot |
19:02:59 | FromGitter | <bung87> may be len =0 |
19:03:41 | Araq | s.setLen 0 |
19:08:38 | FromDiscord | <kodkuce> ty |
19:09:01 | FromDiscord | <kodkuce> sombody should add that to docs 🙂 |
19:13:44 | Yardanico | where would you add it in the docs though? |
19:15:29 | * | JustASlacker quit (Quit: Leaving) |
19:16:09 | * | someunknownuser joined #nim |
19:16:41 | * | someunknownuser quit (Client Quit) |
19:25:07 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
19:30:18 | supakeen | I must be overlooking something, where can I set my `nimble build/install` to use `--threads:on`? |
19:30:38 | Yardanico | in your project.nimble file if you have a task |
19:30:48 | Yardanico | or easier - in "mainfile.nims" placed next to your mainfile.nim |
19:30:55 | Yardanico | or "nim.cfg" placed next to your mainfile.nim |
19:31:04 | Yardanico | or "mainfile.nim.cfg" placed next to your mailfile.nim :P |
19:31:11 | supakeen | Haha thank you. |
19:31:23 | Yardanico | in the case of .cfg put "--threads:on" there, for nims do `switch("threads", "on")` |
19:32:19 | supakeen | That works perfectly, went the `.nims` way. |
19:32:41 | * | NimBot joined #nim |
19:32:49 | Yardanico | ircord is more stable that nimbot /s |
19:32:51 | Yardanico | !status |
19:32:52 | FromDiscord | Uptime - 1 day, 5 hours, 9 minutes, 40 seconds, 223 milliseconds, 44 microseconds, and 115 nanoseconds |
19:33:22 | supakeen | Finally found a project to use Nim for properly so going through a better setup than just a single nim file :) |
19:33:36 | Yardanico | that's good :) |
19:36:03 | FromGitter | <bung87> any suggestion that i can contribue to nim? |
19:36:12 | Yardanico | https://github.com/nim-lang/needed-libraries/issues |
19:36:19 | disruptek | test --gc:arc |
19:36:24 | supakeen | @bung87: Nim itself or the ecosystem? |
19:36:29 | Yardanico | that too |
19:36:31 | Yardanico | help test arc/orc pls |
19:36:35 | Yardanico | on latest devel |
19:37:04 | FromGitter | <bung87> maybe the nim itself |
19:37:24 | FromGitter | <bung87> Ive write and port serveral libs.... |
19:37:28 | Yardanico | @bung87 see how I do it and do the same :P https://github.com/nim-lang/nim/issues?q=is%3Aissue+author%3AYardanico+ |
19:38:40 | FromGitter | <bung87> ok gc things ,I may should learn first |
19:38:40 | supakeen | Take a look at issues and fix any that you can fix, use the language and find bugs then fix those, extend testcase coverage for stdlib are good ones. |
19:38:59 | supakeen | And if you want my top tier wishlist item; some sort of testcase coverage thing. |
19:39:13 | Yardanico | leorize[m]: already did it |
19:39:25 | Yardanico | see https://github.com/alaviss/Nim/commits/coverage |
19:39:42 | supakeen | ah koch has coverage now? |
19:40:34 | leorize[m] | in my branch, yes |
19:40:42 | * | nsf quit (Quit: WeeChat 2.8) |
19:40:46 | leorize[m] | but there are too many false negatives |
19:41:00 | leorize[m] | we need a nim-aware coverage data collector for this to work |
19:41:29 | * | rockcavera joined #nim |
19:41:40 | supakeen | i'm not very good on the technical details of how code coverage data is generated sadly |
19:47:53 | FromDiscord | <kodkuce> https://nim-lang.org/docs/terminal.html#ForegroundColor , can somone explain me what is this fg8Bit , how do i style with true coloros |
19:48:36 | Yardanico | see https://github.com/qqtop/NimCx |
19:48:41 | Yardanico | I think you need to use ANSI color escapes |
19:50:43 | FromDiscord | <kodkuce> will check |
19:54:21 | supakeen | What is the reasoning that some packages seem to use `when defined(nimdoc)` and then only have signatures + docstrings and in their else have the actual implementations without docstrings? |
19:56:28 | * | solitudesf quit (Remote host closed the connection) |
19:56:35 | * | solitudesf- joined #nim |
20:00:22 | * | solitudesf- is now known as solitudesf |
20:06:27 | FromDiscord | <kodkuce> any reason why choosenim devl is building forewer |
20:06:35 | * | ptdel joined #nim |
20:06:59 | shashlick | takes time to build libarchive first time |
20:07:00 | shashlick | what OS |
20:07:16 | shashlick | presume you mean you are building choosenim itself |
20:07:26 | shashlick | perhaps you mean building nim devel |
20:09:03 | FromGitter | <kaushalmodi> `nim r` in devel branch is awesome.. simply type `nim r `, paste the path to the test nim file and hit enter.. the file will compile and run without polluting your current dir with the generated binary. This is really useful if you quickly want to test out some nim code in any dir you might be in the terminal. |
20:11:32 | FromDiscord | <kodkuce> i did choosenim devel |
20:11:37 | FromDiscord | <kodkuce> i head stabel |
20:11:39 | Prestige | I'm running into an issue with illegal storage access, attempting to call an xlib function. Would anyone mind helping me out? I think I'm likely using casing incorrectly, or something.. |
20:11:59 | FromDiscord | <kodkuce> anywya it finished, i tink stable builded 10 time faster |
20:12:05 | Prestige | The function: https://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html my code: https://0x0.st/iLQ4.png |
20:13:42 | FromDiscord | <kodkuce> i newer wraped any lib and dont really know C or C++ to be of any use 😦 |
20:15:04 | Prestige | The propReturn part seems suspicious to me but I'm not sure what would be incorrect |
20:15:12 | dadada | what can I do in a macro / in nim in general, if I want to the code to run in nimscript/nimvm=? |
20:15:24 | Prestige | unless it should be an array or char arrays, or an array of strings... |
20:15:57 | dadada | I thought this would be easy, but it's not as I thought, what I want to do is use nimcacheDir() |
20:16:21 | dadada | from nimscript, but I can't import it, can't use it in macros, can't use it in quote dos, where can I use it? |
20:23:12 | * | solitudesf- joined #nim |
20:23:40 | FromGitter | <bung87> I starting trace zip lib issues, as I created a PR several days ago . |
20:25:25 | * | solitudesf quit (Ping timeout: 264 seconds) |
20:30:24 | supakeen | Is it possible with {.importc.} to get a struct definition directly? |
20:32:37 | * | narimiran quit (Ping timeout: 264 seconds) |
20:40:27 | FromDiscord | <kodkuce> what chars are 'arraw keys' |
20:40:34 | FromDiscord | <kodkuce> in terminal getch() |
20:42:03 | FromDiscord | <kodkuce> guess i can cast to int and compere it like that |
20:42:08 | supakeen | \033[A until D |
20:43:52 | FromDiscord | <kodkuce> hmm ye i just now sow i am getting 3 ints form casting terminal stuff is wierd 🙂 |
20:43:59 | supakeen | You can also use `showkey` in your terminal. |
20:44:11 | supakeen | It's not that weird, you're getting the terminal escape sequences that it sends :) |
20:44:11 | FromDiscord | <kodkuce> how |
20:44:15 | FromGitter | <kaushalmodi> kodkuce: Does this help? https://github.com/dom96/nimbox/blob/master/nimbox/termbox.nim |
20:44:30 | FromGitter | <kaushalmodi> also https://github.com/FedericoCeratto/nim-dashing |
20:45:39 | FromGitter | <kaushalmodi> A Nim lib using the termbox lib: https://github.com/dom96/deauther by @dom96 |
20:46:51 | * | leorize joined #nim |
20:50:37 | * | Vladar quit (Quit: Leaving) |
20:51:28 | FromDiscord | <kodkuce> duno am reading |
20:54:57 | FromGitter | <Knaque> For no reason whatsoever, I made an updated version of that nimble-tag repo that hasn't been updated in a few years. https://github.com/knaque/nimble-tag-2 |
20:58:03 | * | abm quit (Quit: Leaving) |
21:01:00 | * | solitudesf- quit (Remote host closed the connection) |
21:01:20 | * | solitudesf- joined #nim |
21:01:40 | * | solitudesf- is now known as solitudesf |
21:02:51 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
21:10:09 | FromDiscord | <kodkuce> ok i think i got this nimbox 🙂 |
21:10:17 | * | ehmry joined #nim |
21:11:33 | * | solitudesf- joined #nim |
21:14:16 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:16:41 | FromGitter | <bung87> fix 4 zip lib issues. |
21:19:42 | * | solitudesf- quit (Remote host closed the connection) |
21:23:04 | * | filcuc joined #nim |
21:33:00 | Prestige | Welp I'm pretty stuck on this problem |
21:37:15 | Prestige | Trying to implement this function in Nim: https://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html my code: https://0x0.st/iLQ4.png if anyone could take a look |
21:37:34 | Prestige | been getting illegal storage access errors, been trying to figure out why since yesterday |
21:43:12 | PMunch | Well for one you should make sure that the types you're creating pointers to are actually the right type |
21:43:50 | PMunch | formatReturn should be a cint, numItems and bytesAfterReturn should be a culong. |
21:44:00 | PMunch | But most importantly is probably propReturn |
21:44:18 | PMunch | Why have you defined this as an array of two characters? |
21:44:28 | Prestige | I have converters for those, so I think they should be okay |
21:44:42 | PMunch | unsigned char** is a pointer to a list of strings in C |
21:44:44 | Prestige | not super familar with C, I thought it was a pointer to an array of chars |
21:44:53 | PMunch | converters won't help you |
21:45:31 | PMunch | If your Nim int is not the same size as a culong then it will try to put a culong into too small/big of a space |
21:45:50 | PMunch | So the backing type needs to be the same as what you're sending a pointer to |
21:46:06 | PMunch | If you want them as a different type later on you need to convert them after you've retrieved them. |
21:46:16 | Prestige | Cool, thanks |
21:46:48 | Prestige | since that's supposed to be a string, I need to figure out how to transform a string type into a TAtom (which is just a culong) |
21:46:49 | * | filcuc quit (Quit: Konversation terminated!) |
21:46:55 | PMunch | For prop_return you want to define it as a "ptr cstring" |
21:47:10 | * | tane quit (Quit: Leaving) |
21:47:15 | PMunch | Or a "ptr UncheckedArray[cstring]" |
21:48:23 | PMunch | If you look at my PiMo code in src/pimo_lib.nim on lines 46-65 you can see how I handle this |
21:49:08 | Prestige | Thanks for the help! |
21:49:23 | PMunch | And you can find examples of me using that function in the various other files |
21:49:35 | PMunch | (just grep for getProperty) |
21:50:53 | PMunch | I see now that PPcuchar in this case is just meant as a pointer to whatever data is there, not a string |
21:50:55 | PMunch | My bad |
21:52:05 | PMunch | No problem :) |
21:57:43 | FromDiscord | <treeform> @KrispPurg what about my websockets does not work for you? |
21:58:23 | * | audiofile joined #nim |
21:58:55 | FromDiscord | <treeform> What type of protocol error do you get? |
22:14:23 | * | Trustable quit (Remote host closed the connection) |
22:14:58 | FromGitter | <bung87> how does nim find the proc's return value , there may have nested block |
22:16:35 | leorize | wdym? |
22:17:48 | FromGitter | <bung87> https://github.com/nim-lang/Nim/issues/13341 here's the issue |
22:17:51 | disbot | ➥ asyncjs doesn't like inner functions with result assignments ; snippet at 12https://play.nim-lang.org/#ix=2m2Q |
22:18:31 | FromGitter | <bung87> the current approach will resursively `replaceReturn` so this happend |
22:19:29 | * | krux02 quit (Remote host closed the connection) |
22:20:14 | FromDiscord | <KrispPurg> I've tried your ws lib ages ago and I don't have the code, but when the url starts with "wss://", it seems to get a protocol error. |
22:20:27 | * | liblq-dev quit (Quit: WeeChat 2.8) |
22:20:41 | leorize | bung87: check how asyncdispatch does it then :P |
22:20:47 | * | letto quit (Quit: Konversation terminated!) |
22:21:35 | FromGitter | <bung87> idk the compiled js code why has no async nor promise.. looks like a general js header |
22:21:58 | FromGitter | <bung87> ok, that's a good point to start |
22:23:22 | FromDiscord | <treeform> @KrispPurg I did not have support for wss:// for some time, but I fixed the last know bug on Nov 10, 2019... if you have a repro case I would love to fix it. |
22:24:00 | FromDiscord | <KrispPurg> @treeform |
22:24:13 | FromDiscord | <treeform> @KrispPurg |
22:24:37 | skrylar[m] | hoi |
22:24:48 | FromGitter | <bung87> @alehander92 are you there? |
22:25:34 | FromGitter | <bung87> (https://files.gitter.im/nim-lang/Nim/m6TL/Screenshot-2020-05-15-at-6.25.23-AM.png) |
22:25:47 | FromGitter | <bung87> compile asyncjs I only get this |
22:27:00 | FromGitter | <bung87> my bad not exported |
22:37:04 | dadada | what's the best way to remove the last element of a NimNode statement list? |
22:37:28 | dadada | del probably ... nvm |
22:44:28 | skrylar[m] | for the last element it doesn't matter |
22:44:49 | skrylar[m] | del does wreck the order of elements in the middle of a container tho |
22:46:49 | * | Trustable joined #nim |
22:51:16 | FromDiscord | <Recruit_main707> Is there any tools to check generated c code online? |
22:51:47 | audiofile | you mean like code linters? |
22:52:07 | * | kradnoel quit (Remote host closed the connection) |
22:52:56 | * | PMunch quit (Quit: leaving) |
22:52:57 | FromDiscord | <Recruit_main707> Kind of how there is a tool to see generated asm |
22:53:07 | skrylar[m] | oh the compiler explorer |
22:54:34 | * | audiofile is now known as mumble |
22:54:58 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
22:55:22 | FromDiscord | <Rika> https://gcc.godbolt.org ? |
23:04:02 | * | couven92 joined #nim |
23:04:08 | * | fredrikhr quit (Disconnected by services) |
23:04:12 | * | couven92 is now known as fredrikhr |
23:10:28 | dadada | leorize: hey, you there? |
23:10:34 | leorize | o/ |
23:10:47 | dadada | can you tell me how to get into NimScript mode, I failed to make nimcacheDir() work |
23:11:07 | leorize | you don't get to "nimscript" mode :P |
23:11:17 | FromDiscord | <Recruit_main707> But Compiler explorer only shows the asm, not the c code |
23:11:30 | FromDiscord | <Rika> you can see the c code in your nim cache |
23:11:52 | leorize | dadada: use std/compilesettings for that |
23:12:10 | leorize | ~playground |
23:12:11 | disbot | playground: 11an online in-the-browser IDE for simple Nim experiments at http://argentina-ni.ml/ |
23:12:11 | disbot | playground: 11https://play.nim-lang.org the official Nim playground, can run Nim in the browser and share snippets |
23:12:18 | leorize | Recruit_main707: ^ use the first link |
23:12:46 | dadada | dude, are you from argentina? |
23:13:02 | FromDiscord | <Rika> how do i check how much memory my nim program is using *within* the nim program xd |
23:13:22 | dadada | I mean, somebody from our community must be, or this website wouldn't have this domain |
23:14:22 | leorize | we have a pretty big community in argentina |
23:14:28 | leorize | and that's their playground |
23:14:40 | dadada | love argentina |
23:14:50 | leorize | Rika: there's some proc to get gc stats |
23:16:03 | FromGitter | <Willyboar> juan carlos i think is from argentina and he is very active |
23:17:51 | dadada | Willyboar: I've seen him on github, he seems awesome |
23:21:49 | FromDiscord | <exelotl> wait so can I post code blocks in general now? :o |
23:22:15 | FromDiscord | <Rika> i mean you can also prolly speak in "new lines instead of spaces" |
23:28:07 | zacharycarter | what do folks use to overlay twitch chat while broadcasting? |
23:29:02 | FromGitter | <Knaque> @zacharycarter https://nightdev.com/kapchat/ |
23:29:09 | * | gokr quit (Quit: Leaving.) |
23:29:18 | zacharycarter | thanks |
23:29:45 | FromGitter | <Knaque> Just one of many things you could use though, so you might want to look around a bit if you need something more advanced. |
23:30:21 | zacharycarter | I think this will work fine - I appreciate the tip |
23:30:34 | FromGitter | <Knaque> No problem. |
23:41:25 | * | fredrikhr quit (Read error: Connection reset by peer) |
23:41:49 | * | fredrikhr joined #nim |
23:42:24 | leorize | I need help from someone with a lot of I/O experience |
23:42:42 | leorize | I keep hearing that async is faster, but how do you benchmark this |
23:42:47 | leorize | like how "faster" is it? |
23:43:08 | leorize | compared to spawning a bunch of threads |
23:44:36 | * | pbb quit (Remote host closed the connection) |
23:47:13 | * | xet7 quit (Quit: Leaving) |
23:50:43 | * | Hideki joined #nim |
23:50:48 | FromGitter | <timotheecour> @leorize do you mean “why is it faster” or “how do you measure that it’s faster” ? |
23:51:06 | * | Hideki is now known as Guest38665 |
23:51:32 | * | xet7 joined #nim |
23:51:39 | leorize | both :) |
23:52:14 | FromGitter | <timotheecour> note that you can combine threads and async, so it’s not an either or. |
23:52:39 | FromGitter | <timotheecour> and it also depends on applications, eg if IO or compute bound, YMMV. |
23:53:37 | FromGitter | <timotheecour> but if IO bound, you can notice unbounded speedup using async (even on a single thread) compared to using threads; |
23:53:54 | leorize | I'm talking I/O only |
23:54:04 | zacharycarter | there's an interesting set of articles on this |
23:54:30 | FromGitter | <timotheecour> for “how to measure” , you can benchmark using wall-clock (eg look at https://github.com/dom96/httpbeast) |
23:54:34 | zacharycarter | https://rachelbythebay.com/w/2020/03/07/costly/ |
23:54:40 | zacharycarter | https://rachelbythebay.com/w/2020/05/07/serv/ |
23:55:43 | zacharycarter | https://www.twitch.tv/zachary_carter streaming immediate mode gui library development |
23:56:51 | FromGitter | <timotheecour> basically with async, you’re never blocking on IO; instead you’re relying on OS-specific selectors (eg kqueue on OSX) to be notified when a file descriptor is ready with 0-delay and no polling needed. |
23:58:45 | FromGitter | <timotheecour> (somewhat related, using selectors is what allows reading both stderr and stdout separately in next version of osproc; right now this isn’t possible using current API’s in osproc) |
23:59:45 | leorize | I perfectly understand that |