| 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:16 | FromDiscord | <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:42 | FromDiscord | <neonspecter0864> is there anyone looking for a dev? |
| 11:32:46 | FromDiscord | <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:30 | FromDiscord | <gesee37> sent a long message, see https://pasty.ee/sWBWfaLd |
| 14:27:02 | FromDiscord | <gesee37> (edit) "https://pasty.ee/BEHQHztt" => "https://pasty.ee/JWPkwckN" |
| 14:45:43 | FromDiscord | <nnsee> sent a long message, see https://pasty.ee/VHYDxBHF |
| 14:47:24 | FromDiscord | <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:34 | FromDiscord | <gesee37> (edit) removed "go" |
| 14:48:20 | * | xet7 quit (Remote host closed the connection) |
| 14:48:26 | FromDiscord | <gesee37> Just wanted to know if all the drama I heard is finish |
| 14:49:17 | FromDiscord | <gesee37> Or how is it handled at least |
| 14:49:32 | FromDiscord | <gesee37> Because nim really seems like an excellent language |
| 14:51:18 | FromDiscord | <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:48 | FromDiscord | <nervecenter> sent a long message, see https://pasty.ee/kALlzOZP |
| 14:53:33 | FromDiscord | <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:43 | FromDiscord | <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:43 | FromDiscord | <systemblue_2010> I want to find how to block Nil in compile time in sequence, string, openArray |
| 14:59:29 | FromDiscord | <systemblue_2010> sent a code paste, see https://play.nim-lang.org/#pasty=fjHIxLIy |
| 14:59:50 | FromDiscord | <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:07 | FromDiscord | <systemblue_2010> (edit) "nim`not" => "`not" |
| 15:01:54 | FromDiscord | <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:18 | FromDiscord | <systemblue_2010> run time exception is useless |
| 15:53:12 | * | fabricio joined #nim |
| 16:08:48 | * | beholders_eye joined #nim |
| 16:22:49 | FromDiscord | <litlighilit> {.experimental\: "strictNotNil".}↵var i = 0↵var p\: ptr int not nil = addr i |
| 16:22:50 | FromDiscord | <litlighilit> u a incorrect↵(@systemblue_2010) |
| 16:22:56 | FromDiscord | <litlighilit> Or |
| 16:24:46 | FromDiscord | <litlighilit> {.experimental\: "strictNotNil".}↵type NotNilPtr[T] = ptr T not nil↵var i = 0↵var p\: NotNilPtr[T] = addr i |
| 16:28:23 | FromDiscord | <litlighilit> sent a code paste, see https://play.nim-lang.org/#pasty=MydLKxPl |
| 16:28:35 | FromDiscord | <litlighilit> sent a code paste, see https://play.nim-lang.org/#pasty=DJXGkOZr |
| 16:31:51 | FromDiscord | <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:20 | FromDiscord | <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:34 | FromDiscord | <litlighilit> Or u a meaning `not nil` cannot be adopted to non-pointer type(stack-based)?...seriously? (i'm just confused) |
| 16:43:28 | FromDiscord | <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:25 | FromDiscord | <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:49 | FromDiscord | <Buckwheat> something about that looks so type soupy |
| 16:54:32 | FromDiscord | <Buckwheat> though the type sugaring helps |
| 16:55:30 | FromDiscord | <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:15 | FromDiscord | <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:06 | FromDiscord | <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:27 | FromDiscord | <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:38 | FromDiscord | <nervecenter> (edit) "hatches" => "hatch" |
| 17:54:10 | FromDiscord | <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:07 | mid-kid | I'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:16 | mid-kid | I made a simple paste about this, to illustrate what I mean: https://play.nim-lang.org/#pasty=AosMxLZf |
| 18:35:10 | mid-kid | Note 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:30 | mid-kid | I'm also wondering if it's possible to use sequtils-like functional functions on ranges, without having to allocate a sequence first. |
| 18:36:37 | Amun-Ra | mid-kid: https://play.nim-lang.org/#pasty=MdnZkwdi |
| 18:36:58 | mid-kid | Amun-Ra: Oooh, that works. Thanks! |
| 18:37:08 | Amun-Ra | :) |
| 18:37:41 | mid-kid | bit 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:13 | Amun-Ra | yes, variable scope is different that the one in python |
| 18:39:34 | Amun-Ra | btw, in this example you can replace the whole block with: `if needle in haystack` or `if needle notin haystack` |
| 18:40:02 | Amun-Ra | "notin" and not "not in" like in python :) |
| 18:40:41 | Amun-Ra | https://play.nim-lang.org/#pasty=pLBfySCZ |
| 18:41:54 | mid-kid | Is the "in" boolean operator described anywhere? Would love to see the documentation for it |
| 18:41:56 | mid-kid | Thanks btw. |
| 18:42:41 | Amun-Ra | it's a template, see https://nim-lang.org/docs/system.html#in.t%2Cuntyped%2Cuntyped |
| 18:43:22 | Amun-Ra | https://nim-lang.org/docs/system.html#contains%2CopenArray%5BT%5D%2CT and a few others below |
| 18:43:50 | Amun-Ra | and you can implement your own `contains` for your types / type pairs |
| 18:45:37 | Amun-Ra | https://play.nim-lang.org/#pasty=pJnPVguH |
| 18:45:48 | mid-kid | apparently 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:01 | Amun-Ra | ah, yes |
| 18:46:40 | mid-kid | Oh well. |
| 18:51:38 | Amun-Ra | but i'll work for "normal" ranges like 3 .. 10 or 3 ..< 10 |
| 19:00:53 | mid-kid | I've been digging around, and I'm wondering, can "iterator" functions be used anywhere besides "for" loops and the "sequtils.toSeq()" function? |
| 19:01:13 | mid-kid | although toSeq is a template not a function |
| 19:01:24 | mid-kid | just wondering if there's other stdlib facilities operating on them. |
| 19:06:55 | FromDiscord | <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:11 | FromDiscord | <nervecenter> which of course is turned into a for loop |
| 19:08:06 | * | xutaxkamay joined #nim |
| 19:08:34 | FromDiscord | <nervecenter> https://nim-docs.readthedocs.io/en/latest/learn/nim_by_example/iterators/ |
| 19:08:43 | FromDiscord | <nervecenter> Maybe I'm wrong, they can be passed around a bit |
| 19:09:13 | mid-kid | Oh, you're right. That makes a lot of sense in making them absolutely zero-overhead. |
| 19:09:46 | mid-kid | Just not like the iterators I'm used to which keep state. |
| 19:10:00 | mid-kid | Seems like Nim has those in the form of closure operators, and they're not interchangeable. |
| 19:10:11 | Amun-Ra | you can call .next manually |
| 19:10:55 | mid-kid | Amun-Ra: on inline iterators? I get a compile error for daring to assign countup() to a variable. |
| 19:11:39 | Amun-Ra | mid-kid: not like that |
| 19:15:20 | Amun-Ra | check closure iterators from the link above |
| 19:18:19 | mid-kid | right, with closure iterators that's possible. |
| 19:18:24 | Amun-Ra | mhm |
| 20:39:53 | FromDiscord | <nocturn9x> any idea why `-18 mod 100` yields `-18` in nim? |
| 20:39:59 | FromDiscord | <nocturn9x> I would expect it to be `82` |
| 20:41:01 | FromDiscord | <nocturn9x> is it just python being weird |
| 20:43:53 | FromDiscord | <nasuray> In reply to @nocturn9x "any idea why `-18": You doing advent of code perchance? |
| 20:44:03 | FromDiscord | <nocturn9x> indeed |
| 20:44:14 | FromDiscord | <nocturn9x> turns out python is the only weirdo doing modular arithmetic in positive integers only |
| 20:44:18 | FromDiscord | <nocturn9x> and I just had bad expectations |
| 20:45:51 | FromDiscord | <nasuray> Yep it calculated differently https://nim-lang.org/docs/system.html#mod%2Cint%2Cint |
| 21:21:16 | * | fabricio joined #nim |
| 21:42:05 | Amun-Ra | python uses floored division to calc. modulo |
| 21:42:11 | mid-kid | @nocturn9x: use floormod to get python-style mod |
| 21:42:26 | mid-kid | I thought C also did floormod. |
| 21:42:35 | mid-kid | but I could be misremembering |
| 21:57:55 | * | rockcavera joined #nim |
| 22:43:19 | FromDiscord | <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:55 | FromDiscord | <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:19 | FromDiscord | <that_dude.> Isn't the default to round to 0? |
| 23:58:47 | FromDiscord | <litlighilit> nope, round downside |
| 23:59:21 | FromDiscord | <litlighilit> results in 0 |