<< 11-05-2025 >>

00:03:04FromDiscord<0xfab_10> we should be using dijkstra if elif else
00:59:24*hhhhhhhhhn joined #nim
03:33:45FromDiscord<wannabelokesh> In reply to @aintea "in the worst case": okay, then my next question is, please recommend me a really good book about nim that's also not old.
03:36:23FromDiscord<wannabelokesh> cause language tour and such things only covers high-level abstracted syntax and logic. ↵or they show a complex, hard program example to show how it looks or whatever. ↵I mean, either they remain at level 0 to 1 (level of difficulty) or directly jump to some higher. ↵I want someone to explain things one at a time, and low-level things.
04:17:45FromDiscord<wannabelokesh> sent a long message, see https://pasty.ee/qHZDOkAd
04:20:37FromDiscord<wannabelokesh> Please also help me fixing this. https://media.discordapp.net/attachments/371759389889003532/1370978881867354232/image.png?ex=68217714&is=68202594&hm=17e3421e90e16d92d42411e01949709404f26c593ab2834176bdef8af3eace79& https://media.discordapp.net/attachments/371759389889003532/1370978882320334869/image.png?ex=68217715&is=68202595&hm=fa593a51cf8076c17ef3433eb6cecb7856a7656d06ccbdaa3a6017853dbc8cf0&
04:42:06FromDiscord<lainlaylie> In reply to @wannabelokesh "cause language tour and": salewski's book seems to fit the bill, but it's incredibly long winded
04:45:46*CypherCat quit (Quit: IRCNow and Forever!)
04:57:41*fallback quit (Quit: IRCNow and Forever!)
04:58:20*CypherCat joined #nim
05:09:53*fallback joined #nim
05:12:57*hhhhhhhhhn quit (Quit: WeeChat 4.6.2)
05:38:13FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=fbmmzMJd
05:39:22FromDiscord<janakali> (edit) "https://play.nim-lang.org/#pasty=ZcsmLVwE" => "https://play.nim-lang.org/#pasty=tKIzLjLG"
05:55:02FromDiscord<wannabelokesh> thanks. ↵I guess I'm using Vanilla neovim, sure I am.
05:55:44FromDiscord<wannabelokesh> I watched the playlist completely, no skips. ↵I listened to him carefully. But there's many things I didn't get.
05:58:11FromDiscord<wannabelokesh> In reply to @nnsee "you can change where": I mean, nimble compiles and throw the executable inside the parent of src/ ie parallel to src/ ↵I want it to build from src/ and put the final exec into build/ which is parallel to src/
05:58:26FromDiscord<wannabelokesh> by parallel, I mean, sibling or at same level
06:25:55*nils` quit (Ping timeout: 260 seconds)
06:56:58FromDiscord<heysokam> @ElegantBeef how is `==` interpreted for arbitrary `object`s that have no custom == defined?↵is it like a deepEqual, or something else?
06:57:25FromDiscord<Elegantbeef> Yes it compares all the fields calling their `==`
06:57:56FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-2-2/lib/system.nim#L1798 It's not even magic
06:58:52FromDiscord<heysokam> cool, tyty↵if I use `!=` its going to auto template into `not ( ... == ...)` right?
06:59:14FromDiscord<heysokam> was thinking of implementing the custom `==` for a special case
06:59:30FromDiscord<Elegantbeef> Remember your `==` should match your hash
07:00:00FromDiscord<heysokam> what does that mean in practice?
07:00:14FromDiscord<Elegantbeef> If `==` returns true the hash should be the same
07:00:21FromDiscord<heysokam> oh
07:01:08FromDiscord<heysokam> I think I'd rather remove the `Undefined` field values from the object then
07:01:21FromDiscord<heysokam> to avoid that edge case altogether
07:01:34FromDiscord<Elegantbeef> Or you could just make your own hash procedure
07:06:51FromDiscord<heysokam> that's what I mean. removing the undefined fields also removes the need for a `==` and `hash` procs altogether
07:07:07FromDiscord<heysokam> so it turns 5-15 lines into one
07:44:07FromDiscord<aintea> In reply to @wannabelokesh "okay, then my next": I don't know any book but you can go try to check the Nimlings on GitHub, I haven't finished them yet but it should cover everything once it's done
07:45:02FromDiscord<aintea> You can also check Nim Days (website), that has smaller and simpler programs (like a terminal todo list) and explain every step with code, it's actually very good
09:00:21*nils` joined #nim
09:09:25FromDiscord<janakali> In reply to @wannabelokesh "cause language tour and": [Mastering Nim](https://www.amazon.com/Mastering-Nim-complete-programming-language/dp/B0B4R7B9YX)↵[Nim programming book](https://nimprogrammingbook.com/)↵↵You can also read general programming books (C, C++, Python / algorithms and data structures), most concepts they teach (except classes) should translate to Nim.
09:21:18FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=aoYuXhWk
09:34:26FromDiscord<heysokam> In reply to @griffith1deadly "beef what is it": missing return type on the function decl?
09:34:48FromDiscord<heysokam> or maybe missing the `{.cdecl.}` pragma
09:36:10FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=XrtiwlGH
09:36:38FromDiscord<heysokam> ` =` doesn't that need a type?
09:36:57FromDiscord<griffith1deadly> maybe because macros return untyped and i just do a copy of function argument's that includes syms
09:37:12FromDiscord<griffith1deadly> In reply to @heysokam "` =` doesn't that": it's just example i used for `dumpAstGen`
09:37:19FromDiscord<griffith1deadly> generated code looks good
09:37:39FromDiscord<heysokam> kk, if its from macros then I'm out. I have no clue, sorry
09:39:29FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=LqhyychO
09:39:43FromDiscord<griffith1deadly> it looks good
09:39:59FromDiscord<griffith1deadly> but i think maybe problem that i mix typed with untyped
09:40:07FromDiscord<griffith1deadly> but errors so unintuitive
09:40:34FromDiscord<heysokam> that's incorrect if it needs a `.cdecl`
09:40:41FromDiscord<heysokam> (edit) "`.cdecl`" => "`{.cdecl.}`"
09:41:03FromDiscord<griffith1deadly> `nativeEnvironment.defineClass` is cdecl so why proxy function need a cdecl
09:41:14FromDiscord<heysokam> the error is saying that
09:42:00FromDiscord<heysokam> the message says you are trying to assign differen function types to each other, and cdecl makes a function type different
09:42:44FromDiscord<griffith1deadly> i don't assing anything? i just make function call proxy for threadlocal variable
09:42:59FromDiscord<griffith1deadly> (edit) "assing" => "assign"
09:43:21FromDiscord<heysokam> `Error: type mismatch: got ..... but expected one of: ....`
09:43:32FromDiscord<griffith1deadly> if i manually make that proc it works
09:43:36FromDiscord<heysokam> no clue about how that's triggered, but that's what that means
09:45:32FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=yrDXiGQj
09:47:39FromDiscord<griffith1deadly> but if it comes from macros no
09:54:00*dza0 is now known as dza
10:05:55FromDiscord<griffith1deadly> yeah, error comes from mixins syms with untyped result
10:06:37FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=RcluvyOk
10:06:45FromDiscord<griffith1deadly> (edit) "mixins" => "mixin"
11:24:11*CypherCat quit (Changing host)
11:24:11*CypherCat joined #nim
11:42:33*andy-turner joined #nim
12:09:12FromDiscord<heysokam> sent a long message, see https://pasty.ee/QIIzgaiX
12:24:06FromDiscord<lainlaylie> they are defines, so -d
12:25:50FromDiscord<heysokam> kk, ty
12:46:47FromDiscord<heysokam> Is there a way to override imported files from the compiler cli in some way?↵lets say I have `import ./other/thing.nim` called from `file.nim`, and I compile with `nim c file.nim`↵Can I add anything to the compiler that would override `thing.nim` into `path/to/thing.nim`?
12:54:28*andy-turner quit (Quit: Leaving)
12:54:44*andy-turner joined #nim
12:55:06*andy-turner quit (Remote host closed the connection)
12:56:30*andy-turner joined #nim
12:57:37*andy-turner quit (Client Quit)
12:58:28*andy-turner joined #nim
12:59:21*andy-turner quit (Remote host closed the connection)
12:59:44Amun-Raheysokam: patchFile
13:02:05FromDiscord<heysokam> In reply to @Amun-Ra "<@186489007247589376>: patchFile": is that not just for nimscript?
13:02:14FromDiscord<heysokam> that's what the nimc manual says
13:02:56Amun-Rait was eons ago, but I used it to replace something from stdlib for AmigaOS target
13:03:06Amun-Rain c target
13:03:23Amun-Rathat was on 1.6.x
13:03:34*andy-turner joined #nim
13:04:08Amun-RaI don't think I have the code anymore
13:04:19FromDiscord<heysokam> :sadge:
13:08:08Amun-Racommand line(1, 2) Error: invalid command line option: '--patchFile'
13:08:10Amun-Rahmm
13:16:18*andy-turner quit (Quit: Leaving)
13:16:33*andy-turner joined #nim
14:17:58FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=NIkckRrY
15:15:49FromDiscord<heysokam> In reply to @janakali "<@186489007247589376> does it have": it has to be cli, yep 😦
16:33:54*skippy8 joined #nim
17:02:44*andy-turner quit (Quit: Leaving)
17:03:00*andy-turner joined #nim
17:04:54FromDiscord<heysokam> I'm writing a `folder.glob(pattern=".c")` function↵Is there any existing tools to pattern match strings in stdlib?
17:05:18FromDiscord<heysokam> I don't want regex, just simple unix-like glob patterns
17:08:30Amun-Rais the glob pattern hardcoded into an app?
17:08:56Amun-RaI'd go with regex in that case
17:09:58FromDiscord<heysokam> 1000000000000000% not regex
17:10:16FromDiscord<heysokam> its exposed to the caller. I'd rather not have patterns than regex
17:10:47Amun-Raack
17:10:58FromDiscord<heysokam> ?
17:11:46Amun-Rathat can be a hermetic expression, ack is a tcp procotol bit meaning acknowledgement
17:12:03FromDiscord<heysokam> i mean, that'd make it worse
17:12:24Amun-Rait mean ~ "I get it"
17:12:27Amun-Rameans*
17:13:09FromDiscord<heysokam> ah it was a joke. kk
17:13:49strogon14on posix the C glob library is wrapped in the depths of the paths odule
17:13:54Amun-Raas in "I've taken note of the requirements"
17:13:58strogon14*module
17:14:20Amun-RaI see no shell-alike glob pattern module built-in into the batteries
17:14:27*andy-turner quit (Quit: Leaving)
17:14:42*andy-turner joined #nim
17:14:54Amun-Ranimble search returns https://github.com/haltcase/glob and https://github.com/treeform/globby
17:17:55FromDiscord<heysokam> https://github.com/haltcase/glob/blob/ab6087b0cfb56096258cb48f7e756a8c3e8e40cf/src/glob.nim#L143
17:18:44Amun-Rait's still in spec - you don't use regex directly ;)
17:18:53FromDiscord<heysokam> globby fits better
17:19:32Amun-Rait's by treeform after all
17:19:43strogon14heysoka, we discussed glob a few days ago: https://play.nim-lang.org/#pasty=JZFAJKvO
17:25:43FromDiscord<heysokam> ty strogon
17:27:10FromDiscord<heysokam> I guess walkpattern might do the job 🤔
17:27:48FromDiscord<heysokam> I need to select recursion, though. so, actually maybe not
17:34:17FromDiscord<nnsee> In reply to @heysokam "ah it was a": _ack_ is pretty much the same as "okay, got it"
19:36:33FromDiscord<flashjaysan> Is there some kind of main function in nim? How do I know which module will create an executable and which one would produce an object file?
19:53:02FromDiscord<griffith1deadly> In reply to @flashjaysan "Is there some kind": top level function call
19:54:05FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=BbUVdbEr
20:11:39FromDiscord<Phil> Basically: The entiry point is determined by the file you pass into the compiler.↵What will execute is all top-level code across all modules that get pulled into the compilation process.↵To unify this, it is recommended to have some sort of main() proc that you call so you don't have 50 pieces of code across 50 modules that may be executed in an unspecified order that could change over time.
20:17:59*andy-turner quit (Quit: Leaving)
20:26:33*andy-turner joined #nim
20:27:02*andy-turner quit (Remote host closed the connection)
20:29:39*andy-turner joined #nim
20:33:59*kavenjane quit (Quit: Connection closed for inactivity)
21:03:33FromDiscord<fl4shk> does there exist a pre-existing FIFO, or queue data structure? I am not looking for `heapqueue`
21:03:55FromDiscord<fl4shk> searches didn't reveal anything
21:03:57FromDiscord<fl4shk> (edit)
21:04:32FromDiscord<fl4shk> I've implemented a FIFO before as FPGA code, but I don't feel like doing that again right now
21:04:37FromDiscord<pmunch> Deque?
21:04:44FromDiscord<fl4shk> oh that would likely work
21:05:35FromDiscord<pmunch> I've used it as a queue in the past 🙂
21:05:41FromDiscord<fl4shk> that works
21:30:59FromDiscord<fl4shk> thanks
21:36:10*andy-turner quit (Quit: Leaving)
22:05:42FromDiscord<ja.hogy.mi> so, I compiled nim 2.2.4 (nim-lang.org source, not gh release), and about 20 tests are failing↵i wonder is this normal or is my setup fcked
22:06:16FromDiscord<ja.hogy.mi> there is some segfaults, some nimc crashes↵i'm testing with ./koch test