<< 14-05-2020 >>

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:46PrestigeHm can anyone assist with something? Probably should be some sort of template if it's possible..
00:04:57PrestigeEssentially converting this block of C code: https://github.com/i3/i3/blob/next/src/handlers.c#L291
00:05:38PrestigeBasically accessing a property on an object by its name
00:06:19Prestigethe `event->event_member` part in particular - event_member is passed in as the name of the property on `event`
00:07:08FromDiscord<Rika> make a macro
00:07:15FromDiscord<Rika> actually maybe a template works
00:07:46PrestigeYeah I'm not sure, still trying to wrap my head around macros/templates
00:08:02FromDiscord<Rika> template copyMaskMember(maskMember, eventMember) = ... event.`eventMember` ...
00:08:26Prestigeoh you can do that? hm
00:08:44*bok quit (Read error: Connection reset by peer)
00:09:39FromDiscord<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:58PrestigeI feel like I understood macros mostly but not templates
00:10:42FromDiscord<Rika> thats weird, usually its the other way around isnt it
00:10:57Prestige🤷‍♂️
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:16Prestige@Rika would you mind taking a min to assist with it?
00:24:36PrestigeMust be doing something incorrectly
00:25:45Prestigehttps://0x0.st/iLbZ.png and https://0x0.st/iLbN.png
00:28:40*dddddd quit (Ping timeout: 256 seconds)
00:40:59FromDiscord<Rika> 1 moment
00:41:07FromDiscord<Rika> dont use a string
00:41:10FromDiscord<Rika> just an x
00:41:26FromDiscord<Rika> so copyMaskMember(e, 1, x)
00:41:39leorizeis that jetbrains mono?
00:41:55PrestigeShould I do that and make it untyped in the template?
00:42:02Prestigeleorize: good eye, yes it is
00:42:12FromDiscord<Rika> no need, it's automatically untyped
00:42:13leorizeit renders better on your pc than mine :P
00:42:22PrestigeHuh weird
00:42:27FromDiscord<Rika> perhaps its the font size leorize
00:42:40PrestigeI keep hearing font rendering on Linux is bad but it looks good to me
00:42:40FromDiscord<Rika> certain font sizes work better on certain fonts
00:43:17PrestigeRika automatically as in I don't need to provide a type in the template declaration?
00:43:33leorizefont rendering always require a tweak or two on my systems :P
00:43:50PrestigeWhat are you running leorize?
00:43:54*lritter quit (Ping timeout: 240 seconds)
00:43:56leorizegentoo
00:44:01*Trustable quit (Remote host closed the connection)
00:44:02PrestigeAh nice
00:44:42FromDiscord<Rika> yes
00:45:00*lritter joined #nim
00:45:11PrestigeAre there any good tuts on templates? I found some for macros
00:46:01Prestigeleorize: I used Dina for a long time but it doesn't scale size so I switched recently
00:46:16leorizeI'm running iosevka
00:46:20leorizeit's been serving me nicely :)
00:46:58PrestigeNot bad
00:47:13FromDiscord<Rika> prestige, templates are essentially macros that're just a bare "quote do"
00:47:26FromDiscord<Rika> thats at least the best super-compressed tutorial i can give
00:47:40PrestigeOh that makes sense, thanks
00:47:41leorizehttps://play.nim-lang.org/#ix=2lWl
00:47:48leorizeRika: you beat me to it :P
00:48:07FromDiscord<Rika> prestige: also, the backticks are optional on templates
00:48:09PrestigeHehe
00:48:15*pbb quit (Quit: No Ping reply in 180 seconds.)
00:48:16FromDiscord<Rika> but i like to put them anywhere applicable anyway
00:48:25FromDiscord<Rika> theyre more clear to me
00:48:30leorizebackticks have special meanings in templates
00:48:35PrestigeYeah I think it's better for readability, thanks for the help
00:48:40FromDiscord<Rika> also you can combine idents in templates but not quote do
00:48:44leorizethey are used for identifier construction
00:48:47FromDiscord<Rika> which is the meaning for ``s
00:49:11FromDiscord<Rika> `someUntyped =` will combine whatever value the someUntyped is w/ an =
00:49:16FromDiscord<Rika> easy setter proc generation 🙂
00:49:38*pbb joined #nim
00:49:41leorizethat's not the main usecase though :P
00:49:59FromDiscord<Rika> Prestige: ^ make sure to see this, i dont know if leaving ``s on the args has an extra compile time cost
00:50:11leorizethe main use case is to produce something like: proc `prefix Identifier`()
00:50:19FromDiscord<Rika> leorize: technically there's no main usecase for something so generic
00:50:31leorizeI'm just stating what in the manual :P
00:50:41leorize(and yes I do use that case a lot)
00:50:45PrestigeHmm okay
00:50:46FromDiscord<Rika> generic -> wide in use
00:51:05PrestigeThis language is so awesome
00:51:22leorizeyes, 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:18FromDiscord<Rika> TIL an intlit w/ an f suffix is a float32
01:00:08FromGitter<kaushalmodi> Rika: ?
01:00:15FromGitter<kaushalmodi> !eval echo $type(123)
01:00:17NimBotint
01:00:31PrestigeIf a template has a return type, it should still implicitly create `result` right?
01:00:56FromGitter<kaushalmodi> Rika: or did you mean:
01:01:06FromGitter<kaushalmodi> !eval echo $type(123'f)
01:01:08NimBotfloat32
01:01:24leorizePrestige: nope
01:01:24FromDiscord<Rika> yes
01:01:32FromDiscord<Rika> thats what i mean
01:01:37FromGitter<kaushalmodi> if so, there are "suffixes" for all
01:01:44PrestigeThanks
01:01:45FromDiscord<Rika> yeah, i know
01:01:51FromGitter<kaushalmodi> ok
01:01:59FromDiscord<Rika> but i mean, shouldn't `f` mean `float`?
01:02:09FromGitter<kaushalmodi> f is shorthand
01:02:20FromDiscord<Rika> and so
01:02:22FromGitter<kaushalmodi> float64 would be f64, I guess
01:02:29FromDiscord<Rika> but f should be float
01:02:32FromDiscord<Rika> not float32
01:02:33FromGitter<kaushalmodi> similarly there's i32, i64, ..
01:02:38FromDiscord<Rika> i'm not on a 32bit system
01:02:44FromGitter<deech> Aside from nimsuggest what are non-trivial examples of using the compiler as a library?
01:03:32FromGitter<kaushalmodi> https://play.nim-lang.org/#ix=2lWn
01:03:42leorizedeech: nimfind, nimpretty
01:04:02leorizeold nimble was also one of the compiler-based tool
01:04:17PrestigeHmm.. https://0x0.st/iLby.png not sure what to make of this?
01:04:30FromDiscord<Rika> sigh
01:04:32FromDiscord<Rika> whatever
01:04:37leorizePrestige: templates are not procs
01:04:40FromDiscord<Rika> you dont seem to understand what i mean
01:04:45FromDiscord<Rika> ¯\_(ツ)_/¯
01:05:27leorizePrestige: imagine it from the quote do stand point :)
01:06:17leorizeRika: we also have the `d` suffix too
01:07:41FromGitter<kaushalmodi> Rika: cool, wasn't aware aware of 'd
01:07:58FromGitter<kaushalmodi> that's nonintuitive
01:08:10FromGitter<kaushalmodi> for me, d is decimal, h is hex, b is binary
01:08:20Prestigehm I've seen macros executed in the same syntax like someMacro(args) though, unless you mean something else
01:08:54PrestigeCan I just not return values?
01:09:02FromDiscord<Rika> yall i know what the prefixes mean, what i am questioning is why would f be float32 and not float
01:11:57Prestigeperhaps I just need an out param for my values array
01:12:51PrestigeOkay 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:37leorizePrestige: what came out of your template is the AST :P
01:39:31leorize@Rika probably for C users
01:40:15Prestigeoml my status bar was just placed in the correct location
01:40:17Prestigewoo
01:43:57leorizeooh, I never know that iosevka got a "wide" variant
01:44:51leorizethe wide variant makes it look kinda like jetbrains mono :P
01:45:44Prestigeleorize: this is what I ended up doing: https://0x0.st/iLbd.png
01:45:58Prestigeprobably is some way to clean it up futher but it's working
01:47:08leorizewell it looks fine enough I suppose :P
01:50:58*Guest44339 quit (Ping timeout: 258 seconds)
01:51:12leorizegentoo is pretty good at being outdated :p
01:57:03*dadada__ joined #nim
02:04:36disruptekshhh
02:06:26leorize[m]the font I use has been outdated for 2 major releases
02:07:21disruptekeh, 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:02leorizedisruptek: we might wanna research how go does their floating point stuff
02:43:34leorizethey'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:54disruptekhmm.
03:06:10disrupteki guess that's probably worth copying.
03:06:30FromDiscord<Gary M> sent a long message, see http://ix.io/2lWI
03:06:37FromDiscord<Gary M> but how do I initialize the set in the array
03:06:46*cgfuh quit (Quit: WeeChat 2.7.1)
03:09:13FromDiscord<Gary M> the set(s) rather heh
03:11:44FromDiscord<Technisha Circuit> How would i check if a file exists in Nim?
03:11:56FromDiscord<Gary M> I guess it's `for x in signatures.mitems: x = {}` but idk
03:12:33FromDiscord<Gary M> https://nim-lang.org/docs/os.html#fileExists%2Cstring @Technisha Circuit
03:12:50FromDiscord<Technisha Circuit> Thanks
03:12:58FromDiscord<Gary M> existsFile or fileExists either or
03:13:50FromGitter<kaushalmodi> Rika: because in C, (f)loat is 32 bits and (d)ouble is 64 bits
03:14:06FromDiscord<Technisha Circuit> Oh yeah, for an if statement, is `if true` and `if not true` okay?
03:14:21FromDiscord<Rika> @Gary M sets are initialized by default?
03:14:26FromDiscord<Gary M> I guess
03:14:39FromDiscord<Rika> so what's the issue?
03:14:57FromDiscord<Technisha Circuit> Thanks
03:15:00FromDiscord<Gary M> just trying to do std::bitset type stuff in nim but I'm not sure 😄
03:15:06FromDiscord<Technisha Circuit> (edit) 'Thanks' => 'Thanks, I'ma just try'
03:15:11FromDiscord<Rika> sets are 0'd ({}) by default
03:15:12FromGitter<kaushalmodi> You were wondering why 'f is 32 bits and not 64 bit float
03:15:25FromDiscord<Rika> kaushalmodi: wasnt replying to you
03:15:27FromDiscord<Rika> but thanks
03:15:34FromGitter<kaushalmodi> I later figured :)
03:15:35FromDiscord<Rika> i was talking to gary
03:16:08FromDiscord<Gary M> so I want to set a bit in the set
03:16:23FromDiscord<Gary M> I'm not sure if `a.SetSignature({1'u8})` is correct
03:16:23FromDiscord<Rika> by "default"?
03:16:26FromDiscord<Gary M> no
03:16:37FromDiscord<Rika> that should by fine
03:16:53FromDiscord<Gary M> moving on from the and 2'u8 would set a different bit yeah? 😄
03:17:04FromDiscord<Gary M> moving on from the init stuff*
03:17:39FromDiscord<Rika> yes
03:17:55disruptekuse enums instead.
03:18:41FromDiscord<Gary M> is it functionally the same?
03:18:48FromDiscord<Rika> ah yeah, {2} != 2, bitwise
03:18:51FromDiscord<Rika> yes it is
03:19:04disruptekno, it's superior because it composes better and offers type safety.
03:19:54disruptekexamples here:
03:19:56disruptek!repo gittyup
03:19:58disbothttps://github.com/disruptek/gittyup -- 9gittyup: 11higher-level git bindings that build upon nimgit2 15 3⭐ 0🍴
03:20:00disruptek!repo gully
03:20:02disbothttps://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:00FromDiscord<Gary M> sent a code paste, see http://ix.io/2lWL
03:24:02FromDiscord<Gary M> according to the manual
03:24:09FromDiscord<Gary M> `a.SetSignature({Pos})`
03:24:15*lritter quit (Quit: Leaving)
03:24:31FromDiscord<Rika> yes
03:27:06*dadada joined #nim
03:27:29*dadada is now known as Guest73029
03:28:18FromDiscord<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:49FromDiscord<Gary M> do you mean to read the file into a string?
03:30:50*zacharycarter quit (Ping timeout: 265 seconds)
03:33:57FromDiscord<Technisha Circuit> I want to do something similar to `__import__("path.to.file")` from Python
03:34:02FromDiscord<Technisha Circuit> If it's possible
03:35:09FromDiscord<Gary M> I don't know what that does in Python
03:35:44FromDiscord<codic> It imports a file the same way as `import .file`, except the path is a string.
03:36:00FromDiscord<codic> So instead of nim's `import file` they want to have `file` as a string
03:36:45FromDiscord<Gary M> well, Araq says just use import "path/here"
03:36:45FromDiscord<Technisha Circuit> ^^^
03:37:06FromDiscord<Technisha Circuit> And "path/here" is a string?
03:37:21FromDiscord<Gary M> " " implies it's a string
03:37:30FromDiscord<Technisha Circuit> Thanks :p
03:37:37FromDiscord<Gary M> I mean it's compile time isn't it
03:37:37*chemist69 quit (Ping timeout: 260 seconds)
03:37:44FromDiscord<Technisha Circuit> Wasn't in a codeblock so i was double checking
03:38:41*chemist69 joined #nim
03:48:58FromDiscord<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:05FromDiscord<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:33leorize@Technisha Circuit no, if there are conflicts Nim will force you to qualify the name
03:57:07leorizecodic: this is the, uh, not so nice part about jester
03:57:12*dadada__ joined #nim
03:57:26leorize`resp readFile "yourfile.html"` :P
03:57:28FromDiscord<Rika> It will match whichever matches the signature, and if many do it forces fill qual
03:57:30FromDiscord<Rika> Full*
03:58:10FromDiscord<codic> what's so 'not so nice' about it?
03:58:27FromDiscord<codic> `resp(readFile("whatever.html"))` seems perfectly decent
04:02:43leorizeit's not a streaming interface
04:03:04leorizeso this is basically: read the file to memory, then start streaming it to your client
04:03:30leorizeextremely inefficient for large files, but should be fine for small ones like html
04:03:49FromGitter<Willyboar> Doesn't have render?
04:05:13FromDiscord<codic> Any way to have it work for large ones as well?
04:05:22FromDiscord<codic> With decent speed
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:46*supakeen joined #nim
04:09:00FromDiscord<codic> Anyways in jester how do I return a response code and html?
04:09:09FromGitter<Willyboar> Look tweeter example with source code filters
04:09:32FromGitter<Willyboar> Or you can use mustache
04:09:33FromDiscord<codic> No idea how to usea source code filter
04:09:50FromDiscord<codic> Which file should I look at?
04:10:14FromGitter<Willyboar> It is in doms nim in action repo
04:10:59FromGitter<Willyboar> https://github.com/dom96/nim-in-action-code
04:11:14FromDiscord<codic> there's a lot of files though
04:11:18FromDiscord<codic> inside tweeter
04:11:23FromGitter<Willyboar> Look tweeter at the views folder
04:11:31FromDiscord<codic> k
04:11:50FromDiscord<codic> nope, can't find it there :(
04:12:18FromGitter<Willyboar> Also there is an interrsting video series in jester basics
04:12:44FromDiscord<codic> Do you know how to return html + resp code tho
04:13:16FromDiscord<codic> `resp "thing"; return 200` or something?
04:14:07FromGitter<Willyboar> https://www.youtube.com/playlist?list=PL6RpFCvmb5SGw7aJK1E4goBxpMK3NvkON
04:14:30FromDiscord<codic> So I should watch the whole series just to find one thing? Not trying to be mean, but..
04:15:24FromGitter<Willyboar> Nope. You will find three ways of using templates in jester
04:15:45FromGitter<Willyboar> Karax, mustache and SCF
04:16:30FromDiscord<codic> I don't want to use templates, though
04:16:35FromDiscord<codic> I just want to return a response code
04:17:28FromGitter<bung87> @rika oh i see
04:17:51FromDiscord<codic> Seems that I can do `request.status`. I'll do that?
04:17:53*rockcavera quit (Remote host closed the connection)
04:19:44FromGitter<bung87> @rika sorry for late, sleeped and now wake
04:20:28*dadada__ quit (Ping timeout: 258 seconds)
04:20:59FromGitter<Willyboar> @codic you want to print status code ?
04:21:12FromGitter<bung87> !eval let x: [string, float];x = ('hello', 10)
04:21:14NimBotCompile failed: /usercode/in.nim(1, 31) Error: missing closing ' for character literal
04:21:39FromGitter<bung87> !eval let x: [string, float];x = ("hello", 10)
04:21:41NimBotCompile failed: /usercode/in.nim(1, 8) Error: type expected, but got: [string, float]
04:22:09FromGitter<bung87> !eval var x:(string,float);x = ("hello",10)
04:22:11NimBotCompile 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:46leorize@codic resp optionally take a HttpCode
04:31:04leorize@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:40PrestigeIs it common practice when working with C libs to use unsafeAddr when casting types?
05:00:42PrestigeI'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:24FromDiscord<Rika> use unsafeAddr only if you cannot use addr is what i'd say
05:01:28FromDiscord<Rika> but i got no clue how
05:01:59FromGitter<bung87> it is common
05:03:46PrestigeMaybe I had an incorrect type cast or something, will have to keep at it tomorrow. Getting too tired
05:12:26FromDiscord<Elegant Beef> Oh hey we got a good bot finally here
05:12:46FromDiscord<FromIRC> Uptime - 14 hours, 49 minutes, 34 seconds, 188 milliseconds, 265 microseconds, and 139 nanoseconds
05:12:47FromDiscord<Elegant Beef> !status
05:16:36FromDiscord<Rika> just noticed?
05:16:36FromDiscord<__ibrahim__> hey, is there a way to pipe function calls in nim?
05:16:41FromDiscord<Rika> pipe?
05:16:44FromDiscord<Rika> what do you mean
05:16:48FromDiscord<__ibrahim__> |
05:16:54FromDiscord<Rika> nim is not a shell?
05:16:58FromDiscord<Elegant Beef> Yea i just notice rika, dont think i was here
05:17:10FromDiscord<Elegant Beef> Doesnt pipe just send it in through the stdin?
05:17:20FromDiscord<Rika> no thats another pipe
05:17:25FromDiscord<Rika> rather thats another redirector
05:17:28FromDiscord<Elegant Beef> Ah
05:17:33FromDiscord<Elegant Beef> `>` eh
05:17:38FromDiscord<Elegant Beef> ?
05:17:44FromDiscord<Rika> `>` is stdout
05:18:01FromDiscord<__ibrahim__> say u wanna transform then accumulate then fold
05:18:21FromDiscord<Rika> just call with UFCS?
05:19:02FromDiscord<Rika> !eval import sequtils; echo @[1,2,3,4].foldl(a+b)
05:19:05NimBot10
05:19:31FromDiscord<Rika> !eval import sequtils; echo @[1,2,3,4].mapIt(it * 2).filterIt(it > 4).foldl(a+b)
05:19:34NimBot14
05:19:45FromDiscord<Rika> look into sequtils
05:19:48FromDiscord<__ibrahim__> oh sweet
05:20:13FromDiscord<Elegant Beef> the UFCS is one of the nicest syntaxial things about nim imo
05:20:23FromDiscord<Rika> i think its syntactic
05:20:25FromDiscord<__ibrahim__> thank youu that looks great
05:20:31FromDiscord<Elegant Beef> probably rika
05:20:33*dadada__ quit (Ping timeout: 265 seconds)
05:20:41FromDiscord<Elegant Beef> I dont pretend to know how to use english, i just use it
05:20:53FromDiscord<Rika> or syntactical
05:21:08FromDiscord<Rika> i'm just some idiot who knows a few words
05:21:26FromDiscord<__ibrahim__> def not syntaxial, but i like your style Beef
05:21:44FromDiscord<Elegant Beef> See my name says dont listen to me but you guys did
05:21:51FromDiscord<Elegant Beef> Follow the manuals guys!
05:22:32FromDiscord<__ibrahim__> cant hear you sry
05:22:34FromDiscord<Elegant Beef> Also it's not `def` in nim it's `proc`
05:22:37FromDiscord<Elegant Beef> 😛
05:22:50FromDiscord<Rika> did someone say something?
05:23:56FromDiscord<__ibrahim__> nope
05:24:16FromDiscord<Rika> i must be going insane...
05:24:26FromDiscord<__ibrahim__> `proc` no one said anything
05:25:57FromDiscord<Rika> (use deffo :P)
05:26:27FromDiscord<__ibrahim__> `func`
05:27:04*dadada joined #nim
05:27:27*dadada is now known as Guest21172
05:27:45FromDiscord<Elegant Beef> mefunecdureintion
05:28:38FromDiscord<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:06FromDiscord<Elegant Beef> The previous abomination of a sentence clearly shows i shouldnt ever speak
05:35:23FromDiscord<__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:32FromGitter<bung87> any suggestion for contributing to Nim repo that I can handle ?
05:57:00*dadada__ joined #nim
06:00:48livcdmratsim: so even andrew himself told you he is not using webview :D
06:03:08Yardanicooh nice the bot didn't actually crash even once
06:03:10Yardanico!status
06:03:10FromDiscordUptime - 15 hours, 39 minutes, 58 seconds, 620 milliseconds, 739 microseconds, and 366 nanoseconds
06:03:25Yardanicogood morning everyone btw :P
06:03:36FromGitter<bung87> good morning
06:04:15*silvernode joined #nim
06:05:28livcdso who is the notRobot on HN? :P
06:05:50Yardanicowhat happened? :P
06:06:51Yardanico@treeform about source maps - they're implemented in devel
06:07:08FromDiscord<Elegant Beef> Hello yard
06:07:21Yardanico@treeform https://github.com/nim-lang/Nim/pull/7508
06:07:23disbotSourcemap for JS
06:09:33*muffindrake joined #nim
06:09:53*mwbrown quit (Ping timeout: 260 seconds)
06:10:24hongerHey 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:19Yardanicooh nice seems like another arc move/sink bug with the same havlak benchmark :P gonna minimize
06:12:44FromDiscord<Elegant Beef> What module is startCommand from?
06:13:09FromDiscord<Elegant Beef> or do you mean startProcess?
06:15:23FromDiscord<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:57Yardanico@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:34hongerElegant Beef sorry, I definitely meant startProcess
06:23:46FromDiscord<Gary M> One of my favorite syntaxial things
06:24:03FromDiscord<Elegant Beef> Shut the fuck up gary, no one likes you 😛
06:24:18FromDiscord<Gary M> See it's funny because people do like me
06:24:36FromDiscord<Elegant Beef> I thought it was funny cause i **was** your friend
06:24:49FromDiscord<Gary M> And that's why you're special beef
06:25:15FromGitter<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:27Yardanicowell that's not nimble's fault
06:25:42Yardanicoand it's not in nimble's scope of tasks to handle that
06:27:02*dadada joined #nim
06:27:11FromGitter<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:08FromGitter<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:14FromDiscord<Zed> weird question, how much work would it be to implement braces into the language instead of using the colon and indentation?
07:43:23Yardanicothey already were in the language but were removed
07:43:32Yardanicothe thing is that you need to support two different syntaxes at the same time
07:43:32FromDiscord<Zed> bummer
07:43:48Yardanicoand indentation syntax is the hardest out of indentation/braces/begin|end
07:44:03FromDiscord<Zed> could you modularise the syntax
07:45:08FromDiscord<Zed> change the parser to interpret the syntax and generate the correct syntax the compiler wants
07:45:37Yardanicowell I think it was done in a similar way
07:45:51Yardanicobut it still requires more work to update two syntaxes at the same time
07:46:39FromDiscord<Rika> then you would also have no tools that supported the new syntax im guessing
07:47:13Yardanicowell you can check how they were implemented in the compiler if you download the tree from somewhere between 2017~2018
07:47:18Yardanicoi mean braces
07:47:38Yardanicosee https://github.com/nim-lang/Nim/commit/10bd488daafa79f52fec0d5e7ea76ec8d5902465
07:48:05FromDiscord<Rika> also you'll have syntax clash with the key-val tuple constructor and the set constructor
07:48:14Yardanicowdym?
07:48:21Yardanicothat can be solved of course
07:48:38FromDiscord<Rika> i mean yeah of course but that's still extra work
07:48:54Yardanicoyeah that's why they were removed
07:48:59Yardanicoand they weren't used by people anyway
07:52:37FromDiscord<Rika> NGL braced nim looks SUPER DUPER funky
07:52:43YardanicoXD
07:53:30FromDiscord<Rika> it looks both normal and wrong
07:53:39FromDiscord<Rika> like it looks "oh, c style language"
07:53:43*PMunch joined #nim
07:53:50FromDiscord<Rika> but also super wrong like "this should not be
07:53:52Yardanicowell braces don't neccessarily mean "c style language" :P
07:54:00FromDiscord<Rika> i mean, of course
07:54:04FromDiscord<Rika> but that's my first idea
07:54:29Yardanicosee what I found https://python-with-braces.appspot.com/
07:54:40FromDiscord<Rika> import braces
07:54:47Yardanicono, this is not the joke one
07:55:11FromDiscord<Rika> ```↵Add indentation support to C language↵Add braces to Ruby↵```
07:55:13FromDiscord<Rika> w hat
07:55:27Yardanicohttps://github.com/eshirazi/python-with-braces/commit/9c9c0079e4ac5b2ccec1056ac90c94daf89165a6
07:55:35Araqfwiw I wouldn't mind optional 'end if' in the language
07:55:46FromDiscord<Rika> end if?
07:55:50Yardanicoyeah, like lua
07:55:56Araqif foo: x else: y end if
07:56:15PMunchIsn't there one?
07:56:18FromDiscord<Rika> wanna be bash and use fi?
07:56:19FromDiscord<Rika> xd
07:56:27YardanicoPMunch: it was never implemented
07:56:30PMunchAt least for when you use syntax filters for HTML stuff
07:56:31Araq'end' is a keyword, PMunch, but it remains unused
07:56:34Yardanicoif you mean the "endx" syntax skin
07:56:46Araqwell it is a thing in source code filters
07:56:49FromDiscord<Rika> i dont know about the end if thing, i kinda dont like it
07:56:58Yardanico"optional"
07:57:04PMunchYeah, this stuff: https://nim-lang.org/docs/filters.html#available-filters-stdtmpl-filter
07:57:07FromDiscord<Rika> ahhh, then that's fine
07:57:15FromDiscord<Rika> i
07:57:17FromDiscord<Rika> i didnt see it
07:57:22FromDiscord<Rika> i think my head is skipping words
07:57:26Yardanico!status
07:57:27FromDiscordUptime - 17 hours, 34 minutes, 15 seconds, 573 milliseconds, 239 microseconds, and 504 nanoseconds
07:57:31PMunch"Because indentation-based parsing is not suited for a templating engine, control flow statements need end X delimiters."
07:58:01PMunchYardanico, what happens when you edit a message on the new bridge?
07:58:08Yardanicowell for simple cases it works
07:58:18FromDiscord<Yardanico> hello world
07:58:21PMunchDefine works
07:58:21FromDiscord<Yardanico> (edit) 'world' => 'word'
07:58:28PMunchOh cool
07:58:32FromDiscord<Yardanico> (edit) 'hello ... word' => 'helloadd'
07:58:38Yardanicothis is a bit broken though
07:58:44Yardanicowhen inserting in the middle
07:59:16FromDiscord<Yardanico> (edit)
07:59:22Yardanicothis is even more broken it seems
07:59:33FromDiscord<Rika> is it bren?
07:59:37FromDiscord<Rika> (edit) 'bren?' => 'broken?'
07:59:39FromDiscord<Rika> 😛
07:59:52Yardanicoand the edit handling rn is kinda spaghetti code because it's kinda complicated
08:00:07Yardanicohttps://github.com/Yardanico/ircord/blob/master/src/ircord.nim#L298
08:01:18PMunchHmm, I see
08:01:30YardanicoI'm using "diff" - difflib (Pythn) port to Nim
08:01:33PMunchStill pretty good though
08:01:54Yardanicoalthough I also use both regex and npeg :D
08:02:05Yardanicoalso parsetoml for config
08:04:31PMunchMaybe you should use NimScript for config ;)
08:04:42Yardanicoyeah, embed the whole compiler :D
08:04:44Yardanicolike nimph
08:04:47*dddddd joined #nim
08:04:49PMunchI found the bug in my custom stdlib stuff yesterday :)
08:04:55PMunchFinallyI
08:05:10FromGitter<Willyboar> Hello guys!
08:05:17Yardanicohmm maybe I should use npeg to replace IRC formatting with markdown
08:05:19PMunchI mean my test file only comes out to 1.3MB
08:05:20Yardanicowould not be that hard
08:05:33FromGitter<Willyboar> Do you know the nim lib with the most stars except the nim itself?
08:05:35PMunchOoh, that'd be neat
08:05:41Yardanico@Willyboar library or any repository?
08:05:47FromGitter<Willyboar> any
08:05:52Yardanicohttps://github.com/oakes/vim_cubed
08:06:05Yardanicoit's a joke project :P
08:06:09PMunchHaha :P
08:06:14PMunchOf course that has the most stars :P
08:06:36Yardanico@Willyboard you can easily search yourself
08:06:42Yardanicohttps://github.com/search?o=desc&q=language%3Anim+stars%3A%3E100&s=stars&type=Repositories
08:06:54FromGitter<bung87> @alehander92 found I can tranpile source file .ts and .d.ts , so it will generate source translation version and bridge version.
08:07:16FromGitter<Willyboar> Yardanico i used exact the same search query
08:07:20FromGitter<Willyboar> :P
08:08:12livcdYardanico: is deepcopy working with arc/orc already?
08:08:18Yardaniconot yet
08:08:22Yardanicohttps://github.com/nim-lang/Nim/issues/13997
08:08:24disbotARC: deepCopy in new runtime feature missing, do we have alternatives?
08:08:40FromGitter<Willyboar> @PMunch alehander92 watching for you yesterday
08:08:42Yardanicowell it will probably be available :P
08:09:03PMunchWillyboar, oh?
08:09:07Yardanicohmm I want to try something interesting
08:09:10Yardanicocompile https://github.com/nim-lang/Aporia with latest nim
08:09:22Yardanicopoor aporia :c
08:09:26FromGitter<Willyboar> Something about web framework ideas
08:10:03Yardanico"import asyncio" oh lol
08:11:51FromGitter<Willyboar> @yardanico it would be interesting to see aporia alive
08:12:03Yardanicowell at this point it would be easier to rewrite it from scratch :P
08:12:06Yardanicoit's gtk2
08:13:20FromGitter<Willyboar> by the way aporia means question
08:13:38PMunchYardanico, make it compile with --gc:arc :P
08:13:43YardanicoPMunch: sure /s
08:13:52Yardanicowell I mean it could be possible
08:13:54Yardanicobut why
08:13:58PMunchWillyboar, really? What language?
08:14:05FromGitter<Willyboar> Greek
08:14:12PMunchYardanico, you know me, I don't need a why :P
08:14:20Yardanicodid the compilation finish?
08:15:14PMunchNope
08:15:33FromGitter<Willyboar> @PMunch if you decide to start a web framework with alehander i am in
08:15:46PMunchBeen running for 147h atm, currently sitting at 60.5GB of RAM usage, up after the dip yesterday
08:15:57PMunchCPU usage is still low, so I think it's doing IO or swapping to cache
08:16:10PMunchI've used 47GB of my cache now
08:17:04PMunch@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:08FromDiscord<Rika> the big 308 million argument function project
08:18:12FromGitter<Willyboar> Well i am not in the level to help a lot writing one but i can help as a user
08:18:48FromGitter<Willyboar> also i can help with designs, websites, examples and other dirty stuff
08:19:29PMunchAll definitely useful contributions
08:19:50PMunch@Rika, place your bets now for when it finishes compiling!
08:19:56livcdI would welcome a performant http server that is cross platform
08:20:28PMunchMy focus has been primarily on features
08:20:50PMunchBut Jester has pretty good performance, no?
08:21:04FromGitter<Willyboar> yeap
08:21:05livcdon linux
08:21:24PMunchOh, is the performance poor on Windows?
08:21:44livcdhttpbeast does not work on Windows
08:21:46FromGitter<Willyboar> Because of httpbeast
08:21:48PMunchTBH though, if I could sacrifice performance on Windows for performance on Linux for a webserver I'd definitely do it
08:22:07PMunchPretty much every single production webserver runs on Linux
08:22:24FromGitter<Willyboar> I don't think anyone will host an application is not C# in a windows server
08:22:32livcdWe do a lot
08:22:38livcdbut that's not the point
08:23:06FromDiscord<Rika> PMunch: a month
08:23:33livcdIf you exclude the pure backend service your "desktop" application could still use a performant http server
08:25:19FromGitter<Willyboar> Yes but i think asynchttpserver is not that slow
08:25:23PMunchOh for sure, I was just saying that if I could pick one or the other
08:25:33FromGitter<Willyboar> just httpbeast is very fast
08:25:40livcdWillyboar: Absolutely!.
08:27:49FromGitter<Willyboar> i would like to see something between flask and rails/django
08:28:30livcdjester++
08:28:33FromGitter<Willyboar> let's say a flask with blueprints
08:29:08livcdThere are numerous efforts already...it's hard to pick something that is maintained and actively used.
08:30:04FromGitter<Willyboar> yes there is a lot but none of them have a nice website with an example or a simple tutorial
08:32:26Araq=deepcopy is so simple to do...
08:32:31*Araq sighs
08:34:52YardanicoLOL
08:34:56YardanicoI actually made aporia compile with latest nim
08:34:57Yardanicowhat
08:35:18Yardanicothe hardest part was to change some async code to use asyncdispatch
08:35:42Yardanicoalthough there are still places where it crashes because null terminator isn't accessible anymore
08:38:01Yardanicohttps://i.imgur.com/j0YDcdz.png
08:38:54Araqso now I know that "CPS macros" always compose
08:39:04*dadada__ quit (Ping timeout: 256 seconds)
08:39:21Araqnow I only need to know what the heck a "CPS macro" is
08:39:31FromGitter<Willyboar> looks a nice @Yardanico
08:39:31PMunchWait, is Aporia not using a monospace font :S
08:40:00Yardanicoit didn't require so many changes either https://github.com/Yardanico/Aporia/commit/7226d251bcc18dd614ccf133ecc71b9b33c3ec3f
08:40:10Yardanicowell in some places it will still crash I think
08:40:22Yardanicobecause it was made when you could do case object transitions and access null terminator
08:40:25FromDiscord<Recruit_main707> can you change the theme of the ide?
08:41:13narimiranYardanico: off by one? https://github.com/Yardanico/Aporia/commit/7226d251bcc18dd614ccf133ecc71b9b33c3ec3f#diff-456c5aab7b3f0fbb350c6c1a23a9b424R26
08:41:29Yardaniconarimiran: ah lol :P
08:41:43narimiranutils.nim, line 503, the same
08:42:11*dadada joined #nim
08:42:14narimiran`for i in 0 .. tasks-1:` --> using `..<` is nicer, IMO
08:42:24Yardanicowell don't blame me :P
08:42:29narimirani don't :)
08:42:30PMunchThis is actually a bit of a success story for those who worry about Nim compatibility
08:42:32YardanicoI just did the bare minimum to make it compile
08:42:34*dadada is now known as Guest19094
08:43:17narimiranand you did a really good job, make no mistake!
08:43:28Yardanico"while i < text.len" should work I guess?
08:43:36Yardanicoah no wait
08:44:28narimirannope, now i see :)
08:44:34narimiran`var j = i+1`
08:44:36Yardanicoyeah
08:45:06narimiranbut the first example should be ok without `- 1` part, from what i'm seeing
08:47:00Yardanicoit actualy looks quite nice with fira code
08:47:11Yardanicohttps://i.imgur.com/JrvG4Yj.png
08:48:12FromGitter<Willyboar> Doesn't support file tree?
08:48:39FromDiscord<Rika> you know whats a mindfuck for me? `..<` is idiomatic but `..^` technically isnt
08:50:40FromDiscord<mratsim> @Araq send a mail to the author 😛
08:50:45Yardanicolol
08:51:09Yardaniconarimiran: I changed some stuff, not sure if it's correct though https://github.com/Yardanico/Aporia/commit/5b9f4355dbc4442b77d4aafc1ecb876c026eb617
08:51:55FromDiscord<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:01AraqYardanico, write a guest blog post about it, it's very nice
08:53:29FromDiscord<mratsim> > Thispaperdiscussesthecom-putationalpoweroftheSchememacrosystemasafunc-tionallanguageinitself,considersitslimitationsinexpres-siveness,andrelateshowthetechniqueofwritingmacrosinacontinuation-passingstyle|onethathasbeenusedbyseriouspractitionersforsometime|providesawaytogetaroundsomeoftheselimitations.↵yeah broken PDF copy
08:53:44FromDiscord<mratsim> "serious practictioners"
08:54:04Araqmratsim: oh nice, that's a document I haven't seen
08:54:15PMunchAraq, second the post!
08:55:22FromDiscord<mratsim> https://www.csee.umbc.edu/courses/undergraduate/331/resources/lisp/onLisp/20continuations.pdf↵↵20.2 Continuation Passing Macros
08:56:33FromDiscord<mratsim> handout: program transformation to CPS: https://www.cs.toronto.edu/~david/csc324/assignments/a2/handout.html
08:57:24narimiran+1 on Yardanico writing a blog post about it
08:57:25FromDiscord<mratsim> This seems quite deep as well: https://www.brics.dk/RS/06/15/BRICS-RS-06-15.pdf
08:57:32narimiranor maybe even Nim Conference talk ;)
08:57:49Araqmratsim: I know CPS, but I'm too stupid to apply it to macros
08:58:05AraqI mean, I can guess how it would look like
08:58:20Araqbut it would need language support
08:59:03FromGitter<Willyboar> @narimiran or both...
08:59:11Yardanicohah
08:59:12PMunchOoh, I think I just found my NimConf topic!
08:59:55FromDiscord<mratsim> @Araq I find continuation quite useful but I don't understand CPS 😛
09:00:09YardanicoPMunch: it finished?!
09:00:16PMunchHaha, no
09:00:40PMunchMaybe it'll complete some time before NimConf :P
09:00:43Araqmratsim: 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:09FromGitter<Willyboar> @PMunch it''complete the day of the conference
09:01:26PMunchWouldn't that be something !
09:02:03Yardanicowhat's the day of nimconf? which day of june?
09:02:04FromDiscord<mratsim> I just read Intel TBB on continuation passing and I don't understand 😛 https://software.intel.com/en-us/node/506106
09:02:11PMunch6th I think
09:15:34*Guest19094 is now known as dadada
09:15:40dadadayo
09:16:19dadadais 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:41FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/PHhe/Screenshot-2020-05-14-at-5.16.22-PM.png)
09:17:56FromGitter<bung87> I can steal many node modules now
09:18:34FromDiscord<Recruit_main707> dadada: i dont think so, thats pretty specific (not sure though)
09:19:22Yardanicodadada: there's https://nim-lang.org/docs/sequtils.html#distribute%2Cseq%5BT%5D%2CPositive
09:19:31YardanicoI guess it's what you need?
09:20:03*vqrs quit (Ping timeout: 260 seconds)
09:21:21dom96Yardanico, bet you can still get the asyncio module from an old Nim
09:21:27dom96(or just use an old Nim ;))
09:21:31Yardanicodom96: yes but I compiled without it :P
09:21:38Yardanicoidk 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:06Yardanicoah also btw, about nimconf - is it decided where it will be hosted?
09:34:16Yardanicowhich platform
09:34:34dom96nope
09:35:30PMunchJitsi?
09:35:43PMunchQuick, someone throw together a Nim video conferencing app!
09:36:27Yardanicohaha
09:36:38Yardanicodon't forget to embed tracking and fake e2e encryption too
09:36:45Yardanicoand say that it was made in V
09:43:04FromDiscord<Gary M> sent a code paste, see http://ix.io/2lYf
09:43:05livcd:D evil
09:43:18FromDiscord<Gary M> I'm having issues with this generic
09:43:39FromDiscord<Gary M> the components array is an array[MaxEntities, T]
09:44:03FromDiscord<Gary M> I can access it fine with the int literal but not with a variable int
09:46:28Yardanico!status
09:46:29FromDiscordUptime - 19 hours, 23 minutes, 17 seconds, 279 milliseconds, 403 microseconds, and 443 nanoseconds
09:47:57*abm joined #nim
09:48:44FromDiscord<mratsim> @Gary M what's the error?
09:49:05FromDiscord<Gary M> https://i.imgur.com/BZ2usnj.png
09:49:29FromDiscord<Gary M> it's just blowing up lol
09:49:38Yardanicocan you show the end of that error?
09:49:43Yardanicothe bottom
09:49:50Yardanicoit shows which types mismatched
09:50:08FromDiscord<Gary M> https://i.imgur.com/hWbBJKA.png
09:50:11FromGitter<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:18Yardanicono, even more at bottom @nothratal
09:50:29Yardanico@nothratal yes, because JS backend is mainly targeted at frontend
09:50:35FromDiscord<Gary M> that's the end of the error
09:50:38Yardaniconim's IO is not really ported to nodejs
09:50:38FromDiscord<Gary M> when I compile
09:50:45Yardanicoexcept simple stuff like "echo"
09:50:50Yardanicono stdin/stdout, no files
09:50:58Yardanicoyou'll have to wrap them manually but it's not so hard
09:51:07FromGitter<nothratal> ok
09:51:10FromGitter<nothratal> just asking
09:51:21Yardanicoit's not so hard really
09:51:23FromGitter<nothratal> you right, interop-examples are also listed there
09:51:34Yardanicoyou can just go away with emit and a few nim bindings :P
09:52:15Yardanicoa 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:39FromGitter<nothratal> oookey...I have to admit that I don't have an actual use case yet :P ⏎ Just reading through the documentation
09:54:00Yardaniconodejs is really only used for the test suite, all other work is mostly concentrated on the frontend (JS in browsers)
09:54:15FromGitter<nothratal> but good to know, I try to keep it in mind
09:59:38FromDiscord<Gary M> meanwhile still trying to understand why a variable isn't working as an array accessor
09:59:51Yardanicowait what is T()
09:59:53Yardanicois T == int ?
10:00:39FromDiscord<Solitude> can you reduce it to minimal example we can run?
10:00:49Yardanicooh nice solitude now you're in discord :D
10:00:53FromDiscord<Gary M> sent a code paste, see http://ix.io/2lYh
10:00:54FromDiscord<Gary M> I'll try
10:02:21YardanicoReducing an example is fun https://gist.github.com/Yardanico/3de13a8e8cfdbd59b80d5ebd2ac2c80e/revisions
10:02:26Yardanicoread from bottom up :D
10:03:49PMunchHaha from 256 lines down to 14?
10:04:16Yardanicoyeah, see https://github.com/nim-lang/Nim/issues/14345
10:04:19disbot[ORC] Incorrect sink inference ; snippet at 12https://play.nim-lang.org/#ix=2lYi
10:06:35skrylar[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:35skrylar[m]emitters to the mailboxes and they hide the whole variant repacking steps from you
10:07:10Yardanicoa lot of text but sounds good :P
10:07:31FromGitter<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:32FromGitter... [https://gitter.im/nim-lang/Nim?at=5ebd1863519b852e93ef78f6]
10:07:32Yardanicoalso make it threadsafe :D
10:07:36skrylar[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:45FromDiscord<Gary M> https://play.nim-lang.org/#ix=2lYl
10:07:55FromDiscord<Gary M> @Solitude this is the bare minimum for the example
10:09:15Yardanicoof course it wouldn't work ?
10:09:20Yardanicoah wait
10:09:22Yardanicohmm
10:09:46FromDiscord<Gary M> it's just an int
10:09:53skrylar[m]Yardanico: you end up with a bunch of these `proc acceptor(mailbox: type[Mailbox]; letter: type[CollisionStarted]): PostboxAcceptor =`
10:09:56FromDiscord<Gary M> but it only works with a literal, not a variable
10:10:14Yardanicoof course
10:10:18Yardanicoyour variable is int
10:10:20YardanicoEntityId is uint32
10:10:43FromGitter<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:23FromDiscord<Gary M> ah that was it, thanks 🙂
10:12:45narimiranNimConf 2020: https://nim-lang.org/blog/2020/05/14/nim-conference.html
10:12:51Yardanico20th ?
10:13:01YardanicoPMunch: you were *just a little bit* wrong :P
10:13:01narimiranyeah, we decided to move the date a bit
10:13:04Yardanicowell it's fine
10:13:07*honger quit (Ping timeout: 260 seconds)
10:14:35Yardanicoa small nitpick: the google form still says "Event Timing: Saturday, June 6th, 2020"
10:14:49FromGitter<Willyboar> when did you publish the programm?
10:14:55Yardanico@Willyboar ?
10:15:00*honger joined #nim
10:15:03narimiranYardanico: thanks for catching that, fixing it ASAP
10:15:39*JustASlacker joined #nim
10:15:44narimirannow it should be ok
10:15:52Yardanicothat was fast :P
10:16:00narimiranthat's what she said
10:16:05Yardanicoohno
10:16:12narimiranthat too :)
10:16:34PMunchYardanico, only slightly :P
10:16:41PMunchYeah, that's where I got my date from
10:16:46PMunchThe Google sheet that is
10:21:11alehander92morning
10:22:53PMunchGood morning
10:23:27Yardanicoohayo
10:25:32*dadada quit (Ping timeout: 265 seconds)
10:26:56FromGitter<Willyboar> good morning @alehander92
10:27:52alehander92finally in Sofia
10:27:56alehander92first time since March
10:28:15FromGitter<Willyboar> where are you pass the lockdown?
10:28:44alehander92i was in plovdiv, we had police checks on roads between cities unless you fill a declaration
10:29:32FromGitter<Willyboar> yes we have too
10:29:55FromGitter<Willyboar> but we make it good
10:31:28FromGitter<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:27FromGitter<bung87> when source version is not good ,just using bridge version
10:43:14alehander92bung87 ok, sounds interesting
10:43:30alehander92Willyboar were you from thessalonici?
10:43:49*fredrikhr joined #nim
10:43:52FromGitter<Willyboar> I born in thessaloniki
10:44:08FromGitter<Willyboar> also lived here until 17
10:45:19FromGitter<Willyboar> my parents live there
10:54:19alehander92awesome
10:57:06*dadada joined #nim
10:57:30*dadada is now known as Guest68640
11:07:06FromDiscord<Technisha Circuit> Are there any alternative Nim compilers?
11:07:21FromDiscord<Technisha Circuit> I'm just curious rn :P
11:07:40FromDiscord<Recruit_main707> nlvm
11:07:44FromDiscord<Recruit_main707> linux only
11:07:50FromDiscord<Technisha Circuit> Oh?
11:07:59FromDiscord<Recruit_main707> compiles nim directly to llvm
11:08:36alehander92nope
11:08:39FromDiscord<Technisha Circuit> Is there any advantages/disadvantages compared to the normal compiler?
11:08:39alehander92no other frontends
11:08:50alehander92but yeah, nlvm is a different backend
11:08:59FromDiscord<Technisha Circuit> :P
11:09:07alehander92yes, it compiles to llvm
11:09:16Yardanicofor nim it's just like another backend, yeah
11:09:18alehander92you have to ask arnetheduck
11:09:27Yardanicohe's on discord, not here
11:09:29Yardanicoyou can ping him :P
11:09:32alehander92@arnetheduck
11:09:39FromDiscord<Recruit_main707> you can also ;)
11:10:00*Guest68640 is now known as dadada
11:10:40FromDiscord<Technisha Circuit> Nlvm apparently doesn't work on arm
11:11:12Yardanicowell it's not that *hard* to do it if you know stuff
11:11:39Yardaniconlvm is linux x86_64 only because of lack of interested people who actually participate in development :P
11:11:40alehander92so, `except`: doesnt catch Defects, right?
11:11:49FromDiscord<Technisha Circuit> I'm attempting to compile it :p
11:11:55Yardanicoalehander92: in --panics:on it doesn't afaik
11:12:00Yardaniconot sure about without them
11:12:38alehander92hm, so it directly panics
11:12:39alehander92?
11:12:48alehander92is there a way to raise an exception that
11:12:58alehander92is not .. catched by default ..
11:13:02alehander92this doesnt make a lot of sense, right
11:13:15Yardanicoit does
11:14:22FromDiscord<Doongjohn> does nim have weak ref built in?
11:14:28FromDiscord<Technisha Circuit> This is my issue now :/ https://media.discordapp.net/attachments/371759389889003532/710449946674855976/Screenshot_20200514_121415_com.termux.jpg
11:14:45FromDiscord<Technisha Circuit> > does nim have weak ref built in?↵@Doongjohn i think it's something similar to weakref
11:15:01FromDiscord<Technisha Circuit> I can't use GCC because of Termux
11:15:27FromDiscord<Technisha Circuit> I'm using clang
11:16:01dadadaAraq: 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:17Yardanico@Technisha don't even try
11:16:27YardanicoLLVM is really big to compile
11:16:35Yardanicoand nlvm is only x86_64 including the backend itself
11:16:39Yardanicoit won't magically work on arm
11:17:02FromDiscord<Recruit_main707> clang compiles to llvm if im not mistaken also
11:17:02FromDiscord<Technisha Circuit> Eh
11:17:09FromDiscord<Technisha Circuit> It does iirc
11:17:12Yardanico@Recruit_main707 yes it does
11:17:23Yardanicobut clang in termux is probably not using llvm 10
11:17:41FromDiscord<Doongjohn> > @Doongjohn i think it's something similar to weakref↵@Technisha Circuit what's "it"?
11:17:46FromDiscord<Recruit_main707> you are enjoying your new @ s :P
11:17:55FromDiscord<Technisha Circuit> I am not sure @Doongjohn, sorry
11:18:53FromDiscord<Technisha Circuit> I'm going to try and get gcc aswell :P
11:19:01Yardanico@Technisha how much RAM do you have?
11:19:18FromDiscord<Technisha Circuit> 4 gb :P
11:19:25FromDiscord<Technisha Circuit> But it's on my phone sooooooo
11:19:26Yardanicoand how much cores?
11:19:39FromDiscord<Technisha Circuit> I am not sure, let me check
11:20:09FromDiscord<Technisha Circuit> Octacore apparently
11:20:28FromDiscord<Technisha Circuit> It's a Huawei p30 lite
11:22:50Yardanicoyou might be able to compile llvm 10 if you use like 4 cores
11:23:01FromDiscord<Technisha Circuit> Oh?
11:23:47Yardanicoyou need a lot of memory to compile in parallel
11:24:00FromDiscord<Technisha Circuit> Oof
11:24:08Yardanicoso yeah, I wouldn't recommend you even trying
11:24:11FromDiscord<Technisha Circuit> I think it'll be fine :P
11:24:27Yardanicoit won't :)
11:24:31FromDiscord<Technisha Circuit> (Then my phone crashes)
11:24:48FromDiscord<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:50dadadadisruptek: 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:04Yardanicowell not in the files for sure :P
11:27:55FromDiscord<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:15alehander92dadada you can expandMacros:
12:15:18alehander92otherwise
12:15:27alehander92we want something like that optionally
12:15:35alehander92i've implemented it in a branch
12:16:00alehander92where one can get something like a sourcemap between normal code and expanded code (iirc)
12:16:09dadadaalehander92: man, I've been here for a few months now, so I know about expandMacros ..., can you show me your branch?
12:16:19alehander92so it's not quite similar, but maybe we can make a RFC
12:16:44alehander92hm, it's a work one, so i have to see if it's open
12:17:40PMunchOoh, that would actually be really neat alehander92
12:18:03alehander92we
12:18:30alehander92hooked it in sem.nim `semAfterMacrocall`
12:18:45Yardanicoalehander92: also I had this idea - a "dummy" nim backend
12:18:55Yardanicowhich outputs processed _nim_ after all transformations
12:19:36alehander92http://ix.io/2lZ0
12:20:02alehander92but this lacks the sourcemap code
12:20:40PMunchThat would be exactly what I'd need to minify the nimscript stdlib right?
12:21:09PMunchHmm, well maybe not after all transformations..
12:21:25alehander92hm, it has somehing in renderer.nim as well
12:21:33alehander92ok, i have to separate that
12:21:35PMunchBasically 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:39alehander92into a separate branch sorry dadada
12:21:53alehander92because its a part of big branch and i dont have time for this now
12:22:04alehander92but you can just plug some of this code in sem.nim
12:22:39alehander92and try to append it to <filename>.expanded.nim
12:22:49alehander92and remove all the sourcemap-related stuff
12:23:41alehander92PMunch interesting, sounds like other people need it to, i heard complaints about hcr breaking because of `when`-s in arc
12:24:39alehander92yardanico, yeah, sounds also useful!
12:25:11PMunchHmm, yeah I also found a weird when related to HCR in system.nim
12:25:23dadadaalehander92: when do you want this to be ready?
12:25:25PMunchwhen not defined(nimhcr): import hcr
12:25:29PMunchOr something like that
12:25:54dadadaalehander92: I can wait, but it'd be nice to know what your plan is
12:26:00alehander92dadadanope
12:26:06alehander92my plan is to RFC it eventually
12:26:16alehander92so not really soon
12:26:47alehander92i also feel that i need it sometimes :D
12:27:28dadadain my case, sometimes is now :D ... it'd be a nice to have
12:28:20*NimBot joined #nim
12:31:00Araqdadada: what do you need again?
12:32:50dadadaAraq: 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:18alehander92dadada, it might be even easier
12:35:23alehander92to plug somehwere else
12:35:30alehander92i do it there because i think i needed for the sourcemaps
12:35:42alehander92but there must be a place where the c generator takes the nim ast
12:35:55alehander92and you need to mostly plug a simple call to renderer and writeFile there
12:36:07alehander92e.g. in the beginning of cgen
12:36:20PMunchHmm, "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:34PMunchIs there a way to only get the .deps file?
12:37:07alehander92e.g. myOpen
12:37:08PMunchI want to have the minimal stdlib, but with an easy way of adding in whatever modules you need.
12:37:27PMunchAnd that file tells me exactly what I need to copy in to make stuff work
12:38:26Yardanicoalehander92: I tried but it wasn't so simple :D
12:38:35Yardanicoand yes, in myOpen in the entrypoint for the c backend
12:38:41Yardanicoor maybe I did something wrong
12:38:52alehander92it should be
12:38:54alehander92just a second
12:39:19*rockcavera joined #nim
12:40:03*kradnoel joined #nim
12:44:44PMunchHmm, 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:53Yardanicowell yes, that's not hard
12:45:16PMunchI was thinking about my usecase
12:45:23PMunchTo minify Nim code
12:50:24*Vladar joined #nim
12:53:32alehander92hmm
12:53:45alehander92zah is right, cgen has changed quite a bit
12:53:51alehander92myOpen*
12:54:36Yardanicoalehander92: so how do I access the ast of the modules in myOpen so I can dump them?
12:55:04alehander92i am trying to do it locally
12:55:08Yardanicoah ok
12:55:13alehander92it should be in `module`
12:55:24*waleee-cl joined #nim
12:56:19*dadada quit (Ping timeout: 272 seconds)
12:57:10AraqPMunch: the compiler isn't hard to work with, IMHO
12:57:23*dadada joined #nim
12:57:27PMunchNo that's what I'm coming to realise
12:57:43PMunchIt's actually pretty well structured once you start to understand where everything goes
12:57:47*dadada is now known as Guest78757
12:57:58PMunchIt would help with a handy "map" though
12:58:17PMunchIt's not always obvious where various things are called from
12:58:39Yardanicothere is one
12:58:55Yardanicohttps://nim-lang.org/docs/intern.html#the-compiler-s-architecture-short-description-of-nim-s-modules
12:59:01Araqalehander92: from https://www.microsoft.com/en-us/research/uploads/prod/2019/04/beyond_structured_report_v2.pdf
12:59:06Yardanicobut yeah it's quite minimal
12:59:15Araq„The BOSQUE language takes a similar approach by introducing the rec keyword which is used at both declaration
12:59:15Araqsites to indicate a function/method is recursive and again at
12:59:15Araqthe call site so to affirm that the caller is aware of the recursive
12:59:17Araqnature of the call.“
12:59:28Araqsee? I'm always right, recursion is dangerous
12:59:34alehander92sorry, i think it should be myProcess
12:59:48alehander92Araq hm
12:59:55alehander92what was this discussion about?
13:00:00PMunchYardanico, 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:32alehander92PMunch callgraph :)
13:01:55FromGitter<bung87> Bosque Language...
13:04:56alehander92yardanico i confused cgen.nim with sem.nim :D :D :D
13:05:01Yardanicolol
13:05:54Yardanicoi 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:37alehander92so basically
13:09:39alehander92yeah yeah
13:09:46alehander92you plug in myProcess in cgen.nim
13:09:53alehander92i meant i confused the opposite in my code
13:10:51alehander92you use renderTree, and i *think* you can use completeCfilepath and changeFileExt
13:10:58*kradnoel quit (Remote host closed the connection)
13:11:08alehander92that's what i try
13:14:07*kradnoel joined #nim
13:16:18*zacharycarter joined #nim
13:17:58alehander92sorry, 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:09alehander92probably wrong , but still closer to truth i hope
13:23:25*liblq-dev joined #nim
13:28:03alehander92https://github.com/alehander92/Nim/commit/445158da8942a29ab6eea54126b1757f74fc8fa0
13:28:08alehander92praise God, it worked
13:28:14alehander92pfff
13:28:28alehander92i need to improve my compiler knowledge
13:28:44alehander92btw why does my repo trigger CI
13:30:07alehander92dadada ^ you can try it now
13:30:32alehander92it generates nimcache/cfile-like.expanded.nim files
13:36:03PMunchOkay, stupid questions time: http://ix.io/2lZL
13:36:20PMunchThat yields this error: /home/peter/Projects/Nim/lib/system.nim(275, 25) Error: invalid pragma: unchecked
13:36:36PMunchSo I'm obviously missing some bits and pieces
13:36:55alehander92PMunch btw you can try this commit / patch up there to see code without `when`-s i think
13:37:59PMunchThe generateExpanded thing?
13:37:59alehander92hm, not really
13:38:24PMunchNot really what?
13:38:46alehander92sorry, i lied
13:38:53alehander92it seems it still has `when-s`
13:38:58alehander92i am not sure why
13:39:03PMunchHaha
13:40:00alehander92i imagined they are all somehow "calculated" before cgen
13:42:23alehander92it seems it *does* show it correctly for my user code
13:42:34alehander92but somehow not for stdlib files
13:42:54alehander92oh maybe
13:43:04alehander92their code isn't expanded or is dead code eliminated
13:43:08alehander92for procs which arent used
13:43:37alehander92so i have to maybe find out the dead-code-eliminated version of ast
13:49:02PMunchOkay, so initDefinesProg solved that error
13:49:05PMunchNow I have a thousand more
13:50:47*JustASlacker quit (Ping timeout: 272 seconds)
13:53:29alehander92ok
13:53:46alehander92the async docs say that `try` is still not recommended for async
13:53:47PMunchOh wait, that wasn't errors :P
13:53:56PMunchThat was just hints :P
13:53:58alehander92is this still true? or just not updated dom96
13:53:59PMunchIt works now .)
13:54:03alehander92PMunch oh !
13:54:14alehander92so is your install now ready
13:54:19PMunchHuh?
13:54:29PMunchThis was just to get all dependencies for a given file
13:54:57PMunchI'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:18alehander92sorry!
13:57:20alehander92sounds good :)
14:04:20*gokr joined #nim
14:06:27FromGitter<kaushalmodi> Technisha Circuit: Try the tcc compiler? https://github.com/termux/termux-packages/issues/3459
14:06:29disbotPackage Request: TinyCC
14:08:18*Vladar quit (Quit: Leaving)
14:17:20zacharycarterthat UE5 demo is pretty amazing
14:20:09Yardanicoalehander92: thanks a ton!
14:25:09Araqalehander92: it's supported for a long time now, we need to update the docs
14:27:00disruptekzacharycarter: it really is.
14:27:15PMunchOkay, so this works and gets all the required modules: http://ix.io/2m03
14:27:17Yardanicodisruptek: stream soon? :P
14:28:12PMunchhttp://ix.io/2m04 example getting all you need for system.nim and tables.nim
14:28:33PMunchNow just to make it copy all that into a folder and voila
14:28:57PMunch(If I can't figure out how to parse out comments and such though)
14:34:21FromDiscord<treeform> @Yardanico about source maps, thanks! I been waiting for that PR for like a year.
14:35:15Yardanico:P
14:39:33*krux02 joined #nim
14:42:01*lritter joined #nim
14:43:13*JustASlacker joined #nim
14:49:41disruptekAraq: so you want module names in every mangled symbol name in a module? regardless of scope?
14:50:10Araqmodule name in everything top level, not for local variables
14:50:26disruptekokay.
14:50:38*JustASlacker quit (Ping timeout: 264 seconds)
14:50:39disruptekand just first param for procs.
14:52:13Araqdisruptek: it's crucial that you get the order right, it's procname_type_module
14:52:20disruptekyep.
14:52:28Araqmost important thing first for auto completion
14:58:09*arecaceae quit (Remote host closed the connection)
14:58:34*arecaceae joined #nim
14:59:49FromDiscord<Technisha Circuit> heya
15:00:04FromDiscord<codic> While trying to use the example bot for dimscord, i get:↵```↵Exception message: socket closed↵```
15:00:06FromDiscord<codic> at some point
15:00:08FromDiscord<codic> and the bot doesnt run.
15:00:15Yardanicoyou need websocket 0.4.0
15:00:22FromDiscord<Technisha Circuit> me and codic are having an issue with dimscord, we need the zlib.dll but we are running linux
15:00:23Yardanicodimscord doesn't run with "websocket" lib > 0.4.0 :D
15:00:28FromDiscord<Technisha Circuit> lemme check
15:00:38Yardanicoyou don't need zlib really
15:00:41Yardanicounless you use compression
15:00:51FromDiscord<codic> Why do you need websocket < 0.4.0?
15:01:07Yardanicowebsocket == 0.4.0 *
15:01:08FromDiscord<codic> Does nim have something like python virtualenvs to keep packages isolated
15:01:14FromDiscord<codic> <= so
15:01:17Yardanicoyou can install multiple versions of packages at the same time
15:01:18FromDiscord<codic> Or ==?
15:01:20FromDiscord<codic> Ah
15:01:26FromDiscord<codic> But how do you specifiy which one to use
15:01:29Yardaniconimble
15:01:46Yardanico"nimble c" "nimble build" etc
15:01:53disruptek~stream
15:01:54disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
15:01:56disruptekcompiler stuff.
15:02:12FromGitter<kaushalmodi> codic: You can specify the pkg version to be used in nimble files
15:02:31FromGitter<kaushalmodi> e.g. `requires "nim >= 1.2.0", "cligen 0.9.45", "glob >= 0.9.0", "p4ztag_to_json >= 0.11.0"`
15:02:58FromGitter<kaushalmodi> that shows the minimum req pkg version for all, except for the exact pkg version for cligen
15:02:58FromDiscord<codic> ah.
15:02:59FromDiscord<codic> thank you
15:04:34FromDiscord<codic> Yardanico: websocket 4.0 was installed via `nimble install [email protected]`, but now it just freezees, the bot isnt running
15:04:41Yardanicowell ask @Krisp not me :P
15:05:02FromDiscord<kodkuce> can i check minie type from nim or do i need to call file --mime-type image.png
15:05:04FromDiscord<codic> ah, they are the developer of the library?
15:05:15FromDiscord<Technisha Circuit> yea
15:05:21FromDiscord<codic> With dimscord
15:05:22FromDiscord<codic> sent a code paste, see http://ix.io/2m0g
15:06:05FromDiscord<Technisha Circuit> lets try the dev branch
15:06:09Yardanicoah right
15:06:11Yardanicouse devel of course
15:06:13Yardaniconot the master
15:07:12FromDiscord<Technisha Circuit> how do i install it via nimble?
15:07:37FromDiscord<codic> Maybe `nimble install dimscord@devel`
15:07:38FromDiscord<codic> idk
15:07:53Yardanicodimscord@#devel
15:07:57Yardaniconimble install that
15:08:06FromDiscord<codic> nice
15:08:08FromDiscord<codic> worked
15:08:10*PMunch quit (Quit: leaving)
15:08:27FromDiscord<codic> same error though
15:08:44Yardanicowell you have both dimscord installed right?
15:08:47FromDiscord<codic> yeah
15:08:48Yardanicomake sure you're using the devel
15:08:50FromDiscord<codic> uninstalling the old one
15:09:00FromDiscord<codic> uninstalled. progress!
15:09:02FromDiscord<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:09Yardanicowhat's your nim version?
15:09:30FromDiscord<codic> 1.2.0
15:09:54alehander92Araq
15:09:57alehander92they also dont like loops
15:10:21alehander92or at least it seems they prefer map/filter/others
15:11:18alehander92hm, do they require this for mutual rec
15:15:11Araqalehander92: 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:50alehander92yeaaah
15:25:15alehander92otherwise some limit to recursion
15:25:18alehander92seems interesting to me
15:25:35alehander92but 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:53FromGitter<bung87> ` 64-bit double` is cdouble?
15:34:59dadadausing a generic value Object[T] is not possible it seems
15:35:07dadadafor a table value I mean
15:35:19Yardanicodadada: why?
15:35:30dadadaI want the table to contain different types of Object[T] it could be int or string
15:35:33dadadaor anything else
15:35:48Yardanicoit should all be the same type even if it's generic
15:36:00Yardanicouse 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:16FromDiscord<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:28FromDiscord<kodkuce> *5 chars
15:42:56Araqwrite UI applications instead, it's 2020
15:44:08FromGitter<kaushalmodi> kodkuce: That would be a nice addition to that library
15:44:19FromGitter<kaushalmodi> don't worry, there are many CLI/terminal fans here
15:44:23FromGitter<kaushalmodi> :)
15:45:39*JustASlacker joined #nim
15:50:39FromDiscord<kodkuce> i cut you with swrod
15:53:20stefantalpalaruDo 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:07stefantalpalaruThe C version has the same small value between runs (276 bytes): https://gist.github.com/stefantalpalaru/7eb2f9d5d34677ca47bd658e5a5faae8
15:54:35FromDiscord<jasonfi> I've posted a few basic articles regarding Nim on my new blog: https://onlinetechinfo.com/tag/nim
15:54:39FromDiscord<jasonfi> not sure if this helps someone
15:55:14FromDiscord<mratsim> nimporter is for Python calling Nim
15:55:21FromDiscord<mratsim> Nimpy is for Nim calling Python
15:55:36FromDiscord<jasonfi> that's strange because I am calling Python from Nim and I use nimporter
15:55:40FromDiscord<Recruit_main707> not really
15:55:48Yardanico@mratsim you don't have to use nimporter though
15:55:51Yardanicoit's just extra convenience
15:55:54FromDiscord<Recruit_main707> nimporter literally uses nimpy
15:56:07FromDiscord<jasonfi> I read that it makes it easier to use nimpy?
15:56:09Yardanicoyou can call nim from python after you build your nim library to a .so file (or .pyd on windows)
15:56:23Yardanicowith nimpy
15:56:32FromDiscord<Recruit_main707> but it makes it simpler, (by compiling the nim code at python runtime)
15:57:29FromGitter<bung87> compiling nim code at python runtime?
15:57:42Yardanicoyes, it compiles after you do "import"
15:57:47Yardanicoin python
15:57:53Yardanicoso it's just extra convenience as I said
15:58:09FromDiscord<mratsim> the article is about wrapping Python, so it's nimpy that should be mentionned
15:58:21FromDiscord<jasonfi> I will make a change then, thanks
15:59:08FromGitter<bung87> why is that all need is import a .so
15:59:20Yardanico@bung87 for faster development process I guess
16:02:54FromGitter<bung87> oh, `ext_modules=nimporter.build_nim_extensions()`
16:03:20FromGitter<bung87> it has a building extension process
16:05:37FromGitter<bung87> ok, found document also says on import
16:17:28FromDiscord<FromIRC> Uptime - 1 day, 1 hour, 54 minutes, 15 seconds, 860 milliseconds, 792 microseconds, and 327 nanoseconds
16:17:28FromDiscord<Yardanico> !status
16:18:57*leorize joined #nim
16:22:21FromDiscord<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:30wgetchif 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:35Yardanicoyes
16:57:50Yardanico"new" is not recursive it all, it only creates a new instance of the object itself
16:57:50wgetchthought so. pretty much malloc? XD
16:58:46Yardanicoyou have to consider the GC and all that
16:58:52Yardanicoso no, not malloc, far from malloc
16:59:34wgetchwell, just in terms of you have to explicitly call new
16:59:48Yardanicowell you don't need to if you use object constructor syntax
17:00:08Yardanicolet a = MyNewThing()
17:00:11Yardanicoif MyNewThing is a type
17:01:11Yardanicolet a = MyNewThing(field1: 1, field2: "hello")
17:01:16Yardanicoyou can span it over multiple lines as well
17:02:19wgetchbut you'd still have to construct the ref members
17:02:26wgetcheven using that constructor syntax?
17:02:27Yardanicoyes, so?
17:02:36YardanicoI mean with a macro you can create a recursive "new" if you want
17:02:40wgetchjust making sure I'm reading right
17:03:02wgetchI have no need for recursive new, just grasping semantics
17:03:13Yardanicohttps://nim-lang.org/docs/manual.html greatly helps for that :)
17:03:14wgetchbut that is pretty cool
17:04:28wgetchI noticed I couldn't echo() ref types, but if I apply [] operator to them it derefs and works
17:04:42Yardanicoyes
17:04:53wgetchthe manual says (generally) you dont need to use [] explicitly but I'm guessing thats an exception?
17:05:06wgetchI guess its only for members, you dont have to []
17:05:14Yardanicowgetch: it doesn't really say so
17:05:29Yardanico"The . (access a tuple/object field operator) and [] (array/string/sequence index operator) operators perform implicit dereferencing operations for reference types"
17:05:46Yardanicoso for a.b or a[b] you don't need to derefence explicitly
17:05:49Yardanicobut otherwise you need to
17:05:58Yardanico"a.b" covers like 90% of cases though
17:06:17Yardanicobut "echo a" is not a `.` or `[]`
17:06:31wgetchyeah, that makes sense. thank you!
17:15:38FromGitter<bung87> param as optional should assign a value? is there other way?
17:15:45Yardanico??
17:15:54Yardanicoah, no, of course not
17:16:01Yardanicoyou can use "options" module though
17:16:02Yardanicolike
17:16:12Yardanico"proc a(a: string, b = none(string))"
17:16:29Yardanicoso b will have an Option[string] type and contain nothing, but it'll still be an optional argument
17:16:41FromGitter<bung87> ah, omg I wrongly use it
17:17:04FromGitter<bung87> I declare it as b:Option[string]
17:17:13Yardanicowell then it'll still be mandatory
17:19:30FromGitter<bung87> yeah , the editor shows that, and then I recheck the doc, no example use it as param
17:20:59Yardanicowell it's just an ordinary type, you don't need any special docs :)
17:22:54Zevvnarimiran: could you add Salweski's writeup to the Nim learning section?
17:23:19FromGitter<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:07audiofilewhere are my fellow nimmers?! >_>
17:33:21FromDiscord<Recruit_main707> porting code
17:33:23disruptek~stream
17:33:23disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
17:33:56Prestigeo/
17:34:18*silvernode joined #nim
17:34:29audiofileoooh nice
17:34:33audiofileI will join
17:34:36Yardanicook
17:37:15*silvernode quit (Client Quit)
17:39:17FromDiscord<kodkuce> so there no way to read mime type whitout using file -b --mime-type
17:39:21FromDiscord<kodkuce> ?
17:39:30Yardanicowat?
17:39:44Yardanico"file" doesn't just "read" a mime type
17:39:51Yardanicoit has a lot of heuristics to detect the correct mimetype
17:40:02Yardanicobased on the file contents
17:40:06FromDiscord<kodkuce> i want to check mimi want to open only text kinda files in my tmux+micro vscode
17:40:33FromDiscord<kodkuce> yes but with file -b --mime-type i will get mime type
17:40:38FromDiscord<kodkuce> only 🙂
17:41:10FromDiscord<kodkuce> just duno if calling for each file in dir from nim "file -b --mime-type" is a expensive operation
17:41:13FromGitter<bung87> using libmagic
17:49:03*rockcavera quit (Remote host closed the connection)
17:50:00FromDiscord<kodkuce> https://github.com/threatstack/libmagic
17:50:09FromDiscord<kodkuce> need to wrap this i guess
17:51:20FromGitter<bung87> there is I remenber
17:52:07FromDiscord<KrispPurg> @codic use websocket 0.4.0
17:52:36FromDiscord<codic> i did
17:52:43FromDiscord<KrispPurg> huh
17:52:46FromDiscord<codic> removed both versions and then installed @0.4.0
17:52:49FromDiscord<codic> The error is gone
17:52:52FromDiscord<codic> But the bot just doesn't start
17:52:53FromDiscord<codic> it hangs
17:53:00FromDiscord<codic> I did compile with `-d:ssl`
17:53:00Yardanicodo you use compress=true
17:53:10Yardanicoif so, remove it
17:53:12Yardanicoand try again
17:53:13FromDiscord<codic> lemme see
17:53:15FromDiscord<kodkuce> try treeform webscokets at least those worked for me
17:53:37FromDiscord<codic> yeah
17:53:40FromDiscord<codic> Im using compress=true
17:53:41FromDiscord<KrispPurg> treeform's ws doesn't not work for me and I won't use it.
17:53:47Yardanico@codic remove it
17:53:48FromDiscord<KrispPurg> turn it off.
17:53:50FromDiscord<codic> I'll remove ``compress=true` and then check later
17:53:51FromDiscord<codic> ok
17:53:52Yardanicoit didn't work for me either
17:53:56FromDiscord<codic> gotta do school stuff rn tho
17:54:01FromDiscord<KrispPurg> dll files
17:54:11FromDiscord<KrispPurg> gl on your school stuff
17:54:26FromDiscord<codic> thanks↵dll files?
17:54:39FromDiscord<KrispPurg> ignore my msg lol
17:54:46FromDiscord<KrispPurg> that msg*
17:54:46FromDiscord<kodkuce> duno form me treeform worked np, but it was like year ago aprox
17:55:01FromDiscord<codic> alright
17:55:11FromDiscord<KrispPurg> I get protocol errors, but I like websocket.nim.
17:55:15FromDiscord<codic> dimscord actually seems really feeature complete
17:55:25FromDiscord<codic> Alrady
17:55:28FromDiscord<codic> *already
17:55:33FromDiscord<kodkuce> nice there is allread a wraped libmagic
17:56:23FromDiscord<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:35Yardanicoand fix all crashes
17:56:36Yardanico!status
17:56:37FromDiscordUptime - 1 day, 3 hours, 33 minutes, 24 seconds, 878 milliseconds, 964 microseconds, and 284 nanoseconds
17:56:43Yardanicogood so far
17:56:45FromDiscord<KrispPurg> oh oops lmao
18:01:08audiofilePMunch do you see the northern lights then
18:02:14PMunchaudiofile, I assume you meant to ask in #offtopic, but yes we do get northern lights :P
18:19:48FromDiscord<kodkuce> could not load: libmagic.so
18:19:55Yardanicowell you need libmagic installed
18:20:01FromDiscord<kodkuce> do i need to use some copile flag
18:20:05FromDiscord<kodkuce> i have it
18:20:11Yardanicoare you sure? same architecture as well?
18:20:13Yardanicosame version?
18:20:32FromDiscord<kodkuce> meybe i need devel version
18:21:01FromDiscord<kodkuce> hmm there is no devel
18:21:12FromDiscord<kodkuce> [*] libmagic-5.38_1 File type identification library
18:21:46FromDiscord<KrispPurg> what is libmagic
18:21:55FromGitter<bung87> where is install location
18:22:15FromGitter<bung87> a lib of magic
18:22:41FromDiscord<kodkuce> usr/bin i think will check
18:23:10FromGitter<bung87> no ,definately wrong
18:28:09dadadais there a test I can do on runtime to see if a type works as a container in a for in loop?
18:28:31dadadaI tried to wrap for test in thingy: discard with a try block, but it wont catch it
18:28:32FromDiscord<kodkuce> /usr/lib/libmagic.so.1.0.0
18:28:41FromDiscord<kodkuce> /usr/lib/libmagic.so.1 -> /usr/lib/libmagic.so.1.0.0
18:29:12PMunchhttps://github.com/nim-lang/Nim/pull/14351
18:29:13disbotImprove nimeval, changes some defaults
18:29:39FromDiscord<kodkuce> do i need to copy it to dir, shouldent nim auto get that lib, or meybe it searching for difrent name
18:29:48PMunchSome of the changes I've made locally to make this easier to work with
18:30:28FromDiscord<kodkuce> i know i head to symbolic link for 1 so lib to make some game work to just 1 version up
18:30:34FromGitter<bung87> kodkuce see the nim source
18:30:51FromDiscord<kodkuce> nim or magic
18:31:20FromGitter<bung87> binding lub
18:31:26FromGitter<bung87> lib
18:32:53FromDiscord<kodkuce> this https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f?
18:33:30PMunchHmm, why does the tests on devel always seem to be broken..
18:33:38PMunchI don't think I've ever had a all tests passed run..
18:34:56YardanicoPMunch: flaky tests
18:35:01Yardanicomostly async stuff
18:35:07Yardanicoor OS-related
18:35:14Yardanicolast commit passed though :P
18:35:33FromGitter<bung87> blocked by GFW,check the name and get tool that can check info of so, if the tool can find
18:37:51FromDiscord<kodkuce> i think i am tarded
18:37:52PMunchtests/newconfig/tfoo.nim fails with command line(1, 2) Error: invalid command line option: '--hint' for me
18:38:00PMunchAnd I pulled a couple minutes ago..
18:38:09PMunchtests/parser/tstatementoperators.nim also fails..
18:42:24*audiofile quit (Ping timeout: 265 seconds)
18:44:53FromDiscord<kodkuce> beh i just symbolic link libmagic.so.1 to libmagic.so and it worked
18:45:07FromDiscord<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:13FromGitter<bung87> oh ,you paste the path i assuming you dont know where it installed
18:57:08FromDiscord<kodkuce> sword you too
18:57:10FromDiscord<kodkuce> xD
19:00:48FromDiscord<kodkuce> to clear seq there is no clear proc, do i have to craete new or what i frogot
19:02:59FromGitter<bung87> may be len =0
19:03:41Araqs.setLen 0
19:08:38FromDiscord<kodkuce> ty
19:09:01FromDiscord<kodkuce> sombody should add that to docs 🙂
19:13:44Yardanicowhere 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:18supakeenI must be overlooking something, where can I set my `nimble build/install` to use `--threads:on`?
19:30:38Yardanicoin your project.nimble file if you have a task
19:30:48Yardanicoor easier - in "mainfile.nims" placed next to your mainfile.nim
19:30:55Yardanicoor "nim.cfg" placed next to your mainfile.nim
19:31:04Yardanicoor "mainfile.nim.cfg" placed next to your mailfile.nim :P
19:31:11supakeenHaha thank you.
19:31:23Yardanicoin the case of .cfg put "--threads:on" there, for nims do `switch("threads", "on")`
19:32:19supakeenThat works perfectly, went the `.nims` way.
19:32:41*NimBot joined #nim
19:32:49Yardanicoircord is more stable that nimbot /s
19:32:51Yardanico!status
19:32:52FromDiscordUptime - 1 day, 5 hours, 9 minutes, 40 seconds, 223 milliseconds, 44 microseconds, and 115 nanoseconds
19:33:22supakeenFinally found a project to use Nim for properly so going through a better setup than just a single nim file :)
19:33:36Yardanicothat's good :)
19:36:03FromGitter<bung87> any suggestion that i can contribue to nim?
19:36:12Yardanicohttps://github.com/nim-lang/needed-libraries/issues
19:36:19disruptektest --gc:arc
19:36:24supakeen@bung87: Nim itself or the ecosystem?
19:36:29Yardanicothat too
19:36:31Yardanicohelp test arc/orc pls
19:36:35Yardanicoon latest devel
19:37:04FromGitter<bung87> maybe the nim itself
19:37:24FromGitter<bung87> Ive write and port serveral libs....
19:37:28Yardanico@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:40FromGitter<bung87> ok gc things ,I may should learn first
19:38:40supakeenTake 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:59supakeenAnd if you want my top tier wishlist item; some sort of testcase coverage thing.
19:39:13Yardanicoleorize[m]: already did it
19:39:25Yardanicosee https://github.com/alaviss/Nim/commits/coverage
19:39:42supakeenah koch has coverage now?
19:40:34leorize[m]in my branch, yes
19:40:42*nsf quit (Quit: WeeChat 2.8)
19:40:46leorize[m]but there are too many false negatives
19:41:00leorize[m]we need a nim-aware coverage data collector for this to work
19:41:29*rockcavera joined #nim
19:41:40supakeeni'm not very good on the technical details of how code coverage data is generated sadly
19:47:53FromDiscord<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:36Yardanicosee https://github.com/qqtop/NimCx
19:48:41YardanicoI think you need to use ANSI color escapes
19:50:43FromDiscord<kodkuce> will check
19:54:21supakeenWhat 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:27FromDiscord<kodkuce> any reason why choosenim devl is building forewer
20:06:35*ptdel joined #nim
20:06:59shashlicktakes time to build libarchive first time
20:07:00shashlickwhat OS
20:07:16shashlickpresume you mean you are building choosenim itself
20:07:26shashlickperhaps you mean building nim devel
20:09:03FromGitter<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:32FromDiscord<kodkuce> i did choosenim devel
20:11:37FromDiscord<kodkuce> i head stabel
20:11:39PrestigeI'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:59FromDiscord<kodkuce> anywya it finished, i tink stable builded 10 time faster
20:12:05PrestigeThe function: https://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html my code: https://0x0.st/iLQ4.png
20:13:42FromDiscord<kodkuce> i newer wraped any lib and dont really know C or C++ to be of any use 😦
20:15:04PrestigeThe propReturn part seems suspicious to me but I'm not sure what would be incorrect
20:15:12dadadawhat can I do in a macro / in nim in general, if I want to the code to run in nimscript/nimvm=?
20:15:24Prestigeunless it should be an array or char arrays, or an array of strings...
20:15:57dadadaI thought this would be easy, but it's not as I thought, what I want to do is use nimcacheDir()
20:16:21dadadafrom 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:40FromGitter<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:24supakeenIs it possible with {.importc.} to get a struct definition directly?
20:32:37*narimiran quit (Ping timeout: 264 seconds)
20:40:27FromDiscord<kodkuce> what chars are 'arraw keys'
20:40:34FromDiscord<kodkuce> in terminal getch()
20:42:03FromDiscord<kodkuce> guess i can cast to int and compere it like that
20:42:08supakeen\033[A until D
20:43:52FromDiscord<kodkuce> hmm ye i just now sow i am getting 3 ints form casting terminal stuff is wierd 🙂
20:43:59supakeenYou can also use `showkey` in your terminal.
20:44:11supakeenIt's not that weird, you're getting the terminal escape sequences that it sends :)
20:44:11FromDiscord<kodkuce> how
20:44:15FromGitter<kaushalmodi> kodkuce: Does this help? https://github.com/dom96/nimbox/blob/master/nimbox/termbox.nim
20:44:30FromGitter<kaushalmodi> also https://github.com/FedericoCeratto/nim-dashing
20:45:39FromGitter<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:28FromDiscord<kodkuce> duno am reading
20:54:57FromGitter<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:09FromDiscord<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:41FromGitter<bung87> fix 4 zip lib issues.
21:19:42*solitudesf- quit (Remote host closed the connection)
21:23:04*filcuc joined #nim
21:33:00PrestigeWelp I'm pretty stuck on this problem
21:37:15PrestigeTrying 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:34Prestigebeen getting illegal storage access errors, been trying to figure out why since yesterday
21:43:12PMunchWell for one you should make sure that the types you're creating pointers to are actually the right type
21:43:50PMunchformatReturn should be a cint, numItems and bytesAfterReturn should be a culong.
21:44:00PMunchBut most importantly is probably propReturn
21:44:18PMunchWhy have you defined this as an array of two characters?
21:44:28PrestigeI have converters for those, so I think they should be okay
21:44:42PMunchunsigned char** is a pointer to a list of strings in C
21:44:44Prestigenot super familar with C, I thought it was a pointer to an array of chars
21:44:53PMunchconverters won't help you
21:45:31PMunchIf 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:50PMunchSo the backing type needs to be the same as what you're sending a pointer to
21:46:06PMunchIf you want them as a different type later on you need to convert them after you've retrieved them.
21:46:16PrestigeCool, thanks
21:46:48Prestigesince 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:55PMunchFor prop_return you want to define it as a "ptr cstring"
21:47:10*tane quit (Quit: Leaving)
21:47:15PMunchOr a "ptr UncheckedArray[cstring]"
21:48:23PMunchIf you look at my PiMo code in src/pimo_lib.nim on lines 46-65 you can see how I handle this
21:49:08PrestigeThanks for the help!
21:49:23PMunchAnd you can find examples of me using that function in the various other files
21:49:35PMunch(just grep for getProperty)
21:50:53PMunchI see now that PPcuchar in this case is just meant as a pointer to whatever data is there, not a string
21:50:55PMunchMy bad
21:52:05PMunchNo problem :)
21:57:43FromDiscord<treeform> @KrispPurg what about my websockets does not work for you?
21:58:23*audiofile joined #nim
21:58:55FromDiscord<treeform> What type of protocol error do you get?
22:14:23*Trustable quit (Remote host closed the connection)
22:14:58FromGitter<bung87> how does nim find the proc's return value , there may have nested block
22:16:35leorizewdym?
22:17:48FromGitter<bung87> https://github.com/nim-lang/Nim/issues/13341 here's the issue
22:17:51disbotasyncjs doesn't like inner functions with result assignments ; snippet at 12https://play.nim-lang.org/#ix=2m2Q
22:18:31FromGitter<bung87> the current approach will resursively `replaceReturn` so this happend
22:19:29*krux02 quit (Remote host closed the connection)
22:20:14FromDiscord<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:41leorizebung87: check how asyncdispatch does it then :P
22:20:47*letto quit (Quit: Konversation terminated!)
22:21:35FromGitter<bung87> idk the compiled js code why has no async nor promise.. looks like a general js header
22:21:58FromGitter<bung87> ok, that's a good point to start
22:23:22FromDiscord<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:00FromDiscord<KrispPurg> @treeform
22:24:13FromDiscord<treeform> @KrispPurg
22:24:37skrylar[m]hoi
22:24:48FromGitter<bung87> @alehander92 are you there?
22:25:34FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/m6TL/Screenshot-2020-05-15-at-6.25.23-AM.png)
22:25:47FromGitter<bung87> compile asyncjs I only get this
22:27:00FromGitter<bung87> my bad not exported
22:37:04dadadawhat's the best way to remove the last element of a NimNode statement list?
22:37:28dadadadel probably ... nvm
22:44:28skrylar[m]for the last element it doesn't matter
22:44:49skrylar[m]del does wreck the order of elements in the middle of a container tho
22:46:49*Trustable joined #nim
22:51:16FromDiscord<Recruit_main707> Is there any tools to check generated c code online?
22:51:47audiofileyou mean like code linters?
22:52:07*kradnoel quit (Remote host closed the connection)
22:52:56*PMunch quit (Quit: leaving)
22:52:57FromDiscord<Recruit_main707> Kind of how there is a tool to see generated asm
22:53:07skrylar[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:22FromDiscord<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:28dadadaleorize: hey, you there?
23:10:34leorizeo/
23:10:47dadadacan you tell me how to get into NimScript mode, I failed to make nimcacheDir() work
23:11:07leorizeyou don't get to "nimscript" mode :P
23:11:17FromDiscord<Recruit_main707> But Compiler explorer only shows the asm, not the c code
23:11:30FromDiscord<Rika> you can see the c code in your nim cache
23:11:52leorizedadada: use std/compilesettings for that
23:12:10leorize~playground
23:12:11disbotplayground: 11an online in-the-browser IDE for simple Nim experiments at http://argentina-ni.ml/
23:12:11disbotplayground: 11https://play.nim-lang.org the official Nim playground, can run Nim in the browser and share snippets
23:12:18leorizeRecruit_main707: ^ use the first link
23:12:46dadadadude, are you from argentina?
23:13:02FromDiscord<Rika> how do i check how much memory my nim program is using *within* the nim program xd
23:13:22dadadaI mean, somebody from our community must be, or this website wouldn't have this domain
23:14:22leorizewe have a pretty big community in argentina
23:14:28leorizeand that's their playground
23:14:40dadadalove argentina
23:14:50leorizeRika: there's some proc to get gc stats
23:16:03FromGitter<Willyboar> juan carlos i think is from argentina and he is very active
23:17:51dadadaWillyboar: I've seen him on github, he seems awesome
23:21:49FromDiscord<exelotl> wait so can I post code blocks in general now? :o
23:22:15FromDiscord<Rika> i mean you can also prolly speak in "new lines instead of spaces"
23:28:07zacharycarterwhat do folks use to overlay twitch chat while broadcasting?
23:29:02FromGitter<Knaque> @zacharycarter https://nightdev.com/kapchat/
23:29:09*gokr quit (Quit: Leaving.)
23:29:18zacharycarterthanks
23:29:45FromGitter<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:21zacharycarterI think this will work fine - I appreciate the tip
23:30:34FromGitter<Knaque> No problem.
23:41:25*fredrikhr quit (Read error: Connection reset by peer)
23:41:49*fredrikhr joined #nim
23:42:24leorizeI need help from someone with a lot of I/O experience
23:42:42leorizeI keep hearing that async is faster, but how do you benchmark this
23:42:47leorizelike how "faster" is it?
23:43:08leorizecompared 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:48FromGitter<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:39leorizeboth :)
23:52:14FromGitter<timotheecour> note that you can combine threads and async, so it’s not an either or.
23:52:39FromGitter<timotheecour> and it also depends on applications, eg if IO or compute bound, YMMV.
23:53:37FromGitter<timotheecour> but if IO bound, you can notice unbounded speedup using async (even on a single thread) compared to using threads;
23:53:54leorizeI'm talking I/O only
23:54:04zacharycarterthere's an interesting set of articles on this
23:54:30FromGitter<timotheecour> for “how to measure” , you can benchmark using wall-clock (eg look at https://github.com/dom96/httpbeast)
23:54:34zacharycarterhttps://rachelbythebay.com/w/2020/03/07/costly/
23:54:40zacharycarterhttps://rachelbythebay.com/w/2020/05/07/serv/
23:55:43zacharycarterhttps://www.twitch.tv/zachary_carter streaming immediate mode gui library development
23:56:51FromGitter<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:45FromGitter<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:45leorizeI perfectly understand that