<< 12-05-2021 >>

00:05:07*aeverr joined #nim
00:09:59*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
00:10:15*Gustavo6046 joined #nim
00:13:31*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:13:51*njoseph joined #nim
00:14:35*Gustavo6046 quit (Ping timeout: 250 seconds)
00:23:50*Gustavo6046 joined #nim
00:27:20FromGitter<bung87> how to control type field accessbility ? I want seperate one type to single file
00:33:13FromDiscord<Hi02Hi> do you mean sth like https://nim-lang.org/docs/tut1.html#modules ?
00:36:15FromGitter<bung87> I have a long file that defines basic types , some type fields only used for that file
00:36:57FromDiscord<Hi02Hi> if you dont export a field with a , that field will only be visible in that file
00:37:20FromDiscord<Hi02Hi> in other words, fields are private by default
00:37:53FromGitter<bung87> no , am not means to identifiers
00:38:36FromGitter<bung87> "type's fields"
00:40:04FromGitter<bung87> these types also used in other file
00:41:16FromDiscord<creonico> sent a code paste, see https://play.nim-lang.org/#ix=3mxp
00:48:57FromDiscord<Hi02Hi> sent a long message, see https://paste.rs/YHW
00:49:35FromGitter<bung87> it's just a helper macro, what's your point , if most of them used as discardable add that pragma is helpfull
00:49:39FromDiscord<Hi02Hi> In reply to @bung87 ""type's fields"": I do not know what a type field is, so I'll let some who knows answer that, sorry
00:50:11*hyiltiz quit (Ping timeout: 240 seconds)
00:50:25*hyiltiz joined #nim
00:50:26*hyiltiz quit (Changing host)
00:50:26*hyiltiz joined #nim
00:51:44FromDiscord<ElegantBeef> bung87 can you show an example of what you're after?
00:54:05FromGitter<bung87> https://play.nim-lang.org/#ix=3mxq
00:54:41FromGitter<bung87> I belive nim's doc called it type's field everywhere...
00:57:35FromGitter<bung87> for current all written in single file , I want seperate Type A to a file, so it can be used in b and c,d etc...
00:58:25*azed joined #nim
00:59:11FromDiscord<creonico> what is meant by side effects? That is a concept I don't understand
00:59:32FromDiscord<ElegantBeef> Whether the procedure can modify variables not passed into it
00:59:39FromGitter<bung87> the problem is its 800 lines single file, I dont want end user use my lib import the file for only basic Type A
01:00:06FromDiscord<ElegantBeef> No side effects are more like functional programming functions where they only mutate parameters if marked `var` or return state
01:00:35FromDiscord<ElegantBeef> I'm trying to understand, you want to be able to access `v` in specific modules but not let the user import the `v`?
01:01:16FromDiscord<creonico> In reply to @ElegantBeef "Whether the procedure can": not passed to it?
01:02:01FromDiscord<ElegantBeef> A nosideeffect procedure cannot use `echo` since it changes/accesses a global variable `stdin`
01:02:10FromGitter<bung87> " you want to be able to access v in specific modules " yes, " but not let the user import the v" this parts not important.
01:04:25FromGitter<bung87> @creonico that prevent you unexpectly change global variable and proc parameters value
01:05:51FromDiscord<ElegantBeef> I think it might be possible to do this using macros bung, but i dont know how since you basically need to get `sym`s for fields that arent exported
01:08:10FromGitter<bung87> if I include type A file for one module and also export , when other module import type A file , the compiler will identify they are differient type
01:08:41FromGitter<bung87> I remenber I've tried that
01:11:18FromGitter<bung87> oh, maybe I just defind Basic A , and extends A add extro fileds in that module I think
01:14:52*hyiltiz quit (Ping timeout: 240 seconds)
01:19:53FromGitter<bung87> https://github.com/jyapayne/subfield found one that might be useful
01:20:22*hyiltiz joined #nim
01:20:23*hyiltiz quit (Changing host)
01:20:23*hyiltiz joined #nim
01:23:29*Gustavo6046 quit (Ping timeout: 250 seconds)
01:30:44*Gustavo6046 joined #nim
01:33:21*hyiltiz quit (Ping timeout: 265 seconds)
01:34:26*krux02 quit (Remote host closed the connection)
01:38:26*hyiltiz joined #nim
01:38:26*hyiltiz quit (Changing host)
01:38:26*hyiltiz joined #nim
01:42:32*hyiltiz quit (Ping timeout: 240 seconds)
01:42:58*hyiltiz joined #nim
01:42:59*hyiltiz quit (Changing host)
01:42:59*hyiltiz joined #nim
01:49:52*hyiltiz quit (Ping timeout: 240 seconds)
01:52:38*Gustavo6046 quit (Remote host closed the connection)
01:54:19*Gustavo6046 joined #nim
01:56:02FromDiscord<hamidb80> i feel stupid
01:57:06FromDiscord<hamidb80> i'm trying to take screen shot in windows using nim, the default format for pixel colors is RBG https://media.discordapp.net/attachments/371759389889003532/841856475944976384/unknown.png
01:57:12FromDiscord<hamidb80> (edit) "RBG" => "BGR"
01:57:26FromDiscord<hamidb80> so i must swap R with B
01:57:57FromDiscord<hamidb80> none of them work 😱
01:58:01*hyiltiz joined #nim
01:58:02*hyiltiz quit (Changing host)
01:58:02*hyiltiz joined #nim
01:58:49FromDiscord<hamidb80> hey beef are you here? 😄
01:59:28FromDiscord<ElegantBeef> I'm here
02:00:04FromDiscord<hamidb80> any idea what's going on ?
02:01:35FromDiscord<ElegantBeef> Are the screenshots around the code different implementations?
02:02:23FromDiscord<ElegantBeef> What library are you using?
02:04:10FromDiscord<hamidb80> it is written by treeform long time ago (with flippy) and i'm trying to do it with pixie. (since flippy is outdated)
02:04:11FromDiscord<hamidb80> https://gist.github.com/treeform/782149b5fc938753feacfca43637aa90
02:05:01FromDiscord<hamidb80> In reply to @ElegantBeef "What library are you": winim and pixie
02:06:14FromDiscord<ElegantBeef> Have you tried without swapping?
02:08:45FromDiscord<hamidb80> In reply to @ElegantBeef "Have you tried without": yep https://media.discordapp.net/attachments/371759389889003532/841859404793774111/unknown.png
02:09:52FromDiscord<hamidb80> all `blue`s are `yellow`
02:10:11FromDiscord<hamidb80> vice versa
02:10:14FromDiscord<hamidb80> (edit)
02:11:33FromDiscord<Hi02Hi> i just want to say you're saying you must swap R and B, yet in your code, you swap B an d G
02:12:02FromDiscord<ElegantBeef> The very last one they did `r <-> b`
02:12:31FromDiscord<hamidb80> In reply to @hamidb80 "i'm trying to take": @Hi02Hi
02:12:38FromDiscord<ElegantBeef> give me the entire code please
02:12:41FromDiscord<ElegantBeef> So i can actually try it
02:13:18FromDiscord<Hi02Hi> ah i see, i was looking at wind.nim
02:14:03FromDiscord<hamidb80> https://gist.github.com/hamidb80/b49f5d588d48172b6b5e08416b801889
02:14:13FromDiscord<hamidb80> In reply to @ElegantBeef "give me the entire": here
02:16:31FromDiscord<ElegantBeef> Shucks seems to not work in wine
02:18:46*azed quit (Quit: WeeChat 3.1)
02:20:01FromDiscord<ElegantBeef> Ah virtual desktop makes it work
02:27:36FromDiscord<ElegantBeef> Ok so i just changed the loops and fixed it
02:28:12FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3mxE
02:28:31FromDiscord<ElegantBeef> Since you like pinging so much @hamidb80
02:31:23FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/841865108849819668/message.txt
02:32:52FromDiscord<ElegantBeef> I mean all i can say is thati get the proper colour https://media.discordapp.net/attachments/371759389889003532/841865479252869190/unknown.png
02:32:59FromDiscord<ElegantBeef> So atleast using wine it works
02:33:25FromDiscord<hamidb80> yeah, thank u, now i feel more dumb than ever,
02:35:55FromDiscord<ElegantBeef> also there is an `image[x, y]` procedure if you must do the xy iteration 😄
02:36:42FromDiscord<hamidb80> In reply to @ElegantBeef "also there is an": i thought `image[x, y]` is not even possible in nim
02:37:17FromDiscord<ElegantBeef> it's simply `proc [](obj: T, a, b: int)`
02:37:26FromDiscord<ElegantBeef> You can make indexers that take whatever the fuck you want
02:38:32FromDiscord<ElegantBeef> so you can techincally do `a[10, "hello", 134.03]`
02:39:11FromDiscord<ElegantBeef> Now if i ever see that as actual code people use, i might consider never touching code again
02:40:36FromDiscord<Rika> In before someone makes a JSON index procedure that takes in such values
02:40:49FromDiscord<ElegantBeef> I said what i said
02:44:20FromDiscord<ajusa> In reply to @Rika "In before someone makes": Wait that's actually a pretty good idea
02:44:32FromDiscord<ElegantBeef> Shoots ajusa
02:44:45FromDiscord<hamidb80> In reply to @ajusa "Wait that's actually a": no
02:46:06FromDiscord<ajusa> Hey, I think node["parent"]["child"]["property"] would be more readable as ↔node["parent", "child", "property"]
02:46:24FromDiscord<ElegantBeef> or you know use dotoperators and have it be `node.parent.child.property`
02:46:32FromDiscord<Rika> There already ones for string only or integer only
02:46:35FromDiscord<Rika> Not for mixed
02:46:40FromDiscord<ajusa> Makes more sense than node["parent.child.property"]
02:46:44FromDiscord<Rika> And I hope it never happens because that’s a nightmare
02:46:54FromDiscord<ajusa> In reply to @ElegantBeef "or you know use": Can't do that for json node though right
02:47:01FromDiscord<Rika> You can
02:47:03FromDiscord<ElegantBeef> Dotoperators let that yes
02:47:14FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual_experimental.html#special-operators-dot-operators
02:47:20FromDiscord<Rika> Lol
02:47:21FromDiscord<ajusa> Ah I remember that now
02:47:33FromDiscord<Rika> Now look at the {} proc in JSON
02:47:58FromDiscord<ElegantBeef> Yea there are many ways to skin that cat
02:48:12FromDiscord<Rika> Why only the cat and not the dog
02:48:30FromDiscord<Rika> If disruptek were still here I’d probably be dead after saying that
02:48:38FromDiscord<ajusa> why are you skinning animals what's wrong with you
02:49:04FromDiscord<ElegantBeef> What you eat chicken with the feathers on?
02:49:12FromDiscord<ajusa> I'm vegetarian
02:49:20FromDiscord<ajusa> (sorry this is #offtopic
02:49:27FromDiscord<Rika> Well most of us aren’t so
02:49:32FromDiscord<ajusa> (edit) "is #offtopic" => "belongs in #offtopic)"
02:49:57FromDiscord<ElegantBeef> I'm a vegetarian too, i just also eat meat
02:50:26FromDiscord<Rika> :galaxybrain:
02:51:31FromDiscord<ElegantBeef> Though rika i dont know why you'd skin dogs, they're rather cool
02:51:57FromDiscord<hamidb80> In reply to @Rika "<:galaxybrain:582067821736099870>": https://media.discordapp.net/attachments/371759389889003532/841870280703606804/unknown.png
02:52:29FromDiscord<Rika> Reload
02:52:43FromDiscord<Rika> In reply to @ElegantBeef "Though rika i dont": Same to you with cats
02:55:57FromDiscord<ElegantBeef> Eh cats are pricks
02:56:08FromDiscord<ElegantBeef> They have it coming
02:56:27FromDiscord<creonico> Hey, so I got the win32 api working on Nim but I wonder, why in the winim example they don't use `addr` for the `MSG`object and the `WNDCLASS` but it gives me an error if I don't use it
02:56:36FromDiscord<creonico> https://github.com/khchen/winim/blob/master/examples/hellowin.nim
02:57:07FromDiscord<creonico> I am not using winim by the way
02:57:38FromDiscord<Rika> In reply to @ElegantBeef "Eh cats are pricks": Lots of dogs are pricks as well
02:57:57FromDiscord<ElegantBeef> All these windows questions tonight. Trying to get me on windows MS? Not today!
02:58:20FromDiscord<ElegantBeef> What procedure are you talking about exactly?
02:58:48FromDiscord<creonico> haha, you use Linux?
02:59:29FromDiscord<creonico> RegisterClass, GetMessage, TranslateMessage, etc..
03:00:13FromDiscord<creonico> those are functions with pointer parameters
03:02:55FromDiscord<creonico> please ping me if you know
03:03:42*wasted_youth2 quit (Read error: Connection reset by peer)
03:04:06*thomasross quit (Ping timeout: 240 seconds)
03:04:09*wasted_youth2 joined #nim
03:04:17FromDiscord<ElegantBeef> What's the definition of `Wndclassw`?
03:04:24FromDiscord<ElegantBeef> (edit) "`Wndclassw`?" => "`Wndclass`?"
03:05:04FromDiscord<ElegantBeef> Suppose i can open this up with my editor 😄
03:10:42FromDiscord<creonico> sent a code paste, see https://play.nim-lang.org/#ix=3mxO
03:10:59FromDiscord<ElegantBeef> Was looking for the Nim definition, looks like it's an alias of another type that's not a pointer
03:12:04FromDiscord<creonico> sent a code paste, see https://play.nim-lang.org/#ix=3mxP
03:13:13FromDiscord<Rika> That looks equivalent
03:13:34FromDiscord<ElegantBeef> Well it's an alias, the procedure still takes a `ptr` and somehow doesnt complain
03:14:51FromDiscord<Rika> In reply to @creonico "RegisterClass, GetMessage, TranslateMessage, etc..": Can I see the signatures in C?
03:15:07FromDiscord<ElegantBeef> Ah found it https://github.com/khchen/winim/blob/bffaf742b4603d1f675b4558d250d5bfeb8b6630/winim/utils.nim#L26
03:15:19FromDiscord<ElegantBeef> Used a macro to echo the typed body
03:15:25FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3mxS
03:15:43FromDiscord<ElegantBeef> You probably have to dispose of the image
03:15:52FromDiscord<ElegantBeef> also if you're benchmarking use `benchy`
03:15:58FromDiscord<ElegantBeef> At the very least use monotimes
03:16:10FromDiscord<Rika> Probably a ref and the GC isn't firing?
03:16:26FromDiscord<Rika> You can force a gc pass
03:16:37FromDiscord<creonico> sent a code paste, see https://play.nim-lang.org/#ix=3mxT
03:16:46FromDiscord<hamidb80> In reply to @Rika "You can force a": how?
03:16:52FromDiscord<Rika> I forgot lol
03:16:58FromDiscord<ElegantBeef> what library is that `takeScreenshot` from?
03:17:03FromDiscord<ElegantBeef> Or is that your own
03:17:38FromDiscord<hamidb80> In reply to @hamidb80 "https://gist.github.com/hamidb80/b49f5d588d48172b6b": i just put that code inside a proc called `takeScreenshot`
03:17:48FromDiscord<Rika> In reply to @ElegantBeef "Ah found it https://github.com/khchen/winim/blob/bf": @creonico beef found why it doesn't need addr here
03:17:51FromDiscord<ElegantBeef> Might be some part of the windows api you need to propeprly handle
03:18:59FromDiscord<ElegantBeef> The proof of my uselessness is not spelling properly properly
03:22:29FromDiscord<Rika> Propelly
03:23:34FromDiscord<creonico> So if I understand correctly, it does require `addr` but that does it automatically
03:23:42FromDiscord<ElegantBeef> Yes
03:23:47*whitefly quit (Remote host closed the connection)
03:23:55FromDiscord<ElegantBeef> Converters allow you to define implicit conversions
03:24:06FromDiscord<creonico> why they do that though, its not very readable
03:24:29FromDiscord<hamidb80> In reply to @ElegantBeef "Might be some part": GetClientRect(...params), `{.importc.}`↔↔it's actually a c function
03:24:52FromDiscord<Rika> In reply to @creonico "why they do that": Opinion probably
03:25:16FromDiscord<hamidb80> (edit) "`{.importc.}`↔↔it's" => "`{.importc.}`↔↔they are"
03:25:19FromDiscord<hamidb80> (edit) removed "a" | "function" => "functions"
03:25:44FromDiscord<ElegantBeef> If you're using the library a lot you probably dont want to `addr` every single time, so possibly just ergonomics for them
03:25:58FromDiscord<ElegantBeef> But the annoying thing is that's all objects effected
03:26:18*whitefly joined #nim
03:26:28FromDiscord<Rika> Ez fix just make a massive type class for winim objects
03:26:35FromDiscord<ElegantBeef> That's what i was going to say
03:26:48FromDiscord<Rika> And get 10x the compile time (maybe idk I've never tested it)
03:27:06FromDiscord<ElegantBeef> Either way it's pretty annoying to se
03:27:07FromDiscord<ElegantBeef> (edit) "se" => "see"
03:28:37FromDiscord<Rika> Just like you are?
03:29:39FromDiscord<Rika> Beef mad :monkaGiga:
03:30:37FromDiscord<hamidb80> does C have destructor or something ? :😕
03:30:41FromDiscord<ElegantBeef> Lol
03:30:44FromDiscord<ElegantBeef> To both of you
03:30:57FromDiscord<ElegantBeef> C's destructors are the people that sit behind the keyboard
03:31:32FromDiscord<ElegantBeef> In reply to @Rika "Beef mad <:monkaGiga:585595799027712004>": Nah, the truth shouldnt make me angry
03:37:13FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3mxX
03:37:24*spiderstew_ joined #nim
03:39:46*spiderstew quit (Ping timeout: 240 seconds)
03:40:26FromDiscord<ElegantBeef> `img` is probably being freed, it's probably the internal resources that are not
03:41:06FromDiscord<hamidb80> In reply to @ElegantBeef "`img` is probably being": how to free internal sources?
03:44:09FromDiscord<ElegantBeef> You needto call `DeleteObject` after the image is used
03:50:14*wasted_youth2 quit (Quit: Leaving)
03:50:24FromDiscord<ElegantBeef> With modern Nim they could always use destruction to automate destruction of the objects
03:50:52FromDiscord<ElegantBeef> For example https://play.nim-lang.org/#ix=3mxY
03:51:43*gangstacat joined #nim
03:51:54FromDiscord<ElegantBeef> destructors
03:55:18FromDiscord<hamidb80> i really appreciate the time you spend for we noobs
04:00:59FromDiscord<ElegantBeef> If it wasnt for my help you might be on some harder drugs like Rust
04:01:18FromDiscord<ElegantBeef> Think of it as harm prevention
04:21:56FromDiscord<Rika> In reply to @ElegantBeef "With modern Nim they": I used the destruction to automate the destruction
04:22:22ForumUpdaterBotNew thread by Treeform: Show Nim: Pixie now supports text layout and rasterizing, including rich text with styled spans!, see https://forum.nim-lang.org/t/7970
04:22:33*rockcavera quit (Remote host closed the connection)
04:46:26*teal joined #nim
04:51:39FromDiscord<Varriount> Ooo, treeform's library is pretty.
04:51:48FromDiscord<ElegantBeef> Indeed
04:51:58FromDiscord<ElegantBeef> He makes good stuffs
04:53:03FromDiscord<Varriount> Although, I do wonder - does the font rendering using ClearType and similar? It might just be the images, but the font examples look a bit odd
04:58:31FromDiscord<treeform> Thanks!
04:58:39FromDiscord<ElegantBeef> I think it's just the scaling on the forum
04:58:55FromDiscord<ElegantBeef> It's only a 200x200 image so scaled up isnt great
04:58:57FromDiscord<treeform> We don't use ClearType (its priority MS tech)
04:59:22FromDiscord<treeform> They are more closer to how Mac displays fonts then how Windows displays fonts.
04:59:51FromDiscord<treeform> you can see the image in real pixel scale here: https://raw.githubusercontent.com/guzba/pixie/text/tests/fonts/rendered/spans5.png
05:00:22FromDiscord<treeform> (edit) "priority" => "proprietary"
05:00:23FromDiscord<ElegantBeef> Are you using SDF?
05:00:34FromDiscord<treeform> No we do not use SDF.
05:00:46FromDiscord<ElegantBeef> I know i've asked before, but didnt know if you changed since then
05:00:55FromDiscord<treeform> Naa I have not.
05:00:58FromDiscord<Varriount> What font is that?
05:01:11FromDiscord<treeform> The font in that sample is Ubuntu I think?
05:01:18FromDiscord<Rika> In reply to @treeform "They are more closer": ~~macs do a better job anyway~~
05:01:20FromDiscord<ElegantBeef> Yea ubuntu-regular_1 😄
05:01:42FromDiscord<Rika> do you know what the difference is between what a mac does and what windows does?
05:02:31FromDiscord<treeform> Mac is closer to how font designer intended. ClearType was supposed to make it "work" on low pixel screens. But because most screens are high pixel now, "font designer intended" is a better choice now.
05:03:03FromDiscord<treeform> (edit) "now." => "now (in my opinion)."
05:03:11*teal quit (Quit: WeeChat 3.1)
05:03:52FromDiscord<treeform> See here about https://github.com/treeform/typography#comparison-to-different-oss how they differ.
05:04:35FromDiscord<Varriount> Comparing between wordpad and the image, I see very little difference (there is some, but I seem to have picked up a slightly different version of the font, so w/e).
05:05:28FromDiscord<Varriount> I'm just a bit leery - I remember using KDiff on Mac (or was it Windows?) and the font rendering was awful.
05:05:47FromDiscord<treeform> I also think that font rendering is very what you are used too.
05:05:56FromDiscord<treeform> Some thing that is awful to one person is normal to the other.
05:06:12FromDiscord<ElegantBeef> Yea whenever i boot up windows everything just looks off
05:06:17FromDiscord<Varriount> This was more about the fact that the rendering was very aliased.
05:06:32FromDiscord<Varriount> In reply to @ElegantBeef "Yea whenever i boot": Because of the non-retina display?
05:07:02FromDiscord<ElegantBeef> Same display, i'm a linux user not mac 😄
05:07:19FromDiscord<Varriount> Huh. You might try adjusting the ClearType settings.
05:07:44FromDiscord<ElegantBeef> I only use windows to play a select few games, so not highest priority
05:08:02FromDiscord<Varriount> Though, these days ClearType probably has less impact then it used to, considering that screen resolution has increased so much.
05:08:23FromDiscord<ElegantBeef> Yea depending on the font i find it just looks off
05:09:09FromDiscord<ElegantBeef> Also varriount i hate you, i spent a lot of time on that caching library 😛
05:11:05FromDiscord<ElegantBeef> But hey it supports more things than the otherone on nimble(yes there was another one named memo) https://github.com/beef331/kashae
05:14:29FromDiscord<Varriount> +1 for the name.
05:17:38FromDiscord<Varriount> In reply to @ElegantBeef "But hey it supports": As a totally odd use-case for caches, some code I work on uses them to "separate" a bunch of data calculation logic into calculated attributes.
05:18:46FromDiscord<ElegantBeef> Seems doable if you use an object or tuple as the return type
05:18:58FromDiscord<Varriount> Well, this is Python code.
05:19:18FromDiscord<ElegantBeef> Yea was just thinking about how one would do it with my library
05:19:55FromDiscord<ElegantBeef> I do want to be able to swap out the cache type with an LRU cache if one wants, or stick with the ordered table
05:20:11FromDiscord<Varriount> Something I would suggest, if it's possible, is to allow a different backing structure
05:20:13FromDiscord<ElegantBeef> Would be nice for optimizing memory on a proc by proc basis
05:20:19FromDiscord<ElegantBeef> Lol
05:21:56FromDiscord<ElegantBeef> Concepts and pointer procs might work for the backend, but makes the code a little unwieldy
05:22:46FromDiscord<ElegantBeef> But yea doesnt seem undoable
05:22:59FromDiscord<Varriount> Why not just allow giving a type or value that must fulfill a particular concept?
05:23:29FromDiscord<ElegantBeef> Well that's what i meant
05:24:33FromDiscord<ElegantBeef> Ah yea i can just make `unCache(c: var Cache)`
05:24:38FromDiscord<ElegantBeef> Then dont need pointer proc
05:24:48FromDiscord<ElegantBeef> Sounds good, so will do
05:25:27FromDiscord<Varriount> Pointy procs are pointy
05:26:03FromDiscord<Varriount> Now I'm thinking of a hedgehog with a little Nim crown.
05:26:16FromDiscord<ElegantBeef> Lol new mascot
05:28:38FromDiscord<treeform> In reply to @ElegantBeef "Yea whenever i boot": Yeah exaclty!
05:30:23FromDiscord<treeform> In reply to @Varriount "Comparing between wordpad and": Not sure what you mean here, if you think its a bug please file an issue.
05:31:56FromDiscord<Varriount> In reply to @treeform "Not sure what you": https://media.discordapp.net/attachments/371759389889003532/841910545787387914/unknown.png
05:32:22FromDiscord<Varriount> I don't think it's a bug, just slightly different fonts.
05:36:21*narimiran joined #nim
05:40:23FromDiscord<treeform> oh yeah fonts not the same
05:40:58FromDiscord<Varriount> In reply to @treeform "oh yeah fonts not": I got it from here: https://fonts.google.com/specimen/Ubuntu
05:41:59FromDiscord<ElegantBeef> None of those fonts have a t with a full cross
05:44:10FromDiscord<Varriount> In reply to @ElegantBeef "None of those fonts": Oh. I forgot to change the font in Wordpad from Calibri to Ubuntu. That would be why.
05:46:18FromDiscord<ElegantBeef> Can concepts describe non concrete types like `Table`?
05:47:29FromDiscord<garett> Anyone know a way to compare an nkSym NimNode inside a macro with a known type or function (other than string comparison)?
05:47:56FromDiscord<ElegantBeef> `yourSym.eqIdent(procDef[0].baseName)`
05:48:23FromDiscord<Rika> Which is still technically a string comparison I believe
05:48:26FromDiscord<ElegantBeef> Yea
05:48:33FromDiscord<ElegantBeef> But i just assumed they meant explicit
05:48:56FromDiscord<garett> Does it resolve ambiguity wrt same name in different modules?
05:48:57FromDiscord<ElegantBeef> If you want to see if a sym is a procedure `getImpl` and see if it's the same
05:49:26FromDiscord<ElegantBeef> I dont think it's possible for the macro system to distinguish between two identical procedures
05:49:46FromDiscord<ElegantBeef> Name, arguements, implementation...
05:50:21FromDiscord<ElegantBeef> Rika you best correct my seplling there i know i did it again
05:50:27FromDiscord<ElegantBeef> (edit) "seplling" => "spelling"
05:50:44saemWhat's wrong with your smelling?
05:51:07FromDiscord<ElegantBeef> With a nose as large as mine i'd hope nothing
05:51:08FromDiscord<garett> In your example `procDef[0]` is explicitly dereferencing the proc as a pointer to call baseName?
05:51:37FromDiscord<ElegantBeef> no, it's accessing the name identifier from the proc definition
05:51:46FromDiscord<garett> Gotcha
05:52:18FromDiscord<ElegantBeef> the first node of a procedure definition is where the name is either postfixed with `` or not, and as such basename makes it so you dont have to check
05:52:41FromDiscord<treeform> In reply to @Varriount "Oh. I forgot to": Now they match?
05:53:18FromDiscord<garett> Thanks, beef, that’s a pro tip
05:53:20FromDiscord<ElegantBeef> Saem you know more than I, do you know if you can use concepts to describe things like `Table` and not `Table[x, y]`?
05:53:57saemOld ones yes, the example uses stack for example
05:54:13saemI don't know new concepts at all.
05:54:43FromDiscord<garett> @treeform you have some great Nim repos. I forked your staticglfw and upgraded to latest glfw version
05:54:47FromDiscord<ElegantBeef> The example from the experimental manual?
05:55:12FromDiscord<ElegantBeef> Dont encourage treeform, if he doesnt get noticed he might make even cooler libraries to get noticed 😛
05:55:23FromDiscord<treeform> In reply to @garett "<@107140179025735680> you have some": Cool I should do that too.
05:56:13FromDiscord<garett> Sadly I discovered winim and direct3d declarations really slow down the Nim compiler, so I’m writing some stuff in C for quicker compilation
05:57:11saemBeef, yeah the one from the experimental section of the manual.
05:57:54FromDiscord<garett> https://github.com/garettbass/glfw.nim
06:01:24FromDiscord<garett> I wanted the gamepad api
06:05:54FromDiscord<ElegantBeef> Do not think i was clear, i'm basically after a concept that limits non concrete types. I dont think it's posible, for instance `Table` would be valid since it can `Table[Hash, T]`, but i dont want `Table[Hash, int]` to be considered valid
06:07:19FromDiscord<ElegantBeef> This is all for macros so it'd just be to prevent people from passing invalid concrete types
06:07:38*johannes_ joined #nim
06:08:04FromDiscord<Rika> In reply to @ElegantBeef "Name, arguements, implementation...": arguments
06:08:09FromDiscord<ElegantBeef> Thanks
06:11:06saemOh, I don't know about that, I'm not sure how to express something like that in Nim's type system. I think that's a higher kinded type thing. I think some of that is possible with concepts but not sure if all of it supposed to be, let alone how to express it.
06:11:35saemAlthough, if you're in macro land, I'm pretty sure you can get the type one way or the other and check to see if it's unbound.
06:12:07FromDiscord<ElegantBeef> Yea i can implement my own checking if i want, but for now we're doing comments explanation
06:12:51FromDiscord<ElegantBeef> I was hoping i could limit it with a concept just to save me train cells and make it more friendly
06:18:05saemHmm, does Nim have a concept of a bottom type, because an unbound parameter being bottom would make sense.
06:19:03FromDiscord<ElegantBeef> I dont know, also decided to go back to the concepts just replace the type instantiation 😄
06:19:30FromDiscord<ElegantBeef> It's as i was changing the code to support this i went "This is way too much to have to remember a type needs to support"
06:29:33saemYeah, I can't think of a way to represent absurd or bottom, which would be how one would represent it purely in a type system context.
06:53:47*PMunch joined #nim
06:59:07FromDiscord<ElegantBeef> @Varriount and now like that i support changing the backing cache
06:59:49FromDiscord<ElegantBeef> Docs are updated to showcase that 😛
07:08:47FromDiscord<ElegantBeef> yea saem i just end up with users doing `OrderedTable[Hash, int]` or whatever type they want, instead of just `OrderedTable` it's not a big issue but it'd have been nice to have the latter
07:26:52FromDiscord<ElegantBeef> I see pmunch posting on the forum that means he's alive 😄
07:27:02PMunchYou thought I was dead?
07:27:19FromDiscord<ElegantBeef> No just using alive as in awake
07:27:26PMunchAh :P
07:27:33PMunchYes I'm awake, but barely :P
07:27:42FromDiscord<Rika> so barely alive, gotcha
07:28:31FromDiscord<ElegantBeef> I seen your issue on the `memo` library, so you should clearly use https://github.com/beef331/kashae and find bugs for me, thanks 😛
07:29:46PMunchWho, me?
07:29:51FromDiscord<ElegantBeef> yeaa
07:30:09FromDiscord<Rika> humi
07:30:41PMunchI ended up writing my own cache library :P
07:31:09FromDiscord<ElegantBeef> Yea i just made this over the past few days for fun due to varriount mentioning caching 😄
07:31:39PMunchAh, here we go: https://github.com/PMunch/nim-cache
07:31:48FromDiscord<zidsal> Mum says it's my time to write a caching Library!
07:31:56FromDiscord<ElegantBeef> lol
07:32:42FromDiscord<zidsal> (edit) "time" => "turn"
07:32:49FromDiscord<ElegantBeef> I guess i should make it so users can make a lambda'd cached procedure
07:33:01FromDiscord<ElegantBeef> Nah zidsal mine is the bestm purely cause of the name
07:33:03FromDiscord<ElegantBeef> (edit) "bestm" => "best,"
07:33:51PMunch"And now clearCache() can be called inside the function when you want to clear the cache based off some conditional like if the sun is in your eyes." Haha :P
07:34:23FromDiscord<Rika> god damn it why is everyone making the stuff ive been planning to make
07:34:24FromDiscord<ElegantBeef> Had too much fun with the name + readme
07:34:40FromDiscord<ElegantBeef> Rika got anything else you want to make?
07:34:43FromDiscord<ElegantBeef> Can save you some work
07:34:54FromDiscord<Rika> eat a uranium pellet
07:35:04FromDiscord<ElegantBeef> Well i was going to anyway, but i'm not russian
07:35:31FromDiscord<zidsal> I heard rika wants to make a mmorpg wow killer, so get writing and don't forget to open source it
07:35:32FromDiscord<Rika> i make stuff no one uses :pain:
07:36:10FromDiscord<Rika> ah yeah i also was planning to make a halting problem solver and had some ideas but now that ive said it im betting you're already done making it
07:37:00FromDiscord<zidsal> Don't forget to co-credit rika so that he can claim half s Turing award
07:37:10FromDiscord<zidsal> (edit) "s" => "a"
07:37:18FromDiscord<Rika> lmao
07:38:39FromDiscord<ElegantBeef> Ah yea my halting problem solver is inside a filing cabinet over here, give me a second to find it
07:38:56FromDiscord<ElegantBeef> It's just a single not that says "Dont fucking write code, problem solved"
07:39:01FromDiscord<ElegantBeef> (edit) "not" => "note"
07:39:05FromDiscord<Rika> really tho i probably have an advertising issue regarding my packages
07:39:14FromDiscord<zidsal> That sounds like my day job as a programmer
07:39:37FromDiscord<ElegantBeef> Eh people dont really use mine either considering the issues i get
07:39:45FromDiscord<Rika> you get issues?
07:39:52FromDiscord<ElegantBeef> Nope
07:40:02FromDiscord<zidsal> I thought his code was infallible
07:40:09FromDiscord<ElegantBeef> Either my software is flawless or people dont use it
07:40:31FromDiscord<Rika> > your software↔> flawless↔literal impossibility
07:40:46FromDiscord<ElegantBeef> I'm a fuckwit so clearly that's not the case
07:46:25FromDiscord<ElegantBeef> Do wonder if i can implement more flags for behaviour but cannot think of nay atm
07:47:40FromDiscord<Rika> nay
07:47:55FromDiscord<ElegantBeef> nay any yan one of the three
07:49:05FromDiscord<ElegantBeef> You know rika we could work together on making the bestest library ever that no one uses
07:49:29FromDiscord<Rika> poggers
07:53:41FromDiscord<ElegantBeef> For those just tuning in that's Rika laughing at the idea of working with me
07:54:08FromDiscord<Rika> man doesnt know what poggers means
07:54:44FromDiscord<ElegantBeef> I was using it for more self deprecating humour, but I am like 9000 years old
07:59:44FromDiscord<Varriount> In reply to @ElegantBeef "For those just tuning": Is it possible to reduce the amount of procedural AST manipulation by using templates or quasi-quoting?
07:59:56FromDiscord<Varriount> (in your cache implemention)
08:01:10FromDiscord<ElegantBeef> It might be possible, but i try to use quoting as much as possible
08:02:26FromDiscord<ElegantBeef> I suppose i need to document it more anyway, but what's your issue with it
08:04:41FromDiscord<Varriount> Nothing in particular. I just dislike manual AST manipulation in general. I want some magically better way.
08:05:15FromDiscord<ElegantBeef> Ah, in some cases i find there is no better alternative since the alternative is storing a bunch of variables into unpackable ones
08:05:57FromDiscord<ElegantBeef> Though i think there exist better quoting, but i'm uncertain
08:06:46FromDiscord<ElegantBeef> Like pmunch's `macroutils.superquote`
08:08:23PMunchsuperquote is basically just a wrapper around quote that does a little bit of transformation
08:09:44FromDiscord<Varriount> Does quote still have... Problems? I can't recall what they were specifically, just that at least one attempt to fix them was rejected.
08:09:45FromDiscord<ElegantBeef> Yea that's my point it better handles things like `x[0]`
08:10:46FromDiscord<Varriount> PMunch: In my opinion, quote should do what your super quote does.
08:10:46FromDiscord<ElegantBeef> The biggest problem to me is just that the the accQuoted areas dont let you do node traversal, so you have to cache
08:11:13FromDiscord<Varriount> accQuoted? Can you give an example?
08:11:18PMunch@Varriount, I agree :)
08:11:33PMunchThose are the backticks
08:11:50FromDiscord<ElegantBeef> I also think i agree that it should
08:11:59PMunchEverything within backticks in a Nim macro is just treated as a string
08:12:50FromDiscord<Varriount> By cache, you mean assign to a variable within the macro? Because quote doesn't support arbitrary expressions?
08:12:58FromDiscord<ElegantBeef> yea
08:14:37FromDiscord<Varriount> PMunch: Making macros easier to write is a boon for the language. So many of Nim's compelling features rely on them.
08:14:41PMunchBasically all that superQuote does is lift the accQuoted bits out into let statements and replaces the accQuoted bit with that identifier: https://github.com/PMunch/macroutils/blob/master/src/macroutils.nim#L1103-L1132
08:14:56PMunchI totally agree, which is why I wrote macroutils
08:15:05PMunchUnfortunately I keep forget to use it myself :P
08:15:17*mahlon quit (Ping timeout: 260 seconds)
08:15:35FromDiscord<ElegantBeef> And i just dont use it for the same reason, just rely on what i know 😄
08:16:08PMunchI mean it's easy if you know macros to begin with :P
08:16:13PMunchWhich is also why I don't use it
08:16:21PMunchBecause I'd have to re-learn how to write them :P
08:16:52FromDiscord<ElegantBeef> I've written enough macros for procdefs i pretty much know the AST like the back of my hand
08:16:59FromDiscord<Varriount> In reply to @PMunch "I mean it's easy": That's like saying the Nim compiler source code is easy to understand if you've written a programming language before.
08:17:23FromDiscord<ElegantBeef> Eh the hardest part about macros is understanding the AST imo
08:17:37FromDiscord<ElegantBeef> Once you learn the AST you're pretty much a macro god
08:18:02FromDiscord<Varriount> Doesn't make them any less tedious to read or write.
08:18:03*mahlon joined #nim
08:18:31FromDiscord<ElegantBeef> I dont find them tedious to write, quite fun
08:18:40FromDiscord<ElegantBeef> (edit) "I dont find them tedious to write, quite fun ... " added "actually"
08:18:45PMunchWell, once you get used to using quote it's a bit easier
08:21:17FromDiscord<ElegantBeef> Also i'm uncertain but due to params being a `seq[NimNode]` this line isnt actually doable using quote ` elseBody.add newAssignment(ident"result", newCall(lambdaName, params))`
08:22:05FromDiscord<ElegantBeef> it'd turn into `result = lambdaName([a, b, c...])`
08:22:24PMunchMm, I don't think superQuote will help you there either unfortunately..
08:22:36PMunchIt could be expanded to though
08:23:08FromDiscord<ElegantBeef> Yea, simply look up symbol/type and if it's a seq unpack it
08:23:17PMunchAdopt similar syntax to what I have in expand
08:23:34PMunchWell, that would mean you would have to know what kind of AST the user wanted to create
08:23:45PMunchIt could be that they are creating AST to be parsed by another macro
08:23:58PMunchIn which case it might not expect the same node types as normal AST
08:24:10FromDiscord<ElegantBeef> I suppose
08:24:38PMunchBut you could have it like `result = lambdaName(\`params*\`)` like I do for expand
08:25:43FromDiscord<ElegantBeef> Discord made a dogs breakfast of that
08:26:24PMunchHaha, I was afraid it might :P
08:26:27PMunchI even tried my best to escape the inner quotes for you guys..
08:26:41FromDiscord<ElegantBeef> Yea yea an escape sequence
08:27:05FromDiscord<ElegantBeef> Anywho, i'll see about cleaning it up to appeal to your human side varriount
08:27:23FromDiscord<ElegantBeef> Also realized another option of `clearAfterRun`
08:27:51FromDiscord<ElegantBeef> Lets you get super fast calculations with very little permanently used memory
08:28:16FromDiscord<ElegantBeef> Also pmunch i was meaning to ask can a LRU cache actually match the concept signature?
08:28:36FromDiscord<ElegantBeef> I havent looked at how they're meant to be used so dont actually know if this is generic enough
08:28:59PMunchWhat do you mean?
08:29:15FromDiscord<ElegantBeef> https://github.com/beef331/kashae#implementation-details
08:29:33FromDiscord<ElegantBeef> I support user defined caches and that's the concept i
08:29:37FromDiscord<ElegantBeef> (edit) "i" => "i'm presently using"
08:31:20PMunchWait, how does this work `c[a] = K`
08:31:46FromDiscord<ElegantBeef> It's for assignment of a `K` type
08:31:52FromDiscord<ElegantBeef> Oh wait
08:31:54PMunchBut what did you mean by can a LRU cache match?
08:31:56FromDiscord<ElegantBeef> That's supposed to be V
08:32:05PMunchYeah that's what I thought :P
08:32:46FromDiscord<ElegantBeef> Is a LRU cache reasonably capable of falling under that concept
08:33:03PMunchWhy wouldn't it be?
08:33:34FromDiscord<ElegantBeef> I was just curious, i havent looked at the API's and as i seen you used one, i thought i'd ask
08:34:04FromDiscord<ElegantBeef> I've never looked at a LRU cache so i have 0 idea the actual logic behind them or how they work
08:34:08PMunchWell a LRU cache is just a cache that when filled up will evict the least recently used element
08:36:47FromDiscord<ElegantBeef> Well that's good to hear then
08:43:15FromDiscord<Varriount> In reply to @ElegantBeef "I was just curious,": I recommend looking at the Python implementation
08:44:09FromDiscord<ElegantBeef> Might be worth while but need to punch my eyes a bit to make the code blurry
08:45:38FromDiscord<Varriount> Actually, I'd recommend looking at the Python standard library or interpreter for nearly any applicable reference implementation. The code is generally clear and well-documented (especially the C code).
08:45:59*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
08:46:06FromDiscord<ElegantBeef> I mean i wasnt worried about making an LRU, just wondering if it was similar to how a table was used
08:46:48*johnnynitwits joined #nim
08:48:52*Arrrrrrrr joined #nim
08:49:14FromDiscord<ElegantBeef> And now the macro is superbly documented and everyone will be happy 😛
08:49:34ArrrrrrrrGood night nimmics
08:49:55FromDiscord<ElegantBeef> Buh bye person that never spoke all night
08:50:13*krux02 joined #nim
09:00:13*ckafi[m] quit (Quit: Idle for 30+ days)
09:07:16PMunch"Control cannot fall through from one case label", stupid C#, why do you require me to type `break` if not typing `break` is an error!!
09:10:43FromDiscord<Varriount> Why does it require semicolons, if 95% of the time, they end up right next to line breaks?
09:12:04PMunchMhm
09:12:38PMunchAnd why are all my projects 10 files or more with 100 lines of code in each, only one of which actually does anything related to the application..
09:13:37ArrrrrrrrWhy do I work if I will die anyway?
09:15:27FromDiscord<arnetheduck> In reply to @Varriount "Why does it require": rust gets this right - semicolons are not required for expressions, and expressions in general are easier to reason about, so it gently rewards good code with fewer keystrokes. brilliant.
09:17:05FromDiscord<Varriount> Go does that too, if I recall correctly.
09:18:19FromDiscord<Varriount> I've no idea why other languages didn't do it. It's not that hard to implement.
09:18:58FromDiscord<ElegantBeef> C# just glues more mess on their code, they still dont support block expressions
09:20:18FromDiscord<ElegantBeef> And their solution for switch expressions is just ugh
09:38:19*kitech1 quit (Ping timeout: 252 seconds)
09:39:26*kitech1 joined #nim
10:15:20*tane joined #nim
10:19:42*abm joined #nim
10:39:42FromDiscord<neow> In reply to @Varriount "Why does it require": the semicolons are maybe needed to avoid ambiguity
11:02:14ForumUpdaterBotNew Nimble package! interface_implements - implements macro creates toInterface proc., see https://github.com/itsumura-h/nim-interface-implements
11:08:03FromDiscord<Rika> In reply to @neow "the semicolons are maybe": needed only sometimes is the point
11:08:20FromDiscord<Rika> why cant they be "optional" until its ambiguous?
11:10:43*Gustavo6046 quit (Ping timeout: 252 seconds)
11:44:08*Tlangir joined #nim
11:46:26*Tlanger quit (Ping timeout: 246 seconds)
12:16:12ForumUpdaterBotNew thread by Sixte: How to use an OrderedTable , see https://forum.nim-lang.org/t/7971
12:18:13*lritter joined #nim
12:24:12*clyybber joined #nim
12:25:54*rockcavera joined #nim
12:29:10*xet7 quit (Remote host closed the connection)
12:30:33*xet7 joined #nim
12:44:08Zoom[m]Who maintains the forums? Is it Dom? Had a slight race condition yesterday: after posting a reply the page rebuilds with your comment shown, but it doesn't fetch any commentaries which were posted while you're were writing. Why not just refresh the whole page?
12:52:59*sacredfrog quit (Quit: ZNC 1.8.2 - https://znc.in)
12:53:00PMunchI think it's dom96 yeah
12:53:32*sacredfrog joined #nim
12:53:35FromDiscord<zetashift> https://github.com/nim-lang/nimforum open an issue!
12:56:09Zoom[m]Don't want to spam the forums trying to reproduce it :P
12:57:58FromDiscord<zetashift> you can quickly run a dev forum and spam there haha
13:00:33Zoom[m]I knew someone would suggest that! You overestimate my proficiency and underestimate my laziness.
13:01:19PMunchUgh, of course strings in C# are UTF16, because Microsoft..
13:02:55Clonkk[m]<FromDiscord "<zetashift> ">https://github.com/n"> I honestly don't understand why we bother reinventing the wheel by doing a lesser version of Discourse on the pretext that it's writting in Nim (while missing 70% of functionality and having several problematic bugs).
13:03:07Clonkk[m]> <@freenode_FromDiscord:matrix.org> <zetashift> https://github.com/nim-lang/nimforum open an issue!
13:03:07Clonkk[m] * I honestly don't understand why we bother reinventing the wheel by doing a lesser version of Discourse on the pretext that it's written in Nim (while missing 70% of functionality and having several problematic bugs).
13:03:19FromDiscord<Yardanico> to be fair the server backend is much more lighter
13:03:23FromDiscord<Yardanico> of nimforum compared to discourse
13:03:38PMunchIt is kinda cool to have it built in Nim
13:04:05PMunchBut it should probably get some love to make it more reliable so that newcomers don't get a bad first impression
13:04:51FromDiscord<Yardanico> but also, nimforum is actually older than discourse :P the modern version ("nimforum v2") is younger though, yes
13:05:19FromDiscord<Yardanico> example snapshot from 2012 http://web.archive.org/web/20120530061632/http://forum.nimrod-code.org/
13:07:13Zoom[m]Dunno, I like it, it feels snappy.
13:09:24FromDiscord<willyboar> I agree with PMunch. Someone have to give it some love.
13:09:43Zoom[m]Also, I think some risks of making a poor first impression are offset by good impression of dogfooding.
13:10:56FromDiscord<Yardanico> current nimforum is a decent example of a SPA done in nim (frontend side) :)
13:11:05FromDiscord<Yardanico> not even talking about the backend
13:11:33Zoom[m]As someone noted on the forums, we seriously lack tutorials for using Nim for JS. It would be cool to use the nimforum as an example for those.
13:12:08PMunchOoh, most definitely
13:13:01PMunchWhy can't Nim get a mysterious benefactor so they can hire me to just create tutorials, libraries, and such all day long..
13:13:41FromDiscord<ajusa> In reply to @Zoom "As someone noted on": I'm working on one for Karax https://github.com/karaxnim/karax/pull/199
13:14:26Zoom[m]Was the mysterious benefactor who donated some BTC found? đŸ€š
13:18:36Zoom[m]@ajusa, that's cool. Subscribed for proofreading.
13:18:52FromDiscord<Technisha> :p
13:19:05FromDiscord<Mina Ashido]|[đŸ’»â­> I'm still Technisha btw
13:25:39FromDiscord<hamidb80> does anyone know how screen recorders work?
13:25:55FromDiscord<hamidb80> i use this code to take screenshot;↔https://gist.github.com/treeform/782149b5fc938753feacfca43637aa90
13:26:13FromDiscord<hamidb80> it take almost `0.15s` to take a screenshot in my PC
13:26:17FromDiscord<hamidb80> (edit) "take" => "takes"
13:26:44FromDiscord<hamidb80> In reply to @hamidb80 "does anyone know how": how do they achieve 60fps ?
13:27:34*xet7 quit (Remote host closed the connection)
13:32:21*Arrrrrrrr quit (Remote host closed the connection)
13:32:44Oddmongermaybe they can export at 60fps, but not necessarily taken on a real second (it could have take 1.2 second for example)
13:33:35FromDiscord<Rika> wdym
13:34:15FromDiscord<Yardanico> In reply to @hamidb80 "how do they achieve": you just capture images of the screen 60 times a second :)
13:34:30Oddmongerif you ask me 60 fps on a capture, i would say « ok, but do you mind if i redo some frames here and there when i'm late in capturing ? »
13:34:34FromDiscord<Yardanico> of course there can be various optimizations to make this faster by using lower-level OS APIs, or even by graphic drivers
13:35:23FromDiscord<Rika> In reply to @Oddmonger "if you ask me": well thats called dropping frames, and obs usually reports 0 or a very low % for me when i record
13:35:34FromDiscord<Yardanico> but of course you can't record the screen at FPS higher than your refresh rate (software will either record at 60fps or record at the target FPS and interpolate frames)
13:35:54FromDiscord<Yardanico> but generally 60fps is the standard, almost no one records at a higher FPS for youtube or other services
13:36:13FromDiscord<Yardanico> i mean for more "professional" videos and stuff, of course 30fps videos are much more common still
13:36:31FromDiscord<treeform> In reply to @hamidb80 "how do they achieve": https://stackoverflow.com/questions/5069104/fastest-method-of-screen-capturing-on-windows
13:37:58*Vladar joined #nim
13:38:53Oddmongeri don't even dare to imagine doing this with Xorg
13:39:13FromDiscord<Yardanico> it has an API for that too
13:39:42Oddmongerisn't it a framebuffer slow as hell ?
13:39:49FromDiscord<Yardanico> huh?
13:40:31FromDiscord<Yardanico> but generally to check best (or almost best) ways to record you should check out obs' source code :)
13:47:16FromDiscord<haxscramper> For documentation generation would it be a good idea to implement a templating engine with support for documentable entry queries, or I should put more focus on providing built-in functionality?
13:47:42FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3mzQ
13:48:19FromDiscord<haxscramper> Templating engine in addition to docgen-as-a-library of course
13:50:23FromDiscord<haxscramper> And XML/JSON/sqlite export for documentation
13:52:30*wasted_youth2 joined #nim
13:57:36FromDiscord<ajusa> is anyone familiar with cligen? I'm trying to take in a seq[string] as a parameter of filenames, but when I do --flag string1 string 2 it only seems to pick up string1. Do the values need to be comma separated? I was hoping I could get it to work with shell replacement, like .log expands into test.log test2.log by the shell, without commas
13:59:25FromDiscord<Yardanico> that should work, at least the example in the readme says so
14:00:14FromDiscord<Yardanico> is that --flag the last in your command-line call?
14:00:17FromDiscord<ajusa> `proc main(firstList = newSeq[string](), secondList: seq[string]) =` this is the exact signature of my proc
14:01:07FromDiscord<Yardanico> @ajusa from DETAILS of cligen: "Zero or 1 params has type seq[T] to catch optional positional args."
14:01:14FromDiscord<Yardanico> ah, that's not really related
14:01:19FromDiscord<ajusa> and I'm calling it with `--firstList .log input.txt`↔now clearly this doesn't work as there is no way to tell where firstList stops and secondList ends, but I'm not sure how to make that work
14:03:37*xet7 joined #nim
14:08:49FromDiscord<ajusa> hm, it also seems like the generated help menu says `-f=, --firstList= TaintedStrings {} append 1 val to firstList`↔so my guess is that I need to do `-f=first.log -f=second.log` in order to add two items to that list? That seems pretty confusing, am I missing something?
14:33:34*leorize joined #nim
14:42:19FromDiscord<creonico> How can I import a typedef struct from C, and rename it and its fields in Nim
14:46:30FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3mA5
14:46:42FromDiscord<haxscramper> for `typedef struct {...} CStruct`
14:58:06*johannes_ quit (Ping timeout: 265 seconds)
15:01:36FromDiscord<creonico> It gives me an error saying of unknown type name
15:01:41FromDiscord<creonico> (edit) removed "saying"
15:22:38*Gustavo6046 joined #nim
15:22:48FromDiscord<haxscramper> Can you show the C code, nim code and error? Or put example on playground.
15:23:40FromDiscord<haxscramper> You can embed C code in example by using `{.emit:"""/TYPESECTION/`
15:25:02*abm quit (Quit: Leaving)
15:31:17*superbia joined #nim
15:36:18FromDiscord<creonico> https://play.nim-lang.org/#ix=3mAy
15:39:43FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3mAA
15:40:14FromDiscord<haxscramper> Removing field that uses it (and types in C code that were not available) now everything compiles
15:48:59FromDiscord<creonico> how would I also wrap `WNDPROC` ._.
15:49:53FromDiscord<Rika> The same way you wrapped window class?
15:51:52FromDiscord<haxscramper> In reply to @creonico "how would I also": this is a typedef'ed callback?
15:52:16FromDiscord<haxscramper> Use `type WNDPROC = proc(a: cint, <other arguments>) {.cdecl.}`
15:53:16FromDiscord<haxscramper> btw there is a windows API wrapper https://github.com/khchen/winim
15:53:21FromDiscord<creonico> can you explain what `a:cint` is and the `cdecl` pragma
15:53:31FromDiscord<creonico> I know, I just want to learn this before using it
15:54:08FromDiscord<haxscramper> https://github.com/khchen/winim/blob/bffaf742b4603d1f675b4558d250d5bfeb8b6630/winim/inc/winuser.nim#L171
15:54:27FromDiscord<haxscramper> In reply to @creonico "can you explain what": https://nim-lang.org/docs/manual.html#types-procedural-type
15:54:52FromDiscord<haxscramper> https://nim-lang.org/docs/system.html#cint
16:00:14*jaens[m] quit (Quit: Idle for 30+ days)
16:04:54FromDiscord<creonico> sent a code paste, see https://paste.rs/AfR
16:06:36*PMunch quit (Quit: leaving)
16:07:13*whitefly3 joined #nim
16:08:01*whitefly quit (Read error: Connection reset by peer)
16:10:24FromDiscord<haxscramper> `WNDPROC` is a type, `importc` on procedure means that you import C function
16:10:50FromDiscord<haxscramper> so you need to declare `windproc` as a procedural type with `.cdecl.` calling convention
16:11:23FromDiscord<haxscramper> `.importc` for `proc` is needed if you had something like `void concreteWinProcImplementation() { ... }` in C and wanted to use it in nim
16:11:46FromDiscord<haxscramper> Then, you could do `proc concreteWinProcImplementation() {.importc: "concreteWinProcImplementation".}`
16:11:57FromDiscord<haxscramper> but not when declaring type
16:13:03FromDiscord<haxscramper> Also use `cint` instead of `int` as latter one is not guaranteed to have the same type as `C`'s `int`
16:13:12FromDiscord<haxscramper> !eval echo sizeof(int) == sizeof(cint)
16:13:15NimBotfalse
16:13:26FromDiscord<haxscramper> smae size
16:13:28FromDiscord<haxscramper> (edit) "smae" => "same"
16:15:23FromDiscord<creonico> So I used the method that you said to use and I got this error:↔`Error: type mismatch: got <proc (handle: int, message: int32, wparam: int64, lparam: int64): int64{.stdcall.}> but expected 'Window_Procedure = proc (a: cint, handle: int, message: int32, wparam: int64, lparam: int64){.cdecl.}'`
16:17:34*stefantalpalaru quit (Quit: ZNC 1.7.5 - https://znc.in)
16:17:43*stefantalpalaru joined #nim
16:17:52FromDiscord<haxscramper> sent a code paste, see https://paste.rs/87D
16:17:56FromDiscord<haxscramper> so of course it does not work, it is a simple type mismatch
16:18:59FromDiscord<haxscramper> And I believe you need to annotate the proc you are passing as callback with `{.cdecl.}` as well
16:29:03FromGitter<awr1> @creonico please use winim or winlean
16:29:52FromGitter<awr1> or oldwinapi, since winlean is missing window management stuff
16:29:57*stefantalpalaru quit (Changing host)
16:29:57*stefantalpalaru joined #nim
16:43:07FromGitter<awr1> e.g. @creonico https://play.nim-lang.org/#ix=3mAU
16:43:52FromGitter<awr1> i missee a comma after "Cool Window" but that should work
16:45:33*rockcavera quit (Remote host closed the connection)
16:55:39*rockcavera joined #nim
16:58:02FromGitter<awr1> you don't need to use importc on that type also. the windows bindings for nim - it's not that they couldn't import from windows.h using `{.header: "windows.h".}` and the like but they don'tneed to.
16:58:10FromGitter<awr1> instead all the necessary types are defined in nim itself and the way we actually talk to the OS is not by using `{.importc, header: "windows.h".}` to call into functions provided in an imported C header, but rather we just remove the C header middleman and bind to the relevant procedures in the DLLs windows provides directly via `{.importc, dynlib: "user32".}`
16:58:54FromGitter<awr1> so type bindings via `importc` - you can do that, and that is desirable for certain libraries, but we don't do that for windows
17:00:31*brainproxy joined #nim
17:02:27*brainproxy quit (Client Quit)
17:07:54FromDiscord<Ayy Lmao> Is there a way to force Nim to keep the console window open after raising an exception? For instance, if I launch a program that simply raises an exception on windows by clicking the .exe file, the console immediately closes.
17:15:16*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
17:17:33*superbia quit (Quit: WeeChat 3.1)
17:18:18*Lord_Nightmare joined #nim
17:26:49FromDiscord<creonico> I can't seem to use nimble↔`nimble install winim↔bash: nimble: command not found`
17:27:27FromDiscord<creonico> Even though when I run `finish` from the nim install, it says that its on my path
17:28:24FromGitter<awr1> @ayy lmao
17:28:31FromGitter<awr1> a) launch the exe from console, instead of via explorer
17:28:38FromGitter<awr1> b) compile with --app:gui - stack traceback window will pop up instead
17:28:43FromGitter<awr1> c) wrap your program with try/except or modify globalRaiseHook to handle your exceptions in a different way
17:28:50FromGitter<awr1> any of these methods will work
17:30:23FromGitter<awr1> @creonico what's in your nim/bin folder
17:31:24FromDiscord<creonico> lots of things ._.↔not nimble though
17:32:54FromDiscord<Ayy Lmao> In reply to @awr1 "@ayy lmao": Thanks for the info! My program is mainly meant to be launched via explorer so option A isn't for me. I will try your other suggestions.
17:46:48*letto quit (Quit: Konversation terminated!)
17:48:49*letto joined #nim
17:50:58FromGitter<awr1> @creonico go to nim root folder, do `koch nimble`
17:52:11*tane quit (Quit: Leaving)
17:54:15FromDiscord<creonico> `Error: unhandled exception: The system cannot find the file specified.`
17:54:51*tane joined #nim
17:55:50FromGitter<awr1> what are you using to get nim
17:56:27FromGitter<awr1> are you building from the nim git repo
17:56:49FromGitter<awr1> or did you use the zip from the nim website
17:57:33FromDiscord<creonico> the zip from the website
17:58:14FromGitter<awr1> personally i just reccomend using choosenim, it's the most painless way to get nim set up and it makes it easy to switch over to a nim git repo if you do development on the compiler itself
17:58:16FromGitter<awr1> but lemme see
17:59:00FromDiscord<creonico> I did download choosenim
17:59:12FromDiscord<creonico> but i get this when I run the runme.bat file
17:59:24FromGitter<awr1> use the github releases
17:59:29FromGitter<awr1> for choosenim
17:59:35FromDiscord<creonico> sent a long message, see http://ix.io/3mBf
17:59:35FromDiscord<creonico> I did
17:59:50FromGitter<awr1> also I just downloaded the nim zip, i see nimble.exe in there
18:00:43FromGitter<awr1> no i mean don't use runme.bat, just use the .exe version
18:00:56FromGitter<awr1> the readme should be changed
18:01:51FromGitter<awr1> and then use like `choosenim install stable` or whatever
18:02:37FromDiscord<creonico> where is the choosenim exe?
18:03:13FromGitter<awr1> you can get it from github releases but if you downloaded the zip and extracted the whole thing it will be in choosenim/choosenim.exe
18:03:31FromGitter<awr1> do `choosenim stable --firstInstall`
18:03:47FromGitter<awr1> actually i don't really see why runme.bat would fail
18:03:54FromGitter<awr1> did you extract the whole zip?
18:09:38FromDiscord<creonico> yes
18:10:02FromDiscord<creonico> I just ran choosenim stable and got this:↔`Error: unhandled exception: The system cannot find the file specified.↔Additional info: "Requested command not found: \'C:\\Users\\pgnic\\.choosenim\\toolchains\\nim-1.4.6\\bin\\nimble.exe -v\'. OS error:" [OSError]↔`
18:11:03FromGitter<awr1> remove the existing nim installation from your path, delete the .choosenim folder
18:15:21FromDiscord<creonico> Everytime I try to download it I get a virus treat:↔`oserr.nim(94) raiseOSError↔Error: unhandled exception: Operation did not complete successfully because the file contains a virus or potentially unwanted software.↔Additional info: "C:\\Users\\pgnic\\.choosenim\\toolchains\\nim-1.4.6\\bin\\nimble.exe -v" [OSError]`
18:21:24FromDiscord<dom96> wow, cool that we get this as a OS error message
18:21:46FromDiscord<dom96> it's a false positive btw
18:23:10FromDiscord<creonico> right, but it doesn't let me download nimble
18:34:41*beshr quit (Remote host closed the connection)
18:35:04*beshr joined #nim
18:40:10PrestigeCan you run the command as "administrator" or whatever? (I don't use windows)
18:48:51*garFF joined #nim
18:48:56*garFF_ joined #nim
18:49:40*garFF_ quit (Client Quit)
18:55:47FromGitter<awr1> what can we do about the false positive thing? does getting executables signed help?
18:57:10FromGitter<awr1> @creonico whitelist the .choosenim directory in windows defender
19:09:26FromDiscord<hamidb80> In reply to @creonico "Everytime I try to": oh 10054 ?
19:09:42FromDiscord<hamidb80> it's a error number
19:09:47FromDiscord<hamidb80> (edit) "a" => "an"
19:10:51FromDiscord<hamidb80> (edit) "oh" => "do you get error number"
19:18:15FromDiscord<creonico> It doesn't say
19:20:13*lritter quit (Ping timeout: 252 seconds)
19:30:38FromDiscord<hamidb80> https://github.com/miere43/autome
19:31:04FromDiscord<hamidb80> the last commit is from 2016
20:04:15*Vladar quit (Quit: Leaving)
20:14:03FromDiscord<dilawar> How to get a buffer from struct? See the following C code:
20:15:11FromDiscord<dilawar> (edit) "How to get" => "sent" | "buffer from struct? See the following C code:" => "code paste, see https://play.nim-lang.org/#ix=3mBU"
20:15:33FromDiscord<ElegantBeef> What do you mean "buffer"
20:16:48FromDiscord<dilawar> In reply to @ElegantBeef "What do you mean": I updated the question. Not sure if I am using the right words. Struct is directly written to socket in C case and read back into a struct.
20:17:09FromDiscord<dilawar> (edit) "Struct" => "A struct"
20:17:11FromDiscord<ElegantBeef> Ah you just want to write a struct to a file practically
20:17:55FromDiscord<ElegantBeef> `writeBuffer(sock, struct.add, sizeOf(struct.type))`
20:17:58FromDiscord<ElegantBeef> (edit) "struct.add," => "struct.addr,"
20:20:07FromDiscord<ElegantBeef> Dont recall if sockets are considered files, so might have to change that a bit
20:21:09FromDiscord<ElegantBeef> Ah there is a send like that, you can also use a stringstream, and write the struct to that string and send it
20:21:44FromDiscord<dilawar> This is helpful. Yes there is still some issue but I'll call it a progress. `.addr` is not returning the address. I have `addr` as a fiele as well which I am escaping as ``addr``. But I think I am almost there
20:22:18FromDiscord<dilawar> (edit) "``addr``." => "\`addr\`."
20:22:26FromDiscord<ElegantBeef> Should be able to do do `system.addr struct`
20:24:21*narimiran quit (Ping timeout: 265 seconds)
20:24:35FromDiscord<dilawar> In reply to @ElegantBeef "Should be able to": Thank you, Sir. I am back on track. Much appreciate the help 🙂
20:29:42FromDiscord<ajusa> There are also socket streams, not sure if they are in 1.4 though
20:30:12FromDiscord<krisppurg> In reply to @reilly "So #head works, it's": sorry for the late reply (I dont use discord oftenly since I can't access on mobile for some reason), so since new channels are keep getting added to the discord api, I would have to update the ChannelType enum, in the code, it does `GuildChannel(... kind: ChannelType data["type"].get)` (something like that if I remember correctly).
20:32:49FromDiscord<krisppurg> Hence why, but I might as well scrap the idea of ChannelType enum since it basically causes errors frequently when there is a new channel, especially if it even is common like threads. Same applies for MessageTypes, where a common new feature is slash commands and it used to crash whenever there is a new message type, simply because of the range.
20:33:51FromDiscord<krisppurg> (edit) "why, but I" => "why.↔↔I" | "threads. Same" => "threads.↔Same" | "MessageTypes, where" => "`MessageType`," | "type," => "type (before I implemented slash commands),"
20:42:23FromDiscord<ElegantBeef> So time for named constants like it's C? 😛
20:51:03FromDiscord<dilawar> sent a code paste, see https://play.nim-lang.org/#ix=3mC3
20:51:56FromDiscord<dilawar> (edit) "https://play.nim-lang.org/#ix=3mC3" => "https://paste.rs/KE8"
20:53:42FromDiscord<ElegantBeef> `a[0].addr`
20:54:28FromDiscord<ElegantBeef> Nim's strings are pointers to `len, capacity, ptr data` so you need to get the first element
20:55:53FromDiscord<dilawar> still getting 6 non-zero values ` [112, 130, 185, 199, 43, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]`
20:57:19FromDiscord<ElegantBeef> `let b = cast[ptr array[16, uint8]](a[0].unsafeAddr)[]`
20:58:18FromDiscord<dilawar> Worked `[49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 53, 0, 0, 0, 0, 0]`
20:58:47FromDiscord<dilawar> Any page in manual which I can read to understand this?
20:59:51FromDiscord<ElegantBeef> unsafeAddr is a `ptr char` you cast that to a `ptr array[16, uint8]` then dereference it with `[]`
21:00:07FromDiscord<ElegantBeef> Pretty much ally you need, documentation doesnt help here afaik
21:00:45FromDiscord<dilawar> I don't understand why previous one didn't work when I used `a[0].addr`
21:01:12FromDiscord<ElegantBeef> you didnt cast it to a `ptr array`
21:01:50FromDiscord<ElegantBeef> If it errored it was cause you didnt use `unsafeAddr` which is required for `let` variables
21:25:33*garFF quit (Read error: Connection reset by peer)
21:27:05*garFF joined #nim
21:46:41*NimBot joined #nim
21:57:09*thomasross joined #nim
22:20:37*tane quit (Quit: Leaving)
22:36:23*azed joined #nim
23:15:17*clyybber quit (Remote host closed the connection)
23:37:38FromDiscord<Esther> Q on that topic - do let variables always have addresses?
23:38:25*garFF quit (Read error: Connection reset by peer)
23:40:05FromDiscord<Esther> Coming from Ada I was looking for a keyword like “aliased” that tells the compiler that I will be taking the address of this value, but couldn’t find one
23:41:07FromDiscord<Esther> In c/c++ it’s easy cause if it’s not a preprocessor directive or a constexpr then it’ll have an address, nim isn’t quite so clear
23:47:46FromDiscord<zetashift> Like https://nim-lang.org/docs/system.html#addr,T you mean?
23:50:07FromDiscord<exelotl> I believe let variables do always have addresses