00:01:10 | FromDiscord | <zumi.dxy> Result/Option is a form of monad right? |
00:03:17 | FromDiscord | <Robyn [She/Her]> No idea |
00:09:35 | * | xet7 quit (Ping timeout: 264 seconds) |
00:17:18 | lx12ucy | how do you guys think i should check if a given path to a directory is valid? |
00:17:32 | FromDiscord | <Elegantbeef> `createDir` |
00:17:46 | lx12ucy | wait thats actually genius |
00:17:50 | FromDiscord | <Elegantbeef> `existsOrCreateDir` |
00:17:52 | FromDiscord | <Elegantbeef> rather |
00:18:00 | lx12ucy | oh yeah |
00:18:08 | lx12ucy | well |
00:18:25 | lx12ucy | i mean i dont want to create it if it doesnt exist |
00:18:29 | lx12ucy | i just want to see if it does |
00:18:39 | FromDiscord | <Elegantbeef> Checking whether something is a valid path is a fun task |
00:20:34 | FromDiscord | <Elegantbeef> Why do you need to know that it's valid? |
00:21:10 | lx12ucy | i'm making a thing that scans a directory you give it for subdirectories |
00:21:28 | lx12ucy | and saving that directory you give it to yaml if its valid |
00:21:57 | FromDiscord | <Elegantbeef> So then why do you need to validate that it's a path, call `walkDir` inside a `try except` if it errors do not add it |
00:22:11 | lx12ucy | alright |
00:22:35 | lx12ucy | thank you |
00:22:41 | * | xet7 joined #nim |
00:26:34 | lx12ucy | how does walkDir get used? i'm trying `echo walkDir(paramStr(2))` but its giving an error |
00:26:45 | FromDiscord | <Elegantbeef> It's an iterator |
00:26:54 | FromDiscord | <Elegantbeef> so `for x in walkDir(path, checkDir = true): ...` |
00:27:03 | lx12ucy | ohhhh right |
00:27:06 | lx12ucy | thanks |
00:53:56 | * | SchweinDeBurg joined #nim |
01:32:36 | FromDiscord | <sOkam! 🫐> what was the pragma for importing everything from a module, including the private fields of objects? |
01:33:34 | FromDiscord | <sOkam! 🫐> I know about `import someModule {.all.}` but it doesn't seem to import private fields, and I think I recall that functionality being done in a different way 🤔 |
01:36:06 | FromDiscord | <kots> https://nim-lang.github.io/Nim/importutils.html#privateAccess%2Ctypedesc |
01:36:08 | FromDiscord | <kots> Probably this |
01:36:26 | FromDiscord | <sOkam! 🫐> yep, that was it! ty ty |
02:09:33 | * | SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev) |
02:23:42 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=IQosNsIw |
02:24:33 | FromDiscord | <sOkam! 🫐> (edit) "https://play.nim-lang.org/#pasty=CSSWiJUr" => "https://play.nim-lang.org/#pasty=cbTPBolm" |
02:25:17 | FromDiscord | <sOkam! 🫐> (edit) "https://play.nim-lang.org/#pasty=vcagmRwd" => "https://play.nim-lang.org/#pasty=jRDirHOF" |
02:40:05 | FromDiscord | <Elegantbeef> `instantiationInfo(fullPaths = true).fileName.parentDir()`? |
02:51:01 | FromDiscord | <sOkam! 🫐> tyty |
03:53:08 | * | SchweinDeBurg joined #nim |
04:35:06 | FromDiscord | <basilajith> How do I insert a NULL value in an insert statement for db_postgres? |
04:54:29 | * | rockcavera quit (Remote host closed the connection) |
05:54:34 | FromDiscord | <albassort> what is the proc to convert a byte to bits? |
05:54:58 | FromDiscord | <albassort> I know theres procedures to operate on it but i need to see it so i can know how to operate on it |
05:57:49 | * | PMunch joined #nim |
06:04:23 | Amun-Ra | what do you mean, byte to bits? |
06:04:44 | Amun-Ra | as in, iterate an octet in a series of bits? |
06:05:02 | Amun-Ra | in→as? |
06:09:09 | FromDiscord | <leorize> a byte is already bits? |
06:15:07 | FromDiscord | <_nenc> sent a code paste, see https://play.nim-lang.org/#pasty=EAhUpbuC |
06:19:33 | FromDiscord | <albassort> In reply to @Amun-Ra "what do you mean,": See this is the problem, it's that there's no type to represent bits so actually creating a bit array and representing it is not possible |
06:19:42 | FromDiscord | <albassort> You need a sequence of infs |
06:19:48 | FromDiscord | <albassort> (edit) "infs" => "ints" |
06:20:00 | FromDiscord | <albassort> I mean I wanted a bit array that I can look at |
06:20:32 | FromDiscord | <leorize> does std/bitops not do it for you? |
06:20:37 | FromDiscord | <albassort> (edit) "ints" => "bools" |
06:20:44 | FromDiscord | <albassort> Well I read through it and it doesn't look like it has any output like that |
06:20:54 | FromDiscord | <albassort> You would need to do what nenc said |
06:21:24 | FromDiscord | <leorize> why would you want a bit array? |
06:21:38 | FromDiscord | <albassort> So I can look at the data of a bit field for debugging |
06:21:49 | FromDiscord | <leorize> `strutils.toBin` is a simple one to use |
06:21:56 | FromDiscord | <leorize> no cruft from array syntax |
06:22:02 | FromDiscord | <albassort> Oh yes that's right |
06:22:05 | FromDiscord | <leorize> just pure 1 and 0s |
06:22:06 | FromDiscord | <albassort> I forgot about that procedure |
06:22:27 | FromDiscord | <albassort> Lol |
06:22:51 | FromDiscord | <albassort> I feel like it should be in bitops in some form though |
06:22:56 | FromDiscord | <albassort> Perhaps used in an example |
06:24:46 | FromDiscord | <albassort> It's weird how the brains work, I was fixated on one task but if you asked me "how can I create a bit string from an integer" I would be like oh yeah there's a procedure in strutils |
06:25:47 | FromDiscord | <albassort> (edit) "brains" => "brain" | "brainwork, I was fixated on ... onespecific" added "doing something in" | "task" => "specific way," | "strutils" => "strutils." |
06:26:01 | FromDiscord | <albassort> I guess this is why rubber duck debugging works so well. |
06:26:10 | FromDiscord | <albassort> Anyway, thank you. |
06:26:36 | FromDiscord | <albassort> (edit) "work," => "works," |
06:26:51 | * | disso_pch quit (Quit: Leaving) |
06:41:29 | * | ntat joined #nim |
07:05:10 | * | redj joined #nim |
07:07:49 | PMunch | Hmm, where is the Nimble path on Windows? |
07:19:14 | FromDiscord | <Elegantbeef> `%USERDATA%/.nimble` iirc |
07:41:37 | * | lx12ucy quit (Quit: WeeChat 4.3.2) |
07:46:53 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=skRhbcQN |
07:46:58 | FromDiscord | <albassort> whats up with this |
07:47:19 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=wYkEinCj |
07:47:50 | FromDiscord | <albassort> the first 4 are ↵1100 ↵but the value is ↵0010 |
07:48:25 | FromDiscord | <leorize> it depends on the definition of significance by bitops |
07:48:44 | FromDiscord | <ieltan> I have a dream |
07:48:44 | FromDiscord | <albassort> (edit) "first 4 are ↵1100 ↵but" => "output is ↵11000100↵but" | "↵0010" => "↵00100100" |
07:48:51 | FromDiscord | <leorize> bitops define the greater number means higher significance |
07:48:59 | FromDiscord | <albassort> (edit) "↵00100100" => "↵00100011" |
07:49:04 | FromDiscord | <albassort> its backwards |
07:49:06 | FromDiscord | <albassort> yeo |
07:49:07 | FromDiscord | <albassort> (edit) "yeo" => "yep" |
07:49:18 | FromDiscord | <leorize> it's not backwards |
07:49:32 | FromDiscord | <leorize> not to the computer, that is |
07:49:41 | FromDiscord | <albassort> well, i meant the output from what i defined |
07:50:00 | FromDiscord | <albassort> i only saw it when i wrote it out here |
07:50:05 | FromDiscord | <leorize> the good ol' human numbers vs computer numbers |
07:50:17 | FromDiscord | <albassort> In reply to @leorize "the good ol' human": is this platform dependent? |
07:50:21 | FromDiscord | <leorize> nope |
07:50:28 | FromDiscord | <ieltan> Memory regions in Nim that are easy to use and you can choose whether you allocate on the heap/stack. And they work with builtins types too |
07:50:39 | FromDiscord | <leorize> I mean, it will be if you use larger int size |
07:50:46 | FromDiscord | <leorize> but for that int size it's the same everywhere |
07:50:49 | FromDiscord | <albassort> yeah but thats endian |
07:51:01 | FromDiscord | <albassort> why do we write the bits backwards to compared to the computer? |
07:51:15 | FromDiscord | <albassort> (edit) removed "to" |
07:51:49 | FromDiscord | <leorize> backwards is just a mental construct |
07:52:41 | FromDiscord | <ieltan> It's a shame `mm:regions` didn't pan out but maybe it's possible to turn it into a nimble package... |
07:53:20 | FromDiscord | <albassort> i understand, but, why is it that, I write the message as 0b0010_0011 but the computer preforms operations in the other direction |
07:53:24 | FromDiscord | <ieltan> But it won't work with builtins types unless ungodly amounts of hacks are done |
07:53:40 | FromDiscord | <albassort> why not have us humans write it the other way |
07:54:46 | FromDiscord | <leorize> I mean, you have the decimal `142` |
07:55:03 | FromDiscord | <leorize> `1` is larger than `4` here because `1` meant `100` but `4` meant `40` |
07:55:23 | FromDiscord | <leorize> this is just how humans interpret numbers since forever |
07:55:57 | FromDiscord | <leorize> it might be easier to imagine wrt `testBit` if you think of it as testing `2^n` |
08:02:45 | FromDiscord | <albassort> so basically: computers bad |
08:05:31 | FromDiscord | <basilajith> sent a code paste, see https://play.nim-lang.org/#pasty=UFmnlNFA |
08:05:58 | FromDiscord | <ieltan> looks like `mm:region` is implemented as a stack which is neat but then I thought about how `realloc` would work then... |
08:07:04 | FromDiscord | <albassort> In reply to @basilajith "Is there an elegant/simpler": well using strformat may make it look somewhat better |
08:07:16 | FromDiscord | <albassort> the next thing i would do is declare them to individual variables so you know how they make up the output |
08:07:34 | FromDiscord | <albassort> (edit) "the next thing i would do is declare them to individual variables so you know how they make up the output ... " added "more intuitively" |
08:07:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=YDOKNYjJ |
08:08:10 | FromDiscord | <Elegantbeef> What does that mean?↵(@ieltan) |
08:08:22 | FromDiscord | <albassort> that works too but but i think using strscans should be a last resort and this isn't an actual use for it |
08:08:22 | FromDiscord | <Elegantbeef> Bump the stack and return the old block to the pool |
08:08:38 | FromDiscord | <Elegantbeef> Strscans should be a first resort 😛 |
08:08:49 | FromDiscord | <Elegantbeef> I pity the fool that uses `split` |
08:09:09 | FromDiscord | <basilajith> Well, I am reading values from a large XLSX spreadsheet. |
08:09:26 | FromDiscord | <albassort> ok so yeah, strscans will work because its unreadable anyway |
08:09:43 | FromDiscord | <albassort> it will also likely be faster |
08:09:53 | FromDiscord | <basilajith> In reply to @albassort "ok so yeah, strscans": ? |
08:10:22 | FromDiscord | <albassort> sorry i misunderstood |
08:10:28 | FromDiscord | <albassort> yeah don't listen to beef |
08:10:34 | FromDiscord | <albassort> hes joking anyway i think |
08:10:41 | FromDiscord | <Elegantbeef> Not really |
08:11:03 | FromDiscord | <Elegantbeef> If you can use strscans use it over manually splitting strings |
08:12:02 | FromDiscord | <albassort> most languages have a split function, no other language to my knowledge uses the strscans syntax |
08:12:07 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=PvYinxkn |
08:12:18 | FromDiscord | <Elegantbeef> Cool we're using Nim |
08:12:24 | FromDiscord | <Elegantbeef> So why would we not use the tools that are here |
08:12:39 | FromDiscord | <basilajith> Yeah, looking through `strscans`. |
08:12:50 | FromDiscord | <Elegantbeef> Depending what you're parsing strscans is king imo |
08:12:51 | FromDiscord | <albassort> ok but the penalty is readability, and less intuitive code |
08:13:08 | FromDiscord | <albassort> and the data is already split here |
08:13:18 | FromDiscord | <albassort> because its CSV parsing |
08:13:24 | FromDiscord | <basilajith> I just want to keep it as readable as possible for some future dev in my org. |
08:13:24 | FromDiscord | <albassort> (edit) "because its ... CSV" added "already pased" |
08:13:26 | FromDiscord | <albassort> (edit) removed "parsing" |
08:13:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=TfNSBKzV |
08:13:53 | FromDiscord | <Elegantbeef> `names.len == 3`\ |
08:14:28 | FromDiscord | <albassort> In reply to @basilajith "Is there an elegant/simpler": 1. yes. 2. they don't use split here, i presume they already used a csv parser |
08:14:36 | FromDiscord | <Elegantbeef> If you read their message `fullName` is implied to be a single string |
08:14:48 | FromDiscord | <Elegantbeef> > fullName = # string value of unknown length and all CAPS with first name, middle name, and last name (in that order) e.g. "CLARK JOSEPH KENT" |
08:15:14 | FromDiscord | <albassort> it could look like this ↵CLARK, JOSEPH, KENT |
08:15:18 | FromDiscord | <albassort> in the CSV |
08:15:33 | FromDiscord | <Elegantbeef> Right but that's not what it says in their message |
08:15:44 | FromDiscord | <Elegantbeef> `fullName` is said to be a string |
08:15:51 | FromDiscord | <Elegantbeef> So if you're parsing a string, use strscans |
08:15:55 | FromDiscord | <albassort> yeah and that string could be fullname = csv[0] |
08:15:58 | FromDiscord | <Elegantbeef> If you have CSV data why are we slicing |
08:16:07 | FromDiscord | <Elegantbeef> That's not a fullname then |
08:16:10 | FromDiscord | <albassort> fullname[0] = first |
08:16:14 | FromDiscord | <albassort> (edit) "=" => "is" |
08:16:31 | FromDiscord | <Elegantbeef> Hey I read their message and it's ambiguous the type, we should force all messages to pass type checking! |
08:16:46 | FromDiscord | <Elegantbeef> Write a procedure to capitalize then use that if that's what the concern is |
08:16:58 | FromDiscord | <Elegantbeef> If parsing a fixed format string is the concern used strscans |
08:17:13 | FromDiscord | <Elegantbeef> If anything else is concerning use a hand written parser |
08:17:41 | FromDiscord | <ieltan> In reply to @Elegantbeef "What does that mean?": I mean what if I have a `string` and I exceed it's capacity but the memory lives deeps in the memory region stack? |
08:18:18 | FromDiscord | <ieltan> Fwiw I didnt have a formal CS education so these are kinda new things to me |
08:18:51 | FromDiscord | <Elegantbeef> 😛 |
08:19:00 | FromDiscord | <ieltan> In reply to @Elegantbeef "Bump the stack and": At the risk of sounding idiotic, I don't know what "bump the stack" means |
08:19:40 | FromDiscord | <Elegantbeef> The region based allocator does not use the stack it uses a stack |
08:19:45 | FromDiscord | <ieltan> I do know usually the stack doesn't need such a thing as realloc because everything is fixed size |
08:20:13 | FromDiscord | <Elegantbeef> You can have a free list of blocks that you can return when allocating a new value |
08:20:43 | FromDiscord | <Elegantbeef> Yea you're conflating the idea of stack memory with the stack data type |
08:20:52 | FromDiscord | <Elegantbeef> Stack memory is a form of the stack data type |
08:21:05 | FromDiscord | <Elegantbeef> It's a first in last out queue |
08:21:06 | FromDiscord | <ieltan> In reply to @Elegantbeef "The region based allocator": Oh ok lol but I'm still confused |
08:22:07 | FromDiscord | <Elegantbeef> So when you go "Alloc 8 bytes" you move the region pointer up 8, when you then go "Reallocate these 8 bytes to a 32byte block" you return the 8 byte block to a pool, then allocate the 32byte block moving the region pointer up 32 |
08:22:14 | FromDiscord | <leorize> you might want to look into bump allocators |
08:22:29 | FromDiscord | <leorize> there are extensive information out there about this stuff |
08:22:45 | FromDiscord | <Elegantbeef> Do bump allocators generally have any reuse? |
08:23:02 | FromDiscord | <Elegantbeef> Seems like an easy win to have a priority sorted list based off size |
08:24:10 | FromDiscord | <basilajith> In reply to @Elegantbeef "Right but that's not": Yeah, it's a single string within a cell in a row in the Excel sheet. |
08:24:31 | FromDiscord | <Elegantbeef> A single space seperated string? |
08:24:45 | FromDiscord | <Elegantbeef> Always having 3 names? 😄 |
08:25:36 | FromDiscord | <Elegantbeef> It is perfectly fine to just to do what I did above with a `str.toOpenArray(rune.size, str.find(' '))` 😄 |
08:25:44 | FromDiscord | <Elegantbeef> Super easy peasy |
08:26:08 | FromDiscord | <Elegantbeef> Also leo I looked into swift and the sdl2 bindings are lack lusuter it seems |
08:26:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=bneggvhq |
08:27:18 | FromDiscord | <Elegantbeef> > OpenGL can load any OpenGL function up to OpenGL 4.5. |
08:27:24 | FromDiscord | <Elegantbeef> They're really just out to piss me off! |
08:28:08 | FromDiscord | <Elegantbeef> Do wonder if swift has a futharky thing of it's own |
08:28:22 | FromDiscord | <basilajith> In reply to @Elegantbeef "Always having 3 names?": Sadly, no. |
08:28:36 | FromDiscord | <Elegantbeef> Well then yea skip strscans as it'd be messy |
08:28:44 | FromDiscord | <Elegantbeef> Do a simple `find` and slice |
08:56:24 | * | ntat quit (Quit: Leaving) |
09:02:33 | * | coldfeet joined #nim |
09:04:15 | FromDiscord | <nocturn9x> is there any reliable way to track when and how allocations are being made in nim? |
09:04:42 | FromDiscord | <nocturn9x> I am 99% certain I am doing something stupid and inadvertently copying an object a gazillion times |
09:04:55 | * | coldfeet quit (Remote host closed the connection) |
09:05:01 | FromDiscord | <nocturn9x> because way too much time is spent into libc calls, most likely malloc/free |
09:05:21 | PMunch | Definitely not malloc free though since Nim uses mmap munmap |
09:05:26 | FromDiscord | <nocturn9x> Nim _will_ pass large objects by ref internally if they're too big right? |
09:05:32 | FromDiscord | <nocturn9x> In reply to @PMunch "Definitely not malloc free": same thing |
09:05:34 | PMunch | You could try to run with malloc enabled and a memory profiler |
09:05:37 | FromDiscord | <nocturn9x> memory stuff |
09:05:46 | FromDiscord | <nocturn9x> I already use -d:useMalloc |
09:05:53 | FromDiscord | <nocturn9x> because nim's default allocator is shit with threads |
09:05:55 | FromDiscord | <nocturn9x> and I use mimalloc |
09:05:59 | FromDiscord | <nocturn9x> for a nice performance bump |
09:07:16 | PMunch | Uhm, so you rip out Nims allocator, then enables malloc and plugs in another allocator instead? |
09:07:43 | PMunch | Interesting approach |
09:07:54 | PMunch | But try to disable mimalloc and use a memory analyzer |
09:08:12 | PMunch | That should tell you about copying |
09:11:27 | FromDiscord | <nocturn9x> oke |
09:11:32 | FromDiscord | <nocturn9x> In reply to @PMunch "Uhm, so you rip": yeah |
09:11:35 | FromDiscord | <nocturn9x> I statically link it in |
09:12:09 | FromDiscord | <nocturn9x> `perf mem` should do the trick |
09:31:11 | * | coldfeet joined #nim |
09:53:23 | * | coldfeet quit (Remote host closed the connection) |
10:26:12 | * | xtr00 joined #nim |
10:43:36 | * | m5zs7k quit (Ping timeout: 268 seconds) |
10:44:44 | * | m5zs7k joined #nim |
11:04:56 | FromDiscord | <nocturn9x> nope |
11:05:00 | FromDiscord | <nocturn9x> doesn't work on AMD |
11:05:05 | FromDiscord | <nocturn9x> what memory profilers could I try? |
11:07:21 | PMunch | Not sure. Another option would be to use `--wrap` and have every `malloc`call print something out to a file |
11:31:45 | * | redj_ joined #nim |
11:33:52 | FromDiscord | <frusadev> Hello, is there anything like flutter in nim? |
11:36:41 | * | redj quit (*.net *.split) |
11:36:44 | * | nisstyre quit (*.net *.split) |
11:36:45 | * | ormiret quit (*.net *.split) |
11:43:20 | FromDiscord | <albassort> flutter is developed by a trillion dollar company |
11:43:40 | FromDiscord | <albassort> So no, nothing quite as intuitive |
11:44:25 | * | nisstyre joined #nim |
11:44:25 | * | ormiret joined #nim |
11:44:42 | FromDiscord | <albassort> interacting with it might not be impossible, though. But I don't know enough to help beyond that. |
11:45:30 | FromDiscord | <albassort> dart as C ffi |
11:45:35 | FromDiscord | <albassort> :) |
11:47:10 | Amun-Ra | albassort: looks like you need some kind of bit stream |
11:47:25 | FromDiscord | <albassort> is that message delayed? |
11:47:47 | Amun-Ra | nope, I lurk here from time to time |
11:48:35 | FromDiscord | <albassort> Well, no. I was just confused on how bitTest worked. |
11:48:46 | FromDiscord | <albassort> everything is working now |
11:48:49 | Amun-Ra | ah |
11:56:32 | FromDiscord | <nocturn9x> can anyone explain to me |
11:56:41 | FromDiscord | <nocturn9x> why a subtraction is being compiled to _46_ assembly instructions? https://media.discordapp.net/attachments/371759389889003532/1252592825246158859/image.png?ex=6672c779&is=667175f9&hm=8d84f82c81b8f5ae69053fdbb3d756ab3c4d67edd03ffac60d2e28fdf0c632be& |
11:58:12 | Amun-Ra | is that a release build? |
11:58:44 | Amun-Ra | it that's signed subtraction and -d=danger is not set there always be some checks |
11:58:44 | FromDiscord | <nocturn9x> it's a danger build with `--debugger:native` |
11:59:02 | FromDiscord | <nocturn9x> `Score` is a `distinct int32` |
11:59:08 | FromDiscord | <nocturn9x> which is the value being subtracted there |
11:59:18 | FromDiscord | <nocturn9x> In reply to @Amun-Ra "it that's signed subtraction": okay but _forty-six_ instructions? |
12:00:26 | Amun-Ra | https://godbolt.org/z/9M6K9a8sb |
12:00:30 | FromDiscord | <nnsee> In reply to @nocturn9x "why a subtraction is": looks like it's doing SIMD |
12:00:50 | FromDiscord | <nocturn9x> the question is why is it taking 0.77 seconds of execution time |
12:00:55 | FromDiscord | <nocturn9x> isn't SIMD supposed to be _faster_ |
12:02:06 | FromDiscord | <nocturn9x> In reply to @Amun-Ra "https://godbolt.org/z/9M6K9a8sb": ok so that's correct, just `sub` |
12:02:44 | FromDiscord | <odexine> to note this is with -d:danger |
12:02:51 | FromDiscord | <odexine> without -g |
12:02:58 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=xoIOMNRk |
12:03:05 | FromDiscord | <nocturn9x> this is my nim.cfg |
12:03:16 | FromDiscord | <nocturn9x> In reply to @odexine "without -g": that's supposed to add debugging symbols |
12:03:19 | FromDiscord | <odexine> iirc there was an issue with defines in nim.cfg? |
12:03:30 | FromDiscord | <nocturn9x> it does work |
12:03:34 | FromDiscord | <nocturn9x> if I change it stuff changes |
12:03:36 | FromDiscord | <nocturn9x> so it works |
12:03:49 | FromDiscord | <odexine> perhaps it no longer applies |
12:04:00 | FromDiscord | <nocturn9x> the issue is why is nim compiling `a - b` t |
12:04:05 | FromDiscord | <nocturn9x> (edit) "t" => "to a gazillion instructions" |
12:04:07 | FromDiscord | <nocturn9x> or rather, clang |
12:05:14 | Amun-Ra | event non-exportc one behaves the same https://godbolt.org/z/abeh87653 |
12:05:57 | FromDiscord | <nocturn9x> I tried this as well |
12:06:00 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=kOZMCtlL |
12:06:02 | FromDiscord | <nocturn9x> same behavior |
12:06:20 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#pasty=AiPCAVCH |
12:06:54 | Amun-Ra | what's .eg? |
12:06:56 | FromDiscord | <nocturn9x> ah nevermind |
12:06:59 | FromDiscord | <nocturn9x> `Score` is justr int32 |
12:07:01 | FromDiscord | <nocturn9x> (edit) "justr" => "just" |
12:07:29 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=HRGSCnqv |
12:07:33 | FromDiscord | <nocturn9x> (edit) "https://play.nim-lang.org/#pasty=yGbtuTUJ" => "https://play.nim-lang.org/#pasty=NikuyzTn" |
12:07:33 | FromDiscord | <nnsee> works here https://godbolt.org/z/6afbv7eno |
12:07:40 | FromDiscord | <nocturn9x> these are the arrays |
12:07:43 | FromDiscord | <nnsee> it doesn't have clang in the nim machines though |
12:07:47 | FromDiscord | <nnsee> so this is gcc |
12:07:49 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=bZEakMcK |
12:08:05 | FromDiscord | <nocturn9x> the curiois thing is that it only seems to happen with `endGameScores` |
12:08:13 | FromDiscord | <nocturn9x> I don't have the same execution time on `middleGameScores` |
12:08:33 | FromDiscord | <nocturn9x> and it's not the only lines of this array that's problematic, a similar `x[i] += [...]` has the same execution time |
12:08:39 | FromDiscord | <nocturn9x> which is ~0.83 seconds |
12:08:45 | FromDiscord | <nocturn9x> (edit) "curiois" => "curious" |
12:08:47 | Amun-Ra | perhaps these instructions apply to operations on the whole table? |
12:08:58 | * | ntat joined #nim |
12:09:02 | FromDiscord | <nocturn9x> why would the compiler pick that if it's slower |
12:09:11 | FromDiscord | <nocturn9x> and why would it not do the same for the other array |
12:09:26 | Amun-Ra | search me… |
12:11:14 | FromDiscord | <ringabout> Did you try other allocator or `--threads:off`? |
12:11:18 | FromDiscord | <ringabout> (edit) "allocator" => "allocators" |
12:12:01 | FromDiscord | <nocturn9x> uhm |
12:12:06 | FromDiscord | <nocturn9x> I can't turn off threads lmao |
12:12:08 | FromDiscord | <nocturn9x> I use them |
12:12:18 | FromDiscord | <nocturn9x> I _am_ using other allocators |
12:12:25 | FromDiscord | <nocturn9x> because nim's own allocator is garbage and malloc is slow as fuck |
12:14:34 | Amun-Ra | isn't mmap the default? |
12:15:40 | * | nisstyre quit (*.net *.split) |
12:15:41 | * | ormiret quit (*.net *.split) |
12:15:46 | FromDiscord | <nocturn9x> -d:useMalloc... |
12:16:29 | Amun-Ra | a) -d=usemalloc b) complain malloc is slow - pick one ;)( |
12:16:41 | FromDiscord | <nocturn9x> if the default allocator wasn't trash I would us that |
12:16:48 | FromDiscord | <odexine> usemalloc to swap it to mimalloc |
12:16:50 | FromDiscord | <nocturn9x> I'm passing -d:useMalloc and then linking mimalloc |
12:16:55 | FromDiscord | <nocturn9x> folks |
12:16:57 | Amun-Ra | I see |
12:16:58 | FromDiscord | <nocturn9x> I'm already doing that |
12:17:00 | FromDiscord | <nocturn9x> I said that like 10 times |
12:17:02 | FromDiscord | <nocturn9x> lol |
12:17:12 | * | nisstyre joined #nim |
12:17:13 | * | ormiret joined #nim |
12:17:18 | FromDiscord | <odexine> im pointing it out |
12:17:20 | Amun-Ra | reading backlog? ain't nobody got time for that |
12:17:28 | FromDiscord | <odexine> reading? i can barely |
12:17:29 | FromDiscord | <ringabout> What about C code? |
12:17:45 | FromDiscord | <ringabout> Maybe it's just clang |
12:17:46 | FromDiscord | <nocturn9x> good luck with that |
12:17:51 | FromDiscord | <nocturn9x> the C code is unreadable |
12:17:57 | FromDiscord | <nocturn9x> In reply to @ringabout "Maybe it's just clang": gcc is like 2x slower |
12:18:02 | FromDiscord | <nocturn9x> so I would like to keep clang |
12:19:09 | FromDiscord | <nocturn9x> some things just make no sense in this profiler output |
12:19:15 | FromDiscord | <nocturn9x> some variable assignments take 0.24 seconds |
12:19:19 | FromDiscord | <nocturn9x> (of course that's total time) |
12:19:35 | FromDiscord | <nocturn9x> but still, that's literally just `let sideToMove = position.sideToMove` |
12:20:05 | Amun-Ra | I wanted to play with amduprof, but it fails to install because its kernel module is not signed |
12:20:18 | FromDiscord | <nocturn9x> I downloaded it from AMD's website |
12:20:22 | FromDiscord | <nocturn9x> the version in AUR is borked |
12:20:29 | Amun-Ra | same |
12:21:21 | FromDiscord | <ringabout> Well, you can focus on the single function in the c code. Like you can wrapper the `+=` into a function with the name like `fxxx` or something and search it from nimcache. That's how I debug the Nim code |
12:21:34 | FromDiscord | <nocturn9x> `endGameScores[piece.color] += ENDGAME_VALUE_TABLES[piece.color][piece.kind][sq]` |
12:21:40 | FromDiscord | <nocturn9x> this single line is being compiled to over 30 instructions |
12:21:46 | FromDiscord | <nocturn9x> and takes 0.75 seconds of total execution time |
12:21:49 | FromDiscord | <nocturn9x> that is nonsense |
12:22:00 | FromDiscord | <nocturn9x> it's 3 loads and a store lol |
12:22:15 | FromDiscord | <nocturn9x> and an addition |
12:22:52 | FromDiscord | <ringabout> Yeah, we need to know whether Nim generate inefficient C code or Clang generate inefficient instructions |
12:22:59 | FromDiscord | <nocturn9x> the fuck is this compiler doing |
12:23:00 | FromDiscord | <ringabout> (edit) "generate" => "generates" | "generate" => "generates" |
12:23:44 | FromDiscord | <nocturn9x> also for some reason gcc generates shit code |
12:23:46 | FromDiscord | <nocturn9x> way slower |
12:25:46 | FromDiscord | <sOkam! 🫐> how would you UnitTest the shape of a `type T = object`? 🤔 |
12:26:10 | FromDiscord | <nocturn9x> if anyone has the time or expertise |
12:26:17 | FromDiscord | <nocturn9x> https://git.nocturn9x.space/nocturn9x/heimdall/src/branch/master/heimdall/heimdallpkg/eval.nim#L427 |
12:26:21 | FromDiscord | <nocturn9x> this is one of the affected lines |
12:26:35 | FromDiscord | <nocturn9x> the other one being https://git.nocturn9x.space/nocturn9x/heimdall/src/branch/master/heimdall/heimdallpkg/eval.nim#L232 |
12:26:59 | FromDiscord | <nocturn9x> does the compiler hate that array or something? |
12:27:07 | FromDiscord | <nocturn9x> all stuff being done on it is slower than the other one |
12:31:57 | FromDiscord | <nocturn9x> `tyArray4Xw5nlWCQQmIGQycE1eMGw endGameScores; ` |
12:32:00 | FromDiscord | <nocturn9x> there, this is the array |
12:33:10 | FromDiscord | <nocturn9x> my god why is the code generated by nim so fucking garbage |
12:33:18 | FromDiscord | <nocturn9x> there's lines longer than the declaration of independence |
12:33:35 | FromDiscord | <nocturn9x> I understand it's not supposed to be human readable, but this seems purposelly designed to be as unreadable as possible |
12:33:42 | FromDiscord | <nocturn9x> it's one step away from being minified |
12:34:13 | FromDiscord | <zumi.dxy> meanwhile V's codegen is supposed to be "readable" but man that one still looks like multiple files `cat`ted together |
12:34:25 | FromDiscord | <zumi.dxy> last i tried, anyway |
12:34:54 | FromDiscord | <ringabout> In reply to @nocturn9x "I understand it's not": You can also use `--expandArc:evaluate` to check whether it generates lots of temps |
12:35:19 | FromDiscord | <zumi.dxy> I just use `clang-format` to ease the pain |
12:35:25 | FromDiscord | <nocturn9x> I also see a lot of `nimZeroMem` and `NimCopyMem` |
12:35:33 | FromDiscord | <nocturn9x> which should probably not be there but oh wll |
12:35:34 | FromDiscord | <nocturn9x> (edit) "wll" => "well" |
12:35:35 | FromDiscord | <ringabout> It might copy when you access arrays or seqs |
12:36:21 | FromDiscord | <nocturn9x> why would it do that |
12:36:39 | FromDiscord | <ringabout> If they are value types, they are copied |
12:38:14 | FromDiscord | <nocturn9x> they are int32 lol |
12:38:18 | FromDiscord | <nocturn9x> wtf is there to copy with copyMem |
12:38:25 | FromDiscord | <nocturn9x> they ain't pointers |
12:38:49 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=yefeYKQz |
12:38:51 | Amun-Ra | so, something else is being copies |
12:38:53 | FromDiscord | <nocturn9x> seems like it's just initializing it |
12:38:53 | Amun-Ra | d* |
12:39:14 | FromDiscord | <nocturn9x> this is what the subtraction compiles into |
12:39:18 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=siNIgSxv |
12:39:27 | FromDiscord | <nocturn9x> so it ain't nim that's the problem |
12:40:33 | Amun-Ra | I wonder what that asm would look like if you opt for size |
12:40:46 | FromDiscord | <ringabout> Where is `endGameScores`? |
12:42:43 | FromDiscord | <nocturn9x> `--opt:size`? |
12:42:51 | FromDiscord | <nocturn9x> won't that clash with `-d:danger`? |
12:43:13 | * | rockcavera joined #nim |
12:43:30 | FromDiscord | <odexine> not really? |
12:44:21 | FromDiscord | <nocturn9x> `--opt:size` makes the code so much slower |
12:45:14 | FromDiscord | <nocturn9x> makes sense |
12:46:32 | FromDiscord | <nocturn9x> https://paste.nocturn9x.space/lHlmQ0_hZbfqWSYlJf-XD |
12:46:40 | FromDiscord | <nocturn9x> this is the relevant `--expandArc:evaluate` bit |
12:47:53 | FromDiscord | <nocturn9x> `color_1 = chckRange(res, White, None)` |
12:47:56 | FromDiscord | <nocturn9x> this is kinda concerning |
12:48:04 | FromDiscord | <nocturn9x> is this supposed to be there with `-d:danger`? |
12:52:10 | FromDiscord | <ringabout> `chckRange` is handled in backends. It won't generate check if danger is enabled. It still shows in IR |
12:52:37 | FromDiscord | <nocturn9x> ok |
12:52:59 | FromDiscord | <nocturn9x> ugh, trying to figure out the performance issues of this engine has been such a pain in the ass |
12:53:11 | FromDiscord | <nocturn9x> I never know when nim is sneakily copying something behind my back |
12:57:13 | FromDiscord | <asbjorn2> In reply to @ieltan "A2, welcome to pain.": thanks for this advice. I finally managed to get the last of my parallelism/memory bugs fixed, mostly thanks to `SharedPtr` |
12:57:51 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=ZRNpuHjN |
12:57:56 | FromDiscord | <nocturn9x> this is an array of `NI32`s |
12:57:56 | FromDiscord | <asbjorn2> ..or at least I hope that was the last of my shared memory bugs 🙏 |
12:57:59 | FromDiscord | <nocturn9x> why tf is it making a cast |
12:58:07 | FromDiscord | <nocturn9x> In reply to @asbjorn2 "..or at least I": spoiler: no |
12:58:18 | FromDiscord | <nocturn9x> I've done my fair share of nim parallel stuff and it's truly garbage |
12:58:50 | FromDiscord | <asbjorn2> I'll try to manage my expectations 🤣 |
13:07:38 | FromDiscord | <ieltan> In reply to @asbjorn2 "thanks for this advice.": Use sanitizers to make sure you've really fixed all of them |
13:07:42 | FromDiscord | <ieltan> And np |
13:08:09 | FromDiscord | <asbjorn2> what sanitizers? do you have a tool to recommend? |
13:08:19 | * | ntat quit (Remote host closed the connection) |
13:08:26 | FromDiscord | <ieltan> In reply to @nocturn9x "I've done my fair": Well, when you're at rock bottom you can only go up, something like that |
13:08:37 | * | ntat joined #nim |
13:10:11 | FromDiscord | <ieltan> In reply to @asbjorn2 "what sanitizers? do you": They're tools that can detect memory and thread safety issues in your program, they're mandatory if you want to make sure you have no bugs. You simply cannot make a serious project without them. |
13:10:27 | FromDiscord | <nocturn9x> In reply to @ieltan "Well, when you're at": lol |
13:10:54 | FromDiscord | <nocturn9x> also |
13:11:10 | FromDiscord | <nocturn9x> I don't get the same timings when I compile without `-g` and `--debugger:native` |
13:11:59 | FromDiscord | <nocturn9x> not even by a long shot |
13:12:00 | FromDiscord | <asbjorn2> In reply to @ieltan "They're tools that can": does valgrind/helgrind work well with nim? is this the kind of tool you're referring to? |
13:12:24 | FromDiscord | <nocturn9x> In reply to @nocturn9x "I don't get the": thanks nim! |
13:12:29 | FromDiscord | <nocturn9x> very useful to debug |
13:16:32 | PMunch | @asbjorn2, I've used valgrind and helgrind to profile Nim code, works a treat |
13:16:41 | FromDiscord | <ieltan> you can use it too that works |
13:16:48 | FromDiscord | <ieltan> i was referring to asan/tsan more specifically |
13:17:10 | FromDiscord | <ieltan> just remember to compile with `-d:useMalloc` |
13:17:35 | FromDiscord | <ieltan> and `--debugger:native` i guess |
13:38:07 | * | rockcavera quit (Remote host closed the connection) |
13:39:19 | FromDiscord | <imagio> sent a long message, see https://pasty.ee/dpPjgkKf |
13:39:24 | FromDiscord | <imagio> sent a code paste, see https://play.nim-lang.org/#pasty=ZtcxSHOL |
13:41:53 | FromDiscord | <imagio> ...also I probably should have posted this in the forum instead of here since it's a bit long |
13:46:35 | FromDiscord | <zumi.dxy> Effect tags? https://nim-lang.org/docs/manual.html#effect-system |
13:49:45 | FromDiscord | <imagio> Effect-ts is entirely different than nim's "Effect" system AFAICT. They just happen to use the same name. |
13:52:39 | FromDiscord | <ieltan> Well I don't know what would be the equivalent of the `R` type in Nim |
13:53:41 | FromDiscord | <ieltan> that sounds like Nim's `{.raises: [CatchableError].}` https://media.discordapp.net/attachments/371759389889003532/1252622266827673610/image.png?ex=6672e2e5&is=66719165&hm=d0b2164ce632059e09b866dbb3a38544dc7f00b88a1c7cdcd73de6f9633cb7e5& |
13:54:58 | FromDiscord | <ieltan> Nim can track errors using the type system too but you still have to use `try-except` |
13:55:43 | FromDiscord | <Robyn [She/Her]> Could always use https://github.com/arnetheduck/nim-results with a custom return type |
13:56:13 | FromDiscord | <imagio> I'm really more curious about how one would model a type with 3 generic parameters and then write combinators that manipulate those generics. Like how `flatMap` is `<A,E,R>(self: Effect<A,E,R>, fn: <B,E1,R1>(v: A) => Effect<B, E1, R1>) => Effect<B, E | E1, R | R1>` |
13:57:48 | FromDiscord | <ieltan> https://github.com/arnetheduck/nim-results is a good example on how you can achieve that especially the `map` / `flatMap` functions |
13:57:57 | FromDiscord | <ieltan> nice one robyn |
13:58:46 | FromDiscord | <imagio> In reply to @chronos.vitaqua "Could always use https://github.com/arnetheduck/nim": Ah cool, thanks for the link, I'll check that one out |
13:59:30 | FromDiscord | <ieltan> im not sure you can return a `Result[T, E | E2]` though |
13:59:47 | FromDiscord | <ieltan> Nim's union is not like typescript i think |
14:00:41 | FromDiscord | <ieltan> btw a lot of the docs in it is kinda outdated |
14:01:23 | FromDiscord | <ieltan> but the code should work fine |
14:02:16 | FromDiscord | <ieltan> oh boy i forgot they do this weird conditional compilation stuff making the thing unreadable |
14:02:56 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=iRlRjOGV |
14:03:13 | FromDiscord | <imagio> yeah I was scratching my head about why that's necessary |
14:04:09 | FromDiscord | <ieltan> In reply to @imagio "yeah I was scratching": they were working around some nim bug |
14:04:26 | FromDiscord | <ieltan> its fixed now i dunno why they didnt revert the workaround |
14:05:35 | FromDiscord | <zumi.dxy> well people still use old versions |
14:05:43 | FromDiscord | <zumi.dxy> especially on "stable" distros |
14:05:43 | FromDiscord | <imagio> Can nim infer a union return type like the flatMap example above? |
14:06:14 | FromDiscord | <ieltan> In reply to @zumi.dxy "well people still use": Ahh fair enough |
14:07:06 | FromDiscord | <zumi.dxy> choosenim or compiling a new version is an option, sure↵but i don't think people want to go through that hassle unless absolutely necessary |
14:07:58 | FromDiscord | <ieltan> I mean |
14:08:02 | FromDiscord | <ieltan> People have to update anyways |
14:08:08 | FromDiscord | <ieltan> (security fixes) |
14:08:25 | FromDiscord | <imagio> sent a code paste, see https://play.nim-lang.org/#pasty=MRaDgtaC |
14:13:17 | * | lucasta joined #nim |
14:13:20 | FromDiscord | <anuke> Anyone know why setting up Nim on CI has been so slow these past couple of days? It seems to be downloading Nim from the site at 5 kb/s, which is horrendous. Is something wrong with the site? https://media.discordapp.net/attachments/371759389889003532/1252627206245584958/image.png?ex=6672e77e&is=667195fe&hm=553eda9cc3382f232595e85ce7db7c063bbde68e4e07463557c38c5f334aa55b& |
14:15:19 | FromDiscord | <anuke> Likely related to the 2.0.6 release...? |
14:15:48 | FromDiscord | <albassort> i downloaded 2.6 using choosenim and it was fine |
14:16:03 | FromDiscord | <albassort> today |
14:16:29 | FromDiscord | <imagio> sent a code paste, see https://play.nim-lang.org/#pasty=AuWtdYDj |
14:16:40 | FromDiscord | <anuke> In reply to @albassort "i downloaded 2.6 using": Choosenim may use a different system than the CI setup script |
14:17:19 | FromDiscord | <imagio> (edit) "https://play.nim-lang.org/#pasty=ziSiGJxp" => "https://play.nim-lang.org/#pasty=tqWIPtKx" |
14:17:37 | FromDiscord | <imagio> (edit) "https://play.nim-lang.org/#pasty=tzDiOvRv" => "https://play.nim-lang.org/#pasty=JUimITqu" |
14:19:00 | * | PMunch quit (Quit: Leaving) |
14:24:13 | FromDiscord | <Robyn [She/Her]> In reply to @ieltan "im not sure you": True |
14:26:49 | FromDiscord | <ringabout> In reply to @anuke "Anyone know why setting": Isn't it at the start phase https://media.discordapp.net/attachments/371759389889003532/1252630601870082149/image.png?ex=6672eaa8&is=66719928&hm=0838cd06f3ce93596626af969bcd95a49f9da348819da9188063a537d84429e6& |
14:27:42 | FromDiscord | <anuke> Oh, I missed that, my bad |
14:27:44 | FromDiscord | <anuke> What is the issue, then? |
14:27:58 | FromDiscord | <anuke> Could it be a problem with the action? It's happening across multiple repos |
14:30:05 | FromDiscord | <ieltan> @imagio `E0 | E1` in nim means "restrict that generic to only one of those two types". Nim does infer generics but it works differently than typescript |
14:32:17 | FromDiscord | <ringabout> In reply to @anuke "Anyone know why setting": Probably cache issues. It might improve after it has been downloaded. server cdn or cache action |
14:32:50 | FromDiscord | <ieltan> I'm not even sure if I understand how union works in typescript but I'm pretty sure it's different than Nim's |
14:33:08 | FromDiscord | <ieltan> (edit) "I'm not even sure if I understand how ... union" added "type" |
14:40:29 | FromDiscord | <imagio> In reply to @ieltan "I'm not even sure": In TS the meaning is similar to "E0 or E1". In TS it doesn't have to be literally E0 or E1 but rather any type that satisfies E0 or E1 because TS is for some reason dogmatic about structural typing. In most cases however you usually have a discriminator in the type which TS can use to narrow so it really does become "E0 or E1". |
14:41:12 | FromDiscord | <imagio> (edit) "typing." => "typing even when nominal types make sense." |
14:57:57 | FromDiscord | <anuke> I tried downgrading to 2.0.4, and it downloads 2.0.6 for setup anyway. Bizarre behavior. https://media.discordapp.net/attachments/371759389889003532/1252638437568151612/image.png?ex=6672f1f4&is=6671a074&hm=0e2ef38d8d4499affefb5df0eada30f43eb1aaa77b7a64bba23b514e44903251& |
15:25:21 | FromDiscord | <albassort> In reply to @anuke "Choosenim may use a": what is the cl setup script? |
15:33:45 | * | xet7 quit (Remote host closed the connection) |
15:37:23 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=hbdgPrGm |
16:10:51 | * | xet7 joined #nim |
16:21:19 | * | lucasta quit (Quit: Leaving) |
17:09:31 | * | rockcavera joined #nim |
17:13:00 | * | tiorock joined #nim |
17:13:00 | * | tiorock quit (Changing host) |
17:13:00 | * | tiorock joined #nim |
17:13:00 | * | rockcavera is now known as Guest8713 |
17:13:00 | * | Guest8713 quit (Killed (copper.libera.chat (Nickname regained by services))) |
17:13:00 | * | tiorock is now known as rockcavera |
18:05:39 | * | coldfeet joined #nim |
18:24:19 | * | xtr00 quit (Quit: Client closed) |
18:27:21 | * | SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev) |
18:33:59 | FromDiscord | <imagio> sent a code paste, see https://play.nim-lang.org/#pasty=MjZGpAJO |
18:46:40 | FromDiscord | <demotomohiro> In reply to @imagio "Hmm nim 2.0.6 is": It seems failed to compile and link `koch.nim`.↵`nim c --listcmd koch.nim` provide more info. |
18:47:45 | FromDiscord | <demotomohiro> `--listcmd` prints commands Nim issues to compile and link generated C files. |
19:33:30 | * | ntat quit (Quit: Leaving) |
19:45:51 | * | jjido joined #nim |
19:55:14 | FromDiscord | <rakgew> @xkonti \: quite enjoy your nim streams!↵from a recent recoring I watched, it sounded like you might be interested in code reordering?\:↵https://nim-lang.org/docs/manual_experimental.html#code-reordering (but maybe you have found it already) |
20:21:52 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
20:37:28 | FromDiscord | <fakuivan> what is the consensus around calling unary functions without parentheses? |
20:40:47 | FromDiscord | <leorize> it depends™ |
20:42:59 | FromDiscord | <fakuivan> what do formatters do? |
20:51:49 | FromDiscord | <leorize> formatters doesn't change any of this |
20:53:35 | * | coldfeet quit (Remote host closed the connection) |
21:04:31 | FromDiscord | <xkonti> In reply to @rakgew "<@244832576215318528> \: quite enjoy": I'm very glad to hear that ❤️↵I might have perused through this option. Now I'll definitely check it out as it would make it so much easier to keep things organized. Thanks! |
21:04:52 | FromDiscord | <Elegantbeef> Nooooo |
21:04:57 | FromDiscord | <Elegantbeef> Top to bottom code is just the best! 😄 |
21:07:43 | * | jjido joined #nim |
21:08:59 | * | rockcavera quit (Ping timeout: 264 seconds) |
21:15:56 | FromDiscord | <frusadev> Hello. Does anyone know how to copy all the contents of a dir to another one? |
21:16:43 | FromDiscord | <nnsee> `cp -r mydir1/ mydir2/`↵? |
21:16:51 | FromDiscord | <nnsee> oh, i just realized you probably mean within nim |
21:16:58 | FromDiscord | <frusadev> Yeah haha |
21:18:41 | FromDiscord | <nnsee> you probably want to walk the files recursively and copy them to the destination dir one by one |
21:19:05 | FromDiscord | <nnsee> as in https://nim-lang.org/docs/osdirs.html#walkDirRec.i,string |
21:19:37 | FromDiscord | <frusadev> thanks |
21:43:16 | * | rockcavera joined #nim |
22:25:08 | FromDiscord | <demotomohiro> You can use `copyDir`:↵https://nim-lang.org/docs/osdirs.html#copyDir%2Cstring%2Cstring |
22:38:18 | FromDiscord | </-+> Is Nim programming a garbage collector |
22:39:12 | FromDiscord | <juancarlospaco> Nim is a programming language. |
22:46:52 | FromDiscord | <Elegantbeef> Let's be honest with how I write code I'm the garbage collector |
23:01:42 | FromDiscord | <Robyn [She/Her]> It's shown in how you speak too! Though you make more shit behind you sooo |
23:04:18 | FromDiscord | <realqquantum> sent a code paste, see https://play.nim-lang.org/#pasty=AWaKZUuc |
23:04:45 | FromDiscord | <realqquantum> (edit) "https://play.nim-lang.org/#pasty=RknEjnwd" => "https://play.nim-lang.org/#pasty=qMWKsntP" |
23:05:10 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
23:05:47 | FromDiscord | <leorize> since you're SELECT-ing, you'll want https://nim-lang.org/docs/db_sqlite.html#getAllRows%2CDbConn%2CSqlQuery%2Cvarargs%5Bstring%2C%5D instead |
23:06:14 | FromDiscord | <realqquantum> ill try it rn thanks |
23:06:53 | FromDiscord | <realqquantum> worked, thanks! |
23:22:11 | * | lx12ucy joined #nim |
23:22:40 | lx12ucy | what would be the best way to find the unix timestamp of when a directory was last modified? |
23:28:01 | FromDiscord | <leorize> use getFileInfo\: https://nim-lang.org/docs/os.html#getFileInfo%2CFile |
23:28:19 | FromDiscord | <leorize> the FileInfo struct has lastWriteTime, which is what you want |
23:28:48 | FromDiscord | <Elegantbeef> There is also `getLastModificationTime()` |
23:30:31 | lx12ucy | just found `getLastModificationTime()`, i'll try this |