<< 22-01-2023 >>

00:03:18FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4lSE
00:16:08FromDiscord<ShalokShalom> In reply to @Verdagon "one can successfully make": Do you plan on proper pattern matching?
00:18:14FromDiscord<Verdagon> yep! we actually already have that: https://vale.dev/guide/patterns
00:18:31FromDiscord<Verdagon> the only thing missing is a `match` statement to test the actual type of an incoming interface
00:24:05FromDiscord<ShalokShalom> Cool
00:24:14FromDiscord<ShalokShalom> Wish you all the best!
00:24:22FromDiscord<Verdagon> thanks =)
00:55:49FromDiscord<Hourglass> In reply to @Gumbercules "<@337101146017497109> sorry I'm not": Vale?
00:55:53FromDiscord<Hourglass> What's that?
00:56:08FromDiscord<Gumbercules> https://github.com/ValeLang/Vale
00:59:42FromDiscord<Hourglass [She/Her]> That looks cool actually! Syntax ain't my style really but it looks super neat
01:06:10*argonica joined #nim
01:11:22*argonica quit (Quit: Leaving)
01:25:55FromDiscord<Rika> Lots of activity recently huh
01:57:16FromDiscord<Gumbercules> In reply to @Rika "Lots of activity recently": lots of activity in here?
01:57:22FromDiscord<Gumbercules> or in regard to Vale?
02:06:33arkanoidwhat's the most idiomatic way to have seq with ref semantics?
02:06:44FromDiscord<Elegantbeef> `ref seq[T]`
02:06:54arkanoidas simple as that?
02:06:59arkanoidcool, thanks
02:07:05FromDiscord<Elegantbeef> Yes
02:07:19arkanoidI though I would have faced issues with that, not sure why
02:09:46FromDiscord<Rika> In reply to @Gumbercules "lots of activity in": Here
02:12:35FromDiscord<Gumbercules> In reply to @Rika "Here": the creator of Vale hopped in not too long ago - seemed to have had some flurry around that
02:12:44FromDiscord<Gumbercules> not sure what else went on in the past 24 hours
02:13:23FromDiscord<Gumbercules> been attempting to add indirect dispatch support to `sokol_gfx` the past few days and it's been slow and painful
02:13:44FromDiscord<Rika> When was programming not slow and painful
02:14:02FromDiscord<Gumbercules> well when you already know what you're doing, it tends to be less so
02:14:26FromDiscord<Gumbercules> I'm in one of those - I barely have any idea what I'm doing here - modes
02:16:50arkanoidhave you ever tried treeform/shady? I though I was far from able to run custom algorithms on the gpu, but shady made me do it successfully. Suggested!
02:18:05FromDiscord<Gumbercules> In reply to @arkanoid "have you ever tried": I haven't used it before, primarily because I'm supporting as many rendering APIs as possible
02:18:28FromDiscord<Gumbercules> `sokol_gfx` doesn't support compute shaders out of the box, so I've plugged that hole, but indirect dispatch / drawing is still unsupported
02:19:01FromDiscord<Gumbercules> I'm implementing a terrain rendering technique which I've implemented before using BGFX - I'm still not completely sold on the idea that I need compute shader support, but it sure would be nice to have
02:19:22arkanoidGumbercules: I've just realized I've dropped into a related topic accidentally. I wrote what I wrote without knowing the chat context!
02:19:42FromDiscord<Gumbercules> I do it all the time, so no worries at all and no need to apologize 🙂
02:21:40arkanoidbtw, shady let you write all nim and then convert it automatically to glsl. You just need to pay attention to types as you are limited to the shared ones for the code to be ported automatically (well, it's possible to add custom types, but I have not yet experimented with it). Long story short, you can keep your nim code as nim code
02:22:11FromDiscord<Gumbercules> yeah - I already have a tool which cross compiles shader code to whatever shading language I need via spirv-cross
02:22:16FromDiscord<Gumbercules> but I can't write my shaders in Nim
02:22:29FromDiscord<Gumbercules> or run my shader code on the CPU
02:22:42FromDiscord<Gumbercules> I'm okay with this though
02:23:08FromDiscord<Gumbercules> it also provides me with reflection data for my shaders so that I can hot reload them when they change
02:23:09arkanoiddoing the same here. I can run nim functions on CPU or GPU. I use the first for debugging, the second for performance. Sweet!
02:23:24FromDiscord<Gumbercules> yeah debugging shaders is definitely a pain
02:23:35FromDiscord<Gumbercules> getting easier all the time though thanks to renderdoc etc
02:24:40arkanoidyou seems much more expert than me on this topic. I have no ide what spirv-cross is, nor renderdoc, nor BGFX, nor sokol_gfx
02:25:53FromDiscord<Gumbercules> https://en.wikipedia.org/wiki/Standard_Portable_Intermediate_Representation
02:25:53arkanoidElegantbeef, and how I am supposed to (idiomatically) create a new ref seq[T]?
02:26:04FromDiscord<Gumbercules> https://github.com/KhronosGroup/SPIRV-Cross
02:26:09FromDiscord<Elegantbeef> `var a = new seq[T]`
02:26:11arkanoidnew newSeq[int](30)?
02:26:15FromDiscord<Gumbercules> https://github.com/bkaradzic/bgfx
02:26:22FromDiscord<Elegantbeef> Nope
02:26:28FromDiscord<Gumbercules> https://github.com/floooh/sokol
02:26:36FromDiscord<Elegantbeef> `var a = new seq[T]; a[] = newSeq[T](size)`
02:26:41FromDiscord<Gumbercules> https://renderdoc.org/
02:27:59FromDiscord<jtv> Is there really a good reason to use a ref instead of just placing var params where you need reference semantics?
02:29:22FromDiscord<Elegantbeef> Well there is no reason there
02:29:25FromDiscord<Elegantbeef> Nim passes seq/string by ref
02:30:24FromDiscord<Gumbercules> sometimes you need references and your only real option is `ptr`, `pointer` + `cast`, or `ref`
02:31:20FromDiscord<Gumbercules> of course, when passing arguments to functions, `var` parameters will work for non `ref` types
02:31:24*jjido quit (Ping timeout: 264 seconds)
02:31:37FromDiscord<Elegantbeef> But there generally isnt any reason to annotate `var` for pass by ref
02:31:43FromDiscord<Elegantbeef> Since nim already does that for larger types
02:31:43FromDiscord<Gumbercules> no
02:32:01FromDiscord<Gumbercules> yes - but knowing when something is passed by ref or not can be confusing
02:32:18FromDiscord<Gumbercules> and usually people figure it out through slamming heads against objects
02:33:20FromDiscord<Gumbercules> `string` and `seq` being the major offenders
02:34:11FromDiscord<Gumbercules> (edit) "and usually people figure it out through ... slamming" added "experimentation and"
02:35:07FromDiscord<Gumbercules> but yeah, I don't think I've ever found the need for a `ref seq[T]` or a `ref string`
02:35:25FromDiscord<Elegantbeef> I dont think it's that hard to figure out, but maybe i'm just wrong
02:36:01FromDiscord<Elegantbeef> If it's not annotated by `byref` and is smaller than 24 bytes(or is it sizeof(pointer) \ 3) it's by value
02:37:01arkanoidGumbercules: thanks for all the links, I see an unknown world in front of me now. What I don't get is sokol. What's that?
02:37:02FromDiscord<Gumbercules> it's not that it's hard to figure out
02:37:20FromDiscord<Gumbercules> it's that the easy assumption is that value semantics are going to be default
02:37:42FromDiscord<Gumbercules> so people run with that assumption and figure out later it's not the case
02:38:21FromDiscord<jtv> Sure, but he wanted reference semantics, meaning mutability, where under the hood it's going to pass-by-reference but won't let him mutate. Var is generally a much more normal solution that a ref
02:39:00FromDiscord<Gumbercules> In reply to @arkanoid "<@204328759715692544>: thanks for all": Sokol is a collection of single header libraries that do various things - so there's one that offers a cross platform graphics API similar to BGFX, that would be `sokol_gfx.h` - Sokol however focuses on supporting a smaller subset of APIs than BGFX and it also has zero dependencies
02:39:54arkanoidsokol, I think it is just me that I don't see the advantage of "single header library"
02:39:56FromDiscord<Gumbercules> and it's written in C - BGFX is written in C++ and has several dependencies including it's own stdlib, and then it wraps the C++ API with a C99 API
02:40:12FromDiscord<Gumbercules> it's very easy to compile and integrate with a project would be the major upside
02:40:26FromDiscord<Gumbercules> it's also extremely easy to grok the code when there's no jumping around between header and source files
02:40:48FromDiscord<Gumbercules> Sean Barret popularized the concept with the `stb` libraries he created, like `stb-image`
02:41:12FromDiscord<Gumbercules> https://floooh.github.io/sokol-html5/index.html - are all samples made with `Sokol`
02:41:59arkanoidok, so "single file library" seems an umbrella term used around C/C++ meaning: less but easier to manage is better than more
02:42:34FromDiscord<Gumbercules> yeah, generally it's going to be much easier to stick a single header file into a Nim application than one that utilizes a build system like CMake or Premake
02:43:15FromDiscord<Gumbercules> you can just use the `{.compile.}` and `{.passC.}` pragmas
02:43:47arkanoidGumbercules, sure. I've been using futhark so far to get C stuff into nim (or at least to create the v0.1 of the bridge)
02:44:10arkanoidso, can I use "sokol X" as a generic search term for this kind of stuff?
02:44:11FromDiscord<Gumbercules> for instance - https://github.com/floooh/sokol-nim/blob/master/src/sokol/gfx.nim#L1211-L1212 - is how the author of sokol compiles `sokol_gfx.h` for the Nim bindings they authored
02:44:29FromDiscord<Gumbercules> In reply to @arkanoid "so, can I use": single header libraries is probably a better term
02:44:45FromDiscord<Gumbercules> I use quite a few C libraries in my code and have also done quite a bit of C++ interop with Nim, so if you ever have questions, feel free to ask!
02:45:09FromDiscord<Gumbercules> https://github.com/Tail-Wag-Games/frag/tree/master/thirdparty
02:48:29arkanoidthanks! I used to do games, but just unity + internal C#/js scripting. Was fun, but I skipped the system-level stuff spending my time there
02:49:07arkanoidI'm now recoving some of it thanks to nim. It's a gentler approach to the C/C++ world
02:54:24FromDiscord<Gumbercules> In reply to @arkanoid "I'm now recoving some": it's a very nice bridge to it too - I definitely credit a lot of my learning through Nim with being able to break into the industry and start working on games / game engines
02:54:47FromDiscord<Gumbercules> although I did do a lot of Unity and Unreal work as well, custom engine stuff was much rarer
02:54:49FromDiscord<Gumbercules> (edit) "rarer" => "rareer"
02:54:52FromDiscord<Gumbercules> (edit) "rareer" => "rarer"
02:55:39arkanoidwhy strformat `&` does not work in templates?
02:56:02arkanoidI'm forced to do all the concat manually if I wrap some &"{foo}" code in a template
02:56:19FromDiscord<Rika> Because templates mangle/sanitise their variable names
02:56:30FromDiscord<Rika> Which makes them not match the names in a string
02:56:36FromDiscord<Rika> (edit) "a" => "the"
02:56:44arkanoidbut foo is a local variable of the template
02:56:50arkanoidnot a parameter
02:57:22arkanoidthanks for the explanation, I'll concat manually
02:57:50FromDiscord<Elegantbeef> And it's not named `foo` at the end
02:57:55FromDiscord<Elegantbeef> it's `foo'gensymSomeNumberHere`
03:19:37FromDiscord<Rika> In reply to @arkanoid "but foo is a": Templates do it for both
03:20:44arkanoidgot it, makes a lot of sense actually. My head still consider whatever comes with stdlib as something with supermagical powers
03:21:00arkanoidmaybe is {.magic.} pragma that brings this to my head
03:22:06FromDiscord<Rika> you can disable it by putting {.inject.} on the variable iirc
03:30:49*rockcavera quit (Remote host closed the connection)
03:40:56FromDiscord<jtv> That works on a single variable, and {.dirty.} being added to the template will do it for all variables.
03:44:18FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lTg
03:49:30FromDiscord<Rika> `newSeq[char](1024)` -> `newString(1024)`↔`msg[0].addr` -> `msg.cstring`↔? im not too familiar anymore
03:49:54FromDiscord<Elegantbeef> `cstring` on a `string` it's not any safer it's just more explicit
04:03:08FromDiscord<Rika> Yes sure it isn’t
04:05:35*azimut quit (Remote host closed the connection)
04:06:30*azimut joined #nim
04:07:16FromDiscord<ringabout> `cast[cstring]` is probably the only way.
04:09:53FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4lTm
04:10:12FromDiscord<ringabout> (edit) "https://play.nim-lang.org/#ix=4lTo" => "https://play.nim-lang.org/#ix=4lTn"
04:36:38FromDiscord<sOkam!> yeah newString and cstring fixed the warning
04:36:42FromDiscord<sOkam!> tyty
04:49:47*azimut_ joined #nim
04:49:55*azimut quit (Quit: ZNC - https://znc.in)
04:53:28*arkurious quit (Quit: Leaving)
05:31:39*rockcavera joined #nim
06:14:10FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4lTD
06:15:02FromDiscord<ajusa> What do folks prefer for writing unit tests? std/unittest, unittest2, balls, asserts
06:18:17FromDiscord<pyolyokh> balls? std/unittest has a reasonable interface, but it's a little bit too magical which causes problems occasionally, like reporting warnings from the guts of unittest.nim instead of your code. unittest2 is a value-added fork of unittest, so no difference in interface. asserts don't let you see multiple failures, which might be a more useful clue to the problem than the first failure.↔I'm using std/unittest for now but I'd prefer go-st
06:18:30FromDiscord<Rika> Balls is a 3rd party library
06:19:12FromDiscord<Elegantbeef> std/unittest is sufficient for most basic code ime, but yea i'd go for balls if i had anything more elaborate
06:19:14FromDiscord<pyolyokh> since it's not `nimble search`, it's disruptek right? ... yep
06:19:21FromDiscord<Elegantbeef> Yes
06:20:08FromDiscord<pyolyokh> balls looks like it'd have my same irritations with std/unittest
06:20:27FromDiscord<ajusa> looks like balls is threaded as well? but it seems like it runs test files in parallel, rather than the units in the test
06:26:11FromDiscord<leorize> balls try not to cause warnings from internal stuff, it's pretty good tbh
06:27:58FromDiscord<leorize> the thing was originally made to test cps, which does require that it don't mess with line information so we can track down cps bugs easier. And also there's a very large incentive for it to not cause issues \:p
06:28:26FromDiscord<ajusa> seems like it is still getting updated as well - I'll try it out
06:38:17*azimut_ quit (Ping timeout: 255 seconds)
06:49:27*ltriant quit (Ping timeout: 255 seconds)
07:15:22*NimBot joined #nim
07:15:28*FromDiscord joined #nim
07:15:50*arkanoid joined #nim
07:21:50*nisstyre joined #nim
07:32:05arkanoidI have a Tensor of shape [7,100,100], I want to select an element on first dimension and get a [1,100,100] back (or just [100,100]). According to https://mratsim.github.io/Arraymancer/tuto.slicing.html it should be "myTensor[0,_,_]" but this returns a single element to me
07:34:03arkanoidalso [0,_.._,_.._] returns one element
07:34:37arkanoidalso [0,0.._,0.._] returns one element
07:35:25arkanoidalso [0,0..^1,0..^1] returns one element
07:42:26arkanoidI give up, not sure what's wrong, but also echoing the tensor locks the process
08:05:50FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4lTT
08:06:35FromDiscord<michaelb.eth> (edit) "https://play.nim-lang.org/#ix=4lTT" => "https://play.nim-lang.org/#ix=4lTU"
08:07:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lTV
08:07:43FromDiscord<Elegantbeef> `1..0` is an empty range which explains `@[]`
08:07:57FromDiscord<Elegantbeef> `2..0` is also empty, so should probably return `@[]` aswell
08:08:58FromDiscord<michaelb.eth> sure, just noting it's a source of confusion, doesn't bite you until it bites you, but when it does it can be maddening
08:09:58FromDiscord<Elegantbeef> Hey i was just explaining what's going on
08:11:48FromDiscord<Ntsékees> sent a code paste, see https://play.nim-lang.org/#ix=4lTW
08:11:54FromDiscord<Elegantbeef> `: seq`
08:12:00FromDiscord<Elegantbeef> Remove that, be merry
08:12:11FromDiscord<Elegantbeef> It's a `seq[(string, string)]`
08:12:21FromDiscord<Ntsékees> Okay, thanks
08:12:35FromDiscord<Ntsékees> Still, it's not what the compiler should output
08:12:39FromDiscord<Ntsékees> it crashes on that code
08:12:44FromDiscord<Elegantbeef> Of course not it's a bug
08:13:30FromDiscord<Elegantbeef> Internal errors are not meant to be user facing errors
08:19:20*azimut joined #nim
08:32:34FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lTY
08:33:26FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4lTY" => "https://play.nim-lang.org/#ix=4lTZ"
09:04:33*ltriant joined #nim
09:15:47*azimut quit (Ping timeout: 255 seconds)
09:20:53*kenran joined #nim
09:20:53*kenran quit (Remote host closed the connection)
09:26:59FromDiscord<Ntsékees> sent a long message, see http://ix.io/4lU6
09:27:20FromDiscord<NtsĂ©kees> The Nim documentation mentions a type “Any”
09:27:54FromDiscord<Rika> use object variants
09:28:05FromDiscord<Rika> https://nim-lang.org/docs/manual.html#types-object-variants
09:35:28FromDiscord<Ntsékees> I'll look into these, thanks for the pointer.
09:38:51FromDiscord<Phil> In reply to @NtsĂ©kees "I'll look into these,": An object variant (also called union type? I'm not the best at terminology) is basically an object that based on an enum-field can have either a set of fields belonging to enum value A, B, or C.↔You can instantiate one fairly easily, you do have to deal everywhere that variant occurs though, that it might either be one or the other
09:39:30FromDiscord<Phil> (edit) "C.↔You" => "C (or however many enum options you got).↔You"
09:40:30FromDiscord<Phil> JSON parsing and XML/HTML parsing is implemented using object variants in case you're curious
09:40:54FromDiscord<Elegantbeef> > belonging to any ordinal↔FTFY 😄
09:41:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lU8
09:43:14FromDiscord<Phil> So your second case matches anything where kind is a character between b and z?
09:43:21FromDiscord<Elegantbeef> Yes
09:43:31FromDiscord<Phil> Not sure if cursed but it kinda looks like it
09:43:56FromDiscord<Elegantbeef> Not with char but the compiler uses it for PNodes
09:44:10FromDiscord<Phil> Well I guess its better than having to redefine the same stuff when you want to match the same thing multiple times
09:44:30FromDiscord<Phil> (edit) "match" => "have" | "thing multiple times" => "fields for matching different things"
09:44:44FromDiscord<Elegantbeef> It's contrived in this case, but in some cases it's much easier to type than explicitly all branch kinds
09:45:22FromDiscord<Elegantbeef> Like imagine that was a enum, why would i write `b, c, ...` instead of `b..z`
09:46:21FromDiscord<Elegantbeef> your mileage may vary
10:35:19FromDiscord<Ntsékees> It it possible to access a variable index in a tuple?
10:35:33FromDiscord<Ntsékees> `sometuple[i]` triggers an error
10:35:48FromDiscord<NtsĂ©kees> “cannot evaluate at compile time”
10:36:29FromDiscord<Ntsékees> Presumably only literal indexes are allowed?
10:38:02FromDiscord<hotdog> @Ntsékees have a look at https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CS%2CT
10:38:16FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/pXq
10:39:19FromDiscord<enthus1ast> indicates that you use this in a compile time context, and some variable cannot be evaluated on compile time↔(@NtsĂ©kees)
10:40:04FromDiscord<hotdog> sent a code paste, see https://play.nim-lang.org/#ix=4lUp
10:43:39FromDiscord<Phil> In reply to @NtsĂ©kees "`sometuple[i]` triggers an error": With a code example we could tell you what's happening there 😉
10:45:13FromDiscord<Ntsékees> https://media.discordapp.net/attachments/371759389889003532/1066669861075439696/image.png
10:45:43FromDiscord<Ntsékees> Maybe let is in fault?
10:45:56FromDiscord<Ntsékees> Nah, var does the same
10:47:41FromDiscord<Rika> the "variable" has to be evaluated on compile time e.g. neither let nor var
10:47:54FromDiscord<Rika> const is okay
10:55:56FromDiscord<Phil> Ah, do tuple indices require a compile-time index to ensure that no invalid index is used?
10:55:58FromDiscord<NtsĂ©kees> I had thought I could use a tuple of polymorphic tuples instead of a list of such tuples for avoiding the issue of type heterogeneity.↔I think what I'll do is instead of having callbacks in the second tuple slot, having rather strings of the form `"\ecallback_name"`, with the Escape character marking a callback function, and then using a map ⟹callback_name ↩ callback⟩ in the site where the regexps are applied.
10:57:10FromDiscord<Rika> In reply to @Isofruit "Ah, do tuple indices": to ensure that the type cannot suddenly change
10:57:51FromDiscord<Phil> In reply to @NtsĂ©kees "I had thought I": Note that functions also need to have the same signature, so if function a) accepts type A and function b) accepts type B then you'll face the same type issues, because you can't have a seq of procs with different signatures.↔Unless you start storing them as pointers, at which point you'll need to cast them into their proper proc form later, which is a) dirty, b) unsafe and c) looks ugly
10:58:10FromDiscord<Phil> (edit) "signature," => "signature if you want to store them in a seq,"
10:58:40FromDiscord<Ntsékees> They have the same signature, as they are all callback for the same function (`replace()` from the `nre` lib)
10:58:52FromDiscord<Ntsékees> (edit) "callback" => "callbacks"
10:59:05FromDiscord<Phil> Are they not going to accept different types as parameters?
10:59:26FromDiscord<Ntsékees> nope, only strings (since it's a regexp function)
11:00:20FromDiscord<Phil> AH, so the second element is either a string of a proc that returns a string?
11:00:27FromDiscord<Ntsékees> yep
11:00:51FromDiscord<Phil> And you can't call the proc beforehand to get the string?
11:04:25FromDiscord<NtsĂ©kees> not without dropping the whole scheme of “the regexps to be applied to the string are stored in a sequence of tuples, and then later on they are applied in order in a loop”
11:05:08FromDiscord<Ntsékees> which was meant to reduce repetitive code in the original Python version
11:06:04FromDiscord<Phil> Ohhhh so the function is basically an earlier iteration of "apply the regexp from this tuple to the source string" and that output is then used to apply the next regex ?
11:06:22FromDiscord<Ntsékees> exactly
11:07:00FromDiscord<Phil> Why not store a seq of regexes and write a proc that eats a string and that seq of regexes and applies it one by one?
11:09:21FromDiscord<Phil> But eh, might be more a thing if you want to refactor later down the line.↔For now you're right that you can either just generally make it tuples of `(regex, callback)` and the moments where you want it to be just a string you just define your callback as `() => "myString"`
11:09:33FromDiscord<Phil> (edit) removed "either"
11:09:39FromDiscord<Ntsékees> That's more or less what I'm doing but the sequences contains not only the input regexps, but also the output expression, which may a replacement string or a callback
11:10:48FromDiscord<Phil> (For the above JS-like callback syntax btw. import std/sugar, it enables using `=>` and `->` for defining anonymous procs)
11:26:09*clemens3 left #nim (WeeChat 2.7)
11:32:07FromDiscord<NtsĂ©kees> > Error: type mismatch: got↔> '(string, proc (m: RegexMatch): string{.closure, noSideEffect, gcsafe, locks: 0.})' for ... but expected↔> '(string, proc (m: RegexMatch): string{.noSideEffect.})'↔Looks like closures are considered a different type 😔
11:35:37FromDiscord<pyolyokh> name the type of the proc that you want in this structure, and cast all the procs to it that you add
11:43:14FromDiscord<Ntsékees> Even after doing a type casting, `{.closure.}` remains there and causes a mismatch error
11:43:56FromDiscord<Ntsékees> sent a code paste, see https://play.nim-lang.org/#ix=4lUE
11:44:38FromDiscord<NtsĂ©kees> I could convert the non-closure functions into closures đŸ€Ș
11:46:23FromDiscord<Ntsékees> (the lambda expression is a closure because it captures the `cartouche_space` variable)
11:46:51FromDiscord<Phil> Full code example please as e.g. cartouche-space is from the outside
11:47:35FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lUG
11:48:03FromDiscord<Phil> I assume `cartouche_space` is also compile-time?
11:50:42FromDiscord<Ntsékees> sent a code paste, see https://play.nim-lang.org/#ix=4lUH
11:50:46FromDiscord<Ntsékees> Simplified code example
11:50:47FromDiscord<pyolyokh> `Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'.`, yeah, since the calling convention is different I guess they all have to be closures
11:50:52FromDiscord<Ntsékees> the actual code is big and noisy
11:51:08FromDiscord<Ntsékees> cartouche_space is not a constant
11:51:21FromDiscord<Ntsékees> it depends on one of the input arguments of the whole program
11:51:38FromDiscord<Ntsékees> but here for the sake of the demonstration I've set it to `" "`
11:52:16FromDiscord<Ntsékees> (edit)
11:55:58FromDiscord<Rika> Just add closure pragma to that add function I don’t get it
11:56:38FromDiscord<Ntsékees> hmm when I replace `const` with `var`, `.closure.` disappears from the signature; maybe I can do a type cast now

11:57:45FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lUK
11:58:08FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4lUK" => "https://play.nim-lang.org/#ix=4lUL"
11:58:16FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lUM
11:58:58FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4lUL" => "https://play.nim-lang.org/#ix=4lUN"
11:59:09FromDiscord<pyolyokh> : string
11:59:41FromDiscord<pyolyokh> `type MyProc = proc(m: RegexMatch) {.closure.}` doesn't return one
11:59:45FromDiscord<Phil> Agh, pesky return types
12:03:01FromDiscord<Phil> Yeah, straight up can't mix
12:05:22FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lUQ
12:06:29FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lUR
12:07:15*krux02 joined #nim
12:08:21FromDiscord<Ntsékees> that seems to work
12:08:21FromDiscord<Ntsékees> sent a code paste, see https://play.nim-lang.org/#ix=4lUT
12:08:46FromDiscord<Ntsékees> by declaring the lambdas to be closure even though they aren't
12:09:04FromDiscord<Ntsékees> (edit) "closure" => "closures"
12:09:31FromDiscord<Phil> That's fine, all you're saying is "This proc has the ability to capture stuff from its environment", that's relevant for stuff like multithreading etc. where being closures may limit you, but you're not doing multithreading so you're fine
12:14:21FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lUU
12:17:32FromDiscord<Ntsékees> Rika, Phil, pyolyokh: Thank you for your support!
12:17:44FromDiscord<Ntsékees> (afk)
12:23:35*genpaku quit (Read error: Connection reset by peer)
12:24:43*genpaku joined #nim
12:26:02FromDiscord<Phil> Just opened an issue about the sqlite behaviour with the foreign_key PRAGMA with norm.↔The fact that these checks are turned off by default and need to be turned for every connection explicitly is not ok, let's see if norm can include a fix for that.
14:56:47FromDiscord<choltreppe> When I generate docs for a nimble package, I always get "src/.." in the title for each module, no matter if I run the `nim doc` command from inside the `src` folder or not. How can I get rid of the "src/" ? (without editing each .html file)
15:13:52*azimut joined #nim
15:30:12*arkurious joined #nim
15:34:48*xet7 joined #nim
15:36:50*jkl quit (Excess Flood)
15:40:16*jkl joined #nim
15:48:38FromDiscord<hortinstein> so I am getting this issue when I try to output javascript, the closest I have found to a solution was: https://forum.nim-lang.org/t/7181 if you want to reproduce...there is a gitpod of it you can open in the browser here or clone locally: https://github.com/hortinstein/enkodo https://media.discordapp.net/attachments/371759389889003532/1066746216995631255/image.png
15:49:22FromDiscord<hortinstein> i have tried tweaking the source files and it appears to be a parser bug, any ideas on workarounds and if I need to file a bug report
15:49:44FromDiscord<hortinstein> (edit) "report" => "report? Thank you!"
16:30:27FromDiscord<sOkam!> Do you guys know of an existing solution that can add license text to every file in a project, unless that file already contains it?↔I could code a tool for it, but asking in case something already exists
16:30:37FromDiscord<sOkam!> (edit) "it?↔I" => "it? I"
16:31:03FromDiscord<leorize> reuse
16:31:30FromDiscord<leorize> https://reuse.software/
16:36:53FromDiscord<Rika> one hell of a name
16:38:32FromDiscord<chmod222> I must be getting old, I remember the TLDs being shorter than the subdomains
16:41:21FromDiscord<Hourglass [She/Her]> How can I stop this warning from showing up? `cannot prove that it's safe to initialize 'text' with the runtime value for the discriminator 'typ'`
16:41:40FromDiscord<Hourglass [She/Her]> sent a code paste, see https://paste.rs/naZ
16:46:15FromDiscord<sOkam!> In reply to @leorize "https://reuse.software/": thats really useful. tyty!
16:46:39FromDiscord<Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "How can I stop": Ah it's an error
16:47:18FromDiscord<abisxir> sent a long message, see http://ix.io/4lW2
16:47:32FromDiscord<abisxir> (edit) "http://ix.io/4lW2" => "http://ix.io/4lW3"
16:48:09FromDiscord<leorize> use `of` to check the runtime type
16:48:10FromDiscord<chmod222> Give A and B a `method` that returns their typedefs so it uses dynamic dispatch
16:48:17FromDiscord<chmod222> Or that
16:48:35FromDiscord<chmod222> Probably that
16:48:49FromDiscord<leorize> `method` that returns `typedesc` won't work since `typedesc` is compile-time
16:49:56FromDiscord<abisxir> Just the type name is enough for me, I need it for some debugging.
16:50:36FromDiscord<Phil> In reply to @leorize "`method` that returns `typedesc`": You could have a field that is the typedesc string and a method dishing that string out
16:51:06FromDiscord<Phil> But at this point you're in hacktown, population: Way too many programmers
16:51:29FromDiscord<leorize> `method typeName(x: A) = "A"; method typeName(x: B) = "B"` is a thing then
16:52:04FromDiscord<Phil> Yeah, though couldn't you just write a generic method at that point?
16:52:15FromDiscord<abisxir> That is not good, as I do not know how it will extend, a new class then I get A
16:52:18FromDiscord<Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "This is my code": This is very irritating and I don't know how to fix that aha
16:52:20FromDiscord<Phil> Actually, I want to try this out
16:52:51FromDiscord<leorize> generics are instantiated at the spot that you use it, so that won't work↔(@Phil)
16:53:04FromDiscord<leorize> statically speaking it's `A` where it would be used
16:53:35FromDiscord<Rika> In reply to @Hourglass, When the Hour Strikes "This is very irritating": I will say I think there isn’t enough info in your description
16:54:09FromDiscord<Rika> There is no “text” to be seen
16:54:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lW5
16:54:52FromDiscord<jtv> const a = $(typedesc(mytype)) should work too
16:55:15FromDiscord<Rika> 🙂
16:55:17FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4lW6
16:55:23FromDiscord<Rika> I mean R
16:55:23FromDiscord<abisxir> sent a code paste, see https://play.nim-lang.org/#ix=4lW7
16:55:26FromDiscord<Rika> Yes
16:55:31FromDiscord<Phil> Ah, shit... hmm
16:55:46FromDiscord<Rika> That’s what putting it in the sequence effectively does
16:56:10FromDiscord<Phil> Wait, how is `let x: R = A()` that invalid nim
16:56:31FromDiscord<leorize> inheritance↔(@Phil)
16:56:32FromDiscord<abisxir> No that is valid nim, but it will write R
16:56:41FromDiscord<Phil> I'm currently running this code through the compiler and it bombs, I'd have anticipated that it compiles
16:57:05FromDiscord<Phil> on devel
16:57:06FromDiscord<leorize> and you forgot `ref`
16:57:46FromDiscord<Phil> Yeah it needs ref to make it compile, hmm
17:00:27FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lWa
17:01:36FromDiscord<Phil> Time to read up more on method and how nim does runtime dispatch, this smells like I implemented sth wrong
17:02:06FromDiscord<Rika> In reply to @Isofruit "Time to read up": Probably missing base method for R
17:02:26FromDiscord<Phil> Ah, just needs a base for R
17:02:26FromDiscord<Phil> yeah
17:02:28FromDiscord<leorize> you didn't make a base method
17:02:32FromDiscord<chmod222> That one works if you give it a base method
17:02:40FromDiscord<Phil> Hah, only second !
17:04:37FromDiscord<Rika> Lol
17:06:25arkanoidto get C pointer to "var foo = array[2, uint32]", is it "cast[ptr uint32](foo[0].addr)" ?
17:07:20FromDiscord<leorize> yep, that's the most reliable method
17:08:14FromDiscord<Hourglass [She/Her]> In reply to @Rika "I will say I": Ah i sent the wrong proc, but I fixed it by using a case statement instead now
17:09:14arkanoidthanks. Then I don't know why it's not working. I have a UVec2 from https://github.com/treeform/vmath/blob/master/src/vmath.nim, that really is an array[2, uint32], I'm trying to run "glUniform2uiv(location, 2, cast[ptr GLuint](value[0].addr))" from https://github.com/nim-lang/opengl/blob/26c3e1e107d68e84b785f0143a60f87040dceae9/src/opengl/private/procs.nim, but receiving "OpenGL error: invalid
17:09:16arkanoidoperation [GLerror]"
17:10:30FromDiscord<Rika> In reply to @leorize "yep, that's the most": ? Wouldn’t it have been better to do foo[0].addr even if they’re equivalent for this data type
17:22:45arkanoidfound the issue https://github.com/treeform/vmath#vector-and-matrix-representation-and-benchmarks
17:26:34FromDiscord<chmod222> Just make sure foo.len \> 0
17:26:35FromDiscord<chmod222> If it is a seq
17:26:36FromDiscord<chmod222> Otherwise foo[0].addr will segfault
17:26:36FromDiscord<chmod222> Shit, I really should learn to read before typing
17:27:57arkanoidis it possible to print symbol all known aliases of a type?
17:39:56arkanoidis the any difference between unsafeAddr and addr ?
17:40:09FromDiscord<chmod222> In Nim 2.0, no
17:40:16arkanoidin 1.6.10?
17:40:22FromDiscord<chmod222> In Nim 1.6, unsafeAddr works on `let` vars, addr does not
17:40:54arkanoidmakes sense! thanks
17:41:05arkanoidso I've a var here, and both works, so I can't see the difference
17:42:40FromDiscord<chmod222> Yep, exactly
17:43:03FromDiscord<chmod222> Make it a `let` and `addr` will raise an error for now
17:43:16FromDiscord<Ntsékees> Is there an available UTF8 slice function or should I write mine?
17:44:00FromDiscord<Ntsékees> i.e. an equivalent to the byte string `s[i..j]` expressions
17:44:04Amun-RaunsafeAddr is "unsafe" because you need to make sure C function that takes it as an argument not to ever write to it
17:45:42FromDiscord<jtv> You mean one that slices on codepoint instead of by byte, right? You have to scan all the way up to the start of the slice anyway, so there’s not much advantage over just using toRunrs or runes()
17:46:11FromDiscord<sOkam!> When would someone prefer strscans over parseutils?↔Don't they do exactly the same thing, in essence? Or am i misunderstanding something đŸ€” ↔_Usecase is parsing a game level file format_
17:48:41FromDiscord<jtv> The fact that UTF strings aren’t fixed size means that you lose the constant time indexing, you have to scan from the front (or back if you’ve already counted codepoints)
17:49:08Amun-Rastrscans is closer to regex
17:50:06FromDiscord<sOkam!> what does that mean?
17:51:55FromDiscord<jtv> I was answering @Ntsékees
17:52:09FromDiscord<jtv> I don’t know anything about strscans
17:52:40ZevvOskam!: check npeg. but i'm biased.
17:52:53Amun-RaI also use parseutils; strscans is "higher" level module
17:53:42FromDiscord<jtv> I generally just write my own parsing; it’s usually clearer, faster and less error prone than anything that looks like line noise 🙂
17:55:23*rockcavera joined #nim
17:57:31FromDiscord<sOkam!> @zevv gold https://media.discordapp.net/attachments/371759389889003532/1066778650369855488/image.png
17:58:39FromDiscord<sOkam!> In reply to @Amun-Ra "I also use parseutils;": higher level meaning, in this case?
17:59:01FromDiscord<sOkam!> (edit) "In reply to @Amun-Ra "I also use parseutils;": ... highermean," added "what does" | "meaning," => "mean,"
18:00:44FromDiscord<jtv> In reply to @sOkam! "<@693957322375954512> gold": That’s because friends peer pressure each other into bad behavior 😉
18:01:49FromDiscord<sOkam!> KEWK
18:01:54FromDiscord<sOkam!> (edit) "KEWK" => "KEKW"
18:03:08FromDiscord<Phil> In reply to @jtv "That’s because friends peer": All I'm pressuring people into is making their packages that I use nim 2.0 compatible! I resent that statement ! 😛
18:11:15Amun-RasOkam!: as in 'parsing capabilities'
18:26:28FromDiscord<sOkam!> In reply to @Amun-Ra "sOkam!: as in 'parsing": so strscans is gonna be simpler to write, because its higher level?
19:22:04FromDiscord<hotdog> In reply to @hortinstein "so I am getting": @hortinstein it doesn't work because `serEncObj` is a generic. Ideally jsffi would give you a nicer error message so you could file an issue about that
19:40:54*azimut quit (Remote host closed the connection)
19:43:18FromDiscord<hortinstein> In reply to @hotdog "<@169298166506586113> it doesn't work": awesome! Thank you i just fixed it!
19:51:00FromDiscord<hotdog> In reply to @hortinstein "awesome! Thank you": Glad to hear it 🙂
19:58:00FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lX1
19:58:02FromDiscord<Phil> Is this another issue along the lines of "generics don't actually exist"?
19:58:08FromDiscord<Phil> (edit) "Is" => "Was"
19:58:37FromDiscord<Phil> Can't you just do file.lines.toSeq?
19:58:55FromDiscord<Phil> Lines should be an iteratable and toSeq should work on those
19:59:13FromDiscord<sOkam!> yea lines is an iterable. didn't know toseq converts iterators, ty
20:32:58FromDiscord<Ntsékees> Is it possible to test the value of a generic type parameter within the body of a type-generic procedure?
20:34:13FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=4lXe
20:34:44FromDiscord<Ntsékees> Ah; I had tried with `if` but it didn't work. Now I remember that `when` is comparable to C `#ifdef`, somewhat.
20:34:58FromDiscord<Ntsékees> (edit) "`#ifdef`," => "`#if`,"
20:35:16FromDiscord<Ntsékees> Thanks.
20:54:55FromDiscord<pjhenning> sent a code paste, see https://play.nim-lang.org/#ix=4lXj
20:55:16FromDiscord<pjhenning> (edit)
20:55:46FromDiscord<pjhenning> (edit) "https://play.nim-lang.org/#ix=4lXj" => "https://play.nim-lang.org/#ix=4lXk"
20:56:42FromDiscord<pjhenning> Whoops whould be `importcpp` instead of `importc`
21:06:15FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lXl
21:08:55FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lXo
21:28:57FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lXt
21:30:40FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4lXt" => "https://play.nim-lang.org/#ix=4lXu"
21:32:43FromDiscord<amadan> Basically means you are calling a C function in some code that runs at cmopile time.↔Do you call `getAppFilename()` or `getAppDir()` in some compile time code anywhere?
21:33:29FromDiscord<sOkam!> oh, yeah i am. let me see if it fixes it
21:34:01FromDiscord<sOkam!> oh, good catch. that was it, ty
21:34:16FromDiscord<sOkam!> well, a stack trace would have been nice at least 😔
22:10:40FromDiscord<Ntsékees> sent a code paste, see https://play.nim-lang.org/#ix=4lXC
22:11:25FromDiscord<Ntsékees> Unfortunately with these it's a bit tedious to find which part of the code is responsible
22:11:50FromDiscord<Ntsékees> (the last time it happened it was due to an incorrect type declaration)
22:31:44FromDiscord<Phil> I mean, as per the usual without code or anything it's a bit difficult to conclude anything ^^'
22:31:55FromDiscord<Phil> (edit) "anything" => "any kind of minimal example"
22:45:23FromDiscord<lithiumfrost> sent a code paste, see https://play.nim-lang.org/#ix=4lXM
22:45:52FromDiscord<lithiumfrost> https://learn.microsoft.com/en-us/windows/win32/api/wincred/nf-wincred-credenumeratea
22:47:06FromDiscord<Ntsékees> sent a code paste, see https://play.nim-lang.org/#ix=4lXN
22:47:58FromDiscord<Ntsékees> sent a code paste, see https://play.nim-lang.org/#ix=4lXO
22:48:11FromDiscord<Ntsékees> It's the last `else:` with the `raise` statement that causes the crash
22:48:24FromDiscord<Ntsékees> it's odd, because it did work at one point earlier
22:48:39FromDiscord<Ntsékees> (but I've probably made modifications in the meantime)
22:49:28FromDiscord<Ntsékees> since the crash involves macros, it might be due to `fmt`
22:51:13FromDiscord<Ntsékees> It's `$T`. Yet I seem to remember that it worked at one point.
22:51:30FromDiscord<Ntsékees> (even though I wasn't sure it could work)
22:51:56FromDiscord<Elegantbeef> Why an exception
22:52:35FromDiscord<Elegantbeef> This should be `{.error: fmt"your string here".}`
22:53:23FromDiscord<Elegantbeef> But even then why not `T: seq[Rune] or string`
22:53:26FromDiscord<Ntsékees> OK. (I'm new to Nim.)
22:53:43FromDiscord<Elegantbeef> There you go
22:53:44FromDiscord<Ntsékees> In reply to @Elegantbeef "But even then why": I do suspect that this should have been the normal way to proceed
22:54:27FromDiscord<Ntsékees> I used an exception as a hasty measure
22:55:10FromDiscord<Elegantbeef> Yea i wasnt really grilling you, just bad lead up to an explanation
23:00:48*anddam joined #nim
23:03:39*rockcavera quit (Ping timeout: 260 seconds)
23:03:49anddamhowdy
23:05:36FromDiscord<4zv4l> is it me or the example code in https://github.com/krisppurg/dimscord↔doesn't work ?
23:06:17FromDiscord<4zv4l> I get this
23:06:19FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lXU
23:06:54FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lXV
23:07:00FromDiscord<4zv4l> I didn't change anything except the token
23:09:17FromDiscord<4zv4l> my bad, apparently I have to change something on the bot dashboard
23:11:58FromDiscord<Phil> In reply to @NtsĂ©kees "OK. (I'm new to": Don't worry, I only learned of that one roughly 12 months after starting to learn the language, so with that particular feature you're ahead of the curve 😛
23:13:37FromDiscord<Phil> As a sidenote, I have decided I'm not sure I really like the fact that the converter feature exists
23:16:04FromDiscord<sOkam!> In reply to @Isofruit "As a sidenote, I": how so? because of the abstraction?
23:16:17FromDiscord<Phil> Code clarity is king
23:16:35FromDiscord<Phil> If there is a converter that implicitly gets called, I can no longer with certainty quickly say what code has run when
23:16:39FromDiscord<Phil> Only after some detective work
23:17:09FromDiscord<sOkam!> if you don't know the project, agreed. or if you spam converters all over
23:17:26FromDiscord<sOkam!> but for a few sparse things, they are really helpful
23:17:53FromDiscord<Elegantbeef> Converters are lovely if used properly
23:17:58FromDiscord<sOkam!> using an enum as an int natively iwthout having to cast it back to ord, for example, is one of those for me
23:18:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lXX
23:18:30FromDiscord<Elegantbeef> Boom we have a 'weak distinct'
23:18:45FromDiscord<sOkam!> whats lent?
23:18:50FromDiscord<Elegantbeef> But it really depends on what you're doing, some people misuse them and it ruins the sanctity of type safety
23:18:52FromDiscord<Elegantbeef> A borrow
23:18:57FromDiscord<Phil> For the most part I just haven't seen the usecase.↔Or rather where there would be a usecase, I've decided to prefer the approach norm went with:↔Having a dedicated proc name.↔In Snorlogue those are for example "toFormField" and "toModelValue"
23:19:06FromDiscord<sOkam!> i mean, what is a borrow? same Q
23:19:10FromDiscord<sOkam!> 🙂
23:19:20FromDiscord<Elegantbeef> It reuses the memory without copying if possible
23:19:30FromDiscord<sOkam!> so like a ref of sorts?
23:19:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lXY
23:19:56FromDiscord<Elegantbeef> It's a pointer to the memory that is ensured it's not mutated, and is copied if required
23:20:49FromDiscord<Elegantbeef> Borrowing is memory that is safely reused, ensuring the pointer does not dangle or is not mutate(unless we look at view types 'var T' semantics)
23:22:08FromDiscord<sOkam!> In reply to @Isofruit "For the most part": for me, personally, if thats evidently going to be the case all the time, then calling it manualy all the time becomes a pain
23:22:33FromDiscord<sOkam!> but i hate long verbose code, so it might be more helpful if you are fine with that, or even seek it
23:22:55FromDiscord<Phil> In reply to @sOkam! "for me, personally, if": I'd rather call it manually and see it explicitly in the code then have to remember and have to think that this happens
23:23:14FromDiscord<sOkam!> if you have to remember it, then the usecase is not appropiate
23:23:32FromDiscord<sOkam!> its for those situations (imo at least) where the behavior is extremely obvious
23:23:35FromDiscord<Phil> I want my brain to need to supply as little additional information as possible to understand the code in front of me
23:23:52FromDiscord<Phil> And that excludes pretty much all implicit call stuff
23:24:13FromDiscord<sOkam!> yeah same. but sometimes is obvious and used a lot, so explicit becomes a pain to have to write all the time
23:24:14FromDiscord<Phil> Same reason why I'm not a gigantic fan of Jester's DSL for setting up routes and stuff
23:24:43FromDiscord<sOkam!> if its not obvious, then its not a task for a converter
23:25:41FromDiscord<Phil> Eh, I'll take the writing pain, I've had to deal with worse anyway and the important part in the end is reading, not writing, so I tend to optimize for that.
23:26:20FromDiscord<sOkam!> write/read, same thing. but i see your point
23:26:59FromDiscord<Phil> And I'm not sure I could see any non-obvious thing here for useage.↔In the end you'll see that you're passing type A to a proc that eats type B and you forgot or are unaware that there's a converter for that imported from a different module
23:27:22FromDiscord<sOkam!> for me reading `verboseThingName.NameOfTheThing.ThingToUse` its just as painful to read (or more) than it is to write. Even if autocompletion can make it bearable
23:27:37FromDiscord<Elegantbeef> I think type safety is very important and misusing converters can break that down easil
23:27:41FromDiscord<Elegantbeef> easily even
23:28:15FromDiscord<sOkam!> yeah, which is why i mentioned its helpful for a few cases where its hella obvious and easy to track. if its not obvious, its not for a converter
23:28:40FromDiscord<sOkam!> (imo, ofc)
23:28:59FromDiscord<Phil> In reply to @sOkam! "for me reading `verboseThingName.NameOfTheThing.Thi": Yes-ish, unless I'm writing a sequtils block that beef will dislike me for because it copies a lot, I'd not write that either, I'd split it over 2 lines
23:29:36FromDiscord<sOkam!> oh, you cannot split that example. i was referring to the vulkan style of naming things
23:29:37FromDiscord<Phil> Because if you're having names that long then you need more shorter names
23:29:47FromDiscord<Elegantbeef> The anti-java↔(@Phil)
23:30:02FromDiscord<sOkam!> where the enum and the component both contain what the thing itself is, so its duplicated everywwhere
23:30:33FromDiscord<Phil> In reply to @Elegantbeef "The anti-java (<@180601887916163073>)": Look, java gets a bad rep that is totally unfounded. It's not just a bad language. It also has a borderline insane community !
23:30:57FromDiscord<Phil> The latter is far more egregious to me than java as a language tbh
23:31:49FromDiscord<Phil> Though that one is also quite annoying to deal with, but not as annoying as "Custom-Abstraction-Layer 526 just for parsing JSON and inserting it into a Mongo database"
23:33:59FromDiscord<Phil> In reply to @sOkam! "where the enum and": I don't think I understand that one, if the first 2 lines are just an enum, then couldn't you shorten that with `let myoption = verboseThingName.NameOfTheThing`?
23:34:12FromDiscord<Phil> Basically assign the explicit enum into a variable?
23:35:45FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lY6
23:36:22FromDiscord<Elegantbeef> Ah nice you occasionally use type annotations, then also dont
23:36:48FromDiscord<Phil> I mean, in the upper example I can see what the type is, it's on the right hand side
23:36:53FromDiscord<sa-code> Hey y'all
23:37:04FromDiscord<Phil> In the lower lines I can't infer that without knowing what getPathParams returns
23:37:16FromDiscord<Phil> Cheers
23:37:36FromDiscord<Phil> (edit) "returns" => "returns, and that would mean looking it up, which I dislike"
23:37:48FromDiscord<Phil> I'm not perfect at enforcing that on myself either, but I try
23:40:24FromDiscord<sOkam!> In reply to @Isofruit "I don't think I": in this case it could be something acting on a pure enum↔the thing to notice is how everything is duplicated, and in reality it should be `verbose.thing.use`
23:42:17FromDiscord<sOkam!> verbose code tends to be the opposite of that, and explicit verbose name everything, even if to name `One` you have to say `YouKnowThatNumberThatIsFirstAndWeAlwaysCallOne`↔Overexagerating a crap ton, but i was referring to that in a more normal person way than this silly+harsh example 🙈
23:43:22FromDiscord<sOkam!> if its obvious, and its always a number, and its always called one, just saying `One` should be enough↔which is why i was saying that sometimes converters can be good, in that they make the obvious obvious
23:43:54FromDiscord<sa-code> I'm looking at the aws sdk for cpp - I've heard interop it easy to do but I've never done it before. How would I call this code from nim? https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/examples-s3-objects.html
23:44:49FromDiscord<Elegantbeef> You'd use the `{.importcpp.}` pragma to import the types and procedures you need
23:45:05FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma
23:47:36FromDiscord<demotomohiro> In reply to @sa-code "I'm looking at the": If you want to learn how to call C++ functions from Nim: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma
23:47:59FromDiscord<sa-code> In reply to @Elegantbeef "You'd use the `{.importcpp.}`": Thanks, but the top of that example says `# Horrible example of how to interface with a C++ engine ... ;-)` 😄
23:49:35FromDiscord<sOkam!> @sa-code just a friendly reminder that "easy" in this interoperability context will depend very heavily on your background and experience. its only easy because the interface is simple, but if you don't know what you are doing it won't be easy. so dont feel dumb if you are currently on that side of the learning process
23:51:44FromDiscord<sa-code> Maybe it's too late to not feel dumb.
23:51:50FromDiscord<sOkam!> 🙈
23:52:42FromDiscord<sa-code> I've never used or inter-oped with cpp before and I was sorta using this as a way to learn how to do that