<< 27-06-2022 >>

00:00:54NimEventerNew thread by Treeform: Nim 2.0 is already here., see https://forum.nim-lang.org/t/9266
00:32:39*arkurious quit (Quit: Leaving)
01:07:25FromDiscord<ajusa> Puppy doesn't support async and zippy doesn't support streams, I wouldn't say they are 1:1 replacements for existing wrappers
01:07:52FromDiscord<ajusa> But they are better than stdlib for what they currently support, and I am very thankful they exist
01:09:04FromDiscord<Elegantbeef> My thoughts exactly
01:12:47FromDiscord<Elegantbeef> Yea would be nice to get the stdlib to either use a static shippable dependency or do the same thing puppy does
01:13:06FromDiscord<Elegantbeef> Not having to reimplement the code per each platform would make me say the former is better but meh
01:23:32FromDiscord<creikey> Anything like https://pypi.org/project/Pymem/#:~:text=A%20python%20library%20to%20manipulate,memory%20(read%20%2F%20write) pymem for nim? Read into process memory of an application on windows
01:23:53FromDiscord<Elegantbeef> Winim might have that functionality
02:17:04FromDiscord<jan0809> sent a code paste, see https://play.nim-lang.org/#ix=410M
02:17:27FromDiscord<Elegantbeef> You're dereferencing a nil pointer be it `ref` or `ptr`
02:17:31FromDiscord<ynfle> Often an unintilized ref
02:20:07FromDiscord<jan0809> sent a code paste, see https://play.nim-lang.org/#ix=410N
02:20:23FromDiscord<jan0809> (edit) "https://play.nim-lang.org/#ix=410N" => "https://play.nim-lang.org/#ix=410O"
02:21:32FromDiscord<Elegantbeef> is `board` a nilable type
02:21:51FromDiscord<Elegantbeef> is tile\_size \> 0?
02:22:22FromDiscord<jan0809> In reply to @Elegantbeef "is `board` a nilable": its an arramyncer tensor inited with `zeros` initially
02:22:38FromDiscord<jan0809> In reply to @Elegantbeef "is tile\_size \> 0?": its hardcoded to 200
02:23:41FromDiscord<jan0809> `render_tile` works fine and returns an pixie image
02:24:19FromDiscord<Elegantbeef> Which line errors?
02:28:17FromDiscord<jan0809> In reply to @Elegantbeef "Which line errors?": it didnt say that, but i got it now, `render_tile`didnt return anything in case of 0 bc the indent of `return = ` were wrong
02:28:42FromDiscord<Elegantbeef> also you know you can do `result = newImage(...)` and not do `result = im` at the end?
02:30:27FromDiscord<jan0809> In reply to @Elegantbeef "also you know you": where do i iterate the tiles then?
02:30:36FromDiscord<jan0809> https://media.discordapp.net/attachments/371759389889003532/990806324310847498/Download.png
02:30:48FromDiscord<Elegantbeef> The code is otherwise identical
02:31:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=410P
02:31:15FromDiscord<Elegantbeef> sorry `result = newImage(...)`
02:45:12*jmdaemon joined #nim
03:00:06FromDiscord<jan0809> ty
03:18:16FromDiscord<Alea> Why are you using a tensor for the board? Isn't that overkill or something?
03:27:13FromDiscord<ajusa> In reply to @Elegantbeef "Not having to reimplement": I like cosmopolitan for this reason - it does all the cross platform work at the libc level, rather than the OS APIs being called directly
03:27:40FromDiscord<ajusa> So you just write everything using posix APIs, and it maps it to the windows equivalent for pretty much everything
03:37:17FromDiscord<ambient> is nim-taskpool a good solution for work stealing threadpool?
03:37:53FromDiscord<Rika> Did you have any issues with weave?
03:38:35FromDiscord<ambient> yes, it didn't seem to work/was too complex
03:39:16FromDiscord<ambient> like in Rust you have .par_iter(), complexity like weave seems a ton of overkill
03:39:53FromDiscord<ambient> I had some compilation issues that I couldn't solve on a short timeframe directly connected to that library
03:41:01FromDiscord<ambient> there's a lot of apparent ambiquity
03:44:13FromDiscord<jan0809> In reply to @Alea "Why are you using": it is,↵ when i wrote it in pyhon i used numpy arrays bc of the rot90 func that way i can make one move func which just rotates the board (over 4 different) ↵↵and arraymancer tensors seem to be quite close to numpy ndarrays (also theyre as overkill)
04:07:37*noeontheend joined #nim
04:10:07*noeontheend quit (Read error: Connection reset by peer)
04:27:33*noeontheend joined #nim
04:40:08*noeontheend quit (Ping timeout: 255 seconds)
05:48:23*toluene quit (Ping timeout: 246 seconds)
05:51:27*toluene joined #nim
05:59:53*rockcavera quit (Remote host closed the connection)
06:27:46FromDiscord<ambient> wait, does Arraymancer actually make arrays slower. Compared to multidimensional seq, Arraymancer apparently has to calculate striding by default, and without LTO, the compiler can't optimize that kind of stuff away
06:31:47FromDiscord<ambient> iterating 2d loops, you can optimize striding to just one add operation, if you are doing just the indexing, you need more calculation
06:52:14FromDiscord<PyryTheBurger> oops
06:52:16FromDiscord<PyryTheBurger> sent a long message, see http://ix.io/411B
06:54:46FromDiscord<PyryTheBurger> sent a long message, see http://ix.io/411C
06:55:03FromDiscord<PyryTheBurger> nvm
06:55:05FromDiscord<PyryTheBurger> sorry
06:55:09FromDiscord<PyryTheBurger> i figured it out
06:55:09FromDiscord<Elegantbeef> put a `$` before `saveData`
07:06:26*ltriant quit (Ping timeout: 246 seconds)
07:12:28FromDiscord<Girvo> Hello! dumbest question in the world coz its already knock-off time and I wanna go home lol: how to I convince Nim an `array[8, char]` which has `\0` is a cstring to get it to echo? I guess I gotta use a temporary buffer hey
07:16:23FromDiscord<Girvo> Ah screw it, i'll just change it to an actual cstring and throw the size around with it in the queue. never mind haha
07:16:38FromDiscord<Elegantbeef> `cstring myArray[0].addr`
07:17:06FromDiscord<Girvo> @ElegantBeef Ah! man I was close too, I was missing the addr
07:17:14FromDiscord<Girvo> I was trying to do it with a cast lol
07:17:57FromDiscord<Girvo> You're a champion 🙂
07:20:45FromDiscord<Girvo> FreeRTOS queues are now working nicely, sending Nim objects across ESP32 pthreads/FreeRTOS tasks, including sleeping the thread until a message is seen. Yay!
07:24:22*gsalazar joined #nim
07:44:10FromDiscord<j-james> what's an idiomatic way to make a sequence of two different types?
07:44:15FromDiscord<j-james> ...not do that?
07:44:25FromDiscord<Elegantbeef> Object variants
07:44:50FromDiscord<Elegantbeef> https://github.com/alaviss/union exists if you're lazy
08:06:00*crem joined #nim
09:04:29*ltriant joined #nim
09:10:15FromDiscord<mratsim> In reply to @karma_corrections "<@570268431522201601> Got a quick": yes?
09:10:39FromDiscord<Rika> Should have just asked it in the original message…
09:12:44NimEventerNew thread by Dabod: Can I pass different types to static generic parameters?, see https://forum.nim-lang.org/t/9267
09:34:59FromDiscord<eyecon> sent a long message, see http://ix.io/4127
09:39:55FromDiscord<enthus1ast> Maybe overload them taking a file instead a string?
09:46:39FromDiscord<eyecon> I can do that for the user, but I was asking rather for my perspective. Is there anything that allows me to avoid having two almost-same procs, one for the file and one for the string?
09:47:57FromDiscord<enthus1ast> well you could accept proc myProc(foo\: string \| File) then in the proc do the appropriate work for either string or file
09:48:21FromDiscord<enthus1ast> you can check with "when foo is string\:"
09:52:07FromDiscord<enthus1ast> a cheezy way could be to add a proc add(fh\: File, ....) then you must not even change the code
09:52:21FromDiscord<enthus1ast> because file then also have an add
09:52:45FromDiscord<enthus1ast> maybe just add code to close the file but yeah
09:54:55*jmdaemon quit (Ping timeout: 268 seconds)
09:56:08FromDiscord<eyecon> Thanks, that's good
09:56:37FromDiscord<eyecon> sent a code paste, see https://play.nim-lang.org/#ix=4129
10:10:15FromDiscord<tandy> how do i fix `Error: unhandled exception: error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small [SslError]`↵i tried `sslContext=newContext(verifyMode=CVerifyNone)`
10:11:13FromDiscord<tandy> why is httpclient even trying to verify
10:56:05FromDiscord<planetis> I hear reinventing streams basically
11:21:47FromDiscord<soundmodel> Hey, is there some book instead of Nim in Action, which would be free?
11:22:44FromDiscord<soundmodel> In reply to @soundmodel "Hey, is there some": https://ssalewski.de/nimprogramming.html perhaps?
11:28:45*lnxw37 quit (Ping timeout: 256 seconds)
11:30:56FromDiscord<xflywind> In reply to @soundmodel "Hey, is there some": Yeah https://github.com/xflywind/awesome-nim#books except nim in action
12:36:51*xet7 joined #nim
13:25:03*arkurious joined #nim
13:27:45*rockcavera joined #nim
13:27:45*rockcavera quit (Changing host)
13:27:45*rockcavera joined #nim
13:38:46*xet7 quit (Ping timeout: 268 seconds)
14:07:35*ltriant quit (Ping timeout: 255 seconds)
14:24:23*noeontheend joined #nim
14:26:43*noeontheend quit (Remote host closed the connection)
14:27:19*noeontheend joined #nim
14:30:26*xet7 joined #nim
14:37:03FromDiscord<halc> sent a code paste, see https://play.nim-lang.org/#ix=412Y
14:37:16FromDiscord<halc> so my question is, is there a more foolproof way to check if the file is being checked in config.nims
14:37:31FromDiscord<halc> since `defined(nimsuggests)` doesn't seem to be working?
14:37:53FromDiscord<halc> (edit) "https://play.nim-lang.org/#ix=412Y" => "https://play.nim-lang.org/#ix=412Z"
14:38:15FromDiscord<hotdog> @halc does it work if you put the if statement in a `when not defined(nimsuggest):` block?
14:38:40FromDiscord<halc> let's see
14:39:58FromDiscord<halc> still not working
14:40:00FromDiscord<halc> sent a code paste, see https://play.nim-lang.org/#ix=4130
14:40:37FromDiscord<xflywind> What's yor Nim version?
14:40:49FromDiscord<xflywind> I fixed a issue related on devel => https://github.com/nim-lang/Nim/issues/8219
14:40:57FromDiscord<halc> sent a code paste, see https://play.nim-lang.org/#ix=4131
14:41:27FromDiscord<xflywind> (edit) "a" => "an"
14:41:56FromDiscord<halc> is `nimsuggest` defined when using `nim check`?
14:43:00FromDiscord<xflywind> Can you try it with latest Nim? If you use choosenim, try `choose devel` or `choosenim update devel`.
14:43:21FromDiscord<xflywind> See also https://github.com/nim-lang/Nim/pull/19641
14:43:59FromDiscord<xflywind> Imo nimsuggest will call nim check when you save the nimscript file.
14:47:02FromDiscord<halc> @xflywind any reason why you deleted your messages?
14:47:09FromDiscord<halc> I was about to update to devel
14:47:53FromDiscord<xflywind> Can you send the screenshot showing how it doesn't work? I'm reproducing it.
14:50:18FromDiscord<xflywind> I use nimsaem's extension in vscode.
14:51:21FromDiscord<halc> this is the one I'm using https://marketplace.visualstudio.com/items?itemName=kosz78.nim
14:51:47FromDiscord<halc> but running `nim check` manually isn't working either https://media.discordapp.net/attachments/371759389889003532/990992845689221150/Code_Ky3jRWdMYE.png
14:54:05FromDiscord<halc> it only works when I comment out the check entirely
14:55:00FromDiscord<halc> In reply to @flywind "Can you send the": by it not working I mean that the extension doesn't point out anything is wrong (as in the screenshot)
14:55:19FromDiscord<xflywind> Yeah, I see
14:57:11FromDiscord<halc> for the record, I just tried with 1.7.1, same issue
14:58:08FromDiscord<halc> https://media.discordapp.net/attachments/371759389889003532/990994446545977435/unknown.png
14:59:23FromDiscord<halc> I mean it's not a big deal, I can just comment out the check, I'd just like to know if there's an alternative way to check for nimsuggest
15:02:17FromDiscord<xflywind> `defined(nimcheck)` is supposed to work. But it doesn't work in nimscript. It seems to be a bug.
15:08:19FromDiscord<xflywind> In reply to @halc "I mean it's not": You can also open an issue.
15:08:28*ltriant joined #nim
15:13:42*ltriant quit (Ping timeout: 272 seconds)
15:15:09FromDiscord<eyecon> In reply to @planetis "I hear reinventing streams": That's it, thank you for reminding me, I wanted to check if I could use a general stream implementation, I didn't see std/streams before. It is a better solution.
15:17:17FromDiscord<soundmodel> Anyone have input as to how essential macros and metaprogramming are?
15:18:08FromDiscord<enthus1ast> not essential for coding in nim, but it can save you alot of code, also good for runtime speed when you could do some lifting on compile time
15:19:17FromDiscord<enthus1ast> but its a very cool (and sometimes a little complex) part of nim
15:19:38FromDiscord<soundmodel> A book chapter made it seem like for leveraging DSL aspects it could be a crucial style of Nim
15:20:55FromDiscord<xflywind> https://dev.to/beef331/demystification-of-macros-in-nim-13n8 is good learning material for macros in Nim.
15:26:47*xet7 quit (Ping timeout: 255 seconds)
15:27:22FromDiscord<xflywind> In reply to @halc "I mean it's not": I made a quick dirty patch in nim.nim, it works
15:27:25FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/991001814918910052/unknown.png
15:28:12FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/991002012076355644/unknown.png
15:28:57FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/991002203110121483/unknown.png
15:31:21FromDiscord<exelotl> something about there being a file called nim.nim is really funny
15:34:58FromDiscord<potatoxel> nimmy nim
15:37:58FromDiscord<xflywind> yeah, thats why the executable is called nim https://github.com/nim-lang/Nim/blob/devel/compiler/nim.nim
15:38:25FromDiscord<xflywind> Its the main program when compiling the Nim compiler.
15:45:53FromDiscord<Phil> In reply to @potatoxel "nimmy nim": New code rapper with his alter ego slim nimmy
15:53:50*arkurious quit (Ping timeout: 240 seconds)
15:58:42*xet7 joined #nim
16:04:19FromDiscord<eyecon> Arrrgggghhhh 💀
16:04:33FromDiscord<eyecon> Is there no way to switch endianness in std/streams?
16:05:33ehmry`Error: unhandled exception: Success [Exception]` - thanks glib
16:06:28FromDiscord<eyecon> FML
16:07:08*arkurious joined #nim
16:08:34FromDiscord<xflywind> In reply to @eyecon "Is there no way": Yes
16:08:57FromDiscord<xflywind> See discussions in https://github.com/nim-lang/Nim/issues/12790
16:08:59FromDiscord<eyecon> In reply to @flywind "Yes": Yes, there is or Yes, there isn't?
16:10:00FromDiscord<eyecon> In reply to @flywind "See discussions in https://github.com/nim-lang/Nim/": Thanks, terrible to know there isn't
16:10:18FromDiscord<xflywind> Sorry, it should be "No, there isn't".
16:11:18*ltriant joined #nim
16:11:18FromDiscord<eyecon> No problems, it was clear after seeing the link, thanks a lot
16:11:40FromDiscord<xflywind> You are welcome.
16:17:58*ltriant quit (Ping timeout: 240 seconds)
16:18:06FromDiscord<soundmodel> What does do on a macro def like: macro resetToDecl(val: typed): untyped =
16:18:32*noeontheend quit (Ping timeout: 255 seconds)
16:18:39FromDiscord<soundmodel> (edit) "on" => "in"
16:18:41*LuxuryMode quit (Quit: Connection closed for inactivity)
16:20:20*xet7 quit (Ping timeout: 268 seconds)
16:45:17FromDiscord<d4rckh> yes
16:45:46FromDiscord<d4rckh> is there any other keybind i can hook other than CTRL-C in a command line app?
16:49:23FromDiscord<Require Support> not sure if this is possible or not, but I would like to create an object with a field that allows any proc with any number of parameters.. is this possible?
16:49:43FromDiscord<d4rckh> i doubt
16:52:30*wallabra quit (Ping timeout: 272 seconds)
16:53:58*arkurious quit (Ping timeout: 240 seconds)
16:54:50FromDiscord<exelotl> why do you want that? (we might be able to suggest another way)
16:57:27FromDiscord<m4ul3r> In reply to @d4rckh "is there any other": Some where in the nim manual / docs I read that it does not support unix signals and ctrl-c was the only one supported 😔
16:57:34FromDiscord<Require Support> im trying to create my own implementation of getprocaddress and getmodulehandle win apis.. and I wanna find a way to speed up the process of resolving a long list of apis possible through a for loop... i know about dynlib and all that stuff, there is no good reason to do this im just learning nim
16:58:37FromDiscord<Require Support> In reply to @exelotl "why do you want": im trying to create my own implementation of getprocaddress and getmodulehandle Winapis.. and I wanna find a way to speed up the process of resolving a long list of apis maybe through a for loop? i know about dynlib and all that stuff, there is no good reason to do this im just learning what i can do with nim
16:59:17FromDiscord<Rika> you can technically hook to ctrl+\ which is sigquit, but only posix, and i dont recall of any caveats since sometime there are for some signals
16:59:47FromDiscord<Rika> In reply to @m4ul3r "Some where in the": its "supported" but not on windows naturally
17:01:41FromDiscord<Phil> sent a long message, see http://ix.io/413w
17:02:26FromDiscord<Phil> I hate this heat, makes thinking way too hard.
17:02:59FromDiscord<d4rckh> In reply to @Rika "its "supported" but not": ouch. well my programs usually does things like requesting and sometimes these requests get stuck when awaiting for a response
17:03:34FromDiscord<d4rckh> so i want to kind of way of cancelling these requests
17:04:10FromDiscord<d4rckh> i used to hook CTRL-C and check if the program is waiting for a response, if yes, cancel that, otherwise exit the program
17:04:19FromDiscord<d4rckh> but it does not work on windows
17:04:25FromDiscord<d4rckh> (edit) "but it does not work on windows ... " added "which is sad"
17:04:49*noeontheend joined #nim
17:06:27FromDiscord<m4ul3r> Ah this is what I was referring to: https://nim-lang.org/docs/nimc.html#signal-handling-in-nim↵When I said unix, i should have said posix
17:06:54FromDiscord<Phil> Wait actually. My problem can never occur upon creating an entry. Only when updating... well that just shifted the problem around I guess
17:06:56*arkurious joined #nim
17:08:53FromDiscord<d4rckh> i was thinking about maybe ESC or CTRL+Z
17:08:57FromDiscord<d4rckh> (edit) "maybe" => "hooking"
17:09:02FromDiscord<d4rckh> both of these would work tbh
17:14:19*xet7 joined #nim
17:23:32*xet7 quit (Ping timeout: 272 seconds)
17:23:48*noeontheend quit (Ping timeout: 276 seconds)
17:25:58*noeontheend joined #nim
17:28:47FromDiscord<xflywind> Bakcticks don't seem to work on Nim forum?
17:28:50FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/991032368104103986/unknown.png
17:29:58FromDiscord<xflywind> Ah, it needs spaces from other words
17:31:52NimEventerNew thread by Xflywind: If imported name conflicts with Nim keyword, what would you call it?, see https://forum.nim-lang.org/t/9268
17:55:19*ltriant joined #nim
17:57:48FromDiscord<d4rckh> what happens if you marshal objects that contain references of other things?
17:57:50FromDiscord<d4rckh> (edit) "things?" => "objects?"
17:58:20FromDiscord<d4rckh> for example i have a big ref object that has a sequence of other ref objects that contain a ref of the root object
17:58:41FromDiscord<d4rckh> if i marshal only that sequence
17:58:58FromDiscord<d4rckh> (edit) "if i marshal only that sequence ... " added "of refs and then unmarshal it, what would happen to those refs?"
17:59:07FromDiscord<d4rckh> (edit) "refs?" => "refs to the big object?"
18:00:25*ltriant quit (Ping timeout: 248 seconds)
18:01:35FromDiscord<d4rckh> can i somehow reset that reference to the root object and reset it when i unmarshal?
18:18:24*wallabra joined #nim
18:21:17FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=4140
18:21:23FromDiscord<d4rckh> This triggers a SIGSEGV 🤔
18:31:05FromDiscord<jan0809> marshal is something like pickle in python i assume?
18:32:04FromDiscord<jan0809> the same thing that ruby uses for serializing stuff? or is the name an incidence
18:33:24FromDiscord<d4rckh> yes, it serializes things
18:34:41FromDiscord<ynfle> Why use that and not JSON?
18:35:16FromDiscord<halc> sent a code paste, see https://play.nim-lang.org/#ix=4146
18:36:48FromDiscord<d4rckh> yes Client is a ref object
18:36:59FromDiscord<d4rckh> i want to copy the object of client
18:37:03FromDiscord<d4rckh> (edit) "i want to copy the object of client ... " added "into tempClient"
18:37:22FromDiscord<d4rckh> i think i should initialize tempClient to something?
18:37:53FromDiscord<halc> ah, in that case, you should first create a new Client, yes
18:38:29FromDiscord<halc> just a line with `new tempClient` should do
18:39:59FromDiscord<halc> there's probably a nicer way to do it, but I'm new to nim
18:45:56FromDiscord<halc> sent a code paste, see https://play.nim-lang.org/#ix=414b
19:11:09FromDiscord<d4rckh> Client() seems to work
19:11:30FromDiscord<d4rckh> but `new Client` seems more elegant
19:16:13*noeontheend quit (Read error: Connection reset by peer)
19:17:32FromDiscord<d4rckh> ok now theres another problem where i want to backup a sequence that contains objects that reference the clients (which are also backed up )😅
19:18:33*noeontheend joined #nim
19:20:23FromDiscord<d4rckh> okay i think ill have to create separate object types, god
19:22:44*wallabra_ joined #nim
19:25:05*wallabra quit (Ping timeout: 244 seconds)
19:25:06*wallabra_ is now known as wallabra
19:27:55*ltriant joined #nim
19:32:56*ltriant quit (Ping timeout: 255 seconds)
19:45:23FromDiscord<SirOlaf> Is expandArc supposed to expand nested functions as well?
19:46:01FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=414s
19:46:08FromDiscord<SirOlaf> (edit) "https://play.nim-lang.org/#ix=414s" => "https://play.nim-lang.org/#ix=414t"
19:48:06FromDiscord<SirOlaf> Guess it's unneeded because it works on inner when passed to it instead of outer
19:49:45reversem3[m]Where did find information on export , when and where to use it https://nim-lang.org/docs/manual.html
19:51:39reversem3[m] * Where can I find information on export , when and where to use it https://nim-lang.org/docs/manual.html
19:57:38FromDiscord<ynfle> If, for example, your type "extends" a table, you can `export tables` to give a user that imports your module the ability to use procs from tables
20:00:33FromDiscord<soundmodel> Anyone know what to think about "multi-paradigm" in the context of Nim? I'm having some difficulties in grasping, what could be meant by "idiomatic Nim". In C the main style is imperative. In Python I've found it's imperative with the option of "lightweight" OO and functional concepts.
20:03:39FromDiscord<Phil> Nim is very much imperative with functional and absolutely minimal OO bits strewn in
20:03:53FromDiscord<Phil> (edit) "imperative" => "procedural"
20:04:28FromDiscord<soundmodel> In reply to @Isofruit "Nim is very much": The book has quite a bit about OO though: https://ssalewski.de/nimprogramming.html#_object_orientated_programming_and_inheritance
20:05:34FromDiscord<soundmodel> (edit) "though:" => "though, e.g.:"
20:06:05FromDiscord<Phil> Sure, but depending on what you do, you can almost forego it entirely. The only extent to which I've been dealing with OO was the ORM in my webapplication and that only because it was designed that way. Could've just as easily been designed by writing a concept. But since I'm not about to rewrite an entire ORM I took what was given.
20:08:01FromDiscord<soundmodel> and somewhere else I saw some bit that looked very similar to Haskell's guards
20:08:20FromDiscord<Phil> I found myself structuring my code pretty much never around OO concerns. It was always about where do I get proc X/how do I create it
20:09:36FromDiscord<Phil> As an example of why functional stuff is there but not quite as nicely done:↵sequtils, the lib for map/any/filter etc. appears to have some issues with copying things around a lot in memory where it doesn't need to
20:10:05FromDiscord<Phil> So a lot of the time its preferred to do for in loops
20:10:27FromDiscord<Phil> Though the above only matters for more high performance situation than matter to me regarding webdev
20:10:31FromDiscord<soundmodel> I was thinking of starting to write Nim as if it was C
20:10:50FromDiscord<soundmodel> but this could be the wrong way, if the language was Python-like
20:10:55FromDiscord<Phil> Should work, as they're both procedural.
20:11:13FromDiscord<Phil> But I can't fully judge that as I haven't written C
20:11:16FromDiscord<soundmodel> because that'd miss what's more useful in Python
20:12:46FromDiscord<Phil> OO generally doesn't have a massive amount of features in nim. For example, it's pretty hard to tie a function to an object unless you explicitly build it that way (store a proc in an object field)
20:13:33FromDiscord<soundmodel> e.g. that one's not forced to use struct-like things to for pseudo-OO
20:13:44FromDiscord<soundmodel> (edit) removed "to"
20:14:17*noeontheend quit (Ping timeout: 248 seconds)
20:14:44FromDiscord<Phil> You'd need to get more precise on that, I can't really associate anything with the word choice
20:15:46FromDiscord<soundmodel> Some would not consider this idiomatic use of C: https://stackoverflow.com/questions/44102324/emulating-classes-in-c-using-structs
20:17:26FromDiscord<Phil> Since I've never written C I'm having trouble parsing that, but he's essentially making a struct with fields that he throws procs into?
20:19:31FromDiscord<soundmodel> The question is more about, what's the "intended style" (i.e. idiomatic) of a language.
20:20:55*FromDiscord quit (Remote host closed the connection)
20:21:08*FromDiscord joined #nim
20:22:44FromDiscord<soundmodel> So in that sense doing OO in C is not idiomatic, if C is not an OO language.
20:23:05FromDiscord<soundmodel> (edit) "So in that sense doing OO in C is not idiomatic, if C is not an OO language. ... " added "And while it may "work", it's not a designed use-case."
20:23:38FromDiscord<soundmodel> (edit) "And while it may" => "It might"
20:23:47FromDiscord<soundmodel> (edit) "So in that sense doing OO in C is not idiomatic, if C is not an OO language. It might "work", ... it's" added "but"
20:24:55FromDiscord<Phil> Hmm personally I'd see it as similar to C; but weaker. There is some intended use for OO. Method-call-syntax and the existence of inheritance make that clear. It does make sense to only use those when needed though, rather than whenever convenient.
20:25:48FromDiscord<Phil> But that's solely my webdev perspective
20:26:28FromDiscord<soundmodel> some source said that C's "pseudo-OO" is similar to "OO in JS"
20:27:09FromDiscord<Zectbumo> I would say that's not accurate.
20:27:29FromDiscord<Andreas> In reply to @soundmodel "some source said that": no, JS is Prototypal and dynamic.. no
20:27:32FromDiscord<soundmodel> if that was the case then that could suggest what Nim's "OO" is
20:27:38FromDiscord<soundmodel> since it compiles to C and JS
20:28:20FromDiscord<Zectbumo> I think at this point you have to stand back and define what you think "OO" means
20:28:39FromDiscord<soundmodel> I'm just asking what it means in Nim
20:28:52FromDiscord<soundmodel> so that I know whether to start writing it like it was Java or C or Python
20:28:58FromDiscord<soundmodel> based on my earlier experience
20:29:11FromDiscord<SirOlaf> Nim doesn't have real OOP because it doesn't have vtables
20:29:23FromDiscord<SirOlaf> Just has functions associated with types
20:30:04FromDiscord<Zectbumo> which means it's not going to be like Python
20:30:07FromDiscord<Phil> Java is OO on steroids with the steroids.↵Nim has something that can pass somewhat as OO to be used in some cases where otherwise your syntax would get uncomfortable.↵Python, depending on your usecase, can be very OO or not at all.
20:30:18FromDiscord<Phil> (edit) "Java is OO on steroids with the ... steroids.↵Nim" added "steroids taking"
20:31:23FromDiscord<Phil> In webdev, python can be very strongly OO if you use Django since Django offers a lot of very valuable features in OO
20:31:38FromDiscord<Zectbumo> @soundmodel given your choices, nim wouldn't be like Python, so you can rule that out. OO is not ignored/absent like it is C, but it's not like Java. So between C and Java then.
20:31:39FromDiscord<soundmodel> I don't know but the https://ssalewski.de/nimprogramming.html#_object_orientated_programming_and_inheritance looks more like a functional language than OO
20:31:46FromDiscord<soundmodel> since it's functions with types
20:31:58FromDiscord<Andreas> @soundmodel usecase - whats yours btw ?
20:32:11FromDiscord<soundmodel> it says in the book that Nim is intended for all types of programs
20:32:28FromDiscord<soundmodel> but this confuses me, because all the languages I've used have a distinct "idiomatic way" of using the language
20:32:40FromDiscord<soundmodel> that's what distinguishes "ugly Haskell" from "elegant Haskell"
20:33:14FromDiscord<soundmodel> or "C-like Python" from idiomatic Python
20:34:33FromDiscord<Zectbumo> Nim in Action covers some of these
20:34:49FromDiscord<soundmodel> so e.g. if I was learning Python I'd consider that I need to use classes right away
20:34:56FromDiscord<🐒🧠br4n_d0n> I'd suggest to stop worrying about what's the "correct" way and just do what you feel most comfortable with. If at that time you run into issues, then try to take another approach. Nim, to me, seems fairly flexible in this regard
20:35:00FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=414E
20:35:20FromDiscord<soundmodel> because writing Python like it was C is about missing all the extra bits that Python offers
20:35:44FromDiscord<exelotl> idiomatic Nim is just procedural code. You don't use "OOP" (in the sense of, inheritance and dynamic dispatch) unless you have a real need for it
20:36:07FromDiscord<Andreas> In reply to @soundmodel "or "C-like Python" from": hmm, look some people try nim because for things they want to do the combination of Python and maybe a C-extension - if one needs performance - maybe not work the way they expected. So nim offers a familiar syntax and superb performance - if you need it...
20:36:20FromDiscord<Zectbumo> @soundmodel I like where you are going with this
20:38:16FromDiscord<Zectbumo> Another pattern I've seen in Nim is passing some flag that changes it's fields. Like the Shape, Rect, Circle example.
20:38:50FromDiscord<soundmodel> In reply to @br4n_d0n "I'd suggest to stop": But in e.g. Python the case would be to model a thing as a class vs to model it as some sort of iterator thing. And in Python a class for a "stateful thing" could be more reasonable as a class.
20:39:07FromDiscord<soundmodel> but this would not be the case in "write it as if it was C"
20:39:18FromDiscord<d4rckh> What do the pragmas that functions add mean?
20:41:59FromDiscord<soundmodel> and in Haskell it has seemed like common to avoid "imperative patterns", because they're "hacks" in the functional paradigm
20:42:13*tiorock joined #nim
20:42:13*tiorock quit (Changing host)
20:42:13*tiorock joined #nim
20:42:13*rockcavera is now known as Guest8985
20:42:14*Guest8985 quit (Killed (sodium.libera.chat (Nickname regained by services)))
20:42:14*tiorock is now known as rockcavera
20:42:14FromDiscord<soundmodel> emulatable, but not idiomatic
20:46:10FromDiscord<Elegantbeef> You mean object variants?
20:46:42FromDiscord<Elegantbeef> Oh jeez the matrix bridge has been a little slow
20:46:53FromDiscord<Elegantbeef> You mean object variants by this eh?↵(@Zectbumo)
20:47:06FromDiscord<soundmodel> and it still says that Nim is multi-paradigm
20:47:07FromDiscord<Zectbumo> yes, thank you. object variants
20:47:14FromDiscord<soundmodel> but now it sounds like it's more like Rust perhaps
20:47:19FromDiscord<Elegantbeef> Idiomatic Nim is procedural
20:47:26FromDiscord<Elegantbeef> But you can write it how you want
20:47:51FromDiscord<SirOlaf> Gonna experience least resistance with procedural though
20:49:00FromDiscord<Zectbumo> but I think what soundmodel is getting at is he's not interested in writing "how he wants" but how the "nim way" is
20:49:03FromDiscord<soundmodel> yes, but I perceive that it gives functional and OO concepts a very difference sense than in Python for example
20:49:26FromDiscord<soundmodel> since they're essentially still for just "cleaning a bit of procedural", rather than replacing the fundamental paradigm
20:50:37FromDiscord<Zectbumo> the "nim way" which really means the least amount of people in the nim community that will frown upon your code
20:50:38FromDiscord<soundmodel> well based on my observations in the Python community, one will not be viewed delightfully if one decides to break some very established stylistical things
20:51:07FromDiscord<soundmodel> even when the language allows writing in alternative styles
20:51:26FromDiscord<Andreas> In reply to @soundmodel "well based on my": these days the style-police is everywhere
20:52:27FromDiscord<Zectbumo> I haven't been around long enough to see the change in style-police but from what I've experienced so far is that in nim, it's so flexible, you make your own home the way you like it.
20:52:27FromDiscord<Elegantbeef> I mean i'm going to bitch and moan if i have to PR to someone that insists on writing code that is stylistic annoying to me but generally the "Nim way" is the least restrictive and cleanest
20:53:01FromDiscord<soundmodel> In reply to @soundmodel "well based on my": like https://peps.python.org/pep-0008/
20:53:32FromDiscord<Elegantbeef> There is Nep1
20:53:48FromDiscord<Zectbumo> https://nim-lang.org/docs/nep1.html
20:53:50FromDiscord<SirOlaf> Mostly talks about naming
20:53:54FromDiscord<Elegantbeef> But you do not have to abide by it and the only people that are going to get annoyed that you dont are people that will PR
20:54:07FromDiscord<Elegantbeef> Naming is all that really matters
20:54:33FromDiscord<Elegantbeef> Unless you're maintaining the API the internal design really doesnt matter
20:54:57FromDiscord<whisper> What is the most mature library for scraping?
20:55:20FromDiscord<Elegantbeef> https://nimble.directory/search?query=scraping
20:55:35FromDiscord<Elegantbeef> Whenever i need to scrape i just use httpclient + html parsing
20:55:54FromDiscord<dom96> In reply to @whisper "What is the most": `htmlparser` module in the stdlib works pretty well
20:56:51FromDiscord<SirOlaf> puppy is pretty good too
20:57:14*ltriant joined #nim
20:58:14FromDiscord<Zectbumo> I'm going to do an experiment poll for soundmodel. give your emote votes please:↵👩🏿‍🦽 `"hello world".echo`↵🦸‍♂️ `echo "hello world"`↵💅 `echo("hellow world")`
20:58:34FromDiscord<Elegantbeef> Imagine not having polls built into your chat client!
20:58:58FromDiscord<Elegantbeef> The only correct answer is the last due to accidentally writing `hellow` as i typically do
20:59:14FromDiscord<Zectbumo> 😆
20:59:29FromDiscord<eyecon> Btw I salvaged by cbor-with-streams approach with endians2, long live Status
21:00:02FromDiscord<eyecon> In reply to @flywind "See discussions in https://github.com/nim-lang/Nim/": Thanks again
21:01:44FromDiscord<🐒🧠br4n_d0n> In reply to @Zectbumo "I'm going to do": There are more versions↵https://nim-lang.org/blog/2021/11/15/zen-of-nim.html#function-application
21:01:50*ltriant quit (Ping timeout: 240 seconds)
21:02:08FromDiscord<🐒🧠br4n_d0n> 8 in all it seems
21:04:47FromDiscord<Zectbumo> sorta 8, but not really since you need different use cases. I think I covered the base models for echo besides the unnecessary splitting of the literal
21:06:50FromDiscord<Zectbumo> In reply to @Elegantbeef "Imagine not having polls": does matrix have polls built in?
21:07:07*jmdaemon joined #nim
21:07:11FromDiscord<Elegantbeef> Yes, well atleast the element client has it implemented
21:07:58FromDiscord<Zectbumo> 🛸
21:08:14FromDiscord<Zectbumo> high tech
21:08:33FromDiscord<🐒🧠br4n_d0n> Beef, anyway to change the assigned account name color?
21:08:41FromDiscord<🐒🧠br4n_d0n> (edit) "anyway" => "any way"
21:08:46FromDiscord<Elegantbeef> Fuck if i know
21:09:13FromDiscord<Elegantbeef> Afaik it's based off your name
21:09:33FromDiscord<🐒🧠br4n_d0n> ... dumb
21:09:43FromDiscord<Elegantbeef> Cause the color of your name matters?
21:10:21FromDiscord<🐒🧠br4n_d0n> Not really, but it clashes with he green color Element uses and bothers my eyes
21:11:09FromDiscord<Elegantbeef> You probably could make a css to modify just your name
21:14:36FromDiscord<jan0809> In reply to @Zectbumo "does matrix have polls": atleast reactions
21:16:38reversem3[m]<FromDiscord> "<ynfle> If, for example, your..." <- Oh , ok so let me see if I understand this. You only have to use export when you actually exporting a function for someone else to use? So I don't need to export anything if , say I am only creating a web app?
21:17:15FromDiscord<Elegantbeef> Export and the export marker are the equivalent to public in other languages
21:17:33FromDiscord<jan0809> is there a bridge here
21:17:43FromDiscord<jan0809> me realizing stuff
21:17:45FromDiscord<Elegantbeef> There are 2
21:17:51FromDiscord<Elegantbeef> I'm on matrix and there is also irc
21:18:20FromDiscord<Zectbumo> sent a long message, see http://ix.io/414N
21:18:28FromDiscord<Elegantbeef> `var i = 8u8`
21:18:36FromDiscord<Elegantbeef> The only correct way
21:19:11FromDiscord<Zectbumo> (edit) "http://ix.io/414N" => "http://ix.io/414O"
21:19:46FromDiscord<d4rckh> First or last
21:19:50FromDiscord<d4rckh> Not very sure
21:20:08FromDiscord<d4rckh> I'll go with first 😑
21:20:18FromDiscord<Elegantbeef> Shame
21:21:55FromDiscord<jan0809> sent a code paste, see https://play.nim-lang.org/#ix=414P
21:22:05FromDiscord<jan0809> (edit) "https://play.nim-lang.org/#ix=414P" => "https://play.nim-lang.org/#ix=414Q"
21:22:49FromDiscord<Elegantbeef> So i can say that C is just the worst
21:24:01FromDiscord<halc> In reply to @Elegantbeef "`var i = 8u8`": this but I don't like ignoring the existence of `8'u8`
21:24:12FromDiscord<Elegantbeef> Sucks to suck
21:29:44FromDiscord<halc> 8u8 looks too similar to 0x0 even though it's specifying a type rather than a numbering system, I therefore favour 8'u8
21:30:02FromDiscord<Elegantbeef> I disagree but you do you
21:31:23FromDiscord<Zectbumo> In reply to @halc "this but I don't": added
21:33:55*LuxuryMode joined #nim
21:44:26FromDiscord<!Patitotective> In reply to @Zectbumo "next poll. cast your": you chose a beef emoji on purpose, did you?
21:44:45FromDiscord<!Patitotective> In reply to @halc "this but I don't": i do
21:56:19FromDiscord<d4rckh> In reply to @Elegantbeef "Shame": 8u8 is also fine
21:56:49FromDiscord<d4rckh> But specifying uint8 in the type makes it a bit more readable
21:57:35FromDiscord<d4rckh> I think 8u8 would be better in case you pass it to procs like doSomething(8u8)
21:57:47FromDiscord<d4rckh> Actually 8u8 might be best
21:57:54FromDiscord<!Patitotective> yes
21:59:51FromDiscord<Zectbumo> sent a long message, see http://ix.io/414W
22:00:10FromDiscord<d4rckh> 8'u8 looks like you are proving minutes
22:00:17FromDiscord<d4rckh> (edit) "proving" => "providing"
22:00:35FromDiscord<d4rckh> In reply to @Zectbumo "poll: 🧮 `bars[0 ..": First
22:00:48FromDiscord<d4rckh> No discussion
22:01:00FromDiscord<!Patitotective> In reply to @Zectbumo "poll: 🧮 `bars[0 ..": I wouldn't write spaces around `..`↵Like `bars[0..^1]`
22:01:12FromDiscord<Elegantbeef> `bars.toOpenArray(0, bars.len)`
22:02:16FromDiscord<d4rckh> In reply to @Elegantbeef "`bars.toOpenArray(0, bars.len)`": Why this over [0..^1]?
22:02:35FromDiscord<d4rckh> It's easier to understand imo with slices
22:02:59FromDiscord<Elegantbeef> Non copying
22:03:17FromDiscord<d4rckh> So it would be more memory efficient?
22:03:23FromDiscord<Zectbumo> In reply to @Elegantbeef "`bars.toOpenArray(0, bars.len)`": added (with bars.high)
22:07:27FromDiscord<d4rckh> I kind of like these little quizzes. Learning a new thing here and there
22:07:32FromDiscord<Zectbumo> In reply to @Patitotective "I wouldn't write spaces": I was going to do the combos for `[l..h]` vs `[l .. h]` but the list exploded. best kept for a later whitespace poll.
22:08:06FromDiscord<🐒🧠br4n_d0n> I don't quite understand beef's method
22:08:34FromDiscord<Elegantbeef> Openarrays are Nim's free slices that do not allocate
22:09:45FromDiscord<🐒🧠br4n_d0n> So these other arrays are doing heap allocation?
22:10:08FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=414Y
22:10:22FromDiscord<Elegantbeef> No it's compiler magic
22:19:25FromDiscord<Zectbumo> In reply to @Patitotective "I wouldn't write spaces": that, and I didn't want to lead a beginner that may be reading this astray since `..^` is: "A shortcut for .. ^ to avoid the common gotcha that a space between '..' and '^' is required."
22:26:57FromDiscord<!Patitotective> is `float.high` the equivalent of `FLT_MAX` in c++?
22:45:08*ltriant joined #nim
22:47:01*noeontheend joined #nim
22:55:51*rez joined #nim
23:12:12*wallabra quit (Ping timeout: 276 seconds)
23:43:41*rez quit (Quit: l8r)