00:03:04 | FromDiscord | <0xfab_10> we should be using dijkstra if elif else |
00:59:24 | * | hhhhhhhhhn joined #nim |
03:33:45 | FromDiscord | <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:23 | FromDiscord | <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:45 | FromDiscord | <wannabelokesh> sent a long message, see https://pasty.ee/qHZDOkAd |
04:20:37 | FromDiscord | <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:06 | FromDiscord | <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:13 | FromDiscord | <janakali> sent a code paste, see https://play.nim-lang.org/#pasty=fbmmzMJd |
05:39:22 | FromDiscord | <janakali> (edit) "https://play.nim-lang.org/#pasty=ZcsmLVwE" => "https://play.nim-lang.org/#pasty=tKIzLjLG" |
05:55:02 | FromDiscord | <wannabelokesh> thanks. ↵I guess I'm using Vanilla neovim, sure I am. |
05:55:44 | FromDiscord | <wannabelokesh> I watched the playlist completely, no skips. ↵I listened to him carefully. But there's many things I didn't get. |
05:58:11 | FromDiscord | <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:26 | FromDiscord | <wannabelokesh> by parallel, I mean, sibling or at same level |
06:25:55 | * | nils` quit (Ping timeout: 260 seconds) |
06:56:58 | FromDiscord | <heysokam> @ElegantBeef how is `==` interpreted for arbitrary `object`s that have no custom == defined?↵is it like a deepEqual, or something else? |
06:57:25 | FromDiscord | <Elegantbeef> Yes it compares all the fields calling their `==` |
06:57:56 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-2-2/lib/system.nim#L1798 It's not even magic |
06:58:52 | FromDiscord | <heysokam> cool, tyty↵if I use `!=` its going to auto template into `not ( ... == ...)` right? |
06:59:14 | FromDiscord | <heysokam> was thinking of implementing the custom `==` for a special case |
06:59:30 | FromDiscord | <Elegantbeef> Remember your `==` should match your hash |
07:00:00 | FromDiscord | <heysokam> what does that mean in practice? |
07:00:14 | FromDiscord | <Elegantbeef> If `==` returns true the hash should be the same |
07:00:21 | FromDiscord | <heysokam> oh |
07:01:08 | FromDiscord | <heysokam> I think I'd rather remove the `Undefined` field values from the object then |
07:01:21 | FromDiscord | <heysokam> to avoid that edge case altogether |
07:01:34 | FromDiscord | <Elegantbeef> Or you could just make your own hash procedure |
07:06:51 | FromDiscord | <heysokam> that's what I mean. removing the undefined fields also removes the need for a `==` and `hash` procs altogether |
07:07:07 | FromDiscord | <heysokam> so it turns 5-15 lines into one |
07:44:07 | FromDiscord | <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:02 | FromDiscord | <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:25 | FromDiscord | <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:18 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=aoYuXhWk |
09:34:26 | FromDiscord | <heysokam> In reply to @griffith1deadly "beef what is it": missing return type on the function decl? |
09:34:48 | FromDiscord | <heysokam> or maybe missing the `{.cdecl.}` pragma |
09:36:10 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=XrtiwlGH |
09:36:38 | FromDiscord | <heysokam> ` =` doesn't that need a type? |
09:36:57 | FromDiscord | <griffith1deadly> maybe because macros return untyped and i just do a copy of function argument's that includes syms |
09:37:12 | FromDiscord | <griffith1deadly> In reply to @heysokam "` =` doesn't that": it's just example i used for `dumpAstGen` |
09:37:19 | FromDiscord | <griffith1deadly> generated code looks good |
09:37:39 | FromDiscord | <heysokam> kk, if its from macros then I'm out. I have no clue, sorry |
09:39:29 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=LqhyychO |
09:39:43 | FromDiscord | <griffith1deadly> it looks good |
09:39:59 | FromDiscord | <griffith1deadly> but i think maybe problem that i mix typed with untyped |
09:40:07 | FromDiscord | <griffith1deadly> but errors so unintuitive |
09:40:34 | FromDiscord | <heysokam> that's incorrect if it needs a `.cdecl` |
09:40:41 | FromDiscord | <heysokam> (edit) "`.cdecl`" => "`{.cdecl.}`" |
09:41:03 | FromDiscord | <griffith1deadly> `nativeEnvironment.defineClass` is cdecl so why proxy function need a cdecl |
09:41:14 | FromDiscord | <heysokam> the error is saying that |
09:42:00 | FromDiscord | <heysokam> the message says you are trying to assign differen function types to each other, and cdecl makes a function type different |
09:42:44 | FromDiscord | <griffith1deadly> i don't assing anything? i just make function call proxy for threadlocal variable |
09:42:59 | FromDiscord | <griffith1deadly> (edit) "assing" => "assign" |
09:43:21 | FromDiscord | <heysokam> `Error: type mismatch: got ..... but expected one of: ....` |
09:43:32 | FromDiscord | <griffith1deadly> if i manually make that proc it works |
09:43:36 | FromDiscord | <heysokam> no clue about how that's triggered, but that's what that means |
09:45:32 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=yrDXiGQj |
09:47:39 | FromDiscord | <griffith1deadly> but if it comes from macros no |
09:54:00 | * | dza0 is now known as dza |
10:05:55 | FromDiscord | <griffith1deadly> yeah, error comes from mixins syms with untyped result |
10:06:37 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=RcluvyOk |
10:06:45 | FromDiscord | <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:12 | FromDiscord | <heysokam> sent a long message, see https://pasty.ee/QIIzgaiX |
12:24:06 | FromDiscord | <lainlaylie> they are defines, so -d |
12:25:50 | FromDiscord | <heysokam> kk, ty |
12:46:47 | FromDiscord | <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:44 | Amun-Ra | heysokam: patchFile |
13:02:05 | FromDiscord | <heysokam> In reply to @Amun-Ra "<@186489007247589376>: patchFile": is that not just for nimscript? |
13:02:14 | FromDiscord | <heysokam> that's what the nimc manual says |
13:02:56 | Amun-Ra | it was eons ago, but I used it to replace something from stdlib for AmigaOS target |
13:03:06 | Amun-Ra | in c target |
13:03:23 | Amun-Ra | that was on 1.6.x |
13:03:34 | * | andy-turner joined #nim |
13:04:08 | Amun-Ra | I don't think I have the code anymore |
13:04:19 | FromDiscord | <heysokam> :sadge: |
13:08:08 | Amun-Ra | command line(1, 2) Error: invalid command line option: '--patchFile' |
13:08:10 | Amun-Ra | hmm |
13:16:18 | * | andy-turner quit (Quit: Leaving) |
13:16:33 | * | andy-turner joined #nim |
14:17:58 | FromDiscord | <janakali> sent a code paste, see https://play.nim-lang.org/#pasty=NIkckRrY |
15:15:49 | FromDiscord | <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:54 | FromDiscord | <heysokam> I'm writing a `folder.glob(pattern=".c")` function↵Is there any existing tools to pattern match strings in stdlib? |
17:05:18 | FromDiscord | <heysokam> I don't want regex, just simple unix-like glob patterns |
17:08:30 | Amun-Ra | is the glob pattern hardcoded into an app? |
17:08:56 | Amun-Ra | I'd go with regex in that case |
17:09:58 | FromDiscord | <heysokam> 1000000000000000% not regex |
17:10:16 | FromDiscord | <heysokam> its exposed to the caller. I'd rather not have patterns than regex |
17:10:47 | Amun-Ra | ack |
17:10:58 | FromDiscord | <heysokam> ? |
17:11:46 | Amun-Ra | that can be a hermetic expression, ack is a tcp procotol bit meaning acknowledgement |
17:12:03 | FromDiscord | <heysokam> i mean, that'd make it worse |
17:12:24 | Amun-Ra | it mean ~ "I get it" |
17:12:27 | Amun-Ra | means* |
17:13:09 | FromDiscord | <heysokam> ah it was a joke. kk |
17:13:49 | strogon14 | on posix the C glob library is wrapped in the depths of the paths odule |
17:13:54 | Amun-Ra | as in "I've taken note of the requirements" |
17:13:58 | strogon14 | *module |
17:14:20 | Amun-Ra | I 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:54 | Amun-Ra | nimble search returns https://github.com/haltcase/glob and https://github.com/treeform/globby |
17:17:55 | FromDiscord | <heysokam> https://github.com/haltcase/glob/blob/ab6087b0cfb56096258cb48f7e756a8c3e8e40cf/src/glob.nim#L143 |
17:18:44 | Amun-Ra | it's still in spec - you don't use regex directly ;) |
17:18:53 | FromDiscord | <heysokam> globby fits better |
17:19:32 | Amun-Ra | it's by treeform after all |
17:19:43 | strogon14 | heysoka, we discussed glob a few days ago: https://play.nim-lang.org/#pasty=JZFAJKvO |
17:25:43 | FromDiscord | <heysokam> ty strogon |
17:27:10 | FromDiscord | <heysokam> I guess walkpattern might do the job 🤔 |
17:27:48 | FromDiscord | <heysokam> I need to select recursion, though. so, actually maybe not |
17:34:17 | FromDiscord | <nnsee> In reply to @heysokam "ah it was a": _ack_ is pretty much the same as "okay, got it" |
19:36:33 | FromDiscord | <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:02 | FromDiscord | <griffith1deadly> In reply to @flashjaysan "Is there some kind": top level function call |
19:54:05 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=BbUVdbEr |
20:11:39 | FromDiscord | <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:33 | FromDiscord | <fl4shk> does there exist a pre-existing FIFO, or queue data structure? I am not looking for `heapqueue` |
21:03:55 | FromDiscord | <fl4shk> searches didn't reveal anything |
21:03:57 | FromDiscord | <fl4shk> (edit) |
21:04:32 | FromDiscord | <fl4shk> I've implemented a FIFO before as FPGA code, but I don't feel like doing that again right now |
21:04:37 | FromDiscord | <pmunch> Deque? |
21:04:44 | FromDiscord | <fl4shk> oh that would likely work |
21:05:35 | FromDiscord | <pmunch> I've used it as a queue in the past 🙂 |
21:05:41 | FromDiscord | <fl4shk> that works |
21:30:59 | FromDiscord | <fl4shk> thanks |
21:36:10 | * | andy-turner quit (Quit: Leaving) |
22:05:42 | FromDiscord | <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:16 | FromDiscord | <ja.hogy.mi> there is some segfaults, some nimc crashes↵i'm testing with ./koch test |