<< 17-01-2023 >>

00:06:20FromDiscord<Array in ∀ Matrix> oh i must've just missed it then thanks
00:55:33*azimut quit (Remote host closed the connection)
00:59:05*azimut joined #nim
01:14:09*azimut quit (Remote host closed the connection)
01:15:49*azimut joined #nim
01:39:13FromDiscord<Leftbones> Is there a benefit to using result vs return?
01:40:44FromDiscord<Elegantbeef> There is no runtime benefit
01:40:53FromDiscord<Elegantbeef> The best thing is implicit, then result, then return imo but ymmv
01:40:54FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4lsK
02:17:14FromDiscord<ted__> sent a code paste, see https://play.nim-lang.org/#ix=4lsQ
02:18:12FromDiscord<Elegantbeef> There is collect but you require the iteration
02:18:30FromDiscord<Elegantbeef> so it'd be like `var a = collect(for pair in foo=bar,baz,qux=wibble".parseConfig: pair)`
02:18:31FromDiscord<Rika> Doesn’t toSeq work or what
02:18:40FromDiscord<Elegantbeef> `toSeq` should
02:18:57FromDiscord<ted__> I tried `toSeq` and it didn't work, but maybe I did it wrong, let me try again
02:19:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lsR
02:20:06FromDiscord<ted__> yep, I must have done it wrong, thanks!
02:37:56FromDiscord<scruz> sent a code paste, see https://play.nim-lang.org/#ix=4lsU
02:39:00FromDiscord<scruz> (edit) "https://play.nim-lang.org/#ix=4lsU" => "https://play.nim-lang.org/#ix=4lsV"
02:54:57FromDiscord<kots> Looks like inim, you can get it with nimble
03:01:50*xet7 quit (Ping timeout: 246 seconds)
03:18:02*azimut quit (Ping timeout: 255 seconds)
03:36:34*xet7 joined #nim
03:48:25FromDiscord<tfp> sent a code paste, see https://play.nim-lang.org/#ix=4lt6
03:48:30FromDiscord<tfp> so seqs seem like non ref types
03:48:43FromDiscord<tfp> is there a way to them behave like ref types
03:48:49FromDiscord<tfp> i tried `var y = ref x` and `ref y = x`
03:49:01FromDiscord<tfp> basically what can i put on line 2 to make this behave how i expect it
03:51:17FromDiscord<Rika> X has to be a ref seq
03:51:56FromDiscord<tfp> if u use ref in an argument list u get the behavior that i want
03:52:03FromDiscord<tfp> is there no way to just do that on the stack?
03:52:25FromDiscord<Rika> No
03:52:56FromDiscord<Rika> Unless you want unsafe
03:52:59FromDiscord<Rika> Or experimental
03:53:12FromDiscord<tfp> weird
03:53:21FromDiscord<tfp> that makes sense to me as a feature
03:54:00FromDiscord<Rika> Safety is difficult to guarantee unless you add severe limitations to it iirc
03:54:21FromDiscord<tfp> yeah that makes sense
03:54:25FromDiscord<tfp> i guess you'd need a borrow checker basically
03:54:32FromDiscord<tfp> i think addr is fine then if i ever really do need to do this
04:03:55FromDiscord<Elegantbeef> In Nim `ref` is a heap allocated type, unlike C++'s references
04:03:55FromDiscord<Elegantbeef> Technically we could abuse a for loop and make an alias an explicit `for y in alias(x)`
04:04:27FromDiscord<tfp> even if you accept an arg via ref it's suddenly allocated on the heap?
04:04:33FromDiscord<tfp> that was the behavior i was trying to mimick on the stack
04:05:43*azimut joined #nim
04:12:29FromDiscord<Elegantbeef> Nim implicitly will pass arguments by reference if it's faster, but yes in Nim `ref T` is heap allocated
04:12:29FromDiscord<Elegantbeef> `var T` can be stack or heap allocated, it just has to be a mutable lvalue
04:12:35*crem quit (Read error: Connection reset by peer)
04:13:23*arkurious quit (Quit: Leaving)
04:23:17FromDiscord<Try2Cry> sent a long message, see http://ix.io/4ltb
04:23:28FromDiscord<Elegantbeef> think it emits es3
04:23:59FromDiscord<Try2Cry> 3 !!!! https://media.discordapp.net/attachments/371759389889003532/1064761980486951013/image0.png
04:28:49FromDiscord<sOkam!> Can you think of a way to create this type of rb-tree without all the experimental crazyness? https://rosettacode.org/wiki/Algebraic_data_types#Nim
04:30:10FromDiscord<Elegantbeef> Do the same thing the fusion macro does manually
04:33:11FromDiscord<sOkam!> yeah, that's the question. how to do it without having to learn fusion to not use fusion
04:35:52FromDiscord<Elegantbeef> you can `expandMacros` on that case statement and see the generated code
04:47:34FromDiscord<Elegantbeef> https://en.wikipedia.org/wiki/Red%E2%80%93black_tree#Operations mostly documents the algorithims used
04:47:35FromDiscord<Elegantbeef> Might be able to find something else that is more educational
05:32:08*azimut quit (Ping timeout: 255 seconds)
06:45:17*mal`` quit (Quit: Leaving)
07:02:52*mal`` joined #nim
07:53:23*PMunch joined #nim
08:05:25FromDiscord<xoich (xoich)> hi, I have a s = seq[X] where X is an object. I want to modify s[^1] but I don't want to write s[^1] every time. How do I give a name to s[^1] without making X a ref object?
08:06:00*rockcavera quit (Remote host closed the connection)
08:06:09FromDiscord<Elegantbeef> `template lastElement: auto = s[^1]`
08:06:51FromDiscord<xoich (xoich)> @elegantbeef\:matrix.org that is cool, thanks, but can I assign it to a variable?
08:07:24FromDiscord<Elegantbeef> If you dont mind unsafe code you can `import std/decls` and do `var myVal{.byAddr.} = s[^1]`
08:07:31FromDiscord<pyolyokh> you mean, assign `s.lastElement` to a variable and modify that variable, without reference to `s`? Not without pointers or experimental viewtypes
08:07:31FromDiscord<Elegantbeef> But that's just an unsafe version of the template
08:08:36FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4ltN
08:09:13FromDiscord<Elegantbeef> We also could make a for loop
08:09:15FromDiscord<xoich (xoich)> ok thanks, I thought it would have been possible safely
08:09:23FromDiscord<Elegantbeef> Nah it requires a borrow checker
08:11:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ltP
08:12:12FromDiscord<Elegantbeef> But still isnt safe
08:12:58FromDiscord<xoich (xoich)> I'll just make X a ref
08:13:13FromDiscord<pyolyokh> for the requirement of "I don't want to write s[^1] every time", a template does it. You can even make a local template just where you're doing this
08:13:14FromDiscord<Elegantbeef> You really should only use `ref` if you want ref semantics not for aliasing
08:14:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ltQ
08:14:32FromDiscord<Elegantbeef> Created a dangling pointer with just safe mechanisms of Nim
08:15:26FromDiscord<Elegantbeef> But it demonstrates quite nicely why a borrow checker is needed for this logic
08:15:30FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4ltR
08:16:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ltS
08:17:32FromDiscord<xoich (xoich)> @\_discord\_803214225002463283\:t2bot.io I haven't studied templates yet, so I'm not really sure how they work but that seems ok yes
08:17:41FromDiscord<Elegantbeef> It's just code subsitution
08:17:54FromDiscord<Elegantbeef> when you call `last` it pastes the code directly where you called it
08:17:59FromDiscord<Elegantbeef> So in this case it pastes `s[^1]`
08:18:52FromDiscord<pyolyokh> build with `--mm:orc --expandArc:tedious --expandArc:slick`, it's the exact same code
08:18:55FromDiscord<xoich (xoich)> ok but I see\: untyped there, does it have any consequences?
08:19:06FromDiscord<Elegantbeef> Nope
08:19:11FromDiscord<Elegantbeef> pyolyokh was just being lazy
08:19:38FromDiscord<Elegantbeef> It should be `template last: var int = s[^1]`
08:20:25FromDiscord<xoich (xoich)> ok sounds good
08:29:47*jjido joined #nim
08:51:02*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
09:29:16FromDiscord<pyryrin> When youre making a wrapper for a c library, when you importc a proc does it need to be made `{.cdecl.}`?
09:30:45FromDiscord<Elegantbeef> It should be
09:30:50FromDiscord<Elegantbeef> It should be whatever convention is used
09:30:55FromDiscord<pyolyokh> it needs to match the calling convention of the C function in the C library. That's usually going to be cdecl, "the same convention as the C compiler"
09:50:43FromDiscord<pyryrin> In reply to @pyolyokh "it needs to match": But why does ot need to match it?
09:51:12FromDiscord<Elegantbeef> Cause calling conventions change how arguments are passed to a procedure call
09:51:42FromDiscord<Elegantbeef> If the conventions do not match you may have incorrect behaviour on some platforms/backends
09:51:49FromDiscord<pyryrin> Oh
09:52:13FromDiscord<Elegantbeef> Nim does actually do `cdecl` implicitly on linux, but i think on windows it can use fastcall or cdecl depending
09:52:21FromDiscord<Elegantbeef> Cannot recall which OS actually to be honest
09:52:46FromDiscord<Elegantbeef> but it's implicitly `nimCall` to distinctly type it
09:53:11FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lu7
09:53:39FromDiscord<Elegantbeef> `exportC, dynlib`
09:53:53FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-export
09:54:38FromDiscord<Elegantbeef> Without `dynlib` it just assumes "We're giving the C type a name"
09:55:06FromDiscord<pyolyokh> tyty
09:55:52FromDiscord<pyolyokh> incidentally it's still N_LIB_PRIVATE with that, but the symbol now shows up with nm -D. weird
09:56:04FromDiscord<Elegantbeef> Shrug it works
09:56:23FromDiscord<pyolyokh> and it says it's NIMCALL ...
09:56:37FromDiscord<Elegantbeef> well you didnt annotate it `cdecl`
09:56:45FromDiscord<pyolyokh> but if I add cdecl to useit.nim it still works, so yeah I guess that doesn't matter on this platform
09:58:09FromDiscord<Elegantbeef> Yea MS only has fastcall
09:58:21FromDiscord<Elegantbeef> So sadly `cdecl` is a separation due to MS shenanigans
09:58:31FromDiscord<pyolyokh> I'm on x86_64 linux though
09:58:54FromDiscord<pyolyokh> ah, it might not be this platform but a function signature that simple.
09:58:59FromDiscord<Elegantbeef> Yea so you use cdecl, but the Nim compiler distinguishes it to `nimCall` to prevent silent windows issues
09:59:17FromDiscord<Elegantbeef> Since it defaults to fastcall there, but cdecl pretty much everywhere else
09:59:17FromDiscord<New> hi all. i have file, 1.5MB. How i can send this by using sockets? ↵At this moment i just base64 my output and sending it to client. on client side just recvLine and decode.
09:59:46FromDiscord<New> (edit) "decode." => "decode.↵Using this method allow me to send only 750_000 bytes"
10:00:07FromDiscord<Elegantbeef> So technically if only supporting linux(and mac?) there is no reason to use `cdecl` 😛
10:00:12FromDiscord<Elegantbeef> Send it in chunks moving up
10:00:19FromDiscord<pyolyokh> that works, but it should also work to not base64 and just dump the bytes down the wire. Also, that shouldn't limit the size of the file at all. Perhaps you're trying to do it a single syscall?
10:03:25FromDiscord<New> In reply to @pyolyokh "that works, but it": How it looks like:↵i send string + "\n"↵server side looking what i sent, if this is in "list of commands" (like ls -la) - do command, base64 it (cause all output from this command have "\n" and i read only 1 line on client side) and send to client with "\n"↵e.g.:
10:04:16FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lua
10:04:40FromDiscord<pyolyokh> but, maybe recvLine has an internal limit. The alternative to a limit is letting anyone DDOS you after all
10:04:42FromDiscord<New> (edit) "In reply to @pyolyokh "that works, but it": How it looks like:↵i send string + "\n"↵server side looking what i sent, if this is in "list of commands" (like ls -la) - do command, base64 it (cause all output from this command have "\n" and i read only 1 line on client side) and send to client with "\n"↵e.g.:" => "sent a long message, see http://ix.io/4lub"
10:04:54FromDiscord<pyolyokh> (edit) "DDOS" => "DOS"
10:05:46FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4luc
10:05:53FromDiscord<New> In reply to @pyolyokh "but, maybe recvLine has": my server send all to me, but when i do second input, i catch previous part of file xD
10:06:18FromDiscord<pyolyokh> the default maxLength isn't enough for even 1MB
10:06:49FromDiscord<New> so how i can change it then? to 150MB for example
10:07:04FromDiscord<pyolyokh> it's a parameter, just pass your own limit
10:07:09FromDiscord<New> recvLine(maxLength = 150_000_000 ?
10:07:16FromDiscord<New> (edit) "150_000_000" => "150_000_000)"
10:07:18FromDiscord<pyolyokh> yeah
10:09:49FromDiscord<New> impressive. i done it but its not worked before i asked xD↵just change to other value (more then was, eg i typed 150_000_000, now 200_000_000 and all ok)
10:09:59FromDiscord<New> tnx! have a nice day
10:10:09FromDiscord<New> (edit) "change" => "changed"
10:10:56FromDiscord<New> (edit) "impressive. i done it but its not worked before i asked xD↵just changed to other value (more then ... was," added "it"
10:13:39*jjido joined #nim
10:32:24FromDiscord<arkanoid> Interesting blog post!↵↵https://verdagon.dev/blog/when-to-use-memory-safe-part-2
10:38:01FromDiscord<planetis> I wonder how can you possibly keep the top-down approach in a gui setting
10:38:07FromDiscord<Rika> Didn’t expect Nim to need mentioned
10:38:11FromDiscord<Rika> (edit) "need" => "be"
10:39:02FromDiscord<pyolyokh> >Lobster is using borrowing and other static analysis techniques under the hood to eliminate a lot of reference counting overhead.↵why is Lobster called out for doing this but Nim isn't? Probably: Lobster links to what it does direct from the documentation, but Arc/Orc is described by blog posts
10:39:29FromDiscord<planetis> (edit) "setting" => "setting. Except making everything a monolithic piece of code."
10:39:45*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
11:47:18*jjido joined #nim
12:01:06FromDiscord<auxym> good point. When 2.0 is officially out, it might be a good idea to include a blurb on ORC prominently on the front page
12:37:26FromDiscord<伊弉冉の恵み> good morning, are there any other tutorias you would recommend besides Kiloneie's?
12:38:41FromDiscord<Saint> It seems that my projects config.nims is not overriding my ~/.config/nim/config.nims
12:38:48FromDiscord<Saint> But rather the other way around
12:58:05FromDiscord<hotdog> In reply to @伊弉冉の恵み "good morning, are there": You mean video tutorials? I’m not sure there are any. There are various written tutorials linked from https://nim-lang.org/documentation.html
12:58:40FromDiscord<伊弉冉の恵み> In reply to @hotdog "You mean video tutorials?": yeah video ones
12:59:02FromDiscord<伊弉冉の恵み> I was recommended Kiloneie's videos when I first joined the server
12:59:04FromDiscord<伊弉冉の恵み> and they're great
12:59:30FromDiscord<伊弉冉の恵み> just wondering if there are any other ones worth checking out
13:01:11FromDiscord<hotdog> They aren’t really tutorials, but there’s a lot of video content on the nim channel https://youtube.com/@nimprogramminglanguage3130
13:01:25FromDiscord<hotdog> Mostly from the recent nim conferences
13:01:33FromDiscord<hotdog> @伊弉冉の恵み
13:03:37FromDiscord<fbpyr> depends on the topics I guess. I also liked these by dev on duty\: ↵https://yewtu.be/playlist?list=PLu-ydI-PCl0PqxiYXQMmLh7wjQKm5Cz-H
13:03:37FromDiscord<fbpyr> https://yewtu.be/playlist?list=PL9Yd0XwsGAqwSRuWrDXn2SP3N8snNx29W
13:03:37FromDiscord<fbpyr> and aoc by pmunch
13:03:52FromDiscord<伊弉冉の恵み> In reply to @hotdog "<@972362853879275551>": of those I am aware, but thanks anyway
13:03:55FromDiscord<Simran> hey, how are u all?
13:04:29FromDiscord<伊弉冉の恵み> what's yewtube though?
13:05:48FromDiscord<fbpyr> a user and privacy friendl front-end to youtube
13:06:28FromDiscord<fbpyr> links are interchangeable. 🙂 yewtu.be \<-\> youtu.be youtube.com ..
13:07:28FromDiscord<fbpyr> there are more a couple more of these invidious servers though\: ↵https://docs.invidious.io/instances/
13:08:13FromDiscord<fbpyr> source code\: https://github.com/iv-org/invidious
13:11:08FromDiscord<fbpyr> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1064893298864566293): a user and privacy friendly front-end to youtube
13:11:09FromDiscord<fbpyr> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1064893720253693962): there are a couple more of these invidious servers though\: ↵https://docs.invidious.io/instances/
13:14:35*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
13:20:50FromDiscord<choltreppe> is there a way to generate docs using the js backend?
13:28:03FromDiscord<Simran> hey, how are u ?
13:46:11FromDiscord<MadScientistCarl> The Nim style guide says the implementation of method dispatching in Nim is bad. Is it still true?
13:47:39FromDiscord<Rika> iirc
13:47:41FromDiscord<Rika> yes
13:52:38FromDiscord<MadScientistCarl> So I tried storing behavior proc directly as object fields instead of using methods. That makes modularization really hard, again due to the cyclic import limitation
14:19:27*azimut joined #nim
14:24:00*arkurious joined #nim
14:26:30*azimut quit (Remote host closed the connection)
14:27:57*azimut joined #nim
14:31:54PMunch@MadScientistCarl, it's not that bad
14:32:13PMunchIf you're doing inheritance and all that jazz you should probably still use methods
14:32:31PMunchBut if you don't need them or can restructure your program you should probably do that instead
14:32:50PMunch@choltreppe, `nim doc`? Or am I missing something
14:39:56*azimut quit (Quit: ZNC - https://znc.in)
14:40:47*azimut joined #nim
14:45:54*PMunch quit (Quit: Leaving)
14:55:22FromDiscord<choltreppe> In reply to @PMunch "<@705152179782025308>, `nim doc`? Or": when I use `nim doc` all the js backend specific things behind `when defined(js)` are not included in the docs. I mean I guess that makes sense. so my question is is there some parameter i can use to use the js backend for the docs
15:05:23FromDiscord<hotdog> In reply to @choltreppe "when I use `nim": IIRC you can just do -d:js
15:06:20*azimut quit (Ping timeout: 255 seconds)
15:06:32FromDiscord<pyolyokh> that'll get you defined(js), but docs aren't the only things testing that
15:06:59*azimut joined #nim
15:06:59FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lvr
15:07:00*ofelas joined #nim
15:19:44FromDiscord<Scalpi> sent a code paste, see https://play.nim-lang.org/#ix=4lvx
15:22:07FromDiscord<choltreppe> In reply to @Scalpi "I couldn't find a": why not use `#[ your comment ]# example()`?
15:23:30FromDiscord<Scalpi> thanks? it work!
15:23:36FromDiscord<choltreppe> np
15:25:52*ofelas quit (Quit: WeeChat 3.8)
15:27:19FromDiscord<hotdog> In reply to @pyolyokh "that'll get you defined(js),": Ah right, it's just --backend:js
15:27:44FromDiscord<hotdog> @choltreppe
15:30:54*beholders_eye joined #nim
15:32:46FromDiscord<choltreppe> In reply to @hotdog "Ah right, it's just": ah thanks. that worked.
15:38:50FromDiscord<choltreppe> now I have the problem that it uses node.js and I use the DOM in my code which obviously doesnt exist in node. Any idea how to solve this?
15:41:29FromDiscord<huantian> don't use the DOM in your code if you're targeting node?
15:43:03FromDiscord<choltreppe> no im not targeting node. but `nim doc`seems to use node for the runnableExamples checking
15:44:33FromDiscord<huantian> ah i see
15:44:43FromDiscord<hotdog> @choltreppe try `--docCmd:skip`
15:44:59FromDiscord<hotdog> To skip runnableExamples checking
15:45:26FromDiscord<hotdog> If you want to test them in the browser you might have to get creative
15:46:11FromDiscord<choltreppe> thanks that will do for now
15:46:32FromDiscord<hotdog> You could also try something like https://www.npmjs.com/package/jsdom to let you test the runnableexamples with Node
16:19:35*beholders_eye quit (Ping timeout: 255 seconds)
16:26:26FromDiscord<Ayano> how do i convert a long to a byte array?
16:28:21FromDiscord<Ayano> how do i convert an int to byte array?
16:39:17FromDiscord<choltreppe> you could use `cast[array[sizeof(int), byte]](x)`
16:49:15FromDiscord<GoMpow2> how can i index a array ptr float64 ?
16:49:34FromDiscord<GoMpow2> a\: ptr float64↵a[5] doesn't work
16:50:16FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4lvP
16:50:22FromDiscord<huantian> can't remember if you need the `ptr` in the `cast`
16:50:31FromDiscord<GoMpow2> thx
16:52:12*beholders_eye joined #nim
16:54:49Amun-Racast is ugly as
16:57:29Amun-Rathis is C way of converting long (that may be 32-bit or 64-bit): https://play.nim-lang.org/#ix=4lvQ
17:01:22*Figworm joined #nim
17:32:39*junaid_ joined #nim
17:47:02FromDiscord<auxym> In reply to @Amun-Ra "this is C way": nim `cast` generates unions in C
17:47:04*junaid_ quit (Remote host closed the connection)
17:47:59FromDiscord<auxym> because of strict aliasing stuff I assume. "fun" read: https://gist.github.com/shafik/848ae25ee209f698763cffee272a58f8
17:48:33FromDiscord<auxym> so yeah, casting to ptr UncheckedArray in Nim is the correct way to access a C array for FFI, to the best of my knowledge
18:02:03*jmdaemon joined #nim
18:03:07*xet7 quit (Ping timeout: 256 seconds)
18:16:03*xet7 joined #nim
18:24:16*jmdaemon quit (Ping timeout: 256 seconds)
18:25:36*jmdaemon joined #nim
19:04:28FromDiscord<Saint> How do I pass a seq as varags to a proc?
19:04:36FromDiscord<Saint> Like explode or expand it or whatever
19:04:41FromDiscord<Saint> Not sure of the name for it
19:04:48FromDiscord<leorize> just pass it
19:05:00FromDiscord<Saint> Just pass a sequence?
19:05:10FromDiscord<Saint> In python you have to do i think
19:05:10FromDiscord<leorize> yep
19:05:12FromDiscord<Saint> Hmm
19:05:13FromDiscord<Saint> Okay
19:05:43FromDiscord<leorize> `varargs` is a slightly more special `openArray` in that it let you pass without an array/seq
19:05:53FromDiscord<leorize> but if you have one it works just like `openArray`
19:06:05FromDiscord<leorize> except when it&#x27;s `echo`
19:07:10*jmdaemon quit (Ping timeout: 268 seconds)
19:11:40FromDiscord<Saint> Gotcha
19:11:42FromDiscord<Saint> Thank you!
19:12:49FromDiscord<Saint> sent a code paste, see https://play.nim-lang.org/#ix=4lws
19:13:04FromDiscord<Rika> Body needs wait for too
19:13:07FromDiscord<Saint> sent a code paste, see https://play.nim-lang.org/#ix=4lwt
19:13:10FromDiscord<Saint> Yeah why does it need wait?
19:13:12FromDiscord<Rika> Body field is not expected
19:13:13FromDiscord<Rika> Exported
19:13:20FromDiscord<Saint> What does that mean
19:13:22FromDiscord<Rika> Body proc is what you’re calling
19:13:25FromDiscord<Rika> Not the field
19:13:31FromDiscord<leorize> (idk why we show non-exported fields in docs tbh)
19:13:31FromDiscord<Saint> Oh I see
19:14:03FromDiscord<Saint> Wow.. how would I be able to tell that
19:14:07FromDiscord<Saint> From the docs
19:14:13FromDiscord<Rika> Asterisk
19:14:25FromDiscord<Rika> But I’d say it’s obscure as fuck
19:14:39FromDiscord<Recruit_main707> `body:` private↵`body:` public
19:14:40FromDiscord<Saint> Asterisk means what
19:14:47FromDiscord<Saint> Oh I see
19:14:48FromDiscord<Rika> Export
19:14:51FromDiscord<Rika> Yes
19:15:03FromDiscord<Saint> Yeah that is very hard to catch
19:15:05FromDiscord<Recruit_main707> same with functions and types in general
19:15:10FromDiscord<Saint> Is there some way to update the docs?
19:15:26FromDiscord<Saint> Could I possibly include a note even?
19:15:35FromDiscord<Rika> Doc generator would prolly need to be changed in that case
19:15:58FromDiscord<Saint> What about including an example
19:16:00FromDiscord<Rika> Note would need approval from others I assume but I would like to believe it would be accepted easily
19:16:15FromDiscord<Rika> I will have to leave now
19:16:26FromDiscord<Saint> Goodbye I will miss you
19:16:52FromDiscord<Saint> (edit) "Goodbye I will miss you" => "See ya!"
19:40:16FromDiscord<Phil> Erm... not necessarily a nim specific question, more one with the nim image on docker
19:41:49FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lwE
19:42:21FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lwF
19:43:32FromDiscord<Phil> Based on a first google this can happen all over the place for random ass reasons, none of which I understand, anyone had this before?
19:43:50*jjido joined #nim
19:44:43*jmdaemon joined #nim
19:45:46FromDiscord<leorize> try podman
19:48:30FromDiscord<Saint> https://media.discordapp.net/attachments/371759389889003532/1064994643340689459/image.png
19:48:36FromDiscord<Saint> https://news.ycombinator.com/item?id=34410187
19:53:41FromDiscord<Phil> Can I use podman as a drop in replacement for docker-cli? Because if I have to put in another dozen hours of effort to get the pipelines working for something I fundamentally do not care about that much then that's a heavy suggestion.
19:57:31FromDiscord<Phil> Ugh, docker needed login credentials for some random reason
19:59:00*jmdaemon quit (Ping timeout: 272 seconds)
19:59:53*jmdaemon joined #nim
20:00:24FromDiscord<Phil> Alrighty, sqliteTests run in a docker container... now to get postgresTests to run which are bombing for some random ass reason
20:07:24*jmdaemon quit (Ping timeout: 256 seconds)
20:15:05*jmdaemon joined #nim
20:39:32*jmdaemon quit (Ping timeout: 272 seconds)
20:49:43FromDiscord<ted__> In reply to @Isofruit "This is for the": is there a reason that you're running `docker-compose` with `sudo`? there shouldn't be a need to run docker/docker-compose with a root user and I could see it causing issues like what you're seeing. I use `colima` (https://github.com/abiosoft/colima) for docker on mac and it's been solid
20:50:35FromDiscord<ShalokShalom> https://podman.io/whatis.html
20:50:41FromDiscord<Phil> Because installing docker in a manner that doesn't require sudo is extra effort that I haven't gone through
20:50:43FromDiscord<ShalokShalom> there are some voices, that its not entirely true
20:50:50FromDiscord<ShalokShalom> but they had been three years old
20:50:57FromDiscord<ShalokShalom> at this time
20:51:56FromDiscord<ted__> In reply to @Isofruit "Because installing docker in": my org has thousands of engineers all using colima and AFAIK none of them are using it as a super user, for 95% of people it's just `brew install colima docker docker-desktop` then `colima start` and you're good
20:52:35FromDiscord<ted__> the other 5% of people have messed up brew installations or are using testcontainers and need additional resources to be given to the lima engine underneath
21:29:40*azimut quit (Remote host closed the connection)
21:30:58*rockcavera joined #nim
21:31:03*azimut joined #nim
21:53:32FromDiscord<arne> my organization uses scala and docker
22:15:12FromDiscord<Leftbones> Not necessarily a Nim problem but why is reading special keys from `getch` so annoying 💀
22:16:17FromDiscord<Elegantbeef> What character are you trying to read?
22:16:27FromDiscord<Leftbones> Stuff like delete, arrow keys, function keys, etc
22:24:01FromDiscord<Leftbones> On the ASCII table, arrow up is 72, but `getch` reads 0, for example
22:24:28FromDiscord<Leftbones> I don't have the greatest understanding of how `getch` works under the hood, but I managed to do this in the past, though it was a few years ago
22:38:11*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
22:49:08FromDiscord<Mustache Man> https://tenor.com/view/head-spinning-my-is-overwhelmed-gif-24700382↵> ↵> me realizing the technologies and stacks I've been using professionally for the past 10 years are no longer relevant to the job market
22:50:29FromDiscord<Mustache Man> feels like nobody's writing new software anymore, it's just data pipelines, migration to cloud, and devops
22:51:30FromDiscord<Mustache Man> so not having years of experience with python, go, and terraform is rather painful
22:52:32FromDiscord<Mustache Man> i wonder if this is how the previous generation of programmers felt when java showed up 🤔
22:54:32FromDiscord<Leftbones> And then the java programmers when kotlin showed up
22:55:33FromDiscord<Mustache Man> i would love to work in kotlin, but it hasn't gained much mindshare.
22:56:10FromDiscord<Mustache Man> go & python are ubiquitous now
22:56:55FromDiscord<Leftbones> I can't seem to get into Go
22:58:40FromDiscord<Mustache Man> In reply to @Leftbones "I can't seem to": i guess i'm going to try, since at least at its core it has a similar purpose as nim
22:58:52FromDiscord<Mustache Man> syntactically it's gross
22:59:01FromDiscord<Leftbones> Yeah I am not a huge fan of the syntax but it's better than rust at least
22:59:04FromDiscord<Elegantbeef> Does Nim and Go have similar purpose?
22:59:19FromDiscord<Leftbones> I think Go presents itself as a systems language? Though I don't see many people treating it that way
22:59:23FromDiscord<Mustache Man> i feel like they do, right? small, light, GC
22:59:26FromDiscord<Elegantbeef> It doesnt
22:59:34FromDiscord<Leftbones> I might be thinking of something else
22:59:36FromDiscord<Leftbones> Oh, Zig
22:59:43FromDiscord<Elegantbeef> Odin?
22:59:59FromDiscord<Leftbones> Zig aspires to replace C/C++, which is ambitious, to say the least
23:00:02FromDiscord<Mustache Man> i have never even heard of these 😛
23:00:02FromDiscord<Elegantbeef> Go has weird semantics like automatically raising data to heap if it needs it
23:00:26FromDiscord<Elegantbeef> It also has the dumbest time format string
23:00:26FromDiscord<Mustache Man> i've heard go doesn't have proper multithreading but idk if that's true
23:00:54FromDiscord<Elegantbeef> "We wrote the data on a board using 1..bleh and use that date for formatting, cause it's cool or something"
23:01:07FromDiscord<Mustache Man> it also has no while loops... ? and no inheritance.. just, some questionable decisions
23:01:23FromDiscord<Elegantbeef> Meh it has interfaces
23:01:36FromDiscord<Elegantbeef> It does have while though
23:01:44FromDiscord<Elegantbeef> `for x {}`
23:02:01FromDiscord<Mustache Man> dead
23:02:28FromDiscord<Elegantbeef> I think the worst part is there is no error handling in the language
23:02:34FromDiscord<Elegantbeef> So it's up to the programmer to decide what the error type/value is
23:02:51FromDiscord<Leftbones> In reply to @Leftbones "Is there a way": The other day I asked this, and I think I should explain better what I am trying to accomplish. I want to have a char enum `Key` with nice names like `Key.Delete` or `Key.Up` so when I'm reading from `getch` I don't have to go purely off of numbers, but of course I can't compare the output of `getch` with `Key` because they are different types. Any ideas or am I barking up a non-existent tree?
23:03:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lxx
23:03:56FromDiscord<jtv> Go's a perfectly language but a missed opportunity to have a good static type system for my tastes.
23:04:03FromDiscord<jtv> (edit) "Go's a perfectly ... language" added "fine"
23:04:21FromDiscord<Leftbones> Oh and the only reason I want `Key` to be comparable to char, is because for letters I'd like to be able to check if the getch output is `a` or `A` without having to have `Key.A` and `Key.ShiftA` like Illwill does
23:04:25FromDiscord<Elegantbeef> There's quite a bit of it's language design i just disagree
23:04:52FromDiscord<Elegantbeef> Cause `myKey in {ShiftA, A}` is so hard
23:05:07FromDiscord<Elegantbeef> or `myKey in [ShiftA, A]`
23:05:29FromDiscord<Leftbones> I mean, yeah. It's just not the most elegant solution, in my opinion
23:05:44FromDiscord<Mustache Man> Go also uses C style pointer and address syntax.. wish they'd changed that.↵initializing an array like this though:↵myArray := [3]int{5, 4, 3}
23:05:45FromDiscord<jtv> Yeah, I agree, it goes too far out of its way to be close to C
23:05:47FromDiscord<Leftbones> There shouldn't need to be Keys for all the letters and their uppercase versions, since those are just chars
23:06:00FromDiscord<jtv> While making some weird departures like walrus tusks
23:06:30FromDiscord<Mustache Man> (edit) "Go also uses C style pointer and address syntax.. wish they'd changed that.↵initializing an array like this though:↵myArray := [3]int{5, 4, 3}" => "sent a code paste, see https://play.nim-lang.org/#ix=4lxy"
23:06:36FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/bU2
23:06:42FromDiscord<Leftbones> Maybe it's a minor nitpick, but I hate having to use `:=` in Go, honestly
23:06:52FromDiscord<Elegantbeef> Which is weird cause it's based off oberon↵(@jtv)
23:06:57FromDiscord<Elegantbeef> Yet it doesnt even work like oberon
23:06:58FromDiscord<jtv> Yeah, those are the walrus tusks
23:07:06FromDiscord<Leftbones> OH LOL
23:07:08FromDiscord<Leftbones> That's what you meant
23:07:21FromDiscord<Mustache Man> so like, Go is open source, and it's still this weird ugly mish-mash of languages
23:07:34FromDiscord<Elegantbeef> The bastards went "You know oberon has an export marker, let's copy the it by making it so if the first character is a capital character it's exported"
23:07:35FromDiscord<jtv> Every language is a mish-mash of lots of languages
23:07:40FromDiscord<Mustache Man> but i guess i'm gonna learn it because it's in demand
23:07:49FromDiscord<Elegantbeef> They did that export shit, whilst having unicode identifiers
23:08:04FromDiscord<Leftbones> I like it in a language where doing `var x: int = 1` and `var int := 1` mean the same thing
23:08:11FromDiscord<Mustache Man> In reply to @jtv "Every language is a": that's like saying there's no original art
23:08:14FromDiscord<Elegantbeef> So now if you look at chinese written Golang code it is like `T` followed by unicode chinese characters
23:08:35FromDiscord<jtv> Nim's got some things that I'd do differently synactically but minor in comparison.
23:08:50FromDiscord<jtv> Their FFI is also a huge PITA
23:09:01FromDiscord<Mustache Man> FFI?
23:09:09FromDiscord<Elegantbeef> Foreign function interface
23:10:05FromDiscord<Leftbones> I have no gripes with nim's syntax so far, I've only been writing nim for like 3 days, but it's very comfy so far
23:10:11FromDiscord<Leftbones> (edit) removed "so far"
23:10:16FromDiscord<Mustache Man> i think the one thing that gets me about most languages, including nim, is the liberal use of different brackets for different purposes
23:11:08FromDiscord<treeform> I am just glad I don't have to use these: ⟦ ⟧ ⟨ ⟩ ⟪ ⟫ ⟮ ⟯ ⟬ ⟭ ⌈ ⌉ ⌊ ⌋ ⦇ ⦈ ⦉ ⦊
23:11:21FromDiscord<Leftbones> Since Nim seems to use them closer to how Python does, I don't necessarily have a problem with them
23:11:25FromDiscord<jtv> Well, I specifically don't like dictionaries being relegated to the library and literals being syntactic sugar.
23:11:35FromDiscord<Elegantbeef> The original Go generics were like `func MyProc(T)(a T){...}`
23:11:50FromDiscord<Elegantbeef> That proposal was fucking wild
23:11:57FromDiscord<Leftbones> I feel like the only real gripe I have read about Nim's syntax were about the indents, but idk if that's even a valid complaint honestly
23:12:04FromDiscord<Elegantbeef> It's not
23:12:26FromDiscord<Leftbones> I mean, if you take the brackets out of C++ and it's still readable, were the brackets really necessary
23:12:26FromDiscord<Mustache Man> people just complain about writing neat code, i guess
23:12:33FromDiscord<Elegantbeef> Any properly written code is indistinguishable from whitespace
23:12:52FromDiscord<Leftbones> Old traditions die hard, I guess.
23:12:55FromDiscord<Elegantbeef> And on top of it Nim's whitespace is much better than Python's for instance
23:12:56FromDiscord<Mustache Man> indeed, the best code is no code ahaha
23:13:08FromDiscord<Elegantbeef> Like python has that stupid C pre processor macro `\` feature
23:13:28FromDiscord<leorize> the tabs stuff bit people hard in python so probably some of them remember that
23:13:38FromDiscord<jtv> Yeah I remember that. I do think the one thing I'd change about generics is going back to the more original functional style where type variables were just written 't instead of having to overload []
23:13:39FromDiscord<Elegantbeef> That's how bad their white space operates... you might have to tell the parser "You know this statement carrys on in the second line, but you should know that cause it's a binary operator"
23:13:57FromDiscord<jtv> Or at least consider them parameters and stick them w/ the formals
23:14:11FromDiscord<Elegantbeef> Nim has implicit generics
23:14:12FromDiscord<Elegantbeef> So i dont follow
23:14:29FromDiscord<Recruit_main707> talking about go i guess
23:14:45FromDiscord<jtv> Sure, when I need to disambiguate at a call site, I have to use foo[typeParams](non-type-Params)
23:14:55FromDiscord<jtv> I find the overloading of [] meh.
23:15:06FromDiscord<Elegantbeef> The thing i'd change with Go's generics is make them fucking monomorphic in more cases
23:15:13FromDiscord<leorize> the `[]` in nim does serve a purpose of allowing it to be omitted \:p
23:15:46FromDiscord<leorize> btw you can put the type inside `()`, in which case you always have to specify it
23:16:01FromDiscord<leorize> but it works if that's your jam
23:16:15FromDiscord<Elegantbeef> Nim's got some of the more friendly generic dispatch
23:16:21FromDiscord<jtv> They were forever omitted in every early functional language like ML. You just used them like: myfunc(x: 't, y: 't) ...
23:16:44FromDiscord<jtv> And they were generally inferred of course
23:17:00FromDiscord<huantian> I do like the security of polymorphic generics tho
23:17:01FromDiscord<Elegantbeef> `myFunc(x, y: auto)`
23:17:21FromDiscord<huantian> getting the error at the call site instead of the generics is sometimes annoying↵but ig that's why we have concepts
23:17:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lxC
23:17:35FromDiscord<huantian> (edit) "getting the error at the call site instead of the generics is sometimes annoying↵but ig that's why we have concepts ... " added "to help with it a tad"
23:17:44FromDiscord<Elegantbeef> This sentence is funny↵(@huantian)
23:17:51FromDiscord<Elegantbeef> Generics are polymorphic, so uhhh 😛
23:17:53FromDiscord<jtv> Yeah, I know, the call site is more my issue.
23:18:05FromDiscord<Elegantbeef> You mean the security of constrained generics
23:18:12FromDiscord<jtv> Parametric polymorphism vs. inclusion polymorphism vs ad hoc etc
23:18:14FromDiscord<huantian> yeah
23:18:19FromDiscord<huantian> big words me no understand
23:18:20FromDiscord<jtv> Casting is polymorphism too 🙂
23:18:44FromDiscord<Elegantbeef> With new concepts the error messages should be capable of being nicer and more friendly
23:19:14FromDiscord<Elegantbeef> But really any procedure declared with a concept should check that the variable is only used in a place that matches the concept or with a proc that works generically
23:21:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lxE