00:55:36 | * | azimut quit (Remote host closed the connection) |
00:56:01 | * | azimut joined #nim |
01:17:13 | * | rockcavera quit (Remote host closed the connection) |
01:52:46 | * | rockcavera joined #nim |
02:22:37 | FromDiscord | <Saint> Is this the right way to read a json file to nim? |
02:22:41 | FromDiscord | <Saint> sent a code paste, see https://play.nim-lang.org/#ix= |
02:40:36 | FromDiscord | <Elegantbeef> It works |
02:46:09 | * | arkurious quit (Quit: Leaving) |
03:10:37 | FromDiscord | <Saint> Is there a better way @ElegantBeef |
03:10:42 | FromDiscord | <Saint> Just wondering! |
03:16:24 | FromDiscord | <Elegantbeef> "better" is all subjective you can do `parseJson(readAll("john.json"))` but whether that is better depends on if your file quite large |
03:18:52 | FromDiscord | <Saint> Oh gotcha, yeah it's a bigger file @ElegantBeef |
03:18:58 | FromDiscord | <Saint> Got it though, thanks! |
03:21:01 | FromDiscord | <Elegantbeef> Also i dont know if `parseJson` closes the file |
03:21:02 | FromDiscord | <Elegantbeef> Well the stream |
03:21:02 | FromDiscord | <Elegantbeef> Ah yea it does |
04:53:53 | * | azimut quit (Ping timeout: 255 seconds) |
05:38:30 | * | Guest20 joined #nim |
05:39:05 | * | Guest20 quit (Client Quit) |
05:57:55 | FromDiscord | <scruz> What's python's equivalent of `str.encode()` in Nim? |
05:59:15 | FromDiscord | <scruz> sent a code paste, see https://play.nim-lang.org/#ix=4loX |
05:59:36 | FromDiscord | <Rika> Nim strings are not like Python strings |
05:59:53 | FromDiscord | <Rika> Nim strings are already essentially byte sequences |
05:59:59 | FromDiscord | <scruz> hmm hmm |
06:03:05 | FromDiscord | <albassort> Whats the generic type for all arrays |
06:04:47 | FromDiscord | <Rika> What do you mean more specifically |
06:04:52 | FromDiscord | <pyolyokh> `array[Size, Type]`. But if you want to write a proc that accepts arrays of any (flat) type, you probably want `openArray[Type]`, which accepts a slice. |
06:04:58 | FromDiscord | <Rika> openarray? |
06:05:10 | FromDiscord | <Rika> not a qn to you pyo |
06:07:48 | FromDiscord | <scruz> In reply to @Rika "Nim strings are already": So how do I do the comparison? |
06:08:11 | FromDiscord | <scruz> sent a code paste, see https://play.nim-lang.org/#ix=4loZ |
06:08:33 | FromDiscord | <pyolyokh> what comparison are you trying to do? |
06:09:03 | FromDiscord | <pyolyokh> oh, trying to say that the 'h'.byte isn't 0.byte? |
06:09:08 | * | ltriant quit (Ping timeout: 272 seconds) |
06:09:54 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lp0 |
06:10:21 | FromDiscord | <scruz> oh, that's how you do it |
06:10:26 | FromDiscord | <scruz> thanks |
06:11:00 | FromDiscord | <pyolyokh> I've got no idea what the Python's doing. If you want to pull unicode codepoints out of a string, <https://nim-lang.org/docs/unicode.html> can help with that |
06:15:57 | FromDiscord | <albassort> In reply to @Rika "openarray?": doesn't take a sequence |
06:16:26 | FromDiscord | <albassort> i want sequence and array compatibility |
06:16:31 | FromDiscord | <scruz> In reply to @pyolyokh "I've got no idea": https://docs.python.org/3/library/stdtypes.html#str.encode |
06:17:12 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lp2 |
06:17:49 | FromDiscord | <pyolyokh> In reply to @scruz "https://docs.python.org/3/library/stdtypes.html#str": I need to guard every remaining neuron, so I can't learn Python. |
06:18:40 | FromDiscord | <scruz> 😄 |
06:19:21 | FromDiscord | <pyolyokh> In reply to @albassort "i want sequence and": or is what you want to do is take seqs|arrays and pass them onto other routines that are specialized on either a seq or array? |
06:19:29 | FromDiscord | <pyolyokh> (edit) "do is" => "do, to" |
06:20:23 | FromDiscord | <scruz> In reply to @scruz "https://docs.python.org/3/library/stdtypes.html#str": I'm just taking an input stream as a number doing doing stuff with it btw |
06:20:59 | FromDiscord | <scruz> like checking these characters as integers https://media.discordapp.net/attachments/371759389889003532/1064429038657085490/image.png |
06:21:13 | FromDiscord | <scruz> (edit) "a number" => "an integer" |
06:21:46 | FromDiscord | <pyolyokh> you're interpreting zero bytes as a unicode heart emoji? |
06:21:58 | FromDiscord | <scruz> yeah lol |
06:22:10 | FromDiscord | <Elegantbeef> That's literally what an openarray is for↵(@albassort) |
06:33:30 | FromDiscord | <albassort> In reply to @Elegantbeef "That's literally what an": it not working ;-; |
06:35:03 | FromDiscord | <pyolyokh> I show about that "it", as far as you describe it, definitely works. So what are you really trying to do? |
06:35:11 | FromDiscord | <pyolyokh> (edit) "about" => "above" |
06:36:59 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lp4 |
06:37:56 | FromDiscord | <albassort> string | openArray[string]) |
06:38:02 | * | Mister_Magister joined #nim |
06:38:20 | FromDiscord | <pyolyokh> an `openArray[string]` is an array of strings, not an array of chars |
06:38:38 | Mister_Magister | how can i convert Table[char, int] into array of tuples |
06:39:04 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lp5 |
06:40:29 | Mister_Magister | also is there something like vector where i can push front or back? |
06:40:45 | FromDiscord | <Elegantbeef> there are dequeues |
06:41:40 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lp6 |
06:41:50 | Mister_Magister | I basically made Table[char, int] to count occurances of each char in text, and now want to sorter chars by amount of occurances |
06:42:03 | FromDiscord | <pyolyokh> there's a `CountTable` that can be used more directly for that |
06:42:15 | FromDiscord | <Elegantbeef> There is a counttable and also you can do `toSeq` or `collect` on `pairs` |
06:42:17 | Mister_Magister | ohhh |
06:42:35 | Mister_Magister | knew i should just describe what i'm doing |
06:42:36 | FromDiscord | <pyolyokh> <https://nim-lang.org/docs/tables.html#sort%2CCountTableRef%5BA%5D> |
06:42:39 | Mister_Magister | i always forget to do that |
06:43:04 | Mister_Magister | thats much simpler |
06:43:17 | FromDiscord | <Elegantbeef> Dont use `CountTableRef` though 😄 |
06:43:40 | FromDiscord | <Elegantbeef> `string | openarray[X]` doesnt allow implicit openarray conversion |
06:43:42 | FromDiscord | <pyolyokh> yeah that was just the first link |
06:43:55 | FromDiscord | <Elegantbeef> You want `varargs[string]` likely |
06:48:24 | * | rockcavera quit (Remote host closed the connection) |
06:49:59 | Mister_Magister | so after i have counttable i do .sort() on it and then i can do for key in keys(table): ? |
06:50:57 | FromDiscord | <pyolyokh> yeah. |
06:51:01 | Mister_Magister | ayyy nice |
06:51:06 | Mister_Magister | just wanted to make sure |
06:55:54 | * | kenran joined #nim |
07:14:04 | FromDiscord | <scruz> how to convert `seq[string]` to a `string`? |
07:14:45 | FromDiscord | <Elegantbeef> `strutils.join`? |
07:15:22 | FromDiscord | <huantian> ~~`cast[string](mySeq)`~~ |
07:16:25 | FromDiscord | <pyolyokh> In reply to @huantian "~~`cast[string](mySeq)`~~": that's a sequence of strings, not a sequence of chars |
07:16:42 | FromDiscord | <scruz> In reply to @Elegantbeef "`strutils.join`?": thanks! |
07:16:46 | FromDiscord | <huantian> Ik lol I was making a joke don’t do a cast |
07:36:11 | Mister_Magister | yo, can you help me out whats wrong in here? https://play.nim-lang.org/#ix=4lpc |
07:36:30 | FromDiscord | <Elegantbeef> `keys` is an iterator |
07:36:47 | FromDiscord | <Elegantbeef> you need to do `table.keys.toSeq` or `collect(table.keys)` |
07:36:56 | Mister_Magister | ah thanks |
07:37:21 | FromDiscord | <Elegantbeef> Sorry that'd be `collect(for x in table.keys: x)` |
07:39:50 | Mister_Magister | also how can i convert string to char? like i have string that contains single character, so i want to convert it to char, not seq of chars |
07:39:59 | FromDiscord | <Elegantbeef> `[0]` |
07:40:06 | Mister_Magister | xd |
07:40:09 | Mister_Magister | simplest solutions |
07:40:23 | FromDiscord | <Elegantbeef> If it's unicode it's not a `char` it's a `std/unicode` rune |
07:40:32 | FromDiscord | <Elegantbeef> Also btw you can do like `import std/[re, sequtils, strutils, ....]` |
07:41:40 | Mister_Magister | i thought there's something like that but didn'task |
07:41:43 | Mister_Magister | thanks |
07:47:35 | Mister_Magister | kay i got another dumb question if you didn't have enough of me :D I got seq[char] which i want to convert to json's array to later put into file |
07:47:53 | Mister_Magister | and i'm stuck at converting it into json array |
07:48:02 | FromDiscord | <albassort> In reply to @pyolyokh "an `openArray[string]` is an": Yes |
07:48:17 | FromDiscord | <Elegantbeef> The ugly `%` operator should work from `std/json` |
07:48:33 | FromDiscord | <albassort> I want a array of strings of all forms |
07:48:34 | Mister_Magister | it doesn't though :/ |
07:48:39 | FromDiscord | <albassort> Open array, sequence etc |
07:48:43 | FromDiscord | <albassort> I can't find a good concept for it |
07:48:55 | FromDiscord | <Elegantbeef> so then `varargs[string]` |
07:49:18 | Mister_Magister | @Elegantbeef wdym |
07:49:36 | FromDiscord | <Elegantbeef> There is not general unifyer for all string types cause that doesnt make much sense |
07:49:43 | FromDiscord | <Elegantbeef> What's the issue mister? |
07:50:02 | FromDiscord | <Elegantbeef> Saying why it doesnt work makes more sense than just "it doesnt work" |
07:50:05 | Mister_Magister | "so then `varargs[string]`" was this for me? |
07:50:15 | FromDiscord | <Elegantbeef> Certainly not |
07:50:18 | Mister_Magister | ah |
07:50:32 | Mister_Magister | @Elegantbeef it didn't work with seq of chars but works with seq of strings |
07:50:51 | FromDiscord | <Elegantbeef> "doesnt work" in what way |
07:51:36 | Mister_Magister | https://paste.opensuse.org/pastes/831ce83dcf6d |
07:51:39 | FromDiscord | <Elegantbeef> Saying that doesnt give me anything to work with |
07:51:40 | FromDiscord | <Elegantbeef> If it errors in the compiler giving that helps, if it errors in the output saying that helps |
07:52:10 | FromDiscord | <Elegantbeef> Ok thank you |
07:53:44 | FromDiscord | <Elegantbeef> You manually need to do it seems |
07:53:47 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4lpd |
07:53:48 | FromDiscord | <Elegantbeef> like so |
07:54:01 | FromDiscord | <pyolyokh> In reply to @Mister_Magister "kay i got another": JSON doesn't have arrays of chars, I think is the issue. It doesn't have "chars". |
07:54:28 | Mister_Magister | ye thats what i think so too |
07:54:47 | Mister_Magister | @Elegantbeef i just made seq of strings instead of chars and that worked |
07:55:08 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lpf |
07:55:54 | FromDiscord | <pyolyokh> for JSON you probably want seq[string], `collect(for c in s1: $c)` |
07:57:11 | FromDiscord | <Elegantbeef> You can always implement `%` for a `char` I think, might be wrong |
07:57:39 | Mister_Magister | well i got it work so i won't dwell too much xd |
07:57:58 | * | PMunch joined #nim |
07:58:21 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4lpi yea this is sufficient |
08:23:35 | PMunch | TIL @ |
08:26:54 | FromDiscord | <Rika> ? |
08:27:41 | FromDiscord | <Elegantbeef> You can do `@"mystring"` |
08:27:43 | FromDiscord | <Elegantbeef> I assume |
08:29:02 | FromDiscord | <Elegantbeef> @albassort\: you never did elaborate further |
08:29:08 | FromDiscord | <Elegantbeef> Is `varargs[string]` not what you want? |
08:29:25 | FromDiscord | <Elegantbeef> It accepts `string` `array[size, string], and `seq[string]\` |
08:29:32 | FromDiscord | <Elegantbeef> Wow i fuck the backquoting |
10:05:19 | * | ltriant joined #nim |
10:09:42 | * | ltriant quit (Ping timeout: 255 seconds) |
10:21:23 | FromDiscord | <Gumbercules> yeah you do |
10:37:58 | FromDiscord | <Rika> please do not fuck the backquoting |
10:51:20 | FromDiscord | <ShalokShalom> In reply to @Rika "please do not fuck": Sounds like the slogan of something 😅 |
10:51:29 | FromDiscord | <ShalokShalom> Maybe put it on the homepage 😀 |
11:10:29 | FromDiscord | <albassort> In reply to @Elegantbeef "<@217459674700578816>\: you never did": I got sad |
11:14:40 | FromDiscord | <Rika> \:( |
11:19:23 | * | ltriant joined #nim |
11:58:12 | FromDiscord | <System64 ~ Flandre Scarlet> Can Nim compile to WASM? |
11:58:23 | FromDiscord | <Rika> via emscripten |
11:58:36 | FromDiscord | <System64 ~ Flandre Scarlet> Nice |
11:59:12 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "via emscripten": and can you interact with emscripten code via JS? |
12:00:20 | FromDiscord | <Rika> i have no experience with such |
12:00:53 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright |
12:17:54 | * | azimut joined #nim |
12:21:10 | * | xet7 joined #nim |
12:21:12 | FromDiscord | <Tanguy> Is there a proc to get the full path to the source file at CT? |
12:26:12 | * | kenran quit (Remote host closed the connection) |
12:28:57 | FromDiscord | <Tanguy> Found it https://nim-lang.org/docs/system.html#currentSourcePath.t |
13:07:19 | FromDiscord | <Saint> Is there a way to access returned rows by column name in sqlite? |
13:07:24 | FromDiscord | <Saint> Or is it just by index |
13:09:54 | FromDiscord | <MadScientistCarl> What's a good way to generate Nim code? Is there some sort of AST module that can emit Nim code? |
13:11:57 | FromDiscord | <Rika> macros are able to write files and the nimnode ast can be printed into code via `repr` |
13:12:47 | FromDiscord | <sealmove> Have anyone used a message broker with nim? |
13:12:54 | FromDiscord | <Rika> like rabbitmq or smth? |
13:12:57 | FromDiscord | <sealmove> Yep |
13:13:32 | FromDiscord | <Rika> i feel like it oughtta have been done before but idk |
13:13:47 | FromDiscord | <sealmove> Looking for the one that nim has the best support for |
13:14:48 | FromDiscord | <sealmove> Also i am interested if there is an no-middleware-required alternative |
13:15:06 | FromDiscord | <Rika> what does that mean? |
13:15:49 | FromDiscord | <Gumbercules> generally you pick these things because of the features they support and your requirements |
13:15:58 | FromDiscord | <Gumbercules> they're not necessarily interchangeable |
13:16:15 | FromDiscord | <Gumbercules> for instance, RabbitMQ works differently than ZeroMQ |
13:16:21 | FromDiscord | <sealmove> In reply to @Rika "what does that mean?": Not sure 😅 just asking how ppl do this |
13:16:34 | FromDiscord | <Gumbercules> what are you trying to do? |
13:17:15 | FromDiscord | <enthus1ast> @sealmove\: also have a look at nuts |
13:17:41 | FromDiscord | <enthus1ast> aehm |
13:17:43 | FromDiscord | <enthus1ast> nats |
13:18:39 | FromDiscord | <sealmove> Ok my use case is the following: i have an api with an endpoint which a client hits to request a very long operation. I want to send the request to a queue and have a different process consume from it, read the request, and start the processing. |
13:18:59 | FromDiscord | <enthus1ast> then just use a database |
13:19:23 | FromDiscord | <enthus1ast> https://github.com/enthus1ast/simplePostgresQueue |
13:19:26 | FromDiscord | <sealmove> I want fifo logic |
13:19:32 | FromDiscord | <sealmove> Oh hmm |
13:19:34 | FromDiscord | <enthus1ast> look at the link |
13:19:45 | PMunch | @sealmove haven't implemented a broker in Nim, but I've communicated with one |
13:19:50 | FromDiscord | <enthus1ast> no need for complicated stuff, |
13:20:01 | FromDiscord | <sealmove> In reply to @PMunch "<@173424250319929344> haven't implemented a": Which one? |
13:21:02 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4lqm |
13:21:02 | FromDiscord | <sealmove> In reply to @enthus1ast "https://github.com/enthus1ast/simplePostgresQueue": Thanks, could work |
13:21:18 | PMunch | @sealmove, both a MQTT thing and Kafka |
13:22:23 | FromDiscord | <Gumbercules> In reply to @รєคɭ๓๏שє "Ok my use case": different process or different thread? |
13:22:37 | FromDiscord | <sealmove> Different process |
13:22:57 | FromDiscord | <sealmove> Although currently I am just using thread |
13:23:10 | FromDiscord | <Gumbercules> why a different process just out of curiosity? |
13:23:21 | FromDiscord | <Gumbercules> what are you doing in this other process? |
13:23:23 | FromDiscord | <sealmove> Just considering options... |
13:23:35 | FromDiscord | <sealmove> In reply to @Gumbercules "what are you doing": Running ffmpeg basically |
13:23:38 | FromDiscord | <Gumbercules> gotcha |
13:24:14 | FromDiscord | <Gumbercules> yeah I've built something similar to this before and I did use RabbitMQ but as others have mentioned you don't need to |
13:25:14 | FromDiscord | <Gumbercules> one fun thing I did was automatically scale the workers based on the number of entries in the queue |
13:25:59 | FromDiscord | <sealmove> In reply to @Gumbercules "yeah I've built something": I don't need to because of the postgres hack alternative? Or threading? |
13:26:57 | FromDiscord | <Gumbercules> no because you can the same type of queueing mechanism without the overhead of RabbitMQ |
13:27:21 | FromDiscord | <Gumbercules> brb wife is calling me |
13:27:41 | FromDiscord | <Saint> Would it be considered okay to update the documentation for https://nim-lang.org/docs/strutils.html#split.i,string,char,int for example to include that the default separator is spsace? |
13:27:44 | FromDiscord | <Saint> (edit) "spsace?" => "space?" |
13:30:50 | FromDiscord | <leetnewb> Technically says it here: https://nim-lang.org/docs/strbasics.html - but I don't see why it shouldn't be under the strutils section |
13:31:25 | FromDiscord | <Rika> It technically says it here |
13:31:31 | FromDiscord | <Rika> https://nim-lang.org/docs/strutils.html#split%2Cstring%2Cset%5Bchar%5D%2Cint |
13:31:37 | FromDiscord | <leetnewb> err, maybe my brain is still asleep |
13:34:19 | FromDiscord | <Saint> sent a code paste, see https://play.nim-lang.org/#ix=4lqr |
14:01:05 | PMunch | @Rika, @Saint, yeah the default is actually the template without the required argument. Might be a bit confusing, so maybe it would be worth it to have that in there |
14:03:00 | FromDiscord | <Saint> In reply to @Rika "https://nim-lang.org/docs/strutils.html#split%2Cstr": Where does it say it there? |
14:03:05 | FromDiscord | <Saint> (edit) "In reply to @Rika "https://nim-lang.org/docs/strutils.html#split%2Cstr": Where does it say it there? ... " added "🇹🇭" |
14:03:10 | FromDiscord | <Saint> (edit) "🇹🇭" => "🤔" |
14:04:02 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4lqA |
14:04:12 | FromDiscord | <Rika> hence the technically |
14:04:16 | FromDiscord | <Saint> Ohh sorry my bad |
14:04:16 | FromDiscord | <Rika> not really much of an indicator |
14:04:19 | FromDiscord | <Rika> no |
14:04:20 | FromDiscord | <Rika> its fine |
14:04:22 | FromDiscord | <Rika> its hard to spot |
14:04:25 | FromDiscord | <Rika> took me a while too |
14:04:45 | FromDiscord | <Saint> Also is it possible to add examples to the documentation in places? |
14:04:50 | FromDiscord | <Saint> Like is that welcomed or not really |
14:05:09 | FromDiscord | <Rika> examples are usually added by putting a runnableExamples block i believe? not sure |
14:12:20 | FromDiscord | <MadScientistCarl> What's the best way to organize some utility tools in a Nimble project? Say, I have a binding generator as a separate build step. Where should I put it and what should I put in the `.nimble` file? |
14:13:23 | * | arkurious joined #nim |
14:25:47 | FromDiscord | <untoreh> sent a code paste, see https://play.nim-lang.org/#ix=4lqF |
14:26:31 | FromDiscord | <untoreh> and by possible I mean, does it leak something |
14:28:41 | * | rockcavera joined #nim |
14:30:44 | FromDiscord | <Rika> i believe p would be completely invalidated once destroy is complete |
14:30:55 | FromDiscord | <Rika> so getting a ptr to it wont do anything to keep it around |
14:39:32 | FromDiscord | <Gumbercules> In reply to @MadScientistCarl "What's the best way": Tasks |
14:39:57 | FromDiscord | <MadScientistCarl> So do I put files under places like `src/tool/mytool.nim`, and add `tool/mytool` to bins? |
14:40:19 | FromDiscord | <Gumbercules> https://github.com/Tail-Wag-Games/frag/blob/master/config.nims |
14:40:48 | FromDiscord | <MadScientistCarl> Should I put it under `config.nims` or the project nims file? |
14:41:04 | FromDiscord | <Gumbercules> I don't use nimble but I'd probably just make a task named build took and compile it there |
14:41:32 | FromDiscord | <Gumbercules> You could put it in the nimble file or a config.nims or a project.nims filw |
14:41:36 | PMunch | @MadScientistCarl, if you use Nimble you can do it in a similar fashion to what I do in Futhark: https://github.com/PMunch/futhark |
14:41:37 | FromDiscord | <Gumbercules> (edit) "filw" => "file" |
14:41:44 | PMunch | The binary I build there is Opir |
14:42:34 | FromDiscord | <MadScientistCarl> OK |
14:43:05 | PMunch | Note that Nimble will put your binaries in a folder that is typically added to your PATH |
14:43:33 | PMunch | So Futhark actually just calls `opir` assuming it will be in the PATH |
14:47:36 | FromDiscord | <Saint> When getting an Option do you have to cast it as the type you're getting or something |
14:47:41 | FromDiscord | <Saint> Sorry very new to it |
14:49:26 | PMunch | @Saint, huh? |
14:49:55 | FromDiscord | <Rika> no, you call get() |
14:50:05 | FromDiscord | <Rika> https://nim-lang.org/docs/options.html#get%2COption%5BT%5D |
14:50:21 | FromDiscord | <Saint> Right, that's what I tried but I'm getting an error |
14:50:29 | FromDiscord | <Rika> most likely you're getting a none |
14:50:39 | FromDiscord | <Saint> sent a code paste, see https://play.nim-lang.org/#ix= |
14:50:48 | FromDiscord | <Rika> post code |
14:51:01 | FromDiscord | <Saint> sent a code paste, see https://play.nim-lang.org/#ix=4lqL |
14:51:23 | FromDiscord | <Saint> sent a code paste, see https://play.nim-lang.org/#ix= |
14:51:32 | FromDiscord | <Saint> https://krisppurg.github.io/dimscord/dimscord/objects.html#Message |
14:51:33 | FromDiscord | <Rika> type of `m.referenced_message`? |
14:51:34 | FromDiscord | <Saint> The obect definition is here |
14:51:40 | FromDiscord | <Saint> Its type Message |
14:51:49 | FromDiscord | <Saint> Options[Message] rather |
14:51:58 | FromDiscord | <Rika> are you sure you're looking at the correct line |
14:52:01 | FromDiscord | <Rika> look at the line numbers |
14:52:08 | FromDiscord | <Saint> (edit) "Options[Message]" => "Option[Message]" |
14:52:54 | FromDiscord | <Saint> Oh haha you're right, sorry |
14:52:55 | FromDiscord | <Saint> Thanks! |
14:53:07 | FromDiscord | <Rika> 👌 |
15:04:00 | FromDiscord | <MadScientistCarl> Hmm, nim LSP doesn't have a formatter? |
15:04:57 | PMunch | Like a code formatter? |
15:05:05 | FromDiscord | <MadScientistCarl> Yes |
15:05:10 | PMunch | It doesn't. But you could use nimpretty for code formatting |
15:05:21 | FromDiscord | <MadScientistCarl> In Vscode, if I set the lint provider to LSP, the formatter is not available |
15:05:56 | PMunch | nimpretty is its own program |
15:06:14 | PMunch | There might be someone who has created a VSCode extension for it, not sure |
15:06:19 | PMunch | I've never really used it |
15:06:30 | PMunch | But I've heard that it can be a bit buggy |
15:12:46 | * | PMunch quit (Quit: Leaving) |
15:13:17 | FromDiscord | <MadScientistCarl> Can Nim dispatch based on return value? I can't seem to get it working |
15:14:28 | FromDiscord | <MadScientistCarl> sent a code paste, see https://play.nim-lang.org/#ix=4lqW |
15:14:40 | FromDiscord | <MadScientistCarl> I am getting ambiguous call errors |
15:15:08 | Amun-Ra | nope |
15:18:45 | FromDiscord | <Rika> no it cannot |
15:19:33 | FromDiscord | <Saint> What does an Owned return type do? |
15:19:47 | FromDiscord | <Saint> sent a code paste, see https://play.nim-lang.org/#ix=4lqX |
15:19:49 | FromDiscord | <Saint> https://krisppurg.github.io/dimscord/dimscord/restapi.html#deleteMessage%2CRestApi%2Cstring%2Cstring%2Cstring |
15:41:57 | FromDiscord | <Saint> I figured it out |
15:42:07 | FromDiscord | <Saint> How important is it to have hot code reloading for web dev do you think? |
15:47:49 | FromDiscord | <Rika> i believe its not important, ideally you would swap out instances via a reverse proxy since it would be simpler to do so |
15:58:07 | FromDiscord | <Saint> In reply to @Rika "i believe its not": Oh I thought I meant just for development |
15:58:58 | FromDiscord | <MadScientistCarl> Do you omit parentheses in function calls? |
15:58:59 | FromDiscord | <System64 ~ Flandre Scarlet> How can I statically link with a C library please? |
15:59:57 | * | nyeaa492842 joined #nim |
16:02:15 | FromDiscord | <Rika> In reply to @Saint "Oh I thought I": if you can tolerate the compile time then it is unimportant |
16:02:23 | FromDiscord | <Rika> In reply to @MadScientistCarl "Do you omit parentheses": depensd on which |
16:07:09 | * | azimut quit (Remote host closed the connection) |
16:07:34 | * | nyeaa492842 quit (Quit: The Lounge - https://thelounge.chat) |
16:07:46 | * | azimut joined #nim |
16:08:35 | * | nyeaa492842 joined #nim |
16:11:33 | FromDiscord | <MadScientistCarl> How do I specify a bitset in a type? |
16:13:22 | FromDiscord | <Rika> `fieldname: set[someordinaltype]` |
16:13:25 | FromDiscord | <Rika> ? |
16:13:28 | FromDiscord | <MadScientistCarl> I tried `set[MyEnum]` but it says it is not ordinal |
16:13:34 | FromDiscord | <Rika> does it have holes |
16:13:43 | FromDiscord | <MadScientistCarl> I didn't specify values |
16:13:49 | FromDiscord | <Rika> what is this enum |
16:14:02 | FromDiscord | <MadScientistCarl> sent a code paste, see https://play.nim-lang.org/#ix=4lr1 |
16:14:11 | * | chris joined #nim |
16:14:15 | * | chris is now known as Guest182 |
16:14:27 | FromDiscord | <Rika> oh ig holed enums are ordinal too |
16:14:31 | FromDiscord | <Rika> that should work yeah |
16:14:32 | FromDiscord | <MadScientistCarl> OK... it has to be defined before my type |
16:14:38 | FromDiscord | <MadScientistCarl> Even though it is in the same type block |
16:14:52 | FromDiscord | <Rika> it does? sounds like a bug to me, tbh |
16:14:57 | FromDiscord | <MadScientistCarl> I am actually encountering this problem. I have to define enums before using them, even in the same type block |
16:15:36 | Guest182 | Hi, question, how do I convert an unsigned positive integer into its signed two's complement (assuming it fits in the requisite number of bits)? Do I need to dip into C types? |
16:16:35 | FromDiscord | <Rika> if you dont mind a lack of safety you could just cast them |
16:22:50 | * | tiorock joined #nim |
16:22:50 | * | tiorock quit (Changing host) |
16:22:50 | * | tiorock joined #nim |
16:22:50 | * | rockcavera quit (Killed (iridium.libera.chat (Nickname regained by services))) |
16:22:50 | * | tiorock is now known as rockcavera |
16:23:09 | FromDiscord | <MadScientistCarl> Hmmm, `+` is implemented for bitsets but `+=` is not |
16:23:52 | FromDiscord | <Saint> sent a code paste, see https://play.nim-lang.org/#ix=4lr4 |
16:23:55 | FromDiscord | <Saint> If I don't use a dll (for hcr) it works fine |
16:24:23 | FromDiscord | <Saint> Tried it with all different --gc but nothing worked |
16:25:57 | FromDiscord | <Saint> sent a code paste, see https://play.nim-lang.org/#ix=4lr5 |
16:27:47 | FromDiscord | <hdbg> what does `_nimFrame` stand for? Doing some injection and sig scanning when suddenly it crashes with access violation in nimframe. https://media.discordapp.net/attachments/371759389889003532/1064581745242013716/image.png |
16:28:31 | FromDiscord | <MadScientistCarl> How do I raise an exception with dynamic message? Compiler says ValueError can raise |
16:30:11 | FromDiscord | <Rika> In reply to @MadScientistCarl "How do I raise": I dont understand |
16:30:29 | FromDiscord | <Rika> In reply to @hdbg "what does `_nimFrame` stand": stack frame for exception debug info |
16:31:09 | FromDiscord | <MadScientistCarl> sent a code paste, see https://play.nim-lang.org/#ix=4lr6 |
16:31:29 | FromDiscord | <enthus1ast> and with that `--useMalloc` ?↵(@Saint) |
16:31:33 | FromDiscord | <MadScientistCarl> Compiler says ``formatValue(fmtRes_452984924, value, "") can raise an unlisted exception: ref ValueError` |
16:31:52 | FromDiscord | <Rika> do you have a `{.raises: [...].}` somewhere |
16:33:06 | FromDiscord | <MadScientistCarl> I have `{.push raises: [].}` at module top |
16:33:35 | FromDiscord | <Rika> that's why |
16:33:42 | FromDiscord | <Rika> &"" can raise valueerror |
16:33:44 | FromDiscord | <MadScientistCarl> OK... the style guide recommends it |
16:34:13 | FromDiscord | <Rika> if you want, figure out a way to catch the valueerror, or not |
16:34:16 | FromDiscord | <Saint> In reply to @enthus1ast "and with that `--useMalloc`": I get the same thing with --d:useMalloc |
16:51:26 | * | tiorock joined #nim |
16:51:26 | * | tiorock quit (Changing host) |
16:51:26 | * | tiorock joined #nim |
16:51:26 | * | rockcavera is now known as Guest2947 |
16:51:26 | * | Guest2947 quit (Killed (zinc.libera.chat (Nickname regained by services))) |
16:51:26 | * | tiorock is now known as rockcavera |
16:59:54 | FromDiscord | <pyryrin> is it conventional to list enum values separated by commas |
17:00:06 | FromDiscord | <Rika> instead of newlines? |
17:00:15 | FromDiscord | <Rika> both are used commonly |
17:00:25 | FromDiscord | <pyryrin> which is more used |
17:00:27 | * | rockcavera quit (Ping timeout: 252 seconds) |
17:00:54 | FromDiscord | <pyryrin> i mean if you put values with new lines, is it conventional to still put commas? |
17:01:35 | FromDiscord | <Rika> if each enum is on its own line i believe having no trailing commas is conventional |
17:01:45 | FromDiscord | <Rika> if many enums are on one line i believe the converse is true |
17:01:47 | FromDiscord | <Phil> I do newlines for example |
17:02:06 | FromDiscord | <Rika> (edit) "if many ... enums" added "(but not all ofc)" |
17:03:35 | * | rockcavera joined #nim |
17:08:05 | FromDiscord | <Saint> @enthus1ast any idea what is going on? |
17:08:54 | FromDiscord | <enthus1ast> to be honest, i would make a minimal example and create a bug report in the nim repo |
17:09:17 | FromDiscord | <enthus1ast> i bet that this also happens without nimja involved |
17:09:56 | FromDiscord | <enthus1ast> or maybe someone could explain us how to use gc types between dll borders |
17:12:17 | FromDiscord | <Saint> sent a code paste, see https://play.nim-lang.org/#ix=4lra |
17:12:25 | FromDiscord | <Saint> In reply to @enthus1ast "or maybe someone could": Gotcha |
17:28:11 | * | Guest182 quit (Quit: Leaving) |
17:50:15 | Mister_Magister | yo, do you have some example of nice console app? like one that has standard --help and accepts -h --help params |
17:50:26 | Mister_Magister | like gnu tools |
17:54:43 | FromDiscord | <treeform> In reply to @Mister_Magister "yo, do you have": This lib provides a way to generate a nice linux like CLI API: https://github.com/c-blake/cligen |
17:55:01 | FromDiscord | <treeform> It gives you -h and --help but default |
17:55:03 | Mister_Magister | yooo thats exactly what i needed thanks! |
17:55:54 | FromDiscord | <EyeCon> In reply to @Mister_Magister "yo, do you have": See also: https://bitbucket.org/maxgrenderjones/therapist/ |
17:56:21 | FromDiscord | <treeform> In reply to @Mister_Magister "yooo thats exactly what": There is also https://github.com/guzba/bossy if you need some thing really simple |
17:57:09 | Mister_Magister | @EyeCon i just came bach from him… |
17:57:20 | Mister_Magister | jokes, but thanks |
17:57:22 | Mister_Magister | you all |
18:14:54 | FromDiscord | <Saint> How do I set the default compile flags again for nim |
18:15:15 | FromDiscord | <Saint> Oh config.nims |
19:33:25 | FromDiscord | <@thatrandomperson5-6310e3b26da03> How would i decode a hex string, fromHex goes to a number with limited size |
19:33:25 | FromDiscord | <Elegantbeef> `parseHexStr` |
19:44:04 | FromDiscord | <Dumb Dragon> Does anyone else have this problem with 1.6.10 where nimsuggest just stops working properly when you import more than like 5 modules? |
19:44:10 | FromDiscord | <Dumb Dragon> I switched to devel and it works fine now |
19:51:59 | FromDiscord | <Dumb Dragon> Is it an issue with complexity? Am I perhaps using too many generics or macros? |
19:52:28 | * | droidrage quit (Ping timeout: 272 seconds) |
19:55:42 | FromDiscord | <Dumb Dragon> Might just be a vscode issue idk |
20:21:56 | FromDiscord | <ambient> i have had a couple of numsuggest dying instances. both were fixed with vscode restart |
20:37:16 | FromDiscord | <Dumb Dragon> I restarted it multiple times |
20:37:31 | FromDiscord | <Dumb Dragon> It would show suggestions for some files, but for my main file it wouldn't |
20:37:50 | FromDiscord | <Dumb Dragon> removing one of the imports, any of them, fixed it |
20:37:55 | FromDiscord | <ambient> maybe some nimsuggest process has crashed and refuses to close? |
20:38:05 | FromDiscord | <Dumb Dragon> could be it, I don't know |
20:38:17 | FromDiscord | <ambient> you can close them with task manager or the like |
20:38:19 | FromDiscord | <Dumb Dragon> I imagine it's a complexity thing though |
20:38:23 | FromDiscord | <Dumb Dragon> Yeah I tried that |
20:38:40 | FromDiscord | <Dumb Dragon> It kept doing it even after restarting vscode multiple times, but updating to devel fixed it |
20:43:41 | FromDiscord | <djazz> nimsuggest love to spin all my cpu cores with processes, on devel, not stable |
20:44:12 | Amun-Ra | buy more cores |
21:00:00 | FromDiscord | <djazz> brb buying threadripper |
21:00:04 | FromDiscord | <djazz> xD |
21:10:08 | FromDiscord | <Leftbones> sent a code paste, see https://play.nim-lang.org/#ix=4ls6 |
21:10:30 | FromDiscord | <Leftbones> (edit) "https://play.nim-lang.org/#ix=4ls6" => "https://play.nim-lang.org/#ix=4ls7" |
21:10:56 | FromDiscord | <Elegantbeef> What? |
21:12:04 | FromDiscord | <djazz> const FooBar = "string" 😄 |
21:12:47 | FromDiscord | <Phil> In reply to @Leftbones "Is there a way": Do you actually want it to be the type of string or do you just want to get the assigned string out? Because this will print "string": `echo $Foo.Bar` |
21:12:59 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4ls8 |
21:13:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ls9 |
21:13:17 | FromDiscord | <Elegantbeef> But if you're doing that you're writing some odd code |
21:13:24 | FromDiscord | <pyolyokh> (edit) "https://play.nim-lang.org/#ix=4ls8" => "https://play.nim-lang.org/#ix=4lsa" |
21:13:59 | FromDiscord | <pyolyokh> (edit) "https://play.nim-lang.org/#ix=4lsa" => "https://play.nim-lang.org/#ix=4lsc" |
21:14:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lsd |
21:14:57 | FromDiscord | <pyolyokh> I like that but it's slightly different in that it gives you raw strings |
21:15:11 | FromDiscord | <Elegantbeef> So then just \`Foo "string"\~ |
21:15:22 | FromDiscord | <Elegantbeef> God damn it i'm incapable of properly backticking |
21:31:38 | FromDiscord | <Elegantbeef> @<She>Horizon</Her> I finally got around to making the calling macro a bit smarter by using generic mixin's so now there is an interface for calling host functions |
21:33:09 | FromDiscord | <Saint> Whats the diff between waitFor and await? |
21:33:36 | FromDiscord | <Elegantbeef> Waitfor is blocking |
21:33:41 | FromDiscord | <Elegantbeef> Await can only be used inside an async proc |
21:33:42 | FromDiscord | <Saint> await doesn't block? |
21:33:53 | FromDiscord | <Elegantbeef> That's the entire point of async code |
21:33:57 | FromDiscord | <Elegantbeef> Do not block on IO |
21:35:11 | FromDiscord | <Saint> await returns the future? |
21:35:25 | FromDiscord | <Elegantbeef> Neither return the future |
21:35:33 | FromDiscord | <Saint> Hmmmm |
21:35:45 | FromDiscord | <Elegantbeef> await says "here give up the CPU to run this async proc, if any other async procs can also run, great! |
21:36:26 | FromDiscord | <Saint> OKay I think I get it thanks! |
21:36:58 | FromDiscord | <deech> Some interesting discussion on Nim here: https://lobste.rs/s/5tx54f/thoughts_on_zig |
21:37:02 | FromDiscord | <Elegantbeef> waitfor says "We're blocking until the async procedure i'm calling is done" |
21:38:05 | FromDiscord | <Saint> In reply to @deech "Some interesting discussion on": Isn't it just the one comment? |
21:38:15 | FromDiscord | <Saint> That you see everywhere about people hating the import namespace stuff with nim |
21:43:27 | FromDiscord | <Elegantbeef> The only hate you see more is the style insensitivity |
21:45:43 | FromDiscord | <pyolyokh> Nim isn't quite to my preference there either, but it's a really minor gripe, and Nim's imports are in line with the language. Go/Zig/Odin importing a namespace and accessing 100% of features through it? Well, forget about operator overloading, even nice stuff like tables' `[]` procs. D imports where you can explicitly import classes and get all their associated behavior? Well, Nim isn't that object oriented... but a 'smart import' is an |
21:46:30 | FromDiscord | <ambient> I don't understand what's the criticism with Nim imports |
21:46:43 | FromDiscord | <Elegantbeef> Well araq seems to think that type bound operators will resolve that |
21:46:49 | FromDiscord | <Elegantbeef> But it's an easily broken thing |
21:46:58 | FromDiscord | <leorize> isn't `waitFor` pretty much the same as `await` except that `await` have some magic to prevent deadlock from self-wait? |
21:47:00 | FromDiscord | <pyolyokh> speaking of Zig, Andrew's line is that he wants it to be a language that people use despite hating it. Imports and style sensitivity are something people would easily just deal with, despite hating, if not for more substantial complaints that aren't as easy to point to. |
21:47:37 | FromDiscord | <Elegantbeef> You might be right, i though waitfor dispatched only the specific await |
21:47:44 | FromDiscord | <Elegantbeef> i mean async |
21:47:50 | FromDiscord | <Dumb Dragon> honestly nim's imports are great. The only time it's ever a mild issue is when you import two modules that have something with the same name |
21:47:51 | FromDiscord | <Elegantbeef> I probably shouldnt speak about async given i rarely use it |
21:48:03 | FromDiscord | <Dumb Dragon> I hate namespaced imports |
21:48:15 | FromDiscord | <pyolyokh> In reply to @Dumb Dragon "honestly nim's imports are": I don't have conflicts, just the occasional annoyance at not being able to immediately know where a symbol is coming from |
21:48:19 | FromDiscord | <Dumb Dragon> don't make me dig through 15 layers of obscure modules for one function |
21:48:25 | FromDiscord | <Dumb Dragon> In reply to @pyolyokh "I don't have conflicts,": that's fair |
21:48:27 | FromDiscord | <ambient> oh right it's the import in Python terms. I do prefer explicit namespacing |
21:48:46 | FromDiscord | <Hourglass> In reply to @Elegantbeef "<@909883978717204561> I finally got": Oh, for Wasm3? Neat! |
21:48:48 | FromDiscord | <Dumb Dragon> I absolutely loathe rust for this reason though |
21:48:54 | FromDiscord | <Dumb Dragon> and a few other reasons |
21:48:57 | FromDiscord | <Hourglass> I've just been burnt out so haven't been coding as much as I'd like sadly |
21:49:05 | FromDiscord | <leorize> nim's `import` is nothing like `import ` in python, though |
21:49:07 | FromDiscord | <ambient> Rust imports are a little awkward because it filesystem independent |
21:49:21 | FromDiscord | <Dumb Dragon> but having to type `use std::something::someotherthing` over and over makes me hate myself |
21:49:21 | FromDiscord | <pyolyokh> In reply to @ambient "oh right it's the": In Nim terms, Python's default is `from someMod import nil` |
21:49:25 | FromDiscord | <ambient> In reply to @leorize "nim's `import` is nothing": how so? the only diff I see is exports are explicit |
21:49:44 | FromDiscord | <Elegantbeef> Yea horizon i even have a `extractAs` macro to mimic the C macros it has https://github.com/beef331/wasm3/blob/master/tests/test1.nim#L121-L126 |
21:50:01 | FromDiscord | <Elegantbeef> I guess extract as is a template 😄 |
21:50:16 | FromDiscord | <Saint> In reply to @Dumb Dragon "don't make me dig": What do you mean, just like typing it out? |
21:50:34 | FromDiscord | <Dumb Dragon> idk what I mean to be honest |
21:50:40 | FromDiscord | <Saint> It does seem a bit scary where you never know where a function is coming from in nim |
21:50:42 | FromDiscord | <Dumb Dragon> I just hate `::` |
21:50:51 | FromDiscord | <leorize> python `import ` conflicts are kinda fatal↵(@ambient) |
21:50:52 | FromDiscord | <Saint> If your lsp isn’t setup right |
21:50:55 | FromDiscord | <Elegantbeef> So spooky!↵(@Saint) |
21:50:58 | FromDiscord | <Saint> Which can happen a lot |
21:51:01 | FromDiscord | <Dumb Dragon> It's also why I love uniform function call syntax |
21:51:17 | FromDiscord | <Dumb Dragon> because you could just do `thing.` and your ide will give you all the suggestions |
21:51:20 | FromDiscord | <Saint> It isn’t really working always right for me in neovim |
21:51:21 | FromDiscord | <ambient> In reply to @leorize "python `import *` conflicts": IMO pytho import is kinda fatal already 😂 |
21:51:40 | FromDiscord | <Hourglass> In reply to @Elegantbeef "Yea horizon i even": Hm does `extractAs(a, int32, sp, mem)` also declare `a` via the macro? Was slightly confused for a sec because i didn't see a previous definition of it |
21:52:05 | FromDiscord | <ambient> although I understand why Nim doesn't do explicit namespacing considering how it's function calls work |
21:52:06 | FromDiscord | <Elegantbeef> I write code in unsetup nvim at times with Nim, no problem |
21:52:07 | FromDiscord | <leorize> nim have glorious types so it can handle conflicts \:p |
21:52:07 | FromDiscord | <Elegantbeef> mind even |
21:52:07 | FromDiscord | <Elegantbeef> You just need to have the entire Nim stdlib ingrained in your mined |
21:52:23 | FromDiscord | <Elegantbeef> Yes it does |
21:52:26 | FromDiscord | <Elegantbeef> It mimics the C macros that wasm3 has |
21:52:35 | FromDiscord | <ambient> the problem with very limited namespacing is other peoples code |
21:52:39 | FromDiscord | <Hourglass> But this is hella cool tho! I really should try to continue MineMachine soon |
21:52:46 | FromDiscord | <ambient> with Python I immediately know where the function is coming from |
21:52:49 | FromDiscord | <Hourglass> In reply to @Elegantbeef "It mimics the C": Yeah makes sense ^^ |
21:53:00 | FromDiscord | <Elegantbeef> I also fixed it so you can install wasm3 without having to git clone manually |
21:53:03 | FromDiscord | <Saint> In reply to @Elegantbeef "I write code in": Writing is diff from checking out a project or working on a code base rifbt |
21:53:07 | FromDiscord | <Elegantbeef> Turns out nimble has `skipDirs` |
21:53:09 | FromDiscord | <Dumb Dragon> In reply to @ambient "the problem with very": yeah that's true |
21:53:16 | FromDiscord | <Saint> There’s no way to tell where a proc is defined |
21:53:26 | FromDiscord | <Hourglass> In reply to @Elegantbeef "*I also fixed it": Hah sweet! |
21:53:31 | FromDiscord | <Elegantbeef> I dont know if that's really a big deal |
21:53:45 | FromDiscord | <Elegantbeef> I might just be too deep in the koolaid |
21:53:49 | FromDiscord | <Hourglass> It's a little less work for me heh |
21:54:00 | FromDiscord | <Elegantbeef> I mean the other conversation |
21:54:09 | FromDiscord | <Hourglass> Aah fair |
21:54:41 | FromDiscord | <Hourglass> In reply to @Saint "There’s no way to": Idk about others but the nimsaem Nim extension works well from my experience, lets me find definitions and uses easily |
21:55:07 | FromDiscord | <Saint> Oh that's for vscode? |
21:55:21 | FromDiscord | <Elegantbeef> I might just be too deep, since i generally pull the source of any library i'm using up |
21:55:33 | FromDiscord | <leorize> as long as nimsuggest doesn't hate your project everything should work well |
21:55:44 | FromDiscord | <leorize> the problem is that it's very easy to get nimsuggest to hate your project \:p |
21:56:05 | FromDiscord | <Saint> I'm sure it isn't that bad, just have to get a bit used to it |
21:56:09 | FromDiscord | <pyolyokh> and that's an example of a substantive problem that's harder to talk about vs. trivia like style sensitivity and imports |
21:56:14 | FromDiscord | <leorize> yea that won't work in today's economy beef |
21:56:38 | FromDiscord | <Elegantbeef> Damn |
21:56:56 | FromDiscord | <Elegantbeef> Off to chatgpt i guess, "how to do X in Nim" |
21:57:10 | FromDiscord | <Array in ∀ Matrix> [@Elegantbeef](https://matrix.to/#/%40elegantbeef%3Amatrix.org) can i ask for a favor? can you critic my nim code↵https://git.arrayinamatrix.xyz/array-in-a-matrix/multrix |
21:57:14 | FromDiscord | <pyolyokh> "I don't like Nim's imports." - timeless, unassailable. Neither the language nor your position are likely to change. People will nod and move along.↵"The tooling breaks and I can't look symbols up." - well gosh why don't you fix it? |
21:57:43 | FromDiscord | <Elegantbeef> That implies we havent tried to fix it |
21:57:55 | FromDiscord | <Elegantbeef> Yea i love telling people their code is shit, so will do |
21:58:28 | FromDiscord | <Elegantbeef> `preform` dont let rika see this typo |
21:58:33 | FromDiscord | <Elegantbeef> perform 😄 |
21:58:35 | FromDiscord | <Hourglass> In reply to @leorize "the problem is that": Hah yep |
22:01:58 | FromDiscord | <Elegantbeef> There you go array |
22:02:02 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lsj |
22:02:30 | FromDiscord | <leorize> shouldn't this be fixed first? |
22:02:46 | FromDiscord | <leorize> image.png https://media.discordapp.net/attachments/371759389889003532/1064666042678399046/image.png |
22:03:00 | FromDiscord | <Elegantbeef> I only fix code |
22:03:13 | FromDiscord | <leorize> oh lol I just realized it's the cross operator |
22:03:15 | FromDiscord | <Elegantbeef> I dont know how to read unicode i only have 255 characters, reject unicode |
22:03:59 | FromDiscord | <Array in ∀ Matrix> this because of this symbol × |
22:04:14 | FromDiscord | <Elegantbeef> I'd also say "use the `result` variable\` |
22:04:34 | FromDiscord | <Elegantbeef> Instead of `var matrix =` just do `result =` and remove the `return` |
22:05:09 | FromDiscord | <Elegantbeef> I'm sure leo is writing a strongly worded "fuck the result variable" 😛 |
22:05:24 | FromDiscord | <Array in ∀ Matrix> lol |
22:05:36 | FromDiscord | <leorize> instead of `paramStr(0).endsWith(...)`, use `getAppFilename().extractFilename()` |
22:06:19 | FromDiscord | <Elegantbeef> That's slightly fancier splitPath |
22:06:30 | FromDiscord | <Elegantbeef> You define a `type vector = ...` all the way at the bottom of your file inside a procedure, when you use that type you alias elsewhere |
22:06:37 | FromDiscord | <Elegantbeef> Also type's should be captialised |
22:06:47 | FromDiscord | <Elegantbeef> `for i in 0..2` is more idiomatic |
22:07:01 | FromDiscord | <Elegantbeef> `countUp` is generally just used when you want to use that `step` optional |
22:07:21 | FromDiscord | <leorize> also that `case` in `main` can be moved to a dedicated proc |
22:08:00 | FromDiscord | <Elegantbeef> `vector1[1]vector2[2] - vector1[2]vector2[1]` is more conventionally written `vector1[1] vector2[2] - vector1[2] vector2[1]` |
22:08:13 | FromDiscord | <Array in ∀ Matrix> i see |
22:08:54 | FromDiscord | <Elegantbeef> This depends on what you're after but you might want to do `stdout.write "Enter Item: ";stdout.flushFile` instead of `echo` |
22:09:02 | FromDiscord | <Elegantbeef> It doesnt move the cursor to the next line so it can look 'better' |
22:09:20 | FromDiscord | <Elegantbeef> Though there is `rdstdin` that has `readLineFromStdin` |
22:10:41 | * | azimut quit (Ping timeout: 255 seconds) |
22:10:53 | FromDiscord | <Elegantbeef> what's with the `#?` comment? |
22:11:28 | FromDiscord | <Array in ∀ Matrix> i use a vscode extension to auto color comments depending on the symbol infront of the |
22:12:10 | FromDiscord | <Array in ∀ Matrix> SS\_16.01.2023\_17\:11\:58.png https://media.discordapp.net/attachments/371759389889003532/1064668411260575804/SS_16.01.2023_171158.png |
22:12:17 | FromDiscord | <Elegantbeef> `var m = newSeqWith(0, newSeq[float](0))` now that's a funny line |
22:12:29 | FromDiscord | <Elegantbeef> What a complicated `var m: seq[seq[float]]` |
22:12:47 | FromDiscord | <Array in ∀ Matrix> lmao |
22:13:19 | FromDiscord | <Elegantbeef> Well i dont see much else to comment on |
22:14:00 | FromDiscord | <Array in ∀ Matrix> honestly this was my first nim project and i dove straight into it reading the documentation whenever i couldnt figure something out |
22:14:23 | FromDiscord | <Array in ∀ Matrix> thank you so much though for the feedback! |
22:14:42 | FromDiscord | <Elegantbeef> Well you wrote the code well enough |
22:14:52 | FromDiscord | <Elegantbeef> It's not the worst Nim i've seen |
22:15:40 | * | jjido joined #nim |
22:15:42 | FromDiscord | <Elegantbeef> there are 2 repos on github that are up there, but i dare not share them here |
22:18:44 | FromDiscord | <Array in ∀ Matrix> the does nim documentation mention being able to put multiple items into one \`of\` line? |
22:18:57 | FromDiscord | <Array in ∀ Matrix> cause i knew nim can do it but i didnt find it |
22:35:28 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-case-statement |
22:38:54 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
22:41:51 | * | azimut joined #nim |
22:52:34 | FromDiscord | <hmmm> yay I finished my newest toy app creation, should I bother with windows registry to associate some fantasy name extensions to my spiffy exe icon? or big pants boys do it another way? |
22:53:39 | FromDiscord | <hmmm> now that I think about it, myfile.fantasy looks spiffy 🫣 |
23:04:29 | FromDiscord | <Yasuke> So why do nested loops only stop after the first iteration and what should I do |
23:05:48 | FromDiscord | <Yasuke> (edit) "So why do nested ... loops" added "for" |
23:14:07 | FromDiscord | <Yasuke> sent a code paste, see https://play.nim-lang.org/#ix=4lsu |
23:24:12 | FromDiscord | <Elegantbeef> you need to open the file twice or do `for dog in lines("test.txt")` |
23:42:47 | FromDiscord | <Yasuke> In reply to @Elegantbeef "you need to open": oh interesting |
23:42:49 | FromDiscord | <Yasuke> thank you |
23:57:26 | FromDiscord | <Yasuke> Anyway of detecting if seq is empty/nil and if string is empty/nil ? |
23:57:37 | FromDiscord | <Elegantbeef> `.len == 0` |
23:58:47 | FromDiscord | <Yasuke> In reply to @Elegantbeef "`.len == 0`": ah thank you |