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:13 | FromDiscord | <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:00 | FromDiscord | <jaar23> In reply to @enthus1ast "btw nice project <@614403538172379156>,": thanks man, it is more like a mini queue. haha |
03:41:57 | NimEventer | New thread by DMisener: How to pass an optional callback to an a proc?, see https://forum.nim-lang.org/t/10464 |
03:50:59 | NimEventer | New thread by DMisener: How to pass an optional callback to a proc, see https://forum.nim-lang.org/t/10465 |
03:59:53 | FromDiscord | <jaar23> sent a code paste, see https://play.nim-lang.org/#ix=4FzU |
04:38:41 | FromDiscord | <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:08 | FromDiscord | <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:36 | FromDiscord | <toma400> (edit) "making statically linked libs" => "no dll-requiring libs." |
06:26:23 | FromDiscord | <Elegantbeef> Passing teh same as you would with C |
06:26:24 | FromDiscord | <Elegantbeef> Use either `{.passL:.}` inside your nim or inside a config |
06:38:24 | * | PMunch joined #nim |
07:32:22 | FromDiscord | <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:04 | FromDiscord | <Elegantbeef> Yes |
07:37:25 | FromDiscord | <Elegantbeef> The same way all variable pragmas are done on the symbol `const bleh {.deprecated.} = 300` |
07:39:54 | FromDiscord | <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:52 | FromDiscord | <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:12 | FromDiscord | <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:53 | FromDiscord | <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:45 | PMunch | Futhark can wrap both in a static and a dynamic way |
08:40:52 | FromDiscord | <taperfade> hii |
08:41:02 | PMunch | You just feed it header files and still have to figure out how to actually link/build with the library |
08:41:07 | PMunch | taperfade, hello |
08:41:09 | FromDiscord | <taperfade> i have an issue with installing nim |
08:42:40 | PMunch | Well that's not great |
08:42:43 | PMunch | What's the issue? |
08:42:53 | FromDiscord | <taperfade> nim command not found |
08:42:58 | FromDiscord | <taperfade> very weird |
08:43:11 | PMunch | Sounds like AV eating the binary |
08:43:20 | PMunch | You're on Windows? |
08:43:25 | FromDiscord | <taperfade> yea |
08:43:34 | PMunch | Either that or you haven't set your path properly |
08:43:47 | FromDiscord | <taperfade> how do i set my path |
08:43:59 | PMunch | I think finish.exe should do that for you |
08:44:00 | PMunch | Not sure |
08:44:06 | FromDiscord | <taperfade> it didnt |
08:44:22 | PMunch | Try opening a new terminal if you haven't already |
08:44:42 | PMunch | Can you `echo $PATH` on Windows? |
08:45:14 | FromDiscord | <taperfade> uhh |
08:45:17 | FromDiscord | <taperfade> i guess |
08:45:25 | FromDiscord | <taperfade> https://media.discordapp.net/attachments/371759389889003532/1149264147175976980/image.png |
08:45:34 | FromDiscord | <taperfade> im rlly lost |
08:46:36 | FromDiscord | <odexine> it would be `echo %PATH%` for windows |
08:46:47 | FromDiscord | <nnsee> on windows you can just do `path` iirc |
08:46:50 | PMunch | Haha, well that didn't do what I expected :P |
08:47:04 | FromDiscord | <odexine> windows doesnt usually do what you expect xd |
08:47:06 | FromDiscord | <odexine> i kid, of course |
08:47:20 | FromDiscord | <taperfade> im in the path folder |
08:47:31 | PMunch | It does exactly what I expected it to do, mess up other peoples computers :P |
08:47:39 | PMunch | Path folder? |
08:47:55 | FromDiscord | <taperfade> yeah |
08:48:04 | PMunch | What do you mean path folder? |
08:48:09 | FromDiscord | <taperfade> idk |
08:48:22 | PMunch | PATH is an environment variable that sets where Windows will look for binaries |
08:48:30 | FromDiscord | <taperfade> weirt |
08:48:32 | FromDiscord | <taperfade> weird |
08:48:35 | PMunch | It's not a folder |
08:48:36 | FromDiscord | <sOkam! π«> @taperfade https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path |
08:48:38 | FromDiscord | <taperfade> ok enough nim ig |
08:48:43 | FromDiscord | <taperfade> im a nim hater now |
08:48:52 | PMunch | You haven't even tried it.. |
08:48:56 | FromDiscord | <sOkam! π«> π |
08:49:06 | FromDiscord | <taperfade> In reply to @heysokam "<@1111014250446585866> https://unix.stackexchange.": im not on linux |
08:49:28 | FromDiscord | <sOkam! π«> In reply to @taperfade "im not on linux": oh whooops, my bad. that gave the wrong link |
08:49:53 | PMunch | What did `echo %PATH%` give you? |
08:49:58 | FromDiscord | <sOkam! π«> @taperfade https://windowsloop.com/how-to-add-to-windows-path/ this one sry |
08:50:24 | FromDiscord | <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:59 | FromDiscord | <sOkam! π«> also, don't just "wing it"... follow the instructions on the nim website |
08:51:15 | FromDiscord | <taperfade> In reply to @heysokam "also, don't just "wing": i did |
08:51:26 | FromDiscord | <taperfade> downloaded the installer |
08:51:30 | FromDiscord | <sOkam! π«> then add the path how that new link shows you |
08:51:43 | FromDiscord | <taperfade> add what to the path |
08:51:47 | FromDiscord | <sOkam! π«> if the installer didnt (which probably did but you just didn't reboot yet) |
08:51:59 | FromDiscord | <taperfade> In reply to @heysokam "if the installer didnt": i need to reboot windows |
08:52:01 | FromDiscord | <taperfade> ? |
08:52:09 | FromDiscord | <sOkam! π«> well yeah, windows wants to reboot for everything |
08:52:13 | FromDiscord | <taperfade> okie |
08:52:31 | FromDiscord | <taperfade> love my baby boo windows |
08:52:32 | FromDiscord | <sOkam! π«> if that doesn't work come back and we will guide you to what to add to the path on windows |
08:52:44 | FromDiscord | <taperfade> i tried linux and its just not usable |
08:52:48 | FromDiscord | <taperfade> im a linux hater |
08:52:51 | PMunch | Wait, you have to reboot Windows to add something to the path?! |
08:53:03 | FromDiscord | <taperfade> im very mean towards ppl telling me linux is better |
08:53:07 | FromDiscord | <sOkam! π«> In reply to @PMunch "Wait, you have to": π€·ββοΈ maybe with the choosenim installer |
08:53:08 | FromDiscord | <taperfade> bcs it isnt |
08:53:27 | PMunch | It's different, wouldn't recommend it to everyone |
08:53:31 | FromDiscord | <sOkam! π«> its different, and the os battle helps nothing here, so ... kinda silly to even bring it up |
08:53:43 | FromDiscord | <taperfade> yes |
08:53:50 | FromDiscord | <taperfade> bcs windows solos ur fav distro |
08:53:51 | FromDiscord | <sOkam! π«> just reboot and come back if that didn't work |
08:54:24 | FromDiscord | <Elegantbeef> Yea I've just been beating rocks for the past 10 years |
08:54:26 | FromDiscord | <Chronos [She/Her]> In reply to @taperfade "bcs it isnt": It varies from usecase to usecase |
08:54:36 | FromDiscord | <Chronos [She/Her]> For me? It's much better, I get much more control |
08:55:04 | FromDiscord | <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:06 | FromDiscord | <sOkam! π«> stop with the os battle, don't you see that he just doesn't care |
08:55:06 | FromDiscord | <nnsee> In reply to @taperfade "bcs windows solos ur": obvious bait |
08:55:30 | FromDiscord | <Chronos [She/Her]> Just pointing out it's preference and neither is objectively better |
08:55:33 | FromDiscord | <Elegantbeef> Suffice to say "linux is just not usable" is going to fall on deaf ears in most developer circles |
08:56:02 | FromDiscord | <Chronos [She/Her]> Yeah lmao |
08:56:06 | FromDiscord | <sOkam! π«> is there an existing stdlib tool to parse `(~0U)`, `(~0ULL)` and friends? |
08:56:10 | FromDiscord | <odexine> linux is not universally better than windowsβ΅and windows is not universally better than linux |
08:56:19 | FromDiscord | <taperfade> In reply to @odexine "linux is not universally": factually wrong |
08:56:43 | FromDiscord | <odexine> In reply to @taperfade "factually wrong": please provide your evidence, btw anecdotes arent evidence... |
08:56:44 | FromDiscord | <sOkam! π«> go to offtopic if you want to discuss operating system battles, ty |
08:56:56 | FromDiscord | <odexine> lol |
08:56:57 | FromDiscord | <taperfade> In reply to @odexine "please provide your evidence,": okey |
08:57:12 | FromDiscord | <nnsee> stop feeding the troll |
08:57:20 | FromDiscord | <ElegantBeouf> In reply to @odexine "please provide your evidence,": Windows lets you see outside, linux isnt even a word |
08:57:21 | PMunch | sOkam, don't think so, but feel free to steal the stuff from Opir |
08:57:23 | FromDiscord | <taperfade> In reply to @nnsee "stop feeding the troll": why are u now calling me troll |
08:57:50 | FromDiscord | <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:03 | PMunch | taperfade, 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:13 | FromDiscord | <taperfade> In reply to @PMunch "<@1111014250446585866>, because you're no": i fixed it |
08:58:23 | PMunch | Bu I see you have moved it to the off-topic channel, thanks :) |
08:58:29 | FromDiscord | <taperfade> now i can spread some silly little windows propaganda |
08:58:34 | FromDiscord | <odexine> In reply to @elegantbeef "Windows lets you see": but you can break a window |
08:58:51 | FromDiscord | <ElegantBeouf> You can tune a piano but you cannot tuna fish |
08:58:55 | FromDiscord | <odexine> linux doesnt exist how can you break something that doesnt exist |
08:59:10 | FromDiscord | <taperfade> In reply to @odexine "linux doesnt exist how": you cant use something that doesnt exist |
08:59:12 | FromDiscord | <taperfade> get it |
08:59:17 | FromDiscord | <taperfade> linux is unusable |
08:59:36 | FromDiscord | <sOkam! π«> stop with the damn battle and go to offtopic |
08:59:42 | FromDiscord | <sOkam! π«> keep it nim, thank you |
08:59:44 | PMunch | sOkam, here you go: https://github.com/PMunch/futhark/blob/master/src/opir.nim#L328C9-L399C153 |
08:59:55 | FromDiscord | <sOkam! π«> In reply to @PMunch "sOkam, here you go:": ty ππ |
09:00:19 | FromDiscord | <ElegantBeouf> ~~The best OS to program on especially Nim is Linux~~ π |
09:00:42 | FromDiscord | <sOkam! π«> In reply to @PMunch "sOkam, here you go:": oof β°οΈ |
09:01:02 | FromDiscord | <sOkam! π«> im supposed to understand that? crap, that's gonna take a while |
09:01:51 | FromDiscord | <nnsee> chatgpt is pretty good at explaining code |
09:01:53 | FromDiscord | <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:33 | FromDiscord | <sOkam! π«> In reply to @nnsee "chatgpt is pretty good": true |
09:03:01 | PMunch | Haha :P |
09:03:20 | PMunch | I've even had PRs to that section of the code, so we're at least two people who understand it |
09:04:03 | PMunch | Oh wait, maybe it's just the `parseReturn` part onwards you need |
09:04:22 | FromDiscord | <ElegantBeouf> Use your moon runes to contact odin and see what he says |
09:04:56 | FromDiscord | <sOkam! π«> is this what you are parsing, Pmunch? https://media.discordapp.net/attachments/371759389889003532/1149269058164899930/image.png |
09:05:10 | FromDiscord | <sOkam! π«> or is chatgpt not understanding it |
09:05:26 | PMunch | I believe that is a fewer dream |
09:05:51 | FromDiscord | <ElegantBeouf> Ahh good old V vs W π |
09:06:03 | FromDiscord | <sOkam! π«> well, any advice on parsing just values with `(~0L)` and `(~0UL)`? |
09:06:04 | PMunch | The output of that is a JSON object containing the nimified value |
09:06:08 | PMunch | Damn it.. |
09:06:14 | FromDiscord | <sOkam! π«> like i don't have any of those things before it, at all |
09:06:26 | FromDiscord | <sOkam! π«> its just the number, the notting, and the type |
09:06:27 | PMunch | sOkam, ttan is what that code does |
09:06:41 | FromDiscord | <sOkam! π«> yeah but i don't understand it at all |
09:06:52 | FromDiscord | <sOkam! π«> like... not even 1% |
09:06:54 | PMunch | Well, it also parses hex, binary, octal, and floats.. |
09:07:08 | PMunch | Start on line 377 |
09:07:58 | PMunch | It 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:25 | PMunch | For each of those `parseReturn` invocations it just rewrites it to `parseBiggestInt` for example |
09:09:26 | PMunch | The 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:50 | FromDiscord | <sOkam! π«> are you generating strings or actual values? |
09:12:03 | * | lumo_e quit (Quit: Quit) |
09:13:18 | PMunch | What do you mean? |
09:13:47 | FromDiscord | <sOkam! π«> `"123"` `123` |
09:16:09 | PMunch | That didn't really clear anything up :P |
09:16:49 | PMunch | It parses the value into a number and puts it as a number into JSON |
09:16:59 | FromDiscord | <sOkam! π«> nevermind, I will just hardcode the values to some predefined text |
09:18:15 | PMunch | :P |
09:18:55 | PMunch | By the way, I don't think Opir would support `~` |
09:19:35 | PMunch | But if all you need is [tilde][0-9+][lL] then it should be pretty easy to parse |
09:20:30 | PMunch | If you want to support 0x as well then it's a tiny bit trickier, but not that hard |
09:27:43 | PMunch | sOkam, here is the procedure split out for you: http://ix.io/4FAV |
09:28:00 | PMunch | I just declared a bunch of the variables Opir needs for other stuff with dummy values on top |
09:28:23 | FromDiscord | <.maverk> what am i doing wrong ? https://media.discordapp.net/attachments/371759389889003532/1149274959131189268/332.PNG |
09:29:02 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#ix=4FAW |
09:29:14 | FromDiscord | <sOkam! π«> just hardcoded, not like I need infinite values or anything |
09:29:22 | FromDiscord | <Chronos [She/Her]> In reply to @.maverk "what am i doing": Do `ptr int8` |
09:29:29 | FromDiscord | <Chronos [She/Her]> As the type |
09:29:38 | PMunch | .maverk, there's no `$` stringifier for pointers |
09:29:57 | FromDiscord | <Chronos [She/Her]> Ah nvm ignore me |
09:30:02 | FromDiscord | <sOkam! π«> In reply to @.maverk "what am i doing": `ptr` is not a concrete type |
09:30:09 | FromDiscord | <.maverk> https://media.discordapp.net/attachments/371759389889003532/1149275402217459712/44.PNG |
09:30:09 | FromDiscord | <sOkam! π«> `pointer` or `ptr T` are types |
09:30:31 | PMunch | sOkam, haha, well that's one way of doing it :P |
09:30:32 | FromDiscord | <sOkam! π«> In reply to @.maverk "": `echo pointer.repr` |
09:30:47 | PMunch | What are you using this for by the way? |
09:31:01 | FromDiscord | <.maverk> In reply to @heysokam "`echo pointer.repr`": this works |
09:31:40 | FromDiscord | <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:47 | FromDiscord | <sOkam! π«> (edit) "this" => "these" |
09:31:58 | FromDiscord | <.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:19 | FromDiscord | <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:27 | FromDiscord | <sOkam! π«> since pointers go over the GC entirely |
09:32:40 | FromDiscord | <.maverk> In reply to @heysokam "he probably asked you": yes but we are learning that is a silly question |
09:32:50 | FromDiscord | <sOkam! π«> unless you are doing some interop, or trying to expose the address like you did there |
09:33:07 | PMunch | .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:19 | FromDiscord | <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:26 | PMunch | And I was actually asking sOkam what they where using these parsers for :P |
09:33:47 | FromDiscord | <sOkam! π«> In reply to @PMunch "And I was actually": ah for converting the Vulkan spec into nim |
09:34:00 | FromDiscord | <sOkam! π«> which gives some high value uints in this format |
09:34:05 | PMunch | And why don't you just use Futhark? |
09:34:13 | PMunch | Instead of reinventing the wheel? |
09:34:16 | FromDiscord | <sOkam! π«> because its not a wrapper, is a spec parser |
09:34:33 | FromDiscord | <sOkam! π«> we are making a VulkanHpp like thing, not a raw parser |
09:34:36 | * | advesperacit quit (Ping timeout: 250 seconds) |
09:34:57 | PMunch | Hmm, not familiar enough with Vulkan to understand what that means :P |
09:35:11 | * | advesperacit joined #nim |
09:35:14 | FromDiscord | <sOkam! π«> it means nim'ifing the spec, not using it in raw C form |
09:35:51 | FromDiscord | <sOkam! π«> vulkan.hpp converts the C constructs into C++ handy tools like classes, constructors, autodestructors, etc etc |
09:36:15 | FromDiscord | <sOkam! π«> plus the syntax is so much better, but its not enough to just rename the C version |
09:36:29 | PMunch | Ah I see |
09:36:40 | PMunch | I do hope to one day get C++ support in Futhark |
09:36:45 | PMunch | That would be awesome |
09:36:47 | FromDiscord | <taperfade> How do i use discord webhooks |
09:37:29 | FromDiscord | <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:45 | FromDiscord | <sOkam! π«> they have it in the readme of their github page |
09:37:51 | FromDiscord | <taperfade> what |
09:38:11 | FromDiscord | <sOkam! π«> dimscord is a library to control discord bots with nim |
09:38:25 | FromDiscord | <taperfade> does it do webhooks ? |
09:38:34 | FromDiscord | <sOkam! π«> idk, i don't use it |
09:38:44 | FromDiscord | <nnsee> you can use any http library |
09:38:53 | FromDiscord | <sOkam! π«> In reply to @PMunch "I do hope to": same |
09:38:54 | FromDiscord | <nnsee> webhooks use plain old http requests |
09:39:10 | FromDiscord | <taperfade> im rlly new to programming so erm |
09:39:14 | FromDiscord | <taperfade> whats like |
09:39:24 | FromDiscord | <taperfade> a good http library for nim or smth |
09:39:27 | FromDiscord | <taperfade> sorry if i sound dumb |
09:39:59 | FromDiscord | <nnsee> std/httpclient |
09:40:01 | FromDiscord | <sOkam! π«> https://nim-lang.org/docs/httpclient.html |
09:40:37 | FromDiscord | <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:19 | FromDiscord | <taperfade> nimming https://media.discordapp.net/attachments/371759389889003532/1149278210232680498/image.png |
09:41:53 | PMunch | taperfade, nice you got it working :) |
09:42:01 | FromDiscord | <sOkam! π«> day0 acomplished π¦Ύ |
09:42:24 | FromDiscord | <taperfade> In reply to @heysokam "day0 acomplished π¦Ύ": hell yeah |
09:42:35 | FromDiscord | <taperfade> selling for 35k eur |
09:42:52 | FromDiscord | <taperfade> ofc nim was developed by a german |
09:42:58 | FromDiscord | <taperfade> thats why its so good |
09:43:06 | FromDiscord | <taperfade> im german btw |
09:43:13 | FromDiscord | <sOkam! π«> compiling is no easy feat. don't take what nim provides for granted πβ΅other langs are not so kind on you |
09:43:24 | FromDiscord | <taperfade> i got c to work |
09:43:28 | FromDiscord | <taperfade> but i dont like c |
09:43:38 | FromDiscord | <sOkam! π«> c is hardmode |
09:43:52 | FromDiscord | <taperfade> low level is cool but like |
09:44:10 | FromDiscord | <sOkam! π«> you can do low level with other langs (like nim) much better |
09:44:12 | FromDiscord | <taperfade> i feel like im coding 10x slower |
09:44:19 | FromDiscord | <sOkam! π«> C is just 70s stuff |
09:44:27 | FromDiscord | <sOkam! π«> its more low tech than low level |
09:44:45 | FromDiscord | <sOkam! π«> although it can do a LOT with so little, its still a 70s lang |
09:45:19 | FromDiscord | <.maverk> https://media.discordapp.net/attachments/371759389889003532/1149279219256406076/33.PNG |
09:45:22 | FromDiscord | <.maverk> i fixed the problem |
09:45:52 | FromDiscord | <.maverk> but one more issue what if i want to see the address |
09:45:58 | FromDiscord | <.maverk> i will try harder |
09:46:06 | FromDiscord | <sOkam! π«> In reply to @.maverk "": remember that this wouldn't work for sending it to C. just as a sidenote |
09:46:20 | FromDiscord | <.maverk> In reply to @heysokam "remember that this wouldn't": i will never mess with c |
09:46:46 | FromDiscord | <sOkam! π«> well, GLFW, OpenGL, Vulkan, Windows API, Linux API, ...... you will have a really hard time avoiding it entirely |
09:47:22 | FromDiscord | <.maverk> what do you mean ? |
09:47:23 | FromDiscord | <sOkam! π«> sdl, tileengine... almost every library in existence uses C, and you really will need to interop with it one day |
09:47:30 | FromDiscord | <.maverk> i will still have to write c ? |
09:47:35 | FromDiscord | <sOkam! π«> no, interop |
09:47:51 | FromDiscord | <sOkam! π«> i was just saying that for -sending- stuff to C, you need to be mindful. was just a sidenote |
09:48:11 | FromDiscord | <.maverk> i understand |
09:48:19 | FromDiscord | <sOkam! π«> because its really the only purpose of getting the addr of something in nim |
09:48:27 | FromDiscord | <taperfade> how do i get user input |
09:48:29 | FromDiscord | <sOkam! π«> in practical day-to-day terms i mean |
09:48:39 | FromDiscord | <odexine> In reply to @taperfade "how do i get": stdin.readLine? |
09:49:19 | FromDiscord | <taperfade> ill just watch a tutorial |
09:49:35 | FromDiscord | <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:48 | FromDiscord | <taperfade> oh god |
09:49:50 | FromDiscord | <taperfade> reading |
09:50:36 | FromDiscord | <sOkam! π«> this tut is what I learned with. really worth every second https://narimiran.github.io/nim-basics/ |
09:50:50 | FromDiscord | <sOkam! π«> but read both, you will need what's explained in them |
09:51:09 | FromDiscord | <nnsee> if you don't like reading, then maybe programming is not for you? considering it's literally all text |
09:52:08 | FromDiscord | <taperfade> In reply to @nnsee "if you don't like": i dont like readint |
09:52:12 | FromDiscord | <taperfade> that kind of stuff |
09:52:45 | FromDiscord | <taperfade> idk |
09:52:51 | FromDiscord | <taperfade> i just like tutorials more |
09:53:03 | FromDiscord | <nnsee> that's literally a tutorial he posted |
09:55:38 | FromDiscord | <sOkam! π«> I don't know any good video tutorial for nim, the written ones are just crazy good and easy to follow |
09:56:58 | FromDiscord | <taperfade> i found one dw |
09:57:05 | FromDiscord | <taperfade> ill be minning very soon |
09:57:13 | FromDiscord | <taperfade> nimming |
09:57:20 | FromDiscord | <taperfade> (edit) "minning very" => "nimmingvery" |
09:57:25 | FromDiscord | <taperfade> (edit) "nimmingvery" => "nimming very" |
09:57:27 | FromDiscord | <taperfade> trust |
09:57:38 | FromDiscord | <taperfade> i can already pypy |
09:57:45 | FromDiscord | <taperfade> simple stuff |
10:02:11 | FromDiscord | <taperfade> flex https://media.discordapp.net/attachments/371759389889003532/1149283464974188595/image.png |
10:04:46 | * | azimut_ joined #nim |
10:06:19 | FromDiscord | <taperfade> i should learn how to use json |
10:06:21 | FromDiscord | <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:30 | FromDiscord | <sOkam! π«> how do you make nimble in 2.0 wake the F up to understand that your package is updated? |
10:12:01 | FromDiscord | <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:11 | FromDiscord | <odexine> do you have a lockfile in the repo |
10:13:19 | FromDiscord | <odexine> it prolly says lock somewhere on the file |
10:13:23 | FromDiscord | <sOkam! π«> not that i know of |
10:13:25 | FromDiscord | <odexine> (edit) "file" => "filename" |
10:13:27 | FromDiscord | <odexine> check |
10:13:54 | FromDiscord | <odexine> i dont know how nimble 0.14 functions (i still use 0.13) |
10:14:37 | PMunch | sOkam, delete the cache folder in `~/.cache/nim` |
10:15:18 | PMunch | And consider deleting the `.nimble/pkgs` folder, I've had Nim pull a version from there instead of a newer version in pkgs2 |
10:15:32 | FromDiscord | <sOkam! π«> that worked, ty π |
10:15:37 | FromDiscord | <sOkam! π«> it was the cachedir |
10:15:52 | PMunch | Yeah I've had the same issue myself recently |
10:16:00 | FromDiscord | <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:36 | FromDiscord | <taperfade> im just trying out some stuff rn |
10:16:38 | FromDiscord | <taperfade> but uhm |
10:16:57 | FromDiscord | <taperfade> Error: func keyword is not allowed in type descriptions, use proc with {.noSideEffect.} pragma instead |
10:18:41 | FromDiscord | <sOkam! π«> means that you are declaring a func as a type, which is not legal |
10:18:51 | FromDiscord | <taperfade> as a type = |
10:18:52 | FromDiscord | <taperfade> ? |
10:18:53 | FromDiscord | <taperfade> what |
10:18:55 | FromDiscord | <sOkam! π«> func is just sugarfor what that error is telling you to write instead |
10:18:57 | FromDiscord | <nnsee> post code to playground |
10:19:07 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4FBe |
10:19:27 | FromDiscord | <taperfade> whats the nim equivalent to def in python |
10:19:32 | FromDiscord | <nnsee> proc |
10:19:36 | FromDiscord | <Phil> or func |
10:19:38 | FromDiscord | <Phil> or method |
10:19:41 | FromDiscord | <sOkam! π«> proc |
10:19:56 | FromDiscord | <sOkam! π«> he is new, doesn't need method in like the next 6months min |
10:20:06 | FromDiscord | <sOkam! π«> i don't ever even use method π€·ββοΈ |
10:20:18 | FromDiscord | <Phil> tbh, me neither |
10:20:19 | FromDiscord | <nnsee> func is only for functional programming (can't have side effects) |
10:20:33 | FromDiscord | <sOkam! π«> but proc is literally the same, since it auto nosideffects |
10:20:42 | FromDiscord | <sOkam! π«> except you don't have to worry about the effects |
10:20:59 | FromDiscord | <sOkam! π«> (ofc its not the same, since func enforces it, but you get my point. its for learning) |
10:21:05 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4FBg |
10:21:12 | FromDiscord | <taperfade> In reply to @nnsee "func is only for": what |
10:21:14 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4FBg" => "https://play.nim-lang.org/#ix=4FBh" |
10:21:15 | FromDiscord | <kingterrytheterrible12> In reply to @jaar23 "thanks for noting on": You must learn on how to use epoll |
10:21:18 | FromDiscord | <taperfade> functional programming ? |
10:21:27 | FromDiscord | <nnsee> yes, a programming paradigm |
10:21:30 | FromDiscord | <sOkam! π«> In reply to @taperfade "what": ignore it, you don't need to care at all about that in the next 6months |
10:21:40 | FromDiscord | <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:41 | FromDiscord | <taperfade> im gonna care rn |
10:21:42 | FromDiscord | <nnsee> a specific way of programming |
10:21:43 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4FBi |
10:21:44 | FromDiscord | <sOkam! π«> it like giga-confusing for little benefit when learning |
10:21:49 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4FBj |
10:21:52 | FromDiscord | <taperfade> In reply to @nnsee "a specific way of": ohh |
10:21:55 | FromDiscord | <sOkam! π«> In reply to @taperfade "im gonna care rn": well you do you, you were warned |
10:21:56 | FromDiscord | <taperfade> like object oriented = |
10:21:57 | FromDiscord | <nnsee> if you don't know what it is, you don't need it |
10:22:02 | FromDiscord | <taperfade> (edit) "=" => "?" |
10:22:10 | FromDiscord | <nnsee> yes, that's another one |
10:22:35 | FromDiscord | <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:53 | PMunch | Haha, unless you're a mathematician :P |
10:22:59 | FromDiscord | <sOkam! π«> its giga-confusing to learn, takes a lot of practice and ieven then its not for everyone |
10:23:05 | PMunch | Honestly once you get used to FP it's not that confusing |
10:23:27 | FromDiscord | <sOkam! π«> > once you get used to ...β΅thats the problematic part |
10:23:31 | FromDiscord | <nnsee> some people's brains are wired differently and FP makes more sense than OOP |
10:23:37 | FromDiscord | <taperfade> Error: type mismatch: got 'string' for 'readLine(stdin)' but expected 'int' |
10:23:42 | FromDiscord | <taperfade> that worked earlier |
10:23:55 | FromDiscord | <nnsee> post code |
10:24:02 | FromDiscord | <taperfade> embarrasing |
10:24:07 | FromDiscord | <taperfade> im trying it out |
10:24:11 | FromDiscord | <taperfade> so its rlly bad |
10:24:16 | FromDiscord | <nnsee> no worries |
10:24:45 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4FBk |
10:24:50 | FromDiscord | <taperfade> sent a long message, see http://ix.io/4FBl |
10:24:52 | FromDiscord | <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:03 | FromDiscord | <taperfade> In reply to @taperfade "`echo "1" var x:int": im following a tutorial rn |
10:25:16 | FromDiscord | <nnsee> readLine always returns a string, but you're trying to assign it to an integer |
10:25:32 | FromDiscord | <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:34 | FromDiscord | <nnsee> you need to use the parseInt procedure to turn a string into an integer |
10:25:42 | FromDiscord | <taperfade> okie |
10:25:45 | FromDiscord | <sOkam! π«> ^ |
10:26:16 | FromDiscord | <taperfade> whats the parseInt thingy |
10:26:54 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4FBm |
10:26:57 | FromDiscord | <sOkam! π«> sent a code paste, see https://paste.rs/xjM7P |
10:27:28 | FromDiscord | <sOkam! π«> if you just \` code \` then discord doesn't give any syntax and long code becomes almost imposs to follow |
10:27:43 | FromDiscord | <taperfade> ohh okey |
10:27:53 | FromDiscord | <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:06 | FromDiscord | <Phil> In reply to @sys64 "Oh, gotta try this": yes, though I think that needs to be the last field |
10:28:27 | FromDiscord | <Phil> Though why do a raw select btw? |
10:28:55 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#ix=4FBn |
10:28:56 | FromDiscord | <Phil> you could just have a list-select or whatever the proc is called with the entire string after "WHERE" |
10:29:57 | FromDiscord | <sOkam! π«> (edit) "https://play.nim-lang.org/#ix=4FBn" => "https://play.nim-lang.org/#ix=4FBo" |
10:30:02 | FromDiscord | <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:28 | FromDiscord | <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:41 | FromDiscord | <System64 ~ Flandre Scarlet> I have the same error without "" |
10:30:46 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4FBp |
10:30:53 | FromDiscord | <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:00 | FromDiscord | <System64 ~ Flandre Scarlet> Gotta try this |
10:31:03 | FromDiscord | <ieltan> Oh I see |
10:31:08 | FromDiscord | <ieltan> My bad |
10:32:55 | FromDiscord | <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:35 | FromDiscord | <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:32 | FromDiscord | <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:16 | FromDiscord | <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:45 | FromDiscord | <Phil> Is it not? |
10:36:41 | FromDiscord | <System64 ~ Flandre Scarlet> I don't think so |
10:36:54 | FromDiscord | <Phil> Let me check, if so I'll add those in |
10:38:25 | FromDiscord | <taperfade> how do i call a function |
10:38:28 | FromDiscord | <taperfade> proc |
10:40:47 | FromDiscord | <taperfade> i feel like im doing it wrong |
10:40:52 | FromDiscord | <taperfade> for some reason |
10:41:34 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4FBw |
10:41:58 | FromDiscord | <nnsee> (edit) "https://play.nim-lang.org/#ix=4FBw" => "https://play.nim-lang.org/#ix=4FBx" |
10:42:12 | FromDiscord | <taperfade> https://media.discordapp.net/attachments/371759389889003532/1149293536118841415/image.png |
10:42:22 | FromDiscord | <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:17 | FromDiscord | <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:50 | FromDiscord | <enthus1ast> Or 'discard' ing it |
10:44:03 | FromDiscord | <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:39 | FromDiscord | <taperfade> tbh |
10:44:47 | FromDiscord | <taperfade> idk how return works |
10:45:01 | FromDiscord | <taperfade> i didnt know in python too |
10:47:02 | * | jmdaemon quit (Ping timeout: 245 seconds) |
10:47:55 | FromDiscord | <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:42 | FromDiscord | <taperfade> uhh |
10:49:49 | FromDiscord | <taperfade> i dont get it |
10:49:55 | FromDiscord | <nnsee> which part |
10:50:01 | FromDiscord | <taperfade> all of what u said |
10:50:25 | FromDiscord | <nnsee> i can't elaborate if i don't know what you're confused ahout |
10:50:43 | FromDiscord | <taperfade> where does the value that gets returned go to ? |
10:51:05 | FromDiscord | <taperfade> (edit) removed "to" |
10:52:45 | FromDiscord | <taperfade> i added return but it still doesnt work |
10:53:17 | FromDiscord | <taperfade> https://media.discordapp.net/attachments/371759389889003532/1149296320578859080/image.png |
10:54:38 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4FBA |
10:55:27 | FromDiscord | <taperfade> ooo |
10:55:30 | FromDiscord | <taperfade> i get it now th |
10:55:31 | FromDiscord | <taperfade> thx |
10:55:32 | FromDiscord | <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:53 | FromDiscord | <taperfade> In reply to @taperfade "": this is still happening tho |
10:56:23 | FromDiscord | <nnsee> post code? |
10:57:08 | FromDiscord | <taperfade> sent a long message, see http://ix.io/4FBD |
10:57:21 | FromDiscord | <_nenc> you must use let or var to assign |
10:57:27 | FromDiscord | <taperfade> (edit) "long message," => "code paste," | "http://ix.io/4FBD" => "https://play.nim-lang.org/#ix=4FBE" |
10:57:31 | FromDiscord | <taperfade> oh oops |
10:57:41 | FromDiscord | <_nenc> sent a code paste, see https://play.nim-lang.org/#ix=4FBF |
10:58:19 | FromDiscord | <taperfade> YES https://media.discordapp.net/attachments/371759389889003532/1149297588433068052/image.png |
10:58:24 | FromDiscord | <Phil> Sweet! |
10:58:30 | FromDiscord | <Phil> Looking good |
10:59:09 | FromDiscord | <taperfade> getting used to the new syntax |
10:59:20 | FromDiscord | <taperfade> coming from python my baby boo |
10:59:33 | FromDiscord | <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:54 | FromDiscord | <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:29 | FromDiscord | <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:48 | FromDiscord | <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:58 | FromDiscord | <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:30 | FromDiscord | <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:39 | FromDiscord | <taperfade> now |
11:04:47 | FromDiscord | <taperfade> time to make malicious software |
11:04:58 | FromDiscord | <taperfade> jk |
11:05:02 | FromDiscord | <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:46 | FromDiscord | <System64 ~ Flandre Scarlet> the setup is also way simpler than Eloquent or EntityFramework |
11:06:34 | FromDiscord | <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:50 | FromDiscord | <taperfade> how do i send data to a webhook |
11:06:57 | FromDiscord | <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:42 | FromDiscord | <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:06 | FromDiscord | <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:20 | FromDiscord | <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:34 | FromDiscord | <Phil> See here https://norm.nim.town/customDatatypes.html |
11:09:01 | FromDiscord | <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:00 | FromDiscord | <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:06 | FromDiscord | <nnsee> sent a code paste, see https://paste.rs/jcHc8 |
11:10:16 | FromDiscord | <taperfade> In reply to @nnsee "here's some other tips": flexxing on me |
11:10:22 | FromDiscord | <taperfade> im gonna do it this time |
11:10:23 | FromDiscord | <nnsee> no, just giving you tips |
11:11:25 | FromDiscord | <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:54 | FromDiscord | <Phil> So you can fetch the playerdata immediately as well since you would be interested in having that |
11:12:19 | FromDiscord | <System64 ~ Flandre Scarlet> I took the problem in reverse and went the way "One player has a game" |
11:12:26 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "has" => "belongs to" |
11:12:33 | FromDiscord | <Phil> That or you'd have a separate, dedicated "PlayerGameMembership" Table for a many-to-many relationship between players and games |
11:12:49 | FromDiscord | <Phil> (edit) "games" => "gamesβ΅With just 3 fields: id, gameId and playerId" |
11:13:06 | FromDiscord | <System64 ~ Flandre Scarlet> It's one to manyβ΅Because one player belongs to one, and only one game |
11:13:55 | FromDiscord | <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:04 | FromDiscord | <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:10 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4FBJ |
11:14:22 | FromDiscord | <Phil> Ma man out there building bomberman |
11:14:52 | FromDiscord | <Chronos [She/Her]> Hm? |
11:15:08 | FromDiscord | <Phil> Nah, more directed at system64 since a player in their model has bombs |
11:15:50 | FromDiscord | <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:09 | FromDiscord | <System64 ~ Flandre Scarlet> yeah, I'm building an online SHMUP |
11:16:23 | FromDiscord | <Phil> Sick! |
11:16:31 | FromDiscord | <Phil> (edit) "Sick!" => "Sick (as in: Cool) !" |
11:17:22 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah! But very hard to do |
11:17:28 | FromDiscord | <ache of head> wicked (as in impressive) |
11:17:30 | FromDiscord | <odexine> In reply to @isofruit "Sick (as in: Cool)": Sick as in diseased |
11:18:23 | FromDiscord | <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:13 | FromDiscord | <odexine> In reply to @sys64 "There is not even": You can add that later kinda |
11:19:18 | FromDiscord | <nnsee> neat (as in interesting) |
11:19:24 | FromDiscord | <odexine> Would prolly need a good bit of refactoring but eh |
11:19:25 | FromDiscord | <taperfade> how do i send stuff to a webhook ugh |
11:19:54 | FromDiscord | <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:31 | FromDiscord | <taperfade> uh |
11:21:36 | FromDiscord | <taperfade> yeah |
11:22:09 | FromDiscord | <taperfade> how do i send "abc" to a site |
11:22:31 | FromDiscord | <taperfade> a text to a site like idk google or smth |
11:22:33 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "You can add that": I'll see if I have time |
11:22:56 | FromDiscord | <toma400> sent a long message, see http://ix.io/4FBO |
11:22:56 | FromDiscord | <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:20 | FromDiscord | <ache of head> In reply to @taperfade "a text to a": do you necessarily need a webhook for that? |
11:23:30 | FromDiscord | <taperfade> ugh |
11:23:33 | FromDiscord | <ache of head> i haven't done anything in nim in some time now |
11:23:34 | FromDiscord | <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:34 | FromDiscord | <taperfade> im gonna give up |
11:23:36 | FromDiscord | <ache of head> let alone webhooks |
11:23:42 | FromDiscord | <taperfade> it so easy |
11:23:44 | FromDiscord | <taperfade> in python |
11:23:46 | FromDiscord | <ache of head> but wouldn't a simple network request do it? |
11:23:47 | FromDiscord | <toma400> (edit) "http://ix.io/4FBO" => "http://ix.io/4FBP" |
11:23:51 | FromDiscord | <taperfade> i just send data to a webhook |
11:23:53 | FromDiscord | <taperfade> boom |
11:24:10 | FromDiscord | <taperfade> i dont want to request |
11:24:12 | FromDiscord | <taperfade> i want to send stuff |
11:24:50 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Nah, more directed at": h |
11:24:51 | FromDiscord | <Chronos [She/Her]> ah |
11:26:10 | FromDiscord | <ache of head> but isn't a webhook just a post request? |
11:26:18 | FromDiscord | <ache of head> as far as my limited knowledge goes |
11:26:21 | FromDiscord | <taperfade> idk what u mean |
11:27:36 | FromDiscord | <nnsee> In reply to @taperfade "i dont want to": that's what a request is |
11:27:45 | FromDiscord | <nnsee> it's just "sending data" |
11:27:58 | FromDiscord | <nnsee> and it's as easy in python as it is in nim |
11:28:45 | FromDiscord | <ache of head> In reply to @taperfade "idk what u mean": https://nim-lang.org/docs/httpclient.html#using-http-post |
11:29:01 | FromDiscord | <taperfade> In reply to @nnsee "and it's as easy": doesnt seem like it |
11:29:54 | FromDiscord | <nnsee> well show us your code so far |
11:30:03 | FromDiscord | <nnsee> and tell us what exactly you're having trouble with |
11:32:02 | FromDiscord | <System64 ~ Flandre Scarlet> Btw does Norm sanitize user input? |
11:33:10 | FromDiscord | <sOkam! π«> In reply to @toma400 "Thanks, that makes it": yeah i know the feel really well |
11:33:45 | FromDiscord | <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:15 | FromDiscord | <sOkam! π«> you could learn months just learning buildsystems without touching a line of C ever |
11:34:22 | FromDiscord | <sOkam! π«> (edit) "learn" => "spend" |
11:34:44 | FromDiscord | <System64 ~ Flandre Scarlet> C and its build system aaaaah |
11:35:17 | FromDiscord | <taperfade> In reply to @nnsee "well show us your": uhhh |
11:35:34 | FromDiscord | <taperfade> im reading the thing |
11:35:40 | FromDiscord | <taperfade> but it doesnt make sense to me |
11:36:07 | FromDiscord | <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:10 | FromDiscord | <taperfade> https://nim-lang.org/docs/httpclient.html#request%2CAsyncHttpClient%2C%2Cstring%2CHttpHeaders%2CMultipartData |
11:36:45 | FromDiscord | <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:39 | FromDiscord | <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:48 | FromDiscord | <System64 ~ Flandre Scarlet> This is also why I avoid C/C++ as much as possibleβ΅Including the fact those languages are unsafe |
11:37:55 | FromDiscord | <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:10 | FromDiscord | <sOkam! π«> In reply to @sys64 "This is also why": cpp with all warnings active is actually crazy safe |
11:38:26 | FromDiscord | <sOkam! π«> its only unsafe if you go out of rails and ignore the warnings |
11:38:41 | FromDiscord | <System64 ~ Flandre Scarlet> Who care about warningsβ΅π€£ |
11:38:42 | FromDiscord | <sOkam! π«> cannot say the same about C, c has no rails |
11:39:03 | FromDiscord | <sOkam! π«> In reply to @sys64 "Who care about warnings": said the person who thought cpp was unsafe π€·ββοΈ π π guess why that is! |
11:39:10 | FromDiscord | <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:11 | FromDiscord | <ache of head> what about this? |
11:39:39 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "said the person who": Yeahβ΅I have another problem with C++ : the syntax |
11:39:51 | FromDiscord | <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:00 | FromDiscord | <sOkam! π«> In reply to @sys64 "Yeah I have another": yeah that i agree with a lot |
11:40:16 | FromDiscord | <taperfade> https://media.discordapp.net/attachments/371759389889003532/1149308145680777318/image.png |
11:40:19 | FromDiscord | <sOkam! π«> well, i::agree::with... sorry, had to avoid a nameclash π |
11:40:23 | FromDiscord | <taperfade> marked all the things i dont understand red |
11:40:37 | FromDiscord | <ache of head> i just sent you a different proc that does what you want to do |
11:40:42 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "well, i::agree::with... sorry, had": Never do using std |
11:40:50 | FromDiscord | <β Array> how can i do preprocessor directives? like `#define` `#ifdef` in C?also is it possible to overwrite a nim directive? |
11:40:58 | FromDiscord | <nnsee> In reply to @taperfade "": please read what i and ache of head said |
11:41:03 | FromDiscord | <taperfade> In reply to @ab9st8 "i just sent you": thats literally what u sent me |
11:41:11 | FromDiscord | <ache of head> no, you must have clicked on your own link |
11:41:18 | FromDiscord | <ache of head> the proc i sent is `postContent` |
11:41:42 | FromDiscord | <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:00 | FromDiscord | <sOkam! π«> In reply to @sys64 "Yeah, very robust Sometimes": that's actually a real good thing |
11:42:01 | FromDiscord | <taperfade> In reply to @ab9st8 "the proc i sent": whats the body ?? |
11:42:08 | FromDiscord | <taperfade> and what is multipart data |
11:42:08 | FromDiscord | <sOkam! π«> becuase those types are not the same AT ALL lol |
11:42:13 | FromDiscord | <ache of head> the body is the content of the request you want to make |
11:42:27 | FromDiscord | <sOkam! π«> (edit) "thing" => "thingβ΅becuase those types are not the same AT ALL lol" |
11:42:30 | FromDiscord | <ache of head> i dont think you should worry about multipart data |
11:42:34 | FromDiscord | <odexine> In reply to @taperfade "and what is multipart": You can ignore that |
11:42:36 | FromDiscord | <ache of head> i think it's a default argument |
11:42:43 | FromDiscord | <taperfade> and what is future{string] |
11:42:46 | FromDiscord | <System64 ~ Flandre Scarlet> The worst thing is Javascriptβ΅Does it even have types?? |
11:43:08 | FromDiscord | <ache of head> a future is a peculiar type related to asynchronous operations |
11:43:13 | FromDiscord | <ache of head> they're not specific to nim |
11:43:16 | FromDiscord | <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:22 | FromDiscord | <ache of head> https://en.wikipedia.org/wiki/Futures_and_promises |
11:43:28 | FromDiscord | <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:36 | FromDiscord | <ache of head> Future[string] is the return type of `postContent` |
11:43:45 | FromDiscord | <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:47 | FromDiscord | <ieltan> In reply to @sys64 "The worst thing is": Yes, it's just duck typed |
11:44:09 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ieltan "Yes, it's just duck": Alsoβ΅Php |
11:44:21 | FromDiscord | <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:31 | FromDiscord | <ache of head> because an http request doesn't necessarily have to succeed |
11:44:32 | FromDiscord | <ieltan> In reply to @sys64 "Also Php": Same |
11:44:32 | FromDiscord | <sOkam! π«> In reply to @toma400 "Me who literally makes": that's someone elses problem for ignoring the warnings in the first place π |
11:44:34 | FromDiscord | <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:36 | FromDiscord | <taperfade> whadd https://media.discordapp.net/attachments/371759389889003532/1149309238930325524/image.png |
11:44:45 | FromDiscord | <ieltan> I think all language are "typed" |
11:44:59 | FromDiscord | <nnsee> In reply to @taperfade "whadd": it expects something after the colon, but instead the file ended |
11:45:01 | FromDiscord | <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:04 | FromDiscord | <nnsee> (End of File) |
11:45:11 | FromDiscord | <taperfade> In reply to @nnsee "it expects something after": what does it expect tho |
11:45:38 | FromDiscord | <nnsee> a statement? |
11:45:43 | FromDiscord | <taperfade> ok ig |
11:45:46 | FromDiscord | <taperfade> idk |
11:45:51 | FromDiscord | <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:52 | FromDiscord | <taperfade> anyway new problem |
11:46:03 | FromDiscord | <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:04 | FromDiscord | <nnsee> why are you putting a colon there in the first place |
11:46:06 | FromDiscord | <ieltan> Are you following a tutorial? I suggest reading the Nim manual, it shows you how the syntax works etc |
11:46:31 | FromDiscord | <ieltan> Tuts tells you how to do something but not how the language works typically |
11:46:36 | FromDiscord | <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:15 | FromDiscord | <ache of head> In reply to @taperfade "whadd": you dont have to input all the default arguments |
11:47:23 | FromDiscord | <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:40 | FromDiscord | <ieltan> Yeah I was gonna say that |
11:48:02 | FromDiscord | <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:12 | FromDiscord | <ieltan> https://nim-lang.org/docs/manual.html#procedures |
11:48:32 | FromDiscord | <ieltan> a must read if you want to understand what's going on in the docs |
11:48:32 | FromDiscord | <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:45 | FromDiscord | <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:10 | FromDiscord | <taperfade> In reply to @ab9st8 "i might be wrong": ur making me very mad |
11:49:53 | FromDiscord | <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:09 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4FBU |
11:50:10 | * | jjido joined #nim |
11:50:33 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#ix=4FBV |
11:50:44 | FromDiscord | <ieltan> didnt give `body` a default argument, i'll leave that to you :p |
11:51:18 | FromDiscord | <taperfade> In reply to @heysokam "<@1111014250446585866> get used to": <:GO_catStanding:1133402101205192734> |
11:51:26 | FromDiscord | <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:41 | FromDiscord | <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:55 | FromDiscord | <taperfade> In reply to @ieltan "didnt give `body` a": what is a default argument |
11:51:58 | FromDiscord | <ieltan> you would know its `body = "blabla"` instead of `body: "blabla"` if you did |
11:51:59 | FromDiscord | <sOkam! π«> but if you use a codeblock, they can just repost your own code fixed |
11:52:08 | FromDiscord | <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:09 | FromDiscord | <spotlightkid> > Images are even banned in most programming discordsβ΅> What a great idea. can we have that here as well, please? |
11:52:13 | FromDiscord | <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:40 | FromDiscord | <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:43 | FromDiscord | <taperfade> oh wait |
11:52:51 | FromDiscord | <taperfade> im embarrased |
11:52:53 | FromDiscord | <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:58 | FromDiscord | <ieltan> its okay lol |
11:53:33 | FromDiscord | <taperfade> im gonna leave this server and do it this time |
11:53:37 | FromDiscord | <sOkam! π«> In reply to @spotlightkid "> Images are even": what about gamedev? are we not allowed to share screenshots or what? π |
11:54:07 | FromDiscord | <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:27 | FromDiscord | <taperfade> In reply to @spotlightkid "> Images are even": https://tenor.com/view/1984-gif-19260546 |
11:54:36 | FromDiscord | <taperfade> literally 1984 |
11:54:36 | FromDiscord | <sOkam! π«> gifs are banned though |
11:54:41 | FromDiscord | <sOkam! π«> #offtopic has them |
11:54:46 | FromDiscord | <odexine> GIFs are not banned |
11:54:48 | FromDiscord | <odexine> Embeds are |
11:54:53 | FromDiscord | <odexine> You can upload a GIF |
11:54:55 | FromDiscord | <sOkam! π«> ah well, yeah same idea |
11:55:26 | FromDiscord | <taperfade> In reply to @spotlightkid "> Images are even": https://media.discordapp.net/attachments/371759389889003532/1149311963411791943/1984.gif |
11:55:34 | FromDiscord | <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:57 | FromDiscord | <sOkam! π«> ^ its just easier to sshot, than to copypaste and add a codeblock |
11:56:02 | FromDiscord | <ieltan> yeah it's kinda annoying |
11:56:05 | FromDiscord | <sOkam! π«> if you have a sshot tool, its super fast |
11:56:15 | FromDiscord | <sOkam! π«> its not better, just fast |
11:56:30 | FromDiscord | <ieltan> would be bearable if we had the assyst bot or another bot that can do ocr |
11:56:35 | FromDiscord | <ieltan> imo |
11:56:51 | FromDiscord | <ieltan> but feels like an overkill to invite a bot for the sole purpose of reading text in images |
11:56:53 | FromDiscord | <spotlightkid> the markdown triple-backtick syntax is arkward to type, but you could automate that too. |
11:57:11 | FromDiscord | <ieltan> Assyst bot automatically puts text in codeblock |
11:57:26 | FromDiscord | <ieltan> it's just not color formatted |
11:58:28 | emery | programers sharing screenshots is a sure sign that we are going into a software dark age |
12:01:55 | FromDiscord | <taperfade> this is getting so annoying |
12:01:58 | FromDiscord | <taperfade> im gonna sleep |
12:02:03 | FromDiscord | <taperfade> and try again tomorrow |
12:02:21 | FromDiscord | <toma400> Unironically sleeping or making a break is great idea, it lets you look at problem with different perspective |
12:02:46 | FromDiscord | <taperfade> In reply to @toma400 "Unironically sleeping or making": unironically .... |
12:02:49 | FromDiscord | <taperfade> ok byebe |
12:03:01 | FromDiscord | <taperfade> i will continue complaining abt my mistakes tomorrow |
12:03:25 | FromDiscord | <toma400> Haha, sure, have a good rest ^^ |
12:23:31 | FromDiscord | <toma400> sent a code paste, see https://play.nim-lang.org/#ix=4FC7 |
12:26:20 | FromDiscord | <vindaar> `getColors` is a procedure, so `getColors("1")` instead of `getColors["1"]` |
12:27:25 | FromDiscord | <toma400> Oh gosh, that's right XD |
12:27:34 | FromDiscord | <toma400> Thanks for the answer, such a silly mistake to make π
|
12:27:46 | FromDiscord | <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:03 | FromDiscord | <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:35 | FromDiscord | <arnetheduck> sent a code paste, see https://play.nim-lang.org/#ix=4FC9 |
12:37:51 | * | rockcavera joined #nim |
12:46:41 | FromDiscord | <nnsee> from glancing at it - if v is true, then it returns 32, otherwise 42 |
12:46:43 | FromDiscord | <nnsee> right? |
12:47:45 | FromDiscord | <frobnicate> Aren't you guaranteed a finally always runs? |
12:48:06 | FromDiscord | <nnsee> i would assume the return returns early, no? |
12:48:24 | FromDiscord | <frobnicate> π€·ββοΈ |
12:48:36 | FromDiscord | <nnsee> nope, you're right |
12:48:45 | FromDiscord | <nnsee> it's 32 for both |
12:49:04 | FromDiscord | <Chronos [She/Her]> Wow I hate that lmao |
12:49:17 | FromDiscord | <frobnicate> Why? |
12:49:23 | FromDiscord | <Chronos [She/Her]> I would've assumed the return statements returns as soon as it can - before the finally statement |
12:49:24 | FromDiscord | <frobnicate> It's how finally is supposed to work |
12:49:39 | FromDiscord | <frobnicate> Well that breaks the idea of using try catch finally |
12:49:44 | FromDiscord | <Chronos [She/Her]> Never actually used `finally` so it makes brain go brr |
12:49:53 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#ix=4FCg |
12:49:57 | FromDiscord | <frobnicate> You need to be sure finally runs in case of cleanup or error |
12:50:11 | FromDiscord | <Chronos [She/Her]> That makes sense, just not something I expected |
12:50:22 | FromDiscord | <frobnicate> It's ok, try catch is ugly anyway |
12:50:24 | FromDiscord | <Chronos [She/Her]> Though it does make sense when actually thinking |
12:50:26 | FromDiscord | <Chronos [She/Her]> Lol |
12:51:17 | FromDiscord | <sOkam! π«> (edit) "https://play.nim-lang.org/#ix=4FCg" => "https://play.nim-lang.org/#ix=4FCi" |
12:52:05 | FromDiscord | <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:52 | FromDiscord | <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:12 | FromDiscord | <frobnicate> That's how you're supposed to use it |
12:53:33 | FromDiscord | <sOkam! π«> side-note: are exceptions in nim implemented with setjmp/longjump in the background? π€ |
12:53:49 | FromDiscord | <nnsee> In reply to @frobnicate "The only reason it's": isn't that what defer is for, though? |
12:54:07 | FromDiscord | <frobnicate> You don't defer on an exception do you? |
12:54:12 | FromDiscord | <sOkam! π«> (edit) "side-note:" => "side-question:" |
12:55:06 | FromDiscord | <frobnicate> But yes, it's essentially the same. Defer is just a newer concept as far as I'm aware |
12:55:34 | FromDiscord | <nnsee> In reply to @frobnicate "You don't defer on": i in all honesty don't know |
12:55:53 | FromDiscord | <nnsee> iirc araq wanted to deprecate defer a while ago |
12:55:54 | FromDiscord | <nnsee> https://github.com/nim-lang/RFCs/issues/236 |
12:56:04 | FromDiscord | <toma400> sent a code paste, see https://play.nim-lang.org/#ix=4FCj |
12:56:50 | FromDiscord | <frobnicate> Oh ok defer does the same as try finally, just a lexical difference |
12:57:18 | FromDiscord | <frobnicate> But in the wild I usually see using or try finally |
12:57:32 | FromDiscord | <toma400> sent a code paste, see https://play.nim-lang.org/#ix=4FCm |
13:00:55 | FromDiscord | <ieltan> foreach |
13:01:04 | FromDiscord | <ieltan> (edit) "does nim has aforeach ... " added "proc ?" |
13:01:42 | FromDiscord | <frobnicate> for |
13:02:23 | FromDiscord | <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:34 | FromDiscord | <ieltan> yes but i have conditional that i don't want to span across 3 lines |
13:02:39 | FromDiscord | <frobnicate> for <item> in <range> |
13:02:40 | FromDiscord | <ieltan> (edit) "conditional" => "conditionals" |
13:02:58 | FromDiscord | <frobnicate> Then just write it on one line |
13:03:09 | FromDiscord | <Chronos [She/Her]> Could even make a template? |
13:03:15 | FromDiscord | <frobnicate> That too |
13:04:03 | FromDiscord | <ieltan> my usecase is `if (condition) or (["some", "item"] in someSeq): doStuff()` |
13:04:38 | FromDiscord | <ieltan> `in` or `contains` only take one item to check if its in the container |
13:04:39 | FromDiscord | <Chronos [She/Her]> Why do you need a for statement there then...? |
13:04:47 | FromDiscord | <Chronos [She/Her]> Ah |
13:04:52 | FromDiscord | <Chronos [She/Her]> Okay that makes sense |
13:04:59 | FromDiscord | <frobnicate> You wanna check they're all in there? |
13:05:15 | FromDiscord | <ieltan> to see if any item in `["some", "item"]` is in `someSeq` |
13:05:26 | FromDiscord | <ieltan> In reply to @frobnicate "You wanna check they're": if only one of them is |
13:05:27 | FromDiscord | <frobnicate> Do you want any or all? |
13:05:32 | FromDiscord | <ieltan> any |
13:05:42 | FromDiscord | <frobnicate> That's what in already does? |
13:08:39 | FromDiscord | <ieltan> doesnt seem like it: https://play.nim-lang.org/#ix=3rY1 |
13:08:46 | FromDiscord | <ieltan> argh wait |
13:08:59 | FromDiscord | <ieltan> https://play.nim-lang.org/#ix=4FCv |
13:09:04 | FromDiscord | <ieltan> (edit) "https://play.nim-lang.org/#ix=3rY1" => "https://play.nim-lang.org/#ix=4FCv" |
13:13:49 | FromDiscord | <kingterrytheterrible> its insane after you get used to linux your productivity skyrockets |
13:14:20 | FromDiscord | <kingterrytheterrible> even development is faster on linux |
13:15:12 | FromDiscord | <Chronos [She/Her]> Don't say that to the Windows fan π |
13:16:21 | FromDiscord | <kingterrytheterrible> freedom is pricelessβ΅(@Chronos [She/Her]) |
13:16:50 | FromDiscord | <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:19 | FromDiscord | <Chronos [She/Her]> That's fair |
13:17:20 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#ix=4FCx |
13:17:39 | FromDiscord | <enthus1ast> True you must be worried about the gnome guys \typeahead search gone hemhem\ |
13:18:07 | FromDiscord | <kingterrytheterrible> who even uses gnome |
13:18:10 | FromDiscord | <kingterrytheterrible> i use cosmic |
13:19:26 | FromDiscord | <sOkam! π«> In reply to @kingterrytheterrible "i use cosmic": nice SEO lol π |
13:19:46 | FromDiscord | <kingterrytheterrible> huh |
13:20:03 | FromDiscord | <sOkam! π«> i mean i cannot even find it on google, because the name is so generic |
13:20:14 | FromDiscord | <kingterrytheterrible> type "cosmic DE" |
13:20:23 | PMunch | kingterrytheterrible12, Cosmic? |
13:20:27 | FromDiscord | <kingterrytheterrible> its by pop os |
13:21:01 | FromDiscord | <kingterrytheterrible> how do you guys not know what cosmic DE is |
13:21:20 | FromDiscord | <kingterrytheterrible> https://github.com/pop-os/cosmic-epoch |
13:21:30 | FromDiscord | <sOkam! π«> @System64 ~ Flandre Scarlet I found and impostor ππ https://media.discordapp.net/attachments/371759389889003532/1149333622931869706/image.png |
13:21:41 | FromDiscord | <kingterrytheterrible> https://github.com/pop-os/cosmic |
13:21:57 | FromDiscord | <kingterrytheterrible> yesβ΅(@sOkam! π«) |
13:23:09 | PMunch | I'm confused, the last link says it requires Gnome.. |
13:23:50 | FromDiscord | <kingterrytheterrible> because it is gnome |
13:24:00 | FromDiscord | <ieltan> It's a GNOME "distro" so to speak thats why |
13:24:04 | FromDiscord | <kingterrytheterrible> an unfucked gnome |
13:24:20 | FromDiscord | <sOkam! π«> In reply to @kingterrytheterrible "how do you guys": this is probably why https://media.discordapp.net/attachments/371759389889003532/1149334336315871262/image.png |
13:24:28 | FromDiscord | <sOkam! π«> its a niche within ubuntu |
13:25:01 | FromDiscord | <ieltan> By the way, I heard pop!_os has really great general hardware support |
13:25:15 | FromDiscord | <ieltan> like better battery life compared to most distros |
13:25:22 | FromDiscord | <enthus1ast> Now the question is, does all the cosmic open,save etc dialogs support typeahead search |
13:26:45 | FromDiscord | <kingterrytheterrible12> what does that mean |
13:26:47 | FromDiscord | <kingterrytheterrible> what does that mean |
13:26:56 | FromDiscord | <kingterrytheterrible12> matrix glitching |
13:27:01 | FromDiscord | <sOkam! π«> sounds like they are going their own way, though https://media.discordapp.net/attachments/371759389889003532/1149335012668362792/image.png |
13:27:52 | FromDiscord | <kingterrytheterrible12> In reply to @heysokam "sounds like they are": yes |
13:28:03 | FromDiscord | <sOkam! π«> the day two developers agree on one thing... the world will probably end the very next second, im telling you π |
13:28:30 | FromDiscord | <kingterrytheterrible12> In reply to @heysokam "the day two developers": nah seriously gnome is so horrible |
13:28:44 | FromDiscord | <sOkam! π«> i don't even use a DE, so I have no reference at all |
13:28:52 | FromDiscord | <sOkam! π«> mouse workflow is ugggh |
13:28:54 | FromDiscord | <kingterrytheterrible12> WM? |
13:29:02 | FromDiscord | <sOkam! π«> awesomewm, yeah |
13:29:11 | FromDiscord | <sOkam! π«> barely touch the mouse for anything |
13:29:19 | FromDiscord | <kingterrytheterrible12> you can make...comsic a WM yk |
13:29:22 | FromDiscord | <kingterrytheterrible12> its a 2 in 1 |
13:29:39 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzzβ¦) |
13:29:49 | FromDiscord | <kingterrytheterrible12> https://media.discordapp.net/attachments/371759389889003532/1149335715386232923/image.png |
13:29:51 | FromDiscord | <sOkam! π«> except mouse workflow, yk. that sounds more like a -2 in 1 to me π |
13:30:15 | FromDiscord | <kingterrytheterrible12> In reply to @heysokam "except mouse workflow, yk.": donno just dont like WM |
13:30:19 | FromDiscord | <sOkam! π«> tiling wm are just obnoxiously fast to work with when you have a good set of keybinds in place |
13:30:59 | FromDiscord | <kingterrytheterrible12> yeah you do you ngl |
13:31:01 | FromDiscord | <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:03 | FromDiscord | <sOkam! π«> although this is turning into offtopic, so I will stop the thread |
13:31:08 | FromDiscord | <kingterrytheterrible12> In reply to @enthus1ast "It means that you": yes |
13:31:40 | FromDiscord | <kingterrytheterrible12> https://media.discordapp.net/attachments/371759389889003532/1149336181323083806/image.png |
13:32:08 | FromDiscord | <kingterrytheterrible12> In reply to @heysokam "although this is turning": alright |
13:33:05 | FromDiscord | <enthus1ast> Let's go to offtopic \:) |
13:33:17 | FromDiscord | <kingterrytheterrible12> alr |
13:56:55 | FromDiscord | <toma400> In reply to @ieltan "if only one of": That's a nice way of using those, woah π |
13:58:31 | FromDiscord | <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:05 | FromDiscord | <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:25 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4FCN |
14:18:05 | FromDiscord | <odexine> that's a misleading proc though |
14:18:31 | FromDiscord | <odexine> should prolly have a different name |
14:19:13 | FromDiscord | <ieltan> well yeah, you don't know if it should check if "one of" or "all of" `a` is in `b` |
14:19:30 | FromDiscord | <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:05 | FromDiscord | <ieltan> yes, the nim-saem extension in the vscode marketplace |
14:23:55 | FromDiscord | <gbolahan> Great! Works perfectly. Thank you @ieltan |
14:46:13 | FromDiscord | <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:48 | FromDiscord | <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:39 | FromDiscord | <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:29 | FromDiscord | <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:55 | FromDiscord | <sOkam! π«> the compiler will be telling you why in command line when you invoke it |
15:22:07 | FromDiscord | <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:25 | FromDiscord | <enthus1ast> I've disabled most stuff from the extention, and just left code highlight etc turned on, its quite buggy unfortunatelyβ΅(@gbolahan) |
15:25:16 | FromDiscord | <enthus1ast> I now use global project search or straightforward grep (there also is nimgrep) |
15:28:10 | FromDiscord | <enthus1ast> Idk if its the fault of the extension or if its nimsuggest |
15:33:05 | FromDiscord | <solitudesf> In reply to @gbolahan "Pardon me if I": extension relies on nimsuggest, and nimsuggest is very unreliable. |
15:38:15 | FromDiscord | <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:57 | FromDiscord | <kingterrytheterrible12> why isnt there an offical nim extenstion |
16:25:28 | FromDiscord | <Chronos [She/Her]> Too much work to maintain, probably |
16:25:45 | FromDiscord | <Chronos [She/Her]> Also no-one really wants to take on that duty either |
16:27:42 | FromDiscord | <toma400> Also, Nim seems like harsh language to parse, especially given flexible AST considering custom macros |
16:28:27 | FromDiscord | <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:01 | FromDiscord | <toma400> It tends to even skip a lot of highlighting/middle-click/refactoring support for method-written procs |
16:29:22 | FromDiscord | <toma400> I'm not surprised tho, I can't imagine to write something parsing so flexible monster as Nim |
16:29:25 | FromDiscord | <toma400> (edit) "as" => "like" |
16:29:44 | * | ntat joined #nim |
16:30:00 | FromDiscord | <Chronos [She/Her]> I think work on Nimsuggest needs to be done to end up improving the tooling in general |
16:33:40 | FromDiscord | <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:09 | FromDiscord | <toma400> In reply to @odexine "not harsh to parse,": Maybe that's better worded, yeah |
17:09:22 | * | jmdaemon joined #nim |
17:12:55 | FromDiscord | <catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4FDN |
17:13:22 | FromDiscord | <catnowblue> (edit) "https://play.nim-lang.org/#ix=4FDN" => "https://play.nim-lang.org/#ix=4FDO" |
17:13:53 | FromDiscord | <catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4FDP |
17:13:59 | FromDiscord | <catnowblue> (edit) "https://play.nim-lang.org/#ix=4FDO" => "https://play.nim-lang.org/#ix=4FDQ" |
17:14:05 | FromDiscord | <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:40 | FromDiscord | <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:02 | FromDiscord | <System64 ~ Flandre Scarlet> With Netty |
17:31:10 | FromDiscord | <griffith1deadly> In reply to @sys64 "<@107140179025735680> Hi, is it": port open? |
17:31:31 | FromDiscord | <griffith1deadly> for non local connection |
17:32:14 | FromDiscord | <griffith1deadly> if no, u can use some proxy. β΅radmin, hamachi, ngrok |
17:33:14 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "port open?": they are on the same network |
17:34:12 | FromDiscord | <griffith1deadly> In reply to @sys64 "they are on the": if so you maybe use incorrect ip address for connection |
17:34:46 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "if so you maybe": No because the Web server works well |
17:35:42 | FromDiscord | <griffith1deadly> hm, looks like netty problem, real |
17:37:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "hm, looks like netty": OOF, so this is a big problem |
17:38:41 | FromDiscord | <griffith1deadly> In reply to @sys64 "OOF, so this is": can you check default sockets? |
17:39:30 | FromDiscord | <griffith1deadly> https://github.com/treeform/netty/blob/master/src/netty.nim#L463 |
17:39:40 | FromDiscord | <griffith1deadly> with this configuration |
17:40:10 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "can you check default": The server uses defined ports |
17:49:16 | FromDiscord | <toma400> Why is some procs in Nim 2.0 in `std/private/osdirs`, ones like `walkFiles`? |
17:49:30 | FromDiscord | <toma400> Weren't they available from higher hierarchy place in 1.x? |
17:53:44 | FromDiscord | <solitudesf> In reply to @toma400 "Why is some procs": osdirs is imported and reexported by os |
18:00:30 | FromDiscord | <odexine> not sure why exactly they were split off but they resemble the new Path type based api `std/[paths, files, dirs]` |
18:02:11 | FromDiscord | <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:04 | FromDiscord | <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:38 | FromDiscord | <System64 ~ Flandre Scarlet> Do I have to punch trough or something? |
18:20:08 | * | ntat joined #nim |
18:21:47 | NimEventer | New 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:48 | FromDiscord | <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:37 | FromDiscord | <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:39 | FromDiscord | <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:05 | FromDiscord | <treeform> But basically you can never hit a home computer from outiside the local network. |
19:19:28 | FromDiscord | <treeform> That's what multiple computiers hittin a centreal server is so popular. |
19:19:46 | FromDiscord | <treeform> (edit) "computiers hittin" => "computers hitting" | "centreal" => "central" |
19:19:58 | FromDiscord | <treeform> You can setup your router to do port forward though, and some times it works. |
19:20:12 | FromDiscord | <treeform> https://en.wikipedia.org/wiki/Port_forwarding |
19:20:44 | FromDiscord | <treeform> Your router will prevent from pretty much any packets from the internet hitting your computer, unless you talked to them first. |
19:21:07 | FromDiscord | <treeform> Punch trough is another complex topic, you need to understand the first two before doing that. |
19:22:35 | FromDiscord | <treeform> https://www.liveswitch.io/hs-fs/hubfs/4%20-%20blog%20images/STUN-Server-diagram.gif? |
19:22:41 | FromDiscord | <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:13 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @treeform "But basically you can": But everything is in local |
19:25:08 | FromDiscord | <System64 ~ Flandre Scarlet> It's just 2 different machines, but both are in the same network |
19:27:10 | FromDiscord | <treeform> then I have no clue |
19:27:31 | FromDiscord | <treeform> some times routers have two networks for 4g and not wifi and ground |
19:27:41 | FromDiscord | <treeform> (edit) "some times routers have two networks for 4g ... andold" added "wifi" | "not" => "old" |
19:27:47 | FromDiscord | <treeform> (edit) "ground" => "wired" |
19:27:54 | FromDiscord | <treeform> are you sure you have the correct local ip address? |
19:28:04 | FromDiscord | <treeform> are you sure you don't have like windows firewall running? |
19:28:15 | FromDiscord | <treeform> There is just too much to debug network connections |
19:28:22 | FromDiscord | <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:54 | FromDiscord | <treeform> SO TCP (HTTP) works and UDP does not? |
19:28:57 | FromDiscord | <treeform> thats very strange |
19:29:26 | FromDiscord | <treeform> I would test a very simple UDP server next |
19:30:05 | FromDiscord | <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:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @treeform "I would test a": MRI failed https://media.discordapp.net/attachments/371759389889003532/1149428734865195028/netty.zip |
19:39:30 | FromDiscord | <System64 ~ Flandre Scarlet> here is some code |
19:56:20 | FromDiscord | <treeform> `var server = newReactor("127.0.0.1", 51730)` |
19:56:28 | FromDiscord | <treeform> ^ here is your error you are listentin on local host |
19:56:38 | FromDiscord | <treeform> you need to listen on outisde IP address `0.0.0.0` |
19:56:53 | FromDiscord | <treeform> This should be true for TCP as well? |
19:57:02 | FromDiscord | <kingterrytheterrible12> the infamous treeform is here |
19:57:13 | FromDiscord | <kingterrytheterrible12> thanks for supporting the nim community with all your libs |
19:57:30 | FromDiscord | <treeform> thank you! |
19:57:42 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @treeform "you need to listen": I should listen on 0.0.0.0? |
19:59:20 | FromDiscord | <treeform> yes? |
19:59:34 | FromDiscord | <treeform> I am sure your HTTP server does |
19:59:51 | FromDiscord | <treeform> 127.0.0.1 address can only be hit from that same computer |
19:59:56 | FromDiscord | <treeform> it can't be hit from the outside |
20:00:32 | FromDiscord | <treeform> 0.0.0.0 can be hit from the outside |
20:00:52 | FromDiscord | <treeform> you can also listen to your outside router address |
20:01:08 | FromDiscord | <kingterrytheterrible12> https://github.com/treeform/genny |
20:01:17 | FromDiscord | <treeform> usually 192.168.1.10 or 10.0.0.5 or some thing like that. |
20:01:21 | FromDiscord | <kingterrytheterrible12> In reply to @kingterrytheterrible12 "https://github.com/treeform/genny": treeform wtf is the gc yes or no mean in here? |
20:01:24 | FromDiscord | <treeform> But 0.0.0.0 is juste asier |
20:02:20 | FromDiscord | <treeform> In reply to @kingterrytheterrible12 "treeform wtf is the": The GC column? https://media.discordapp.net/attachments/371759389889003532/1149434495246802944/image.png |
20:02:24 | FromDiscord | <kingterrytheterrible12> In reply to @treeform "The GC column?": yes |
20:02:26 | * | jjido joined #nim |
20:02:51 | FromDiscord | <treeform> It means that we tie the GC to the language. |
20:03:04 | FromDiscord | <treeform> So when making binding for python we integrate python's GC so that it works. |
20:03:11 | FromDiscord | <treeform> Garbage Collector |
20:03:21 | FromDiscord | <treeform> C has no Garbage Collector so that will always be a no |
20:03:34 | FromDiscord | <kingterrytheterrible12> what about node? |
20:03:36 | FromDiscord | <treeform> Node.js has a Garbage Collector, but I could not figure out how to bind it with jsffi. |
20:03:47 | FromDiscord | <treeform> jsffi does not expose Garbage Collector |
20:03:52 | FromDiscord | <treeform> so a different way is required |
20:03:55 | FromDiscord | <treeform> I did not know when I started |
20:04:00 | FromDiscord | <treeform> (edit) "I did not know ... when" added "that" |
20:04:03 | FromDiscord | <kingterrytheterrible12> hm so if i want to use it with node i have to use manual memory managment? |
20:04:22 | FromDiscord | <treeform> Yes you have to call newX and freeX |
20:04:26 | FromDiscord | <treeform> just like you do in C |
20:04:27 | FromDiscord | <treeform> not ideal |
20:04:38 | FromDiscord | <kingterrytheterrible12> damn |
20:04:43 | FromDiscord | <kingterrytheterrible12> what about arc? |
20:04:49 | FromDiscord | <kingterrytheterrible12> and use malloc? |
20:04:52 | FromDiscord | <kingterrytheterrible12> (edit) "use malloc?" => "useMalloc?" |
20:16:06 | FromDiscord | <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:20 | FromDiscord | <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:44 | FromDiscord | <Phil> (edit) "believ emisisng?" => "believe misisng?" |
20:26:30 | FromDiscord | <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:06 | FromDiscord | <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:57 | FromDiscord | <taperfade> hii |
21:44:00 | FromDiscord | <taperfade> i just woke up |
21:48:05 | FromDiscord | <toma400> hello π ^^ |
21:48:51 | * | azimut_ quit (Ping timeout: 246 seconds) |
21:55:10 | FromDiscord | <taperfade> uhhhh |
21:55:34 | FromDiscord | <taperfade> sent a code paste, see https://play.nim-lang.org/#ix=4FFn |
21:55:47 | FromDiscord | <taperfade> im confused |
21:55:54 | FromDiscord | <kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4FFo |
21:55:55 | FromDiscord | <taperfade> nope |
21:55:56 | FromDiscord | <kingterrytheterrible12> so i can spam it |
21:56:05 | FromDiscord | <taperfade> nuh uh |
21:56:12 | FromDiscord | <kingterrytheterrible12> what if i say pretty please |
21:56:15 | FromDiscord | <kingterrytheterrible12> with a cherry on top |
21:56:22 | FromDiscord | <taperfade> still not |
21:57:01 | FromDiscord | <kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4FFp |
21:57:02 | FromDiscord | <kingterrytheterrible12> your missing an arg i think |
21:57:33 | FromDiscord | <taperfade> i dont get what i should do |
21:57:52 | FromDiscord | <taperfade> bcs i have the client and url and content to send |
22:01:41 | FromDiscord | <ache of head> man |
22:01:45 | FromDiscord | <ache of head> why are u still using the request proc |
22:02:01 | FromDiscord | <ache of head> there's a proc in the module which literally just webhook |
22:02:04 | FromDiscord | <ache of head> (edit) "webhook" => "webhooks" |
22:02:36 | FromDiscord | <ache of head> In reply to @ab9st8 "https://nim-lang.org/docs/httpclient.html#postConte": this one |
22:03:06 | FromDiscord | <ache of head> as far as my limited webhook knowledge goes |
22:03:15 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4FFq |
22:05:29 | FromDiscord | <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:43 | FromDiscord | <kingterrytheterrible12> bro how to heap allocate in nim |
22:05:47 | FromDiscord | <kingterrytheterrible12> or gc decides? |
22:06:24 | FromDiscord | <ache of head> sent a code paste, see https://play.nim-lang.org/#ix=4FFs |
22:07:13 | FromDiscord | <ache of head> (edit) "https://play.nim-lang.org/#ix=4FFs" => "https://play.nim-lang.org/#ix=4FFt" |
22:08:05 | FromDiscord | <ache of head> sent a code paste, see https://play.nim-lang.org/#ix=4FFu |
22:09:21 | FromDiscord | <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:34 | FromDiscord | <ache of head> you should decide on one way you prefer and use it consistently |
22:10:26 | FromDiscord | <raynei486> In reply to @kingterrytheterrible12 "bro how to heap": why are you manually allocating memory? |
22:10:28 | FromDiscord | <raynei486> https://nim-lang.org/docs/system.html#alloc.t,Natural |
22:10:44 | FromDiscord | <kingterrytheterrible12> In reply to @raynei486 "why are you manually": so who decides what goes where |
22:11:33 | FromDiscord | <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:37 | FromDiscord | <raynei486> In reply to @kingterrytheterrible12 "so who decides what": ? |
22:11:40 | FromDiscord | <ache of head> In reply to @kingterrytheterrible12 "so who decides what": the gc |
22:11:43 | FromDiscord | <kingterrytheterrible12> In reply to @raynei486 "?": ???? |
22:11:50 | FromDiscord | <ache of head> but you can also go gcless |
22:11:51 | FromDiscord | <ache of head> afaik |
22:11:54 | FromDiscord | <raynei486> yeah |
22:12:03 | FromDiscord | <kingterrytheterrible12> alright |
22:12:08 | FromDiscord | <raynei486> you can manage your own memory |
22:12:19 | FromDiscord | <ache of head> weren't there like a couple of gc modes available as well |
22:12:22 | FromDiscord | <ache of head> arc and orc |
22:12:23 | FromDiscord | <raynei486> just usually not necessary |
22:12:31 | FromDiscord | <ache of head> (no idea what the difference is) |
22:12:53 | FromDiscord | <kingterrytheterrible12> In reply to @ab9st8 "(no idea what the": arc will leak with cycles |
22:12:55 | FromDiscord | <kingterrytheterrible12> orc doesnt |
22:13:01 | FromDiscord | <kingterrytheterrible12> in nim 2.0 orc is the default |
22:13:08 | FromDiscord | <ache of head> man you do know this stuff |
22:13:15 | FromDiscord | <ache of head> why are you asking for help then π |
22:13:32 | FromDiscord | <kingterrytheterrible12> because idk why nim keeps what goes on the heap obscure |
22:13:42 | FromDiscord | <kingterrytheterrible12> it doesnt say if the gc allocates on the heap or not |
22:14:01 | FromDiscord | <ache of head> β¦where else is it supposed to allocate? |
22:14:10 | FromDiscord | <ache of head> unless i'm not getting something obvious, it's pretty late here and i'm half dead |
22:14:15 | FromDiscord | <kingterrytheterrible12> it could be like boehm in C where i allocate but never free using `GC_malloc` |
22:15:29 | FromDiscord | <raynei486> In reply to @ab9st8 "β¦where else is it": you can allocate from a static buffer |
22:15:38 | FromDiscord | <raynei486> (common in C) |
22:15:43 | FromDiscord | <ache of head> huh |
22:15:51 | FromDiscord | <ache of head> i've never heard about that |
22:16:07 | FromDiscord | <ache of head> oh you just mean static variables |
22:16:31 | FromDiscord | <kingterrytheterrible12> in here |
22:16:33 | FromDiscord | <kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4FFw |
22:16:39 | FromDiscord | <kingterrytheterrible12> where the fuck is result coming from |
22:16:45 | FromDiscord | <taperfade> sent a code paste, see https://play.nim-lang.org/#ix=4FFx |
22:16:59 | FromDiscord | <raynei486> sent a code paste, see https://play.nim-lang.org/#ix=4FFy |
22:17:14 | FromDiscord | <taperfade> im getting smarter by learning nim but i feel like im actually not making any progress |
22:18:37 | FromDiscord | <raynei486> sent a code paste, see https://play.nim-lang.org/#ix=4FFz |
22:18:46 | FromDiscord | <raynei486> `ptr` are a different story |
22:18:57 | FromDiscord | <kingterrytheterrible12> In reply to @raynei486 "`ptr` are a different": ok |
22:19:20 | FromDiscord | <raynei486> sent a code paste, see https://play.nim-lang.org/#ix=4FFA |
22:19:34 | FromDiscord | <raynei486> (edit) "https://play.nim-lang.org/#ix=4FFA" => "https://play.nim-lang.org/#ix=4FFB" |
22:19:39 | FromDiscord | <taperfade> how do i use the string or discard it |
22:20:14 | FromDiscord | <kingterrytheterrible12> In reply to @taperfade "how do i use": just `discard functionName` |
22:23:40 | FromDiscord | <ache of head> In reply to @taperfade "im getting smarter by": how are you learning? |
22:23:48 | FromDiscord | <ache of head> like what are you using to learn |
22:26:47 | FromDiscord | <Elegantbeef> `result` is an implicitly declared variable for any procedure that has a return type that's not voidβ΅(@kingterrytheterrible12) |
22:27:01 | FromDiscord | <kingterrytheterrible12> In reply to @Elegantbeef "`result` is an implicitly": FUCKING NEAT |
22:27:02 | FromDiscord | <kingterrytheterrible12> I LIEK IT |
22:27:16 | FromDiscord | <Elegantbeef> Both of those examples are bad though imo |
22:27:56 | FromDiscord | <Elegantbeef> Much more sane |
22:27:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4FFD |
22:28:05 | FromDiscord | <kingterrytheterrible12> you just |
22:28:06 | FromDiscord | <kingterrytheterrible12> fucked it |
22:28:10 | FromDiscord | <kingterrytheterrible12> whats sane about it |
22:28:37 | FromDiscord | <raynei486> turned all the assignments into a construction |
22:28:43 | FromDiscord | <Elegantbeef> Using object construction, not using `result.field =` |
22:28:46 | FromDiscord | <Elegantbeef> Constructors generally are just expressions so keep it that way |
22:29:19 | FromDiscord | <Elegantbeef> Generally if an expression suffices it's best to be used |
22:29:24 | FromDiscord | <kingterrytheterrible12> sooo use `ref` makes sure the object is heap allocated? |
22:29:26 | FromDiscord | <raynei486> btw beef how did you become a language lawyer for Nim |
22:29:36 | FromDiscord | <kingterrytheterrible12> In reply to @raynei486 "btw beef how did": bsns |
22:29:42 | FromDiscord | <Elegantbeef> Write a lot of Nim and you can then become one |
22:29:50 | FromDiscord | <Elegantbeef> `ref` is a memory safe pointer |
22:29:59 | FromDiscord | <raynei486> ^ |
22:30:11 | FromDiscord | <raynei486> you use it where you use pointers (like for aliasing) |
22:30:22 | FromDiscord | <kingterrytheterrible12> In reply to @Elegantbeef "`ref` is a memory": and its pointing to where |
22:30:24 | FromDiscord | <kingterrytheterrible12> stack or heap |
22:30:30 | FromDiscord | <kingterrytheterrible12> in c i can make pointer to stack |
22:30:43 | FromDiscord | <raynei486> In reply to @Elegantbeef "Write a lot of": I'm assuming you've been writing nim pre 1.0? |
22:30:49 | FromDiscord | <Elegantbeef> It is heap allocated |
22:30:49 | FromDiscord | <Elegantbeef> But `ref`s are memory safe |
22:30:49 | FromDiscord | <Elegantbeef> In Nim you can make pointers to stack too |
22:31:04 | FromDiscord | <Elegantbeef> They cannot dangle, they cannot be derefed when nil |
22:31:11 | FromDiscord | <catnowblue> In reply to @catnowblue "I'll never understand how": can anyone figured out what's going on :( |
22:31:13 | FromDiscord | <Elegantbeef> Nope I actually only started writing Nim in 2020 |
22:31:30 | FromDiscord | <kingterrytheterrible12> In reply to @Elegantbeef "In Nim you can": how |
22:31:36 | FromDiscord | <Elegantbeef> `addr` |
22:31:44 | FromDiscord | <kingterrytheterrible12> alright |
22:31:49 | FromDiscord | <Elegantbeef> It's not suggested to use `ptr` unless you know what you're doing |
22:32:01 | FromDiscord | <kingterrytheterrible12> if i dont know what im doing i use ref? |
22:32:07 | FromDiscord | <Elegantbeef> Yes |
22:32:08 | FromDiscord | <kingterrytheterrible12> bc 99% ofthe time i dont |
22:32:20 | FromDiscord | <raynei486> or if you don't know why you use ref don't use ref |
22:32:50 | FromDiscord | <kingterrytheterrible12> will the gc prevent stack overflow |
22:33:04 | FromDiscord | <kingterrytheterrible12> like it allocates large objects on heap |
22:33:12 | FromDiscord | <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:12 | FromDiscord | <Elegantbeef> Of course not GC and stack overflow have no relation |
22:33:29 | FromDiscord | <Elegantbeef> Nim is relatively explicit about allocations |
22:33:45 | FromDiscord | <Elegantbeef> So nope there is no magic there |
22:33:45 | FromDiscord | <Elegantbeef> Most stack overflow happens due to recursion anyway |
22:33:49 | FromDiscord | <kingterrytheterrible12> so i should allocate large objects on heap |
22:33:56 | FromDiscord | <kingterrytheterrible12> with ref |
22:35:10 | FromDiscord | <Elegantbeef> I'm not going to say yes or no |
22:35:15 | FromDiscord | <Elegantbeef> That wholly depends on what you're doing |
22:35:48 | FromDiscord | <Elegantbeef> Like I said Nim implicitly passes objects by reference as parameters to procedures |
22:36:04 | FromDiscord | <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:21 | FromDiscord | <jviega> Nim generally makes it far easier to keep stuff on the stack whenever feasible, which tends to be faster |
22:36:28 | FromDiscord | <kingterrytheterrible12> how is this possible |
22:36:30 | FromDiscord | <kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4FFF |
22:36:40 | FromDiscord | <gbolahan> In reply to @nnsee "i use the nimlsp": Probably have to check this out |
22:36:43 | FromDiscord | <kingterrytheterrible12> valgrind reports 1 allocation |
22:36:43 | FromDiscord | <kingterrytheterrible12> how |
22:37:28 | FromDiscord | <kingterrytheterrible12> is this a bug |
22:37:40 | FromDiscord | <raynei486> I'm assuming this is NRVO |
22:37:53 | FromDiscord | <raynei486> also iirc nim allocations don't get tracked in valgrind |
22:37:58 | FromDiscord | <raynei486> because it's not using malloc or something |
22:38:08 | FromDiscord | <raynei486> (edit) "also iirc nim allocations don't get tracked ... in" added "well" |
22:38:13 | FromDiscord | <kingterrytheterrible12> i gotta pass in `-d:useMalloc` right |
22:38:18 | FromDiscord | <raynei486> yeah |
22:38:30 | FromDiscord | <raynei486> although that'll make the program inefficient |
22:38:43 | FromDiscord | <kingterrytheterrible12> alr |
22:38:45 | FromDiscord | <raynei486> you're forcing the GC to do something it wasn't designed around |
22:38:46 | FromDiscord | <kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4FFG |
22:38:47 | FromDiscord | <kingterrytheterrible12> In reply to @raynei486 "although that'll make the": why? |
22:39:13 | FromDiscord | <raynei486> I'm not really deep in the compiler internals but I know it uses its own allocation techniques within |
22:39:33 | FromDiscord | <kingterrytheterrible12> how do i reserve capacity in sequences in nim |
22:39:37 | FromDiscord | <kingterrytheterrible12> like C++ vectos |
22:39:40 | FromDiscord | <kingterrytheterrible12> (edit) "vectos" => "vectors" |
22:39:50 | FromDiscord | <huantian> newSeqOfCa |
22:39:51 | FromDiscord | <jviega> `x = newSeqOfCap(120)` |
22:39:52 | FromDiscord | <huantian> (edit) "newSeqOfCa" => "newSeqOfCap" |
22:39:55 | FromDiscord | <Elegantbeef> It uses malloc instead of Nim's allocator, it's that simple |
22:39:55 | FromDiscord | <Elegantbeef> The performance curves are different between the two, benchmark if you care |
22:39:56 | FromDiscord | <Elegantbeef> `mySeq.setLen(size);mySeq.setLen(startSize)` |
22:39:56 | FromDiscord | <Elegantbeef> or `newSeqOfCap` |
22:40:08 | FromDiscord | <kingterrytheterrible12> of cap |
22:40:14 | FromDiscord | <kingterrytheterrible12> it has a limit? |
22:40:21 | FromDiscord | <huantian> cap as in capacity |
22:40:27 | FromDiscord | <jviega> No, it's the pre-alloc'd capacity |
22:40:39 | FromDiscord | <Elegantbeef> Yes it has a limit of 2^40 bytes or so |
22:40:53 | FromDiscord | <realqquantum> https://media.discordapp.net/attachments/371759389889003532/1149474397602713680/image.png |
22:41:00 | FromDiscord | <taperfade> In reply to @kingterrytheterrible12 "just `discard functionName`": i did discard postContent but it didnt do anything |
22:41:13 | FromDiscord | <huantian> In reply to @Elegantbeef "Yes it has a": dang that's not that big |
22:41:13 | FromDiscord | <Elegantbeef> Or your memory, whichever is smaller |
22:41:21 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-discard-statement |
22:41:30 | FromDiscord | <kingterrytheterrible12> but why is it 200 allocations when im allocating 100? |
22:41:36 | FromDiscord | <kingterrytheterrible12> there is a copy somewhere |
22:41:41 | FromDiscord | <gbolahan> In reply to @gbolahan "Pardon me if I": I'd say what I really want is the Goto definition tbh |
22:42:01 | FromDiscord | <Elegantbeef> Right huan I could fit like maybe 1 2023 game in there |
22:42:01 | FromDiscord | <Elegantbeef> That allocates a string |
22:42:01 | FromDiscord | <Elegantbeef> You're echoing |
22:42:18 | FromDiscord | <kingterrytheterrible12> oh yeah lol |
22:42:55 | FromDiscord | <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:34 | FromDiscord | <kingterrytheterrible12> so i should avoid doing `--d:useMalloc"? |
22:43:38 | FromDiscord | <kingterrytheterrible12> (edit) "`--d:useMalloc"?" => "`--d:useMalloc`?" |
22:43:51 | FromDiscord | <huantian> it's probably a good idea to not use it unless you have a reason to |
22:43:56 | FromDiscord | <huantian> (eg using valgrind) |
22:43:59 | FromDiscord | <Elegantbeef> Unless you're doing embedded or a place where you need to remove Nim's allocator yes |
22:44:18 | FromDiscord | <kingterrytheterrible12> lets test if nim allocator is faster than use malloc |
22:44:19 | FromDiscord | <Elegantbeef> Just cause a switch exists doesnt mean it's supposed to be flicked |
22:44:35 | FromDiscord | <Elegantbeef> uh oh a low effort memory benchmark incoming |
22:44:47 | FromDiscord | <kingterrytheterrible12> xd |
22:44:47 | FromDiscord | <huantian> wait I'm not supposed to copy the list of compile flags and paste them into my nim.cfg |
22:45:00 | FromDiscord | <Elegantbeef> "I allocated 3000 contiguous memory blocks and there was no difference, malloc is goooder" |
22:45:02 | FromDiscord | <huantian> i thought they each give a 1% performance boost |
22:45:03 | FromDiscord | <kingterrytheterrible12> oh nim allocator is muuuch faster |
22:45:22 | FromDiscord | <kingterrytheterrible12> nvm its the same speed when i ran it again |
22:45:27 | FromDiscord | <Elegantbeef> Huan that's only true if you used a flame stencil to apply your thermal paste |
22:45:43 | FromDiscord | <huantian> wouldn't you want your thermal paste to be like an ice cube |
22:45:52 | FromDiscord | <Elegantbeef> Nah fire is faster |
22:45:57 | FromDiscord | <huantian> ah i see i see |
22:46:08 | FromDiscord | <Elegantbeef> If fire wasnt faster why would people put it on cars and think about rockets they use fire to move |
22:47:06 | FromDiscord | <taperfade> ugh https://media.discordapp.net/attachments/371759389889003532/1149475962690482226/image.png https://media.discordapp.net/attachments/371759389889003532/1149475962954711120/image.png |
22:47:27 | FromDiscord | <Elegantbeef> You arent doing `discar postContent(....)` |
22:48:22 | FromDiscord | <kingterrytheterrible12> In reply to @Elegantbeef ""I allocated 3000 contiguous": fair to me |
22:48:29 | FromDiscord | <kingterrytheterrible12> the memory has been allocated |
22:48:38 | FromDiscord | <kingterrytheterrible12> therefore i have benchmarked it |
23:09:54 | FromDiscord | <taperfade> can u guys give me example code on how to send data to a url |
23:09:56 | FromDiscord | <taperfade> im lost |
23:11:16 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/httpclient.html#using-http-post |
23:21:02 | FromDiscord | <taperfade> yoooo https://media.discordapp.net/attachments/371759389889003532/1149484502389887118/image.png |
23:21:31 | FromDiscord | <taperfade> how does let work |
23:21:51 | FromDiscord | <sOkam! π«> In reply to @taperfade "how does let work": its like const, but runtime |
23:22:00 | FromDiscord | <taperfade> whats const |
23:22:03 | FromDiscord | <taperfade> whats runtime |
23:22:06 | FromDiscord | <sOkam! π«> const can only be decided when you compile |
23:22:17 | FromDiscord | <taperfade> |
23:22:18 | FromDiscord | <sOkam! π«> let can only be decided when you run (aka runtime) |
23:23:02 | FromDiscord | <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:23 | FromDiscord | <sOkam! π«> let is dediced when you run the app, and const when you compile the app |
23:24:04 | FromDiscord | <taperfade> inever had to worry abt that in python |
23:24:09 | FromDiscord | <taperfade> im dumb ugh |
23:24:12 | FromDiscord | <taperfade> i thought i was smart |
23:24:16 | FromDiscord | <jviega> Because Python doesn't compile |
23:24:26 | FromDiscord | <taperfade> huh |
23:25:33 | FromDiscord | <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:47 | FromDiscord | <jviega> It's part of the story as to why Python is so much slower (50-100x) |
23:26:03 | FromDiscord | <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:16 | FromDiscord | <sOkam! π«> literal everything is a string, and its runtime only forever |
23:26:27 | FromDiscord | <sOkam! π«> (edit) "literal" => "literally" |
23:26:30 | FromDiscord | <taperfade> In reply to @jviega "When you run "nim": woah |
23:26:32 | FromDiscord | <taperfade> interesting |
23:26:49 | FromDiscord | <jviega> Not everything is a string in Python, where did you get that idea? |
23:27:26 | FromDiscord | <sOkam! π«> I understood the underlying representation of all types is strings, even if there is type explicitness built on top |
23:27:40 | FromDiscord | <jviega> No |
23:27:56 | FromDiscord | <jviega> Not even a little, that's never ever been the case |
23:28:13 | FromDiscord | <sOkam! π«> well I have been misinformed for a while, then. good to know |
23:28:14 | FromDiscord | <jviega> Not in the 30 years since I first started w/ Python |
23:28:47 | FromDiscord | <Elegantbeef> Lua uses tables π |
23:28:58 | * | krux02 quit (Remote host closed the connection) |
23:29:32 | FromDiscord | <taperfade> I JUST DEBUGGED SOMETHING MYSELF WITHOUT TUTORIALS |
23:29:35 | FromDiscord | <taperfade> im so fucking smart |
23:29:41 | FromDiscord | <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:55 | FromDiscord | <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:31 | FromDiscord | <huantian> Sometimes I have to restart vscode to get goto to work |
23:50:29 | FromDiscord | <raynei486> In reply to @taperfade "I JUST DEBUGGED SOMETHING": step in the right direction |