<< 19-06-2022 >>

00:26:36*rockcavera joined #nim
00:26:36*rockcavera quit (Changing host)
00:26:36*rockcavera joined #nim
01:19:21*noeontheend quit (Ping timeout: 248 seconds)
01:42:23*noeontheend joined #nim
01:48:23FromDiscord<STATUS_404> @ElegantBeef Can I please have some of your beefy and elegant advice bro?
01:57:31FromDiscord<STATUS_404> https://tenor.com/view/fancy-dog-fancy-steak-husky-gif-13608501
02:00:18FromDiscord<Prestige> What's your question @STATUS_404 ?
02:01:35FromDiscord<STATUS_404> Can I please DM you a code snippet?
02:01:42FromDiscord<STATUS_404> I need that prestige advice
02:09:31*Jjp137 joined #nim
02:33:32*arkurious quit (Quit: Leaving)
02:56:10*wallabra quit (Remote host closed the connection)
02:58:21*wallabra joined #nim
02:59:32FromDiscord<Prestige> Nah just put the snippet here
03:38:33*noeontheend quit (Ping timeout: 248 seconds)
04:00:57NimEventerNew thread by Morturo: How to copy dir using nimscript?, see https://forum.nim-lang.org/t/9245
04:23:58FromDiscord<Yardanico> deleted again :(
04:48:38FromDiscord<Elegantbeef> Who's deleting these?
05:08:25FromDiscord<deadmeme77> Is Nim on termux outdated?
05:08:38FromDiscord<Elegantbeef> Probably
05:09:58FromDiscord<demotomohiro> Package manager on termux installed nim-1.6.6 on my android phone.
05:10:49FromDiscord<deadmeme77> It's 1.6.6 in mine too. Not too shabby
05:11:29FromDiscord<deadmeme77> Enough for some quick demo I'd say
05:11:39FromDiscord<Elegantbeef> That's stable
05:11:42FromDiscord<Elegantbeef> So yes that's up to date
05:12:45FromDiscord<demotomohiro> As far as I know, package manager on gentoo and arch linux provides nim-1.6.6 now.
05:19:04FromDiscord<deadmeme77> It runs perfectly. Nice 👍
05:24:25FromDiscord<deadmeme77> @demotomohiro have you been using Nim to script batch jobs in your phone? If so, do you need root for Termux to be able to find files in Android's SD cards?
05:44:25FromDiscord<demotomohiro> I just use Nim to test some code on termux.
05:46:09FromDiscord<demotomohiro> @deadmeme77 It seems you can read sdcard from termux: https://wiki.termux.com/wiki/Internal_and_external_storage
06:04:20FromDiscord<Prestige> Elegantbeef are you familiar with testing frameworks that can "mock" function calls? I've been thinking of implementing this for my Nim testing framework but am not sure it's possible, without compiler access...
06:05:08FromDiscord<Elegantbeef> I doubt you need compiler access
06:05:46FromDiscord<Prestige> I can describe the functionality if you are unfamiliar
06:06:03FromDiscord<Elegantbeef> I'm unfamiliar so go ahead but yea i doubt you need compiler access
06:06:56FromDiscord<Prestige> "mocking" a function allows you to substitute the body of the function, basically. Change what it does and what it returns. The tricky part, I think, is substituting this for the whole Nim program
06:07:19FromDiscord<Rika> Just import some other module that mocks the function?
06:07:20FromDiscord<Elegantbeef> Yea that's what i figured you might have IO/Capi and at test time want to only return X thing
06:07:33FromDiscord<Elegantbeef> Yea that's less complex than my idea
06:07:48FromDiscord<Elegantbeef> My idea would be replace a call with your own function using a macro
06:07:52FromDiscord<Rika> Oh wait hm I get it
06:07:57FromDiscord<Prestige> In reply to @Rika "Just import some other": How could you do that globally for your program?
06:07:58FromDiscord<Rika> No I get it wait
06:08:48FromDiscord<Rika> You prolly “have” to put a define flag
06:08:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40s7
06:08:51FromDiscord<Rika> Yeah that
06:08:57FromDiscord<Rika> Wait I got a warning brb
06:09:20FromDiscord<Prestige> hmmm
06:10:01FromDiscord<Prestige> Elegantbeef is there some neat way you could have the testing framwork search all files that would be used, see if it has said import, then replace it with that?
06:10:04FromDiscord<Prestige> Or am I overthinking this
06:10:29FromDiscord<Elegantbeef> I mean just make that your module
06:10:41FromDiscord<Elegantbeef> There is no reason for fancy shit
06:10:52FromDiscord<Prestige> Because I don't want anything related to testing to actually imported into files unrelated to testing, basically
06:11:02FromDiscord<Prestige> I want to keep all testing logic within the test
06:11:28FromDiscord<Elegantbeef> put a `when not defined(test): {.error: "you imported test in non test environment".}` inside `mymoduletest`
06:11:37FromDiscord<Elegantbeef> I dont see that you really need any magic here
06:11:45FromDiscord<Elegantbeef> But you know me i'm often wrong
06:12:09FromDiscord<Prestige> I could write like an example of what I want to be writing in a test I guess, if that would help
06:13:00FromDiscord<Elegantbeef> You can also emit your own procedures/calls if you really wanted
06:13:22FromDiscord<Elegantbeef> But that requires macros which dont make this reasonable to look at imo
06:14:17FromDiscord<Prestige> perhaps
06:15:13FromDiscord<Prestige> in my test I want to be able to just do like, `mock(module.someProc, myImpl)` and when I compile and run the test, it calls `myImpl` instead of `module.someProc`
06:15:25FromDiscord<Prestige> Then I don't need to create other files, etc
06:15:43FromDiscord<Elegantbeef> Sure but that requires replacing all `someProc` usage without the information where
06:15:51FromDiscord<Prestige> Yeah
06:15:58FromDiscord<Elegantbeef> So that surely needs compiler support
06:16:27FromDiscord<Elegantbeef> But you could do something like `mock(someProcCall(args), myProcToReplace, myReplacementProc)`
06:17:10FromDiscord<Elegantbeef> You might be able to abuse term rewriting macros
06:17:53FromDiscord<Prestige> hm
06:17:57FromDiscord<Prestige> I'd like more info on that
06:20:51FromDiscord<Prestige> this would be really powerful for testing
06:21:10FromDiscord<Elegantbeef> Writing an example
06:21:54FromDiscord<Prestige> sweet
06:27:26FromDiscord<Elegantbeef> Nope order of operations issue as always
06:27:49FromDiscord<Prestige> well damn
06:28:16FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3ZTJ
06:28:24FromDiscord<Elegantbeef> We could do it unsafely with just idents
06:28:49FromDiscord<Elegantbeef> So you'd do `mock(doThing, proc() = echo "no")` and it'd replace all `doThing` with the name of that proc
06:29:42FromDiscord<Elegantbeef> i mean we could make it a tinge safer with checking the type and if the module is the same
06:29:56FromDiscord<Elegantbeef> so you could do like `mock("mymodule.myProc", ...)`
06:30:41FromDiscord<Prestige> that playground didnt work out
06:30:50FromDiscord<Prestige> it's not code
06:30:55FromDiscord<Elegantbeef> Eh doesnt matter i have a proper implementation incomming
06:30:59FromDiscord<Prestige> kk
06:52:03FromDiscord<Elegantbeef> @Prestige\: https://wandbox.org/permlink/QH7tzss8BNQAbhU6
06:52:21FromDiscord<Elegantbeef> That norewrite pragma doesnt seem to be working... odd
06:52:27FromDiscord<Prestige> https://media.discordapp.net/attachments/371759389889003532/987973116141658112/unknown.png
06:52:47FromDiscord<Prestige> Can you see the image I posted?
06:52:50FromDiscord<Elegantbeef> It's a multi file project what want me to zip it?
06:53:01FromDiscord<Prestige> Sure
06:53:35FromDiscord<Prestige> maybe use wormhole.app
06:54:00FromDiscord<Elegantbeef> What matrix files are too spooky for you?
06:54:21FromDiscord<Prestige> matrix files?
06:54:34FromDiscord<Prestige> if you mean that wandbox.org thing, that didn't work
06:54:34FromDiscord<Elegantbeef> Matrix supports file uploads
06:54:41FromDiscord<Elegantbeef> It's a multi media protocol
06:55:05FromDiscord<Prestige> I mean send it however you can, but that site didn't work
06:56:27FromDiscord<Elegantbeef> mocker.tar.gz https://media.discordapp.net/attachments/371759389889003532/987974123382800424/mocker.tar.gz
06:56:47FromDiscord<Prestige> ty
06:59:04FromDiscord<Elegantbeef> Would be nice if `noRewrite` was respected
07:04:10FromDiscord<Elegantbeef> If unclear you need to pass `-d:test`
07:06:46FromDiscord<Elegantbeef> and you probably want to do `--hint[Pattern]:off` if you dont like the noise, this way of mocking will cause the compiler to be slower since norewrite isnt respected for whatever reason
07:10:33FromDiscord<Prestige> i'll try to break it
07:24:45*ltriant quit (Ping timeout: 256 seconds)
07:36:57FromDiscord<Prestige> hm I can't import and export `mocker` from a file where I'm using `newStmtList`
07:37:18FromDiscord<Prestige> `Error: expression ' {.noRewrite.}: newStmtList([])' is of type 'NimNode' and has to be used (or discarded)`
07:39:14FromDiscord<Elegantbeef> Dont export mocker anyway
07:39:36FromDiscord<Elegantbeef> It needs to me imported in all files to work as it's supposed to
07:41:32FromDiscord<Prestige> hmm
07:42:55FromDiscord<Elegantbeef> Dont know if you noticed the config.nims but that's how we're injecting it
08:09:36FromDiscord<Prestige> So it's always implicitly imported, hmm
08:22:14*pro joined #nim
08:40:27*kayabaNerve joined #nim
08:44:51FromDiscord<Prestige> yeah not sure how I should be using this
08:44:59FromDiscord<Prestige> with the weird import thing
08:45:23FromDiscord<Prestige> because my testing framework needs to export that file right?
08:49:39FromDiscord<Prestige> Closest I can get to it working, is the previous error I posted above
08:56:01*ltriant joined #nim
08:56:25*jmdaemon quit (Ping timeout: 248 seconds)
08:57:13*kayabaNerve quit (Ping timeout: 244 seconds)
08:57:40FromDiscord<d4rckh> does it happen for anyone else for vs code to keep resetting your indentation settings?
08:58:07FromDiscord<d4rckh> i like indenting with 2 spaces in nim but vs code keeps resetting it to 4 spaces 🤔
08:59:55*kayabaNerve joined #nim
09:02:10FromDiscord<Elegantbeef> No you testing framework doesnt need to export any file
09:02:45FromDiscord<Elegantbeef> You have to import that module in all modules to have `mock` work properly
09:03:03FromDiscord<Elegantbeef> So you need to bring that around and use `--import:mocker`
09:14:06*kayabaNerve quit (Remote host closed the connection)
09:18:43*kayabaNerve joined #nim
09:29:28*kayabaNerve quit (Ping timeout: 248 seconds)
09:36:55FromDiscord<j-james> In reply to @d4rckh "i like indenting with": i don't think you can set per-language indentation settings in vscode
09:37:29FromDiscord<d4rckh> i have to go manually and click detect indentation from file every time i open vs code
09:37:34FromDiscord<d4rckh> (edit) "i have to go manually ... and" added "to each file"
09:37:44FromDiscord<d4rckh> why doesnt it detect the indentation automatically?
09:37:53FromDiscord<j-james> oh that's unexpected
09:38:05FromDiscord<j-james> there should be a "detect indentation" setting
09:38:43FromDiscord<d4rckh> wait i found it
09:38:48FromDiscord<d4rckh> but i swear i enabled it before and it didnt work
09:39:00FromDiscord<d4rckh> now it works 🤦‍♂️
09:39:31FromDiscord<j-james> i've had annoyances with it not indenting with two spaces when creating new files, but existing always works fine
09:39:49FromDiscord<d4rckh> it should do something like
09:40:18FromDiscord<d4rckh> if it detects im indenting manually using 2 spaces, like pressing space 2 times to indent, it should automatically change the behavior of the tab key to insert 2 spaces
09:54:20NimEventerNew thread by Justb: Optimize this code?, see https://forum.nim-lang.org/t/9246
10:04:01*kayabaNerve joined #nim
10:08:14FromDiscord<xflywind> sent a code paste, see https://play.nim-lang.org/#ix=40sG
10:08:16FromDiscord<xflywind> found a VM bug
10:08:27FromDiscord<xflywind> (edit) "bug" => "bug: field 'node' is not accessible for type 'TFullReg' using 'kind = rkRegisterAddr' [FieldDefect]"
10:18:20*kayabaNerve quit (Ping timeout: 244 seconds)
10:32:15FromDiscord<STATUS_404> In reply to @Avahe "Nah just put the": No thank you bro, that sounds unreasonable. If you are not confident you can help me alone your expertise is not really what I am looking for.
10:32:51*kayabaNerve joined #nim
10:38:01FromDiscord<Phil> That is impressively rude for a message in a help chat
10:40:12*gsalazar quit (Ping timeout: 276 seconds)
10:42:06FromDiscord<exelotl> lmao
10:43:31FromDiscord<xflywind>
10:46:09FromDiscord<aph> In reply to @Isofruit "That is impressively rude": they can't see it now anyway, they left i think
10:48:51FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=40sL
10:48:53FromDiscord<d4rckh> any reason for why $filePath is empty?
11:00:29FromDiscord<d4rckh> maybe i need to allocate the buffer?
11:06:34FromDiscord<Rika> LP means it’s a pointer?
11:06:47FromDiscord<Rika> It starts off null, so you should initialise it yes
11:56:01FromDiscord<d4rckh> In reply to @Rika "It starts off null,": uhh no really sure how
11:56:14FromDiscord<d4rckh> is this the proper way? 🤔
11:56:16FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=40sQ
11:56:26FromDiscord<Rika> im not familiar with raw windows apis so i cant help you there
12:06:48*kayabaNerve quit (Ping timeout: 248 seconds)
12:30:25*arkurious joined #nim
12:31:22FromDiscord<d4rckh> just trying to get the file path of my executable
12:31:32*kayabaNerve joined #nim
12:48:40FromDiscord<amadan> @d4rckh this gets the path the the binary https://nim-lang.org/docs/os.html#getAppFilename
12:50:06FromDiscord<amadan> (you can take a look at how it uses the winapi if you want to do it manually)
12:50:10FromDiscord<d4rckh> ah, thanks!
12:55:53*krux02 joined #nim
13:11:48*pro quit (Quit: pro)
13:21:00FromDiscord<federico3> the compiler and stdlib uses both `defined(osx)` and `defined(macosx)`
13:28:28*kayabaNerve quit (Ping timeout: 244 seconds)
14:29:35*kayabaNerve joined #nim
15:19:20*kayabaNerve quit (Ping timeout: 248 seconds)
15:36:39*kayabaNerve joined #nim
15:41:12*kayabaNerve quit (Ping timeout: 248 seconds)
15:45:08*kayabaNerve joined #nim
15:50:23FromDiscord<proton> What's the equivalent of nginx proxy_pass for Jester?
15:55:29FromDiscord<Yardanico> proxy_pass
15:55:45FromDiscord<Phil> Do you want to use jester as the reverse proxy?
15:55:48FromDiscord<Yardanico> oh, if you want to do the same with jester, it doesn't have that functionality
15:55:51FromDiscord<Yardanico> you'll have to do it manually
15:56:14FromDiscord<Phil> I feel like you'd be better served using nginx for that either way
16:00:42FromDiscord<Rika> yes
16:02:13FromDiscord<proton> ok, thanks
16:03:56FromDiscord<proton> There is a requirement to serve website built by Next.js as well as apis at the same time
16:11:46FromDiscord<Phil> Run 3 servers would be my suggestion
16:12:21FromDiscord<Phil> Nginx , jester and next ja, with nginx being reverse proxy for the others at the same time
16:12:32FromDiscord<Phil> (edit) "ja," => "js,"
16:12:57FromDiscord<Phil> Just run next js and jester on different ports
16:26:22*xet7 joined #nim
16:39:16*krux02 quit (Read error: Connection reset by peer)
16:44:46*PMunch joined #nim
16:50:28*krux02 joined #nim
17:04:25*TakinOver quit (Ping timeout: 248 seconds)
17:05:28*kayabaNerve quit (Ping timeout: 248 seconds)
17:18:40FromDiscord<Xzayler> sent a code paste, see https://play.nim-lang.org/#ix=40tN
17:19:10FromDiscord<Rika> `self.selected` is a type descriptor?
17:19:24FromDiscord<Rika> more info please? like what is self? what is selected?
17:19:27FromDiscord<Xzayler> Not sure what that is, I declared it like: var selected = seq[Plant]
17:19:29FromDiscord<Elegantbeef> it... cant be but somehow is?
17:19:33FromDiscord<Xzayler> (edit) "var" => "`var" | "seq[Plant]" => "seq[Plant]`"
17:19:38FromDiscord<Rika> yeah thats wrong
17:19:41FromDiscord<Elegantbeef> `: seq[Plant]`
17:20:16FromDiscord<Xzayler> omg I have to stop for today
17:20:19FromDiscord<Xzayler> so sorry guys
17:24:00FromDiscord<Phil> It's fine, I semi regularly ask waaaaay dumber questions here
17:24:25Amun-RaI'd use haproxy for reverse proxying
17:24:56FromDiscord<Rika> i'd say haproxy is better for load balancing ironically
17:24:58FromDiscord<Phil> Why not just industry standards like Apache and nginx ?
17:25:10FromDiscord<Rika> haproxy is also industry standard..........
17:25:10Amun-Rait is industry standard
17:25:13FromDiscord<Phil> Oh wait, I'm dumb
17:25:22FromDiscord<Phil> Ah, too slow
17:25:28Amun-Raand it's way better status page than (free) nginx does ;>
17:25:34Amun-Rait's → it has
17:25:37FromDiscord<Rika> yes that is true
17:25:38FromDiscord<Phil> Memory kicked in way to late
17:25:46FromDiscord<Rika> metrics are better on haproxy
17:26:05FromDiscord<Rika> i should prolly migrate my nginx config then
17:26:19FromDiscord<Phil> Hmm, my old workplace used haproxy
17:26:31FromDiscord<Phil> Current one swears on nginx
17:26:36Amun-RaI use nginx as httpd and haproxy for ssl offload/revproxy/lb
17:27:06FromDiscord<Phil> And I'm too unknowing to know if one has cases where they are better than the other
17:29:35*haskellandchill joined #nim
17:31:43FromDiscord<Rika> haproxy is equal with nginx with reverse proxy stuff, but ofc it isnt an httpd
17:32:33Amun-Ramhm
17:33:33FromDiscord<Phil> So basically given I just want it to serve my front-end and forward requests to my backend and serve image /audio files I could just as easily use haproxy ?
17:36:07Amun-Rayes
17:36:37FromDiscord<Phil> Hmmmm
17:36:56FromDiscord<Phil> I might make a second docker image of by project eventually then
17:41:10haskellandchillhi is this the most active chat for nim discussion? I wanted to evaluate Nim's feature claims like https://mawfig.github.io/2022/06/18/v-lang-in-2022.html did for V lang. I expect Nim to do much better than V did.
17:42:17FromDiscord<huantian> Yeah this is probably the most active chat
17:42:35haskellandchillok and if I access it from discord it's the same basically?
17:42:49FromDiscord<Phil> Pretty much
17:42:57FromDiscord<huantian> Mhm the chat is bridged between discord, irc, and matrix
17:44:13FromDiscord<huantian> Depending on your topic it might be better to make a forum post tho
17:45:25*haskellandchill quit (Quit: Client closed)
17:45:33FromDiscord<Phil> Aye. Form post is more likely to get attention if you want some more elaborate answers
17:45:50FromDiscord<haskellandchill> interesting
17:46:07FromDiscord<dom96> Matrix<->Discord<->IRC. It's all linked together here
17:46:29FromDiscord<Elegantbeef> Even had telegram at one point but "They're too noisey" 😄
17:46:30FromDiscord<haskellandchill> I just want to be fair to the community and also yeah not be missing anything basic with my approach
17:47:29FromDiscord<haskellandchill> I just started: https://github.com/svanderbleek/x-language-review/blob/main/lrnim/review.md
17:48:29FromDiscord<Elegantbeef> Well we're already off to the races with ways to add to your post! 😄
17:49:31FromDiscord<haskellandchill> one thing I can't figure out is how to refer to `$` as a function
17:49:42FromDiscord<Elegantbeef> backtick before and after
17:49:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40tU
17:50:07FromDiscord<Yardanico> also https://media.discordapp.net/attachments/371759389889003532/988138623914344508/unknown.png
17:50:28FromDiscord<haskellandchill> Makes sense
17:51:58FromDiscord<haskellandchill> It seems contradictory to the goal in the faq
17:52:07FromDiscord<dom96> The segfault in that case can be thought of as a NilPointerException and indeed there is a Nim module which makes it so: https://nim-lang.org/docs/segfaults.html
17:52:22FromDiscord<haskellandchill> I understand why it's happening and that it's intended behavior
17:52:26FromDiscord<dom96> (edit) "NilPointerException" => "NilAccessException"
17:52:30FromDiscord<Elegantbeef> Nim does have mechanisms for no nil in `experimenta:strictNotNil`
17:52:51FromDiscord<haskellandchill> ooo
17:53:11FromDiscord<Elegantbeef> Though as the name implies it's not complete
17:53:15FromDiscord<Phil> In reply to @Elegantbeef "Nim does have mechanisms": Aaaaand bookmarked
17:53:25FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#strict-not-nil-checking
17:53:37FromDiscord<Yardanico> In reply to @haskellandchill "ooo": also just to be clear - nim and rust are different in quite a lot of things
17:53:43FromDiscord<Yardanico> even the basic approach to safety/etc is very different
17:53:46FromDiscord<haskellandchill> oh for sure
17:53:49FromDiscord<Yardanico> and memory management
17:53:51FromDiscord<haskellandchill> I'm just using it as an example
17:54:07FromDiscord<haskellandchill> oh how it could be handled to be more in line with the faq statement: "How about security and memory safety?↵Nim provides memory safety by not performing pointer arithmetic, with optional checks, traced and untraced references and optional non-nullable types."
17:54:20FromDiscord<haskellandchill> specifically a "traced reference"
17:54:24FromDiscord<Yardanico> a lot of the manual is quite old, yes
17:54:47FromDiscord<Elegantbeef> Memory safety also isnt a overwhelmingly concise term
17:55:02FromDiscord<Elegantbeef> Depending on what you consider it means changes what that means 😄
17:55:17FromDiscord<haskellandchill> the goal of the project is to be more precise and have verified support for language claims
17:55:35FromDiscord<haskellandchill> (edit) "the goal of the project is to be more precise ... and" added "with"
17:56:05FromDiscord<haskellandchill> but I believe that experimental feature is in line with it
17:56:49FromDiscord<haskellandchill> `nim c --experimental:strictNotNil file.nim`?
17:57:10FromDiscord<Elegantbeef> Yep or you can just include `{.experimental: "strictNotNil".}` in the fiile before your nilable code
17:57:43FromDiscord<haskellandchill> hm it doesn't seem to do anything for this case
17:57:53FromDiscord<haskellandchill> are there any examples for it?
17:58:00FromDiscord<Elegantbeef> You need to annotate the type is nilable
17:58:07FromDiscord<Elegantbeef> Scroll down on that link
17:58:08FromDiscord<Rika> you mean not nilable
17:58:41FromDiscord<haskellandchill> oh cool thanks
17:59:02FromDiscord<Elegantbeef> It doesnt turn all `ref T` into `not nil` only the ones you annotate
17:59:38FromDiscord<Elegantbeef> It also isnt complete so there are probably bugs and the like, but it's there so thought i'd mention it
17:59:59FromDiscord<haskellandchill> this syntax confuses me
17:59:59FromDiscord<haskellandchill> sent a code paste, see https://play.nim-lang.org/#ix=40tW
18:00:07FromDiscord<Rika> ? in what whay
18:00:08FromDiscord<Rika> (edit) "whay" => "way"
18:00:15FromDiscord<Elegantbeef> Object is a type alias to `NilableObject not nil`
18:00:17FromDiscord<haskellandchill> hm so I need two types to do it?
18:00:21FromDiscord<Rika> not necessarily
18:00:22FromDiscord<Elegantbeef> Yes
18:00:26FromDiscord<Rika> wait really?
18:00:34FromDiscord<Rika> you cant directly `ref object not nil`?
18:00:39FromDiscord<haskellandchill> I tried that
18:00:41FromDiscord<haskellandchill> it didn't work
18:00:46FromDiscord<Elegantbeef> You cannot directly do that rika
18:00:47FromDiscord<Rika> when did it change
18:00:53FromDiscord<Rika> prolly read the rfc and forgot
18:01:00FromDiscord<Elegantbeef> `notNil` vs `strictNotNil`
18:01:29FromDiscord<haskellandchill> oh there's another?
18:01:41FromDiscord<Elegantbeef> Actually no nevermind neither support it
18:01:54FromDiscord<Elegantbeef> Eh `notNil` was a different implementation that is really deprecated by the latter
18:02:08FromDiscord<huantian> There are some alternative ways to make ref objects nil safe like Option and byref ig↵↵Or just don’t use ref objects
18:02:53FromDiscord<huantian> Oh is notNil just an older version? I was always confused why there’s two
18:02:58FromDiscord<Elegantbeef> I think the definition Nim uses of memory safe is more along the lines of "Memory is never lost and is always freed"
18:03:03FromDiscord<haskellandchill> byref ig?
18:03:21FromDiscord<Elegantbeef> Yea i think `notNil` was an old implementation that's only kept around due to possible old code that relies on it
18:06:35FromDiscord<Elegantbeef> I don't think the current implementation of `strictNotNil` actually catches a field access oddly
18:06:49FromDiscord<dom96> sent a code paste, see https://play.nim-lang.org/#ix=40tZ
18:07:19FromDiscord<Elegantbeef> It's probably just easier on the parser this way
18:08:27FromDiscord<haskellandchill> hm it doesn't seem to catch field access
18:08:40FromDiscord<haskellandchill> but I can change the example
18:09:06FromDiscord<Elegantbeef> I dont think it presently ever assumes the `not nil` object can be nil
18:09:19FromDiscord<Elegantbeef> So yea that's one of those bugs i mentioned 😄
18:10:32FromDiscord<haskellandchill> > We show an error for each dereference ([], .field, [index] () etc) which is of a tracked expression which is in MaybeNil or Nil state.
18:10:39FromDiscord<huantian> Pragma you can use on non-ref value types to make them pass by reference iirc↵(@haskellandchill)
18:10:45FromDiscord<haskellandchill> what does it mean by "We show an error"
18:10:54FromDiscord<haskellandchill> compile error? doesn't seem to
18:11:02FromDiscord<Elegantbeef> Eh huan most types are passed by ref as they're larger than 3 floats
18:11:14FromDiscord<Yardanico> both of these not nil things are unfinished, I don't think they ever worked as advertised :)
18:11:36FromDiscord<Elegantbeef> Eh yard it works just on `Nilable -> not nil` it doesnt work on the `not nil` part presently
18:11:40FromDiscord<dom96> it's also unclear what their future looks like, there were questions posed in https://github.com/nim-lang/RFCs/issues/437 but not answered
18:11:59FromDiscord<Elegantbeef> It's intended to be kept
18:12:08FromDiscord<Elegantbeef> > "Not nil annotation" -- Should be planned for Nim 2.x but removed from the "experimental" manual.
18:12:10FromDiscord<Yardanico> ? https://media.discordapp.net/attachments/371759389889003532/988144172835930272/unknown.png
18:12:18FromDiscord<Yardanico> although it's a stretch goal
18:12:45FromDiscord<Elegantbeef> yardanico that's for `out` parameters
18:14:16FromDiscord<huantian> We have our parameters??
18:14:23FromDiscord<Elegantbeef> No we do not
18:14:38FromDiscord<Elegantbeef> It's reserved in the language and araq wants them for definite assignment
18:17:50FromDiscord<huantian> Interesting
18:18:03FromDiscord<huantian> I can’t tell if this convo was helpful or confusing lmao
18:18:13FromDiscord<haskellandchill> woa strictNotNil worked without the `not nil` annotation
18:19:17FromDiscord<Elegantbeef> Uhh?
18:19:19FromDiscord<Elegantbeef> Code?
18:20:13FromDiscord<haskellandchill> sent a code paste, see https://play.nim-lang.org/#ix=40u0
18:20:24FromDiscord<haskellandchill> with `nim c --experimental:strictNotNil ref.nim`
18:20:55FromDiscord<dom96> what's the error you get? :o
18:21:09FromDiscord<Yardanico> warning
18:21:16FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=40u2
18:21:21FromDiscord<Yardanico> but of course you can always turn warnings into errors
18:21:26FromDiscord<dom96> cool
18:22:01FromDiscord<ElegantBeef> odd it doesnt work for field access right now 😄
18:22:31FromDiscord<haskellandchill> how do I turn warnings into errors?
18:23:10FromDiscord<Elegantbeef> `--warningAsError[StrictNotNil]` i think
18:23:20FromDiscord<haskellandchill> oh I can't do it for all warnings?
18:24:16FromDiscord<Elegantbeef> Seems not
18:25:19reversem3[m]What am I doing wrong https://play.nim-lang.org/#ix=40u1... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/4924a04ad4f9b641468e458c6f520920204d1dbe)
18:26:20FromDiscord<Elegantbeef> With thinks like strictNotNil though it propagates down to the stdlib aswell and some things arent presently setup to handle that
18:26:23FromDiscord<Elegantbeef> things like\
18:26:33FromDiscord<Elegantbeef> Nim's `strictFunc` also has a similar issue
18:26:44om3gaHello! Is there some lib that can plot fft of wave file?
18:27:10*noeontheend joined #nim
18:28:02FromDiscord<haskellandchill> This seems weird
18:28:10FromDiscord<haskellandchill> sent a code paste, see https://play.nim-lang.org/#ix=40u3
18:28:21FromDiscord<haskellandchill> where did `digits100` come from
18:28:21FromDiscord<Elegantbeef> Like i said it's the stdlib not presently written with strictNotNil in mind
18:28:34FromDiscord<Elegantbeef> You call `echo t.x`
18:28:39FromDiscord<haskellandchill> ah
18:29:23FromDiscord<Phil> In reply to @reversem3 "What am I doing": I'll take a look in an hour or so, currently only on phone and on phone it looks too garbled to properly see anything
18:29:41FromDiscord<Elegantbeef> Even at a desktop it's too garbled
18:29:59FromDiscord<Phil> Ah so that wasn't my phone
18:30:48reversem3[m]Its showing the errors from vim
18:30:59FromDiscord<Phil> In that case could you also add a clean copy paste of a minimal example reversem3?
18:31:05reversem3[m]do you want me to post without the errors
18:31:15reversem3[m]ok
18:32:28reversem3[m]https://play.nim-lang.org/#ix=40u4
18:32:34reversem3[m]no errors , sorry about that
18:32:51reversem3[m] * no error in the paste now , sorry about that
18:33:05FromDiscord<Phil> That's f fine
18:33:39FromDiscord<Phil> You can't access the dB like that. First things first, you using sqlite or postgres?
18:34:15reversem3[m]db_postgres
18:34:38FromDiscord<Phil> Because your key problem is you're trying to use a dB connection (dB) without creating it first
18:35:57FromDiscord<Phil> Norm has a template for that, let me see
18:36:31reversem3[m]So this doesn't work ? `import std/db_postgres
18:36:31reversem3[m]let db = open("localhost", "user", "password", "dbname")
18:36:31reversem3[m]db.close()`
18:37:55FromDiscord<Phil> It does but the line running create tables is line 21
18:38:06FromDiscord<Phil> You create the connection way later
18:40:12NimEventerNew thread by Bulat_Ziganshin: Lifetime of pointer returned by str.cstring, see https://forum.nim-lang.org/t/9247
18:40:16reversem3[m]Ok, so I shouldn't have a separate file for opening the connection then?
18:40:24FromDiscord<Phil> Although even then you might get ringtone errors because those login credentials do not look like valid postgres login credentials. However, I have not used postgres before so no idea if those are some sort of valid default
18:42:07FromDiscord<Phil> Ohhh wait .. Oh fuck it, this is too painful on phone, I'll look at it when I'm in front of a computer.
18:44:05FromDiscord<haskellandchill> ringtone errors?
18:44:57FromDiscord<huantian> Probably autocorrect from runtime
18:46:35FromDiscord<haskellandchill> ah I was picturing somehow opening a connection to postgres like a dial up modem
18:47:40FromDiscord<Phil> Runtime
18:47:49FromDiscord<Phil> Not ringtone. Gna
18:48:16FromDiscord<huantian> In reply to @haskellandchill "ah I was picturing": That would be funny 😄
18:56:21NimEventerNew question by justb: How could I optimize this Nim code with lots of similar functions?, see https://stackoverflow.com/questions/72679549/how-could-i-optimize-this-nim-code-with-lots-of-similar-functions
18:58:04FromDiscord<Phil> Yeeeeh that's a design question
19:14:21*noeontheend quit (Ping timeout: 276 seconds)
19:18:12*jmdaemon joined #nim
19:26:49*jmdaemon quit (Ping timeout: 248 seconds)
19:27:36*jmdaemon joined #nim
19:28:37*rockcavera quit (Read error: Connection reset by peer)
19:29:08*rockcavera joined #nim
19:29:08*rockcavera quit (Changing host)
19:29:08*rockcavera joined #nim
19:29:27FromDiscord<Gennadiy> sent a long message, see http://ix.io/40uc
19:42:56*kayabaNerve joined #nim
19:46:16FromDiscord<exelotl> I'm using Norm right now and _dang_ it would really benefit from stable `not nil` in the language
19:46:43FromDiscord<Elegantbeef> Or not being written with OOP as the base 😄
19:47:17FromDiscord<exelotl> nrm
19:47:18*kayabaNerve_ joined #nim
19:48:08FromDiscord<Elegantbeef> I havent used it whatsoever but i did notice it's usage of `Model` should be doable with a base `Model = object of RootObj` or just a concept
19:48:52FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=40uh
19:49:02FromDiscord<d4rckh> 🤔 How do I prevent this error?
19:49:11FromDiscord<d4rckh> should i check for `socket.isClosed`?
19:49:16FromDiscord<Elegantbeef> Open the socket
19:49:28FromDiscord<Elegantbeef> Apparently
19:49:46*kayabaNerve quit (Ping timeout: 244 seconds)
19:49:53*Jjp137 quit (Quit: Leaving)
19:51:19FromDiscord<exelotl> In reply to @Elegantbeef "I havent used it": I mean, the OOP aspect is exactly what I want, the thing is before doing a query you're expected to have a fully instantiated object which will be populated with the results of the query, but if that object (or any of its fields which are also model objects) happen to be `nil` then it just segfaults :x
19:51:30*kayabaNerve_ quit (Ping timeout: 240 seconds)
19:51:35FromDiscord<Elegantbeef> What?
19:52:06FromDiscord<Elegantbeef> I dont know Norm related APIs but given phil's code i didnt see any benefit in the OOP method of code, i could be wrong
19:53:21*Jjp137 joined #nim
19:54:08FromDiscord<Elegantbeef> Like does it actually benefit from being able to dynamically point at any model, or is it all mostly static?
19:54:34*Jjp137 quit (Client Quit)
19:55:04FromDiscord<exelotl> oh, you mean like that
19:56:03FromDiscord<exelotl> not sure if the inheritance is necessary or if dynamic dispatch is actually used
19:57:28*Jjp137 joined #nim
19:57:44*PMunch quit (Quit: leaving)
19:58:05FromDiscord<exelotl> seems mostly just useful as a way to ensure every model has the necessary internal fields (e.g. `id`)
19:58:27FromDiscord<Elegantbeef> Yea that's my point concepts + value type inheritance works
19:58:34FromDiscord<Elegantbeef> For instance
19:58:37FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40ui
19:59:49FromDiscord<Elegantbeef> But i really should make it clear i've never used Norm or anything like it so i dont even know what it does
20:31:44FromDiscord<ripluke> Is there a function I can use to rename files
20:32:30FromDiscord<Elegantbeef> `moveFile`
20:34:48FromDiscord<ripluke> Ohk
20:43:47*noeontheend joined #nim
20:55:21FromDiscord<Phil> In reply to @reversem3 "https://play.nim-lang.org/#ix=40u4": Alright, finally can look at it on a proper screen
20:56:08FromDiscord<Phil> Issue 1) You don't import the postgres module in norm. the norm/model module is for defining models. The methods for doing things on a given database are in the sqlite/postgres modules
20:57:05FromDiscord<Phil> Issue 2) db is a DbConn object from std/db_sqlite (which norm has its own version of but they are literally the same type
20:57:24FromDiscord<Phil> (edit) "type" => "thing and can be used interchangeably)"
20:57:32FromDiscord<Phil> (edit) "interchangeably)" => "interchangeably). It does not have a "userFoo" attribute"
20:57:57FromDiscord<Phil> (edit) "Issue 2) db is a DbConn object from std/db_sqlite (which norm has its own version of but they are literally the same thing and can be used interchangeably). It does not have a "userFoo" attribute ... " added "(The echo `db.userFoo` will get you there)"
20:59:40FromDiscord<Phil> (Minor) Issue 3) Which won't be a runtime error but is in general advisable: database connection pooling is neat and saves you the runtime-effort of creating and destroying database connections all the time.
21:00:56FromDiscord<Phil> Issue 4) You might want to double check if you can access your postgres database with neither a username nor a password (since you pass those as empty strings).
21:01:06FromDiscord<Phil> (edit) "strings)." => "strings when creating a connection)."
21:01:10FromDiscord<Elegantbeef> I see phil has replaced me 😄
21:01:15FromDiscord<Phil> (edit) "Issue 4) You might want to double check if you ... can" added "actually"
21:01:32FromDiscord<Phil> This is questions about like the 1 project I've actually made semi-significant contributions to
21:02:14FromDiscord<Elegantbeef> That's how it starts!
21:02:29FromDiscord<Phil> Sorry if I might be a bit short, was in a theme park for birthday celebrations of a friend of mine and my brain is woozy af
21:03:07FromDiscord<Phil> Way too much rollercoaster stuff
21:10:35reversem3[m]Yeah I got it to work now buy fixing the lines , I can see the rows now
21:11:07*rockcavera quit (Read error: Connection reset by peer)
21:12:09reversem3[m]So it’s ‘import norm/[model,postgres]’
21:13:04reversem3[m]I wonder if I can use my db_connect.nim file now
21:13:09*rockcavera joined #nim
21:14:44FromDiscord<Phil> Generally I would not recommend the model of having one global database connection that you reuse over and over
21:14:46reversem3[m]I need to figure out though why I can’t just select the email from the row , it’s tells me I have to select everything. Just to the User.email.
21:14:55reversem3[m]* Just to get the User.email.
21:15:07FromDiscord<Phil> norm wants to build you the entire object
21:15:13FromDiscord<Phil> Or what do you mena?
21:15:38reversem3[m]Let get back on pc to show you
21:15:45FromDiscord<Phil> norm should generate the SQL for you other than the WHERE clause, which you can modify yourself, so not sure where precisely you're meaning
21:19:40*pro joined #nim
21:34:30*noeontheend quit (Ping timeout: 240 seconds)
21:41:07FromDiscord<whisper> Araq mentioned in forum combination of trial deletion algorithms with ideas from generational GCs. Is there any specific paper or group of papers he was referring to?
21:57:53FromDiscord<Elegantbeef> You could ask in the forum post or ask him yourself 😄
22:01:11NimEventerNew thread by Treeform: Show Nim: Pure Nim .jpeg decoder in Pixie, see https://forum.nim-lang.org/t/9248
22:01:41FromDiscord<treeform> In reply to @NimEventer "New thread by Treeform:": I am around to answer any questions you might have.
22:12:09*pro quit (Quit: pro)
22:27:34FromDiscord<ajusa> In reply to @treeform "I am around to": Thank you for doing this!
22:35:43FromDiscord<treeform> 🙂
22:53:14*adium quit (Quit: Stable ZNC by #bnc4you)
23:08:33*adium joined #nim
23:13:06FromDiscord<demotomohiro> In reply to @treeform "I am around to": Pure Nim .jpeg decoder implementation is awesome!
23:14:37FromDiscord<ynfle> In reply to @treeform "I am around to": Can pixie be used to implement computer vision algorithms? Like does it give you random access to the data?
23:16:12FromDiscord<demotomohiro> In reply to @ynfle "Can pixie be used": pixie reads image file to `Image` type object and you can do random access each pixels.
23:21:53FromDiscord<treeform> Yeah you can do anything to the images, for CV, you might scale them to fit your neural network.
23:24:29FromDiscord<ynfle> I will definitely be trying out seam carving with pixie. Looking forward
23:24:34FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=40uT
23:28:19FromDiscord<ynfle> The real question is who influenced who for the "py" name ending schema? Do all your collaborators have to use that schema?
23:32:17FromDiscord<Elegantbeef> You mean the `y` suffix?
23:33:54FromDiscord<!Patitotective> its better than calling it imagenim
23:34:24FromDiscord<Elegantbeef> Not as good as nimagine
23:34:38FromDiscord<Elegantbeef> I'm joking of couruse
23:34:40FromDiscord<Elegantbeef> course even
23:35:35FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=40uV
23:35:57FromDiscord<treeform> In reply to @ynfle "The real question is": Just kind of happened one day
23:36:18FromDiscord<treeform> or Justy kinddy of happeneddy oniey day
23:36:41FromDiscord<ynfle> Is that why guzba called it zippy?
23:36:52FromDiscord<ynfle> Or is that not the same decision/happening?
23:37:02FromDiscord<guzba> zippy was right around when the "y" thing happened iirc
23:37:38FromDiscord<guzba> supersnappy was before, but just happens to fit?↵the "before" treeform repos are like "chroma" "chrono" "vmath" etc lots of em↵the "after", well those are obvious haha
23:38:21FromDiscord<ynfle> I think it should go in the official nim style guide
23:38:33FromDiscord<!Patitotective> its part of treeforms master plan
23:39:21FromDiscord<guzba> we had some epic debates of pixxy / pixy / pixie↵is the y sound the important part, or the y letter?
23:39:24FromDiscord<guzba> existential questions
23:39:43FromDiscord<Elegantbeef> Nah it's atrocious for people that like pun filled library names!↵(@ynfle)
23:40:03FromDiscord<Elegantbeef> you just cant beat kashae for a cache library
23:40:31FromDiscord<ynfle> vershun too
23:41:36FromDiscord<Elegantbeef> Though i guess oopsie fits the suffix
23:41:57FromDiscord<guzba> hottie also went "sound" over "letter"
23:42:09FromDiscord<guzba> i think it is slightly more flexible but still on brand
23:42:10FromDiscord<guzba> hahaha
23:45:45*xaltsc joined #nim