00:04:21 | * | lucasta joined #nim |
00:36:17 | * | azimut joined #nim |
01:11:40 | NimEventer | New 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:49 | FromDiscord | <Yardanico> ah I love https://github.com/PMunch/nim-optionsutils |
01:53:21 | FromDiscord | <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:27 | FromDiscord | <Yardanico> seems like it creates closure procs though, seems a bit inefficient đ€ |
02:00:20 | FromDiscord | <Yardanico> ah right there's https://github.com/status-im/questionable, let's see |
02:03:33 | FromDiscord | <Yardanico> yeah, it uses blocks instead, no closure procs |
02:08:41 | FromDiscord | <Yardanico> damn questionable was made for telebot |
02:09:11 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4tKU |
02:09:13 | FromDiscord | <Yardanico> and then msg is available in the subsequent code |
02:09:15 | FromDiscord | <Yardanico> yes yes magic |
02:13:24 | FromDiscord | <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:53 | FromDiscord | <Dudugz> ``stuff?.prop`` if stuff is none returns none otherwise it tries to get prop and return its value |
02:13:57 | FromDiscord | <Yardanico> yes |
02:14:27 | FromDiscord | <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:39 | FromDiscord | <Yardanico> damn those APIs with a lot of optional values |
02:14:51 | FromDiscord | <Yardanico> i don't dare imagine how such code would look in C++ |
02:15:07 | FromDiscord | <Elegantbeef> Preprocessor `unpackas` đ |
02:15:08 | FromDiscord | <Dudugz> Is there null coalescence too? ``foo ?? bar`` if foo is none it returns the value of bar, otherwise it returns foo. |
02:15:18 | FromDiscord | <Elegantbeef> `wrapNils` |
02:15:25 | FromDiscord | <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:30 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/wrapnils.html |
02:15:30 | FromDiscord | <Yardanico> and no, that's not a joke |
02:16:10 | FromDiscord | <Elegantbeef> You can easily define that `??` operator |
02:17:01 | FromDiscord | <Dudugz> hm, but the example is counterintuitive lol, opt chaining became a unary operator |
02:17:06 | FromDiscord | <Dudugz> ?.foo.bar |
02:17:23 | FromDiscord | <Elegantbeef> Well Nim does not have postfix operations |
02:17:33 | FromDiscord | <Elegantbeef> So you have to use it as a prefix |
02:18:25 | FromDiscord | <Dudugz> Serious? I thought you could create binary operators that take left and right inputs |
02:18:36 | FromDiscord | <Elegantbeef> That's an infix |
02:18:38 | FromDiscord | <Elegantbeef> not a postfix |
02:18:44 | FromDiscord | <Dudugz> It's because it makes more sense foo?.bar?.baz |
02:18:52 | FromDiscord | <Yardanico> @Dudugz questionable has what you want |
02:18:57 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/1098070199535681636/image.png |
02:19:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tKW |
02:19:36 | FromDiscord | <Yardanico> but how about options beef |
02:19:40 | FromDiscord | <Elegantbeef> `foo?.bar?` isnt valid Nim |
02:19:59 | FromDiscord | <Elegantbeef> Options are da poopoo |
02:20:20 | FromDiscord | <Yardanico> what's the alternative for optional stuff in all the apis :(( |
02:20:37 | FromDiscord | <Elegantbeef> Never having an API developed enough that you need optionals |
02:20:42 | FromDiscord | <Dudugz> Yea |
02:20:53 | FromDiscord | <Elegantbeef> Excuse me whilst i work on my 999999th project |
02:21:34 | FromDiscord | <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:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tKY |
02:41:07 | FromDiscord | <Elegantbeef> though `?` is never valid |
02:45:21 | FromDiscord | <Elegantbeef> Also this doesnt stop execution properly, so guess it's mostly useless đ |
02:51:21 | FromDiscord | <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:33 | FromDiscord | <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:56 | FromDiscord | <Rika> In reply to @Dudugz "11 floorMod 10": That is invalid though |
07:59:48 | FromDiscord | <newlibarian> how do i upgrade my existing nim to 2.0? |
07:59:53 | FromDiscord | <newlibarian> or latest version? |
08:10:00 | FromDiscord | <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:08 | Amun-Ra | firasuke: I've created nimble task for that (although I'm using nimble to test and not testament), https://dpaste.com/4B9ED79DK |
08:19:19 | Amun-Ra | firasuke: nimble test leaves leftovers too, I clean them via make clean, https://dpaste.com/CA99QFUGL |
08:19:41 | FromDiscord | <firasuke> oh ok thanks for that, I will have to check them and see |
08:22:29 | Amun-Ra | just replace nimble test cmd with testament one, my task requires test file names to be in form of test_*.nim |
08:22:48 | FromDiscord | <firasuke> I see, thanks a lot for the effort |
08:22:52 | Amun-Ra | no worries |
08:24:12 | Amun-Ra | it's a task from my image viewer, hence that subdirectory testing |
08:24:35 | Amun-Ra | (I can test only image formats native to specific platform) |
08:25:53 | FromDiscord | <newlibarian> what is the current stable version of nim 1.6? |
08:26:05 | Amun-Ra | 1.6.12 |
08:28:44 | FromDiscord | <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:41 | FromDiscord | <newlibarian> one copy in .nimble and one copy in choosenim/toolchain/1.6.12 |
08:30:40 | Amun-Ra | oh, I've never used choosenim |
08:31:05 | * | cm quit (Ping timeout: 240 seconds) |
08:31:52 | PMunch | @newlibarian, if you do `choosenim show` you will see all the versions it has installed |
08:32:07 | PMunch | If you have previously installed Nim without choosenim you will now have an extra install from there |
08:32:08 | * | cm joined #nim |
08:32:20 | PMunch | I recommend removing that install and only using choosenim |
08:32:44 | PMunch | But there shouldn't be a copy in .nimble I don't think |
08:33:28 | FromDiscord | <newlibarian> i'm a bit confused. |
08:34:23 | FromDiscord | <newlibarian> i originally installed nim without choosenim. and it created .nimble. |
08:34:55 | FromDiscord | <newlibarian> and nimcache |
08:36:20 | FromDiscord | <newlibarian> and i now i noticed i have choosenim directory was it there before when i instlaled nim without using choosenim? |
08:37:51 | FromDiscord | <newlibarian> how do i uninstall nim in .nimble and choosenim |
08:39:21 | FromDiscord | <newlibarian> i have a version in .nimble and choosenim |
08:49:07 | PMunch | Choosenim creates the choosenim directory |
08:49:19 | PMunch | Oh wait, are you talking about .nimble/bin/nim? |
08:51:00 | PMunch | That'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:58 | FromDiscord | <newlibarian> so right now i have nim in my c root drive, i have choosenim where my .nimble and nimcahse i located. |
08:54:16 | FromDiscord | <newlibarian> (edit) "i" => "are" |
08:54:58 | FromDiscord | <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:14 | PMunch | Oh you're on Windows, then I don't really know |
08:59:41 | PMunch | But yeah, you should keep choosenim around even after Nim has been installed |
08:59:55 | PMunch | But you can remove the Nim install in your C: drive |
09:00:04 | PMunch | And only keep the one that choosenim installed |
09:02:41 | FromDiscord | <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:24 | FromDiscord | <newlibarian> so i guess i have to wait for 2.0 to be stable. |
09:03:51 | FromDiscord | <newlibarian> i can't be writing games and trouble shooting the compiler at the same time. |
09:12:19 | PMunch | It's stable enough, it's mostly to give people time to patch up their breaking changes and such |
09:12:35 | PMunch | You can select it by doing `choosenim \#version-2-0` |
09:12:40 | PMunch | At least on Linux |
09:18:54 | FromDiscord | <newlibarian> my compiler is actually 1.6.6 not 1.6.12 |
09:19:40 | FromDiscord | <newlibarian> how can i chose 32bit and 64bit? my previous installed compiler is 32bit |
09:22:56 | PMunch | On Windowws? No idea |
09:23:24 | PMunch | Does `nim --version` and `choosenim show` show different versions? |
09:27:08 | FromDiscord | <newlibarian> version is 1.6.6 |
09:27:26 | FromDiscord | <newlibarian> compiler is 1.6.6 and stable version is 1.6.12 |
09:28:17 | PMunch | Could you do a codepaste of the output of those two commands? |
09:29:39 | FromDiscord | <newlibarian> sent a long message, see http://ix.io/4tM9 |
09:30:04 | FromDiscord | <newlibarian> (edit) "http://ix.io/4tM9" => "http://ix.io/4tMa" |
09:30:29 | FromDiscord | <newlibarian> i installed the 32b i386 cuz i want my exe to be more compatible. |
09:30:36 | PMunch | That means the version that `nim -v` picks up is not the version choo-enim has installed |
09:30:41 | FromDiscord | <newlibarian> that was my first install |
09:31:16 | PMunch | You should remove your initial install and use the one from choosenim, then set your path up properly to point to that version |
09:31:40 | PMunch | Nim 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:36 | FromDiscord | <newlibarian> i'm on windows should it be choosenim 2.0?? instead of choosenim \#version-2-0? |
09:54:57 | FromDiscord | <newlibarian> choosenim is just an exe... |
10:02:20 | PMunch | Don't think so, no |
10:02:36 | PMunch | version-2-0 is a tag |
10:05:16 | FromDiscord | <newlibarian> sent a long message, see http://ix.io/4tMn |
10:14:11 | FromDiscord | <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:11 | FromDiscord | <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:25 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4tMr |
10:16:31 | FromDiscord | <Rika> 10 |
10:16:36 | FromDiscord | <Rika> Inclusive |
10:16:54 | FromDiscord | <System64 ~ Flandre Scarlet> Woops!â”And what to do for non-inclusive, |
10:16:58 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "non-inclusive," => "non-inclusive?" |
10:20:20 | FromDiscord | <Yardanico> In reply to @System64 "Woops! And what to": 0..9 |
10:20:22 | FromDiscord | <Yardanico> or 0..<10 |
10:21:15 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright, thanks! |
10:21:44 | FromDiscord | <System64 ~ Flandre Scarlet> btw Nim Playground dead? |
10:21:54 | FromDiscord | <System64 ~ Flandre Scarlet> I have gateway timeout |
10:37:57 | PMunch | @System64_~_Flandre_Scarlet, back up now |
10:39:32 | PMunch | Not quite sure what happens, but it seems like the actual playground server code blocks up |
10:39:47 | PMunch | Typically this has been a resource issue, but now it just seems to get stuck |
10:39:52 | FromDiscord | <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:17 | FromDiscord | <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:09 | FromDiscord | <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:27 | FromDiscord | <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:35 | FromDiscord | <michaelb.eth> and for good reason in some cases |
15:50:51 | FromDiscord | <michaelb.eth> but stdlib does a fair bit of that in some modules |
15:52:32 | FromDiscord | <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:10 | FromDiscord | <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:40 | FromDiscord | <demotomohiro> sent a long message, see http://ix.io/4tNG |
15:57:25 | FromDiscord | <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:03 | FromDiscord | <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:16 | FromDiscord | <michaelb.eth> 1.9.3 is 2.0 RC2 |
16:23:38 | FromDiscord | <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:22 | FromDiscord | <0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4tNY |
16:49:05 | FromDiscord | <0ffh> XmlNode should be defined in xmlparser |
16:49:06 | FromDiscord | <Dale> Does `xmlparser` export the `xmlnode` type? |
16:49:26 | FromDiscord | <0ffh> In reply to @Dale "Does `xmlparser` export the": I assumed so. Would be pretty useless if it didn't no? |
16:49:59 | FromDiscord | <0ffh> But I'll check. |
16:50:35 | FromDiscord | <0ffh> sent a code paste, see https://play.nim-lang.org/#ix= |
16:50:38 | * | progranner joined #nim |
16:51:03 | FromDiscord | <0ffh> (edit) "https://play.nim-lang.org/#ix=" => "https://play.nim-lang.org/#ix=4tNZ" |
16:52:13 | * | progranner quit (Client Quit) |
16:52:25 | FromDiscord | <0ffh> Oh no, you're right! |
16:52:42 | FromDiscord | <0ffh> I clicked on "XmlNode" in the docs, then on "source". |
16:53:03 | FromDiscord | <0ffh> But "XmlNode" took me from the "XmlParser" to the "XmlTree" docs. |
16:53:27 | FromDiscord | <0ffh> So it's defined in XmlTree, probably not re-exported. |
16:54:39 | FromDiscord | <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:59 | FromDiscord | <Dale> Probably worth a bug report |
16:56:13 | FromDiscord | <Dale> It may be intentional so you have to specifically bring in the tree source, but I've no idea |
16:57:05 | FromDiscord | <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:57 | FromDiscord | <Dale> For sure! |
17:02:46 | FromDiscord | <Weldify> im trying to index a sequence backwards by using https://media.discordapp.net/attachments/371759389889003532/1098292619722899546/image.png |
17:02:53 | FromDiscord | <Weldify> and for some reason im getting this error: https://media.discordapp.net/attachments/371759389889003532/1098292647594045612/image.png |
17:03:08 | FromDiscord | <Weldify> am i doing something wrong? |
17:04:28 | * | progranner joined #nim |
17:04:37 | FromDiscord | <0ffh> In reply to @Weldify "am i doing something": I think the last element is -1 not -0. |
17:04:46 | FromDiscord | <0ffh> you start i at 0. |
17:05:02 | FromDiscord | <Weldify> oh right |
17:05:16 | FromDiscord | <Weldify> yep, seems to work |
17:05:59 | FromDiscord | <Weldify> thanks! |
17:09:36 | * | lucasta joined #nim |
17:32:02 | * | Notxor quit (Remote host closed the connection) |
17:36:28 | FromDiscord | <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:53 | FromDiscord | <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:45 | FromDiscord | <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:03 | NimEventer | New 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:09 | FromDiscord | <Arvinâ> sent a code paste, see https://play.nim-lang.org/#ix=4tOd |
18:27:15 | * | Notxor joined #nim |
18:28:56 | FromDiscord | <Arvinâ> (edit) "https://paste.rs/NQU" => "https://play.nim-lang.org/#ix=4tOg" |
18:29:06 | FromDiscord | <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:41 | FromDiscord | <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:17 | FromDiscord | <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:53 | FromDiscord | <Nerve> A compiler dev might know more about how that would behave |
19:01:15 | FromDiscord | <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:24 | FromDiscord | <Nerve> Seems so |
19:02:12 | FromDiscord | <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:14 | FromDiscord | <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:52 | FromDiscord | <Nerve> (edit) "`myfunc[N](arrayseq:" => "`proc myProc[N](arrayseq:" |
19:05:37 | FromDiscord | <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:20 | FromDiscord | <firasuke> so in short it is slightly better than having `seq` for all cases |
19:51:09 | FromDiscord | <Elegantbeef> Well `openArray` isnt really a generic |
19:51:25 | FromDiscord | <Elegantbeef> It's a type that array/seq's can implicitly convert to |
19:51:30 | FromDiscord | <huantian> openArray is just magic |
20:01:30 | FromDiscord | <Arvinâ> In reply to @auxym "That's something you should": damn this winim sounds like it may give me migraines |
20:04:27 | FromDiscord | <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:49 | FromDiscord | <Elegantbeef> Well it's converted into a ptr and len |
20:06:54 | FromDiscord | <Elegantbeef> There are no allocations |
20:27:56 | FromDiscord | <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:17 | FromDiscord | <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:44 | FromDiscord | <firasuke> so apparently `defer` is deprecated now, so I guess it would be better to replace the `quit()` with `return`? |
22:00:58 | FromDiscord | <Elegantbeef> Quit closes the program |
22:01:05 | FromDiscord | <Elegantbeef> return does not |
22:01:29 | FromDiscord | <Elegantbeef> Also defer is deprecated? |
22:03:24 | FromDiscord | <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:42 | FromDiscord | <Elegantbeef> Make your own quit proc? |
22:03:52 | FromDiscord | <firasuke> oh I can do that xD |
22:04:52 | FromDiscord | <Elegantbeef> That's what they tell me |
22:05:47 | FromDiscord | <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:25 | FromDiscord | <Elegantbeef> You do you |
22:07:50 | FromDiscord | <firasuke> I'd take that as a yes, I can do both, but I will go with a `custom_quit()` |
22:07:52 | FromDiscord | <firasuke> thanks for pointing that out |
22:08:27 | FromDiscord | <Elegantbeef> You also could use an exit proc if you really wanted and just return |
22:10:41 | FromDiscord | <firasuke> In reply to @Elegantbeef "You also could use": nim has an exit proc? |
22:10:58 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/exitprocs.html |
22:13:13 | FromDiscord | <firasuke> cool |
22:14:16 | * | azimut joined #nim |
22:53:05 | FromDiscord | <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:44 | Amun-Ra | firasuke: or make a single quit outside of try block |
22:56:24 | Amun-Ra | faldor20: I haven't seen any language docs that do that |
22:58:57 | FromDiscord | <faldor20> sent a long message, see http://ix.io/4tOV |
23:02:00 | FromDiscord | <faldor20> sent a long message, see http://ix.io/4tOX |
23:03:20 | FromDiscord | <faldor20> (edit) "http://ix.io/4tOX" => "http://ix.io/4tOY" |
23:04:33 | Amun-Ra | the only think I've noticed that wasn't described in terms of why is effects |
23:05:16 | FromDiscord | <faldor20> Hahah I was going to mention that and I honestly thought that one might be considered self explanatory enough đ
|
23:05:57 | Amun-Ra | thing* |
23:09:41 | FromDiscord | <Elegantbeef> Views is a borrow checker practically |
23:09:54 | FromDiscord | <Elegantbeef> No not nil and options are not the same |
23:10:14 | Amun-Ra | option is a common language type, and primary usage is mentioned in the docs |
23:11:27 | Amun-Ra | views are iirc still in experimental phase |
23:11:43 | FromDiscord | <Elegantbeef> Options are for adding 1 value to a type(except they do not in Nim for ref/pointers) |
23:11:53 | FromDiscord | <Elegantbeef> Not nil is for disallowing `nil` in a ref type statically |
23:12:32 | FromDiscord | <Elegantbeef> I mean they were reading the experimental manual amun |
23:13:33 | FromDiscord | <Elegantbeef> The manual describes how the language works so it does not say what things are for generally |
23:13:40 | FromDiscord | <Elegantbeef> Plus it's experimental |
23:15:24 | FromDiscord | <Weldify> i started learning nim 2 days ago along with the nico framework and its been an absolute blast so far |
23:15:41 | FromDiscord | <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 |