<< 27-06-2025 >>

00:08:31*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
00:13:15*end quit (Ping timeout: 252 seconds)
00:14:25*bcksl quit (Ping timeout: 244 seconds)
00:36:56*bcksl joined #nim
00:43:59*end joined #nim
03:13:47*xet7 quit (Remote host closed the connection)
03:20:27FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=QIdofRee
03:21:02FromDiscord<janakali> (edit) "https://play.nim-lang.org/#pasty=IMfgdHAU" => "https://play.nim-lang.org/#pasty=vPimXnyh"
03:24:39FromDiscord<janakali> You also might need to logout & login if you've added the path to `~/.profile` or similar file.
03:48:24FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=eBUrmarS
03:48:29FromDiscord<DetermiedNim1> (edit) "https://play.nim-lang.org/#pasty=kGdUeFbO" => "https://play.nim-lang.org/#pasty=EAhJPteU"
03:48:31FromDiscord<DetermiedNim1> (i use nushell)
03:50:08FromDiscord<DetermiedNim1> its the same with bash https://media.discordapp.net/attachments/371759389889003532/1388003440529248417/image.png?ex=685f6670&is=685e14f0&hm=94cc1cbd6ffbdb1b3d980f1e0206a2defd56760a70d2f0720b54a9f7543b2693&
04:15:54FromDiscord<leorize> do you happen to have nim in .nimble/bin?
04:18:03FromDiscord<leorize> also, that doesn't say anything, because bash running from nushell would inherit nushell's environment, esp with `-c` which disables sourcing of any `rc` files↵(@DetermiedNim1)
04:28:02FromDiscord<DetermiedNim1> oh true
04:32:14FromDiscord<DetermiedNim1> hmm
04:32:41FromDiscord<DetermiedNim1> oooh wait it probably got fixed when i restarted and i didnt notice cause i already did the alias thing
04:32:43FromDiscord<DetermiedNim1> it works now
05:51:55*xutaxkamay quit (Ping timeout: 268 seconds)
05:52:07*xutaxkamay_ joined #nim
05:53:06*xutaxkamay_ is now known as xutaxkamay
06:09:34*skippy8 joined #nim
07:25:56*jjido joined #nim
07:36:18*beholders_eye quit (Ping timeout: 272 seconds)
08:26:02FromDiscord<arnetheduck> sent a long message, see https://pasty.ee/KMKCcpti
08:27:58*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
10:37:01*skippy8 quit (Ping timeout: 252 seconds)
10:38:27FromDiscord<hawkey5212> sent a code paste, see https://play.nim-lang.org/#pasty=RmDUUHjY
10:43:17FromDiscord<arnetheduck> sent a code paste, see https://play.nim-lang.org/#pasty=UMXYyfJJ
10:44:07FromDiscord<arnetheduck> sent a code paste, see https://play.nim-lang.org/#pasty=HDNBjOBH
10:48:07FromDiscord<hawkey5212> so `error` is automagically the error result?
10:48:15FromDiscord<hawkey5212> thanks
10:59:10*skippy8 joined #nim
11:09:41FromDiscord<arnetheduck> In reply to @hawkey5212 "so `error` is automagically": https://github.com/arnetheduck/nim-results/blob/df8113dda4c2d74d460a8fa98252b0b771bf1f27/results.nim#L1208 (though it's no longer experimental really, it used to be that there were bugs in nim that were preventing it from working, but these have since been address)
11:43:09*nils` quit (Ping timeout: 260 seconds)
11:49:09FromDiscord<lla_dane> Hey folks, I'm trying to set up a Nim development environment in VS Code and could use some help. ↵I've installed the official nim extension (nim-lang.nim) maintained by the compiler team in VS Code. Right now I only get basic syntax highlighting - no code navingation, no go-to-defination, no symbol lookup, nothing that would help with debugging or understanding code. ↵Some help would be great to set up nim properly.
11:49:52FromDiscord<lla_dane> (edit) "navingation," => "navigation,"
11:54:02FromDiscord<hawkey5212> In reply to @lla_dane "Hey folks, I'm trying": I hope to be corrected, because I'm in the same boat, but as far as I'm aware, these functionalities just straight up don't exist, or have flakey functionality.↵↵go to definition often fails me, or takes a long time. For code navigation, I use `grep` based tooling for the most part. Can't help you with the vscode setup, but I can share with you my neovim setup, and explain the hotkey
11:59:25FromDiscord<hawkey5212> sent a code paste, see https://play.nim-lang.org/#pasty=BkHewSPh
12:05:49FromDiscord<arnetheduck> there's an idiom `if (let v = foo(); v.isSome): let v = v.get(); <use v>` and templates / macros that help make that less ugly to swallow - for better options, we need to wait for sum types to be shipped.↵↵in the meantime, there's the option to use `Opt[T]` that comes with nim-results and is mostly a drop-in replacement and flip the condition, ie `let id = ?foo()`,
12:13:04FromDiscord<hawkey5212> sent a code paste, see https://play.nim-lang.org/#pasty=tXeBBgNS
12:59:31FromDiscord<janakali> sent a long message, see https://pasty.ee/CWFBXzIP
13:05:41FromDiscord<janakali> I don't usually use vscode, but still have it installed to know the status quo.↵It works, at least with my projects (none of them are big or use macros).↵But lsp, for some reason, has a delay in vscode, it works a lot faster for me in neovim. 🤔
13:13:05*nils` joined #nim
13:57:59FromDiscord<litlighilit> Use nimsem's Nim extension↵(@lla_dane)
13:58:00FromDiscord<litlighilit> @lla_dane which works fine for me
14:10:43FromDiscord<lainlaylie> this is counterproductive. use the official one and report bugs
15:13:03FromDiscord<arnetheduck> In reply to @hawkey5212 "hmmmm. neither of those": actually, I just remember that `foo.isErrOr: echo value` might do the trick
15:13:10FromDiscord<arnetheduck> (edit) "remember" => "remembered"
15:13:56FromDiscord<arnetheduck> I'm not sure I love that syntax, where were the critical thinkers when I was adding that ... 🙂
15:14:41FromDiscord<hawkey5212> why not `foo.isErrOr(val): echo val`. This magically appearing variable is... _something_ I spose.
15:14:55FromDiscord<hawkey5212> (edit) "val`." => "val`?"
15:15:44FromDiscord<arnetheduck> In reply to @hawkey5212 "why not `foo.isErrOr(val): echo": `val` might read as a default here
15:16:15FromDiscord<arnetheduck> whereas `value` and `error` are already established names in the library
15:16:54FromDiscord<arnetheduck> ie `valueOr(val)` _would_ be a default
15:17:42FromDiscord<hawkey5212> so `value` and `error` are just two keywords that serve the role of variables and get silently assigned under the hood?
15:17:49FromDiscord<arnetheduck> yes
15:19:11FromDiscord<arnetheduck> more specifically, they're templates that give you direct rvalue access to the storage of the inner value
15:19:18FromDiscord<hawkey5212> Is there any way to go about writing my code so that those two variables are effectively removed from the code base? I really don't like the idea of tracking implied values.
15:19:36FromDiscord<arnetheduck> don't use `valueOr` 🙂
15:20:03FromDiscord<arnetheduck> they only exist within the scope of those functions, and they're not variables, just accessors
15:20:13FromDiscord<arnetheduck> (edit) "functions," => "functions (templates really),"
15:21:21FromDiscord<hawkey5212> so in order to access a good idiom, I have to pay for it by accepting the presence of magic variables. Am I understanding this correctly?
15:21:56FromDiscord<hawkey5212> (opinion caveat applies)
15:22:06FromDiscord<arnetheduck> of the options I can think of right now, yes
15:22:42FromDiscord<arnetheduck> like mentioned, there are libraries that add all kinds of macros and operators around this to make it look different or let you choose the variable name and so on - this is just what you get out of the box
15:24:27FromDiscord<arnetheduck> https://github.com/codex-storage/questionable is one example
15:24:30FromDiscord<hawkey5212> I don't want to use non std libraries to change the syntax of the language. That's a down stream solution to an upstream problem, which comes with all kinds of problems.↵↵I'll just wait, hoping that the language itself works things out.
15:24:55FromDiscord<arnetheduck> some consider it a feature of nim, that you _can_ change the syntax of the language 😉
15:25:34FromDiscord<arnetheduck> ie the `?` operator in nim-results is an outcome of being able to change the syntax
15:25:53FromDiscord<arnetheduck> it just so happens to be familiar thanks to a few languages popularising it
15:28:24FromDiscord<hawkey5212> sent a long message, see https://pasty.ee/cqqZEeZI
15:30:18FromDiscord<ieltan> In reply to @hawkey5212 "it means that changing": I don't see a problems if the idioms are contained within the library code, the Nim-results library has the ability to convert value errors into exception and vice versa
15:30:45FromDiscord<ieltan> If you're contributing to said library and you missed said idioms it will be caught at code review for you
15:31:26FromDiscord<hawkey5212> I mean, it's _cool_, and certainly impressive, don't get me wrong.
15:31:55FromDiscord<arnetheduck> like traditions and laws, every idiom starts not being a an idiom _somewhere_ - a library is just a way to bootstrap the process ... now, most of us don't use questionable for the reasons you mention, but then again, using nim-results is in and of itself a "non-standard extension" to the language
15:32:09FromDiscord<ieltan> The good thing about nim is that it lets you change the syntax but you don't have to use it if you don't want to... They are usually there as sugar for standard looking code
15:32:21FromDiscord<hawkey5212> In reply to @ieltan "I don't see a": and I wouldn't see a problem with it either, if I could know that I would only ever deal with projects that use one very carefully curated clobbering of the language, and it was kept the same across projects.
15:35:07FromDiscord<hawkey5212> I think this discussion has taken a turn that's not entirely constructive. Appologies for any role I played in it.↵↵I don't think I have anything left unsaid about this.
15:35:33FromDiscord<ieltan> Well I get it but the issue of micro-DSL exist in every language that has macros and let you transform the ast, IME it's pretty rare to have encounter libraries who force you to use said DSL everytime you contribute as they're used to do away with boiler plate but I get the concern 🙂
15:37:55FromDiscord<ieltan> I also don't think you're wrong or unconstructive btw you raised valid concerns I just thought I would throw my two cents
15:39:21FromDiscord<ieltan> Btw "magic variables" are used in the std library too, see `mapIt` or anything with `It`
15:40:33FromDiscord<hawkey5212> yeah. don't know how to respond to that one.
15:43:27FromDiscord<ieltan> Well fortunately the language is keen on "don't pay for what you don't use", the solution is to look away and not use them
15:44:09FromDiscord<ieltan> You have `map` that serve the same purpose
15:52:14*skippy8 quit (Quit: WeeChat 4.6.3)
15:58:35*xet7 joined #nim
16:02:55FromDiscord<litlighilit> may be due to lack of `nimlangserver`, ref https://github.com/nim-lang/vscode-nim#code-completion↵(@lla_dane)
16:47:45*fabricio joined #nim
17:36:51*nils` quit (Ping timeout: 276 seconds)
17:47:04*ftajhii quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
17:54:37*ftajhii joined #nim
18:53:33*nils` joined #nim
19:00:14*beholders_eye joined #nim
19:52:02*amadaluzia joined #nim
20:11:49FromDiscord<shalokshalom> In reply to @ieltan "The good thing about": Can I create new keywords and concepts, as in Lisp?
20:19:03FromDiscord<ieltan> In reply to @shalokshalom "Can I create new": I don't know much about lisp so I can't say. Command syntax with macros/template sorta does act as keyword-like, for instance await is a user space defined template, in other languages it's typically a keyword because it needs compiler magic...
20:20:33FromDiscord<ieltan> And it depends on the concept you want to create, but I think I need to be more specific, it's not that you're changing the syntax but the AST in the end the language must still be valid AST there's no way around that
20:40:12*fabricio quit (Quit: WeeChat 3.5)
20:55:41*jjido joined #nim
21:05:39FromDiscord<shalokshalom> In lisp is the AST the source language
21:14:05*amadaluzia quit (Quit: ZNC 1.9.1 - https://znc.in)
21:19:23*amadaluzia joined #nim
21:52:44*amadaluzia quit (Ping timeout: 260 seconds)
22:25:44*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
22:38:15*xtr00 quit (Ping timeout: 252 seconds)
23:03:03*xtr00 joined #nim
23:09:00*xtr00 quit (Quit: ZNC 1.9.1 - https://znc.in)
23:12:32*xtr00 joined #nim