<< 13-01-2023 >>

00:06:38FromDiscord<!!sharpcdf!!> oh yea i guess i could just clear it before im finished with it
00:06:54FromDiscord<!!sharpcdf!!> in my case im running `illwillInit` and `illwillDeinit` several times
00:07:54FromDiscord<!!sharpcdf!!> weird, apparently im doing that already
00:08:37FromDiscord<!!sharpcdf!!> found a fix, had to place the clear in the loop, i was placing it after the loop
00:51:56*fallback quit (Quit: IRCNow and Forever!)
00:59:21FromDiscord<scipio> In reply to @T0lk1en "You guys in this": yup, I also appreciate a lot how helpful people in this Nim Discord are.
00:59:45FromDiscord<Elegantbeef> Except that beef guy, i hear he's a dick
01:00:20FromDiscord<scipio> Nah he's pretty decent too. Does have a sense of humour you need to be open to, and if you are, he's cool
01:01:04FromDiscord<scipio> If he tells you you're a scammer, just agree
01:01:19FromDiscord<Elegantbeef> Sounds like something a scammer would say
01:03:00FromDiscord<Rika> Beef is the most rude person you’d ever find in Canada
01:03:12FromDiscord<Elegantbeef> Sorry about that
01:03:47FromDiscord<Boston> Now did you say it sorry or sorry
01:03:55FromDiscord<scipio> In short, that Beef guy is pretty good. Yeah he's great/ He's like Jordan. Well he's not that good. He can misinterpret you. Or just give a plain wrong answer. He's pretty bad actually. He sucks. Booo @ElegantBeef
01:04:00FromDiscord<scipio> https://media.discordapp.net/attachments/371759389889003532/1063262099247210506/image.png
01:04:09FromDiscord<Elegantbeef> sore-y
01:04:16FromDiscord<Elegantbeef> Not sauri
01:05:05FromDiscord<scipio> Tauri not Sauri
01:05:13FromDiscord<Elegantbeef> We're not yanks we know how to say sorry
01:05:22FromDiscord<Elegantbeef> Nah i dont feel like stargate right now
01:10:46*fallback joined #nim
02:13:10FromDiscord<T0lk1en> Hey guys. I’m trying to take and array that holds data and “split it” in between places and stick new data there.
02:13:41FromDiscord<T0lk1en> Like if I have x = [1, 2, 4, 5]
02:14:16FromDiscord<T0lk1en> How could I make it where x = [1, 2, 9, 4, 5]
02:14:26FromDiscord<Rika> Has to be a sequence
02:14:32FromDiscord<T0lk1en> It is
02:14:52FromDiscord<T0lk1en> But how would I do it
02:14:57FromDiscord<Rika> Ah, sorry, array has a different connotation
02:15:06FromDiscord<T0lk1en> Mm gotcha
02:15:21FromDiscord<T0lk1en> I was just going for “universal programmer standard” syntax
02:15:25FromDiscord<Rika> There’s an insert procedure I believe in sequtils
02:15:34FromDiscord<T0lk1en> Aight lemme check it
02:16:01FromDiscord<Rika> Or maybe it was just in system, I don’t recall anymore
02:16:20FromDiscord<T0lk1en> Found it looks very helpful.
02:16:29FromDiscord<T0lk1en> It’s in system
02:19:09FromDiscord<T0lk1en> In reply to @Rika "There’s an insert procedure": Holy bro. You just made my life 100000 times easier
02:22:39*arkurious quit (Quit: Leaving)
02:27:32FromDiscord<Rika> Nice
02:32:36FromDiscord<T0lk1en> Yo Ik how to make a sequence equal to a string but how do I convert a sequence to a string
02:32:57FromDiscord<pyolyokh> `$theseq`
02:33:16FromDiscord<T0lk1en> Uhh could you give me an example?😅
02:33:22FromDiscord<T0lk1en> Like
02:33:32FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4l2G
02:33:46FromDiscord<T0lk1en> Aight
02:37:08FromDiscord<Rika> Tell us if this isn’t what you wanted lol because there’s two interpretations of what you said
02:47:31*deadmarshal_ quit (Quit: IRCNow and Forever!)
02:54:49FromDiscord<MadScientistCarl> If I debug Nim, can I step into C code?
02:56:02FromDiscord<Rika> Yeah but it won’t be pleasant I believe
02:56:18FromDiscord<MadScientistCarl> I mean if I use a C/C++ library
02:56:25FromDiscord<MadScientistCarl> Can I step into its source?
02:56:46termeryou can
02:56:51termerit won't make much sense to you
02:57:18termeron linux systems, the C cache will be under ~/.cache/nim
02:57:22termernot sure where it would be on windows or another OS
02:57:48FromDiscord<MadScientistCarl> I don't mean the C generated by Nim. I mean step into the C/C++ library
02:58:05termeryou mean interface with one?
02:58:11termerI'm not sure what you mean by stepping into the library
02:58:54FromDiscord<MadScientistCarl> Say I have a `liba.so`. This is an external library written in C, full with debug symbols and source. Now, I use this library in Nim. I would like to step into `liba`'s source, as well
02:59:18FromDiscord<Rika> Sure I think that’s possible
02:59:25FromDiscord<MadScientistCarl> Is it easy?
02:59:47FromDiscord<Rika> GDB has no knowledge that Nim code is Nim code, unless you configure it to
03:03:01FromDiscord<MadScientistCarl> ok
03:08:15FromDiscord<MadScientistCarl> Does nim have offline documentation?
03:09:41*deadmarshal_ joined #nim
03:11:15FromDiscord<Rika> Not sure
03:11:26FromDiscord<Rika> I think you can generate it yourself but I don’t know how
03:11:35*xet7 joined #nim
03:11:44FromDiscord<Rika> And I don’t know if it comes with it already generated either
03:33:18FromDiscord<j-james> try devdocs
03:33:19FromDiscord<j-james> https://devdocs.io/nim/
03:33:37FromDiscord<j-james> it'll let you download them to your indexdb and then work offline
03:34:18FromDiscord<j-james> but i don't believe there's a `rustup docs` equivalent that i know of
05:03:25*rockcavera quit (Ping timeout: 260 seconds)
05:04:41*azimut quit (Ping timeout: 255 seconds)
05:10:52FromDiscord<Girvo> Anyone have any good references to using/managing inline assembly within Nim projects? I have vector instructions I want to use that don't have intrinsics at all (annoyingly). My idea is basically just write a .c/.h file with the inline assembly, and bind that from Nim, but figured I'd ask. (And as an aside, this is in a `--compileOnly` setup, sadly Nim isn't calling the C compiler directly [I hate CMake for this])
05:13:42FromDiscord<pyolyokh> that or <https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma> should work.
05:14:36FromDiscord<Girvo> Oh yeah, I forgot about emit. That would be nicer frankly, unless we desperately need to call this from C as well -- but we've managed to remove _all_ first party C code from the project so adding more makes me sad haha
05:15:26FromDiscord<Girvo> Writing an `intrinsics.nim` module with a heap of emits would work well I reckon. Good call
05:16:18FromDiscord<pyolyokh> oh, there's also <https://nim-lang.org/docs/manual.html#statements-and-expressions-assembler-statement>
05:16:59FromDiscord<Girvo> Now _that_ is what I was looking for! I wonder how it plays with `--compileOnly`? I imagine it's codegen is just inline assembly itself, saving me from having to write that
05:17:02FromDiscord<Girvo> I'll test it out, dope
05:17:04FromDiscord<Girvo> Thanks mate
05:18:46FromDiscord<Girvo> As a complete aside, its still wild to me that the Xtensa LX7 we're using on this is a 24-bit instruction set lol
06:45:05om3gawow, just noticed linter for vscode can lint nim.cfg
06:45:22om3gaaccidentally typed --gc:cmake instead --gc:clang
06:45:37om3gaand it highlighted it
06:46:38om3ganot the "--gc", the "-cc"
06:47:04om3gawhat about musl compiler option? would we have it in future as --cc parameter?
06:47:39FromDiscord<Elegantbeef> perhaps, no clue araq's view on it
06:52:39om3gaI hope he will agree :) only if absence of musl in osx will not cause the problem
06:55:12om3gait can be compiled in osx anyway.. I remember they already had script for it...
07:24:41FromDiscord<jtv> What's the simplest way to test for whether I'm running code compile-time or not?
07:25:26FromDiscord<pyolyokh> <https://nim-lang.org/docs/manual.html#statements-and-expressions-when-nimvm-statement>
07:25:50FromDiscord<jtv> Perfect, thank you.
07:26:50*kenran joined #nim
08:04:07FromDiscord<enthus1ast> yes, all the module docs are in the toolchain folder (when you installed via choosenim)↵eg\: C\:\\Users\\david.choosenim\\toolchains\\nim-1.6.10\\doc\\html\\strutils.html↵(@MadScientistCarl)
08:05:31FromDiscord<enthus1ast> use them all the time while in train (germany has quite a lot dead spots)
08:09:20FromDiscord<christianl> Hi, I need to compile my code with different versions of the nim compiler (1.6 and latest devel). Unfortunately I have quite a lot of BareExcepts in third-party code, which I want to ignore if compiling with latest nim. But if I pass --warning\:BareExcept\:off, nim 1.6 fails with an "error\: unknown warning".↵How should I deal with this? Can I check for the nim version in config.nims somehow? How?↵Thank you.
08:16:18FromDiscord<pyolyokh> hmm, well there is a `NimVersion` constant
08:17:51FromDiscord<Elegantbeef> Yep that's the way to do it
08:18:06FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4l3Q
08:18:14FromDiscord<Elegantbeef> `when (NimMajor, NimMinor) >= (1, 7): ...`
08:18:23FromDiscord<ringabout> There is also a define you can use
08:18:37FromDiscord<Elegantbeef> `nimHasBareExcept` i assume?
08:18:59FromDiscord<ringabout> yeah
08:19:53FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4l3S
08:21:49FromDiscord<christianl> Great, thank you so much!
08:22:48FromDiscord<Elegantbeef> christian sadly matrix reacts do not land to those pesky discord users
08:23:05FromDiscord<Elegantbeef> the version of the bridge t2bot hosts doesnt have it
08:23:32FromDiscord<christianl> Thats not my problem 😜 but the thanks msg should have reached them neverthrless.
08:42:24FromDiscord<ShalokShalom> In reply to @Elegantbeef "perhaps, no clue araq's": Araq just expressed his dislike of replacing glibc
08:44:59*kenran` joined #nim
08:46:29*kenran quit (Ping timeout: 256 seconds)
09:13:52FromDiscord<christianl> Interstingly it is called\: nimHasWarnBareExcept but\: nimHasWarningImpicitTemplateRedefinition 🙈
09:39:44*kenran` quit (Remote host closed the connection)
10:00:51*dv^_^ joined #nim
10:57:42FromDiscord<mratsim> In reply to @Girvo "Anyone have any good": use "asm": https://github.com/mratsim/finite-fields/blob/97e40060cefeb4e2ef5fc5a1c355977caae79674/add_carry.nim#L73-L91
11:02:19FromDiscord<mratsim> and if you need significantly more inline assembly, I have implemented a compile-time macro-based inline assembler for x86 here you can use as inspiration: https://github.com/mratsim/constantine/pull/69
11:26:38*PMunch joined #nim
11:35:43PMunchluteva, what exactly is it that you're trying to achieve with LSP?
11:40:18Amun-Rais there a way to return from iterator early? something like python's raise StopIteration
11:41:17Zevvyou can do just that, I guess
11:41:22Zevvrais something
11:41:34Zevvand put your for in a try:
11:42:19Amun-Rathe iterator has to have raises [] pragma
11:43:07Amun-RaI reversed the logic and it works, but I was just curious
11:43:10FromDiscord<Rika> In reply to @Amun-Ra "is there a way": Return early is only achievable in iterators by hitting the end of the code block
11:43:21FromDiscord<Rika> So break out of your loops
11:44:10Amun-RaI see, thank you
11:45:24PMunchAmun-Ra, you can just return as well..
11:45:34FromDiscord<Rika> You can? I wasn’t aware
11:45:39PMunchOr maybe that's only closure iterators..
11:46:05Amun-RaPMunch: 'return not allowed here'
11:47:09PMunchYeah, apparently that's only allowed for closure iterators for some reason: https://play.nim-lang.org/#ix=4l4D
11:47:30PMunchYou can even have a return without a value
11:48:45PMunchSomething like this works though: https://play.nim-lang.org/#ix=4l4E
11:49:35PMunchOf course in that case you could just break out of the for loop, but this is a more general solution (you could be multiple nested loops deep, or if you have two separate stages of your iterator it still works)
11:52:01Amun-Raah, block, iteresting
12:01:54Amun-Rathat's way better than reversing the logic, thanks PMunch
12:12:13*genpaku quit (Read error: Connection reset by peer)
12:12:50PMunchNo problem, named block/break is a really under-appreciated feature :)
12:12:54*genpaku joined #nim
12:42:53Amun-Ra:>
13:04:35FromDiscord<luteva> In reply to @PMunch "<@954521401073754212>, what exactly is": I want to do "code visualization" and manipulation in a "kind of graph". it is not bound to a special language, so it is nice to be able to start different language servers fpr different programming languages and use them in the same manner (through the language sever protocol).
13:05:10FromDiscord<luteva> (edit) "fpr" => "for"
13:10:57PMunchOoh, cool
13:16:23FromDiscord<luteva> 😄
13:16:46FromDiscord<luteva> (edit) "😄" => "😃"
13:35:51*dnh joined #nim
13:38:57*argonica joined #nim
13:40:16FromDiscord<untoreh> does nim have something to override symbols from an imported C lib?
13:43:52FromDiscord<htac> Is there a way how I can prevent nimZeroMems (which are effectively memsets) from being applied to imported c++ objects? Not only are they unnecessary for classes/structs with a default constructor, they are also destructive since they mess with the internal representation which, for instance, will break std::string's char pointer, as I gather so far...
13:46:39FromDiscord<htac> on Nim's side, iterating over a for loop without indexing will partially fail, in comparison to a for i in 0 ..< loop . At least this seems to happen with my C++ codegen on MSVC
13:48:30FromDiscord<htac> see this e. g.: https://stackoverflow.com/questions/6877281/memset-structure-with-stdstring-contained
13:49:53FromDiscord<auxym> In reply to @untoreh "does nim have something": not sure what you mean by override symbols, but you can name your imported however you want in nim, like `var someVar: cint {.importc: "var_name_in_C"}`
13:50:13FromDiscord<auxym> (edit) "In reply to @untoreh "does nim have something": not sure what you mean by override symbols, but you can name your imported ... however"var_name_in_C".}`" added "symbols" | ""var_name_in_C"}`" => ""var_name_in_C".}`"
13:56:41FromDiscord<htac> I have isolated the issue here in this code snippet: https://discord.com/channels/371759389889003530/371759389889003532/1062700587835195475
14:07:32*PMunch quit (Quit: Leaving)
14:16:22*azimut joined #nim
14:39:59FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4l5a
14:46:26FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4l5d
14:47:29FromDiscord<Rika> "nil" is a pointer with value 0
14:47:39FromDiscord<Rika> What do you mean when you say you want a pointer to 0
14:48:19FromDiscord<pyryrin> in which situations is it better to make a type a tuple rather than an object
14:48:32FromDiscord<Rika> In reply to @pyryrin "in which situations is": When you don’t want to make an object lol
14:48:44FromDiscord<enthus1ast> if you want to return it like this\:↵↵return ("foo", 1337)
14:49:06FromDiscord<pyryrin> i dont see any point for tuples other than multiple return values
14:49:31FromDiscord<enthus1ast> Tuples have unpacking for example
14:50:08FromDiscord<untoreh> In reply to @auxym "not sure what you": I want to override this `g_mmap_limit` but I don't think it's possible unless I recompile it, since it is not externed to C, and I am using leveldb through the `passl` flag↵https://github.com/google/leveldb/blob/fb644cb44539925a7f444b1b0314f402a456c5f4/util/env_posix.cc#L50
14:50:46FromDiscord<4zv4l> In reply to @Rika "What do you mean": I just want NULL, but if `nil` is ok, then sure↵but I still get an error with my mmap and I don't see why↵any argument seems wrong ?
14:50:58FromDiscord<4zv4l> I changed the `fd` to `-1` also
14:51:08FromDiscord<Rika> nil is the same as NULL
14:51:08FromDiscord<4zv4l> `adr = mmap(nil, sizeof payload, PROT_READ or PROT_WRITE or PROT_EXEC, MAP_PRIVATE, -1, 0)`
14:51:13FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4l5e
14:51:37FromDiscord<enthus1ast> this is not possible with objects
14:51:47FromDiscord<Rika> I am not familiar with mmap’s API and I don’t have time to familiarise
14:53:50FromDiscord<4zv4l> well now it works↵I can copy to it but not exec it seems xD
14:53:58FromDiscord<auxym> In reply to @untoreh "I want to override": yeah, if it's not accessible in C, it definitely won't be possible in nim
14:54:56*arkurious joined #nim
15:07:03FromDiscord<4zv4l> it works https://media.discordapp.net/attachments/371759389889003532/1063474262859591830/image.png
15:07:05FromDiscord<4zv4l> happy happy xD
15:13:46FromDiscord<4zv4l> I don't get why `const` array don't have 'addr' for Nim ?
15:15:27FromDiscord<auxym> In reply to @4zv4l "I don't get why": because consts are inlined at compile-time, they don't exist in memory at runtime
15:15:32FromDiscord<ambient> const is part of the program code, thus it won't have a heap address afaik
15:15:58FromDiscord<4zv4l> In reply to @auxym "because consts are inlined": it's in the rodata isn't it ?
15:16:01FromDiscord<4zv4l> just like literal string
15:16:52*dnh quit (Quit: Textual IRC Client: www.textualapp.com)
15:17:37FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4l5y
15:20:50FromDiscord<4zv4l> In reply to @4zv4l "it works": hmmmm, alright so I can't set the array const ?
15:22:14FromDiscord<auxym> wdym?
15:24:38FromDiscord<auxym> you mean use `const` instead of `var` for payload? No, not if you want to use copymem. You can use `let` though for a runtime immutable value
15:26:30FromDiscord<4zv4l> they're all on the stack anyway right ?↵won't push it on the heap ?
15:26:42FromDiscord<4zv4l> since the size is known at compile time
15:28:14FromDiscord<auxym> yes, arrays are always on the stack
15:28:34FromDiscord<auxym> strings, seqs and `ref object`s only go on the heap
15:29:17*argonica quit (Quit: Leaving)
15:29:20FromDiscord<4zv4l> perfect, thank you !
15:42:31*jmdaemon joined #nim
16:09:35*ehmry quit (Ping timeout: 260 seconds)
16:10:50*jmdaemon quit (Ping timeout: 272 seconds)
16:16:31*fallback quit (Remote host closed the connection)
16:23:20*jmdaemon joined #nim
16:23:38FromDiscord<MadScientistCarl> Are there any good editor support for Nim? There isn't one with basic rename supports
16:27:38FromDiscord<hotdog> In reply to @MadScientistCarl "Are there any good": Renaming symbols isn't supported by nimsuggest AFAIK, so you probably won't find any editors that can do it
16:27:57FromDiscord<hotdog> Most widely used editor for Nim is vscode with the nimsaem plugin
16:29:26FromDiscord<hotdog> If you are trying to find all instances of a symbol in a Nim project in order to rename them, Nimgrep (https://nim-lang.org/docs/nimgrep.html) might come in useful as it can search with style insensitivty
16:29:30FromDiscord<hotdog> (edit) "insensitivty" => "insensitivity"
16:29:44FromDiscord<MadScientistCarl> OK, though I don't think this works for renaming object fields
16:30:04FromDiscord<MadScientistCarl> In general, how well is Nim suited for real world programming now?
16:31:51FromDiscord<hotdog> In reply to @MadScientistCarl "OK, though I don't": Object fields are still just nim style insensitive symbols no?
16:31:57*ehmry joined #nim
16:32:47FromDiscord<hotdog> In reply to @MadScientistCarl "In general, how well": Depends what you mean by real world programming. There are several companies using it. The language is good, there's not a huge talent pool if you are hiring for a large company
16:32:49FromDiscord<choltreppe> Is there any kind of `arrayutils` package with all the goodies of `std/sequtils` (that are possible for arrays). I didnt find any on nimble, but maybe I didnt searched correctly
16:33:03FromDiscord<Gumbercules> In reply to @MadScientistCarl "In general, how well": What is real world programming?
16:33:23FromDiscord<Gumbercules> I think this is highly domain dependant
16:33:42FromDiscord<hotdog> sent a code paste, see https://play.nim-lang.org/#ix=4l5U
16:33:53FromDiscord<hotdog> Is there a proc you're trying to use that doesn't work for you with an array?
16:34:08FromDiscord<MadScientistCarl> In reply to @Gumbercules "What is real world": Let's say, writing quick CLI tools. Currently I use Go for this purpose.
16:34:19FromDiscord<Gumbercules> Yes it's ready for that
16:34:25FromDiscord<Gumbercules> And has been for years
16:34:26FromDiscord<hotdog> In reply to @MadScientistCarl "Let's say, writing quick": Nim is great for this. I use it for lots of cli tools myself
16:34:59FromDiscord<Gumbercules> Nim can do most things one would normally lean on language X for
16:34:59FromDiscord<MadScientistCarl> Are there "de facto" libraries for common tasks, like argument parsing, terminal UI, and maybe some GUI?
16:35:11FromDiscord<Gumbercules> Yes yes and yes
16:35:59FromDiscord<Gumbercules> I don't know about defacto - having choices and picking the best tool for the job is generally smiled upon I think.
16:36:16FromDiscord<choltreppe> In reply to @hotdog "From the top of": oh I missed that
16:36:32FromDiscord<MadScientistCarl> Or I should ask "stable and maintained" instead?
16:36:42FromDiscord<Gumbercules> If a Nim option doesn't exist, it's good that Nim has great C interop and not so great C++ interop
16:37:34FromDiscord<Gumbercules> No programming language has great cross platform GUI capabilities outside of C/C++ via qt
16:37:48FromDiscord<Gumbercules> And that's no panacea either
16:37:56FromDiscord<Gumbercules> It's not a programming language problem
16:38:17FromDiscord<MadScientistCarl> I understand that. But what about TUI?
16:38:21FromDiscord<Gumbercules> It's a problem created by operating system developers and their companies
16:38:28FromDiscord<auxym> In reply to @MadScientistCarl "Are there "de facto"": cligen and illwill, probably
16:38:32FromDiscord<Gumbercules> Yes Nim had nimwave for TUI I believe
16:38:47FromDiscord<Gumbercules> That's the most popular TUI lib tmk
16:38:48FromDiscord<auxym> the GUI situation in Nim is not great, IMO, unless you like GTK (gintro)
16:38:54FromDiscord<Gumbercules> It relies on illwill
16:39:25FromDiscord<Gumbercules> Well there are bindings to immediate mode GUI libraries
16:39:36FromDiscord<MadScientistCarl> I tried imgui but it's not statically linked
16:39:43FromDiscord<Gumbercules> Which I feel is the route most people end up going
16:39:47FromDiscord<MadScientistCarl> (I mean in Nim)
16:39:53FromDiscord<Gumbercules> I statically link it in my program
16:40:15FromDiscord<Gumbercules> But I also have my own bindings to most libraries I use
16:40:33FromDiscord<MadScientistCarl> It asks for `cimgui` library, which isn't present on my syste
16:40:38FromDiscord<MadScientistCarl> (edit) "syste" => "system"
16:40:48FromDiscord<Gumbercules> Probably need to build it yourself
16:41:15FromDiscord<Gumbercules> It's just a C99 API around dear imgui
16:41:53FromDiscord<MadScientistCarl> Yeah... every package I look at are like last commit months if not years ago
16:45:26*fallback joined #nim
16:46:17*fallback quit (Client Quit)
16:51:11FromDiscord<Gumbercules> Well if they're wrapping C libraries then they might not need to update that often
16:51:36FromDiscord<Gumbercules> And this is also why I recommend wrapping libraries yourself
16:51:55FromDiscord<Gumbercules> It's not hard. No one wants to be a maintainer of bindings
16:52:07FromDiscord<Gumbercules> (edit) "It's not hard. No one wants to be a maintainer of bindings ... " added "for other people."
16:55:23FromDiscord<enthus1ast> does someone know if the old donation system (salt) is defunct?
16:55:24FromDiscord<enthus1ast> salt / bountysource
17:01:11*jmdaemon quit (Ping timeout: 246 seconds)
17:10:43*jmdaemon joined #nim
17:14:52FromDiscord<pietroppeter> It appears so: https://github.com/nim-lang/website/issues/349
17:16:08FromDiscord<pietroppeter> What’s the official take @narimiran ?
17:17:54*fallback joined #nim
17:22:15FromDiscord<pietroppeter> (There are also issues reported on PayPal broken and BTC address changed)
17:25:37FromDiscord<pyryrin> is there a performance difference between using `func` and `proc`?
17:26:37FromDiscord<m4ul3r> sent a long message, see http://ix.io/4l62
17:27:01FromDiscord<jtv> No, I've mainly been doing import a except doSomething
17:27:07FromDiscord<jtv> You can still call a.doSomething
17:29:04FromDiscord<m4ul3r> i guess it would make sense, since it’s semantically identical to doSomething(a)
17:35:17FromDiscord<ezquerra> sent a long message, see http://ix.io/4l67
17:36:20FromDiscord<MadScientistCarl> Does `std/db_sqlite` actually override `open`? Does that mean I can't open a regular file if I import this?
17:41:09FromDiscord<Phil> In reply to @MadScientistCarl "Does `std/db_sqlite` actually override": It doesn't and that's actually something that can only be done in very, very specific scenarios
17:41:27FromDiscord<MadScientistCarl> OK, I might be confused by the autocompletion
17:41:58FromDiscord<Phil> "Overriding" is the kind of thing that can happen when you have a fitting generic floating around and also an explicit proc, in that scenario the compiler will prefer the explicit proc over the generic
17:42:23FromDiscord<MadScientistCarl> Maybe I should say "shadow" instead of override
17:42:25FromDiscord<Phil> Generally when nim notices you have 2 procs with the same name and the same parameters, it'll throw a compiler error
17:42:48FromDiscord<MadScientistCarl> Ah, so procs can have the same name but different types?
17:43:05FromDiscord<jtv> 100% as long as those types don't conflict
17:43:18FromDiscord<Phil> Yeah, IIRC you can even have the same types and just different parameter names will do, I'd need to look that one up again
17:43:38FromDiscord<jtv> I don't think that's the case
17:43:39FromDiscord<Phil> Don't make use of that feature in particular so I'm flubby on that one
17:46:03om3gaI noticed nim does not like the numbers in fuctions and variable names
17:46:26FromDiscord<jtv> Not as the first character
17:46:31FromDiscord<jtv> No language does, it is ambiguous
17:46:33om3gayes, as last
17:46:58FromDiscord<jtv> Well, I definitely have had numbers at the end of identifiers
17:47:35om3gaI had too, cant remember what exact case it was, but I had troubles with it
17:47:57FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4l6b
17:48:26FromDiscord<jtv> And if you want to quote things, you can put basically anything in an identifier. Like I do a lot of : `let \`someVar?\` = blah` to represent an Option[someVar's type]
17:48:38FromDiscord<jtv> Ugh, discord's quoting sucks
17:48:48FromDiscord<jtv> let \`someVar?` = blah
17:49:25FromDiscord<MadScientistCarl> Ah
17:49:56FromDiscord<jtv> But `let argv0 = getAppName()` works just fine
17:49:58FromDiscord<Phil> sent a code paste, see https://paste.rs/IDx
17:49:59FromDiscord<MadScientistCarl> Wait, that sounds like a terrible idea to have two functions distinguished just on mutability
17:50:16*jmdaemon quit (Ping timeout: 272 seconds)
17:50:22FromDiscord<jtv> Wow, that I really don't like.
17:50:34FromDiscord<MadScientistCarl> How would the compiler actually decide if it is x, or z, or var x?
17:50:39FromDiscord<Phil> The only reason it works is because of the explicit parameter assignment
17:50:41FromDiscord<jtv> Wonder how many times I've written the same function twice without noticing it
17:50:47FromDiscord<jtv> Yeah, the call site
17:51:00FromDiscord<jtv> And which one takes priority if you don't name the call site's variable x or z??
17:51:04FromDiscord<jtv> Yuck
17:51:23FromDiscord<Phil> In reply to @MadScientistCarl "How would the compiler": by saying `print(x = x)` you say "the parameter named x should get the value of the variable x defined in this scope"
17:51:29FromDiscord<Phil> If you don't do this you get a compiler error
17:51:34FromDiscord<Phil> Because the compiler can't know which proc to choose
17:52:03FromDiscord<jtv> That's one of nim's uglier features, wow
17:52:07FromDiscord<Phil> By giving it `print(x=x)` you are revealting to the compiler that you mean a proc with the name "print" that must have only the parameter "x"
17:52:16FromDiscord<Phil> (edit) "revealting" => "revealing"
17:52:19FromDiscord<Phil> So it can figure it out again
17:52:25FromDiscord<Phil> In reply to @jtv "That's one of nim's": Yeah I don't make use of it either
17:53:13FromDiscord<jtv> I think the mutability overload is not great either, per @MadScientistCarl . Plenty of potential for unexpected semantics
17:53:17FromDiscord<Phil> I basically do it the way I've known it from java:↵Allow procs of the same name, as long as they have different types we're gucci
17:53:32FromDiscord<Phil> (edit) "I basically do it the way I've known it from java:↵Allow procs of the same name, as long as they have different types ... we're" added "or different order of types or different numbers of parameters"
17:54:46FromDiscord<Phil> In webdev I managed to get away with not running into issues around procs that do var or not var by just avoiding ref-types, which works for the most part...except for the ORM >_>
17:55:10FromDiscord<MadScientistCarl> And is this documented anywhere?
17:55:44FromDiscord<jtv> Yeah, it all tends to be briefly documented SOMEWHERE, but nothing about the documentation is great for an on-ramp. It's more focused on being a reference
17:55:47FromDiscord<MadScientistCarl> This sounds like something that should _really_ be written in a -nomicon book
17:57:42*rockcavera joined #nim
17:58:43FromDiscord<MadScientistCarl> So how does the compiler dispatch on var vs immutable? What if I have a `var x` and a pair of procedure `f(var x)` and `f(x)`, and I want to treat `x` as immutable because the first one writes to it?
17:59:10FromDiscord<jtv> It's based on the mutability of what you're passing in
17:59:29FromDiscord<jtv> ie, whether you declared it var or (let | const)
17:59:37FromDiscord<MadScientistCarl> Can I turn a `var` into a constant?
17:59:57FromDiscord<jtv> Meaning, change it from mutable to non-mutable??
18:00:00FromDiscord<MadScientistCarl> You know, in Rust I can pass a mutable reference into a shared reference. Like "downgrading" it.
18:00:05FromDiscord<MadScientistCarl> Yes.
18:00:07FromDiscord<jtv> Constant means compile time here
18:00:40FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4l6f
18:01:09FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4l6h
18:02:57FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4l6i
18:03:10FromDiscord<MadScientistCarl> No, that is not what I mean
18:03:14FromDiscord<MadScientistCarl> Let me give an example
18:05:19FromDiscord<MadScientistCarl> sent a code paste, see https://play.nim-lang.org/#ix=4l6m
18:05:28FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4l6n
18:05:35FromDiscord<Phil> Which is what the reassignment does
18:06:09FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4l6n" => "https://play.nim-lang.org/#ix=4l6o"
18:06:35FromDiscord<MadScientistCarl> Would copies be expensive for objects?
18:06:49FromDiscord<MadScientistCarl> Or do they point to the same object?
18:06:51FromDiscord<Phil> Depends on multiple factors, gimme a sec
18:08:03FromDiscord<Phil> Nim distinguishes both ref types and value types.↵If your object is a value type, it'll only be in stack-memory and copying it will be fairly fast.↵If the object itself is massive (say that one object takes up several kilo/megabytes of RAM), that could become a problem when you copy a lot.
18:10:59FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4l6q
18:11:15FromDiscord<MadScientistCarl> Ah, I will go look up muse
18:11:19FromDiscord<MadScientistCarl> (edit) "muse" => "myself"
18:11:57FromDiscord<MadScientistCarl> I see nim by example uses `` in its object definition. Is that like a pointer?
18:12:36FromDiscord<Phil> No, `` always is the export symbol.↵On an object field it means that this field is not private
18:12:45FromDiscord<MadScientistCarl> Oh
18:13:06FromDiscord<Phil> If that object field doesn't have `` and you use that object in another module and try to access that field you'll get a compiler error, without `` it's private
18:33:15FromDiscord<jtv> Generally, I'm told Nim will be pretty lazy about copying, meaning even if your parameter isn't a 'var' parameter, no copy is likely to happen unless you assign
18:42:47FromDiscord<MadScientistCarl> When should I use `ref object` in type declaration?
18:43:42FromDiscord<jtv> That's a matter of style and personal preference to a large degree. The language is smart enough to avoid lots of copying, but many people come from languages where objects have reference semantics by default
18:43:55FromDiscord<<She>Horizon</Her>> Just had an amazing idea for a small game idea :)
18:44:10FromDiscord<MadScientistCarl> If I declare just `type A = object`, I am able to use `ref A` elsewhere. But if I declare `type A = ref object`, can I get otherwise?
18:44:12FromDiscord<<She>Horizon</Her>> Well, programming project
18:44:15FromDiscord<<She>Horizon</Her>> Snake in the terminal
18:44:20FromDiscord<jtv> So if you are used to mutable objects that people hold pointers to, use a ref object
18:44:28FromDiscord<MadScientistCarl> I see
18:45:03FromDiscord<etra> sent a code paste, see https://paste.rs/AOf
18:45:21FromDiscord<jtv> Well, it's clunky to go back and forth between the two explicitly, and it's not something you should need to do commonly., anyway
18:45:23FromDiscord<etra> (edit) "https://play.nim-lang.org/#ix=4l6w" => "https://play.nim-lang.org/#ix=4l6v"
18:45:24FromDiscord<etra> (edit) "https://play.nim-lang.org/#ix=4l6v" => "https://paste.rs/uIa"
18:47:33*jjido joined #nim
18:48:08FromDiscord<MadScientistCarl> How can I store a closure/lambda/etc in a field?
18:48:29FromDiscord<MadScientistCarl> It seems to have syntax error...?
18:49:26FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4l6z
18:49:37FromDiscord<Phil> Basically [] is the dereferencing operator
18:49:45FromDiscord<MadScientistCarl> Ah, OK. Missed that part
18:50:23FromDiscord<Phil> In reply to @MadScientistCarl "How can I store": One sec, do you want to have OOP dynamic dispatch or do you just happen to want to throw a proc into an object?
18:50:34FromDiscord<MadScientistCarl> I want to store a proc into an object
18:50:51FromDiscord<MadScientistCarl> Nim says "first class functions", so I think this should be possible?
18:50:56FromDiscord<Phil> For OOP you can define `method`s, if you're not chasing after the OOP paradigm you can just define a proc-type same as a proc declaration and assign to it
18:51:01FromDiscord<Phil> One sec, let me cook up an example
18:51:19FromDiscord<jtv> It is, I do it all the time. Assignment generally works, but the calling convention is kind of a part of the type
18:51:56FromDiscord<MadScientistCarl> sent a code paste, see https://play.nim-lang.org/#ix=4l6A
18:52:16FromDiscord<jtv> Yes, and there's a module "sugar" to help you write more natural type signatures
18:52:29FromDiscord<<She>Horizon</Her>> sent a code paste, see https://play.nim-lang.org/#ix=4l6B
18:52:50FromDiscord<<She>Horizon</Her>> It'll accept a proc with one parameter with `int`, and a return type of int
18:52:59FromDiscord<<She>Horizon</Her>> Name is irrelevant
18:53:00FromDiscord<MadScientistCarl> sent a code paste, see https://play.nim-lang.org/#ix=4l6C
18:53:03FromDiscord<MadScientistCarl> With sugar
18:53:16FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4l6D
18:53:17FromDiscord<<She>Horizon</Her>> Unsure about that one, don't use the sugar module
18:53:50FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4l6E
18:54:05FromDiscord<jtv> Notice it's expecting a closure there. You can do: `x = myfunc`, but if myfunc is a proper proc, it's not a closure by default, it's a 'nimproc'. Usually the language automatically deals w/ it, but I've run into cases where it does NOT
18:54:11FromDiscord<MadScientistCarl> Is it true that I don't have to include the `std/` part of the import?
18:54:28FromDiscord<<She>Horizon</Her>> Yeah, but I'd say it's better for clarity
18:54:30FromDiscord<Phil> In reply to @MadScientistCarl "Is it true that": It is true, but for clarity of the imports personally I'd recommend using them
18:54:40FromDiscord<Phil> and use `./` for importing from your own project
18:55:05FromDiscord<<She>Horizon</Her>> sent a code paste, see https://play.nim-lang.org/#ix=4l6F
18:55:15FromDiscord<<She>Horizon</Her>> In reply to @Minaaa <3 "If you have multiple": (can also have it on a single line but i prefer this)
18:55:23FromDiscord<Phil> Personally I do `import std/[strutils, sugar]`
18:55:25FromDiscord<jtv> Yeah, I've also seen cases where, for less common modules, I'd get an error w/o the std/
18:56:11FromDiscord<Phil> In reply to @jtv "Yeah, I've also seen": IIRC the std/ thing wasn't there from the start, so comparatively newer modules don't have a non-std link or whatever enables the import behaviour
18:56:52FromDiscord<<She>Horizon</Her>> Does Nim have a way to make fields in types read only, once the object has been initialised?
18:57:56FromDiscord<<She>Horizon</Her>> In reply to @Isofruit "Personally I do `import": Fair, i typically try to annotate the reason for why I'm importing each module though, which is why i prefer spreading it between lines
18:57:59FromDiscord<<She>Horizon</Her>> Helps for refactoring
18:58:01FromDiscord<jtv> No, it lacks a 'once' type capability for fields and functions both. 'let' is kind of like that for variables.
18:58:24FromDiscord<Phil> In reply to @Minaaa <3 "Fair, i typically try": Actually a solid idea, "import comments" in a sense
18:58:47FromDiscord<Phil> In reply to @jtv "No, it lacks a": I'd argue that it kind of does by keeping fields private
18:58:56FromDiscord<Phil> Assuming you don't provide procs that can mutate the field
18:59:10FromDiscord<<She>Horizon</Her>> In reply to @jtv "No, it lacks a": Sad, i wonder if a macro could be made for this?
18:59:24FromDiscord<<She>Horizon</Her>> It'd just mark the field as private but have an accessor proc
18:59:35FromDiscord<jtv> Yeah, of course. I do find the whole oberon-style visibility a bit inflexible, unobvious and clunky 🙂
18:59:54FromDiscord<Phil> In reply to @Minaaa <3 "It'd just mark the": You'd need to code in the logic under which access is acceptable and when not
18:59:59FromDiscord<Phil> Which can be ugly to read
19:00:00FromDiscord<<She>Horizon</Her>> In reply to @Isofruit "Actually a solid idea,": Yep! I have many bad habits, better to at least try to make it clear xD
19:00:03FromDiscord<gibson> I decided to ask on the forum instead, since it was big. But my question is↵> How do you use Nim to incrementally convert a C or C++ project with the least friction?↵https://forum.nim-lang.org/t/9820#64780
19:00:28FromDiscord<Phil> And you'd need to accept that you can only notice those access violations at runtime
19:00:56FromDiscord<MadScientistCarl> I wonder if you can do program analysis in macros
19:01:00FromDiscord<<She>Horizon</Her>> In reply to @Isofruit "You'd need to code": Write context lock could be similar to what importutils do, maybe? And read access should be everywhere
19:01:26FromDiscord<<She>Horizon</Her>> In reply to @Isofruit "And you'd need to": That's not a bad thing, is it? Plus, `-d:danger` exists for the brave who'd want to turn them off haha
19:01:33FromDiscord<Phil> In reply to @MadScientistCarl "I wonder if you": What kind of analysis do you want to do?
19:01:59FromDiscord<MadScientistCarl> Nope, just commenting if it is possible to use macro to implement the initialize-once thing
19:02:20FromDiscord<Phil> Because I used compile-time procs to do e.g. a fair bit of compile-time validation for an ORM whether an attempt to query a many-to-many relationship was valid or not
19:02:22FromDiscord<MadScientistCarl> I guess you can use getters and private fields...
19:02:30FromDiscord<jtv> I mean, for function calls yes, easily
19:02:35FromDiscord<jtv> And I have a macro like that
19:02:51FromDiscord<jtv> But I don't see how you would do it for arbitrary fields.
19:03:03FromDiscord<jtv> Not saying there isn't a way, I'm a relative nim newbie too
19:03:08FromDiscord<Phil> In reply to @Minaaa <3 "That's not a bad": Imo runtime errors are bad always and ever and should be avoided, the thing is that very often they can't be avoided
19:03:52FromDiscord<Phil> In order of badness from least to worst:↵Compile time error > Startup error > Runtime error↵I'll eat any of the first 2 happily, runtime errors I dislike with a passion because they have the capacity to be some of the most annoying assholes this side of the sun
19:03:52FromDiscord<<She>Horizon</Her>> Don't things like seqs have runtime checking?
19:04:14FromDiscord<<She>Horizon</Her>> And it's possible to turn it off with the danger flag?
19:04:33FromDiscord<Phil> Ah, that's separate from my gripe with runtime errors
19:04:41FromDiscord<Phil> And yeah they do, basically they do overflow checking IIRC
19:04:48FromDiscord<Phil> Actually, I might as well try this out
19:04:52FromDiscord<jtv> Yeah they do
19:05:13FromDiscord<<She>Horizon</Her>> In reply to @Isofruit "Ah, that's separate from": Also, why couldn't you make it a compile time error with some hacking?
19:05:14FromDiscord<jtv> That's pretty unavoidable unless you like crashes. You certainly cannot detect arbitrary array index errors statically
19:05:46FromDiscord<jtv> There will be programs where such an analysis cannot give an accurate result
19:05:53FromDiscord<<She>Horizon</Her>> Hm fair
19:06:30FromDiscord<MadScientistCarl> Can I not do `./[a, b]`? I get error saying file not found
19:06:40FromDiscord<jtv> No, that you cannot do
19:06:43FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4l6J
19:07:23FromDiscord<<She>Horizon</Her>> Is that still not fixed in Nim 2.0?
19:07:27FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4l6J" => "https://play.nim-lang.org/#ix=4l6K"
19:07:32FromDiscord<<She>Horizon</Her>> I remember that irritated me so much xD
19:07:34FromDiscord<Phil> The thing that it crashes at runtime for overflow?
19:07:43FromDiscord<<She>Horizon</Her>> No the `.` with multiple imports
19:07:51FromDiscord<jtv> Well it might be in 2.0
19:08:03FromDiscord<<She>Horizon</Her>> In reply to @MadScientistCarl "Can I not do": You could do `"."` instead of `.`?
19:08:12FromDiscord<<She>Horizon</Her>> That seems to work for me
19:08:13FromDiscord<Phil> I'm on `1.9.1`, I wouldn't get my hopesup
19:08:17FromDiscord<<She>Horizon</Her>> Even if it feels gross
19:08:24FromDiscord<jtv> There have been so many changes and so many mem management issues I have stopped trying to keep my code working in both places until 2.0 stabilizes
19:08:34FromDiscord<<She>Horizon</Her>> sent a code paste, see https://play.nim-lang.org/#ix=4l6M
19:08:45FromDiscord<<She>Horizon</Her>> In reply to @jtv "There have been so": Totally understandable, probably a pain lol
19:08:55FromDiscord<Phil> Ohhh wait, you don't mean import for std lib like that but imports of your own stuff like that?
19:08:56FromDiscord<Phil> one sec
19:09:05FromDiscord<<She>Horizon</Her>> Yep
19:09:17FromDiscord<Phil> Nope, still crashes on 1.9.1
19:09:24FromDiscord<<She>Horizon</Her>> Could hack into dot operators possibly?
19:09:31FromDiscord<<She>Horizon</Her>> But that's probably way less than ideal
19:09:38FromDiscord<<She>Horizon</Her>> Not probably, definitely lmao
19:09:54FromDiscord<MadScientistCarl> Isn't nim's latest version like 1.6?
19:10:02FromDiscord<Phil> In reply to @MadScientistCarl "Isn't nim's latest version": I'm on the devel branch of the compiler
19:10:05FromDiscord<<She>Horizon</Her>> In reply to @MadScientistCarl "Isn't nim's latest version": That's latest stable
19:10:13FromDiscord<Phil> 1.6.10 is basically official releases
19:10:19FromDiscord<MadScientistCarl> OK
19:10:24*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
19:10:30FromDiscord<Phil> Being on the devel compiler is like being on arch
19:10:33FromDiscord<Phil> (edit) "Being on the devel compiler is like being on arch ... " added "linux"
19:10:53FromDiscord<MadScientistCarl> Arch is actually fine
19:10:55FromDiscord<Phil> Except that arch has been somewhat more stable for me than the compiler 😛
19:11:27FromDiscord<jtv> I still use 1.6.10 yes
19:11:30FromDiscord<Phil> Yeh, most of the time, has some oddities like that application behaviour gets wonky after updates sometimes but nothing a good reboot can't fix
19:12:09FromDiscord<MadScientistCarl> Hmmm, can I do `import ./a/[b,c,d]`?
19:12:21FromDiscord<Phil> Yes
19:13:08FromDiscord<Phil> Example of this kind of thing from my own application:↵`import ../utils/[jwtContext, customResponses, errorResponses, databaseUtils]`
19:13:26FromDiscord<MadScientistCarl> Do folders have any meaning for Nim?
19:13:53FromDiscord<Phil> they are part of the path.↵"utils" in my example is a folder for example
19:14:11FromDiscord<Phil> Beyond that, not really
19:14:14FromDiscord<MadScientistCarl> So there is no `init.py` or `mod.rs` equivalent?
19:14:27FromDiscord<jtv> No 😦
19:14:51FromDiscord<Phil> Not enforced in any meaningful way.↵You can abide by that pattern yourself but it's not going to be as pretty
19:14:51FromDiscord<jtv> People basically tend to write newMyType() functions that instantiate and do initialization
19:15:10FromDiscord<Phil> In reply to @jtv "People basically tend to": I would like to very explicitly and strongly point out I use constructor
19:15:22FromDiscord<jtv> You're finding a lot of warts fast tho 🙂
19:15:46FromDiscord<Phil> Because there is no way in the seven hells I'm writing constructor procs myself for 60+ model object types
19:16:07FromDiscord<Phil> Ain't nobody got time for that but beef's macro code that generates those procs for me
19:17:28FromDiscord<Phil> https://github.com/beef331/constructor For those not aware of it yet
19:18:31FromDiscord<Phil> Nim has a way to default initialize object in nim2.0, which is a pretty cool feature all things considered, but it still breaks for my very specific usecase so I'm still using constructor
19:19:00FromDiscord<Phil> That specific usecase being I have a distinct type of `DateTime`, if you don't have that you're good
19:28:59FromDiscord<<She>Horizon</Her>> ~~I should comment everything i do in my conlang now~~
19:29:01FromDiscord<<She>Horizon</Her>> Oh my god that'd actually be kinda funny
19:29:16FromDiscord<Phil> conlang?
19:29:37FromDiscord<<She>Horizon</Her>> Constructed language
19:29:46FromDiscord<<She>Horizon</Her>> Basically a language I've thought up and stuff
19:29:56FromDiscord<<She>Horizon</Her>> With its own quirks and such
19:30:05FromDiscord<<She>Horizon</Her>> (Spoken language, btw)
19:30:10FromDiscord<<She>Horizon</Her>> (Like English and others)
19:31:49FromDiscord<MadScientistCarl> Is there a Nim formatter?
19:32:35FromDiscord<<She>Horizon</Her>> `nimpretty` but uh, from experience it's a wee bit broken
19:32:40FromDiscord<jtv> Yeah, it sucks
19:33:02FromDiscord<jtv> I stopped using it, I hate the formatting it does, and it's almost entirely NON configurable
19:33:30FromDiscord<jtv> It's crazy there isn't something better considering how w/ Nim it's easy to parse Nim 🙂
19:33:51FromDiscord<MadScientistCarl> I wish every language has an LSP as good as Go's
19:33:58FromDiscord<<She>Horizon</Her>> sent a code paste, see https://play.nim-lang.org/#ix=4l6S
19:34:05FromDiscord<<She>Horizon</Her>> It keeps indenting it iirc
19:34:23FromDiscord<<She>Horizon</Her>> Did when i used it at least, let me check if it's still the case
19:34:42FromDiscord<jtv> Yeah, I've had some weird fights with it. Now as I go through old code I just manually format and wait until the day that I crack and write my own
19:35:34FromDiscord<<She>Horizon</Her>> Hm not an issue anymore
19:35:42FromDiscord<<She>Horizon</Her>> In reply to @jtv "Yeah, I've had some": Pfff fair
19:36:31FromDiscord<jtv> I had one file where it wouldn't respect my indent choice, full stop, no matter what almost. No clear reason why
19:36:43FromDiscord<jtv> And that's like the ONE thing you can configure
19:38:50FromDiscord<jos> is there a stable/popular image loading library in pure nim?
19:39:49FromDiscord<<She>Horizon</Her>> In reply to @jtv "I had one file": Yeah that's what i had the issue with, no idea why xD
19:39:56FromDiscord<<She>Horizon</Her>> In reply to @jos "is there a stable/popular": I think it's called Pixi?
19:41:22FromDiscord<tfp> interesting
19:41:23FromDiscord<tfp> pixie looks cool
19:41:41FromDiscord<tfp> kind of overkill for just loading images but the other features look useful too
19:42:29FromDiscord<MadScientistCarl> How do I take the object out of a `distinct` type?
19:43:19FromDiscord<<She>Horizon</Her>> In reply to @MadScientistCarl "How do I take": You can just cast it to the original
19:43:29FromDiscord<<She>Horizon</Her>> So `myDistinct.OriginalType`
19:43:40FromDiscord<<She>Horizon</Her>> Can also do `OriginalType(myDistinct)`
19:43:53FromDiscord<<She>Horizon</Her>> Or even `OriginalType myDistinct`
19:44:00FromDiscord<<She>Horizon</Her>> I prefer the first though for most situations
19:44:01FromDiscord<MadScientistCarl> Oh OK
19:50:05FromDiscord<Phil> In reply to @MadScientistCarl "Oh OK": That is basically type-casting, it works in an identical capacity when e.g. casting int32 to int64 or vice versa
19:51:30FromDiscord<MadScientistCarl> Hmm, the borrow pragma doesn't seem to work for comparison
19:53:11FromDiscord<Phil> Does for me for the most time, can you provide a minimal example?
19:54:30FromDiscord<MadScientistCarl> sent a code paste, see https://play.nim-lang.org/#ix=4l72
19:57:57ZevvThe operator is `<`
19:58:05Zevvthe others are derived from that
19:59:06FromDiscord<MadScientistCarl> OK
19:59:09Zevvyou need to borrow `<` and `<=`, you will get `>` and `>=` for free
19:59:16FromDiscord<MadScientistCarl> Yeah, it works
19:59:16Zevvthe manual might not be explicit on that I think
20:00:02FromDiscord<Phil> Yeah that is the kind of implicit gotcha that I typically cuss out java for
20:17:41*krux02_ quit (Remote host closed the connection)
21:02:42FromDiscord<pyolyokh> the manual mentions that >= are templates (system/comparisons), but doesn't mention that the borrow pragma cares either way, and the error I don't get at all in this case.
21:04:16FromDiscord<pyolyokh> I think it should at least suggest that templating is a problem, and at best should have a list of system/comparisons templates that people are wont to borrow and give the advice above about them
21:05:00FromDiscord<Elegantbeef> I mean that specialisation doesnt make any sense
21:05:11FromDiscord<Elegantbeef> Cause the compiler doesnt have that information presently 😄
21:05:38FromDiscord<Elegantbeef> Borrowing is done quite simply which results in a lacking diagnostic
21:06:39FromDiscord<tfp> i can't figure out how to make something an iterator
21:06:47FromDiscord<tfp> like i want my type to be an iterator
21:06:49FromDiscord<tfp> so i can do
21:06:55FromDiscord<tfp> var my_type = MyType()
21:06:59FromDiscord<tfp> for x in my_type
21:07:03FromDiscord<tfp> what am i missing
21:07:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4l7l
21:07:11FromDiscord<Elegantbeef> implement `items`
21:07:29FromDiscord<tfp> ty
21:07:33FromDiscord<Elegantbeef> `iterator items(myType: MyType): YieldedType =...`
21:14:42*junaid_ joined #nim
21:26:54*junaid_ quit (Remote host closed the connection)
21:30:36*arkanoid joined #nim
21:31:25FromDiscord<tfp> that worked
21:33:19FromDiscord<Elegantbeef> I do enjoy the confirmation of my Nim knowledge
21:33:41FromDiscord<Elegantbeef> Would be funny if I couldnt walk someone through writing an items iterator
21:35:22FromDiscord<pyolyokh> you'd hear about that a year later in a presentation in some big conference,↵"Why did I leave Nim? It's just too hard of a language. Even Elegantbeef can't get iterators right."
21:41:43arkanoidI'm refactoring my multithreading app built with weave. I want to turn all the ptr arguments I'm passing to threaded funcs into a single ptr container object that brings the original fields. Basically something like this https://play.nim-lang.org/#ix=4l7v . Problem is that this little change goes SIGSEGV and I don't know why. What's the difference?
21:42:21FromDiscord<Elegantbeef> How are you allocating?
21:42:41arkanoidI've not changed how I run the thread. Just created a wrapper object type, filled with original non-ref and non-ptr values, and passed container.unsafeAddr instead
21:42:57FromDiscord<Elegantbeef> So you're passing a stack value
21:43:22arkanoidElegantbeef, yes
21:43:34FromDiscord<Elegantbeef> Well that's wrong
21:44:33arkanoidwhy?
21:44:38FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4l7z
21:44:39FromDiscord<4zv4l> like abstraction interface
21:44:56arkanoidthe threading function is ending before the launching function goes out of scope
21:45:28FromDiscord<Elegantbeef> You should technically be capable of accessing another thread's stack, it's just generally considred incorrect
21:46:14FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4l7A
21:46:34FromDiscord<Elegantbeef> Yea without more code that demonstrates the issue i cannot say much
21:50:29FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4l7B
21:50:40FromDiscord<4zv4l> (edit) "https://play.nim-lang.org/#ix=4l7B" => "https://play.nim-lang.org/#ix=4l7C"
21:50:56FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4l7D
21:53:26FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4l7G
21:53:26FromDiscord<4zv4l> sounds good too !
21:54:14FromDiscord<tfp> hmm i'm having trouble binding nim w/rust in a new scenario
21:54:41arkanoidElegantbeef: here's a slightly longer example of what I've changed in my application https://play.nim-lang.org/#ix=4l7H
21:55:01FromDiscord<tfp> i think my issue is that i'm not importc'ing the object-- since i don't have a c struct for my rust structs, i'm not sure how to make it work
21:55:18FromDiscord<tfp> like there's no header file to importc from
21:55:25arkanoidthe original (unwrapped, aka multi-arg threading function) works nicely, I've just added a container
21:55:28FromDiscord<tfp> the layout should be the same otherwise, but i'm getting invalid access
21:56:54arkanoidtfp, I don't know how rust packs it's objects, but nim requires packed pragma to avoid optimizing away with internal logic https://nim-lang.org/docs/manual.html#foreign-function-interface-packed-pragma
21:57:57FromDiscord<4zv4l> In reply to @jos "hmm i'm having trouble": you're interfacing with rust source code or with rust object file/dyn lib ?
21:58:03FromDiscord<tfp> rust static lib
21:58:10FromDiscord<Elegantbeef> Unless you need to access fields directly a `type MyObject = ptr object` is ideal
21:58:13FromDiscord<tfp> In reply to @arkanoid "tfp, I don't know": is there a way to print the layout too? i can print it in rust
21:58:25FromDiscord<tfp> if i can compare then i can probably figure it out
21:58:52FromDiscord<4zv4l> In reply to @jos "i think my issue": does nim has keyword for different type of struct ? like packed struct ?
21:59:05FromDiscord<tfp> there's the packed pragma that arkanoid mentioned
21:59:12FromDiscord<tfp> i've tried it before though
21:59:14FromDiscord<tfp> it didn't fix my issue
21:59:16FromDiscord<Elegantbeef> I swear some people dont read
21:59:29FromDiscord<Elegantbeef> Both Rust and Nim would need the packed annotation
21:59:34FromDiscord<tfp> i just wanna inspect the nim layout but i can't find a way to do it
21:59:55FromDiscord<tfp> the rust struct is using a lib called abi_stable that should guarantee a stable layout
22:00:34arkanoidtfp, print the object size and object position in memory, and find out?
22:01:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4l7M
22:01:20FromDiscord<tfp> In reply to @arkanoid "tfp, print the object": i already checked the size and it's the same
22:01:27FromDiscord<tfp> sent a code paste, see https://play.nim-lang.org/#ix=4l7N
22:01:28FromDiscord<tfp> nim is so cool
22:01:33FromDiscord<tfp> i wish nim and rust had a baby
22:01:55FromDiscord<Elegantbeef> I mean Nim is basically a less invasive rust
22:01:55arkanoidplease, no. I wish nim eats rust as a whole
22:02:42FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4l7O
22:03:01FromDiscord<4zv4l> offset shows the 'index' of the field ?↵how does it show that
22:03:04FromDiscord<Elegantbeef> Offset gives you the offset from the start of the objet
22:03:10FromDiscord<Elegantbeef> addr gives you a pointer
22:03:23FromDiscord<Elegantbeef> The compiler knows the offset of the fields
22:03:34FromDiscord<Elegantbeef> Ah sorry the above wont work
22:04:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4l7P
22:04:51FromDiscord<Elegantbeef> That should work
22:04:54FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4l7Q
22:05:05FromDiscord<Elegantbeef> Likely not, but yes
22:05:10FromDiscord<Elegantbeef> That's the idea
22:05:22FromDiscord<4zv4l> for packed struct that's how it is supposed to be right ?
22:05:23FromDiscord<Elegantbeef> `type Test {.packed.} = object` would mean yes
22:05:33FromDiscord<4zv4l> okok alright
22:06:32FromDiscord<Elegantbeef> Arkanoid did that code you sent segfault?
22:06:34FromDiscord<Elegantbeef> It works fine here
22:07:12FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4l7R
22:07:41FromDiscord<Elegantbeef> It takes in a typed expression which in this case is `myObject.fieldName` grabs the field symbol then gets the offset of it
22:07:48arkanoidElegantbeef, surely not that code, I've represented just the change I've made logically to my code. Sadly to replicate exactly what happening I would need some libs installed in play.nim
22:08:37FromDiscord<Elegantbeef> Well i dont care about nim playground
22:08:41FromDiscord<Elegantbeef> I'm running the code locally to reproduce
22:09:36arkanoidElegantbeef, btw it was just a curiosity, as I can workaround this problem easily by using the previous pattern: https://play.nim-lang.org/#ix=4l7T
22:10:02FromDiscord<4zv4l> In reply to @Elegantbeef "It takes in a": `a[^1]` is used for what ? why not use `a` ?
22:10:04FromDiscord<Elegantbeef> I still say not using the heap is a sin 😛
22:10:24FromDiscord<MadScientistCarl> sent a code paste, see https://play.nim-lang.org/#ix=4l7V
22:10:34FromDiscord<Elegantbeef> > Returns the same result as system.offsetof if the offset is known by the Nim compiler. It expects a resolved symbol node from a field of a type.
22:11:00FromDiscord<Elegantbeef> `a` is a `dotExpr(myObject, fieldName)` `[^1]` gets `fieldName`
22:11:16arkanoidI don't the the issue with using ptr to stack allocated stuff. It compiles with arc and runs fine
22:11:45FromDiscord<Elegantbeef> You could check by using `nim doc`↵(@MadScientistCarl)
22:11:53FromDiscord<4zv4l> makes more sense, thanks
22:11:54arkanoidI'm not saying I am right, just don't know which foot I am hammering
22:12:26FromDiscord<Elegantbeef> I mean it's technically safe what you're doing
22:13:04FromDiscord<Elegantbeef> Taking an address to the stack is just always iffy cause it's so easy to fuck up
22:13:07*ltriant quit (Ping timeout: 252 seconds)
22:15:00arkanoidI've avoided system level programming languages for years, so I fear I have a long list of bullets to shoot in my leg left
22:15:39arkanoidI'm googling "why I should not pass references to stack allocated structs)
22:16:54FromDiscord<Elegantbeef> The reason is quite simple, there is no static analysis in Nim to ensure your usage does not outlive the allocation
22:16:57FromDiscord<ShalokShalom> ~ just don't know which foot I am hammering ~
22:17:04FromDiscord<pyolyokh> the #1 issue is that you have to ensure that your references don't live longer than the data on the stack does. Function returns? Its stack is invalid. Thread dies? Its stack is invalid.
22:17:05FromDiscord<ShalokShalom> sounds like a nice slogan
22:17:07FromDiscord<Elegantbeef> If you validate that then you know it's safe
22:17:11FromDiscord<ShalokShalom> should put this on my wall 😄
22:17:39FromDiscord<MadScientistCarl> Is it safe to use `ref Type` as table keys?
22:17:48FromDiscord<Elegantbeef> Yes
22:17:50FromDiscord<MadScientistCarl> Does it actually hash the object or does it use the address?
22:18:05FromDiscord<Elegantbeef> you need `-d:nimPreviewHashRef`
22:18:25FromDiscord<Elegantbeef> It hashes the pointer
22:18:25FromDiscord<Elegantbeef> `hash` should work the same as `==`
22:19:42FromDiscord<MadScientistCarl> Can I think of `Table` to be comparing structurally and `TableRef` to be comparing the same object?
22:19:53FromDiscord<Elegantbeef> No
22:20:03FromDiscord<Elegantbeef> `TableRef` is a reference table
22:20:15FromDiscord<Elegantbeef> It's the same as `Table` but has reference semantics on the actual table
22:20:17FromDiscord<MadScientistCarl> Oh, so it refs the table itself
22:23:26FromDiscord<MadScientistCarl> If I am not using `ref` types anywhere, would Nim actually copy a big struct all over the place? Or is the compiler smarter and does not actually do that?
22:23:49FromDiscord<Elegantbeef> Big objects are passed by reference
22:24:09FromDiscord<Elegantbeef> Copies can happen depending on the mm you're using
22:24:18FromDiscord<MadScientistCarl> Even if I do not define them as `ref object`?
22:24:20FromDiscord<Elegantbeef> Arc/Orc have move semantics so if a copy can be avoided it'll move memory
22:24:28FromDiscord<MadScientistCarl> Hmm, is Orc a 2.0 thing?
22:24:33FromDiscord<Elegantbeef> Nope
22:24:46FromDiscord<pyolyokh> the 2.0 thing is that they become the default
22:25:06FromDiscord<Elegantbeef> Nim passes by reference `seq` `string` and objects larger than 24bytes afaik
22:25:12FromDiscord<MadScientistCarl> OK
22:25:18FromDiscord<Elegantbeef> Or any object annotated with `{.byRef.}`
22:25:21FromDiscord<MadScientistCarl> Hmm, how do I enable ORC in nimble?
22:25:36FromDiscord<Elegantbeef> make a `config.nims` and `--mm:orc`
22:25:43FromDiscord<cow> In reply to @MadScientistCarl "Even if I do": don't `ref object`s never get copied, as they're only a pointer to the heap?
22:25:53FromDiscord<MadScientistCarl> I should probably really go understand the reference semantics of Nim
22:26:05FromDiscord<Elegantbeef> I mean reference semantics are just pointer semantics
22:26:10FromDiscord<MadScientistCarl> In reply to @cow "don't `ref object`s never": I think so? I am asking about `type A = object` situation
22:26:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4l7X
22:26:47FromDiscord<Elegantbeef> That's all there is to references
22:27:12FromDiscord<Elegantbeef> They're heap allocated data types that can form many to one relationships
22:27:13FromDiscord<Elegantbeef> There's nothing else really special
22:27:25FromDiscord<MadScientistCarl> I know this
22:27:58FromDiscord<MadScientistCarl> I was asking whether Nim is smart enough to not copy a big struct defined _NOT_ as `ref object` if it is not being modified
22:28:19FromDiscord<Elegantbeef> Like i said it depends on MM for assignment
22:28:29FromDiscord<Elegantbeef> For procedures large objects are passed by reference
22:28:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4l7Y
22:29:04FromDiscord<Elegantbeef> But in arc/orc that might not be if `someLargeObject` isnt used after the usage of `a`
22:29:06FromDiscord<MadScientistCarl> OK
22:29:15FromDiscord<Elegantbeef> If you're concerned about copies with objects you can disable the copy hook
22:29:27FromDiscord<MadScientistCarl> I see
22:29:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4l7Z
22:29:52FromDiscord<MadScientistCarl> Is there a difference between `--mm` and `--gc`?
22:29:53FromDiscord<Elegantbeef> That disables copies for your type
22:29:55FromDiscord<MadScientistCarl> Ah
22:30:14FromDiscord<Elegantbeef> No
22:30:47FromDiscord<Elegantbeef> The thing with arc/orc is you need to actually look at the code to understand if Nim will move resources
22:30:59FromDiscord<Elegantbeef> There's also cursor annotations
22:31:08FromDiscord<Elegantbeef> Which is like a weak reference in C++
22:31:33FromDiscord<MadScientistCarl> OK... I will not touch `--mm` unless I have a problem with performance
22:31:46FromDiscord<Elegantbeef> I mean Orc/Arc are just better than refc
22:32:08FromDiscord<MadScientistCarl> I see it's going to be default?
22:32:16FromDiscord<pyolyokh> that's the 2.0 thing, yes.
22:32:36FromDiscord<cow> 2.0 will bring in all the (potentially) backwards compat breaking pending changes
22:34:18FromDiscord<MadScientistCarl> I am so new to the language that this is completely not an issue for me
22:35:38*jjido joined #nim
22:36:24*xet7 quit (Remote host closed the connection)
22:38:04FromDiscord<MadScientistCarl> Hmm, can I not have cyclic imports?
22:38:39FromDiscord<Elegantbeef> You need to delay imports to have cyclical
22:38:46FromDiscord<Elegantbeef> So it's a bit complicated and generally not what you want
22:40:08FromDiscord<Elegantbeef> https://wandbox.org/permlink/ZzgEjgKLfPNRHeK8
22:40:43FromDiscord<Elegantbeef> an example of it here
22:42:23FromDiscord<MadScientistCarl> Looks like I can't have mutually defined types either
22:42:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4l82
22:44:37FromDiscord<MadScientistCarl> Ah, OK. They have to be in the same type block
22:53:47FromDiscord<Elegantbeef> There is a plan to make it so both delayed imports and using the same typeblock are not required sometime in Nim 2.x
23:09:25*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
23:18:17arkanoidhow can I create a ref bool? Do I need to create an alias type?
23:18:28FromDiscord<Elegantbeef> `new bool`
23:19:11arkanoidthanks
23:19:47arkanoidbut how to set it to true or false?
23:20:05FromDiscord<pyolyokh> `b[] = true`
23:20:23arkanoidmakes sense
23:31:09FromDiscord<MadScientistCarl> How do I make a reference out of an existing object?
23:31:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4l8i
23:31:44FromDiscord<Elegantbeef> You cannot raise a non ref to a ref
23:31:48FromDiscord<Elegantbeef> You need to allocate then copy
23:31:53FromDiscord<MadScientistCarl> Not this, but the other way around
23:32:08FromDiscord<MadScientistCarl> Oh, is it not possible?
23:32:10FromDiscord<Elegantbeef> `var myNonRef = myRef[]`
23:32:32FromDiscord<Elegantbeef> Nim's `ref` is a automatically managed heap allocated type
23:32:41FromDiscord<MadScientistCarl> sent a code paste, see https://play.nim-lang.org/#ix=4l8j
23:32:55FromDiscord<Elegantbeef> You mean how do you take the address of a value
23:33:00FromDiscord<Elegantbeef> `addr` or `unsafeaddr`
23:33:03FromDiscord<Elegantbeef> That gives you a `ptr T`
23:33:18FromDiscord<Elegantbeef> not a `ref` since Nim's ref is as i said memory safe
23:33:30FromDiscord<MadScientistCarl> OK...
23:43:43FromDiscord<<She>Horizon</Her>> In reply to @Elegantbeef "You need to delay": I still stand by the fact that true cyclic imports would be nice but i can see issues because, this ain't class based like Java for example, where all the code is contained nicely in some class/function
23:43:55FromDiscord<<She>Horizon</Her>> Though it could still be done i the
23:43:57FromDiscord<<She>Horizon</Her>> Think
23:44:03FromDiscord<<She>Horizon</Her>> In reply to @Elegantbeef "There is a plan": Oh that's epic
23:44:09FromDiscord<Elegantbeef> As i said it's planned for 2.x
23:44:31FromDiscord<MadScientistCarl> Now I wonder, should I use methods or should I store `proc` as a member
23:44:40FromDiscord<Elegantbeef> Depends what you need
23:44:42FromDiscord<Elegantbeef> Or want
23:44:51FromDiscord<<She>Horizon</Her>> sent a code paste, see https://play.nim-lang.org/#ix=4l8n
23:45:01FromDiscord<huantian> sent a code paste, see https://paste.rs/RXo
23:45:19FromDiscord<MadScientistCarl> No, that is making another copy of the object
23:45:23FromDiscord<Elegantbeef> Of course you cannot if `myOtherObj` is a value↵(@<She>Horizon</Her>)
23:45:36FromDiscord<<She>Horizon</Her>> Ah
23:45:52FromDiscord<ShalokShalom> how is your java backend going? 🙂
23:45:55FromDiscord<<She>Horizon</Her>> But you could do `(ref MyObj)()` or something?
23:46:03FromDiscord<Elegantbeef> Yes
23:46:07FromDiscord<<She>Horizon</Her>> In reply to @ShalokShalom "how is your java": So, so burnt out on it aha
23:46:10FromDiscord<Elegantbeef> But the point was copying an existent object to the heap
23:46:15FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4l8p
23:46:21FromDiscord<MadScientistCarl> sent a code paste, see https://play.nim-lang.org/#ix=4l8q
23:46:30FromDiscord<Elegantbeef> You can do the same in Nim
23:46:35FromDiscord<<She>Horizon</Her>> It's a big project and got too over my head about it, though i do want to actually continue it asap, it'd be very neat
23:46:44FromDiscord<MadScientistCarl> But in Nim it has to be on the heap, unless I missed something
23:46:45FromDiscord<<She>Horizon</Her>> In reply to @Elegantbeef "But the point was": Ah fair
23:46:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4l8r
23:46:59FromDiscord<MadScientistCarl> That is not quite the same
23:47:07FromDiscord<Elegantbeef> Nim's reference is not like Rust's reference or C++'s
23:47:23FromDiscord<Elegantbeef> Nim's reference is explicitly more akin to rust's ref counted container
23:47:31FromDiscord<Elegantbeef> I cannot remember what it's called presently
23:47:43FromDiscord<MadScientistCarl> Proc taking `var` is like taking `&mut` in Rust. However, in the hypothetical situation I was asking, it should be just plain `ref`
23:48:21FromDiscord<ShalokShalom> In reply to @Minaaa <3 "So, so burnt out": bless you
23:48:22FromDiscord<Elegantbeef> No
23:48:23FromDiscord<Elegantbeef> `proc someProc(myType: MyType)` will pass by ref automatically in Nim if `MyType` is large enoguh
23:48:25FromDiscord<Elegantbeef> There is no reason to labour the programmer with having to manually take a reference
23:48:27FromDiscord<MadScientistCarl> Actually you can't do that in Rust either
23:48:40FromDiscord<MadScientistCarl> Never mind
23:48:42FromDiscord<Elegantbeef> Yea didnt think so but dont know rust enough to be 100%
23:49:02FromDiscord<MadScientistCarl> Yeah, in Rust you need `Rc` too, which is reference counting
23:49:35FromDiscord<MadScientistCarl> I guess plain objects are just like shared refs in Rust
23:50:56FromDiscord<Elegantbeef> Plain objects in Nim are just Rust structs
23:51:05*jjido joined #nim
23:51:26FromDiscord<Elegantbeef> They're value types that are allocated contiguously when capable
23:52:09FromDiscord<<She>Horizon</Her>> In reply to @Elegantbeef "`proc someProc(myType: MyType)` will": What counts as big enough? Also i wasn't aware of this behaviour before hm
23:52:56FromDiscord<MadScientistCarl> Is it possible to let Nimble build in another directory? I would rather not have to edit my `.gitignore` every time
23:54:20FromDiscord<<She>Horizon</Her>> I think `-o:location` is what you're looking for
23:54:38FromDiscord<<She>Horizon</Her>> Is it `-o`? Or was it `--out`
23:54:42FromDiscord<<She>Horizon</Her>> Or outfile
23:54:56FromDiscord<<She>Horizon</Her>> Can't remember rn, been a while since i touched any of Nim's flags
23:55:21FromDiscord<Elegantbeef> Bigger or equal to 24bytes i think
23:55:28FromDiscord<MadScientistCarl> Ah, I find a flag called `binDir`
23:56:34FromDiscord<MadScientistCarl> I set it to `build/`, and everything is good
23:56:35FromDiscord<Elegantbeef> Why do you need to edit your git ignore, just make it ignore all extensionless files, .exe and .out
23:57:07FromDiscord<MadScientistCarl> `build/` is just easier to manage, IMO
23:57:17FromDiscord<MadScientistCarl> If I don't want something, just delete the whole thing
23:59:43*oprypin quit (Quit: Bye)