00:18 < bridge> What do you guys use as a http testing server? I use `python3 -m http.server`, but was wondering what others do 00:46 < bridge> I also do that 01:15 < bridge> I fell into a dependency hell in rust that made me miss python, I didn't think I'd ever say that 01:17 < bridge> dependency hell is actually good 01:17 < bridge> ive been trying to avoid it but got nowhere 01:17 < bridge> writing a gui with 0 dependencies is not that easy 01:19 < bridge> What on earth is this? 01:19 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1396995135832719452/image.png?ex=68801c9b&is=687ecb1b&hm=68ca7ac0675020f2c48cd305afd4ce0fc07ad78b1204f1b1980e4c4a5aa699d7& 01:21 < bridge> lmaooooo 01:21 < bridge> what the hell 01:21 < bridge> is that ur dependency or dependency of a dependency 01:21 < bridge> I dont understand how python is better in this regard, if youre doing anything with ML its surely worse 01:22 < bridge> A dependency I have conditionally depends on `rand_core` specifically version 0.6.4, but the authors of rand in all their wisdom just fling everything around every version 01:22 < bridge> maybe idk enough about rust 01:22 < bridge> If I bump the dependency to the pre-release version, they upgraded the rand package, but then the pkcs8 encoder is broken 01:23 < bridge> If I keep it on the old one, and use an old version of rand myself I thought it'd work, but `rand 0.6.4` pulls in `rand_os 0.1.3`, which depends on and implements the `rand_code 0.4.2` interface which doesn't work because the library expects the `rand_core 0.6.4` interface 01:25 < bridge> it seems absurd to have 10 crates to do the same thing 01:25 < bridge> and they all depend on different version of rand_core 01:25 < bridge> so you drag about 10 more dependencies 01:26 < bridge> I do not understand anything, I'll sleep on this 01:26 < bridge> I just said oh let me generate a key and give it a go before I sleep, how long could it take, max 10 minutes 01:28 < bridge> Ah, rand 0.6.4 does not pull in rand_core 0.6.4, it pulls in rand_core 0.3 as one would think 01:28 < bridge> i think its possible to disable most of sub dependencies with features 01:28 < bridge> default-features = false 01:28 < bridge> What I want is rand 0.8.5 to get my rand_core 0.6.4 compatible rand 01:28 < bridge> I think I got it this time 01:29 < bridge> 0.6.4 triggers me 01:31 < bridge> fork the dependency you use and manually change the version 01:31 < bridge> problem solved 01:32 < bridge> finally, I managed to write a der file, I wanted to write a pem file but for some godforsaken reason only the der writer is working 01:32 < bridge> so I'll take it, der files it is 01:32 < bridge> 🎉 01:36 < bridge> Allah willing tomorrow I'll figure out how to save a PEM file 01:50 < bridge> https://media.discordapp.net/attachments/1083075203732607096/1396974494521757867/image.png?ex=68800962&is=687eb7e2&hm=4dd51ac1699dbee13799a4470a106ca4357fe403ad48abb16bc731eb34f4d846&=&format=webp&quality=lossless 01:50 < bridge> https://media.discordapp.net/attachments/1083075203732607096/1396974564692721694/image.png?ex=68800972&is=687eb7f2&hm=da8d38f7fc35afbc9383d480968cddf9ce084e2f969495bfc2259f9d96bc9f59&=&format=webp&quality=lossless 01:50 < bridge> https://media.discordapp.net/attachments/1083075203732607096/1396974998605795489/image.png?ex=688009da&is=687eb85a&hm=ff376b4ad294015121a0d3a3af4bc04139c81fac306f39687727a72441a413c8&=&format=webp&quality=lossless 01:50 < bridge> https://media.discordapp.net/attachments/1083075203732607096/1396975087185297518/image.png?ex=688009ef&is=687eb86f&hm=f86f2f1a9c6708f1ae3da7e28cb55c20ceabecded49171373370f0c2d49d913c&=&format=webp&quality=lossless&width=419&height=559 @everyone 01:51 < bridge> @Discord Mod ∆ 01:51 < bridge> everywhere 01:51 < bridge> Why didnt the ban delete them :/ 01:52 < bridge> you have to actually select it on the menu.... 01:53 < bridge> Well duh, I thought I did 01:54 < bridge> duh doesn't look like you did 01:54 < bridge> In every channel pllsss 01:59 < bridge> It doesn't always delete them for some reason even when you select it in the menu 03:04 < bridge> https://media.discordapp.net/attachments/1083075203732607096/1396974494521757867/image.png?ex=68800962&is=687eb7e2&hm=4dd51ac1699dbee13799a4470a106ca4357fe403ad48abb16bc731eb34f4d846&=&format=webp&quality=lossless 03:04 < bridge> https://media.discordapp.net/attachments/1083075203732607096/1396974564692721694/image.png?ex=68800972&is=687eb7f2&hm=da8d38f7fc35afbc9383d480968cddf9ce084e2f969495bfc2259f9d96bc9f59&=&format=webp&quality=lossless 03:04 < bridge> https://media.discordapp.net/attachments/1083075203732607096/1396974998605795489/image.png?ex=688009da&is=687eb85a&hm=ff376b4ad294015121a0d3a3af4bc04139c81fac306f39687727a72441a413c8&=&format=webp&quality=lossless 03:05 < bridge> https://media.discordapp.net/attachments/1083075203732607096/1396975087185297518/image.png?ex=688009ef&is=687eb86f&hm=f86f2f1a9c6708f1ae3da7e28cb55c20ceabecded49171373370f0c2d49d913c&=&format=webp&quality=lossless&width=419&height=559 @everyone 03:19 < bridge> woah is this real? 03:20 < bridge> @Discord Mod i think thats the right role to ping 04:39 < bridge> except that barely any of the mods have it afaik 05:56 < bridge> No mods have it, murpi learath and heinrich have it 05:57 < bridge> I used to have it, but I'm not active enough anymore 06:45 < ws-client> **** @learath2 i also use pyson http 06:45 < ws-client> **** but not only for testing <:justatest:572499997178986510> 07:13 < bridge> where do I set the client version number 07:14 < bridge> nvm 07:21 < bridge> Caddy is better, more features. I specifically care about video streaming which seems to work better with caddy. 07:30 < bridge> LOL 07:42 < bridge> ah yeah 07:42 < bridge> thats why i don't see part of skins in serverbrowser xd 08:13 < bridge> https://www.tomshardware.com/tablets/worlds-first-risc-v-tablet-is-finally-fully-baked-pinetab-v-now-ships-with-completely-functional-linux-for-usd149 08:13 < ws-client> **** can we get some progress on #10399 08:13 < chillerbot> https://github.com/ddnet/ddnet/issues/10399 10:04 < bridge> hi, i updated #10529 if anyone wants to take a look. would be nice if a maintainer gave opinion so I know if there's anything I especially need to fix earlier than later 10:04 < bridge> https://github.com/ddnet/ddnet/pull/10529 10:04 < bridge> btw how am i supposed to get clang format 10 on fedora lmao 10:18 < bridge> Macros 10:19 < bridge> If you are releasing crates that are all tightly integrated like this, you should be required by law to version them in lockstep 10:19 < bridge> What difference does it make 10:19 < bridge> It’s all statically linked and comes from crates io 10:22 < bridge> Well in this case the rng itself comes from rand. But the package I'm using only needs to commit to the interface in rand_core 10:24 < bridge> It only took 1 hour of my life to figure out why I couldn't pass the rng engine 10:29 < bridge> `ed25519_dalek` is the crate I was using btw 10:36 < bridge> Beware gen_range deprecation 10:53 < bridge> on it 🙂 11:10 < bridge> you still have other requested changes open. I know this sometimes can be annoying 12:35 < bridge> @pioooooo thank you for reporting the rendering bug. it's amazing, how stupid it is and it went unnoticed, because it only affects overlays and only on map borders 12:45 < bridge> cool, discord gh bot doesn't even show image links 13:34 < bridge> Would anyone else like to help review #9965? 13:34 < bridge> https://github.com/ddnet/ddnet/pull/9965 14:03 < bridge> @robyt3 14:03 < bridge> ```C++ 14:03 < bridge> for(int i = 0; i < m_pLayerQuads->m_NumQuads; ++i) 14:03 < bridge> { 14:03 < bridge> const CQuad *pQuad = &pQuads[i]; 14:03 < bridge> 14:03 < bridge> // calculate clip region 14:03 < bridge> for(int QuadIdPoint = 0; QuadIdPoint < 4; ++QuadIdPoint) 14:03 < bridge> { 14:03 < bridge> for(int Channel = 0; Channel < 2; ++Channel) 14:03 < bridge> { 14:03 < bridge> aQuadOffsetMin[Channel] = std::min(aQuadOffsetMin[Channel], pQuad->m_aPoints[QuadIdPoint][Channel]); 14:03 < bridge> aQuadOffsetMax[Channel] = std::max(aQuadOffsetMax[Channel], pQuad->m_aPoints[QuadIdPoint][Channel]); 14:03 < bridge> } 14:03 < bridge> } 14:03 < bridge> } 14:03 < bridge> ``` 14:03 < bridge> 14:04 < bridge> This is not possible, because the CQuad is const and you can't access m_aPoints for some reason, if pQuad is const 🤔 14:04 < bridge> 14:04 < bridge> Seems like `constexpr T &operator[](const int index) { return index ? y : x; }` in vmath.h is not const correct. 14:04 < bridge> it isn't, because it returns a reference 14:07 < bridge> Does `constexpr T &operator[](const int index) const { return index ? y : x; }` work? 14:09 < bridge> currently trying, I wouldn't wonder if it crashes somewhere else 14:11 < bridge> you mean `constexpr const T &operator[](const int index) const { return index ? y : x; }` 14:11 < bridge> 14:11 < bridge> And no, it crashes on 5 other places 14:11 < bridge> you mean `constexpr const T &operator[](const int index) const { return index ? y : x; }` 14:11 < bridge> 14:11 < bridge> And no, it ~~crashes~~ doesn't compile on 5 other places 14:11 < bridge> Maybe you need both operators 14:11 < bridge> const and non-const 14:12 < bridge> wouldn't that be ambigous? 14:12 < bridge> well compiler says it works 14:37 < bridge> <.puch> @totar Hello i'd like to know if it would be possible to force tclient to 0.7 in a bridge gctf server? 14:49 < bridge> block 14:50 < bridge> I assume it should work the same as in DDNet client. Use `tw-0.7+udp://:` to connect to the server 15:08 < bridge> is there a better way 15:08 < bridge> ` DoPopupMenu(pContext, X, Y, TextWidth + 10.0f, TextHeight + 10.0f, pContext, [this](auto... Args) { return this->PopupMessage(Args...); });` 15:09 < bridge> if pfnFunction now takes an std::function, force the Cui::* func ptr to a lambda 15:09 < bridge> without the stupid bind or lambda 15:09 < bridge> i could overload DoPopupMenu to also accept Cui::* and do the wrapping for you 15:09 < bridge> Ddnet context or t-client context 15:10 < bridge> ddnet 15:40 < bridge> https://www.businessinsider.com/replit-ceo-apologizes-ai-coding-tool-delete-company-database-2025-7 15:40 < bridge> kek 17:01 < bridge> I may or may not be cooking something here 17:02 < bridge> https://paste.pr0.tips/MII 17:04 < bridge> What is this 17:06 < bridge> It's a signed manifest file for updates, want to finally replace the old insecure autoupdater with an external binary 17:06 < bridge> The external binary will also serve as a crash pad of sorts to do crash reporting and any other thing we might want to do while starting ddnet 17:07 < bridge> It's a signed manifest file for updates, want to finally replace the old insecure (not exactly insecure, but it would be if we ever lose the ddnet domains) autoupdater with an external binary 17:37 < bridge> thx 17:38 < bridge> btw are inline conditionals used much elsewhere in dd code? 17:38 < bridge> i love me inline conditionals but sometimes it makes the flow of logic a bit less readable 17:39 < bridge> Ternaries? We use a few 17:40 < bridge> They look ugly when chained though and reading them is a little annoying. So avoid chaining too many 😄 17:43 < bridge> also what's the maintainer opinion on adding new sounds if there even is one 17:43 < bridge> No opinion afaik, I don't think anyone added one in years 17:48 < bridge> Would probably be a good idea for target switches 17:49 < bridge> (and fallback to an existing sound for old clients) 18:33 < bridge> bro gave an agent free access to production database? lmao 18:33 < bridge> kinda deserved 18:34 < bridge> Was it literally free access or was the wrong command approved by a human? 18:35 < bridge> not familiar with replit but i assume it's like agent mode on other llm tools where you describe what you want changed and it just builds code and runs commands in terminal 18:35 < bridge> if you don't double check the changes before you hit run all then you may get cooked 18:36 < bridge> If it works similar to claudes integration in the zed editor which i tried, it can automatically apply and run code/commands 18:36 < bridge> Like, "generate me a unit Test and run it on X and Y" would work without further confirmation needed 18:38 < ws-client> **** found a vanilla 0.6 player o.O 18:39 < ws-client> **** @louis from github 18:40 < bridge> Who??? 18:41 < bridge> ChillerDragon: what from github 18:49 < bridge> smartest vibe coder 18:55 < ws-client> **** @louis clang 18:55 < ws-client> **** can announcementns.txtx do comments? 18:57 < bridge> I'd be willing to create some sounds, I have a few options and ideas 18:59 < ws-client> **** nvm no comments needed anymore 19:00 < bridge> sure, its been a while since ive worked with audio 19:38 < ws-client> **** where download clang format?? 19:38 < chillerbot> you can download clang-format-10 here https://github.com/muttleyxd/clang-tools-static-binaries/releases 19:38 < ws-client> **** epic 19:50 < bridge> chiller are you botting again 19:50 < bridge> no 19:52 < bridge> no proof 19:53 < bridge> proof is above 19:53 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1397275368431423590/image.png?ex=68812197&is=687fd017&hm=17c88dbcb8e86424238efbdea837787c41152cad2641cfd2094d003008b6a460& 19:56 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1397276168922726622/image.png?ex=68812256&is=687fd0d6&hm=b1f7520d5b09c752c6d6656db8d4160d29329245f8f526b75b8014d86126e5d0& 19:56 < bridge> im stalking chillerdragon 20:01 < bridge> what do you get from stalking yourself?? xD 20:03 < bridge> hi can we add #10529 please thanks 20:03 < bridge> https://github.com/ddnet/ddnet/pull/10529 20:19 < bridge> Is anyone familiar with how to use this? https://gitlab.com/Patiga/twgpu/-/blob/master/twgpu-tools/src/bin/twgpu-encode-demo.rs 20:22 < bridge> all the things in the Cli struct are command line options 20:22 < bridge> `cargo r --bin twgpu-encode-demo.rs` 20:22 < bridge> `cargo r --bin twgpu-encode-demo` 20:23 < bridge> if you pass `-h`, it should show descriptions for all flags 20:37 < bridge> how are macros in rust any better than macros in C? 20:38 < bridge> don't they have the same issues? 20:38 < bridge> i mean obviously rust is more powerful but it still seems like macros aren't entirely aware about your code 20:42 < bridge> yeah they're more powerful 20:42 < bridge> yeah they're still macros 20:49 < bridge> rust macros are based on the AST and modifying it, C macros are text based with no notion of tokens and the like 20:50 < bridge> proc macros, the ones with derive are more powerful 20:50 < bridge> but they need a separate crate 20:51 < bridge> Rust macros are dope, but they need to make scoped versions of them 20:51 < bridge> have anyone make a proc macro which takes a prompt, sends it to chat gpt, takes the code and pastes the result as its body? xd 20:51 < bridge> https://github.com/edg-l/formy 20:51 < bridge> i made this long time ago 20:51 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1397290023266685132/image.png?ex=68812f3d&is=687fddbd&hm=4f7ee2b85a7d24772e65514bb71707340be1b9d62ef32c0b91325f1e3c912d4e& 20:51 < bridge> it makes a html form xd 20:51 < bridge> idk the use but idk why i did this 20:52 < bridge> neat 20:52 < bridge> that's cool honestly 20:53 < bridge> + https://github.com/jprochazk/garde 20:53 < bridge> https://crates.io/crates/validator 20:53 < bridge> i always used this 20:53 < bridge> didnt know 20:54 < bridge> This crate is heavily inspired by the validator crate. It is essentially a full rewrite of validator. The creation of this crate was prompted by this comment and a few others talking about a potential rewrite. 20:54 < bridge> looks like validator is not maintained a lot 20:54 < bridge> yeah 20:55 < bridge> i have yet to use either i just keep it in my brain's index of cool crates 21:47 < bridge> Idk if they are that capable, but a build.rs could do this I guess 21:48 < bridge> have anyone made a proc macro which takes a prompt, sends it to chat gpt, takes the code and pastes the result as its body? xd 21:59 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1397307103030546633/20250720_233020.jpg?ex=68813f26&is=687feda6&hm=a5a935dbd259049050aa0804c86d0bfccb018aac3bdc19bb09385ddb809a9a89& 22:07 < bridge> https://anuraag2601.github.io/gemini_cli_disaster.html 22:33 < bridge> Thanks but oufff it's not working 22:33 < bridge> Finally figured out all the dependencies though 22:33 < bridge> Wish there was Docker for it 22:39 < bridge> you should only need rust 22:39 < bridge> rustup is the best place to install it assuming you're not on a weird os 22:39 < bridge> Oh yeah I should clarify, I mean without DDNet, but DDNet also uses Rust, so yeah 22:39 < bridge> I was trying on Linux Mint locally, before trying anything on cloud 22:40 < bridge> idk what you mean but good luck 22:40 < bridge> I mean I didn't install DDNet and all of its dependencies 22:40 < bridge> teeworlds is becoming more and more attractive for contributors. It has less than 50 pending PRs and in 2 years Oy will come back to merge 20 at once. While DDNet has 100 stale PRs and in 2 years it will have 200 stale PRs. 22:41 < bridge> lol 22:41 < bridge> you know.. it all started when 0.7 was merged 22:42 < bridge> Nah bro you can’t defend ddnet here 22:42 < bridge> You maintain a teeworlds fork non ddnet based 22:44 < bridge> hey listen, we're migrating 22:44 < bridge> :kek: 22:44 < bridge> We should do a cleanup arc 22:44 < bridge> No more new prs 22:45 < bridge> Everyone who wants to open a new pr has to close 2. And all the plebs who don’t have close powers have to review 3 prs to be allowed to open one. 22:45 < bridge> hey, as long as #10529 gets merged i dont mind. 22:45 < bridge> https://github.com/ddnet/ddnet/pull/10529 22:45 < bridge> I mind 22:46 < bridge> Because everyone has favorites in the 100 pr pile and it’s a constant cherry picking 22:46 < bridge> We should just reach a low number so stuff doesn’t get stale again 22:47 < bridge> tho to be fair, stuff like #10496 is hard to merge because reviewing takes a long time 22:47 < bridge> its 1K loc changed, with UI and code structure changes 22:47 < bridge> https://github.com/ddnet/ddnet/pull/10496 22:47 < bridge> Oh yea my rule for that is atomic prs 22:47 < bridge> Prs should do one thing and one thing only 22:47 < bridge> Big diffs should be discussed in issues and then merged instantly 22:47 < bridge> roby would kill you! 22:48 < bridge> i love his `see commits` PR's 22:48 < bridge> I think he doesn’t fully disagree 22:48 < bridge> we should merge everything unconditionally 22:48 < bridge> :f3: 22:48 < bridge> I say close not merge 22:48 < bridge> Reject is better than stale 22:48 < bridge> merge 100 bad prs and make 100 new ones to fix 22:49 < bridge> merge 1 bad pr and 0.7 sits within hands reach, unused by 95% of the playerbase 22:49 < bridge> :dTeuMonkaW: i'll never forgive you chiller 22:49 < bridge> merge 1 ~~bad~~ pr and 0.7 sits within hands reach, unused by 95% of the playerbase 22:50 < bridge> I don't think it's bad there's just no way to gracefully handle 0.7 specific behavior 22:50 < bridge> @mpft: that’s also a strategy. Test on master 22:50 < bridge> Can’t do that always but at least as a phase 22:52 < bridge> @blaiszephyr: can’t tell if your joking but since I invested a lot of time into 0.7 I’ll defined it anyway. Does it even hurt you? It’s good stuff. The ctf community really needed it it’s struggeling to survive. 22:53 < bridge> I haven't actually seen any bugs or lingering shortcomings from 0.7 make it past the review stage. it seems stable 22:53 < bridge> whats wrong about having ctf on 0.6 22:53 < bridge> an issue i have with it is that we had dozens of PR's to fix 0.7 behavior on a 0.6 based client 22:53 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1397320729460084888/image.png?ex=68814bd6&is=687ffa56&hm=ef03c98b1d4c2e813bd58445cd954a4403072de24e21b17d0fabeb469134c8e8& 22:53 < bridge> Oh 22:54 < bridge> The PRs aren’t bad 22:54 < bridge> Smol things get merged quickly 22:54 < bridge> It splits the community 22:54 < bridge> Its bad if players try to follow each other and half of them don’t arrive 22:55 < bridge> Not everyone uses ddnet. Or at least used 4 years ago when I started the port 22:56 < bridge> What’s wrong with ctf on 0.6 is like saying what’s wrong with ddrace on ddnet 9.2 22:56 < bridge> I think this is still better than 0.7 servers shrinking to extinction 22:57 < bridge> They sadly are kinda extinct 22:58 < bridge> But occasionally I see some 1v1 of old pros xd 22:58 < bridge> Which I wouldn’t see if my client was stuck in 0.6 22:58 < bridge> everything seems extinct here except ddnet where there are at least 5 npcs online in usa at any given moment 22:59 < bridge> it's obviously totally subjective - within the last year my respect towards backwards compatibility dropped to almost zero. 22:59 < bridge> i'll dip now, i think i said everything i had to say, and it gets quite late 22:59 < bridge> didnt mean to bash your port or the implementation by the way, it was great work. its just me being annoyed that we even need to have it. 22:59 < bridge> that is kinda what it seems like 22:59 < bridge> Adding support for multiple editor maps won't exactly be easy to review either, currently`64 files changed, 4025 insertions(+), 3623 deletions(-)` without even adding the feature 22:59 < bridge> But 0.6 is the backwards stuff 22:59 < bridge> it's fair to be frustrated 23:00 < bridge> ouch.. - and respect. 23:00 < bridge> I think there is no cost to 0.7 especially if you have me who is willing to maintain it 23:00 < bridge> My biggest pain point is that I used up all my Heinrich points with that pr 23:00 < bridge> yeag 23:00 < bridge> you took all his remaining fucks to give 23:00 < bridge> for all of ddnet 23:01 < bridge> He was the big 0.7 defender. And after that pr was merged. He made sure to disagree with me on every single opinion to be ever existed 23:01 < bridge> is Heinrich a maintainer on teeworlds? or is Oy the only one with merge access. 23:01 < bridge> 23:01 < bridge> i worry that Oy may just, not come back. and then we have ddnet with constant updates and teeworlds will vanish into the depths of FOSS software 23:01 < bridge> well you have to get a second one 23:01 < bridge> oy inherited it 23:01 < bridge> Heinrich is just a technical maintainer 23:01 < bridge> Afaik he is the only one with merge access 23:01 < bridge> Hein has seniority tho 23:01 < bridge> He has powers but shouldn’t use them 23:02 < bridge> O 23:04 < bridge> chillerdragon try not to glaze teeworlds challange, impossible difficulty 23:04 < bridge> it's a pretty good game 23:04 < bridge> last commit 1 year ago before robyt3 and heinrich merged a security fix 😄 23:05 < bridge> any day now oy will come back and 0.8 will happen, trust 23:06 < bridge> it will have trails and pets 23:06 < bridge> the future of ddnet!!!!! :kek: 23:06 < bridge> ddnet will be completely obsolete by the time the update hits steam 23:07 < bridge> no players = no botters 23:07 < bridge> this is the current anti cheat 23:07 < bridge> ngl, that is kinda true 23:08 < bridge> @mpft have you ever used a `std::cell:LazyCell`? 23:12 < bridge> yeah what's up 23:13 < bridge> lazy loaded static memory for 1 thread 23:14 < bridge> What use is it? It's explicitly `!Sync` so it can't be in a static 23:14 < bridge> i don't know any vani person who used ddnet 0.7 to actually play on 0.7 servers 23:14 < bridge> 0.7 scene died the moment ddnet-insta appeared 23:15 < bridge> i still see no reason of having both bridge client and server 23:15 < bridge> it's a complete disaster 23:15 < bridge> Sync is used for programs with many threads 23:16 < bridge> so !Sync means it can't be used in more than one 23:16 < bridge> compiler markers 23:16 < bridge> or whatever 23:16 < bridge> yet Rust will happily require all statics be `Sync` whether you spawn multiple threads, or not, or use the static from multiple threads 23:16 < bridge> So I'm curious what the use of `LazyCell` which is explicitly `!Sync` is. You can't put it in a static, so what use is the lazy initialization? 23:17 < bridge> hmm i thnk i have used statics without sync 23:17 < bridge> im gonna check 23:19 < bridge> nvm i did not 23:19 < bridge> i probably encountered the same issue 23:22 < bridge> so thats why `once_cell` crate exists 23:22 < bridge> it provides LazyCell without the need for Sync implementation 23:22 < bridge> I'm sure whatever I wanted to use it for required Send+Sync anyway so I used a LazyLock 23:23 < bridge> perhaps it's just to specify your own synchronization mechanism 23:23 < bridge> nvm unsync::OnceCell can't be used in statics 23:23 < bridge> rust shenanigans 23:24 < bridge> so when using static memory over multiple threads you can do LazyCell for example, when you hsge a type that has its own synchronization mechanism (by virtue of an Arc or its own RwLock or whatever) 23:25 < bridge> LazyLock<> would provide redundant traits & worse performance for that I think 23:29 < bridge> hmm i think i have used statics without sync 23:30 < bridge> Are you sure? LazyCell contains an UnsafeCell which is explicitly !Sync, the LazyCell itself will never be Sync 23:30 < bridge> I'm not sure 23:31 < bridge> I don't think there's a remaining instance of the struct in any code I have 23:31 < bridge> i used it when trying to figure stuff out and eventually settled on something else 23:31 < bridge> the solution is don't use statics 23:31 < bridge> saw that you needed a crate like once_cell to get that behavior and decided to just do something else 23:32 < bridge> statics are fairly aids 23:32 < bridge> arc mutex everything 23:32 < bridge> I'll ask the rust people in the rust discord, I'm curious now what the use for this is 23:32 < bridge> arc tokio rwlock 23:32 < bridge> for more explicit access control 23:32 < bridge> and no panic 23:32 < bridge> Arc tokio RwLock everything in a single threaded application 23:32 < bridge> no 23:32 < bridge> Yes 23:32 < bridge> just to initialize a value when its being accessed xd 23:32 < bridge> maybe it is that simple 23:33 < bridge> but where would you have one if not in a static? just local in a function? ::D 23:33 < bridge> but where would you have one if not in a static? just local in a function? 😄 23:33 < bridge> yeah it does seem useless 23:34 < bridge> an example from the source code 23:34 < bridge> ```rs 23:34 < bridge> /// use std::cell::LazyCell; 23:34 < bridge> /// 23:34 < bridge> /// let lazy: LazyCell = LazyCell::new(|| { 23:34 < bridge> /// println!("initializing"); 23:34 < bridge> /// 92 23:34 < bridge> /// }); 23:34 < bridge> /// println!("ready"); 23:34 < bridge> /// println!("{}", *lazy); 23:34 < bridge> /// println!("{}", *lazy); 23:34 < bridge> ``` 23:34 < bridge> I'm sure it has some use, Rust people discuss for 8 billion years before merging anything, there is no way they merged something that isn't useful 23:39 < bridge> Rust discord enlightened me, it can be used in `thread_local`s and it can be used in a construction like 23:39 < bridge> ```rust 23:39 < bridge> struct Foo { 23:39 < bridge> ... 23:39 < bridge> expensive_to_calculate_field: Lazy 23:39 < bridge> }; 23:39 < bridge> ``` 23:39 < bridge> Rust discord enlightened me, it can be used in `thread_local`s and it can be used in a construction like 23:39 < bridge> ```rust 23:39 < bridge> struct Foo { 23:39 < bridge> ... 23:39 < bridge> expensive_to_calculate_field: LazyCell 23:39 < bridge> }; 23:39 < bridge> ``` 23:40 < bridge> oh yeah the struct thing is kinda obvious in hindsight 23:40 < bridge> but it'd have to be expensive to justify that 23:40 < bridge> lmao 23:40 < bridge> so the only advantage is for use in thread_local 23:40 < bridge> i have never used it tbh 23:41 < bridge> Yeah, maybe something like a type that holds a file handle and parses it only when accessed through that field 23:41 < bridge> facts 23:41 < bridge> only after i get mine in tho 23:42 < bridge> maybe for embedded stuff 23:42 < bridge> where doing many things at once can make the microcontroller go kaboom 23:42 < bridge> xd 23:44 < bridge> i mean matricks should also have merge perms but iirc he said he doesnt want to interfere 23:46 < bridge> makes sense 23:47 < bridge> I'll try one rn