<< 01-07-2022 >>

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