| 00:33:32 | * | gabreal joined #nim |
| 01:04:32 | * | gabreal quit (Remote host closed the connection) |
| 01:11:14 | * | gabreal joined #nim |
| 01:33:20 | * | gabreal quit (Remote host closed the connection) |
| 01:33:39 | * | gabreal joined #nim |
| 02:31:18 | * | rockcavera quit (Remote host closed the connection) |
| 03:23:57 | * | xutaxkamay_ joined #nim |
| 03:24:31 | * | xutaxkamay quit (Ping timeout: 268 seconds) |
| 03:24:53 | * | xutaxkamay_ is now known as xutaxkamay |
| 03:58:53 | * | gabreal_ joined #nim |
| 03:59:27 | * | gabreal quit (Read error: Connection reset by peer) |
| 05:47:32 | * | gabreal joined #nim |
| 05:50:35 | * | gabreal_ quit (Ping timeout: 245 seconds) |
| 06:13:26 | * | gabreal_ joined #nim |
| 06:16:18 | * | gabreal quit (Ping timeout: 248 seconds) |
| 06:52:40 | * | mrinsane quit (Ping timeout: 245 seconds) |
| 07:34:47 | * | gabreal joined #nim |
| 07:35:53 | FromDiscord | <hovsater> Should I use `atlas` or `nimble`? It's somewhat unclear to me. |
| 07:36:18 | * | gabreal_ quit (Ping timeout: 248 seconds) |
| 08:09:30 | FromDiscord | <nnsee> nimble is what most people use |
| 08:09:54 | FromDiscord | <nnsee> atlas is newer and supposedly better in some ways, but i recommend looking into it once you've used nim for a bit already |
| 08:26:52 | FromDiscord | <hovsater> Alright, thanks for that. 🙂 |
| 08:35:52 | FromDiscord | <hovsater> Should https://www.nimble.directory work? It's referenced in the documentation but it just errors out with `502 Bad Gateway`. |
| 08:45:32 | FromDiscord | <nnsee> it should |
| 08:45:34 | FromDiscord | <nnsee> @pmunch |
| 08:50:26 | FromDiscord | <aethrvmn> You can check https://nimpkgs.org in the meantime↵(@hovsater) |
| 08:52:45 | FromDiscord | <pmunch> Should be back up now |
| 09:02:59 | FromDiscord | <hovsater> Yep. It's working again! |
| 09:06:50 | FromDiscord | <hovsater> sent a code paste, see https://play.nim-lang.org/#pasty=MKHaXzFY |
| 09:07:14 | FromDiscord | <hovsater> (edit) "https://play.nim-lang.org/#pasty=HTjeoKyH" => "https://play.nim-lang.org/#pasty=RYSSCGNL" |
| 09:08:05 | FromDiscord | <hovsater> If I remove my `namedBin`entry, `nimble run` works but produces a `difm_radio` binary. |
| 09:08:11 | FromDiscord | <hovsater> (edit) "`namedBin`entry," => "`namedBin` entry," |
| 09:21:25 | FromDiscord | <hovsater> Interestingly, I can run `nimble run difm` and that works. I guess I'll do that for now. Just surprised by the error message when the target wasn't specified. Feels like a bug to me. |
| 09:23:43 | FromDiscord | <nnsee> what happens if you remove the `bin` line and just keep `namedBin`? |
| 09:24:18 | FromDiscord | <hovsater> Same issue. |
| 09:36:53 | * | beholders_eye joined #nim |
| 09:48:13 | FromDiscord | <nnsee> seems like this: https://github.com/nim-lang/nimble/issues/984 |
| 09:48:49 | FromDiscord | <hovsater> Yeah, that's definitely what I'm running into. Seems there's a PR open to fix it. |
| 09:51:31 | FromDiscord | <hovsater> Btw, what approach do most people take to testing? I'm writing a simple parser and want to write some tests for the parser itself. There seem to be `std/unittest` but it references `testament` as a better option. It also mentions that most of the time it's easier to just do `when isMainModule: doAssert conditionHere`. Then there's something called `runnableExamples`. 😅 |
| 09:52:16 | FromDiscord | <hovsater> (edit) "Btw, what approach do most people take to testing? I'm writing a simple parser and want to write some tests for the parser itself. There seem to be `std/unittest` but it references `testament` as a better option. It also mentions that most of the time it's easier to just do `when isMainModule: doAssert conditionHere`. Then there's something called `runnableExamples`. ... 😅" added "I'm getting analysis paralysis." |
| 09:52:57 | FromDiscord | <cobaltdsc4102> Kinda wish you could override the default tasks |
| 09:53:12 | FromDiscord | <cobaltdsc4102> Like build and stuff |
| 09:56:43 | FromDiscord | <nnsee> `runnableExamples` is more of a documentation thing - it is compiled when testing so you know if documentation is out of date, but you shouldn't use it for testing per se. for simpler projects, the `when isMainModule` method is fine and is what i often use, but for larger projects, `testament` should be used - this is also what the compiler itself uses for tests. i've generally avoided `std/unittest` entirely. i've also seen `disruptek/ball |
| 09:58:13 | FromDiscord | <hovsater> In reply to @nnsee "`runnableExamples` is more of": Thanks. That was insightful. Do you have an example of the `isMainModule` approach? I assume it's just a bunch of assert statements one after another? |
| 10:03:12 | FromDiscord | <nnsee> In reply to @hovsater "Thanks. That was insightful.": pretty much. since running the files manually is inconvenient, i only ever use it for quick tests (mostly when developing whatever file i'm working on) and not as part of an actual test suite, here's an example I used when writing a db module: https://git.dog/xx/pasty/src/branch/master/src/db.nim#L146 |
| 10:04:28 | FromDiscord | <nnsee> also, i lied a bit, i have used `std/unittest`: https://git.dog/xx/nim-quickselect/src/branch/master/tests/test.nim |
| 10:04:32 | FromDiscord | <nnsee> ¯\_(ツ)_/¯ |
| 10:23:09 | FromDiscord | <hovsater> In reply to @nnsee "pretty much. since running": > pretty much. since running the files manually is inconvenient, i only ever use it for quick tests (mostly when developing whatever file i'm working on) and not as part of an actual test suite, here's an example I used when writing a db module↵Are you saying that usually, you would rewrite those tests at some points into something like testament when you feel comfortable with what you |
| 10:23:15 | FromDiscord | <hovsater> (edit) "usually," => "usually" |
| 10:23:20 | FromDiscord | <nnsee> indeed |
| 10:23:50 | FromDiscord | <hovsater> Gotcha. Makes sense. I'll start of with the `isMainModule` approach and turn the parser tests into something else when I feel I've fleshed out the API. |
| 10:27:49 | FromDiscord | <hovsater> Can you run a individual file with `nimble` or should I use `nim` for that? |
| 10:28:06 | * | beholders_eye quit (Ping timeout: 248 seconds) |
| 10:30:05 | FromDiscord | <nnsee> you can, `nimble c -r src/whatever.nim` |
| 10:30:16 | FromDiscord | <hovsater> I tried that, but it did not seem to run the actual file. |
| 10:30:34 | FromDiscord | <nnsee> just tested it, works fine here |
| 10:30:55 | FromDiscord | <hovsater> sent a code paste, see https://play.nim-lang.org/#pasty=dcXbZIoo |
| 10:31:07 | FromDiscord | <hovsater> sent a code paste, see https://play.nim-lang.org/#pasty=UbdjfyIx |
| 10:31:15 | FromDiscord | <nnsee> seems to work? `Nim Output asd` |
| 10:31:37 | FromDiscord | <hovsater> Oh! 🤦♂️ |
| 10:31:51 | FromDiscord | <hovsater> Missed that part. The output is a bit different from `nim c -r` that's why I missed it. |
| 10:31:53 | FromDiscord | <hovsater> Thanks for that. 🙂 |
| 11:03:37 | * | beholders_eye joined #nim |
| 12:31:22 | FromDiscord | <hovsater> Am I right in understanding that in Nim I should prefer an alternative to exception for known failure points? For instance, if my parser fail to parse the input, it's not really exceptional. What do we usually prefer then? Go-style tuples as return values? E.g., `(ok, parsed)`? |
| 12:31:33 | FromDiscord | <hovsater> (edit) "exception" => "exceptions" |
| 12:32:51 | Amun-Ra | exceptions are te goto way of handling errors in nim |
| 12:33:13 | Amun-Ra | but you can use result-like structures too |
| 12:36:30 | FromDiscord | <hovsater> sent a long message, see https://pasty.ee/zKjvuhKU |
| 12:36:33 | FromDiscord | <Ras 🫐> some people or orgs (like Status) avoid using exceptions and opt for `Result`s instead; you can read their reasoning here\: https://status-im.github.io/nim-style-guide/errors.html (and see the following sections to see how they do it) |
| 12:36:39 | FromDiscord | <Ras 🫐> my personal take is that exceptions are... fine |
| 12:37:15 | FromDiscord | <hovsater> I mean, I don't have anything against exceptions, but I'm also trying to stay true to what the official docs state. |
| 12:37:38 | FromDiscord | <hovsater> And the official docs seem to suggest there's a better alternative for when you're dealing with a non exceptional circumstance? |
| 12:39:06 | Amun-Ra | tbh in my programs I use exceptions for IO or stdlib errors, and a enum for my own procs |
| 13:01:48 | FromDiscord | <kapendev> I would use the one that fits your project more. Not a fan of exceptions, but they can be nice sometimes. |
| 13:02:27 | FromDiscord | <kapendev> Or mix and use one more than the other. |
| 13:23:33 | FromDiscord | <Laylie> sent a code paste, see https://play.nim-lang.org/#pasty=ZHIpKWgn |
| 13:42:45 | Amun-Ra | and what's nice is you can have explicit exception listed functions |
| 13:45:33 | FromDiscord | <hovsater> sent a code paste, see https://play.nim-lang.org/#pasty=aimSaDDW |
| 13:46:25 | FromDiscord | <hovsater> `result` would obviously be something other than `string` (probably some kind of structure), but I just wrote something for demonstration purposes. |
| 13:48:17 | FromDiscord | <user2m> whats the best db to use with mummy? I'm guessing postgresql? I'm using sqlite + prologue right now and looking to swicth to mummy |
| 13:57:32 | FromDiscord | <exelotl> it really depends on the needs of your site. For ease of deployment I'd stick with sqlite, if you need massive scale / serving 10000's of simultaneous users / gigabytes of data then postgres could be better. |
| 13:58:56 | FromDiscord | <exelotl> the forum app that treeform recently published uses mummy + debby with sqlite backend by default, I think that should be fine for most sites↵<https://github.com/treeform/nobby> |
| 14:05:42 | FromDiscord | <planetis_m> In reply to @hovsater "What about something like": I would advice against object variants for result types, just return a tuple |
| 14:07:43 | FromDiscord | <planetis_m> but then only if errors are common, I would otherwise use exceptions. |
| 14:13:27 | FromDiscord | <planetis_m> here;s my nim style guide: https://github.com/planetis-m/skills/blob/master/nim-style-guide/SKILL.md in my experience it leads to good code. |
| 14:15:34 | FromDiscord | <user2m> In reply to @exelotl "it really depends on": ok I'm allregic to over engineering so il def try sqlite first |
| 14:26:21 | * | zodman quit (Quit: WeeChat 4.8.1) |
| 14:27:34 | * | zodman joined #nim |
| 14:32:58 | * | zodman quit (Quit: WeeChat 4.8.1) |
| 14:33:30 | * | zodman joined #nim |
| 14:34:42 | * | zodman quit (Client Quit) |
| 14:35:02 | * | zodman joined #nim |
| 14:39:18 | * | zodman quit (Client Quit) |
| 14:41:50 | * | zodman joined #nim |
| 14:51:19 | FromDiscord | <[Next-System] systemblue> hey I want to integrate nim utility library ↵and would you like to recommend me some?↵encode, jsony, chrono, sysinfo, globby, nim-stew, bignum, chroma↵is in my list |
| 14:59:54 | FromDiscord | <nasuray> In reply to @hovsater "What about something like": This is basically what `nim-results` is doing under the hood https://github.com/arnetheduck/nim-results |
| 15:04:34 | FromDiscord | <hovsater> In reply to @planetis_m "I would advice against": Mind expanding on the why? |
| 15:45:48 | FromDiscord | <planetis_m> difficult to deal with, in all fronts be it serialization, naming the fields, no real advantage in terms of space savings, just theres no point, unless its something really simple |
| 15:46:41 | FromDiscord | <planetis_m> like representing a multi type node. |
| 15:48:21 | FromDiscord | <planetis_m> (edit) "multi type" => "dynamically typed" |
| 16:02:00 | FromDiscord | <hovsater> Alright. |
| 16:05:48 | * | beholders_eye quit (Ping timeout: 246 seconds) |
| 16:07:24 | * | gabreal quit (Remote host closed the connection) |
| 16:07:38 | * | gabreal joined #nim |
| 16:33:57 | * | gabreal_ joined #nim |
| 16:34:57 | * | gabreal quit (Ping timeout: 255 seconds) |
| 16:59:08 | * | gabreal_ quit (Remote host closed the connection) |
| 17:08:22 | * | gabreal joined #nim |
| 17:09:08 | * | mrinsane joined #nim |
| 18:06:49 | * | termer3 joined #nim |
| 18:09:12 | * | termer quit (Ping timeout: 268 seconds) |
| 18:09:12 | * | termer3 is now known as termer |
| 18:17:15 | * | gabreal quit (Read error: Connection reset by peer) |
| 18:17:27 | * | gabreal joined #nim |
| 18:30:58 | * | gabreal_ joined #nim |
| 18:33:54 | * | gabreal quit (Ping timeout: 248 seconds) |
| 19:36:49 | * | gabreal joined #nim |
| 19:40:21 | * | gabreal_ quit (Ping timeout: 255 seconds) |
| 19:45:54 | * | gabreal quit (Ping timeout: 248 seconds) |
| 20:45:24 | * | gabreal joined #nim |