00:09:09 | FromDiscord | <Luckayla> In reply to @retkid "i dont wanna be": Worst possible take for open source |
00:14:16 | FromDiscord | <retkid> In reply to @Luckayla "Worst possible take for": its a thing called ✨ im an adult who cannot seem to grow out of unfunny edgy humor ✨ |
00:14:31 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/992221624935915550/unknown.png |
00:14:36 | FromDiscord | <retkid> and its nothing important at all |
00:14:43 | FromDiscord | <Luckayla> :slow_blink: |
00:15:04 | FromDiscord | <retkid> just to make code readable |
00:15:48 | FromDiscord | <retkid> and the illusion of not being relatively low level |
00:24:32 | FromDiscord | <laurenclass> Now is your Bitcoin wallet or coinbase 0.00000 I promise 0.80500 in less than 24 hours without sending money to anyone. Earn 0.764 in 7hours, No referrals, No Ads, No scams. Ask how(me)Or join https://t.me/+JdEg2rIn7E0wZDFk |
00:24:37 | FromDiscord | <laurenclass> Join and ask how |
00:25:20 | FromDiscord | <retkid> @Yardanico |
00:25:39 | FromDiscord | <retkid> <@&371760044473319454> |
00:26:12 | FromDiscord | <Elegantbeef> Where is the filter of all messages that contain the word "no scam" |
00:26:14 | FromDiscord | <Elegantbeef> words\ |
00:29:19 | FromDiscord | <retkid> why is beef not mod |
00:29:50 | FromDiscord | <Elegantbeef> No one has asked me and i cannot play nice |
00:30:04 | FromDiscord | <retkid> you play nicer than yard |
00:36:42 | * | wallabra quit (Ping timeout: 264 seconds) |
00:46:09 | FromDiscord | <Rika> “No scams” “source: trust me” |
00:51:26 | * | krux02 quit (Remote host closed the connection) |
00:54:02 | FromDiscord | <proton> https://media.discordapp.net/attachments/371759389889003532/992231573548171334/unknown.png |
01:01:52 | FromDiscord | <!Patitotective> In reply to @proton "": yes |
01:02:00 | FromDiscord | <!Patitotective> In reply to @retkid "why is beef not": hes high |
01:02:35 | FromDiscord | <retkid> In reply to @proton "": I don't think C is hard its just cumbersome |
01:03:02 | FromDiscord | <retkid> i also don't like the python comparisons |
01:03:03 | FromDiscord | <!Patitotective> In reply to @proton "": + elegant |
01:03:15 | FromDiscord | <Elegantbeef> I'm never high liar!↵(@!Patitotective) |
01:04:00 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/992234081725202472/unknown.png |
01:04:11 | FromDiscord | <!Patitotective> In reply to @retkid "": hahahah |
01:06:20 | FromDiscord | <huantian> In reply to @Elegantbeef "Where is the filter": beef is beautiful no scam |
01:07:25 | FromDiscord | <retkid> In reply to @huantian "beef is beautiful no": hes not beautiful but I'd say he sure is ...↵ELEGANT |
01:25:19 | FromDiscord | <Prestige> In reply to @retkid "I don't think C": I hear this a lot and see memory leaks |
01:25:21 | FromDiscord | <Elegantbeef> This cult following is getting a bit old, we'll have to drink the flavour aid soon |
01:28:13 | FromDiscord | <!Patitotective> why do you need c if you can write bad code in nim |
01:28:54 | FromDiscord | <Elegantbeef> Cause Nim compiles to C 😛 |
01:36:37 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=41ka |
01:36:55 | FromDiscord | <retkid> (edit) "https://play.nim-lang.org/#ix=41ka" => "https://play.nim-lang.org/#ix=41kb" |
01:37:05 | FromDiscord | <retkid> (edit) "https://play.nim-lang.org/#ix=41kb" => "https://play.nim-lang.org/#ix=41kc" |
01:37:25 | FromDiscord | <retkid> this iterates, instantiates S to a sequence with the step of sites |
01:37:28 | FromDiscord | <retkid> so sites = 4 |
01:37:35 | FromDiscord | <retkid> s == a squence to 4 with a step of 1 |
01:37:39 | FromDiscord | <retkid> (edit) "squence" => "sequence" |
01:38:34 | FromDiscord | <retkid> what i don't get is how an array can be compared to an iteratoer |
01:38:35 | FromDiscord | <retkid> (edit) "iteratoer" => "iterator" |
01:38:45 | FromDiscord | <retkid> weird arrayfire stuff |
01:39:09 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=41kd |
01:39:15 | FromDiscord | <Rika> Most people don’t use that |
01:39:53 | FromDiscord | <retkid> In reply to @Rika "?": in arrayfire? |
01:40:07 | FromDiscord | <retkid> maybe one day i'll need it so i learn |
01:42:38 | FromDiscord | <Rika> I mean I have never heard of array fire |
01:42:51 | FromDiscord | <Rika> I doubt most C programmers have |
01:44:41 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/992244319450841128/unknown.png |
01:44:43 | FromDiscord | <retkid> relatively big one |
02:01:27 | * | wallabra joined #nim |
02:01:43 | FromDiscord | <Rika> You do realise Nim has 10k+ stars and yet look at how popular it is 🙂 |
02:03:34 | FromDiscord | <retkid> a cpp library is 36% as popular as nim |
02:03:37 | FromDiscord | <retkid> thats pretty well used |
02:03:43 | FromDiscord | <Rika> ?? |
02:03:55 | FromDiscord | <retkid> what |
02:04:18 | FromDiscord | <Rika> Doesn’t sound well used to me considering the size of the C++ community |
02:04:52 | FromDiscord | <retkid> well its the best cl library that has moderately usable api in nim |
02:06:58 | FromDiscord | <retkid> rika is either rolling his eyes or actively looking for a better cl library |
02:16:25 | FromDiscord | <Rika> No I no longer know what the argument was about |
03:15:42 | FromDiscord | <mbenam> Hello, looking for some datamancer help. How do you multiply two columns? |
03:17:12 | FromDiscord | <Girvo> _waves hello_ |
03:19:56 | FromDiscord | <Girvo> Can I tell nim to _not_ use asyncfile if I want httpclient? Weird question I know lol |
03:20:26 | FromDiscord | <Elegantbeef> It doesnt use it unless you use it |
03:22:59 | FromDiscord | <Girvo> It imports it though, so it's choking on `SEEK_CUR` `SEEK_END` and `SEEK_SET` not being defined, somehow |
03:23:29 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=41ku |
03:23:54 | FromDiscord | <Elegantbeef> Ah there is no way to prevent the import of it you'd need patchfile |
03:24:01 | FromDiscord | <Girvo> Alrighty |
03:24:27 | FromDiscord | <Girvo> Cheers 🙂 Figured I'd ask! Time to work out why those constants don't exist, despite being used in ESP-IDF elsewhere anyway |
03:33:44 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=41kx |
03:33:53 | FromDiscord | <Girvo> Looks like that should be defined in a specific constants file for Nim to pick up? |
03:39:10 | FromDiscord | <Girvo> Yay it worked! I can do `httpClient` calls in ESP-IDF via PPPoS 😄 |
03:39:38 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=41ky |
03:39:38 | * | jmdaemon quit (Ping timeout: 240 seconds) |
03:39:50 | FromDiscord | <Girvo> Out over a modem on UART, all in Nim. Awesome 🙂 |
03:40:47 | FromDiscord | <Girvo> Now to see if SSL will work with the ESP-IDF's "OpenSSL compatibility layer" over mbedTLS lol. Will come down to how much of it Nim 1.6.x uses |
03:40:54 | FromDiscord | <Girvo> Which Nim version switched to OpenSSL 3? |
03:47:23 | FromDiscord | <Rika> None as of now |
03:47:27 | FromDiscord | <Rika> I believe it’s still in progress |
03:49:40 | FromDiscord | <Girvo> Ah fair enough. I saw some people trip up on it, I guess they were `choosenim`-ing devel versions? |
03:49:48 | FromDiscord | <Girvo> We might be able to upgrade then, awesome |
03:50:21 | FromDiscord | <Girvo> Now to work out how to convince Nim that I want it to pick [these](https://github.com/nim-lang/Nim/blob/141b76e36519219915ada9086d1c9b1d0b465659/lib/posix/posix_other_consts.nim#L741) up from `stdio.h` instead of `unistd.h` |
03:51:44 | FromDiscord | <xflywind> In reply to @Girvo "Which Nim version switched": No, there are some isues on macos https://github.com/nim-lang/Nim/pull/19814 |
03:52:24 | FromDiscord | <Girvo> As a mac user, I am deeply unsurprised and deeply sorry that mac continues to be annoying with things like this lol |
04:23:35 | FromDiscord | <Prestige> The problem child of OS's |
04:28:07 | FromDiscord | <Girvo> Does anyone know how `detect.nim` works? |
04:28:26 | FromDiscord | <Girvo> For generating `posix_other_consts.nim` and such? |
04:30:00 | FromDiscord | <Girvo> Oh! Neat: @elcritch I think integrated FreeRTOS into detect.nim already, I just need to patch in SEEK_CUR etc. into it and... tell it to regenerate it somehow? |
04:31:37 | FromDiscord | <Girvo> I wonder if there is an easier way to tell asyncfile.nim etc. that `var SEEK_CUR = cint(-1)` without hacking inside Nim itself lol |
04:32:29 | FromDiscord | <Girvo> Because if I'm reading this source right, it should _generate_ the freertos consts, but it's been done for Zephyr and for whatever reason doesn't pick up `SEEK_CUR` despite it working/existing in FreeRTOS anyway |
04:34:44 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=41kF |
04:35:59 | * | arkurious quit (Quit: Leaving) |
04:50:06 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=41kI |
05:16:39 | * | ehmry quit (Remote host closed the connection) |
05:17:49 | * | ehmry joined #nim |
05:19:55 | * | sagax joined #nim |
05:43:12 | * | rockcavera quit (Remote host closed the connection) |
06:00:13 | FromDiscord | <🐒🧠br4n_d0n> OK, I've been messing around with the Runes in the unicode module, but I'm struggling to define a single one other than the awkward ``.runeAt(0)`` way. Can someone help me with examples of other methods that result in 4bytes instead of the string method that results in 8? |
06:04:17 | FromDiscord | <huantian> I don't think there's any built-in way |
06:05:27 | FromDiscord | <Elegantbeef> There really should be a `rune` proc which takes a string literal and returns a single rune |
06:05:38 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=41kT |
06:05:38 | FromDiscord | <enthus1ast> > that result in 4bytes instead of the string method that results in 8?↵> What does this mean? |
06:05:58 | FromDiscord | <enthus1ast> > that result in 4bytes instead of the string method that results in 8?↵What does this mean? |
06:08:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/axh |
06:08:20 | FromDiscord | <Elegantbeef> Shit that should be `> 1` but alas i cannot type |
06:08:32 | FromDiscord | <🐒🧠br4n_d0n> In reply to @enthus1ast "> that result in": If try to do the simple method of putting the unicode character in double quotes ``" "`` without doing ``.runeAt(0)`` it results in a string with a sizeof 8 |
06:08:57 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=41kV |
06:09:43 | FromDiscord | <huantian> huh I haven't seen fastRuneAt before, would that be faster for this? |
06:09:54 | FromDiscord | <Elegantbeef> Faster than compile time, methinks not |
06:10:10 | FromDiscord | <Elegantbeef> There is 0 point for this at runtime |
06:10:40 | FromDiscord | <huantian> oh runeAt just uses fastRuneAt |
06:11:31 | FromDiscord | <🐒🧠br4n_d0n> How would I go about overloading the single quotes to add in unicode? 😋 |
06:11:42 | FromDiscord | <huantian> that seems like a bad idea lol |
06:11:49 | FromDiscord | <huantian> just type the four extra characters |
06:12:14 | FromDiscord | <enthus1ast> how do you measure this?↵(@🐒🧠br4n_d0n) |
06:12:17 | FromDiscord | <Elegantbeef> `let myRune = rune"s"` is better |
06:12:20 | FromDiscord | <enthus1ast> sizeof a string is always 8 |
06:13:24 | FromDiscord | <enthus1ast> if you just do`echo sizeof("äöo")`you get the size of the pointer |
06:13:51 | FromDiscord | <🐒🧠br4n_d0n> In reply to @huantian "that seems like a": Hey, if I want to be a caveman and bash bits to Beef's dismay, then I should be able to overload my single quotes as well. lol😈 |
06:14:10 | FromDiscord | <Elegantbeef> I mean you can make your own literal type |
06:14:25 | FromDiscord | <Elegantbeef> Dont recall if it's just numeric literals |
06:14:35 | FromDiscord | <huantian> just use term rewriting macros 😛 |
06:15:28 | FromDiscord | <Elegantbeef> Nope only seems to be for numerical literals |
06:16:18 | FromDiscord | <Elegantbeef> I unironically believe some people just write code to my dismay↵(@🐒🧠br4n_d0n) |
06:18:45 | FromDiscord | <🐒🧠br4n_d0n> https://tenor.com/view/dogecoin-doge-mining-crypto-wow-gif-14225529 |
06:18:49 | FromDiscord | <b1rdf00d> In reply to @b1rdf00d "I've started using nim": sorry to bump my own question, but any ideas on this? my intuition is it's some sort of type / memory conversion thing but the 256 is throwing me off |
06:18:53 | FromDiscord | <Prestige> Lol beef |
06:18:58 | FromDiscord | <Prestige> I promise I'm not one of those |
06:19:04 | * | ltriant quit (Quit: leaving) |
06:19:45 | FromDiscord | <🐒🧠br4n_d0n> (edit) "https://tenor.com/view/dogecoin-doge-mining-crypto-wow-gif-14225529" => "https://tenor.com/view/dogecoin-doge-mining-crypto-wow-gif-14225529↵Beef, just think of this as me with flipping bits" |
06:20:21 | FromDiscord | <Elegantbeef> I'll take a look at that now bird |
06:20:54 | FromDiscord | <b1rdf00d> thanks heaps! even just a point in the direction for how / what to debug would be ace |
06:20:58 | FromDiscord | <Elegantbeef> Works fine here what OS/shell are you using? |
06:21:04 | FromDiscord | <b1rdf00d> macos |
06:21:23 | FromDiscord | <b1rdf00d> (edit) "macos ... " added "12.4" |
06:21:28 | FromDiscord | <🐒🧠br4n_d0n> most likely zsh then |
06:22:05 | FromDiscord | <b1rdf00d> yeah sorry, macos with zsh |
06:22:06 | FromDiscord | <Elegantbeef> Yea on linux with bash and shell everything seems fine |
06:22:15 | FromDiscord | <Elegantbeef> bash and fish and sh |
06:22:24 | FromDiscord | <b1rdf00d> okay cool! thanks for testing it 🙂 |
06:23:18 | FromDiscord | <Elegantbeef> Let's try a different api to see if it's repeated |
06:23:18 | FromDiscord | <enthus1ast> what does the macos shell reports as the exit code? |
06:23:27 | FromDiscord | <Rika> In reply to @br4n_d0n "How would I go": Prolly with a macro? |
06:23:41 | FromDiscord | <Rika> In the end it’ll result in a string though |
06:23:49 | FromDiscord | <Rika> Not even sure if the parser allows it |
06:24:13 | FromDiscord | <Rika> Prolly doesn’t do |
06:24:40 | FromDiscord | <b1rdf00d> sent a code paste, see https://play.nim-lang.org/#ix=41kW |
06:24:54 | FromDiscord | <b1rdf00d> not sure how else to inspect the value 😅 |
06:25:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41kX |
06:25:21 | FromDiscord | <Elegantbeef> Does the above also replicate the issue? |
06:25:42 | FromDiscord | <Elegantbeef> Also you are on a recent nim version? |
06:26:24 | FromDiscord | <b1rdf00d> In reply to @Elegantbeef "Does the above also": nope! I get 1! |
06:26:39 | FromDiscord | <Elegantbeef> Ok so execShellCmd does something funky on your OSX |
06:27:06 | FromDiscord | <b1rdf00d> sent a code paste, see https://play.nim-lang.org/#ix=41kY |
06:27:07 | FromDiscord | <b1rdf00d> yep, makes sense |
06:27:25 | FromDiscord | <b1rdf00d> thanks very much for the help |
06:28:21 | FromDiscord | <b1rdf00d> I've mostly been using nim in my spare time for fun, but starting to use it at work where I can for local automation / helper stuff |
06:30:28 | FromDiscord | <Elegantbeef> The issue is probably https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/os.nim#L2047-L2056 but i'm uncertain |
06:30:31 | FromDiscord | <Elegantbeef> Now to get back to this message, after you saying that i can only say doubt 😛↵(@Prestige) |
06:32:21 | FromDiscord | <Prestige> Haha |
06:33:32 | FromDiscord | <Elegantbeef> Or `execProcesses` rather |
06:34:25 | FromDiscord | <retkid> after realizing that assigning an 2d array 1 million values would take a long time i've come to the conclusion that not using arraymancer is insane |
06:34:54 | FromDiscord | <retkid> how good is arraymancer's gpgpu? |
06:35:06 | FromDiscord | <Prestige> I'm curious, how were you assigning the values? |
06:35:23 | FromDiscord | <Elegantbeef> Hmm maybe the bridge will bridge that message |
06:35:23 | FromDiscord | <Elegantbeef> For context if confused you re-implemented it for nimtest |
06:35:27 | FromDiscord | <Elegantbeef> Who knows |
06:35:47 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/992317575562280961/unknown.png |
06:35:50 | FromDiscord | <Elegantbeef> \My discord shit the bed so it's the only reason i know it didnt |
06:36:05 | FromDiscord | <retkid> echo x was debug |
06:36:10 | FromDiscord | <Elegantbeef> The slow thing is the echo |
06:36:13 | FromDiscord | <retkid> yes |
06:36:14 | FromDiscord | <retkid> i know |
06:36:17 | FromDiscord | <retkid> it was slow before |
06:36:24 | FromDiscord | <retkid> .-. |
06:36:25 | FromDiscord | <Elegantbeef> `for x in a.mitems: x = rand(0..255)` isnt that complex |
06:36:37 | FromDiscord | <Prestige> @Elegantbeef#0000 what about nimtest? |
06:36:50 | FromDiscord | <Elegantbeef> The reason it's so slow ret is you're iterating over all integers |
06:37:01 | FromDiscord | <Elegantbeef> `(width height 3).high` returns `int.high` |
06:37:07 | FromDiscord | <🐒🧠br4n_d0n> @ElegantBeef and @b1rdf00d I can confirm on my macOS 1.6.7 build that code gives me ``256`` as well |
06:37:21 | FromDiscord | <Elegantbeef> You remade `execProcesses` |
06:37:21 | FromDiscord | <retkid> In reply to @Elegantbeef "`(width * height *": a.mitems doesn't exist |
06:37:35 | FromDiscord | <Elegantbeef> That doesnt change the logic you're doing iis wrong |
06:37:37 | FromDiscord | <retkid> i have to iterate over a for loop |
06:37:46 | FromDiscord | <Elegantbeef> you want to do `(width height 3)` |
06:37:57 | FromDiscord | <Prestige> Oh that `high` is such a problem lol |
06:37:58 | FromDiscord | <Elegantbeef> `.high` returns `int.high` which is much much larger |
06:38:11 | FromDiscord | <retkid> stop making me optimize my code |
06:38:20 | FromDiscord | <retkid> i didn't run .high |
06:38:22 | FromDiscord | <Elegantbeef> It's not optimising it's fixing it |
06:38:23 | FromDiscord | <retkid> i thought it looked nice for you |
06:38:28 | FromDiscord | <retkid> i really did -1 |
06:38:55 | FromDiscord | <Elegantbeef> Well one of you two with a mac make a issue if one doesnt exist, thanks |
06:39:02 | FromDiscord | <zhmtzhmt> sent a long message, see http://ix.io/41l2 |
06:39:20 | FromDiscord | <Elegantbeef> It's looking for vcc |
06:39:29 | FromDiscord | <Elegantbeef> You dont have vcc so `--cc:gcc` should resolve it |
06:39:35 | FromDiscord | <Elegantbeef> If you want to use vcc download it and set it up |
06:39:52 | FromDiscord | <Elegantbeef> So prestige hopefully you get what i said about nimtest 😄 |
06:40:02 | FromDiscord | <zhmtzhmt> sent a code paste, see https://play.nim-lang.org/#ix=41l3 |
06:40:19 | FromDiscord | <Elegantbeef> How did you install Nim? |
06:40:32 | FromDiscord | <Prestige> Beef you said I remade execProcess? Hmm I'll take a look in a bit |
06:40:43 | FromDiscord | <Elegantbeef> execProcesses to be exact |
06:40:51 | FromDiscord | <Prestige> Ah |
06:40:59 | FromDiscord | <Elegantbeef> The stdlib has an API for dispatching N number of processes and run code after |
06:41:17 | FromDiscord | <Elegantbeef> So your thread api and all that is redundant and can be replaced with a much simpler call |
06:41:21 | FromDiscord | <retkid> anyway, does arraymancer have linear algebra functions ;-; |
06:41:42 | FromDiscord | <huantian> it's called arraymancer |
06:41:46 | FromDiscord | <huantian> and it does matricies |
06:41:46 | FromDiscord | <retkid> i would assume so |
06:41:48 | FromDiscord | <huantian> what did you expect lmao |
06:41:57 | FromDiscord | <retkid> (╯°□°)╯︵ ┻━┻ |
06:42:06 | FromDiscord | <huantian> ┬─┬ ノ( ゜-゜ノ) |
06:42:38 | FromDiscord | <🐒🧠br4n_d0n> In reply to @Elegantbeef "Well one of you": @b1rdf00d You may want to check and see if there is an existing issue, if not, you should probably make one |
06:42:50 | FromDiscord | <Prestige> In reply to @Elegantbeef "So your thread api": Sweet |
06:43:29 | FromDiscord | <b1rdf00d> In reply to @br4n_d0n "<@775600941985431562> You may want": will do! |
06:43:48 | FromDiscord | <b1rdf00d> I think it's not that section since the exit code is _multiplied_ by 256 |
06:43:57 | FromDiscord | <Elegantbeef> Look at my minions they're capable of repeating what i say |
06:44:00 | FromDiscord | <b1rdf00d> e.g. exit(2) -> 512 |
06:44:17 | FromDiscord | <Elegantbeef> I mean iif you were really inclined you could attempt to fix it 😄 |
06:44:24 | FromDiscord | <b1rdf00d> I would like to |
06:44:26 | FromDiscord | <🐒🧠br4n_d0n> https://tenor.com/view/banana-love-minion-in-love-smile-gif-16330833 |
06:45:34 | FromDiscord | <🐒🧠br4n_d0n> Aww man, are animated gifs turned off in this chat? |
06:45:41 | FromDiscord | <Elegantbeef> well `c_system` is defined as https://github.com/nim-lang/Nim/blob/d0232f0e5b97b697a640c2f622c7596ce6d10eb5/lib/pure/os.nim#L1115-L1116 |
06:46:04 | FromDiscord | <Elegantbeef> So if it's not that it has to be that status proc |
06:47:04 | FromDiscord | <b1rdf00d> thanks! I'll see how I go |
06:47:29 | FromDiscord | <Elegantbeef> You can always import the procs it uses in your own file outside of the stdlib |
06:47:52 | FromDiscord | <Elegantbeef> Then you can see what each reports and author a PR to fix it |
06:49:17 | FromDiscord | <b1rdf00d> yep cool 👍 |
06:50:56 | FromDiscord | <Elegantbeef> This is the best outcome of OSS, "I found X thing is broke, and I will attempt to fix it" |
06:51:13 | FromDiscord | <Elegantbeef> is reminded he found an issue with Wine and a specific game and the possible problem, but doesnt want to write C so is avoiding fixing it |
06:52:15 | FromDiscord | <Rika> Just report it then |
06:52:53 | FromDiscord | <b1rdf00d> 😄 I've been playing around with raylib and array mancer, this should give me a tight scope to try something different and get debugging working in my env |
06:53:53 | FromDiscord | <Elegantbeef> I aint no snitch↵(@Rika) |
06:54:01 | FromDiscord | <zhmtzhmt> Why c2nim can't be built on windows with vcc? |
06:54:28 | FromDiscord | <zhmtzhmt> Additional info: Requested command not found: 'cl.exe'. OS error: [OSError] |
06:54:40 | FromDiscord | <Elegantbeef> It cannot find `cl` in your path |
06:54:58 | FromDiscord | <Elegantbeef> Someone can probably help but i'm not that someone |
06:55:02 | FromDiscord | <zhmtzhmt> how to fix it? |
06:55:32 | FromDiscord | <zhmtzhmt> 😄 |
06:55:43 | FromDiscord | <enthus1ast> imho on windows you need to aktivate your environment |
06:55:49 | FromDiscord | <🐒🧠br4n_d0n> In reply to @Elegantbeef "This is the best": I'd like to help fix or add new things, but my technical expertise are not up to par yet |
06:56:00 | FromDiscord | <enthus1ast> vcvarsall.bat ? |
06:56:19 | FromDiscord | <Elegantbeef> There is a ton of low hanging things that needed attended to↵(@🐒🧠br4n_d0n) |
06:56:31 | FromDiscord | <enthus1ast> can you try to run vcvarsall.bat in a shell and try to call cl.exe |
06:56:39 | FromDiscord | <zhmtzhmt> Hint: using d:\Prog\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat |
06:56:45 | FromDiscord | <enthus1ast> yes |
06:56:58 | FromDiscord | <enthus1ast> but who knows |
06:56:58 | FromDiscord | <zhmtzhmt> It used this |
06:57:20 | FromDiscord | <enthus1ast> try to call this by hand, then call cl.exe in a shell |
06:57:24 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 there you go |
06:57:42 | FromDiscord | <zhmtzhmt> ok |
06:57:55 | FromDiscord | <zhmtzhmt> I will try, thank you |
06:58:13 | FromDiscord | <enthus1ast> just to see if it could work |
07:43:06 | FromDiscord | <zhmtzhmt> I switch to mingw, |
07:43:23 | FromDiscord | <zhmtzhmt> Failed to build with msvc |
07:47:10 | FromDiscord | <demotomohiro> Nim on windows has `vccexe.exe` that automatically find `cl.exe` and call it when you set `--cc:vcc`. So you don't need to run `vcvarsall.bat` if `vccexe.exe` works correctly. |
07:47:41 | FromDiscord | <PyryTheBurger> is there a way to make seqs of any type? |
07:48:10 | FromDiscord | <Rika> If you mean contains any type, not if it is an arbitrary type |
07:48:17 | FromDiscord | <zhmtzhmt> I simplely run nim comiple test.nim |
07:48:20 | FromDiscord | <PyryTheBurger> contains any type |
07:48:30 | FromDiscord | <Rika> You can otherwise, just encapsulate the types in an object variant to make it one type |
07:48:46 | FromDiscord | <enthus1ast> what do you wanna do?↵(@PyryTheBurger) |
07:48:54 | FromDiscord | <zhmtzhmt> vcvarsall.bat was called automatically. |
07:49:05 | FromDiscord | <demotomohiro> In reply to @PyryTheBurger "is there a way": https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-how-to-store-different-types-in-seqqmark |
07:49:26 | FromDiscord | <Prestige> I can't believe I didn't know `execProcesses` existed |
07:49:28 | FromDiscord | <Elegantbeef> Jeez demo you dont have the silliest version there! |
07:49:54 | FromDiscord | <Prestige> I almost feel like making youtube videos about these different std modules |
07:50:32 | FromDiscord | <enthus1ast> when i was doing python programming years ago i liked the (python) "module of the week" website |
07:52:22 | FromDiscord | <demotomohiro> You can access each elements of seq randomly and efficiently thanks to each elements are same type. |
07:52:25 | FromDiscord | <xflywind> There is a nim weekly in twitter: https://nitter.net/NimDiscussions |
07:52:40 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41lf |
07:52:43 | FromDiscord | <Elegantbeef> Everyone's favourite OOP solution! |
07:54:02 | FromDiscord | <enthus1ast> since the object kind solution does not allow multiple attributes to have the same name, this is the only one that kinda composes |
07:54:32 | FromDiscord | <demotomohiro> @ElegantBeef Thank you! I will add that code. |
07:55:01 | FromDiscord | <enthus1ast> the only problem, it's on twitter↵(@xflywind) |
07:55:41 | FromDiscord | <enthus1ast> cannot use twitter withouth going insane |
07:56:06 | FromDiscord | <xflywind> In reply to @enthus1ast "cannot use twitter withouth": Yeah, I cannot use twitter too, it sucks. |
07:56:55 | FromDiscord | <enthus1ast> nitter is better, but its just to annoying to copy paste links to it on eg mobile |
07:58:24 | FromDiscord | <xflywind> https://discu.eu/weekly/nim/ provides email subscription. I dunno whether it is collected by bot though. |
08:00:07 | FromDiscord | <Prestige> hm nitter isn't loading for me |
08:00:36 | FromDiscord | <xflywind> Actually google is my Nim weekly. I only need to search "nim language" plus past week range 😆 |
08:00:58 | FromDiscord | <enthus1ast> i often sort github by "recently changed" |
08:01:00 | FromDiscord | <enthus1ast> with nim |
08:01:11 | FromDiscord | <enthus1ast> to see whats going on in the nim verse |
08:01:16 | FromDiscord | <xflywind> Yeah, so does Github https://github.com/search?o=desc&q=nim+language%3Anim&s=updated&type=Repositories |
08:02:05 | madprops | made/making this thing https://github.com/madprops/goldie |
08:02:27 | FromDiscord | <xflywind> All repos written in Nim with Nim label or nim keyword in the description. |
08:03:33 | madprops | ? |
08:03:54 | madprops | ok in the description "written in nim" ? |
08:04:19 | madprops | oh there's a topics field |
08:05:25 | FromDiscord | <enthus1ast> yeah thats what i mena↵(@xflywind) |
08:05:26 | FromDiscord | <enthus1ast> mean |
08:07:18 | FromDiscord | <xflywind> I see. Last year there are only 4k repos by this search method. Now there are 5k repos. 🥳 |
08:07:46 | FromDiscord | <xflywind> (edit) "only" => "less than" |
08:07:53 | FromDiscord | <xflywind> (edit) "I see. Last year there are less than 4k repos by this search method. Now there are ... 5k" added "more than" |
08:35:37 | FromDiscord | <Phil> Hah, and I made, like 2 of them! |
08:35:48 | FromDiscord | <Phil> (edit) "like" => "like," |
08:39:29 | FromDiscord | <xflywind> Nice😋 |
08:49:34 | FromDiscord | <demotomohiro> @ElegantBeef I have add your code on my FAQ page. Thank you!↵https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-how-to-store-different-types-in-seqqmark |
08:58:58 | FromDiscord | <Phil> In reply to @enthus1ast "nitter is better, but": Man, I wish so badly firefox mobile would have nitter |
09:18:25 | FromDiscord | <luteva> sent a code paste, see https://play.nim-lang.org/#ix=41lB |
09:18:27 | FromDiscord | <luteva> thanks a lot! |
09:18:31 | FromDiscord | <luteva> 🙂 |
09:19:12 | FromDiscord | <luteva> (edit) "https://play.nim-lang.org/#ix=41lB" => "https://play.nim-lang.org/#ix=41lC" |
09:25:13 | FromDiscord | <luteva> sent a long message, see http://ix.io/41lD |
09:37:19 | FromDiscord | <amadan> sent a long message, see http://ix.io/41lF |
09:41:35 | FromDiscord | <Rika> I have a suspicion |
09:41:49 | FromDiscord | <Rika> If you use file instead of the file stream, does it work? |
09:45:32 | FromDiscord | <amadan> tried that thinking same thing, didn't work |
09:47:07 | FromDiscord | <amadan> Checking if the stream/file is end of file though is still returning true after file is edited so maybe its not reading lines since it doesn't think it can 🤔 |
09:47:35 | FromDiscord | <luteva> same for me. file instead of file stream doesn't work either. |
09:55:14 | NimEventer | New Nimble package! arbitrary - Generating structured data from arbitrary, unstructured input., see https://github.com/planetis-m/arbitrary |
09:57:56 | FromDiscord | <luteva> In reply to @amadan "Checking if the stream/file": so, what can we try no? how can we check?↵the documentation is pretty clear imo for readLine(...):↵"Returns false if the end of the file has been reached, true otherwise. If false is returned line contains no new data."↵So in our case there should be new data. and so true should be returned, right? |
10:09:07 | FromDiscord | <amadan> If you call `atEnd` with the stream it prints true even after you edit the file↵so don't think it knows it has new data |
10:14:48 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=41lK |
10:15:08 | FromDiscord | <luteva> ok, so the problem seems to be that it doesn't know about new data. (or maybe the problem is i misunderstood the way it works. But most people said that it should work as i expect it, too!)↵Does anyone has an idea how to fix that without closing and reopening the stream (or the file) all over the time?↵Is this something for a bugreport? |
10:15:19 | FromDiscord | <amadan> Forces the file to recheck if its at the end↵Should work for stream also using `setPosition` and `getPosition` |
10:15:38 | FromDiscord | <luteva> ok thanks a lot! |
10:16:02 | FromDiscord | <luteva> anyway: is this a subject for a bugreport? |
10:17:28 | FromDiscord | <amadan> no clue ¯\_(ツ)_/¯ |
10:18:11 | FromDiscord | <amadan> quick glace makes me think its the c api that the io module uses causes it to work that way? |
10:25:45 | FromDiscord | <luteva> makes sense. but anyway, this is quite confusing imo! And calling a different proc (set-/getPosition) to achieve something else (force a check if we are at the end) is a workaround i never would came up with.... |
10:27:08 | FromDiscord | <luteva> (so thanks again amadan 👍 ) |
10:27:51 | FromDiscord | <demotomohiro> If you just want to send a data from a process to other process, pipe is more easier. |
10:30:44 | FromDiscord | <luteva> the other process is writing to a file and not under my control. so i cannot switch using pipes.↵It's like a logfile. and i just want to continously read the file (just as tail -f does). |
10:31:36 | FromDiscord | <demotomohiro> What sould happen when you remove lines on text editor while your program is reading the file? Read position go further above end of file? |
10:36:05 | FromDiscord | <luteva> the file is only appended at the end. it's a (kind of) logfile. so the solution that @amadan posted should work quite well. It's just confusing that we have to do this "get/setPosition" kind of "workaround". |
10:44:58 | FromDiscord | <Rika> In reply to @luteva "the file is only": The point is that the file api isn’t just for your kind of file that’s append only |
11:05:20 | FromDiscord | <luteva> the point is, that i am now confused about what a filestream is? what it can be or should be? i mean: in a stream i would expect append (at the end) only. so maybe i totally misunderstood streams...?!? (and in this case the filestream) |
11:07:24 | FromDiscord | <luteva> i mean: i am not using file (directly) but filestream. and in a stream (a filestream) i would expect anything but append to the end. |
11:07:42 | FromDiscord | <luteva> (edit) "would" => "wouldn't" |
11:11:53 | madprops | wait what.. not returning something returns a default value in a proc? |
11:15:10 | madprops | from a proc* |
11:18:58 | FromDiscord | <demotomohiro> Stream in Nim wraps files, strings, pipes or sockets so that you can read/write it as if it is an array of bytes. Why do you expect stream can read data that is appended by other process after the file was open?↵Do we need to care about other processes changing the content of the file or size of the file while we reading a file using stream? |
11:21:31 | madprops | https://play.nim-lang.org/#ix=41m1 |
11:21:36 | madprops | didn't know it worked like that |
11:21:43 | madprops | for proc returns |
11:23:34 | FromDiscord | <demotomohiro> `let` is not an expression. It returns empty string because it is default value of string. |
11:24:24 | FromDiscord | <valerga> yeah that let could be anything but |
11:24:32 | FromDiscord | <valerga> i would have guessed nim would error at no return |
11:26:08 | FromDiscord | <Phil> In reply to @madprops "https://play.nim-lang.org/#ix=41m1": the proc returns the last expression in such a case |
11:26:14 | FromDiscord | <Phil> Or, well, tries to |
11:26:50 | FromDiscord | <demotomohiro> `Stream` provides same interface for fileStream, stringStream and stream for pipes so that you can reuse same procs for different kinds of streams. |
11:29:06 | FromDiscord | <Phil> sent a long message, see http://ix.io/41m2 |
11:29:23 | FromDiscord | <Phil> (edit) "http://ix.io/41m2" => "http://ix.io/41m3" |
11:30:02 | FromDiscord | <Phil> (edit) "http://ix.io/41m3" => "http://ix.io/41m4" |
11:30:03 | madprops | i knew about result. didn't know it was initialized automatically with a default value |
11:30:43 | FromDiscord | <Phil> Yeh, keep in mind though that this is only true for value types, not ref types. |
11:41:00 | FromDiscord | <Phil> Just checked, for ref-types a variable gets "initiated" with `nil` |
11:41:28 | FromDiscord | <Phil> (edit) "`nil`" => "`nil`. Which will cause a compiler error if you try to read the memory that variable references before assigning anything to it." |
12:16:56 | FromDiscord | <b1rdf00d> sent a code paste, see https://play.nim-lang.org/#ix=41m8 |
12:17:13 | FromDiscord | <b1rdf00d> (edit) "https://play.nim-lang.org/#ix=41m8" => "https://play.nim-lang.org/#ix=41m9" |
12:24:56 | FromDiscord | <Rika> reading the doc for status |
12:25:05 | FromDiscord | <Rika> i mean system |
12:25:08 | FromDiscord | <Rika> `man 3 system` |
12:25:46 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=41mb |
12:25:48 | FromDiscord | <Rika> `man 2 waitpid` |
12:26:36 | FromDiscord | <Rika> sent a code paste, see https://paste.rs/2Dn |
12:26:58 | FromDiscord | <Rika> 256 is 9 bits |
12:27:04 | FromDiscord | <Rika> your return value is 0 |
12:27:13 | FromDiscord | <Rika> huh that's strange |
12:27:44 | FromDiscord | <Rika> (edit) "https://play.nim-lang.org/#ix=41mb" => "https://paste.rs/piP" |
12:28:30 | FromDiscord | <Rika> that is strange |
12:31:30 | FromDiscord | <b1rdf00d> TIL you can man page c functions |
12:32:36 | FromDiscord | <Rika> lol |
12:33:02 | FromDiscord | <b1rdf00d> yeah the weird thing is if the python file has say `exit(3)` then the result is 768 (which doesn't fit in 9 bits). Never the less I think that this isn't a nim issue at all since going directly to c produces the same output |
12:33:32 | FromDiscord | <b1rdf00d> oh well, I don't want to go down a c rabbit hole |
12:33:37 | FromDiscord | <Rika> you mught actually have to test the macros listed in waitpid(2) |
12:33:43 | FromDiscord | <Rika> have fun 😛 |
12:33:56 | FromDiscord | <b1rdf00d> I am kinda curious now... |
12:40:48 | FromDiscord | <b1rdf00d> sent a code paste, see https://play.nim-lang.org/#ix=41mh |
12:42:29 | FromDiscord | <Rika> fun |
13:15:49 | * | rockcavera joined #nim |
13:15:49 | * | rockcavera quit (Changing host) |
13:15:49 | * | rockcavera joined #nim |
13:42:54 | * | arkurious joined #nim |
14:16:59 | * | pch joined #nim |
15:37:37 | FromDiscord | <Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=41mY |
16:24:28 | FromDiscord | <PyryTheBurger> what does typed mean in nim |
16:34:06 | FromDiscord | <PyryTheBurger> argh this is the only thing i dont like about statically typed languages |
16:34:15 | FromDiscord | <PyryTheBurger> cant have multiple types of varargs |
16:34:26 | FromDiscord | <PyryTheBurger> annoyiiiiiiiiing |
16:36:08 | FromDiscord | <Alea> if you have and item in a table and pass it to a proc with a var arg like tbl[itm].update(), will it update the item? |
16:36:13 | FromDiscord | <Alea> (edit) "and" => "an" |
16:41:17 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=41nk |
16:42:27 | FromDiscord | <enthus1ast> but i would try to see if you can change the way you do stuff, this is not needed that often really |
16:42:52 | FromDiscord | <enthus1ast> Nim also offers concepts |
16:43:28 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/manual_experimental.html#concepts |
16:43:41 | FromDiscord | <that_dude> In reply to @PyryTheBurger "argh this is the": https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-how-to-store-different-types-in-seqqmark Theres also this which may be of use |
16:44:22 | FromDiscord | <enthus1ast> ahh he added the "all favourites example" |
17:26:27 | FromDiscord | <PyryTheBurger> so types have a limited amount of variables????? |
17:26:31 | FromDiscord | <PyryTheBurger> do |
17:27:12 | FromDiscord | <enthus1ast> what? |
17:27:53 | FromDiscord | <PyryTheBurger> in my object there is 4 variables, when i add a 5th one, one of the variables gets completeky ignored |
17:28:21 | FromDiscord | <enthus1ast> what does ignore mean? |
17:28:39 | FromDiscord | <PyryTheBurger> it ignores in in the code, it makes it 0 |
17:29:01 | FromDiscord | <PyryTheBurger> i guess thats not really ignoring but still |
17:29:08 | FromDiscord | <enthus1ast> do you initialize it? |
17:29:20 | FromDiscord | <PyryTheBurger> yeah |
17:29:47 | FromDiscord | <enthus1ast> please show the code |
17:30:44 | FromDiscord | <PyryTheBurger> sent a long message, see http://ix.io/41nu |
17:33:03 | FromDiscord | <enthus1ast> mh |
17:33:11 | FromDiscord | <enthus1ast> how do you put stuff in text? |
17:33:30 | FromDiscord | <PyryTheBurger> sent a long message, see http://ix.io/41nw |
17:33:39 | FromDiscord | <PyryTheBurger> i have a seq called buttons |
17:34:08 | * | vicecea quit (Remote host closed the connection) |
17:34:38 | * | vicecea joined #nim |
17:38:47 | FromDiscord | <enthus1ast> i see no reason in the code you posted why it should be (0,0) |
17:39:12 | FromDiscord | <enthus1ast> only of course pos is (0,0) in the param already |
17:40:18 | FromDiscord | <enthus1ast> the only strange thing i see is that you add this to the buttons sequence |
17:40:56 | FromDiscord | <enthus1ast> so you will have a copy |
18:12:55 | FromDiscord | <PyryTheBurger> i need to add them to the seq because i need to loop over all the buttons |
18:13:18 | FromDiscord | <enthus1ast> yes but you do it in the newButton and also return it |
18:13:22 | FromDiscord | <enthus1ast> so you have two |
18:13:32 | FromDiscord | <PyryTheBurger> so how do i prevent it |
18:14:12 | FromDiscord | <enthus1ast> "ref object" for example, or do not put it in the seq inside the constructor |
18:16:27 | FromDiscord | <PyryTheBurger> ref object made errors |
18:48:15 | * | xet7 joined #nim |
18:49:17 | FromDiscord | <PyryTheBurger> sent a long message, see http://ix.io/41nF |
18:49:50 | FromDiscord | <PyryTheBurger> nvm fixed it |
18:51:18 | FromDiscord | <PyryTheBurger> wait what |
18:58:57 | * | xet7 quit (Remote host closed the connection) |
19:04:10 | FromDiscord | <arnetheduck> yay for markdown - now, if only we can get rid of runnableexamples too 🙂 https://github.com/nim-lang/Nim/pull/19954 |
19:08:27 | FromDiscord | <konsumlamm> what, what's the problem with `runnableExamples`? |
19:24:15 | FromDiscord | <retkid> is there an easy way to iterate over a tensor |
19:24:22 | FromDiscord | <retkid> (edit) "is there an easy way to iterate over a tensor ... " added "in each dimension" |
19:24:24 | FromDiscord | <retkid> so like |
19:24:43 | FromDiscord | <retkid> if i had a tensor with a y of 3 and an x of 600 |
19:24:59 | FromDiscord | <retkid> i iterate over the x and yield a 3y arrat |
19:25:00 | FromDiscord | <retkid> (edit) "arrat" => "array" |
19:25:10 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix= |
19:25:26 | FromDiscord | <retkid> (edit) "https://play.nim-lang.org/#ix=" => "https://play.nim-lang.org/#ix=41nT" |
19:25:46 | FromDiscord | <retkid> y is the tensor, lemme update that name |
19:43:24 | FromDiscord | <arnetheduck> In reply to @konsumlamm "what, what's the problem": it's hard to tell / distinguish from real code (ie it distracts from getting from proc signature to actual code - it takes effort to find the code which is never good) and it can't be flowed reasonably into sections mixing code and docs |
19:45:12 | * | syl quit (Ping timeout: 246 seconds) |
20:02:06 | FromDiscord | <retkid> i wanna do something cursed i need a ref of a variable |
20:02:25 | FromDiscord | <retkid> actually i have an idea 👿 |
20:06:03 | FromDiscord | <retkid> nah it didn't work |
20:06:04 | FromDiscord | <retkid> 😭 |
20:09:22 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=41o6 |
20:09:42 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=41o7 |
20:09:49 | FromDiscord | <retkid> all that to do a zi[p |
20:09:50 | FromDiscord | <retkid> (edit) "zi[p" => "zip" |
20:10:48 | FromDiscord | <federico3> dlopen(libssl.1.1.dylib, 2)\: image not found any documentation on what is the search path on OSX? |
20:12:20 | Amun-Ra | hmm, check otool |
20:13:31 | FromDiscord | <federico3> otool is showing me where the the library is linked to but not where Nim is looking for |
20:14:09 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=41oa |
20:14:56 | FromDiscord | <federico3> export DYLD\_LIBRARY\_PATH="/usr/local/Cellar/[email protected]/1.1.1p/lib" fixes it but only if I compile-then-run something |
20:14:56 | FromDiscord | <federico3> nim c -r foo.nim does not pass the env |
20:15:33 | Amun-Ra | I have never run nim on osx but I presume it uses default search rpath |
20:16:13 | Amun-Ra | federico3: http://clarkkromenaker.com/post/library-dynamic-loading-mac/ |
20:16:23 | Amun-Ra | perhaps you'll find there something useful |
20:16:31 | FromDiscord | <Phil> In reply to @PyryTheBurger "wait what": From your reaction here I assume that some stuff is still problematic?↵If you still want somebody to take a look at it, could you post the definition of your other types in there ? |
20:39:16 | * | syl joined #nim |
20:45:47 | FromDiscord | <Elegantbeef> This is quite a funny comment https://news.ycombinator.com/item?id=31942338 |
20:48:01 | * | nyeaa joined #nim |
20:52:05 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "This is quite a": I think many just lack the technical terms.↵Whitespace + good type inference is what they are looking for. |
20:52:25 | FromDiscord | <Elegantbeef> I mean it's funny cause scripting languages are... well meant for scripting |
20:52:43 | FromDiscord | <Elegantbeef> "scripting style" means nothing |
21:02:47 | FromDiscord | <Phil> I mean, given python is touted as the scripting language, that comment has the connotation to me of "It uses whitespaces instead of curly braces, thus it must be a scripting language" |
21:19:05 | Amun-Ra | "it's closer to X than to C++" is a pro not a con |
21:20:09 | FromDiscord | <Phil> inb4 X is brainfuck |
21:21:00 | Amun-Ra | it could even be a logo |
21:24:47 | FromDiscord | <Luckayla> I love python to death but I would pick Lua over it for scripting |
21:24:53 | FromDiscord | <Luckayla> Just nicer to integrate into things |
21:25:14 | FromDiscord | <Luckayla> I guess for EMBEDDED scripting I mean |
21:25:32 | FromDiscord | <Luckayla> For system scripts I wouldn't dream of using anything other than python |
21:26:22 | * | pch quit (Read error: Connection reset by peer) |
21:26:40 | * | pch joined #nim |
21:37:16 | FromDiscord | <j-james> what's best practice for dealing with objects where some fields may remain uninitialized? |
21:37:28 | FromDiscord | <Elegantbeef> `Option[T]` |
21:37:37 | FromDiscord | <Elegantbeef> Or a sentinel value if you prefer |
21:38:16 | FromDiscord | <j-james> what's a sentinel value? |
21:38:34 | FromDiscord | <Elegantbeef> You designate a value to be "empty" and remove that as a possible value |
21:38:39 | FromDiscord | <Elegantbeef> Like the often `-1` or `0` |
21:39:01 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimtrest/blob/master/sentinels.nim a generic type for it here |
21:40:22 | FromDiscord | <j-james> interesting, i see |
21:42:02 | FromDiscord | <j-james> i'll probably play around with options some |
21:42:28 | FromDiscord | <j-james> i don't think sentinels will work for the nested ref types i'm using |
21:49:40 | FromDiscord | <j-james> if i have a function taking an `Option[T]`: do you not call it with `foo(T)`? |
21:49:59 | FromDiscord | <Elegantbeef> `some(T)` |
21:50:22 | FromDiscord | <Elegantbeef> `Option[T]` is not convertible to/from implicitly you have to explicitly convert |
21:50:35 | FromDiscord | <j-james> ah, ty |
21:51:12 | FromDiscord | <Elegantbeef> If they're nested ref it's also "acceptable" to just use `nil` but that's up to you `option` is more explicit |
21:51:32 | FromDiscord | <Elegantbeef> You could do` Sentinel[MyRefType, nil]` |
21:52:02 | FromDiscord | <Elegantbeef> Sentinel is Option but without any extra memory overhead due to a bool |
21:54:40 | FromDiscord | <j-james> i started off using `nil`, but then decided that it would be better to force myself to pattern match it |
21:54:49 | FromDiscord | <j-james> why do Options have extra memory overhead? |
21:55:21 | FromDiscord | <Elegantbeef> Cause they add a bool |
21:56:17 | FromDiscord | <Elegantbeef> Which depending on the data you're making an optional can add 8 bytes |
21:57:18 | FromDiscord | <Alea> Is crystal really that much faster than Nim, or are the benchmark programs just shitty? |
21:58:53 | FromDiscord | <Elegantbeef> It's not any faster |
21:58:53 | FromDiscord | <Elegantbeef> The highest determinant of speed is the one at the steering wheel |
21:58:53 | FromDiscord | <Elegantbeef> People that benchmark system languages do so many things incorrectly it's not funny |
21:58:54 | FromDiscord | <Elegantbeef> "X language is faster even though it uses a different implementation" |
22:00:34 | FromDiscord | <Elegantbeef> Language benchmarks are odd cause when you go for speed with a system language it's down to the implementation and less language. |
22:00:40 | FromDiscord | <Phil> sent a long message, see http://ix.io/41oo |
22:01:12 | FromDiscord | <Elegantbeef> Not to say compilers dont play a part, but it's almost always within spitting distance of each other when there is a verbatim solution |
22:01:27 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=41op |
22:01:28 | FromDiscord | <Elegantbeef> Yes |
22:01:51 | FromDiscord | <Elegantbeef> Fuck when types are horrifically documented by docgen |
22:02:03 | FromDiscord | <Elegantbeef> Really wish it could just paste the untyped AST there |
22:02:53 | FromDiscord | <Phil> Yeah I'm quite surprised that "has" and "val" don't come with type annotations since "hash" must be a boolean based on how I think it should work |
22:03:23 | FromDiscord | <Phil> I assume that's because Option is implemented via AST-stuff rather than just simple nim |
22:03:25 | FromDiscord | <Elegantbeef> Well the branches are untyped afaik |
22:03:35 | FromDiscord | <Elegantbeef> No Option is simple nim |
22:03:59 | FromDiscord | <Elegantbeef> The issue is `when` inside a type definition is complicated |
22:04:22 | FromDiscord | <Elegantbeef> You need to instantiate the `Option` to know what branches it has and their type |
22:05:15 | FromDiscord | <Elegantbeef> It really really should just use the source AST there but i dont think it can |
22:08:17 | FromDiscord | <Elegantbeef> Anywhere there is some contention about Option wrapping nilables as it does |
22:09:18 | FromDiscord | <Phil> oh |
22:09:21 | FromDiscord | <Phil> (edit) "oh" => "oh?" |
22:09:27 | FromDiscord | <Phil> What are the alternatives? |
22:09:41 | FromDiscord | <Elegantbeef> All types even nilable gets the `bool` to indicate value |
22:10:24 | FromDiscord | <Elegantbeef> Afterall the definition of an Optional type pretty much says it makes it have `n + 1` possible values |
22:10:29 | FromDiscord | <Phil> I'm trying to think of a way as to why using nil to indicate absence of value is bad but I can't see it |
22:12:06 | FromDiscord | <Phil> I assume +1 stands for the "nil"?↵Wouldn't `val` still have the ability to have n + 1 values if it didn't wrap nil this way? |
22:12:18 | FromDiscord | <Phil> (edit) "didn't wrap nil this way?" => "also had a "has" variable?" |
22:12:44 | FromDiscord | <Phil> Since the optional would be initialized with the pointer being nil |
22:17:35 | FromDiscord | <Elegantbeef> Except with the current implementation `has` is `val == nil` |
22:18:16 | FromDiscord | <Elegantbeef> rather `!= nil` |
22:23:09 | FromDiscord | <Phil> Wait, "has" answers the question "Does this variable have a value", right?↵Why is has represented with `val == nil`, that would give back the wrong response to the question and lead to invalid code.↵I think I'm not getting something there |
22:23:47 | FromDiscord | <Elegantbeef> Sure, but the question is "Is this a value you're concerned with" not "is this a value" |
22:24:39 | FromDiscord | <Elegantbeef> In the current implementation for `Option[ptr | ref]` it's more like a sentinel than an optional |
22:24:55 | FromDiscord | <Elegantbeef> `nil` is a valid value that for some reason you may want to pass back |
22:25:12 | FromDiscord | <Elegantbeef> Not that I disagree with the current implementation |
22:25:35 | FromDiscord | <Phil> I do not wish to imply you do, I'm trying to wrap my head around e.g. the idea that `nil` is a value you might want |
22:25:43 | FromDiscord | <Elegantbeef> The current implementation wraps nils in a more forced unpacking |
22:26:01 | FromDiscord | <Phil> I was under the impression that Optionals entire point was avoiding nil |
22:26:33 | FromDiscord | <Elegantbeef> No the point is more giving context to whether a value is wanted or not |
22:26:47 | FromDiscord | <Phil> Ohhh, like JS having "undefined" and "null" both? |
22:27:01 | FromDiscord | <Phil> hmm |
22:27:30 | FromDiscord | <Elegantbeef> Returning a sentinel value is easy but requires a magic constant |
22:27:53 | FromDiscord | <Elegantbeef> I'm sure you've seen api's that return an integer on error |
22:28:31 | FromDiscord | <Elegantbeef> Or specific integers based off state, optionals bake that into the type and encourage you to check it |
22:28:44 | FromDiscord | <GT> undefined means it hasn't been defined yet at all |
22:29:32 | FromDiscord | <GT> null is just not initialized state or wiped away elsewhere, optional means maybe you have it, maybe you don't |
22:29:34 | FromDiscord | <Phil> I'm aware, I do recall however that I do care very little for undefined |
22:29:37 | FromDiscord | <GT> thats how I see them |
22:29:54 | FromDiscord | <GT> you shouldnt typically ever run into undefined |
22:30:12 | FromDiscord | <Elegantbeef> If that was the case it'd be statically typed! 😜 |
22:30:35 | FromDiscord | <GT> or just very defensively written code |
22:31:11 | FromDiscord | <Phil> I just like optionals to force myself to deal with "This value might not exist" properly |
22:31:19 | FromDiscord | <Elegantbeef> I mean that's the point |
22:31:21 | FromDiscord | <GT> thats fine |
22:31:25 | FromDiscord | <GT> indeed |
22:31:42 | FromDiscord | <Elegantbeef> The question is more "is nil a value one is concerned with" 😄 |
22:32:34 | FromDiscord | <Phil> I'd personally say no.↵I guess you do lose the ability to express that you explicitly want to say "I intentionally say there is nothing here", however I have yet to find a scenario where I'd actually want to express that |
22:33:26 | FromDiscord | <Prestige> The author of worm is no longer hanging out in this chat, right? I recall helping him with a few WM related issues a while ago, his username was Codic |
22:33:42 | FromDiscord | <Elegantbeef> They never really hung out here 😄 |
22:33:55 | FromDiscord | <Phil> Worm as in a lib? Because I only know an online book by that name |
22:33:58 | FromDiscord | <Elegantbeef> But you are right about their name |
22:34:05 | FromDiscord | <Elegantbeef> Worm is a WM written by codic |
22:34:10 | FromDiscord | <Phil> Ah, check |
22:36:19 | FromDiscord | <Phil> Random sidenote: Boy do I wish lto was multithreaded |
22:37:44 | FromDiscord | <retkid> anyone know how to concat two tensors in arraymancer |
22:38:07 | FromDiscord | <Elegantbeef> Does it not use `&` |
22:38:16 | FromDiscord | <retkid> lets see |
22:38:20 | FromDiscord | <retkid> oh its a meme |
22:38:25 | FromDiscord | <retkid> lets its not |
22:38:41 | FromDiscord | <retkid> (edit) "lets" => "unless" |
22:39:02 | FromDiscord | <retkid> no it doesn ot |
22:39:05 | FromDiscord | <retkid> (edit) "doesn ot" => "does not" |
22:39:06 | FromDiscord | <Elegantbeef> `&` is Nim's concatenation operator |
22:39:18 | FromDiscord | <retkid> yea it would make sense |
22:39:22 | FromDiscord | <retkid> theres a concat function but |
22:39:31 | FromDiscord | <retkid> it only works with a seqeuence i think |
22:39:33 | FromDiscord | <retkid> (edit) "seqeuence" => "sequence" |
22:39:36 | FromDiscord | <Prestige> Elegantbeef: if you have other feedback about my nimtest library I'd like to hear it - I'll be submitting it to nimble soon, just so I can more easily use it in my projects |
22:40:20 | FromDiscord | <retkid> ah i got it |
22:40:24 | FromDiscord | <retkid> :3 |
22:40:37 | FromDiscord | <Prestige> I should probably add in my before and after hooks first... |
22:41:35 | FromDiscord | <Elegantbeef> I'd suggest using `strutils.%` instead of string concatenation like you're doing |
22:41:49 | FromDiscord | <Prestige> Good idea |
22:42:31 | FromDiscord | <Elegantbeef> `assertRaises`'s first parameter should be `exception: typedesc[Exception]` |
22:42:58 | FromDiscord | <Prestige> Oh so that's how you do it. Cool |
22:43:22 | FromDiscord | <retkid> hmm how can i get the number of items on an axis of a tensor array |
22:44:04 | FromDiscord | <Elegantbeef> your `describe` macro should use `eqIdent` |
22:45:32 | FromDiscord | <Elegantbeef> Not that people are going to write `iT` or `oN_lY` but still working predictably is always nice |
22:47:04 | FromDiscord | <Elegantbeef> also `e.name != $exception` should be `if not e of exception` |
22:47:13 | FromDiscord | <Elegantbeef> actually is `notof` an operator? |
22:47:36 | FromDiscord | <Prestige> I don't think so |
22:49:13 | FromDiscord | <Phil> Personally for throwing strings together I like strformat |
22:49:27 | FromDiscord | <Elegantbeef> Well prestige is in a tempalte |
22:49:35 | FromDiscord | <Elegantbeef> So strformat is a bit icky there |
22:49:41 | FromDiscord | <Phil> it is? Huh |
22:50:22 | FromDiscord | <Elegantbeef> Well templates are hygienic so if you use template parameters it cannot find them since the template symbols are gensym'd |
22:51:46 | FromDiscord | <Elegantbeef> Well i dont see much else and this reminds me that someone should make a `codereview` github repo where people can throw projects on as an issue and willing people can review the code for them 😄 |
22:52:29 | FromDiscord | <Prestige> That's a neat idea, like just open an issue with a project link |
22:52:40 | FromDiscord | <Elegantbeef> Yep |
22:52:46 | FromDiscord | <Elegantbeef> Ideally under `nim-lang` |
22:53:25 | FromDiscord | <Prestige> I'd like to see that. Unfortunately I can't make a repo under nim-lang |
22:53:36 | FromDiscord | <Prestige> Or maybe fortunately |
22:53:45 | FromDiscord | <Prestige> :P |
22:57:28 | FromDiscord | <Prestige> I just started reading Araq's new book, and am learning a bunch of little things I didn't know previously. Like `from foo import nil` is pretty awesome. |
22:57:43 | FromDiscord | <Elegantbeef> block prestige indefinetly |
22:57:46 | FromDiscord | <Prestige> Lol |
22:58:11 | FromDiscord | <Elegantbeef> It's an ok feature that i've used like once |
22:58:35 | FromDiscord | <Elegantbeef> It's nice that it's there but if you use it without needing it i hate you |
22:58:35 | FromDiscord | <Phil> I mean, that's what stackexchange codereview is for |
22:58:58 | FromDiscord | <Elegantbeef> Not like the Nim community is that active on stack exchange |
22:59:15 | FromDiscord | <Prestige> I've had some cases when making games where I accidentally name a module the same thing I would want to name as a variable. Like I had `egg.nim` that creates an Egg object, and I typically wanted to name it egg |
22:59:30 | FromDiscord | <Prestige> My workaround was doing `import egg as eggModule` |
22:59:51 | FromDiscord | <Elegantbeef> The solution is to name the module `eggs.nim` |
22:59:55 | FromDiscord | <Elegantbeef> The plural naming works exceedingly well |
23:00:12 | FromDiscord | <Elegantbeef> Though some argue that the module shouldnt create it's own namespace |
23:00:12 | FromDiscord | <Prestige> But then if I wanted an array of eggs, I'm back to the same problem |
23:00:28 | FromDiscord | <Elegantbeef> I mean stop using global variables 😛 |
23:00:39 | FromDiscord | <Prestige> Global variables? |
23:00:51 | FromDiscord | <Prestige> I thought imports had to be global |
23:01:03 | FromDiscord | <Prestige> Well, to the local module |
23:01:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41oz |
23:02:32 | FromDiscord | <Prestige> Weird, I thought that's exactly the problem I was having, that it wouldn't work |
23:02:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41oA |
23:02:59 | FromDiscord | <Prestige> Ah |
23:03:09 | FromDiscord | <Prestige> Strange |
23:03:30 | FromDiscord | <Prestige> So you can shadow variables once per scope? |
23:03:41 | FromDiscord | <Prestige> Or is it just an issue with top level variables |
23:04:10 | FromDiscord | <Elegantbeef> A "fix" would be to copy C and have different name spaces for modules |
23:04:23 | FromDiscord | <Elegantbeef> You can shadow symbols once per scope yes |
23:04:31 | FromDiscord | <Elegantbeef> So you'd do `module.streams.yourCallHere` |
23:04:52 | FromDiscord | <Elegantbeef> or `module(streams)` but yea make module access an explicit action |
23:05:21 | FromDiscord | <Elegantbeef> Atleast `import as X` doesnt ruin UFCS like the `nil` variant |
23:06:05 | FromDiscord | <Elegantbeef> Phil there are exactly 0 code reviews on stack exchange for nim-lang 😄 |
23:06:30 | FromDiscord | <Phil> That can't be since I literally know I wrote one |
23:06:43 | FromDiscord | <Elegantbeef> ah it's just `nim` |
23:06:43 | FromDiscord | <Phil> One sec, maybe the flags are wrong or sth |
23:07:26 | FromDiscord | <Phil> Correction, i wrote 2 |
23:07:35 | FromDiscord | <Elegantbeef> Eitherway it kinda proves my point there isnt any activity there |
23:07:47 | FromDiscord | <Phil> (edit) "2" => "3" |
23:07:48 | FromDiscord | <Prestige> I don't think I've ever used stackexchange |
23:08:39 | FromDiscord | <Elegantbeef> Just be a chad and never ask questions |
23:08:56 | FromDiscord | <Phil> yet↵I find problem solution to stuff in SE / SO to be a lot easier than elsewhere, that's pretty much the sole reason I throw the answer to every semi-complicated question that I learn up on there |
23:09:02 | FromDiscord | <Elegantbeef> "Dont like my code dont use it" |
23:21:33 | FromDiscord | <j-james> ran into a weird error with options |
23:21:55 | FromDiscord | <j-james> what does `not val.isNil` mean? |
23:22:43 | FromDiscord | <Elegantbeef> `val != nil` |
23:26:23 | FromDiscord | <j-james> hmm |
23:26:35 | FromDiscord | <j-james> do options work strangely with `result`? |
23:26:40 | FromDiscord | <Elegantbeef> No |
23:26:46 | FromDiscord | <Elegantbeef> They're defaulted to `none(T)` |
23:27:58 | FromDiscord | <j-james> oh so would this line cause some problems: `let current = child.layout(parent=some(result), previous=prevchild)` |
23:28:13 | FromDiscord | <Prestige> Weird, `if not e of exception` threw an error but `if not (e of exception)` worked |
23:28:16 | FromDiscord | <j-james> my stack trace seems to point there, but i don't know what's wrong |
23:28:24 | FromDiscord | <Elegantbeef> Eh makes sense prestige |
23:28:29 | FromDiscord | <Elegantbeef> Precedence and all |
23:28:30 | FromDiscord | <Prestige> I don't follow |
23:28:35 | FromDiscord | <Elegantbeef> `not` is probably the same as `of` |
23:28:44 | FromDiscord | <Prestige> oh |
23:28:46 | FromDiscord | <Prestige> I see |
23:28:46 | FromDiscord | <Elegantbeef> so `not e` was first then `of exception` |
23:29:12 | FromDiscord | <Elegantbeef> Similar issue arises with bitwise `not` if you're writing funny code |
23:29:20 | FromDiscord | <Elegantbeef> `not 10 == 10` does not return what you'd imagine |
23:29:37 | FromDiscord | <Prestige> Parens wins |
23:30:00 | FromDiscord | <Elegantbeef> Is child `nil`?↵(@j-james) |
23:30:22 | FromDiscord | <Elegantbeef> Without the entire procedure i cannot say anything for certain |
23:30:39 | FromDiscord | <j-james> no |
23:30:52 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=41oD |
23:30:52 | FromDiscord | <Elegantbeef> Worth noting prestige that it'll say it's right if it's any child of that exception |
23:30:58 | FromDiscord | <Elegantbeef> What's the error? |
23:31:04 | FromDiscord | <j-james> i think the problem might be returning a value and also trying to use result |
23:31:25 | FromDiscord | <Elegantbeef> that's not an issue |
23:31:49 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=41oE |
23:32:16 | FromDiscord | <j-james> line 58 is the `let current` line |
23:32:32 | FromDiscord | <Elegantbeef> `some(nil)` is invalid |
23:33:01 | FromDiscord | <j-james> i think what might be happening is `result` becomes `nil` once i return a `Layout` |
23:33:09 | FromDiscord | <Elegantbeef> Result isnt set at that point so you're attempting to do `some(nil)` |
23:33:15 | FromDiscord | <Elegantbeef> No it's nil at the very start of the procedure |
23:33:26 | FromDiscord | <Elegantbeef> You dont assign result until after |
23:33:31 | FromDiscord | <j-james> oh? |
23:33:59 | FromDiscord | <j-james> i thought result would initialize itself as a `Layout()` with empty fields |
23:34:12 | FromDiscord | <Elegantbeef> It is 0-init'd |
23:34:17 | FromDiscord | <Elegantbeef> For ref types that is nil |
23:34:48 | FromDiscord | <Elegantbeef> All types in Nim are sadly 0 init'd |
23:34:49 | FromDiscord | <j-james> 😃 |
23:34:54 | FromDiscord | <j-james> that's it, ty! |
23:35:24 | FromDiscord | <Elegantbeef> There is an RFC for init procedures but they have to be static |
23:37:52 | FromDiscord | <Elegantbeef> I impatiently await our safely init'd range overlords |
23:40:43 | FromDiscord | <j-james> is there a downside to auto initializing any `ref T` as `T()`? |
23:41:07 | FromDiscord | <j-james> performance? |
23:49:44 | FromDiscord | <demotomohiro> I usually initialize `ref T` as `T()`. I don't think there is any downside. |