<< 21-03-2021 >>

00:25:40FromDiscord<treeform> In reply to @saem "I gotta get profiling": Which profiler did you end up using?
00:25:54saemtreeform: sysprof
00:26:54FromDiscord<treeform> In reply to @バロザード ""Im just going to": soon™️
00:27:35FromDiscord<treeform> In reply to @saem "<@107140179025735680>: sysprof": hmm linux only. I really wish there was a good cross-platform profiler.
00:31:03FromDiscord<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:26FromDiscord<Gary M> I'm getting an implicit copy warning on some types that I've marked with {.byref.}, is that not enough?
02:08:45FromDiscord<Gary M> passing to a sink parameter implicit copy
02:10:13leorize[m]that doesn't sound like the right way to do it
02:10:28FromDiscord<Gary M> apparently not
02:11:34FromDiscord<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:38leorize[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:37FromDiscord<Gary M> the warning persists regardless of byref
02:12:57leorize[m]yes, it requires the ownership of the object
02:13:00FromDiscord<Gary M> ah maybe I should just move() them
02:14:06leorize[m]note that even if that parameter isn't a `sink`, a copy will occur silently instead
02:14:18leorize[m]s/even//
02:14:53FromDiscord<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:06leorize[m]free them later?
02:15:13leorize[m]are you not using destructors?
02:15:15FromDiscord<Gary M> Vulkan C ffi
02:15:44FromDiscord<Gary M> I have to very explicitly call the destructors in a specific order
02:16:44leorize[m]that sounds like a pain that encapsulation won't save you from :P
02:16:52FromDiscord<Gary M> sent a code paste, see https://play.nim-lang.org/#ix=2TAZ
02:17:15FromDiscord<Gary M> moving them obviously makes the address no longer valid 😄
02:17:48leorize[m]if they contain a pointer anyway then does it matter if they're copied?
02:18:05FromDiscord<Gary M> Oh wait I can just use the index in the table
02:18:43FromDiscord<Gary M> I haven't used any `ptr` or `ref` types in my Mesh object definition so they're technically Value types?
02:19:01leorize[m]if your "value" is a pointer then does it matter?
02:20:42FromDiscord<Gary M> well yes because they also contain a nice fat sequence of vertices
02:20:59leorize[m]like a `seq` or a pointer?
02:21:07FromDiscord<Gary M> which all have position, normal, color vec3's and eventually some texcoords
02:21:12FromDiscord<Gary M> no actual sequences
02:21:27leorize[m]then what is copied exactly?
02:21:46FromDiscord<Gary M> I read them into sequences CPU side with a parser then upload them to the gpu buffer
02:22:15FromDiscord<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:41FromDiscord<Gary M> sent a code paste, see https://play.nim-lang.org/#ix=2TB0
02:23:44FromDiscord<Gary M> so here is the shortest example
02:23:59FromDiscord<Gary M> it also throws a sink copy warning there adding to renderables
02:24:38leorize[m]most likely because you are referring to `monkey` after the `add`
02:24:46FromDiscord<Gary M> actually for some reason I think that one didn't but the other one did hold on
02:24:56FromDiscord<Gary M> sent a code paste, see https://play.nim-lang.org/#ix=2TB1
02:24:56FromDiscord<Gary M> which also makes no sense to me
02:25:26FromDiscord<Gary M> that's the entire lifecycle of the `monkey` and `tri` RenderObject before the sequence is iterated
02:26:51leorize[m]have you tried to make those `let`?
02:27:31FromDiscord<Gary M> https://media.discordapp.net/attachments/371759389889003532/823019965216325693/unknown.png
02:27:44FromDiscord<Yardanico> you can use object construction syntax
02:27:58FromDiscord<Yardanico> let monkey = RenderObject(mesh: ..., material: ..., etc)
02:28:07FromDiscord<Gary M> okay, let me give it a shot then
02:31:03FromDiscord<Gary M> That seems to have done the trick.
02:31:13FromDiscord<Gary M> Why does that make all the difference?
02:32:58leorize[m]I would chalk it up to some analysis issues
02:33:58leorize[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:23leorize[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:58leorize[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:45leorize[m]anyhow, I think you'll have to figure out a way to cleanly free those buffers because currently that looks brittle
02:37:36FromDiscord<Gary M> yeah I had an issue with closures on iterator variables and never figured out why
02:37:58FromDiscord<Gary M> because I think they work the way you "would" expect in C++ lambdas
02:38:13leorize[m]this is not really well documented but the fix is usually to put the entire loop body in `closureScope()` template
02:38:29FromDiscord<Gary M> interesting. I'll try to remember that next time.
02:38:40FromDiscord<Gary M> or maybe I'll go try it now
02:39:10FromDiscord<Gary M> because I just "fixed" it by inefficiently running the same for loop inside the lambda itself lol
02:39:21leorize[m]lol
02:39:32FromDiscord<Gary M> but I think that also avoids closures...
02:41:49leorize[m]avoiding closures is kind of a no-brainer if you want to minimize allocations
02:42:31leorize[m]though I don't think Nim closures allocate much, if any
02:43:17FromDiscord<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:08leorize[m]what is this very strict deallocation requirement?
02:44:27FromDiscord<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:03FromDiscord<Gary M> So basically Vulkan has these Validation layers and whenever you forget to free a resource it'll tell you
02:45:23FromDiscord<Gary M> You have to allocate everything and free everything their way
02:45:42FromDiscord<Gary M> Creating the instance, the devices, the memory on the devices, just to name a few
02:45:46leorize[m]sounds like destructors can handle them?
02:46:04FromDiscord<Gary M> So if you destroy the device before destroying the memory on the device you're already leaking
02:46:08leorize[m]though you might have to ask Araq for a "guaranteed free on exit"
02:47:12FromDiscord<Gary M> I'm not sure if I'd be able to use destructors for everything...
02:48:09FromDiscord<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:39FromDiscord<Gary M> So it's not so simple as just make a VkDevice() and then ~VkDevice(), I don't think
02:49:40FromDiscord<Gary M> Maybe I'm missing something. I'm not very smart so that could be pretty likely lol
02:51:05FromDiscord<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:13leorize[m]sounds like you just need a `shared_ptr` to keep your `VkDevice` alive until all meshs are gone
02:52:17FromDiscord<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:45FromDiscord<Gary M> Even in C++ they don't try wrapping it in smart pointers
02:54:13FromDiscord<Gary M> So I'm just using a FIFO callback queue like one implementation I'm following.
02:54:45leorize[m]maybe you can try looking at things like rust gpu for inspiration?
02:55:06FromDiscord<Gary M> Ah that sounds outside of my mental capabilities haha
02:55:35FromDiscord<ElegantBeef> opengl isnt looking too bad now is it? 😛
02:56:11FromDiscord<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:45FromDiscord<Gary M> Hey ogl is fine but apple is shit for deprecating it
02:57:01FromDiscord<Gary M> At least with Vulkan I'm future proofed with Moltenvk
02:57:09FromDiscord<Gary M> And everything else is supported
02:57:25FromDiscord<ElegantBeef> ogl -> grvk -> moltenvk 😄
02:57:55FromDiscord<Gary M> What is Mantle
02:58:04FromDiscord<ElegantBeef> Oh that's mantle
02:58:10FromDiscord<ElegantBeef> I thought that was for opengl -> vk
02:58:28FromDiscord<ElegantBeef> Mantle was the precursor to vulkan, an AMD project that was killed off due to low adoption
02:58:43FromDiscord<Gary M> There actually is a moltengl
02:58:51FromDiscord<Gary M> And it's not free
02:59:17FromDiscord<Gary M> Also only up to opengles 2.0
02:59:32FromDiscord<Gary M> I'm confident Vulkan is worth it
02:59:51FromDiscord<Gary M> Regardless of using Vulkan or Ogl I still can't parse gltf worth jack shit lol
03:00:52FromDiscord<ElegantBeef> Read the spec and become 1 with it
03:00:59FromDiscord<Gary M> :(
03:01:11FromDiscord<Gary M> That's essentially saying "get good"
03:01:24FromDiscord<ElegantBeef> I'd never say that, only imply it
03:01:30FromDiscord<Gary M> Lol
03:07:31FromDiscord<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:52FromDiscord<Yardanico> the latter
03:07:54FromDiscord<Gary M> I ask because there's a single place where it's supposed to be running 60+ fps
03:07:57FromDiscord<Yardanico> why would the first one improve anything
03:08:04FromDiscord<Yardanico> nim iterators are inline by default anywayt
03:08:05FromDiscord<Yardanico> (edit) "anywayt" => "anyway"
03:08:32FromDiscord<Gary M> Because typically pointer arithmetic is very fast :P I didn't know if Nim iterators had overhead
03:09:07FromDiscord<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:54leorize[m]you think too much and it will get slow
03:15:32leorize[m]in terms of loop optimizations, the folks at #nim-gamedev can help you with that
03:16:47leorize[m]but here is my "how to be fast": don't do syscalls, and don't allocate.
03:17:16leorize[m]technically the prior implies the latter :P
03:18:30leorize[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:24FromDiscord<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:52FromDiscord<Gary M> I've put over 700 lines into just rendering some triangles and obj meshes without textures
03:37:55FromDiscord<clyybber> In reply to @leorize "using `let` satisfy the": the analysis doesnt care about let or var
03:38:26FromDiscord<clyybber> @Gary M Those copy hints (not warnings ;) should be hidden
03:38:34leorize[m]I'm wrong then :p
03:38:36FromDiscord<clyybber> by default I mean
03:38:45FromDiscord<clyybber> they just confuse people
03:38:56FromDiscord<Gary M> is it because I'm using orc or something 😛
03:39:04FromDiscord<Gary M> or that's just the default anyways
03:39:40FromDiscord<clyybber> yeah but dont worry about it
03:39:40FromDiscord<Gary M> also clyybber did you ever figure out how to load gltf? 😄
03:39:45FromDiscord<Gary M> I'm having massive trouble with it.
03:39:47FromDiscord<clyybber> didntry
03:39:56FromDiscord<clyybber> whats your issue?
03:40:13FromDiscord<Gary M> https://media.discordapp.net/attachments/371759389889003532/823038259000115251/unknown.png
03:40:16FromDiscord<Gary M> lol
03:40:35FromDiscord<Gary M> I didn't even bother reading the normals or anything like that
03:40:47FromDiscord<Gary M> just trying to read the vertices gave me enough trouble
03:40:48FromDiscord<clyybber> looks fine wdym :p
03:41:11FromDiscord<Gary M> it's funny because it's in the general shape of the mesh
03:41:27FromDiscord<clyybber> yeah the vertices are right
03:41:51FromDiscord<clyybber> your indices are wrong
03:41:59FromDiscord<Gary M> hm
03:43:55FromDiscord<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:52FromDiscord<Gary M> looks like something to look more into later then
03:44:57FromDiscord<Gary M> thanks
03:50:37FromDiscord<clyybber> hmm
03:50:47FromDiscord<clyybber> then the order is different?
03:51:09FromDiscord<clyybber> Maybe just diff the vertices of loaded gltf and obj
03:51:26FromDiscord<ElegantBeef> Yea the obj might have them linear, whereas the gltf may have it all over
03:56:06FromGitter<bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=6056c3d688edaa1eb8ce1c2b]
03:56:43FromGitter<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:39FromDiscord<ElegantBeef> Couldnt you just use epochTime? 😄
04:16:28*timdorohin quit (Quit: Konversation terminated!)
04:22:14*timdorohin joined #nim
04:22:56FromGitter<bung87> not sure it's nim httpclient's code
04:25:36FromDiscord<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:09FromDiscord<Gary M> The obj has all the duplicate verts and the gltf doesn't if that's the case
05:39:51FromDiscord<Gary M> how do I define comparison operators for a custom type?
05:39:58FromDiscord<Gary M> specifically `<`
05:40:52FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=
05:41:17FromDiscord<Gary M> sounds about right
05:41:21FromDiscord<Rika> `>` will be defined automatically as well i believe
05:42:00FromDiscord<Rika> "automatically" more like `>` is a generic that matches anything, body is `b < a`
05:42:06FromDiscord<Gary M> hm, this is a little tricky to do
05:42:09FromDiscord<Rika> ?
05:42:12FromDiscord<Rika> whats the issu
05:42:12FromDiscord<Rika> e
05:42:33FromDiscord<Gary M> I have a RenderObject type which has a mesh, material, and transform matrix as it's fields
05:42:48FromDiscord<Gary M> and they're held in a sequence that I want to sort by their material
05:42:49FromDiscord<Rika> oh no, complexity, im too stupid
05:43:27FromDiscord<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:53FromDiscord<Rika> implement a kind of sort priority maybe
05:43:56FromDiscord<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:18FromDiscord<Rika> but you then need == for the underlying fields too
05:44:23FromDiscord<Gary M> because currently if it's fragmented, it has to switch pipeline bindings several times per frame
05:44:33FromDiscord<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:25FromDiscord<w1n5t0n> sent a code paste, see https://play.nim-lang.org/#ix=2TC0
08:50:36FromDiscord<w1n5t0n> If I remove that option then compilation succeeds
08:53:57FromDiscord<w1n5t0n> (I should mention that I'm on Windows 10 but I'm using `eshell` in Emacs
08:57:24FromDiscord<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:34FromDiscord<w1n5t0n> Thanks, I'll switch to that and open an issue - is the ` nim-lang/Nim ` repo the right place?
09:00:55FromDiscord<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:34FromDiscord<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:51FromDiscord<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:12FromDiscord<Gary M> `not(myInt)` is equivalent to bitwise `not` right?
10:35:17FromDiscord<Rika> yes
10:35:21FromDiscord<Gary M> ty
10:35:36FromDiscord<Rika> !eval echo not 0b11110000u8
10:35:38NimBot15
10:48:20ForumUpdaterBotNew 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:39FromDiscord<Gary M> oo this c++ is evil `(void)&sceneData`
11:12:54*kenran quit (Quit: leaving)
11:13:32FromDiscord<IDF> !eval echo 0x2be or not(0x2be)
11:13:35NimBot-1
11:14:03FromDiscord<Gary M> would that be list `cast[ptr UncheckedArray[char](sceneData.addr)[1]` lol
11:14:07FromDiscord<Gary M> be like
11:14:22FromDiscord<Gary M> considering sceneData is a char
11:15:39*FromGitter quit (Read error: Connection reset by peer)
11:15:44FromDiscord<Rika> Missing a bracket after char
11:15:55FromDiscord<Rika> But I think so yeah
11:16:29FromDiscord<Gary M> yeah meant this `cast[ptr UncheckedArray[char]](sceneData)[1].addr`
11:22:16FromDiscord<Gary M> bah, how would I do pointer incrementing 😄
11:22:36FromDiscord<Gary M> sceneData += value
11:28:07FromDiscord<Rika> 200 IQ but also not very safe
11:28:16FromDiscord<Rika> Probably just increase the index?
11:29:59FromDiscord<Gary M> man yeah this is hard
11:32:23FromDiscord<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:12liblq-dev!eval echo not false
11:33:14NimBottrue
11:33:33liblq-dev`not` is just an operator like any other
11:33:35FromDiscord<Rika> I don’t see how this is problematic
11:33:49liblq-devand `false` is the right-hand side of the operator
11:34:07liblq-dev`false` could just as well be any expression you want
11:34:14FromDiscord<Goel> I don't understand the sense of using `not false` since there is only another option that is `true`
11:34:22liblq-devwell yeah
11:34:26liblq-devit's obfuscation
11:34:49liblq-devor dumb/drunk/drowsy coding
11:35:00FromDiscord<Rika> It works it’s just not practical
11:40:06FromDiscord<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:06FromDiscord<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:10FromDiscord<Gary M> ahhhhh holy shit I did it
11:44:25FromDiscord<Gary M> pointer arithmetic belongs in the trash
11:44:48FromDiscord<Gary M> sent a code paste, see https://play.nim-lang.org/#ix=2TCS
11:44:55FromDiscord<Rika> In reply to @Goel "I found it, it": oh, you mean in docs
11:45:10FromDiscord<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:35FromDiscord<Gary M> yeeep
12:08:47FromDiscord<sealmove> Is there an automatic way to release release notes?
12:09:01FromDiscord<sealmove> As docs I mean
12:10:45FromDiscord<Rika> not that i know of
12:11:23FromDiscord<sealmove> is it ok if I have a release_notes.rst in the repo? :P
12:12:13FromDiscord<Rika> the repo -> ?
12:12:38FromDiscord<sealmove> https://github.com/sealmove/binarylang
12:13:39FromDiscord<Rika> i dont see why not 😛
12:14:04FromDiscord<sealmove> me neither, I just wonder how common this is, and how people do it.
12:18:57FromDiscord<Papel> Those release notes are like the changelogs of each version, right?
12:23:52FromDiscord<Rika> In reply to @รєคɭ๓๏שє "me neither, I just": prolly not a lot, not a lot even version properly (hi) sooooo
12:28:11FromDiscord<sealmove> In reply to @Papel "Those release notes are": yes, must start doing this
12:29:16FromDiscord<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:58FromDiscord<sealmove> If you have an open PR and you make a commit, it is added to the PR automatically
12:31:52FromDiscord<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:33FromDiscord<mratsim> In reply to @no name fits "Excellent, thanks. Is there": Hacktoberfest doc maybe
12:36:43FromDiscord<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:21FromDiscord<no name fits> That's a good tip, thanks
12:52:29FromDiscord<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:46FromDiscord<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:53FromDiscord<VinKer> Docs are capsule form of knowledge. Sometimes it is good.
13:12:38FromDiscord<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:52FromDiscord<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:21FromDiscord<haxscramper> So right now the best alternative is to just search for procedures in documentation
13:14:16FromDiscord<haxscramper> I'm "working" on more useful docgen, but it is slow (because other projects etc.)
13:15:24FromDiscord<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:10FromDiscord<exelotl> @haxscramper I'm really looking forward to this ^^
13:17:07FromDiscord<haxscramper> Ye, I know it's somewhat wanted feature, and I actually should focus on this
13:17:18FromDiscord<exelotl> Custom headings under which you could group types and procs and such would be amazing. With additional prose _between_ the definitions
13:18:25FromDiscord<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:45FromDiscord<haxscramper> And I'm not sure what do you mean by "additional prose between the definitions"
13:19:33FromDiscord<VinKer> @exelotl Yes. That is what i am planning
13:22:19FromDiscord<exelotl> sent a long message, see http://ix.io/2TDe
13:25:16FromDiscord<exelotl> Maybe a Sphinx plugin would be more suitable for that sort of thing though?
13:25:27FromDiscord<haxscramper> sent a code paste, see https://paste.rs/CQ6
13:25:33FromDiscord<exelotl> Yeah
13:26:55FromDiscord<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:37FromDiscord<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:53FromDiscord<Rika> In reply to @exelotl "Custom headings under which": prose between procs would be an issue if you wanted customisable grouping
13:30:47FromDiscord<haxscramper> Why? I can just repeat proc documentation on multiple pages
13:30:50FromDiscord<haxscramper> One for whole index
13:31:08FromDiscord<haxscramper> And also any time someone links to it via `[[code:`
13:31:26FromDiscord<Rika> i mean in page customisable grouping
13:31:37FromDiscord<Rika> where a user can click something to change the grouping
13:32:27FromDiscord<haxscramper> Still don't follow how this would be a problem. Just make multiple sort options - "by tags", "by self", etc.
13:32:41FromDiscord<haxscramper> "by self" == using first type of the procedure
13:32:56FromDiscord<Rika> i guess you could hide the betweener prose if the grouping is not default
13:33:04FromDiscord<Rika> but that might be confusing
13:33:36FromDiscord<haxscramper> no. prose and full index are two differen things
13:34:07FromDiscord<haxscramper> prose is when you want to write a lot of text and occasionally link to procs
13:34:22FromDiscord<haxscramper> And full index is just total dump of absolutely everything in one place
13:34:33FromDiscord<Rika> i wasnt talking about the index
13:34:43FromDiscord<Rika> ah i guess grouping is less relevant in definition docs?
13:35:01FromDiscord<Rika> but i'd like that as well, i dont often go to the index, i go straight to module def docs...
13:35:23FromDiscord<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:39FromDiscord<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:52FromDiscord<Rika> yes
13:36:10FromDiscord<haxscramper> Ah, I was referring to this as index
13:36:18FromDiscord<haxscramper> Because it is just a dump of proc signatures mostly
13:36:25FromDiscord<haxscramper> With some text put on top
13:37:19FromDiscord<haxscramper> 'prose' is https://nim-lang.org/docs/tut1.html
13:37:21FromDiscord<Rika> im starting to think that maybe its better to use a premade docgen...
13:43:09FromDiscord<nuc> @mratsim answering here. Wouldnt it be possible to use the `mut` keyword instead, to define vars as mutable?
13:43:48FromDiscord<Rika> there is `var`
13:43:54FromDiscord<nuc> Then `var` would not be needed
13:44:07FromDiscord<Rika> well why use two words if you can use one
13:46:29FromDiscord<nuc> Because then one could write `int mut a` instead of `var a: int` for example.
13:47:17FromDiscord<haxscramper> And why is this needed? Most modern language use optional trailing types for variable declarations
13:47:19FromDiscord<Rika> and why would we want that?
13:47:36FromDiscord<haxscramper> Instead of mandatory leading type like in C/C++/Java/C#
13:47:38FromDiscord<Rika> syntax is a preference
13:48:01FromDiscord<Rika> the creator of the language prefers var a: int to int mut a
13:48:46FromDiscord<mratsim> In reply to @nuc "<@!570268431522201601> answering here. Wouldnt": Your syntax doesn't mesh well with type inference
13:50:12FromDiscord<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:31FromDiscord<nuc> @mratsim Oh ok, yeah I was curious if it is preference, or a different reason 🙂
13:50:44FromDiscord<haxscramper> Or you can do `let a = 0.3`
13:50:52FromDiscord<nuc> (edit) "a`" => "a = 1`"
13:51:31FromDiscord<Rika> does let a: float = 1 not work? i dont recall
13:51:37FromDiscord<mratsim> it does
13:51:40FromDiscord<Rika> !eval let a: float = 1
13:51:42NimBot<no output>
13:51:52FromDiscord<Rika> i dont see the issue then
13:51:57FromDiscord<Rika> !eval let a: float32 = 1
13:51:57FromDiscord<mratsim> literals are coerced to the left hand type
13:51:59NimBot<no output>
13:52:41FromDiscord<haxscramper> @nuc nim is from pascal family of languages, and they have `let/var/const` sections to declare variables
13:53:03FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TDq
13:53:10FromDiscord<haxscramper> And this is impossible to do with leading type
13:53:42FromDiscord<haxscramper> And C++ `int a, b = 12` is very iffy
13:54:06FromDiscord<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:32FromDiscord<mratsim> In reply to @haxscramper "And C++ `int a,": good recipe for introducing initialization bug
13:54:37FromDiscord<nuc> sent a code paste, see https://play.nim-lang.org/#ix=2TDr
13:54:44FromDiscord<mratsim> var > let mut
13:54:56FromDiscord<Rika> again, why two words if one works
13:54:59FromDiscord<mratsim> why do you want to type 7 characters?
13:55:03FromDiscord<haxscramper> And trailing types also work with you have multiple arguments in proc `proc test(x, y, z: float)` vs
13:55:28FromDiscord<haxscramper> Though `int x, y, z` would work just as good i suppose
13:55:36FromDiscord<Rika> especially the second version, the mut part can look confusing
13:55:37FromDiscord<haxscramper> So for proc signatures it is a draw
13:56:02FromDiscord<mratsim> not with default arguments
13:56:24FromDiscord<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:44FromDiscord<nuc> @haxscramper it is just my example for a syntax, not saying its perfect
13:57:07FromDiscord<mratsim> `proc test(x = 1)` vs `proc test(int x = 1)`
13:57:23FromDiscord<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:29FromDiscord<nuc> Just asking because thats how I would have designed it from a C++ perspective haha
13:57:46FromDiscord<Rika> well this is a pascal-derived language not a C one sooooo
13:57:57FromDiscord<nuc> I perfectly understand nim has been derived more from pascal in its syntax
13:58:31FromDiscord<Rika> yeah its fine
14:00:26FromDiscord<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:51FromDiscord<haxscramper> But `arg: type = expr` is more common still
14:02:10FromDiscord<mratsim> usually those default arguments are true / false / 10 / bigEndian
14:02:16FromDiscord<mratsim> at least for what i write
14:02:39FromDiscord<Rika> why 10?
14:03:07FromDiscord<mratsim> 1à as in an integer
14:03:19FromDiscord<mratsim> ah 1e-5 as well
14:03:23FromDiscord<mratsim> (edit) "1à" => "10"
14:18:18*PMunch joined #nim
14:31:01PMunchHi everyone :)
14:36:28FromDiscord<InventorMatt> Hi PMunch, how goes your work with the teensy?
14:39:45timdorohinmratsim: hello
14:42:29PMunchI was actually just about to do another stream :)
14:42:45PMunchI've been redoing the bathroom this week, so I haven't had a lot of time
14:43:03*NimBot joined #nim
14:44:02timdorohinmratsim: may i ask a quick question? should i use arraymancer or laser for simple RL task?
14:44:30FromDiscord<Rika> im betting hes gonna tell you to use arraymancer 😛
14:47:10timdorohinafaik 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:51FromDiscord<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:47FromDiscord<mratsim> In reply to @timdorohin "<@570268431522201601>: may i ask": laser is a research repo
14:57:08FromDiscord<mratsim> it wasn't me who put it on nimble
15:05:27PMunch@InventorMatt, stream is live: https://www.twitch.tv/pmunche
15:05:58PMunchAnd for anyone else who wants to see me develop keyboard firmware in Nim (this episode is mostly about macros)
15:14:01FromDiscord<Rika> pmunch are you basing your firmware off of anything? or is this totally scratch and self-knowledge?
15:14:15PMunchIt's totally from scratch
15:14:22PMunchAre you watching?
15:14:30FromDiscord<Rika> no, i cant, i have no time sorry
15:14:39PMunchBuilt from just C code, not even the Arduino libraries
15:15:06FromDiscord<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:14FromDiscord<Rika> because i totally dont know where to start lmao
15:18:57PMunchNot really
15:19:08PMunchI mean I am basing it off-of the normal matrix stuff
15:19:22PMunchBut apart from that nothing
15:19:27FromDiscord<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:47FromDiscord<Rika> is vec3 an array under the hood? if not, dont cast it
15:19:58FromDiscord<Rika> make an array manually and pass that into imgui
15:20:28FromDiscord<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:44PMunchYou can always look at my video series on it :)
15:21:19FromDiscord<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:34FromDiscord<Rika> In reply to @PMunch "You can always look": i have no time for video series
15:21:46FromDiscord<Rika> if it were a text series i'd prolly be able to
15:22:28FromDiscord<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:38FromDiscord<Rika> unless you resort to passing pointers around (have fun)
15:22:58ForumUpdaterBotNew thread by Peheje: Array sample slower than indexing into rand(size-1), see https://forum.nim-lang.org/t/7673
15:23:00PMunchMaybe I'll do a write-up of it as well
15:23:03*Vladar quit (Remote host closed the connection)
15:23:12FromDiscord<Mr Axilus> yikes, I'll just store as arrays, and convert to vec3 when I need to use a glm function then
15:23:23FromDiscord<Rika> In reply to @PMunch "Maybe I'll do a": i would be grateful if you did
15:23:36FromDiscord<aryn> pmuch do you use i3wm :shakyEyes:
15:25:44*Vladar joined #nim
15:27:32Oddmongerwhat is more costly on cpu ? An object or a tuple ?
15:32:04liblq-devneither
15:32:08liblq-devthey're equivalent
15:32:32liblq-devexcept tuples do not have ordering guarantees, field visibility, and inheritance
15:35:34*fredrikhr joined #nim
15:36:53Oddmongerok, thank you
15:38:03Oddmongeri'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:45Oddmongerthe 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:48FromDiscord<haxscramper> Oddmonger: common idiom for enum-to-T mapping is `array[Enum, T]`
16:08:43FromDiscord<haxscramper> If you need to reverse association it gets more complicated, but mapping from could be done with `array`
16:11:16FromDiscord<lumi> sent a code paste, see https://play.nim-lang.org/#ix=2TEL
16:11:47FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TEM
16:12:59FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TEN
16:13:26FromDiscord<haxscramper> typedefed, forward-declared struct is mapped to `.importc: "WrenLoadModuleResult"` for type
16:14:41Oddmongerok mapping from array, thank you haxscramper
16:15:14FromDiscord<haxscramper> So
16:15:45FromDiscord<haxscramper> sent a code paste, see https://paste.rs/QJZ
16:15:58*superbia joined #nim
16:17:19FromDiscord<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:30FromDiscord<lumi> Ah I see, thanks!
16:23:36PMunchIs there a way to convert an identifier to the constant behind it?
16:24:24saemThat would be a two pass thing, right?
16:25:02PMunchI think so
16:39:13*tane joined #nim
16:44:05*narimiran joined #nim
16:55:10ForumUpdaterBotNew thread by DavidKunz: How can I quote a type with a sequence of strings, see https://forum.nim-lang.org/t/7674
16:58:39FromDiscord<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:28FromDiscord<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:47FromDiscord<nikki> @Mr Axilus if you define the cleanup on the =destroy of the element type, it'll happen at the right time
17:21:54FromDiscord<nikki> especially with arc
17:23:26PMunchNice, 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:58giaco__anybody knows how to write a "#mangle" directive for c2nim to replace '__' with '_'?
17:39:02giaco__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:45giaco__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:38FromDiscord<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:30PMunchDon't you have jump to definition?
18:36:32PMunchOr hover?
18:37:12PMunchIn 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:16FromDiscord<aryn> how does defer work to close things such as files? does it run when the object is GCd?
18:42:27FromDiscord<Yardanico> defer is not related to the GC
18:42:46PMunchIt's just at the end of the current scope
18:42:53*sunwukon` joined #nim
18:42:57FromDiscord<aryn> ah alright
18:43:04FromDiscord<Yardanico> internally in the compiler "defer" is transformed into a try finally block
18:43:09FromDiscord<aryn> so you could still leak with it
18:43:13FromDiscord<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:14FromDiscord<aryn> ahhh alright, thats fine
18:43:35FromDiscord<Yardanico> or something like that
18:43:36FromDiscord<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:36FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TFQ
18:43:41FromDiscord<aryn> thanks!
18:43:58FromDiscord<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:00PMunchHmm, what does this error message mean? Error: system module needs: nimErrorFlag
18:44:28FromDiscord<Yardanico> nimErrorFlag is used with --exceptions:goto
18:44:30*sunwukon` is now known as sunwukong
18:44:32PMunchHmm
18:44:51PMunchI don't have that enabled..
18:44:55FromDiscord<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:05PMunchThis is for the Teensy though, so plenty of weird flags..
18:45:33*sunwukong quit (Client Quit)
18:48:29FromDiscord<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:29PMunchIf 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:50FromDiscord<no name fits> Cool, thanks
18:49:56PMunchOtherwise you'd have to keep something like a table that maps filenames to strings and a timestamp
18:50:18FromDiscord<no name fits> Yeah I'm guessing I can just put that readFile result in whatever I want
18:50:37PMunchYou'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:28FromDiscord<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:52PMunchNot built in, but there is this: https://github.com/FedericoCeratto/nim-fswatch
18:52:02FromDiscord<no name fits> Cool, thanks a bunch!
18:52:09*federico3 waves
18:52:18FromDiscord<no name fits> 👋
18:52:20*PMunch waves back :)
18:52:33PMunchDo people on Discord see these now?
18:52:49FromDiscord<no name fits> I just started doing web in Nim today, so
18:53:05FromDiscord<no name fits> I'm used to MVC C#
18:53:20*PMunch shudders
18:53:46FromDiscord<Rika> We see those but they look exactly like regular messages
18:54:00PMunchAh, not even appending the username?
18:54:24FromDiscord<no name fits> Nope, your username shows as a normal username with [IRC] appended
18:55:08PMunchAaw, that breaks the whole point
18:55:23*abm quit (Ping timeout: 260 seconds)
18:55:39PMunchIt's supposed to look like we're doing something
18:58:37FromDiscord<aryn> nope
19:03:47*PMunch quit (Quit: leaving)
19:07:32FromDiscord<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:59FromDiscord<no name fits> I'm doing the same so I dunno 🤷‍♂️
19:08:05FromDiscord<lantos> haha
19:08:36FromDiscord<lantos> (edit) "haha" => "haha, I might try maybe add a on hover show import in the nimnaesim"
19:08:54FromDiscord<lantos> (edit) "haha, I might try maybe add a on hover show import in the nimnaesim ... " added "if I get the chance"
19:18:14FromDiscord<Yardanico> @lantos that works for me btw
19:18:19FromDiscord<Yardanico> nimsaem has that functionality
19:18:34FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/823274404221157406/unknown.png
19:18:48FromDiscord<Yardanico> i just hovered my mouse over it
19:21:21*sunwukong joined #nim
19:40:14FromDiscord<no name fits> But do you already have that imported?
19:40:42FromDiscord<ElegantBeef> Well yea, you kinda have to for it to resolve where it came from
19:41:00FromDiscord<no name fits> Right, he's asking for a feature where it figures out the import itself
19:41:50FromDiscord<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:42FromDiscord<ElegantBeef> Then again i've always just manually added namespaces in C# 😄
19:44:02FromDiscord<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:40FromDiscord<ElegantBeef> I suppose it wouldnt be bad if it doesnt auto resolve with ambiguitity
19:45:10FromDiscord<no name fits> The way the C# analyser does it, is ask you which to use
19:46:03FromDiscord<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:10FromDiscord<ElegantBeef> Yea i got that
19:46:26FromDiscord<no name fits> Sorry
19:48:48FromDiscord<lantos> https://github.com/saem/vscode-nim/blob/611bdb71a844b2816ec6492d09f0377c10b59203/src/nimvscode/nimSuggest.nim#L99
20:04:06ozzzDear 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:06FromDiscord<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:21FromDiscord<dom96> Why are you after fcgi?
20:08:28ozzzYardanico, yeah, but there is warning about active dev state of project. I planning to use it for production
20:08:33FromDiscord<dom96> Is HTTP + reverse proxy not enough?
20:09:31ozzzI need threads, decentralized architecture
20:10:11FromDiscord<dom96> I don't see why you'd need fcgi for that
20:11:29ozzzit helps to split web servers, apps & db to decentralize components
20:12:13ozzzusing such architecture I'm able to maintain resources & balance load
20:12:17FromDiscord<dom96> how?
20:13:12FromDiscord<dom96> fcgi is just a protocol, you can use http just as well
20:13:18*PMunch joined #nim
20:13:58ozzzright, but then I will need to administrate many web servers
20:15:08FromDiscord<dom96> no, your app written in Nim will communicate with nginx (or whatever you use) with HTTP instead of fcgi
20:15:22FromDiscord<dom96> there is nothing more to administrate
20:15:34FromDiscord<no name fits> Doesn't nginx just forward the request to your app?
20:16:01ozzzfcgi allows you to maintain faulty requests
20:16:13ozzzwill it work using http?
20:17:00ozzzfor example web_server -> app_server1 fails
20:17:04FromDiscord<dom96> what do you mean by "faulty requests"?
20:17:11ozzzsame request will be forwarded to another
20:17:42FromDiscord<dom96> that likely depends on the web server
20:17:46ozzzcan reverse proxy determine if app server not works or not in network?
20:18:07FromDiscord<dom96> but I don't see why not
20:18:42FromDiscord<dom96> https://ef.gy/fastcgi-is-pointless
20:21:22ozzzWell, I not agree... but anyway. Wht you suggest to have app server which works on another machine?
20:21:39ozzzhow it will communicate with web server?
20:21:59ozzzunix socets not a solution in my case
20:22:49FromDiscord<dom96> I'm not sure what you mean
20:22:53FromDiscord<dom96> but fcgi uses unix sockets too
20:23:04ozzzit uses tcp
20:23:31FromDiscord<dom96> oh you meant domain sockets
20:23:37FromDiscord<dom96> fcgi and http can use any kind of socket
20:23:50FromDiscord<dom96> and yes, primarily http uses tcp too
20:24:01ozzzfcgi app listens port 9000 for example
20:24:29ozzzweb proxy transfers requests to app servers using network (tcp)
20:24:49ozzz1 web server can work with 10 app servers
20:25:00FromDiscord<dom96> sure, you can run http on port 9000 too
20:25:07ozzzI know :)
20:25:28FromDiscord<dom96> you can run multiple app servers that expose http on various ports
20:25:31ozzzso you mean that my app written on nim should have own web server?
20:25:34FromDiscord<dom96> and then your web server can work with those app servers
20:25:36FromDiscord<dom96> over http
20:25:42FromDiscord<dom96> yes
20:25:58ozzzwhich web server? standalone per app server?
20:26:18ozzzor some kind of lib for nim?
20:27:12FromDiscord<dom96> you can use `asynchttpserver` which is in NIm's stdlib or any other Nim http server, like httpbeast
20:27:54ozzzdom96, thanks for suggestion. I will test how it will perform
20:28:16ozzzhave you tried it?
20:33:07ozzzanother problem here - as I see, no threads support
20:34:07ozzzOr maybe I'm wrong...
20:35:07FromDiscord<aryn> nim has an http server in stdlib? neat
20:36:06FromDiscord<no name fits> It also has async http
20:37:00ozzzwhat mean by "async"? multithreaded?
20:38:13ozzzor that it will multiple requests in one single process?
20:38:22ozzz*if
20:38:27FromDiscord<no name fits> <https://nim-lang.org/docs/asynchttpserver.html>
20:40:05ozzzI see.. maybe because I'm not native speaker of English )
20:40:16ozzzbut there is no explanation
20:41:42ForumUpdaterBotNew thread by DavidKunz: Learning Nim: Macros and Pattern Matching [video], see https://forum.nim-lang.org/t/7676
20:42:33ForumUpdaterBotNew 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:05FromDiscord<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:12ozzzSure, 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:07ozzznim is very beautiful and easy to remember
20:49:51FromDiscord<sealmove> it seems `nim rst2html` doesn't have as many capabilities as `nim doc` :(
20:50:05FromDiscord<sealmove> for example with `.. code:: nim`, the code is not highlighted
20:51:57*narimiran quit (Quit: leaving)
20:52:39reversem3any examples of a nim programming written purely functional ?
20:54:37FromDiscord<sealmove> Hmm nvm, it does highlight. But still you don't get dark mode for example.
21:07:07FromDiscord<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:40FromDiscord<willyboar> what nim version you are using?
21:14:03FromDiscord<no name fits> ``Nim Compiler Version 1.4.4 [Windows: amd64]``
21:14:57FromDiscord<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:36PMunchHmm, any good names for my Nim based keyboard firmware?
21:28:16FromDiscord<dom96> neyboard
21:28:20FromDiscord<lantos> nimboard
21:28:21FromDiscord<lantos> oh
21:28:53FromDiscord<ElegantBeef> Think pmunch said "good" names
21:29:03FromDiscord<willyboar> nimeyboard
21:29:09PMunchHaha
21:30:42PMunchHm,m QMK stands for Quantum Mechanical Keyboard
21:31:20FromDiscord<ElegantBeef> Clearly you should name it HoneyBoard since the interface is sweet, and it takes no shit like a honey badger 😛
21:31:44PMunchOooh, is this my time to re-introduce the badger?
21:31:49FromDiscord<ElegantBeef> Lol
21:32:09PMunchI mean it's not like the Nim project is using him any longer :P
21:32:28PMunchBadgerBoard :P
21:32:41PMunchHoneyBoard sounds a bit sticky..
21:33:38ozzzWow!
21:33:40PMunchI was just about to create a repository for it and now I need a name..
21:33:49PMunchozzz, found something cool?
21:34:04FromDiscord<ElegantBeef> Well what you do your keyboard is between you your office walls and your keyboard
21:34:08FromDiscord<ElegantBeef> (edit) "Well what you do ... your" added "to"
21:34:25ozzzyeah! I included fcgiapp.h and nim comiler compiled FCGX_init
21:34:46ozzzit returned zero, so looks like it works
21:35:25ozzztomorrow I will try to create multi threaded app
21:35:28PMunchNice! Easy C interop is one of Nims many strengths :)
21:35:49PMunchMulti threading can feel a bit hairy when you're used to Nims comforts..
21:35:50ozzzPMunch, sure, I amazed how it worked
21:37:13ozzzPMunch, I'm not afraid of headache, after C...
21:37:49PMunchHaha, good :P
21:37:52ozzzPMunch, have you tried threads in NIM?
21:37:59PMunchYup
21:38:00FromDiscord<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:14PMunchI use threaded embedded async Nim at work
21:38:27FromDiscord<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:29PMunchI've tried pretty much every configuration of Nim there is :P
21:38:42FromDiscord<aryn> nim MT is super easy with the stdlib
21:39:24PMunch@InventorMatt, I was planning on just comparing it to QMK.. Rewriting the whole thing in Arduino C++ sounds a bit tedious
21:39:38PMunchBut it would make for a good comparison
21:39:43ozzzPMunch, has it support of mutex locks?
21:39:49PMunchYup
21:39:53FromDiscord<no name fits> Should I post an issue or am I missing something?
21:39:58PMunchNim has support for pretty much everything
21:40:05PMunchThere is a locks module in the standard library
21:40:27PMunch@no name fits, what code are you using?
21:40:45ozzzPMunch, awesome! Thanks a lot everybody for suggestions and help!
21:41:20ozzzIf my attempt will be sucessfull, I will let you know
21:41:39FromDiscord<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:40ozzzanyway, switching now to nim for sure...
21:42:05PMunchozzz, 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:07FromDiscord<no name fits> The browser just hangs on localhost:8080 but it does stop trying to request when you close the server
21:42:21ozzzPMunch, thanks!
21:43:24FromDiscord<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:27PMunchHmm, I can't even compile that @no name fits
21:43:41FromDiscord<no name fits> The official example?
21:43:43PMunch@ElegantBeef, what's your issue with it?
21:43:46PMunch@no name fits, yeah
21:43:49FromDiscord<willyboar> @no name fits I have the same problem on macos
21:43:54PMunchIt says `listen` doesn't exist..
21:43:57FromDiscord<ElegantBeef> Their C code doesnt compile
21:44:08FromDiscord<no name fits> Oh, it does compile for me
21:44:18PMunchThe official RPi C code?
21:44:27FromDiscord<ElegantBeef> Yea
21:44:53PMunch@no name fits, it's super weird
21:44:58FromDiscord<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:59PMunchBecause it definitely does exist..
21:45:15FromDiscord<aryn> the async http server looks pretty nice
21:45:20FromDiscord<aryn> quite simple to use
21:45:28PMunchI can even jump to definition by using nimlsp..
21:45:29FromDiscord<ElegantBeef> `TU_BIT` is just a bitshift macro
21:45:32FromDiscord<no name fits> sent a code paste, see https://play.nim-lang.org/#ix=2TGQ
21:46:45FromDiscord<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:21FromDiscord<no name fits> Anything I can do to help? I don't really know what's going wrong though
21:47:28PMunch@no name fits, got it to compile now. But same error as you have and that willyboard mentioned
21:47:51PMunchThat's not great..
21:48:34FromDiscord<willyboar> this is only for the example
21:48:37PMunchThat example is definitely broken, or something else is..
21:49:14FromDiscord<aryn> mine hangs also
21:49:33FromDiscord<willyboar> frameworks working
21:52:51FromDiscord<no name fits> which framework?
21:55:11FromDiscord<willyboar> jester, prologue and rosencrantz
21:55:32FromDiscord<no name fits> Ah, right
21:55:57FromDiscord<no name fits> Yeah I was trying to learn the async stuff from scratch before using a framework
21:56:35FromDiscord<no name fits> Anyway I need to go to bed so one of you guys is welcome to open the issue
21:57:36FromDiscord<willyboar> That means that is example issue and not asynchttpserver
22:00:02PMunchhttps://github.com/PMunch/badger
22:03:53FromDiscord<ElegantBeef> It's "Nim's great features" 😛
22:06:30PMunchDamn it..
22:06:52PMunchTha's what I get for just quickly throwing together a readme :P
22:07:24FromDiscord<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:21FromDiscord<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:52FromDiscord<ElegantBeef> Find will search and return the index of the first element in the openArray
22:34:10FromDiscord<jfmonty2> hmm, my type isn't an openArray though
22:34:34FromDiscord<jfmonty2> it does contain an array as a field, but surely it's not guessing to that extent
22:34:49FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/823323789042516019/unknown.png
22:35:06FromDiscord<ElegantBeef> https://nim-lang.org/docs/theindex.html#find there are a bunch of finds
22:35:22FromDiscord<jfmonty2> ah so just any iterable then? gotcha
23:11:22FromDiscord<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:43FromDiscord<Yardanico> :nimRawr:
23:14:51FromDiscord<exelotl> #NotMyNimMascot
23:17:30PMunchWell we don't really have another
23:17:56PMunchApart from this thing I guess:https://github.com/nim-lang/RFCs/issues/104
23:30:16FromDiscord<sealmove> VSCode wrongly highlights error. The code compiles fine.
23:31:21FromDiscord<exelotl> PMunch: I actually really love that mascot still and wish it became official
23:37:12PMunchSame here
23:37:23PMunchI mean it is the closest thing we have to an official mascot
23:37:49PMunchVideos 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:35PMunchYou 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)