<< 07-09-2023 >>

00:00:52*Ekho quit (Quit: CORE ERROR, SYSTEM HALTED.)
00:39:49*Ekho joined #nim
00:46:01*Ekho quit (Quit: CORE ERROR, SYSTEM HALTED.)
00:50:59*Ekho joined #nim
01:06:06*Ekho quit (Quit: CORE ERROR, SYSTEM HALTED.)
01:20:20*Ekho joined #nim
01:44:03*blop_ quit (Remote host closed the connection)
01:44:35*blop_ joined #nim
01:56:17*edr quit (Quit: Leaving)
03:30:13FromDiscord<jaar23> In reply to @enthus1ast "<@614403538172379156>\: could it be": ah, okay. that's where the problem. never know tryRecv actually use more cpu resource compare to recv. ↡then got to fix octolog multi thread fmtLine function.
03:31:00FromDiscord<jaar23> In reply to @enthus1ast "btw nice project <@614403538172379156>,": thanks man, it is more like a mini queue. haha
03:41:57NimEventerNew thread by DMisener: How to pass an optional callback to an a proc?, see https://forum.nim-lang.org/t/10464
03:50:59NimEventerNew thread by DMisener: How to pass an optional callback to a proc, see https://forum.nim-lang.org/t/10465
03:59:53FromDiscord<jaar23> sent a code paste, see https://play.nim-lang.org/#ix=4FzU
04:38:41FromDiscord<Phil> In reply to @kingterrytheterrible12 "": Number 1, that is offtopic, number 2, there's a memes channel if it were programming related.↡This channel is primarily for chatter about nim and nim coding help/discussions.↡We tend to turn a blind eye if nothing else is going on and so nobody gets disturbed, but generally nim discussion has precedence.
04:55:15*ntat joined #nim
05:00:18*azimut joined #nim
05:57:35*rockcavera quit (Remote host closed the connection)
06:24:16*advesperacit joined #nim
06:25:08FromDiscord<toma400> Out of curiosity, is there any resources that explain how to build static wrapper on libs, especially C ones?↡I feel like one of my biggest pains with Nim is necessity to build a lot of dependencies, so it'd be nice to have some tips how to help with making statically linked libs
06:25:36FromDiscord<toma400> (edit) "making statically linked libs" => "no dll-requiring libs."
06:26:23FromDiscord<Elegantbeef> Passing teh same as you would with C
06:26:24FromDiscord<Elegantbeef> Use either `{.passL:.}` inside your nim or inside a config
06:38:24*PMunch joined #nim
07:32:22FromDiscord<sOkam! 🫐> Is it possible to mark a `const thing = 42` variable as `{.deprecated.}` like a function? such that it only gives a warning when its used πŸ€”
07:37:04FromDiscord<Elegantbeef> Yes
07:37:25FromDiscord<Elegantbeef> The same way all variable pragmas are done on the symbol `const bleh {.deprecated.} = 300`
07:39:54FromDiscord<sOkam! 🫐> kk ty ✍️
07:53:24*ntat quit (Quit: leaving)
08:04:35*acidsys quit (Server closed connection)
08:04:57*acidsys joined #nim
08:16:31*lumo_e joined #nim
08:31:40*advesperacit quit (Ping timeout: 248 seconds)
08:32:19*advesperacit joined #nim
08:33:52FromDiscord<sOkam! 🫐> In reply to @toma400 "Out of curiosity, is": i haven't found any. but you can see two examples at `heysokam/wgpu` and `heysokam/nglfw`
08:35:12FromDiscord<sOkam! 🫐> the root essence is either you use the library buildsystem to create a static lib and link to it with `passL:`... or you create a list of `{.compile: "thefile.c".}` in your file to build their code directly from the nim gcc call system
08:36:53FromDiscord<sOkam! 🫐> you also have the futhark way of wrapping, which can be static if this system happens to fit your desired lib↡https://github.com/PMunch/futhark/blob/master/tests/tstb.nim
08:37:02*advesperacit quit (Ping timeout: 245 seconds)
08:37:29*advesperacit joined #nim
08:40:45PMunchFuthark can wrap both in a static and a dynamic way
08:40:52FromDiscord<taperfade> hii
08:41:02PMunchYou just feed it header files and still have to figure out how to actually link/build with the library
08:41:07PMunchtaperfade, hello
08:41:09FromDiscord<taperfade> i have an issue with installing nim
08:42:40PMunchWell that's not great
08:42:43PMunchWhat's the issue?
08:42:53FromDiscord<taperfade> nim command not found
08:42:58FromDiscord<taperfade> very weird
08:43:11PMunchSounds like AV eating the binary
08:43:20PMunchYou're on Windows?
08:43:25FromDiscord<taperfade> yea
08:43:34PMunchEither that or you haven't set your path properly
08:43:47FromDiscord<taperfade> how do i set my path
08:43:59PMunchI think finish.exe should do that for you
08:44:00PMunchNot sure
08:44:06FromDiscord<taperfade> it didnt
08:44:22PMunchTry opening a new terminal if you haven't already
08:44:42PMunchCan you `echo $PATH` on Windows?
08:45:14FromDiscord<taperfade> uhh
08:45:17FromDiscord<taperfade> i guess
08:45:25FromDiscord<taperfade> https://media.discordapp.net/attachments/371759389889003532/1149264147175976980/image.png
08:45:34FromDiscord<taperfade> im rlly lost
08:46:36FromDiscord<odexine> it would be `echo %PATH%` for windows
08:46:47FromDiscord<nnsee> on windows you can just do `path` iirc
08:46:50PMunchHaha, well that didn't do what I expected :P
08:47:04FromDiscord<odexine> windows doesnt usually do what you expect xd
08:47:06FromDiscord<odexine> i kid, of course
08:47:20FromDiscord<taperfade> im in the path folder
08:47:31PMunchIt does exactly what I expected it to do, mess up other peoples computers :P
08:47:39PMunchPath folder?
08:47:55FromDiscord<taperfade> yeah
08:48:04PMunchWhat do you mean path folder?
08:48:09FromDiscord<taperfade> idk
08:48:22PMunchPATH is an environment variable that sets where Windows will look for binaries
08:48:30FromDiscord<taperfade> weirt
08:48:32FromDiscord<taperfade> weird
08:48:35PMunchIt's not a folder
08:48:36FromDiscord<sOkam! 🫐> @taperfade https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path
08:48:38FromDiscord<taperfade> ok enough nim ig
08:48:43FromDiscord<taperfade> im a nim hater now
08:48:52PMunchYou haven't even tried it..
08:48:56FromDiscord<sOkam! 🫐> πŸ˜„
08:49:06FromDiscord<taperfade> In reply to @heysokam "<@1111014250446585866> https://unix.stackexchange.": im not on linux
08:49:28FromDiscord<sOkam! 🫐> In reply to @taperfade "im not on linux": oh whooops, my bad. that gave the wrong link
08:49:53PMunchWhat did `echo %PATH%` give you?
08:49:58FromDiscord<sOkam! 🫐> @taperfade https://windowsloop.com/how-to-add-to-windows-path/ this one sry
08:50:24FromDiscord<sOkam! 🫐> I had been dealing with it on windows the other day, but history showed the wrong link. that second one is what I used
08:50:59FromDiscord<sOkam! 🫐> also, don't just "wing it"... follow the instructions on the nim website
08:51:15FromDiscord<taperfade> In reply to @heysokam "also, don't just "wing": i did
08:51:26FromDiscord<taperfade> downloaded the installer
08:51:30FromDiscord<sOkam! 🫐> then add the path how that new link shows you
08:51:43FromDiscord<taperfade> add what to the path
08:51:47FromDiscord<sOkam! 🫐> if the installer didnt (which probably did but you just didn't reboot yet)
08:51:59FromDiscord<taperfade> In reply to @heysokam "if the installer didnt": i need to reboot windows
08:52:01FromDiscord<taperfade> ?
08:52:09FromDiscord<sOkam! 🫐> well yeah, windows wants to reboot for everything
08:52:13FromDiscord<taperfade> okie
08:52:31FromDiscord<taperfade> love my baby boo windows
08:52:32FromDiscord<sOkam! 🫐> if that doesn't work come back and we will guide you to what to add to the path on windows
08:52:44FromDiscord<taperfade> i tried linux and its just not usable
08:52:48FromDiscord<taperfade> im a linux hater
08:52:51PMunchWait, you have to reboot Windows to add something to the path?!
08:53:03FromDiscord<taperfade> im very mean towards ppl telling me linux is better
08:53:07FromDiscord<sOkam! 🫐> In reply to @PMunch "Wait, you have to": πŸ€·β€β™‚οΈ maybe with the choosenim installer
08:53:08FromDiscord<taperfade> bcs it isnt
08:53:27PMunchIt's different, wouldn't recommend it to everyone
08:53:31FromDiscord<sOkam! 🫐> its different, and the os battle helps nothing here, so ... kinda silly to even bring it up
08:53:43FromDiscord<taperfade> yes
08:53:50FromDiscord<taperfade> bcs windows solos ur fav distro
08:53:51FromDiscord<sOkam! 🫐> just reboot and come back if that didn't work
08:54:24FromDiscord<Elegantbeef> Yea I've just been beating rocks for the past 10 years
08:54:26FromDiscord<Chronos [She/Her]> In reply to @taperfade "bcs it isnt": It varies from usecase to usecase
08:54:36FromDiscord<Chronos [She/Her]> For me? It's much better, I get much more control
08:55:04FromDiscord<Chronos [She/Her]> For others? They don't want to have to mess around with anything to get it working how they want, Windows does that out-of-the-box normally
08:55:06FromDiscord<sOkam! 🫐> stop with the os battle, don't you see that he just doesn't care
08:55:06FromDiscord<nnsee> In reply to @taperfade "bcs windows solos ur": obvious bait
08:55:30FromDiscord<Chronos [She/Her]> Just pointing out it's preference and neither is objectively better
08:55:33FromDiscord<Elegantbeef> Suffice to say "linux is just not usable" is going to fall on deaf ears in most developer circles
08:56:02FromDiscord<Chronos [She/Her]> Yeah lmao
08:56:06FromDiscord<sOkam! 🫐> is there an existing stdlib tool to parse `(~0U)`, `(~0ULL)` and friends?
08:56:10FromDiscord<odexine> linux is not universally better than windows↡and windows is not universally better than linux
08:56:19FromDiscord<taperfade> In reply to @odexine "linux is not universally": factually wrong
08:56:43FromDiscord<odexine> In reply to @taperfade "factually wrong": please provide your evidence, btw anecdotes arent evidence...
08:56:44FromDiscord<sOkam! 🫐> go to offtopic if you want to discuss operating system battles, ty
08:56:56FromDiscord<odexine> lol
08:56:57FromDiscord<taperfade> In reply to @odexine "please provide your evidence,": okey
08:57:12FromDiscord<nnsee> stop feeding the troll
08:57:20FromDiscord<ElegantBeouf> In reply to @odexine "please provide your evidence,": Windows lets you see outside, linux isnt even a word
08:57:21PMunchsOkam, don't think so, but feel free to steal the stuff from Opir
08:57:23FromDiscord<taperfade> In reply to @nnsee "stop feeding the troll": why are u now calling me troll
08:57:50FromDiscord<sOkam! 🫐> In reply to @PMunch "sOkam, don't think so,": have a link? your code is hella hard to navigate, you too smart πŸ˜”
08:58:03PMunchtaperfade, because you're no longer trying to fix you Nim install and instead seem to want to discuss operating systems which is off-topic.
08:58:13FromDiscord<taperfade> In reply to @PMunch "<@1111014250446585866>, because you're no": i fixed it
08:58:23PMunchBu I see you have moved it to the off-topic channel, thanks :)
08:58:29FromDiscord<taperfade> now i can spread some silly little windows propaganda
08:58:34FromDiscord<odexine> In reply to @elegantbeef "Windows lets you see": but you can break a window
08:58:51FromDiscord<ElegantBeouf> You can tune a piano but you cannot tuna fish
08:58:55FromDiscord<odexine> linux doesnt exist how can you break something that doesnt exist
08:59:10FromDiscord<taperfade> In reply to @odexine "linux doesnt exist how": you cant use something that doesnt exist
08:59:12FromDiscord<taperfade> get it
08:59:17FromDiscord<taperfade> linux is unusable
08:59:36FromDiscord<sOkam! 🫐> stop with the damn battle and go to offtopic
08:59:42FromDiscord<sOkam! 🫐> keep it nim, thank you
08:59:44PMunchsOkam, here you go: https://github.com/PMunch/futhark/blob/master/src/opir.nim#L328C9-L399C153
08:59:55FromDiscord<sOkam! 🫐> In reply to @PMunch "sOkam, here you go:": ty πŸ™πŸ™
09:00:19FromDiscord<ElegantBeouf> ~~The best OS to program on especially Nim is Linux~~ πŸ˜›
09:00:42FromDiscord<sOkam! 🫐> In reply to @PMunch "sOkam, here you go:": oof ⚰️
09:01:02FromDiscord<sOkam! 🫐> im supposed to understand that? crap, that's gonna take a while
09:01:51FromDiscord<nnsee> chatgpt is pretty good at explaining code
09:01:53FromDiscord<ElegantBeouf> I think the only person that's supposed to understand that is Pmunch, and now the only thing that does is God
09:02:33FromDiscord<sOkam! 🫐> In reply to @nnsee "chatgpt is pretty good": true
09:03:01PMunchHaha :P
09:03:20PMunchI've even had PRs to that section of the code, so we're at least two people who understand it
09:04:03PMunchOh wait, maybe it's just the `parseReturn` part onwards you need
09:04:22FromDiscord<ElegantBeouf> Use your moon runes to contact odin and see what he says
09:04:56FromDiscord<sOkam! 🫐> is this what you are parsing, Pmunch? https://media.discordapp.net/attachments/371759389889003532/1149269058164899930/image.png
09:05:10FromDiscord<sOkam! 🫐> or is chatgpt not understanding it
09:05:26PMunchI believe that is a fewer dream
09:05:51FromDiscord<ElegantBeouf> Ahh good old V vs W πŸ˜›
09:06:03FromDiscord<sOkam! 🫐> well, any advice on parsing just values with `(~0L)` and `(~0UL)`?
09:06:04PMunchThe output of that is a JSON object containing the nimified value
09:06:08PMunchDamn it..
09:06:14FromDiscord<sOkam! 🫐> like i don't have any of those things before it, at all
09:06:26FromDiscord<sOkam! 🫐> its just the number, the notting, and the type
09:06:27PMunchsOkam, ttan is what that code does
09:06:41FromDiscord<sOkam! 🫐> yeah but i don't understand it at all
09:06:52FromDiscord<sOkam! 🫐> like... not even 1%
09:06:54PMunchWell, it also parses hex, binary, octal, and floats..
09:07:08PMunchStart on line 377
09:07:58PMunchIt checks the first character, if it's a 0 then it checks to see if it needs to parse hex, octal, binary, etc. Or if it's just 0L then it returns 0.
09:08:25PMunchFor each of those `parseReturn` invocations it just rewrites it to `parseBiggestInt` for example
09:09:26PMunchThe parseReturn first strips away the L/l U/u Z/z postfixes and records them, then it parses the number as specified, and then it applies the postfix logic
09:11:50FromDiscord<sOkam! 🫐> are you generating strings or actual values?
09:12:03*lumo_e quit (Quit: Quit)
09:13:18PMunchWhat do you mean?
09:13:47FromDiscord<sOkam! 🫐> `"123"` `123`
09:16:09PMunchThat didn't really clear anything up :P
09:16:49PMunchIt parses the value into a number and puts it as a number into JSON
09:16:59FromDiscord<sOkam! 🫐> nevermind, I will just hardcode the values to some predefined text
09:18:15PMunch:P
09:18:55PMunchBy the way, I don't think Opir would support `~`
09:19:35PMunchBut if all you need is [tilde][0-9+][lL] then it should be pretty easy to parse
09:20:30PMunchIf you want to support 0x as well then it's a tiny bit trickier, but not that hard
09:27:43PMunchsOkam, here is the procedure split out for you: http://ix.io/4FAV
09:28:00PMunchI just declared a bunch of the variables Opir needs for other stuff with dummy values on top
09:28:23FromDiscord<.maverk> what am i doing wrong ? https://media.discordapp.net/attachments/371759389889003532/1149274959131189268/332.PNG
09:29:02FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4FAW
09:29:14FromDiscord<sOkam! 🫐> just hardcoded, not like I need infinite values or anything
09:29:22FromDiscord<Chronos [She/Her]> In reply to @.maverk "what am i doing": Do `ptr int8`
09:29:29FromDiscord<Chronos [She/Her]> As the type
09:29:38PMunch.maverk, there's no `$` stringifier for pointers
09:29:57FromDiscord<Chronos [She/Her]> Ah nvm ignore me
09:30:02FromDiscord<sOkam! 🫐> In reply to @.maverk "what am i doing": `ptr` is not a concrete type
09:30:09FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1149275402217459712/44.PNG
09:30:09FromDiscord<sOkam! 🫐> `pointer` or `ptr T` are types
09:30:31PMunchsOkam, haha, well that's one way of doing it :P
09:30:32FromDiscord<sOkam! 🫐> In reply to @.maverk "": `echo pointer.repr`
09:30:47PMunchWhat are you using this for by the way?
09:31:01FromDiscord<.maverk> In reply to @heysokam "`echo pointer.repr`": this works
09:31:40FromDiscord<sOkam! 🫐> @.maverk https://github.com/heysokam/nstd/blob/f603400be928947e346a78f852fac1adf58eb2cc/src/nstd/format.nim#L22-L26C43 I made this because I found the existing ones kinda lacking↡feel free to jank them if you find them useful
09:31:47FromDiscord<sOkam! 🫐> (edit) "this" => "these"
09:31:58FromDiscord<.maverk> In reply to @PMunch "What are you using": with all of my respect this should not be asked don't you think !?
09:32:19FromDiscord<sOkam! 🫐> In reply to @.maverk "with all of my": he probably asked you because in Nim you dont need to use pointers, you use references
09:32:27FromDiscord<sOkam! 🫐> since pointers go over the GC entirely
09:32:40FromDiscord<.maverk> In reply to @heysokam "he probably asked you": yes but we are learning that is a silly question
09:32:50FromDiscord<sOkam! 🫐> unless you are doing some interop, or trying to expose the address like you did there
09:33:07PMunch.maverk, huh? Why wouldn't I ask what you are trying to do? Much easier to help people out if you know wat they are doing
09:33:19FromDiscord<sOkam! 🫐> In reply to @.maverk "yes but we are": yeah was just blindguessing, since people come thinking that is normal nim (because of C/C++ and friends) but that's not standard nim
09:33:26PMunchAnd I was actually asking sOkam what they where using these parsers for :P
09:33:47FromDiscord<sOkam! 🫐> In reply to @PMunch "And I was actually": ah for converting the Vulkan spec into nim
09:34:00FromDiscord<sOkam! 🫐> which gives some high value uints in this format
09:34:05PMunchAnd why don't you just use Futhark?
09:34:13PMunchInstead of reinventing the wheel?
09:34:16FromDiscord<sOkam! 🫐> because its not a wrapper, is a spec parser
09:34:33FromDiscord<sOkam! 🫐> we are making a VulkanHpp like thing, not a raw parser
09:34:36*advesperacit quit (Ping timeout: 250 seconds)
09:34:57PMunchHmm, not familiar enough with Vulkan to understand what that means :P
09:35:11*advesperacit joined #nim
09:35:14FromDiscord<sOkam! 🫐> it means nim'ifing the spec, not using it in raw C form
09:35:51FromDiscord<sOkam! 🫐> vulkan.hpp converts the C constructs into C++ handy tools like classes, constructors, autodestructors, etc etc
09:36:15FromDiscord<sOkam! 🫐> plus the syntax is so much better, but its not enough to just rename the C version
09:36:29PMunchAh I see
09:36:40PMunchI do hope to one day get C++ support in Futhark
09:36:45PMunchThat would be awesome
09:36:47FromDiscord<taperfade> How do i use discord webhooks
09:37:29FromDiscord<sOkam! 🫐> In reply to @taperfade "How do i use": there is a dimscord specific server, if you ask in terms of doing it with nim
09:37:45FromDiscord<sOkam! 🫐> they have it in the readme of their github page
09:37:51FromDiscord<taperfade> what
09:38:11FromDiscord<sOkam! 🫐> dimscord is a library to control discord bots with nim
09:38:25FromDiscord<taperfade> does it do webhooks ?
09:38:34FromDiscord<sOkam! 🫐> idk, i don't use it
09:38:44FromDiscord<nnsee> you can use any http library
09:38:53FromDiscord<sOkam! 🫐> In reply to @PMunch "I do hope to": same
09:38:54FromDiscord<nnsee> webhooks use plain old http requests
09:39:10FromDiscord<taperfade> im rlly new to programming so erm
09:39:14FromDiscord<taperfade> whats like
09:39:24FromDiscord<taperfade> a good http library for nim or smth
09:39:27FromDiscord<taperfade> sorry if i sound dumb
09:39:59FromDiscord<nnsee> std/httpclient
09:40:01FromDiscord<sOkam! 🫐> https://nim-lang.org/docs/httpclient.html
09:40:37FromDiscord<sOkam! 🫐> you can add `{.define: ssl.}` at the top of your file, if you cannot figure out how to compile with the `-d:ssl` flag
09:41:19FromDiscord<taperfade> nimming https://media.discordapp.net/attachments/371759389889003532/1149278210232680498/image.png
09:41:53PMunchtaperfade, nice you got it working :)
09:42:01FromDiscord<sOkam! 🫐> day0 acomplished 🦾
09:42:24FromDiscord<taperfade> In reply to @heysokam "day0 acomplished 🦾": hell yeah
09:42:35FromDiscord<taperfade> selling for 35k eur
09:42:52FromDiscord<taperfade> ofc nim was developed by a german
09:42:58FromDiscord<taperfade> thats why its so good
09:43:06FromDiscord<taperfade> im german btw
09:43:13FromDiscord<sOkam! 🫐> compiling is no easy feat. don't take what nim provides for granted πŸ™‚β†΅other langs are not so kind on you
09:43:24FromDiscord<taperfade> i got c to work
09:43:28FromDiscord<taperfade> but i dont like c
09:43:38FromDiscord<sOkam! 🫐> c is hardmode
09:43:52FromDiscord<taperfade> low level is cool but like
09:44:10FromDiscord<sOkam! 🫐> you can do low level with other langs (like nim) much better
09:44:12FromDiscord<taperfade> i feel like im coding 10x slower
09:44:19FromDiscord<sOkam! 🫐> C is just 70s stuff
09:44:27FromDiscord<sOkam! 🫐> its more low tech than low level
09:44:45FromDiscord<sOkam! 🫐> although it can do a LOT with so little, its still a 70s lang
09:45:19FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1149279219256406076/33.PNG
09:45:22FromDiscord<.maverk> i fixed the problem
09:45:52FromDiscord<.maverk> but one more issue what if i want to see the address
09:45:58FromDiscord<.maverk> i will try harder
09:46:06FromDiscord<sOkam! 🫐> In reply to @.maverk "": remember that this wouldn't work for sending it to C. just as a sidenote
09:46:20FromDiscord<.maverk> In reply to @heysokam "remember that this wouldn't": i will never mess with c
09:46:46FromDiscord<sOkam! 🫐> well, GLFW, OpenGL, Vulkan, Windows API, Linux API, ...... you will have a really hard time avoiding it entirely
09:47:22FromDiscord<.maverk> what do you mean ?
09:47:23FromDiscord<sOkam! 🫐> sdl, tileengine... almost every library in existence uses C, and you really will need to interop with it one day
09:47:30FromDiscord<.maverk> i will still have to write c ?
09:47:35FromDiscord<sOkam! 🫐> no, interop
09:47:51FromDiscord<sOkam! 🫐> i was just saying that for -sending- stuff to C, you need to be mindful. was just a sidenote
09:48:11FromDiscord<.maverk> i understand
09:48:19FromDiscord<sOkam! 🫐> because its really the only purpose of getting the addr of something in nim
09:48:27FromDiscord<taperfade> how do i get user input
09:48:29FromDiscord<sOkam! 🫐> in practical day-to-day terms i mean
09:48:39FromDiscord<odexine> In reply to @taperfade "how do i get": stdin.readLine?
09:49:19FromDiscord<taperfade> ill just watch a tutorial
09:49:35FromDiscord<sOkam! 🫐> In reply to @taperfade "how do i get": its explained in one of the examples here https://nim-lang.org/docs/tut1.html
09:49:48FromDiscord<taperfade> oh god
09:49:50FromDiscord<taperfade> reading
09:50:36FromDiscord<sOkam! 🫐> this tut is what I learned with. really worth every second https://narimiran.github.io/nim-basics/
09:50:50FromDiscord<sOkam! 🫐> but read both, you will need what's explained in them
09:51:09FromDiscord<nnsee> if you don't like reading, then maybe programming is not for you? considering it's literally all text
09:52:08FromDiscord<taperfade> In reply to @nnsee "if you don't like": i dont like readint
09:52:12FromDiscord<taperfade> that kind of stuff
09:52:45FromDiscord<taperfade> idk
09:52:51FromDiscord<taperfade> i just like tutorials more
09:53:03FromDiscord<nnsee> that's literally a tutorial he posted
09:55:38FromDiscord<sOkam! 🫐> I don't know any good video tutorial for nim, the written ones are just crazy good and easy to follow
09:56:58FromDiscord<taperfade> i found one dw
09:57:05FromDiscord<taperfade> ill be minning very soon
09:57:13FromDiscord<taperfade> nimming
09:57:20FromDiscord<taperfade> (edit) "minning very" => "nimmingvery"
09:57:25FromDiscord<taperfade> (edit) "nimmingvery" => "nimming very"
09:57:27FromDiscord<taperfade> trust
09:57:38FromDiscord<taperfade> i can already pypy
09:57:45FromDiscord<taperfade> simple stuff
10:02:11FromDiscord<taperfade> flex https://media.discordapp.net/attachments/371759389889003532/1149283464974188595/image.png
10:04:46*azimut_ joined #nim
10:06:19FromDiscord<taperfade> i should learn how to use json
10:06:21FromDiscord<taperfade> ngl
10:07:27*azimut quit (Ping timeout: 246 seconds)
10:09:18*gst joined #nim
10:09:54*gst is now known as deon
10:10:49*deon is now known as deon_d
10:11:30FromDiscord<sOkam! 🫐> how do you make nimble in 2.0 wake the F up to understand that your package is updated?
10:12:01FromDiscord<sOkam! 🫐> its locked in some weird old version, and doesn't even let me build because the old one is not installed anymore
10:13:11FromDiscord<odexine> do you have a lockfile in the repo
10:13:19FromDiscord<odexine> it prolly says lock somewhere on the file
10:13:23FromDiscord<sOkam! 🫐> not that i know of
10:13:25FromDiscord<odexine> (edit) "file" => "filename"
10:13:27FromDiscord<odexine> check
10:13:54FromDiscord<odexine> i dont know how nimble 0.14 functions (i still use 0.13)
10:14:37PMunchsOkam, delete the cache folder in `~/.cache/nim`
10:15:18PMunchAnd consider deleting the `.nimble/pkgs` folder, I've had Nim pull a version from there instead of a newer version in pkgs2
10:15:32FromDiscord<sOkam! 🫐> that worked, ty πŸ™
10:15:37FromDiscord<sOkam! 🫐> it was the cachedir
10:15:52PMunchYeah I've had the same issue myself recently
10:16:00FromDiscord<sOkam! 🫐> In reply to @PMunch "And consider deleting the": yeah its what i did, but didn't remove the nimcache and it was searching for the old
10:16:36FromDiscord<taperfade> im just trying out some stuff rn
10:16:38FromDiscord<taperfade> but uhm
10:16:57FromDiscord<taperfade> Error: func keyword is not allowed in type descriptions, use proc with {.noSideEffect.} pragma instead
10:18:41FromDiscord<sOkam! 🫐> means that you are declaring a func as a type, which is not legal
10:18:51FromDiscord<taperfade> as a type =
10:18:52FromDiscord<taperfade> ?
10:18:53FromDiscord<taperfade> what
10:18:55FromDiscord<sOkam! 🫐> func is just sugarfor what that error is telling you to write instead
10:18:57FromDiscord<nnsee> post code to playground
10:19:07FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4FBe
10:19:27FromDiscord<taperfade> whats the nim equivalent to def in python
10:19:32FromDiscord<nnsee> proc
10:19:36FromDiscord<Phil> or func
10:19:38FromDiscord<Phil> or method
10:19:41FromDiscord<sOkam! 🫐> proc
10:19:56FromDiscord<sOkam! 🫐> he is new, doesn't need method in like the next 6months min
10:20:06FromDiscord<sOkam! 🫐> i don't ever even use method πŸ€·β€β™‚οΈ
10:20:18FromDiscord<Phil> tbh, me neither
10:20:19FromDiscord<nnsee> func is only for functional programming (can't have side effects)
10:20:33FromDiscord<sOkam! 🫐> but proc is literally the same, since it auto nosideffects
10:20:42FromDiscord<sOkam! 🫐> except you don't have to worry about the effects
10:20:59FromDiscord<sOkam! 🫐> (ofc its not the same, since func enforces it, but you get my point. its for learning)
10:21:05FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4FBg
10:21:12FromDiscord<taperfade> In reply to @nnsee "func is only for": what
10:21:14FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4FBg" => "https://play.nim-lang.org/#ix=4FBh"
10:21:15FromDiscord<kingterrytheterrible12> In reply to @jaar23 "thanks for noting on": You must learn on how to use epoll
10:21:18FromDiscord<taperfade> functional programming ?
10:21:27FromDiscord<nnsee> yes, a programming paradigm
10:21:30FromDiscord<sOkam! 🫐> In reply to @taperfade "what": ignore it, you don't need to care at all about that in the next 6months
10:21:40FromDiscord<Phil> In reply to @taperfade "functional programming ?": A very specific way to write code, really not the time yet for you to dive into if you're not familiar and starting out
10:21:41FromDiscord<taperfade> im gonna care rn
10:21:42FromDiscord<nnsee> a specific way of programming
10:21:43FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=4FBi
10:21:44FromDiscord<sOkam! 🫐> it like giga-confusing for little benefit when learning
10:21:49FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4FBj
10:21:52FromDiscord<taperfade> In reply to @nnsee "a specific way of": ohh
10:21:55FromDiscord<sOkam! 🫐> In reply to @taperfade "im gonna care rn": well you do you, you were warned
10:21:56FromDiscord<taperfade> like object oriented =
10:21:57FromDiscord<nnsee> if you don't know what it is, you don't need it
10:22:02FromDiscord<taperfade> (edit) "=" => "?"
10:22:10FromDiscord<nnsee> yes, that's another one
10:22:35FromDiscord<sOkam! 🫐> In reply to @taperfade "like object oriented ?": yes, except its the opposite of OOP... oop works like your brain does, FP works like the absolute exact opposite
10:22:53PMunchHaha, unless you're a mathematician :P
10:22:59FromDiscord<sOkam! 🫐> its giga-confusing to learn, takes a lot of practice and ieven then its not for everyone
10:23:05PMunchHonestly once you get used to FP it's not that confusing
10:23:27FromDiscord<sOkam! 🫐> > once you get used to ...↡thats the problematic part
10:23:31FromDiscord<nnsee> some people's brains are wired differently and FP makes more sense than OOP
10:23:37FromDiscord<taperfade> Error: type mismatch: got 'string' for 'readLine(stdin)' but expected 'int'
10:23:42FromDiscord<taperfade> that worked earlier
10:23:55FromDiscord<nnsee> post code
10:24:02FromDiscord<taperfade> embarrasing
10:24:07FromDiscord<taperfade> im trying it out
10:24:11FromDiscord<taperfade> so its rlly bad
10:24:16FromDiscord<nnsee> no worries
10:24:45FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4FBk
10:24:50FromDiscord<taperfade> sent a long message, see http://ix.io/4FBl
10:24:52FromDiscord<sOkam! 🫐> In reply to @taperfade "Error: type mismatch: got": you were probably asigning the value to something that allowed it to be a string, but now you don't and its complaining about types↡since you said you come from python, you really need to start thinking about types with nim↡in python literally every single item is a string. even non-strings are just strings↡but in nim types are actual types
10:25:03FromDiscord<taperfade> In reply to @taperfade "`echo "1" var x:int": im following a tutorial rn
10:25:16FromDiscord<nnsee> readLine always returns a string, but you're trying to assign it to an integer
10:25:32FromDiscord<sOkam! 🫐> In reply to @taperfade "`echo "1" var x:int": readline gives you a string, but the variable holds an int, and you cannot assign that incorrect type
10:25:34FromDiscord<nnsee> you need to use the parseInt procedure to turn a string into an integer
10:25:42FromDiscord<taperfade> okie
10:25:45FromDiscord<sOkam! 🫐> ^
10:26:16FromDiscord<taperfade> whats the parseInt thingy
10:26:54FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4FBm
10:26:57FromDiscord<sOkam! 🫐> sent a code paste, see https://paste.rs/xjM7P
10:27:28FromDiscord<sOkam! 🫐> if you just \` code \` then discord doesn't give any syntax and long code becomes almost imposs to follow
10:27:43FromDiscord<taperfade> ohh okey
10:27:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "hmmm could you write": Oh, gotta try this↡Do I need to specify select the ID too?
10:28:06FromDiscord<Phil> In reply to @sys64 "Oh, gotta try this": yes, though I think that needs to be the last field
10:28:27FromDiscord<Phil> Though why do a raw select btw?
10:28:55FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4FBn
10:28:56FromDiscord<Phil> you could just have a list-select or whatever the proc is called with the entire string after "WHERE"
10:29:57FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4FBn" => "https://play.nim-lang.org/#ix=4FBo"
10:30:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "you could just have": and can I do an ORDER BY and LIMIT 10 with a normal select?
10:30:28FromDiscord<ieltan> In reply to @heysokam "its giga-confusing to learn,": I mean FP isn't that hard, pure functional programming however is a different case indeed
10:30:41FromDiscord<System64 ~ Flandre Scarlet> I have the same error without ""
10:30:46FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4FBp
10:30:53FromDiscord<sOkam! 🫐> In reply to @ieltan "I mean FP isn't": we were talking about a complete newbie to programming. missing some context of that sentence
10:31:00FromDiscord<System64 ~ Flandre Scarlet> Gotta try this
10:31:03FromDiscord<ieltan> Oh I see
10:31:08FromDiscord<ieltan> My bad
10:32:55FromDiscord<Phil> In reply to @sys64 "Gotta try this": Keep in mind, when you use `select` from norm: The "condition"-string that you hand it is literally just the part that you add after `WHERE`
10:33:35FromDiscord<Phil> Norm will always just generate a query of `SELECT <all the fields in correct order> FROM <table-name of the model> WHERE <the string you pass in as condition>`
10:34:32FromDiscord<Phil> So it is nearly as flexible as SQL can be.↡Just can't do crap like recursive queries or deal with views through it. That's what rawSelect is for
10:35:16FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "So it is *nearly*": Oooooh alright! It works! Thanks!↡Sad this case isn't documented
10:35:44*deon_d quit (Quit: Ping timeout (120 seconds))
10:35:45FromDiscord<Phil> Is it not?
10:36:41FromDiscord<System64 ~ Flandre Scarlet> I don't think so
10:36:54FromDiscord<Phil> Let me check, if so I'll add those in
10:38:25FromDiscord<taperfade> how do i call a function
10:38:28FromDiscord<taperfade> proc
10:40:47FromDiscord<taperfade> i feel like im doing it wrong
10:40:52FromDiscord<taperfade> for some reason
10:41:34FromDiscord<nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4FBw
10:41:58FromDiscord<nnsee> (edit) "https://play.nim-lang.org/#ix=4FBw" => "https://play.nim-lang.org/#ix=4FBx"
10:42:12FromDiscord<taperfade> https://media.discordapp.net/attachments/371759389889003532/1149293536118841415/image.png
10:42:22FromDiscord<Phil> In reply to @sys64 "I don't think so": We do not indeed. Created https://github.com/moigagoo/norm/issues/193↡I'll see that I can get moigagoo on board and get to implementing and merging that
10:43:17FromDiscord<nnsee> In reply to @taperfade "": you're not doing anything with the result of that proc (like echoing it or assigning it to a variable)
10:43:50FromDiscord<enthus1ast> Or 'discard' ing it
10:44:03FromDiscord<nnsee> if you want to call a procedure simply for its side effects and don't care about its return value, then you can prepend `discard` to it
10:44:39FromDiscord<taperfade> tbh
10:44:47FromDiscord<taperfade> idk how return works
10:45:01FromDiscord<taperfade> i didnt know in python too
10:47:02*jmdaemon quit (Ping timeout: 245 seconds)
10:47:55FromDiscord<nnsee> it ends the execution of that particular function and (optionally) returns a value (the "result") from inside the procedure to the caller
10:49:42FromDiscord<taperfade> uhh
10:49:49FromDiscord<taperfade> i dont get it
10:49:55FromDiscord<nnsee> which part
10:50:01FromDiscord<taperfade> all of what u said
10:50:25FromDiscord<nnsee> i can't elaborate if i don't know what you're confused ahout
10:50:43FromDiscord<taperfade> where does the value that gets returned go to ?
10:51:05FromDiscord<taperfade> (edit) removed "to"
10:52:45FromDiscord<taperfade> i added return but it still doesnt work
10:53:17FromDiscord<taperfade> https://media.discordapp.net/attachments/371759389889003532/1149296320578859080/image.png
10:54:38FromDiscord<nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4FBA
10:55:27FromDiscord<taperfade> ooo
10:55:30FromDiscord<taperfade> i get it now th
10:55:31FromDiscord<taperfade> thx
10:55:32FromDiscord<nnsee> note that in my procedure, I used `return`, but this isn't strictly necessary - you can choose to leave this out and it would still work (this is called an implicit return)
10:55:53FromDiscord<taperfade> In reply to @taperfade "": this is still happening tho
10:56:23FromDiscord<nnsee> post code?
10:57:08FromDiscord<taperfade> sent a long message, see http://ix.io/4FBD
10:57:21FromDiscord<_nenc> you must use let or var to assign
10:57:27FromDiscord<taperfade> (edit) "long message," => "code paste," | "http://ix.io/4FBD" => "https://play.nim-lang.org/#ix=4FBE"
10:57:31FromDiscord<taperfade> oh oops
10:57:41FromDiscord<_nenc> sent a code paste, see https://play.nim-lang.org/#ix=4FBF
10:58:19FromDiscord<taperfade> YES https://media.discordapp.net/attachments/371759389889003532/1149297588433068052/image.png
10:58:24FromDiscord<Phil> Sweet!
10:58:30FromDiscord<Phil> Looking good
10:59:09FromDiscord<taperfade> getting used to the new syntax
10:59:20FromDiscord<taperfade> coming from python my baby boo
10:59:33FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "We do not indeed.": Alright!↡Norm isn't bad, but it lacks documentations in some part↡But yeah, not as powerful as EntityFramework or Laravel's Eloquent
10:59:54FromDiscord<System64 ~ Flandre Scarlet> (edit) "In reply to @isofruit "We do not indeed.": Alright!↡Norm isn't bad, but it lacks documentations in some part↡But yeah, not as powerful as ... EntityFramework" added "C#'s"
11:02:29FromDiscord<Phil> In reply to @sys64 "Alright! Norm isn't bad,": Ouch, right where it hurts πŸ˜„ ↡And that was after we already wrote so much↡Nah, it's fair, some blindspots neither moigagoo nor I can spot simply because at this point we've both used it too much and understand it too well
11:02:48FromDiscord<Phil> The fact that a condition is basically everything after "WHERE" was obvious to me but you are entirely correct that it isn't obvious
11:02:58FromDiscord<Phil> (edit) "The fact that a condition is basically everything after "WHERE" was obvious to me but you are entirely correct that it isn't obvious ... " added "and should be documented"
11:03:30FromDiscord<Phil> (edit) "In reply to @sys64 "Alright! Norm isn't bad,": Ouch, right where it hurts πŸ˜„ ↡And that was after we already wrote so much↡Nah, it's fair, some blindspots ... neithernotice" added "in the docs" | "can spot" => "notice"
11:03:45*advesperacit quit (Ping timeout: 255 seconds)
11:04:26*advesperacit joined #nim
11:04:39FromDiscord<taperfade> now
11:04:47FromDiscord<taperfade> time to make malicious software
11:04:58FromDiscord<taperfade> jk
11:05:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "The fact that a": Yeah it might be confusing for some people↡But let's be honnest, despite of not being as powerful as EntityFramework or Eloquent, it still does its job, and it does quite well
11:05:46FromDiscord<System64 ~ Flandre Scarlet> the setup is also way simpler than Eloquent or EntityFramework
11:06:34FromDiscord<Phil> In reply to @sys64 "Yeah it might be": I wish we had a more simple way to do many-to-X queries instead of separate procs
11:06:50FromDiscord<taperfade> how do i send data to a webhook
11:06:57FromDiscord<Phil> But that requires some serious additional code and neither of us have that kind of ORM experience to write that in a manner that won't result in a clusterfuck
11:07:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "I wish we had": Yeah, that would be pretty useful↡Or being able to store seqs / arrays in an ORM objet, I think both Entity and Eloquent support this
11:08:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "But that requires some": I won't be able to contribute, ORMs are black boxes for me, it just works
11:08:20FromDiscord<Phil> In reply to @sys64 "Yeah, that would be": I mean you can do that, no?↡Just write it as a custom datatype and add the necessary `to`, `dbVal` procs etc.
11:08:34FromDiscord<Phil> See here https://norm.nim.town/customDatatypes.html
11:09:01FromDiscord<Phil> You'd be storing said seq most likely as a string though and then receive it as a string and parse it back to your thing
11:10:00FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "You'd be storing said": Well, it was for a relation like "A game has 4 players"
11:10:06FromDiscord<nnsee> sent a code paste, see https://paste.rs/jcHc8
11:10:16FromDiscord<taperfade> In reply to @nnsee "here's some other tips": flexxing on me
11:10:22FromDiscord<taperfade> im gonna do it this time
11:10:23FromDiscord<nnsee> no, just giving you tips
11:11:25FromDiscord<Phil> In reply to @sys64 "Well, it was for": If you plan on having 4 be a fixed limit I'd have had 4 FK-fields to your Player model, all of them optional
11:11:54FromDiscord<Phil> So you can fetch the playerdata immediately as well since you would be interested in having that
11:12:19FromDiscord<System64 ~ Flandre Scarlet> I took the problem in reverse and went the way "One player has a game"
11:12:26FromDiscord<System64 ~ Flandre Scarlet> (edit) "has" => "belongs to"
11:12:33FromDiscord<Phil> That or you'd have a separate, dedicated "PlayerGameMembership" Table for a many-to-many relationship between players and games
11:12:49FromDiscord<Phil> (edit) "games" => "games↡With just 3 fields: id, gameId and playerId"
11:13:06FromDiscord<System64 ~ Flandre Scarlet> It's one to many↡Because one player belongs to one, and only one game
11:13:55FromDiscord<Phil> In that case to model that correctly yeah, it'd indeed be player model having FK to a game field and I assume that needs to be optional as a player may be in a game right now or they might not be (and be in a lobby or so instead) ?
11:14:04FromDiscord<Chronos [She/Her]> Anyone know of something with Nim bindings that I can use for 3D physics with Naylib? Want to get physics for stuff like hair swishing or clothes moving
11:14:10FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4FBJ
11:14:22FromDiscord<Phil> Ma man out there building bomberman
11:14:52FromDiscord<Chronos [She/Her]> Hm?
11:15:08FromDiscord<Phil> Nah, more directed at system64 since a player in their model has bombs
11:15:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "Nah, more directed at": Oh lol↡It's bomb in a shoot them up↡It's a powerful attack that harms all on screen enemies at once
11:16:09FromDiscord<System64 ~ Flandre Scarlet> yeah, I'm building an online SHMUP
11:16:23FromDiscord<Phil> Sick!
11:16:31FromDiscord<Phil> (edit) "Sick!" => "Sick (as in: Cool) !"
11:17:22FromDiscord<System64 ~ Flandre Scarlet> Yeah! But very hard to do
11:17:28FromDiscord<ache of head> wicked (as in impressive)
11:17:30FromDiscord<odexine> In reply to @isofruit "Sick (as in: Cool)": Sick as in diseased
11:18:23FromDiscord<System64 ~ Flandre Scarlet> There is not even interpolation or extrapolation, but I use it on a local network so that's okay↡But would be interesting to mention that in my document
11:19:13FromDiscord<odexine> In reply to @sys64 "There is not even": You can add that later kinda
11:19:18FromDiscord<nnsee> neat (as in interesting)
11:19:24FromDiscord<odexine> Would prolly need a good bit of refactoring but eh
11:19:25FromDiscord<taperfade> how do i send stuff to a webhook ugh
11:19:54FromDiscord<nnsee> In reply to @taperfade "how do i send": you perform a http request with the parameters defined in the Discord API documentation
11:21:31FromDiscord<taperfade> uh
11:21:36FromDiscord<taperfade> yeah
11:22:09FromDiscord<taperfade> how do i send "abc" to a site
11:22:31FromDiscord<taperfade> a text to a site like idk google or smth
11:22:33FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "You can add that": I'll see if I have time
11:22:56FromDiscord<toma400> sent a long message, see http://ix.io/4FBO
11:22:56FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "Would prolly need a": https://github.com/system64MC/tfe/tree/develop↡The code is a bit messy lol
11:23:20FromDiscord<ache of head> In reply to @taperfade "a text to a": do you necessarily need a webhook for that?
11:23:30FromDiscord<taperfade> ugh
11:23:33FromDiscord<ache of head> i haven't done anything in nim in some time now
11:23:34FromDiscord<toma400> (actually this is why I loved Nim, it had just as smooth installation process as Rust or Go while being Python-like and having C performance; all those C/C++/C#/Java setup is really making me feel sick)
11:23:34FromDiscord<taperfade> im gonna give up
11:23:36FromDiscord<ache of head> let alone webhooks
11:23:42FromDiscord<taperfade> it so easy
11:23:44FromDiscord<taperfade> in python
11:23:46FromDiscord<ache of head> but wouldn't a simple network request do it?
11:23:47FromDiscord<toma400> (edit) "http://ix.io/4FBO" => "http://ix.io/4FBP"
11:23:51FromDiscord<taperfade> i just send data to a webhook
11:23:53FromDiscord<taperfade> boom
11:24:10FromDiscord<taperfade> i dont want to request
11:24:12FromDiscord<taperfade> i want to send stuff
11:24:50FromDiscord<Chronos [She/Her]> In reply to @isofruit "Nah, more directed at": h
11:24:51FromDiscord<Chronos [She/Her]> ah
11:26:10FromDiscord<ache of head> but isn't a webhook just a post request?
11:26:18FromDiscord<ache of head> as far as my limited knowledge goes
11:26:21FromDiscord<taperfade> idk what u mean
11:27:36FromDiscord<nnsee> In reply to @taperfade "i dont want to": that's what a request is
11:27:45FromDiscord<nnsee> it's just "sending data"
11:27:58FromDiscord<nnsee> and it's as easy in python as it is in nim
11:28:45FromDiscord<ache of head> In reply to @taperfade "idk what u mean": https://nim-lang.org/docs/httpclient.html#using-http-post
11:29:01FromDiscord<taperfade> In reply to @nnsee "and it's as easy": doesnt seem like it
11:29:54FromDiscord<nnsee> well show us your code so far
11:30:03FromDiscord<nnsee> and tell us what exactly you're having trouble with
11:32:02FromDiscord<System64 ~ Flandre Scarlet> Btw does Norm sanitize user input?
11:33:10FromDiscord<sOkam! 🫐> In reply to @toma400 "Thanks, that makes it": yeah i know the feel really well
11:33:45FromDiscord<sOkam! 🫐> For the wrapping, you really don't need to learn C at all↡Its all about buildsystem management, not about C coding
11:34:15FromDiscord<sOkam! 🫐> you could learn months just learning buildsystems without touching a line of C ever
11:34:22FromDiscord<sOkam! 🫐> (edit) "learn" => "spend"
11:34:44FromDiscord<System64 ~ Flandre Scarlet> C and its build system aaaaah
11:35:17FromDiscord<taperfade> In reply to @nnsee "well show us your": uhhh
11:35:34FromDiscord<taperfade> im reading the thing
11:35:40FromDiscord<taperfade> but it doesnt make sense to me
11:36:07FromDiscord<Chronos [She/Her]> I am struggling to choose what physics engine I should use (I'm gonna have to write bindings anyway since they're all C++)
11:36:10FromDiscord<taperfade> https://nim-lang.org/docs/httpclient.html#request%2CAsyncHttpClient%2C%2Cstring%2CHttpHeaders%2CMultipartData
11:36:45FromDiscord<sOkam! 🫐> In reply to @sys64 "C and its build": literal reason why I made confy to begin with. make/cmake/scons/ninja/mason made me sick of working with them πŸ˜”
11:37:39FromDiscord<sOkam! 🫐> its all targeted at extremely heavy DIY... and its like.... FFS! stop askig me to rewrite my damn buildsystem for every single hello world, provide some damn project sane defaults!
11:37:48FromDiscord<System64 ~ Flandre Scarlet> This is also why I avoid C/C++ as much as possible↡Including the fact those languages are unsafe
11:37:55FromDiscord<nnsee> In reply to @taperfade "https://nim-lang.org/docs/httpclient.html#request%2": that's a pretty low level procedure, use one of the many helpers https://nim-lang.org/docs/httpclient.html#post%2CAsyncHttpClient%2C%2Cstring%2CMultipartData
11:38:10FromDiscord<sOkam! 🫐> In reply to @sys64 "This is also why": cpp with all warnings active is actually crazy safe
11:38:26FromDiscord<sOkam! 🫐> its only unsafe if you go out of rails and ignore the warnings
11:38:41FromDiscord<System64 ~ Flandre Scarlet> Who care about warningsβ†΅πŸ€£
11:38:42FromDiscord<sOkam! 🫐> cannot say the same about C, c has no rails
11:39:03FromDiscord<sOkam! 🫐> In reply to @sys64 "Who care about warnings": said the person who thought cpp was unsafe πŸ€·β€β™‚οΈ πŸ˜„ πŸ˜„ guess why that is!
11:39:10FromDiscord<ache of head> In reply to @taperfade "https://nim-lang.org/docs/httpclient.html#request%2": https://nim-lang.org/docs/httpclient.html#postContent%2CAsyncHttpClient%2C%2Cstring%2CMultipartData
11:39:11FromDiscord<ache of head> what about this?
11:39:39FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "said the person who": Yeah↡I have another problem with C++ : the syntax
11:39:51FromDiscord<sOkam! 🫐> jokes aside, Nim has a much more robust ttype system, but cpp is actually pretty good if you don't do stoopid stuff
11:40:00FromDiscord<sOkam! 🫐> In reply to @sys64 "Yeah I have another": yeah that i agree with a lot
11:40:16FromDiscord<taperfade> https://media.discordapp.net/attachments/371759389889003532/1149308145680777318/image.png
11:40:19FromDiscord<sOkam! 🫐> well, i::agree::with... sorry, had to avoid a nameclash πŸ™ˆ
11:40:23FromDiscord<taperfade> marked all the things i dont understand red
11:40:37FromDiscord<ache of head> i just sent you a different proc that does what you want to do
11:40:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "well, i::agree::with... sorry, had": Never do using std
11:40:50FromDiscord<␀ Array> how can i do preprocessor directives? like `#define` `#ifdef` in C?also is it possible to overwrite a nim directive?
11:40:58FromDiscord<nnsee> In reply to @taperfade "": please read what i and ache of head said
11:41:03FromDiscord<taperfade> In reply to @ab9st8 "i just sent you": thats literally what u sent me
11:41:11FromDiscord<ache of head> no, you must have clicked on your own link
11:41:18FromDiscord<ache of head> the proc i sent is `postContent`
11:41:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "jokes aside, Nim has": Yeah, very robust↡Sometimes it's annoying you can't do something like uint64 + uint8 but I understand the intention
11:42:00FromDiscord<sOkam! 🫐> In reply to @sys64 "Yeah, very robust Sometimes": that's actually a real good thing
11:42:01FromDiscord<taperfade> In reply to @ab9st8 "the proc i sent": whats the body ??
11:42:08FromDiscord<taperfade> and what is multipart data
11:42:08FromDiscord<sOkam! 🫐> becuase those types are not the same AT ALL lol
11:42:13FromDiscord<ache of head> the body is the content of the request you want to make
11:42:27FromDiscord<sOkam! 🫐> (edit) "thing" => "thing↡becuase those types are not the same AT ALL lol"
11:42:30FromDiscord<ache of head> i dont think you should worry about multipart data
11:42:34FromDiscord<odexine> In reply to @taperfade "and what is multipart": You can ignore that
11:42:36FromDiscord<ache of head> i think it's a default argument
11:42:43FromDiscord<taperfade> and what is future{string]
11:42:46FromDiscord<System64 ~ Flandre Scarlet> The worst thing is Javascript↡Does it even have types??
11:43:08FromDiscord<ache of head> a future is a peculiar type related to asynchronous operations
11:43:13FromDiscord<ache of head> they're not specific to nim
11:43:16FromDiscord<toma400> In reply to @sys64 "Who care about warnings": Me who literally makes `deprecated` warning which entirely rebuilds procedure in next version XD↡↡(but for real, I'm quite afraid someone will also ignore those and after everything have that surprise moment when the app starts behaving weirdly πŸ˜…)
11:43:22FromDiscord<ache of head> https://en.wikipedia.org/wiki/Futures_and_promises
11:43:28FromDiscord<sOkam! 🫐> In reply to @taperfade "whats the body ??": functions with `input :Type = value` mean that you can ignore those input arguments because they are given a default value that most of the time is supposed to work normally wihtout providing them
11:43:36FromDiscord<ache of head> Future[string] is the return type of `postContent`
11:43:45FromDiscord<sOkam! 🫐> (edit) "In reply to @taperfade "whats the body ??": functions with `input :Type = value` mean that you can ignore those input arguments because they are given a default value that most of the time is supposed to work normally wihtout providing ... them" added "them↡thats what the = is for in"
11:43:47FromDiscord<ieltan> In reply to @sys64 "The worst thing is": Yes, it's just duck typed
11:44:09FromDiscord<System64 ~ Flandre Scarlet> In reply to @ieltan "Yes, it's just duck": Also↡Php
11:44:21FromDiscord<ache of head> as far as i know the easiest way to think of a future is "a thing that might have a value in the future"
11:44:31FromDiscord<ache of head> because an http request doesn't necessarily have to succeed
11:44:32FromDiscord<ieltan> In reply to @sys64 "Also Php": Same
11:44:32FromDiscord<sOkam! 🫐> In reply to @toma400 "Me who literally makes": that's someone elses problem for ignoring the warnings in the first place πŸ™ˆ
11:44:34FromDiscord<toma400> In reply to @heysokam "For the wrapping, you": That's relieving, I will try to find some small lib to see how much I understand wrapping system. Thanks for being here for all my concerns by the way ❀️
11:44:36FromDiscord<taperfade> whadd https://media.discordapp.net/attachments/371759389889003532/1149309238930325524/image.png
11:44:45FromDiscord<ieltan> I think all language are "typed"
11:44:59FromDiscord<nnsee> In reply to @taperfade "whadd": it expects something after the colon, but instead the file ended
11:45:01FromDiscord<toma400> In reply to @heysokam "that's someone elses problem": Yeah, I'm also quite "idiot-proofing" person, so will keep warning after changing the code for 1-2 subversions I think
11:45:04FromDiscord<nnsee> (End of File)
11:45:11FromDiscord<taperfade> In reply to @nnsee "it expects something after": what does it expect tho
11:45:38FromDiscord<nnsee> a statement?
11:45:43FromDiscord<taperfade> ok ig
11:45:46FromDiscord<taperfade> idk
11:45:51FromDiscord<sOkam! 🫐> In reply to @toma400 "That's relieving, I will": no worries. ask away as you need. this topic is hella confusing to start working with, but its actually really good and simple. its just that there is almost no info on practical examples, and the tutorials are super lacking↡but the system itself is super good, so no worries if you need to ask whatever along the way
11:45:52FromDiscord<taperfade> anyway new problem
11:46:03FromDiscord<Phil> In reply to @sys64 "Btw does Norm sanitize": I'd need to check, I don't think so off the top of my head
11:46:04FromDiscord<nnsee> why are you putting a colon there in the first place
11:46:06FromDiscord<ieltan> Are you following a tutorial? I suggest reading the Nim manual, it shows you how the syntax works etc
11:46:31FromDiscord<ieltan> Tuts tells you how to do something but not how the language works typically
11:46:36FromDiscord<taperfade> i put in the URL in the part where the URL goes and it says it expected Type(???) instead of the fucking url
11:47:15FromDiscord<ache of head> In reply to @taperfade "whadd": you dont have to input all the default arguments
11:47:23FromDiscord<sOkam! 🫐> In reply to @taperfade "i put in the": if you crop the code its difficult to understand the context in which you are using `:` and its impossible to help
11:47:40FromDiscord<ieltan> Yeah I was gonna say that
11:48:02FromDiscord<ache of head> i might be wrong but it seems to me you dont have a basic understanding of nim syntax before going as deep as web reauests
11:48:12FromDiscord<ieltan> https://nim-lang.org/docs/manual.html#procedures
11:48:32FromDiscord<ieltan> a must read if you want to understand what's going on in the docs
11:48:32FromDiscord<ache of head> read the book from the nim-lang.org page, it’s concise, reads quickly and gets you up to speed if you have experience with python like you daid
11:48:45FromDiscord<taperfade> https://media.discordapp.net/attachments/371759389889003532/1149310283597217833/image.png https://media.discordapp.net/attachments/371759389889003532/1149310283865665536/image.png
11:49:06*kenran joined #nim
11:49:10FromDiscord<taperfade> In reply to @ab9st8 "i might be wrong": ur making me very mad
11:49:53FromDiscord<taperfade> In reply to @ab9st8 "read the book from": https://tenor.com/view/spongebob-patrick-star-boring-weak-melted-ice-cream-gif-17184539
11:50:09FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4FBU
11:50:10*jjido joined #nim
11:50:33FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4FBV
11:50:44FromDiscord<ieltan> didnt give `body` a default argument, i'll leave that to you :p
11:51:18FromDiscord<taperfade> In reply to @heysokam "<@1111014250446585866> get used to": <:GO_catStanding:1133402101205192734>
11:51:26FromDiscord<ieltan> but honestly just reading the manual will avoid you those little pains, sorry if i come across as dismissive but it's true
11:51:41FromDiscord<sOkam! 🫐> if someone wants to give you a simple fix, they cant↡because they have to rewrite your example completely letter by letter manually
11:51:55FromDiscord<taperfade> In reply to @ieltan "didnt give `body` a": what is a default argument
11:51:58FromDiscord<ieltan> you would know its `body = "blabla"` instead of `body: "blabla"` if you did
11:51:59FromDiscord<sOkam! 🫐> but if you use a codeblock, they can just repost your own code fixed
11:52:08FromDiscord<nnsee> In reply to @taperfade "": that's not how you call procedures that are already defined (like the ones we linked you) - that's how you define new ones
11:52:09FromDiscord<spotlightkid> > Images are even banned in most programming discords↡> What a great idea. can we have that here as well, please?
11:52:13FromDiscord<sOkam! 🫐> In reply to @taperfade "what is a default": an argument that you dont need to provide, becuase its given a default value
11:52:40FromDiscord<ieltan> In reply to @taperfade "what is a default": a default argument is the value you want an argument to have in a procedure when you dont specify it at call site
11:52:43FromDiscord<taperfade> oh wait
11:52:51FromDiscord<taperfade> im embarrased
11:52:53FromDiscord<sOkam! 🫐> (edit) "In reply to @taperfade "what is a default": an argument that you dont need to provide, becuase its given a default value ... " added "that its meant to work well when not provided"
11:52:58FromDiscord<ieltan> its okay lol
11:53:33FromDiscord<taperfade> im gonna leave this server and do it this time
11:53:37FromDiscord<sOkam! 🫐> In reply to @spotlightkid "> Images are even": what about gamedev? are we not allowed to share screenshots or what? πŸ˜”
11:54:07FromDiscord<sOkam! 🫐> its a good thing that they are not banned here, at least some people can post their progress without having to external upload
11:54:27FromDiscord<taperfade> In reply to @spotlightkid "> Images are even": https://tenor.com/view/1984-gif-19260546
11:54:36FromDiscord<taperfade> literally 1984
11:54:36FromDiscord<sOkam! 🫐> gifs are banned though
11:54:41FromDiscord<sOkam! 🫐> #offtopic has them
11:54:46FromDiscord<odexine> GIFs are not banned
11:54:48FromDiscord<odexine> Embeds are
11:54:53FromDiscord<odexine> You can upload a GIF
11:54:55FromDiscord<sOkam! 🫐> ah well, yeah same idea
11:55:26FromDiscord<taperfade> In reply to @spotlightkid "> Images are even": https://media.discordapp.net/attachments/371759389889003532/1149311963411791943/1984.gif
11:55:34FromDiscord<spotlightkid> yeah, but I find it astonishing how many programmer's apparently think the way to show code is to make a screenshot πŸ™„
11:55:57FromDiscord<sOkam! 🫐> ^ its just easier to sshot, than to copypaste and add a codeblock
11:56:02FromDiscord<ieltan> yeah it's kinda annoying
11:56:05FromDiscord<sOkam! 🫐> if you have a sshot tool, its super fast
11:56:15FromDiscord<sOkam! 🫐> its not better, just fast
11:56:30FromDiscord<ieltan> would be bearable if we had the assyst bot or another bot that can do ocr
11:56:35FromDiscord<ieltan> imo
11:56:51FromDiscord<ieltan> but feels like an overkill to invite a bot for the sole purpose of reading text in images
11:56:53FromDiscord<spotlightkid> the markdown triple-backtick syntax is arkward to type, but you could automate that too.
11:57:11FromDiscord<ieltan> Assyst bot automatically puts text in codeblock
11:57:26FromDiscord<ieltan> it's just not color formatted
11:58:28emeryprogramers sharing screenshots is a sure sign that we are going into a software dark age
12:01:55FromDiscord<taperfade> this is getting so annoying
12:01:58FromDiscord<taperfade> im gonna sleep
12:02:03FromDiscord<taperfade> and try again tomorrow
12:02:21FromDiscord<toma400> Unironically sleeping or making a break is great idea, it lets you look at problem with different perspective
12:02:46FromDiscord<taperfade> In reply to @toma400 "Unironically sleeping or making": unironically ....
12:02:49FromDiscord<taperfade> ok byebe
12:03:01FromDiscord<taperfade> i will continue complaining abt my mistakes tomorrow
12:03:25FromDiscord<toma400> Haha, sure, have a good rest ^^
12:23:31FromDiscord<toma400> sent a code paste, see https://play.nim-lang.org/#ix=4FC7
12:26:20FromDiscord<vindaar> `getColors` is a procedure, so `getColors("1")` instead of `getColors["1"]`
12:27:25FromDiscord<toma400> Oh gosh, that's right XD
12:27:34FromDiscord<toma400> Thanks for the answer, such a silly mistake to make πŸ˜…
12:27:46FromDiscord<vindaar> The error message indicates that you give it a generic type, but it doesn't expect one. Because `getColors[<type>]` would instantiate a generic. Hence the confusing error here
12:29:03FromDiscord<toma400> Now that makes sense, this error was indeed really making me wonder what it was even about ^^
12:30:58*lumo_e joined #nim
12:31:35FromDiscord<arnetheduck> sent a code paste, see https://play.nim-lang.org/#ix=4FC9
12:37:51*rockcavera joined #nim
12:46:41FromDiscord<nnsee> from glancing at it - if v is true, then it returns 32, otherwise 42
12:46:43FromDiscord<nnsee> right?
12:47:45FromDiscord<frobnicate> Aren't you guaranteed a finally always runs?
12:48:06FromDiscord<nnsee> i would assume the return returns early, no?
12:48:24FromDiscord<frobnicate> πŸ€·β€β™€οΈ
12:48:36FromDiscord<nnsee> nope, you're right
12:48:45FromDiscord<nnsee> it's 32 for both
12:49:04FromDiscord<Chronos [She/Her]> Wow I hate that lmao
12:49:17FromDiscord<frobnicate> Why?
12:49:23FromDiscord<Chronos [She/Her]> I would've assumed the return statements returns as soon as it can - before the finally statement
12:49:24FromDiscord<frobnicate> It's how finally is supposed to work
12:49:39FromDiscord<frobnicate> Well that breaks the idea of using try catch finally
12:49:44FromDiscord<Chronos [She/Her]> Never actually used `finally` so it makes brain go brr
12:49:53FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4FCg
12:49:57FromDiscord<frobnicate> You need to be sure finally runs in case of cleanup or error
12:50:11FromDiscord<Chronos [She/Her]> That makes sense, just not something I expected
12:50:22FromDiscord<frobnicate> It's ok, try catch is ugly anyway
12:50:24FromDiscord<Chronos [She/Her]> Though it does make sense when actually thinking
12:50:26FromDiscord<Chronos [She/Her]> Lol
12:51:17FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4FCg" => "https://play.nim-lang.org/#ix=4FCi"
12:52:05FromDiscord<nnsee> In reply to @frobnicate "It's ok, try catch": sure, but how about we design an entire language around that pattern? https://ntietz.com/blog/introducing-hurl/
12:52:52FromDiscord<frobnicate> The only reason it's weird here, is because you're touching result in the finally. But you can imagine doing a try on a file and doing some work to it, if it fails we want to handle the error flow, if it success we want to return the new file maybe, regardless we want to close the file
12:53:12FromDiscord<frobnicate> That's how you're supposed to use it
12:53:33FromDiscord<sOkam! 🫐> side-note: are exceptions in nim implemented with setjmp/longjump in the background? πŸ€”
12:53:49FromDiscord<nnsee> In reply to @frobnicate "The only reason it's": isn't that what defer is for, though?
12:54:07FromDiscord<frobnicate> You don't defer on an exception do you?
12:54:12FromDiscord<sOkam! 🫐> (edit) "side-note:" => "side-question:"
12:55:06FromDiscord<frobnicate> But yes, it's essentially the same. Defer is just a newer concept as far as I'm aware
12:55:34FromDiscord<nnsee> In reply to @frobnicate "You don't defer on": i in all honesty don't know
12:55:53FromDiscord<nnsee> iirc araq wanted to deprecate defer a while ago
12:55:54FromDiscord<nnsee> https://github.com/nim-lang/RFCs/issues/236
12:56:04FromDiscord<toma400> sent a code paste, see https://play.nim-lang.org/#ix=4FCj
12:56:50FromDiscord<frobnicate> Oh ok defer does the same as try finally, just a lexical difference
12:57:18FromDiscord<frobnicate> But in the wild I usually see using or try finally
12:57:32FromDiscord<toma400> sent a code paste, see https://play.nim-lang.org/#ix=4FCm
13:00:55FromDiscord<ieltan> foreach
13:01:04FromDiscord<ieltan> (edit) "does nim has aforeach ... " added "proc ?"
13:01:42FromDiscord<frobnicate> for
13:02:23FromDiscord<Chronos [She/Her]> Why would it need one? I actually don't get the use of it when the `for` statement is sane (like in Nim)
13:02:34FromDiscord<ieltan> yes but i have conditional that i don't want to span across 3 lines
13:02:39FromDiscord<frobnicate> for <item> in <range>
13:02:40FromDiscord<ieltan> (edit) "conditional" => "conditionals"
13:02:58FromDiscord<frobnicate> Then just write it on one line
13:03:09FromDiscord<Chronos [She/Her]> Could even make a template?
13:03:15FromDiscord<frobnicate> That too
13:04:03FromDiscord<ieltan> my usecase is `if (condition) or (["some", "item"] in someSeq): doStuff()`
13:04:38FromDiscord<ieltan> `in` or `contains` only take one item to check if its in the container
13:04:39FromDiscord<Chronos [She/Her]> Why do you need a for statement there then...?
13:04:47FromDiscord<Chronos [She/Her]> Ah
13:04:52FromDiscord<Chronos [She/Her]> Okay that makes sense
13:04:59FromDiscord<frobnicate> You wanna check they're all in there?
13:05:15FromDiscord<ieltan> to see if any item in `["some", "item"]` is in `someSeq`
13:05:26FromDiscord<ieltan> In reply to @frobnicate "You wanna check they're": if only one of them is
13:05:27FromDiscord<frobnicate> Do you want any or all?
13:05:32FromDiscord<ieltan> any
13:05:42FromDiscord<frobnicate> That's what in already does?
13:08:39FromDiscord<ieltan> doesnt seem like it: https://play.nim-lang.org/#ix=3rY1
13:08:46FromDiscord<ieltan> argh wait
13:08:59FromDiscord<ieltan> https://play.nim-lang.org/#ix=4FCv
13:09:04FromDiscord<ieltan> (edit) "https://play.nim-lang.org/#ix=3rY1" => "https://play.nim-lang.org/#ix=4FCv"
13:13:49FromDiscord<kingterrytheterrible> its insane after you get used to linux your productivity skyrockets
13:14:20FromDiscord<kingterrytheterrible> even development is faster on linux
13:15:12FromDiscord<Chronos [She/Her]> Don't say that to the Windows fan πŸ˜›
13:16:21FromDiscord<kingterrytheterrible> freedom is priceless↡(@Chronos [She/Her])
13:16:50FromDiscord<kingterrytheterrible> with linux i dont have to worry about microsoft adding something i dont like to my OS and i cant even remove it
13:17:19FromDiscord<Chronos [She/Her]> That's fair
13:17:20FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4FCx
13:17:39FromDiscord<enthus1ast> True you must be worried about the gnome guys \typeahead search gone hemhem\
13:18:07FromDiscord<kingterrytheterrible> who even uses gnome
13:18:10FromDiscord<kingterrytheterrible> i use cosmic
13:19:26FromDiscord<sOkam! 🫐> In reply to @kingterrytheterrible "i use cosmic": nice SEO lol πŸ™ˆ
13:19:46FromDiscord<kingterrytheterrible> huh
13:20:03FromDiscord<sOkam! 🫐> i mean i cannot even find it on google, because the name is so generic
13:20:14FromDiscord<kingterrytheterrible> type "cosmic DE"
13:20:23PMunchkingterrytheterrible12, Cosmic?
13:20:27FromDiscord<kingterrytheterrible> its by pop os
13:21:01FromDiscord<kingterrytheterrible> how do you guys not know what cosmic DE is
13:21:20FromDiscord<kingterrytheterrible> https://github.com/pop-os/cosmic-epoch
13:21:30FromDiscord<sOkam! 🫐> @System64 ~ Flandre Scarlet I found and impostor πŸ‘€πŸ‘€ https://media.discordapp.net/attachments/371759389889003532/1149333622931869706/image.png
13:21:41FromDiscord<kingterrytheterrible> https://github.com/pop-os/cosmic
13:21:57FromDiscord<kingterrytheterrible> yes↡(@sOkam! 🫐)
13:23:09PMunchI'm confused, the last link says it requires Gnome..
13:23:50FromDiscord<kingterrytheterrible> because it is gnome
13:24:00FromDiscord<ieltan> It's a GNOME "distro" so to speak thats why
13:24:04FromDiscord<kingterrytheterrible> an unfucked gnome
13:24:20FromDiscord<sOkam! 🫐> In reply to @kingterrytheterrible "how do you guys": this is probably why https://media.discordapp.net/attachments/371759389889003532/1149334336315871262/image.png
13:24:28FromDiscord<sOkam! 🫐> its a niche within ubuntu
13:25:01FromDiscord<ieltan> By the way, I heard pop!_os has really great general hardware support
13:25:15FromDiscord<ieltan> like better battery life compared to most distros
13:25:22FromDiscord<enthus1ast> Now the question is, does all the cosmic open,save etc dialogs support typeahead search
13:26:45FromDiscord<kingterrytheterrible12> what does that mean
13:26:47FromDiscord<kingterrytheterrible> what does that mean
13:26:56FromDiscord<kingterrytheterrible12> matrix glitching
13:27:01FromDiscord<sOkam! 🫐> sounds like they are going their own way, though https://media.discordapp.net/attachments/371759389889003532/1149335012668362792/image.png
13:27:52FromDiscord<kingterrytheterrible12> In reply to @heysokam "sounds like they are": yes
13:28:03FromDiscord<sOkam! 🫐> the day two developers agree on one thing... the world will probably end the very next second, im telling you πŸ™ˆ
13:28:30FromDiscord<kingterrytheterrible12> In reply to @heysokam "the day two developers": nah seriously gnome is so horrible
13:28:44FromDiscord<sOkam! 🫐> i don't even use a DE, so I have no reference at all
13:28:52FromDiscord<sOkam! 🫐> mouse workflow is ugggh
13:28:54FromDiscord<kingterrytheterrible12> WM?
13:29:02FromDiscord<sOkam! 🫐> awesomewm, yeah
13:29:11FromDiscord<sOkam! 🫐> barely touch the mouse for anything
13:29:19FromDiscord<kingterrytheterrible12> you can make...comsic a WM yk
13:29:22FromDiscord<kingterrytheterrible12> its a 2 in 1
13:29:39*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
13:29:49FromDiscord<kingterrytheterrible12> https://media.discordapp.net/attachments/371759389889003532/1149335715386232923/image.png
13:29:51FromDiscord<sOkam! 🫐> except mouse workflow, yk. that sounds more like a -2 in 1 to me πŸ˜”
13:30:15FromDiscord<kingterrytheterrible12> In reply to @heysokam "except mouse workflow, yk.": donno just dont like WM
13:30:19FromDiscord<sOkam! 🫐> tiling wm are just obnoxiously fast to work with when you have a good set of keybinds in place
13:30:59FromDiscord<kingterrytheterrible12> yeah you do you ngl
13:31:01FromDiscord<enthus1ast> It means that you can type a filename in a folder etc, and it is highlighted. Gnome thinks it's a better idea to just search through your harddrive
13:31:03FromDiscord<sOkam! 🫐> although this is turning into offtopic, so I will stop the thread
13:31:08FromDiscord<kingterrytheterrible12> In reply to @enthus1ast "It means that you": yes
13:31:40FromDiscord<kingterrytheterrible12> https://media.discordapp.net/attachments/371759389889003532/1149336181323083806/image.png
13:32:08FromDiscord<kingterrytheterrible12> In reply to @heysokam "although this is turning": alright
13:33:05FromDiscord<enthus1ast> Let's go to offtopic \:)
13:33:17FromDiscord<kingterrytheterrible12> alr
13:56:55FromDiscord<toma400> In reply to @ieltan "if only one of": That's a nice way of using those, woah 😍
13:58:31FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "<@380360389377916939> I found and": Eject him!
14:01:17*lumo_e quit (Quit: Quit)
14:02:20*rockcavera quit (Remote host closed the connection)
14:02:40*rockcavera joined #nim
14:02:41*rockcavera quit (Changing host)
14:02:41*rockcavera joined #nim
14:08:19*PMunch quit (Quit: Leaving)
14:17:05FromDiscord<ieltan> In reply to @toma400 "That's a nice way": It's also pretty easy to implement: https://play.nim-lang.org/#ix=4FCM
14:17:25FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4FCN
14:18:05FromDiscord<odexine> that's a misleading proc though
14:18:31FromDiscord<odexine> should prolly have a different name
14:19:13FromDiscord<ieltan> well yeah, you don't know if it should check if "one of" or "all of" `a` is in `b`
14:19:30FromDiscord<gbolahan> Hey guys! New to Nim here.. Is there a vscode extension that could give information on functions when hovered, or could help find the reference
14:21:05FromDiscord<ieltan> yes, the nim-saem extension in the vscode marketplace
14:23:55FromDiscord<gbolahan> Great! Works perfectly. Thank you @ieltan
14:46:13FromDiscord<toma400> In reply to @ieltan "It's also pretty easy": Sorry, I meant to reply to sOkam, not sure what happened here with my reply XD
14:46:48FromDiscord<toma400> sent a code paste, see https://play.nim-lang.org/#ix=4FCU
14:48:15*junaid_ joined #nim
14:58:04*xet7_ quit (Remote host closed the connection)
15:01:00*kenran quit (Quit: ERC 5.6-git (IRC client for GNU Emacs 30.0.50))
15:02:59*xet7 joined #nim
15:13:39FromDiscord<gbolahan> Anyone with any idea why this might be happening↡>↡The nim extension works with all the other small nim projects I wrote when learning the langauge, but it doesn’t seem to work while I'm trying to read and navigate a large codebase I just cloned
15:19:29FromDiscord<sOkam! 🫐> In reply to @gbolahan "Anyone with any idea": "works" and "doesn't work" are not compiler messages. we have no context of what is happening with the lib
15:19:55FromDiscord<sOkam! 🫐> the compiler will be telling you why in command line when you invoke it
15:22:07FromDiscord<gbolahan> Pardon me if I don’t understand how it really works, but I'm talking about the extension. The one that helps with syntax highlighting, Goto definition etc↡I need to use the Goto definition in large projects but it doesn’t seem to work
15:24:25FromDiscord<enthus1ast> I've disabled most stuff from the extention, and just left code highlight etc turned on, its quite buggy unfortunately↡(@gbolahan)
15:25:16FromDiscord<enthus1ast> I now use global project search or straightforward grep (there also is nimgrep)
15:28:10FromDiscord<enthus1ast> Idk if its the fault of the extension or if its nimsuggest
15:33:05FromDiscord<solitudesf> In reply to @gbolahan "Pardon me if I": extension relies on nimsuggest, and nimsuggest is very unreliable.
15:38:15FromDiscord<nnsee> In reply to @gbolahan "Anyone with any idea": i use the nimlsp extension (requires you to install the nimlsp binary separately) and in my experience, it works a tad bit more reliably
15:50:10*xet7 quit (Remote host closed the connection)
16:22:57FromDiscord<kingterrytheterrible12> why isnt there an offical nim extenstion
16:25:28FromDiscord<Chronos [She/Her]> Too much work to maintain, probably
16:25:45FromDiscord<Chronos [She/Her]> Also no-one really wants to take on that duty either
16:27:42FromDiscord<toma400> Also, Nim seems like harsh language to parse, especially given flexible AST considering custom macros
16:28:27FromDiscord<toma400> I'm using PyCharm extension, and while it's really amazing, I really wish it had recognision of libraries imported, since neither highlighting nor middle-clicking work with those
16:29:01FromDiscord<toma400> It tends to even skip a lot of highlighting/middle-click/refactoring support for method-written procs
16:29:22FromDiscord<toma400> I'm not surprised tho, I can't imagine to write something parsing so flexible monster as Nim
16:29:25FromDiscord<toma400> (edit) "as" => "like"
16:29:44*ntat joined #nim
16:30:00FromDiscord<Chronos [She/Her]> I think work on Nimsuggest needs to be done to end up improving the tooling in general
16:33:40FromDiscord<odexine> In reply to @toma400 "Also, Nim seems like": not harsh to parse, harsh to analyse
16:41:50*junaid_ quit (Remote host closed the connection)
16:43:09FromDiscord<toma400> In reply to @odexine "not harsh to parse,": Maybe that's better worded, yeah
17:09:22*jmdaemon joined #nim
17:12:55FromDiscord<catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4FDN
17:13:22FromDiscord<catnowblue> (edit) "https://play.nim-lang.org/#ix=4FDN" => "https://play.nim-lang.org/#ix=4FDO"
17:13:53FromDiscord<catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4FDP
17:13:59FromDiscord<catnowblue> (edit) "https://play.nim-lang.org/#ix=4FDO" => "https://play.nim-lang.org/#ix=4FDQ"
17:14:05FromDiscord<catnowblue> here's how it implements
17:14:52*ntat quit (Quit: leaving)
17:16:12*xet7 joined #nim
17:16:37*jmdaemon quit (Ping timeout: 245 seconds)
17:22:40FromDiscord<System64 ~ Flandre Scarlet> @treeform Hi, is it normal a client can communicate with a server if both are on the same machine but if one of them is on a different machine, it doesn't work?
17:23:02FromDiscord<System64 ~ Flandre Scarlet> With Netty
17:31:10FromDiscord<griffith1deadly> In reply to @sys64 "<@107140179025735680> Hi, is it": port open?
17:31:31FromDiscord<griffith1deadly> for non local connection
17:32:14FromDiscord<griffith1deadly> if no, u can use some proxy. ↡radmin, hamachi, ngrok
17:33:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "port open?": they are on the same network
17:34:12FromDiscord<griffith1deadly> In reply to @sys64 "they are on the": if so you maybe use incorrect ip address for connection
17:34:46FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "if so you maybe": No because the Web server works well
17:35:42FromDiscord<griffith1deadly> hm, looks like netty problem, real
17:37:26FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "hm, looks like netty": OOF, so this is a big problem
17:38:41FromDiscord<griffith1deadly> In reply to @sys64 "OOF, so this is": can you check default sockets?
17:39:30FromDiscord<griffith1deadly> https://github.com/treeform/netty/blob/master/src/netty.nim#L463
17:39:40FromDiscord<griffith1deadly> with this configuration
17:40:10FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "can you check default": The server uses defined ports
17:49:16FromDiscord<toma400> Why is some procs in Nim 2.0 in `std/private/osdirs`, ones like `walkFiles`?
17:49:30FromDiscord<toma400> Weren't they available from higher hierarchy place in 1.x?
17:53:44FromDiscord<solitudesf> In reply to @toma400 "Why is some procs": osdirs is imported and reexported by os
18:00:30FromDiscord<odexine> not sure why exactly they were split off but they resemble the new Path type based api `std/[paths, files, dirs]`
18:02:11FromDiscord<treeform> In reply to @sys64 "<@107140179025735680> Hi, is it": It’s probably network setup related. Netty can work anywhere and has worked with various setups.
18:03:04FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "It’s probably network setup": Is it related to the opened ports of my box?↡Both machines are on the same network
18:07:21*FromDiscord quit (Remote host closed the connection)
18:07:34*FromDiscord joined #nim
18:10:38FromDiscord<System64 ~ Flandre Scarlet> Do I have to punch trough or something?
18:20:08*ntat joined #nim
18:21:47NimEventerNew thread by hevaf: How to get the string of all command line parameters except the first parameter ?, see https://forum.nim-lang.org/t/10466
18:22:15*jjido joined #nim
18:40:30*ntat quit (Quit: leaving)
18:50:48FromDiscord<toma400> In reply to @solitudesf "osdirs is imported and": Ooh, I see. Would be nice to have clearer info/redirection in docs that they are available under `os` one, I keep getting into private one and copying into imports πŸ˜…
18:51:27*krux02 joined #nim
18:55:37FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "It’s probably network setup": I think I'll do a minimal reproductible exemple to figure out what the problem is
19:15:53*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
19:16:58*jmdaemon joined #nim
19:18:39FromDiscord<treeform> In reply to @sys64 "I think I'll do": Networking is a complex topic, not sure I can explain it. https://en.wikipedia.org/wiki/NAT_traversal
19:19:05FromDiscord<treeform> But basically you can never hit a home computer from outiside the local network.
19:19:28FromDiscord<treeform> That's what multiple computiers hittin a centreal server is so popular.
19:19:46FromDiscord<treeform> (edit) "computiers hittin" => "computers hitting" | "centreal" => "central"
19:19:58FromDiscord<treeform> You can setup your router to do port forward though, and some times it works.
19:20:12FromDiscord<treeform> https://en.wikipedia.org/wiki/Port_forwarding
19:20:44FromDiscord<treeform> Your router will prevent from pretty much any packets from the internet hitting your computer, unless you talked to them first.
19:21:07FromDiscord<treeform> Punch trough is another complex topic, you need to understand the first two before doing that.
19:22:35FromDiscord<treeform> https://www.liveswitch.io/hs-fs/hubfs/4%20-%20blog%20images/STUN-Server-diagram.gif?
19:22:41FromDiscord<treeform> (edit) "https://www.liveswitch.io/hs-fs/hubfs/4%20-%20blog%20images/STUN-Server-diagram.gif?" => "https://www.liveswitch.io/hs-fs/hubfs/4%20-%20blog%20images/STUN-Server-diagram.gif"
19:23:18*jmdaemon quit (Ping timeout: 246 seconds)
19:24:13FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "But basically you can": But everything is in local
19:25:08FromDiscord<System64 ~ Flandre Scarlet> It's just 2 different machines, but both are in the same network
19:27:10FromDiscord<treeform> then I have no clue
19:27:31FromDiscord<treeform> some times routers have two networks for 4g and not wifi and ground
19:27:41FromDiscord<treeform> (edit) "some times routers have two networks for 4g ... andold" added "wifi" | "not" => "old"
19:27:47FromDiscord<treeform> (edit) "ground" => "wired"
19:27:54FromDiscord<treeform> are you sure you have the correct local ip address?
19:28:04FromDiscord<treeform> are you sure you don't have like windows firewall running?
19:28:15FromDiscord<treeform> There is just too much to debug network connections
19:28:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "are you sure you": Yeah sure because I can interact with the REST API without any problems↡Windows Firewall is disabled
19:28:54FromDiscord<treeform> SO TCP (HTTP) works and UDP does not?
19:28:57FromDiscord<treeform> thats very strange
19:29:26FromDiscord<treeform> I would test a very simple UDP server next
19:30:05FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "I would test a": I'll do an MRI too and test↡If it doesn't work, there is a problem
19:30:30*jmdaemon joined #nim
19:39:26FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "I would test a": MRI failed https://media.discordapp.net/attachments/371759389889003532/1149428734865195028/netty.zip
19:39:30FromDiscord<System64 ~ Flandre Scarlet> here is some code
19:56:20FromDiscord<treeform> `var server = newReactor("127.0.0.1", 51730)`
19:56:28FromDiscord<treeform> ^ here is your error you are listentin on local host
19:56:38FromDiscord<treeform> you need to listen on outisde IP address `0.0.0.0`
19:56:53FromDiscord<treeform> This should be true for TCP as well?
19:57:02FromDiscord<kingterrytheterrible12> the infamous treeform is here
19:57:13FromDiscord<kingterrytheterrible12> thanks for supporting the nim community with all your libs
19:57:30FromDiscord<treeform> thank you!
19:57:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "you need to listen": I should listen on 0.0.0.0?
19:59:20FromDiscord<treeform> yes?
19:59:34FromDiscord<treeform> I am sure your HTTP server does
19:59:51FromDiscord<treeform> 127.0.0.1 address can only be hit from that same computer
19:59:56FromDiscord<treeform> it can't be hit from the outside
20:00:32FromDiscord<treeform> 0.0.0.0 can be hit from the outside
20:00:52FromDiscord<treeform> you can also listen to your outside router address
20:01:08FromDiscord<kingterrytheterrible12> https://github.com/treeform/genny
20:01:17FromDiscord<treeform> usually 192.168.1.10 or 10.0.0.5 or some thing like that.
20:01:21FromDiscord<kingterrytheterrible12> In reply to @kingterrytheterrible12 "https://github.com/treeform/genny": treeform wtf is the gc yes or no mean in here?
20:01:24FromDiscord<treeform> But 0.0.0.0 is juste asier
20:02:20FromDiscord<treeform> In reply to @kingterrytheterrible12 "treeform wtf is the": The GC column? https://media.discordapp.net/attachments/371759389889003532/1149434495246802944/image.png
20:02:24FromDiscord<kingterrytheterrible12> In reply to @treeform "The GC column?": yes
20:02:26*jjido joined #nim
20:02:51FromDiscord<treeform> It means that we tie the GC to the language.
20:03:04FromDiscord<treeform> So when making binding for python we integrate python's GC so that it works.
20:03:11FromDiscord<treeform> Garbage Collector
20:03:21FromDiscord<treeform> C has no Garbage Collector so that will always be a no
20:03:34FromDiscord<kingterrytheterrible12> what about node?
20:03:36FromDiscord<treeform> Node.js has a Garbage Collector, but I could not figure out how to bind it with jsffi.
20:03:47FromDiscord<treeform> jsffi does not expose Garbage Collector
20:03:52FromDiscord<treeform> so a different way is required
20:03:55FromDiscord<treeform> I did not know when I started
20:04:00FromDiscord<treeform> (edit) "I did not know ... when" added "that"
20:04:03FromDiscord<kingterrytheterrible12> hm so if i want to use it with node i have to use manual memory managment?
20:04:22FromDiscord<treeform> Yes you have to call newX and freeX
20:04:26FromDiscord<treeform> just like you do in C
20:04:27FromDiscord<treeform> not ideal
20:04:38FromDiscord<kingterrytheterrible12> damn
20:04:43FromDiscord<kingterrytheterrible12> what about arc?
20:04:49FromDiscord<kingterrytheterrible12> and use malloc?
20:04:52FromDiscord<kingterrytheterrible12> (edit) "use malloc?" => "useMalloc?"
20:16:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "C has no Garbage": Boehm GC is a thing, but not really tied to the language
20:24:20FromDiscord<Phil> In reply to @sys64 "I should listen on": Other than examples for using ORDER BY and LIMIT, any other examples you believ emisisng?
20:24:44FromDiscord<Phil> (edit) "believ emisisng?" => "believe misisng?"
20:26:30FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "Other than examples for": Not at this moment
20:26:55*jjido quit (Quit: Textual IRC Client: www.textualapp.com)
20:56:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "But 0.0.0.0 is juste": It works! Thanks!
21:03:07*advesperacit quit ()
21:32:53*rockcavera quit (Read error: Connection reset by peer)
21:33:38*rockcavera joined #nim
21:33:38*rockcavera quit (Changing host)
21:33:38*rockcavera joined #nim
21:43:57FromDiscord<taperfade> hii
21:44:00FromDiscord<taperfade> i just woke up
21:48:05FromDiscord<toma400> hello πŸ‘‹ ^^
21:48:51*azimut_ quit (Ping timeout: 246 seconds)
21:55:10FromDiscord<taperfade> uhhhh
21:55:34FromDiscord<taperfade> sent a code paste, see https://play.nim-lang.org/#ix=4FFn
21:55:47FromDiscord<taperfade> im confused
21:55:54FromDiscord<kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4FFo
21:55:55FromDiscord<taperfade> nope
21:55:56FromDiscord<kingterrytheterrible12> so i can spam it
21:56:05FromDiscord<taperfade> nuh uh
21:56:12FromDiscord<kingterrytheterrible12> what if i say pretty please
21:56:15FromDiscord<kingterrytheterrible12> with a cherry on top
21:56:22FromDiscord<taperfade> still not
21:57:01FromDiscord<kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4FFp
21:57:02FromDiscord<kingterrytheterrible12> your missing an arg i think
21:57:33FromDiscord<taperfade> i dont get what i should do
21:57:52FromDiscord<taperfade> bcs i have the client and url and content to send
22:01:41FromDiscord<ache of head> man
22:01:45FromDiscord<ache of head> why are u still using the request proc
22:02:01FromDiscord<ache of head> there's a proc in the module which literally just webhook
22:02:04FromDiscord<ache of head> (edit) "webhook" => "webhooks"
22:02:36FromDiscord<ache of head> In reply to @ab9st8 "https://nim-lang.org/docs/httpclient.html#postConte": this one
22:03:06FromDiscord<ache of head> as far as my limited webhook knowledge goes
22:03:15FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4FFq
22:05:29FromDiscord<ache of head> In reply to @ab9st8 "as far as my": going one by one in the arguments: `client` is that thing you created with `newAsyncHttpClient()`; `url` is where you wanna webhook (i think that's your `webhook` var); `body` is the actual content of the request and you don't have to worry about `multipart` just skip that
22:05:43FromDiscord<kingterrytheterrible12> bro how to heap allocate in nim
22:05:47FromDiscord<kingterrytheterrible12> or gc decides?
22:06:24FromDiscord<ache of head> sent a code paste, see https://play.nim-lang.org/#ix=4FFs
22:07:13FromDiscord<ache of head> (edit) "https://play.nim-lang.org/#ix=4FFs" => "https://play.nim-lang.org/#ix=4FFt"
22:08:05FromDiscord<ache of head> sent a code paste, see https://play.nim-lang.org/#ix=4FFu
22:09:21FromDiscord<ache of head> your snippet doesn't work because you provide `client` as an argument twice, once in the prefix-dot syntax and once in-between parentheses
22:09:34FromDiscord<ache of head> you should decide on one way you prefer and use it consistently
22:10:26FromDiscord<raynei486> In reply to @kingterrytheterrible12 "bro how to heap": why are you manually allocating memory?
22:10:28FromDiscord<raynei486> https://nim-lang.org/docs/system.html#alloc.t,Natural
22:10:44FromDiscord<kingterrytheterrible12> In reply to @raynei486 "why are you manually": so who decides what goes where
22:11:33FromDiscord<ache of head> In reply to @ab9st8 "you should decide on": also you wanted to webhook which is a POST request; if you really want to use the `request` proc you should also provide the `httpMethod` argument (which normally defaults to GET as you can see, instead put `HttpPost` there)
22:11:37FromDiscord<raynei486> In reply to @kingterrytheterrible12 "so who decides what": ?
22:11:40FromDiscord<ache of head> In reply to @kingterrytheterrible12 "so who decides what": the gc
22:11:43FromDiscord<kingterrytheterrible12> In reply to @raynei486 "?": ????
22:11:50FromDiscord<ache of head> but you can also go gcless
22:11:51FromDiscord<ache of head> afaik
22:11:54FromDiscord<raynei486> yeah
22:12:03FromDiscord<kingterrytheterrible12> alright
22:12:08FromDiscord<raynei486> you can manage your own memory
22:12:19FromDiscord<ache of head> weren't there like a couple of gc modes available as well
22:12:22FromDiscord<ache of head> arc and orc
22:12:23FromDiscord<raynei486> just usually not necessary
22:12:31FromDiscord<ache of head> (no idea what the difference is)
22:12:53FromDiscord<kingterrytheterrible12> In reply to @ab9st8 "(no idea what the": arc will leak with cycles
22:12:55FromDiscord<kingterrytheterrible12> orc doesnt
22:13:01FromDiscord<kingterrytheterrible12> in nim 2.0 orc is the default
22:13:08FromDiscord<ache of head> man you do know this stuff
22:13:15FromDiscord<ache of head> why are you asking for help then πŸ’€
22:13:32FromDiscord<kingterrytheterrible12> because idk why nim keeps what goes on the heap obscure
22:13:42FromDiscord<kingterrytheterrible12> it doesnt say if the gc allocates on the heap or not
22:14:01FromDiscord<ache of head> …where else is it supposed to allocate?
22:14:10FromDiscord<ache of head> unless i'm not getting something obvious, it's pretty late here and i'm half dead
22:14:15FromDiscord<kingterrytheterrible12> it could be like boehm in C where i allocate but never free using `GC_malloc`
22:15:29FromDiscord<raynei486> In reply to @ab9st8 "…where else is it": you can allocate from a static buffer
22:15:38FromDiscord<raynei486> (common in C)
22:15:43FromDiscord<ache of head> huh
22:15:51FromDiscord<ache of head> i've never heard about that
22:16:07FromDiscord<ache of head> oh you just mean static variables
22:16:31FromDiscord<kingterrytheterrible12> in here
22:16:33FromDiscord<kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4FFw
22:16:39FromDiscord<kingterrytheterrible12> where the fuck is result coming from
22:16:45FromDiscord<taperfade> sent a code paste, see https://play.nim-lang.org/#ix=4FFx
22:16:59FromDiscord<raynei486> sent a code paste, see https://play.nim-lang.org/#ix=4FFy
22:17:14FromDiscord<taperfade> im getting smarter by learning nim but i feel like im actually not making any progress
22:18:37FromDiscord<raynei486> sent a code paste, see https://play.nim-lang.org/#ix=4FFz
22:18:46FromDiscord<raynei486> `ptr` are a different story
22:18:57FromDiscord<kingterrytheterrible12> In reply to @raynei486 "`ptr` are a different": ok
22:19:20FromDiscord<raynei486> sent a code paste, see https://play.nim-lang.org/#ix=4FFA
22:19:34FromDiscord<raynei486> (edit) "https://play.nim-lang.org/#ix=4FFA" => "https://play.nim-lang.org/#ix=4FFB"
22:19:39FromDiscord<taperfade> how do i use the string or discard it
22:20:14FromDiscord<kingterrytheterrible12> In reply to @taperfade "how do i use": just `discard functionName`
22:23:40FromDiscord<ache of head> In reply to @taperfade "im getting smarter by": how are you learning?
22:23:48FromDiscord<ache of head> like what are you using to learn
22:26:47FromDiscord<Elegantbeef> `result` is an implicitly declared variable for any procedure that has a return type that's not void↡(@kingterrytheterrible12)
22:27:01FromDiscord<kingterrytheterrible12> In reply to @Elegantbeef "`result` is an implicitly": FUCKING NEAT
22:27:02FromDiscord<kingterrytheterrible12> I LIEK IT
22:27:16FromDiscord<Elegantbeef> Both of those examples are bad though imo
22:27:56FromDiscord<Elegantbeef> Much more sane
22:27:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4FFD
22:28:05FromDiscord<kingterrytheterrible12> you just
22:28:06FromDiscord<kingterrytheterrible12> fucked it
22:28:10FromDiscord<kingterrytheterrible12> whats sane about it
22:28:37FromDiscord<raynei486> turned all the assignments into a construction
22:28:43FromDiscord<Elegantbeef> Using object construction, not using `result.field =`
22:28:46FromDiscord<Elegantbeef> Constructors generally are just expressions so keep it that way
22:29:19FromDiscord<Elegantbeef> Generally if an expression suffices it's best to be used
22:29:24FromDiscord<kingterrytheterrible12> sooo use `ref` makes sure the object is heap allocated?
22:29:26FromDiscord<raynei486> btw beef how did you become a language lawyer for Nim
22:29:36FromDiscord<kingterrytheterrible12> In reply to @raynei486 "btw beef how did": bsns
22:29:42FromDiscord<Elegantbeef> Write a lot of Nim and you can then become one
22:29:50FromDiscord<Elegantbeef> `ref` is a memory safe pointer
22:29:59FromDiscord<raynei486> ^
22:30:11FromDiscord<raynei486> you use it where you use pointers (like for aliasing)
22:30:22FromDiscord<kingterrytheterrible12> In reply to @Elegantbeef "`ref` is a memory": and its pointing to where
22:30:24FromDiscord<kingterrytheterrible12> stack or heap
22:30:30FromDiscord<kingterrytheterrible12> in c i can make pointer to stack
22:30:43FromDiscord<raynei486> In reply to @Elegantbeef "Write a lot of": I'm assuming you've been writing nim pre 1.0?
22:30:49FromDiscord<Elegantbeef> It is heap allocated
22:30:49FromDiscord<Elegantbeef> But `ref`s are memory safe
22:30:49FromDiscord<Elegantbeef> In Nim you can make pointers to stack too
22:31:04FromDiscord<Elegantbeef> They cannot dangle, they cannot be derefed when nil
22:31:11FromDiscord<catnowblue> In reply to @catnowblue "I'll never understand how": can anyone figured out what's going on :(
22:31:13FromDiscord<Elegantbeef> Nope I actually only started writing Nim in 2020
22:31:30FromDiscord<kingterrytheterrible12> In reply to @Elegantbeef "In Nim you can": how
22:31:36FromDiscord<Elegantbeef> `addr`
22:31:44FromDiscord<kingterrytheterrible12> alright
22:31:49FromDiscord<Elegantbeef> It's not suggested to use `ptr` unless you know what you're doing
22:32:01FromDiscord<kingterrytheterrible12> if i dont know what im doing i use ref?
22:32:07FromDiscord<Elegantbeef> Yes
22:32:08FromDiscord<kingterrytheterrible12> bc 99% ofthe time i dont
22:32:20FromDiscord<raynei486> or if you don't know why you use ref don't use ref
22:32:50FromDiscord<kingterrytheterrible12> will the gc prevent stack overflow
22:33:04FromDiscord<kingterrytheterrible12> like it allocates large objects on heap
22:33:12FromDiscord<Elegantbeef> In Nim to pass a mutable reference you just use `var T`, otherwise Nim will implicitly pass by reference where it sees fit
22:33:12FromDiscord<Elegantbeef> Of course not GC and stack overflow have no relation
22:33:29FromDiscord<Elegantbeef> Nim is relatively explicit about allocations
22:33:45FromDiscord<Elegantbeef> So nope there is no magic there
22:33:45FromDiscord<Elegantbeef> Most stack overflow happens due to recursion anyway
22:33:49FromDiscord<kingterrytheterrible12> so i should allocate large objects on heap
22:33:56FromDiscord<kingterrytheterrible12> with ref
22:35:10FromDiscord<Elegantbeef> I'm not going to say yes or no
22:35:15FromDiscord<Elegantbeef> That wholly depends on what you're doing
22:35:48FromDiscord<Elegantbeef> Like I said Nim implicitly passes objects by reference as parameters to procedures
22:36:04FromDiscord<Elegantbeef> So if you have a single instance that you just pass around there is not much reason to heap allocate it unless it's truly too large
22:36:21FromDiscord<jviega> Nim generally makes it far easier to keep stuff on the stack whenever feasible, which tends to be faster
22:36:28FromDiscord<kingterrytheterrible12> how is this possible
22:36:30FromDiscord<kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4FFF
22:36:40FromDiscord<gbolahan> In reply to @nnsee "i use the nimlsp": Probably have to check this out
22:36:43FromDiscord<kingterrytheterrible12> valgrind reports 1 allocation
22:36:43FromDiscord<kingterrytheterrible12> how
22:37:28FromDiscord<kingterrytheterrible12> is this a bug
22:37:40FromDiscord<raynei486> I'm assuming this is NRVO
22:37:53FromDiscord<raynei486> also iirc nim allocations don't get tracked in valgrind
22:37:58FromDiscord<raynei486> because it's not using malloc or something
22:38:08FromDiscord<raynei486> (edit) "also iirc nim allocations don't get tracked ... in" added "well"
22:38:13FromDiscord<kingterrytheterrible12> i gotta pass in `-d:useMalloc` right
22:38:18FromDiscord<raynei486> yeah
22:38:30FromDiscord<raynei486> although that'll make the program inefficient
22:38:43FromDiscord<kingterrytheterrible12> alr
22:38:45FromDiscord<raynei486> you're forcing the GC to do something it wasn't designed around
22:38:46FromDiscord<kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4FFG
22:38:47FromDiscord<kingterrytheterrible12> In reply to @raynei486 "although that'll make the": why?
22:39:13FromDiscord<raynei486> I'm not really deep in the compiler internals but I know it uses its own allocation techniques within
22:39:33FromDiscord<kingterrytheterrible12> how do i reserve capacity in sequences in nim
22:39:37FromDiscord<kingterrytheterrible12> like C++ vectos
22:39:40FromDiscord<kingterrytheterrible12> (edit) "vectos" => "vectors"
22:39:50FromDiscord<huantian> newSeqOfCa
22:39:51FromDiscord<jviega> `x = newSeqOfCap(120)`
22:39:52FromDiscord<huantian> (edit) "newSeqOfCa" => "newSeqOfCap"
22:39:55FromDiscord<Elegantbeef> It uses malloc instead of Nim's allocator, it's that simple
22:39:55FromDiscord<Elegantbeef> The performance curves are different between the two, benchmark if you care
22:39:56FromDiscord<Elegantbeef> `mySeq.setLen(size);mySeq.setLen(startSize)`
22:39:56FromDiscord<Elegantbeef> or `newSeqOfCap`
22:40:08FromDiscord<kingterrytheterrible12> of cap
22:40:14FromDiscord<kingterrytheterrible12> it has a limit?
22:40:21FromDiscord<huantian> cap as in capacity
22:40:27FromDiscord<jviega> No, it's the pre-alloc'd capacity
22:40:39FromDiscord<Elegantbeef> Yes it has a limit of 2^40 bytes or so
22:40:53FromDiscord<realqquantum> https://media.discordapp.net/attachments/371759389889003532/1149474397602713680/image.png
22:41:00FromDiscord<taperfade> In reply to @kingterrytheterrible12 "just `discard functionName`": i did discard postContent but it didnt do anything
22:41:13FromDiscord<huantian> In reply to @Elegantbeef "Yes it has a": dang that's not that big
22:41:13FromDiscord<Elegantbeef> Or your memory, whichever is smaller
22:41:21FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-discard-statement
22:41:30FromDiscord<kingterrytheterrible12> but why is it 200 allocations when im allocating 100?
22:41:36FromDiscord<kingterrytheterrible12> there is a copy somewhere
22:41:41FromDiscord<gbolahan> In reply to @gbolahan "Pardon me if I": I'd say what I really want is the Goto definition tbh
22:42:01FromDiscord<Elegantbeef> Right huan I could fit like maybe 1 2023 game in there
22:42:01FromDiscord<Elegantbeef> That allocates a string
22:42:01FromDiscord<Elegantbeef> You're echoing
22:42:18FromDiscord<kingterrytheterrible12> oh yeah lol
22:42:55FromDiscord<jviega> Most languages take big allocations from the OS and then dole them out internally, which is generally much faster than lots of mallocs, and is basically free, since calloc'd pages are mapped to all-zero pages until written, then you get copy-on-write semantics. So you're not taking up any real space even in a cache anywhere
22:43:34FromDiscord<kingterrytheterrible12> so i should avoid doing `--d:useMalloc"?
22:43:38FromDiscord<kingterrytheterrible12> (edit) "`--d:useMalloc"?" => "`--d:useMalloc`?"
22:43:51FromDiscord<huantian> it's probably a good idea to not use it unless you have a reason to
22:43:56FromDiscord<huantian> (eg using valgrind)
22:43:59FromDiscord<Elegantbeef> Unless you're doing embedded or a place where you need to remove Nim's allocator yes
22:44:18FromDiscord<kingterrytheterrible12> lets test if nim allocator is faster than use malloc
22:44:19FromDiscord<Elegantbeef> Just cause a switch exists doesnt mean it's supposed to be flicked
22:44:35FromDiscord<Elegantbeef> uh oh a low effort memory benchmark incoming
22:44:47FromDiscord<kingterrytheterrible12> xd
22:44:47FromDiscord<huantian> wait I'm not supposed to copy the list of compile flags and paste them into my nim.cfg
22:45:00FromDiscord<Elegantbeef> "I allocated 3000 contiguous memory blocks and there was no difference, malloc is goooder"
22:45:02FromDiscord<huantian> i thought they each give a 1% performance boost
22:45:03FromDiscord<kingterrytheterrible12> oh nim allocator is muuuch faster
22:45:22FromDiscord<kingterrytheterrible12> nvm its the same speed when i ran it again
22:45:27FromDiscord<Elegantbeef> Huan that's only true if you used a flame stencil to apply your thermal paste
22:45:43FromDiscord<huantian> wouldn't you want your thermal paste to be like an ice cube
22:45:52FromDiscord<Elegantbeef> Nah fire is faster
22:45:57FromDiscord<huantian> ah i see i see
22:46:08FromDiscord<Elegantbeef> If fire wasnt faster why would people put it on cars and think about rockets they use fire to move
22:47:06FromDiscord<taperfade> ugh https://media.discordapp.net/attachments/371759389889003532/1149475962690482226/image.png https://media.discordapp.net/attachments/371759389889003532/1149475962954711120/image.png
22:47:27FromDiscord<Elegantbeef> You arent doing `discar postContent(....)`
22:48:22FromDiscord<kingterrytheterrible12> In reply to @Elegantbeef ""I allocated 3000 contiguous": fair to me
22:48:29FromDiscord<kingterrytheterrible12> the memory has been allocated
22:48:38FromDiscord<kingterrytheterrible12> therefore i have benchmarked it
23:09:54FromDiscord<taperfade> can u guys give me example code on how to send data to a url
23:09:56FromDiscord<taperfade> im lost
23:11:16FromDiscord<Elegantbeef> https://nim-lang.org/docs/httpclient.html#using-http-post
23:21:02FromDiscord<taperfade> yoooo https://media.discordapp.net/attachments/371759389889003532/1149484502389887118/image.png
23:21:31FromDiscord<taperfade> how does let work
23:21:51FromDiscord<sOkam! 🫐> In reply to @taperfade "how does let work": its like const, but runtime
23:22:00FromDiscord<taperfade> whats const
23:22:03FromDiscord<taperfade> whats runtime
23:22:06FromDiscord<sOkam! 🫐> const can only be decided when you compile
23:22:17FromDiscord<taperfade>
23:22:18FromDiscord<sOkam! 🫐> let can only be decided when you run (aka runtime)
23:23:02FromDiscord<sOkam! 🫐> const == constant, aka something that cannot be changed (aka immutable in programming terms)↡let is runtime immutable, const is compiletime immutable. none of them can be changed when you assign them
23:23:23FromDiscord<sOkam! 🫐> let is dediced when you run the app, and const when you compile the app
23:24:04FromDiscord<taperfade> inever had to worry abt that in python
23:24:09FromDiscord<taperfade> im dumb ugh
23:24:12FromDiscord<taperfade> i thought i was smart
23:24:16FromDiscord<jviega> Because Python doesn't compile
23:24:26FromDiscord<taperfade> huh
23:25:33FromDiscord<jviega> When you run "nim c" it takes your code, and converts it into machine code, which runs on its own. When you run Python, it does create essentially cache files, but Python itself always is present, and interprets your code dynamically as you run
23:25:47FromDiscord<jviega> It's part of the story as to why Python is so much slower (50-100x)
23:26:03FromDiscord<sOkam! 🫐> In reply to @taperfade "inever had to worry": because python is the most unsafe language you will ever touch in your life
23:26:16FromDiscord<sOkam! 🫐> literal everything is a string, and its runtime only forever
23:26:27FromDiscord<sOkam! 🫐> (edit) "literal" => "literally"
23:26:30FromDiscord<taperfade> In reply to @jviega "When you run "nim": woah
23:26:32FromDiscord<taperfade> interesting
23:26:49FromDiscord<jviega> Not everything is a string in Python, where did you get that idea?
23:27:26FromDiscord<sOkam! 🫐> I understood the underlying representation of all types is strings, even if there is type explicitness built on top
23:27:40FromDiscord<jviega> No
23:27:56FromDiscord<jviega> Not even a little, that's never ever been the case
23:28:13FromDiscord<sOkam! 🫐> well I have been misinformed for a while, then. good to know
23:28:14FromDiscord<jviega> Not in the 30 years since I first started w/ Python
23:28:47FromDiscord<Elegantbeef> Lua uses tables πŸ˜„
23:28:58*krux02 quit (Remote host closed the connection)
23:29:32FromDiscord<taperfade> I JUST DEBUGGED SOMETHING MYSELF WITHOUT TUTORIALS
23:29:35FromDiscord<taperfade> im so fucking smart
23:29:41FromDiscord<taperfade> smartest girl alive
23:32:35*cm_ joined #nim
23:33:20*cm quit (Ping timeout: 258 seconds)
23:33:20*cm_ is now known as cm
23:46:55FromDiscord<gbolahan> Who here uses vscode because it just seems like my Goto definition only works for small files, or just the extension use in general↡I'm using nimsaem↡I've never been stressed like this in a long time
23:48:31FromDiscord<huantian> Sometimes I have to restart vscode to get goto to work
23:50:29FromDiscord<raynei486> In reply to @taperfade "I JUST DEBUGGED SOMETHING": step in the right direction