<< 29-01-2024 >>

00:09:52FromDiscord<Elegantbeef> Nim's typed AST really is fun to work around πŸ˜„
00:09:52FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=efQbUjaHwLhi
00:10:07FromDiscord<Elegantbeef> Just throw `typeof` whenever it errors about type mismatches until it works
00:25:34*khazakar quit (Quit: Connection closed for inactivity)
00:34:37*derpydoo joined #nim
00:34:40*raynei quit (Ping timeout: 255 seconds)
00:58:04FromDiscord<graveflo> Is there a syntax to force Nim to treat a return value with the same semantics as a `var` parameter. The only thing close to this that I can find is the manual section on NRVO, but nothing that I have tried has worked yet. No matter what I try the address of `result` is not the same as the address of the return type at the callsite.
00:59:40FromDiscord<Elegantbeef> Are you testing code inside of a proc or top level?
01:00:15FromDiscord<graveflo> I tried both
01:00:41FromDiscord<graveflo> But i guess not all combinations of both with all the things I tried
01:01:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=cTdnzHfecexg
01:01:32FromDiscord<Elegantbeef> Or... it did
01:01:37FromDiscord<Elegantbeef> The fuck πŸ˜„
01:02:10FromDiscord<Elegantbeef> Seems it was just bad cached code
01:02:18FromDiscord<Elegantbeef> Yea with `-d:release` it certainly is NVRO'd
01:03:49FromDiscord<leorize> just remember that NVRO is an optimization, if you want it to act like a `var` all the time, use a `var`
01:04:10FromDiscord<Elegantbeef> I thought that was sink πŸ˜›
01:04:10FromDiscord<graveflo> `var` return is for iterators or something
01:04:19FromDiscord<Elegantbeef> It's for everything
01:04:52FromDiscord<Elegantbeef> a getter can return `var T`
01:04:52FromDiscord<Elegantbeef> but you can just do `proc doThing(result: var T)`
01:04:56*Mister_Magister quit (Quit: bye)
01:05:05FromDiscord<graveflo> I disabled `copy` and `dup` for the type and Nim doesn't like the `var` return because it needs to copy for some reason
01:05:18FromDiscord<Elegantbeef> Uhh
01:05:24FromDiscord<Elegantbeef> Do you have a min repro?
01:05:27FromDiscord<leorize> var return is not the same as a var parameter
01:06:00FromDiscord<Elegantbeef> `var` as a return value is a mutable reference to data from the parameter list
01:06:18FromDiscord<graveflo> Yea I'll try and make a min example. I don't fully understand what `var` return does but looking at it for 10 seconds it looked like it was for cooperative functions
01:06:23FromDiscord<leorize> it's rust borrow but worse
01:06:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=ROlVARuxSQSV
01:06:50*Mister_Magister joined #nim
01:06:56FromDiscord<Elegantbeef> Hey I think it's better than Rust's borrow
01:07:01*raynei joined #nim
01:07:10FromDiscord<Elegantbeef> You don't have to call `clone`! πŸ˜›
01:07:25FromDiscord<leorize> but you can't store it either \:P
01:07:33FromDiscord<Elegantbeef> safely
01:08:31FromDiscord<Elegantbeef> Anyway it sounds like you're doing something like `proc doThing(val: T): T = val`
01:08:41FromDiscord<Elegantbeef> Without `dup` or `copy` that needs to be `sink`
01:09:27FromDiscord<leorize> `sink` is an optimization, it cannot make your code more correct
01:09:32FromDiscord<Elegantbeef> lol
01:10:46FromDiscord<graveflo> In reply to @Elegantbeef "Anyway it sounds like": no the input is not the output that would be weird. This is an `initX` style proc
01:11:05FromDiscord<Elegantbeef> Uh huh
01:15:52FromDiscord<graveflo> the only way I can reproduce it is if I make the structure less than the magic nvro size. The structure that I am working with is well above that but it is also `importc`d (with the members defined so I don't know why that would matter). Besides, the question is: can I force this behavior? I need to make sure that the addresses are the same regardless of nvro or `d:release` or anything like that. It's part of how the C library behaves
01:16:17FromDiscord<leorize> you can't
01:16:24FromDiscord<leorize> it's called an optimization for a reason
01:16:41FromDiscord<graveflo> to make development not optimal?
01:16:51FromDiscord<Elegantbeef> If you want it to always do what you want `proc bleh(res: var result)`
01:17:12FromDiscord<Elegantbeef> It's an optimisation whether it's enabled or not should not change the behaviour of the program
01:17:23FromDiscord<leorize> nor the semantics
01:17:33FromDiscord<graveflo> yea I figured that, but it's gross. I wish Nim could just transform the return value into that syntax.. it's a pretty straight forward concept
01:18:09FromDiscord<Elegantbeef> It should do that in specific cases iirc
01:18:41FromDiscord<leorize> if you're interacting with C you gotta give up the sugar
01:18:56FromDiscord<leorize> though it's trivial to just wrap it so that you can still have the sugar
01:19:03FromDiscord<graveflo> I'm done with these fancy languages. I'm going to do everything in pure ASM from now on and never upgrading my CPU
01:20:07FromDiscord<Elegantbeef> Fuck it just get a steady hand and a magnet
01:20:15FromDiscord<graveflo> In reply to @leorize "if you're interacting with": you say this but there no point in being ignorant to what is possible. That is not the case here. What I am trying to do is very doable with the "sugary" syntax. I understand what you are saying but here's a difference. No need to be so complacent
01:20:36FromDiscord<Elegantbeef> I'm so confused at what you're doing
01:21:08FromDiscord<leorize> the point is that it shouldn't matter because the compiler knows better when it comes to speed
01:21:13FromDiscord<Elegantbeef> Whether something is NVRO'd or not should not change the anything
01:21:20FromDiscord<Elegantbeef> "the anything" ah yes
01:21:49FromDiscord<Elegantbeef> I'd like to believe your miss-attributing a bug to NVRO
01:22:01FromDiscord<leorize> like if you return a struct \<= 2x machine word it is significantly faster to pass back 2 registers than doing a move to pointer
01:22:18FromDiscord<graveflo> okay, at the callsite se say `let x = initX()` and the value of `x` has space on the stack on the callsite stack frame. Inside of `initX` there is a choice to work with the return value as a new address on `initX`s stack frame or use the address from the callsite. I would like to use the address from the callsite. In fact I need to. That's it
01:22:37FromDiscord<Elegantbeef> "I need to"?
01:22:44FromDiscord<graveflo> yes
01:23:05FromDiscord<Elegantbeef> Why?
01:24:23FromDiscord<graveflo> because I the library I'm working with will capture the address when I call a proc in the init function and sigsev. I know. "dont do it like that", "use ref semantics". I know how to work around problems like this is just stupid that I can't do something that is simple that I know is possible.
01:25:27FromDiscord<Elegantbeef> `/s/proc/template` πŸ˜„
01:25:27FromDiscord<graveflo> it's weird too because the library is designed to work without malloc at all
01:25:44FromDiscord<leorize> just use `var`, really
01:25:50FromDiscord<graveflo> I was thinking about using a template but idk
01:25:52FromDiscord<Elegantbeef> Yea leo is right
01:26:05FromDiscord<graveflo> yea I know about that, like I said it's just gross
01:26:06FromDiscord<leorize> while such a transformation is possible it breaks the semantic of the language
01:26:16FromDiscord<graveflo> it doesn't
01:26:38FromDiscord<Elegantbeef> I think it's way less gross than relying on NVRO πŸ˜„
01:27:01FromDiscord<leorize> or rather, you impose a restriction that doesn't exist where the compiler has much more liberty
01:27:19FromDiscord<Elegantbeef> NVRO my ints!
01:27:25FromDiscord<graveflo> It's not like NVRO does something that only NVRO can do. Theres no need to rely on it
01:27:37FromDiscord<Elegantbeef> Glad we're in agreeance
01:28:15FromDiscord<graveflo> right. It's the syntax that I'm saying is lacking, but anyway, just wanted to know if Nim had a way to control that. Guess not
01:28:50FromDiscord<Elegantbeef> I mean forced NVRO changes the semantics drastically
01:29:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=XSGyJTuERSTw
01:29:42FromDiscord<Elegantbeef> This requires a thunk to be generated for one of them
01:29:51FromDiscord<Elegantbeef> Assuming one is nvro'd and the other is not
01:30:12FromDiscord<graveflo> a thunk?
01:30:18FromDiscord<Elegantbeef> Atleast if i'm not being brain dead I think it does
01:30:26FromDiscord<Elegantbeef> A intermediate proc
01:30:46FromDiscord<Elegantbeef> The same logic exists for {.nimcall.} -\> {.closure.}
01:30:56FromDiscord<graveflo> right yea I can understand that
01:31:18FromDiscord<bubblie> To turn a ptr cstring into a seq cstring should I just cast the seq cstring to it
01:31:21FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#pasty=XDxxNmfKhgbq
01:31:39FromDiscord<Elegantbeef> No you should not cast it
01:32:04FromDiscord<Elegantbeef> `@cast[ptr UncheckedArray[cstring]](myArr).toOpenArray(0, len)`
01:32:11FromDiscord<Elegantbeef> `seq[T]` is not `T`
01:32:17FromDiscord<bubblie> Ah
01:32:25FromDiscord<graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=NAJNpZmVVsnt
01:32:31FromDiscord<Elegantbeef> If it's nil terminated iterate the array
01:32:41FromDiscord<bubblie> Got it
01:32:44FromDiscord<bubblie> Thanks!
01:35:42FromDiscord<leorize> it doesn't↡(@graveflo)
01:36:18FromDiscord<leorize> since `int` fits in a register, it could be left there and picked up by `bar`
01:36:27FromDiscord<leorize> this kind of function is called a "leaf" function
01:36:47FromDiscord<graveflo> wouldn't `foo`s stack frame be popped before the addion operation can happen? If the value is in `foo`s stack frame that means that `bar` will never know what it was
01:36:53*rockcavera quit (Remote host closed the connection)
01:37:01FromDiscord<leorize> the stack doesn't exist
01:37:19FromDiscord<Elegantbeef> Leo hitting us with deep philosophical takes
01:37:24FromDiscord<graveflo> right I get that it can fit in a register. This is more of a conceptual problem.
01:38:53FromDiscord<graveflo> not that it isn't relevant in it's own right, but what I'm talking about doesn't concern details on that level
01:39:28*rockcavera joined #nim
01:40:07FromDiscord<leorize> it does, because it is the primary reason why "return value" as a concept is intentionally vague
01:42:48FromDiscord<graveflo> If that level of vagueness is ultimately expected then doing anything with memory addresses would be nonsensical. It's not abnormal to want control memory addresses. Return values, parameters included
01:45:32FromDiscord<leorize> the thing with return values is that the target location can be anything and doesn't have to "exist" semantically or literally
01:46:04FromDiscord<leorize> parameters on the other hand must exist semantically, and thus already have constraints like having a location
01:46:07FromDiscord<graveflo> but it could. Like an "out parameter"
01:46:29FromDiscord<leorize> an out parameter still exist semantically, because you must provide the out location
01:46:49FromDiscord<leorize> take beef array example, you can't write it with an out location before that array exist
01:47:54FromDiscord<graveflo> the only problem I can understand from beefs example is that they may need to have different calling conventions. That makes sense to me but I'm not 100% sure. Those would have been proc handles
01:48:31FromDiscord<Elegantbeef> Right they'd change the type of the procs afaik
01:48:41FromDiscord<graveflo> but besides, I was asking if something like that exists, not trying to say that it should work with Nim's current implementation. Seems like it doesn't exist. At this point I'm just saying that it could exist
01:48:45FromDiscord<Elegantbeef> But then you can have `{.nimcall, nvro.}` and more sets
01:49:09FromDiscord<Elegantbeef> On the plus side the convention to do what you want is extremely simple
01:49:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=OWVrGGHDPsxr
01:50:04FromDiscord<graveflo> I feel like it would be a nice way to wrap C code with out parameters since Nim doesn't seem to like those. They are a lot less readable IMO and require more lines of code that is necessary
01:50:32FromDiscord<Elegantbeef> Nim has out parameters in 2.0(devel?)
01:50:42FromDiscord<graveflo> It's not that much different but you have to define something at the callsite which is a lot less expressive imo
01:51:40FromDiscord<graveflo> out parameters never worked well for me and I thought they existed just to wrap C code not to copy it's syntax. I like to wrap C code in a way that has Nim syntax so making out parameters is something I would like to avoid
01:51:47FromDiscord<Elegantbeef> You could do `var a {.nvro.} = someCall()` which emits a new proc that is NVRO'd
01:51:52FromDiscord<graveflo> (edit) "out parameters ... never" added "in Nim"
01:52:18FromDiscord<graveflo> lost me on that one beef
01:52:33*raynei quit (Ping timeout: 260 seconds)
01:53:10FromDiscord<graveflo> Is there an advantage to the pragma being at the callsite as opposed to the `proc`. I would assume the `proc` is the only place it would make much sense
01:53:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=pdGHCwaVSWjS
01:53:55FromDiscord<Elegantbeef> The benefit at the callsite is that it allows you to do this πŸ˜›
01:54:31FromDiscord<Elegantbeef> Nim does not allow you to attach a macro on a proc that changes how a variable is declared
01:54:37FromDiscord<graveflo> oh so you think a macro could do this
01:54:40FromDiscord<Elegantbeef> It does allow you attach a macro on a variable to change how it's declared
01:55:06FromDiscord<Elegantbeef> But now you have a proc floating around that relies on UB
01:55:11FromDiscord<graveflo> well that would make it even more confusing to client code, but that is an interesting idea. I didn't think of that
01:55:36FromDiscord<Elegantbeef> `someCall` now has to be called using the `{.nvro.}` macro
01:58:40FromDiscord<Elegantbeef> The better Nim sugar is to just use templates that introduce symbols
01:59:25FromDiscord<Elegantbeef> write your proc with `var T` then just have a pragma that you attach on the symbol
01:59:35FromDiscord<Elegantbeef> `var a {.nvro.} = someCall(a)`
02:00:02FromDiscord<Elegantbeef> Annoyingly even `var a: int = someCall(a)` is invalid
02:02:40FromDiscord<graveflo> yea I think I'll just do the template
02:05:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=BDaLeyGsVFNw
02:10:52*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
03:06:13FromDiscord<bubblie> is there a quick way to take a cStringArray and turn it into a sequence
03:06:35FromDiscord<bubblie> (edit) "cStringArray" => "cstringArray tpye variable"
03:06:42FromDiscord<bubblie> (edit) "tpye" => "type"
03:07:23*tiorock joined #nim
03:07:23*tiorock quit (Changing host)
03:07:23*tiorock joined #nim
03:07:23*rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services)))
03:07:24*tiorock is now known as rockcavera
03:07:58FromDiscord<bubblie> I just traversed
03:28:31FromDiscord<Elegantbeef> Again if it's nil terminated you have to iterate
03:37:38*raynei joined #nim
03:55:07NimEventerNew thread by dwhall256: Help with a template, see https://forum.nim-lang.org/t/10926
03:58:08FromDiscord<piman_discriminator_1010> what's the best way to pass an object through an `int`?↡I have a function callback that reads userdata as an `int` presumably as a substitute for what would be a C void pointer
04:00:13FromDiscord<Elegantbeef> `pointer`
04:20:08FromDiscord<piman_discriminator_1010> can I get a ref as a pointer?
04:21:10FromDiscord<Elegantbeef> You can `cast[pointer](yourRef)`, but otherwise no
04:21:20FromDiscord<Elegantbeef> Mixing gc and non gc is only for those that know what they're doing
04:21:47FromDiscord<piman_discriminator_1010> the lifetime of the pointer will be less than the lifetime of the GCd object it points to
04:22:17FromDiscord<piman_discriminator_1010> (well more like about the same, which is also the lifetime of the program)
04:22:49FromDiscord<Elegantbeef> Yea I mean you can do `GcRef` and `GcUnref` to manage it manually otherwise
04:23:41FromDiscord<piman_discriminator_1010> if the lifetime is equal or less though I don't need to use those?
04:24:19FromDiscord<bubblie> In reply to @Elegantbeef "Again if it's nil": Right yeah I just ended up doing that it was nil terminated and it works fine now thank you again
04:24:42FromDiscord<Elegantbeef> Correct if the ref isn't gc'd before the proc exits you do not need it thanks to determinisim
04:25:36FromDiscord<piman_discriminator_1010> πŸ‘
04:25:42FromDiscord<Elegantbeef> Those procs are for manually managing memory that you give up ownership of or lose through type erasure
04:27:31*raynei quit (Ping timeout: 276 seconds)
04:28:06*SchweinDeBurg joined #nim
04:33:10*nazgulsenpai quit (Ping timeout: 255 seconds)
04:35:49*nazgulsenpai joined #nim
04:35:53*rockcavera quit (Remote host closed the connection)
06:02:02*jkl quit (Quit: Gone.)
06:06:38*raynei joined #nim
06:38:52*khazakar joined #nim
07:03:13*PMunch joined #nim
07:24:41*raynei quit (Ping timeout: 252 seconds)
07:49:09PMunchHmm, is there a way in Nim to format a string directly into a cstring?
07:49:48PMunchI know I can use C stuff to do this, but I was thinking something like `"the value is " & $value`
07:53:42FromDiscord<Elegantbeef> There's nothing premade that I know of
07:57:01*advesperacit joined #nim
08:38:55FromDiscord<exelotl> I've been thinking to make a macro with a `fmt` like syntax which invokes any printf/sprintf routine under the hood
08:47:52Amun-Rasame
08:48:25Amun-Raalthough I'd just wrap it for simplicity
08:58:18*khazakar quit (Quit: Connection closed for inactivity)
09:02:43*derpydoo quit (Ping timeout: 246 seconds)
09:08:31FromDiscord<Robyn [She/Her]> In reply to @exelotl "I've been thinking to": Oh? Why printf?
09:32:21PMunch$Robyn_[She/Her], can't speak for exelotl, but I want it to be able to avoid Nim strings on embedded targets
09:38:31FromDiscord<Robyn [She/Her]> Aah fair
09:51:31*khazakar joined #nim
11:09:27FromDiscord<Robyn [She/Her]> What's the issue some people have with result types?
11:09:38FromDiscord<Robyn [She/Her]> Is it the fact that they don't have any sort of traceback or?
11:10:32FromDiscord<nnsee> that's one of the issues
11:11:45FromDiscord<Robyn [She/Her]> What's the other issues? I'm curious
11:11:57FromDiscord<Robyn [She/Her]> Also I'm wondering how the issue of lacking a traceback could be solved
11:13:17FromDiscord<nnsee> explicit handling of every result is often very verbose and complicates the code, especially if the language doesn't have first class support for it
11:13:32FromDiscord<Robyn [She/Her]> Fair, like Rust's `match` statement?
11:14:07FromDiscord<Robyn [She/Her]> Can't remember the syntax but I know that it's very clean
11:14:51FromDiscord<nnsee> yes, and returning error types implicitly using a specific operator like ? if the signature matches with the calling function's signature
11:15:35FromDiscord<Robyn [She/Her]> `?` operator sounds a bit yucky
11:16:48FromDiscord<nnsee> what is your proposed solution to the equivalent of being able to `throw` something three functions deep and catching and handling the error three functions higher up the call chain without having explicit code for it in each calling function?
11:17:09FromDiscord<nnsee> `?` sounds like a reasonable solution to me
11:17:21FromDiscord<Robyn [She/Her]> Unfortunately nothing, you're right
11:17:27FromDiscord<Robyn [She/Her]> I dislike `?` though :p
11:17:32FromDiscord<Robyn [She/Her]> It's the only way I guess
11:19:17FromDiscord<nnsee> and re: traceback, as far as i understand it, attaching a traceback to error values isn't exactly "hard", but again requires first class support by the language/compiler
11:19:59FromDiscord<nnsee> mind you i have almost no idea what i'm talking about so take anything i say with a grain of salt
11:20:31FromDiscord<Robyn [She/Her]> Fair
11:36:20FromDiscord<dissolved.girl> In reply to @nnsee "mind you i have": Appreciate the honesty haha
11:53:09FromDiscord<Robyn [She/Her]> Couldn't "first class 'support'" be done with purely macros?
11:56:05FromDiscord<nnsee> within the scope of your own project i don't see why not (although perhaps persuading the compiler to spit out a stack trace might be somewhat difficult), however once you start shipping libraries etc this breaks down, because the library users will then have to start using your macro mechanism for handling exceptions etc
11:57:25PMunchnnsee, getting a stack trace is actually pretty trivial: https://nim-lang.org/docs/system.html#getStackTrace
11:57:27FromDiscord<Robyn [She/Her]> A possible idea would be a macro/template to wrap functions with errors into result types instead possibly
11:57:34FromDiscord<Robyn [She/Her]> In reply to @PMunch "<@961485620075720734>, getting a stack": Oh fun
11:58:06FromDiscord<Robyn [She/Her]> In reply to @nnsee "within the scope of": And yeah I'd expect it'd have to be explicitly supported
11:58:17FromDiscord<nnsee> In reply to @PMunch "<@961485620075720734>, getting a stack": fair enough
11:58:37PMunchRobyn_[She/Her], I have this kind of wrapping in my optionsutils library: https://github.com/PMunch/nim-optionsutils/blob/master/src/optionsutils.nim#L329
11:59:45FromDiscord<Robyn [She/Her]> In reply to @PMunch "Robyn_[She/Her], I have this": Oh fun
12:02:02FromDiscord<nnsee> In reply to @nnsee "what is your proposed": also inb4 Rika comes in here and starts talking about how Haskell has solved it with invariant ephemeral nomads or whatever the hell insanity the Haskell devs have conjured up
12:02:53FromDiscord<Robyn [She/Her]> Lol
12:03:02FromDiscord<Robyn [She/Her]> In reply to @nnsee "also inb4 Rika comes": @odexine
12:03:12FromDiscord<odexine> I was already reading the chat
12:03:27FromDiscord<odexine> And yes essentially monads
12:03:37FromDiscord<Robyn [She/Her]> Pfff
12:03:55FromDiscord<nnsee> called it
12:05:09FromDiscord<odexine> Well, the result type itself is a monad
12:44:43PMunchHmm, it's a bit annoying that Nim won't show the mismatch when you want to pass a callback that is aliased to a type
13:14:50*rockcavera joined #nim
13:19:59FromDiscord<Robyn [She/Her]> How does Nim's lsp work with macros?
13:20:06FromDiscord<Robyn [She/Her]> Is it good or no?
13:28:41PMunchShould work just fine
13:28:48PMunchAt least nimlsp
13:43:22*raynei joined #nim
13:43:35*anddam joined #nim
13:44:22anddamhowdy, what could be causing this while installing via choosenim on windows11 64bit using 0.8.4 official installer? https://termbin.com/c8js
13:45:16FromDiscord<Robyn [She/Her]> In reply to @PMunch "At least nimlsp": Fair
13:46:43anddamnvm, I ran choosenim.bat twice and did the trick, maybe ~/nimble/bin wasn't there on first run of `choosenim.exe stable --firstInstall`?
13:49:08PMunchRobyn_[She/Her], I mean they both use nimsuggest, and nimsuggest is basically the compiler just modified to output information instead of code
13:49:14PMunchSo most things should work just fine
13:51:03FromDiscord<nnsee> In reply to @anddam "nvm, I ran choosenim.bat": that sounds like a bug
13:51:06FromDiscord<nnsee> will try to reproduce later
13:52:20FromDiscord<Robyn [She/Her]> In reply to @PMunch "So most things should": Fair :P
13:52:46FromDiscord<Robyn [She/Her]> I was wondering because if I made a custom `match` macro I was wondering if it'd work with autocomplete at all
14:01:16PMunchI mean the name should autocomplete just fine
14:01:25PMunchBut of course a DSL won't autocorrect
14:30:57FromDiscord<Robyn [She/Her]> Fair
14:37:26anddamdoes nimble have something equivalent to virtual environment to manage per-project dependencies?
14:39:40FromDiscord<Robyn [She/Her]> In reply to @anddam "does nimble have something": Atlas fulfils that I believe
14:42:57anddamI'll check it thx
14:45:29PMunchAlso you don't really need it in Nim
14:51:24anddamhow so?
14:51:49anddamI mean what if I have a package wanting foo2 and another wanting foo3 ?
14:54:37PMunchLike two versions of the same package?
14:55:02PMunchYou just add `requires "foo == 2.0.0"` in your nimble file
14:55:16anddamok, but how do you use one or another?
14:55:34anddam(I am trying to translate my python habits)
14:56:30PMunchWell you add that to the nimble file for your project, and then just `import foo` in your Nim file where you want to use it
14:57:02PMunchThen build with `nimble build` and Nimble will figure out which packages to use
14:57:31PMunchOf course since Nim is compiled all this sort of stuff is way less problematic
14:58:04PMunchIf you want to use someone elses program you just download their pre-built binaries. No need to have Nim or any packages installed at all
14:58:36PMunchAnd if you want to build it yourself then Nimble figures it out for you
14:58:40*derpydoo joined #nim
14:59:11anddamfrom what you said I gather the dependencies are pulled in the build directory at build time
14:59:28anddamhehe right about the binary and being self-contained, not very used to that
14:59:51anddam(also what led me looking for other languages and finding nim)
15:00:16PMunchNot quite
15:00:37PMunchNim by default will look for installed packages in `~/.nimble/pkgs`
15:01:06PMunchBut it has command line switches which disables that, and another switch to manually add a search path
15:01:40anddamwhat if there's a dependency specified in nimble file for a package that is in conflict with what's in ~/.nimble/pkgs?
15:01:56PMunchSo what Nimble does is just disable the "look for installed packages" flag and adds the paths to whatever you listed in the nimble file
15:02:50PMunchWell in your case you would have `~/.nimble/pkgs/foo-2.0.0` and `~/.nimble/pkgs/foo-3.0.0`
15:03:00PMunchBy default Nim picks the one with the higher version
15:03:17PMunchBut with a Nimble file you can specify which one you want
15:03:29anddamthat seems an approach too rational and easy
15:03:41PMunchWelcome to Nim :P
15:04:07anddamit's like making problems going away with a magic wand gesture by not allowing them to exist in first place,
15:08:56*PMunch quit (Quit: Leaving)
15:43:40*jmdaemon quit (Ping timeout: 255 seconds)
16:14:34FromDiscord<anuke> Is this a known bug in `rand`, or is it expected behavior? https://media.discordapp.net/attachments/371759389889003532/1201561023157645353/image.png?ex=65ca43e7&is=65b7cee7&hm=e9c1223947df870ac79bb52233d8864fb3bcaa0e369d2289681a209a5bedb2fe&
16:15:33FromDiscord<anuke> This works correctly, for example: https://media.discordapp.net/attachments/371759389889003532/1201561277865132072/image.png?ex=65ca4424&is=65b7cf24&hm=8fc38c318035f3dc66d4649284c8729d563c436a8df2c9cbc8a0f0be4bebdc15&
16:33:07FromDiscord<odexine> "hey technically its possible to be so incredibly lucky that you get 10 falses"
16:33:11*raynei quit (Quit: Konversation terminated!)
16:34:31FromDiscord<demotomohiro> Let's check issues about random module and read source code of random module.
16:35:57FromDiscord<drunkenalcoholic> TestBool has 2 options, a or b, bool as just bool might be default to false, but im new to nim so I wouldn't really know, I just think of it saying rand(0) as 0 representing fault or -1 ect..
16:37:45FromDiscord<drunkenalcoholic> (edit) "false," => "false?," | "0" => "in zero" | "fault" => "false" | "-1 ect.." => "is bool false -1?"
16:41:28anddamanuke: what rand function would be that of the screenshot? https://nim-lang.org/docs/random.html#rand%2Cfloat
16:42:05FromDiscord<odexine> it would be this one https://nim-lang.org/docs/random.html#rand%2Ctypedesc%5BT%5D
16:43:03FromDiscord<demotomohiro> It seems bool and enum are generated in different way:↡https://github.com/nim-lang/Nim/blob/devel/lib/pure/random.nim#L381
16:43:20anddamironically almost got a 10 false on first run https://termbin.com/gb47
16:44:33FromDiscord<odexine> In reply to @demotomohiro "It seems bool and": https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/random.nim#L387C7-L387C39 for 2.0
16:45:10FromDiscord<Robyn [She/Her]> https://play.nim-lang.org/#pasty=abDDJZTbhGkB immense pain
16:45:26FromDiscord<Robyn [She/Her]> For some reason at the end, the code is indenting instead of dedenting
16:49:18FromDiscord<demotomohiro> In reply to @anuke "Is this a known": It is known issue and there is the fix: https://github.com/nim-lang/Nim/pull/22361↡But it is not yet merged to ver2.0.2?
16:51:18*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
16:58:45FromDiscord<anuke> Seems to be backported, but I don't have the fix at 2.0.2, yeah
16:58:58FromDiscord<jaar23> In reply to @norax.2 "does someone have a": try out my example here,https://github.com/jaar23/tui_widget↡ i'm building widget based on illwill. illwill is a superb library. It's way more easier than many other tui lib if you are familiar with it
17:17:35*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
17:20:35*Lord_Nightmare joined #nim
18:03:22FromDiscord<norax.2> In reply to @jaar23 "try out my example": thx
18:16:59FromDiscord<Phil> Oh hey, my tests work proving threadButler to have reached the stage of correctness, yaaaay↡Oh hey, my docs no longer compile because of some random weird ass interaction between nim docs and chronos, less yay
18:28:59NimEventerNew thread by mig: Feedback on site: Scroll to Top or Update Design for Docs, see https://forum.nim-lang.org/t/10927
18:40:59FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "https://play.nim-lang.org/#pasty=abDDJZTbhGkB immen": Anyone know why after the identifier 'e' and before 'f' there's an indent token even though it should be a dedent?
18:41:06FromDiscord<norax.2> sent a code paste, see https://play.nim-lang.org/#pasty=eWbeerFCqaBv
18:41:24FromDiscord<norax.2> This like shortes all your code lol
18:42:56FromDiscord<norax.2> (edit) "lol" => "lol(yeah idk if it work or smth i havent tried it lol)"
18:44:36FromDiscord<odexine> In reply to @chronos.vitaqua "Anyone know why after": idk what to tell you other than "youll be hardpressed to find someone to debug 500+ lines"
18:45:14FromDiscord<Phil> I don't even have the mental capacity to solve my own problems at the moment other than isolating them to a modul from status
18:45:21FromDiscord<Phil> Let alone debug 500+ loc
18:46:59FromDiscord<Robyn [She/Her]> L387-L463 LP
18:47:06FromDiscord<Robyn [She/Her]> Still 80 lines tho so yeah fair
18:47:16FromDiscord<Robyn [She/Her]> I am so confused on the issue 😭
18:50:38FromDiscord<Robyn [She/Her]> Hm...
18:50:42FromDiscord<Robyn [She/Her]> Indent stack is pain
18:53:14FromDiscord<Robyn [She/Her]> Rewrite time
18:53:20FromDiscord<odexine> xd
18:53:39FromDiscord<odexine> refactor not rewrite
18:53:51FromDiscord<Robyn [She/Her]> What's the difference :p
18:53:55FromDiscord<Robyn [She/Her]> Refactor is moving around
18:54:02FromDiscord<Robyn [She/Her]> Rewrite is delete then write-
18:54:10FromDiscord<odexine> rewrite gives me the impression of throwing away the current implementation
18:54:19FromDiscord<odexine> refactor is restructuring what you already have
18:54:24FromDiscord<odexine> this disctinction is significant
18:55:50FromDiscord<Robyn [She/Her]> Ah
19:01:24FromDiscord<Phil> Rewrite imo is changing actual approach
19:01:35FromDiscord<Phil> Refactor is just the same approach, but written in a different way
19:01:42FromDiscord<Phil> (edit) "Refactor is just the same approach, ... but" added "same APIs,"
19:01:47FromDiscord<Phil> (edit) "Refactor is just the same approach, same APIs, but written in a different way ... " added "under the covers"
19:01:57FromDiscord<Phil> (edit) "approach" => "approach, implying also API changes"
19:06:11FromDiscord<Robyn [She/Her]> HAH! FIXED! :D
19:06:21FromDiscord<Robyn [She/Her]> In reply to @isofruit "Refactor is just the": That makes it cleared ty :p
19:06:25FromDiscord<Robyn [She/Her]> clearer
19:52:12FromDiscord<Robyn [She/Her]> Whyyyy can't programming be easy
19:56:17FromDiscord<Phil> Because every time it's easy you're just crunching through your tasks without appreciating it
19:56:30FromDiscord<Phil> So only the hard stuff is left over
19:58:43FromDiscord<Robyn [She/Her]> True
19:58:45FromDiscord<Robyn [She/Her]> Pain
20:00:30FromDiscord<norax.2> microsoft is gonna sue me for recreating excell lol https://media.discordapp.net/attachments/371759389889003532/1201617887744491600/image.png?ex=65ca78dd&is=65b803dd&hm=df0ae0ac3679952461f10002a1762a61242aa10c9775f47a1b49d61a39de9d8a&
20:00:41FromDiscord<norax.2> yes you can write in ANY of thesse
20:00:48FromDiscord<norax.2> and resize
20:02:51FromDiscord<norax.2> https://media.discordapp.net/attachments/371759389889003532/1201618480701636738/image.png?ex=65ca796a&is=65b8046a&hm=1da7847c14e68dfe6ca5e3ee8173289e96952ad5b2d02029151ca535623b3057&
20:03:00FromDiscord<norax.2> well...why the rest is like so..
20:03:04FromDiscord<norax.2> what
20:20:22FromDiscord<Phil> Aaaand now I have data races when observing my tests under loonyqueue↡This stuff can be such a braindrain
21:09:57anddamwent through this little tutorial https://arhamjain.com/2021/11/22/nim-simple-chat.html (code at https://github.com/ajusa/simple-chat ) but the code won't work with a current setup
21:10:05anddam```Error: 'matchMatcher (Async)' is not GC-safe as it accesses 'chatrooms' which is a global using GC'ed memory```
21:11:32anddamI am not able to figure what I should be changing, not having a global chatroom? disabling GC? (does not sound wise)
21:12:09FromDiscord<graveflo> any reason why a case statement would want `of X` to be defined at compile time? I thought that nim only supports `when X: elif:` syntax
21:15:48FromDiscord<demotomohiro> In reply to @graveflo "any reason why a": I guess it is to optimize case statement.↡If `X` in `of X` is runtime value, you can rewrite it with if statement.
21:19:06FromDiscord<graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=jyjvBpCPqzSY
21:20:09FromDiscord<Elegantbeef> It's supposed to happen
21:20:32FromDiscord<Elegantbeef> Nim case statements are exhaustively checked which requires the branches to be static
21:20:42FromDiscord<Elegantbeef> Make a `runtimeCase` macro πŸ˜›
21:21:09FromDiscord<graveflo> they are checked exhaustively in enums but how is that supposed to work for other types?
21:21:22FromDiscord<Elegantbeef> The same way
21:21:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=BzqLANKkWEiA
21:21:44FromDiscord<graveflo> there is an `else` in there anyway so it is exhaustive
21:21:55FromDiscord<Elegantbeef> Sure
21:22:24FromDiscord<graveflo> so what needs to be evaluated at compile time for `int` types?
21:22:30FromDiscord<Elegantbeef> > Because case statements are checked for exhaustiveness during semantic analysis, the value in every of branch must be a constant expression. This restriction also allows the compiler to generate more performant code.
21:22:37FromDiscord<Elegantbeef> The branch delimiter
21:22:53FromDiscord<graveflo> have to check for `high(int)` number of cases or an `else`? I'd think that the else is what matters
21:22:53FromDiscord<Elegantbeef> You want if branches
21:23:15FromDiscord<graveflo> alright. It's weird tho
21:23:23FromDiscord<Elegantbeef> It's not that weird
21:23:30FromDiscord<Elegantbeef> Case statements are exhaustive for everything but strings
21:23:39FromDiscord<Elegantbeef> Runtime values prevent exhaustiveness
21:23:53FromDiscord<graveflo> all it needs to prove its exhaustive is `else` so it
21:23:57FromDiscord<graveflo> s weird LOL
21:24:16FromDiscord<graveflo> especially for types that have `high(int)` branches. thats just silly
21:24:32FromDiscord<graveflo> or more like `high(uint64)`
21:24:33FromDiscord<Elegantbeef> Not really cause you can handle the cases you care about then have an `else`
21:24:39FromDiscord<Elegantbeef> The issue is purely just "I want runtime values"
21:24:46FromDiscord<graveflo> right and if you do that there is nothing to check at compile time
21:25:39FromDiscord<graveflo> actually nim doesn't even need to do that for enums either. It can just make sure that `else` is there or all names are used not values
21:25:59FromDiscord<Elegantbeef> Right
21:26:13FromDiscord<graveflo> okay I would call that weird then
21:26:39FromDiscord<graveflo> there no reason why the code I posted shouldn't work
21:26:43FromDiscord<Elegantbeef> I mean it also silently generates worse code, but I guess that's the intention
21:27:37FromDiscord<graveflo> what silently generates worse code? The algo I mentioned or the dummy example?
21:27:50FromDiscord<Elegantbeef> Allowing runtime values
21:28:02FromDiscord<Elegantbeef> It prevents creation of a jump table which means it's slower
21:28:35FromDiscord<graveflo> shouldn't the C compiler be able to do that if the branches are constant anyway? Whats the point of enforcing it when it can just be a special case
21:28:58FromDiscord<Elegantbeef> I mean this is a feature that's not yet implemented
21:29:04FromDiscord<Elegantbeef> "PRs possibly welcome"
21:29:09FromDiscord<graveflo> it's not like there isn't already a test that can determine if it's a compile optimization or not. Thats what currently happens
21:32:53FromDiscord<Elegantbeef> Does C's switch statement accept runtime values?
21:33:07FromDiscord<graveflo> Who cares? C is for losers
21:33:24FromDiscord<graveflo> that being said I use C
21:33:39FromDiscord<Elegantbeef> I mean it's important cause it changes whether it's a front end change or a frontend and backend change
21:33:58FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Does C's switch statement": I can't remember, possibly no
21:34:34FromDiscord<graveflo> it could but at the same time it might be easier to just keep the current impl for the special case and generate something else for runtime
21:35:11FromDiscord<graveflo> it's prob easier to do it that way tbh. Just might add bloat to the compiler, so I guess that would be bad
21:35:30FromDiscord<Elegantbeef> Well presently it probably generates a switch statement, which means at codegen you need to check whether it has static values or not if not generate if statements
21:35:44FromDiscord<Elegantbeef> Until then just write a `runtimecase` macro πŸ˜›
21:38:10FromDiscord<graveflo> I'll prob just ignore it LOL. I don't like the design but I was just wondering why it didn't work.
21:41:02FromDiscord<graveflo> it looks like `switch` doesn't have to be constant in C but it's hard to find anyone who gives a shit about that either. I'm only saying that bc `case` is usually explicitly labelled as constant where `switch` is not
22:01:32FromDiscord<pierce.jason> anyone familiar with PyCharm Community ide, w/ Jetbrains Nim plugin? I'm wondering what I'm missing in Community vs VSCode. I did notice PyCharm Comm doesnt allow builtin debugging
22:02:24FromDiscord<graveflo> Nim doesn't have any usable debugging solutions. It's just print statements for now
22:02:45FromDiscord<Elegantbeef> I mean gdb sorta kinda not really works
22:02:56FromDiscord<Elegantbeef> Jmgomez does have a PR to add better mangling
22:03:45FromDiscord<Elegantbeef> Atleast for procs
22:04:49FromDiscord<Robyn [She/Her]> How would the mangling be better?
22:04:56FromDiscord<pierce.jason> I've never used a debugger, I come mostly from scripted languages using print/echo for debugging, so thats not a big deal for now
22:05:10FromDiscord<Elegantbeef> It changes it to a more readable 'standard'
22:05:19FromDiscord<Robyn [She/Her]> In reply to @pierce.jason "I've never used a": Until you get segfaults :P
22:05:33FromDiscord<Robyn [She/Her]> With async code :P
22:05:34FromDiscord<pierce.jason> right, lol
22:05:47FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "It changes it to": Fair
22:05:50FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1201649426909900891/image.png?ex=65ca963c&is=65b8213c&hm=ba5a2fb9b804c50192d57a5e506b521e7d61e498c75b44051add84a444a55b67&
22:05:52FromDiscord<Elegantbeef> The stack trace in the new mangling
22:05:54FromDiscord<Robyn [She/Her]> Also I've barely touched a debugger too so
22:06:19FromDiscord<pierce.jason> cross that bridge after I get a usable environment
22:06:24FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "image.png": Oh neat
22:06:29FromDiscord<Robyn [She/Her]> In reply to @pierce.jason "cross that bridge after": Fair
22:07:10FromDiscord<Elegantbeef> No the bridge is too well guarded
22:08:44FromDiscord<pierce.jason> haha, so are there any decent reasons that I should keep fighting VSCode plugins instead of rolling with JetBrain/Pycharm w/ Nim plugin?
22:09:17FromDiscord<graveflo> usually the vscode plugin works well. I'm surpised that's giving you an issue
22:09:22FromDiscord<Elegantbeef> Jetbrain's Nim plugin is done dumber and does not support things like macros or templates
22:09:23FromDiscord<graveflo> for me the jeybrains plugin never wokrs
22:09:32FromDiscord<graveflo> (edit) "jeybrains" => "jetbrains" | "wokrs" => "works"
22:09:41FromDiscord<pierce.jason> iirc thr jetbrains plugin is updated only to nim v1.5x
22:10:02FromDiscord<graveflo> there is a vscode extensions that has a lot of downoads but it's old and prob boroken
22:10:10FromDiscord<Elegantbeef> Right it also does not use any compiler based tooling so is done only lexically
22:10:12FromDiscord<Robyn [She/Her]> In reply to @pierce.jason "haha, so are there": VSC is the go-to of many here (excluding Vim/Emacs users)
22:10:41FromDiscord<Robyn [She/Her]> In reply to @graveflo "there is a vscode": There's one by nim-lang apparently but it's not in the extension marketplace for me on my install for an odd reason
22:10:42FromDiscord<Elegantbeef> I mean Nimlsp and Nimlangserver with a LSP enabled editor is as good as vscode ime
22:11:00FromDiscord<Elegantbeef> Are you using vscodium or another free vscode fork?
22:11:11FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Are you using vscodium": Possibly Code OSS
22:11:12FromDiscord<graveflo> there used to be a "nim" plugin and a "nim-saem" plugin and now I think there is a third that is build on "nim-saem"
22:11:21FromDiscord<pierce.jason> In reply to @chronos.vitaqua "VSC is the go-to": Thats what I figured, and a good reason to go vscode,
22:11:26FromDiscord<Elegantbeef> There is a fork of saem's that is now official
22:11:37FromDiscord<graveflo> In reply to @Elegantbeef "There is a fork": yea use this one
22:11:41FromDiscord<Elegantbeef> It's not open vsix afaik
22:11:47FromDiscord<pierce.jason> vscode has one from nim-lang.org which i am trying to use
22:11:51FromDiscord<Elegantbeef> or w/e the open plugin place is
22:12:00FromDiscord<graveflo> yea I can't get the new one on codium
22:12:06FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "It's not open vsix": Pain
22:12:13FromDiscord<Elegantbeef> I mean you can get it if you manually download it and install it
22:12:17FromDiscord<Elegantbeef> But that's silly
22:12:22FromDiscord<Elegantbeef> At that point just use kate πŸ˜›
22:12:39FromDiscord<graveflo> I like kate but it has dumbass defaults and pisses the bed sometimes
22:12:51FromDiscord<Elegantbeef> works fine for me
22:13:09FromDiscord<graveflo> vscode has its own warts but it just works and doesn't do anything annoying as far as I'm concerned
22:13:49FromDiscord<pierce.jason> I'll keep trying to get vscode setup, thanks for the advice
22:14:01FromDiscord<Elegantbeef> Actually I take it back an annoying thing with kate is the fact there is no clear way of overriding default LSPs
22:14:19FromDiscord<pierce.jason> current issue is langserv crashing when I start up vscode
22:14:22FromDiscord<Elegantbeef> Fairly certain I've got a `nimlangserver` named `nimlsp` in my .nimble/bin πŸ˜„
22:14:33FromDiscord<graveflo> I couldn't get the nim lang server working without customizing the lsp in kate.. ah well
22:14:57FromDiscord<pierce.jason> https://gist.github.com/pierce-jason/00462061446da52f450fa68f66ad1a18 is the errors i get from the vscode nim-lang plugin
22:15:08FromDiscord<Elegantbeef> Does the official plugin default to nimlangserver now?
22:15:21FromDiscord<graveflo> I also don't like how kate doesn't save temp files. It's annoying to turn my PC off and think "oh did I save that". Makes me feel like I'm using notepad on windows in 2005
22:15:46FromDiscord<Elegantbeef> It does save temp files↡(@graveflo)
22:15:54FromDiscord<Elegantbeef> It creates a `kate.swp` file next to the file
22:16:04FromDiscord<graveflo> not if you havent saved before
22:16:11FromDiscord<pierce.jason> In reply to @Elegantbeef "Does the official plugin": yes, asked me to nimble langserv on vscode startup
22:16:40FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1201652156239708252/image.png?ex=65ca98c7&is=65b823c7&hm=0892301eeabe83e38d0bc0b7c57fb501cf5cd41f1b0e1f536703f82ee9e972fd&
22:16:47FromDiscord<pierce.jason> I also get a popup in vscode that langserv restarted 5 times
22:17:14FromDiscord<Elegantbeef> Is this just an empty `.nim` file?
22:17:21FromDiscord<graveflo> In reply to @Elegantbeef "image.png": what's this? I'm not reading that. i just typed `poweroff` in the terminal
22:17:30FromDiscord<Elegantbeef> Lol
22:17:42FromDiscord<Elegantbeef> Improperly closes programs then wonders why they do not behave πŸ˜„
22:18:09FromDiscord<graveflo> expect they all do. bs i use programs that have modern features πŸ˜‰
22:18:19FromDiscord<graveflo> (edit) "expect" => "except"
22:18:33FromDiscord<Elegantbeef> We just have different expectations
22:18:37FromDiscord<pierce.jason> good question, both files i have tried have contents, let me check on an empty
22:19:33FromDiscord<exelotl> I really want to like Kate but I had the same experience as Graveflo haha
22:19:51FromDiscord<Elegantbeef> You guys just shut off your PC without closing programs you care about?
22:20:13FromDiscord<exelotl> not intentionally
22:20:35FromDiscord<Elegantbeef> I realise I do not use my computer like most people so I guess ok πŸ˜„
22:20:44FromDiscord<Elegantbeef> How many tabs do you lot have open in your web browser right now?
22:21:00FromDiscord<exelotl> but sometimes you can have a hardware blip or your laptop runs out of battery in its sleep or something
22:21:18FromDiscord<Elegantbeef> We're talking about an untitled file though
22:21:29FromDiscord<Elegantbeef> How often are you working on an untitled file?
22:22:02FromDiscord<graveflo> all the time. besides SIGTERM is not improper shutdown
22:22:14FromDiscord<exelotl> I have 12 browser tabs open, 6 vscode windows, one of which has several untitled files which are basically notes I haven't gotten round to saving yet
22:22:19FromDiscord<graveflo> I open files just to type sometimes. I use them as buffers.
22:22:20FromDiscord<Elegantbeef> Why are you so often working on an untitled file that you care about
22:22:29FromDiscord<Elegantbeef> Weird
22:22:38FromDiscord<exelotl> In reply to @graveflo "I open files just": this
22:22:53FromDiscord<graveflo> I care about most things that I type. I don't need to bother giving them a name until I need to. It's much easier to just have my open buffers stay there until Idiscard them ro save them
22:23:21FromDiscord<Elegantbeef> If i'm typing something in an editor I'm saving it to a file, so this is an odd paradigm I'm learning about
22:23:39FromDiscord<graveflo> no it isn't thats why most modern editors have temp files
22:23:48FromDiscord<Elegantbeef> It's weird to me I mean
22:23:49FromDiscord<graveflo> you literally don't have to do that step
22:24:18FromDiscord<graveflo> I dont want to go `rm` a file that I never needed saved
22:24:32FromDiscord<graveflo> if I gotta go do somethign and my computer needs to be turned off I just want to turn it off
22:24:40FromDiscord<graveflo> not shift thru all my programs and make suer I save everything
22:24:51FromDiscord<graveflo> I just turn it off and go. everythign stays as I left it
22:25:02FromDiscord<Elegantbeef> We use our computers very differently
22:25:10FromDiscord<exelotl> I'll be in a meeting, someone will say something important, so I press the Super key, type 'Notepad' open up xed or kwrite or whatever and then start typing
22:25:11FromDiscord<Elegantbeef> I close things I'm not using and like my PC to start up fresh
22:25:43FromDiscord<graveflo> I don't have desktop sessions. I like that feature for my editors
22:25:58FromDiscord<exelotl> it might be a very long time before I actually get around to saving said notes, if ever x)
22:25:58FromDiscord<graveflo> and the browser is nice too
22:26:09FromDiscord<Elegantbeef> I absolutely despise "continue were you left off"
22:26:20FromDiscord<Elegantbeef> So I guess it makes sense why I've never ran into this problem
22:26:35FromDiscord<graveflo> I used to have 100+ pages open in notepad++. some nights I would just spend 2 hours going through them and deciding to save to discard them
22:26:48FromDiscord<Elegantbeef> That's crazy to me
22:26:56FromDiscord<graveflo> it is pretty messed up ngl
22:27:15FromDiscord<graveflo> but I don't really do that much anymore. I just want to be able to turn my computer off at any moment and tend to the outside world
22:27:30FromDiscord<exelotl> there's a notes app on my phone which forces you to name the note before you can type anything, and refuses to let you use a name you previously used
22:27:34FromDiscord<exelotl> it's so bad
22:27:52FromDiscord<Elegantbeef> Meanwhile me\: "That's great"
22:29:03FromDiscord<exelotl> tfw you already made a note called "shopping" and you have to stop and think of a more descriptive name to avoid the clash, and by the time you've solved this mini-puzzle you've forgotten what you even wanted to write down
22:29:44FromDiscord<graveflo> yea.... that is so relatable. You know, some people are not brain-dead though and they just remember stuff
22:29:56FromDiscord<graveflo> but why beef doesn't mind remembering to save his files
22:30:10FromDiscord<graveflo> to me that is like.. its not going to happen. I'm going to lose something and it will piss me off
22:31:03FromDiscord<graveflo> I don't like remembering things the computer can remember for me. It's hard enough as is. That is prime real-estate in my grey matter.
22:31:12FromDiscord<Elegantbeef> Like I said if I'm writing something I'm making a file
22:31:17FromDiscord<Elegantbeef> I close the editor when I'm done
22:31:26FromDiscord<pierce.jason> empty.nim flashes some vscode popup errors that disappeared, but not seeing any persistant errors on blank file
22:31:46FromDiscord<Elegantbeef> If I'm not using a program(chat clients aside) they're closed
22:32:44FromDiscord<graveflo> I get that, but for me that usually a notes app, IDE, multiple terminals, and a web browser. That's a lot of shit to close. I need to go back and forth between all of them while I'm working
22:32:57FromDiscord<Elegantbeef> I don't have that much stuff open
22:33:03FromDiscord<Elegantbeef> I have a text editor and maybe a browser
22:33:14FromDiscord<graveflo> terminal in the editor I guess?
22:33:19FromDiscord<Elegantbeef> Yes
22:33:34FromDiscord<graveflo> I don't like those. Purpose built terminals always work so much better for me
22:33:42FromDiscord<Elegantbeef> To each their own
22:33:52FromDiscord<Elegantbeef> Even if I have a terminal window open, I close it when I'm done coding
22:36:27FromDiscord<graveflo> do you usually end your session on the computer in the heat of development or do you wind down? I always just stop coding by closing everything at once with `poweroff`. If I played games or did other stuff on my computer I could see myself closing everything up
22:36:54FromDiscord<graveflo> Why I say "if".. more like "when"
22:37:06FromDiscord<graveflo> I dont leave that up if I stop coding Im just coding 99% of the time
22:37:23FromDiscord<Elegantbeef> I mean even on my laptop I manually close things when done
22:37:29FromDiscord<Elegantbeef> But it's not like I code on there
22:38:03FromDiscord<Elegantbeef> But yes I do generally code inbetween doing something else
22:43:11*jkl joined #nim
22:43:56FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#pasty=SnGOSsWwkalh
22:52:09FromDiscord<pierce.jason> In reply to @Elegantbeef "Is this just an": starting w/ an empty.nim seems to have cleared up whatever was causing problems. the other file I was working on loads, compiles, and runs fine now
22:53:08FromDiscord<pierce.jason> thanks a million!
22:56:55*jmdaemon joined #nim
23:02:45FromDiscord<Elegantbeef> @user2m Nim has tuple unpacking
23:02:47FromDiscord<Elegantbeef> That's it
23:03:25FromDiscord<Elegantbeef> You can use procs or macros to unpack objects, one example is here https://github.com/beef331/nimtrest/wiki/Code-snippets#unpack-objects-with-optional-fields
23:09:10*advesperacit quit ()
23:10:49FromDiscord<Robyn [She/Her]> I wonder if an alternative docs site would be good for Nim
23:11:00FromDiscord<Robyn [She/Her]> Not sure how it'd look but maybe a different style would be nice...
23:11:18FromDiscord<Robyn [She/Her]> Current docs feel kinda clunky at times, if ya get what I mean
23:21:29FromDiscord<pierce.jason> I don't remember the style, is been years... But I always liked the web docs for php
23:28:22FromDiscord<graveflo> In reply to @chronos.vitaqua "Current docs feel kinda": I think the docs would improve significantly if it generated an alternative view where an object is documented along with every `proc` `template` `iterator` `macro` etc that uses it. It's annoying to try and find all the compatible actions you can do with a type in the docs
23:29:22FromDiscord<graveflo> and that should span the whole std lib. So if a type is defined in `system.nim` it's doc page will have everything that uses it across the entire std lib
23:30:18FromDiscord<graveflo> There's no curated place of "how to use X" it's just a massive info dump of everything in a module. Very time consuming to parse through especially when you are new
23:30:43FromDiscord<anuke> Yeah. I remember being very confused about `seq` in particular
23:31:29FromDiscord<anuke> Most seq-related procs beyond the basics are in `sequtils`, but a few "higher level" ones like `find` are in system.
23:32:00FromDiscord<graveflo> and that is a lucky type that has a module named after it. Try `openArray`. it's everywhere
23:32:43FromDiscord<graveflo> I don't think I've found any good documentation on `openArray` at all actually. I think I understand what it is from this chat
23:32:56FromDiscord<Elegantbeef> the manual has a reference πŸ˜›
23:33:02FromDiscord<graveflo> yea but it sucks
23:33:59FromDiscord<graveflo> In reply to @Elegantbeef "the manual has a": wait do you mean for openArray or for cross referencing entities
23:34:09FromDiscord<anuke> A bigger issue for me is that I can't just type `mySeq.` and have the IDE (whatever that may be) instantly autocomplete everything I can do with it - nimsuggest is broken beyond trivial projects in VSCode across multiple extensions, the langserver didn't work for me either and the intelliJ plugin is incomplete
23:34:20FromDiscord<Elegantbeef> I mean it has documentation on `openArray`
23:35:00FromDiscord<graveflo> yea IDE support is an ongoing issue. It's gotten better as far as I can tell, but it's a far cry from the popular languages.
23:47:41*tiorock joined #nim
23:47:41*tiorock quit (Changing host)
23:47:41*tiorock joined #nim
23:47:41*rockcavera is now known as Guest2497
23:47:41*Guest2497 quit (Killed (lead.libera.chat (Nickname regained by services)))
23:47:41*tiorock is now known as rockcavera