<< 17-06-2023 >>

00:05:46FromDiscord<lucidrains> Nim should be more mature than Zig?
00:12:22FromDiscord<Elegantbeef> Who knows it's older, but also more complex
00:14:09*lucasta joined #nim
00:21:44FromDiscord<takko_the_boss> I'm gonna create a language opposite of Zig called "Giz" (G pronounced as a J), and it will always produce the opposite of what you want it to. And it will maybe work sometimes sorta.
00:22:43FromDiscord<jmgomez> Jason, do you know if you can somehow tell nimble to use nim_temp? or a custom nim version? triggered something whith a change in the compiler that's getting hard to catch
00:23:26FromDiscord<Elegantbeef> `nimble --nim:...`
00:24:18FromDiscord<jmgomez> beautiful, thank you! I was in the opposite direction adding traces to nimble
00:29:05FromDiscord<Elegantbeef> takko\_the\_boss sadly I want to indulge your shitty joke, the package manage is epaculate?
00:31:54FromDiscord<takko_the_boss> Mac OS has its own version called emaculate.
00:32:38FromDiscord<jmgomez> what, I didnt know this was a thing `T: typedesc[HoleyEnum]`
00:32:51FromDiscord<Elegantbeef> Which part?
00:32:58FromDiscord<jmgomez> `typedesc[T]`
00:33:18FromDiscord<Elegantbeef> Really you've never seen `proc init(_: type T)`?
00:35:28FromDiscord<jmgomez> Maybe Im sleepy but I cant recall, also dont really see the relation. typedesc is a bit alien to me TBH, I just know it exists and it's a handy alternative to `T` but not sure about the nuances
00:35:49FromDiscord<Elegantbeef> `typedesc` is a generic parameter that accepts types
00:36:05FromDiscord<Elegantbeef> `typedesc[T]` constrains it to only types of `T`
00:36:19FromDiscord<Elegantbeef> so like `typedesc[int or string]`
00:37:59FromDiscord<jmgomez> I see, but is not effectively the same as a `T : int | string`?
00:38:06FromDiscord<Elegantbeef> No
00:38:10FromDiscord<Elegantbeef> `typedesc` accepts types
00:38:27FromDiscord<jmgomez> ahh like you pass directly the type as argument
00:38:37FromDiscord<jmgomez> somewhat a meta type
00:38:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yrT
00:38:47FromDiscord<Elegantbeef> Is a common pattern
00:39:28FromDiscord<jmgomez> hmm
00:39:47FromDiscord<jmgomez> good to know, I have more clear now why it fails 😅
00:40:26FromDiscord<jmgomez> thanks for the explanation!
00:47:02FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4yrV
00:47:12FromDiscord<Elegantbeef> More so that it works with generics
00:47:28FromDiscord<Elegantbeef> `initType(x, y)` does not work inside a generic
00:47:53FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4yrW
00:48:32FromDiscord<arathanis> (edit) "https://play.nim-lang.org/#ix=4yrW" => "https://play.nim-lang.org/#ix=4yrX"
01:25:49FromDiscord<JJ> typedesc init good 👍
01:26:53FromDiscord<Elegantbeef> named init bad 👎️
01:44:52FromDiscord<michaelb.eth> In reply to @Elegantbeef "named init bad 👎️": why?
02:31:36*derpydoo joined #nim
02:45:09FromDiscord<JJ> it's ugly tawa mi
02:45:14FromDiscord<JJ> also yeah, generics
02:48:27FromDiscord<Elegantbeef> I assumed I missed a message and JJ isnt just crazy
02:58:32*azimut_ quit (Ping timeout: 240 seconds)
03:36:35FromDiscord<graveflo> I like to use `init` name as an initializer instead of a dual purpose instantiate / initializer so something like `proc init[T: MyType](n: var T)`. I prefer to use nims built in instantiation mech whenever possible
03:37:06FromDiscord<Elegantbeef> Well Nim's object constructor isnt much better in the generic department 😄
03:37:14FromDiscord<Elegantbeef> It's a tinge better, but not much
03:37:57FromDiscord<graveflo> whats the hang up with generics anyway. I only have issues in this area when mixing generics and inheritance but I doubt that is what you are talking about
03:38:15FromDiscord<Elegantbeef> if your proc is named `initMyType` you cannot use it with a generic
03:38:39FromDiscord<Elegantbeef> If your obj constructor is `T(x: x, y: y)` but you have a `Vec2 = array[2, float32]` it doesnt work
03:39:58FromDiscord<graveflo> I am confused. Is the `Vec2` the subject of the proc or a member of `T` or something else
03:40:39FromDiscord<Elegantbeef> https://github.com/beef331/gooey/blob/master/src/gooey.nim#L99
03:40:51FromDiscord<graveflo> oh nvm I get it. Its not a common name
03:40:52FromDiscord<Elegantbeef> I want my gui stuff to work with any vector type
03:40:59FromDiscord<graveflo> so generics cant target it broadly
04:43:12madpropsis atlas like package.json with npm?
04:44:10*lucasta quit (Quit: Leaving)
04:44:29madpropsor is it more like virtualenvs?
04:58:57*adigitoleo quit (Server closed connection)
04:59:09*adigitoleo joined #nim
05:25:07*ntat joined #nim
05:29:44FromDiscord<krab4t> nim needs a library like this https://xsdata.readthedocs.io/en/latest/index.html
05:37:03FromDiscord<Elegantbeef> Be the change you want in the world
05:42:13*derpydoo quit (Ping timeout: 258 seconds)
05:47:01*rockcavera quit (Remote host closed the connection)
05:48:12FromDiscord<huantian> Yeah cus I won’t touch xml unless I need to 🙃
05:49:35*derpydoo joined #nim
06:00:42FromDiscord<_gumbercules> In reply to @krab4t "nim needs a library": Just find a C library, wrap it, done
06:01:35FromDiscord<huantian> Hm not sure that would work for this
06:01:53FromDiscord<huantian> Since the point of the library is that it generates types given a schema right
06:02:30FromDiscord<_gumbercules> Ah, okay yeah then nevermind
06:13:43FromDiscord<krab4t> any xml, xml schema or json
06:30:36*disso-peach quit (Quit: Leaving)
07:02:36FromDiscord<heysokam> is there an existing way to expand a sequence in place inside another seq, so that `seqOne & seqTwo` is not needed, and instead one could do `@[seqOne.expand, seqTwo.expand]`?
07:05:09*al1ranger joined #nim
07:06:08*al1ranger quit (Client Quit)
07:09:24FromDiscord<Elegantbeef> no
07:30:21FromDiscord<odexine> In reply to @heysokam "is there an existing": What would the difference be between the two aside from syntax
07:30:46FromDiscord<Bloss> 2.0 when? 😱
07:30:50FromDiscord<Elegantbeef> Slight optimisation
07:32:45FromDiscord<JJ> blurgh hitting some rust usability issues
07:33:31FromDiscord<odexine> “Rust itself is a usability issue”
07:33:38FromDiscord<JJ> makes me appreciate nim's total abstraction around `ref` types where i don't need to care if it's an `Rc` or `Arc` or `Box` or etc
07:36:02FromDiscord<JJ> yeah i was reading graydon hoare's rust reflection post and some of the somewhat unwarranted complexity in rust stands out more
07:38:39FromDiscord<JJ> i already had a laundry list that i was gonna write down my thoughts somewhere about, but the really interesting one was that the current problem-not-acknowledged-as-a-problem of lifetimes ever needing to be explicit was tied to `&` being an inherent property of a type rather than a layer above
07:45:54FromDiscord<JJ> bluh also i don't understand the appeal of module systems in general, they seem so complex for so little gain when you can simply dump everything into the global namespace and force qualification on conflicts like Nim does
07:45:57FromDiscord<Elegantbeef> https://hatebin.com/udrfbrfqns this does give an allocation optimisation over the manually concatenated version, assuming you have more entries than just 2 sequences
07:46:09FromDiscord<Elegantbeef> But what Nim has is a module system 😄
07:46:17FromDiscord<odexine> In reply to @omentic "bluh also i don't": It’s a readability thing
07:46:28FromDiscord<odexine> In reply to @Elegantbeef "But what Nim has": Means qualification as default I assume
07:46:41FromDiscord<Elegantbeef> You can in theory read forced qualified code without any tooling
07:46:46FromDiscord<Elegantbeef> Nim technically requires tooling to follow
07:46:50FromDiscord<JJ> and what does separating filesystem structure from library structure do that `export` can't anyway
07:47:07FromDiscord<Elegantbeef> The counterpoint is that Rust and friends have `use` or similar
07:47:13FromDiscord<JJ> In reply to @odexine "Means qualification as default": well i think so i don't really understand module systems
07:47:22FromDiscord<odexine> In reply to @omentic "and what does separating": I don’t know I think they just think it’s cleaner, opinion thing I’d say
07:47:32FromDiscord<JJ> one of my friends is a big fan of standard ml and particularly the ml module system and i haven't yet understood it
07:47:50FromDiscord<odexine> In reply to @Elegantbeef "The counterpoint is that": Yes but I think it’s not recommended or rather it is frowned upon using it everywhere?
07:47:59FromDiscord<Elegantbeef> To me modules are best thought of as entire implementations that should be swappable
07:48:06FromDiscord<odexine> In reply to @omentic "one of my friends": I don’t know what they mean by that specifically
07:48:08FromDiscord<Elegantbeef> Yes
07:48:34FromDiscord<Elegantbeef> Well Nim's module system is a bit of a disappointment in some regards
07:48:53FromDiscord<Elegantbeef> Think about `strutils` or `unicode` if you want to use your own string type with them you just cannot
07:50:37FromDiscord<JJ> In reply to @odexine "I don’t know I": what does boggle my mind is the vast amount of complexity the rust module system seems to have: like you have a distinction between internal and external apis, which are controlled via the presence of a `mod.rs` and a `lib.rs` file accordingly, have different and exclusive semantics to access, etc...
07:50:54FromDiscord<Elegantbeef> Right rust's module system is awful
07:51:12FromDiscord<Elegantbeef> Like you have to have 30 bazillion crates for a single project
07:51:54FromDiscord<JJ> In reply to @Elegantbeef "Think about `strutils` or": yeah that's true though tbh i'm not sure how much i like what rust does instead, i don't quite like the presence of a std::result::Result<T, E> and a std::io::Result<T>
07:51:58FromDiscord<Elegantbeef> https://github.com/rust-lang/rust-analyzer/tree/master/crates like what the fuck is this 😄
07:52:37FromDiscord<Elegantbeef> It's like a distributed repo turned into a monorepo
07:53:13FromDiscord<JJ> In reply to @Elegantbeef "Think about `strutils` or": what i've wished nim would do instead is rely on concepts for the standard library
07:53:18FromDiscord<Elegantbeef> Is someone going to depend on `rust-analyzer/cfg`, isn't the entire crates folder here redundant
07:53:46FromDiscord<Elegantbeef> Well I'd prefer that you'd have concepts inferred from usage and then you could do `import std/strutils[string: MyString]`
07:53:50FromDiscord<JJ> ofc they didn't exist back then, and they're not even stable now
07:54:08FromDiscord<JJ> In reply to @Elegantbeef "Well I'd prefer that": hmm, wdym
07:54:24FromDiscord<Elegantbeef> Have modules be modular and allow programmers to replace types
07:54:38FromDiscord<Elegantbeef> The above would instantiate a `strutils` variation replacing `string` with `MyString`
07:55:11FromDiscord<Elegantbeef> Of course that wouldnt presently work thanks to `newString` and friends being used instead of `string.init`
07:55:23FromDiscord<JJ> how i have envisioned it is exactly like how rust stdlib functions use traits - only since it's concepts, instead of relying on explicit `impl` you just rely on the presence of appropriate functions for the concept and so there's no boilerplate (but you run the risk of accidentally using the wrong function)
07:55:52FromDiscord<Elegantbeef> Sure that's also nice, but the stdlib should work with native Nim types
07:56:35FromDiscord<JJ> In reply to @Elegantbeef "Of course that wouldnt": so then to define your own string type you just need to define all the string primitives for it? or
07:56:42FromDiscord<Elegantbeef> Correct
07:56:47FromDiscord<Elegantbeef> Wait not
07:57:08FromDiscord<Elegantbeef> to use `strutils` with your `MyString` you'd have to implement all operations that is required for `string` inside the library
07:57:29FromDiscord<Elegantbeef> This applies to anything though, imagine a graphics library that used a different vector to you
07:58:12FromDiscord<JJ> hmm well that just seems similar to having a string concept then
07:58:13FromDiscord<Elegantbeef> It practically means that even though a library is a concretely typed library it doesnt mean you cannot use it generically
07:58:40FromDiscord<Elegantbeef> It's not too dissimilar, the benefit is it's inferred and concretely typed
07:58:55FromDiscord<JJ> that's really interesting
07:59:45FromDiscord<Elegantbeef> You practically get generic instantiations for entire modules, which makes code reuse shoot into the ceiling
08:00:36FromDiscord<Elegantbeef> Imagine you have some library with a top level variable, you can make that top level variable your type even though it's not declared yet... this is idea is inspired by this and windy
08:01:26FromDiscord<Elegantbeef> Windy is written using vmath for all of it's vectors, which is fine of course I use vmath myself, but some people might have different vectors for whatever reason and want to use windy they now need a converter or to manually convert
08:01:28FromDiscord<JJ> my gut feeling is it would be hard to infer but ig if you're passing a function the type it needs then it isn't hard at all
08:01:55FromDiscord<Elegantbeef> Well if the type is used statically you pretty much know all the operations required, it's not too different to generic instantiation
08:02:11FromDiscord<Elegantbeef> You don't even really need to infer anything
08:02:28FromDiscord<Elegantbeef> Replace all the `string` types with your type and mixin the importing scope
08:02:58FromDiscord<JJ> i wonder what a language construct for that would look like
08:03:05FromDiscord<Elegantbeef> I showed you 😛
08:03:15FromDiscord<Elegantbeef> `import std/strutils[string: MyString]`
08:03:26FromDiscord<Elegantbeef> import strutils, replacing `string` for `MyString`
08:03:45FromDiscord<JJ> oh i see lol
08:04:00FromDiscord<JJ> reading comprehension / reading at all is yet again my weakness
08:04:53FromDiscord<Elegantbeef> This also would've made gooey so much easier to implement
08:05:53FromDiscord<Elegantbeef> I could've just made some dummy vector types then one could've done `import gooey[GooVec3: Vec3, GooVec2: Vec2]` and not have a `UiElement[SizeVec: Vec2, PosVec: Vec3]`
08:06:39FromDiscord<JJ> i think `string` would need to be a typeclass/concept then
08:06:46FromDiscord<JJ> if i'm thinking about it right
08:06:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yta
08:06:54FromDiscord<Elegantbeef> Nah
08:07:10FromDiscord<JJ> the compiler's gotta know what functions/primitives are defined for it
08:07:26FromDiscord<Elegantbeef> You quite literally replace `string` with `MyString` and recompile the module
08:07:44FromDiscord<JJ> oh i see
08:07:50FromDiscord<Elegantbeef> That's the lazy way
08:07:56FromDiscord<JJ> that's interesting
08:08:05FromDiscord<Elegantbeef> The smart way is to see all usages of `string` inside the module and document that
08:08:22FromDiscord<Elegantbeef> Then ensure that your instantiating module has those operations
08:08:48FromDiscord<Elegantbeef> Remember the `strutils` module is not a generic module, all operations are concrete
08:09:09FromDiscord<Elegantbeef> As such you know that to use a module with a different type you have to have all operations that `string` has
08:09:56FromDiscord<JJ> the lazy way and the smart way seems somewhat the same tbh
08:10:30FromDiscord<JJ> ig the smart way would provide checking without needing to recompile the module but you're gonna have to recompile it anyway
08:11:01FromDiscord<Elegantbeef> The smart way would allow you to do something like `modulename interface string` if you wanted to explicitly state "this module implements operations specifically around string"
08:11:08FromDiscord<Elegantbeef> It could then list all the operations required
08:11:29FromDiscord<Elegantbeef> Instead of just bubbling up generic instantiation errors
08:12:18FromDiscord<JJ> one other thing that stood out about the rust creator's post on what he wanted rust to be was that a module system was supposed to be an alternative to traits
08:12:34FromDiscord<JJ> i didn't understand that at all at first but now after seeing what you're thinking it makes more sense
08:13:42FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/G0XNN
08:14:01FromDiscord<JJ> god i gotta learn a module system
08:14:09FromDiscord<odexine> Fuck y’all now I want this so badly in Nim
08:14:19FromDiscord<Elegantbeef> lol
08:14:37FromDiscord<JJ> hey `interface` is reserved and unused
08:14:44FromDiscord<Elegantbeef> Indeed 😄
08:15:33FromDiscord<Elegantbeef> Rika templates might work now for this
08:15:33FromDiscord<Elegantbeef> I haven't tried to use templates for a module in quite some time
08:15:34FromDiscord<Elegantbeef> metagn has been working on templates
08:15:40FromDiscord<Elegantbeef> This is practically templates but with a concrete implementation
08:16:22FromDiscord<Andreas> In reply to @omentic "hey `interface` is reserved": the RFC-thread about 'new concepts' has a `implements`-macro - no idea if it works..
08:16:27FromDiscord<Elegantbeef> \Who wants to rewrite gooey to use templates instead!
08:19:17FromDiscord<Elegantbeef> To be clear though JJ I've never used anything but Nim/C# so I do not have a firm grasp on any module system 😄
08:20:41FromDiscord<odexine> In reply to @Elegantbeef "metagn has been working": OOT but I keep on imagining their name with the gn pronounced like in champagne
08:21:07FromDiscord<odexine> In reply to @Elegantbeef "\*Who wants to rewrite": Kinda sounds cursed?
08:21:49FromDiscord<Elegantbeef> I'm already doing `type X[T, Y] = ref object of T` how more cursed could it be
08:22:17FromDiscord<JJ> In reply to @Elegantbeef "I'm already doing `type": yeah that still makes me recoil a bit
08:22:39FromDiscord<Elegantbeef> Same, but I used SDL2 to draw my GUI and opengl so... fuck it
08:22:57FromDiscord<JJ> In reply to @odexine "Kinda sounds cursed?": see that's the sense i'm getting too, but like, what if this was idiomatic and there was good language support to make it not cursed
08:23:07FromDiscord<Elegantbeef> Renderer/vector agnostic graphics \> keeping your food down
08:23:20FromDiscord<odexine> In reply to @omentic "see that's the sense": Yeah of course I just mean that currently it is cursed
08:23:21FromDiscord<JJ> god i gotta sit down and learn ocaml properly, they've got modules and effects
08:23:40FromDiscord<JJ> oh yeah no kidding
08:23:56FromDiscord<odexine> In reply to @omentic "god i gotta sit": What does this mean
08:24:34FromDiscord<JJ> effects are a generalized form of handling both async/await and exceptions
08:24:53FromDiscord<JJ> i don't know how they work (both effects and modules have been on my to-understand list for a while)
08:25:42FromDiscord<Elegantbeef> Well modules is quite a overloaded term
08:25:51FromDiscord<odexine> Effects as well hahaha
08:26:09FromDiscord<JJ> yeah, nim's "effects" support is not an "effects system"
08:26:10FromDiscord<Elegantbeef> It can mean namespaces like C# or more properly developed systems
08:26:10FromDiscord<odexine> Are you describing monads?
08:26:44FromDiscord<Elegantbeef> I think it's spelled gonads
08:26:52FromDiscord<odexine> I’ll rip yours off
08:27:06FromDiscord<Elegantbeef> Understandable
08:28:10FromDiscord<JJ> i am not quite sure how monads intersect with effects but i think they're orthogonal
08:28:47FromDiscord<odexine> Well it’s hard for me to tell what you mean by effects lmao
08:29:13FromDiscord<JJ> it's hard for me to describe because i don't know what they are rofl
08:29:14FromDiscord<odexine> Monads are a way to model side effects like IO
08:31:08FromDiscord<odexine> One common monad is the optional type
08:31:28FromDiscord<JJ> the core of effect systems, i believe, is that you can have effect handlers that generalize exceptions and allow taking any action ex. resuming or panicking in context
08:31:37FromDiscord<JJ> i do not quite know how they generalize async as well
08:32:45FromDiscord<odexine> Effects just sound like an inbuilt event loop system
08:32:55FromDiscord<JJ> unfortunately i believe there are three languages that fully implement effect systems, not counting ocaml (it only has primitives so far) and the only authoritative sources on them seem to be papers which i haven't read
08:34:16FromDiscord<odexine> In reply to @omentic "unfortunately i believe there": Which
08:34:28FromDiscord<odexine> I assume the OTP languages are part?
08:35:05FromDiscord<Elegantbeef> Effect systems are very academic afaik
08:35:31FromDiscord<odexine> I’m reading up on it and yes they seem very academic right now
08:35:51FromDiscord<JJ> https://koka-lang.github.io/, https://unison-lang.org/, https://effekt-lang.org/
08:36:05FromDiscord<JJ> very academic and also notably very new
08:37:31FromDiscord<odexine> Ah unison
08:37:47FromDiscord<odexine> Keep on encountering that language whenever I do anything in an OTP language
08:38:01FromDiscord<JJ> unison does other fucky things
08:38:23FromDiscord<odexine> I am aware
08:38:24FromDiscord<JJ> i don't know how erlang relates to effects systems
08:38:34FromDiscord<JJ> can you resume from exceptions?
08:39:05FromDiscord<odexine> I think that part is irrelevant and it’s more of how it seems like this is just a different way to model message passing?
08:39:13FromDiscord<JJ> well, okay, i don't understand effects systems at all why am i asking comparisons to them lol
08:40:47FromDiscord<odexine> In that here you do not need to do any registering of which process does which to the underlying function/process but rather you just send messages and it’ll reach the intended process by some inbuilt system
08:41:16FromDiscord<odexine> Oh this kinda reminds me of telemetry
08:41:34FromDiscord<odexine> Where you just keep on sending entries and whichever registered handlers will handle them
08:44:53FromDiscord<odexine> Oh oh except these registered handlers are scope limited
08:45:12FromDiscord<odexine> Hmm~ cool system
08:52:55FromDiscord<JJ> it's kind of interesting, since both async and exceptions have their issues
08:53:51FromDiscord<JJ> async with coloured functions or whatever, exceptions with the checking of exceptions being super verbose
08:54:35FromDiscord<JJ> though i suppose the former is solved in some languages and the latter is mostly a syntax thing than a theory thing idk
08:59:25NimEventerNew thread by ingo: Malebolgia & Pixy problem: expression has no address, see https://forum.nim-lang.org/t/10278
08:59:49FromDiscord<Bloss> 2.0 release 🙏
09:02:22FromDiscord<Elegantbeef> just use devel and cut yourself on the bleeding edge
09:03:14FromDiscord<odexine> I hope you don’t ask that every 90 minutes
09:06:33FromDiscord<Bloss> I mean they promise 2022, then early 2023...
09:06:40FromDiscord<Bloss> Just wondering is all
09:09:01FromDiscord<Bloss> No mean to be rude 😄
09:09:27FromDiscord<Bloss> (edit) "No" => "I no"
09:10:12FromDiscord<Andreas> Patience is the highest virtue. (by unknown)
09:11:50FromDiscord<Bloss> Yes patience!
09:40:11FromDiscord<jmgomez> There are no stoppers left
10:30:10*syl_ is now known as syl
10:33:57NimEventerNew question by IvanS: Nim osproc.startProcess input/output out of sync, see https://stackoverflow.com/questions/76495787/nim-osproc-startprocess-input-output-out-of-sync
10:45:44FromDiscord<toma400> Just joined, so wanted to say hello to the community of my new favourite language 👋 ^^
10:47:06FromDiscord<odexine> Honestly hold off on calling it your favourite until you’ve used it a good bit xd
10:48:55FromDiscord<toma400> Haha, I was joking a bit, but I'm fairly certain it will stand at least in top place (just like Ruby and Java are my small loves, despite that it's annoying in many places to use them)
11:49:20*GreaseMonkey quit (Remote host closed the connection)
11:50:27*greaser|q joined #nim
11:52:34*euantorano_ quit (Server closed connection)
11:52:47*euantorano_ joined #nim
12:37:58NimEventerNew thread by jasonfi: Nimble not installing Jester v0.6.0, see https://forum.nim-lang.org/t/10279
12:56:27FromDiscord<takko_the_boss> Oh, wait until you hear about Giz. (G pronounced as a J)↵(@toma400)
13:02:12FromDiscord<krab4t> how to compile to cpp just to see what generated?
13:02:16FromDiscord<krab4t> with nimble?
13:02:57*azimut joined #nim
13:04:26FromDiscord<takko_the_boss> Jack be Nimble, Jack be quick.
13:26:41*rockcavera joined #nim
13:37:35FromDiscord<auxym> In reply to @krab4t "how to compile to": you'll have to pull the cpp files from nim's cache dir
13:38:38FromDiscord<krab4t> found them in .cache/nim
13:38:56FromDiscord<auxym> you can specify it, something like `nim cpp -c --nimcache:nimcache somefile.nim` will create the cpp files in `./nimcache`. `-c` only does the compile to cpp part, skips invoking gcc to produce a binary
14:02:13*azimut quit (Remote host closed the connection)
14:02:39*azimut joined #nim
14:14:59FromDiscord<_gumbercules> In reply to @suck666 "Just wondering is all": You should have been around for the 1.0 release
14:15:10FromDiscord<_gumbercules> If you think 2.0 is taking a whle
14:31:27*azimut quit (Remote host closed the connection)
14:31:46*azimut joined #nim
15:50:39*lain quit (Server closed connection)
15:51:21*lain joined #nim
16:06:48FromDiscord<basilajith> Can anyone kindly tell me where I can get a discounted version of Nim in Action? The paperback is quite expensive.
16:06:56FromDiscord<basilajith> (edit) "expensive." => "expensive in India."
16:11:18FromDiscord<_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1119660549760888952/foo.pdf
16:11:24FromDiscord<_gumbercules> took me about five seconds to google and find that
16:11:28FromDiscord<Chronos [She/Her]> Do the `wrapSocket` procs modify the socket that I'm wrapping?
16:11:40FromDiscord<Chronos [She/Her]> In reply to @_gumbercules "took me about five": Think they want it in paperback specifically
16:16:27FromDiscord<basilajith> Yes, I preferred the paperback. The ebook is available at a discounted rate in Manning.
16:48:37FromDiscord<spotlightkid> There are used copies on the amazon marketplace
16:57:38*Guest63 joined #nim
16:58:33*Guest63 quit (Client Quit)
16:58:53FromDiscord<voidwalker> @basilajith I haven't read it all, but it's not that great. I consider this the best nim book atm: https://ssalewski.de/nimprogramming.html#_the_block_statement
16:59:04FromDiscord<voidwalker> but it is better than "Mastering Nim"
17:02:47FromDiscord<spotlightkid> > I haven't read it all, but it's not that great.↵> Does not compile.
17:03:08FromDiscord<spotlightkid> > I haven't read it all, but it's not that great.Does not compile.
17:03:10FromDiscord<Andreas> In reply to @voidwalker "but it is better": both are good reads, "Mastering Nim" is newer.
17:03:21FromDiscord<spotlightkid> > I haven't read it all, but it's not that great.↵> Does not compile.
17:07:26FromDiscord<krab4t> how you call proc periodically like every 5 minutes? Qt has QTimer
17:15:01FromDiscord<toma400> In reply to @spotlightkid "> I haven't read": I love sweet irony of this, no wonder it's not that great, if you didn't compile the book as a whole 😅
17:15:42FromDiscord<toma400> But I agree that ssalewski.de book is pretty amazing. I wish it had PDF form, so I can just read it offline
17:18:44systemdsucksi did print it to pdf for that reason
17:21:19FromDiscord<odexine> the book cant be updated all the time, there is an errata page that fixes issues but the book is "pinned" to ver. 1.0 IIRC
17:25:36FromDiscord<Chronos [She/Her]> In reply to @krab4t "how you call proc": Could use async or something or a thread
17:33:17FromDiscord<demotomohiro> In reply to @krab4t "how you call proc": https://nim-lang.org/docs/os.html#sleep%2Cint
17:34:10FromDiscord<deech4592> sent a code paste, see https://play.nim-lang.org/#ix=4yuS
17:39:35FromDiscord<krab4t> sleep?!?!!?
17:41:39FromDiscord<demotomohiro> Call proc, sleep 5min then repeat it.
17:59:22NimEventerNew thread by basilajith: Discounted rates for "Nim in Action" and "Mastering Nim"?, see https://forum.nim-lang.org/t/10280
18:05:08*rockcavera quit (Remote host closed the connection)
18:24:35FromDiscord<xrfez> Does anyone know if the Windows `copyFileEx()` has been wrapped? I am struggling with the callback parameter.
18:48:59FromDiscord<_gumbercules> https://learn.microsoft.com/en-us/windows/win32/api/winbase/nc-winbase-lpprogress_routine
18:49:17FromDiscord<_gumbercules> In reply to @xrfez "Does anyone know if": This? ^
18:51:01FromDiscord<xrfez> yes. and how to use it properly with `copyFileExW()'
18:51:24FromDiscord<xrfez> (edit) "`copyFileExW()'" => "`copyFileExW()`"
18:52:36*disso-peach joined #nim
18:53:50FromDiscord<_gumbercules> https://github.com/khchen/winim
18:53:58FromDiscord<_gumbercules> I'm on my phone but have you looked at ^ yet?
18:54:23FromDiscord<_gumbercules> If not and you're still having issues later when I get back on my PC I can help more
18:54:50FromDiscord<Sebwazhere> is there a way to increase i with code in a for loop?
18:55:21FromDiscord<xrfez> okay. I did look there but I will look again to see if it is implementing windows callbacks that I can learn from
18:55:59FromDiscord<odexine> In reply to @Sebwazhere "is there a way": ?
18:56:08FromDiscord<xrfez> sent a code paste, see https://play.nim-lang.org/#ix=4yvb
18:56:22FromDiscord<voidwalker> can you modify the iterator variable inside the loop ? I thought you couldn't
18:58:56FromDiscord<odexine> you cant if it isnt marked as var
19:04:31*systemdsucks quit (Remote host closed the connection)
19:13:01FromDiscord<_gumbercules> Use a while loop instead
19:18:54*ttkap quit (Server closed connection)
19:20:15FromDiscord<xrfez> In reply to @_gumbercules "https://github.com/khchen/winim": Yes I found it wrapped in winbase.nim Pretty much how I wrapped it. Ill keep playing with it. I'm not passing it in correctly or something.
19:20:37*xet7 joined #nim
19:23:41*ttkap joined #nim
19:23:49FromDiscord<_gumbercules> In reply to @xrfez "Yes I found it": Do you have any code and errors you can share? That'd go a long way in helping me troubleshoot the issue
19:24:15FromDiscord<xrfez> let me plug away a bit more.
19:25:03FromDiscord<xrfez> In reply to @_gumbercules "Do you have any": the error is an illegal access after the copy is complete. When I try to access the data from the callback
19:26:06FromDiscord<_gumbercules> Hmmm are you targeting the c or cop backend and are you using mingw or clang or msvc?
19:26:21FromDiscord<_gumbercules> Cpp even
19:29:45FromDiscord<xrfez> In reply to @_gumbercules "Hmmm are you targeting": c backend. GCC `{.stdcall.}` calling convention
19:30:40FromDiscord<_gumbercules> That might be the problem I'm not sure
19:31:20FromDiscord<_gumbercules> Have you tried using msvc via --cc:vcc
19:31:54FromDiscord<_gumbercules> (edit) "--cc:vcc" => "--cc:vcc?"
19:32:36FromDiscord<xrfez> In reply to @_gumbercules "That might be the": The real question is the callback takes parameters that are updated by copyFileEx(). what is the correct way to pass those variables in/read those variables back
19:33:16FromDiscord<xrfez> In reply to @_gumbercules "Have you tried using": I do not have vcc available at the moment
19:33:56FromDiscord<_gumbercules> You should just be able to pass in a proc with whatever calling convention the callback type expects
19:34:25FromDiscord<_gumbercules> As long as the price signature matches the callback type it should just work
19:34:33FromDiscord<_gumbercules> Procedure even
19:34:49FromDiscord<_gumbercules> Generally it's going to be cdecl
19:34:58FromDiscord<_gumbercules> For GCC or mingw
19:35:01FromDiscord<graveflo> what specifically are you trying to access when the copy is complete?
19:35:57FromDiscord<xrfez> In reply to @_gumbercules "You should just be": So create variables and pass them to the callback which is passed to copyFileEx().
19:36:31FromDiscord<_gumbercules> Mmmm give me a second let me put an example together
19:36:54FromDiscord<xrfez> In reply to @graveflo "what specifically are you": for now I am just echo all of them. eventually just track copy progress
19:37:14FromDiscord<graveflo> In reply to @xrfez "So create variables and": I don't think nim has partial procs and if it did I doubt you could pass them as a callback in this scenario. You should not be calling your callback at all
19:38:10FromDiscord<graveflo> try only a subset of the parameters. Avoid `lpData`
19:38:42FromDiscord<xrfez> In reply to @graveflo "I don't think nim": Interesting. Okay
19:42:12FromDiscord<graveflo> you can paste the line you are using to call `CopyFileExW` if you want
19:43:24FromDiscord<wrld> var assembly = load(buf.toOpenArray)↵Does anything similar to this exist?
19:48:06FromDiscord<_gumbercules> sent a code paste, see https://paste.rs/2XVIy
19:49:45FromDiscord<_gumbercules> this doesn't work - it compiles but just returns 0 from `CopyFileExW` - will attempt to get it working correctly
19:50:35FromDiscord<_gumbercules> okay this worked
19:51:39FromDiscord<odexine> In reply to @wrld "var assembly = load(buf.toOpenArray)": prolly not? strange to need it though
19:52:07FromDiscord<_gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4yvj
19:52:26FromDiscord<_gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4yvk
19:52:46FromDiscord<_gumbercules> @xrfez ^
19:54:44FromDiscord<xrfez> sent a code paste, see https://play.nim-lang.org/#ix=4yvl
19:55:37FromDiscord<xrfez> sent a code paste, see https://play.nim-lang.org/#ix=4yvm
20:16:32FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4yvu
20:16:51FromDiscord<_gumbercules> In reply to @demotomohiro "Is sizeof(BOOL) and sizeof(bool)": ah yeah I fixed that in the second example
20:17:23FromDiscord<_gumbercules> And re sizeof: I'm not sure - probaby but I didn't check - the callback wants a pointer to a bool so it can mutate it to store some value indicating whether the copy was cancelled or not I guess
20:36:54*_________ quit (Server closed connection)
20:37:17*_________ joined #nim
20:53:12*ntat quit (Quit: Leaving)
21:07:56*derpydoo quit (Quit: derpydoo)
21:13:55*disso_pch joined #nim
21:15:50*disso-peach quit (Ping timeout: 252 seconds)
21:21:26*disso_pch quit (Quit: Leaving)
22:19:33*derpydoo joined #nim
22:24:15*derpydoo quit (Ping timeout: 258 seconds)