<< 31-03-2023 >>

00:06:53FromDiscord<morgan> i feel like it would be possible to have an external forum and a forum channel bridged in some way
00:07:16FromDiscord<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:09FromDiscord<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:59NimEventerNew 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:32FromDiscord<morgan> running some boxy examples and i think im gonna need to figure out framerate limiting lol
07:58:59FromDiscord<morgan> love it when a basic demo with a couple images uses a full core of cpu
08:01:36PMunchWild guess is that you don't actually limit it to a framerate
08:02:00PMunchSo it just tries to render as fast as possible, meaning 100% utilization
08:02:15FromDiscord<morgan> my guess was every frame increment a number, if it's above some value reset and call the do stuff proc
08:02:23FromDiscord<morgan> instead of calling whatever every frame
08:02:47PMunchWell, depends on how you want stuff to work
08:03:22FromDiscord<morgan> yeah i;d need to make sure inputs were handled more often
08:03:56PMunchOne 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:15FromDiscord<morgan> yeah
08:04:42FromDiscord<morgan> i don't really care about the fps for this rn
08:04:51FromDiscord<morgan> i was considering just outputting a png tbh
08:05:16FromDiscord<morgan> so if it's somewhere between 5 and 30 fps that's ok
08:05:40FromDiscord<morgan> in fact i might first do png output
08:05:56FromDiscord<morgan> tho it would be nice to have a gui eventually
08:06:05FromDiscord<Rika> In reply to @PMunch "One fairly common way": or you just run another loop without rendering lol
08:07:01FromDiscord<morgan> probably even better to use some sleep proc to have whatever wake up the thread when it's time
08:08:31PMunchOh sure, if you have other work then you can run that instead
08:08:39PMunchThe GC used to be a common choice
08:08:54PMunchNot sure how relevant that is with ARC, but ORC might still be applicable
08:09:18FromDiscord<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:20PMunchBut yeah, a rendering thread with sleeping and then game logic on a separate thread is another option
08:09:54PMunchOr do your main loop asynchronously and use sleepAsync for your UI loop
08:10:09FromDiscord<morgan> im not planning on having this stuff be visualized past development, but i do want some for later stuff
08:10:30PMunchBut be aware of the caveats about co-operative multi-tasking (outlined for example in my article on async)
08:11:39FromDiscord<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:20FromDiscord<Elegantbeef> I assume boxy uses windy so i guess it does not have a builtin method to lock the framerate?
08:12:35FromDiscord<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:42FromDiscord<morgan> so that's what i'm working on now
08:12:44FromDiscord<morgan> well
08:12:58FromDiscord<morgan> i'm working on stuff to help me debug it as i work on it more
08:14:43FromDiscord<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:11FromDiscord<morgan> and i wanna be able to see the graph to make sure i'm working with it correctly
08:18:03PMunch@Elegantbeef, looks like it. It sits at pretty much exactly 60FPS
08:21:40FromDiscord<Elegantbeef> Oh yea it has a vsync arg
08:23:01PMunchHmm, the docs link to nimdocs.com, but that seems to be down..
08:23:12FromDiscord<morgan> yeah it's been down for me all day
08:23:21PMunchNever seen that page before
08:23:23PMunchWho runs it?
08:23:27FromDiscord<morgan> seems to just make `nim doc` available online
08:23:32FromDiscord<morgan> treeform
08:23:40PMunchOh nice
08:23:49FromDiscord<morgan> yea it looks cool
08:23:59PMunchI guess it's something we should think about getting into the officially maintained infrastructure
08:24:22FromDiscord<morgan> yea, esp with better hosting lol
08:24:38FromDiscord<morgan> idk if it's an issue on the hosting or the code crashes
08:24:44FromDiscord<Elegantbeef> Well the nimble directory is supposed to but it bugs out
08:24:50FromDiscord<morgan> i saw some messages in hte past about it being down
08:25:21PMunchHmm, tried passing `vsync = false` and it still runs at 60 FPS
08:25:54PMunchThe playground is also official and it crashes all the time because the server is so whimpy..
08:26:03PMunchI guess it's time to get some new servers
08:26:03FromDiscord<morgan> rip
08:27:47FromDiscord<Elegantbeef> Hmph ticking nim to version 1.9.3 seems to have caused all the official docs to go there
08:28:09FromDiscord<Yardanico> oops
08:32:09FromDiscord<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:59FromDiscord<Elegantbeef> I mean you could just store the time of last frame then do `1/dt` šŸ˜„
08:34:08FromDiscord<morgan> that's what i did
08:34:19FromDiscord<Elegantbeef> Average it!
08:34:22FromDiscord<morgan> start of last frame to start of this frame
08:34:30FromDiscord<morgan> that's what i was gonna do next
08:35:07PMunchThis is what I did to benchmark: http://ix.io/4sj0/
08:35:26PMunchBug again, that runs at 60 FPS here no matter the vsync = false..
08:36:56PMunchHaha, apparently an Nvidia driver setting
08:37:06PMunchDisabling it and Boxy now runs at ~2000 FPS
08:37:11FromDiscord<morgan> lmao
08:38:19PMunchAnd it takes 100% CPU and the terminal uses 125% CPU :P
08:38:28PMunchApparently my terminal emulator is multi-threaded
08:39:06FromDiscord<morgan> weird that it's maxing out at like 45% usage on that thread
08:39:39PMunchWhat do you mean?
08:39:52*derpydoo quit (Quit: derpydoo)
08:40:17FromDiscord<morgan> im seeing 140-150 fps and the thread is at 45%
08:40:45FromDiscord<morgan> if it was just cpu limited it would instead go to like 300 fps and use the whole core
08:41:07PMunchAnd you did vsync = false?
08:41:18FromDiscord<morgan> no where do i put that
08:41:27FromDiscord<morgan> i didn't see vsync in the example
08:41:33PMunchLook at the code I shared
08:41:38FromDiscord<morgan> ok
08:42:10FromDiscord<morgan> ah ok
08:43:14*nanxiao quit (Quit: Client closed)
08:43:18FromDiscord<morgan> lol idk what it's doing, it's maxed out the thread (or nearly) and only went to like 160 fps
08:43:59PMunchYou've got slow threads I guess :P
08:44:37FromDiscord<morgan> weird it';s twice the cpu for like another tenth of performance
08:44:54FromDiscord<morgan> and yea not the latest cpu
08:46:08*derpydoo joined #nim
08:46:17FromDiscord<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:57FromDiscord<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:15FromDiscord<morgan> but it's late i think that'll be for tomorrow
08:52:50PMunchHmm, 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:57FromDiscord<Elegantbeef> Disruptek's frosty is probably a good base for that
09:01:57FromDiscord<Elegantbeef> It's very serde like
09:08:47PMunchHmm
09:09:59FromDiscord<ricky> In reply to @Elegantbeef "It's very serde like": huge if true
09:10:39FromDiscord<Elegantbeef> Well the issue with frosty is that no one uses it
09:16:54PMunchThat's really to serialize and deserialize native objects though..
09:20:36FromDiscord<deeuu> Here's a new package I stumbled upon the other day: https://github.com/gabbhack/deser . Looks like JSON only atm
09:30:01FromDiscord<narimiran> Nim 2.0 RC2 is out:ā†µhttps://nim-lang.org/blog/2023/03/31/version-20-rc2.html
09:32:11PMunchThose error messages takes my brain way too long to parse..
09:32:14NimEventerNew thread by miran: Nim v2.0.0 RC2 is out, see https://forum.nim-lang.org/t/10051
09:33:24PMunchAnd why is there no choosenim install guide?
09:34:28FromDiscord<ringabout> In reply to @PMunch "And why is there": https://github.com/dom96/choosenim/pull/317
09:34:48FromDiscord<ringabout> It might not work if building from csource.
09:34:58PMunchRight..
09:35:22PMunchSo we need to clone or transfer choosenim from dom so we can keep it up to date..
09:37:50FromDiscord<ringabout> Yeah
09:41:51FromDiscord<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:52Amun-Rado you often return gc types annotated with owned?
10:13:34FromDiscord<djazz> `choosenim update stable` gives 1.9.3 šŸ˜Ž
10:13:49FromDiscord<djazz> I guess this is v2 rc2?
10:15:05FromDiscord<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:28PMunchI 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:09FromDiscord<djazz> Latest devel build
10:55:24FromDiscord<djazz> It builds daily (nightly) right?
11:39:44*ltriant joined #nim
11:50:14FromDiscord<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:36FromDiscord<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:11PMunchpositional inits?
12:01:02PMunchHmm, the YAML library doesn't have any other type than strings
12:01:54FromDiscord<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:13FromDiscord<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:06FromDiscord<pietroppeter> In reply to @PMunch "Hmm, have anyone made": ā€¦I was trying to reply to this message by Pmunch
12:10:32FromDiscord<firasuke> When will forward declarations be removed?
12:18:48FromDiscord<ringabout> In reply to @firasuke "When will forward declarations": 2023 or 2024, which is on the roadmap anyway.
12:19:52FromDiscord<ringabout> It has been written on the Roadmap => https://github.com/nim-lang/RFCs/issues/503
12:20:03FromDiscord<firasuke> Oh ok cool
12:29:43FromDiscord<firasuke> Nice, Nim 2.0.0 is on its way, getting better and better!
12:50:00*rockcavera joined #nim
12:56:55PMunch@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:24FromDiscord<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:07FromDiscord<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:42FromDiscord<pietroppeter> But I do like a lot the approach of jsony
13:03:02FromDiscord<pietroppeter> (edit) "But" => "And"
13:03:50FromDiscord<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:58FromDiscord<kcvinker> What's the nim equivalent of `size_t` ?
13:19:15FromDiscord<ringabout> It should be `csize_t`
13:19:30FromDiscord<kcvinker> In reply to @ringabout "It should be `csize_t`": Thanks
13:23:50FromDiscord<kcvinker> How to import a function from `wchar.h` header file ?
13:31:02*fredrikhr quit (Quit: Disconnecting...)
13:32:21FromDiscord<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:32FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4skf
13:41:57FromDiscord<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:28NimEventerNew thread by ringabout: RFC: compiler support for object construction shorthand (full fields initializer), see https://forum.nim-lang.org/t/10052
13:47:41FromDiscord<kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4skh
13:52:11FromDiscord<michaelb.eth> In reply to @kcvinker "This is my problem.": `wcslen` is the one defined by `wchar.h` or a different one?
13:52:37FromDiscord<kcvinker> No. `dynlib` takes a lib name
13:52:47FromDiscord<michaelb.eth> that's not what I'm asking šŸ™‚
13:53:02FromDiscord<michaelb.eth> where is the `wcslen` defined that you want to import?
13:53:03FromDiscord<kcvinker> defined in `wchar.h
13:53:07FromDiscord<kcvinker> (edit) "`wchar.h" => "`wchar.h`"
13:53:24*jmdaemon joined #nim
13:56:05FromDiscord<kcvinker> I tried `<wchar.h> & `wchar.h`
13:56:07FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4skn
13:56:30FromDiscord<kcvinker> In reply to @michaelb.eth "I'm looking at https://en.wikibooks.org/wiki/C_Prog": Thanks. Let me try
13:57:19FromDiscord<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:25FromDiscord<kcvinker> In reply to @michaelb.eth "I'm looking at https://en.wikibooks.org/wiki/C_Prog": Yep ! worked
13:57:31FromDiscord<michaelb.eth> cool!
13:57:46FromDiscord<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:54FromDiscord<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:12FromDiscord<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:57FromDiscord<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:11FromDiscord<etra> (edit) "it's" => "its"
14:59:16*rockcavera quit (Remote host closed the connection)
15:00:02FromDiscord<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:41FromDiscord<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:58FromDiscord<etra> I saw one of your talks deech btw and it's one of the reasons I'm here haha
15:02:28FromDiscord<deech> Wow! That's awesome.
15:03:21FromDiscord<jmgomez> What's wrong with the hook approach? (i.e. std/jsonutils)
15:08:01FromDiscord<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:50FromDiscord<jmgomez> But you can always override it, cant you?
15:12:47FromDiscord<deech> Can you? I'm not sure. Not saying you're wrong but Nim's overload resolution is pretty complicated.
15:14:28FromDiscord<deech> As far as I can tell, concepts are more analogous to traits than hooks.
15:17:35*jmdaemon joined #nim
15:19:05FromDiscord<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:33FromDiscord<Gumbercules> sent a long message, see http://ix.io/4skO
15:23:34FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4skP
15:25:23FromDiscord<jmgomez> In reply to @Gumbercules "I'm trying to wrap": how are you wrapping it?
15:32:31FromDiscord<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:20FromDiscord<Gumbercules> moments even
15:34:43FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4skW
15:40:22FromDiscord<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:42FromDiscord<jmgomez> Okay, I saw the struct now with the unused pointers
15:41:53FromDiscord<Gumbercules> sent a long message, see http://ix.io/4skX
15:42:15FromDiscord<Gumbercules> (edit) "http://ix.io/4skX" => "http://ix.io/4skY"
15:42:56FromDiscord<jmgomez> Okay, can you do sizeof on both? In in the C one that you are referring and the one in Nim
15:42:57FromDiscord<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:11FromDiscord<Gumbercules> Yeah, I did that and they were the same but let me just double check...
15:43:47FromDiscord<Gumbercules> oh btw - I didn't have `ptr proc` earlier either - just `proc`
15:43:48FromDiscord<firasuke> What's the difference between varargs[string] and seq[string] as procedure parameters?
15:43:57FromDiscord<Gumbercules> I added the `ptr proc` last night when I was trying to get things working
15:43:59FromDiscord<jmgomez> I think some time ago I saw issues when no using importc pure
15:44:14FromDiscord<jmgomez> (with the pure pragma I mean)
15:44:32FromDiscord<jmgomez> Like it skips rtti, not sure if it has to be explicitly enabled
15:44:57FromDiscord<Gumbercules> I saw something in the manual about `pure` doing nothing unless you were also using `inheritable`
15:45:29FromDiscord<jmgomez> In reply to @firasuke "What's the difference between": https://nim-lang.org/docs/manual.html#types-varargs
15:45:46FromDiscord<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:07FromDiscord<Nerve> (edit) "`varargs[string]`" => "`varargs[T]`" | "strings" => "`T`"
15:46:18FromDiscord<Nerve> (edit) removed "and,"
15:46:38FromDiscord<Nerve> (edit) "corresponds to" => "is a type of"
15:46:51FromDiscord<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:01FromDiscord<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:20FromDiscord<Gumbercules> @jmgomez here's the C version: https://onlinegdb.com/emGNZtXsG - output looks to be exactly the same
16:04:10FromDiscord<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:11FromDiscord<Hourglass [She/Her]> How much overhead would it be to make JNI bindings to a C library in Nim?
16:06:45FromDiscord<Hourglass [She/Her]> Would it be negligible? Or is it big enough to make an impact
16:07:11FromDiscord<Hourglass [She/Her]> (This C library doesn't have any JNI bindings and I cannot do C to save my life)
16:07:28FromDiscord<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:56FromDiscord<Hourglass [She/Her]> Acting as the glue between C and the JVM
16:08:21FromDiscord<Hourglass [She/Her]> Since I thought JNI requires you to do some funky stuff for that?
16:13:33FromDiscord<Gumbercules> In reply to @Hourglass, When the Hour Strikes "Acting as the glue": This is what JNI does
16:13:41FromDiscord<Gumbercules> In reply to @Hourglass, When the Hour Strikes "Since I thought JNI": define "funky stuff"
16:13:49FromDiscord<Hourglass [She/Her]> I mean between C and JNI
16:14:02FromDiscord<Gumbercules> You don't really need glue between C and JNI
16:14:12FromDiscord<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:14FromDiscord<Gumbercules> You just use JNI to wrap the C API
16:14:29FromDiscord<Hourglass [She/Her]> Oh huh
16:14:31FromDiscord<Gumbercules> In reply to @jmgomez "it's quite odd. Just": yeah I can give that a shhot
16:15:33FromDiscord<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:29FromDiscord<Gumbercules> https://www.baeldung.com/jni would probably be a good read / place to start
16:17:25FromDiscord<Yardanico> also <https://github.com/yglukhov/jnim>
16:18:39FromDiscord<jmgomez> In reply to @Yardanico "also <https://github.com/yglukhov/jnim>": that's cool, does it have bindings?
16:18:44FromDiscord<Yardanico> wdym?
16:19:00FromDiscord<Yardanico> it is the library for binding java code to nim
16:19:07FromDiscord<jmgomez> the java api automatically bound to Nim types
16:19:22FromDiscord<Yardanico> ah, no, I don't think so
16:26:27FromDiscord<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:47FromDiscord<Hourglass [She/Her]> In reply to @Gumbercules "https://www.baeldung.com/jni would probably be": Yeah reading that
16:28:29FromDiscord<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:51FromDiscord<Gumbercules> The real question is - what are you trying to do?
16:32:48FromDiscord<Hourglass [She/Her]> Create some mediocre bindings to a C library for Java
16:37:26FromDiscord<Gumbercules> Gotcha - Nim seems like it'd just add more complexity to this task
16:38:15FromDiscord<Gumbercules> You may want to check out SWIG - https://www.swig.org/Doc1.3/Java.html
16:41:35FromDiscord<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:02FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4sl7
16:42:11FromDiscord<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:51FromDiscord<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:22FromDiscord<BoomBang> but I guess since adding is an actual function, this won't work
16:43:26FromDiscord<BoomBang> any way to do that?
16:44:18FromDiscord<Yardanico> In reply to @BoomBang "any way to do": let mynewvar = myfloat + float(myint)
16:44:26FromDiscord<BoomBang> thx
16:44:28FromDiscord<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:36FromDiscord<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:51FromDiscord<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:02FromDiscord<djazz> I think nim lang server crashed my pc. Don't do infinite recursion statically guys!
17:00:10FromDiscord<djazz> https://media.discordapp.net/attachments/371759389889003532/1091406595746955445/DSC_5692.jpg
17:00:51FromDiscord<djazz> I was going to type the arguments... And it hung up
17:03:06FromDiscord<djazz> I disabled the recursion limit...
17:03:17FromDiscord<djazz> Otherwise it wouldnt happen haha
17:06:01FromDiscord<djazz> Hm, i uncommented vmmaxiterations in my config.nims but it still crashed
17:06:19FromDiscord<djazz> (edit) "uncommented" => "commented out"
17:06:22FromDiscord<I have 50GB of nothing on my PC> it might be eating all your ram
17:06:27FromDiscord<djazz> Yes it is
17:07:35FromDiscord<djazz> I was just about to reset the pc and it came back responding xD vscode gone
17:20:59FromDiscord<Hourglass [She/Her]> In reply to @Gumbercules "You may want to": Ah thanks Gumbercules!
17:22:08*beholders_eye joined #nim
17:35:55FromDiscord<creative> is choosenim broken?
17:36:19FromDiscord<djazz> choosenim 1.6.12 to get back to stable
17:36:43FromDiscord<creative> how do i do that with "iffy/[email protected]" thing
17:37:07FromDiscord<djazz> oh. right
17:37:22FromDiscord<djazz> yeah see #internals
17:38:20FromDiscord<djazz> i havent done much CI so i dunno
17:39:00FromDiscord<creative> no problem
17:39:54FromDiscord<System64 ~ Flandre Scarlet> Will Nim 2.0 have breaking changes?
17:41:20FromDiscord<Yardanico> of course, yes
17:42:02FromDiscord<Yardanico> <https://github.com/nim-lang/Nim/blob/devel/changelogs/changelog_2_0_0.md>
17:43:30FromDiscord<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:41NimEventerNew 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:44NimEventerNew thread by demetera: Nim 1.6 vs 2 (1.9) Working with channels, see https://forum.nim-lang.org/t/10054
18:46:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "Yes, the ones I": Ah alright so I just need to install thoses packages?
18:47:26FromDiscord<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:35FromDiscord<Phil> (edit) "files," => "file,"
18:47:50*fallback_ joined #nim
18:48:25FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "Assuming you build with": The way I build is...ā†µnim compile -r myFile.nim
18:49:08FromDiscord<Phil> Ma man is not even using -d:release or -d:lto šŸ˜›
18:49:44FromDiscord<TechnoRazor> sent a code paste, see https://play.nim-lang.org/#ix=4slD
18:49:49FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "Ma man is not": I did this tooā†µBut what is -d:lto
18:51:02FromDiscord<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:14FromDiscord<Elegantbeef> probably need to do `mixin t1` inside the `t2` template, or `bind t1` if that doesnt workā†µ(@TechnoRazor)
18:51:21FromDiscord<Elegantbeef> Well not really the C bits
18:51:22FromDiscord<Phil> It increases compiletime considerably though if you have a larger projects with many dozens of files
18:51:30FromDiscord<Phil> (edit) "a larger" => "arger"
18:51:35FromDiscord<Phil> (edit) "arger" => "larger"
18:52:01FromDiscord<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:05FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4slE
18:52:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "link time optimization. Stems": Oh good to knowā†µSo I should use Nimble build?
18:52:44FromDiscord<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:12FromDiscord<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:16FromDiscord<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:17FromDiscord<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:58FromDiscord<Phil> And why is that a problem? You can have separate nimble tasks to compile them individually
18:54:17FromDiscord<Phil> And a third nimble task to compile both at once if you're as lazy as me
18:54:26FromDiscord<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:51FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4slG
18:57:55FromDiscord<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:11FromDiscord<Elegantbeef> Well it cannot really provide a fix
18:58:43FromDiscord<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:05FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4slK
18:59:31FromDiscord<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:04FromDiscord<TechnoRazor> (edit) "being" => "the identifier is"
19:00:30FromDiscord<Elegantbeef> That's wildly complex
19:00:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "This is parts of": Oh thanks! That can help me a lot!
19:01:44FromDiscord<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:06FromDiscord<Elegantbeef> Well it's wildly complex to intuit what the programmer wants
19:02:19FromDiscord<Elegantbeef> Just cause you have a `t1` template does not mean you want to use it
19:03:41FromDiscord<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:15FromDiscord<Elegantbeef> The real question is why are you using a template here šŸ˜„
19:07:15FromDiscord<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:43FromDiscord<Nilts> Choosenim broke on me :( https://media.discordapp.net/attachments/371759389889003532/1091438694830973049/message.txt
19:08:03FromDiscord<Elegantbeef> I mean why are you using a template for something that doesnt need a template šŸ˜„
19:09:07FromDiscord<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:24FromDiscord<Elegantbeef> Well you're using the wrong tool and then complaining that it fails šŸ˜„
19:10:36FromDiscord<Elegantbeef> You use the simplest tool first\: proc -\> generic -\> template -\> macro
19:11:45FromDiscord<Nilts> In reply to @not logged in "Choosenim broke on me": anybody know what is wrong?
19:11:52FromDiscord<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:27FromDiscord<Elegantbeef> It's not even premature optimisation it's being silly
19:12:44FromDiscord<TechnoRazor> then i guess im silly :P
19:13:06FromDiscord<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:28FromDiscord<Nilts> Is this related? https://github.com/dom96/choosenim/issues/324
19:13:34FromDiscord<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:44FromDiscord<Elegantbeef> With a generic proc it should bind properly
19:14:08FromDiscord<Nilts> In reply to @djazz "Araq made Nim 2.0": how do i fix it?
19:14:16FromDiscord<djazz> choosenim 1.6.12
19:14:19FromDiscord<djazz> maybe
19:14:33FromDiscord<Elegantbeef> https://godbolt.org/z/r5d18rEEW but like.... it inlines as expected
19:14:49FromDiscord<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:39FromDiscord<Elegantbeef> I'd argue this encourages following convention instead of doing silly things
19:15:53FromDiscord<Elegantbeef> Why you are using a template and neutering what your program can do is beyond me
19:17:30FromDiscord<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:24FromDiscord<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:39FromDiscord<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:03FromDiscord<sOkam!> šŸ˜® I totally missed the news https://media.discordapp.net/attachments/371759389889003532/1091442301361995816/image.png
19:22:43FromDiscord<TechnoRazor> In reply to @sOkam! "šŸ˜® I totally missed": oh wow, i did too
19:22:53FromDiscord<djazz> now do `choosenim versions` and see it break xD
19:27:25FromDiscord<Elegantbeef> Anywho PRs are generally welcomed to improve error messages
19:27:50FromDiscord<Yardanico> In reply to @sOkam! "šŸ˜® I totally missed": that's not exactly intended
19:28:05FromDiscord<Yardanico> but yeah, a lot of people get to test 2.x without actually wanting to do so :D
19:29:36FromDiscord<Gumbercules> In reply to @djazz "now do `choosenim versions`": the first mistake there is using `choosenim`
19:31:40FromDiscord<TechnoRazor> sent a long message, see http://ix.io/4slV
19:33:36FromDiscord<TechnoRazor> not sure if i verbalized my thoughts well, but im sure there are others who have felt the same way
19:34:00FromDiscord<@@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:46FromDiscord<Elegantbeef> You're not even denied to do it
19:36:46FromDiscord<Elegantbeef> Open arrays are not capturable
19:36:52FromDiscord<Elegantbeef> use a `seq`
19:38:09FromDiscord<@@prestosilver> is it viable to convert the openarray into a seq then build the iterator
19:38:32FromDiscord<Elegantbeef> Also works
19:38:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4slZ
19:39:26FromDiscord<@@prestosilver> That might work
19:39:36FromDiscord<sOkam!> In reply to @Yardanico "that's not exactly intended": oh it wasn't intended to make rc2 stable?
19:39:40FromDiscord<Yardanico> no lol
19:39:48FromDiscord<sOkam!> ah lol i see
19:39:57FromDiscord<Elegantbeef> It will have to copy eitherway since it's not a `ref`
19:40:01FromDiscord<@@prestosilver> for refrence im working on the findExes function in stdlib, idk if that changes anything
19:40:06FromDiscord<@@prestosilver> ok
19:40:08FromDiscord<@@prestosilver> yea
19:40:10FromDiscord<@@prestosilver> makes sense
19:40:41FromDiscord<Elegantbeef> doing `for x in @oa` might be the most sensible in that case
19:41:21FromDiscord<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:18FromDiscord<@@prestosilver> whats @ do, idk if ive seen it
19:42:37FromDiscord<Elegantbeef> Well being denied generic methods is par for the course
19:42:41FromDiscord<Elegantbeef> `@` converts a openarray to a seq
19:42:46FromDiscord<@@prestosilver> o neato
19:42:48FromDiscord<@@prestosilver> ill use that
19:42:53FromDiscord<Elegantbeef> You've certainly seen `@[10, 20, 30]`
19:43:07FromDiscord<@@prestosilver> dang didnt know that was an operator
19:43:11FromDiscord<@@prestosilver> kinda sick
19:43:35FromDiscord<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:23FromDiscord<@@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:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4sm1
19:46:35FromDiscord<@@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:58FromDiscord<@@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:50FromDiscord<Elegantbeef> I do think with ringabout's addition of a vtable it might be simpler to make generic methods work
19:49:02FromDiscord<Elegantbeef> Since now it's just adding the proc for all instantiated types of a generic, but who knows
19:49:06FromDiscord<Elegantbeef> "PRs welcome" šŸ˜„
19:50:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4sm4
19:51:05FromDiscord<vexman> sent a code paste, see https://play.nim-lang.org/#ix=4sm5
19:51:53FromDiscord<Elegantbeef> Are you super certain it's the right arch?
19:52:26FromDiscord<vexman> https://media.discordapp.net/attachments/371759389889003532/1091449945002877088/image.png https://media.discordapp.net/attachments/371759389889003532/1091449945401348136/image.png
19:52:35FromDiscord<djazz> nim -v, does it say 64 bit?
19:52:46FromDiscord<@@prestosilver> yea was about to say that
19:53:00FromDiscord<djazz> sometimes choosenim dowloads win32 version xD
19:53:01FromDiscord<vexman> sent a code paste, see https://play.nim-lang.org/#ix=4sm7
19:53:03FromDiscord<vexman> 386 so 32 bit i guess
19:53:04FromDiscord<djazz> like in your case
19:53:09FromDiscord<Elegantbeef> Well there's your problem
19:53:18FromDiscord<djazz> choosenim 1.6
19:53:23FromDiscord<djazz> choosenim remove 1.6.12
19:53:29FromDiscord<djazz> chosenim 1.6.12
19:53:35FromDiscord<djazz> choosenim remove 1.6
19:53:46FromDiscord<@@prestosilver> sent a code paste, see https://play.nim-lang.org/#ix=4sm8
19:53:48FromDiscord<@@prestosilver> sorry for the large code drop
19:53:56FromDiscord<@@prestosilver> (edit)
19:54:42FromDiscord<vexman> In reply to @djazz "choosenim remove 1.6.12": https://media.discordapp.net/attachments/371759389889003532/1091450518376816710/image.png
19:54:44FromDiscord<Elegantbeef> still using `exts` inside the iterator
19:54:54FromDiscord<@@prestosilver> oml lol
19:55:00FromDiscord<@@prestosilver> o wait
19:55:07FromDiscord<@@prestosilver> thats the template tho right
19:55:09FromDiscord<djazz> @vexman, hence choosenim 1.6
19:55:21FromDiscord<djazz> just any other version so you can reinstall 1.6.12
19:55:31FromDiscord<vexman> so .12 doesnt have a x64 bin?
19:55:46FromDiscord<djazz> yees, but choosenim sometimes gets wrong arch on windows
19:55:52FromDiscord<djazz> i had it happen too
19:55:55FromDiscord<vexman> wtf just happened
19:56:06FromDiscord<vexman> you sure 1.6 is like a version choosenim knows about?
19:56:10FromDiscord<Elegantbeef> Why are you even using a template here
19:56:37FromDiscord<djazz> use 1.6.10 then
19:56:38FromDiscord<@@prestosilver> Idk, most of this code is straight from the stdlib, i just pushed it into an iterator
19:56:38FromDiscord<vexman> https://media.discordapp.net/attachments/371759389889003532/1091451005868196041/image.png
19:56:53FromDiscord<djazz> choosenim 1.6.10
19:56:55FromDiscord<vexman> ok it found .10
19:57:00FromDiscord<@@prestosilver> might be worth a full function rewrite ngl
19:57:10FromDiscord<@@prestosilver> rather than trying to save the old code
19:57:19FromDiscord<vexman> https://media.discordapp.net/attachments/371759389889003532/1091451177146781786/image.png
19:57:21FromDiscord<vexman> ..
19:57:30FromDiscord<djazz> oh. right
19:57:44FromDiscord<vexman> this is seriously gonna make me use linux
19:57:58FromDiscord<vexman> debian collecting dust on my other partition
19:58:04FromDiscord<@@prestosilver> I swear windows defender makes me so mad sometimes lol, The main reason i use linux
19:58:17FromDiscord<vexman> so this thing works just fine in linux right?
19:58:25FromDiscord<djazz> try any other version, like devel
19:58:30FromDiscord<djazz> choosenim devel
19:58:52FromDiscord<vexman> it got the 32 bit again
19:59:00FromDiscord<djazz> šŸ˜® oh
19:59:07FromDiscord<djazz> choosenim update self ?
19:59:15FromDiscord<djazz> maybe u got 32bit choosenim?
19:59:24FromDiscord<vexman> nope
19:59:29FromDiscord<vexman> choosenim v0.8.4 (2022-07-06 14:50:55) [windows/amd64]
19:59:41FromDiscord<djazz> hm right, there is only 64bit choosenim
19:59:49FromDiscord<vexman> fuck you microsoft
20:00:09FromDiscord<@@prestosilver> most of the time windows defender false flags new exes, but the more people that download them the faster its fixed
20:00:29FromDiscord<@@prestosilver> drives me nuts bc like games i build and send to freinds are always flagged
20:00:34FromDiscord<vexman> cant i specify which architecture im using in choosenim
20:00:55FromDiscord<djazz> In reply to @vexman "fuck you microsoft": indeed... in related news... https://discord.com/channels/371759389889003530/371759607934353448/1091252980210212914
20:02:14FromDiscord<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:34FromDiscord<djazz> steam deck ftw, and i game on my linux pc too
20:02:40FromDiscord<@@prestosilver> you can pay for a cert to get through windows defender if im not mistaken, but its 100% a scam imho
20:02:59FromDiscord<djazz> i bought an old thinkpad second hand that i have windows on. the hdd is sooo slooow
20:03:00FromDiscord<@@prestosilver> exe signing or something
20:03:21FromDiscord<djazz> (i have only used it to test nim stuff lol)
20:03:51FromDiscord<@@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:53FromDiscord<@@prestosilver> lol
20:04:02FromDiscord<@@prestosilver> I mean not good for gaming bc no gpu ofc
20:04:08FromDiscord<@@prestosilver> but still nice for softdev
20:04:10FromDiscord<djazz> this one is from like 2010
20:04:24FromDiscord<vexman> ok so i switched to nim 0.16.0
20:04:27FromDiscord<vexman> x32 again
20:04:32FromDiscord<@@prestosilver> my x220 was a 2011 model
20:04:44FromDiscord<djazz> touchpad is bit broken, so it oftens opens Cortana, which isnt available in my country
20:04:45FromDiscord<@@prestosilver> was bc I upgraded the motherboard
20:04:49FromDiscord<@@prestosilver> lol
20:04:51FromDiscord<djazz> some gesture i guess
20:05:22FromDiscord<djazz> T510 is what i have
20:06:56FromDiscord<@@prestosilver> dang, my first laptop was a T440-T400 forgot tbh
20:07:24FromDiscord<djazz> In reply to @vexman "x32 again": so weird..
20:13:16FromDiscord<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:29FromDiscord<vexman> but at the end i had pong
20:13:45FromDiscord<vexman> ill just develop on linux, its ridiculous to do this on windows
20:14:39FromDiscord<djazz> just use mingw64 to develop for windows from linux šŸ˜Ž
20:15:01FromDiscord<vexman> i do have mingw64
20:15:14FromDiscord<vexman> oh wait nvm
20:32:34*rockcavera quit (Remote host closed the connection)
21:01:25anddamare enum field names case insensitive?
21:01:43FromDiscord<Yardanico> they're the same as all other Nim symbols, so case insensitive except the first letter
21:01:52FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality
21:01:57FromDiscord<Yardanico> and underscores ignored ofc
21:02:50*Notxor quit (Remote host closed the connection)
21:03:39FromDiscord<Elegantbeef> All idents are style instensitive
21:03:39FromDiscord<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:40FromDiscord<Elegantbeef> I changed it already, but they're at it again šŸ˜„
21:03:42anddamI 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:03anddamI have three issues in the resulting imgui.nim, one is that End and END gets generated as names for ImGuiKey enum
21:06:44anddamanother issue with enums is that the generation code takes C enums ImGuiKey_FOO and create an enum type ImGuiKey with FOO name
21:07:09anddamin newer cimgui there's ImGuiKey_0 .. ImGuiKey_9, the resulting names 0 .. 9 are not valid
21:07:40FromDiscord<Elegantbeef> Yep you need to modify them somewhat to disambiguate
21:07:40FromDiscord<Elegantbeef> Many people get annoyed by style insensitivity but in what world is End and END different
21:07:42anddamI guess I can just prefix this with something like "NUMBER", not sure why there are ImGuiKey_End and ImGuiKey_END though
21:08:00anddamwell "This is the End" seems like the final chapter of a book
21:08:18anddam"THIS IS THE END" means we are likely going to die soon
21:09:17anddamok, 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:56FromDiscord<Elegantbeef> Or just do `Zero, One, Two, ...` šŸ˜„
21:10:57anddamI see the "Elegant" part in your nick now
21:11:13anddamnow, the other problem I am facing is this type in imgui.nim
21:11:14anddam ImBitArrayForNamedKeys* = uint32<ImGuiKey_NamedKey_COUNT,-ImGuiKey_NamedKey_BEGIN>
21:11:18anddamthat's not very good
21:11:50FromDiscord<Elegantbeef> Lol
21:11:52FromDiscord<Elegantbeef> What about EnD or eNd or enD?
21:11:55anddamI 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:00anddamI used CAPITAL_END
21:15:07anddamapropos 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:27anddamthose types are ill-defined for a C library, right?
21:16:10anddamI 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:23FromDiscord<Elegantbeef> Shame it's hardly ever true
21:16:30anddamI was told otherwise on #C++ but didn't get what this type actually is?
21:16:40anddamElegantbeef: sorry, what is hardly ever true
21:16:41anddam?
21:20:18FromDiscord<Elegantbeef> Me being elegant
21:20:18FromDiscord<Elegantbeef> Bridge moment
21:21:04FromDiscord<Elegantbeef> C++ templates do support constants iirc
21:22:56FromDiscord<etra> yeah they do, `std::array` is a prime example of its usage
21:26:59anddamok, but how does that translate into a typedef in cimgui? that should be C and, to my limited knowledge, not have template
21:27:29anddamwhat's a way to check if a string is one of "0" .. "9"?
21:28:10anddamI mean a nim idiomatic way
21:28:14anddam"nimbolic"
21:30:35FromDiscord<Elegantbeef> `if str.len == 0 and str[0] in '0'..'9'`
21:30:38FromDiscord<Elegantbeef> I mean `str.len == 1` of course
21:30:44FromDiscord<Elegantbeef> In C it probably doesnt translate
21:30:44FromDiscord<Elegantbeef> Since C does not have value associated types
21:30:47FromDiscord<Elegantbeef> Might be a `T[]`?
21:36:59*advesperacit quit ()
21:39:11FromDiscord<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:13FromDiscord<etra> (edit) "strucct" => "struct"
21:39:53FromDiscord<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:54FromDiscord<etra> (woops, sorry, fixed the message)
21:42:18anddamyeah I am on IRC, I see the edits
21:42:29FromDiscord<etra> oh, that must look terrible on IRC
21:42:36FromDiscord<Elegantbeef> It's spam of messages
21:42:40anddamnot really
21:42:54FromDiscord<Elegantbeef> https://irclogs.nim-lang.org/ if you care to see
21:43:13anddamI am still puzzled how would I translate that in C, the OFFSET still gets used in the generated struct
21:43:21anddamthis is an error on cimgui side, right?
21:43:40anddamI mean https://github.com/anddam/imgui/tree/feature/update-dear-imgui
21:43:58FromDiscord<Elegantbeef> It's a fixed bitset
21:44:06anddamif you clone and run nimble gen, should get the incriminated typedef
21:44:07FromDiscord<Elegantbeef> You'd generate a bitset per type using a macro in C land
21:44:31FromDiscord<etra> OFFSET should not be used in the struct though? the offset is only used in the functions
21:45:18FromDiscord<Elegantbeef> I'd write the equivlent C macro but i like my sanity
21:46:09FromDiscord<Elegantbeef> In Nim you actually might get away with a `set[range[0..SomeValueIDoNotKnowHere]`
21:46:38anddametra: 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:44FromDiscord<etra> In reply to @anddam "I am still puzzled": it's not? https://github.com/nimgl/cimgui/blob/d24246adfdbd01d70998deda8570f175283b6035/cimgui.h#L1710
21:46:50FromDiscord<etra> unless I'm not looking at the right thing
21:47:30FromDiscord<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:12FromDiscord<Elegantbeef> They're just procedures that take an instance of the type as a first parameter
21:48:12anddambut I see the OFFSET being used there in the struc
21:48:16FromDiscord<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:45FromDiscord<etra> In reply to @anddam "but I see the": where?
21:48:49FromDiscord<etra> can you point to a specific line?
21:48:53anddamok, so ImBitArrayForNamedKeys is actually ImBitArray_ImGuiKey_NamedKey_COUNT__lessImGuiKey_NamedKey_BEGIN
21:49:27anddamthat is actually struct ImBitArray_ImGuiKey_NamedKey_COUNT__lessImGuiKey_NamedKey_BEGIN
21:49:53anddamyes, I am battling between this damn windows terminal, late hour and figuring stuff I do not really know
21:50:28anddamthe https://github.com/nimgl/cimgui/blob/d24246adfdbd01d70998deda8570f175283b6035/cimgui.h#L1710 you linked has the typedef for ImBitArrayForNamedKeys
21:50:50anddamI 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:02anddamI think that's broken and has been committed as such
21:52:23FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4sms
21:52:57FromDiscord<etra> (and we're ignoring all the typedef shenanigans that C requires to avoid typing `struct`)
21:54:05anddamwhat code should I paste?
21:56:37anddamif 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:01FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4smy
21:57:07anddamthen `nimble gen` and the issue arise in src/imgui.nim
21:57:18anddamooh "sent" a code paste, not "send" as "send me a code paste"
21:57:21FromDiscord<etra> sorry, can't do that now
21:58:37anddamnp, thanks for the paste
21:58:43anddamgotta walk the dog now
21:59:07FromDiscord<etra> same except I have to walk just myself =D
21:59:27anddamtake a poop bag roll anyway, just in caseā€¦
21:59:43anddam(bad joke)
21:59:45anddamhave a nice walk
22:03:04NimEventerNew thread by cmc: Announce: LimDB 0.2.0, see https://forum.nim-lang.org/t/10055
22:20:20FromDiscord<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:44FromDiscord<System64 ~ Flandre Scarlet> because I used it
22:22:08FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1091487620808318976/image.png
22:33:14*rockcavera joined #nim
22:57:58FromDiscord<newlibarian> is there such thing as a python to nim transpiler?
23:03:16FromDiscord<Elegantbeef> https://github.com/py2many/py2many has some nim support
23:03:22FromDiscord<Elegantbeef> The answer is going to generally be "no"
23:03:40FromDiscord<Elegantbeef> Python being dynamically typed means it's nigh impossible to transpile most code and just run it
23:04:06anddamSystem64 ~ Flandre Scarlet: did you use custom cimgui or nimgl/nimfl \\]
23:04:52anddamthe dog hit enter mid-typing
23:05:30anddamSystem64 ~ Flandre Scarlet: did you use custom cimgui or the latest available on nimgl/nimgui?
23:11:23NimEventerNew thread by alexeypetrushin: Why to_seq not overloaded properly?, see https://forum.nim-lang.org/t/10056
23:18:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @anddam "System64 ~ Flandre Scarlet:": NimGL
23:19:17anddamSystem64: I'll shorten your nick since nick completion doesn't work well over the irc bridge
23:19:50anddammy issue was that I was trying docking branch, I didn't have the docking effect so tried to upgrade the underlying libs
23:21:16anddambut 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