00:12:23 | * | Mister_Magister quit (Quit: bye) |
00:14:57 | * | Mister_Magister joined #nim |
00:24:51 | * | xet7 joined #nim |
00:32:24 | * | rockcavera quit (Remote host closed the connection) |
00:43:47 | * | rockcavera joined #nim |
00:45:22 | * | rockcavera quit (Remote host closed the connection) |
00:46:13 | * | rockcavera joined #nim |
01:17:35 | FromDiscord | <janakali> In reply to @lan_maneiro "is neovim beginner friendly?": If you learn vim motions and start without or with few plugins, neovim is very simple IDE to use. A lot simpler than vscode. But it takes time to get used to. |
01:17:39 | FromDiscord | <janakali> Similar how driving a bicycle is easy and faster than walking, but you will have to fall a dozen times first, ha. |
02:20:42 | * | xet7 quit (Ping timeout: 248 seconds) |
02:32:58 | * | xet7 joined #nim |
02:42:58 | * | rockcavera quit (Remote host closed the connection) |
02:49:36 | * | LuckyMan joined #nim |
03:44:55 | * | SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev) |
03:49:06 | * | SchweinDeBurg joined #nim |
03:58:54 | * | xet7 quit (Remote host closed the connection) |
04:10:07 | * | LuckyMan quit (Quit: LuckyMan) |
04:47:11 | FromDiscord | <microssd.> sent a long message, see https://pasty.ee/kWXuGoBE |
04:48:05 | FromDiscord | <microssd.> or in other words how do I access inner text in xmlDoc ? |
05:12:21 | FromDiscord | <janakali> sent a code paste, see https://play.nim-lang.org/#pasty=iedIMZLS |
05:18:13 | FromDiscord | <microssd.> In reply to @janakali "<@1406729274072891436> https://nim-lang.org/docs/xm": What if I want to access the node by tag? |
05:23:10 | FromDiscord | <microssd.> I mean, I want the text inside a certain tag |
05:32:14 | FromDiscord | <janakali> sent a code paste, see https://play.nim-lang.org/#pasty=FkUAPCCe |
06:39:58 | FromDiscord | <xtrayambak> sent a code paste, see https://play.nim-lang.org/#pasty=QjnbjTiK |
06:40:16 | FromDiscord | <xtrayambak> I'm probably using `codegenDecl` wrong because that doesn't influence the code generator in any way |
06:43:09 | FromDiscord | <xtrayambak> actually it _DOES_ seem to affect codegen, just not where I intended it to :P |
06:43:20 | FromDiscord | <Elegantbeef> `const` is a type annotation so you need a `type ConstWlInterface {.imporc: "const struct wl_interface".} = object` |
06:48:56 | FromDiscord | <xtrayambak> In reply to @Elegantbeef "`const` is a type": aaaaand that works. Thank you so much. :^) |
06:49:27 | FromDiscord | <Elegantbeef> Really you want to forgo the `importc` so you don't have these issues |
08:23:54 | * | beholders_eye joined #nim |
08:26:23 | * | kubrat joined #nim |
08:59:30 | * | derpydoo joined #nim |
09:31:35 | FromDiscord | <kiloneie> sent a code paste, see https://play.nim-lang.org/#pasty=hbeJxVzO |
09:51:09 | FromDiscord | <kiloneie> Also, i wish the compiler, or extension would spot a random left over ), and not just say, invalid indentation <.<... |
09:55:43 | Amun-Ra | I'd make a few templates/procs instead of just single one |
09:56:34 | FromDiscord | <kiloneie> ? |
09:57:01 | FromDiscord | <kiloneie> with color and stuff ? That's future plans. |
09:57:29 | FromDiscord | <kiloneie> Also, can i not import a variable used by main, imported by some other module ? |
09:58:17 | Amun-Ra | hmm? |
09:58:25 | Amun-Ra | export it |
09:58:35 | Amun-Ra | if I understand the q correctly |
09:58:38 | FromDiscord | <kiloneie> Oh,. sht. |
10:07:47 | FromDiscord | <kiloneie> Actually error, recursive dependency... eh, i will just use a template, it's cleanup... who cares. |
10:10:14 | Amun-Ra | refactor |
10:10:17 | Amun-Ra | don't overuse templates |
10:10:37 | FromDiscord | <kiloneie> In reply to @Amun-Ra "don't overuse templates": It's clean up. |
10:11:17 | FromDiscord | <kiloneie> I did transform what little of templates i had, to proc + template wrapper. |
10:11:43 | FromDiscord | <kiloneie> There might be a few full ones, but they are working with so little code, that... i doubt it matters in any way. |
11:11:05 | * | derpydoo quit (Quit: derpydoo) |
11:37:59 | * | kubrat quit (Ping timeout: 250 seconds) |
11:38:42 | * | vsantana joined #nim |
12:00:54 | * | kubrat joined #nim |
13:51:50 | FromDiscord | <kiloneie> Does anyone actually use HashSets ? I tried, then i tried, then i slapped myself and just used a sequence. |
13:52:40 | FromDiscord | <nnsee> i use hashsets all the time |
13:52:46 | FromDiscord | <nnsee> what issues are you having? |
14:05:03 | FromDiscord | <kiloneie> None, i just tried using them for something that didn't need them. Luckily i figured that out fast enough, i didn't want to do all that boilerplate. |
14:12:27 | FromDiscord | <nnsee> boilerplate? |
14:12:43 | FromDiscord | <nnsee> hashsets generally shouldn't have much boilerplate if used correctly |
14:12:58 | FromDiscord | <nnsee> in fact i often use it to _reduce_ the amount of code i would otherwise write if i were to use a seq or something |
14:25:49 | * | hygo joined #nim |
14:26:26 | FromDiscord | <ieltan> In reply to @kiloneie "Does anyone actually use": they are actually needed when you need to guarantee unique values in a collection |
14:30:57 | FromDiscord | <ieltan> that can happen pretty often on my side when as im dealing with apis that wants me to send an array of `anyof T` where `T`is actually a well defined variant |
14:31:54 | FromDiscord | <ieltan> (edit) removed "as" |
14:31:58 | FromDiscord | <kiloneie> I know all that, i made a video about them. But my use case was simply a sequence for all my Entity child types, another for Images, Fonts, etc. All of which, are never going to be that numerous, nor do they have to be unique. Then i for loop and free them. |
14:32:41 | * | xet7 joined #nim |
14:33:35 | FromDiscord | <ieltan> well what youve found is right, if they dont have to be unique then there was no reason to use hashset in the first place |
14:33:56 | FromDiscord | <ieltan> your usecase seems like `seq` is perfect there :p |
14:36:28 | FromDiscord | <mitranim> Depending on the use case, sets can be optimal for queues. Had such as use case recently when rewriting an observables system |
14:36:37 | FromDiscord | <mitranim> (edit) "case," => "case (and underlying implementation)," |
14:36:41 | FromDiscord | <mitranim> (edit) "as" => "a" |
14:37:47 | * | om3ga quit (Read error: Connection reset by peer) |
14:38:56 | FromDiscord | <kiloneie> In reply to @ieltan "well what youve found": Yeah i just, haven't found the need yet... if i didn't need to do any boilerplate, if they worked for anything like sequences, i'd probably use them for instances... But i can just add a number too. Idk, one day i will need them, surely... |
14:40:44 | * | om3ga joined #nim |
14:41:55 | FromDiscord | <ieltan> In reply to @mitranim "Depending on the use": queues ? sorry but how does that work, there's no pop/push for sets i think... |
14:42:29 | FromDiscord | <ieltan> or maybe you mean implementing a sequence number mechanism ? |
14:42:35 | FromDiscord | <mitranim> That's right, some queues are unordered but need to keep elements unique (which may frequently request to be enqued redundantly) |
14:42:51 | FromDiscord | <0xfab_10> don't you need some sort of linked hash set for that? |
14:42:55 | FromDiscord | <mitranim> Could also describe that as a subscription system, but it flushes subscribers on each trigger, so it's a queue |
14:42:56 | FromDiscord | <0xfab_10> to preserve ordering |
14:43:14 | FromDiscord | <mitranim> Triggering subscribers tends to be order-insensitive |
14:43:18 | FromDiscord | <ieltan> i see, that makes more sense |
14:43:35 | FromDiscord | <mitranim> Mine actually has hierarchical ordering (parents run before descendants, via several queues, which have depth levels) |
14:44:10 | FromDiscord | <ieltan> In reply to @kiloneie "Yeah i just, haven't": one word of advice but don't worry too much about the boilerplate unless it's really terrible |
14:45:49 | FromDiscord | <ieltan> as much as people complain about boilerplate, go seems like it's doing fine as their most pressing issue seems to be to get rid of `if err != nil` 🙂 |
14:46:31 | FromDiscord | <ieltan> well, go programmers, the people working on the actual compiler seems to not care |
14:46:39 | FromDiscord | <mitranim> ...Which I did years ago via exceptions (recommended): <https://mitranim.com/posts/goex> |
14:47:02 | FromDiscord | <ieltan> bahahaha i did not expect this 😭 |
14:47:12 | FromDiscord | <ieltan> i'll check it out when i have some time |
14:47:56 | FromDiscord | <ieltan> actually at first glace it looks short enough to read it now |
14:49:07 | FromDiscord | <mitranim> sent a code paste, see https://play.nim-lang.org/#pasty=QOpqqlgE |
14:49:22 | FromDiscord | <kiloneie> In reply to @ieltan "one word of advice": Umm okay. If you see me use a lot of templates, well i love ergonomics D:... |
14:50:24 | FromDiscord | <kiloneie> I've side projected myself from finally entering the fun part of my game engine, to do all kinds of clean up, better terminal debug messages, etc... except going for the fun... <.<... |
14:50:40 | FromDiscord | <kiloneie> I made my life easier, but it could of been a bit more fun already. |
14:51:13 | FromDiscord | <tauruuuuuus> In reply to @mitranim "...Which I did years": this seems cursed 🤣 are you wrapping recover? |
14:51:43 | FromDiscord | <mitranim> It uses `panic` and `recover`, yes |
14:52:05 | FromDiscord | <mitranim> Go is actually very friendly to exceptions, and the performance is perfectly fine |
14:53:10 | FromDiscord | <mitranim> All that stuff about errors as values philosophy is complete nonsense, and they're not consistent about it either (plenty of stdlib APIs have documented panics, which are supposed to crash you, while HTTP server implementation recovers from panics and sends 500) |
14:53:31 | FromDiscord | <ieltan> In reply to @kiloneie "Umm okay. If you": well i cant blame you for liking templates, i also like them too but i am very nervous when using them as you can hit compilation errors that's hard to solve, most of the time i was fine with proc or i just needed to use macros |
14:54:57 | FromDiscord | <ieltan> oh speaking of which |
14:55:03 | FromDiscord | <tauruuuuuus> In reply to @mitranim "All that stuff about": agree to disagree on the philosophy (subjective, i like errors more stylistically), but I do agree on the latter part of your argument |
14:55:21 | FromDiscord | <ieltan> In reply to @ieltan "also you're mixing new": remember this |
14:55:24 | FromDiscord | <tauruuuuuus> panics are one of the strangest bit of the go language, expecially how they're handled in stdlib and advertised |
14:55:28 | FromDiscord | <kiloneie> In reply to @ieltan "well i cant blame": I had so many template problems, until PMUNCH helped me out here. Gave me info on how they actually work, and how to better use them. |
14:55:41 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=lZUHZjcG |
14:56:14 | FromDiscord | <ieltan> thats fully functional, and even if you never used macros i am sure you can understand what they're doing 🙂 |
14:56:30 | FromDiscord | <ieltan> well actually i lied, i dont really know if it's fully functional |
14:56:39 | FromDiscord | <ieltan> but in so far it's promising |
14:58:07 | FromDiscord | <ieltan> (also no templates in view, as they're not needed yet) |
14:58:54 | FromDiscord | <mitranim> sent a code paste, see https://play.nim-lang.org/#pasty=KXexZHBZ |
14:59:06 | FromDiscord | <ieltan> In reply to @mitranim "...Which I did years": >Go has panics, which are exceptions.↵hell, even C have them if you count `setjmp/longlmp` as a exception mechanism |
14:59:06 | FromDiscord | <mitranim> (edit) "https://play.nim-lang.org/#pasty=SKfpmICu" => "https://play.nim-lang.org/#pasty=xVmMqvwc" |
15:00:35 | FromDiscord | <ieltan> In reply to @mitranim "...Which I did years": >Panics are cheap. Stack traces have a minor cost.↵I dont actually know about this, every language have a panic mechanism and the only thing in common is that at the very least, catching them is expensive |
15:01:02 | FromDiscord | <tauruuuuuus> In reply to @mitranim "One funny thing, which": Been there done that 😅 I think this is actually one of the bigger mistakes they did in go |
15:01:49 | FromDiscord | <mitranim> Dunno about other languages, but I benchmarked this extensively in Go, and panic/defer/recover are cheap and hard to measure. They're quite well optimized. Most languages with throw/catch have built-in traces, so that cost becomes part of a benchmark |
15:01:54 | FromDiscord | <tauruuuuuus> Their philosophy, which is kind of the opposite of nim, was to have just one way of doing things, but imho they dropped the ball on anything related to this very topic (traces) |
15:02:31 | FromDiscord | <tauruuuuuus> which is unfortunate, I like go a lot to be honest, I'd say it's my second fav language to program in after nim |
15:02:44 | FromDiscord | <ieltan> well overall nim is heading there but it's still going to be a `try/except` but with errno style errors. |
15:03:33 | FromDiscord | <ieltan> it's also going to be used to solve the whole `Option[var T]`problem by making it `var T {.raises.}` instead, but i am not sure how everything else works |
15:04:09 | FromDiscord | <ieltan> hmmm i need to find the forum post about this |
15:04:12 | FromDiscord | <tauruuuuuus> try/except and exceptions are one of the few things I do not like too much here, my issue with them is that I confirmed time and time again that people do not know hot to use them, I see this all the time at work |
15:04:33 | FromDiscord | <tauruuuuuus> they enable a huge mess, because they are so opaque most of times |
15:05:01 | FromDiscord | <tauruuuuuus> plus the subjective style thing, but that is just a personal issue |
15:05:23 | FromDiscord | <tauruuuuuus> I never had any issues with performances or stuff like that |
15:05:49 | FromDiscord | <ieltan> objectively, nim has the best overall design because we have raise tracking so you know if your proc raises an exception or even force it not to raises by using `{.raises: [].}` |
15:05:52 | FromDiscord | <mitranim> In reply to @tauruuuuuus "try/except and exceptions are": Curious what you mean there? The only exception "pitfall" I can think of is forgetting to `defer close()` when coming from exception-free languages without a defer equivalent (like C), but that quickly becomes second nature |
15:06:17 | FromDiscord | <mitranim> (edit) "C)," => "C, as long as you don't jmp)," |
15:06:43 | FromDiscord | <ieltan> {.raises: [].} is actually so underused... but it's so useful it's a shame |
15:07:06 | FromDiscord | <tauruuuuuus> In reply to @mitranim "Curious what you mean": I'm talking of languages that actually do have them, e.g. python |
15:08:39 | FromDiscord | <ieltan> In reply to @mitranim "Dunno about other languages,": fair enough |
15:08:42 | FromDiscord | <tauruuuuuus> In reply to @ieltan "objectively, nim has the": but correct me if I'm wrong, you can just raise and not specify it in the raises signature, right? |
15:10:05 | FromDiscord | <ieltan> In reply to @tauruuuuuus "but correct me if": if you dont specify `raises`at all, it's inferred |
15:12:06 | FromDiscord | <tauruuuuuus> got it, that's something that I don't quite like of exceptions, you don't know what a function raises to begin with (i.e. reading the func signature) |
15:13:03 | FromDiscord | <tauruuuuuus> but a lot of this is subjective, I generally just use what the language provides as first class citizen and be done with it |
15:17:16 | FromDiscord | <michaelb.eth> In reply to @tauruuuuuus "got it, that's something": put “push raises: []” pragma at the top of your modules then you’ll have to know / figure out exactly what all your procs raise↵↵then continue annotating procs until compiler stops failing with errors for missing raises |
15:17:34 | FromDiscord | <tauruuuuuus> ty |
15:19:01 | FromDiscord | <michaelb.eth> cf. https://status-im.github.io/nim-style-guide/errors.exceptions.html |
15:33:59 | FromDiscord | <kiloneie> Is there a way to have all fields as public by default ? The amount of times, i forgot to export a field of an object... |
15:34:22 | FromDiscord | <kiloneie> Just now, i think i lost like 30 minutes... |
15:45:12 | FromDiscord | <ieltan> In reply to @kiloneie "Is there a way": nop, unless macros |
15:47:24 | FromDiscord | <kiloneie> It takes me too long to catch such simple mistakes... |
16:02:02 | * | xet7 quit (Ping timeout: 248 seconds) |
16:11:00 | FromDiscord | <buwubie> sent a long message, see https://pasty.ee/trkBBrpx |
16:12:07 | FromDiscord | <buwubie> (edit) "https://pasty.ee/SnEcDIHV" => "https://pasty.ee/DoXsmRkg" |
16:14:16 | * | xet7 joined #nim |
16:30:19 | * | hygo quit (Quit: WeeChat 4.7.1) |
16:33:03 | * | hygo joined #nim |
16:47:30 | * | beholders_eye quit (Ping timeout: 256 seconds) |
17:05:55 | * | xet7 quit (Remote host closed the connection) |
17:06:04 | * | kubrat quit (Quit: Client closed) |
17:17:57 | * | kubrat joined #nim |
17:20:23 | * | kubrat quit (Client Quit) |
17:51:17 | * | syl_ is now known as syl |
18:25:49 | FromDiscord | <lan_maneiro> In reply to @janakali "If you learn vim": got it. maybe i'll try it someday |
18:35:26 | FromDiscord | <metrotick03> sent a long message, see https://pasty.ee/UMIrxTat |
18:48:54 | * | TheTechRobo joined #nim |
18:58:12 | * | przmk quit (Ping timeout: 252 seconds) |
19:00:16 | * | przmk joined #nim |
19:43:58 | * | fallback quit (Ping timeout: 246 seconds) |
19:57:08 | * | beholders_eye joined #nim |
20:36:57 | * | beholders_eye quit (Ping timeout: 260 seconds) |
21:16:17 | * | rockcavera joined #nim |
21:56:11 | * | fallback joined #nim |
22:35:43 | * | tiorock joined #nim |
22:35:43 | * | tiorock quit (Changing host) |
22:35:43 | * | tiorock joined #nim |
22:35:43 | * | rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services))) |
22:35:43 | * | tiorock is now known as rockcavera |
23:09:44 | * | vsantana quit (Ping timeout: 240 seconds) |
23:47:33 | FromDiscord | <nervecenter> In reply to @kiloneie "It takes me too": This is one of those scenarios where explicit is better, when you have to go back and read your module |