00:05:46 | FromDiscord | <lucidrains> Nim should be more mature than Zig? |
00:12:22 | FromDiscord | <Elegantbeef> Who knows it's older, but also more complex |
00:14:09 | * | lucasta joined #nim |
00:21:44 | FromDiscord | <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:43 | FromDiscord | <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:26 | FromDiscord | <Elegantbeef> `nimble --nim:...` |
00:24:18 | FromDiscord | <jmgomez> beautiful, thank you! I was in the opposite direction adding traces to nimble |
00:29:05 | FromDiscord | <Elegantbeef> takko\_the\_boss sadly I want to indulge your shitty joke, the package manage is epaculate? |
00:31:54 | FromDiscord | <takko_the_boss> Mac OS has its own version called emaculate. |
00:32:38 | FromDiscord | <jmgomez> what, I didnt know this was a thing `T: typedesc[HoleyEnum]` |
00:32:51 | FromDiscord | <Elegantbeef> Which part? |
00:32:58 | FromDiscord | <jmgomez> `typedesc[T]` |
00:33:18 | FromDiscord | <Elegantbeef> Really you've never seen `proc init(_: type T)`? |
00:35:28 | FromDiscord | <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:49 | FromDiscord | <Elegantbeef> `typedesc` is a generic parameter that accepts types |
00:36:05 | FromDiscord | <Elegantbeef> `typedesc[T]` constrains it to only types of `T` |
00:36:19 | FromDiscord | <Elegantbeef> so like `typedesc[int or string]` |
00:37:59 | FromDiscord | <jmgomez> I see, but is not effectively the same as a `T : int | string`? |
00:38:06 | FromDiscord | <Elegantbeef> No |
00:38:10 | FromDiscord | <Elegantbeef> `typedesc` accepts types |
00:38:27 | FromDiscord | <jmgomez> ahh like you pass directly the type as argument |
00:38:37 | FromDiscord | <jmgomez> somewhat a meta type |
00:38:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yrT |
00:38:47 | FromDiscord | <Elegantbeef> Is a common pattern |
00:39:28 | FromDiscord | <jmgomez> hmm |
00:39:47 | FromDiscord | <jmgomez> good to know, I have more clear now why it fails 😅 |
00:40:26 | FromDiscord | <jmgomez> thanks for the explanation! |
00:47:02 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4yrV |
00:47:12 | FromDiscord | <Elegantbeef> More so that it works with generics |
00:47:28 | FromDiscord | <Elegantbeef> `initType(x, y)` does not work inside a generic |
00:47:53 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4yrW |
00:48:32 | FromDiscord | <arathanis> (edit) "https://play.nim-lang.org/#ix=4yrW" => "https://play.nim-lang.org/#ix=4yrX" |
01:25:49 | FromDiscord | <JJ> typedesc init good 👍 |
01:26:53 | FromDiscord | <Elegantbeef> named init bad 👎️ |
01:44:52 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "named init bad 👎️": why? |
02:31:36 | * | derpydoo joined #nim |
02:45:09 | FromDiscord | <JJ> it's ugly tawa mi |
02:45:14 | FromDiscord | <JJ> also yeah, generics |
02:48:27 | FromDiscord | <Elegantbeef> I assumed I missed a message and JJ isnt just crazy |
02:58:32 | * | azimut_ quit (Ping timeout: 240 seconds) |
03:36:35 | FromDiscord | <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:06 | FromDiscord | <Elegantbeef> Well Nim's object constructor isnt much better in the generic department 😄 |
03:37:14 | FromDiscord | <Elegantbeef> It's a tinge better, but not much |
03:37:57 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> if your proc is named `initMyType` you cannot use it with a generic |
03:38:39 | FromDiscord | <Elegantbeef> If your obj constructor is `T(x: x, y: y)` but you have a `Vec2 = array[2, float32]` it doesnt work |
03:39:58 | FromDiscord | <graveflo> I am confused. Is the `Vec2` the subject of the proc or a member of `T` or something else |
03:40:39 | FromDiscord | <Elegantbeef> https://github.com/beef331/gooey/blob/master/src/gooey.nim#L99 |
03:40:51 | FromDiscord | <graveflo> oh nvm I get it. Its not a common name |
03:40:52 | FromDiscord | <Elegantbeef> I want my gui stuff to work with any vector type |
03:40:59 | FromDiscord | <graveflo> so generics cant target it broadly |
04:43:12 | madprops | is atlas like package.json with npm? |
04:44:10 | * | lucasta quit (Quit: Leaving) |
04:44:29 | madprops | or 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:44 | FromDiscord | <krab4t> nim needs a library like this https://xsdata.readthedocs.io/en/latest/index.html |
05:37:03 | FromDiscord | <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:12 | FromDiscord | <huantian> Yeah cus I won’t touch xml unless I need to 🙃 |
05:49:35 | * | derpydoo joined #nim |
06:00:42 | FromDiscord | <_gumbercules> In reply to @krab4t "nim needs a library": Just find a C library, wrap it, done |
06:01:35 | FromDiscord | <huantian> Hm not sure that would work for this |
06:01:53 | FromDiscord | <huantian> Since the point of the library is that it generates types given a schema right |
06:02:30 | FromDiscord | <_gumbercules> Ah, okay yeah then nevermind |
06:13:43 | FromDiscord | <krab4t> any xml, xml schema or json |
06:30:36 | * | disso-peach quit (Quit: Leaving) |
07:02:36 | FromDiscord | <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:24 | FromDiscord | <Elegantbeef> no |
07:30:21 | FromDiscord | <odexine> In reply to @heysokam "is there an existing": What would the difference be between the two aside from syntax |
07:30:46 | FromDiscord | <Bloss> 2.0 when? 😱 |
07:30:50 | FromDiscord | <Elegantbeef> Slight optimisation |
07:32:45 | FromDiscord | <JJ> blurgh hitting some rust usability issues |
07:33:31 | FromDiscord | <odexine> “Rust itself is a usability issue” |
07:33:38 | FromDiscord | <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:02 | FromDiscord | <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:39 | FromDiscord | <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:54 | FromDiscord | <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:57 | FromDiscord | <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:09 | FromDiscord | <Elegantbeef> But what Nim has is a module system 😄 |
07:46:17 | FromDiscord | <odexine> In reply to @omentic "bluh also i don't": It’s a readability thing |
07:46:28 | FromDiscord | <odexine> In reply to @Elegantbeef "But what Nim has": Means qualification as default I assume |
07:46:41 | FromDiscord | <Elegantbeef> You can in theory read forced qualified code without any tooling |
07:46:46 | FromDiscord | <Elegantbeef> Nim technically requires tooling to follow |
07:46:50 | FromDiscord | <JJ> and what does separating filesystem structure from library structure do that `export` can't anyway |
07:47:07 | FromDiscord | <Elegantbeef> The counterpoint is that Rust and friends have `use` or similar |
07:47:13 | FromDiscord | <JJ> In reply to @odexine "Means qualification as default": well i think so i don't really understand module systems |
07:47:22 | FromDiscord | <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:32 | FromDiscord | <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:50 | FromDiscord | <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:59 | FromDiscord | <Elegantbeef> To me modules are best thought of as entire implementations that should be swappable |
07:48:06 | FromDiscord | <odexine> In reply to @omentic "one of my friends": I don’t know what they mean by that specifically |
07:48:08 | FromDiscord | <Elegantbeef> Yes |
07:48:34 | FromDiscord | <Elegantbeef> Well Nim's module system is a bit of a disappointment in some regards |
07:48:53 | FromDiscord | <Elegantbeef> Think about `strutils` or `unicode` if you want to use your own string type with them you just cannot |
07:50:37 | FromDiscord | <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:54 | FromDiscord | <Elegantbeef> Right rust's module system is awful |
07:51:12 | FromDiscord | <Elegantbeef> Like you have to have 30 bazillion crates for a single project |
07:51:54 | FromDiscord | <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:58 | FromDiscord | <Elegantbeef> https://github.com/rust-lang/rust-analyzer/tree/master/crates like what the fuck is this 😄 |
07:52:37 | FromDiscord | <Elegantbeef> It's like a distributed repo turned into a monorepo |
07:53:13 | FromDiscord | <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:18 | FromDiscord | <Elegantbeef> Is someone going to depend on `rust-analyzer/cfg`, isn't the entire crates folder here redundant |
07:53:46 | FromDiscord | <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:50 | FromDiscord | <JJ> ofc they didn't exist back then, and they're not even stable now |
07:54:08 | FromDiscord | <JJ> In reply to @Elegantbeef "Well I'd prefer that": hmm, wdym |
07:54:24 | FromDiscord | <Elegantbeef> Have modules be modular and allow programmers to replace types |
07:54:38 | FromDiscord | <Elegantbeef> The above would instantiate a `strutils` variation replacing `string` with `MyString` |
07:55:11 | FromDiscord | <Elegantbeef> Of course that wouldnt presently work thanks to `newString` and friends being used instead of `string.init` |
07:55:23 | FromDiscord | <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:52 | FromDiscord | <Elegantbeef> Sure that's also nice, but the stdlib should work with native Nim types |
07:56:35 | FromDiscord | <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:42 | FromDiscord | <Elegantbeef> Correct |
07:56:47 | FromDiscord | <Elegantbeef> Wait not |
07:57:08 | FromDiscord | <Elegantbeef> to use `strutils` with your `MyString` you'd have to implement all operations that is required for `string` inside the library |
07:57:29 | FromDiscord | <Elegantbeef> This applies to anything though, imagine a graphics library that used a different vector to you |
07:58:12 | FromDiscord | <JJ> hmm well that just seems similar to having a string concept then |
07:58:13 | FromDiscord | <Elegantbeef> It practically means that even though a library is a concretely typed library it doesnt mean you cannot use it generically |
07:58:40 | FromDiscord | <Elegantbeef> It's not too dissimilar, the benefit is it's inferred and concretely typed |
07:58:55 | FromDiscord | <JJ> that's really interesting |
07:59:45 | FromDiscord | <Elegantbeef> You practically get generic instantiations for entire modules, which makes code reuse shoot into the ceiling |
08:00:36 | FromDiscord | <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:26 | FromDiscord | <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:28 | FromDiscord | <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:55 | FromDiscord | <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:11 | FromDiscord | <Elegantbeef> You don't even really need to infer anything |
08:02:28 | FromDiscord | <Elegantbeef> Replace all the `string` types with your type and mixin the importing scope |
08:02:58 | FromDiscord | <JJ> i wonder what a language construct for that would look like |
08:03:05 | FromDiscord | <Elegantbeef> I showed you 😛 |
08:03:15 | FromDiscord | <Elegantbeef> `import std/strutils[string: MyString]` |
08:03:26 | FromDiscord | <Elegantbeef> import strutils, replacing `string` for `MyString` |
08:03:45 | FromDiscord | <JJ> oh i see lol |
08:04:00 | FromDiscord | <JJ> reading comprehension / reading at all is yet again my weakness |
08:04:53 | FromDiscord | <Elegantbeef> This also would've made gooey so much easier to implement |
08:05:53 | FromDiscord | <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:39 | FromDiscord | <JJ> i think `string` would need to be a typeclass/concept then |
08:06:46 | FromDiscord | <JJ> if i'm thinking about it right |
08:06:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yta |
08:06:54 | FromDiscord | <Elegantbeef> Nah |
08:07:10 | FromDiscord | <JJ> the compiler's gotta know what functions/primitives are defined for it |
08:07:26 | FromDiscord | <Elegantbeef> You quite literally replace `string` with `MyString` and recompile the module |
08:07:44 | FromDiscord | <JJ> oh i see |
08:07:50 | FromDiscord | <Elegantbeef> That's the lazy way |
08:07:56 | FromDiscord | <JJ> that's interesting |
08:08:05 | FromDiscord | <Elegantbeef> The smart way is to see all usages of `string` inside the module and document that |
08:08:22 | FromDiscord | <Elegantbeef> Then ensure that your instantiating module has those operations |
08:08:48 | FromDiscord | <Elegantbeef> Remember the `strutils` module is not a generic module, all operations are concrete |
08:09:09 | FromDiscord | <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:56 | FromDiscord | <JJ> the lazy way and the smart way seems somewhat the same tbh |
08:10:30 | FromDiscord | <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:01 | FromDiscord | <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:08 | FromDiscord | <Elegantbeef> It could then list all the operations required |
08:11:29 | FromDiscord | <Elegantbeef> Instead of just bubbling up generic instantiation errors |
08:12:18 | FromDiscord | <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:34 | FromDiscord | <JJ> i didn't understand that at all at first but now after seeing what you're thinking it makes more sense |
08:13:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/G0XNN |
08:14:01 | FromDiscord | <JJ> god i gotta learn a module system |
08:14:09 | FromDiscord | <odexine> Fuck y’all now I want this so badly in Nim |
08:14:19 | FromDiscord | <Elegantbeef> lol |
08:14:37 | FromDiscord | <JJ> hey `interface` is reserved and unused |
08:14:44 | FromDiscord | <Elegantbeef> Indeed 😄 |
08:15:33 | FromDiscord | <Elegantbeef> Rika templates might work now for this |
08:15:33 | FromDiscord | <Elegantbeef> I haven't tried to use templates for a module in quite some time |
08:15:34 | FromDiscord | <Elegantbeef> metagn has been working on templates |
08:15:40 | FromDiscord | <Elegantbeef> This is practically templates but with a concrete implementation |
08:16:22 | FromDiscord | <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:27 | FromDiscord | <Elegantbeef> \Who wants to rewrite gooey to use templates instead! |
08:19:17 | FromDiscord | <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:41 | FromDiscord | <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:07 | FromDiscord | <odexine> In reply to @Elegantbeef "\*Who wants to rewrite": Kinda sounds cursed? |
08:21:49 | FromDiscord | <Elegantbeef> I'm already doing `type X[T, Y] = ref object of T` how more cursed could it be |
08:22:17 | FromDiscord | <JJ> In reply to @Elegantbeef "I'm already doing `type": yeah that still makes me recoil a bit |
08:22:39 | FromDiscord | <Elegantbeef> Same, but I used SDL2 to draw my GUI and opengl so... fuck it |
08:22:57 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> Renderer/vector agnostic graphics \> keeping your food down |
08:23:20 | FromDiscord | <odexine> In reply to @omentic "see that's the sense": Yeah of course I just mean that currently it is cursed |
08:23:21 | FromDiscord | <JJ> god i gotta sit down and learn ocaml properly, they've got modules and effects |
08:23:40 | FromDiscord | <JJ> oh yeah no kidding |
08:23:56 | FromDiscord | <odexine> In reply to @omentic "god i gotta sit": What does this mean |
08:24:34 | FromDiscord | <JJ> effects are a generalized form of handling both async/await and exceptions |
08:24:53 | FromDiscord | <JJ> i don't know how they work (both effects and modules have been on my to-understand list for a while) |
08:25:42 | FromDiscord | <Elegantbeef> Well modules is quite a overloaded term |
08:25:51 | FromDiscord | <odexine> Effects as well hahaha |
08:26:09 | FromDiscord | <JJ> yeah, nim's "effects" support is not an "effects system" |
08:26:10 | FromDiscord | <Elegantbeef> It can mean namespaces like C# or more properly developed systems |
08:26:10 | FromDiscord | <odexine> Are you describing monads? |
08:26:44 | FromDiscord | <Elegantbeef> I think it's spelled gonads |
08:26:52 | FromDiscord | <odexine> I’ll rip yours off |
08:27:06 | FromDiscord | <Elegantbeef> Understandable |
08:28:10 | FromDiscord | <JJ> i am not quite sure how monads intersect with effects but i think they're orthogonal |
08:28:47 | FromDiscord | <odexine> Well it’s hard for me to tell what you mean by effects lmao |
08:29:13 | FromDiscord | <JJ> it's hard for me to describe because i don't know what they are rofl |
08:29:14 | FromDiscord | <odexine> Monads are a way to model side effects like IO |
08:31:08 | FromDiscord | <odexine> One common monad is the optional type |
08:31:28 | FromDiscord | <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:37 | FromDiscord | <JJ> i do not quite know how they generalize async as well |
08:32:45 | FromDiscord | <odexine> Effects just sound like an inbuilt event loop system |
08:32:55 | FromDiscord | <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:16 | FromDiscord | <odexine> In reply to @omentic "unfortunately i believe there": Which |
08:34:28 | FromDiscord | <odexine> I assume the OTP languages are part? |
08:35:05 | FromDiscord | <Elegantbeef> Effect systems are very academic afaik |
08:35:31 | FromDiscord | <odexine> I’m reading up on it and yes they seem very academic right now |
08:35:51 | FromDiscord | <JJ> https://koka-lang.github.io/, https://unison-lang.org/, https://effekt-lang.org/ |
08:36:05 | FromDiscord | <JJ> very academic and also notably very new |
08:37:31 | FromDiscord | <odexine> Ah unison |
08:37:47 | FromDiscord | <odexine> Keep on encountering that language whenever I do anything in an OTP language |
08:38:01 | FromDiscord | <JJ> unison does other fucky things |
08:38:23 | FromDiscord | <odexine> I am aware |
08:38:24 | FromDiscord | <JJ> i don't know how erlang relates to effects systems |
08:38:34 | FromDiscord | <JJ> can you resume from exceptions? |
08:39:05 | FromDiscord | <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:13 | FromDiscord | <JJ> well, okay, i don't understand effects systems at all why am i asking comparisons to them lol |
08:40:47 | FromDiscord | <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:16 | FromDiscord | <odexine> Oh this kinda reminds me of telemetry |
08:41:34 | FromDiscord | <odexine> Where you just keep on sending entries and whichever registered handlers will handle them |
08:44:53 | FromDiscord | <odexine> Oh oh except these registered handlers are scope limited |
08:45:12 | FromDiscord | <odexine> Hmm~ cool system |
08:52:55 | FromDiscord | <JJ> it's kind of interesting, since both async and exceptions have their issues |
08:53:51 | FromDiscord | <JJ> async with coloured functions or whatever, exceptions with the checking of exceptions being super verbose |
08:54:35 | FromDiscord | <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:25 | NimEventer | New thread by ingo: Malebolgia & Pixy problem: expression has no address, see https://forum.nim-lang.org/t/10278 |
08:59:49 | FromDiscord | <Bloss> 2.0 release 🙏 |
09:02:22 | FromDiscord | <Elegantbeef> just use devel and cut yourself on the bleeding edge |
09:03:14 | FromDiscord | <odexine> I hope you don’t ask that every 90 minutes |
09:06:33 | FromDiscord | <Bloss> I mean they promise 2022, then early 2023... |
09:06:40 | FromDiscord | <Bloss> Just wondering is all |
09:09:01 | FromDiscord | <Bloss> No mean to be rude 😄 |
09:09:27 | FromDiscord | <Bloss> (edit) "No" => "I no" |
09:10:12 | FromDiscord | <Andreas> Patience is the highest virtue. (by unknown) |
09:11:50 | FromDiscord | <Bloss> Yes patience! |
09:40:11 | FromDiscord | <jmgomez> There are no stoppers left |
10:30:10 | * | syl_ is now known as syl |
10:33:57 | NimEventer | New 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:44 | FromDiscord | <toma400> Just joined, so wanted to say hello to the community of my new favourite language 👋 ^^ |
10:47:06 | FromDiscord | <odexine> Honestly hold off on calling it your favourite until you’ve used it a good bit xd |
10:48:55 | FromDiscord | <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:58 | NimEventer | New thread by jasonfi: Nimble not installing Jester v0.6.0, see https://forum.nim-lang.org/t/10279 |
12:56:27 | FromDiscord | <takko_the_boss> Oh, wait until you hear about Giz. (G pronounced as a J)↵(@toma400) |
13:02:12 | FromDiscord | <krab4t> how to compile to cpp just to see what generated? |
13:02:16 | FromDiscord | <krab4t> with nimble? |
13:02:57 | * | azimut joined #nim |
13:04:26 | FromDiscord | <takko_the_boss> Jack be Nimble, Jack be quick. |
13:26:41 | * | rockcavera joined #nim |
13:37:35 | FromDiscord | <auxym> In reply to @krab4t "how to compile to": you'll have to pull the cpp files from nim's cache dir |
13:38:38 | FromDiscord | <krab4t> found them in .cache/nim |
13:38:56 | FromDiscord | <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:59 | FromDiscord | <_gumbercules> In reply to @suck666 "Just wondering is all": You should have been around for the 1.0 release |
14:15:10 | FromDiscord | <_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:48 | FromDiscord | <basilajith> Can anyone kindly tell me where I can get a discounted version of Nim in Action? The paperback is quite expensive. |
16:06:56 | FromDiscord | <basilajith> (edit) "expensive." => "expensive in India." |
16:11:18 | FromDiscord | <_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1119660549760888952/foo.pdf |
16:11:24 | FromDiscord | <_gumbercules> took me about five seconds to google and find that |
16:11:28 | FromDiscord | <Chronos [She/Her]> Do the `wrapSocket` procs modify the socket that I'm wrapping? |
16:11:40 | FromDiscord | <Chronos [She/Her]> In reply to @_gumbercules "took me about five": Think they want it in paperback specifically |
16:16:27 | FromDiscord | <basilajith> Yes, I preferred the paperback. The ebook is available at a discounted rate in Manning. |
16:48:37 | FromDiscord | <spotlightkid> There are used copies on the amazon marketplace |
16:57:38 | * | Guest63 joined #nim |
16:58:33 | * | Guest63 quit (Client Quit) |
16:58:53 | FromDiscord | <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:04 | FromDiscord | <voidwalker> but it is better than "Mastering Nim" |
17:02:47 | FromDiscord | <spotlightkid> > I haven't read it all, but it's not that great.↵> Does not compile. |
17:03:08 | FromDiscord | <spotlightkid> > I haven't read it all, but it's not that great.Does not compile. |
17:03:10 | FromDiscord | <Andreas> In reply to @voidwalker "but it is better": both are good reads, "Mastering Nim" is newer. |
17:03:21 | FromDiscord | <spotlightkid> > I haven't read it all, but it's not that great.↵> Does not compile. |
17:07:26 | FromDiscord | <krab4t> how you call proc periodically like every 5 minutes? Qt has QTimer |
17:15:01 | FromDiscord | <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:42 | FromDiscord | <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:44 | systemdsucks | i did print it to pdf for that reason |
17:21:19 | FromDiscord | <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:36 | FromDiscord | <Chronos [She/Her]> In reply to @krab4t "how you call proc": Could use async or something or a thread |
17:33:17 | FromDiscord | <demotomohiro> In reply to @krab4t "how you call proc": https://nim-lang.org/docs/os.html#sleep%2Cint |
17:34:10 | FromDiscord | <deech4592> sent a code paste, see https://play.nim-lang.org/#ix=4yuS |
17:39:35 | FromDiscord | <krab4t> sleep?!?!!? |
17:41:39 | FromDiscord | <demotomohiro> Call proc, sleep 5min then repeat it. |
17:59:22 | NimEventer | New 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:35 | FromDiscord | <xrfez> Does anyone know if the Windows `copyFileEx()` has been wrapped? I am struggling with the callback parameter. |
18:48:59 | FromDiscord | <_gumbercules> https://learn.microsoft.com/en-us/windows/win32/api/winbase/nc-winbase-lpprogress_routine |
18:49:17 | FromDiscord | <_gumbercules> In reply to @xrfez "Does anyone know if": This? ^ |
18:51:01 | FromDiscord | <xrfez> yes. and how to use it properly with `copyFileExW()' |
18:51:24 | FromDiscord | <xrfez> (edit) "`copyFileExW()'" => "`copyFileExW()`" |
18:52:36 | * | disso-peach joined #nim |
18:53:50 | FromDiscord | <_gumbercules> https://github.com/khchen/winim |
18:53:58 | FromDiscord | <_gumbercules> I'm on my phone but have you looked at ^ yet? |
18:54:23 | FromDiscord | <_gumbercules> If not and you're still having issues later when I get back on my PC I can help more |
18:54:50 | FromDiscord | <Sebwazhere> is there a way to increase i with code in a for loop? |
18:55:21 | FromDiscord | <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:59 | FromDiscord | <odexine> In reply to @Sebwazhere "is there a way": ? |
18:56:08 | FromDiscord | <xrfez> sent a code paste, see https://play.nim-lang.org/#ix=4yvb |
18:56:22 | FromDiscord | <voidwalker> can you modify the iterator variable inside the loop ? I thought you couldn't |
18:58:56 | FromDiscord | <odexine> you cant if it isnt marked as var |
19:04:31 | * | systemdsucks quit (Remote host closed the connection) |
19:13:01 | FromDiscord | <_gumbercules> Use a while loop instead |
19:18:54 | * | ttkap quit (Server closed connection) |
19:20:15 | FromDiscord | <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:49 | FromDiscord | <_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:15 | FromDiscord | <xrfez> let me plug away a bit more. |
19:25:03 | FromDiscord | <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:06 | FromDiscord | <_gumbercules> Hmmm are you targeting the c or cop backend and are you using mingw or clang or msvc? |
19:26:21 | FromDiscord | <_gumbercules> Cpp even |
19:29:45 | FromDiscord | <xrfez> In reply to @_gumbercules "Hmmm are you targeting": c backend. GCC `{.stdcall.}` calling convention |
19:30:40 | FromDiscord | <_gumbercules> That might be the problem I'm not sure |
19:31:20 | FromDiscord | <_gumbercules> Have you tried using msvc via --cc:vcc |
19:31:54 | FromDiscord | <_gumbercules> (edit) "--cc:vcc" => "--cc:vcc?" |
19:32:36 | FromDiscord | <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:16 | FromDiscord | <xrfez> In reply to @_gumbercules "Have you tried using": I do not have vcc available at the moment |
19:33:56 | FromDiscord | <_gumbercules> You should just be able to pass in a proc with whatever calling convention the callback type expects |
19:34:25 | FromDiscord | <_gumbercules> As long as the price signature matches the callback type it should just work |
19:34:33 | FromDiscord | <_gumbercules> Procedure even |
19:34:49 | FromDiscord | <_gumbercules> Generally it's going to be cdecl |
19:34:58 | FromDiscord | <_gumbercules> For GCC or mingw |
19:35:01 | FromDiscord | <graveflo> what specifically are you trying to access when the copy is complete? |
19:35:57 | FromDiscord | <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:31 | FromDiscord | <_gumbercules> Mmmm give me a second let me put an example together |
19:36:54 | FromDiscord | <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:14 | FromDiscord | <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:10 | FromDiscord | <graveflo> try only a subset of the parameters. Avoid `lpData` |
19:38:42 | FromDiscord | <xrfez> In reply to @graveflo "I don't think nim": Interesting. Okay |
19:42:12 | FromDiscord | <graveflo> you can paste the line you are using to call `CopyFileExW` if you want |
19:43:24 | FromDiscord | <wrld> var assembly = load(buf.toOpenArray)↵Does anything similar to this exist? |
19:48:06 | FromDiscord | <_gumbercules> sent a code paste, see https://paste.rs/2XVIy |
19:49:45 | FromDiscord | <_gumbercules> this doesn't work - it compiles but just returns 0 from `CopyFileExW` - will attempt to get it working correctly |
19:50:35 | FromDiscord | <_gumbercules> okay this worked |
19:51:39 | FromDiscord | <odexine> In reply to @wrld "var assembly = load(buf.toOpenArray)": prolly not? strange to need it though |
19:52:07 | FromDiscord | <_gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4yvj |
19:52:26 | FromDiscord | <_gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4yvk |
19:52:46 | FromDiscord | <_gumbercules> @xrfez ^ |
19:54:44 | FromDiscord | <xrfez> sent a code paste, see https://play.nim-lang.org/#ix=4yvl |
19:55:37 | FromDiscord | <xrfez> sent a code paste, see https://play.nim-lang.org/#ix=4yvm |
20:16:32 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4yvu |
20:16:51 | FromDiscord | <_gumbercules> In reply to @demotomohiro "Is sizeof(BOOL) and sizeof(bool)": ah yeah I fixed that in the second example |
20:17:23 | FromDiscord | <_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) |