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:20 | FromGitter | <bung87> how to control type field accessbility ? I want seperate one type to single file |
00:33:13 | FromDiscord | <Hi02Hi> do you mean sth like https://nim-lang.org/docs/tut1.html#modules ? |
00:36:15 | FromGitter | <bung87> I have a long file that defines basic types , some type fields only used for that file |
00:36:57 | FromDiscord | <Hi02Hi> if you dont export a field with a , that field will only be visible in that file |
00:37:20 | FromDiscord | <Hi02Hi> in other words, fields are private by default |
00:37:53 | FromGitter | <bung87> no , am not means to identifiers |
00:38:36 | FromGitter | <bung87> "type's fields" |
00:40:04 | FromGitter | <bung87> these types also used in other file |
00:41:16 | FromDiscord | <creonico> sent a code paste, see https://play.nim-lang.org/#ix=3mxp |
00:48:57 | FromDiscord | <Hi02Hi> sent a long message, see https://paste.rs/YHW |
00:49:35 | FromGitter | <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:39 | FromDiscord | <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:44 | FromDiscord | <ElegantBeef> bung87 can you show an example of what you're after? |
00:54:05 | FromGitter | <bung87> https://play.nim-lang.org/#ix=3mxq |
00:54:41 | FromGitter | <bung87> I belive nim's doc called it type's field everywhere... |
00:57:35 | FromGitter | <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:11 | FromDiscord | <creonico> what is meant by side effects? That is a concept I don't understand |
00:59:32 | FromDiscord | <ElegantBeef> Whether the procedure can modify variables not passed into it |
00:59:39 | FromGitter | <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:06 | FromDiscord | <ElegantBeef> No side effects are more like functional programming functions where they only mutate parameters if marked `var` or return state |
01:00:35 | FromDiscord | <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:16 | FromDiscord | <creonico> In reply to @ElegantBeef "Whether the procedure can": not passed to it? |
01:02:01 | FromDiscord | <ElegantBeef> A nosideeffect procedure cannot use `echo` since it changes/accesses a global variable `stdin` |
01:02:10 | FromGitter | <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:25 | FromGitter | <bung87> @creonico that prevent you unexpectly change global variable and proc parameters value |
01:05:51 | FromDiscord | <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:10 | FromGitter | <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:41 | FromGitter | <bung87> I remenber I've tried that |
01:11:18 | FromGitter | <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:53 | FromGitter | <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:02 | FromDiscord | <hamidb80> i feel stupid |
01:57:06 | FromDiscord | <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:12 | FromDiscord | <hamidb80> (edit) "RBG" => "BGR" |
01:57:26 | FromDiscord | <hamidb80> so i must swap R with B |
01:57:57 | FromDiscord | <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:49 | FromDiscord | <hamidb80> hey beef are you here? đ |
01:59:28 | FromDiscord | <ElegantBeef> I'm here |
02:00:04 | FromDiscord | <hamidb80> any idea what's going on ? |
02:01:35 | FromDiscord | <ElegantBeef> Are the screenshots around the code different implementations? |
02:02:23 | FromDiscord | <ElegantBeef> What library are you using? |
02:04:10 | FromDiscord | <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:11 | FromDiscord | <hamidb80> https://gist.github.com/treeform/782149b5fc938753feacfca43637aa90 |
02:05:01 | FromDiscord | <hamidb80> In reply to @ElegantBeef "What library are you": winim and pixie |
02:06:14 | FromDiscord | <ElegantBeef> Have you tried without swapping? |
02:08:45 | FromDiscord | <hamidb80> In reply to @ElegantBeef "Have you tried without": yep https://media.discordapp.net/attachments/371759389889003532/841859404793774111/unknown.png |
02:09:52 | FromDiscord | <hamidb80> all `blue`s are `yellow` |
02:10:11 | FromDiscord | <hamidb80> vice versa |
02:10:14 | FromDiscord | <hamidb80> (edit) |
02:11:33 | FromDiscord | <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:02 | FromDiscord | <ElegantBeef> The very last one they did `r <-> b` |
02:12:31 | FromDiscord | <hamidb80> In reply to @hamidb80 "i'm trying to take": @Hi02Hi |
02:12:38 | FromDiscord | <ElegantBeef> give me the entire code please |
02:12:41 | FromDiscord | <ElegantBeef> So i can actually try it |
02:13:18 | FromDiscord | <Hi02Hi> ah i see, i was looking at wind.nim |
02:14:03 | FromDiscord | <hamidb80> https://gist.github.com/hamidb80/b49f5d588d48172b6b5e08416b801889 |
02:14:13 | FromDiscord | <hamidb80> In reply to @ElegantBeef "give me the entire": here |
02:16:31 | FromDiscord | <ElegantBeef> Shucks seems to not work in wine |
02:18:46 | * | azed quit (Quit: WeeChat 3.1) |
02:20:01 | FromDiscord | <ElegantBeef> Ah virtual desktop makes it work |
02:27:36 | FromDiscord | <ElegantBeef> Ok so i just changed the loops and fixed it |
02:28:12 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3mxE |
02:28:31 | FromDiscord | <ElegantBeef> Since you like pinging so much @hamidb80 |
02:31:23 | FromDiscord | <hamidb80> https://media.discordapp.net/attachments/371759389889003532/841865108849819668/message.txt |
02:32:52 | FromDiscord | <ElegantBeef> I mean all i can say is thati get the proper colour https://media.discordapp.net/attachments/371759389889003532/841865479252869190/unknown.png |
02:32:59 | FromDiscord | <ElegantBeef> So atleast using wine it works |
02:33:25 | FromDiscord | <hamidb80> yeah, thank u, now i feel more dumb than ever, |
02:35:55 | FromDiscord | <ElegantBeef> also there is an `image[x, y]` procedure if you must do the xy iteration đ |
02:36:42 | FromDiscord | <hamidb80> In reply to @ElegantBeef "also there is an": i thought `image[x, y]` is not even possible in nim |
02:37:17 | FromDiscord | <ElegantBeef> it's simply `proc [](obj: T, a, b: int)` |
02:37:26 | FromDiscord | <ElegantBeef> You can make indexers that take whatever the fuck you want |
02:38:32 | FromDiscord | <ElegantBeef> so you can techincally do `a[10, "hello", 134.03]` |
02:39:11 | FromDiscord | <ElegantBeef> Now if i ever see that as actual code people use, i might consider never touching code again |
02:40:36 | FromDiscord | <Rika> In before someone makes a JSON index procedure that takes in such values |
02:40:49 | FromDiscord | <ElegantBeef> I said what i said |
02:44:20 | FromDiscord | <ajusa> In reply to @Rika "In before someone makes": Wait that's actually a pretty good idea |
02:44:32 | FromDiscord | <ElegantBeef> Shoots ajusa |
02:44:45 | FromDiscord | <hamidb80> In reply to @ajusa "Wait that's actually a": no |
02:46:06 | FromDiscord | <ajusa> Hey, I think node["parent"]["child"]["property"] would be more readable as â”node["parent", "child", "property"] |
02:46:24 | FromDiscord | <ElegantBeef> or you know use dotoperators and have it be `node.parent.child.property` |
02:46:32 | FromDiscord | <Rika> There already ones for string only or integer only |
02:46:35 | FromDiscord | <Rika> Not for mixed |
02:46:40 | FromDiscord | <ajusa> Makes more sense than node["parent.child.property"] |
02:46:44 | FromDiscord | <Rika> And I hope it never happens because thatâs a nightmare |
02:46:54 | FromDiscord | <ajusa> In reply to @ElegantBeef "or you know use": Can't do that for json node though right |
02:47:01 | FromDiscord | <Rika> You can |
02:47:03 | FromDiscord | <ElegantBeef> Dotoperators let that yes |
02:47:14 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual_experimental.html#special-operators-dot-operators |
02:47:20 | FromDiscord | <Rika> Lol |
02:47:21 | FromDiscord | <ajusa> Ah I remember that now |
02:47:33 | FromDiscord | <Rika> Now look at the {} proc in JSON |
02:47:58 | FromDiscord | <ElegantBeef> Yea there are many ways to skin that cat |
02:48:12 | FromDiscord | <Rika> Why only the cat and not the dog |
02:48:30 | FromDiscord | <Rika> If disruptek were still here Iâd probably be dead after saying that |
02:48:38 | FromDiscord | <ajusa> why are you skinning animals what's wrong with you |
02:49:04 | FromDiscord | <ElegantBeef> What you eat chicken with the feathers on? |
02:49:12 | FromDiscord | <ajusa> I'm vegetarian |
02:49:20 | FromDiscord | <ajusa> (sorry this is #offtopic |
02:49:27 | FromDiscord | <Rika> Well most of us arenât so |
02:49:32 | FromDiscord | <ajusa> (edit) "is #offtopic" => "belongs in #offtopic)" |
02:49:57 | FromDiscord | <ElegantBeef> I'm a vegetarian too, i just also eat meat |
02:50:26 | FromDiscord | <Rika> :galaxybrain: |
02:51:31 | FromDiscord | <ElegantBeef> Though rika i dont know why you'd skin dogs, they're rather cool |
02:51:57 | FromDiscord | <hamidb80> In reply to @Rika "<:galaxybrain:582067821736099870>": https://media.discordapp.net/attachments/371759389889003532/841870280703606804/unknown.png |
02:52:29 | FromDiscord | <Rika> Reload |
02:52:43 | FromDiscord | <Rika> In reply to @ElegantBeef "Though rika i dont": Same to you with cats |
02:55:57 | FromDiscord | <ElegantBeef> Eh cats are pricks |
02:56:08 | FromDiscord | <ElegantBeef> They have it coming |
02:56:27 | FromDiscord | <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:36 | FromDiscord | <creonico> https://github.com/khchen/winim/blob/master/examples/hellowin.nim |
02:57:07 | FromDiscord | <creonico> I am not using winim by the way |
02:57:38 | FromDiscord | <Rika> In reply to @ElegantBeef "Eh cats are pricks": Lots of dogs are pricks as well |
02:57:57 | FromDiscord | <ElegantBeef> All these windows questions tonight. Trying to get me on windows MS? Not today! |
02:58:20 | FromDiscord | <ElegantBeef> What procedure are you talking about exactly? |
02:58:48 | FromDiscord | <creonico> haha, you use Linux? |
02:59:29 | FromDiscord | <creonico> RegisterClass, GetMessage, TranslateMessage, etc.. |
03:00:13 | FromDiscord | <creonico> those are functions with pointer parameters |
03:02:55 | FromDiscord | <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:17 | FromDiscord | <ElegantBeef> What's the definition of `Wndclassw`? |
03:04:24 | FromDiscord | <ElegantBeef> (edit) "`Wndclassw`?" => "`Wndclass`?" |
03:05:04 | FromDiscord | <ElegantBeef> Suppose i can open this up with my editor đ |
03:10:42 | FromDiscord | <creonico> sent a code paste, see https://play.nim-lang.org/#ix=3mxO |
03:10:59 | FromDiscord | <ElegantBeef> Was looking for the Nim definition, looks like it's an alias of another type that's not a pointer |
03:12:04 | FromDiscord | <creonico> sent a code paste, see https://play.nim-lang.org/#ix=3mxP |
03:13:13 | FromDiscord | <Rika> That looks equivalent |
03:13:34 | FromDiscord | <ElegantBeef> Well it's an alias, the procedure still takes a `ptr` and somehow doesnt complain |
03:14:51 | FromDiscord | <Rika> In reply to @creonico "RegisterClass, GetMessage, TranslateMessage, etc..": Can I see the signatures in C? |
03:15:07 | FromDiscord | <ElegantBeef> Ah found it https://github.com/khchen/winim/blob/bffaf742b4603d1f675b4558d250d5bfeb8b6630/winim/utils.nim#L26 |
03:15:19 | FromDiscord | <ElegantBeef> Used a macro to echo the typed body |
03:15:25 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3mxS |
03:15:43 | FromDiscord | <ElegantBeef> You probably have to dispose of the image |
03:15:52 | FromDiscord | <ElegantBeef> also if you're benchmarking use `benchy` |
03:15:58 | FromDiscord | <ElegantBeef> At the very least use monotimes |
03:16:10 | FromDiscord | <Rika> Probably a ref and the GC isn't firing? |
03:16:26 | FromDiscord | <Rika> You can force a gc pass |
03:16:37 | FromDiscord | <creonico> sent a code paste, see https://play.nim-lang.org/#ix=3mxT |
03:16:46 | FromDiscord | <hamidb80> In reply to @Rika "You can force a": how? |
03:16:52 | FromDiscord | <Rika> I forgot lol |
03:16:58 | FromDiscord | <ElegantBeef> what library is that `takeScreenshot` from? |
03:17:03 | FromDiscord | <ElegantBeef> Or is that your own |
03:17:38 | FromDiscord | <hamidb80> In reply to @hamidb80 "https://gist.github.com/hamidb80/b49f5d588d48172b6b": i just put that code inside a proc called `takeScreenshot` |
03:17:48 | FromDiscord | <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:51 | FromDiscord | <ElegantBeef> Might be some part of the windows api you need to propeprly handle |
03:18:59 | FromDiscord | <ElegantBeef> The proof of my uselessness is not spelling properly properly |
03:22:29 | FromDiscord | <Rika> Propelly |
03:23:34 | FromDiscord | <creonico> So if I understand correctly, it does require `addr` but that does it automatically |
03:23:42 | FromDiscord | <ElegantBeef> Yes |
03:23:47 | * | whitefly quit (Remote host closed the connection) |
03:23:55 | FromDiscord | <ElegantBeef> Converters allow you to define implicit conversions |
03:24:06 | FromDiscord | <creonico> why they do that though, its not very readable |
03:24:29 | FromDiscord | <hamidb80> In reply to @ElegantBeef "Might be some part": GetClientRect(...params), `{.importc.}`â”â”it's actually a c function |
03:24:52 | FromDiscord | <Rika> In reply to @creonico "why they do that": Opinion probably |
03:25:16 | FromDiscord | <hamidb80> (edit) "`{.importc.}`â”â”it's" => "`{.importc.}`â”â”they are" |
03:25:19 | FromDiscord | <hamidb80> (edit) removed "a" | "function" => "functions" |
03:25:44 | FromDiscord | <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:58 | FromDiscord | <ElegantBeef> But the annoying thing is that's all objects effected |
03:26:18 | * | whitefly joined #nim |
03:26:28 | FromDiscord | <Rika> Ez fix just make a massive type class for winim objects |
03:26:35 | FromDiscord | <ElegantBeef> That's what i was going to say |
03:26:48 | FromDiscord | <Rika> And get 10x the compile time (maybe idk I've never tested it) |
03:27:06 | FromDiscord | <ElegantBeef> Either way it's pretty annoying to se |
03:27:07 | FromDiscord | <ElegantBeef> (edit) "se" => "see" |
03:28:37 | FromDiscord | <Rika> Just like you are? |
03:29:39 | FromDiscord | <Rika> Beef mad :monkaGiga: |
03:30:37 | FromDiscord | <hamidb80> does C have destructor or something ? :đ |
03:30:41 | FromDiscord | <ElegantBeef> Lol |
03:30:44 | FromDiscord | <ElegantBeef> To both of you |
03:30:57 | FromDiscord | <ElegantBeef> C's destructors are the people that sit behind the keyboard |
03:31:32 | FromDiscord | <ElegantBeef> In reply to @Rika "Beef mad <:monkaGiga:585595799027712004>": Nah, the truth shouldnt make me angry |
03:37:13 | FromDiscord | <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:26 | FromDiscord | <ElegantBeef> `img` is probably being freed, it's probably the internal resources that are not |
03:41:06 | FromDiscord | <hamidb80> In reply to @ElegantBeef "`img` is probably being": how to free internal sources? |
03:44:09 | FromDiscord | <ElegantBeef> You needto call `DeleteObject` after the image is used |
03:50:14 | * | wasted_youth2 quit (Quit: Leaving) |
03:50:24 | FromDiscord | <ElegantBeef> With modern Nim they could always use destruction to automate destruction of the objects |
03:50:52 | FromDiscord | <ElegantBeef> For example https://play.nim-lang.org/#ix=3mxY |
03:51:43 | * | gangstacat joined #nim |
03:51:54 | FromDiscord | <ElegantBeef> destructors |
03:55:18 | FromDiscord | <hamidb80> i really appreciate the time you spend for we noobs |
04:00:59 | FromDiscord | <ElegantBeef> If it wasnt for my help you might be on some harder drugs like Rust |
04:01:18 | FromDiscord | <ElegantBeef> Think of it as harm prevention |
04:21:56 | FromDiscord | <Rika> In reply to @ElegantBeef "With modern Nim they": I used the destruction to automate the destruction |
04:22:22 | ForumUpdaterBot | New 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:39 | FromDiscord | <Varriount> Ooo, treeform's library is pretty. |
04:51:48 | FromDiscord | <ElegantBeef> Indeed |
04:51:58 | FromDiscord | <ElegantBeef> He makes good stuffs |
04:53:03 | FromDiscord | <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:31 | FromDiscord | <treeform> Thanks! |
04:58:39 | FromDiscord | <ElegantBeef> I think it's just the scaling on the forum |
04:58:55 | FromDiscord | <ElegantBeef> It's only a 200x200 image so scaled up isnt great |
04:58:57 | FromDiscord | <treeform> We don't use ClearType (its priority MS tech) |
04:59:22 | FromDiscord | <treeform> They are more closer to how Mac displays fonts then how Windows displays fonts. |
04:59:51 | FromDiscord | <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:22 | FromDiscord | <treeform> (edit) "priority" => "proprietary" |
05:00:23 | FromDiscord | <ElegantBeef> Are you using SDF? |
05:00:34 | FromDiscord | <treeform> No we do not use SDF. |
05:00:46 | FromDiscord | <ElegantBeef> I know i've asked before, but didnt know if you changed since then |
05:00:55 | FromDiscord | <treeform> Naa I have not. |
05:00:58 | FromDiscord | <Varriount> What font is that? |
05:01:11 | FromDiscord | <treeform> The font in that sample is Ubuntu I think? |
05:01:18 | FromDiscord | <Rika> In reply to @treeform "They are more closer": ~~macs do a better job anyway~~ |
05:01:20 | FromDiscord | <ElegantBeef> Yea ubuntu-regular_1 đ |
05:01:42 | FromDiscord | <Rika> do you know what the difference is between what a mac does and what windows does? |
05:02:31 | FromDiscord | <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:03 | FromDiscord | <treeform> (edit) "now." => "now (in my opinion)." |
05:03:11 | * | teal quit (Quit: WeeChat 3.1) |
05:03:52 | FromDiscord | <treeform> See here about https://github.com/treeform/typography#comparison-to-different-oss how they differ. |
05:04:35 | FromDiscord | <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:28 | FromDiscord | <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:47 | FromDiscord | <treeform> I also think that font rendering is very what you are used too. |
05:05:56 | FromDiscord | <treeform> Some thing that is awful to one person is normal to the other. |
05:06:12 | FromDiscord | <ElegantBeef> Yea whenever i boot up windows everything just looks off |
05:06:17 | FromDiscord | <Varriount> This was more about the fact that the rendering was very aliased. |
05:06:32 | FromDiscord | <Varriount> In reply to @ElegantBeef "Yea whenever i boot": Because of the non-retina display? |
05:07:02 | FromDiscord | <ElegantBeef> Same display, i'm a linux user not mac đ |
05:07:19 | FromDiscord | <Varriount> Huh. You might try adjusting the ClearType settings. |
05:07:44 | FromDiscord | <ElegantBeef> I only use windows to play a select few games, so not highest priority |
05:08:02 | FromDiscord | <Varriount> Though, these days ClearType probably has less impact then it used to, considering that screen resolution has increased so much. |
05:08:23 | FromDiscord | <ElegantBeef> Yea depending on the font i find it just looks off |
05:09:09 | FromDiscord | <ElegantBeef> Also varriount i hate you, i spent a lot of time on that caching library đ |
05:11:05 | FromDiscord | <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:29 | FromDiscord | <Varriount> +1 for the name. |
05:17:38 | FromDiscord | <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:46 | FromDiscord | <ElegantBeef> Seems doable if you use an object or tuple as the return type |
05:18:58 | FromDiscord | <Varriount> Well, this is Python code. |
05:19:18 | FromDiscord | <ElegantBeef> Yea was just thinking about how one would do it with my library |
05:19:55 | FromDiscord | <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:11 | FromDiscord | <Varriount> Something I would suggest, if it's possible, is to allow a different backing structure |
05:20:13 | FromDiscord | <ElegantBeef> Would be nice for optimizing memory on a proc by proc basis |
05:20:19 | FromDiscord | <ElegantBeef> Lol |
05:21:56 | FromDiscord | <ElegantBeef> Concepts and pointer procs might work for the backend, but makes the code a little unwieldy |
05:22:46 | FromDiscord | <ElegantBeef> But yea doesnt seem undoable |
05:22:59 | FromDiscord | <Varriount> Why not just allow giving a type or value that must fulfill a particular concept? |
05:23:29 | FromDiscord | <ElegantBeef> Well that's what i meant |
05:24:33 | FromDiscord | <ElegantBeef> Ah yea i can just make `unCache(c: var Cache)` |
05:24:38 | FromDiscord | <ElegantBeef> Then dont need pointer proc |
05:24:48 | FromDiscord | <ElegantBeef> Sounds good, so will do |
05:25:27 | FromDiscord | <Varriount> Pointy procs are pointy |
05:26:03 | FromDiscord | <Varriount> Now I'm thinking of a hedgehog with a little Nim crown. |
05:26:16 | FromDiscord | <ElegantBeef> Lol new mascot |
05:28:38 | FromDiscord | <treeform> In reply to @ElegantBeef "Yea whenever i boot": Yeah exaclty! |
05:30:23 | FromDiscord | <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:56 | FromDiscord | <Varriount> In reply to @treeform "Not sure what you": https://media.discordapp.net/attachments/371759389889003532/841910545787387914/unknown.png |
05:32:22 | FromDiscord | <Varriount> I don't think it's a bug, just slightly different fonts. |
05:36:21 | * | narimiran joined #nim |
05:40:23 | FromDiscord | <treeform> oh yeah fonts not the same |
05:40:58 | FromDiscord | <Varriount> In reply to @treeform "oh yeah fonts not": I got it from here: https://fonts.google.com/specimen/Ubuntu |
05:41:59 | FromDiscord | <ElegantBeef> None of those fonts have a t with a full cross |
05:44:10 | FromDiscord | <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:18 | FromDiscord | <ElegantBeef> Can concepts describe non concrete types like `Table`? |
05:47:29 | FromDiscord | <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:56 | FromDiscord | <ElegantBeef> `yourSym.eqIdent(procDef[0].baseName)` |
05:48:23 | FromDiscord | <Rika> Which is still technically a string comparison I believe |
05:48:26 | FromDiscord | <ElegantBeef> Yea |
05:48:33 | FromDiscord | <ElegantBeef> But i just assumed they meant explicit |
05:48:56 | FromDiscord | <garett> Does it resolve ambiguity wrt same name in different modules? |
05:48:57 | FromDiscord | <ElegantBeef> If you want to see if a sym is a procedure `getImpl` and see if it's the same |
05:49:26 | FromDiscord | <ElegantBeef> I dont think it's possible for the macro system to distinguish between two identical procedures |
05:49:46 | FromDiscord | <ElegantBeef> Name, arguements, implementation... |
05:50:21 | FromDiscord | <ElegantBeef> Rika you best correct my seplling there i know i did it again |
05:50:27 | FromDiscord | <ElegantBeef> (edit) "seplling" => "spelling" |
05:50:44 | saem | What's wrong with your smelling? |
05:51:07 | FromDiscord | <ElegantBeef> With a nose as large as mine i'd hope nothing |
05:51:08 | FromDiscord | <garett> In your example `procDef[0]` is explicitly dereferencing the proc as a pointer to call baseName? |
05:51:37 | FromDiscord | <ElegantBeef> no, it's accessing the name identifier from the proc definition |
05:51:46 | FromDiscord | <garett> Gotcha |
05:52:18 | FromDiscord | <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:41 | FromDiscord | <treeform> In reply to @Varriount "Oh. I forgot to": Now they match? |
05:53:18 | FromDiscord | <garett> Thanks, beef, thatâs a pro tip |
05:53:20 | FromDiscord | <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:57 | saem | Old ones yes, the example uses stack for example |
05:54:13 | saem | I don't know new concepts at all. |
05:54:43 | FromDiscord | <garett> @treeform you have some great Nim repos. I forked your staticglfw and upgraded to latest glfw version |
05:54:47 | FromDiscord | <ElegantBeef> The example from the experimental manual? |
05:55:12 | FromDiscord | <ElegantBeef> Dont encourage treeform, if he doesnt get noticed he might make even cooler libraries to get noticed đ |
05:55:23 | FromDiscord | <treeform> In reply to @garett "<@107140179025735680> you have some": Cool I should do that too. |
05:56:13 | FromDiscord | <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:11 | saem | Beef, yeah the one from the experimental section of the manual. |
05:57:54 | FromDiscord | <garett> https://github.com/garettbass/glfw.nim |
06:01:24 | FromDiscord | <garett> I wanted the gamepad api |
06:05:54 | FromDiscord | <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:19 | FromDiscord | <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:04 | FromDiscord | <Rika> In reply to @ElegantBeef "Name, arguements, implementation...": arguments |
06:08:09 | FromDiscord | <ElegantBeef> Thanks |
06:11:06 | saem | Oh, 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:35 | saem | Although, 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:07 | FromDiscord | <ElegantBeef> Yea i can implement my own checking if i want, but for now we're doing comments explanation |
06:12:51 | FromDiscord | <ElegantBeef> I was hoping i could limit it with a concept just to save me train cells and make it more friendly |
06:18:05 | saem | Hmm, does Nim have a concept of a bottom type, because an unbound parameter being bottom would make sense. |
06:19:03 | FromDiscord | <ElegantBeef> I dont know, also decided to go back to the concepts just replace the type instantiation đ |
06:19:30 | FromDiscord | <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:33 | saem | Yeah, 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:07 | FromDiscord | <ElegantBeef> @Varriount and now like that i support changing the backing cache |
06:59:49 | FromDiscord | <ElegantBeef> Docs are updated to showcase that đ |
07:08:47 | FromDiscord | <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:52 | FromDiscord | <ElegantBeef> I see pmunch posting on the forum that means he's alive đ |
07:27:02 | PMunch | You thought I was dead? |
07:27:19 | FromDiscord | <ElegantBeef> No just using alive as in awake |
07:27:26 | PMunch | Ah :P |
07:27:33 | PMunch | Yes I'm awake, but barely :P |
07:27:42 | FromDiscord | <Rika> so barely alive, gotcha |
07:28:31 | FromDiscord | <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:46 | PMunch | Who, me? |
07:29:51 | FromDiscord | <ElegantBeef> yeaa |
07:30:09 | FromDiscord | <Rika> humi |
07:30:41 | PMunch | I ended up writing my own cache library :P |
07:31:09 | FromDiscord | <ElegantBeef> Yea i just made this over the past few days for fun due to varriount mentioning caching đ |
07:31:39 | PMunch | Ah, here we go: https://github.com/PMunch/nim-cache |
07:31:48 | FromDiscord | <zidsal> Mum says it's my time to write a caching Library! |
07:31:56 | FromDiscord | <ElegantBeef> lol |
07:32:42 | FromDiscord | <zidsal> (edit) "time" => "turn" |
07:32:49 | FromDiscord | <ElegantBeef> I guess i should make it so users can make a lambda'd cached procedure |
07:33:01 | FromDiscord | <ElegantBeef> Nah zidsal mine is the bestm purely cause of the name |
07:33:03 | FromDiscord | <ElegantBeef> (edit) "bestm" => "best," |
07:33:51 | PMunch | "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:23 | FromDiscord | <Rika> god damn it why is everyone making the stuff ive been planning to make |
07:34:24 | FromDiscord | <ElegantBeef> Had too much fun with the name + readme |
07:34:40 | FromDiscord | <ElegantBeef> Rika got anything else you want to make? |
07:34:43 | FromDiscord | <ElegantBeef> Can save you some work |
07:34:54 | FromDiscord | <Rika> eat a uranium pellet |
07:35:04 | FromDiscord | <ElegantBeef> Well i was going to anyway, but i'm not russian |
07:35:31 | FromDiscord | <zidsal> I heard rika wants to make a mmorpg wow killer, so get writing and don't forget to open source it |
07:35:32 | FromDiscord | <Rika> i make stuff no one uses :pain: |
07:36:10 | FromDiscord | <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:00 | FromDiscord | <zidsal> Don't forget to co-credit rika so that he can claim half s Turing award |
07:37:10 | FromDiscord | <zidsal> (edit) "s" => "a" |
07:37:18 | FromDiscord | <Rika> lmao |
07:38:39 | FromDiscord | <ElegantBeef> Ah yea my halting problem solver is inside a filing cabinet over here, give me a second to find it |
07:38:56 | FromDiscord | <ElegantBeef> It's just a single not that says "Dont fucking write code, problem solved" |
07:39:01 | FromDiscord | <ElegantBeef> (edit) "not" => "note" |
07:39:05 | FromDiscord | <Rika> really tho i probably have an advertising issue regarding my packages |
07:39:14 | FromDiscord | <zidsal> That sounds like my day job as a programmer |
07:39:37 | FromDiscord | <ElegantBeef> Eh people dont really use mine either considering the issues i get |
07:39:45 | FromDiscord | <Rika> you get issues? |
07:39:52 | FromDiscord | <ElegantBeef> Nope |
07:40:02 | FromDiscord | <zidsal> I thought his code was infallible |
07:40:09 | FromDiscord | <ElegantBeef> Either my software is flawless or people dont use it |
07:40:31 | FromDiscord | <Rika> > your softwareâ”> flawlessâ”literal impossibility |
07:40:46 | FromDiscord | <ElegantBeef> I'm a fuckwit so clearly that's not the case |
07:46:25 | FromDiscord | <ElegantBeef> Do wonder if i can implement more flags for behaviour but cannot think of nay atm |
07:47:40 | FromDiscord | <Rika> nay |
07:47:55 | FromDiscord | <ElegantBeef> nay any yan one of the three |
07:49:05 | FromDiscord | <ElegantBeef> You know rika we could work together on making the bestest library ever that no one uses |
07:49:29 | FromDiscord | <Rika> poggers |
07:53:41 | FromDiscord | <ElegantBeef> For those just tuning in that's Rika laughing at the idea of working with me |
07:54:08 | FromDiscord | <Rika> man doesnt know what poggers means |
07:54:44 | FromDiscord | <ElegantBeef> I was using it for more self deprecating humour, but I am like 9000 years old |
07:59:44 | FromDiscord | <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:56 | FromDiscord | <Varriount> (in your cache implemention) |
08:01:10 | FromDiscord | <ElegantBeef> It might be possible, but i try to use quoting as much as possible |
08:02:26 | FromDiscord | <ElegantBeef> I suppose i need to document it more anyway, but what's your issue with it |
08:04:41 | FromDiscord | <Varriount> Nothing in particular. I just dislike manual AST manipulation in general. I want some magically better way. |
08:05:15 | FromDiscord | <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:57 | FromDiscord | <ElegantBeef> Though i think there exist better quoting, but i'm uncertain |
08:06:46 | FromDiscord | <ElegantBeef> Like pmunch's `macroutils.superquote` |
08:08:23 | PMunch | superquote is basically just a wrapper around quote that does a little bit of transformation |
08:09:44 | FromDiscord | <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:45 | FromDiscord | <ElegantBeef> Yea that's my point it better handles things like `x[0]` |
08:10:46 | FromDiscord | <Varriount> PMunch: In my opinion, quote should do what your super quote does. |
08:10:46 | FromDiscord | <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:13 | FromDiscord | <Varriount> accQuoted? Can you give an example? |
08:11:18 | PMunch | @Varriount, I agree :) |
08:11:33 | PMunch | Those are the backticks |
08:11:50 | FromDiscord | <ElegantBeef> I also think i agree that it should |
08:11:59 | PMunch | Everything within backticks in a Nim macro is just treated as a string |
08:12:50 | FromDiscord | <Varriount> By cache, you mean assign to a variable within the macro? Because quote doesn't support arbitrary expressions? |
08:12:58 | FromDiscord | <ElegantBeef> yea |
08:14:37 | FromDiscord | <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:41 | PMunch | Basically 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:56 | PMunch | I totally agree, which is why I wrote macroutils |
08:15:05 | PMunch | Unfortunately I keep forget to use it myself :P |
08:15:17 | * | mahlon quit (Ping timeout: 260 seconds) |
08:15:35 | FromDiscord | <ElegantBeef> And i just dont use it for the same reason, just rely on what i know đ |
08:16:08 | PMunch | I mean it's easy if you know macros to begin with :P |
08:16:13 | PMunch | Which is also why I don't use it |
08:16:21 | PMunch | Because I'd have to re-learn how to write them :P |
08:16:52 | FromDiscord | <ElegantBeef> I've written enough macros for procdefs i pretty much know the AST like the back of my hand |
08:16:59 | FromDiscord | <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:23 | FromDiscord | <ElegantBeef> Eh the hardest part about macros is understanding the AST imo |
08:17:37 | FromDiscord | <ElegantBeef> Once you learn the AST you're pretty much a macro god |
08:18:02 | FromDiscord | <Varriount> Doesn't make them any less tedious to read or write. |
08:18:03 | * | mahlon joined #nim |
08:18:31 | FromDiscord | <ElegantBeef> I dont find them tedious to write, quite fun |
08:18:40 | FromDiscord | <ElegantBeef> (edit) "I dont find them tedious to write, quite fun ... " added "actually" |
08:18:45 | PMunch | Well, once you get used to using quote it's a bit easier |
08:21:17 | FromDiscord | <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:05 | FromDiscord | <ElegantBeef> it'd turn into `result = lambdaName([a, b, c...])` |
08:22:24 | PMunch | Mm, I don't think superQuote will help you there either unfortunately.. |
08:22:36 | PMunch | It could be expanded to though |
08:23:08 | FromDiscord | <ElegantBeef> Yea, simply look up symbol/type and if it's a seq unpack it |
08:23:17 | PMunch | Adopt similar syntax to what I have in expand |
08:23:34 | PMunch | Well, that would mean you would have to know what kind of AST the user wanted to create |
08:23:45 | PMunch | It could be that they are creating AST to be parsed by another macro |
08:23:58 | PMunch | In which case it might not expect the same node types as normal AST |
08:24:10 | FromDiscord | <ElegantBeef> I suppose |
08:24:38 | PMunch | But you could have it like `result = lambdaName(\`params*\`)` like I do for expand |
08:25:43 | FromDiscord | <ElegantBeef> Discord made a dogs breakfast of that |
08:26:24 | PMunch | Haha, I was afraid it might :P |
08:26:27 | PMunch | I even tried my best to escape the inner quotes for you guys.. |
08:26:41 | FromDiscord | <ElegantBeef> Yea yea an escape sequence |
08:27:05 | FromDiscord | <ElegantBeef> Anywho, i'll see about cleaning it up to appeal to your human side varriount |
08:27:23 | FromDiscord | <ElegantBeef> Also realized another option of `clearAfterRun` |
08:27:51 | FromDiscord | <ElegantBeef> Lets you get super fast calculations with very little permanently used memory |
08:28:16 | FromDiscord | <ElegantBeef> Also pmunch i was meaning to ask can a LRU cache actually match the concept signature? |
08:28:36 | FromDiscord | <ElegantBeef> I havent looked at how they're meant to be used so dont actually know if this is generic enough |
08:28:59 | PMunch | What do you mean? |
08:29:15 | FromDiscord | <ElegantBeef> https://github.com/beef331/kashae#implementation-details |
08:29:33 | FromDiscord | <ElegantBeef> I support user defined caches and that's the concept i |
08:29:37 | FromDiscord | <ElegantBeef> (edit) "i" => "i'm presently using" |
08:31:20 | PMunch | Wait, how does this work `c[a] = K` |
08:31:46 | FromDiscord | <ElegantBeef> It's for assignment of a `K` type |
08:31:52 | FromDiscord | <ElegantBeef> Oh wait |
08:31:54 | PMunch | But what did you mean by can a LRU cache match? |
08:31:56 | FromDiscord | <ElegantBeef> That's supposed to be V |
08:32:05 | PMunch | Yeah that's what I thought :P |
08:32:46 | FromDiscord | <ElegantBeef> Is a LRU cache reasonably capable of falling under that concept |
08:33:03 | PMunch | Why wouldn't it be? |
08:33:34 | FromDiscord | <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:04 | FromDiscord | <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:08 | PMunch | Well a LRU cache is just a cache that when filled up will evict the least recently used element |
08:36:47 | FromDiscord | <ElegantBeef> Well that's good to hear then |
08:43:15 | FromDiscord | <Varriount> In reply to @ElegantBeef "I was just curious,": I recommend looking at the Python implementation |
08:44:09 | FromDiscord | <ElegantBeef> Might be worth while but need to punch my eyes a bit to make the code blurry |
08:45:38 | FromDiscord | <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:06 | FromDiscord | <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:14 | FromDiscord | <ElegantBeef> And now the macro is superbly documented and everyone will be happy đ |
08:49:34 | Arrrrrrrr | Good night nimmics |
08:49:55 | FromDiscord | <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:16 | PMunch | "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:43 | FromDiscord | <Varriount> Why does it require semicolons, if 95% of the time, they end up right next to line breaks? |
09:12:04 | PMunch | Mhm |
09:12:38 | PMunch | And 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:37 | Arrrrrrrr | Why do I work if I will die anyway? |
09:15:27 | FromDiscord | <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:05 | FromDiscord | <Varriount> Go does that too, if I recall correctly. |
09:18:19 | FromDiscord | <Varriount> I've no idea why other languages didn't do it. It's not that hard to implement. |
09:18:58 | FromDiscord | <ElegantBeef> C# just glues more mess on their code, they still dont support block expressions |
09:20:18 | FromDiscord | <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:42 | FromDiscord | <neow> In reply to @Varriount "Why does it require": the semicolons are maybe needed to avoid ambiguity |
11:02:14 | ForumUpdaterBot | New Nimble package! interface_implements - implements macro creates toInterface proc., see https://github.com/itsumura-h/nim-interface-implements |
11:08:03 | FromDiscord | <Rika> In reply to @neow "the semicolons are maybe": needed only sometimes is the point |
11:08:20 | FromDiscord | <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:12 | ForumUpdaterBot | New 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:08 | Zoom[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:00 | PMunch | I think it's dom96 yeah |
12:53:32 | * | sacredfrog joined #nim |
12:53:35 | FromDiscord | <zetashift> https://github.com/nim-lang/nimforum open an issue! |
12:56:09 | Zoom[m] | Don't want to spam the forums trying to reproduce it :P |
12:57:58 | FromDiscord | <zetashift> you can quickly run a dev forum and spam there haha |
13:00:33 | Zoom[m] | I knew someone would suggest that! You overestimate my proficiency and underestimate my laziness. |
13:01:19 | PMunch | Ugh, of course strings in C# are UTF16, because Microsoft.. |
13:02:55 | Clonkk[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:07 | Clonkk[m] | > <@freenode_FromDiscord:matrix.org> <zetashift> https://github.com/nim-lang/nimforum open an issue! |
13:03:07 | Clonkk[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:19 | FromDiscord | <Yardanico> to be fair the server backend is much more lighter |
13:03:23 | FromDiscord | <Yardanico> of nimforum compared to discourse |
13:03:38 | PMunch | It is kinda cool to have it built in Nim |
13:04:05 | PMunch | But it should probably get some love to make it more reliable so that newcomers don't get a bad first impression |
13:04:51 | FromDiscord | <Yardanico> but also, nimforum is actually older than discourse :P the modern version ("nimforum v2") is younger though, yes |
13:05:19 | FromDiscord | <Yardanico> example snapshot from 2012 http://web.archive.org/web/20120530061632/http://forum.nimrod-code.org/ |
13:07:13 | Zoom[m] | Dunno, I like it, it feels snappy. |
13:09:24 | FromDiscord | <willyboar> I agree with PMunch. Someone have to give it some love. |
13:09:43 | Zoom[m] | Also, I think some risks of making a poor first impression are offset by good impression of dogfooding. |
13:10:56 | FromDiscord | <Yardanico> current nimforum is a decent example of a SPA done in nim (frontend side) :) |
13:11:05 | FromDiscord | <Yardanico> not even talking about the backend |
13:11:33 | Zoom[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:08 | PMunch | Ooh, most definitely |
13:13:01 | PMunch | Why can't Nim get a mysterious benefactor so they can hire me to just create tutorials, libraries, and such all day long.. |
13:13:41 | FromDiscord | <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:26 | Zoom[m] | Was the mysterious benefactor who donated some BTC found? đ€š |
13:18:36 | Zoom[m] | @ajusa, that's cool. Subscribed for proofreading. |
13:18:52 | FromDiscord | <Technisha> :p |
13:19:05 | FromDiscord | <Mina Ashido]|[đ»â> I'm still Technisha btw |
13:25:39 | FromDiscord | <hamidb80> does anyone know how screen recorders work? |
13:25:55 | FromDiscord | <hamidb80> i use this code to take screenshot;â”https://gist.github.com/treeform/782149b5fc938753feacfca43637aa90 |
13:26:13 | FromDiscord | <hamidb80> it take almost `0.15s` to take a screenshot in my PC |
13:26:17 | FromDiscord | <hamidb80> (edit) "take" => "takes" |
13:26:44 | FromDiscord | <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:44 | Oddmonger | maybe they can export at 60fps, but not necessarily taken on a real second (it could have take 1.2 second for example) |
13:33:35 | FromDiscord | <Rika> wdym |
13:34:15 | FromDiscord | <Yardanico> In reply to @hamidb80 "how do they achieve": you just capture images of the screen 60 times a second :) |
13:34:30 | Oddmonger | if 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:34 | FromDiscord | <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:23 | FromDiscord | <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:34 | FromDiscord | <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:54 | FromDiscord | <Yardanico> but generally 60fps is the standard, almost no one records at a higher FPS for youtube or other services |
13:36:13 | FromDiscord | <Yardanico> i mean for more "professional" videos and stuff, of course 30fps videos are much more common still |
13:36:31 | FromDiscord | <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:53 | Oddmonger | i don't even dare to imagine doing this with Xorg |
13:39:13 | FromDiscord | <Yardanico> it has an API for that too |
13:39:42 | Oddmonger | isn't it a framebuffer slow as hell ? |
13:39:49 | FromDiscord | <Yardanico> huh? |
13:40:31 | FromDiscord | <Yardanico> but generally to check best (or almost best) ways to record you should check out obs' source code :) |
13:47:16 | FromDiscord | <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:42 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3mzQ |
13:48:19 | FromDiscord | <haxscramper> Templating engine in addition to docgen-as-a-library of course |
13:50:23 | FromDiscord | <haxscramper> And XML/JSON/sqlite export for documentation |
13:52:30 | * | wasted_youth2 joined #nim |
13:57:36 | FromDiscord | <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:25 | FromDiscord | <Yardanico> that should work, at least the example in the readme says so |
14:00:14 | FromDiscord | <Yardanico> is that --flag the last in your command-line call? |
14:00:17 | FromDiscord | <ajusa> `proc main(firstList = newSeq[string](), secondList: seq[string]) =` this is the exact signature of my proc |
14:01:07 | FromDiscord | <Yardanico> @ajusa from DETAILS of cligen: "Zero or 1 params has type seq[T] to catch optional positional args." |
14:01:14 | FromDiscord | <Yardanico> ah, that's not really related |
14:01:19 | FromDiscord | <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:49 | FromDiscord | <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:19 | FromDiscord | <creonico> How can I import a typedef struct from C, and rename it and its fields in Nim |
14:46:30 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3mA5 |
14:46:42 | FromDiscord | <haxscramper> for `typedef struct {...} CStruct` |
14:58:06 | * | johannes_ quit (Ping timeout: 265 seconds) |
15:01:36 | FromDiscord | <creonico> It gives me an error saying of unknown type name |
15:01:41 | FromDiscord | <creonico> (edit) removed "saying" |
15:22:38 | * | Gustavo6046 joined #nim |
15:22:48 | FromDiscord | <haxscramper> Can you show the C code, nim code and error? Or put example on playground. |
15:23:40 | FromDiscord | <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:18 | FromDiscord | <creonico> https://play.nim-lang.org/#ix=3mAy |
15:39:43 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3mAA |
15:40:14 | FromDiscord | <haxscramper> Removing field that uses it (and types in C code that were not available) now everything compiles |
15:48:59 | FromDiscord | <creonico> how would I also wrap `WNDPROC` ._. |
15:49:53 | FromDiscord | <Rika> The same way you wrapped window class? |
15:51:52 | FromDiscord | <haxscramper> In reply to @creonico "how would I also": this is a typedef'ed callback? |
15:52:16 | FromDiscord | <haxscramper> Use `type WNDPROC = proc(a: cint, <other arguments>) {.cdecl.}` |
15:53:16 | FromDiscord | <haxscramper> btw there is a windows API wrapper https://github.com/khchen/winim |
15:53:21 | FromDiscord | <creonico> can you explain what `a:cint` is and the `cdecl` pragma |
15:53:31 | FromDiscord | <creonico> I know, I just want to learn this before using it |
15:54:08 | FromDiscord | <haxscramper> https://github.com/khchen/winim/blob/bffaf742b4603d1f675b4558d250d5bfeb8b6630/winim/inc/winuser.nim#L171 |
15:54:27 | FromDiscord | <haxscramper> In reply to @creonico "can you explain what": https://nim-lang.org/docs/manual.html#types-procedural-type |
15:54:52 | FromDiscord | <haxscramper> https://nim-lang.org/docs/system.html#cint |
16:00:14 | * | jaens[m] quit (Quit: Idle for 30+ days) |
16:04:54 | FromDiscord | <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:24 | FromDiscord | <haxscramper> `WNDPROC` is a type, `importc` on procedure means that you import C function |
16:10:50 | FromDiscord | <haxscramper> so you need to declare `windproc` as a procedural type with `.cdecl.` calling convention |
16:11:23 | FromDiscord | <haxscramper> `.importc` for `proc` is needed if you had something like `void concreteWinProcImplementation() { ... }` in C and wanted to use it in nim |
16:11:46 | FromDiscord | <haxscramper> Then, you could do `proc concreteWinProcImplementation() {.importc: "concreteWinProcImplementation".}` |
16:11:57 | FromDiscord | <haxscramper> but not when declaring type |
16:13:03 | FromDiscord | <haxscramper> Also use `cint` instead of `int` as latter one is not guaranteed to have the same type as `C`'s `int` |
16:13:12 | FromDiscord | <haxscramper> !eval echo sizeof(int) == sizeof(cint) |
16:13:15 | NimBot | false |
16:13:26 | FromDiscord | <haxscramper> smae size |
16:13:28 | FromDiscord | <haxscramper> (edit) "smae" => "same" |
16:15:23 | FromDiscord | <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:52 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/87D |
16:17:56 | FromDiscord | <haxscramper> so of course it does not work, it is a simple type mismatch |
16:18:59 | FromDiscord | <haxscramper> And I believe you need to annotate the proc you are passing as callback with `{.cdecl.}` as well |
16:29:03 | FromGitter | <awr1> @creonico please use winim or winlean |
16:29:52 | FromGitter | <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:07 | FromGitter | <awr1> e.g. @creonico https://play.nim-lang.org/#ix=3mAU |
16:43:52 | FromGitter | <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:02 | FromGitter | <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:10 | FromGitter | <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:54 | FromGitter | <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:54 | FromDiscord | <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:49 | FromDiscord | <creonico> I can't seem to use nimbleâ”`nimble install winimâ”bash: nimble: command not found` |
17:27:27 | FromDiscord | <creonico> Even though when I run `finish` from the nim install, it says that its on my path |
17:28:24 | FromGitter | <awr1> @ayy lmao |
17:28:31 | FromGitter | <awr1> a) launch the exe from console, instead of via explorer |
17:28:38 | FromGitter | <awr1> b) compile with --app:gui - stack traceback window will pop up instead |
17:28:43 | FromGitter | <awr1> c) wrap your program with try/except or modify globalRaiseHook to handle your exceptions in a different way |
17:28:50 | FromGitter | <awr1> any of these methods will work |
17:30:23 | FromGitter | <awr1> @creonico what's in your nim/bin folder |
17:31:24 | FromDiscord | <creonico> lots of things ._.â”not nimble though |
17:32:54 | FromDiscord | <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:58 | FromGitter | <awr1> @creonico go to nim root folder, do `koch nimble` |
17:52:11 | * | tane quit (Quit: Leaving) |
17:54:15 | FromDiscord | <creonico> `Error: unhandled exception: The system cannot find the file specified.` |
17:54:51 | * | tane joined #nim |
17:55:50 | FromGitter | <awr1> what are you using to get nim |
17:56:27 | FromGitter | <awr1> are you building from the nim git repo |
17:56:49 | FromGitter | <awr1> or did you use the zip from the nim website |
17:57:33 | FromDiscord | <creonico> the zip from the website |
17:58:14 | FromGitter | <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:16 | FromGitter | <awr1> but lemme see |
17:59:00 | FromDiscord | <creonico> I did download choosenim |
17:59:12 | FromDiscord | <creonico> but i get this when I run the runme.bat file |
17:59:24 | FromGitter | <awr1> use the github releases |
17:59:29 | FromGitter | <awr1> for choosenim |
17:59:35 | FromDiscord | <creonico> sent a long message, see http://ix.io/3mBf |
17:59:35 | FromDiscord | <creonico> I did |
17:59:50 | FromGitter | <awr1> also I just downloaded the nim zip, i see nimble.exe in there |
18:00:43 | FromGitter | <awr1> no i mean don't use runme.bat, just use the .exe version |
18:00:56 | FromGitter | <awr1> the readme should be changed |
18:01:51 | FromGitter | <awr1> and then use like `choosenim install stable` or whatever |
18:02:37 | FromDiscord | <creonico> where is the choosenim exe? |
18:03:13 | FromGitter | <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:31 | FromGitter | <awr1> do `choosenim stable --firstInstall` |
18:03:47 | FromGitter | <awr1> actually i don't really see why runme.bat would fail |
18:03:54 | FromGitter | <awr1> did you extract the whole zip? |
18:09:38 | FromDiscord | <creonico> yes |
18:10:02 | FromDiscord | <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:03 | FromGitter | <awr1> remove the existing nim installation from your path, delete the .choosenim folder |
18:15:21 | FromDiscord | <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:24 | FromDiscord | <dom96> wow, cool that we get this as a OS error message |
18:21:46 | FromDiscord | <dom96> it's a false positive btw |
18:23:10 | FromDiscord | <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:10 | Prestige | Can 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:47 | FromGitter | <awr1> what can we do about the false positive thing? does getting executables signed help? |
18:57:10 | FromGitter | <awr1> @creonico whitelist the .choosenim directory in windows defender |
19:09:26 | FromDiscord | <hamidb80> In reply to @creonico "Everytime I try to": oh 10054 ? |
19:09:42 | FromDiscord | <hamidb80> it's a error number |
19:09:47 | FromDiscord | <hamidb80> (edit) "a" => "an" |
19:10:51 | FromDiscord | <hamidb80> (edit) "oh" => "do you get error number" |
19:18:15 | FromDiscord | <creonico> It doesn't say |
19:20:13 | * | lritter quit (Ping timeout: 252 seconds) |
19:30:38 | FromDiscord | <hamidb80> https://github.com/miere43/autome |
19:31:04 | FromDiscord | <hamidb80> the last commit is from 2016 |
20:04:15 | * | Vladar quit (Quit: Leaving) |
20:14:03 | FromDiscord | <dilawar> How to get a buffer from struct? See the following C code: |
20:15:11 | FromDiscord | <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:33 | FromDiscord | <ElegantBeef> What do you mean "buffer" |
20:16:48 | FromDiscord | <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:09 | FromDiscord | <dilawar> (edit) "Struct" => "A struct" |
20:17:11 | FromDiscord | <ElegantBeef> Ah you just want to write a struct to a file practically |
20:17:55 | FromDiscord | <ElegantBeef> `writeBuffer(sock, struct.add, sizeOf(struct.type))` |
20:17:58 | FromDiscord | <ElegantBeef> (edit) "struct.add," => "struct.addr," |
20:20:07 | FromDiscord | <ElegantBeef> Dont recall if sockets are considered files, so might have to change that a bit |
20:21:09 | FromDiscord | <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:44 | FromDiscord | <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:18 | FromDiscord | <dilawar> (edit) "``addr``." => "\`addr\`." |
20:22:26 | FromDiscord | <ElegantBeef> Should be able to do do `system.addr struct` |
20:24:21 | * | narimiran quit (Ping timeout: 265 seconds) |
20:24:35 | FromDiscord | <dilawar> In reply to @ElegantBeef "Should be able to": Thank you, Sir. I am back on track. Much appreciate the help đ |
20:29:42 | FromDiscord | <ajusa> There are also socket streams, not sure if they are in 1.4 though |
20:30:12 | FromDiscord | <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:49 | FromDiscord | <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:51 | FromDiscord | <krisppurg> (edit) "why, but I" => "why.â”â”I" | "threads. Same" => "threads.â”Same" | "MessageTypes, where" => "`MessageType`," | "type," => "type (before I implemented slash commands)," |
20:42:23 | FromDiscord | <ElegantBeef> So time for named constants like it's C? đ |
20:51:03 | FromDiscord | <dilawar> sent a code paste, see https://play.nim-lang.org/#ix=3mC3 |
20:51:56 | FromDiscord | <dilawar> (edit) "https://play.nim-lang.org/#ix=3mC3" => "https://paste.rs/KE8" |
20:53:42 | FromDiscord | <ElegantBeef> `a[0].addr` |
20:54:28 | FromDiscord | <ElegantBeef> Nim's strings are pointers to `len, capacity, ptr data` so you need to get the first element |
20:55:53 | FromDiscord | <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:19 | FromDiscord | <ElegantBeef> `let b = cast[ptr array[16, uint8]](a[0].unsafeAddr)[]` |
20:58:18 | FromDiscord | <dilawar> Worked `[49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 53, 0, 0, 0, 0, 0]` |
20:58:47 | FromDiscord | <dilawar> Any page in manual which I can read to understand this? |
20:59:51 | FromDiscord | <ElegantBeef> unsafeAddr is a `ptr char` you cast that to a `ptr array[16, uint8]` then dereference it with `[]` |
21:00:07 | FromDiscord | <ElegantBeef> Pretty much ally you need, documentation doesnt help here afaik |
21:00:45 | FromDiscord | <dilawar> I don't understand why previous one didn't work when I used `a[0].addr` |
21:01:12 | FromDiscord | <ElegantBeef> you didnt cast it to a `ptr array` |
21:01:50 | FromDiscord | <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:38 | FromDiscord | <Esther> Q on that topic - do let variables always have addresses? |
23:38:25 | * | garFF quit (Read error: Connection reset by peer) |
23:40:05 | FromDiscord | <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:07 | FromDiscord | <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:46 | FromDiscord | <zetashift> Like https://nim-lang.org/docs/system.html#addr,T you mean? |
23:50:07 | FromDiscord | <exelotl> I believe let variables do always have addresses |