<< 02-12-2025 >>

00:28:15*beholders_eye quit (Ping timeout: 240 seconds)
02:28:45*SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev)
02:33:36*SchweinDeBurg joined #nim
02:36:02*rockcavera quit (Remote host closed the connection)
06:06:21*maytham joined #nim
06:16:35*maytham quit (Ping timeout: 245 seconds)
07:28:16FromDiscord<litlighilit> https://nimble.directory/search?query=lua
07:37:24*redj quit (Ping timeout: 252 seconds)
07:39:09*redj joined #nim
08:40:57*xtr00 joined #nim
09:43:32*beholders_eye joined #nim
09:51:02*xtr00 quit (Quit: ZNC 1.9.1 - https://znc.in)
09:56:30*xtr00 joined #nim
10:55:34*xtr00 quit (Ping timeout: 255 seconds)
10:59:47*xtr00 joined #nim
11:05:15*xtr00 quit (Read error: Connection reset by peer)
11:09:21*xtr00 joined #nim
11:15:33*xtr00 quit (Read error: Connection reset by peer)
11:20:20*xtr00 joined #nim
11:24:42FromDiscord<neonspecter0864> is there anyone looking for a dev?
11:32:46FromDiscord<lainlaylie> not in this channel there isnt
11:43:19*xtr00 quit (Read error: Connection reset by peer)
12:14:47*xtr00 joined #nim
12:17:22*xtr00 quit (Read error: Connection reset by peer)
12:23:52*xtr00 joined #nim
12:37:40*xtr00 quit (Ping timeout: 265 seconds)
12:40:38*xtr00 joined #nim
12:47:11*xtr00 quit (Ping timeout: 244 seconds)
12:49:43*beholders_eye quit (Ping timeout: 240 seconds)
13:06:06*xet7 joined #nim
14:25:30FromDiscord<gesee37> sent a long message, see https://pasty.ee/sWBWfaLd
14:27:02FromDiscord<gesee37> (edit) "https://pasty.ee/BEHQHztt" => "https://pasty.ee/JWPkwckN"
14:45:43FromDiscord<nnsee> sent a long message, see https://pasty.ee/VHYDxBHF
14:47:24FromDiscord<gesee37> In reply to @nnsee "1. nim is going": Seems go good. I think the 3rd question was redundant with the 2nd one.
14:47:34FromDiscord<gesee37> (edit) removed "go"
14:48:20*xet7 quit (Remote host closed the connection)
14:48:26FromDiscord<gesee37> Just wanted to know if all the drama I heard is finish
14:49:17FromDiscord<gesee37> Or how is it handled at least
14:49:32FromDiscord<gesee37> Because nim really seems like an excellent language
14:51:18FromDiscord<nnsee> In reply to @gesee37 "Just wanted to know": idunno, i've been here for a hot minute and haven't really seen any drama at all
14:51:48FromDiscord<nervecenter> sent a long message, see https://pasty.ee/kALlzOZP
14:53:33FromDiscord<gesee37> In reply to @nervecenter "Some people way back": Yeah yeah. Actually I already felt into the multi method trap.↵I think I applied principle from julia (multiple dispatch) too fervently to nim 😅
14:57:43FromDiscord<gesee37> In reply to @nervecenter "Some people way back": As for the engine. It's just a core.↵You can take a look [here](https://github.com/Gesee-y/Cruise) to have a better idea of the scope
14:58:43FromDiscord<systemblue_2010> I want to find how to block Nil in compile time in sequence, string, openArray
14:59:29FromDiscord<systemblue_2010> sent a code paste, see https://play.nim-lang.org/#pasty=fjHIxLIy
14:59:50FromDiscord<systemblue_2010> (edit) "sent a code paste, see https://play.nim-lang.org/#pasty=qnQhLExd" => "with ref or ptr type I can use nim`not nil` keyword but I can't use it in var or let"
15:00:07FromDiscord<systemblue_2010> (edit) "nim`not" => "`not"
15:01:54FromDiscord<systemblue_2010> Nim should make borrow checker and Nil blocker↵there's no way to block nil in var or let reference type
15:02:18FromDiscord<systemblue_2010> run time exception is useless
15:53:12*fabricio joined #nim
16:08:48*beholders_eye joined #nim
16:22:49FromDiscord<litlighilit> {.experimental\: "strictNotNil".}↵var i = 0↵var p\: ptr int not nil = addr i
16:22:50FromDiscord<litlighilit> u a incorrect↵(@systemblue_2010)
16:22:56FromDiscord<litlighilit> Or
16:24:46FromDiscord<litlighilit> {.experimental\: "strictNotNil".}↵type NotNilPtr[T] = ptr T not nil↵var i = 0↵var p\: NotNilPtr[T] = addr i
16:28:23FromDiscord<litlighilit> sent a code paste, see https://play.nim-lang.org/#pasty=MydLKxPl
16:28:35FromDiscord<litlighilit> sent a code paste, see https://play.nim-lang.org/#pasty=DJXGkOZr
16:31:51FromDiscord<litlighilit> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1445450142021849143): here I don't get you about why to combine type modifier `ref`, `ptr` with variable immutability modifier `let`, `var`
16:36:20FromDiscord<litlighilit> Or u a meaning not nil cannot be adopted to non-pointer type(stack-based)?...seriously? (i'm just confused)↵(@systemblue_2010)
16:36:34FromDiscord<litlighilit> Or u a meaning `not nil` cannot be adopted to non-pointer type(stack-based)?...seriously? (i'm just confused)
16:43:28FromDiscord<litlighilit> Nim has both borrow checker and Nil blocker.Not enforced and anxious like Rust's, but optional and works implicitly mostly↵(@systemblue_2010)
16:48:25FromDiscord<litlighilit> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1445455337808334931): Nim has both borrow checker and Nil blocker.Not enforced and anxious like Rust's, but optional and works implicitly mostly.Meanwhile, memory management is implicitly guarded via effective ORC with no mental burden,↵and efficiency is still nearly close to C
16:53:49FromDiscord<Buckwheat> something about that looks so type soupy
16:54:32FromDiscord<Buckwheat> though the type sugaring helps
16:55:30FromDiscord<litlighilit> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1445453600330350714): Or u a meaning  not nil  cannot be adopted to non-pointer type? (which are stack-based!)...is such question seriously? (i'm just confused)
17:02:15FromDiscord<Buckwheat> I'm probably gonna be old man yelling at clouds here but the borrow checker hype just seems like people trying to fearmonger using Rust's mentality
17:47:29*beholders_eye quit (Ping timeout: 265 seconds)
17:48:24*beholders_eye joined #nim
17:53:06FromDiscord<nervecenter> With few exceptions, all of Nim's types, from primitive to compound to dynamic, support value semantics. Don't use a `ref` if you don't absolutely need it, and don't even make it `var` if you don't absolutely need it. That makes the lifetime obvious (usually the initializing scope) and moves very easy to statically insert. Triggering the manual-memory escape hatches is what complicates it all.
17:53:27FromDiscord<nervecenter> (edit) "With few exceptions, all of Nim's types, from primitive to compound to dynamic, support value semantics. Don't use a `ref` if you don't absolutely need it, and don't even make it `var` if you don't absolutely need it. That makes the lifetime obvious (usually the initializing scope) and ... movesanalyze" added "makes" | "makesmoves very easy to statically ... insert." added "analyze and"
17:53:38FromDiscord<nervecenter> (edit) "hatches" => "hatch"
17:54:10FromDiscord<nervecenter> (edit) "With few exceptions, all of Nim's types, from primitive to compound to dynamic, support value semantics. Don't use a `ref` if you don't absolutely need it, and don't even make it `var` if you don't absolutely need it. That makes the lifetime obvious (usually the initializing scope) and makes moves very easy ... to" added "for the compiler"
18:11:09*xutaxkamay quit (Ping timeout: 260 seconds)
18:20:08*fabricio quit (Read error: No route to host)
18:34:07mid-kidI'm new to nim and getting the hang of things. Is there any idiom like python's "for/else" statement, so I don't need to keep track of a separate variable for when the loop exits without breaking?
18:34:16mid-kidI made a simple paste about this, to illustrate what I mean: https://play.nim-lang.org/#pasty=AosMxLZf
18:35:10mid-kidNote that the "item == needle" comparison is a simple one, I'm sure there's a way to figure out if a value is part of a range quicker, but that's not my goal here.
18:36:30mid-kidI'm also wondering if it's possible to use sequtils-like functional functions on ranges, without having to allocate a sequence first.
18:36:37Amun-Ramid-kid: https://play.nim-lang.org/#pasty=MdnZkwdi
18:36:58mid-kidAmun-Ra: Oooh, that works. Thanks!
18:37:08Amun-Ra:)
18:37:41mid-kidbit sad about the extra level of indentation but I suppose this sort of thing is why it's usually 2 spaces instead of more.
18:38:13Amun-Rayes, variable scope is different that the one in python
18:39:34Amun-Rabtw, in this example you can replace the whole block with: `if needle in haystack` or `if needle notin haystack`
18:40:02Amun-Ra"notin" and not "not in" like in python :)
18:40:41Amun-Rahttps://play.nim-lang.org/#pasty=pLBfySCZ
18:41:54mid-kidIs the "in" boolean operator described anywhere? Would love to see the documentation for it
18:41:56mid-kidThanks btw.
18:42:41Amun-Rait's a template, see https://nim-lang.org/docs/system.html#in.t%2Cuntyped%2Cuntyped
18:43:22Amun-Rahttps://nim-lang.org/docs/system.html#contains%2CopenArray%5BT%5D%2CT and a few others below
18:43:50Amun-Raand you can implement your own `contains` for your types / type pairs
18:45:37Amun-Rahttps://play.nim-lang.org/#pasty=pJnPVguH
18:45:48mid-kidapparently the "contains" function is specifically for HSlices and doesn't work for iterators, so "10 in countup(0, 20, 2)" doesn't work sadly.
18:46:01Amun-Raah, yes
18:46:40mid-kidOh well.
18:51:38Amun-Rabut i'll work for "normal" ranges like 3 .. 10 or 3 ..< 10
19:00:53mid-kidI've been digging around, and I'm wondering, can "iterator" functions be used anywhere besides "for" loops and the "sequtils.toSeq()" function?
19:01:13mid-kidalthough toSeq is a template not a function
19:01:24mid-kidjust wondering if there's other stdlib facilities operating on them.
19:06:55FromDiscord<nervecenter> iterators are a pretty special compile-time type, they get turned into raw for loops in the generated C so I think they have to be used loop contexts, with the exception being that `toSeq` template
19:07:11FromDiscord<nervecenter> which of course is turned into a for loop
19:08:06*xutaxkamay joined #nim
19:08:34FromDiscord<nervecenter> https://nim-docs.readthedocs.io/en/latest/learn/nim_by_example/iterators/
19:08:43FromDiscord<nervecenter> Maybe I'm wrong, they can be passed around a bit
19:09:13mid-kidOh, you're right. That makes a lot of sense in making them absolutely zero-overhead.
19:09:46mid-kidJust not like the iterators I'm used to which keep state.
19:10:00mid-kidSeems like Nim has those in the form of closure operators, and they're not interchangeable.
19:10:11Amun-Rayou can call .next manually
19:10:55mid-kidAmun-Ra: on inline iterators? I get a compile error for daring to assign countup() to a variable.
19:11:39Amun-Ramid-kid: not like that
19:15:20Amun-Racheck closure iterators from the link above
19:18:19mid-kidright, with closure iterators that's possible.
19:18:24Amun-Ramhm
20:39:53FromDiscord<nocturn9x> any idea why `-18 mod 100` yields `-18` in nim?
20:39:59FromDiscord<nocturn9x> I would expect it to be `82`
20:41:01FromDiscord<nocturn9x> is it just python being weird
20:43:53FromDiscord<nasuray> In reply to @nocturn9x "any idea why `-18": You doing advent of code perchance?
20:44:03FromDiscord<nocturn9x> indeed
20:44:14FromDiscord<nocturn9x> turns out python is the only weirdo doing modular arithmetic in positive integers only
20:44:18FromDiscord<nocturn9x> and I just had bad expectations
20:45:51FromDiscord<nasuray> Yep it calculated differently https://nim-lang.org/docs/system.html#mod%2Cint%2Cint
21:21:16*fabricio joined #nim
21:42:05Amun-Rapython uses floored division to calc. modulo
21:42:11mid-kid@nocturn9x: use floormod to get python-style mod
21:42:26mid-kidI thought C also did floormod.
21:42:35mid-kidbut I could be misremembering
21:57:55*rockcavera joined #nim
22:43:19FromDiscord<nocturn9x> I see
23:03:45*rockcavera quit (Remote host closed the connection)
23:16:03*rockcavera joined #nim
23:20:21*fabricio quit (Quit: WeeChat 3.5)
23:53:55FromDiscord<litlighilit> nope. C's `-1/2` and Nim's `-1 div 2` means the same.↵(<@709044657232936960_mid-kid=5b=49=52=43=5d>)
23:56:19FromDiscord<that_dude.> Isn't the default to round to 0?
23:58:47FromDiscord<litlighilit> nope, round downside
23:59:21FromDiscord<litlighilit> results in 0