00:25:40 | FromDiscord | <treeform> In reply to @saem "I gotta get profiling": Which profiler did you end up using? |
00:25:54 | saem | treeform: sysprof |
00:26:54 | FromDiscord | <treeform> In reply to @バロザード ""Im just going to": soon™️ |
00:27:35 | FromDiscord | <treeform> In reply to @saem "<@107140179025735680>: sysprof": hmm linux only. I really wish there was a good cross-platform profiler. |
00:31:03 | FromDiscord | <ElegantBeef> Dont say that too much eventually you'll be the reason there is 😄 |
00:37:00 | * | Vladar quit (Quit: Leaving) |
00:45:44 | * | krux02 quit (Ping timeout: 240 seconds) |
01:20:14 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:20:33 | * | njoseph joined #nim |
01:38:38 | * | leorize quit (Remote host closed the connection) |
01:39:04 | * | fiesta92 joined #nim |
01:39:32 | * | fiesta92 quit (Client Quit) |
02:08:26 | FromDiscord | <Gary M> I'm getting an implicit copy warning on some types that I've marked with {.byref.}, is that not enough? |
02:08:45 | FromDiscord | <Gary M> passing to a sink parameter implicit copy |
02:10:13 | leorize[m] | that doesn't sound like the right way to do it |
02:10:28 | FromDiscord | <Gary M> apparently not |
02:11:34 | FromDiscord | <Gary M> so I have an `initTable[string, Mesh]` and simply adding a mesh via `meshes["monkey"] = monkeyMesh` sets off the sink param warning |
02:11:38 | leorize[m] | sink parameters requires a transfer of ownership, so if that can't be transferred there is no other choice but to copy |
02:12:37 | FromDiscord | <Gary M> the warning persists regardless of byref |
02:12:57 | leorize[m] | yes, it requires the ownership of the object |
02:13:00 | FromDiscord | <Gary M> ah maybe I should just move() them |
02:14:06 | leorize[m] | note that even if that parameter isn't a `sink`, a copy will occur silently instead |
02:14:18 | leorize[m] | s/even// |
02:14:53 | FromDiscord | <Gary M> a couple things I can move but not those because I still need to keep a ref to free them later... |
02:15:06 | leorize[m] | free them later? |
02:15:13 | leorize[m] | are you not using destructors? |
02:15:15 | FromDiscord | <Gary M> Vulkan C ffi |
02:15:44 | FromDiscord | <Gary M> I have to very explicitly call the destructors in a specific order |
02:16:44 | leorize[m] | that sounds like a pain that encapsulation won't save you from :P |
02:16:52 | FromDiscord | <Gary M> sent a code paste, see https://play.nim-lang.org/#ix=2TAZ |
02:17:15 | FromDiscord | <Gary M> moving them obviously makes the address no longer valid 😄 |
02:17:48 | leorize[m] | if they contain a pointer anyway then does it matter if they're copied? |
02:18:05 | FromDiscord | <Gary M> Oh wait I can just use the index in the table |
02:18:43 | FromDiscord | <Gary M> I haven't used any `ptr` or `ref` types in my Mesh object definition so they're technically Value types? |
02:19:01 | leorize[m] | if your "value" is a pointer then does it matter? |
02:20:42 | FromDiscord | <Gary M> well yes because they also contain a nice fat sequence of vertices |
02:20:59 | leorize[m] | like a `seq` or a pointer? |
02:21:07 | FromDiscord | <Gary M> which all have position, normal, color vec3's and eventually some texcoords |
02:21:12 | FromDiscord | <Gary M> no actual sequences |
02:21:27 | leorize[m] | then what is copied exactly? |
02:21:46 | FromDiscord | <Gary M> I read them into sequences CPU side with a parser then upload them to the gpu buffer |
02:22:15 | FromDiscord | <Gary M> well what's being copied is I'm storing the meshes in a lookup table as well as a flat sequence of renderables |
02:23:41 | FromDiscord | <Gary M> sent a code paste, see https://play.nim-lang.org/#ix=2TB0 |
02:23:44 | FromDiscord | <Gary M> so here is the shortest example |
02:23:59 | FromDiscord | <Gary M> it also throws a sink copy warning there adding to renderables |
02:24:38 | leorize[m] | most likely because you are referring to `monkey` after the `add` |
02:24:46 | FromDiscord | <Gary M> actually for some reason I think that one didn't but the other one did hold on |
02:24:56 | FromDiscord | <Gary M> sent a code paste, see https://play.nim-lang.org/#ix=2TB1 |
02:24:56 | FromDiscord | <Gary M> which also makes no sense to me |
02:25:26 | FromDiscord | <Gary M> that's the entire lifecycle of the `monkey` and `tri` RenderObject before the sequence is iterated |
02:26:51 | leorize[m] | have you tried to make those `let`? |
02:27:31 | FromDiscord | <Gary M> https://media.discordapp.net/attachments/371759389889003532/823019965216325693/unknown.png |
02:27:44 | FromDiscord | <Yardanico> you can use object construction syntax |
02:27:58 | FromDiscord | <Yardanico> let monkey = RenderObject(mesh: ..., material: ..., etc) |
02:28:07 | FromDiscord | <Gary M> okay, let me give it a shot then |
02:31:03 | FromDiscord | <Gary M> That seems to have done the trick. |
02:31:13 | FromDiscord | <Gary M> Why does that make all the difference? |
02:32:58 | leorize[m] | I would chalk it up to some analysis issues |
02:33:58 | leorize[m] | If I have to guess it would be how the compiler will preserve the variable between iterations (same reason why capturing loop variables in a closure won't yield what you expect) |
02:34:23 | leorize[m] | if you can minimize it into a tiny sample, I'm sure the compiler folks would be happy to look at it |
02:35:58 | leorize[m] | using `let` satisfy the analysis by making sure that the variable is wiped on every loop, which is why sink works then |
02:36:45 | leorize[m] | anyhow, I think you'll have to figure out a way to cleanly free those buffers because currently that looks brittle |
02:37:36 | FromDiscord | <Gary M> yeah I had an issue with closures on iterator variables and never figured out why |
02:37:58 | FromDiscord | <Gary M> because I think they work the way you "would" expect in C++ lambdas |
02:38:13 | leorize[m] | this is not really well documented but the fix is usually to put the entire loop body in `closureScope()` template |
02:38:29 | FromDiscord | <Gary M> interesting. I'll try to remember that next time. |
02:38:40 | FromDiscord | <Gary M> or maybe I'll go try it now |
02:39:10 | FromDiscord | <Gary M> because I just "fixed" it by inefficiently running the same for loop inside the lambda itself lol |
02:39:21 | leorize[m] | lol |
02:39:32 | FromDiscord | <Gary M> but I think that also avoids closures... |
02:41:49 | leorize[m] | avoiding closures is kind of a no-brainer if you want to minimize allocations |
02:42:31 | leorize[m] | though I don't think Nim closures allocate much, if any |
02:43:17 | FromDiscord | <Gary M> It's not a huge issue since in this case those few lambdas are only being called at the end of the program for a few swapchain images, but I think avoiding closures if I can is just better design anyways |
02:44:08 | leorize[m] | what is this very strict deallocation requirement? |
02:44:27 | FromDiscord | <Gary M> Also you can give a seq of closure procs a nimcall proc just fine but you can't give a seq of nimcall procs a closure proc |
02:45:03 | FromDiscord | <Gary M> So basically Vulkan has these Validation layers and whenever you forget to free a resource it'll tell you |
02:45:23 | FromDiscord | <Gary M> You have to allocate everything and free everything their way |
02:45:42 | FromDiscord | <Gary M> Creating the instance, the devices, the memory on the devices, just to name a few |
02:45:46 | leorize[m] | sounds like destructors can handle them? |
02:46:04 | FromDiscord | <Gary M> So if you destroy the device before destroying the memory on the device you're already leaking |
02:46:08 | leorize[m] | though you might have to ask Araq for a "guaranteed free on exit" |
02:47:12 | FromDiscord | <Gary M> I'm not sure if I'd be able to use destructors for everything... |
02:48:09 | FromDiscord | <Gary M> For everything you instantiate in Vulkan it's this convoluted process of filling out a structure of information and a pointer to the device and sometimes a few other things |
02:48:39 | FromDiscord | <Gary M> So it's not so simple as just make a VkDevice() and then ~VkDevice(), I don't think |
02:49:40 | FromDiscord | <Gary M> Maybe I'm missing something. I'm not very smart so that could be pretty likely lol |
02:51:05 | FromDiscord | <Gary M> The destructors for one thing would all need a reference to the device that they're destructing on so I'd probably have to keep a reference in their object, no? |
02:51:13 | leorize[m] | sounds like you just need a `shared_ptr` to keep your `VkDevice` alive until all meshs are gone |
02:52:17 | FromDiscord | <Gary M> Idk, it's a little more complicated than that simply because it's destructing on a GPU not just local memory |
02:53:45 | FromDiscord | <Gary M> Even in C++ they don't try wrapping it in smart pointers |
02:54:13 | FromDiscord | <Gary M> So I'm just using a FIFO callback queue like one implementation I'm following. |
02:54:45 | leorize[m] | maybe you can try looking at things like rust gpu for inspiration? |
02:55:06 | FromDiscord | <Gary M> Ah that sounds outside of my mental capabilities haha |
02:55:35 | FromDiscord | <ElegantBeef> opengl isnt looking too bad now is it? 😛 |
02:56:11 | FromDiscord | <Gary M> I'm lucky I actually have the validation layers in Vulkan telling me when I mess up. They're really descriptive and I have it print the call stack at the same time with a custom debugger callback |
02:56:45 | FromDiscord | <Gary M> Hey ogl is fine but apple is shit for deprecating it |
02:57:01 | FromDiscord | <Gary M> At least with Vulkan I'm future proofed with Moltenvk |
02:57:09 | FromDiscord | <Gary M> And everything else is supported |
02:57:25 | FromDiscord | <ElegantBeef> ogl -> grvk -> moltenvk 😄 |
02:57:55 | FromDiscord | <Gary M> What is Mantle |
02:58:04 | FromDiscord | <ElegantBeef> Oh that's mantle |
02:58:10 | FromDiscord | <ElegantBeef> I thought that was for opengl -> vk |
02:58:28 | FromDiscord | <ElegantBeef> Mantle was the precursor to vulkan, an AMD project that was killed off due to low adoption |
02:58:43 | FromDiscord | <Gary M> There actually is a moltengl |
02:58:51 | FromDiscord | <Gary M> And it's not free |
02:59:17 | FromDiscord | <Gary M> Also only up to opengles 2.0 |
02:59:32 | FromDiscord | <Gary M> I'm confident Vulkan is worth it |
02:59:51 | FromDiscord | <Gary M> Regardless of using Vulkan or Ogl I still can't parse gltf worth jack shit lol |
03:00:52 | FromDiscord | <ElegantBeef> Read the spec and become 1 with it |
03:00:59 | FromDiscord | <Gary M> :( |
03:01:11 | FromDiscord | <Gary M> That's essentially saying "get good" |
03:01:24 | FromDiscord | <ElegantBeef> I'd never say that, only imply it |
03:01:30 | FromDiscord | <Gary M> Lol |
03:07:31 | FromDiscord | <Gary M> Is iterating on a sequence using ptr UncheckedArray (gross pointer arithmetic) as fast as it would be in pure C/C++? Or would you say just iterating on the seq like normal is just as fast |
03:07:52 | FromDiscord | <Yardanico> the latter |
03:07:54 | FromDiscord | <Gary M> I ask because there's a single place where it's supposed to be running 60+ fps |
03:07:57 | FromDiscord | <Yardanico> why would the first one improve anything |
03:08:04 | FromDiscord | <Yardanico> nim iterators are inline by default anywayt |
03:08:05 | FromDiscord | <Yardanico> (edit) "anywayt" => "anyway" |
03:08:32 | FromDiscord | <Gary M> Because typically pointer arithmetic is very fast :P I didn't know if Nim iterators had overhead |
03:09:07 | FromDiscord | <Gary M> Also I'm not smart and this is why I'm asking. |
03:09:12 | * | gpanders quit (Ping timeout: 268 seconds) |
03:13:54 | leorize[m] | you think too much and it will get slow |
03:15:32 | leorize[m] | in terms of loop optimizations, the folks at #nim-gamedev can help you with that |
03:16:47 | leorize[m] | but here is my "how to be fast": don't do syscalls, and don't allocate. |
03:17:16 | leorize[m] | technically the prior implies the latter :P |
03:18:30 | leorize[m] | I don't think copies are that expensive nowadays with caching and stuff, but I guess avoiding them isn't too bad of an idea, unless it complicates your program |
03:37:24 | FromDiscord | <Gary M> It's stuff I'll worry a little more about when I can get more features implemented and refactor the codebase down a bit. |
03:37:52 | FromDiscord | <Gary M> I've put over 700 lines into just rendering some triangles and obj meshes without textures |
03:37:55 | FromDiscord | <clyybber> In reply to @leorize "using `let` satisfy the": the analysis doesnt care about let or var |
03:38:26 | FromDiscord | <clyybber> @Gary M Those copy hints (not warnings ;) should be hidden |
03:38:34 | leorize[m] | I'm wrong then :p |
03:38:36 | FromDiscord | <clyybber> by default I mean |
03:38:45 | FromDiscord | <clyybber> they just confuse people |
03:38:56 | FromDiscord | <Gary M> is it because I'm using orc or something 😛 |
03:39:04 | FromDiscord | <Gary M> or that's just the default anyways |
03:39:40 | FromDiscord | <clyybber> yeah but dont worry about it |
03:39:40 | FromDiscord | <Gary M> also clyybber did you ever figure out how to load gltf? 😄 |
03:39:45 | FromDiscord | <Gary M> I'm having massive trouble with it. |
03:39:47 | FromDiscord | <clyybber> didntry |
03:39:56 | FromDiscord | <clyybber> whats your issue? |
03:40:13 | FromDiscord | <Gary M> https://media.discordapp.net/attachments/371759389889003532/823038259000115251/unknown.png |
03:40:16 | FromDiscord | <Gary M> lol |
03:40:35 | FromDiscord | <Gary M> I didn't even bother reading the normals or anything like that |
03:40:47 | FromDiscord | <Gary M> just trying to read the vertices gave me enough trouble |
03:40:48 | FromDiscord | <clyybber> looks fine wdym :p |
03:41:11 | FromDiscord | <Gary M> it's funny because it's in the general shape of the mesh |
03:41:27 | FromDiscord | <clyybber> yeah the vertices are right |
03:41:51 | FromDiscord | <clyybber> your indices are wrong |
03:41:59 | FromDiscord | <Gary M> hm |
03:43:55 | FromDiscord | <Gary M> I didn't even really touch on indices, I just tried reading the verts into my mesh object the same way I did obj |
03:44:52 | FromDiscord | <Gary M> looks like something to look more into later then |
03:44:57 | FromDiscord | <Gary M> thanks |
03:50:37 | FromDiscord | <clyybber> hmm |
03:50:47 | FromDiscord | <clyybber> then the order is different? |
03:51:09 | FromDiscord | <clyybber> Maybe just diff the vertices of loaded gltf and obj |
03:51:26 | FromDiscord | <ElegantBeef> Yea the obj might have them linear, whereas the gltf may have it all over |
03:56:06 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=6056c3d688edaa1eb8ce1c2b] |
03:56:43 | FromGitter | <bung87> how this works ? I thought it just need something like guid ? |
04:05:34 | * | spiderstew joined #nim |
04:07:12 | * | spiderstew_ quit (Ping timeout: 246 seconds) |
04:07:39 | FromDiscord | <ElegantBeef> Couldnt you just use epochTime? 😄 |
04:16:28 | * | timdorohin quit (Quit: Konversation terminated!) |
04:22:14 | * | timdorohin joined #nim |
04:22:56 | FromGitter | <bung87> not sure it's nim httpclient's code |
04:25:36 | FromDiscord | <Gary M> In reply to @ElegantBeef "Yea the obj might": I'm going to think it's just indices since obj doesn't bother with those |
04:27:09 | FromDiscord | <Gary M> The obj has all the duplicate verts and the gltf doesn't if that's the case |
05:39:51 | FromDiscord | <Gary M> how do I define comparison operators for a custom type? |
05:39:58 | FromDiscord | <Gary M> specifically `<` |
05:40:52 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix= |
05:41:17 | FromDiscord | <Gary M> sounds about right |
05:41:21 | FromDiscord | <Rika> `>` will be defined automatically as well i believe |
05:42:00 | FromDiscord | <Rika> "automatically" more like `>` is a generic that matches anything, body is `b < a` |
05:42:06 | FromDiscord | <Gary M> hm, this is a little tricky to do |
05:42:09 | FromDiscord | <Rika> ? |
05:42:12 | FromDiscord | <Rika> whats the issu |
05:42:12 | FromDiscord | <Rika> e |
05:42:33 | FromDiscord | <Gary M> I have a RenderObject type which has a mesh, material, and transform matrix as it's fields |
05:42:48 | FromDiscord | <Gary M> and they're held in a sequence that I want to sort by their material |
05:42:49 | FromDiscord | <Rika> oh no, complexity, im too stupid |
05:43:27 | FromDiscord | <Gary M> but the Material is defined by having a pipeline and pipeline layout, so determining which is "greater" or "lesser" is kinda weird... |
05:43:53 | FromDiscord | <Rika> implement a kind of sort priority maybe |
05:43:56 | FromDiscord | <Gary M> really what I want isn't to sort from lesser to greater but just... sort so that they're all contiguously grouped |
05:44:18 | FromDiscord | <Rika> but you then need == for the underlying fields too |
05:44:23 | FromDiscord | <Gary M> because currently if it's fragmented, it has to switch pipeline bindings several times per frame |
05:44:33 | FromDiscord | <Gary M> if I group them it only has to change when moving to the next group |
05:46:32 | * | Q-Master quit (Quit: Ушел) |
05:47:55 | * | superbia joined #nim |
05:51:59 | * | Q-Master joined #nim |
06:26:07 | * | superbia quit (Quit: WeeChat 3.1) |
06:37:19 | * | lritter joined #nim |
06:37:42 | * | DaKnig[m] left #nim ("User left") |
07:03:11 | * | narimiran joined #nim |
07:28:39 | * | haxscramper joined #nim |
08:50:25 | FromDiscord | <w1n5t0n> sent a code paste, see https://play.nim-lang.org/#ix=2TC0 |
08:50:36 | FromDiscord | <w1n5t0n> If I remove that option then compilation succeeds |
08:53:57 | FromDiscord | <w1n5t0n> (I should mention that I'm on Windows 10 but I'm using `eshell` in Emacs |
08:57:24 | FromDiscord | <haxscramper> In reply to @w1n5t0n "Hey, I just started": I can reproduce it (with `--out:a/b` or `--out:"a/b"`), so it looks like a bug. You can use `switch("out", "a/b")` in `config.nims` instead of `--` syntax - it works fine |
08:58:09 | * | narimiran quit (Ping timeout: 264 seconds) |
08:59:34 | FromDiscord | <w1n5t0n> Thanks, I'll switch to that and open an issue - is the ` nim-lang/Nim ` repo the right place? |
09:00:55 | FromDiscord | <haxscramper> Yes, this is the right place |
09:25:03 | * | vesper11 joined #nim |
09:26:45 | * | vesper11 quit (Read error: Connection reset by peer) |
09:28:47 | * | vesper11 joined #nim |
09:43:34 | FromDiscord | <jtiai> Fight with writing kernel continues. When compiling I end up in two errors: `Error: system module needs: appendString`. To my understanding this has something to do with (certain) type of equality `==` comparison. If I remove (only) equality comp. compilation fails with: `fatal error: stdint.h: No such file or directory`. I'm open for all ideas what to try. |
09:50:51 | FromDiscord | <jtiai> nim |
10:13:19 | * | kenran joined #nim |
10:21:41 | * | vesper11 quit (Quit: ZNC 1.7.5 - https://znc.in) |
10:24:41 | * | vicfred quit (Quit: Leaving) |
10:35:12 | FromDiscord | <Gary M> `not(myInt)` is equivalent to bitwise `not` right? |
10:35:17 | FromDiscord | <Rika> yes |
10:35:21 | FromDiscord | <Gary M> ty |
10:35:36 | FromDiscord | <Rika> !eval echo not 0b11110000u8 |
10:35:38 | NimBot | 15 |
10:48:20 | ForumUpdaterBot | New thread by DavidKunz: Documentation: Method Call Synatx and Inverse Index, see https://forum.nim-lang.org/t/7672 |
10:52:33 | * | kenran quit (Ping timeout: 245 seconds) |
10:53:01 | * | haxscram` joined #nim |
10:54:26 | * | kenran joined #nim |
10:55:09 | * | haxscramper quit (Ping timeout: 264 seconds) |
10:57:45 | * | haxscram` quit (Ping timeout: 246 seconds) |
11:08:14 | * | Vladar joined #nim |
11:12:39 | FromDiscord | <Gary M> oo this c++ is evil `(void)&sceneData` |
11:12:54 | * | kenran quit (Quit: leaving) |
11:13:32 | FromDiscord | <IDF> !eval echo 0x2be or not(0x2be) |
11:13:35 | NimBot | -1 |
11:14:03 | FromDiscord | <Gary M> would that be list `cast[ptr UncheckedArray[char](sceneData.addr)[1]` lol |
11:14:07 | FromDiscord | <Gary M> be like |
11:14:22 | FromDiscord | <Gary M> considering sceneData is a char |
11:15:39 | * | FromGitter quit (Read error: Connection reset by peer) |
11:15:44 | FromDiscord | <Rika> Missing a bracket after char |
11:15:55 | FromDiscord | <Rika> But I think so yeah |
11:16:29 | FromDiscord | <Gary M> yeah meant this `cast[ptr UncheckedArray[char]](sceneData)[1].addr` |
11:22:16 | FromDiscord | <Gary M> bah, how would I do pointer incrementing 😄 |
11:22:36 | FromDiscord | <Gary M> sceneData += value |
11:28:07 | FromDiscord | <Rika> 200 IQ but also not very safe |
11:28:16 | FromDiscord | <Rika> Probably just increase the index? |
11:29:59 | FromDiscord | <Gary M> man yeah this is hard |
11:32:23 | FromDiscord | <Goel> How can this be used? `not false` I was reading some code yesterday but i can't find it anymore, but i remember reading it. What is its usage? If is a bool is not supposed to be always `true` or `false`? |
11:33:12 | liblq-dev | !eval echo not false |
11:33:14 | NimBot | true |
11:33:33 | liblq-dev | `not` is just an operator like any other |
11:33:35 | FromDiscord | <Rika> I don’t see how this is problematic |
11:33:49 | liblq-dev | and `false` is the right-hand side of the operator |
11:34:07 | liblq-dev | `false` could just as well be any expression you want |
11:34:14 | FromDiscord | <Goel> I don't understand the sense of using `not false` since there is only another option that is `true` |
11:34:22 | liblq-dev | well yeah |
11:34:26 | liblq-dev | it's obfuscation |
11:34:49 | liblq-dev | or dumb/drunk/drowsy coding |
11:35:00 | FromDiscord | <Rika> It works it’s just not practical |
11:40:06 | FromDiscord | <Goel> I found it, it has it uses, it was for checking if a specific flag was used or not by the user by the nim compiler |
11:41:06 | FromDiscord | <Goel> `proc winHints(resizable = true; visible = true; decorated = true; debugContext = not false)`↵and then `debug context: when -d:release is not defined` |
11:41:38 | * | fredrikhr joined #nim |
11:42:10 | * | ^Q-Master^ joined #nim |
11:43:10 | * | aeverr quit (Read error: Connection reset by peer) |
11:43:13 | * | aeverr_ joined #nim |
11:43:47 | * | aeverr_ is now known as aeverr |
11:44:10 | FromDiscord | <Gary M> ahhhhh holy shit I did it |
11:44:25 | FromDiscord | <Gary M> pointer arithmetic belongs in the trash |
11:44:48 | FromDiscord | <Gary M> sent a code paste, see https://play.nim-lang.org/#ix=2TCS |
11:44:55 | FromDiscord | <Rika> In reply to @Goel "I found it, it": oh, you mean in docs |
11:45:10 | FromDiscord | <Rika> In reply to @Gary M "pointer arithmetic belongs in": the price you pay when interfacing with C |
11:45:24 | * | Q-Master quit (Ping timeout: 256 seconds) |
11:45:35 | FromDiscord | <Gary M> yeeep |
12:08:47 | FromDiscord | <sealmove> Is there an automatic way to release release notes? |
12:09:01 | FromDiscord | <sealmove> As docs I mean |
12:10:45 | FromDiscord | <Rika> not that i know of |
12:11:23 | FromDiscord | <sealmove> is it ok if I have a release_notes.rst in the repo? :P |
12:12:13 | FromDiscord | <Rika> the repo -> ? |
12:12:38 | FromDiscord | <sealmove> https://github.com/sealmove/binarylang |
12:13:39 | FromDiscord | <Rika> i dont see why not 😛 |
12:14:04 | FromDiscord | <sealmove> me neither, I just wonder how common this is, and how people do it. |
12:18:57 | FromDiscord | <Papel> Those release notes are like the changelogs of each version, right? |
12:23:52 | FromDiscord | <Rika> In reply to @รєคɭ๓๏שє "me neither, I just": prolly not a lot, not a lot even version properly (hi) sooooo |
12:28:11 | FromDiscord | <sealmove> In reply to @Papel "Those release notes are": yes, must start doing this |
12:29:16 | FromDiscord | <no name fits> I know this isn't Nim specific, but does anyone know a good guide to handling PRs? I want to update an already created PR with more commits, but I'm not sure what the best approach is |
12:30:58 | FromDiscord | <sealmove> If you have an open PR and you make a commit, it is added to the PR automatically |
12:31:52 | FromDiscord | <no name fits> Excellent, thanks. Is there an overview of all this stuff somewhere? I tried just looking at the git docs, but it wasn't very helpful, and GitHub's page on PRs is extremely short |
12:34:33 | FromDiscord | <mratsim> In reply to @no name fits "Excellent, thanks. Is there": Hacktoberfest doc maybe |
12:36:43 | FromDiscord | <sealmove> you can add a `[WIP]` to the PR's name or make it a draft, if you don't want it to get merged yet |
12:37:21 | FromDiscord | <no name fits> That's a good tip, thanks |
12:52:29 | FromDiscord | <VinKer> Hi all, What is the best way to learn a specific Nim type ? For example, if i saw a "NimNode" object in documentation, i want to know what are the properties and methods in that type. Reading the source code or any type of detailed documentation about that specific type ? Which is the recommended way ? |
13:05:46 | FromDiscord | <Zachary Carter> Just read the source. It's the same answer for any language. If docs aren't clear enough, or you want to see the impl, look at src |
13:10:53 | FromDiscord | <VinKer> Docs are capsule form of knowledge. Sometimes it is good. |
13:12:38 | FromDiscord | <VinKer> What i am doing now is, open the source in a new tab and press "Ctrl F" and type "(: NimNode". This way, i can go through all the methods of NimNode type. |
13:12:52 | FromDiscord | <haxscramper> We do not have any documentation generator tool that groups procedures by type. `nim doc` does quite mediocre job at grouping things in a searchable way (like doxygen) |
13:13:21 | FromDiscord | <haxscramper> So right now the best alternative is to just search for procedures in documentation |
13:14:16 | FromDiscord | <haxscramper> I'm "working" on more useful docgen, but it is slow (because other projects etc.) |
13:15:24 | FromDiscord | <VinKer> I think collecting the details in a word document or something else would be a great idea. If i read about NimNode in docs, copy paste the func signature and paste it in a word document. Do the same for all methods. |
13:16:10 | FromDiscord | <exelotl> @haxscramper I'm really looking forward to this ^^ |
13:17:07 | FromDiscord | <haxscramper> Ye, I know it's somewhat wanted feature, and I actually should focus on this |
13:17:18 | FromDiscord | <exelotl> Custom headings under which you could group types and procs and such would be amazing. With additional prose _between_ the definitions |
13:18:25 | FromDiscord | <haxscramper> You mean something like a tag system, when you can tag procedure with something like `:db:` and then get section with all database-related procs? |
13:18:45 | FromDiscord | <haxscramper> And I'm not sure what do you mean by "additional prose between the definitions" |
13:19:33 | FromDiscord | <VinKer> @exelotl Yes. That is what i am planning |
13:22:19 | FromDiscord | <exelotl> sent a long message, see http://ix.io/2TDe |
13:25:16 | FromDiscord | <exelotl> Maybe a Sphinx plugin would be more suitable for that sort of thing though? |
13:25:27 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/CQ6 |
13:25:33 | FromDiscord | <exelotl> Yeah |
13:26:55 | FromDiscord | <haxscramper> Though it would require some kind of pattern-based search, because linking `proc foo()` is easy. Linking `[[code:std/osproc.execProcess(string, string, ...)]]` is more complicated |
13:27:03 | * | fredrikhr quit (Quit: Client Disconnecting) |
13:27:37 | FromDiscord | <haxscramper> Especially if we consider that there might be an overloaded function, or ever absolutely identical functions in separate modules, or maybe you want to write multimodule overview documentation |
13:29:53 | FromDiscord | <Rika> In reply to @exelotl "Custom headings under which": prose between procs would be an issue if you wanted customisable grouping |
13:30:47 | FromDiscord | <haxscramper> Why? I can just repeat proc documentation on multiple pages |
13:30:50 | FromDiscord | <haxscramper> One for whole index |
13:31:08 | FromDiscord | <haxscramper> And also any time someone links to it via `[[code:` |
13:31:26 | FromDiscord | <Rika> i mean in page customisable grouping |
13:31:37 | FromDiscord | <Rika> where a user can click something to change the grouping |
13:32:27 | FromDiscord | <haxscramper> Still don't follow how this would be a problem. Just make multiple sort options - "by tags", "by self", etc. |
13:32:41 | FromDiscord | <haxscramper> "by self" == using first type of the procedure |
13:32:56 | FromDiscord | <Rika> i guess you could hide the betweener prose if the grouping is not default |
13:33:04 | FromDiscord | <Rika> but that might be confusing |
13:33:36 | FromDiscord | <haxscramper> no. prose and full index are two differen things |
13:34:07 | FromDiscord | <haxscramper> prose is when you want to write a lot of text and occasionally link to procs |
13:34:22 | FromDiscord | <haxscramper> And full index is just total dump of absolutely everything in one place |
13:34:33 | FromDiscord | <Rika> i wasnt talking about the index |
13:34:43 | FromDiscord | <Rika> ah i guess grouping is less relevant in definition docs? |
13:35:01 | FromDiscord | <Rika> but i'd like that as well, i dont often go to the index, i go straight to module def docs... |
13:35:23 | FromDiscord | <exelotl> This is why I see Sphinx as an easy way out. Its already good, it already uses RST, you start with a blank page, and can pull in any Nim definitions you want. Only obstacle is that someone has to write the sphinx extension, which is not easy... |
13:35:39 | FromDiscord | <haxscramper> In reply to @Rika "but i'd like that": module def docs is something like https://nim-lang.org/docs/osproc.html ? |
13:35:52 | FromDiscord | <Rika> yes |
13:36:10 | FromDiscord | <haxscramper> Ah, I was referring to this as index |
13:36:18 | FromDiscord | <haxscramper> Because it is just a dump of proc signatures mostly |
13:36:25 | FromDiscord | <haxscramper> With some text put on top |
13:37:19 | FromDiscord | <haxscramper> 'prose' is https://nim-lang.org/docs/tut1.html |
13:37:21 | FromDiscord | <Rika> im starting to think that maybe its better to use a premade docgen... |
13:43:09 | FromDiscord | <nuc> @mratsim answering here. Wouldnt it be possible to use the `mut` keyword instead, to define vars as mutable? |
13:43:48 | FromDiscord | <Rika> there is `var` |
13:43:54 | FromDiscord | <nuc> Then `var` would not be needed |
13:44:07 | FromDiscord | <Rika> well why use two words if you can use one |
13:46:29 | FromDiscord | <nuc> Because then one could write `int mut a` instead of `var a: int` for example. |
13:47:17 | FromDiscord | <haxscramper> And why is this needed? Most modern language use optional trailing types for variable declarations |
13:47:19 | FromDiscord | <Rika> and why would we want that? |
13:47:36 | FromDiscord | <haxscramper> Instead of mandatory leading type like in C/C++/Java/C# |
13:47:38 | FromDiscord | <Rika> syntax is a preference |
13:48:01 | FromDiscord | <Rika> the creator of the language prefers var a: int to int mut a |
13:48:46 | FromDiscord | <mratsim> In reply to @nuc "<@!570268431522201601> answering here. Wouldnt": Your syntax doesn't mesh well with type inference |
13:50:12 | FromDiscord | <nuc> Just more straight forward to write `float32 a` than `let a = 1'f32`, in the first example one immediatly sees that the definition of float32 is explicit, while in the second example it is at the end. |
13:50:31 | FromDiscord | <nuc> @mratsim Oh ok, yeah I was curious if it is preference, or a different reason 🙂 |
13:50:44 | FromDiscord | <haxscramper> Or you can do `let a = 0.3` |
13:50:52 | FromDiscord | <nuc> (edit) "a`" => "a = 1`" |
13:51:31 | FromDiscord | <Rika> does let a: float = 1 not work? i dont recall |
13:51:37 | FromDiscord | <mratsim> it does |
13:51:40 | FromDiscord | <Rika> !eval let a: float = 1 |
13:51:42 | NimBot | <no output> |
13:51:52 | FromDiscord | <Rika> i dont see the issue then |
13:51:57 | FromDiscord | <Rika> !eval let a: float32 = 1 |
13:51:57 | FromDiscord | <mratsim> literals are coerced to the left hand type |
13:51:59 | NimBot | <no output> |
13:52:41 | FromDiscord | <haxscramper> @nuc nim is from pascal family of languages, and they have `let/var/const` sections to declare variables |
13:53:03 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TDq |
13:53:10 | FromDiscord | <haxscramper> And this is impossible to do with leading type |
13:53:42 | FromDiscord | <haxscramper> And C++ `int a, b = 12` is very iffy |
13:54:06 | FromDiscord | <haxscramper> And I don't even know if it works when you need to declare multiple variables of different type. I think it doesn't |
13:54:32 | FromDiscord | <mratsim> In reply to @haxscramper "And C++ `int a,": good recipe for introducing initialization bug |
13:54:37 | FromDiscord | <nuc> sent a code paste, see https://play.nim-lang.org/#ix=2TDr |
13:54:44 | FromDiscord | <mratsim> var > let mut |
13:54:56 | FromDiscord | <Rika> again, why two words if one works |
13:54:59 | FromDiscord | <mratsim> why do you want to type 7 characters? |
13:55:03 | FromDiscord | <haxscramper> And trailing types also work with you have multiple arguments in proc `proc test(x, y, z: float)` vs |
13:55:28 | FromDiscord | <haxscramper> Though `int x, y, z` would work just as good i suppose |
13:55:36 | FromDiscord | <Rika> especially the second version, the mut part can look confusing |
13:55:37 | FromDiscord | <haxscramper> So for proc signatures it is a draw |
13:56:02 | FromDiscord | <mratsim> not with default arguments |
13:56:24 | FromDiscord | <haxscramper> In reply to @nuc "<@!608382355454951435> I dont think": You get ambiguous grammar here. Is `mut` related to whole section or just one? It is not clear for me |
13:56:44 | FromDiscord | <nuc> @haxscramper it is just my example for a syntax, not saying its perfect |
13:57:07 | FromDiscord | <mratsim> `proc test(x = 1)` vs `proc test(int x = 1)` |
13:57:23 | FromDiscord | <haxscramper> Ye, It looks okay I guess. Well, if you factor in indentation then it should not be a problem really, but still `var` is a single keyword and it does the same |
13:57:29 | FromDiscord | <nuc> Just asking because thats how I would have designed it from a C++ perspective haha |
13:57:46 | FromDiscord | <Rika> well this is a pascal-derived language not a C one sooooo |
13:57:57 | FromDiscord | <nuc> I perfectly understand nim has been derived more from pascal in its syntax |
13:58:31 | FromDiscord | <Rika> yeah its fine |
14:00:26 | FromDiscord | <haxscramper> In reply to @mratsim "`proc test(x = 1)`": I always write types in proc signatures and think that omitting them is not the best idea. Maybe it is fine for `1` |
14:00:51 | FromDiscord | <haxscramper> But `arg: type = expr` is more common still |
14:02:10 | FromDiscord | <mratsim> usually those default arguments are true / false / 10 / bigEndian |
14:02:16 | FromDiscord | <mratsim> at least for what i write |
14:02:39 | FromDiscord | <Rika> why 10? |
14:03:07 | FromDiscord | <mratsim> 1à as in an integer |
14:03:19 | FromDiscord | <mratsim> ah 1e-5 as well |
14:03:23 | FromDiscord | <mratsim> (edit) "1à" => "10" |
14:18:18 | * | PMunch joined #nim |
14:31:01 | PMunch | Hi everyone :) |
14:36:28 | FromDiscord | <InventorMatt> Hi PMunch, how goes your work with the teensy? |
14:39:45 | timdorohin | mratsim: hello |
14:42:29 | PMunch | I was actually just about to do another stream :) |
14:42:45 | PMunch | I've been redoing the bathroom this week, so I haven't had a lot of time |
14:43:03 | * | NimBot joined #nim |
14:44:02 | timdorohin | mratsim: may i ask a quick question? should i use arraymancer or laser for simple RL task? |
14:44:30 | FromDiscord | <Rika> im betting hes gonna tell you to use arraymancer 😛 |
14:47:10 | timdorohin | afaik arraymancer needs external BLAS which i really doesn't want have around, but with laser i wold end reimplementing the wheel (backprop) manually |
14:51:51 | FromDiscord | <Ayy Lmao> So I am reading a big endian data stream that has some floating point numbers in the IEEE 754 standard. For integers I am needing to swap the endianness to get the right numbers, but I don't need to swap the floating point numbers. I have read that IEEE 754 doesn't cover the endianness problem. Will reading without swapping work on every machine? If not, how can I make sure it doesn't break on other machines? |
14:55:53 | * | krux02 joined #nim |
14:56:47 | FromDiscord | <mratsim> In reply to @timdorohin "<@570268431522201601>: may i ask": laser is a research repo |
14:57:08 | FromDiscord | <mratsim> it wasn't me who put it on nimble |
15:05:27 | PMunch | @InventorMatt, stream is live: https://www.twitch.tv/pmunche |
15:05:58 | PMunch | And for anyone else who wants to see me develop keyboard firmware in Nim (this episode is mostly about macros) |
15:14:01 | FromDiscord | <Rika> pmunch are you basing your firmware off of anything? or is this totally scratch and self-knowledge? |
15:14:15 | PMunch | It's totally from scratch |
15:14:22 | PMunch | Are you watching? |
15:14:30 | FromDiscord | <Rika> no, i cant, i have no time sorry |
15:14:39 | PMunch | Built from just C code, not even the Arduino libraries |
15:15:06 | FromDiscord | <Rika> i mean yeah but are you "basing the idea off of a current firmware" like are you reading some soruce to know where to start |
15:15:14 | FromDiscord | <Rika> because i totally dont know where to start lmao |
15:18:57 | PMunch | Not really |
15:19:08 | PMunch | I mean I am basing it off-of the normal matrix stuff |
15:19:22 | PMunch | But apart from that nothing |
15:19:27 | FromDiscord | <Mr Axilus> Does anyone know how to cast a type to a var array? I have a Vec3 (from nim-glm) and want to give it to Dear ImGUI which requires a var array[3, float32] |
15:19:47 | FromDiscord | <Rika> is vec3 an array under the hood? if not, dont cast it |
15:19:58 | FromDiscord | <Rika> make an array manually and pass that into imgui |
15:20:28 | FromDiscord | <Rika> In reply to @PMunch "Not really": okay, maybe ill just look at a tutorial to start the base idea first then, thanks |
15:20:44 | PMunch | You can always look at my video series on it :) |
15:21:19 | FromDiscord | <Mr Axilus> but wouldn't creating a separate array not update my vec3? Or are you saying I should just be storing my vectors as arrays instead of vec3 as I'm doing now |
15:21:34 | FromDiscord | <Rika> In reply to @PMunch "You can always look": i have no time for video series |
15:21:46 | FromDiscord | <Rika> if it were a text series i'd prolly be able to |
15:22:28 | FromDiscord | <Rika> In reply to @mraxilus "but wouldn't creating a": it wont, and unless vec3 is an array under the hood then you cant do anything about it i believe... |
15:22:38 | FromDiscord | <Rika> unless you resort to passing pointers around (have fun) |
15:22:58 | ForumUpdaterBot | New thread by Peheje: Array sample slower than indexing into rand(size-1), see https://forum.nim-lang.org/t/7673 |
15:23:00 | PMunch | Maybe I'll do a write-up of it as well |
15:23:03 | * | Vladar quit (Remote host closed the connection) |
15:23:12 | FromDiscord | <Mr Axilus> yikes, I'll just store as arrays, and convert to vec3 when I need to use a glm function then |
15:23:23 | FromDiscord | <Rika> In reply to @PMunch "Maybe I'll do a": i would be grateful if you did |
15:23:36 | FromDiscord | <aryn> pmuch do you use i3wm :shakyEyes: |
15:25:44 | * | Vladar joined #nim |
15:27:32 | Oddmonger | what is more costly on cpu ? An object or a tuple ? |
15:32:04 | liblq-dev | neither |
15:32:08 | liblq-dev | they're equivalent |
15:32:32 | liblq-dev | except tuples do not have ordering guarantees, field visibility, and inheritance |
15:35:34 | * | fredrikhr joined #nim |
15:36:53 | Oddmonger | ok, thank you |
15:38:03 | Oddmonger | i'd be interested to have an enum associated to a number, but i don't think it's possible without using a tuple (or an object) with the enum and the value inside |
15:38:45 | Oddmonger | the value could be the same for differents enum value, so no set here i guess |
15:40:24 | * | m4r35n357 quit (Quit: Ex-Chat) |
15:56:28 | * | timdorohin quit (Quit: Konversation terminated!) |
16:00:02 | * | stisa quit (Quit: Idle for 30+ days) |
16:07:48 | FromDiscord | <haxscramper> Oddmonger: common idiom for enum-to-T mapping is `array[Enum, T]` |
16:08:43 | FromDiscord | <haxscramper> If you need to reverse association it gets more complicated, but mapping from could be done with `array` |
16:11:16 | FromDiscord | <lumi> sent a code paste, see https://play.nim-lang.org/#ix=2TEL |
16:11:47 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TEM |
16:12:59 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TEN |
16:13:26 | FromDiscord | <haxscramper> typedefed, forward-declared struct is mapped to `.importc: "WrenLoadModuleResult"` for type |
16:14:41 | Oddmonger | ok mapping from array, thank you haxscramper |
16:15:14 | FromDiscord | <haxscramper> So |
16:15:45 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/QJZ |
16:15:58 | * | superbia joined #nim |
16:17:19 | FromDiscord | <haxscramper> @lumi It doesn't matter if something is forward-declared in C code or not, but for it to correctly compile on nim side you need to declare type first, and then procedure using this type. Or if this all is type you need `type WrenLoadModuleCompleteFn = proc( ... ) {.cdecl.}` |
16:20:30 | FromDiscord | <lumi> Ah I see, thanks! |
16:23:36 | PMunch | Is there a way to convert an identifier to the constant behind it? |
16:24:24 | saem | That would be a two pass thing, right? |
16:25:02 | PMunch | I think so |
16:39:13 | * | tane joined #nim |
16:44:05 | * | narimiran joined #nim |
16:55:10 | ForumUpdaterBot | New thread by DavidKunz: How can I quote a type with a sequence of strings, see https://forum.nim-lang.org/t/7674 |
16:58:39 | FromDiscord | <Mr Axilus> Does defering within a for loop work, or would they be excuted as soon as the scope of the for loop ends? |
16:59:28 | FromDiscord | <Mr Axilus> Eg. if I want to do cleanup on a seq of variables, do I have to do it manually, or is there any way to tell defer that it should execute on the scope a level up. |
17:21:47 | FromDiscord | <nikki> @Mr Axilus if you define the cleanup on the =destroy of the element type, it'll happen at the right time |
17:21:54 | FromDiscord | <nikki> especially with arc |
17:23:26 | PMunch | Nice, little bit of macro work on the keyboard saved about 30% of program size and cut the source code by about 40% :) |
17:34:22 | * | vicfred joined #nim |
17:37:58 | giaco__ | anybody knows how to write a "#mangle" directive for c2nim to replace '__' with '_'? |
17:39:02 | giaco__ | been trying with mangle "{.*}'__'{.*}" "$1_$2" but it replaces a bit too much, I get empty file out |
17:40:45 | * | lritter quit (Ping timeout: 264 seconds) |
17:48:35 | * | vicfred quit (Quit: Leaving) |
17:54:20 | * | Gustavo6046 quit (Remote host closed the connection) |
17:55:33 | * | Gustavo6046 joined #nim |
17:57:48 | * | sunwukon` joined #nim |
17:58:27 | * | sunwukon` quit (Client Quit) |
18:00:45 | giaco__ | solved with sed for the moment |
18:02:01 | * | sunwukon` joined #nim |
18:06:39 | * | vicfred joined #nim |
18:08:21 | * | sunwukong quit (Quit: authenticating) |
18:08:30 | * | sunwukong joined #nim |
18:08:51 | * | sunwukong is now known as Guest32848 |
18:08:57 | * | Guest32848 left #nim (#nim) |
18:11:19 | * | sunwukon` quit (Quit: ERC (IRC client for Emacs 27.1)) |
18:11:50 | * | sunwukon` joined #nim |
18:18:23 | * | abm joined #nim |
18:24:38 | * | stisa joined #nim |
18:35:38 | FromDiscord | <lantos> finding it difficult to find out the definitions of funcs and objects in vscode for imports. Anyone else know of an easy way to work out which import a definition comes from? |
18:36:30 | PMunch | Don't you have jump to definition? |
18:36:32 | PMunch | Or hover? |
18:37:12 | PMunch | In Vim with LSP I can just trigger :LspHover and it will show the signature including the module name |
18:38:51 | * | sunwukon` quit (Quit: ERC (IRC client for Emacs 27.1)) |
18:42:16 | FromDiscord | <aryn> how does defer work to close things such as files? does it run when the object is GCd? |
18:42:27 | FromDiscord | <Yardanico> defer is not related to the GC |
18:42:46 | PMunch | It's just at the end of the current scope |
18:42:53 | * | sunwukon` joined #nim |
18:42:57 | FromDiscord | <aryn> ah alright |
18:43:04 | FromDiscord | <Yardanico> internally in the compiler "defer" is transformed into a try finally block |
18:43:09 | FromDiscord | <aryn> so you could still leak with it |
18:43:13 | FromDiscord | <no name fits> In reply to @lantos "finding it difficult to": I havn't figured it out. I usually ctrl+f for the thing in whatever docs are relevant. Jump to definition only works once the module is imported, so |
18:43:14 | FromDiscord | <aryn> ahhh alright, thats fine |
18:43:35 | FromDiscord | <Yardanico> or something like that |
18:43:36 | FromDiscord | <aryn> i wasnt sure what it was actually doing so wanted to use it correctly, but i am aware of how finally blocks are run |
18:43:36 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TFQ |
18:43:41 | FromDiscord | <aryn> thanks! |
18:43:58 | FromDiscord | <lantos> In reply to @no name fits "I havn't figured it": yeah using, nim extension by naesem but I think it fails to jumpto def sometimes |
18:44:00 | PMunch | Hmm, what does this error message mean? Error: system module needs: nimErrorFlag |
18:44:28 | FromDiscord | <Yardanico> nimErrorFlag is used with --exceptions:goto |
18:44:30 | * | sunwukon` is now known as sunwukong |
18:44:32 | PMunch | Hmm |
18:44:51 | PMunch | I don't have that enabled.. |
18:44:55 | FromDiscord | <no name fits> In reply to @lantos "yeah using, nim extension": nimsaem? Works fine for me once the module is actually imported. The hard thing is figuring out which module something is a part of |
18:45:05 | PMunch | This is for the Teensy though, so plenty of weird flags.. |
18:45:33 | * | sunwukong quit (Client Quit) |
18:48:29 | FromDiscord | <no name fits> How would you go about making a templating engine that allows you to just serve it html files with some placeholder names, and cache the template so it doesn't have to do io on every request? |
18:49:29 | PMunch | If you don't need it to update based on the files you can just `readFile` them in on compile-time and embed them into your program |
18:49:50 | FromDiscord | <no name fits> Cool, thanks |
18:49:56 | PMunch | Otherwise you'd have to keep something like a table that maps filenames to strings and a timestamp |
18:50:18 | FromDiscord | <no name fits> Yeah I'm guessing I can just put that readFile result in whatever I want |
18:50:37 | PMunch | You'd still have to poll the file if it's newer than the version you have cached, but it would be faster than reading the entire file (bit depending on the size of your file) |
18:51:14 | * | a_b_m joined #nim |
18:51:28 | FromDiscord | <no name fits> There isn't a built-in way to watch a file? |
18:51:39 | * | superbia quit (Quit: WeeChat 3.1) |
18:51:52 | PMunch | Not built in, but there is this: https://github.com/FedericoCeratto/nim-fswatch |
18:52:02 | FromDiscord | <no name fits> Cool, thanks a bunch! |
18:52:09 | * | federico3 waves |
18:52:18 | FromDiscord | <no name fits> 👋 |
18:52:20 | * | PMunch waves back :) |
18:52:33 | PMunch | Do people on Discord see these now? |
18:52:49 | FromDiscord | <no name fits> I just started doing web in Nim today, so |
18:53:05 | FromDiscord | <no name fits> I'm used to MVC C# |
18:53:20 | * | PMunch shudders |
18:53:46 | FromDiscord | <Rika> We see those but they look exactly like regular messages |
18:54:00 | PMunch | Ah, not even appending the username? |
18:54:24 | FromDiscord | <no name fits> Nope, your username shows as a normal username with [IRC] appended |
18:55:08 | PMunch | Aaw, that breaks the whole point |
18:55:23 | * | abm quit (Ping timeout: 260 seconds) |
18:55:39 | PMunch | It's supposed to look like we're doing something |
18:58:37 | FromDiscord | <aryn> nope |
19:03:47 | * | PMunch quit (Quit: leaving) |
19:07:32 | FromDiscord | <lantos> In reply to @no name fits "nimsaem? Works fine for": yeah that's the one. This is what I'm having an issue with. As a temporary thing I am using github to search for the func and find the original file. |
19:07:59 | FromDiscord | <no name fits> I'm doing the same so I dunno 🤷♂️ |
19:08:05 | FromDiscord | <lantos> haha |
19:08:36 | FromDiscord | <lantos> (edit) "haha" => "haha, I might try maybe add a on hover show import in the nimnaesim" |
19:08:54 | FromDiscord | <lantos> (edit) "haha, I might try maybe add a on hover show import in the nimnaesim ... " added "if I get the chance" |
19:18:14 | FromDiscord | <Yardanico> @lantos that works for me btw |
19:18:19 | FromDiscord | <Yardanico> nimsaem has that functionality |
19:18:34 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/823274404221157406/unknown.png |
19:18:48 | FromDiscord | <Yardanico> i just hovered my mouse over it |
19:21:21 | * | sunwukong joined #nim |
19:40:14 | FromDiscord | <no name fits> But do you already have that imported? |
19:40:42 | FromDiscord | <ElegantBeef> Well yea, you kinda have to for it to resolve where it came from |
19:41:00 | FromDiscord | <no name fits> Right, he's asking for a feature where it figures out the import itself |
19:41:50 | FromDiscord | <ElegantBeef> Well that seems like it'd cause some issues considering there maybe modules in pkgs or even locally with the same proc signature + name |
19:43:42 | FromDiscord | <ElegantBeef> Then again i've always just manually added namespaces in C# 😄 |
19:44:02 | FromDiscord | <lantos> In reply to @no name fits "Right, he's asking for": this also if you put in args that don't match an def it will break the link "expression '' has no type (or is ambiguous)". maybe suggest the next best thing or closest match? |
19:44:40 | FromDiscord | <ElegantBeef> I suppose it wouldnt be bad if it doesnt auto resolve with ambiguitity |
19:45:10 | FromDiscord | <no name fits> The way the C# analyser does it, is ask you which to use |
19:46:03 | FromDiscord | <no name fits> Like you run into it all the time when using Random in Unity. It just goes "Random is ambiguous > Option 1, Option 2" |
19:46:10 | FromDiscord | <ElegantBeef> Yea i got that |
19:46:26 | FromDiscord | <no name fits> Sorry |
19:48:48 | FromDiscord | <lantos> https://github.com/saem/vscode-nim/blob/611bdb71a844b2816ec6492d09f0377c10b59203/src/nimvscode/nimSuggest.nim#L99 |
20:04:06 | ozzz | Dear all, is there any decent fcgi lib for nim? I tried to prepare old original libfcgi using c2nim, but it won't work with it. |
20:07:06 | FromDiscord | <Yardanico> honestly I'm don't know much about fcgi, but have you seen https://github.com/ba0f3/fastcgi.nim and https://github.com/mrhdias/fastkiss ? |
20:08:21 | FromDiscord | <dom96> Why are you after fcgi? |
20:08:28 | ozzz | Yardanico, yeah, but there is warning about active dev state of project. I planning to use it for production |
20:08:33 | FromDiscord | <dom96> Is HTTP + reverse proxy not enough? |
20:09:31 | ozzz | I need threads, decentralized architecture |
20:10:11 | FromDiscord | <dom96> I don't see why you'd need fcgi for that |
20:11:29 | ozzz | it helps to split web servers, apps & db to decentralize components |
20:12:13 | ozzz | using such architecture I'm able to maintain resources & balance load |
20:12:17 | FromDiscord | <dom96> how? |
20:13:12 | FromDiscord | <dom96> fcgi is just a protocol, you can use http just as well |
20:13:18 | * | PMunch joined #nim |
20:13:58 | ozzz | right, but then I will need to administrate many web servers |
20:15:08 | FromDiscord | <dom96> no, your app written in Nim will communicate with nginx (or whatever you use) with HTTP instead of fcgi |
20:15:22 | FromDiscord | <dom96> there is nothing more to administrate |
20:15:34 | FromDiscord | <no name fits> Doesn't nginx just forward the request to your app? |
20:16:01 | ozzz | fcgi allows you to maintain faulty requests |
20:16:13 | ozzz | will it work using http? |
20:17:00 | ozzz | for example web_server -> app_server1 fails |
20:17:04 | FromDiscord | <dom96> what do you mean by "faulty requests"? |
20:17:11 | ozzz | same request will be forwarded to another |
20:17:42 | FromDiscord | <dom96> that likely depends on the web server |
20:17:46 | ozzz | can reverse proxy determine if app server not works or not in network? |
20:18:07 | FromDiscord | <dom96> but I don't see why not |
20:18:42 | FromDiscord | <dom96> https://ef.gy/fastcgi-is-pointless |
20:21:22 | ozzz | Well, I not agree... but anyway. Wht you suggest to have app server which works on another machine? |
20:21:39 | ozzz | how it will communicate with web server? |
20:21:59 | ozzz | unix socets not a solution in my case |
20:22:49 | FromDiscord | <dom96> I'm not sure what you mean |
20:22:53 | FromDiscord | <dom96> but fcgi uses unix sockets too |
20:23:04 | ozzz | it uses tcp |
20:23:31 | FromDiscord | <dom96> oh you meant domain sockets |
20:23:37 | FromDiscord | <dom96> fcgi and http can use any kind of socket |
20:23:50 | FromDiscord | <dom96> and yes, primarily http uses tcp too |
20:24:01 | ozzz | fcgi app listens port 9000 for example |
20:24:29 | ozzz | web proxy transfers requests to app servers using network (tcp) |
20:24:49 | ozzz | 1 web server can work with 10 app servers |
20:25:00 | FromDiscord | <dom96> sure, you can run http on port 9000 too |
20:25:07 | ozzz | I know :) |
20:25:28 | FromDiscord | <dom96> you can run multiple app servers that expose http on various ports |
20:25:31 | ozzz | so you mean that my app written on nim should have own web server? |
20:25:34 | FromDiscord | <dom96> and then your web server can work with those app servers |
20:25:36 | FromDiscord | <dom96> over http |
20:25:42 | FromDiscord | <dom96> yes |
20:25:58 | ozzz | which web server? standalone per app server? |
20:26:18 | ozzz | or some kind of lib for nim? |
20:27:12 | FromDiscord | <dom96> you can use `asynchttpserver` which is in NIm's stdlib or any other Nim http server, like httpbeast |
20:27:54 | ozzz | dom96, thanks for suggestion. I will test how it will perform |
20:28:16 | ozzz | have you tried it? |
20:33:07 | ozzz | another problem here - as I see, no threads support |
20:34:07 | ozzz | Or maybe I'm wrong... |
20:35:07 | FromDiscord | <aryn> nim has an http server in stdlib? neat |
20:36:06 | FromDiscord | <no name fits> It also has async http |
20:37:00 | ozzz | what mean by "async"? multithreaded? |
20:38:13 | ozzz | or that it will multiple requests in one single process? |
20:38:22 | ozzz | *if |
20:38:27 | FromDiscord | <no name fits> <https://nim-lang.org/docs/asynchttpserver.html> |
20:40:05 | ozzz | I see.. maybe because I'm not native speaker of English ) |
20:40:16 | ozzz | but there is no explanation |
20:41:42 | ForumUpdaterBot | New thread by DavidKunz: Learning Nim: Macros and Pattern Matching [video], see https://forum.nim-lang.org/t/7676 |
20:42:33 | ForumUpdaterBot | New post on r/nim by David-Kunz: Learning Nim: Macros and Pattern Matching, see https://reddit.com/r/nim/comments/ma5nni/learning_nim_macros_and_pattern_matching/ |
20:45:05 | FromDiscord | <willyboar> @ozzz the truth is there is not a lot of real world examples of nim web apps (nim forum and nimble directory are some) but the numbers in benchmarks are pretty nice and someone here told me once that there is a lot of room for optimizations. |
20:47:12 | ozzz | Sure, I want to complement Nim, it's third day I started to learning it, and already created some basic functionality what I usually do |
20:48:07 | ozzz | nim is very beautiful and easy to remember |
20:49:51 | FromDiscord | <sealmove> it seems `nim rst2html` doesn't have as many capabilities as `nim doc` :( |
20:50:05 | FromDiscord | <sealmove> for example with `.. code:: nim`, the code is not highlighted |
20:51:57 | * | narimiran quit (Quit: leaving) |
20:52:39 | reversem3 | any examples of a nim programming written purely functional ? |
20:54:37 | FromDiscord | <sealmove> Hmm nvm, it does highlight. But still you don't get dark mode for example. |
21:07:07 | FromDiscord | <no name fits> Is the example within <https://nim-lang.org/docs/asynchttpserver.html> supposed to be compiled to an exe and ran from the terminal, or is it supposed to be run from a server environment? It crashes my computer when I run it from the terminal |
21:07:24 | * | haxscramper joined #nim |
21:08:01 | * | haxscramper quit (Remote host closed the connection) |
21:13:40 | FromDiscord | <willyboar> what nim version you are using? |
21:14:03 | FromDiscord | <no name fits> ``Nim Compiler Version 1.4.4 [Windows: amd64]`` |
21:14:57 | FromDiscord | <no name fits> is it a windows issue? |
21:16:06 | * | haxscramper joined #nim |
21:23:32 | * | haxscramper quit (Remote host closed the connection) |
21:27:36 | PMunch | Hmm, any good names for my Nim based keyboard firmware? |
21:28:16 | FromDiscord | <dom96> neyboard |
21:28:20 | FromDiscord | <lantos> nimboard |
21:28:21 | FromDiscord | <lantos> oh |
21:28:53 | FromDiscord | <ElegantBeef> Think pmunch said "good" names |
21:29:03 | FromDiscord | <willyboar> nimeyboard |
21:29:09 | PMunch | Haha |
21:30:42 | PMunch | Hm,m QMK stands for Quantum Mechanical Keyboard |
21:31:20 | FromDiscord | <ElegantBeef> Clearly you should name it HoneyBoard since the interface is sweet, and it takes no shit like a honey badger 😛 |
21:31:44 | PMunch | Oooh, is this my time to re-introduce the badger? |
21:31:49 | FromDiscord | <ElegantBeef> Lol |
21:32:09 | PMunch | I mean it's not like the Nim project is using him any longer :P |
21:32:28 | PMunch | BadgerBoard :P |
21:32:41 | PMunch | HoneyBoard sounds a bit sticky.. |
21:33:38 | ozzz | Wow! |
21:33:40 | PMunch | I was just about to create a repository for it and now I need a name.. |
21:33:49 | PMunch | ozzz, found something cool? |
21:34:04 | FromDiscord | <ElegantBeef> Well what you do your keyboard is between you your office walls and your keyboard |
21:34:08 | FromDiscord | <ElegantBeef> (edit) "Well what you do ... your" added "to" |
21:34:25 | ozzz | yeah! I included fcgiapp.h and nim comiler compiled FCGX_init |
21:34:46 | ozzz | it returned zero, so looks like it works |
21:35:25 | ozzz | tomorrow I will try to create multi threaded app |
21:35:28 | PMunch | Nice! Easy C interop is one of Nims many strengths :) |
21:35:49 | PMunch | Multi threading can feel a bit hairy when you're used to Nims comforts.. |
21:35:50 | ozzz | PMunch, sure, I amazed how it worked |
21:37:13 | ozzz | PMunch, I'm not afraid of headache, after C... |
21:37:49 | PMunch | Haha, good :P |
21:37:52 | ozzz | PMunch, have you tried threads in NIM? |
21:37:59 | PMunch | Yup |
21:38:00 | FromDiscord | <no name fits> So I sent the exe to a friend and it didn't work and they got up to like 12mb memory usage from the app. Also on windows. The browser just hung on the localhost:8080 request |
21:38:14 | PMunch | I use threaded embedded async Nim at work |
21:38:27 | FromDiscord | <InventorMatt> pmunch, when you finish your keyboard you should see about making an arduino cpp code equivalent to show the superiority of the nim approach |
21:38:29 | PMunch | I've tried pretty much every configuration of Nim there is :P |
21:38:42 | FromDiscord | <aryn> nim MT is super easy with the stdlib |
21:39:24 | PMunch | @InventorMatt, I was planning on just comparing it to QMK.. Rewriting the whole thing in Arduino C++ sounds a bit tedious |
21:39:38 | PMunch | But it would make for a good comparison |
21:39:43 | ozzz | PMunch, has it support of mutex locks? |
21:39:49 | PMunch | Yup |
21:39:53 | FromDiscord | <no name fits> Should I post an issue or am I missing something? |
21:39:58 | PMunch | Nim has support for pretty much everything |
21:40:05 | PMunch | There is a locks module in the standard library |
21:40:27 | PMunch | @no name fits, what code are you using? |
21:40:45 | ozzz | PMunch, awesome! Thanks a lot everybody for suggestions and help! |
21:41:20 | ozzz | If my attempt will be sucessfull, I will let you know |
21:41:39 | FromDiscord | <no name fits> The example code at <https://nim-lang.org/docs/asynchttpserver.html> and my minor rewrite <https://play.nim-lang.org/#ix=2TGP> both don't work on windows |
21:41:40 | ozzz | anyway, switching now to nim for sure... |
21:42:05 | PMunch | ozzz, I meant feel free to know if you can't get it to work either. I'm sure we'll be able to help .) |
21:42:07 | FromDiscord | <no name fits> The browser just hangs on localhost:8080 but it does stop trying to request when you close the server |
21:42:21 | ozzz | PMunch, thanks! |
21:43:24 | FromDiscord | <ElegantBeef> Lol pmunch i'm still not able to get the tinyusb example for the pico to compile so... sure "we'll help" 😛 |
21:43:27 | PMunch | Hmm, I can't even compile that @no name fits |
21:43:41 | FromDiscord | <no name fits> The official example? |
21:43:43 | PMunch | @ElegantBeef, what's your issue with it? |
21:43:46 | PMunch | @no name fits, yeah |
21:43:49 | FromDiscord | <willyboar> @no name fits I have the same problem on macos |
21:43:54 | PMunch | It says `listen` doesn't exist.. |
21:43:57 | FromDiscord | <ElegantBeef> Their C code doesnt compile |
21:44:08 | FromDiscord | <no name fits> Oh, it does compile for me |
21:44:18 | PMunch | The official RPi C code? |
21:44:27 | FromDiscord | <ElegantBeef> Yea |
21:44:53 | PMunch | @no name fits, it's super weird |
21:44:58 | FromDiscord | <ElegantBeef> `error: enumerator value for 'TUSB_DESC_CONFIG_ATT_SELF_POWERED' is not an integer constant↵ 191 | TUSB_DESC_CONFIG_ATT_SELF_POWERED = TU_BIT(6u)` |
21:44:59 | PMunch | Because it definitely does exist.. |
21:45:15 | FromDiscord | <aryn> the async http server looks pretty nice |
21:45:20 | FromDiscord | <aryn> quite simple to use |
21:45:28 | PMunch | I can even jump to definition by using nimlsp.. |
21:45:29 | FromDiscord | <ElegantBeef> `TU_BIT` is just a bitshift macro |
21:45:32 | FromDiscord | <no name fits> sent a code paste, see https://play.nim-lang.org/#ix=2TGQ |
21:46:45 | FromDiscord | <willyboar> in 1.4.4 compiles but it stucks on load. in 1.4.0 and 1.2.2 throw an error |
21:47:00 | * | a_b_m quit (Quit: Leaving) |
21:47:21 | FromDiscord | <no name fits> Anything I can do to help? I don't really know what's going wrong though |
21:47:28 | PMunch | @no name fits, got it to compile now. But same error as you have and that willyboard mentioned |
21:47:51 | PMunch | That's not great.. |
21:48:34 | FromDiscord | <willyboar> this is only for the example |
21:48:37 | PMunch | That example is definitely broken, or something else is.. |
21:49:14 | FromDiscord | <aryn> mine hangs also |
21:49:33 | FromDiscord | <willyboar> frameworks working |
21:52:51 | FromDiscord | <no name fits> which framework? |
21:55:11 | FromDiscord | <willyboar> jester, prologue and rosencrantz |
21:55:32 | FromDiscord | <no name fits> Ah, right |
21:55:57 | FromDiscord | <no name fits> Yeah I was trying to learn the async stuff from scratch before using a framework |
21:56:35 | FromDiscord | <no name fits> Anyway I need to go to bed so one of you guys is welcome to open the issue |
21:57:36 | FromDiscord | <willyboar> That means that is example issue and not asynchttpserver |
22:00:02 | PMunch | https://github.com/PMunch/badger |
22:03:53 | FromDiscord | <ElegantBeef> It's "Nim's great features" 😛 |
22:06:30 | PMunch | Damn it.. |
22:06:52 | PMunch | Tha's what I get for just quickly throwing together a readme :P |
22:07:24 | FromDiscord | <ElegantBeef> A minor grammatical mistake, literally unusable |
22:07:39 | * | sunwukong quit (Ping timeout: 246 seconds) |
22:25:34 | * | Vladar quit (Quit: Leaving) |
22:27:58 | * | fredrikhr quit (Ping timeout: 245 seconds) |
22:33:21 | FromDiscord | <jfmonty2> Is `find` an alias of some kind for `index`? I decided to rename from one to the other but missed a call, but it still worked |
22:33:52 | FromDiscord | <ElegantBeef> Find will search and return the index of the first element in the openArray |
22:34:10 | FromDiscord | <jfmonty2> hmm, my type isn't an openArray though |
22:34:34 | FromDiscord | <jfmonty2> it does contain an array as a field, but surely it's not guessing to that extent |
22:34:49 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/823323789042516019/unknown.png |
22:35:06 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/theindex.html#find there are a bunch of finds |
22:35:22 | FromDiscord | <jfmonty2> ah so just any iterable then? gotcha |
23:11:22 | FromDiscord | <zidsal> sent a code paste, see https://play.nim-lang.org/#ix= |
23:12:09 | * | ^Q-Master^ quit (Read error: Connection reset by peer) |
23:12:16 | * | Q-Master joined #nim |
23:12:43 | FromDiscord | <Yardanico> :nimRawr: |
23:14:51 | FromDiscord | <exelotl> #NotMyNimMascot |
23:17:30 | PMunch | Well we don't really have another |
23:17:56 | PMunch | Apart from this thing I guess:https://github.com/nim-lang/RFCs/issues/104 |
23:30:16 | FromDiscord | <sealmove> VSCode wrongly highlights error. The code compiles fine. |
23:31:21 | FromDiscord | <exelotl> PMunch: I actually really love that mascot still and wish it became official |
23:37:12 | PMunch | Same here |
23:37:23 | PMunch | I mean it is the closest thing we have to an official mascot |
23:37:49 | PMunch | Videos of the keyboard streams are up if anyone should want to watch them in their own time: https://www.youtube.com/watch?v=XoOp3UfKXQY |
23:38:35 | PMunch | You can click through to the "as streamed" playlist as well: https://www.youtube.com/playlist?list=PL9Yd0XwsGAqzAf1mfRVur4xy-VC8oTPfC< |
23:54:44 | * | PMunch quit (Quit: leaving) |