00:06:53 | FromDiscord | <morgan> i feel like it would be possible to have an external forum and a forum channel bridged in some way |
00:07:16 | FromDiscord | <Yardanico> i think it would kinda be too spammy for the nim forum then :P but yeah of course it's possible, you could just make a fake user to post on the nim forum |
00:15:09 | FromDiscord | <morgan> i mean like a new post in a forum channel becoming a new post on the forum site, and any messages in each synced between them |
00:40:55 | * | Jjp137 quit (Ping timeout: 276 seconds) |
00:50:00 | * | Jjp137 joined #nim |
00:52:44 | * | derpydoo joined #nim |
01:18:06 | * | nanxiao joined #nim |
01:43:59 | NimEventer | New thread by alexeypetrushin: Strange behavior of nre.replace?, see https://forum.nim-lang.org/t/10050 |
02:25:02 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
02:27:42 | * | Lord_Nightmare joined #nim |
02:49:01 | * | nanxiao quit (Quit: Client closed) |
02:51:59 | * | nanxiao joined #nim |
03:56:20 | * | Jjp137 quit (Ping timeout: 250 seconds) |
03:56:38 | * | Jjp137 joined #nim |
04:13:19 | * | nanxiao quit (Quit: Client closed) |
04:13:36 | * | Guest86 joined #nim |
04:14:22 | * | Guest86 quit (Client Quit) |
04:18:10 | * | xet7 joined #nim |
04:40:57 | * | arkurious quit (Quit: Leaving) |
05:23:47 | * | advesperacit joined #nim |
05:33:26 | * | nanxiao joined #nim |
05:48:47 | * | beholders_eye quit (Ping timeout: 264 seconds) |
06:18:43 | * | nanxiao quit (Quit: Client closed) |
06:41:05 | * | PMunch joined #nim |
06:41:26 | * | ltriant quit (Ping timeout: 250 seconds) |
06:45:08 | * | rockcavera quit (Remote host closed the connection) |
06:50:11 | * | nanxiao joined #nim |
07:12:09 | * | Notxor joined #nim |
07:58:32 | FromDiscord | <morgan> running some boxy examples and i think im gonna need to figure out framerate limiting lol |
07:58:59 | FromDiscord | <morgan> love it when a basic demo with a couple images uses a full core of cpu |
08:01:36 | PMunch | Wild guess is that you don't actually limit it to a framerate |
08:02:00 | PMunch | So it just tries to render as fast as possible, meaning 100% utilization |
08:02:15 | FromDiscord | <morgan> my guess was every frame increment a number, if it's above some value reset and call the do stuff proc |
08:02:23 | FromDiscord | <morgan> instead of calling whatever every frame |
08:02:47 | PMunch | Well, depends on how you want stuff to work |
08:03:22 | FromDiscord | <morgan> yeah i;d need to make sure inputs were handled more often |
08:03:56 | PMunch | One fairly common way of doing it is having a frame limiter set to e.g. 60 FPS. Then when you start your loop you record the time, at the end of the loop you record the time and see how big the difference is. Now if the difference is smaller than 1/60 you sleep for the remaining time until the next frame. |
08:04:15 | FromDiscord | <morgan> yeah |
08:04:42 | FromDiscord | <morgan> i don't really care about the fps for this rn |
08:04:51 | FromDiscord | <morgan> i was considering just outputting a png tbh |
08:05:16 | FromDiscord | <morgan> so if it's somewhere between 5 and 30 fps that's ok |
08:05:40 | FromDiscord | <morgan> in fact i might first do png output |
08:05:56 | FromDiscord | <morgan> tho it would be nice to have a gui eventually |
08:06:05 | FromDiscord | <Rika> In reply to @PMunch "One fairly common way": or you just run another loop without rendering lol |
08:07:01 | FromDiscord | <morgan> probably even better to use some sleep proc to have whatever wake up the thread when it's time |
08:08:31 | PMunch | Oh sure, if you have other work then you can run that instead |
08:08:39 | PMunch | The GC used to be a common choice |
08:08:54 | PMunch | Not sure how relevant that is with ARC, but ORC might still be applicable |
08:09:18 | FromDiscord | <morgan> so the gui is to show a graph, which is so i can then have some way of seeing if my later code works |
08:09:20 | PMunch | But yeah, a rendering thread with sleeping and then game logic on a separate thread is another option |
08:09:54 | PMunch | Or do your main loop asynchronously and use sleepAsync for your UI loop |
08:10:09 | FromDiscord | <morgan> im not planning on having this stuff be visualized past development, but i do want some for later stuff |
08:10:30 | PMunch | But be aware of the caveats about co-operative multi-tasking (outlined for example in my article on async) |
08:11:39 | FromDiscord | <morgan> the end goal is to input some function and a list of electronics parts and it runs evolution on it to create a circuit that matches the function as closely as possible, showing some stats and maybe showing what the best one looks like |
08:12:20 | FromDiscord | <Elegantbeef> I assume boxy uses windy so i guess it does not have a builtin method to lock the framerate? |
08:12:35 | FromDiscord | <morgan> and i had so many issues with getting ngspice working that i decided i would just write my own basic circuit simulator lmao |
08:12:42 | FromDiscord | <morgan> so that's what i'm working on now |
08:12:44 | FromDiscord | <morgan> well |
08:12:58 | FromDiscord | <morgan> i'm working on stuff to help me debug it as i work on it more |
08:14:43 | FromDiscord | <morgan> circuit graph -> simplify -> non-ideal parts to several ideal (basically splicing in another mini graph) -> simplify -> possibly split up into separate sections -> ?? -> solve -> profit |
08:15:11 | FromDiscord | <morgan> and i wanna be able to see the graph to make sure i'm working with it correctly |
08:18:03 | PMunch | @Elegantbeef, looks like it. It sits at pretty much exactly 60FPS |
08:21:40 | FromDiscord | <Elegantbeef> Oh yea it has a vsync arg |
08:23:01 | PMunch | Hmm, the docs link to nimdocs.com, but that seems to be down.. |
08:23:12 | FromDiscord | <morgan> yeah it's been down for me all day |
08:23:21 | PMunch | Never seen that page before |
08:23:23 | PMunch | Who runs it? |
08:23:27 | FromDiscord | <morgan> seems to just make `nim doc` available online |
08:23:32 | FromDiscord | <morgan> treeform |
08:23:40 | PMunch | Oh nice |
08:23:49 | FromDiscord | <morgan> yea it looks cool |
08:23:59 | PMunch | I guess it's something we should think about getting into the officially maintained infrastructure |
08:24:22 | FromDiscord | <morgan> yea, esp with better hosting lol |
08:24:38 | FromDiscord | <morgan> idk if it's an issue on the hosting or the code crashes |
08:24:44 | FromDiscord | <Elegantbeef> Well the nimble directory is supposed to but it bugs out |
08:24:50 | FromDiscord | <morgan> i saw some messages in hte past about it being down |
08:25:21 | PMunch | Hmm, tried passing `vsync = false` and it still runs at 60 FPS |
08:25:54 | PMunch | The playground is also official and it crashes all the time because the server is so whimpy.. |
08:26:03 | PMunch | I guess it's time to get some new servers |
08:26:03 | FromDiscord | <morgan> rip |
08:27:47 | FromDiscord | <Elegantbeef> Hmph ticking nim to version 1.9.3 seems to have caused all the official docs to go there |
08:28:09 | FromDiscord | <Yardanico> oops |
08:32:09 | FromDiscord | <morgan> my modification of the `basic_windy` example to show fps (i think it was showing fps) was 120-160, tho it was changing super fast so that's only a guess |
08:33:59 | FromDiscord | <Elegantbeef> I mean you could just store the time of last frame then do `1/dt` š |
08:34:08 | FromDiscord | <morgan> that's what i did |
08:34:19 | FromDiscord | <Elegantbeef> Average it! |
08:34:22 | FromDiscord | <morgan> start of last frame to start of this frame |
08:34:30 | FromDiscord | <morgan> that's what i was gonna do next |
08:35:07 | PMunch | This is what I did to benchmark: http://ix.io/4sj0/ |
08:35:26 | PMunch | Bug again, that runs at 60 FPS here no matter the vsync = false.. |
08:36:56 | PMunch | Haha, apparently an Nvidia driver setting |
08:37:06 | PMunch | Disabling it and Boxy now runs at ~2000 FPS |
08:37:11 | FromDiscord | <morgan> lmao |
08:38:19 | PMunch | And it takes 100% CPU and the terminal uses 125% CPU :P |
08:38:28 | PMunch | Apparently my terminal emulator is multi-threaded |
08:39:06 | FromDiscord | <morgan> weird that it's maxing out at like 45% usage on that thread |
08:39:39 | PMunch | What do you mean? |
08:39:52 | * | derpydoo quit (Quit: derpydoo) |
08:40:17 | FromDiscord | <morgan> im seeing 140-150 fps and the thread is at 45% |
08:40:45 | FromDiscord | <morgan> if it was just cpu limited it would instead go to like 300 fps and use the whole core |
08:41:07 | PMunch | And you did vsync = false? |
08:41:18 | FromDiscord | <morgan> no where do i put that |
08:41:27 | FromDiscord | <morgan> i didn't see vsync in the example |
08:41:33 | PMunch | Look at the code I shared |
08:41:38 | FromDiscord | <morgan> ok |
08:42:10 | FromDiscord | <morgan> ah ok |
08:43:14 | * | nanxiao quit (Quit: Client closed) |
08:43:18 | FromDiscord | <morgan> lol idk what it's doing, it's maxed out the thread (or nearly) and only went to like 160 fps |
08:43:59 | PMunch | You've got slow threads I guess :P |
08:44:37 | FromDiscord | <morgan> weird it';s twice the cpu for like another tenth of performance |
08:44:54 | FromDiscord | <morgan> and yea not the latest cpu |
08:46:08 | * | derpydoo joined #nim |
08:46:17 | FromDiscord | <morgan> not really an issue that im getting only 160 fps, display doesn't go that high and i don't care about that much fps, esp for this |
08:47:57 | FromDiscord | <morgan> for everything after the stuff with displaying a graph with spring forces to unbunch it, i'll probably explicitly run the display proc instead of running it constantly |
08:49:23 | * | nanxiao joined #nim |
08:50:15 | FromDiscord | <morgan> but it's late i think that'll be for tomorrow |
08:52:50 | PMunch | Hmm, have anyone made a generic "config" thing in Nim. Basically consume YAML, TOML, JSON, whatever, and have a common API to read it? |
08:56:45 | * | derpydoo quit (Ping timeout: 260 seconds) |
08:57:05 | * | derpydoo joined #nim |
09:01:57 | FromDiscord | <Elegantbeef> Disruptek's frosty is probably a good base for that |
09:01:57 | FromDiscord | <Elegantbeef> It's very serde like |
09:08:47 | PMunch | Hmm |
09:09:59 | FromDiscord | <ricky> In reply to @Elegantbeef "It's very serde like": huge if true |
09:10:39 | FromDiscord | <Elegantbeef> Well the issue with frosty is that no one uses it |
09:16:54 | PMunch | That's really to serialize and deserialize native objects though.. |
09:20:36 | FromDiscord | <deeuu> Here's a new package I stumbled upon the other day: https://github.com/gabbhack/deser . Looks like JSON only atm |
09:30:01 | FromDiscord | <narimiran> Nim 2.0 RC2 is out:āµhttps://nim-lang.org/blog/2023/03/31/version-20-rc2.html |
09:32:11 | PMunch | Those error messages takes my brain way too long to parse.. |
09:32:14 | NimEventer | New thread by miran: Nim v2.0.0 RC2 is out, see https://forum.nim-lang.org/t/10051 |
09:33:24 | PMunch | And why is there no choosenim install guide? |
09:34:28 | FromDiscord | <ringabout> In reply to @PMunch "And why is there": https://github.com/dom96/choosenim/pull/317 |
09:34:48 | FromDiscord | <ringabout> It might not work if building from csource. |
09:34:58 | PMunch | Right.. |
09:35:22 | PMunch | So we need to clone or transfer choosenim from dom so we can keep it up to date.. |
09:37:50 | FromDiscord | <ringabout> Yeah |
09:41:51 | FromDiscord | <System64 ~ Flandre Scarlet> Oh my! Nim 2 is coming soon!! |
10:06:10 | * | derpydoo quit (Quit: derpydoo) |
10:09:07 | * | nanxiao quit (Quit: Client closed) |
10:12:52 | Amun-Ra | do you often return gc types annotated with owned? |
10:13:34 | FromDiscord | <djazz> `choosenim update stable` gives 1.9.3 š |
10:13:49 | FromDiscord | <djazz> I guess this is v2 rc2? |
10:15:05 | FromDiscord | <djazz> stable and devel give same hash in nim -v š makes sence since they are identical still |
10:29:06 | * | junaid_ joined #nim |
10:34:54 | * | junaid_ quit (Remote host closed the connection) |
10:35:28 | PMunch | I don't think devel and rc2 is the same though |
10:37:35 | * | azimut_ joined #nim |
10:39:56 | * | azimut quit (Ping timeout: 255 seconds) |
10:44:31 | * | jmdaemon quit (Ping timeout: 252 seconds) |
10:55:09 | FromDiscord | <djazz> Latest devel build |
10:55:24 | FromDiscord | <djazz> It builds daily (nightly) right? |
11:39:44 | * | ltriant joined #nim |
11:50:14 | FromDiscord | <Zoom> Yeah, the lack of common APIs is disturbing. That's one of the strong sides of Rust's ecosystem\: find a trait/bunch of them in stdlib and write your own thing implementing it, and it all composes great.āµ(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
11:51:36 | FromDiscord | <Zoom> Am I the only one concerned with positional inits? I don't think I'm convincing enough to argue against them alone \:D. |
11:58:11 | PMunch | positional inits? |
12:01:02 | PMunch | Hmm, the YAML library doesn't have any other type than strings |
12:01:54 | FromDiscord | <Zoom> https://github.com/nim-lang/Nim/pull/21559 and https://github.com/nim-lang/RFCs/issues/418#issuecomment-1483896436āµ(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
12:09:13 | FromDiscord | <pietroppeter> In reply to @Zoom "Yeah, the lack of": I started to work some time ago on a Jsony inspired Yaml version but then had to stop (I should make that repo public), if we also make a Tomly it should be rather easy to add a common layer |
12:10:06 | FromDiscord | <pietroppeter> In reply to @PMunch "Hmm, have anyone made": ā¦I was trying to reply to this message by Pmunch |
12:10:32 | FromDiscord | <firasuke> When will forward declarations be removed? |
12:18:48 | FromDiscord | <ringabout> In reply to @firasuke "When will forward declarations": 2023 or 2024, which is on the roadmap anyway. |
12:19:52 | FromDiscord | <ringabout> It has been written on the Roadmap => https://github.com/nim-lang/RFCs/issues/503 |
12:20:03 | FromDiscord | <firasuke> Oh ok cool |
12:29:43 | FromDiscord | <firasuke> Nice, Nim 2.0.0 is on its way, getting better and better! |
12:50:00 | * | rockcavera joined #nim |
12:56:55 | PMunch | @pietroppeter, it would be nice to have a common parser architecture |
12:58:05 | * | rockcavera quit (Read error: Connection reset by peer) |
12:59:19 | * | rockcavera joined #nim |
12:59:19 | * | rockcavera quit (Changing host) |
12:59:19 | * | rockcavera joined #nim |
13:00:24 | FromDiscord | <pietroppeter> This is the repo I was referring to, should be public now: https://github.com/pietroppeter/yamly (there is very little code at the moment but the approach is rather straightforward) |
13:02:07 | FromDiscord | <pietroppeter> To be honest I am not sure I feel the need of a common layer (I like json for machine generated and machine consumed data, toml for simple configuration, yaml for manually produced data or more complex configuration), but once the building blocks are there, why not š |
13:02:42 | FromDiscord | <pietroppeter> But I do like a lot the approach of jsony |
13:03:02 | FromDiscord | <pietroppeter> (edit) "But" => "And" |
13:03:50 | FromDiscord | <pietroppeter> Btw speaking of which @treeform there are a couple of PR of mine in jsony that are ready for review, in case you are interested š |
13:12:07 | * | progranner joined #nim |
13:14:07 | * | progranner quit (Read error: Connection reset by peer) |
13:18:58 | FromDiscord | <kcvinker> What's the nim equivalent of `size_t` ? |
13:19:15 | FromDiscord | <ringabout> It should be `csize_t` |
13:19:30 | FromDiscord | <kcvinker> In reply to @ringabout "It should be `csize_t`": Thanks |
13:23:50 | FromDiscord | <kcvinker> How to import a function from `wchar.h` header file ? |
13:31:02 | * | fredrikhr quit (Quit: Disconnecting...) |
13:32:21 | FromDiscord | <michaelb.eth> In reply to @kcvinker "How to import a": I'm doing it like this: https://github.com/michaelsbradleyjr/nim-notcurses/blob/master/notcurses/abi/constants.nim#L18-L32 |
13:40:32 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4skf |
13:41:57 | FromDiscord | <ringabout> In reply to @michaelb.eth "fwiw, `choosenim '#version-2-0'` builds": Yeah, it works for me. But it might cause some issues => https://forum.nim-lang.org/t/9746#64114 |
13:44:28 | NimEventer | New thread by ringabout: RFC: compiler support for object construction shorthand (full fields initializer), see https://forum.nim-lang.org/t/10052 |
13:47:41 | FromDiscord | <kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4skh |
13:52:11 | FromDiscord | <michaelb.eth> In reply to @kcvinker "This is my problem.": `wcslen` is the one defined by `wchar.h` or a different one? |
13:52:37 | FromDiscord | <kcvinker> No. `dynlib` takes a lib name |
13:52:47 | FromDiscord | <michaelb.eth> that's not what I'm asking š |
13:53:02 | FromDiscord | <michaelb.eth> where is the `wcslen` defined that you want to import? |
13:53:03 | FromDiscord | <kcvinker> defined in `wchar.h |
13:53:07 | FromDiscord | <kcvinker> (edit) "`wchar.h" => "`wchar.h`" |
13:53:24 | * | jmdaemon joined #nim |
13:56:05 | FromDiscord | <kcvinker> I tried `<wchar.h> & `wchar.h` |
13:56:07 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4skn |
13:56:30 | FromDiscord | <kcvinker> In reply to @michaelb.eth "I'm looking at https://en.wikibooks.org/wiki/C_Prog": Thanks. Let me try |
13:57:19 | FromDiscord | <michaelb.eth> note that I used `Wchar` there, so you'll need to change it to however you're defining the `wchar_t` type, or do it like I did it in the nim code I linked above |
13:57:25 | FromDiscord | <kcvinker> In reply to @michaelb.eth "I'm looking at https://en.wikibooks.org/wiki/C_Prog": Yep ! worked |
13:57:31 | FromDiscord | <michaelb.eth> cool! |
13:57:46 | FromDiscord | <kcvinker> In reply to @michaelb.eth "note that I used": Okay |
14:00:25 | * | jmdaemon quit (Ping timeout: 276 seconds) |
14:09:11 | * | PMunch quit (Quit: Leaving) |
14:36:08 | * | jmdaemon joined #nim |
14:47:52 | * | ltriant quit (Ping timeout: 276 seconds) |
14:51:54 | FromDiscord | <etra> In reply to @Zoom "Yeah, the lack of": I haven't written that much Nim, but I think API design is one of the reasons I haven't. It's really hard to design common APIs with the current stable tools, or at least, I haven't found any concise example of it, and every time I try to use a dependency, it feels like the interfaces could really be improved.āµāµBeef showed me concepts though and that may improve the current situation, but still, i |
14:58:12 | FromDiscord | <deech> IME in metaprogramming and macro heavy languages it's a struggle to build common interfaces because people build only what they need for their specific use case and move on. There aren't any technical barriers. |
14:58:57 | FromDiscord | <etra> yeah, I'm still interested in this language because it's metaprogramming capabilities are amazing, it's performance is really good and I really like arc/orc |
14:59:11 | FromDiscord | <etra> (edit) "it's" => "its" |
14:59:16 | * | rockcavera quit (Remote host closed the connection) |
15:00:02 | FromDiscord | <deech> The trait/typeclass approach also has problems. If for example a bad instance makes it into the network of traits it's almost impossible to remove. After experiencing this with Haskell I think the Nim/static introspection is better. |
15:00:41 | FromDiscord | <deech> (edit) "instance" => "impl/instance" | "impl/instancemakes it into the network of traits it's almost impossible to remove. After experiencing this with Haskell I think the Nim/static introspection ... is" added "approach" |
15:01:56 | * | jmdaemon quit (Ping timeout: 265 seconds) |
15:01:58 | FromDiscord | <etra> I saw one of your talks deech btw and it's one of the reasons I'm here haha |
15:02:28 | FromDiscord | <deech> Wow! That's awesome. |
15:03:21 | FromDiscord | <jmgomez> What's wrong with the hook approach? (i.e. std/jsonutils) |
15:08:01 | FromDiscord | <deech> The problem begins when a hook calls another hook possibly a couple of transitive dependencies away that has surprising or bad behavior that you don't control and can't override. |
15:09:50 | FromDiscord | <jmgomez> But you can always override it, cant you? |
15:12:47 | FromDiscord | <deech> Can you? I'm not sure. Not saying you're wrong but Nim's overload resolution is pretty complicated. |
15:14:28 | FromDiscord | <deech> As far as I can tell, concepts are more analogous to traits than hooks. |
15:17:35 | * | jmdaemon joined #nim |
15:19:05 | FromDiscord | <jmgomez> Need to double check but I think you can, the overload will prioritise the more specialised or the last one?. Yes, not saying the opposite |
15:20:31 | * | rockcavera joined #nim |
15:21:33 | FromDiscord | <Gumbercules> sent a long message, see http://ix.io/4skO |
15:23:34 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4skP |
15:25:23 | FromDiscord | <jmgomez> In reply to @Gumbercules "I'm trying to wrap": how are you wrapping it? |
15:32:31 | FromDiscord | <Gumbercules> In reply to @jmgomez "how are you wrapping": I'm grabbing my personal laptop now and will share a snippets in two seconds |
15:33:20 | FromDiscord | <Gumbercules> moments even |
15:34:43 | FromDiscord | <Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4skW |
15:40:22 | FromDiscord | <jmgomez> Just trying to help, and to understand what you are doing, a have a few questions:āµ- why you dont use importc?āµ- what are those unused pointers? |
15:41:42 | FromDiscord | <jmgomez> Okay, I saw the struct now with the unused pointers |
15:41:53 | FromDiscord | <Gumbercules> sent a long message, see http://ix.io/4skX |
15:42:15 | FromDiscord | <Gumbercules> (edit) "http://ix.io/4skX" => "http://ix.io/4skY" |
15:42:56 | FromDiscord | <jmgomez> Okay, can you do sizeof on both? In in the C one that you are referring and the one in Nim |
15:42:57 | FromDiscord | <Gumbercules> I think the unused pointers are there to account for the virtual constructor and destructor in the virtual class, but I'm also not really sure... I've never wrapped a virtual C++ class like this with a C interface before |
15:43:11 | FromDiscord | <Gumbercules> Yeah, I did that and they were the same but let me just double check... |
15:43:47 | FromDiscord | <Gumbercules> oh btw - I didn't have `ptr proc` earlier either - just `proc` |
15:43:48 | FromDiscord | <firasuke> What's the difference between varargs[string] and seq[string] as procedure parameters? |
15:43:57 | FromDiscord | <Gumbercules> I added the `ptr proc` last night when I was trying to get things working |
15:43:59 | FromDiscord | <jmgomez> I think some time ago I saw issues when no using importc pure |
15:44:14 | FromDiscord | <jmgomez> (with the pure pragma I mean) |
15:44:32 | FromDiscord | <jmgomez> Like it skips rtti, not sure if it has to be explicitly enabled |
15:44:57 | FromDiscord | <Gumbercules> I saw something in the manual about `pure` doing nothing unless you were also using `inheritable` |
15:45:29 | FromDiscord | <jmgomez> In reply to @firasuke "What's the difference between": https://nim-lang.org/docs/manual.html#types-varargs |
15:45:46 | FromDiscord | <Nerve> In reply to @firasuke "What's the difference between": `varargs[string]` corresponds to variadic arguments, it goes at the end and, and the proc can take any number of strings arguments from there which are returned as an iterable, I think `varargs` technically corresponds to `openarray` |
15:46:07 | FromDiscord | <Nerve> (edit) "`varargs[string]`" => "`varargs[T]`" | "strings" => "`T`" |
15:46:18 | FromDiscord | <Nerve> (edit) removed "and," |
15:46:38 | FromDiscord | <Nerve> (edit) "corresponds to" => "is a type of" |
15:46:51 | FromDiscord | <firasuke> Which one should I use if I wanted a procedure to deal with a variable number of strings? Previously I used sequence but TIL about varargs? |
15:46:51 | * | jmdaemon quit (Ping timeout: 255 seconds) |
15:49:19 | * | arkurious joined #nim |
15:53:01 | FromDiscord | <Gumbercules> In reply to @jmgomez "Okay, can you do": Here's the Nim one - working on the C one now...āµhttps://play.nim-lang.org/#ix=4sl1 |
16:03:20 | FromDiscord | <Gumbercules> @jmgomez here's the C version: https://onlinegdb.com/emGNZtXsG - output looks to be exactly the same |
16:04:10 | FromDiscord | <Gumbercules> the only difference is - I'm compiling with msvc, but I don't think that would be an issue... I'll try though on my local machine in a sec to verify that assumption. |
16:06:11 | FromDiscord | <Hourglass [She/Her]> How much overhead would it be to make JNI bindings to a C library in Nim? |
16:06:45 | FromDiscord | <Hourglass [She/Her]> Would it be negligible? Or is it big enough to make an impact |
16:07:11 | FromDiscord | <Hourglass [She/Her]> (This C library doesn't have any JNI bindings and I cannot do C to save my life) |
16:07:28 | FromDiscord | <Gumbercules> I'm confused by the question - JNI allows you to interface with native code in Java. What does Nim have to do with anything in that situation? |
16:07:56 | FromDiscord | <Hourglass [She/Her]> Acting as the glue between C and the JVM |
16:08:21 | FromDiscord | <Hourglass [She/Her]> Since I thought JNI requires you to do some funky stuff for that? |
16:13:33 | FromDiscord | <Gumbercules> In reply to @Hourglass, When the Hour Strikes "Acting as the glue": This is what JNI does |
16:13:41 | FromDiscord | <Gumbercules> In reply to @Hourglass, When the Hour Strikes "Since I thought JNI": define "funky stuff" |
16:13:49 | FromDiscord | <Hourglass [She/Her]> I mean between C and JNI |
16:14:02 | FromDiscord | <Gumbercules> You don't really need glue between C and JNI |
16:14:12 | FromDiscord | <jmgomez> In reply to @Gumbercules "<@726017160115126333> here's the C": it's quite odd. Just to make sure can you try to use the C imported by Nim (like emit and then import) to see if you get the same error? If you get it, maybe the error is somewhere else? |
16:14:14 | FromDiscord | <Gumbercules> You just use JNI to wrap the C API |
16:14:29 | FromDiscord | <Hourglass [She/Her]> Oh huh |
16:14:31 | FromDiscord | <Gumbercules> In reply to @jmgomez "it's quite odd. Just": yeah I can give that a shhot |
16:15:33 | FromDiscord | <Gumbercules> In reply to @Hourglass, When the Hour Strikes "Oh huh": Just like Nim needs code to interop with C, Java does too - thus JNI. I guess you could use Nim to parse C code and Java code and produce JNI but it seems like it'd be much easier to just write the JNI or find a tool specialized to do that. |
16:16:29 | FromDiscord | <Gumbercules> https://www.baeldung.com/jni would probably be a good read / place to start |
16:17:25 | FromDiscord | <Yardanico> also <https://github.com/yglukhov/jnim> |
16:18:39 | FromDiscord | <jmgomez> In reply to @Yardanico "also <https://github.com/yglukhov/jnim>": that's cool, does it have bindings? |
16:18:44 | FromDiscord | <Yardanico> wdym? |
16:19:00 | FromDiscord | <Yardanico> it is the library for binding java code to nim |
16:19:07 | FromDiscord | <jmgomez> the java api automatically bound to Nim types |
16:19:22 | FromDiscord | <Yardanico> ah, no, I don't think so |
16:26:27 | FromDiscord | <Gumbercules> In reply to @jmgomez "it's quite odd. Just": also thanks for the sanity check and help š |
16:27:34 | * | tiorock joined #nim |
16:27:34 | * | tiorock quit (Changing host) |
16:27:34 | * | tiorock joined #nim |
16:27:34 | * | rockcavera quit (Killed (silver.libera.chat (Nickname regained by services))) |
16:27:34 | * | tiorock is now known as rockcavera |
16:27:47 | FromDiscord | <Hourglass [She/Her]> In reply to @Gumbercules "https://www.baeldung.com/jni would probably be": Yeah reading that |
16:28:29 | FromDiscord | <Hourglass [She/Her]> In reply to @Yardanico "also <https://github.com/yglukhov/jnim>": Yeah I was thinking of using the JNIEXPORT thing (pragma, I'd assume?) to export the functions I need (since there's already wasm3 bindings) |
16:29:51 | FromDiscord | <Gumbercules> The real question is - what are you trying to do? |
16:32:48 | FromDiscord | <Hourglass [She/Her]> Create some mediocre bindings to a C library for Java |
16:37:26 | FromDiscord | <Gumbercules> Gotcha - Nim seems like it'd just add more complexity to this task |
16:38:15 | FromDiscord | <Gumbercules> You may want to check out SWIG - https://www.swig.org/Doc1.3/Java.html |
16:41:35 | FromDiscord | <Gumbercules> @jmgomez I think I may have stumbled across a couple of clues - first of all I wasn't compiling my Nim wrapper against C11. This was one reason I was getting so many errors when I was using `importc` as `alignas` wasn't available in `stdalign.h`. |
16:42:02 | FromDiscord | <Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4sl7 |
16:42:11 | FromDiscord | <Gumbercules> so it appears that's my next hint as far as what I need to fix - and probably the one that's causing me all the grief |
16:42:51 | FromDiscord | <BoomBang> So I was programming something andāµI was trying to add a float64 to an int, of which I guessed may return a float64 |
16:43:22 | FromDiscord | <BoomBang> but I guess since adding is an actual function, this won't work |
16:43:26 | FromDiscord | <BoomBang> any way to do that? |
16:44:18 | FromDiscord | <Yardanico> In reply to @BoomBang "any way to do": let mynewvar = myfloat + float(myint) |
16:44:26 | FromDiscord | <BoomBang> thx |
16:44:28 | FromDiscord | <Yardanico> or use https://nim-lang.org/docs/lenientops.html but it's not really recommended if you only need to do that in a few places |
16:53:53 | * | derpydoo joined #nim |
16:54:36 | FromDiscord | <jmgomez> In reply to @Gumbercules "Now that I've done": cool! let me know how it goes |
16:57:37 | * | zgasma quit (Quit: leaving) |
16:58:51 | FromDiscord | <Gumbercules> In reply to @jmgomez "cool! let me know": So far, not very well, but I need to spend more time on it later today. Work is calling š¦ |
17:00:02 | FromDiscord | <djazz> I think nim lang server crashed my pc. Don't do infinite recursion statically guys! |
17:00:10 | FromDiscord | <djazz> https://media.discordapp.net/attachments/371759389889003532/1091406595746955445/DSC_5692.jpg |
17:00:51 | FromDiscord | <djazz> I was going to type the arguments... And it hung up |
17:03:06 | FromDiscord | <djazz> I disabled the recursion limit... |
17:03:17 | FromDiscord | <djazz> Otherwise it wouldnt happen haha |
17:06:01 | FromDiscord | <djazz> Hm, i uncommented vmmaxiterations in my config.nims but it still crashed |
17:06:19 | FromDiscord | <djazz> (edit) "uncommented" => "commented out" |
17:06:22 | FromDiscord | <I have 50GB of nothing on my PC> it might be eating all your ram |
17:06:27 | FromDiscord | <djazz> Yes it is |
17:07:35 | FromDiscord | <djazz> I was just about to reset the pc and it came back responding xD vscode gone |
17:20:59 | FromDiscord | <Hourglass [She/Her]> In reply to @Gumbercules "You may want to": Ah thanks Gumbercules! |
17:22:08 | * | beholders_eye joined #nim |
17:35:55 | FromDiscord | <creative> is choosenim broken? |
17:36:19 | FromDiscord | <djazz> choosenim 1.6.12 to get back to stable |
17:36:43 | FromDiscord | <creative> how do i do that with "iffy/[email protected]" thing |
17:37:07 | FromDiscord | <djazz> oh. right |
17:37:22 | FromDiscord | <djazz> yeah see #internals |
17:38:20 | FromDiscord | <djazz> i havent done much CI so i dunno |
17:39:00 | FromDiscord | <creative> no problem |
17:39:54 | FromDiscord | <System64 ~ Flandre Scarlet> Will Nim 2.0 have breaking changes? |
17:41:20 | FromDiscord | <Yardanico> of course, yes |
17:42:02 | FromDiscord | <Yardanico> <https://github.com/nim-lang/Nim/blob/devel/changelogs/changelog_2_0_0.md> |
17:43:30 | FromDiscord | <Phil> In reply to @System64 "Will Nim 2.0 have": Yes, the ones I felt most notably are moving smtp and db_ modules to external packages rather than be part of nim. |
17:44:11 | * | fallback_ quit (Ping timeout: 260 seconds) |
18:19:41 | NimEventer | New thread by Angluca: Maybe can add a pragma let nim proc/func easy call cproc/cfunc, see https://forum.nim-lang.org/t/10053 |
18:27:44 | NimEventer | New thread by demetera: Nim 1.6 vs 2 (1.9) Working with channels, see https://forum.nim-lang.org/t/10054 |
18:46:18 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "Yes, the ones I": Ah alright so I just need to install thoses packages? |
18:47:26 | FromDiscord | <Phil> Assuming you build with nimble, you'll also need to adjust your nimble files, update all your imports and you better use packages that also have already dealt with that, otherwise you'll find yourself either making PRs to upstream those modification to those packages as well |
18:47:35 | FromDiscord | <Phil> (edit) "files," => "file," |
18:47:50 | * | fallback_ joined #nim |
18:48:25 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "Assuming you build with": The way I build is...āµnim compile -r myFile.nim |
18:49:08 | FromDiscord | <Phil> Ma man is not even using -d:release or -d:lto š |
18:49:44 | FromDiscord | <TechnoRazor> sent a code paste, see https://play.nim-lang.org/#ix=4slD |
18:49:49 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "Ma man is not": I did this tooāµBut what is -d:lto |
18:51:02 | FromDiscord | <Phil> link time optimization.āµStems from the C bits of programming.āµEvery file is its own piece of compiled code, all of those get bundled together into one big binary based on the root file you use. Gluing them all together is linking and one file calling code from another can be optimized for better performance, that's what lto does |
18:51:14 | FromDiscord | <Elegantbeef> probably need to do `mixin t1` inside the `t2` template, or `bind t1` if that doesnt workāµ(@TechnoRazor) |
18:51:21 | FromDiscord | <Elegantbeef> Well not really the C bits |
18:51:22 | FromDiscord | <Phil> It increases compiletime considerably though if you have a larger projects with many dozens of files |
18:51:30 | FromDiscord | <Phil> (edit) "a larger" => "arger" |
18:51:35 | FromDiscord | <Phil> (edit) "arger" => "larger" |
18:52:01 | FromDiscord | <TechnoRazor> In reply to @Elegantbeef "probably need to do": oh, `mixin` works, thank you!āµthat's really weird behavior though, is there a good reason for it? |
18:52:05 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4slE |
18:52:17 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "link time optimization. Stems": Oh good to knowāµSo I should use Nimble build? |
18:52:44 | FromDiscord | <Phil> Depends on how many flags you want/need to use, I personally really like it and would recommend it, but it's not a must by any means |
18:53:12 | FromDiscord | <Phil> I use nimble because I detest writing compile commands, I want that all summarized together without having to always spell out what I want, that's why I use nimble tasks |
18:53:16 | FromDiscord | <Elegantbeef> Templates are code substitution as such `.t1` looks like field access and might not bind anything, i also think doing `t1(x)` might work |
18:53:17 | FromDiscord | <System64 ~ Flandre Scarlet> Now the problem is I havve 2 projects : One for client, one for server https://media.discordapp.net/attachments/371759389889003532/1091435061536112670/image.png |
18:53:58 | FromDiscord | <Phil> And why is that a problem? You can have separate nimble tasks to compile them individually |
18:54:17 | FromDiscord | <Phil> And a third nimble task to compile both at once if you're as lazy as me |
18:54:26 | FromDiscord | <Elegantbeef> You need to tell the compiler to store `t1` on declaration instead of searching at instantation, it's not dissimilar to Nim generics |
18:55:51 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4slG |
18:57:55 | FromDiscord | <TechnoRazor> In reply to @Elegantbeef "Templates are code substitution": you're right, `t1(x)` does work, which feels really silly, but i think i see what you're saying -- it can't tell whether it's supposed to be a routine call or field access until instantiationāµthings like this do make the language feel frustrating at times though -- it'd help if the compiler could provide hints as to what the fix might be, at least |
18:58:11 | FromDiscord | <Elegantbeef> Well it cannot really provide a fix |
18:58:43 | FromDiscord | <Elegantbeef> How does it know you didnt want to do `.t1` on an object where you write `t1` in the scope of your template |
18:59:05 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4slK |
18:59:31 | FromDiscord | <TechnoRazor> i don't know how feasible this is, but maybe it'd analyze your code a bit on compilation failure? it could see that `t1` is defined and being used from a template from a generic proc being called from another module, and tell you to try `t1(x)` instead? |
19:00:04 | FromDiscord | <TechnoRazor> (edit) "being" => "the identifier is" |
19:00:30 | FromDiscord | <Elegantbeef> That's wildly complex |
19:00:53 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "This is parts of": Oh thanks! That can help me a lot! |
19:01:44 | FromDiscord | <TechnoRazor> it'd be really useful though -- maybe a separate tool could do it, instead of trying to mix this into the compiler |
19:02:06 | FromDiscord | <Elegantbeef> Well it's wildly complex to intuit what the programmer wants |
19:02:19 | FromDiscord | <Elegantbeef> Just cause you have a `t1` template does not mean you want to use it |
19:03:41 | FromDiscord | <TechnoRazor> right, but seeing as `t1` is not defined anywhere else means i probably wanted to use itāµit doesn't have to perfectly predict intentions and/or catch everything, but just be hardcoded to explain a few common mistakes |
19:04:15 | FromDiscord | <Elegantbeef> The real question is why are you using a template here š |
19:07:15 | FromDiscord | <TechnoRazor> well this is a silly example, but i ran into this in my own project where i was implementing a generic spare-set-like map -- i had a template for converting the key to an index, which was used from another template similar to `tables.withValue`, which was used from a generic `add` proc |
19:07:43 | FromDiscord | <Nilts> Choosenim broke on me :( https://media.discordapp.net/attachments/371759389889003532/1091438694830973049/message.txt |
19:08:03 | FromDiscord | <Elegantbeef> I mean why are you using a template for something that doesnt need a template š |
19:09:07 | FromDiscord | <TechnoRazor> why use a proc when i could use a one-line template? ĀÆ\_(ć)_/ĀÆāµi know the compiler would probably inline a proc anyway, but templates are fun |
19:10:24 | FromDiscord | <Elegantbeef> Well you're using the wrong tool and then complaining that it fails š |
19:10:36 | FromDiscord | <Elegantbeef> You use the simplest tool first\: proc -\> generic -\> template -\> macro |
19:11:45 | FromDiscord | <Nilts> In reply to @not logged in "Choosenim broke on me": anybody know what is wrong? |
19:11:52 | FromDiscord | <TechnoRazor> yeah im aware of that idea, but im just not sure if i agree all the timeāµcall it premature optimization, but i don't want to have 5 function calls to do one thing |
19:12:27 | FromDiscord | <Elegantbeef> It's not even premature optimisation it's being silly |
19:12:44 | FromDiscord | <TechnoRazor> then i guess im silly :P |
19:13:06 | FromDiscord | <TechnoRazor> it doesn't seem that unreasonable to assume that it'd be able to resolve `t1` though, since the generic proc is defined in the same module |
19:13:28 | FromDiscord | <Nilts> Is this related? https://github.com/dom96/choosenim/issues/324 |
19:13:34 | FromDiscord | <djazz> In reply to @not logged in "anybody know what is": Araq made Nim 2.0 RC2 the stable release and choosenim doesnt like that version number (1.9.3) |
19:13:44 | FromDiscord | <Elegantbeef> With a generic proc it should bind properly |
19:14:08 | FromDiscord | <Nilts> In reply to @djazz "Araq made Nim 2.0": how do i fix it? |
19:14:16 | FromDiscord | <djazz> choosenim 1.6.12 |
19:14:19 | FromDiscord | <djazz> maybe |
19:14:33 | FromDiscord | <Elegantbeef> https://godbolt.org/z/r5d18rEEW but like.... it inlines as expected |
19:14:49 | FromDiscord | <TechnoRazor> In reply to @Elegantbeef "With a generic proc": yeah, but it seems weird to hurt the programmer when they choose to not follow convention |
19:15:39 | FromDiscord | <Elegantbeef> I'd argue this encourages following convention instead of doing silly things |
19:15:53 | FromDiscord | <Elegantbeef> Why you are using a template and neutering what your program can do is beyond me |
19:17:30 | FromDiscord | <Elegantbeef> I'm not going to deny the error is awful, but using a template instead of just using a proc cause "I always want it to inline" without any indication it's not inlining or a performance issue is just as awful š |
19:19:24 | FromDiscord | <TechnoRazor> i know it was a silly decision and i can't fault the compiler for acting upāµbut the issue is that it doesn't feel like it _should_ be neutering -- im aware that templates are code substitution, and sometimes i use code substitution instead of a function call, and that shouldn't be used against me in resolving symbols of all things |
19:19:39 | FromDiscord | <TechnoRazor> it's just as feasible for someone to have used a template from another template in a way that isn't silly |
19:22:03 | FromDiscord | <sOkam!> š® I totally missed the news https://media.discordapp.net/attachments/371759389889003532/1091442301361995816/image.png |
19:22:43 | FromDiscord | <TechnoRazor> In reply to @sOkam! "š® I totally missed": oh wow, i did too |
19:22:53 | FromDiscord | <djazz> now do `choosenim versions` and see it break xD |
19:27:25 | FromDiscord | <Elegantbeef> Anywho PRs are generally welcomed to improve error messages |
19:27:50 | FromDiscord | <Yardanico> In reply to @sOkam! "š® I totally missed": that's not exactly intended |
19:28:05 | FromDiscord | <Yardanico> but yeah, a lot of people get to test 2.x without actually wanting to do so :D |
19:29:36 | FromDiscord | <Gumbercules> In reply to @djazz "now do `choosenim versions`": the first mistake there is using `choosenim` |
19:31:40 | FromDiscord | <TechnoRazor> sent a long message, see http://ix.io/4slV |
19:33:36 | FromDiscord | <TechnoRazor> not sure if i verbalized my thoughts well, but im sure there are others who have felt the same way |
19:34:00 | FromDiscord | <@@prestosilver> I have a dumn question, If i have a proc that takes in a openArray, and i want to return an iterator, whats the best way to capture the openArray, or get the openarray inside the iterator |
19:34:46 | FromDiscord | <Elegantbeef> You're not even denied to do it |
19:36:46 | FromDiscord | <Elegantbeef> Open arrays are not capturable |
19:36:52 | FromDiscord | <Elegantbeef> use a `seq` |
19:38:09 | FromDiscord | <@@prestosilver> is it viable to convert the openarray into a seq then build the iterator |
19:38:32 | FromDiscord | <Elegantbeef> Also works |
19:38:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4slZ |
19:39:26 | FromDiscord | <@@prestosilver> That might work |
19:39:36 | FromDiscord | <sOkam!> In reply to @Yardanico "that's not exactly intended": oh it wasn't intended to make rc2 stable? |
19:39:40 | FromDiscord | <Yardanico> no lol |
19:39:48 | FromDiscord | <sOkam!> ah lol i see |
19:39:57 | FromDiscord | <Elegantbeef> It will have to copy eitherway since it's not a `ref` |
19:40:01 | FromDiscord | <@@prestosilver> for refrence im working on the findExes function in stdlib, idk if that changes anything |
19:40:06 | FromDiscord | <@@prestosilver> ok |
19:40:08 | FromDiscord | <@@prestosilver> yea |
19:40:10 | FromDiscord | <@@prestosilver> makes sense |
19:40:41 | FromDiscord | <Elegantbeef> doing `for x in @oa` might be the most sensible in that case |
19:41:21 | FromDiscord | <TechnoRazor> In reply to @Elegantbeef "You're not even denied": i mean without `mixin` or changing the syntaxāµthere are other things that the programmer is denied from doing -- the only one off the top of my head is generic methods? not sure what the current status of those is right now, but i remember it being deprecated or not allowed or something |
19:42:01 | * | jmdaemon joined #nim |
19:42:18 | FromDiscord | <@@prestosilver> whats @ do, idk if ive seen it |
19:42:37 | FromDiscord | <Elegantbeef> Well being denied generic methods is par for the course |
19:42:41 | FromDiscord | <Elegantbeef> `@` converts a openarray to a seq |
19:42:46 | FromDiscord | <@@prestosilver> o neato |
19:42:48 | FromDiscord | <@@prestosilver> ill use that |
19:42:53 | FromDiscord | <Elegantbeef> You've certainly seen `@[10, 20, 30]` |
19:43:07 | FromDiscord | <@@prestosilver> dang didnt know that was an operator |
19:43:11 | FromDiscord | <@@prestosilver> kinda sick |
19:43:35 | FromDiscord | <Elegantbeef> Most other languages also do not have generic methods, though I do kinda want generic methods, the tricky part is that the ABI has to be identical for all of them |
19:44:23 | FromDiscord | <@@prestosilver> I was recentally working on a lang as a time filler, generics were my end goal for the lang, really liked my stupid implementation |
19:44:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4sm1 |
19:46:35 | FromDiscord | <@@prestosilver> the implementation i had basically added a type "anytype" and then after finding all the functions and ast, i would generate the main function, whenever it calls something generate that, but if there was an anytype parameter it would generate that function for the signature it ran into |
19:47:58 | FromDiscord | <@@prestosilver> The final implementation was a bit wonky bc you had to manually get the type of a generic parameter with a .TYPE method but it worked> |
19:48:50 | FromDiscord | <Elegantbeef> I do think with ringabout's addition of a vtable it might be simpler to make generic methods work |
19:49:02 | FromDiscord | <Elegantbeef> Since now it's just adding the proc for all instantiated types of a generic, but who knows |
19:49:06 | FromDiscord | <Elegantbeef> "PRs welcome" š |
19:50:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4sm4 |
19:51:05 | FromDiscord | <vexman> sent a code paste, see https://play.nim-lang.org/#ix=4sm5 |
19:51:53 | FromDiscord | <Elegantbeef> Are you super certain it's the right arch? |
19:52:26 | FromDiscord | <vexman> https://media.discordapp.net/attachments/371759389889003532/1091449945002877088/image.png https://media.discordapp.net/attachments/371759389889003532/1091449945401348136/image.png |
19:52:35 | FromDiscord | <djazz> nim -v, does it say 64 bit? |
19:52:46 | FromDiscord | <@@prestosilver> yea was about to say that |
19:53:00 | FromDiscord | <djazz> sometimes choosenim dowloads win32 version xD |
19:53:01 | FromDiscord | <vexman> sent a code paste, see https://play.nim-lang.org/#ix=4sm7 |
19:53:03 | FromDiscord | <vexman> 386 so 32 bit i guess |
19:53:04 | FromDiscord | <djazz> like in your case |
19:53:09 | FromDiscord | <Elegantbeef> Well there's your problem |
19:53:18 | FromDiscord | <djazz> choosenim 1.6 |
19:53:23 | FromDiscord | <djazz> choosenim remove 1.6.12 |
19:53:29 | FromDiscord | <djazz> chosenim 1.6.12 |
19:53:35 | FromDiscord | <djazz> choosenim remove 1.6 |
19:53:46 | FromDiscord | <@@prestosilver> sent a code paste, see https://play.nim-lang.org/#ix=4sm8 |
19:53:48 | FromDiscord | <@@prestosilver> sorry for the large code drop |
19:53:56 | FromDiscord | <@@prestosilver> (edit) |
19:54:42 | FromDiscord | <vexman> In reply to @djazz "choosenim remove 1.6.12": https://media.discordapp.net/attachments/371759389889003532/1091450518376816710/image.png |
19:54:44 | FromDiscord | <Elegantbeef> still using `exts` inside the iterator |
19:54:54 | FromDiscord | <@@prestosilver> oml lol |
19:55:00 | FromDiscord | <@@prestosilver> o wait |
19:55:07 | FromDiscord | <@@prestosilver> thats the template tho right |
19:55:09 | FromDiscord | <djazz> @vexman, hence choosenim 1.6 |
19:55:21 | FromDiscord | <djazz> just any other version so you can reinstall 1.6.12 |
19:55:31 | FromDiscord | <vexman> so .12 doesnt have a x64 bin? |
19:55:46 | FromDiscord | <djazz> yees, but choosenim sometimes gets wrong arch on windows |
19:55:52 | FromDiscord | <djazz> i had it happen too |
19:55:55 | FromDiscord | <vexman> wtf just happened |
19:56:06 | FromDiscord | <vexman> you sure 1.6 is like a version choosenim knows about? |
19:56:10 | FromDiscord | <Elegantbeef> Why are you even using a template here |
19:56:37 | FromDiscord | <djazz> use 1.6.10 then |
19:56:38 | FromDiscord | <@@prestosilver> Idk, most of this code is straight from the stdlib, i just pushed it into an iterator |
19:56:38 | FromDiscord | <vexman> https://media.discordapp.net/attachments/371759389889003532/1091451005868196041/image.png |
19:56:53 | FromDiscord | <djazz> choosenim 1.6.10 |
19:56:55 | FromDiscord | <vexman> ok it found .10 |
19:57:00 | FromDiscord | <@@prestosilver> might be worth a full function rewrite ngl |
19:57:10 | FromDiscord | <@@prestosilver> rather than trying to save the old code |
19:57:19 | FromDiscord | <vexman> https://media.discordapp.net/attachments/371759389889003532/1091451177146781786/image.png |
19:57:21 | FromDiscord | <vexman> .. |
19:57:30 | FromDiscord | <djazz> oh. right |
19:57:44 | FromDiscord | <vexman> this is seriously gonna make me use linux |
19:57:58 | FromDiscord | <vexman> debian collecting dust on my other partition |
19:58:04 | FromDiscord | <@@prestosilver> I swear windows defender makes me so mad sometimes lol, The main reason i use linux |
19:58:17 | FromDiscord | <vexman> so this thing works just fine in linux right? |
19:58:25 | FromDiscord | <djazz> try any other version, like devel |
19:58:30 | FromDiscord | <djazz> choosenim devel |
19:58:52 | FromDiscord | <vexman> it got the 32 bit again |
19:59:00 | FromDiscord | <djazz> š® oh |
19:59:07 | FromDiscord | <djazz> choosenim update self ? |
19:59:15 | FromDiscord | <djazz> maybe u got 32bit choosenim? |
19:59:24 | FromDiscord | <vexman> nope |
19:59:29 | FromDiscord | <vexman> choosenim v0.8.4 (2022-07-06 14:50:55) [windows/amd64] |
19:59:41 | FromDiscord | <djazz> hm right, there is only 64bit choosenim |
19:59:49 | FromDiscord | <vexman> fuck you microsoft |
20:00:09 | FromDiscord | <@@prestosilver> most of the time windows defender false flags new exes, but the more people that download them the faster its fixed |
20:00:29 | FromDiscord | <@@prestosilver> drives me nuts bc like games i build and send to freinds are always flagged |
20:00:34 | FromDiscord | <vexman> cant i specify which architecture im using in choosenim |
20:00:55 | FromDiscord | <djazz> In reply to @vexman "fuck you microsoft": indeed... in related news... https://discord.com/channels/371759389889003530/371759607934353448/1091252980210212914 |
20:02:14 | FromDiscord | <vexman> i swear to god once windows 10's support ends ill have windows 11 or 12 only for gaming unless in 2-3 years linux gets even better in gaming, steam proton is already pretty great |
20:02:34 | FromDiscord | <djazz> steam deck ftw, and i game on my linux pc too |
20:02:40 | FromDiscord | <@@prestosilver> you can pay for a cert to get through windows defender if im not mistaken, but its 100% a scam imho |
20:02:59 | FromDiscord | <djazz> i bought an old thinkpad second hand that i have windows on. the hdd is sooo slooow |
20:03:00 | FromDiscord | <@@prestosilver> exe signing or something |
20:03:21 | FromDiscord | <djazz> (i have only used it to test nim stuff lol) |
20:03:51 | FromDiscord | <@@prestosilver> In reply to @djazz "i bought an old": I had a x220 for years, finally upgraded to a x270 abt a year ago, with the ssd I got this things a beast |
20:03:53 | FromDiscord | <@@prestosilver> lol |
20:04:02 | FromDiscord | <@@prestosilver> I mean not good for gaming bc no gpu ofc |
20:04:08 | FromDiscord | <@@prestosilver> but still nice for softdev |
20:04:10 | FromDiscord | <djazz> this one is from like 2010 |
20:04:24 | FromDiscord | <vexman> ok so i switched to nim 0.16.0 |
20:04:27 | FromDiscord | <vexman> x32 again |
20:04:32 | FromDiscord | <@@prestosilver> my x220 was a 2011 model |
20:04:44 | FromDiscord | <djazz> touchpad is bit broken, so it oftens opens Cortana, which isnt available in my country |
20:04:45 | FromDiscord | <@@prestosilver> was bc I upgraded the motherboard |
20:04:49 | FromDiscord | <@@prestosilver> lol |
20:04:51 | FromDiscord | <djazz> some gesture i guess |
20:05:22 | FromDiscord | <djazz> T510 is what i have |
20:06:56 | FromDiscord | <@@prestosilver> dang, my first laptop was a T440-T400 forgot tbh |
20:07:24 | FromDiscord | <djazz> In reply to @vexman "x32 again": so weird.. |
20:13:16 | FromDiscord | <vexman> this was so dumb i had to get the 32 bit version of sdl2 AND i had to go to my fonts folder to copy a missing font for the example |
20:13:29 | FromDiscord | <vexman> but at the end i had pong |
20:13:45 | FromDiscord | <vexman> ill just develop on linux, its ridiculous to do this on windows |
20:14:39 | FromDiscord | <djazz> just use mingw64 to develop for windows from linux š |
20:15:01 | FromDiscord | <vexman> i do have mingw64 |
20:15:14 | FromDiscord | <vexman> oh wait nvm |
20:32:34 | * | rockcavera quit (Remote host closed the connection) |
21:01:25 | anddam | are enum field names case insensitive? |
21:01:43 | FromDiscord | <Yardanico> they're the same as all other Nim symbols, so case insensitive except the first letter |
21:01:52 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality |
21:01:57 | FromDiscord | <Yardanico> and underscores ignored ofc |
21:02:50 | * | Notxor quit (Remote host closed the connection) |
21:03:39 | FromDiscord | <Elegantbeef> All idents are style instensitive |
21:03:39 | FromDiscord | <Elegantbeef> @ringabout\: do not recall if you can ban people from the wiki but https://github.com/nim-lang/Nim/wiki/_Sidebar/_compare/aba4ad4%5E...aba4ad4 |
21:03:40 | FromDiscord | <Elegantbeef> I changed it already, but they're at it again š |
21:03:42 | anddam | I am (still) playing with updating nimgl/imgui, since I want a newer dear-imgui I cloned the repo, updated it's cimgui submodule to a 1.89.3 and run the generate |
21:05:03 | anddam | I have three issues in the resulting imgui.nim, one is that End and END gets generated as names for ImGuiKey enum |
21:06:44 | anddam | another issue with enums is that the generation code takes C enums ImGuiKey_FOO and create an enum type ImGuiKey with FOO name |
21:07:09 | anddam | in newer cimgui there's ImGuiKey_0 .. ImGuiKey_9, the resulting names 0 .. 9 are not valid |
21:07:40 | FromDiscord | <Elegantbeef> Yep you need to modify them somewhat to disambiguate |
21:07:40 | FromDiscord | <Elegantbeef> Many people get annoyed by style insensitivity but in what world is End and END different |
21:07:42 | anddam | I guess I can just prefix this with something like "NUMBER", not sure why there are ImGuiKey_End and ImGuiKey_END though |
21:08:00 | anddam | well "This is the End" seems like the final chapter of a book |
21:08:18 | anddam | "THIS IS THE END" means we are likely going to die soon |
21:09:17 | anddam | ok, I figure I am slightly breaking the underlying API but I don't give a sheet for now, I have no idea what these values are for and I'll just use the differentiated versions if need be |
21:09:56 | FromDiscord | <Elegantbeef> Or just do `Zero, One, Two, ...` š |
21:10:57 | anddam | I see the "Elegant" part in your nick now |
21:11:13 | anddam | now, the other problem I am facing is this type in imgui.nim |
21:11:14 | anddam | ImBitArrayForNamedKeys* = uint32<ImGuiKey_NamedKey_COUNT,-ImGuiKey_NamedKey_BEGIN> |
21:11:18 | anddam | that's not very good |
21:11:50 | FromDiscord | <Elegantbeef> Lol |
21:11:52 | FromDiscord | <Elegantbeef> What about EnD or eNd or enD? |
21:11:55 | anddam | I see the cimgui is defining a type from the underlying C++ library, but the C API should not have a template type, right? |
21:12:00 | anddam | I used CAPITAL_END |
21:15:07 | anddam | apropos the type please see https://github.com/cimgui/cimgui/blob/1.89.3/generator/output/typedefs_dict.lua#L2 and https://github.com/cimgui/cimgui/blob/1.89.3/generator/output/typedefs_dict.json#L2 |
21:15:27 | anddam | those types are ill-defined for a C library, right? |
21:16:10 | anddam | I am not C++ guy, but I didn't even know what the templates with a negative value was, I thought templates were for types only |
21:16:23 | FromDiscord | <Elegantbeef> Shame it's hardly ever true |
21:16:30 | anddam | I was told otherwise on #C++ but didn't get what this type actually is? |
21:16:40 | anddam | Elegantbeef: sorry, what is hardly ever true |
21:16:41 | anddam | ? |
21:20:18 | FromDiscord | <Elegantbeef> Me being elegant |
21:20:18 | FromDiscord | <Elegantbeef> Bridge moment |
21:21:04 | FromDiscord | <Elegantbeef> C++ templates do support constants iirc |
21:22:56 | FromDiscord | <etra> yeah they do, `std::array` is a prime example of its usage |
21:26:59 | anddam | ok, but how does that translate into a typedef in cimgui? that should be C and, to my limited knowledge, not have template |
21:27:29 | anddam | what's a way to check if a string is one of "0" .. "9"? |
21:28:10 | anddam | I mean a nim idiomatic way |
21:28:14 | anddam | "nimbolic" |
21:30:35 | FromDiscord | <Elegantbeef> `if str.len == 0 and str[0] in '0'..'9'` |
21:30:38 | FromDiscord | <Elegantbeef> I mean `str.len == 1` of course |
21:30:44 | FromDiscord | <Elegantbeef> In C it probably doesnt translate |
21:30:44 | FromDiscord | <Elegantbeef> Since C does not have value associated types |
21:30:47 | FromDiscord | <Elegantbeef> Might be a `T[]`? |
21:36:59 | * | advesperacit quit () |
21:39:11 | FromDiscord | <etra> In reply to @anddam "ok, but how does": in that case, according to <https://github.com/ocornut/imgui/blob/5f301914a0bbca018fcbab7065480e1ab2c38e23/imgui_internal.h#L320> it should simply translate to `array[ImGuiKey_NamedKey_COUNT, uint32]`. The other constant is used for the functions implemented in that same strucct |
21:39:13 | FromDiscord | <etra> (edit) "strucct" => "struct" |
21:39:53 | FromDiscord | <etra> (edit) "<https://github.com/ocornut/imgui/blob/5f301914a0bbca018fcbab7065480e1ab2c38e23/imgui_internal.h#L320>" => "<https://github.com/ocornut/imgui/blob/5f301914a0bbca018fcbab7065480e1ab2c38e23/imgui_internal.h#L564-L576>" |
21:41:54 | FromDiscord | <etra> (woops, sorry, fixed the message) |
21:42:18 | anddam | yeah I am on IRC, I see the edits |
21:42:29 | FromDiscord | <etra> oh, that must look terrible on IRC |
21:42:36 | FromDiscord | <Elegantbeef> It's spam of messages |
21:42:40 | anddam | not really |
21:42:54 | FromDiscord | <Elegantbeef> https://irclogs.nim-lang.org/ if you care to see |
21:43:13 | anddam | I am still puzzled how would I translate that in C, the OFFSET still gets used in the generated struct |
21:43:21 | anddam | this is an error on cimgui side, right? |
21:43:40 | anddam | I mean https://github.com/anddam/imgui/tree/feature/update-dear-imgui |
21:43:58 | FromDiscord | <Elegantbeef> It's a fixed bitset |
21:44:06 | anddam | if you clone and run nimble gen, should get the incriminated typedef |
21:44:07 | FromDiscord | <Elegantbeef> You'd generate a bitset per type using a macro in C land |
21:44:31 | FromDiscord | <etra> OFFSET should not be used in the struct though? the offset is only used in the functions |
21:45:18 | FromDiscord | <Elegantbeef> I'd write the equivlent C macro but i like my sanity |
21:46:09 | FromDiscord | <Elegantbeef> In Nim you actually might get away with a `set[range[0..SomeValueIDoNotKnowHere]` |
21:46:38 | anddam | etra: to be honest I do not know, my C is low level (not in the embedded meaning) so struct for me are just group of types, not sure why there are functions in that second link you pasted |
21:46:44 | FromDiscord | <etra> In reply to @anddam "I am still puzzled": it's not? https://github.com/nimgl/cimgui/blob/d24246adfdbd01d70998deda8570f175283b6035/cimgui.h#L1710 |
21:46:50 | FromDiscord | <etra> unless I'm not looking at the right thing |
21:47:30 | FromDiscord | <etra> In reply to @anddam "<@329819426000076801>: to be honest": oh, that's not C, that's C++. C++ either class or structs can have methods related to the object |
21:48:12 | FromDiscord | <Elegantbeef> They're just procedures that take an instance of the type as a first parameter |
21:48:12 | anddam | but I see the OFFSET being used there in the struc |
21:48:16 | FromDiscord | <etra> the only field of that struct is `ImU32 Storage[(ImGuiKey_NamedKey_COUNT+31)>>5];`, the other things are methods related to that object, and only the functions use the offset templated parameter |
21:48:45 | FromDiscord | <etra> In reply to @anddam "but I see the": where? |
21:48:49 | FromDiscord | <etra> can you point to a specific line? |
21:48:53 | anddam | ok, so ImBitArrayForNamedKeys is actually ImBitArray_ImGuiKey_NamedKey_COUNT__lessImGuiKey_NamedKey_BEGIN |
21:49:27 | anddam | that is actually struct ImBitArray_ImGuiKey_NamedKey_COUNT__lessImGuiKey_NamedKey_BEGIN |
21:49:53 | anddam | yes, I am battling between this damn windows terminal, late hour and figuring stuff I do not really know |
21:50:28 | anddam | the https://github.com/nimgl/cimgui/blob/d24246adfdbd01d70998deda8570f175283b6035/cimgui.h#L1710 you linked has the typedef for ImBitArrayForNamedKeys |
21:50:50 | anddam | I was looking at the generated (by cimgui) json and lua files at https://github.com/cimgui/cimgui/blob/1.89.3/generator/output/typedefs_dict.json#L2 |
21:51:02 | anddam | I think that's broken and has been committed as such |
21:52:23 | FromDiscord | <etra> sent a code paste, see https://play.nim-lang.org/#ix=4sms |
21:52:57 | FromDiscord | <etra> (and we're ignoring all the typedef shenanigans that C requires to avoid typing `struct`) |
21:54:05 | anddam | what code should I paste? |
21:56:37 | anddam | if you clone that fork of mine you should be able to reproduce, i.e. git clone --branch feature/update-dear-imgui [email protected]:anddam/imgui.git |
21:57:01 | FromDiscord | <etra> sent a code paste, see https://play.nim-lang.org/#ix=4smy |
21:57:07 | anddam | then `nimble gen` and the issue arise in src/imgui.nim |
21:57:18 | anddam | ooh "sent" a code paste, not "send" as "send me a code paste" |
21:57:21 | FromDiscord | <etra> sorry, can't do that now |
21:58:37 | anddam | np, thanks for the paste |
21:58:43 | anddam | gotta walk the dog now |
21:59:07 | FromDiscord | <etra> same except I have to walk just myself =D |
21:59:27 | anddam | take a poop bag roll anyway, just in caseā¦ |
21:59:43 | anddam | (bad joke) |
21:59:45 | anddam | have a nice walk |
22:03:04 | NimEventer | New thread by cmc: Announce: LimDB 0.2.0, see https://forum.nim-lang.org/t/10055 |
22:20:20 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @anddam "the https://github.com/nimgl/cimgui/blob/d24246adfd": I confirm that this thing works very well |
22:20:44 | FromDiscord | <System64 ~ Flandre Scarlet> because I used it |
22:22:08 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1091487620808318976/image.png |
22:33:14 | * | rockcavera joined #nim |
22:57:58 | FromDiscord | <newlibarian> is there such thing as a python to nim transpiler? |
23:03:16 | FromDiscord | <Elegantbeef> https://github.com/py2many/py2many has some nim support |
23:03:22 | FromDiscord | <Elegantbeef> The answer is going to generally be "no" |
23:03:40 | FromDiscord | <Elegantbeef> Python being dynamically typed means it's nigh impossible to transpile most code and just run it |
23:04:06 | anddam | System64 ~ Flandre Scarlet: did you use custom cimgui or nimgl/nimfl \\] |
23:04:52 | anddam | the dog hit enter mid-typing |
23:05:30 | anddam | System64 ~ Flandre Scarlet: did you use custom cimgui or the latest available on nimgl/nimgui? |
23:11:23 | NimEventer | New thread by alexeypetrushin: Why to_seq not overloaded properly?, see https://forum.nim-lang.org/t/10056 |
23:18:17 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @anddam "System64 ~ Flandre Scarlet:": NimGL |
23:19:17 | anddam | System64: I'll shorten your nick since nick completion doesn't work well over the irc bridge |
23:19:50 | anddam | my issue was that I was trying docking branch, I didn't have the docking effect so tried to upgrade the underlying libs |
23:21:16 | anddam | but cimgui is pretty much on par with dear-imgui but the nimgui generator is a bit behind so it won't handle new enums and, I think that cimgui generated typedef is wrong |
23:33:03 | * | xet7 quit (Ping timeout: 268 seconds) |
23:37:47 | * | xet7 joined #nim |