<< 27-02-2026 >>

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:53FromDiscord<hovsater> Should I use `atlas` or `nimble`? It's somewhat unclear to me.
07:36:18*gabreal_ quit (Ping timeout: 248 seconds)
08:09:30FromDiscord<nnsee> nimble is what most people use
08:09:54FromDiscord<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:52FromDiscord<hovsater> Alright, thanks for that. 🙂
08:35:52FromDiscord<hovsater> Should https://www.nimble.directory work? It's referenced in the documentation but it just errors out with `502 Bad Gateway`.
08:45:32FromDiscord<nnsee> it should
08:45:34FromDiscord<nnsee> @pmunch
08:50:26FromDiscord<aethrvmn> You can check https://nimpkgs.org in the meantime↵(@hovsater)
08:52:45FromDiscord<pmunch> Should be back up now
09:02:59FromDiscord<hovsater> Yep. It's working again!
09:06:50FromDiscord<hovsater> sent a code paste, see https://play.nim-lang.org/#pasty=MKHaXzFY
09:07:14FromDiscord<hovsater> (edit) "https://play.nim-lang.org/#pasty=HTjeoKyH" => "https://play.nim-lang.org/#pasty=RYSSCGNL"
09:08:05FromDiscord<hovsater> If I remove my `namedBin`entry, `nimble run` works but produces a `difm_radio` binary.
09:08:11FromDiscord<hovsater> (edit) "`namedBin`entry," => "`namedBin` entry,"
09:21:25FromDiscord<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:43FromDiscord<nnsee> what happens if you remove the `bin` line and just keep `namedBin`?
09:24:18FromDiscord<hovsater> Same issue.
09:36:53*beholders_eye joined #nim
09:48:13FromDiscord<nnsee> seems like this: https://github.com/nim-lang/nimble/issues/984
09:48:49FromDiscord<hovsater> Yeah, that's definitely what I'm running into. Seems there's a PR open to fix it.
09:51:31FromDiscord<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:16FromDiscord<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:57FromDiscord<cobaltdsc4102> Kinda wish you could override the default tasks
09:53:12FromDiscord<cobaltdsc4102> Like build and stuff
09:56:43FromDiscord<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:13FromDiscord<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:12FromDiscord<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:28FromDiscord<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:32FromDiscord<nnsee> ¯\_(ツ)_/¯
10:23:09FromDiscord<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:15FromDiscord<hovsater> (edit) "usually," => "usually"
10:23:20FromDiscord<nnsee> indeed
10:23:50FromDiscord<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:49FromDiscord<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:05FromDiscord<nnsee> you can, `nimble c -r src/whatever.nim`
10:30:16FromDiscord<hovsater> I tried that, but it did not seem to run the actual file.
10:30:34FromDiscord<nnsee> just tested it, works fine here
10:30:55FromDiscord<hovsater> sent a code paste, see https://play.nim-lang.org/#pasty=dcXbZIoo
10:31:07FromDiscord<hovsater> sent a code paste, see https://play.nim-lang.org/#pasty=UbdjfyIx
10:31:15FromDiscord<nnsee> seems to work? `Nim Output asd`
10:31:37FromDiscord<hovsater> Oh! 🤦‍♂️
10:31:51FromDiscord<hovsater> Missed that part. The output is a bit different from `nim c -r` that's why I missed it.
10:31:53FromDiscord<hovsater> Thanks for that. 🙂
11:03:37*beholders_eye joined #nim
12:31:22FromDiscord<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:33FromDiscord<hovsater> (edit) "exception" => "exceptions"
12:32:51Amun-Raexceptions are te goto way of handling errors in nim
12:33:13Amun-Rabut you can use result-like structures too
12:36:30FromDiscord<hovsater> sent a long message, see https://pasty.ee/zKjvuhKU
12:36:33FromDiscord<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:39FromDiscord<Ras 🫐> my personal take is that exceptions are... fine
12:37:15FromDiscord<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:38FromDiscord<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:06Amun-Ratbh in my programs I use exceptions for IO or stdlib errors, and a enum for my own procs
13:01:48FromDiscord<kapendev> I would use the one that fits your project more. Not a fan of exceptions, but they can be nice sometimes.
13:02:27FromDiscord<kapendev> Or mix and use one more than the other.
13:23:33FromDiscord<Laylie> sent a code paste, see https://play.nim-lang.org/#pasty=ZHIpKWgn
13:42:45Amun-Raand what's nice is you can have explicit exception listed functions
13:45:33FromDiscord<hovsater> sent a code paste, see https://play.nim-lang.org/#pasty=aimSaDDW
13:46:25FromDiscord<hovsater> `result` would obviously be something other than `string` (probably some kind of structure), but I just wrote something for demonstration purposes.
13:48:17FromDiscord<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:32FromDiscord<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:56FromDiscord<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:42FromDiscord<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:43FromDiscord<planetis_m> but then only if errors are common, I would otherwise use exceptions.
14:13:27FromDiscord<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:34FromDiscord<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:19FromDiscord<[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:54FromDiscord<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:34FromDiscord<hovsater> In reply to @planetis_m "I would advice against": Mind expanding on the why?
15:45:48FromDiscord<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:41FromDiscord<planetis_m> like representing a multi type node.
15:48:21FromDiscord<planetis_m> (edit) "multi type" => "dynamically typed"
16:02:00FromDiscord<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