<< 19-04-2023 >>

00:04:21*lucasta joined #nim
00:36:17*azimut joined #nim
01:11:40NimEventerNew thread by termer: Design discussion for KommandKit - async, multithreaded, ORC-ready web framework, see https://forum.nim-lang.org/t/10112
01:16:33*jmdaemon joined #nim
01:38:27*Mister_Magister quit (Excess Flood)
01:39:09*Mister_Magister joined #nim
01:45:30*pharonix71 joined #nim
01:51:49FromDiscord<Yardanico> ah I love https://github.com/PMunch/nim-optionsutils
01:53:21FromDiscord<Yardanico> telebot uses tons of options due to the nature of telegram's bot api, so code can become really messy if you want it to be safe with all the option gets
01:57:27FromDiscord<Yardanico> seems like it creates closure procs though, seems a bit inefficient đŸ€”
02:00:20FromDiscord<Yardanico> ah right there's https://github.com/status-im/questionable, let's see
02:03:33FromDiscord<Yardanico> yeah, it uses blocks instead, no closure procs
02:08:41FromDiscord<Yardanico> damn questionable was made for telebot
02:09:11FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4tKU
02:09:13FromDiscord<Yardanico> and then msg is available in the subsequent code
02:09:15FromDiscord<Yardanico> yes yes magic
02:13:24FromDiscord<Dudugz> In reply to @Yardanico "ah I love https://github.com/PMunch/nim-optionsutil": Got me on the optional chaining operator, javascript has this operator
02:13:53FromDiscord<Dudugz> ``stuff?.prop`` if stuff is none returns none otherwise it tries to get prop and return its value
02:13:57FromDiscord<Yardanico> yes
02:14:27FromDiscord<Yardanico> before/after, I guess I could've written my before code better, but anyway I have my chaining now https://media.discordapp.net/attachments/371759389889003532/1098069065215508560/image.png
02:14:39FromDiscord<Yardanico> damn those APIs with a lot of optional values
02:14:51FromDiscord<Yardanico> i don't dare imagine how such code would look in C++
02:15:07FromDiscord<Elegantbeef> Preprocessor `unpackas` 😄
02:15:08FromDiscord<Dudugz> Is there null coalescence too? ``foo ?? bar`` if foo is none it returns the value of bar, otherwise it returns foo.
02:15:18FromDiscord<Elegantbeef> `wrapNils`
02:15:25FromDiscord<Yardanico> i was already scarred for life when a simple chatgpt cli client in C++ had like 350 lines for parsing a 10-line json config
02:15:30FromDiscord<Elegantbeef> https://nim-lang.org/docs/wrapnils.html
02:15:30FromDiscord<Yardanico> and no, that's not a joke
02:16:10FromDiscord<Elegantbeef> You can easily define that `??` operator
02:17:01FromDiscord<Dudugz> hm, but the example is counterintuitive lol, opt chaining became a unary operator
02:17:06FromDiscord<Dudugz> ?.foo.bar
02:17:23FromDiscord<Elegantbeef> Well Nim does not have postfix operations
02:17:33FromDiscord<Elegantbeef> So you have to use it as a prefix
02:18:25FromDiscord<Dudugz> Serious? I thought you could create binary operators that take left and right inputs
02:18:36FromDiscord<Elegantbeef> That's an infix
02:18:38FromDiscord<Elegantbeef> not a postfix
02:18:44FromDiscord<Dudugz> It's because it makes more sense foo?.bar?.baz
02:18:52FromDiscord<Yardanico> @Dudugz questionable has what you want
02:18:57FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1098070199535681636/image.png
02:19:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tKW
02:19:36FromDiscord<Yardanico> but how about options beef
02:19:40FromDiscord<Elegantbeef> `foo?.bar?` isnt valid Nim
02:19:59FromDiscord<Elegantbeef> Options are da poopoo
02:20:20FromDiscord<Yardanico> what's the alternative for optional stuff in all the apis :((
02:20:37FromDiscord<Elegantbeef> Never having an API developed enough that you need optionals
02:20:42FromDiscord<Dudugz> Yea
02:20:53FromDiscord<Elegantbeef> Excuse me whilst i work on my 999999th project
02:21:34FromDiscord<Dudugz> lol, i could use this in sdl but i am using doAssert to check that objects are not nil
02:23:09*lucasta quit (Ping timeout: 265 seconds)
02:27:11*lucasta joined #nim
02:32:02*lucasta quit (Remote host closed the connection)
02:32:22*lucasta joined #nim
02:40:36FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tKY
02:41:07FromDiscord<Elegantbeef> though `?` is never valid
02:45:21FromDiscord<Elegantbeef> Also this doesnt stop execution properly, so guess it's mostly useless 😄
02:51:21FromDiscord<Dudugz> lol, I was wondering how it could be invalid if it has for example mod and floorMod that performs an operation on both sides
02:51:33FromDiscord<Dudugz> 11 floorMod 10
03:14:35*arkurious quit (Quit: Leaving)
03:52:26*cm quit (Quit: Bye.)
04:02:56*cm joined #nim
04:26:25*cm quit (Quit: Bye.)
04:26:45*cm joined #nim
04:40:19*cm quit (Quit: Bye.)
04:46:20*cm joined #nim
04:55:21*cm quit (Quit: Bye.)
04:58:15*lucasta quit (Remote host closed the connection)
05:22:15*cm joined #nim
06:00:38*rockcavera quit (Remote host closed the connection)
06:09:53*advesperacit joined #nim
06:29:02*PMunch joined #nim
06:38:40*fredrikhr joined #nim
07:26:16*Batzy quit (Quit: No Ping reply in 180 seconds.)
07:27:43*Batzy joined #nim
07:51:56FromDiscord<Rika> In reply to @Dudugz "11 floorMod 10": That is invalid though
07:59:48FromDiscord<newlibarian> how do i upgrade my existing nim to 2.0?
07:59:53FromDiscord<newlibarian> or latest version?
08:10:00FromDiscord<firasuke> is there a better way to write unit tests in Nim? I created a tests directory and I am using testament, but I have to manually invoke it on each test and it creates leftovers that I have to manually clean. something like `nimble test` but that runs all tests in `./tests` directory? or am I doing it wrong?
08:18:08Amun-Rafirasuke: I've created nimble task for that (although I'm using nimble to test and not testament), https://dpaste.com/4B9ED79DK
08:19:19Amun-Rafirasuke: nimble test leaves leftovers too, I clean them via make clean, https://dpaste.com/CA99QFUGL
08:19:41FromDiscord<firasuke> oh ok thanks for that, I will have to check them and see
08:22:29Amun-Rajust replace nimble test cmd with testament one, my task requires test file names to be in form of test_*.nim
08:22:48FromDiscord<firasuke> I see, thanks a lot for the effort
08:22:52Amun-Rano worries
08:24:12Amun-Rait's a task from my image viewer, hence that subdirectory testing
08:24:35Amun-Ra(I can test only image formats native to specific platform)
08:25:53FromDiscord<newlibarian> what is the current stable version of nim 1.6?
08:26:05Amun-Ra1.6.12
08:28:44FromDiscord<newlibarian> so i just used choosen to install 1.6.12 and i had previously install 1.6 so do i have multiple copies of 1.6?
08:29:41FromDiscord<newlibarian> one copy in .nimble and one copy in choosenim/toolchain/1.6.12
08:30:40Amun-Raoh, I've never used choosenim
08:31:05*cm quit (Ping timeout: 240 seconds)
08:31:52PMunch@newlibarian, if you do `choosenim show` you will see all the versions it has installed
08:32:07PMunchIf you have previously installed Nim without choosenim you will now have an extra install from there
08:32:08*cm joined #nim
08:32:20PMunchI recommend removing that install and only using choosenim
08:32:44PMunchBut there shouldn't be a copy in .nimble I don't think
08:33:28FromDiscord<newlibarian> i'm a bit confused.
08:34:23FromDiscord<newlibarian> i originally installed nim without choosenim. and it created .nimble.
08:34:55FromDiscord<newlibarian> and nimcache
08:36:20FromDiscord<newlibarian> and i now i noticed i have choosenim directory was it there before when i instlaled nim without using choosenim?
08:37:51FromDiscord<newlibarian> how do i uninstall nim in .nimble and choosenim
08:39:21FromDiscord<newlibarian> i have a version in .nimble and choosenim
08:49:07PMunchChoosenim creates the choosenim directory
08:49:19PMunchOh wait, are you talking about .nimble/bin/nim?
08:51:00PMunchThat's just a proxy file which calls your choosenim binary. If you look at it that file is <500K in size while the actual Nim compiler is about 6.3M
08:53:58FromDiscord<newlibarian> so right now i have nim in my c root drive, i have choosenim where my .nimble and nimcahse i located.
08:54:16FromDiscord<newlibarian> (edit) "i" => "are"
08:54:58FromDiscord<newlibarian> and it seemed you need the choosenim.exe as an external file to activate choosenim as it's not in the install directory..am i missing something?
08:59:14PMunchOh you're on Windows, then I don't really know
08:59:41PMunchBut yeah, you should keep choosenim around even after Nim has been installed
08:59:55PMunchBut you can remove the Nim install in your C: drive
09:00:04PMunchAnd only keep the one that choosenim installed
09:02:41FromDiscord<newlibarian> well i got a problem wanted to install nim for raylib and it requires 2.0 but the current stable version is 1.6.12
09:03:24FromDiscord<newlibarian> so i guess i have to wait for 2.0 to be stable.
09:03:51FromDiscord<newlibarian> i can't be writing games and trouble shooting the compiler at the same time.
09:12:19PMunchIt's stable enough, it's mostly to give people time to patch up their breaking changes and such
09:12:35PMunchYou can select it by doing `choosenim \#version-2-0`
09:12:40PMunchAt least on Linux
09:18:54FromDiscord<newlibarian> my compiler is actually 1.6.6 not 1.6.12
09:19:40FromDiscord<newlibarian> how can i chose 32bit and 64bit? my previous installed compiler is 32bit
09:22:56PMunchOn Windowws? No idea
09:23:24PMunchDoes `nim --version` and `choosenim show` show different versions?
09:27:08FromDiscord<newlibarian> version is 1.6.6
09:27:26FromDiscord<newlibarian> compiler is 1.6.6 and stable version is 1.6.12
09:28:17PMunchCould you do a codepaste of the output of those two commands?
09:29:39FromDiscord<newlibarian> sent a long message, see http://ix.io/4tM9
09:30:04FromDiscord<newlibarian> (edit) "http://ix.io/4tM9" => "http://ix.io/4tMa"
09:30:29FromDiscord<newlibarian> i installed the 32b i386 cuz i want my exe to be more compatible.
09:30:36PMunchThat means the version that `nim -v` picks up is not the version choo-enim has installed
09:30:41FromDiscord<newlibarian> that was my first install
09:31:16PMunchYou should remove your initial install and use the one from choosenim, then set your path up properly to point to that version
09:31:40PMunchNim 64 bit can still build 32 bit binaries, so there is no point in installing the 32 bit compiler unless you're on a 32 bit machine
09:38:36FromDiscord<newlibarian> i'm on windows should it be choosenim 2.0?? instead of choosenim \#version-2-0?
09:54:57FromDiscord<newlibarian> choosenim is just an exe...
10:02:20PMunchDon't think so, no
10:02:36PMunchversion-2-0 is a tag
10:05:16FromDiscord<newlibarian> sent a long message, see http://ix.io/4tMn
10:14:11FromDiscord<newlibarian> https://github.com/planetis-m/naylib↔WARNING 1: Currently Naylib only works with Nim version 2.0 which is expected to be released soon. Use a nightlies build in the meantime.↔there is something i'm missing. It says, it only works with version 2 but there is no version 2 i can find.
10:15:11FromDiscord<System64 ~ Flandre Scarlet> In reply to @newlibarian "https://github.com/planetis-m/naylib WARNING 1: Cur": Nim 1.9 is Nim 2.0
10:16:25FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4tMr
10:16:31FromDiscord<Rika> 10
10:16:36FromDiscord<Rika> Inclusive
10:16:54FromDiscord<System64 ~ Flandre Scarlet> Woops!↔And what to do for non-inclusive,
10:16:58FromDiscord<System64 ~ Flandre Scarlet> (edit) "non-inclusive," => "non-inclusive?"
10:20:20FromDiscord<Yardanico> In reply to @System64 "Woops! And what to": 0..9
10:20:22FromDiscord<Yardanico> or 0..<10
10:21:15FromDiscord<System64 ~ Flandre Scarlet> Oh alright, thanks!
10:21:44FromDiscord<System64 ~ Flandre Scarlet> btw Nim Playground dead?
10:21:54FromDiscord<System64 ~ Flandre Scarlet> I have gateway timeout
10:37:57PMunch@System64_~_Flandre_Scarlet, back up now
10:39:32PMunchNot quite sure what happens, but it seems like the actual playground server code blocks up
10:39:47PMunchTypically this has been a resource issue, but now it just seems to get stuck
10:39:52FromDiscord<System64 ~ Flandre Scarlet> Thanks!
12:45:01*om3ga quit (Ping timeout: 240 seconds)
12:58:57*progranner joined #nim
13:04:50*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz
)
13:07:34*progranner joined #nim
14:00:57*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz
)
14:05:30*progranner joined #nim
14:07:13*PMunch quit (Quit: Leaving)
14:24:05*Notxor joined #nim
14:28:58*rockcavera joined #nim
14:46:19*om3ga joined #nim
15:08:17FromDiscord<Hundo> Hi, I'm trying to work with bitfields but the example code at https://nim-lang.org/docs/manual.html#set-type-bit-fields is reporting "Warning: target type is larger than source type" on toNum. Is there a safe way to cast a set instance to an integer?
15:10:10*fredrikhr quit (Quit: Disconnecting...)
15:20:56*Notxor quit (Remote host closed the connection)
15:46:31*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz
)
15:48:31*Notxor joined #nim
15:49:09FromDiscord<demotomohiro> When you create a set of enum, make sure that the size specified in size pragma for the enum and the sizeof int you want to cast are match.
15:50:27FromDiscord<michaelb.eth> there is a thing where in devel/2.0 (and maybe backported to latest 1.6, not sure), casts from smaller to larger ints trigger a warning
15:50:35FromDiscord<michaelb.eth> and for good reason in some cases
15:50:51FromDiscord<michaelb.eth> but stdlib does a fair bit of that in some modules
15:52:32FromDiscord<michaelb.eth> for example: https://github.com/michaelsbradleyjr/nim-notcurses/blob/master/examples/cli2.nim#L21↔the reason I added the `.uint64` is because `toHex` (or something it calls, can't recall exactly atm) does a cast, and I didn't want to see the compiler warning
15:53:10FromDiscord<michaelb.eth> (edit) "for example: https://github.com/michaelsbradleyjr/nim-notcurses/blob/master/examples/cli2.nim#L21↔the reason I added the `.uint64` is because `toHex` ... (or" added "from std/strutils"
15:54:10*cm quit (Ping timeout: 250 seconds)
15:54:47*cm joined #nim
15:56:40FromDiscord<demotomohiro> sent a long message, see http://ix.io/4tNG
15:57:25FromDiscord<michaelb.eth> see also: https://github.com/nim-lang/Nim/pull/20103#issuecomment-1435273038
15:59:41*cm_ joined #nim
15:59:45*cm quit (Ping timeout: 260 seconds)
16:00:02*cm_ is now known as cm
16:06:45*cm quit (Ping timeout: 260 seconds)
16:06:46*cm_ joined #nim
16:07:10*cm_ is now known as cm
16:08:40*arkurious joined #nim
16:16:05*cm quit (Ping timeout: 240 seconds)
16:17:35*cm joined #nim
16:18:03FromDiscord<Hundo> Thanks for your replies. I should have mentioned that I am compiling with nim 1.9.3. The example code from the manual does seem to be using the same type for the enum size pragma and the cast but it appears that while the enum does have sizeof((MyFlag)==sizeof(cint), which is 4 bytes, the sizeof the set type (MyFlags) is only a single byte.
16:22:24*cm quit (Ping timeout: 255 seconds)
16:22:56*cm joined #nim
16:23:16FromDiscord<michaelb.eth> 1.9.3 is 2.0 RC2
16:23:38FromDiscord<michaelb.eth> (edit) "RC2" => "release candidate 2"
16:33:26*cm_ joined #nim
16:34:33*cm quit (Ping timeout: 255 seconds)
16:34:33*cm_ is now known as cm
16:37:14*azimut quit (Ping timeout: 255 seconds)
16:38:18*cm_ joined #nim
16:38:58*cm quit (Ping timeout: 252 seconds)
16:38:58*cm_ is now known as cm
16:48:22FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4tNY
16:49:05FromDiscord<0ffh> XmlNode should be defined in xmlparser
16:49:06FromDiscord<Dale> Does `xmlparser` export the `xmlnode` type?
16:49:26FromDiscord<0ffh> In reply to @Dale "Does `xmlparser` export the": I assumed so. Would be pretty useless if it didn't no?
16:49:59FromDiscord<0ffh> But I'll check.
16:50:35FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=
16:50:38*progranner joined #nim
16:51:03FromDiscord<0ffh> (edit) "https://play.nim-lang.org/#ix=" => "https://play.nim-lang.org/#ix=4tNZ"
16:52:13*progranner quit (Client Quit)
16:52:25FromDiscord<0ffh> Oh no, you're right!
16:52:42FromDiscord<0ffh> I clicked on "XmlNode" in the docs, then on "source".
16:53:03FromDiscord<0ffh> But "XmlNode" took me from the "XmlParser" to the "XmlTree" docs.
16:53:27FromDiscord<0ffh> So it's defined in XmlTree, probably not re-exported.
16:54:39FromDiscord<0ffh> In reply to @Dale "Does `xmlparser` export the": Yup, that was it, thanks!↔I'd call that a major weirdness in the stdlib, though.
16:54:59FromDiscord<Dale> Probably worth a bug report
16:56:13FromDiscord<Dale> It may be intentional so you have to specifically bring in the tree source, but I've no idea
16:57:05FromDiscord<0ffh> Yeah, still, having a lib who'se whole raison d'etre is to produce values of a type that you don't export seems strange.
16:57:57FromDiscord<Dale> For sure!
17:02:46FromDiscord<Weldify> im trying to index a sequence backwards by using https://media.discordapp.net/attachments/371759389889003532/1098292619722899546/image.png
17:02:53FromDiscord<Weldify> and for some reason im getting this error: https://media.discordapp.net/attachments/371759389889003532/1098292647594045612/image.png
17:03:08FromDiscord<Weldify> am i doing something wrong?
17:04:28*progranner joined #nim
17:04:37FromDiscord<0ffh> In reply to @Weldify "am i doing something": I think the last element is -1 not -0.
17:04:46FromDiscord<0ffh> you start i at 0.
17:05:02FromDiscord<Weldify> oh right
17:05:16FromDiscord<Weldify> yep, seems to work
17:05:59FromDiscord<Weldify> thanks!
17:09:36*lucasta joined #nim
17:32:02*Notxor quit (Remote host closed the connection)
17:36:28FromDiscord<firasuke> I have a function that takes a sequence of strings as an argument, sometimes I use this function to pass a sequence of a known length, and sometimes I don't know the length, should I use `openArray` type of `seq` in this case for when I am passing something of known length I don't have to use the `@` and allocate unneeded stuff on the heap?
17:36:53FromDiscord<firasuke> (edit) "I have a function that takes a sequence of strings as an argument, sometimes I use this function to pass a sequence of a known length, and sometimes I don't know the length, should I use `openArray` type of `seq` in this case for when I am passing something of known length ... I" added "so"
17:39:45FromDiscord<firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4tO4
17:47:29*oprypin quit (Quit: Bye)
17:47:48*oprypin joined #nim
18:13:03NimEventerNew thread by alexeypetrushin: Avoid copying large string?, see https://forum.nim-lang.org/t/10113
18:21:01*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz
)
18:24:06*pharonix71 quit (Remote host closed the connection)
18:24:28*progranner joined #nim
18:24:34*pharonix71 joined #nim
18:27:09FromDiscord<Arvin❓> sent a code paste, see https://play.nim-lang.org/#ix=4tOd
18:27:15*Notxor joined #nim
18:28:56FromDiscord<Arvin❓> (edit) "https://paste.rs/NQU" => "https://play.nim-lang.org/#ix=4tOg"
18:29:06FromDiscord<Arvin❓> (edit) "https://play.nim-lang.org/#ix=4tOg" => "https://play.nim-lang.org/#ix=4tOh"
18:30:06*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz
)
18:30:56*progranner joined #nim
18:45:41FromDiscord<auxym> In reply to @Arvin❓ "I tried using the": That's something you should report to the library author as a bug. As for other modules, you could use winim, which are low-level bindings for the win32 API
19:00:17FromDiscord<Nerve> In reply to @firasuke "I have a function": I just tested this, and yeah, `openarray` can take both `seq` and `array` arguments. So yeah, if you feed it literal arrays like your example (without the `@`), those will most likely get hoisted as `const` arrays and not even be stack allocated.
19:00:53FromDiscord<Nerve> A compiler dev might know more about how that would behave
19:01:15FromDiscord<firasuke> In reply to @Nerve "I just tested this,": so performance wise, if in some cases I end up passing arrays of known length, it would be better to have `openArray` instead of `seq`
19:01:24FromDiscord<Nerve> Seems so
19:02:12FromDiscord<firasuke> if I understood correctly, then openArray is a generic type that gets evaluated to an array of X size or to a sequence based on the `@` that is passed, so in the cases where I am passing something of known length with no `@` it would get passed as an array of X size on the stack
19:04:14FromDiscord<Nerve> Yes, the equivalent, if I am understanding correctly, is effectively having a template procedure `myfunc[N](arrayseq: seq[string] | array[N, string])` where `myFunc` gets compiled as many times for as many array lengths as you pass it, plus a seq version. Assuming you use only the interface elements the two types share, which is most of their procs.
19:04:52FromDiscord<Nerve> (edit) "`myfunc[N](arrayseq:" => "`proc myProc[N](arrayseq:"
19:05:37FromDiscord<Nerve> (edit) "Yes, the equivalent, if I am understanding correctly, is effectively having a template procedure `proc myProc[N](arrayseq: seq[string] | array[N, string])` where `myFunc` gets compiled as many times for as many array lengths as you pass it, plus a seq version. Assuming you use only the interface elements ... theprocs" added "with signatures" | "procs." => "procs and iterators and such."
19:09:28*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz
)
19:17:17*progranner joined #nim
19:17:20FromDiscord<firasuke> so in short it is slightly better than having `seq` for all cases
19:51:09FromDiscord<Elegantbeef> Well `openArray` isnt really a generic
19:51:25FromDiscord<Elegantbeef> It's a type that array/seq's can implicitly convert to
19:51:30FromDiscord<huantian> openArray is just magic
20:01:30FromDiscord<Arvin❓> In reply to @auxym "That's something you should": damn this winim sounds like it may give me migraines
20:04:27FromDiscord<firasuke> In reply to @Elegantbeef "It's a type that": ok cool, so in the cases where an array is passed, it is converted to a fix sized array on the stack, instead of a dynamically sized one (sequence) on the heap
20:06:49FromDiscord<Elegantbeef> Well it's converted into a ptr and len
20:06:54FromDiscord<Elegantbeef> There are no allocations
20:27:56FromDiscord<firasuke> ok cool
21:06:45*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz
)
21:13:10*lucasta quit (Remote host closed the connection)
21:16:17FromDiscord<firasuke> I have a `try:`/`finally:` block where I have a bunch of `quit()` inside the `try` block, these are preventing the `finally` block from running, is there a better approach to handle these? I tried `defer`, but to no avail...
21:40:06*Guest31 joined #nim
21:40:38*Guest31 quit (Client Quit)
21:47:01*Notxor quit (Remote host closed the connection)
21:54:30*advesperacit quit ()
21:55:44FromDiscord<firasuke> so apparently `defer` is deprecated now, so I guess it would be better to replace the `quit()` with `return`?
22:00:58FromDiscord<Elegantbeef> Quit closes the program
22:01:05FromDiscord<Elegantbeef> return does not
22:01:29FromDiscord<Elegantbeef> Also defer is deprecated?
22:03:24FromDiscord<firasuke> In reply to @Elegantbeef "Quit closes the program": ok I have multiple end points where I do `quit(exitCode)`, I am creating a lock file at the beginning of my CLI's execution, and I want to remove it when execution ends regardless if it was successful or not (just to tell that the CLI has only one instance running)
22:03:42FromDiscord<Elegantbeef> Make your own quit proc?
22:03:52FromDiscord<firasuke> oh I can do that xD
22:04:52FromDiscord<Elegantbeef> That's what they tell me
22:05:47FromDiscord<firasuke> xD but is it a good design choice? I can create a `custom_quit()` but then overriding `quit()` is better, or not?
22:06:25FromDiscord<Elegantbeef> You do you
22:07:50FromDiscord<firasuke> I'd take that as a yes, I can do both, but I will go with a `custom_quit()`
22:07:52FromDiscord<firasuke> thanks for pointing that out
22:08:27FromDiscord<Elegantbeef> You also could use an exit proc if you really wanted and just return
22:10:41FromDiscord<firasuke> In reply to @Elegantbeef "You also could use": nim has an exit proc?
22:10:58FromDiscord<Elegantbeef> https://nim-lang.org/docs/exitprocs.html
22:13:13FromDiscord<firasuke> cool
22:14:16*azimut joined #nim
22:53:05FromDiscord<faldor20> I've been reading through the experimental features of nim in the docs, and it's so weird. The docs are really comprehensive at explaining the implementation and features, but consistently completely fail to provide a single real example of where you use this feature, or even explanation of why it's useful. It's very strange for a language that claims to be pragmatic.
22:55:44Amun-Rafirasuke: or make a single quit outside of try block
22:56:24Amun-Rafaldor20: I haven't seen any language docs that do that
22:58:57FromDiscord<faldor20> sent a long message, see http://ix.io/4tOV
23:02:00FromDiscord<faldor20> sent a long message, see http://ix.io/4tOX
23:03:20FromDiscord<faldor20> (edit) "http://ix.io/4tOX" => "http://ix.io/4tOY"
23:04:33Amun-Rathe only think I've noticed that wasn't described in terms of why is effects
23:05:16FromDiscord<faldor20> Hahah I was going to mention that and I honestly thought that one might be considered self explanatory enough 😅
23:05:57Amun-Rathing*
23:09:41FromDiscord<Elegantbeef> Views is a borrow checker practically
23:09:54FromDiscord<Elegantbeef> No not nil and options are not the same
23:10:14Amun-Raoption is a common language type, and primary usage is mentioned in the docs
23:11:27Amun-Raviews are iirc still in experimental phase
23:11:43FromDiscord<Elegantbeef> Options are for adding 1 value to a type(except they do not in Nim for ref/pointers)
23:11:53FromDiscord<Elegantbeef> Not nil is for disallowing `nil` in a ref type statically
23:12:32FromDiscord<Elegantbeef> I mean they were reading the experimental manual amun
23:13:33FromDiscord<Elegantbeef> The manual describes how the language works so it does not say what things are for generally
23:13:40FromDiscord<Elegantbeef> Plus it's experimental
23:15:24FromDiscord<Weldify> i started learning nim 2 days ago along with the nico framework and its been an absolute blast so far
23:15:41FromDiscord<Weldify> nim is amazing
23:22:51*rockcavera quit (Read error: Connection reset by peer)
23:34:02*rockcavera joined #nim
23:34:02*rockcavera quit (Changing host)
23:34:02*rockcavera joined #nim
23:34:49*lucasta joined #nim