00:00:07 | FromDiscord | <albassort> or not, its gone |
00:00:08 | FromDiscord | <albassort> Β―\_(γ)_/Β― |
00:00:32 | FromDiscord | <albassort> i had 1 job |
00:01:18 | FromDiscord | <Robyn [She/Her]> Everything works fine...until it doesn't...and then suddenly it does again xD |
00:56:02 | FromDiscord | <leorize> usually when it does that it's a sign of stack corruption |
00:57:14 | FromDiscord | <albassort> In reply to @leorize "usually when it does": i am furiously scrubbing all of the addresses! |
00:59:51 | FromDiscord | <demotomohiro> In reply to @albassort "everything is synced up": It is possible that you wrote a undefined behaiver code but it didn't affected your code and passed tests.β΅But that UB code affected recently added code. |
01:02:59 | FromDiscord | <albassort> In reply to @demotomohiro "It is possible that": i would say so, if it wasn't for the fact that just recompiling the code fixed it (sometimes) |
01:03:12 | FromDiscord | <albassort> i think leorize is right though. I think it is stack corruption |
01:03:34 | FromDiscord | <albassort> my code is durable in terms of behavior, but flimsy in terms of memory |
01:04:30 | FromDiscord | <leorize> luckily stack corruption is simple |
01:04:50 | FromDiscord | <leorize> just make sure you give out the right memory size to FFI |
01:05:27 | FromDiscord | <albassort> it was more, i was reading an extra 15 bytes in 3 places, and freeing an extra 1sizeof |
01:05:48 | FromDiscord | <albassort> or maybe not. I don't know about the second one |
01:06:23 | FromDiscord | <albassort> but who knows if that actually fixed the issue, i will to keep testing |
01:09:03 | FromDiscord | <leorize> what's the signature of the troubling function? |
01:09:12 | FromDiscord | <leorize> and the nim signature, too |
01:10:37 | FromDiscord | <albassort> i pushed a fix to gitlab now |
01:15:14 | FromDiscord | <Elegantbeef> Thought I'd add multi threading to a fractal tree toy, and now the program runs 33% slower! |
01:15:24 | FromDiscord | <Elegantbeef> We did it we made it use more CPU at the cost of thrashing the cache! |
01:24:32 | FromDiscord | <leorize> btw albassort, check this out\: https://github.com/arnetheduck/nbindgen?tab=readme-ov-file |
01:25:51 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "btw albassort, check this": Isn't that outdated and/or incomplete? |
01:26:06 | FromDiscord | <albassort> In reply to @chronos.vitaqua "Isn't that outdated and/or": I heard that too, thats why i didn't use it |
01:26:39 | FromDiscord | <Robyn [She/Her]> A lib that'd provide glue for Nim and Rust seems pretty useful though |
01:27:38 | FromDiscord | <leorize> last commit is 8mo ago so I think it could still work? |
01:28:25 | FromDiscord | <Robyn [She/Her]> Fair point |
01:28:43 | FromDiscord | <albassort> its better than manually changing the bindings every time i update the rust code, i'll say that |
01:28:43 | FromDiscord | <Robyn [She/Her]> Smh if only Rust had compile-time introspection |
01:29:19 | FromDiscord | <Robyn [She/Her]> Wait couldn't you make a dead simple macro in Rust that you could use as an annotation to generate the Nim glue?- |
01:30:04 | FromDiscord | <Robyn [She/Her]> Cbindgen (and Nimbindgen) probably do that |
01:32:03 | FromDiscord | <leorize> they don't use macross |
01:32:39 | FromDiscord | <leorize> oh wait it is a proc macro |
01:32:53 | FromDiscord | <Elegantbeef> Leo "the liar" rize |
01:32:57 | FromDiscord | <leorize> interesting, I guess rust macros can be compiled to binary? |
01:33:16 | FromDiscord | <Elegantbeef> I think that's how proc macros work |
01:33:27 | FromDiscord | <leorize> IC took so long Rust already got native macros done |
01:33:47 | FromDiscord | <Elegantbeef> Now if only Rust macros didn't require you to use a cargo to split them |
01:39:03 | FromDiscord | <graveflo> does the shared heap put the block size behind the allocated block like malloc does or am I tripping? I can't seem to find it |
01:39:49 | FromDiscord | <leorize> you can just `-d:useMalloc` and you won't have to worry about such frivolity |
01:40:23 | FromDiscord | <graveflo> true but I would like to know how it works.. I guess I could just read the source if I have to |
01:41:50 | FromDiscord | <albassort> i am unable to get nbindgen to have any output |
01:41:52 | FromDiscord | <albassort> π |
01:42:42 | FromDiscord | <leorize> then ig it's toasted |
01:43:33 | FromDiscord | <albassort> it parses the rust properly and warns me about the right partsd |
01:43:34 | FromDiscord | <albassort> (edit) "partsd" => "parts" |
01:43:36 | FromDiscord | <albassort> but no nim output |
01:43:37 | FromDiscord | <albassort> rip |
02:01:21 | * | SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev) |
02:35:56 | FromDiscord | <planetis_m> In reply to @graveflo "does the shared heap": Ots the tlsf allocator and i think not |
02:39:52 | FromDiscord | <planetis_m> It's a few fields before the data https://github.com/nim-lang/Nim/blob/830153323af0fce9ca5c73030c2374f03367a412/lib/system/alloc.nim#L88 |
02:59:46 | FromDiscord | <graveflo> nice one! thanks |
03:45:38 | * | SchweinDeBurg joined #nim |
03:48:58 | FromDiscord | <that_dude.> In reply to @tommyzjones_20 "Dear admin and fellow": <@&371760044473319454> This one snuck through |
04:04:23 | * | FromDiscord quit (Remote host closed the connection) |
04:04:37 | * | FromDiscord joined #nim |
04:07:14 | * | xet7 quit (Remote host closed the connection) |
05:02:22 | * | ntat joined #nim |
05:39:47 | * | disso-peach quit (Quit: Leaving) |
05:44:46 | FromDiscord | <sOkam! π«> I swear nim error messages trigger me badly sometimes π |
05:46:04 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=qdHnDJfV |
05:46:06 | FromDiscord | <Elegantbeef> To shoot with the rude response "l4rn 2 rd" |
05:46:18 | FromDiscord | <sOkam! π«> (edit) "https://play.nim-lang.org/#pasty=EWcNJTyv" => "https://play.nim-lang.org/#pasty=WlngnJPt" |
05:46:35 | FromDiscord | <Elegantbeef> I assume `Logger` is not generic? |
05:46:48 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=gJWVuxWq |
05:48:33 | FromDiscord | <Elegantbeef> Cannot say anything myself π |
05:48:42 | FromDiscord | <sOkam! π«> yeah, it makes no sense |
05:48:53 | FromDiscord | <Elegantbeef> I think it'd probably make sense with full context |
05:49:11 | FromDiscord | <sOkam! π«> I'm writing it in a PR. let me push my current stuff and send the link |
05:52:41 | FromDiscord | <sOkam! π«> @ElegantBeef This is the line that errorsβ΅https://github.com/heysokam/nstd/blob/b00b88e8bf7f9204773835f5cce0820d11a1a7f5/src/nstd/logger/core.nim#L122 |
05:54:39 | FromDiscord | <sOkam! π«> It is calling for `erase`, which is here:β΅https://github.com/heysokam/nstd/blob/b00b88e8bf7f9204773835f5cce0820d11a1a7f5/src/nstd/paths/files.nim#L83 |
05:55:41 | FromDiscord | <Elegantbeef> Oh you have circular deps |
05:55:45 | FromDiscord | <Elegantbeef> Fun |
05:56:59 | FromDiscord | <sOkam! π«> yeah, I just saw it when running the tests! wth |
05:57:24 | FromDiscord | <sOkam! π«> why does the compiler sometimes choke on itself and not print the circular deps error message |
05:57:49 | FromDiscord | <Elegantbeef> Probably cached files |
05:57:51 | FromDiscord | <Elegantbeef> Who knows |
05:57:52 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=wHHJFEUU |
05:58:01 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "Probably cached files": ah that could be |
05:59:54 | FromDiscord | <sOkam! π«> removed the logger from the `create` dir call... and solve it π€·ββοΈ |
06:00:50 | FromDiscord | <Elegantbeef> Some delayed imports and everything might work |
06:01:30 | * | coldfeet joined #nim |
06:02:58 | FromDiscord | <Elegantbeef> Heh your `DefVerbose` is verbose |
06:03:49 | FromDiscord | <Elegantbeef> `const DefVerbose = not(defined(release) or defined(danger)) or defined(debug)` |
06:05:01 | FromDiscord | <Elegantbeef> Though I imagine that could just be `defined(debug)` since `-d:release -d:debug` works |
06:08:41 | * | coldfeet quit (Remote host closed the connection) |
06:19:04 | FromDiscord | <sOkam! π«> yeah its verbose by default, since nim compiles on `debug` mode by default |
06:19:24 | FromDiscord | <Elegantbeef> I mean the body was verbose |
06:19:39 | FromDiscord | <sOkam! π«> don't know what you mean |
06:20:02 | FromDiscord | <Elegantbeef> You have `when (...) elif ...: ... else: ...` |
06:21:35 | FromDiscord | <Elegantbeef> Which is just a overly complex boolean expression like I did above |
06:22:53 | FromDiscord | <sOkam! π«> where exactly? i dont follow |
06:23:27 | FromDiscord | <Elegantbeef> `const DefVerbose = not(defined(release) or defined(danger)) or defined(debug)` |
06:26:24 | FromDiscord | <sOkam! π«> yes, that meansβ΅> fill in the `-d:debug` that is missing from official nim compilerβ΅> and do verbose things on debug by default when its -d:debug or when it should be |
06:26:47 | FromDiscord | <Elegantbeef> What? |
06:27:04 | FromDiscord | <Elegantbeef> Yours presently is this `const DefVerbose = when defined(release) or defined(danger): false elif defined(debug): true else: true` |
06:27:14 | FromDiscord | <Elegantbeef> Which is just a verbose version of the above |
06:27:18 | FromDiscord | <Elegantbeef> Which is what I found ironic |
06:28:12 | FromDiscord | <sOkam! π«> im really confused |
06:29:02 | FromDiscord | <thepuzzleddev> is there an interpreter for nim? |
06:29:33 | FromDiscord | <Elegantbeef> You have a when elf else chain when a boolean operation suffices sokam |
06:29:45 | FromDiscord | <Elegantbeef> I found it funny that it was `DefVerbose` that had a verbose body |
06:29:55 | FromDiscord | <Elegantbeef> Yes nimscript exists it's only a subset so it's not grand |
06:30:06 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "I found it funny": ah, i see |
06:30:19 | FromDiscord | <sOkam! π«> sorry, I absolutely didn't get the connection there |
06:31:32 | FromDiscord | <sOkam! π«> me, pretty much https://media.discordapp.net/attachments/371759389889003532/1254685323842293810/joke-joke-missed.gif?ex=667a6444&is=667912c4&hm=c1eecedabb83ae339799834e79243949cef42589ad1b4e7d23b8dc7ce6d8506b& |
06:36:23 | FromDiscord | <Elegantbeef> Damn data is your father |
06:44:02 | * | PMunch joined #nim |
08:27:52 | FromDiscord | <ieltan> i need something to replace choosenim |
08:27:55 | FromDiscord | <ieltan> any ideas ? |
08:28:45 | FromDiscord | <Marcus> Nix? π |
08:30:28 | FromDiscord | <ieltan> In reply to @Marcus "Nix? π": I've already used Nix/NixOS so I know how to install it using Nix but I just want to install it in another OS without it lol |
08:31:20 | FromDiscord | <ieltan> and choosenim interacts poorly with langserver or whatever and create zombie processes |
08:32:50 | FromDiscord | <ieltan> meh, i guess i'll check if good ole docker is up to date |
08:34:01 | FromDiscord | <ieltan> inb4 "compile it from source" yes but is there an alternative installer that doesn't require me to git pull the whole nim repo which takes storage on my disk ? |
08:35:00 | FromDiscord | <ieltan> and yup docker is up to date |
08:42:32 | FromDiscord | <ieltan> just needed to compile some code, i'll to do this proper later |
08:42:38 | FromDiscord | <ieltan> for now it's enough |
08:44:40 | FromDiscord | <Clonkk> In reply to @ieltan "i need something to": Download the latest 2.0.X version with atlas included and uses 'atlas env' |
08:45:33 | FromDiscord | <Clonkk> Then setup some bash alias that sources the correct env file and send you in the workspace directory |
08:45:56 | FromDiscord | <Clonkk> easiest way to swap between Nim version in a contained format |
09:02:25 | FromDiscord | <ieltan> In reply to @.sneakybaguette "Download the latest 2.0.X": totally forgot about atlas |
09:02:29 | FromDiscord | <ieltan> thanks π |
09:29:02 | * | beholders_eye joined #nim |
09:30:22 | * | smlckz joined #nim |
09:31:49 | smlckz | 2.0.6 was released, yet channel topic have not changed.. |
09:35:56 | smlckz | How can I make this work? https://0x0.st/XAgI.txt |
09:36:54 | * | beholders_eye quit (Quit: WeeChat 4.1.2) |
09:40:00 | * | coldfeet joined #nim |
09:41:16 | PMunch | Thanks for reminding me smlckz! |
09:41:39 | PMunch | @ieltan, why do you need to replace it? |
09:42:06 | PMunch | We're working on fixing choosenim |
09:42:18 | PMunch | So it might be worth just waiting for that |
09:42:29 | PMunch | Or you could try nimlsp which doesn't have the zombie process issue |
09:53:10 | smlckz | PMunch: no problem, how about my question? |
09:54:49 | PMunch | Depends on what you mean by "make it work" |
09:55:27 | PMunch | For starters arrays are static size |
09:55:37 | PMunch | So you need to pick a dynamically sized data structure |
09:56:09 | FromDiscord | <ieltan> In reply to @PMunch "<@256520101015060480>, why do you": cuz of the zombie processes... but if you say nimlsp doesnt have this issue then i'll give it a try. |
09:56:39 | PMunch | @ieltan, yeah nimlsp uses nimsuggest as a library, so you don't even need to have nimsuggest installed to use NimLSP :) |
09:59:14 | PMunch | smlckz, something like this works: https://play.nim-lang.org/#pasty=jjDvrxCR |
10:32:08 | smlckz | PMunch: this ... also works: https://play.nim-lang.org/#pasty=KFaLbTES |
10:33:44 | PMunch | Sure, but now you have to specify how many bits you need.. |
10:39:46 | * | coldfeet quit (Remote host closed the connection) |
10:41:14 | PMunch | Of course for many usecases it is quite surperfluous to first convert to an array or a sequence: https://play.nim-lang.org/#pasty=LEBCiPrU |
10:44:16 | smlckz | hmm |
11:06:19 | smlckz | Why does len returns int? Why isn't there any seperate type for size? |
11:08:40 | FromDiscord | <sOkam! π«> In reply to @smlckz "Why does len returns": if you need to interop with C, its `csize_t` |
11:09:08 | FromDiscord | <sOkam! π«> I believe there is also a `csize` type, but I don't remember the details of that one |
11:10:21 | FromDiscord | <sOkam! π«> but there is no need to `usize` or `size_t`, just use `uint` |
11:13:19 | * | xet7 joined #nim |
11:13:45 | smlckz | hmm https://github.com/nim-lang/Nim/blob/version-2-0/lib/system/ctypes.nim#L42 |
11:13:51 | PMunch | smlckz, why would you want `len` to not return an int? |
11:13:51 | FromDiscord | <sOkam! π«> @ElegantBeef I'm having an issue where a custom type that I made is not automatically converting to string with a custom `$` proc that I made π€β΅It also ignores a converter I just wrote tooβ΅Do you know what could trigger that misbehavior? Am I missing something? |
11:14:22 | smlckz | btw what is nimPreviewSlimSystem? |
11:14:22 | PMunch | Missing exports? Or missing module imports? |
11:17:44 | FromDiscord | <sOkam! π«> @pmunch it is importing a `paths` module that I made, everywhere I can see π€ |
11:17:51 | smlckz | PMunch: in reality, I welcome having sizes stored in signed integers, I wonder what was the rationale behind the choice. Is it the same as what I think it is? |
11:17:59 | FromDiscord | <sOkam! π«> that module imports all its subfiles, and exports them |
11:19:44 | PMunch | smlckz, I think the rationale is pretty much that you're never going to use more than int64.high anyways, and unsigned integers can act in strange ways if you're not careful |
11:19:48 | FromDiscord | <sOkam! π«> Oh, I think I see what's happening. somewhere there is a fmt inside another fmt... and that might be the cause |
11:24:02 | FromDiscord | <sOkam! π«> nope, that wasn't it |
11:24:26 | PMunch | Hard to tell without looking at code unfortunately |
11:24:29 | FromDiscord | <sOkam! π«> well, I will manually convert anyway. I don't want to keep hunting template issues. I found enough of them this week π |
11:25:16 | FromDiscord | <sOkam! π«> In reply to @PMunch "Hard to tell without": I'm not sure how the code would help, since its spread across multiple repos and deeply nested in function chains π¦ |
11:25:47 | FromDiscord | <sOkam! π«> would need to create a min-repro. but I would rather explcitly convert than try to hunt another template bug this week |
11:25:49 | FromDiscord | <sOkam! π«> maybe some other time |
11:33:09 | * | SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev) |
11:38:59 | * | SchweinDeBurg joined #nim |
11:42:12 | FromDiscord | <melmass> Oh PMunch is here π I'm currently trying out Futhark |
11:42:18 | FromDiscord | <melmass> Why are you all APPS π€ ? |
11:43:26 | PMunch | Huh? |
11:46:58 | FromDiscord | <demotomohiro> In reply to @melmass "Oh PMunch is here": There are bridges between different chat services and there are people using IRC or other chat services. |
11:47:13 | PMunch | Oh right, on Discord we have "APP" next to our names :P |
11:47:16 | PMunch | Forgot about that |
11:47:26 | PMunch | At least it's better than "BOT" or whatever it used to say |
11:47:51 | PMunch | A surprising amount of people though we just had some really clever bots in this chat |
11:48:32 | FromDiscord | <melmass> Nice I thought it was some anonymization thing I wasn't aware of |
11:48:42 | FromDiscord | <zumi.dxy> I mean the IRC bridge avatar is still a bot |
11:49:22 | FromDiscord | <demotomohiro> Many new beginner thought beef is clever AI written in Nim. |
11:50:06 | FromDiscord | <melmass> In reply to @PMunch "Huh?": Is there a way to "debug" rename directives in futhark? I'd like to understand what the proc receives |
11:50:19 | FromDiscord | <zumi.dxy> ~~i wish~~ |
11:50:57 | FromDiscord | <melmass> It worked suprinsingly well out of the box, but now I'm struggling a bit on the impl/manual part |
11:54:08 | PMunch | Hmm, not exactly sure what you're looking for |
11:54:14 | PMunch | You could always just echo out what you get |
11:55:40 | FromDiscord | <melmass> sent a code paste, see https://play.nim-lang.org/#pasty=NgQMpsYN |
11:57:33 | PMunch | You might be running into cache stuff |
11:58:00 | PMunch | Try compiling with `-d:useFuthark -d:futharkRebuild` |
11:58:07 | FromDiscord | <melmass> And the actual end goal is that furthark seems to generate a lot of "aliased" structs for the same type, and they don't all expose the same fields |
11:58:32 | PMunch | That sounds strange |
11:58:42 | PMunch | Futhark should just do the 1:1 from C |
11:59:10 | PMunch | Only thing which should change is the names of identifiers to make sure they are unique |
12:00:19 | FromDiscord | <melmass> The source I'm trying to bridge handle A LOT of environments which I think might be the issue here |
12:00:29 | FromDiscord | <melmass> <https://github.com/ufbx/ufbx> |
12:00:51 | FromDiscord | <melmass> Ah cool, using rebuild revealed some errors |
12:01:11 | FromDiscord | <sOkam! π«> In reply to @melmass "And the actual end": the C names are respected verbatim though |
12:01:28 | FromDiscord | <sOkam! π«> the aliases are confusing, but thats just codegen noise. the C names is what matters |
12:01:37 | FromDiscord | <sOkam! π«> and those are preserved |
12:03:02 | PMunch | Why would environments be an issue? |
12:03:34 | FromDiscord | <melmass> I see thanks! I did use the bare c names which resulted in "xxx field not found" so looking at the generated bindings I saw all those typed aliases and they don't seem to all define the same fields |
12:05:10 | FromDiscord | <melmass> In reply to @PMunch "Why would environments be": Just a guess that's probably not a big deal? I meant that it uses a lot of templates and comp time conditionals |
12:05:37 | PMunch | Shouldn't bother Futhark at all :) |
12:07:07 | FromDiscord | <melmass> Cool so the rebuild did reveal I didn't need those custom define but I still get an error `Error: cannot 'importc' variable at compile time;` but now removing rebuild works fine |
12:07:36 | PMunch | Without the rebuild it builds from cache |
12:07:50 | PMunch | So if you at some point had a working version that's the one it grabs |
12:08:22 | FromDiscord | <melmass> Ah yes, that might explain some stuff, so I'm not "iterating" since quite some time I think fk me π
|
12:08:23 | PMunch | The importc at compile time thing is probably the OS module trying to write to a file in a non-compatible way with compile-time procs |
12:08:37 | PMunch | Haha, simple mistake |
12:08:50 | PMunch | Granted if you change anything in the importc block it should trigger a rebuild |
12:08:57 | PMunch | Same for changing the renameCallabck |
12:09:20 | FromDiscord | <melmass> YES! |
12:09:48 | FromDiscord | <melmass> Cool, so yes now echo works! Thanks a lot |
12:09:57 | PMunch | No problem :) |
12:13:33 | FromDiscord | <melmass> sent a code paste, see https://play.nim-lang.org/#pasty=eMJsFgVB |
12:15:21 | PMunch | Ah, that's because it's a distinct ptr |
12:16:13 | PMunch | Try doing the `object of X` thing the manual works instead |
12:19:13 | FromDiscord | <melmass> Great, I'll actually re-read the whole readme now that you helped solve a few blockers, not sure where I picked up this actually I had this missing line too.`converter toBase(c: FbxScene): ptr ufbxscene = cast[ptr ufbxscene](c)` |
12:27:34 | PMunch | If you find anything in the README which is unclear I'd love PRs to fix it |
12:27:37 | FromDiscord | <planetis_m> FbxScene {.borrow: `.`.} |
12:27:56 | FromDiscord | <planetis_m> (edit) "{.borrow: `.`.}" => "`{.borrow: `.`.}`" |
12:28:09 | FromDiscord | <planetis_m> (edit) "FbxScene `{.borrow: `.`.}`" => "sent a code paste, see https://play.nim-lang.org/#pasty=sraJedDO" |
12:28:54 | FromDiscord | <planetis_m> Wait its ptr so it doesn't have any fields |
12:30:29 | FromDiscord | <melmass> hello planetis! I picked up nim back thanks to your naylib library πβ΅Ideally these bindings could allow loading fbx in it |
12:30:31 | FromDiscord | <planetis_m> sent a code paste, see https://play.nim-lang.org/#pasty=zQHkuGUr |
12:30:39 | FromDiscord | <planetis_m> (edit) "https://play.nim-lang.org/#pasty=spRZvCip" => "https://play.nim-lang.org/#pasty=qqTonLSt" |
12:31:03 | FromDiscord | <planetis_m> Hi, good to hear |
12:33:30 | FromDiscord | <planetis_m> That would be a great addition indeed. Though I m not familiar with anything 3d |
12:34:53 | FromDiscord | <melmass> It was a great way to get back to nim, I implemented hcamera.h and the first person sample |
12:39:27 | FromDiscord | <melmass> Cool so yes rebuild was my main issue :facepalmdouble: https://media.discordapp.net/attachments/371759389889003532/1254777911341486201/image.png?ex=667aba7e&is=667968fe&hm=78ef8a8444e5c91139f566b7918295303d0925a3f367ccd01a6db3d33027d5e7& |
12:40:16 | FromDiscord | <melmass> Thanks for the help π |
12:42:01 | FromDiscord | <melmass> In reply to @PMunch "If you find anything": I had to read it multiple times at different stage of "understanding" but it feels complete imo, I would probably point out the test folder that contain nice samples too |
12:42:37 | FromDiscord | <melmass> And yes that rebuild/cache thing!! |
12:42:52 | FromDiscord | <melmass> cc @pmunch βοΈ |
12:44:00 | FromDiscord | <melmass> nvm it's there π
|
12:44:33 | FromDiscord | <melmass> But maybe a table of futhark defines with what they do |
12:45:07 | FromDiscord | <sOkam! π«> @pmunch consider making the non-cached option the default. its very unintutive to compile the code and not get the lib recompiled π€·ββοΈ |
12:46:20 | FromDiscord | <sOkam! π«> when you are confident you can always add the cached option back in, and stay pinned to that version until you trigger a rebuild. but it won't confuse beginners (it did trip me too, literally one of the first things I did was add the non-cached flag to my buildsystem) |
12:46:53 | FromDiscord | <melmass> What the way now? config.nims? |
12:46:55 | PMunch | I mean it should rebuild as long as you change something on the Nim side |
12:47:08 | PMunch | If you change something on the C side however it won't trigger a rebuild |
12:47:46 | FromDiscord | <sOkam! π«> In reply to @melmass "What the way now?": yeah in whatever buildsystem config options you are using |
12:47:48 | PMunch | If not then there is something wrong with the hashing logic.. |
12:47:58 | FromDiscord | <sOkam! π«> if you are using nimble to build your test project, then yes it would work with config.nims |
12:56:55 | FromDiscord | <melmass> In reply to @heysokam "yeah in whatever buildsystem": I'm just using basic scripts for now or nimble tasks, but discovered nims that I feel fit better |
13:04:09 | * | smlckz left #nim (WeeChat 4.3.1) |
13:13:15 | FromDiscord | <melmass> sent a code paste, see https://play.nim-lang.org/#pasty=xQisDuzr |
13:50:00 | FromDiscord | <ieltan> In reply to @melmass "Not sure how idiomatic": unless `ufbx_free_scene` checks for nil, you risk a use-after-free there, so you gotta check for nil in the destructor |
13:52:26 | FromDiscord | <melmass> sent a code paste, see https://play.nim-lang.org/#pasty=VFTGQaRl |
14:05:46 | FromDiscord | <ieltan> In reply to @melmass "I'm doing the check": well you can keep the nil check and add one in the destructor too, because the object could be moved in another proc and it's now nil but i am not sure if Nim calls destructors for moved objects (i think it doesn't but again im not sure) |
14:08:24 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=wzbhcvFH |
14:08:32 | FromDiscord | <ieltan> (edit) "https://play.nim-lang.org/#pasty=PSWiSJmM" => "https://play.nim-lang.org/#pasty=fxPszBzt" |
14:11:47 | FromDiscord | <ieltan> whoosp the sign was on the wrong side |
14:13:08 | * | PMunch quit (Quit: Leaving) |
14:16:11 | FromDiscord | <Robyn [She/Her]> In reply to @ieltan "also you need theses": You only need to define it for `=copy`, `=dup` uses `=copy` |
14:28:13 | FromDiscord | <planetis_m> In reply to @chronos.vitaqua "You only need to": dup is an optimization of copy. It defaults to cp if not found |
14:30:19 | FromDiscord | <planetis_m> In reply to @ieltan "well you can keep": That's exactly the reason why you need the nil check in the destructor |
14:32:33 | FromDiscord | <ieltan> In reply to @planetis_m "That's exactly the reason": ok, i wasnt sure that's why i said it doesn't but glad to know i havent gone totally senile |
14:32:45 | FromDiscord | <ieltan> (edit) "In reply to @planetis_m "That's exactly the reason": ok, i wasnt sure that's why i said it doesn't ... but" added "destroy it" |
14:48:57 | FromDiscord | <planetis_m> You can verify this easily with --expandarc:myproc |
15:06:42 | FromDiscord | <Robyn [She/Her]> In reply to @planetis_m "dup is an optimization": You still only need to define `=copy`, I know this because I did that in my code and when it tries using `=dup`, it said it couldn't since `=copy` errored :p |
15:07:12 | FromDiscord | <Robyn [She/Her]> Something something inferred `=dup` couldn't be used because `=copy` something something |
15:09:55 | FromDiscord | <ieltan> @Robyn [She/Her] I would still do the two hooks for completeness, I also don't like those implicit rules it's kind of confusing at first so.. |
15:10:05 | * | lucasta joined #nim |
15:10:09 | FromDiscord | <ieltan> but it's nice to know |
15:10:31 | FromDiscord | <ieltan> In reply to @planetis_m "You can verify this": totally forgot about that, thanks pal |
15:11:24 | FromDiscord | <Robyn [She/Her]> In reply to @ieltan "<@524288464422830095> I would still": Fair point |
15:12:49 | FromDiscord | <mratsim> `=dup`? I must have been writing Nim code in a cave for a while. What does that do? |
15:23:27 | FromDiscord | <ieltan> In reply to @mratsim "`=dup`? I must have": its documented there: https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks-nimeqdup-hookβ΅basically i think it's optimizing `wasMoved` |
15:36:54 | * | derpydoo joined #nim |
15:42:44 | NimEventer | New thread by Mrokii: Error: cannot open file: x11, see https://forum.nim-lang.org/t/11836 |
15:55:45 | * | derpydoo quit (Ping timeout: 268 seconds) |
16:00:12 | * | SEP_ quit (Ping timeout: 252 seconds) |
16:02:14 | * | SEP joined #nim |
16:25:31 | * | def- quit (Quit: -) |
16:25:48 | * | SEP_ joined #nim |
16:26:25 | * | def- joined #nim |
16:28:44 | * | SEP quit (Ping timeout: 268 seconds) |
16:37:39 | * | derpydoo joined #nim |
16:48:50 | * | lucasta quit (Quit: Leaving) |
17:00:37 | * | coldfeet joined #nim |
17:03:08 | * | SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev) |
17:05:38 | * | disso-peach joined #nim |
18:20:08 | * | coldfeet quit (Remote host closed the connection) |
18:36:26 | * | PMunch joined #nim |
18:38:05 | * | derpydoo quit (Quit: derpydoo) |
19:39:49 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
19:42:12 | * | Lord_Nightmare joined #nim |
20:23:20 | * | ntat quit (Quit: Leaving) |
20:27:49 | * | PMunch quit (Quit: leaving) |
21:06:29 | FromDiscord | <Elegantbeef> Wait I'm not, news to meβ΅(@demotomohiro) |
21:34:17 | FromDiscord | <Robyn [She/Her]> https://play.nim-lang.org/#pasty=BCcbZrAd I am so confused on why this is always returning 0 |
21:36:10 | FromDiscord | <Robyn [She/Her]> It's a basic ratelimiter and it should be returning a positive number (the amount of time to wait before retrying) if the cooldown has been hit |
21:39:23 | FromDiscord | <Elegantbeef> Cause you return `0` in all branches except over hits |
21:40:01 | FromDiscord | <Elegantbeef> It's much cleaner if you write it like so https://play.nim-lang.org/#pasty=qGJceXyJ |
21:51:24 | FromDiscord | <Robyn [She/Her]> That's still returning 0 everywhere |
21:51:36 | FromDiscord | <Elegantbeef> Never said I fixed the logical error π |
21:53:18 | FromDiscord | <Robyn [She/Her]> Pain |
21:53:44 | FromDiscord | <Robyn [She/Her]> Even in the branch where the hits are over the max it returns 0 and I'm confuseddd |
21:54:01 | FromDiscord | <Elegantbeef> cache `now()` |
21:54:23 | FromDiscord | <Elegantbeef> Reduce variance inbetween logic |
21:55:09 | FromDiscord | <Robyn [She/Her]> I could use `limit.lastAccessed` |
21:57:44 | FromDiscord | <Robyn [She/Her]> I think I understand the issue now |
21:58:58 | FromDiscord | <Elegantbeef> Also you can remove the `ref object` if you just use one `addr` |
21:59:34 | FromDiscord | <Robyn [She/Her]> In line 26? |
21:59:48 | FromDiscord | <Elegantbeef> Yea |
22:00:11 | FromDiscord | <Elegantbeef> It also means you can do `discard limiter[endpoint].hasKeyOrPut(uid, Limit(...))` |
22:00:16 | FromDiscord | <Elegantbeef> Without heap allocating every call |
22:00:44 | FromDiscord | <Elegantbeef> Though the if's lazy evaluation is probably better |
22:09:10 | FromDiscord | <Robyn [She/Her]> God I am so fucking confused why this isn't working |
22:19:53 | FromDiscord | <Robyn [She/Her]> I'm just going to give up on this for now ._. |
22:20:59 | FromDiscord | <Elegantbeef> Breakpoint debugging is a wonderful thing |
22:24:18 | FromDiscord | <Robyn [She/Her]> I should use it yes yes, but also I'm tired- |