00:00:27 | FromDiscord | <ShalokShalom> Oh, that is great |
00:01:09 | FromDiscord | <ShalokShalom> Matrix bridges are the best |
00:01:42 | FromDiscord | <ShalokShalom> If its good for anything, then for that |
00:02:51 | FromDiscord | <ShalokShalom> I guess they cant prevent it technically |
00:03:17 | FromDiscord | <ShalokShalom> Since they want the API for other bot stuff |
00:04:03 | FromDiscord | <Elegantbeef> Yea can even send SMS/Email through matrix bots đ |
00:04:20 | FromDiscord | <Elegantbeef> It's got quite good capabilities \:D |
00:05:25 | FromDiscord | <undel> In reply to @ShalokShalom "Typical open source fashion": Situation: there are now 15 competing standards |
00:07:27 | * | ehmry joined #nim |
00:08:55 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4juH |
00:08:56 | FromDiscord | <albassort> what do you think of my use of block |
00:09:28 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#ix=4juH" => "https://paste.rs/A4e" |
00:10:11 | FromDiscord | <Rika> Makes no sense because youâre not breaking out of any sort of outer loop |
00:10:20 | FromDiscord | <Rika> Thereâs only one loop to break out of |
00:10:57 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4juI |
00:11:07 | FromDiscord | <albassort> ok i just wanna use block-break because its cool |
00:11:31 | FromDiscord | <Rika> Okay |
00:11:33 | FromDiscord | <Rika> You do you |
00:11:38 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#ix=4juI" => "https://play.nim-lang.org/#ix=4juJ" |
00:12:03 | FromDiscord | <albassort> judging by your reaction you actually meanâ”"Don't do you, thats fucking stupid" |
00:12:42 | FromDiscord | <Rika> Feel free to interpret what I say like that |
00:12:47 | FromDiscord | <Rika> Just donât say that itâs what I said |
00:13:25 | FromDiscord | <albassort> I can see block being used to break out of nested if statements |
00:13:43 | FromDiscord | <albassort> it can be used anyway you wish for it to |
00:13:57 | FromDiscord | <albassort> if it was only for loops they would have stopped its use outside of a loop |
00:14:01 | FromDiscord | <Rika> In reply to @albassort "I can see block": Sure |
00:14:11 | FromDiscord | <albassort> but my code has no use for it here |
00:14:15 | FromDiscord | <albassort> so im gonna do it the normal way |
00:14:19 | FromDiscord | <Rika> But the way you used it doesnât have anything to apply |
00:14:43 | FromDiscord | <albassort> if there was another branch to spontaneously switch to |
00:14:51 | FromDiscord | <albassort> idk |
00:15:09 | FromDiscord | <Rika> What? |
00:16:16 | FromDiscord | <albassort> don't you what me you sussy baka |
00:20:28 | FromDiscord | <ali> Merry Christmas y'all đ British time anyways |
00:21:54 | FromDiscord | <albassort> :) |
00:28:32 | FromDiscord | <System64 ~ Flandre Scarlet> Hiâ”https://github.com/Niminem/Neelâ”Can it work with a JS Framework like Angular? |
00:31:54 | FromDiscord | <Elegantbeef> Probably |
00:33:17 | FromDiscord | <System64 ~ Flandre Scarlet> Oh my god, I probably found the Graal?!â”I hate Electron because how heavy it is |
00:35:41 | FromDiscord | <Elegantbeef> https://github.com/juancarlospaco/webgui and friends do exist |
00:39:16 | FromDiscord | <System64 ~ Flandre Scarlet> Oh niceâ”If both supports JS Frameworks and NodeJS, it would be so nice! |
00:59:50 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "https://github.com/juancarlospaco/webgui and friend": Do I assume correctly that this has no search functionally |
00:59:58 | FromDiscord | <ShalokShalom> I looked into the docs |
01:01:51 | FromDiscord | <ShalokShalom> I look for something that runs on Linux and provides a search box and dynamic updating of the content based on the search results :nimGlow: |
01:02:35 | FromDiscord | <Elegantbeef> I toyed with webgui briefly it had a terrible interop afaik |
01:02:54 | FromDiscord | <ShalokShalom> I see |
01:03:17 | FromDiscord | <ShalokShalom> Do you know any toolkit, that can do this |
01:03:43 | FromDiscord | <Elegantbeef> I've used owlkettle for something similar |
01:03:50 | FromDiscord | <ShalokShalom> Thanks |
01:04:07 | FromDiscord | <Elegantbeef> Infact there is an app launcher example |
01:04:55 | FromDiscord | <ShalokShalom> Hnn |
01:05:09 | FromDiscord | <ShalokShalom> Was just about asking you about your code |
01:05:50 | FromDiscord | <Elegantbeef> https://github.com/can-lehmann/owlkettle/blob/main/examples/apps/app_launcher.nim |
01:06:02 | FromDiscord | <Elegantbeef> Based off code i wrote but cah rewrote to fit the paradigm better |
01:07:32 | FromDiscord | <ShalokShalom> It looks really clean |
01:08:09 | FromDiscord | <ShalokShalom> That interface to GTK makes it a thousand times more approachable |
01:10:35 | FromDiscord | <ShalokShalom> I will try to build this app tomorrow |
01:10:53 | FromDiscord | <ShalokShalom> Or today, more precise |
01:11:06 | FromDiscord | <ShalokShalom> Looks really neat |
01:11:17 | FromDiscord | <Elegantbeef> Yea i liked owlkettle |
01:18:43 | FromDiscord | <System64 ~ Flandre Scarlet> I prefer designing GUIs with HTML / CSS / JS |
01:21:10 | FromDiscord | <Elegantbeef> I prefer not making GUI đ |
01:37:45 | FromDiscord | <Bung> searchbox that's just html input |
01:40:50 | FromDiscord | <Elegantbeef> Yea you could use webgui for that, i just didnt like how it did interop |
01:41:07 | FromDiscord | <Elegantbeef> You couldnt modify the HTML from the host afaict |
01:41:24 | FromDiscord | <Elegantbeef> I guess cannot modify the dom is more correct to say đ |
01:42:05 | FromDiscord | <Bung> dont know why you say cant modify the dom |
01:42:17 | FromDiscord | <Elegantbeef> How do you modify the dom with webgui? |
01:42:25 | FromDiscord | <Elegantbeef> I did not see anyway to |
01:42:36 | FromDiscord | <Bung> it's local html file, how cant you modify it |
01:43:03 | FromDiscord | <Elegantbeef> I was loading a html page, calling Nim code then wanting to display that result |
01:43:51 | FromDiscord | <Elegantbeef> There was no good way to mutate the dom, the only way you can interact with the dom is through their json interop bridge |
01:46:56 | FromDiscord | <Bung> I use something like this https://github.com/bung87/gamode/blob/main/src/gamode.nim#L154 |
01:47:34 | FromDiscord | <Elegantbeef> How does that relate to the webgui package? |
01:47:51 | FromDiscord | <sekao> sent a code paste, see https://play.nim-lang.org/#ix=4juT |
01:48:34 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/pull/21170 |
01:49:22 | FromDiscord | <Bung> it use modified webview.nim that handle load html string properly |
01:49:31 | FromDiscord | <sekao> In reply to @Elegantbeef "https://github.com/nim-lang/Nim/pull/21170": ah nice |
01:50:28 | FromDiscord | <Elegantbeef> Ok bung, but it's not like your sending runtime data to the html to update the page afaict |
01:52:11 | FromDiscord | <Bung> ok then |
02:03:28 | FromDiscord | <albassort> you guys ever have a #TODO and forget about it |
02:03:32 | FromDiscord | <albassort> then find it |
02:03:36 | FromDiscord | <albassort> and go "NOOOOOOO" |
02:47:25 | FromDiscord | <Rika> No |
02:47:37 | FromDiscord | <Rika> Why so dramatic about a forgotten todo I donât get it |
02:57:51 | madprops | because the software is bad |
03:00:42 | FromDiscord | <Bung> I guess just he write something todo he really dont want to do |
03:29:11 | FromDiscord | <Bung> look what I found https://github.com/kaitai-io/kaitai_struct |
03:30:07 | FromDiscord | <Elegantbeef> A general binary language interesting |
03:32:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/eUm |
03:35:00 | FromDiscord | <Bung> oh, I cant get the idea behind it, where the code come from? |
03:35:16 | FromDiscord | <Elegantbeef> https://github.com/kaitai-io/kaitai_struct_nim_runtime/tree/f5285907bea2f464bb9e3b7f9ee5ed12f14740e9 |
03:35:32 | FromDiscord | <Elegantbeef> It's really just a language agnostic variant of https://sealmove.github.io/binarylang/ |
03:35:38 | * | wallabra_ joined #nim |
03:38:35 | * | wallabra quit (Ping timeout: 264 seconds) |
03:38:36 | * | wallabra_ is now known as wallabra |
03:40:57 | FromDiscord | <Bung> I feel kaitai\_struct is more like unified apis handle binaray files |
03:41:19 | FromDiscord | <Elegantbeef> Afaict it just generates code that parses the data |
03:41:24 | FromDiscord | <Elegantbeef> So kinda |
04:07:06 | * | ltriant joined #nim |
04:12:38 | * | ltriant quit (Ping timeout: 272 seconds) |
04:16:19 | FromDiscord | <GalacticColourisation> hello |
04:16:26 | FromDiscord | <GalacticColourisation> merry cmris |
04:16:45 | FromDiscord | <Rika> đ |
04:24:05 | * | ltriant joined #nim |
04:30:19 | * | ltriant quit (Ping timeout: 260 seconds) |
04:38:59 | * | rockcavera joined #nim |
04:52:12 | * | tiorock joined #nim |
04:52:12 | * | tiorock quit (Changing host) |
04:52:12 | * | tiorock joined #nim |
04:52:12 | * | rockcavera is now known as Guest1976 |
04:52:12 | * | tiorock is now known as rockcavera |
04:56:15 | * | Guest1976 quit (Ping timeout: 265 seconds) |
05:16:20 | * | tiorock joined #nim |
05:16:20 | * | tiorock quit (Changing host) |
05:16:20 | * | tiorock joined #nim |
05:16:20 | * | rockcavera is now known as Guest2840 |
05:16:20 | * | Guest2840 quit (Killed (sodium.libera.chat (Nickname regained by services))) |
05:16:20 | * | tiorock is now known as rockcavera |
06:30:52 | * | Guest12 joined #nim |
06:34:41 | * | Guest12 quit (Client Quit) |
06:38:37 | FromDiscord | <ShalokShalom> @sekao thanks a ton |
06:38:40 | FromDiscord | <ShalokShalom> https://forum.nim-lang.org/t/9758#64240 |
06:39:46 | FromDiscord | <ShalokShalom> I was looking for proper persistent data structures for long :nimGlow: |
06:42:48 | FromDiscord | <ShalokShalom> Since initialized collections are recommended, why did you use the bulkier name on them? |
06:45:50 | FromDiscord | <ShalokShalom> Map[] definitely sounds like the defaultâ”And initMap like the special case |
06:46:16 | FromDiscord | <ShalokShalom> (edit) "initMap" => "initMap[]" | "initMap[]like the special case ... " added ":nimGlow:" |
06:47:45 | FromDiscord | <ShalokShalom> Does it sound sane to swap this around and spend the uninitialized collections a special name.. ? |
06:59:09 | * | wallabra_ joined #nim |
07:01:59 | * | wallabra quit (Ping timeout: 264 seconds) |
07:03:13 | * | wallabra joined #nim |
07:03:53 | * | wallabra_ quit (Ping timeout: 268 seconds) |
07:16:27 | * | tiorock joined #nim |
07:16:27 | * | tiorock quit (Changing host) |
07:16:27 | * | tiorock joined #nim |
07:16:27 | * | rockcavera is now known as Guest1374 |
07:16:27 | * | tiorock is now known as rockcavera |
07:19:28 | * | Guest1374 quit (Ping timeout: 272 seconds) |
08:38:10 | FromDiscord | <Phil> I feel like I remembered preludes incorrectly |
08:38:32 | FromDiscord | <Phil> I thought I could implicitly have everything in a prelude imported in every module file in a project |
08:38:52 | FromDiscord | <Phil> now I see it's just a convenience file with a bunch of import statements and no magic surrounding it whatsoever |
08:41:35 | FromDiscord | <Elegantbeef> you can do `--import:myFile` |
08:44:09 | FromDiscord | <Phil> Was going over the compiler flags just not just in case I'd forgotten it and found it.â”Seem like I mixed up prelude and the import flag in my mind |
09:00:24 | * | ltriant joined #nim |
09:04:40 | * | ltriant quit (Ping timeout: 252 seconds) |
09:19:06 | FromDiscord | <Mitja Felicijan> I am new to Nim. How would one return string or error if something goes wrong from a procedure? I am parsing some JSON and if fails I would like to return error so I can handle it later in the code. I tried Result and I keep getting errors that stuff is not defined even though I have imported system. |
09:19:27 | FromDiscord | <ezquerra> In reply to @Isofruit "now I see it's": What do you mean?â”I made a library called âbatteriesâ that is similar to prelude except that you can import it (instead of including it like prelude). It also imports more modules form the standard library |
09:19:43 | FromDiscord | <ezquerra> I wonder what additional kind of magic youâd like to get from such a library? |
09:20:52 | FromDiscord | <Phil> In reply to @ezquerra "What do you mean?": I mostly needed to know the mechanism because I intend to write a mini mocking lib based on the custom pragma beef gave me in offtopic.â”I basically want to annotate all exported procs in all modules of a project with said pragma and make sure that pragma is defined by having it auto-imported |
09:22:36 | om3ga | Mitja Felicijan, like in other languages, you should catch that errors, and return the integer code, or true/false with mutable function input parameter (string) to have string description of that error |
09:23:29 | om3ga | or handle the error with already made mechanisms, like strerror, or assertions |
09:24:24 | om3ga | use try-except constructs, there is many ways how to do that |
09:24:33 | FromDiscord | <Mitja Felicijan> I have the following procedure `proc requestAvailabilityInformation(url: string): Availability =`. I capture stuff inside with try/except. What I would like is to somehow return either Availability or nil or something like that. |
09:25:29 | om3ga | what type Availability is? |
09:25:38 | FromDiscord | <Mitja Felicijan> Its a struct. |
09:25:49 | FromDiscord | <Mitja Felicijan> So not an int, which would be acceptable with nil. |
09:27:37 | om3ga | or maybe object? you can move it to input parameter, maybe like thar : proc requestAvailabilityInformation(url: string, avail: var Availability): bool = |
09:27:44 | FromDiscord | <Mitja Felicijan> I was thinking maybe having a something like tuple for the response (Availability, err). Or something like that if that is not possible, and return empty struct in case of error. I am still learning how to do things in Nim and what are the best practices. |
09:27:46 | om3ga | and return true-false |
09:28:10 | FromDiscord | <Elegantbeef> `std/options` exists |
09:28:37 | FromDiscord | <Mitja Felicijan> Would that allow me to access the object when I call the procedure later in the code with assignment?â”(<@709044657232936960_om3ga=5b=49=52=43=5d>) |
09:29:26 | FromDiscord | <Mitja Felicijan> I call this function later in the code and access the object props. |
09:29:43 | om3ga | Mitja Felicijan, yeah, it should, you pass the object to this function |
09:29:43 | FromDiscord | <Mitja Felicijan> That is why I am returning the struct. |
09:30:41 | FromDiscord | <Mitja Felicijan> Is this similar to passing by reference? |
09:30:48 | om3ga | it will exist until calling function will not exit (or you will not copy it to another object) |
09:32:06 | om3ga | Mitja Felicijan, I don't really tried to study how nim passes that objects to the functions, but yeah, it should be the reference to the orig one object |
09:33:32 | om3ga | but it depends on the type of objects, for example if you have shared heap alloceted, then you should pass prt typeName, then word var is not necessary |
09:34:51 | FromDiscord | <Mitja Felicijan> 2022-12-25\_10\:34\:30.png https://media.discordapp.net/attachments/371759389889003532/1056505290884919346/2022-12-25_103430.png |
09:34:56 | FromDiscord | <Mitja Felicijan> This is the struct |
09:35:03 | om3ga | Mitja Felicijan or you can return object with elements inside it that can point to an error with string of the error code |
09:35:57 | FromDiscord | <Mitja Felicijan> This seems the most simple solution for now.â”(<@709044657232936960_om3ga=5b=49=52=43=5d>) |
09:36:04 | om3ga | but by my opinion this is not optimal, to operate with such amounts of data |
09:36:35 | om3ga | sorry, I'm from IRC, which one is simple? |
09:36:56 | FromDiscord | <Mitja Felicijan> or you can return object with elements inside it that can point to an error with string of the error codeâ”(<@709044657232936960_om3ga=5b=49=52=43=5d>) |
09:37:23 | FromDiscord | <Mitja Felicijan> The most simple one until I understand this more đ |
09:37:28 | om3ga | yeah, but as I mentioned, this might be not optimal |
09:38:35 | FromDiscord | <Mitja Felicijan> I know đ For the prototype, it will do.â”(<@709044657232936960_om3ga=5b=49=52=43=5d>) |
09:42:21 | FromDiscord | <Mitja Felicijan> I initialized it like this `var availability: Availability = default(Availability)` and then I populate it if nothing fails and return this, and then I can check status attr in struct. Not the most elegant way of doing it, but it works. Thanks for the help. |
09:44:05 | om3ga | Mitja Felicijan : here is example https://play.nim-lang.org/#ix=4jvA |
09:44:33 | om3ga | Mitja Felicijan : ur welcome! |
09:50:25 | FromDiscord | <Mitja Felicijan> It works like a charm! This is awesome. Thank you, so much!â”(<@709044657232936960_om3ga=5b=49=52=43=5d>) |
09:50:37 | om3ga | Mitja Felicijan : no prob |
10:42:34 | FromDiscord | <hdbg> Can I determine if a certain address was allocated via `alloc` function? |
10:50:38 | FromDiscord | <HitBlast> Is there a way to clear out or check for unused packages inside nimble? |
10:50:48 | Amun-Ra | hdbg: no, that address isn't managed anywhere |
10:53:07 | FromDiscord | <willyboar> Isn't possible to setup GitHub actions to packages repo and then remove any package that fail to install? |
10:54:15 | FromDiscord | <willyboar> I know there are a lot of them but it seems like a solution to remove broken packages |
10:54:34 | FromDiscord | <willyboar> (edit) "a" => "" |
11:38:14 | * | wallabra quit (Ping timeout: 246 seconds) |
11:42:46 | * | wallabra joined #nim |
11:52:14 | * | jmdaemon quit (Ping timeout: 246 seconds) |
12:22:20 | FromDiscord | <N00nehere> Hey guys, just wanted to wish you all happy holidays. Discord is filled with ready-made messages that you don't even read, you just copy and paste to every server, I don't like that, I like writing from my heart. Our friendship, from the deepest to virtual, is very important to me and couldn't ever be represented by a cookie-cutter message from anywhere. So, I'd like to thank you all, you're the best furry roleplaying server I've ever i |
12:24:56 | FromDiscord | <Phil> ... I am tempted to request for spam ban |
12:55:15 | FromDiscord | <Phil> Anyone can think of a decent way to scan for the end of a proc to insert a pragma manually there? (I know its ugly as hell, you don't need to tell me, can't think of a better solution) |
12:55:38 | FromDiscord | <Phil> Assuming you have the line of a file where a proc definition starts |
12:56:00 | FromDiscord | <Phil> (edit) removed "of a file" | "a" => "the" | "wheretheproc definition starts ... " added "and you can look at future lines" |
12:56:15 | FromDiscord | <Phil> (edit) "future" => "the" | "thelines ... " added "that follow after" |
13:24:23 | FromDiscord | <Vindaar> If you want it robust: use the compiler API, parse the code, insert into the AST similar to how you would in a macro, then render tree back as code & write back.â”Otherwise, depends a bit. If single line procs are forbidden it's not too bad (replace last `=` by `{.myPragma.} =`. Otherwise search for `proc/func` + `(` + `)` + `=` (gotta make sure to count parens, as there may be nested parens) |
13:24:38 | FromDiscord | <Vindaar> but maybe there's a better way đ |
13:24:54 | FromDiscord | <arkanoid> Wouldn't be nice if the ide would paint CT/RT code with different colors? |
13:28:43 | FromDiscord | <amadan> Think that would be possible LSP semantic highlighting đ€ |
13:28:51 | FromDiscord | <Phil> In reply to @Vindaar "If you want it": I'm semi-certain that I don't care about inline proc definitions.â”The macro would let me mock the proc, I don't care about mocking inline-procs, they're part of the procedure that's getting tested and thus shouldn't be mocked |
13:29:04 | FromDiscord | <Phil> (edit) "In reply to @Vindaar "If you want it": I'm semi-certain that I don't care about inline proc definitions.â”The macro would let me mock the proc, I don't care about mocking inline-procs, they're part of the procedure that's getting tested and thus shouldn't be mocked ... " added "individually" |
13:30:33 | FromDiscord | <arkanoid> Even better would be be able to ask the ide (nimsuggest/lsp) if the code I'm on is CT or RT |
13:30:44 | FromDiscord | <Vindaar> I mean with something like `npeg` you should be able to construct the nim grammar for procedure signatures I suppose. I'm no help there though, as I don't have peg experience and reading the Nim grammar is also work for me đ€Ł |
13:35:17 | FromDiscord | <Bung> I'd rather it render color fully client side (the current implementation) |
13:36:13 | FromDiscord | <arkanoid> What do you mean? |
13:36:22 | FromDiscord | <Bung> wait language server just for syntax highlight? no, that's nightmare |
13:38:13 | FromDiscord | <Phil> In reply to @Vindaar "I mean with something": Hot dang all of this looks painful |
13:38:28 | FromDiscord | <Phil> Parsing language is pain |
13:39:00 | FromDiscord | <arkanoid> Well my point was not how to provide it, but if that would be interesting on not. It's abou what, not how |
13:40:24 | FromDiscord | <Bung> I know that am saying that just because it's a directly route implement it in language server |
13:42:05 | FromDiscord | <arkanoid> You mean it's easy to make it spit out that info? |
13:44:30 | FromDiscord | <Bung> I think so the server can identify this and give different color response to client side |
13:46:28 | FromDiscord | <arkanoid> \`42'f32\` vs \`42.float32\` , would the second be paited as CT? |
13:47:52 | FromDiscord | <Bung> the second one more closer to RT, as it call a conversation proc |
13:51:06 | FromDiscord | <arkanoid> You sure? Is a proc on a literal |
14:00:24 | FromDiscord | <Bung> it's `int literal` -\> conversation proc -\> `float` |
14:00:27 | FromDiscord | <sekao> In reply to @ShalokShalom "Since initialized collections are": I'm going with the normal convention of initialization functions starting with `init`. But really it's fine to just not initialize them. I say it's not recommended in parazoa for stylistic reasons. Isn't nim going to start printing a warning when you do it? |
14:02:20 | FromDiscord | <Bung> there's a issue about a proc defines return type but proc body just have `discard`, they suggest give a warning |
14:09:59 | NimEventer | New thread by CraneDancingShape: How to further speed up the build of your Nim's projects (using ccache), see https://forum.nim-lang.org/t/9759 |
14:17:58 | FromDiscord | <arkanoid> So it's a procedure running on a constant (literal) value. It's constant |
14:18:24 | * | junaid_ joined #nim |
14:20:41 | FromDiscord | <Bung> why you think like that? the literal only means you write the number in code |
14:23:38 | FromDiscord | <tyrion> Hello, I was wondering if I declare a type like this type `Mat[N, M: static[int]] =` ... is there a way to access the values of N and M at runtime? |
14:28:44 | FromDiscord | <Bung> I may need full code to answer your question, in most cases I'd say yes, but I dont know where that question come from. |
14:31:00 | FromDiscord | <tyrion> Well, the full code right now is just `type Mat[N, M: static[int]] = array[N, array[M, float]]`, and so I could use `low` and `high`, however I was wondering if I could define the type as something like `type Mat[N, M: static[int]] = array[NM, float]` ? |
14:31:02 | FromDiscord | <arkanoid> Aren't literals constant? |
14:32:34 | FromDiscord | <Bung> so can you declare a proc returns `static[int]` |
14:34:24 | FromDiscord | <Bung> yes you can, there're few issues related to it but not this case |
14:35:15 | FromDiscord | <tyrion> Ok cool, thanks, I will try. What are the issues anyway? just curious |
14:36:54 | FromDiscord | <Bung> like nested generic proc when you instantiation outer the inner proc cant get the `static[int]` generic param, so it cant instantiation |
14:39:01 | FromDiscord | <Bung> like `array[T]` well `T` requires static as array is special handled so the `T` must be special handled to , but now when you pass non-static number it cause other error make user confusing. |
14:41:00 | FromDiscord | <Bung> and `array[T]` accept a type like `int` but it cause cgen error , as it's too large |
14:41:46 | FromDiscord | <tyrion> Ok! thanks for the explanation |
14:42:28 | FromDiscord | <Bung> NP |
14:43:14 | FromDiscord | <tyrion> Also, if I want to iterate over the values in an array, what is the difference in doing `for i in low(arr)..high(arr): arr[i]` or directly `for val in arr: val` |
14:45:50 | FromDiscord | <Bung> 1. `for i in 111 .. 222:` , 2. `for val in system.items(arr)` |
14:49:10 | FromDiscord | <tyrion> It works without the `system.items` for me though ... |
14:49:18 | FromDiscord | <tyrion> is it an automatic cast to iterable or something like that? |
14:50:33 | FromDiscord | <vindaar> writing `for x in SomeInstance` implicitly converts that to `for x in items(SomeInstance)`. That's why it works magically without |
14:50:49 | FromDiscord | <vindaar> as long as there's an `iterator items` defined that is |
14:54:09 | FromDiscord | <Bung> it's magic proc |
14:54:33 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4jwC |
14:55:59 | FromDiscord | <tyrion> Not sure I understand this in detail. I get it, it's a special case of the for statement |
14:56:33 | FromDiscord | <tyrion> So, is there a way I can make some magic like this for my "Matrix" type as well? |
14:57:33 | FromDiscord | <tyrion> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1056586108198211684): Not sure I understand this in detail. What I get is that it's a special case of the for statement |
14:58:27 | FromDiscord | <vindaar> as mentioned above, just define an iterator named `items` |
14:58:59 | FromDiscord | <Bung> and export it |
14:59:22 | FromDiscord | <tyrion> ah, super cool |
15:08:33 | FromDiscord | <ShalokShalom> In reply to @sekao "I'm going with the": Ah ok |
15:08:38 | FromDiscord | <ShalokShalom> Idk about Nim warnings |
15:08:56 | FromDiscord | <ShalokShalom> But it sounds like in the docs, not doing so will explode the world |
15:09:06 | FromDiscord | <ShalokShalom> Maybe you wanna explain in the README |
15:09:18 | * | arkurious joined #nim |
15:17:26 | FromDiscord | <sekao> i removed the warning from the comments since it isn't a safety issue (bugs notwithstanding) |
15:47:08 | FromDiscord | <tyrion> Now, maybe this is too much, but out of curiosity, is it possible to define a type with a variable type of arguments? Like `Tensor[A, B, C, ...]` |
15:47:49 | FromDiscord | <tyrion> kind of varargs for types |
15:50:41 | FromDiscord | <ajusa> In reply to @tyrion "Now, maybe this is": pretty sure you can't - you'd need to resort to macros |
15:51:03 | FromDiscord | <ajusa> at least that's what beef told me last time I asked that question |
15:59:49 | FromDiscord | <tyrion> where prod is imported from math |
16:00:14 | FromDiscord | <tyrion> would be fun though ahah |
16:21:16 | FromDiscord | <Vindaar> bridge is half dead I think |
16:21:30 | FromDiscord | <tyrion> @ajusa\: you meant to turn `prod` into a macro? Or something else, like generating a tensor type on demand? |
16:21:51 | FromDiscord | <tyrion> My understanding of nim is not yet good enough to figure this out I think |
16:24:02 | * | junaid_ quit (Remote host closed the connection) |
16:25:56 | FromDiscord | <tyrion> so would you need to generate separate types like `Tensor2D, Tensor3D, Tensor4D` ... etc? |
16:37:17 | * | ltriant joined #nim |
16:38:33 | FromDiscord | <Bung> I just realize matrix bridge is down |
16:41:44 | * | ltriant quit (Ping timeout: 246 seconds) |
16:41:51 | FromDiscord | <tyrion> So, I am curious to understand why my previous example with Matrix worked perfectly even though it had `NM` on the rhs, and now `prod(S)` doesn't seem to work. Is the limitation that it is not possible to have a static array (or object or whatever) on the left-hand side of a type? |
16:48:21 | FromDiscord | <Bung> am off now it's 0\:33 here |
17:27:44 | FromDiscord | <Smarc> whats a good way to put values to the letters {'a'..'z'} and {'A'..'Z'}? I want 'a' to have the value 1, 'b' value 2, ... and 'A' value 26, 'B' value 27 , ... etc. What would be an Nim idiomatic way to accomplish that? |
17:27:52 | FromDiscord | <Smarc> I thought about enums first thought |
17:28:50 | FromDiscord | <Smarc> 'A' value 27, 'B' 28 and so on of course |
17:48:29 | FromDiscord | <mantielero (mantielero)> Happy holidays all |
17:59:37 | FromDiscord | <mantielero (mantielero)> So probably I should emit it |
19:07:03 | FromDiscord | <Phil> In reply to @Smarc "whats a good way": Depends, if you want to go hyper efficient you could just store an array and define a "value" proc that takes the index of the character and adds 1 to it to get your desired number |
19:07:10 | FromDiscord | <Phil> (edit) "In reply to @Smarc "whats a good way": Depends, if you want to go hyper efficient you could just store an array ... and" added "or a seq" |
19:16:18 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jxy |
19:16:55 | FromDiscord | <Phil> or 2 dictionaries if you want to map value --> character as well as character --> value |
19:17:21 | FromDiscord | <Phil> Or another way could be to transform the bits of cha into the number you want, should be pretty easily possible |
19:27:10 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jxz |
19:32:56 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jxC |
19:33:26 | FromDiscord | <huantian> Iâd say just do if c in âaâ..âzâ |
19:33:44 | FromDiscord | <Phil> I think he wants explicitly numerical values |
19:33:48 | FromDiscord | <huantian> Instead of the isLowerCase/upperacsde |
19:33:55 | FromDiscord | <Phil> ohhh that way |
19:34:40 | FromDiscord | <Phil> I wonder what's faster, 2 comparisons or checking if x is in a range |
19:35:01 | FromDiscord | <huantian> Should be optimized to be the same |
19:35:07 | FromDiscord | <huantian> Maybe a case match would be even better |
19:42:47 | FromDiscord | <Phil> Just did a check for the funsies |
19:43:49 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/Ild |
19:45:03 | FromDiscord | <Phil> I don't really understand how these number differences come about.â”Factor 50 would've made sense to me again, "only" a 50% difference just confuses me |
19:45:36 | FromDiscord | <Phil> (edit) "50" => "20+" |
19:46:07 | FromDiscord | <Phil> Not that it matters. Unless you're insanely performance sensitive this is irrelevant |
19:55:20 | FromDiscord | <Smarc> whats the nim equiv to a dict? table? |
19:55:49 | FromDiscord | <Smarc> dict or hashmap or something like that |
19:59:28 | FromDiscord | <Phil> In reply to @Smarc "whats the nim equiv": Table.â”The important difference to things like a python table is though, that your values all need to have the same datatype.â”So you can't have one table where some values are strings and others are ints |
19:59:37 | FromDiscord | <Phil> (edit) "table" => "dict" |
20:00:29 | FromDiscord | <Phil> Or rather you can, but that'd require an object variant |
20:04:11 | FromDiscord | <Smarc> thats fine. gonna look into it, thank you |
20:06:35 | FromDiscord | <Smarc> is there a shortcut to assign all the values? or do i have to write every single letter in a single line? |
20:06:57 | FromDiscord | <Smarc> or just loop it? whats the most idiomatic way? |
20:32:58 | FromDiscord | <albassort> hey so im making a simple bidirectional table library |
20:33:29 | FromDiscord | <albassort> how would you guys prefer to differentiate between a bitable with two of the same types |
20:34:27 | FromDiscord | <albassort> my current idea is, for [A,A] you are required to have a [A,A,B], the B being an enum to sort the additions |
20:34:36 | FromDiscord | <albassort> that or a proc |
20:34:47 | FromDiscord | <albassort> (edit) "that or a proc ... " added "as a parameter with the input of a" |
20:34:52 | FromDiscord | <albassort> (edit) "that or a proc as a parameter with the input of a ... " added "and yeilds a bool" |
20:36:59 | * | xet7 joined #nim |
20:42:40 | FromDiscord | <auxym> In reply to @Smarc "or just loop it?": what do you mean assign all values? assign all of what? |
20:43:42 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jxM |
20:43:48 | FromDiscord | <albassort> kinda surprised this compiles |
20:44:43 | FromDiscord | <albassort> could of sworn you couldn't default cast parameters to nil |
21:11:57 | FromDiscord | <Mitja Felicijan> Is there a reason why this line `write(stdout, fmt"{snapshot.timestamp}\t{snapshot.original}\n")` would not respect new line and tab? They are not being rendered. I also tried with echo, and it's the same. I guess the `fmt` is a problem. Is there and alternative for this? |
21:12:46 | FromDiscord | <djazz> Use `&` instead of `fmt` |
21:12:58 | FromDiscord | <djazz> I think? |
21:13:16 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jxP |
21:13:29 | FromDiscord | <Phil> Though tbh I'd recommend just using the procs over using a table |
21:14:37 | FromDiscord | <djazz> In reply to @Mitja Felicijan "Is there a reason": https://nim-lang.org/docs/strformat.html#nimfmt-vsdot-nimamp |
21:15:47 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jxS |
21:16:00 | FromDiscord | <albassort> I don't know what object variants are |
21:16:04 | FromDiscord | <Phil> Let the user give you 2 types, you throw them into a generic object variant for which you have procs that differentiate between the two |
21:17:05 | FromDiscord | <Phil> In reply to @albassort "I don't know what": object variants are nims way to deal with the scenario that you want a sequence, but values in it may either be of type string or of type int (or other such scenarios)â”So you define a type that can be both, using different fields to store each value based on an enum |
21:17:07 | FromDiscord | <Elegantbeef> Nope |
21:17:10 | FromDiscord | <Phil> std/json makes heavy use of this |
21:17:40 | FromDiscord | <Elegantbeef> Nim has a special string syntax that allows any callable to be used `callable"myString"` but the caveat is it turns it into a raw string literal |
21:17:45 | FromDiscord | <Phil> In reply to @albassort "I don't know what": https://nim-lang.org/docs/manual.html#types-object-variants |
21:17:47 | FromDiscord | <Elegantbeef> Which means characters are not escaped |
21:19:09 | FromDiscord | <Phil> An object variant is kind of a statement ala:â”"This object contains either this field, or this other field, or this last other field" (depending on how many enums you have) |
21:20:12 | FromDiscord | <Phil> (edit) "have)" => "have). And since they are all different fields they're allowed by the type-system to have different types." |
21:20:37 | FromDiscord | <Phil> The main drawback of object variants is you are unlikely to get around using case statements |
21:21:08 | FromDiscord | <Phil> Since they force you for every operation you do with the object variant, to deal with all possible variants an object variant can be |
21:23:44 | FromDiscord | <albassort> In reply to @Isofruit "https://nim-lang.org/docs/manual.html#types-object-": I mean the user can do that if they want |
21:23:47 | FromDiscord | <albassort> That's probably a smart way to go about it |
21:23:53 | FromDiscord | <albassort> But I also like the option for classifiers |
21:24:12 | FromDiscord | <Phil> Not sure what you mean by classifiers, could you elaborate? |
21:24:22 | FromDiscord | <Mitja Felicijan> How would you split this into multiple lines `write(stdout, snapshot.timestamp & "\t" & snapshot.original & "\n")` without having a bunch of separate write statements? For example, in bash you can do `\` at the end of the line. |
21:24:28 | FromDiscord | <albassort> A classifier would be you attach a proc to it to define whether or not the input is of a or b |
21:25:00 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jxT |
21:25:13 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#ix=4jxT" => "https://play.nim-lang.org/#ix=4jxV" |
21:25:18 | FromDiscord | <albassort> (((trying to figure out how to statically nilcheck, this wont compile) |
21:25:32 | FromDiscord | <albassort> (edit) "compile)" => "compile because isnil is runtime... )))" |
21:26:02 | FromDiscord | <Phil> But you can do that (at runtime) with an object variant |
21:26:08 | FromDiscord | <Phil> Checking if it is a or b that is |
21:26:19 | FromDiscord | <albassort> i already have code for that ;-; |
21:26:22 | FromDiscord | <Phil> Which is something you can't do at compile-time either way unless your data is compiletime |
21:26:50 | FromDiscord | <albassort> well i still want to figure out how to check if something is nil at compile time because it can make some of my code cleaner |
21:27:38 | FromDiscord | <albassort> sent a code paste, see https://paste.rs/3AT |
21:27:44 | FromDiscord | <albassort> this is one solution i had |
21:27:55 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jxW |
21:28:14 | FromDiscord | <Phil> for nil checking that tends to work for me |
21:28:35 | FromDiscord | <Phil> this forcefully checks at compile-time due to the static block |
21:28:52 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jxX |
21:28:52 | FromDiscord | <albassort> this would be cool |
21:29:00 | FromDiscord | <Phil> that also works |
21:29:18 | FromDiscord | <Phil> so does `when x.isNil` huh |
21:29:58 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jxY |
21:29:58 | FromDiscord | <Phil> Could you throw your BiTable type definition at me? |
21:30:11 | FromDiscord | <albassort> doesn't compile |
21:30:12 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#ix=4jxY" => "https://play.nim-lang.org/#ix=4jxZ" |
21:30:14 | FromDiscord | <Phil> Or rather a complete code sample I can compile |
21:30:28 | FromDiscord | <Phil> Because "doesn't compile" doesn't tell me what's wrong đ |
21:30:37 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jy0 |
21:31:14 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#ix=4jy0" => "https://play.nim-lang.org/#ix=4jy1" |
21:32:20 | FromDiscord | <Phil> I am spotting an indentation issue with your procdefinition of "initBiTable" and "Classify" |
21:32:27 | FromDiscord | <Phil> But I'll try to get it running first |
21:32:48 | FromDiscord | <albassort> ok yes |
21:32:51 | FromDiscord | <albassort> but that doesn't fix it lol |
21:33:10 | FromDiscord | <albassort> because classifier cant be resolved at runtime |
21:33:36 | FromDiscord | <albassort> idk how that happened lol |
21:33:39 | FromDiscord | <Phil> In reply to @albassort "because classifier cant be": It can, you wanna know how? |
21:33:49 | FromDiscord | <albassort> o.o |
21:33:51 | FromDiscord | <Phil> `static proc(a : A) : bool` |
21:34:20 | FromDiscord | <albassort> https://tenor.com/view/cerebro-explosion-mind-blown-gif-8141811 |
21:34:25 | FromDiscord | <Phil> Keep in mind though that this will mean you will not be able to swap out the proc properly, this likely has a limitation that I'm not fully getting |
21:34:50 | FromDiscord | <Phil> Unless you want to only ever provide 1 type of proc for every combination of A-B you plan to use |
21:34:52 | FromDiscord | <albassort> i forgot about the static keyword |
21:35:29 | FromDiscord | <albassort> In reply to @Isofruit "Unless you want to": I don't support the insanity that would be not doing this |
21:35:45 | FromDiscord | <albassort> making a ref to a proc that mutates would be actually just... I want my code to stop you |
21:36:03 | FromDiscord | <Phil> In reply to @albassort "I don't support the": I don't parse this sentence but clearly common sense went out the window the moment object variants were rejected for the solution đ |
21:36:21 | FromDiscord | <Phil> Ohhh you mean you don't want to allow people to swap out the proc at runtime |
21:36:22 | FromDiscord | <albassort> you cant generate new object variants |
21:36:28 | FromDiscord | <albassort> so |
21:36:36 | FromDiscord | <Phil> You can do generic ones I'm semi sure, let me see |
21:36:37 | FromDiscord | <albassort> if the user wants to not use a classifier its up to them |
21:36:51 | FromDiscord | <albassort> the user is free to write logic code |
21:36:55 | FromDiscord | <albassort> im here allowing for insane code as well |
21:37:04 | FromDiscord | <albassort> this solution is a bit more adaptable |
21:39:36 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/q9z |
21:40:04 | FromDiscord | <Phil> You likely always have to quality what combination of 2 types you want to use for MyVar, but as a user you can deal with that by making a simple Alias |
21:40:11 | FromDiscord | <Phil> (edit) "quality" => "qualify" |
21:46:47 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jy4 |
21:50:15 | FromDiscord | <albassort> ok |
21:50:19 | FromDiscord | <albassort> my example is having a problem |
21:50:22 | FromDiscord | <albassort> đ€ |
21:50:23 | * | wallabra quit (Ping timeout: 246 seconds) |
21:51:34 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jy5 |
21:51:42 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#ix=4jy5" => "https://play.nim-lang.org/#ix=4jy6" |
21:52:00 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jy7 |
21:52:31 | FromDiscord | <albassort> []= dont work between two distinct types |
21:54:52 | * | wallabra joined #nim |
21:58:18 | FromDiscord | <huantian> Then youâll need to make your own hash for your types ig |
21:59:43 | * | ltriant joined #nim |
22:00:28 | FromDiscord | <albassort> NOOOOO |
22:00:48 | FromDiscord | <albassort> if i wanted to program my own hash |
22:01:06 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1056693093409239151/image.png |
22:01:17 | FromDiscord | <albassort> theres the formula for it |
22:02:08 | FromDiscord | <huantian> Are you sure lol |
22:02:27 | FromDiscord | <huantian> I mean thatâs not a formula for a specific hashing alto |
22:02:33 | FromDiscord | <huantian> (edit) "alto" => "algo" |
22:02:39 | FromDiscord | <albassort> well thats the... start |
22:02:45 | FromDiscord | <albassort> i would need to them figure out the harsh |
22:02:56 | FromDiscord | <albassort> this is just the concept |
22:03:41 | FromDiscord | <Phil> In reply to @albassort "your solution doesn't fix": My example does indeed have an entirely different problem |
22:04:20 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1056693907724959765/image.png |
22:04:23 | FromDiscord | <albassort> i have no idea how to solve this |
22:04:24 | FromDiscord | <albassort> lmao |
22:05:14 | FromDiscord | <albassort> template instantiation |
22:05:23 | FromDiscord | <albassort> from inserting two distinct types |
22:05:32 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jyf |
22:05:55 | FromDiscord | <albassort> well i dont know how to see the actual issue |
22:06:04 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4jyf" => "https://play.nim-lang.org/#ix=4jyg" |
22:06:40 | FromDiscord | <Phil> The line that bombs is `table[variantKey].fld2`, as `[]` apparently does not like being in a variant object generic or sth |
22:07:12 | FromDiscord | <albassort> do i... |
22:07:16 | FromDiscord | <albassort> open up an issue |
22:07:49 | FromDiscord | <albassort> alright i have another solution |
22:08:01 | FromDiscord | <albassort> this might be cursed |
22:10:07 | FromDiscord | <albassort> @Phil what was that keyword which defines generic conversions again |
22:14:06 | FromDiscord | <Phil> In reply to @albassort "<@180601887916163073> what was that": converter? |
22:14:07 | FromDiscord | <albassort> converter |
22:14:27 | FromDiscord | <ElegantBeef> Fuck bridge dieded |
22:14:40 | FromDiscord | <ElegantBeef> sent a code paste, see https://paste.rs/8yq |
22:15:31 | FromDiscord | <ElegantBeef> You implement a `==` and `hash` procedure |
22:15:34 | FromDiscord | <ElegantBeef> Solveded |
22:18:38 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jyi |
22:18:39 | FromDiscord | <albassort> ok this doesn't work either |
22:19:01 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#ix=4jyi" => "https://play.nim-lang.org/#ix=4jyk" |
22:19:26 | * | ltriant quit (Ping timeout: 272 seconds) |
22:19:32 | FromDiscord | <albassort> oh wait |
22:19:36 | FromDiscord | <albassort> i never implemented that proc |
22:19:53 | FromDiscord | <albassort> works fine |
22:19:56 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jyl |
22:20:21 | FromDiscord | <albassort> or wait maybe |
22:21:36 | FromDiscord | <albassort> this also works |
22:21:38 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jym |
22:22:00 | FromDiscord | <ElegantBeef> I dont get why you just dont implement `hash` and `==` |
22:22:08 | FromDiscord | <ElegantBeef> You lose all type safety here |
22:22:16 | FromDiscord | <albassort> for the that is the point |
22:22:27 | FromDiscord | <ElegantBeef> What's the point of the distincts then? |
22:22:42 | FromDiscord | <albassort> hypothetical type saftey |
22:23:12 | FromDiscord | <albassort> though for actual type saftey you should implement them to be the same type but implement a classifier |
22:23:22 | FromDiscord | <ElegantBeef> I dont follow |
22:24:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jyn |
22:24:39 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jyo |
22:24:44 | FromDiscord | <albassort> type saftey between cased strings |
22:24:56 | FromDiscord | <ElegantBeef> Oh there we go matrix bridge is back |
22:26:01 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jyp |
22:26:03 | FromDiscord | <ElegantBeef> They dont care about distincts |
22:26:13 | FromDiscord | <albassort> in this case they do |
22:26:17 | FromDiscord | <ElegantBeef> No they dont |
22:27:15 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1056699674674876509/image.png |
22:27:38 | FromDiscord | <albassort> explain that, liberal |
22:27:59 | FromDiscord | <Elegantbeef> I guess it errors in `==` so you need to implement the `==` for your variant aswell |
22:28:07 | FromDiscord | <ElegantBeef> Works fine |
22:28:09 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4jyr |
22:28:24 | FromDiscord | <albassort> then whats hapening here |
22:28:38 | FromDiscord | <ElegantBeef> I dont know give the compiler error instead of an arrow you cuckservative |
22:28:50 | FromDiscord | <ElegantBeef> Am i doing this joke right? |
22:28:59 | FromDiscord | <albassort> not exactly but close enough |
22:29:07 | FromDiscord | <albassort> aight lemme if you the compiler error |
22:29:08 | FromDiscord | <albassort> ahem |
22:29:20 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jys |
22:29:21 | FromDiscord | <ElegantBeef> That's not the compiler error |
22:29:26 | FromDiscord | <ElegantBeef> That's a part of the message |
22:29:27 | FromDiscord | <albassort> how i give compiler error |
22:29:29 | FromDiscord | <ElegantBeef> The least important part |
22:29:31 | FromDiscord | <ElegantBeef> Compile the program |
22:29:35 | FromDiscord | <ElegantBeef> And give the entire compiler error |
22:29:56 | FromDiscord | <albassort> it doesn't even fitr |
22:29:57 | FromDiscord | <albassort> (edit) "fitr" => "fit" |
22:30:08 | FromDiscord | <ElegantBeef> Well turn it into a cat |
22:30:20 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jyt |
22:30:23 | FromDiscord | <ElegantBeef> There you go |
22:30:25 | FromDiscord | <ElegantBeef> You're missing a hash |
22:30:35 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#ix=4jyt" => "https://paste.rs/Nfj" |
22:30:38 | FromDiscord | <ElegantBeef> You need to implement `==` and `hash` for custom types |
22:30:41 | FromDiscord | <albassort> ok how do i write a hash that accounts for this |
22:30:46 | FromDiscord | <albassort> for arbitrary types |
22:30:50 | FromDiscord | <albassort> any type put into this proc |
22:31:00 | FromDiscord | <albassort> or do i just let the user figure it out |
22:31:06 | FromDiscord | <ElegantBeef> Users provide their own |
22:31:09 | FromDiscord | <ElegantBeef> Just like std/tables |
22:31:16 | FromDiscord | <ElegantBeef> You can provide defaults |
22:31:27 | FromDiscord | <albassort> :hmm: |
22:31:48 | FromDiscord | <ElegantBeef> Works for instance |
22:31:50 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4jyv |
22:32:04 | FromDiscord | <albassort> i will include this in the readme |
22:32:10 | FromDiscord | <ElegantBeef> Though `$` should call `$` i guess |
22:32:25 | FromDiscord | <albassort> "supreme spaghetti writer, ElegentBeef" |
22:32:25 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/tables.html#basic-usage-hashing but nim's tables documents this |
22:32:30 | FromDiscord | <ElegantBeef> It's not even spaghetti |
22:32:33 | FromDiscord | <ElegantBeef> It's sensible code |
22:32:46 | FromDiscord | <albassort> no, but spaghetti is what i associate you with |
22:32:47 | FromDiscord | <ElegantBeef> This is the power of mixins in Nim |
22:32:56 | FromDiscord | <ElegantBeef> You can define logic that operates on code that's not even written yet |
22:45:48 | * | ltriant joined #nim |
22:49:19 | * | adium quit (Ping timeout: 260 seconds) |
22:49:49 | * | adium joined #nim |
22:51:04 | * | ltriant quit (Ping timeout: 260 seconds) |
22:51:37 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4jyx |
22:51:45 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "https://play.nim-lang.org/#ix=4jyx" => "https://play.nim-lang.org/#ix=4jyy" |
22:53:28 | FromDiscord | <Phil> In reply to @ElegantBeef "Works for instance": Huh, didn't know about distinctBase |
22:54:19 | FromDiscord | <Phil> How... does that bracket syntax even work? |
22:54:27 | FromDiscord | <ElegantBeef> Damn it the bridge only goes one way right now |
22:54:29 | FromDiscord | <ElegantBeef> That's funny |
22:54:32 | FromDiscord | <ElegantBeef> That's JS phil |
22:54:41 | FromDiscord | <Phil> Oh wow |
22:54:50 | FromDiscord | <Phil> Yeah, just didn't parse |
22:55:35 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ElegantBeef "Damn it the bridge": I think Neel can do both directions? |
22:55:49 | FromDiscord | <ElegantBeef> No the matrix bridge is only taking discord messages |
22:55:53 | FromDiscord | <ElegantBeef> Discord is not recieving them |
22:56:03 | FromDiscord | <ElegantBeef> I think you do `nim js neel.nim` and use that |
22:56:12 | FromDiscord | <ElegantBeef> Given the example has a `<script src = "neel.js"/>` |
22:56:58 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ElegantBeef "I think you do": What I want to do is doing an electron-like app (what is Neel done for) and use stuff like NodeJS, Angular, ... |
22:57:10 | FromDiscord | <Phil> In reply to @System64 "Hi About Neel, where": callProc is never written anywhere, it gets generated (see Readme.md):â”> `exposeProcs` is a macro that exposes specific procedures for javascript to be able to call from the frontend. When the macro is expanded, it creates a procedure `callProc` which contains all exposed procedures and will call a specified procedure based on frontend data, passing in the appropriate params (should there |
22:57:15 | FromDiscord | <ElegantBeef> I dont get why you want to use NodeJs, Nim is there đ |
22:57:52 | FromDiscord | <ElegantBeef> Or i guess maybe neeljs is embeded in the binary |
22:57:58 | FromDiscord | <ElegantBeef> I dont know but your HTML needs to add it |
22:58:58 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ElegantBeef "I dont get why": Like, for building single page apps for exemple |
22:59:07 | * | ltriant joined #nim |
22:59:09 | FromDiscord | <ElegantBeef> Karax? |
22:59:22 | FromDiscord | <System64 ~ Flandre Scarlet> what's that? |
22:59:33 | FromDiscord | <ElegantBeef> https://github.com/karaxnim/karax |
22:59:39 | FromDiscord | <ElegantBeef> I dont get why you want to use neel to be honest |
22:59:46 | FromDiscord | <ElegantBeef> It locks your program to chrome |
23:00:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ElegantBeef "It locks your program": Wait, that means if you don't have Chrome, the program crashes? |
23:00:37 | FromDiscord | <ElegantBeef> If you dont have chrome the program doesnt work correct |
23:00:51 | FromDiscord | <ElegantBeef> If you want to have it not depend on chrome you likely want https://github.com/juancarlospaco/webgui |
23:03:07 | FromDiscord | <Phil> Still not convinced of the approach that uses webview |
23:03:24 | FromDiscord | <Phil> For HTML/CSS/JS gui's |
23:03:53 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "*For HTML/CSS/JS gui's": any better options? |
23:05:02 | FromDiscord | <Phil> Not nim based ones. Imo as bad as the rep is that electron gets, it does mean you do not have to deal with the buggy/non-standard implementations that Konqueror/Epiphany will give you on Linux (no idea about safari/edge on Mac/Windows) |
23:05:21 | FromDiscord | <ElegantBeef> > Konqueror/Epiphany â”What? |
23:05:22 | FromDiscord | <Phil> For CSS/HTML |
23:05:46 | FromDiscord | <Phil> In reply to @ElegantBeef "> Konqueror/Epiphany What?": From what I've seen, the engines used to render the HTML/CSS/JS are based on your OS |
23:05:59 | FromDiscord | <ElegantBeef> For linux webgui use webkitgtk |
23:05:59 | FromDiscord | <Phil> AFAIK on Gnome that's Epiphany and the engines it comes with |
23:06:16 | FromDiscord | <Phil> KDE uses webkitgtk? |
23:06:26 | FromDiscord | <ElegantBeef> webgui only uses webkitgtk |
23:06:33 | FromDiscord | <ElegantBeef> So who gives a shit what KDE uses?! đ |
23:06:49 | FromDiscord | <ElegantBeef> It's a single runtime |
23:07:10 | FromDiscord | <Phil> Ohhhhhh so instead of bundling chromium, it bundles webkitgtk |
23:07:16 | FromDiscord | <ElegantBeef> Correct |
23:07:22 | FromDiscord | <ElegantBeef> So it's in theory consistent |
23:07:34 | FromDiscord | <ElegantBeef> Though windows will always be fun to ship to from linux |
23:07:37 | FromDiscord | <Phil> Still means your CSS/HTML rendering will behave different from standard |
23:07:47 | FromDiscord | <ElegantBeef> "different from standard" |
23:07:55 | FromDiscord | <ElegantBeef> I mean chrome is different from standard in many places |
23:07:56 | FromDiscord | <Phil> The standard Chrome and Mozilla set |
23:07:58 | FromDiscord | <System64 ~ Flandre Scarlet> Okay soâ”How can I compile the examples? |
23:08:19 | FromDiscord | <ElegantBeef> https://github.com/juancarlospaco/webgui#install |
23:08:22 | FromDiscord | <Phil> I mention those two specifically (and Safari) because I checked out how my side-project frontend renders on all of them and it renders fine |
23:08:30 | FromDiscord | <Phil> But it breaks hard on webkitgtk |
23:08:46 | FromDiscord | <ElegantBeef> Sure, but the browser engines(chrome especially) dont always abide by the standard |
23:09:00 | FromDiscord | <ElegantBeef> So bringing up the standard when the most popular engine doesnt.... is always fun |
23:09:00 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ElegantBeef "https://github.com/juancarlospaco/webgui#install": already installed |
23:09:25 | FromDiscord | <ElegantBeef> Should just be `nim c the_example.nim` then |
23:09:47 | FromDiscord | <Elegantbeef> Macros sure are magical |
23:09:50 | FromDiscord | <ElegantBeef> But phil if they're making an application built purely on webgui does it really matter if it doesnt abide by the standard |
23:09:54 | FromDiscord | <ElegantBeef> There's that slow poke |
23:10:24 | FromDiscord | <Phil> In reply to @ElegantBeef "So bringing up the": Yeh but the cross-section of the 3 most used browsers does manage to render it fine while Epiphany doesn't, its the de-facto standard though I guess chances aren't zero that it's a google-extension that mozilla and safari adopted when they could |
23:10:26 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4jyB |
23:11:08 | FromDiscord | <Phil> In reply to @ElegantBeef "But phil if they're": Nah, if you know your CSS might get annoying at parts though when it behaves not as you'd expect, but you are correct that ultimately it doesn't matter too much if you adjust the CSS to fit locally |
23:11:29 | * | ltriant quit (Ping timeout: 260 seconds) |
23:11:37 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4jyC |
23:12:33 | FromDiscord | <System64 ~ Flandre Scarlet> Oh god I hate Windows |
23:12:39 | FromDiscord | <Phil> Windows is the moment I start fleeing |
23:12:43 | FromDiscord | <Phil> Can't support what I don't have |
23:12:53 | FromDiscord | <ElegantBeef> > ShellExecuteWâ”Hmph does seem something isnt linking a library |
23:13:07 | FromDiscord | <System64 ~ Flandre Scarlet> WTF |
23:13:14 | FromDiscord | <ElegantBeef> You're on a 32bit system? |
23:13:51 | FromDiscord | <ElegantBeef> Which version of gtk did you install? |
23:14:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ElegantBeef "Which version of gtk": I don't have GTK I think |
23:14:35 | FromDiscord | <ElegantBeef> Well follow the instructions |
23:14:40 | FromDiscord | <System64 ~ Flandre Scarlet> and I use 32-bits Nim I think |
23:14:43 | FromDiscord | <ElegantBeef> https://gtk.org/docs/installations/windows/ |
23:14:47 | FromDiscord | <ElegantBeef> Why do you use 32bit Nim? |
23:14:50 | FromDiscord | <ElegantBeef> Are you on a 32bit os? |
23:15:06 | FromDiscord | <System64 ~ Flandre Scarlet> No 64-bits |
23:15:16 | * | jmdaemon joined #nim |
23:15:20 | FromDiscord | <ElegantBeef> So then why are you using 32bit Nim/Mingw? |
23:15:31 | FromDiscord | <System64 ~ Flandre Scarlet> But I used 32-bits one 'cause I used a 32-bits lib for my game |
23:15:42 | FromDiscord | <ElegantBeef> ugh |
23:15:58 | * | ltriant joined #nim |
23:16:09 | FromDiscord | <ElegantBeef> I dont know what to say here |
23:16:22 | FromDiscord | <ElegantBeef> I can only say install 64bit Nim, Mingw, Gtk then try again |
23:16:32 | FromDiscord | <System64 ~ Flandre Scarlet> alright |
23:16:42 | FromDiscord | <ElegantBeef> I think compiling on Windows 32bit is actually quite easy on 64bit |
23:17:01 | FromDiscord | <ElegantBeef> But you would need to pass compiler options |
23:18:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ElegantBeef "I dont know what": https://github.com/kometbomb/klystron/wiki/libksndâ”I tried to compile this lib on 64-bitsâ”But doesn't seems to work (even for 32-bits)â”So I used the pre-compiled dll which is... 32-bits |
23:18:51 | FromDiscord | <ElegantBeef> You can make Nim compile 32bit on a 64bit PC |
23:19:00 | FromDiscord | <ElegantBeef> Assuming you have a 32bit C compiler/linker |
23:19:25 | FromDiscord | <System64 ~ Flandre Scarlet> I have 2 Nim installedâ”One 32 bits, the other 64 bits |
23:19:34 | FromDiscord | <ElegantBeef> That's kinda pointless |
23:20:23 | FromDiscord | <ElegantBeef> `nim c --cpu:i386 --gcc.exe=mingw-i386 --gcc.linkerexe=mingw-i386 myNim.nim` or there abouts should work |
23:20:31 | FromDiscord | <ElegantBeef> I dont know what the mingw 32 bit is called exactly |
23:20:41 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
23:20:52 | FromDiscord | <System64 ~ Flandre Scarlet> I should make a batch script |
23:20:58 | FromDiscord | <ElegantBeef> Or a `config.nims` |
23:21:09 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/nimc.html#crossminuscompilation can help |
23:21:37 | FromDiscord | <ElegantBeef> @Phil what's your frontend even for anywho? |
23:22:51 | FromDiscord | <Elegantbeef> Ping |
23:23:05 | FromDiscord | <Elegantbeef> Hey this is alive again |
23:31:10 | * | ltriant quit (Ping timeout: 268 seconds) |
23:58:36 | FromDiscord | <nqeron> I have a generic type `Move[M: MoveKind] = tuple(square: Square, movekind: M)` and I'm trying to get set up a default Move that I can return to a procedure `Move` |
23:59:08 | FromDiscord | <nqeron> (edit) "I have a generic type `Move[M: MoveKind] = tuple(square: Square, movekind: M)` and I'm trying to get set up a default Move that I can return to a procedure ... `Move`and" added "returning a" | "returning a`Move` ... " added "and an error" |