00:04:51 | FromDiscord | <Tuatarian> would it be possible to, instead of computing the rollout step with MCTS, just use a simple heuristic evaluator? |
00:05:01 | FromDiscord | <Tuatarian> computing rollout seems insanely expensive and also unreliable |
00:05:19 | FromDiscord | <Tuatarian> and I think it would take crazy amounts of time for the game I'm trying to build an engine for |
00:13:10 | FromDiscord | <Tuatarian> probably not, right? kind of violates the theoretical idea of the entire algo |
00:14:43 | FromDiscord | <neon_> btw if anyone was wondering how i fixed the problem i had yesterday i added -static to the linker options and it worked |
00:17:04 | FromDiscord | <neon_> In reply to @neon_ "on another note would": for reference i also added the linker options for the windows networking library |
00:17:29 | FromDiscord | <neon_> now it all packs into a static binary |
00:17:57 | FromDiscord | <konradmb> How can I define hooks in external module for an user to implement later - like https://github.com/treeform/jsony does? |
00:18:10 | FromDiscord | <Elegantbeef> `mixin` |
00:18:13 | * | wallabra_ joined #nim |
00:18:27 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#generics-mixin-statement |
00:20:26 | * | wallabra quit (Ping timeout: 255 seconds) |
00:20:26 | * | wallabra_ is now known as wallabra |
00:21:55 | FromDiscord | <Superstart033> `resultVar2() == "I will be returned"` [AssertionDefect]↵`Error: execution of an external program failed`↵This error keeps happening, someone knows why? https://media.discordapp.net/attachments/371759389889003532/1003819903100399647/unknown.png |
00:22:16 | FromDiscord | <Superstart033> I'm using the example from "Nim in Action" |
00:23:17 | FromDiscord | <konradmb> Elegantbeef\: Ok, thanks. So it only works in generics? So I guess there's no way to do it in "normal" procs? |
00:23:40 | FromDiscord | <!Patitotective> youre missing the last dot @Superstart033 |
00:23:50 | FromDiscord | <Elegantbeef> hooks dont make sense in normal procs |
00:24:12 | FromDiscord | <Superstart033> In reply to @Patitotective "youre missing the last": Thank you |
00:24:44 | FromDiscord | <Elegantbeef> i mean since non generics arent instantiated there is no new scope |
00:24:50 | FromDiscord | <Superstart033> Why did the bots tag each other? |
00:24:56 | FromDiscord | <Elegantbeef> perhaps use a template instead |
00:25:47 | FromDiscord | <Elegantbeef> we arent bots↵(@Superstart033) |
00:25:58 | FromDiscord | <Superstart033> Lol |
00:26:07 | * | TakinOver joined #nim |
00:26:10 | * | TakinOver quit (Read error: Connection reset by peer) |
00:27:10 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "we arent bots (<@179666061795262464>)": they are, dont listen to them |
00:27:53 | FromDiscord | <konradmb> @Superstart033\: To continue using this server please enter CAPTCHA\: N̴̈̚i̴̛̿m̷̋̉ ̵̒̄i̸͌̊s̸̛͂ ̵͊̚ť̸͛h̴̛̀e̴͑̈́ ̷́͑k̴͊̔i̵͋̊n̷̓͛g̷̈̅ |
00:27:57 | * | TakinOver joined #nim |
00:28:38 | FromDiscord | <!Patitotective> LMAO |
00:29:05 | FromDiscord | <Superstart033> https://tenor.com/view/vacuum-chase-run-scared-gif-3985014 |
00:29:05 | FromDiscord | <voidwalker> I find it very funny that we get very beginner questions from people buyin that book, even though it's not a book for beginners, except the very first part |
00:29:17 | * | krux02 quit (Remote host closed the connection) |
00:29:33 | FromDiscord | <voidwalker> A part that feels somewhat stitched together to the rest |
00:29:47 | FromDiscord | <Superstart033> In reply to @voidwalker "I find it very": I'm not a beginner, I just not good noticing those small errors sometimes |
00:30:24 | FromDiscord | <Superstart033> I was honestly expecting a false as a result, not an error |
00:30:34 | FromDiscord | <!Patitotective> beef, i will again translate c++ code manually instead of wrapping it 😁 ↵ill never touch c++ 💀 |
00:30:42 | FromDiscord | <Superstart033> Lul |
00:31:12 | FromDiscord | <Prestige> In reply to @Patitotective "beef, i will again": Same |
00:31:38 | FromDiscord | <!Patitotective> carbon is not killing c++↵we are |
00:33:14 | FromDiscord | <Prestige> Google will do that anyway |
00:35:40 | FromDiscord | <Superstart033> Apparently Golang lives |
00:36:02 | FromDiscord | <Superstart033> And Dart is still use |
00:36:13 | FromDiscord | <Elegantbeef> doubt |
00:36:17 | FromDiscord | <Prestige> Same |
00:36:20 | FromDiscord | <Superstart033> So Carbon will live for a while after 1.0 |
00:36:31 | qwr | carbon exists because google has some weird build-the-world development process |
00:36:48 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "doubt": hes a quantic bot LOL |
00:37:00 | FromDiscord | <Superstart033> Lmao |
00:37:17 | FromDiscord | <Superstart033> In reply to @qwr "carbon exists because google": Build-the-world? |
00:37:30 | FromDiscord | <Elegantbeef> Full on NIH syndrome |
00:37:34 | qwr | appearantly D-lang didn't work for google either, or they're really into NIH |
00:41:37 | FromDiscord | <Prestige> I don't really care if it takes off or not tbh |
00:42:35 | FromDiscord | <Superstart033> I don’t think many people should care at the moment, is too young and unstable to be something to be taken seriously imo |
00:43:06 | FromDiscord | <Elegantbeef> What you think `let a:!: f32 = 0` makes sense?! |
00:43:18 | FromDiscord | <Prestige> what the fuck is that |
00:43:22 | FromDiscord | <Elegantbeef> whoops that's supposed to be `a:! f32` |
00:43:42 | FromDiscord | <Prestige> magic nonsense eh |
00:43:48 | FromDiscord | <Superstart033> Bruh |
00:43:55 | FromDiscord | <Prestige> Does that mean like, must be initialized? |
00:44:10 | FromDiscord | <Elegantbeef> That's how carbon declares a constant |
00:44:15 | FromDiscord | <Prestige> my god, why |
00:44:47 | FromDiscord | <Prestige> In reply to @Superstart033 "I don’t think many": I mean I'm not going to care, I mostly care about what will happen with Nim |
00:44:57 | FromDiscord | <Elegantbeef> `const a` was too dificult 😄 |
00:44:58 | FromDiscord | <Elegantbeef> No it's a constant |
00:45:07 | FromDiscord | <Elegantbeef> it's the same as `const a: float32 = 0` |
00:45:13 | FromDiscord | <Elegantbeef> in nim\ |
00:45:19 | FromDiscord | <Superstart033> What will happen with Nim? |
00:45:24 | FromDiscord | <Superstart033> :nim1: |
00:45:44 | qwr | compare https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2137r0.html and https://github.com/carbon-language/carbon-lang/blob/trunk/docs/project/goals.md#non-goals |
00:46:13 | qwr | but yeah, carbon isn't interesting, if you are not google |
00:46:41 | FromDiscord | <Prestige> In reply to @Superstart033 "What will happen with": at this point I'm mostly hoping for better editor support and I'll be happy |
00:47:14 | FromDiscord | <Superstart033> I’m not having much problems myself, but I’m just coping the simplest things from the book |
00:47:28 | FromDiscord | <Superstart033> What kind of problems do you mean? |
00:48:24 | FromDiscord | <ajusa> Google uses open source code |
00:48:30 | FromDiscord | <Prestige> Editor problems? Getting errors from nimsuggest that aren't real (code compiles fine), not getting warnings I should be getting, better LSP support, better autocompletion, etc etc |
00:48:59 | FromDiscord | <ajusa> but yes, they have a ton of internal tools that are all invented there |
00:50:16 | FromDiscord | <j-james> In reply to @Avahe "Editor problems? Getting errors": editor support got significantly better when i switched from vscode+vscode-nim to sublime + the lsp |
00:50:28 | FromDiscord | <j-james> (edit) "vscode+vscode-nim" => "vscode + vscode-nim" |
00:50:52 | FromDiscord | <Prestige> Nimsuggest constantly crashing I believe is the main problme |
00:50:53 | FromDiscord | <Prestige> (edit) "problme" => "problem" |
00:51:09 | FromDiscord | <Superstart033> So is “out of memory” one of those problems? |
00:51:18 | FromDiscord | <Superstart033> Because that just happened to me |
00:51:26 | FromDiscord | <Prestige> Not usually |
00:52:01 | FromDiscord | <Superstart033> This is the first time a programming language literally tells me that is out of memory |
00:52:43 | FromDiscord | <Elegantbeef> The hell are you doing that it goes out of memory |
00:53:11 | FromDiscord | <Superstart033> I’m literally just copying from the book |
00:53:16 | FromDiscord | <Superstart033> I think is my pc itself |
00:53:34 | FromDiscord | <Elegantbeef> Yea if you're low on ram and attempt to allocate you'd get an out of memory error |
00:53:35 | FromDiscord | <Superstart033> It’s completely frozen right now |
00:53:53 | FromDiscord | <Superstart033> Welp |
01:02:22 | FromDiscord | <!Patitotective> In reply to @j-james "editor support got significantly": really? when i tried nimlsp in sublime it worked for a while and then just stopped working and blocked sublime auto-completions so using it was even worse than not using it |
01:04:37 | * | CyberTailor_ joined #nim |
01:04:48 | FromDiscord | <neon_> can the irc / matrix bridge bots also translate discord reactions? |
01:05:11 | FromDiscord | <Elegantbeef> Nope |
01:05:23 | FromDiscord | <Elegantbeef> I mean it's technically possible for matrix but the bridge doesnt do it |
01:05:39 | FromDiscord | <!Patitotective> In reply to @neon_ "can the irc /": they live in a joyless world |
01:05:48 | FromDiscord | <neon_> yeah i can see :( |
01:06:09 | FromDiscord | <neon_> is it custom written or just cloned from a repo |
01:06:19 | * | CyberTailor quit (Remote host closed the connection) |
01:06:38 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1003831157705670857/image.png |
01:07:12 | FromDiscord | <neon_> dayum images go througg??? |
01:07:36 | FromDiscord | <Elegantbeef> Matrix is a multimedia protocol |
01:08:44 | FromDiscord | <neon_> is the bridge written in nim |
01:09:31 | FromDiscord | <Elegantbeef> no |
01:09:42 | FromDiscord | <neon_> :( |
01:10:31 | FromDiscord | <neon_> would it be possible to dynamically load nim files like discord bots in javascript load commands from .js files? |
01:10:51 | FromDiscord | <Elegantbeef> You could use a plugin system but it'd be a lot of work for no reward |
01:11:42 | FromDiscord | <neon_> yeah at that point its prolly better to just use a cicd to autocompile |
01:12:01 | FromDiscord | <neon_> or have seperate binaries and use a rpc based system |
01:13:29 | FromDiscord | <Elegantbeef> Or just recompile the bot cause it takes like 10s on release probably |
01:16:18 | FromDiscord | <neon_> yeah yeah but if you wanted to automate it u just use some actions platform that listens to a git repo then autocompiles it and pushes the binary (or docker container) to the target machine |
01:16:33 | FromDiscord | <neon_> my inner devops is taking over😩 |
01:17:08 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "image.png": lmaooo https://media.discordapp.net/attachments/371759389889003532/1003833797005017188/unknown.png |
01:17:19 | FromDiscord | <!Patitotective> In reply to @neon_ "is the bridge written": beef doesnt want to :[ |
01:18:40 | FromDiscord | <neon_> what did he write it in |
01:19:04 | FromDiscord | <Elegantbeef> I didnt write the bridge |
01:19:08 | FromDiscord | <!Patitotective> i mean, he doesnt want to rewrite |
01:19:10 | FromDiscord | <!Patitotective> lmao |
01:19:19 | FromDiscord | <!Patitotective> (edit) "i mean, he doesnt want to rewrite ... " added "it" |
01:19:23 | FromDiscord | <Elegantbeef> I dont even know which bridge is used |
01:32:45 | FromDiscord | <j-james> In reply to @Patitotective "really? when i tried": yeah it works great |
01:32:59 | FromDiscord | <j-james> nimlime with no syntax checking + nimlsp |
01:33:50 | FromDiscord | <!Patitotective> :/ |
01:56:03 | FromDiscord | <#!/rip/luke> What is the best mongodb lib |
01:57:10 | FromDiscord | <voidwalker> Trying to grasp my head around this async thing. What is wrong with this code? : |
01:57:25 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46oa |
01:57:38 | FromDiscord | <voidwalker> trying to get it to close the connection after N bytes read |
02:00:33 | FromDiscord | <huantian> Maybe it’s cus readAll waits until the connection is completely finished? |
02:01:04 | FromDiscord | <huantian> I also can’t remember if streaming requests are bugged or not lol |
02:03:14 | FromDiscord | <voidwalker> Hm don't remember where I picked that one from, but it seems readAll is for normal streams, not future streams |
02:07:20 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46oe |
02:09:02 | FromDiscord | <huantian> Maybe actually don’t await, just asyncCheck |
02:09:10 | FromDiscord | <voidwalker> let body = await resp.body ? |
02:09:22 | FromDiscord | <!Patitotective> In reply to @voidwalker "let body = await": yes |
02:09:24 | FromDiscord | <huantian> That way you can do stuff as the body is being read |
02:09:26 | FromDiscord | <!Patitotective> it just reads the body stream |
02:09:53 | FromDiscord | <!Patitotective> oh actually no |
02:10:06 | FromDiscord | <!Patitotective> it will read the whole body stream |
02:10:11 | FromDiscord | <!Patitotective> readAll will too |
02:10:48 | FromDiscord | <voidwalker> welp, both streams and async are foreign concepts to me |
02:11:25 | FromDiscord | <!Patitotective> https://nim-lang.org/docs/asyncstreams.html#len%2CFutureStream%5BT%5D |
02:11:27 | FromDiscord | <voidwalker> Wish there was some video animation of such a program running step by step, and its internal state |
02:11:36 | FromDiscord | <!Patitotective> read the docs https://nim-lang.org/docs/asyncdispatch.html |
02:15:09 | * | arkurious quit (Quit: Leaving) |
02:22:03 | FromDiscord | <voidwalker> I read that but it's not clear enough for a beginner in the topic :\ |
02:22:22 | FromDiscord | <voidwalker> just searched for "await" in the mastering nim book.. 0 results nice |
02:22:34 | FromDiscord | <voidwalker> how can you master nim if you can't do async |
02:23:58 | FromDiscord | <Elegantbeef> You become me and hardly ever use asnyc |
02:24:04 | FromDiscord | <Elegantbeef> so little i cannot spell it |
02:24:14 | FromDiscord | <!Patitotective> In reply to @voidwalker "I read that but": it was also hard to me to understand asynchronous stuff but you can search for "async/await programing" in google and youll be able to apply those concepts in nim |
02:24:47 | FromDiscord | <voidwalker> I remember dom's book had a pretty elaborate explanation, I should return to that |
02:27:46 | FromDiscord | <voidwalker> `A procedure can be executed in a new thread using the spawn procedure. ` |
02:27:58 | FromDiscord | <!Patitotective> those are threads |
02:33:50 | * | wallabra quit (Ping timeout: 240 seconds) |
02:45:50 | FromDiscord | <crack81> The autocomplete doesn't work in vscode , already installed the nim plugin, any clue about it? |
02:46:32 | FromDiscord | <Elegantbeef> If you arent using niimsaem's you should be |
02:48:21 | FromDiscord | <crack81> FYI I am using w11 and nim is installed and the path configured |
02:48:33 | FromDiscord | <crack81> (edit) "FYI I am using w11 and nim is installed and the path ... configured" added " is" |
02:52:36 | NimEventer | New post on r/nim by Ruri: Newbie Question about Proc Declaration, see https://reddit.com/r/nim/comments/we08zs/newbie_question_about_proc_declaration/ |
02:58:29 | * | pch quit (Quit: Leaving) |
03:06:01 | * | dextop_ is now known as dextop |
03:21:56 | FromDiscord | <!Patitotective> sent a code paste, see https://paste.rs/5J1 |
03:24:28 | FromDiscord | <huantian> what is Toast? |
03:24:41 | FromDiscord | <!Patitotective> an object |
03:24:49 | FromDiscord | <!Patitotective> do i send it? |
03:25:07 | FromDiscord | <flywind> Toast is marked as requiresInit? |
03:25:36 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46ok |
03:26:33 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=46ol |
03:26:46 | FromDiscord | <huantian> maybe it's cus Positive defaults to 0? |
03:27:12 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46om |
03:27:17 | FromDiscord | <huantian> !eval echo default(Positive) |
03:27:20 | NimBot | 0 |
03:27:26 | FromDiscord | <flywind> (edit) "https://play.nim-lang.org/#ix=46ol" => "https://play.nim-lang.org/#ix=46on" |
03:28:36 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=46oo |
03:28:46 | FromDiscord | <!Patitotective> :/ |
03:29:55 | * | CyberTailor_ quit (Remote host closed the connection) |
03:31:05 | * | CyberTailor_ joined #nim |
03:31:44 | FromDiscord | <Elegantbeef> It's telling you "The sequence can grow and you may not like the result" |
03:33:57 | FromDiscord | <!Patitotective> im iterating through a `seq[Toast]` and since i can delete an element inside the loop im `deepCopy`ing it↵not sure if its a good idea :/ |
03:35:00 | FromDiscord | <Elegantbeef> Doesnt sound like a good idea |
03:36:09 | FromDiscord | <!Patitotective> soooo should i `mySeq.delete(mySeq.find(ele))` |
03:36:10 | FromDiscord | <!Patitotective> (edit) "`mySeq.delete(mySeq.find(ele))`" => "`mySeq.delete(mySeq.find(ele))`?" |
03:36:46 | FromDiscord | <Elegantbeef> You should check if it's \>= 0 and probably use `del` if you dont need them in order |
03:37:13 | FromDiscord | <!Patitotective> :] |
03:41:20 | FromDiscord | <!Patitotective> 🌃 |
04:06:02 | * | dextop quit (Quit: WeeChat 2.8) |
04:41:58 | FromDiscord | <#!/rip/luke> Is it a good idea to have a database with a .nim file |
04:42:39 | FromDiscord | <#!/rip/luke> Like it can use type to define objects |
04:45:09 | FromDiscord | <&Makarov/1> Hello guys .. i hope you re doing well , i got all the time this question |
04:45:41 | FromDiscord | <&Makarov/1> Why using nim rather than rust |
04:45:46 | FromDiscord | <&Makarov/1> Or rather than zig |
04:45:58 | FromDiscord | <that_dude> Because nim is cool |
04:46:03 | FromDiscord | <that_dude> simple as |
04:46:14 | FromDiscord | <Prestige> It's easier to read and write, and has comparable performance to rust and zig |
04:46:15 | FromDiscord | <Elegantbeef> It's a more expressive language that has a different type system to Rust or Zig |
04:48:10 | FromDiscord | <&Makarov/1> In reply to @Elegantbeef "It's a more expressive": By expressive you mean what exactly ? |
04:48:55 | FromDiscord | <Elegantbeef> It's very easy to write and doesnt require writing a lot to get to the point |
04:49:11 | FromDiscord | <Elegantbeef> Compare that to Zig's method of generics or rust in general |
04:49:53 | FromDiscord | <&Makarov/1> In reply to @Elegantbeef "Compare that to Zig's": Can u pls give me an example of that 🙏 |
04:51:06 | FromDiscord | <gibson> @that_dude easier to read/write/share with novices, great performance, runs everywhere. I love how like Rust nim assumes safety for you, but unlike Rust doesn't berate you for playing around just to get something to work, but Nim lets you adjust all the nuts and bolts to achieve very similar safety and assurances and performance tweaks, should you care (unsafe memory, exception tracking, pure funcs, noinit) |
04:54:07 | FromDiscord | <&Makarov/1> In reply to @gibson "<@532751332445257729> easier to read/write/share": Hmmm |
04:54:18 | FromDiscord | <that_dude> Don't think you pinged the right person lol |
04:55:03 | FromDiscord | <gibson> Oops, you're right. Can I change it?... |
04:55:22 | FromDiscord | <that_dude> Maybe change the message, but he understood so it's prob fine |
04:56:49 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=46pd |
05:03:01 | FromDiscord | <gibson> Or compile-time parameter pack indexing, which is notoriously difficult in C++, to get the Nth element of an iterable object, is insanely easy in Nim, using the same syntax you would use to do it at runtime. For instance, here is the C++ talk from May 2022 on exactly this topic. https://www.youtube.com/watch?v=LfOh0DwTP00 |
05:04:08 | FromDiscord | <b1rdf00d> I'm interested in Zig, but it has not operator overloading or macros. And it's manually memory managed (which I'd like to practice) |
05:04:24 | FromDiscord | <Elegantbeef> You can practice with Nim 😛 |
05:04:54 | FromDiscord | <b1rdf00d> also strings are just arrays of u8 and doing the AOC with zig started to become a bit tedious |
05:05:26 | FromDiscord | <b1rdf00d> Nim feels like a dynamic language, but it's typed and compiled |
05:05:27 | FromDiscord | <gibson> Yeah, honestly practicing manual memory management in Nim has been very fun, because any of the stuff you _don't_ want to spend time doing, you don't have to, and you can focus on whatever the heart of your fancy algorithm is. |
05:06:11 | FromDiscord | <b1rdf00d> I'm interested in the custom allocators in Zig, and defer. Thinking I might try to follow Crafting Interpreters using Zig instead of C |
05:06:26 | FromDiscord | <Elegantbeef> Shame |
05:06:43 | FromDiscord | <b1rdf00d> But yes, having access to it when you want to instead of being forced to all the time is a great part of Nim |
05:08:07 | FromDiscord | <b1rdf00d> In reply to @Elegantbeef "Shame": Actually, I think it would help me better understand what I'm doing when writing Nim. I ran into a question with `ref` on the weekend and I think if I'd had more recent experience with a manually memory managed language I would have understood better |
05:08:13 | FromDiscord | <Elegantbeef> Personally i'd rather use odin than zig, as it has features i'd like |
05:08:25 | FromDiscord | <Elegantbeef> Sure but why not just use Nim with manual memory management? |
05:08:51 | FromDiscord | <b1rdf00d> In reply to @Elegantbeef "Sure but why not": Actually this is a good point. I might do this instead |
05:08:52 | FromDiscord | <Elegantbeef> `--mm:none -d:useMalloc` and valgrind to ensure you dont leak |
05:09:32 | FromDiscord | <Elegantbeef> Odin actually has distincts and bitsets |
05:10:02 | FromDiscord | <Elegantbeef> Oh and enum indexed arrays 😄 |
05:10:27 | FromDiscord | <b1rdf00d> Odin is interesting to me too, a couple of things I'm not sure about: not sure I'm "correct" enough as a developer for Ginger Bill's standards, errors are just handled as an additional return var. ↵↵String handling in Odin seems much nicer than in Zig and it does also have custom allocators |
05:10:56 | FromDiscord | <Elegantbeef> Yea the multiple return type for error handling i dislike |
05:11:11 | FromDiscord | <Elegantbeef> I'm an odd duck as i prefer exceptions |
05:11:33 | FromDiscord | <b1rdf00d> I went to install valgrind the other night to profile my ray tracer but apple silicon is not yet supported, might have to do it on my 2012 air |
05:12:19 | FromDiscord | <Elegantbeef> wonders if it works with linux |
05:12:55 | FromDiscord | <b1rdf00d> actually yeah I might try installing a linux VM |
05:13:08 | FromDiscord | <Elegantbeef> I more meant running linux natively 😄 |
05:13:22 | FromDiscord | <b1rdf00d> ah yep, been there |
05:13:45 | FromDiscord | <Elegantbeef> I'd imagine valgrind there would work |
05:13:55 | FromDiscord | <b1rdf00d> I'm tempted to go back, but can't for work and kinda can't be bothered for my personal machine |
05:14:36 | FromDiscord | <Elegantbeef> cmon if linus can develop linux on it you can develop whatever you need on it 😛 |
05:18:33 | FromDiscord | <huantian> did you know linux switched to asahi? |
05:18:38 | FromDiscord | <huantian> and is on an macbook now |
05:18:51 | FromDiscord | <huantian> which is like ↵cool but apple |
05:19:03 | FromDiscord | <huantian> (edit) "linux" => "linus" |
05:19:42 | FromDiscord | <b1rdf00d> yeah it's impressive |
05:21:17 | FromDiscord | <Prestige> sounds like a poor choice imo |
05:24:11 | FromDiscord | <flywind> !eval import std/macros; dumpTree: let x = block: 12 |
05:24:13 | NimBot | Compile failed: /usercode/in.nim(1, 30) Error: expression expected, but found 'keyword let' |
05:26:56 | FromDiscord | <flywind> Is there a reason for block expressions and block statements share the same node kind: nkBlockStmt? |
05:27:14 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=46pr |
05:27:37 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=46ps |
05:29:42 | FromDiscord | <b1rdf00d> In reply to @huantian "did you know linus": oh Linus did, that I did not know |
05:29:58 | FromDiscord | <flywind> In reply to @flywind "Is there a reason": So does `nkCaseStmt`. |
05:30:01 | FromDiscord | <huantian> yeah typo sorry lol |
05:54:37 | * | jmdaemon joined #nim |
06:00:41 | FromDiscord | <wiga> any idea how i can additionate floats with integer? https://media.discordapp.net/attachments/371759389889003532/1003905155982426172/unknown.png |
06:01:58 | FromDiscord | <Prestige> You mean add? Lol |
06:02:09 | FromDiscord | <Prestige> `float(someInt) + 0.5` |
06:02:15 | FromDiscord | <wiga> In reply to @Avahe "You mean add? Lol": french, dont mind |
06:02:19 | FromDiscord | <wiga> In reply to @Avahe "`float(someInt) + 0.5`": ty |
06:09:11 | FromDiscord | <Prestige> Is there a way to make a `set` filled with all values from an enum? Or do I just have to create the set |
06:09:32 | FromDiscord | <Girvo> I didn't realise Asahi is so far along it can be run. Nice, I might setup my M1 Pro to run it |
06:16:18 | FromDiscord | <Prestige> Elegantbeef help me out here ^ |
06:23:39 | * | CyberTailor_ quit (Remote host closed the connection) |
06:27:28 | * | CyberTailor_ joined #nim |
06:32:00 | FromDiscord | <Prestige> I'm basically trying to get a random value from an enum, _excluding_ any values the user passes in. Was planning on uses sets, it's been a pita so far |
06:33:00 | FromDiscord | <Phil> sent a long message, see http://ix.io/46pK |
06:34:29 | FromDiscord | <&Makarov/1> In reply to @Isofruit "As someone who tried": Thanks for this explanation !! |
06:36:29 | FromDiscord | <Girvo> Tbh, thats because Rust is honestly a _bad fit_ for web development/modern back-end dev. Its not what it's good at, IMHO |
06:36:53 | FromDiscord | <Girvo> I know a lot of people are putting a lot of work into trying to make it happen, but it really feels like a square-peg round-hole situation to me |
06:38:56 | * | CyberTailor_ quit (Remote host closed the connection) |
06:39:16 | FromDiscord | <Girvo> Honestly a lot of what it gets pushed for by the Rust crowd it's a bad fit for lol |
06:39:32 | FromDiscord | <Phil> In reply to @Girvo "Tbh, thats because Rust": I do not think myself experienced enough to be able to evaluate that, so that's likely true.↵Would you say that because of the push for correctness or what feature makes it so? |
06:39:34 | FromDiscord | <Girvo> And I say that as someone who _likes_ the language. Though I feel Nim is superior in most ways for most projects |
06:39:46 | FromDiscord | <huantian> man I actually need to try rust at some point |
06:40:00 | FromDiscord | <Phil> In reply to @huantian "man I actually need": The one thing you'll really like is pattern matching. Man that is a nice feature |
06:40:01 | * | CyberTailor_ joined #nim |
06:40:09 | FromDiscord | <Phil> That and Result types |
06:40:11 | FromDiscord | <Phil> chef's kiss |
06:40:30 | FromDiscord | <Girvo> Web development/server dev is all about stringly-typed stuff, and munging incoming/outgoing data in various forms. Its why dynamic-ish scripting languages are so great at it, for example. It's the antithesis of Rusts correctness checking 🙂 |
06:40:49 | FromDiscord | <Girvo> At the end of the day, HTTP Is all about strings and doing weird stuff to them 😉 |
06:41:06 | FromDiscord | <Girvo> That, and Rusts async story is _still_ not sorted out fully yet |
06:41:10 | FromDiscord | <Girvo> Which is a pretty big blocker, IMO |
06:41:11 | FromDiscord | <Phil> In reply to @Girvo "Web development/server dev is": Hmm but wouldn't nim also be bad at it then? |
06:41:39 | FromDiscord | <huantian> In reply to @Girvo "That, and Rusts async": you say that like nim async is perfect 🙃 |
06:41:43 | FromDiscord | <Phil> Or maybe I am biased at this point, I've spent 3 times the amount with nim than I have with rust |
06:41:44 | FromDiscord | <Girvo> Nim is _great_ at munging strings though 😄 Or, should I say, it _can_ be, because you can be a strict or as loosey-goosey as you need to be |
06:41:53 | FromDiscord | <Girvo> In reply to @huantian "you say that like": No I didn't 😉 |
06:42:06 | FromDiscord | <Girvo> Its one of my main pain-points in Nim still today haha |
06:42:31 | FromDiscord | <Phil> In reply to @Girvo "Nim is _great_ at": How does one evaluate that? Or is that because Rust has 2 different string types that you need to deal with? |
06:42:37 | * | CyberTailor_ quit (Remote host closed the connection) |
06:42:51 | FromDiscord | <Girvo> Rusts big benefit is `serde` though. Fantastic project that is great at marshalling data into and out of various forms |
06:42:51 | FromDiscord | <huantian> In reply to @Girvo "Nim is _great_ at": I really like how nim strings are just ascii bytes |
06:43:17 | FromDiscord | <huantian> you don't have to worry about encoding until you have to worry about it |
06:43:31 | FromDiscord | <Girvo> @huantian I have a love-hate relationship with that |
06:43:57 | FromDiscord | <Elegantbeef> sample the random difference of a set and the given value?↵(@Prestige) |
06:44:14 | * | CyberTailor_ joined #nim |
06:44:18 | FromDiscord | <Elegantbeef> `enumutils` if it wasnt pointed out |
06:44:23 | FromDiscord | <Girvo> I _love_ it because for the work I'm doing right now, its perfect. I can't waste cycles on my tiny processor for UTF-8. But for larger network projects that deliver stuff to a users browser, I'd prefer UTF-8 by-default. PHP rightfully caught a lot of flack for being ASCII-first up until recently |
06:44:24 | FromDiscord | <Phil> In reply to @huantian "you don't have to": It's kinda funny to me that generating a random string is honestly faster by just generating random bytes with syrand and base64 encoding them than choosing a random character from a set of character n times |
06:44:49 | FromDiscord | <Prestige> In reply to @Elegantbeef "sample the random difference": Yeah that's my goal. Thanks I'll check out enumutils |
06:44:54 | FromDiscord | <Phil> Which I assume the entire byte-thing plays into |
06:45:10 | FromDiscord | <Bung> how to get privilege for manage services in windows? |
06:45:25 | FromDiscord | <Phil> ... context? |
06:45:39 | FromDiscord | <Girvo> @Bung you mean trigger a UAC prompt to ask for that perm? |
06:45:46 | FromDiscord | <Bung> fails to call OpenSCManager with code 5 |
06:46:15 | FromDiscord | <Bung> prompt or not I dont care |
06:46:41 | FromDiscord | <Bung> I just want run a program stop some services |
06:47:06 | FromDiscord | <Girvo> Right click -> run as admin? |
06:47:17 | FromDiscord | <Girvo> Or do you need to do it programatically? |
06:47:52 | FromDiscord | <Bung> https://github.com/bung87/gamode/blob/main/src/gamode/srv.nim |
06:47:54 | FromDiscord | <Girvo> I believe if you ensure your binary is named `EXAMPLE_setup.exe` windows will automatically request elevated privileges |
06:49:04 | FromDiscord | <Bung> ah, haven't pack as installer , just debuging through `nim c -r ` |
06:49:21 | FromDiscord | <Girvo> Ah that's why 🙂 |
06:50:01 | FromDiscord | <Girvo> You can in theory turn `nim.exe` into needing Admin permissions lol but that might be annoying |
06:50:37 | FromDiscord | <huantian> In reply to @Girvo "I believe if you": wait whattttttt I didn't know this |
06:50:39 | FromDiscord | <Bung> hmm let me try manually run as admin first |
06:50:50 | FromDiscord | <Girvo> If you find the `.exe` file that your `nim c` has built, you can right click it -> properties -> "Run this program as administrator" |
06:51:00 | FromDiscord | <Girvo> But it'll likely get wiped each time you rebuild |
06:51:17 | FromDiscord | <Girvo> @huantian It definitely used to work that way back in Windows 7! It's possible it has changed mind you |
06:52:55 | FromDiscord | <Bung> yeah , it's work, thanks. my program works as expected. |
06:52:58 | FromDiscord | <Girvo> If you want it to start with User permissions by default, and request a UAC prompt to get Admin at run-time, you'll likely need to do some COM fiddling.↵https://docs.microsoft.com/en-us/windows/win32/com/the-com-elevation-moniker |
06:53:16 | FromDiscord | <Girvo> Basically use `CoGetObject` to create an elevated operation, to manage services for example |
06:53:24 | FromDiscord | <Girvo> But this is left as an exercise to the reader 😉 |
06:58:59 | FromDiscord | <Bung> I understand , register com app to registry then send request prompt to get privileges |
07:01:20 | FromDiscord | <Bung> btw , do you load how to switch keyboard layout in program? |
07:01:34 | FromDiscord | <Bung> (edit) "load how" => "knowhow" |
07:01:41 | FromDiscord | <Bung> (edit) "knowhow" => "know how" |
07:02:26 | FromDiscord | <Bung> I tried `ActivateKeyboardLayout` doesn't seem to work |
07:08:14 | * | gsalazar quit (Quit: Leaving) |
07:08:29 | * | gsalazar joined #nim |
07:11:28 | FromDiscord | <Prestige> Elegantbeef: I'm not sure how I should utilize enumutils for this use case |
07:11:34 | FromDiscord | <Prestige> If you have any ideas |
07:11:48 | FromDiscord | <Girvo> @Bung Not sure, been _years_ since I was doing stuff like that 🙂 |
07:12:14 | FromDiscord | <Girvo> But yeah ↵>Switching the keyboard layout requires some P/Invoke; you´ll need at least the following Windows functions to get it working: LoadKeyboardLayout, GetKeyboardLayout and ActivateKeyboardLayout. The following import declarations worked for me... |
07:12:18 | FromDiscord | <Girvo> (edit) "↵>Switching" => "↵> Switching" |
07:12:28 | FromDiscord | <huantian> sent a long message, see http://ix.io/46q2 |
07:12:30 | FromDiscord | <Girvo> ^ thats from some C# COM discussion on how to do it @Bung |
07:14:18 | FromDiscord | <Elegantbeef> `sample(fullSet(MyEnum) - {myEnum})`prestige |
07:14:29 | FromDiscord | <Girvo> > This function only affects the layout for the current process or thread.↵^ This isn't true anymore. Windows no longer has per-process keyboard layouts, it's global. So it likely needs Admin permissions too, I think |
07:14:54 | FromDiscord | <Bung> In reply to @Girvo "But yeah >": yeah, I did it exactly same, but did not work, and the keyboard layout I loaded does not list in settings but in task bar |
07:15:06 | FromDiscord | <Prestige> In reply to @Elegantbeef "`sample(fullSet(MyEnum) - {myEnum})`prestige": What is sample? |
07:15:18 | FromDiscord | <Elegantbeef> It's a procedure in `std/random` |
07:15:28 | FromDiscord | <Girvo> @Bung Yeah welcome to Windows API programming haha, it's a mess 😄 |
07:15:40 | FromDiscord | <Prestige> sweet that's the one bit I was missing. Thanks |
07:16:11 | FromDiscord | <Bung> In reply to @Girvo "> This function only": yeah , maybe it's privilege problem too, thanks! help a lot. |
07:16:39 | FromDiscord | <Girvo> No worries 🙂 |
07:17:30 | FromDiscord | <huantian> In reply to @huantian "<https://www.reddit.com/r/programminghorror/comment": though concepts exist ig, but you don't get that safety when writing the procedure, it's only nicer for the user |
07:28:34 | FromDiscord | <huantian> Hm would it even be possible for concepts to work like how rust traits work, with the compile time tooling |
07:33:52 | FromDiscord | <Rika> Rust traits are opt in, Nim concepts are “whatever fits fits” |
07:34:29 | FromDiscord | <Elegantbeef> Yes Huan it'd be possible the compiler would just have to check that all usages of your type that is bound to a concept is applicable to the concept |
07:34:48 | FromDiscord | <Elegantbeef> It requires making the compiler smarter |
07:35:30 | FromDiscord | <Rika> Lol |
07:36:02 | FromDiscord | <Rika> I don’t really know what traits do exactly so cd |
07:36:07 | FromDiscord | <Rika> (edit) "cd" => "xd" |
08:02:59 | FromDiscord | <huantian> Yeah I have no idea how, even generally, this would actually implemented |
08:03:09 | FromDiscord | <huantian> But it does seem possible |
08:10:14 | FromDiscord | <frobnicate> Seeing the word "traits" makes me shiver due to PHP |
08:12:03 | FromDiscord | <frobnicate> Anyway, question time: any good tutorial or example on multi threading in Nim other than the docs and Nim in action? |
08:12:32 | FromDiscord | <frobnicate> And any way to benchmark on windows? |
08:14:13 | FromDiscord | <Phil> In reply to @frobnicate "And any way to": How precisely benchmarking are we talking?↵For simple "how fast is func x compared to y" you can just use benchy in a mini playground project |
08:51:43 | FromDiscord | <b1rdf00d> I used the manual recently to multithread my raytracer using `parallel` . The tracing is all independent so I didn’t need to deal with mutating state across threads. It wasn’t clear why I should use `parallel` over a `threadpool`. |
09:04:41 | * | oddish joined #nim |
09:04:54 | FromDiscord | <frobnicate> In reply to @Isofruit "How precisely benchmarking are": I wanted to try putting a benchmark in my render loop |
09:05:27 | FromDiscord | <frobnicate> I'm fooling myself into believing I'm making a renderer |
09:06:04 | FromDiscord | <frobnicate> In reply to @b1rdf00d "I used the manual": I see, thanks |
09:08:13 | * | jmdaemon quit (Ping timeout: 268 seconds) |
09:09:08 | Amun-Ra | huantian: regarding trais, same here but due to rust not php |
09:11:36 | FromDiscord | <Rika> We were discussing rust traits though |
09:13:05 | FromDiscord | <b1rdf00d> In reply to @frobnicate "I see, thanks": Not sure if it’s helpful but here’s the code which has a single threaded and multithreaded version starting line 132. I found the docs to be a little sparse, a bit more complicated example would have helped. ↵↵https://github.com/danielclarke/raytracing/blob/main/nim/src/tracer.nim |
09:14:41 | FromDiscord | <b1rdf00d> In reply to @Rika "We were discussing rust": I’m keen on exploring rust traits vs Nim ufcs + Concepts more. I think they provide similar functionality but I’m a noob and want to try writing something much more in depth in both |
09:15:32 | FromDiscord | <b1rdf00d> The Nim version seems more “dynamic” and the rust version seems more “enterprise” |
09:19:11 | FromDiscord | <Elegantbeef> Ironic since the Nim variant is static and the rust variant is capable of being dynamic 😄 |
09:54:40 | FromDiscord | <untoreh> in gdb when I call `info locals` all the vars are named T_xxx is there a way to get the source names? |
10:53:03 | FromDiscord | <Superstart033> Do you guys have any guides on how to do “Conway’s game of life”? I would like to try and do it as my first Nim project |
10:53:19 | FromDiscord | <Superstart033> Also, do I need a graphics library for that? |
10:55:08 | FromDiscord | <hotdog> In reply to @Superstart033 "Do you guys have": Cool idea! |
10:55:08 | FromDiscord | <hotdog> In reply to @Superstart033 "Also, do I need": You could output characters to the terminal, or use a graphics library |
10:55:50 | FromDiscord | <hotdog> sdl2 is pretty simple to get started with, or Araq's pixel library which I think is based on sdl2 and just gives you simple draw functions |
10:56:40 | FromDiscord | <hotdog> I've used this wrapper before successfully: https://nimble.directory/pkg/sdl2nim |
10:57:01 | FromDiscord | <hotdog> This is the pixels library: https://nimble.directory/pkg/pixels |
10:57:21 | FromDiscord | <Superstart033> In reply to @hotdog "You could output characters": Yeah, that was the idea. Probably using the symbol as the cells. |
10:57:37 | FromDiscord | <hotdog> Raylib is another option, there's a few wrappers: https://nimble.directory/search?query=raylib |
10:57:41 | FromDiscord | <Superstart033> But I wanted to know if I needed to use a graphics lib just in case |
10:57:49 | FromDiscord | <hotdog> In reply to @Superstart033 "But I wanted to": You don't have to |
10:57:57 | FromDiscord | <PyryTheBurger> Can someone help me with generics? everytime i try to do something weith them i get the error "generic/template instansiation from here" |
10:58:14 | FromDiscord | <Superstart033> In reply to @hotdog "You don't have to": Thank you for the support, hotdog! |
10:58:40 | FromDiscord | <hotdog> @Superstart033 useful terminal stuff is in this stdlib module: https://nim-lang.org/docs/terminal.html |
10:58:56 | FromDiscord | <hotdog> This package is also cool for advanced terminal interfaces: https://nimble.directory/pkg/illwill |
10:59:21 | FromDiscord | <hotdog> Hope that helps get you started 🙂 Feel free to message on here with any questions, people are very helpful |
10:59:40 | FromDiscord | <Superstart033> I notice yeah! Thank you so much |
10:59:56 | FromDiscord | <hotdog> In reply to @PyryTheBurger "Can someone help me": Do you have a code example of what you're trying to do? |
11:25:23 | * | CyberTailor_ quit (Remote host closed the connection) |
11:27:09 | * | CyberTailor_ joined #nim |
11:27:38 | FromDiscord | <Phil> In reply to @Superstart033 "Do you guys have": OHHHH that's a fun one! Cool idea! |
11:30:50 | FromDiscord | <Phil> In reply to @Superstart033 "But I wanted to": If you want to use this as a learning experience, it might be useful to first write the program for the terminal, and then later on to write it as e.g. a gnome application. That has the nice benefit of exposing you to both terminal and GUI stuff and once the GUI stuff comes around you only have 1 new thing to get used to |
11:31:26 | FromDiscord | <Superstart033> I see, thank you. I’ll try |
11:45:29 | NimEventer | New thread by Jasonfi: Nexus context types are being refactored, see https://forum.nim-lang.org/t/9340 |
13:12:58 | * | CyberTailor_ quit (Ping timeout: 268 seconds) |
13:13:41 | * | CyberTailor_ joined #nim |
13:32:18 | * | xet7 quit (Remote host closed the connection) |
13:44:17 | * | wallabra joined #nim |
13:46:37 | FromDiscord | <PyryTheBurger> why does this code not work omggggg proc getComp(ent: Entity, T: typedesc): T =↵ result = cast[T](ent.comps[T.name]) and that code gets no errors in one file but then in another file echo ent.getComp(LolComp).lol there is that stupid generics error |
13:48:50 | FromDiscord | <PyryTheBurger> nvm got it working |
13:50:37 | FromDiscord | <PyryTheBurger> how can i get the type that the typedesc is describing |
13:53:42 | FromDiscord | <Rika> the typedesc is the type, wdym |
13:55:10 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46rv |
13:55:27 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=46rv" => "https://play.nim-lang.org/#ix=46rw" |
13:55:53 | FromDiscord | <PyryTheBurger> wooooooooooooow perfect |
13:55:55 | FromDiscord | <PyryTheBurger> sorry |
13:56:05 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=46rw" => "https://play.nim-lang.org/#ix=46rx" |
13:57:05 | FromDiscord | <PyryTheBurger> In reply to @Isofruit "Heya, by using 3": no that returns an error |
13:57:51 | FromDiscord | <Phil> In reply to @PyryTheBurger "no that returns an": Generally, when saying it returns an error, you would copy-paste the error. You can also do that with backticks for readability, e.g.:↵\`\`\`txt↵some error text↵\`\`\` |
13:58:33 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix= |
13:59:08 | FromDiscord | <Phil> How are you calling getComp? |
13:59:19 | FromDiscord | <PyryTheBurger> echo ent.getComp(LolComp).lol |
13:59:29 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix= |
14:00:09 | FromDiscord | <Phil> And the above is the entire text your terminal throws out?↵The above is more than likely a warning that leads to the actual error 2-3 lines down |
14:00:58 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=46rz |
14:01:03 | FromDiscord | <Phil> AHA! See, the below line is your actual error |
14:01:19 | FromDiscord | <PyryTheBurger> i dont really understand |
14:01:32 | FromDiscord | <Phil> is "name" a field on your type `LolComp`? |
14:01:37 | FromDiscord | <PyryTheBurger> lolcomp has a field name |
14:01:55 | FromDiscord | <PyryTheBurger> nope it doesnt |
14:01:58 | FromDiscord | <PyryTheBurger> arghhhhhhhhhhh |
14:02:01 | FromDiscord | <PyryTheBurger> im so dumbbbb |
14:02:07 | FromDiscord | <Phil> You have another issue there |
14:02:26 | FromDiscord | <Phil> "LolComp" is not an instance of the type LolComp, it is the type LolComp itself |
14:02:39 | FromDiscord | <PyryTheBurger> huh |
14:03:01 | FromDiscord | <Phil> As in, the type description. That's like a class in Java, it contains the information that "I have all of these fields", but since it isn't an instance of the type it doesn't hold actual data |
14:03:48 | * | arkurious joined #nim |
14:04:33 | FromDiscord | <PyryTheBurger> yeah but its a ref object of component so it says its a component but i want it to be a lolcomponent |
14:05:09 | FromDiscord | <enthus1ast> what is T.name supposed to do? |
14:05:31 | FromDiscord | <PyryTheBurger> T.id is an index of a table |
14:05:43 | FromDiscord | <PyryTheBurger> t is supposed to be a lolcomp |
14:05:48 | FromDiscord | <PyryTheBurger> i dont know |
14:05:59 | FromDiscord | <enthus1ast> T.id ? |
14:06:15 | FromDiscord | <PyryTheBurger> its a string |
14:06:21 | FromDiscord | <Phil> In reply to @PyryTheBurger "yeah but its a": Ohhh so this is an inheritance thing?↵You have something of type `Entity` and you know that it is the subclass `LolComp` which inherits from `Entity` and thus want to type-cast it to be `LolComp` to get access to the corresponding fields and such.↵Is that correct? |
14:06:56 | FromDiscord | <Phil> Or are these 2 completely separate types and you want to convert from one to the other? |
14:06:58 | FromDiscord | <PyryTheBurger> there is a class Component and every component like LolComp is inheritence from it |
14:07:23 | FromDiscord | <PyryTheBurger> and Component type has an id |
14:07:58 | FromDiscord | <enthus1ast> you can get the name of the type (as a string) with `$T` |
14:08:07 | FromDiscord | <Phil> Could you copy paste the type definitions of `Entity` and `LolComp` ? |
14:08:18 | FromDiscord | <enthus1ast> https://github.com/enthus1ast/ecs/blob/f693322e32782e3e676b96ae8a783a556917d9cf/src/ecs.nim#L153 |
14:08:35 | FromDiscord | <PyryTheBurger> In reply to @enthus1ast "https://github.com/enthus1ast/ecs/blob/f693322e3278": i want to make my own |
14:08:59 | FromDiscord | <enthus1ast> sure, but maybe you can see how i got the name↵(@PyryTheBurger) |
14:09:07 | FromDiscord | <PyryTheBurger> sent a code paste, see https://paste.rs/GyT |
14:11:10 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/3sI |
14:11:56 | FromDiscord | <PyryTheBurger> yes probably |
14:12:14 | FromDiscord | <PyryTheBurger> the keys are Component.id's |
14:13:56 | FromDiscord | <PyryTheBurger> what does all the [T] mean tho |
14:13:59 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46rE |
14:15:15 | FromDiscord | <PyryTheBurger> In reply to @Isofruit "Ahhhh okay, yeah then": no this doesnt work because it thinks lolcomp is just Component |
14:16:33 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46rF |
14:17:28 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=46rF" => "https://play.nim-lang.org/#ix=46rG" |
14:17:40 | FromDiscord | <domosokrat> sent a code paste, see https://play.nim-lang.org/#ix=46rH |
14:17:56 | FromDiscord | <Phil> entity doesn't ahve an id field domosokrat |
14:18:04 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=46rI |
14:18:10 | * | krux02 joined #nim |
14:18:13 | FromDiscord | <voidwalker> can someone produce code that will close the http client after N bytes being downloaded ? I can't figure it out. Spent 2 hours researching :\ |
14:18:32 | FromDiscord | <domosokrat> damn, didn't pay attention \:( |
14:19:32 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=46rJ |
14:19:55 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46rK |
14:19:59 | FromDiscord | <enthus1ast> T is your type |
14:20:04 | FromDiscord | <enthus1ast> not the instance |
14:20:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46rL |
14:20:26 | FromDiscord | <Phil> Do you know other programming languages? Maybe I can make a comparison to those |
14:20:53 | FromDiscord | <PyryTheBurger> C:\Users\delux\dev\nim\projects\ecs\src\game.nim(11, 75) template/generic instantiation of `getComp` from here↵C:\Users\delux\dev\nim\projects\ecs\src\ecs.nim(67, 33) Error: undeclared field: 'id' |
14:21:15 | FromDiscord | <PyryTheBurger> i understand yeah |
14:22:32 | FromDiscord | <enthus1ast> its the same as writing LolType.id |
14:23:11 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46rN |
14:23:22 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=46rN" => "https://play.nim-lang.org/#ix=46rO" |
14:23:50 | FromDiscord | <Phil> Most of the time you only need typedesc[T] or the like when you do meta-programming of sorts |
14:26:04 | FromDiscord | <enthus1ast> i still don't get what this all should actually do `ent.comps[T.id]` |
14:26:06 | FromDiscord | <Phil> That's why it's useful to show us always the proc and how you call it in one go |
14:26:07 | FromDiscord | <enthus1ast> you store the components inside the entitiy? |
14:26:49 | FromDiscord | <enthus1ast> if yes, then why not use the type as the key? (as i shown in my example) |
14:26:56 | * | CyberTailor_ quit (Remote host closed the connection) |
14:28:06 | * | CyberTailor_ joined #nim |
14:29:49 | FromDiscord | <Phil> Is it typical for such a system to only have 1 instance? I assumed he might want an ID to have multiple instances of the same type |
14:30:15 | FromDiscord | <enthus1ast> typically you would not store the components in the entities |
14:31:28 | FromDiscord | <enthus1ast> in his design (at least what i've guessed now) is that his entity has a table that stores all component objects assigned to the entity |
14:32:33 | FromDiscord | <enthus1ast> usually you only have one component of the same type per entity |
14:32:40 | FromDiscord | <enthus1ast> at least with the ecs'es i've used |
14:47:15 | * | gsalazar quit (Quit: Leaving) |
14:47:32 | * | gsalazar joined #nim |
14:55:36 | FromDiscord | <PyryTheBurger> where do you store the components if not entitiesa |
14:55:58 | NimEventer | New thread by Woodwindblues: Translating "Nature of Code" to Nim - Which graphics library should I use?, see https://forum.nim-lang.org/t/9341 |
15:00:21 | FromDiscord | <PyryTheBurger> In reply to @enthus1ast "if yes, then why": do you mean that i should set the id of lolcomp to be $LolComp |
15:04:41 | * | wallabra_ joined #nim |
15:05:26 | * | wallabra quit (Ping timeout: 240 seconds) |
15:05:57 | FromDiscord | <enthus1ast> Not sure why you need the id at all |
15:06:28 | FromDiscord | <enthus1ast> In the registry↵(@PyryTheBurger) |
15:06:46 | * | wallabra_ is now known as wallabra |
15:06:48 | FromDiscord | <enthus1ast> The entity is as lightweight as possible (just an int) |
15:06:54 | FromDiscord | <PyryTheBurger> what |
15:07:26 | FromDiscord | <PyryTheBurger> bruh im doing everything wrong |
15:07:29 | FromDiscord | <enthus1ast> That you use for all the lookups |
15:07:56 | FromDiscord | <enthus1ast> BUT you approach could also work, so yeah |
15:09:12 | FromDiscord | <PyryTheBurger> what is a tableref compared to a table |
15:13:03 | FromDiscord | <Phil> A table will be copied whenever you reassign it, tableref is a normal ref type so lives in heap memory |
15:13:26 | FromDiscord | <Phil> Use table for small tables and ref for larger ones |
15:14:20 | FromDiscord | <PyryTheBurger> why do you need all that {.gcsafe.} and stuff |
15:14:32 | FromDiscord | <PyryTheBurger> for me it adds those automatically |
15:14:43 | FromDiscord | <Phil> In general? |
15:15:04 | FromDiscord | <Phil> Or are you taking about some code example from enthusiast ? |
15:15:05 | FromDiscord | <AmitSupremacy> hi, sorry to interrup, I need to create a cli app, is there any library that provides api for flag parsing and loading animation? |
15:15:13 | FromDiscord | <PyryTheBurger> in general |
15:17:09 | FromDiscord | <Phil> I'm on phone and soon climbing, the reason is multi threading, aka 2 threads could work on the same object at the same time and if one e.g. deletes an object and hands it's memory back to the system while the other wanted to assign to it, it'll try to do so on a piece of memory it no longer has access to |
15:17:20 | FromDiscord | <Phil> Somebody else will have to explain more in depth |
15:17:51 | * | CyberTailor_ quit (Remote host closed the connection) |
15:18:46 | * | CyberTailor_ joined #nim |
15:21:27 | FromDiscord | <Superstart033> Can constant arrays change still have their values change? |
15:21:36 | FromDiscord | <Superstart033> (edit) removed "change" |
15:28:38 | * | gsalazar quit (Ping timeout: 240 seconds) |
15:51:32 | FromDiscord | <auxym> In reply to @AmitSupremacy "hi, sorry to interrup,": cligen is the popular one for CLI flags parsing. not sure what you mean by animation though? something tui like curses? if so check out illwill |
15:54:50 | * | CyberTailor_ quit (Remote host closed the connection) |
15:55:49 | * | CyberTailor_ joined #nim |
15:56:06 | FromDiscord | <AmitSupremacy> In reply to @auxym "cligen is the popular": completion status/ loading animation like tqdm in python |
16:02:01 | * | gsalazar joined #nim |
16:04:53 | FromDiscord | <auxym> this turns up 3 options: https://nimble.directory/search?query=progress |
16:09:26 | * | gsalazar quit (Ping timeout: 240 seconds) |
16:16:42 | FromDiscord | <EyeCon> You can create yours with the terminal package if it's not complicated |
16:16:44 | * | krux02 quit (Remote host closed the connection) |
16:16:56 | FromDiscord | <EyeCon> Part of the stdlib |
16:23:16 | FromDiscord | <voidwalker> Help. Need code to get just first N bytes with httpclient, then close connection |
16:25:35 | FromDiscord | <voidwalker> Didn't find any way to do it with httpclient itself, so something like asynchttpclient, and constant polling until the N bytes are got. N is small for me, so it shouldn't be a problem to wait in a loop for this |
16:33:33 | FromDiscord | <EyeCon> Would it be OK to just send a Content-Range and read all returned bytes? |
16:33:57 | FromDiscord | <voidwalker> oh wait, is that just a header the server complies with ?> |
16:34:06 | FromDiscord | <voidwalker> that might work then |
16:34:23 | FromDiscord | <EyeCon> Sorry, request has header `Range` apparently |
16:34:40 | FromDiscord | <EyeCon> Response has `Content-Range` if I read it correctly |
16:34:42 | FromDiscord | <Rika> Not all servers support it but there’s a chance |
16:35:16 | FromDiscord | <EyeCon> In reply to @voidwalker "oh wait, is that": Exactly |
16:35:24 | FromDiscord | <EyeCon> The support is not bad, I think |
16:35:33 | FromDiscord | <EyeCon> Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range |
16:35:52 | FromDiscord | <EyeCon> Be ready to accept a 206 rather than a 200: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206 |
16:40:17 | * | gsalazar joined #nim |
17:18:23 | FromDiscord | <voidwalker> well, imdb does not appear to accept ranges |
17:18:49 | FromDiscord | <voidwalker> it's a dynamic webpage, why would it |
17:23:44 | * | ecs left #nim (*.net *.split) |
17:33:05 | FromDiscord | <voidwalker> welp, so my request remains: I need code that closes connection after the first N bytes have been retrieved by httpclient |
17:36:09 | * | wallabra_ joined #nim |
17:36:44 | * | wallabra quit (Ping timeout: 244 seconds) |
17:38:10 | * | wallabra_ is now known as wallabra |
17:43:21 | FromDiscord | <Kermithos> In reply to @voidwalker "welp, so my request": I don't think you can do that, maybe patch httpclient to add this function? |
17:45:12 | FromDiscord | <Kermithos> I think you could do it here: https://github.com/nim-lang/Nim/blob/58656aa5bba572672f093499280b69bb0f0d4c06/lib/pure/httpclient.nim#L684 |
17:56:40 | FromDiscord | <voidwalker> 0 chance |
17:57:58 | NimEventer | New Nimble package! grAlg - Classical Graph Algos in Nim, see https://github.com/c-blake/gralg |
17:58:13 | FromDiscord | <voidwalker> I am stuck at this for 24 hours now |
17:58:16 | FromDiscord | <voidwalker> I will write on the forum |
18:06:42 | FromDiscord | <krisppurg> is there any optimised way and or quicker way of `stream.readStr(...)`? |
18:33:10 | * | Guest6812 joined #nim |
18:39:49 | * | Guest6812 quit (Quit: Client closed) |
18:49:47 | FromDiscord | <voidwalker> how do you confirm e-mail on nim forum ? I got no e-mail message for that |
18:50:30 | FromDiscord | <Phil> That is a very good question to ask <@&371760044473319454> |
18:50:52 | FromDiscord | <Phil> Preferably while mentioning your account name @voidwalker 😄 |
18:51:22 | FromDiscord | <Superstart033> Also your credit card information:^) |
18:51:33 | FromDiscord | <Phil> For security purposes of course |
18:51:41 | FromDiscord | <Superstart033> ☝️ |
18:51:45 | FromDiscord | <Phil> Will need the secret code on the back just to confirm it's you |
18:52:09 | FromDiscord | <Vindaar> In reply to @voidwalker "how do you confirm": you don't, it's broken afaiu. If you tell us your username we just activate your account |
18:52:21 | FromDiscord | <voidwalker> that is so sad 😦 |
18:52:28 | FromDiscord | <voidwalker> please activate void09 thanks |
18:54:52 | FromDiscord | <PMunch> In reply to @voidwalker "please activate void09 thanks": Done |
18:56:34 | NimEventer | New thread by Void09: How to get just the first N bytes with httpclient ?, see https://forum.nim-lang.org/t/9342 |
18:57:56 | FromDiscord | <voidwalker> First time discord fails to provide an answer for >24 hours.. let's see how well the forum does : ) |
19:00:52 | FromDiscord | <Phil> Apologies for being unable to help here, I've worked precious little with the httpclient so I can't really offer any experience there, and I'm fairly certain anything I can think of to stare at you've already checked out |
19:01:24 | FromDiscord | <voidwalker> I'm pretty sure it's something very simple, it's just too many unfamiliar concepts thrown in at once |
19:09:51 | * | Figworm joined #nim |
19:11:59 | * | kenran joined #nim |
19:19:20 | * | kenran quit (Quit: WeeChat info:version) |
19:19:34 | * | kenran joined #nim |
19:24:57 | FromDiscord | <zip1203> Cheap VPS/VDS, Storage Slabs, Shared Hosting. Starting from 2$ a month. Coin Payments allowed, privacy focused law of the land host. Tor allowed -\> https://my.frantech.ca/aff.php?aff=5862 |
19:26:30 | FromDiscord | <Phil> In reply to @zip1203 "Cheap VPS/VDS, Storage Slabs,": Gooo fuuuuck yourseeeeeelf↵Help <@&371760044473319454> |
19:28:18 | FromDiscord | <Phil> Thanks!↵My fuse for ad bastards really has shortened considerably over the months |
19:28:38 | FromDiscord | <PMunch> Thanks.. |
19:29:30 | FromDiscord | <PMunch> I wonder if we can somehow fingerprint those to ban them automatically |
19:31:34 | FromDiscord | <PMunch> Maybe something as simple as if the first message contains a URL? |
19:31:56 | FromDiscord | <huantian> there are bots that do that for you |
19:32:01 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=46td |
19:32:07 | FromDiscord | <Phil> Maybe a keyword + url? |
19:32:41 | FromDiscord | <Phil> With a handfull of url's whitelisted such as all links nim related |
19:33:01 | * | CyberTailor_ quit (Remote host closed the connection) |
19:33:21 | FromDiscord | <Phil> In reply to @gibson "Why does this break": I don't think 2 can act as a type, that'd need to be int |
19:33:32 | FromDiscord | <gibson> But if I make it a proc it works. |
19:33:39 | FromDiscord | <Phil> Wait what? One sec, trying out |
19:34:01 | * | CyberTailor_ joined #nim |
19:34:37 | * | kenran quit (Quit: WeeChat info:version) |
19:35:02 | FromDiscord | <Phil> Okay, tried it out, phew, yeah a number is not a type , otherwise `let x: 2 = 2` would work |
19:35:18 | FromDiscord | <Phil> How does your proc look? identical? |
19:35:46 | FromDiscord | <gibson> Yeah, just change `template` to `proc`. You can even replace the `0` return with `N` and you'll get 2 returned. |
19:36:06 | FromDiscord | <Phil> ... what the hell |
19:36:14 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=46te |
19:37:49 | * | jmdaemon joined #nim |
19:38:01 | FromDiscord | <gibson> I expected the proc to work, and it did. But I don't know why the template doesn't work. |
19:38:47 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=46tg |
19:38:48 | FromDiscord | <enthus1ast> but idk |
19:39:03 | * | CyberTailor_ quit (Remote host closed the connection) |
19:39:14 | FromDiscord | <Phil> I agree that the above should not be valid |
19:39:17 | FromDiscord | <Phil> Like, a number as a type |
19:39:19 | FromDiscord | <Phil> What the heck |
19:39:28 | FromDiscord | <gibson> Why not? The template is specified to be a compile-time value. |
19:39:43 | FromDiscord | <Phil> Using a number as a type does not work in any other context |
19:40:02 | FromDiscord | <Phil> `let x:2 = 2` is invalid |
19:41:06 | * | CyberTailor_ joined #nim |
19:41:21 | FromDiscord | <gibson> It's not a type, `static int` means "I want a const int, not an int" unless that's technically a type. |
19:41:54 | FromDiscord | <gibson> I of course have no idea what's going on under the hood, so I best just stop talking now... :p |
19:43:32 | FromDiscord | <Phil> sent a long message, see http://ix.io/46th |
19:43:53 | FromDiscord | <huantian> In reply to @Isofruit "I agree that the": why not? |
19:44:21 | FromDiscord | <huantian> it doesn't make sense in templates, since it's functionally the same as using it as a parameter, but It does have some use for procs and types |
19:45:10 | FromDiscord | <gibson> Yes, as a parameter is my current workaround. I suppose that makes sense. |
19:45:31 | FromDiscord | <gibson> I kind of wish for syntax uniformity it would allow this. |
19:46:20 | FromDiscord | <Phil> In reply to @huantian "it doesn't make sense": I think this just brings befuddles me, like suddenly swapping Subject-Predicate-Object order around. |
19:46:27 | FromDiscord | <Phil> (edit) removed "brings" |
19:46:50 | FromDiscord | <Phil> Like, 2 is a value, why is it a type? It's the thing you describe with types, not the other way round |
19:46:58 | FromDiscord | <Phil> I'd be equally confused by a variable of type false |
19:47:38 | FromDiscord | <Phil> (edit) "In reply to @huantian "it doesn't make sense": I think this ... just" added "(the concept of using a specific value as a type, not your sentence, I just reread and noticed it's missunderstandable)" |
19:47:55 | FromDiscord | <Phil> (edit) "it's" => "my line here was" |
19:47:58 | FromDiscord | <gibson> Well, it's sometimes useful to specify different compile-time variants of procs and types using the `[]` syntax with different values passed in... like making a 2D array for instance.↵But @huantian is right, that with a template, it's always at compile-time so you don't have to rely on templating of the signature. |
19:48:45 | FromDiscord | <gibson> @Phil the trick is the keyword `static`. |
19:49:49 | FromDiscord | <Phil> I think unless I see an actual usecase I'll not comprehend. My mind keeps getting stuck that a number isn't a type, it's a value and thus a thing you'd put as a parameter-value |
19:50:20 | FromDiscord | <Phil> Maybe the sports muddled my brain enough, it is semi late I guess |
19:51:58 | FromDiscord | <gibson> I think it's because `static int` doesn't actually mean "an int-known-at-compiletime type" rather, "an int known at compiletime" |
19:53:36 | FromDiscord | <gibson> and similarly `int` in generics means "an int value, known at runtime" |
19:55:00 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=46tl |
19:55:42 | FromDiscord | <gibson> that would be generics specialization for the int typeclass declaration. |
19:56:18 | * | CyberTailor_ quit (Remote host closed the connection) |
19:56:58 | FromDiscord | <mr_noia> sent a code paste, see https://paste.rs/inU |
19:57:06 | * | CyberTailor_ joined #nim |
19:57:35 | FromDiscord | <Elegantbeef> Good example, but i'd use a concept 😄 |
19:58:31 | FromDiscord | <mr_noia> yes, but it was the simplest one I could think hehe |
19:58:33 | FromDiscord | <gibson> I learned something. |
19:59:54 | FromDiscord | <gibson> In reply to @mr_noia "An example of having": (fencepost error :p) |
20:00:16 | FromDiscord | <Phil> In reply to @gibson "that would be generics": Pretty much, since as far as I understood generics so far for example, `bla[T: object]()` the `: object` just narrowed down the type rather than making a value explicit |
20:00:55 | FromDiscord | <Elegantbeef> This is the fun part `static[T]` is type information 😄 |
20:01:53 | FromDiscord | <Phil> In reply to @mr_noia "An example of having": I'm squinting at this, very hard. It's pretty correct and it looks like one of the best possible ways to write this, but it still takes a specific number as a generic type of sorts and I just can't help but squint at that.↵I may need a bit to just get used to the thought. |
20:02:08 | FromDiscord | <Elegantbeef> It's not the best way to write that 😛 |
20:02:31 | FromDiscord | <Phil> The "one of" in there is doing work beef 😛 |
20:02:50 | FromDiscord | <gibson> @Phil it constrains `N` to be a number known at compiletime. Without that constraint the compiler complains. |
20:02:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46ts |
20:03:56 | FromDiscord | <Phil> The previous typing did |
20:03:58 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46tu |
20:04:01 | FromDiscord | <Elegantbeef> Of course |
20:04:08 | FromDiscord | <Elegantbeef> It should atleast |
20:04:27 | FromDiscord | <Phil> I'm seeing no information anywhere being passed about the array length, thus the question |
20:04:30 | * | wallabra_ joined #nim |
20:04:37 | FromDiscord | <enthus1ast> this makes sence (in my mind at least) but dotProduct[2] would not |
20:05:11 | FromDiscord | <gibson> array length is part of the array type. So if they are different lengths, then that signature would not match. |
20:05:24 | FromDiscord | <Elegantbeef> Concepts are generic constraints it should constrain to the type and if the type isnt the same it's a mismatch↵(@Phil) |
20:05:27 | FromDiscord | <Elegantbeef> Atleast it should |
20:05:57 | FromDiscord | <domosokrat> Elegantbeef\: Where does the `N` in your code get its value? |
20:06:08 | FromDiscord | <Elegantbeef> It doesnt i messed up that should be `..a.high` |
20:06:21 | FromDiscord | <Elegantbeef> Yay it doesnt actually compile |
20:07:02 | * | wallabra quit (Ping timeout: 240 seconds) |
20:07:03 | * | wallabra_ is now known as wallabra |
20:07:32 | FromDiscord | <Elegantbeef> Shit it doesnt bind how i assumed |
20:07:36 | FromDiscord | <Elegantbeef> I guess smokebomb |
20:08:03 | FromDiscord | <Phil> Oh no, where did beef go, he stole all the concepts and took them with him, I can't see him anywhere! |
20:09:05 | FromDiscord | <Elegantbeef> Concepts apparently dont work like typeclasses so.... yea |
20:09:20 | FromDiscord | <gibson> And that's why I avoid them haha. I wish they did. |
20:09:33 | FromDiscord | <Elegantbeef> You can easily make that the case i methinks |
20:10:22 | * | xet7 joined #nim |
20:10:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46tw |
20:11:30 | FromDiscord | <gibson> wha???... |
20:11:46 | FromDiscord | <Phil> This looks somewhat cursed |
20:13:22 | FromDiscord | <Elegantbeef> Nim typeclasses bind tightly to the type to reduce typing |
20:13:51 | FromDiscord | <Elegantbeef> `proc doThing(a, b: int or float)` does not behave the same as `proc doThing(a, b: SomeNumber)` |
20:14:08 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/issues/20136#issuecomment-1201995189 |
20:14:13 | * | wallabra quit (Ping timeout: 268 seconds) |
20:15:15 | FromDiscord | <mr_noia> that's really interesting, but how does it constraint the size of the arrays? |
20:15:48 | FromDiscord | <Elegantbeef> The typeclass makes it so the types have to match |
20:15:48 | FromDiscord | <Elegantbeef> This is just how named typeclasses work |
20:16:31 | FromDiscord | <gibson> Can you explain that another way? I'm trying to wrap my head around why it needed ` and not void` to compile. |
20:16:50 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46tx |
20:18:05 | FromDiscord | <gibson> Unless concepts can inherently be void unless otherwise specified, because they're a blank canvas of typing. |
20:19:18 | FromDiscord | <DaiChimpo> that's a little funky |
20:20:05 | FromDiscord | <mr_noia> really cool, I'm gonna have to study this more |
20:20:31 | * | Figworm quit (Quit: Figworm) |
20:20:59 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=46ty |
20:21:16 | FromDiscord | <Phil> But now you need to remember to always type and not void |
20:21:26 | FromDiscord | <Phil> Which is the first thing I'll professionally forget |
20:21:38 | FromDiscord | <gibson> Not for use to get things done. Only to see what was necessary to get this to compile. |
20:22:42 | * | CyberTailor_ quit (Quit: Konversation terminated!) |
20:28:56 | FromDiscord | <EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=46tA |
20:29:17 | FromDiscord | <EyeCon> Joke aside, that's actually very interesting to know |
20:35:58 | * | Onionhammer quit (Quit: The Lounge - https://thelounge.chat) |
20:36:28 | * | Onionhammer joined #nim |
21:03:46 | FromDiscord | <Elegantbeef> Except that doesnt solve the issue of mismatching arrays↵(@gibson) |
21:03:58 | FromDiscord | <Elegantbeef> Atleast it shouldnt 😄 |
21:22:52 | * | def- quit (Quit: -) |
21:23:03 | * | def- joined #nim |
21:30:14 | * | tk quit (Ping timeout: 240 seconds) |
21:31:09 | NimEventer | New thread by Pietroppeter: Nimib with release 0.3 becomes interactive, see https://forum.nim-lang.org/t/9343 |
21:51:39 | * | rwb quit (Quit: ZNC - https://znc.in) |
21:53:16 | * | MatN joined #nim |
21:55:30 | * | wallabra joined #nim |
21:58:01 | * | MatN quit (Quit: Leaving) |
22:02:15 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=46u4 |
22:02:30 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=46u5 |
22:02:46 | FromDiscord | <Elegantbeef> You dont check if `result != nil` i presume |
22:04:13 | FromDiscord | <Tuatarian> When would it be nil? |
22:04:23 | FromDiscord | <Tuatarian> I am not checking yeah |
22:04:28 | FromDiscord | <Elegantbeef> if `rt: McNode` was nil |
22:04:55 | FromDiscord | <Tuatarian> That shouldn't be happening in general though I don't think |
22:05:12 | FromDiscord | <Elegantbeef> Well you have a nil... so guard your nils |
22:05:32 | FromDiscord | <Tuatarian> I'm creating a mcnode and running mcmonte on it repeatedly |
22:05:48 | FromDiscord | <Tuatarian> I guess I do have a nil but then the question becomes why |
22:05:57 | FromDiscord | <Elegantbeef> You diddnt provide all the code so cannot say |
22:06:14 | FromDiscord | <Tuatarian> This is all the relevant stuff |
22:06:26 | FromDiscord | <Elegantbeef> Except it lacks the graph generation 😄 |
22:07:40 | FromDiscord | <Tuatarian> I'm doing `var mcroot = McNode(board : b(this is a legal position btw), parental units : McNode(visits : -1), whiteMoves : false)` and running mcmonte on that |
22:08:19 | FromDiscord | <Tuatarian> It becomes nil at some point during mcpick/mcwalk i am pretty sure so the other parts of mcmonte should not be relevant |
22:08:49 | FromDiscord | <Elegantbeef> Why does mcmonte take a `var McNode`? |
22:09:13 | FromDiscord | <Tuatarian> it mutates it right? |
22:09:25 | FromDiscord | <Tuatarian> oh not yet |
22:09:32 | FromDiscord | <Tuatarian> yeah it mutates it in the later functions |
22:09:35 | FromDiscord | <Elegantbeef> It's a reference you only need `var` if you want to change where the reference points |
22:10:00 | FromDiscord | <Tuatarian> you can mutate the data itself without using var? |
22:10:08 | FromDiscord | <Tuatarian> I never want to change where I'm pointing |
22:10:20 | FromDiscord | <Elegantbeef> Without stricteffects yes |
22:10:20 | FromDiscord | <Elegantbeef> strictFuncs i mean |
22:10:32 | FromDiscord | <Tuatarian> ok I will remove the var, that should fix it |
22:11:09 | FromDiscord | <Tuatarian> removng all the vars still causes it to segfault |
22:11:20 | FromDiscord | <Elegantbeef> Well yea you werent mutating it 😄 |
22:11:23 | FromDiscord | <Elegantbeef> You're passing a nil somewhere |
22:11:33 | FromDiscord | <Elegantbeef> Put some nil guards |
22:11:34 | FromDiscord | <Tuatarian> in the same place |
22:11:58 | FromDiscord | <Elegantbeef> And what line is erroring? |
22:12:07 | FromDiscord | <Tuatarian> 285 |
22:12:14 | FromDiscord | <Elegantbeef> Doesnt help me |
22:12:16 | FromDiscord | <Tuatarian> `result = mcPick result` |
22:12:22 | FromDiscord | <Tuatarian> yeah I realized after I said that lmao |
22:12:23 | FromDiscord | <Tuatarian> in mcWalk() |
22:12:29 | FromDiscord | <Elegantbeef> That's not the line that's erroring |
22:12:44 | FromDiscord | <Elegantbeef> There is no dereferencing in that |
22:12:54 | FromDiscord | <Elegantbeef> Walk down the stack i believe in you |
22:13:25 | FromDiscord | <!Patitotective> the stack walks on you |
22:13:47 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=46ua |
22:13:55 | * | xet7 quit (Remote host closed the connection) |
22:14:19 | FromDiscord | <mischa_u> Check that there is a valid bestkid found, initially without previous visits your score will be 0, so will never beat the uninitialized bedKid |
22:14:22 | FromDiscord | <Elegantbeef> You have a cyclical type but are using orc? |
22:14:23 | FromDiscord | <Elegantbeef> arc i mean |
22:14:42 | FromDiscord | <Tuatarian> oh oops I meant to use orc |
22:14:45 | FromDiscord | <Elegantbeef> Wait to no let them figure it out for themselves |
22:15:00 | FromDiscord | <Tuatarian> still segfaults |
22:15:14 | FromDiscord | <mischa_u> (edit) "Check that there is a valid bestkid found, initially without previous visits your score will be 0, so will never beat the uninitialized bedKid ... " added "and you will return a nil M node in mcPick" |
22:15:15 | FromDiscord | <Elegantbeef> No shit it still segfaults |
22:15:24 | FromDiscord | <Elegantbeef> "We've changed nothing, and it still fails" |
22:16:00 | FromDiscord | <mischa_u> (edit) "bedKid" => "bestKid" | "M node" => "McNode" |
22:16:11 | FromDiscord | <Tuatarian> yeah it was that there was no valid bestkid found |
22:16:34 | FromDiscord | <Tuatarian> I didn't realize that ref obj didn't have an initial value, which I probably should have in retrospect |
22:16:42 | FromDiscord | <Tuatarian> thanks mischa & beef |
22:16:45 | FromDiscord | <Elegantbeef> How do i not passive aggressively say "Wow a nil check really solved the issue" |
22:17:22 | FromDiscord | <Tuatarian> "nil check unsurprisingly solved the isssue" |
22:17:31 | FromDiscord | <Prestige> Good bot |
22:17:34 | FromDiscord | <Tuatarian> lmao |
22:17:45 | FromDiscord | <Tuatarian> as long as you're not actually being malicious tone is not a huge deal |
22:17:57 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "How do i not": you're passive aggressive yourself, its on your nature |
22:18:16 | FromDiscord | <Elegantbeef> Oh i know patito but i try no to be a dick, although sometimes it's hard 😛 |
22:18:55 | FromDiscord | <Tuatarian> you can use arc with cyclic types right? You just need to manually free them |
22:19:10 | FromDiscord | <Elegantbeef> Sure |
22:19:18 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Oh i know patito": using :p makes everything nice |
22:19:38 | FromDiscord | <Elegantbeef> Patito you're useless and will never amount to anything |
22:19:39 | FromDiscord | <Elegantbeef> 😛 |
22:19:43 | FromDiscord | <Elegantbeef> Ah you're right it does make it nice |
22:19:49 | FromDiscord | <!Patitotective> yep :p |
22:19:57 | FromDiscord | <Tuatarian> I feel like :p is just more passive aggressive |
22:20:03 | FromDiscord | <!Patitotective> maybe :p |
22:20:19 | FromDiscord | <Tuatarian> "Wow a nil check really solved the issue" :p |
22:20:19 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "😛": thats not :p thats 😛 |
22:20:22 | FromDiscord | <!Patitotective> lmao |
22:20:44 | FromDiscord | <Elegantbeef> Hey my client automatically inserts it 😛 |
22:20:53 | FromDiscord | <Tuatarian> matrix moment |
22:21:00 | FromDiscord | <Elegantbeef> I can disable it |
22:21:06 | FromDiscord | <Elegantbeef> Cause control exists here |
22:21:18 | FromDiscord | <!Patitotective> thats the thing i hate the most about twitch (and discord by default)↵they fricking replace nice ascii emojis with their ugly little things |
22:22:17 | FromDiscord | <Tuatarian> In reply to @Elegantbeef "I can disable it": p sure you can disable it on discord too |
22:22:43 | FromDiscord | <Prestige> yeah :P |
22:22:44 | FromDiscord | <Tuatarian> yep just disabled it |
22:22:50 | FromDiscord | <Generic> In reply to @Patitotective "thats the thing i": I like ascii emojis too, which OS do you use? |
22:22:56 | FromDiscord | <Generic> (edit) "In reply to @Patitotective "thats the thing i": I like ascii emojis too, ... which" added "though" |
22:23:06 | FromDiscord | <!Patitotective> i-... |
22:23:18 | FromDiscord | <!Patitotective> linux for short 😁 |
22:23:27 | FromDiscord | <Generic> imho the only good emoji font is the one windows has |
22:23:34 | FromDiscord | <Tuatarian> emoji font? |
22:23:35 | FromDiscord | <!Patitotective> i like twitter une |
22:23:36 | FromDiscord | <!Patitotective> (edit) "une" => "one" |
22:23:39 | FromDiscord | <Generic> segoe ui emoji or however it's called |
22:24:03 | FromDiscord | <Tuatarian> the only emojis i like are the thumb up, thumb down, heart |
22:24:12 | FromDiscord | <Tuatarian> pretty much the only useful ones |
22:24:43 | FromDiscord | <Generic> for some reason the one place where flat and simple designs really look a lot better is where even Apple still uses those ugly somewhat realistically shaded ones |
22:24:45 | FromDiscord | <!Patitotective> hey, \:upside_do: is useful too |
22:24:50 | FromDiscord | <Generic> 💽 |
22:24:56 | FromDiscord | <!Patitotective> (edit) "\:upside_do:" => "\🙃" |
22:25:07 | FromDiscord | <!Patitotective> In reply to @Patitotective "hey, \🙃 is useful": what happened here? |
22:25:15 | FromDiscord | <!Patitotective> thats not discords 🙃 |
22:26:00 | FromDiscord | <Generic> lach |
22:27:28 | * | tk joined #nim |
23:16:28 | FromDiscord | <voidwalker> Welp. 65 views and no reply. https://forum.nim-lang.org/t/9342 |
23:18:54 | FromDiscord | <voidwalker> How exactly would you get the bodyStream data, which is FutureStream[string] ? |
23:20:09 | FromDiscord | <Elegantbeef> I might be wrong but you may not be capable of doing what you want with the present httpclient |
23:24:34 | FromDiscord | <voidwalker> there is this `onProgressChanged` callback proc. `You may specify a callback procedure to be called during an HTTP request. This callback will be executed every second with information about the progress of the HTTP request.` |
23:24:43 | FromDiscord | <voidwalker> why a second ? I don't see any way to change that |
23:24:46 | FromDiscord | <!Patitotective> @voidwalker take a look at this https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncdispatch.nim#L1939 |
23:25:06 | FromDiscord | <!Patitotective> In reply to @voidwalker "there is this `onProgressChanged`": it just returns the total amount to download, the current and speed |
23:26:53 | FromDiscord | <voidwalker> well it does whatever you want it to do |
23:27:12 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46ug |
23:40:18 | FromDiscord | <!!sharpcdf!!> In reply to @Elegantbeef "Cause control exists here": im late to the party but ROASTED |
23:40:31 | FromDiscord | <!!sharpcdf!!> DESTROYED WITHOUT MERCY |
23:41:24 | FromDiscord | <!!sharpcdf!!> but yea you can do the same thing on discord lmao |