00:00:54 | NimEventer | New 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:25 | FromDiscord | <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:52 | FromDiscord | <ajusa> But they are better than stdlib for what they currently support, and I am very thankful they exist |
01:09:04 | FromDiscord | <Elegantbeef> My thoughts exactly |
01:12:47 | FromDiscord | <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:06 | FromDiscord | <Elegantbeef> Not having to reimplement the code per each platform would make me say the former is better but meh |
01:23:32 | FromDiscord | <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:53 | FromDiscord | <Elegantbeef> Winim might have that functionality |
02:17:04 | FromDiscord | <jan0809> sent a code paste, see https://play.nim-lang.org/#ix=410M |
02:17:27 | FromDiscord | <Elegantbeef> You're dereferencing a nil pointer be it `ref` or `ptr` |
02:17:31 | FromDiscord | <ynfle> Often an unintilized ref |
02:20:07 | FromDiscord | <jan0809> sent a code paste, see https://play.nim-lang.org/#ix=410N |
02:20:23 | FromDiscord | <jan0809> (edit) "https://play.nim-lang.org/#ix=410N" => "https://play.nim-lang.org/#ix=410O" |
02:21:32 | FromDiscord | <Elegantbeef> is `board` a nilable type |
02:21:51 | FromDiscord | <Elegantbeef> is tile\_size \> 0? |
02:22:22 | FromDiscord | <jan0809> In reply to @Elegantbeef "is `board` a nilable": its an arramyncer tensor inited with `zeros` initially |
02:22:38 | FromDiscord | <jan0809> In reply to @Elegantbeef "is tile\_size \> 0?": its hardcoded to 200 |
02:23:41 | FromDiscord | <jan0809> `render_tile` works fine and returns an pixie image |
02:24:19 | FromDiscord | <Elegantbeef> Which line errors? |
02:28:17 | FromDiscord | <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:42 | FromDiscord | <Elegantbeef> also you know you can do `result = newImage(...)` and not do `result = im` at the end? |
02:30:27 | FromDiscord | <jan0809> In reply to @Elegantbeef "also you know you": where do i iterate the tiles then? |
02:30:36 | FromDiscord | <jan0809> https://media.discordapp.net/attachments/371759389889003532/990806324310847498/Download.png |
02:30:48 | FromDiscord | <Elegantbeef> The code is otherwise identical |
02:31:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=410P |
02:31:15 | FromDiscord | <Elegantbeef> sorry `result = newImage(...)` |
02:45:12 | * | jmdaemon joined #nim |
03:00:06 | FromDiscord | <jan0809> ty |
03:18:16 | FromDiscord | <Alea> Why are you using a tensor for the board? Isn't that overkill or something? |
03:27:13 | FromDiscord | <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:40 | FromDiscord | <ajusa> So you just write everything using posix APIs, and it maps it to the windows equivalent for pretty much everything |
03:37:17 | FromDiscord | <ambient> is nim-taskpool a good solution for work stealing threadpool? |
03:37:53 | FromDiscord | <Rika> Did you have any issues with weave? |
03:38:35 | FromDiscord | <ambient> yes, it didn't seem to work/was too complex |
03:39:16 | FromDiscord | <ambient> like in Rust you have .par_iter(), complexity like weave seems a ton of overkill |
03:39:53 | FromDiscord | <ambient> I had some compilation issues that I couldn't solve on a short timeframe directly connected to that library |
03:41:01 | FromDiscord | <ambient> there's a lot of apparent ambiquity |
03:44:13 | FromDiscord | <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:46 | FromDiscord | <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:47 | FromDiscord | <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:14 | FromDiscord | <PyryTheBurger> oops |
06:52:16 | FromDiscord | <PyryTheBurger> sent a long message, see http://ix.io/411B |
06:54:46 | FromDiscord | <PyryTheBurger> sent a long message, see http://ix.io/411C |
06:55:03 | FromDiscord | <PyryTheBurger> nvm |
06:55:05 | FromDiscord | <PyryTheBurger> sorry |
06:55:09 | FromDiscord | <PyryTheBurger> i figured it out |
06:55:09 | FromDiscord | <Elegantbeef> put a `$` before `saveData` |
07:06:26 | * | ltriant quit (Ping timeout: 246 seconds) |
07:12:28 | FromDiscord | <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:23 | FromDiscord | <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:38 | FromDiscord | <Elegantbeef> `cstring myArray[0].addr` |
07:17:06 | FromDiscord | <Girvo> @ElegantBeef Ah! man I was close too, I was missing the addr |
07:17:14 | FromDiscord | <Girvo> I was trying to do it with a cast lol |
07:17:57 | FromDiscord | <Girvo> You're a champion 🙂 |
07:20:45 | FromDiscord | <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:10 | FromDiscord | <j-james> what's an idiomatic way to make a sequence of two different types? |
07:44:15 | FromDiscord | <j-james> ...not do that? |
07:44:25 | FromDiscord | <Elegantbeef> Object variants |
07:44:50 | FromDiscord | <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:15 | FromDiscord | <mratsim> In reply to @karma_corrections "<@570268431522201601> Got a quick": yes? |
09:10:39 | FromDiscord | <Rika> Should have just asked it in the original message… |
09:12:44 | NimEventer | New thread by Dabod: Can I pass different types to static generic parameters?, see https://forum.nim-lang.org/t/9267 |
09:34:59 | FromDiscord | <eyecon> sent a long message, see http://ix.io/4127 |
09:39:55 | FromDiscord | <enthus1ast> Maybe overload them taking a file instead a string? |
09:46:39 | FromDiscord | <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:57 | FromDiscord | <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:21 | FromDiscord | <enthus1ast> you can check with "when foo is string\:" |
09:52:07 | FromDiscord | <enthus1ast> a cheezy way could be to add a proc add(fh\: File, ....) then you must not even change the code |
09:52:21 | FromDiscord | <enthus1ast> because file then also have an add |
09:52:45 | FromDiscord | <enthus1ast> maybe just add code to close the file but yeah |
09:54:55 | * | jmdaemon quit (Ping timeout: 268 seconds) |
09:56:08 | FromDiscord | <eyecon> Thanks, that's good |
09:56:37 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=4129 |
10:10:15 | FromDiscord | <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:13 | FromDiscord | <tandy> why is httpclient even trying to verify |
10:56:05 | FromDiscord | <planetis> I hear reinventing streams basically |
11:21:47 | FromDiscord | <soundmodel> Hey, is there some book instead of Nim in Action, which would be free? |
11:22:44 | FromDiscord | <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:56 | FromDiscord | <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:03 | FromDiscord | <halc> sent a code paste, see https://play.nim-lang.org/#ix=412Y |
14:37:16 | FromDiscord | <halc> so my question is, is there a more foolproof way to check if the file is being checked in config.nims |
14:37:31 | FromDiscord | <halc> since `defined(nimsuggests)` doesn't seem to be working? |
14:37:53 | FromDiscord | <halc> (edit) "https://play.nim-lang.org/#ix=412Y" => "https://play.nim-lang.org/#ix=412Z" |
14:38:15 | FromDiscord | <hotdog> @halc does it work if you put the if statement in a `when not defined(nimsuggest):` block? |
14:38:40 | FromDiscord | <halc> let's see |
14:39:58 | FromDiscord | <halc> still not working |
14:40:00 | FromDiscord | <halc> sent a code paste, see https://play.nim-lang.org/#ix=4130 |
14:40:37 | FromDiscord | <xflywind> What's yor Nim version? |
14:40:49 | FromDiscord | <xflywind> I fixed a issue related on devel => https://github.com/nim-lang/Nim/issues/8219 |
14:40:57 | FromDiscord | <halc> sent a code paste, see https://play.nim-lang.org/#ix=4131 |
14:41:27 | FromDiscord | <xflywind> (edit) "a" => "an" |
14:41:56 | FromDiscord | <halc> is `nimsuggest` defined when using `nim check`? |
14:43:00 | FromDiscord | <xflywind> Can you try it with latest Nim? If you use choosenim, try `choose devel` or `choosenim update devel`. |
14:43:21 | FromDiscord | <xflywind> See also https://github.com/nim-lang/Nim/pull/19641 |
14:43:59 | FromDiscord | <xflywind> Imo nimsuggest will call nim check when you save the nimscript file. |
14:47:02 | FromDiscord | <halc> @xflywind any reason why you deleted your messages? |
14:47:09 | FromDiscord | <halc> I was about to update to devel |
14:47:53 | FromDiscord | <xflywind> Can you send the screenshot showing how it doesn't work? I'm reproducing it. |
14:50:18 | FromDiscord | <xflywind> I use nimsaem's extension in vscode. |
14:51:21 | FromDiscord | <halc> this is the one I'm using https://marketplace.visualstudio.com/items?itemName=kosz78.nim |
14:51:47 | FromDiscord | <halc> but running `nim check` manually isn't working either https://media.discordapp.net/attachments/371759389889003532/990992845689221150/Code_Ky3jRWdMYE.png |
14:54:05 | FromDiscord | <halc> it only works when I comment out the check entirely |
14:55:00 | FromDiscord | <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:19 | FromDiscord | <xflywind> Yeah, I see |
14:57:11 | FromDiscord | <halc> for the record, I just tried with 1.7.1, same issue |
14:58:08 | FromDiscord | <halc> https://media.discordapp.net/attachments/371759389889003532/990994446545977435/unknown.png |
14:59:23 | FromDiscord | <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:17 | FromDiscord | <xflywind> `defined(nimcheck)` is supposed to work. But it doesn't work in nimscript. It seems to be a bug. |
15:08:19 | FromDiscord | <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:09 | FromDiscord | <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:17 | FromDiscord | <soundmodel> Anyone have input as to how essential macros and metaprogramming are? |
15:18:08 | FromDiscord | <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:17 | FromDiscord | <enthus1ast> but its a very cool (and sometimes a little complex) part of nim |
15:19:38 | FromDiscord | <soundmodel> A book chapter made it seem like for leveraging DSL aspects it could be a crucial style of Nim |
15:20:55 | FromDiscord | <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:22 | FromDiscord | <xflywind> In reply to @halc "I mean it's not": I made a quick dirty patch in nim.nim, it works |
15:27:25 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/991001814918910052/unknown.png |
15:28:12 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/991002012076355644/unknown.png |
15:28:57 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/991002203110121483/unknown.png |
15:31:21 | FromDiscord | <exelotl> something about there being a file called nim.nim is really funny |
15:34:58 | FromDiscord | <potatoxel> nimmy nim |
15:37:58 | FromDiscord | <xflywind> yeah, thats why the executable is called nim https://github.com/nim-lang/Nim/blob/devel/compiler/nim.nim |
15:38:25 | FromDiscord | <xflywind> Its the main program when compiling the Nim compiler. |
15:45:53 | FromDiscord | <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:19 | FromDiscord | <eyecon> Arrrgggghhhh 💀 |
16:04:33 | FromDiscord | <eyecon> Is there no way to switch endianness in std/streams? |
16:05:33 | ehmry | `Error: unhandled exception: Success [Exception]` - thanks glib |
16:06:28 | FromDiscord | <eyecon> FML |
16:07:08 | * | arkurious joined #nim |
16:08:34 | FromDiscord | <xflywind> In reply to @eyecon "Is there no way": Yes |
16:08:57 | FromDiscord | <xflywind> See discussions in https://github.com/nim-lang/Nim/issues/12790 |
16:08:59 | FromDiscord | <eyecon> In reply to @flywind "Yes": Yes, there is or Yes, there isn't? |
16:10:00 | FromDiscord | <eyecon> In reply to @flywind "See discussions in https://github.com/nim-lang/Nim/": Thanks, terrible to know there isn't |
16:10:18 | FromDiscord | <xflywind> Sorry, it should be "No, there isn't". |
16:11:18 | * | ltriant joined #nim |
16:11:18 | FromDiscord | <eyecon> No problems, it was clear after seeing the link, thanks a lot |
16:11:40 | FromDiscord | <xflywind> You are welcome. |
16:17:58 | * | ltriant quit (Ping timeout: 240 seconds) |
16:18:06 | FromDiscord | <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:39 | FromDiscord | <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:17 | FromDiscord | <d4rckh> yes |
16:45:46 | FromDiscord | <d4rckh> is there any other keybind i can hook other than CTRL-C in a command line app? |
16:49:23 | FromDiscord | <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:43 | FromDiscord | <d4rckh> i doubt |
16:52:30 | * | wallabra quit (Ping timeout: 272 seconds) |
16:53:58 | * | arkurious quit (Ping timeout: 240 seconds) |
16:54:50 | FromDiscord | <exelotl> why do you want that? (we might be able to suggest another way) |
16:57:27 | FromDiscord | <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:34 | FromDiscord | <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:37 | FromDiscord | <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:17 | FromDiscord | <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:47 | FromDiscord | <Rika> In reply to @m4ul3r "Some where in the": its "supported" but not on windows naturally |
17:01:41 | FromDiscord | <Phil> sent a long message, see http://ix.io/413w |
17:02:26 | FromDiscord | <Phil> I hate this heat, makes thinking way too hard. |
17:02:59 | FromDiscord | <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:34 | FromDiscord | <d4rckh> so i want to kind of way of cancelling these requests |
17:04:10 | FromDiscord | <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:19 | FromDiscord | <d4rckh> but it does not work on windows |
17:04:25 | FromDiscord | <d4rckh> (edit) "but it does not work on windows ... " added "which is sad" |
17:04:49 | * | noeontheend joined #nim |
17:06:27 | FromDiscord | <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:54 | FromDiscord | <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:53 | FromDiscord | <d4rckh> i was thinking about maybe ESC or CTRL+Z |
17:08:57 | FromDiscord | <d4rckh> (edit) "maybe" => "hooking" |
17:09:02 | FromDiscord | <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:47 | FromDiscord | <xflywind> Bakcticks don't seem to work on Nim forum? |
17:28:50 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/991032368104103986/unknown.png |
17:29:58 | FromDiscord | <xflywind> Ah, it needs spaces from other words |
17:31:52 | NimEventer | New 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:48 | FromDiscord | <d4rckh> what happens if you marshal objects that contain references of other things? |
17:57:50 | FromDiscord | <d4rckh> (edit) "things?" => "objects?" |
17:58:20 | FromDiscord | <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:41 | FromDiscord | <d4rckh> if i marshal only that sequence |
17:58:58 | FromDiscord | <d4rckh> (edit) "if i marshal only that sequence ... " added "of refs and then unmarshal it, what would happen to those refs?" |
17:59:07 | FromDiscord | <d4rckh> (edit) "refs?" => "refs to the big object?" |
18:00:25 | * | ltriant quit (Ping timeout: 248 seconds) |
18:01:35 | FromDiscord | <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:17 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=4140 |
18:21:23 | FromDiscord | <d4rckh> This triggers a SIGSEGV 🤔 |
18:31:05 | FromDiscord | <jan0809> marshal is something like pickle in python i assume? |
18:32:04 | FromDiscord | <jan0809> the same thing that ruby uses for serializing stuff? or is the name an incidence |
18:33:24 | FromDiscord | <d4rckh> yes, it serializes things |
18:34:41 | FromDiscord | <ynfle> Why use that and not JSON? |
18:35:16 | FromDiscord | <halc> sent a code paste, see https://play.nim-lang.org/#ix=4146 |
18:36:48 | FromDiscord | <d4rckh> yes Client is a ref object |
18:36:59 | FromDiscord | <d4rckh> i want to copy the object of client |
18:37:03 | FromDiscord | <d4rckh> (edit) "i want to copy the object of client ... " added "into tempClient" |
18:37:22 | FromDiscord | <d4rckh> i think i should initialize tempClient to something? |
18:37:53 | FromDiscord | <halc> ah, in that case, you should first create a new Client, yes |
18:38:29 | FromDiscord | <halc> just a line with `new tempClient` should do |
18:39:59 | FromDiscord | <halc> there's probably a nicer way to do it, but I'm new to nim |
18:45:56 | FromDiscord | <halc> sent a code paste, see https://play.nim-lang.org/#ix=414b |
19:11:09 | FromDiscord | <d4rckh> Client() seems to work |
19:11:30 | FromDiscord | <d4rckh> but `new Client` seems more elegant |
19:16:13 | * | noeontheend quit (Read error: Connection reset by peer) |
19:17:32 | FromDiscord | <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:23 | FromDiscord | <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:23 | FromDiscord | <SirOlaf> Is expandArc supposed to expand nested functions as well? |
19:46:01 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=414s |
19:46:08 | FromDiscord | <SirOlaf> (edit) "https://play.nim-lang.org/#ix=414s" => "https://play.nim-lang.org/#ix=414t" |
19:48:06 | FromDiscord | <SirOlaf> Guess it's unneeded because it works on inner when passed to it instead of outer |
19:49:45 | reversem3[m] | Where did find information on export , when and where to use it https://nim-lang.org/docs/manual.html |
19:51:39 | reversem3[m] | * Where can I find information on export , when and where to use it https://nim-lang.org/docs/manual.html |
19:57:38 | FromDiscord | <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:33 | FromDiscord | <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:39 | FromDiscord | <Phil> Nim is very much imperative with functional and absolutely minimal OO bits strewn in |
20:03:53 | FromDiscord | <Phil> (edit) "imperative" => "procedural" |
20:04:28 | FromDiscord | <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:34 | FromDiscord | <soundmodel> (edit) "though:" => "though, e.g.:" |
20:06:05 | FromDiscord | <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:01 | FromDiscord | <soundmodel> and somewhere else I saw some bit that looked very similar to Haskell's guards |
20:08:20 | FromDiscord | <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:36 | FromDiscord | <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:05 | FromDiscord | <Phil> So a lot of the time its preferred to do for in loops |
20:10:27 | FromDiscord | <Phil> Though the above only matters for more high performance situation than matter to me regarding webdev |
20:10:31 | FromDiscord | <soundmodel> I was thinking of starting to write Nim as if it was C |
20:10:50 | FromDiscord | <soundmodel> but this could be the wrong way, if the language was Python-like |
20:10:55 | FromDiscord | <Phil> Should work, as they're both procedural. |
20:11:13 | FromDiscord | <Phil> But I can't fully judge that as I haven't written C |
20:11:16 | FromDiscord | <soundmodel> because that'd miss what's more useful in Python |
20:12:46 | FromDiscord | <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:33 | FromDiscord | <soundmodel> e.g. that one's not forced to use struct-like things to for pseudo-OO |
20:13:44 | FromDiscord | <soundmodel> (edit) removed "to" |
20:14:17 | * | noeontheend quit (Ping timeout: 248 seconds) |
20:14:44 | FromDiscord | <Phil> You'd need to get more precise on that, I can't really associate anything with the word choice |
20:15:46 | FromDiscord | <soundmodel> Some would not consider this idiomatic use of C: https://stackoverflow.com/questions/44102324/emulating-classes-in-c-using-structs |
20:17:26 | FromDiscord | <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:31 | FromDiscord | <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:44 | FromDiscord | <soundmodel> So in that sense doing OO in C is not idiomatic, if C is not an OO language. |
20:23:05 | FromDiscord | <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:38 | FromDiscord | <soundmodel> (edit) "And while it may" => "It might" |
20:23:47 | FromDiscord | <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:55 | FromDiscord | <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:48 | FromDiscord | <Phil> But that's solely my webdev perspective |
20:26:28 | FromDiscord | <soundmodel> some source said that C's "pseudo-OO" is similar to "OO in JS" |
20:27:09 | FromDiscord | <Zectbumo> I would say that's not accurate. |
20:27:29 | FromDiscord | <Andreas> In reply to @soundmodel "some source said that": no, JS is Prototypal and dynamic.. no |
20:27:32 | FromDiscord | <soundmodel> if that was the case then that could suggest what Nim's "OO" is |
20:27:38 | FromDiscord | <soundmodel> since it compiles to C and JS |
20:28:20 | FromDiscord | <Zectbumo> I think at this point you have to stand back and define what you think "OO" means |
20:28:39 | FromDiscord | <soundmodel> I'm just asking what it means in Nim |
20:28:52 | FromDiscord | <soundmodel> so that I know whether to start writing it like it was Java or C or Python |
20:28:58 | FromDiscord | <soundmodel> based on my earlier experience |
20:29:11 | FromDiscord | <SirOlaf> Nim doesn't have real OOP because it doesn't have vtables |
20:29:23 | FromDiscord | <SirOlaf> Just has functions associated with types |
20:30:04 | FromDiscord | <Zectbumo> which means it's not going to be like Python |
20:30:07 | FromDiscord | <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:18 | FromDiscord | <Phil> (edit) "Java is OO on steroids with the ... steroids.↵Nim" added "steroids taking" |
20:31:23 | FromDiscord | <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:38 | FromDiscord | <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:39 | FromDiscord | <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:46 | FromDiscord | <soundmodel> since it's functions with types |
20:31:58 | FromDiscord | <Andreas> @soundmodel usecase - whats yours btw ? |
20:32:11 | FromDiscord | <soundmodel> it says in the book that Nim is intended for all types of programs |
20:32:28 | FromDiscord | <soundmodel> but this confuses me, because all the languages I've used have a distinct "idiomatic way" of using the language |
20:32:40 | FromDiscord | <soundmodel> that's what distinguishes "ugly Haskell" from "elegant Haskell" |
20:33:14 | FromDiscord | <soundmodel> or "C-like Python" from idiomatic Python |
20:34:33 | FromDiscord | <Zectbumo> Nim in Action covers some of these |
20:34:49 | FromDiscord | <soundmodel> so e.g. if I was learning Python I'd consider that I need to use classes right away |
20:34:56 | FromDiscord | <🐒🧠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:00 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=414E |
20:35:20 | FromDiscord | <soundmodel> because writing Python like it was C is about missing all the extra bits that Python offers |
20:35:44 | FromDiscord | <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:07 | FromDiscord | <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:20 | FromDiscord | <Zectbumo> @soundmodel I like where you are going with this |
20:38:16 | FromDiscord | <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:50 | FromDiscord | <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:07 | FromDiscord | <soundmodel> but this would not be the case in "write it as if it was C" |
20:39:18 | FromDiscord | <d4rckh> What do the pragmas that functions add mean? |
20:41:59 | FromDiscord | <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:14 | FromDiscord | <soundmodel> emulatable, but not idiomatic |
20:46:10 | FromDiscord | <Elegantbeef> You mean object variants? |
20:46:42 | FromDiscord | <Elegantbeef> Oh jeez the matrix bridge has been a little slow |
20:46:53 | FromDiscord | <Elegantbeef> You mean object variants by this eh?↵(@Zectbumo) |
20:47:06 | FromDiscord | <soundmodel> and it still says that Nim is multi-paradigm |
20:47:07 | FromDiscord | <Zectbumo> yes, thank you. object variants |
20:47:14 | FromDiscord | <soundmodel> but now it sounds like it's more like Rust perhaps |
20:47:19 | FromDiscord | <Elegantbeef> Idiomatic Nim is procedural |
20:47:26 | FromDiscord | <Elegantbeef> But you can write it how you want |
20:47:51 | FromDiscord | <SirOlaf> Gonna experience least resistance with procedural though |
20:49:00 | FromDiscord | <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:03 | FromDiscord | <soundmodel> yes, but I perceive that it gives functional and OO concepts a very difference sense than in Python for example |
20:49:26 | FromDiscord | <soundmodel> since they're essentially still for just "cleaning a bit of procedural", rather than replacing the fundamental paradigm |
20:50:37 | FromDiscord | <Zectbumo> the "nim way" which really means the least amount of people in the nim community that will frown upon your code |
20:50:38 | FromDiscord | <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:07 | FromDiscord | <soundmodel> even when the language allows writing in alternative styles |
20:51:26 | FromDiscord | <Andreas> In reply to @soundmodel "well based on my": these days the style-police is everywhere |
20:52:27 | FromDiscord | <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:27 | FromDiscord | <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:01 | FromDiscord | <soundmodel> In reply to @soundmodel "well based on my": like https://peps.python.org/pep-0008/ |
20:53:32 | FromDiscord | <Elegantbeef> There is Nep1 |
20:53:48 | FromDiscord | <Zectbumo> https://nim-lang.org/docs/nep1.html |
20:53:50 | FromDiscord | <SirOlaf> Mostly talks about naming |
20:53:54 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> Naming is all that really matters |
20:54:33 | FromDiscord | <Elegantbeef> Unless you're maintaining the API the internal design really doesnt matter |
20:54:57 | FromDiscord | <whisper> What is the most mature library for scraping? |
20:55:20 | FromDiscord | <Elegantbeef> https://nimble.directory/search?query=scraping |
20:55:35 | FromDiscord | <Elegantbeef> Whenever i need to scrape i just use httpclient + html parsing |
20:55:54 | FromDiscord | <dom96> In reply to @whisper "What is the most": `htmlparser` module in the stdlib works pretty well |
20:56:51 | FromDiscord | <SirOlaf> puppy is pretty good too |
20:57:14 | * | ltriant joined #nim |
20:58:14 | FromDiscord | <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:34 | FromDiscord | <Elegantbeef> Imagine not having polls built into your chat client! |
20:58:58 | FromDiscord | <Elegantbeef> The only correct answer is the last due to accidentally writing `hellow` as i typically do |
20:59:14 | FromDiscord | <Zectbumo> 😆 |
20:59:29 | FromDiscord | <eyecon> Btw I salvaged by cbor-with-streams approach with endians2, long live Status |
21:00:02 | FromDiscord | <eyecon> In reply to @flywind "See discussions in https://github.com/nim-lang/Nim/": Thanks again |
21:01:44 | FromDiscord | <🐒🧠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:08 | FromDiscord | <🐒🧠br4n_d0n> 8 in all it seems |
21:04:47 | FromDiscord | <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:50 | FromDiscord | <Zectbumo> In reply to @Elegantbeef "Imagine not having polls": does matrix have polls built in? |
21:07:07 | * | jmdaemon joined #nim |
21:07:11 | FromDiscord | <Elegantbeef> Yes, well atleast the element client has it implemented |
21:07:58 | FromDiscord | <Zectbumo> 🛸 |
21:08:14 | FromDiscord | <Zectbumo> high tech |
21:08:33 | FromDiscord | <🐒🧠br4n_d0n> Beef, anyway to change the assigned account name color? |
21:08:41 | FromDiscord | <🐒🧠br4n_d0n> (edit) "anyway" => "any way" |
21:08:46 | FromDiscord | <Elegantbeef> Fuck if i know |
21:09:13 | FromDiscord | <Elegantbeef> Afaik it's based off your name |
21:09:33 | FromDiscord | <🐒🧠br4n_d0n> ... dumb |
21:09:43 | FromDiscord | <Elegantbeef> Cause the color of your name matters? |
21:10:21 | FromDiscord | <🐒🧠br4n_d0n> Not really, but it clashes with he green color Element uses and bothers my eyes |
21:11:09 | FromDiscord | <Elegantbeef> You probably could make a css to modify just your name |
21:14:36 | FromDiscord | <jan0809> In reply to @Zectbumo "does matrix have polls": atleast reactions |
21:16:38 | reversem3[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:15 | FromDiscord | <Elegantbeef> Export and the export marker are the equivalent to public in other languages |
21:17:33 | FromDiscord | <jan0809> is there a bridge here |
21:17:43 | FromDiscord | <jan0809> me realizing stuff |
21:17:45 | FromDiscord | <Elegantbeef> There are 2 |
21:17:51 | FromDiscord | <Elegantbeef> I'm on matrix and there is also irc |
21:18:20 | FromDiscord | <Zectbumo> sent a long message, see http://ix.io/414N |
21:18:28 | FromDiscord | <Elegantbeef> `var i = 8u8` |
21:18:36 | FromDiscord | <Elegantbeef> The only correct way |
21:19:11 | FromDiscord | <Zectbumo> (edit) "http://ix.io/414N" => "http://ix.io/414O" |
21:19:46 | FromDiscord | <d4rckh> First or last |
21:19:50 | FromDiscord | <d4rckh> Not very sure |
21:20:08 | FromDiscord | <d4rckh> I'll go with first 😑 |
21:20:18 | FromDiscord | <Elegantbeef> Shame |
21:21:55 | FromDiscord | <jan0809> sent a code paste, see https://play.nim-lang.org/#ix=414P |
21:22:05 | FromDiscord | <jan0809> (edit) "https://play.nim-lang.org/#ix=414P" => "https://play.nim-lang.org/#ix=414Q" |
21:22:49 | FromDiscord | <Elegantbeef> So i can say that C is just the worst |
21:24:01 | FromDiscord | <halc> In reply to @Elegantbeef "`var i = 8u8`": this but I don't like ignoring the existence of `8'u8` |
21:24:12 | FromDiscord | <Elegantbeef> Sucks to suck |
21:29:44 | FromDiscord | <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:02 | FromDiscord | <Elegantbeef> I disagree but you do you |
21:31:23 | FromDiscord | <Zectbumo> In reply to @halc "this but I don't": added |
21:33:55 | * | LuxuryMode joined #nim |
21:44:26 | FromDiscord | <!Patitotective> In reply to @Zectbumo "next poll. cast your": you chose a beef emoji on purpose, did you? |
21:44:45 | FromDiscord | <!Patitotective> In reply to @halc "this but I don't": i do |
21:56:19 | FromDiscord | <d4rckh> In reply to @Elegantbeef "Shame": 8u8 is also fine |
21:56:49 | FromDiscord | <d4rckh> But specifying uint8 in the type makes it a bit more readable |
21:57:35 | FromDiscord | <d4rckh> I think 8u8 would be better in case you pass it to procs like doSomething(8u8) |
21:57:47 | FromDiscord | <d4rckh> Actually 8u8 might be best |
21:57:54 | FromDiscord | <!Patitotective> yes |
21:59:51 | FromDiscord | <Zectbumo> sent a long message, see http://ix.io/414W |
22:00:10 | FromDiscord | <d4rckh> 8'u8 looks like you are proving minutes |
22:00:17 | FromDiscord | <d4rckh> (edit) "proving" => "providing" |
22:00:35 | FromDiscord | <d4rckh> In reply to @Zectbumo "poll: 🧮 `bars[0 ..": First |
22:00:48 | FromDiscord | <d4rckh> No discussion |
22:01:00 | FromDiscord | <!Patitotective> In reply to @Zectbumo "poll: 🧮 `bars[0 ..": I wouldn't write spaces around `..`↵Like `bars[0..^1]` |
22:01:12 | FromDiscord | <Elegantbeef> `bars.toOpenArray(0, bars.len)` |
22:02:16 | FromDiscord | <d4rckh> In reply to @Elegantbeef "`bars.toOpenArray(0, bars.len)`": Why this over [0..^1]? |
22:02:35 | FromDiscord | <d4rckh> It's easier to understand imo with slices |
22:02:59 | FromDiscord | <Elegantbeef> Non copying |
22:03:17 | FromDiscord | <d4rckh> So it would be more memory efficient? |
22:03:23 | FromDiscord | <Zectbumo> In reply to @Elegantbeef "`bars.toOpenArray(0, bars.len)`": added (with bars.high) |
22:07:27 | FromDiscord | <d4rckh> I kind of like these little quizzes. Learning a new thing here and there |
22:07:32 | FromDiscord | <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:06 | FromDiscord | <🐒🧠br4n_d0n> I don't quite understand beef's method |
22:08:34 | FromDiscord | <Elegantbeef> Openarrays are Nim's free slices that do not allocate |
22:09:45 | FromDiscord | <🐒🧠br4n_d0n> So these other arrays are doing heap allocation? |
22:10:08 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=414Y |
22:10:22 | FromDiscord | <Elegantbeef> No it's compiler magic |
22:19:25 | FromDiscord | <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:57 | FromDiscord | <!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) |