01:26 < bridge> winter depression is a serious illness! 01:39 < bridge> <_voxeldoesart> good 08:54 < bridge> https://bughunters.google.com/blog/4805571163848704/llvm-cfi-and-cross-language-llvm-cfi-support-for-rust 10:11 < bridge> morning 10:26 < bridge> morn 10:27 < bridge> ing 11:20 < bridge> gni 11:21 < bridge> nrom 11:22 < bridge> 🚗 11:50 < bridge> Choo Choo 12:59 < bridge> Hello ! 12:59 < bridge> 12:59 < bridge> I have a little problem, my hook ingame have a delay. 12:59 < bridge> It's not anti-ping, i also try to off/on my pc and is not working :/ 12:59 < bridge> I have a delay of 200 ms on my hook ... 13:17 < bridge> turn off vsync 13:17 < bridge> Hello 13:17 < bridge> i have a problem 13:17 < bridge> so i refreshed DDNet and i have so low fps idk why 13:18 < bridge> how low? 13:18 < bridge> i had 200FPS before 13:18 < bridge> 20FPS 13:18 < bridge> do you know nightly builds? 13:18 < bridge> and its locked so it stucks at 20 max 13:18 < bridge> no 13:18 < bridge> The vsync is off 13:18 < bridge> its off 13:18 < bridge> https://ddnet.org/news/nightly-build-revived/ 13:18 < bridge> 13:18 < bridge> can you try this ^ ? 13:19 < bridge> was the delay always there? 13:19 < bridge> no 13:19 < bridge> i didn't play on my pc since 5 month and when i cb the delay was there but only on my hook the mouvement ect are normal 13:20 < bridge> mh dunno, reset config maybe 13:20 < bridge> rename ddnet in %appdata% for that 13:20 < bridge> else look in your mouse settings 13:20 < bridge> wow i have 340FPS thx 13:51 < bridge> Windows 10 13:51 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1184115357598875768/image.png?ex=658acc5d&is=6578575d&hm=9794e2f5f278fa5f3b6b45b639fe1fa14168a43f4a85d2009a2ea0ebf342555e& 13:53 < bridge> <_voxeldoesart> chad windows 10 user 13:55 < bridge> help pls ❤️ 13:59 < bridge> that's a warning not an error 13:59 < bridge> if you dont show the error nobody here can help 14:02 < bridge> someone really ought to go through and find all inappropriate c style casts and replace them 14:03 < bridge> there is very very very rarely an instance where you need a c cast 14:05 < bridge> c style casts are simpler to type 14:06 < bridge> i rarely ever used c++ casts 14:12 < bridge> c++ make it easier to avoid errors, and they more clearly state the intent 14:12 < bridge> c++ casts make it easier to avoid errors, and they more clearly state the intent 14:14 < bridge> @learath2 do u think a malloc done within a JIT engine from llvm needs to be freed manually (the process calling the jit engine is alive all time) or when the jit engine is done its fred 14:14 < bridge> i wonder if llvm jit has some docs on this 14:14 < bridge> i dunno, i'd not agree with that tbh 😄 14:15 < bridge> @jupeyy_keks best casts are pointer method casts in rust 14:15 < bridge> they are type checked 14:15 < bridge> i mean .cast() ans .const_cast() 14:15 < bridge> Hm, I have no idea on how llvm jit works. You'll have to dig around it's docs 14:16 < bridge> Modern C++ casts look so ugly and are so annoying to type, but they are better in every other aspect 14:16 < bridge> https://doc.rust-lang.org/std/primitive.pointer.html#method.cast_const 14:16 < bridge> my grip is there are lot of types of casts and they have long names 14:16 < bridge> and also ub 14:17 < bridge> i dislike dynamic cast, bcs it's simply overhead. 14:17 < bridge> 14:17 < bridge> const_cast is basically c cast 14:17 < bridge> 14:17 < bridge> and reinterpret cast should be avoided anyway 14:17 < bridge> or static cast 14:17 < bridge> isnt const cast for constness? 14:18 < bridge> i forgot 14:18 < bridge> does it even exist? 14:18 < bridge> oh u mean rust? 14:18 < bridge> its named cast_const xd 14:18 < bridge> *mut to *const 14:18 < bridge> `*mut T ` to `*const T` 14:18 < bridge> `*mut A ` to `*const T` 14:19 < bridge> You almost always want a static_cast, if you are a polymorphism enjoyer a dynamic_cast, if you are an opaque datatype enjoyer a reinterpret_cast and if you are doing blackmagic a bit_cast 14:19 < bridge> @learath2 do u think its sensible to expect the jit malloc and rust libc dep to be same 14:19 < bridge> and would a malloc from inside jit be ok with free from rust with libc 14:19 < bridge> Oh and when you hate that the type system doesn't have nice sane const, you use const_cast 😄 14:20 < bridge> evil answer: garbage collected 14:20 < bridge> <_voxeldoesart> polymorphism fan vs opaque datatype enjoyer 14:20 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1184122554047283280/image.png?ex=658ad310&is=65785e10&hm=5f1f192bac4342c8d77498ce11c0edcc2e08eaaa2056f15ce5f3f4d0eca896fa& 14:20 < bridge> mmh where you hear that 14:20 < bridge> funny how fast one can forget c++ 😬 14:20 < bridge> i used too much rust lately 14:20 < bridge> Uhh, this is something I have no idea about. If they really both use dynamically linked libc and the same libc, yes 14:20 < bridge> hear what? 14:21 < bridge> i think const cast is used when u face a badly designed api not using const 14:21 < bridge> same bro 14:21 < bridge> Problem is due to how const and overrides work some apis just cant be const correct 14:21 < bridge> actually implementing garbage collection can be orders of magnitude harder 14:21 < bridge> specially if u want a competitive gc 14:21 < bridge> Overloads* 14:21 < bridge> const T *const_ptr; 14:21 < bridge> auto ptr = const_cast(const_ptr); 14:21 < bridge> ill probs just refcount mallocs or smth 14:22 < bridge> Implement mark and sweep gc, go 14:22 < bridge> at my free time i started a weird project 14:22 < bridge> im implementing pascal in mlir 14:22 < bridge> cuz im bad at designing a language 14:22 < bridge> i picked a easy one 14:22 < bridge> avoid reinterpret and static cast 14:22 < bridge> those are the 2 safest 14:23 < bridge> avoid c++ 14:23 < bridge> thats the safest 14:23 < bridge> shut up pls 14:23 < bridge> :3 14:23 < bridge> reinterpret 14:23 < bridge> the word alone is unsafe xD 14:23 < bridge> There are a scant few legit uses of reinterpret cast 14:23 < bridge> hmmm 14:24 < bridge> hard to get much done without it when you have a base type and your derived objects are managed as points of the based type 14:24 < bridge> You almost always want a static_cast 14:24 < bridge> e.g. every object oriented system 14:24 < bridge> that sounds more like dynamic cast 14:24 < bridge> you are casting the ptrs 14:24 < bridge> and dynamic casts have: 14:24 < bridge> - overhead 14:25 < bridge> - can return null ptrs (kinda bcs of above) 14:25 < bridge> @learath2 is there a way to "try to free" a pointer but not segfault if u cant? 14:25 < bridge> bcs they do type checks 14:25 < bridge> dynamic casts arw 100% runtime overhead avoid them 14:25 < bridge> You mean upcasting? 14:25 < bridge> yes 14:26 < bridge> Static casts work just fine there if you already know for sure the type 14:26 < bridge> Someone: »today I made me a toast hawaii« 14:26 < bridge> Ryozuki: »but in rust …« 14:26 < bridge> And a dynamic cast just uses rtti to make sure the type is correct if you dont have another mechanism to figure it out 14:27 < bridge> i mean if the roaster would write "software written in rust" 14:27 < bridge> 14:27 < bridge> i'd buy it just for that 14:27 < bridge> ngl xd 14:27 < bridge> would be insanely funny 14:27 < bridge> Nope 14:27 < bridge> rusty toaster 14:27 < bridge> <_voxeldoesart> funniest rust advocate 14:28 < bridge> that's why when freeing a pointer you shoud set it to nullptr afterwards 14:28 < bridge> The issue with c style casts is the fallback behaviour that no one really knows off the top of their head 14:28 < bridge> that's why when freeing a pointer you should set it to nullptr afterwards 14:28 < bridge> that's why when freeing a pointer you should set it to `nullptr` afterwards 14:29 < bridge> or simply use unique_ptr 14:29 < bridge> welcome to #developer home of rust 14:29 < bridge> non zero cost 😬 14:29 < bridge> <_voxeldoesart> ddnet is still 90% cpp 14:29 < bridge> debugging ptr stuff is also not zero cost 14:29 < bridge> 😏 14:30 < bridge> 😬 14:30 < bridge> rust 14:30 < bridge> I mean I know it off the top of my head but most people just put a cast there and dont care. But you usually dont want it to fallback to reinterpret cast since at that point it's usually a mistake 14:30 < bridge> 😬 14:30 < bridge> 😬 14:30 < bridge> omg learath i wanted to surround it with faces 14:30 < bridge> Nooo bad timing 14:30 < bridge> @learath2 please delete your message 14:30 < bridge> repeating it over and over again does not make it right, you know 14:30 < bridge> xd 14:30 < bridge> lmao 14:30 < bridge> Fixed 14:30 < bridge> @learath2 lmao 14:30 < bridge> we shown u its right tho 14:31 < bridge> <_voxeldoesart> https://tenor.com/view/brick-wall-talk-gif-5290288 14:31 < bridge> i mean tbf, when using LTO, i am not sure 14:31 < bridge> it might or might not be zero cost, depends on how the compiler performs 14:31 < bridge> super low % 14:31 < bridge> It's still not 0 cost but it's like 0.00000001 cost 😄 14:31 < bridge> i see 14:31 < bridge> You get unlucky with caching and it's even 0.000001 cost 14:32 < bridge> my question is when will this actually matter. like who the hell cares. it’s so negligible you’re spending more effort talking about it than people will ever spend trying to counteract it 14:32 < bridge> If you also are still running ancient dram modules it might even be 0.1 cost 14:32 < bridge> idc i use it on my holy fight for rust 14:32 < bridge> :NekoEvil: 14:32 < bridge> <_voxeldoesart> guys be silent im going to become funny to ddnet devs 14:32 < bridge> i like rust but people behaving the way you are is what makes people dislike it 14:32 < bridge> that alone 14:33 < bridge> xDD 14:33 < bridge> is what gives the lang a bad rep 14:33 < bridge> <_voxeldoesart> what even is 100 cost 14:33 < bridge> im trolling a bit but ok 14:33 < bridge> <_voxeldoesart> 😂 😂 windows : 😂 😂 😂 😂 14:33 < bridge> ill fix it for you 14:33 < bridge> c++ best lang 14:33 < bridge> thank god we code in c++ 14:33 < bridge> i see it more as comedy 14:33 < bridge> cpp isn’t usually the best choice 14:33 < bridge> just be realistic 14:33 < bridge> you can’t do rust everything 14:33 < bridge> <_voxeldoesart> comedy involves it being funny 14:33 < bridge> At the scale of cost we are talking about with unique_ptr windows would be like TREE(3) cost 14:34 < bridge> you don't find it funny, how brainwashed he is? 14:34 < bridge> @learath2 realloc moving the ptr to a new addr doesnt mean i got to free the old addr right 14:34 < bridge> ur my libc docs now 14:34 < bridge> <_voxeldoesart> me when i dont find the same joke told 2763 times funny 14:34 < bridge> No, if realloc gives you a new addr that's the one ur responsible with freeing 14:34 < bridge> pointer points to same spot 14:35 < bridge> it's like in animes.. the joke was never funny. it will still be done 50000 more times 14:35 < bridge> thats the neat part, u can do rust everywhere u do c++ 14:35 < bridge> you can’t 14:35 < bridge> only limitation is maybe gcc on a weird platform 14:35 < bridge> that no one uses 14:35 < bridge> but soon thats fixed 14:35 < bridge> with the rust gcc 14:35 < bridge> or maybe existing code and standards and knowledge and experience and unit tests and other infrastructure 14:35 < bridge> you can’t just “”use rust”” anywhere 14:36 < bridge> ah u mean legally bound? i give u that 14:36 < bridge> technically rust can be used everywhere c++ is used 14:36 < bridge> sure 14:36 < bridge> depending upon the revision 14:36 < bridge> thats what i meant 14:36 < bridge> u should learn rust already 14:36 < bridge> i like cpp better 14:36 < bridge> jupstar was rly pro cpp 14:36 < bridge> i remember 14:36 < bridge> bad memory 14:37 < bridge> no 😬 14:37 < bridge> 100% 14:37 < bridge> Well Rust and C++ are both turing complete. You can technically do everything with them 14:37 < bridge> ryo u ask rudimentary cpp questions so i think your perception of pro cpp is a bit different 14:37 < bridge> <_voxeldoesart> you better dip asap 14:37 < bridge> <_voxeldoesart> every second you're around them they're just gonna poke at yoy 14:37 < bridge> It's just that the cost of migrating 2 decades of legacy code is extremely prohibitive 14:37 < bridge> <_voxeldoesart> you better dip asap 14:37 < bridge> <_voxeldoesart> every second you're around them they're just gonna poke at you 14:37 < bridge> im asking this basic stuff cuz i havent used libc for long xd and im lazy to check 14:38 < bridge> just saying 14:38 < bridge> He used to be good. Then he got enlightened by the rust tree and deleted his knowledge of other inferior languages 14:38 < bridge> u rly think my definition of someone pro at a programming lang is knowing library functions 14:38 < bridge> i think u misunderstood what i said 14:38 < bridge> but i am too tired to repeat myself 14:38 < bridge> ok 14:39 < bridge> i will hardly have advanced cpp questions because i literally dont use cpp 14:39 < bridge> and dont want to anymore 14:39 < bridge> advanced rust is more fun 14:39 < bridge> i looked into reinterpret cast and i suppose it’s only uniquely good for opaque data types like incomplete types or void ptrs 14:39 < bridge> but otherwise equivalent to static cast 14:40 < bridge> void ptrs are safe to cast from/to with static too. So only opaque data types and some very niche tricks 14:40 < bridge> i suppose 14:41 < bridge> i don’t see the harm anyway 14:41 < bridge> i feel like in some circumstances casting between void ptrs can get you in trouble with more pedantic compiler settings 14:42 < bridge> strict aliasing? 14:42 < bridge> that reminds me of something but ppl will get too mad 14:43 < bridge> <_voxeldoesart> ryo knowing limits? crazy 14:43 < bridge> @mpft do u know about pointer provenance 14:43 < bridge> "quick google" 14:43 < bridge> yea idk the term lol 14:43 < bridge> https://www.ralfj.de/blog/2020/12/14/provenance.html 14:43 < bridge> is this just about ptr arithmetic 14:44 < bridge> void and char ptrs are allowed to alias anything. So I'm unsure whether it can cause a strict aliasing issue, but even if it can the type of cast won't save you there 14:44 < bridge> true 14:44 < bridge> Pointer provenance is arcane black magic that you will almost never have to care about. I wouldn't even read about it 14:44 < bridge> Especially in C++ 14:45 < bridge> isn’t it just like uint8_t * != uint16_t * because sizeof() for each is different? 14:45 < bridge> It only ever is an issue if you use a placement new 14:45 < bridge> placement new is bonkers stuff that nobody in their right mind should use 14:45 < bridge> 😬 14:45 < bridge> use your words 14:46 < bridge> I’m not reading this blog post 14:46 < bridge> except for the time I recommended it be used for the ddnet kernel object or something 14:46 < bridge> If you are tight on memory there are some uses to it 😄 14:47 < bridge> perhaps 14:47 < bridge> Pointer provenance becomes an issue if you construct a new object of a different type in place of another 14:48 < bridge> provenance distingishes different pointers to the same address, its cuz due to optimizations u can get unexpected results 14:48 < bridge> right 14:48 < bridge> so it’s basically what i said 14:48 < bridge> this one is a rust definition 14:48 < bridge> > The provenance of a pointer is used to distinguish pointers that point to the same memory address (i.e., pointers that, when cast to usize, will compare equal). Provenance is extra state that only exists in the Rust Abstract Machine; it is needed to specify program behavior but not present any more when the program runs on real hardware. In other words, pointers that only differ in their provenance can not be distinguished any more in the final b 14:48 < bridge> The old pointer you held refers to a lifetime that has already ended, thus is technically invalid to access through. Which the compiler can optimize out causing UB 14:49 < bridge> no not exactly 14:50 < bridge> ```c 14:50 < bridge> char p[1], q[1] = {0}; 14:50 < bridge> uintptr_t ip = (uintptr_t)(p+1); 14:50 < bridge> uintptr_t iq = (uintptr_t)q; 14:50 < bridge> if (iq == ip) { 14:50 < bridge> *(char*)iq = 10; 14:50 < bridge> print(q[0]); 14:50 < bridge> } 14:50 < bridge> ``` 14:50 < bridge> this is the example from the blog 14:50 < bridge> i see 14:50 < bridge> As far as C++ is concerned it's about a way to break strict aliasing without invoking UB 14:50 < bridge> preposterous 14:50 < bridge> any way of circumventing optimizations may as well be IB 14:51 < bridge> ub 14:51 < bridge> https://youtu.be/5HXCbLilIzs?si=9YxrUMbpbXZOOONw if you wanna hear about a C++ feature you'll never have any use for 14:51 < bridge> i think i read about it 14:51 < bridge> novice cpp 14:51 < bridge> 😬 14:52 < bridge> what are you talking about 14:52 < bridge> nothing 14:52 < bridge> you know what is funny. 14:52 < bridge> All concepts i now use in rust, were ideas i had long before i've ever touched rust: 14:52 < bridge> 14:52 < bridge> https://discord.com/channels/252358080522747904/293493549758939136/994267418220306462 14:52 < bridge> 14:52 < bridge> https://discord.com/channels/252358080522747904/293493549758939136/966359790672556144 14:52 < bridge> 14:52 < bridge> https://discord.com/channels/252358080522747904/293493549758939136/997967609863602207 14:52 < bridge> 14:52 < bridge> I often agreed that rust solves the memory related stuff. Tbf i did not expect that proc macros solve a few of my issues for logic errors. Besides that i never am _really_ pro any language that exists yet. 14:52 < bridge> I'd need a language that is preventing logic errors to be as fanboy as you are about rust 😬 14:52 < bridge> 14:52 < bridge> I do think rust is better than cpp (with few exceptions), but i am defs less of a fanboy of rust than you think xD 14:52 < bridge> @ryozuki thanks for reading my ted talk 14:52 < bridge> 😬 14:53 < bridge> i also always said if a lang with better borrow checker or same idea comes 14:53 < bridge> My 3 favourite things about rust are: 14:53 < bridge> - Sum types/Error handling 14:53 < bridge> - Traits 14:53 < bridge> - proc_macros 14:53 < bridge> ill be first to switch 14:53 < bridge> 😬 14:53 < bridge> trur 14:53 < bridge> tsur* 14:53 < bridge> I'm not a huge fan of the whole fearless concurrency and automatic memory management. I'm an old man 14:53 < bridge> tsur > rust 14:53 < bridge> invent tsur 14:54 < bridge> Send + Sync, borrowck too smart for me 14:54 < bridge> i just like how it makes so much sense 14:54 < bridge> i leave since it seems ryo is just trying to troll 14:54 < bridge> ??? 14:54 < bridge> xd 14:54 < bridge> get someone’s goat. not sure whose 14:54 < bridge> good night 🌙 14:55 < bridge> If I were to make a language it'd take these 3 and transplant it into a clean version of C 14:55 < bridge> i was just making a snark remark at u for the pro cpp thing 14:55 < bridge> good night! 14:55 < bridge> what do you like about traits, if i may ask? 14:55 < bridge> I'd also steal namespaces from C++ 14:56 < bridge> I like the idea of methods acting on objects. I don't enjoy polymorphism that much though 14:56 < bridge> Traits are a nice compromise 14:56 < bridge> yeah i agree, i still try to generally minimize using them, except for containers or other "global" structures 14:57 < bridge> It gives me methods and a way to define shared behaviour 14:58 < bridge> I probably would also omit the automatic dereferencing in my language. It's just too much to think about for me 14:58 < bridge> uh why 14:58 < bridge> i find modules on rust best 14:58 < bridge> i think my top 3 are: 14:58 < bridge> - enum structs (and ofc the resulting pattern matching) 14:58 < bridge> - proc macros 14:58 < bridge> - easier ecosystem (e.g. adding deps etc.) 14:58 < bridge> actually includes in c c++ are thing of past 14:58 < bridge> well headers are from hell 14:58 < bridge> lets face it 14:58 < bridge> I could take Rust modules too yeah. I need some way to group things together the one namespace in C is so dirty 14:58 < bridge> i never in my life thought: oh now write the shit in headers is so much fun 14:59 < bridge> its harder to parse a header than anything else 14:59 < bridge> what u mean b enums is ADT algebraic data types 14:59 < bridge> <_voxeldoesart> when remove header files 15:00 < bridge> https://en.wikipedia.org/wiki/Algebraic_data_type 15:00 < bridge> this should be basis for any new lang 15:00 < bridge> yep, but e.g. in typescript it completely sucks 15:00 < bridge> without pattern matching it's kinda useless 15:00 < bridge> ye 15:00 < bridge> pattern matching is important 15:01 < bridge> strong typing 15:01 < bridge> 1 thing I like about header files is how they are like a summary of the class. I might have to figure out some way to separate that in my language too 15:01 < bridge> ts has a ez escape hatch from type system 15:01 < bridge> as any 15:01 < bridge> `as any` 15:01 < bridge> true, sometimes reading the functions of a class in headers is easier 😄 15:01 < bridge> rust is also more grepable than c 15:01 < bridge> grep fn 15:01 < bridge> but not smth an editor could not do 15:01 < bridge> to list functions 15:02 < bridge> I might steal the modern function declaration syntax too, but I also don't really want to break "declaration follows use" 15:05 < bridge> i also like i64 15:05 < bridge> vs int 15:05 < bridge> I can also takes lambdas from C++. I'll also need to patch together an async system. Something less fearless 15:08 < bridge> Maybe the idea of executors from rust, impeccable usability of ES6 promises, multiple executors from folly, and a Stream wrapper inspired by rxjs Observable, might make a nice unholy combination 15:09 < bridge> Some sort of coroutines would also be cool but it's a bit difficult to do 15:09 < bridge> do es6 promises finally add yield? 15:10 < bridge> i die without it 15:10 < bridge> No yield still 15:11 < bridge> i mean i only have like 3-4 use cases 15:11 < bridge> Wait which sort of yield are you talking about? 15:11 < bridge> Like yielding a value? 15:11 < bridge> it just hard without a notifier/notify system 15:12 < bridge> since js also doesnt have this 15:12 < bridge> i could live with a yield 15:12 < bridge> Are Observables perhaps what you are looking for? 15:13 < bridge> They are pretty enjoyable to use 15:13 < bridge> i'll look into it 15:13 < bridge> is nodejs thread safe? 15:13 < bridge> well webworkers have only limited functionality 15:14 < bridge> so you dont really have multi threading i'd say 15:14 < bridge> What does it mean for a js runtime to be thread safe? 15:14 < bridge> Chillerdragon you know of an js / ts lib to connect a client with acess to rcon? If not id rather do Network sniffer. If both dont work ill try writing something for reading remote dumps (then ill be sad tho) 15:14 < bridge> You really might have an easier time just building a client that does this 15:15 < bridge> Learning c++ from scratch is easier? 15:15 < bridge> the problem already is: 15:15 < bridge> js / ts have no udp support 15:15 < bridge> i dunno if nodejs has modules for it... maybe 15:15 < bridge> then you could maybe built ddnet to wasm 15:15 < bridge> and use it with js xd 15:15 < ws-client> @Bota yea as jopsti said if it is in the browser it wont work. Are you doing it in the frontend or backend? 15:16 < ws-client> @Bota also nudel said he did not add rcon so it might not work 15:16 < bridge> Ah, I thought you knew C++. Then that's a no go 15:16 < ws-client> @Bota i think my ruby client has rcon and it is really easy to use. Does the server you want it for accept 0.7 connections? 15:17 < bridge> @alex0006 have you ever checked how often log.txt is written by the client? 15:17 < bridge> 15:17 < bridge> i bet u can just add a `flush` somewhere and read from it live 15:17 < ws-client> https://github.com/ChillerDragon/teeworlds_network/blob/97de34f1518018292aa81aae3e0fb7d3ea91d6e0/docs/classes/TeeworldsClient.md#on_rcon_line 15:17 < bridge> then u _almost_ have to not alter the client 15:17 < bridge> Log probably doesnt contain rcon though 15:17 < bridge> I have a web framework for displaying 15:18 < ws-client> yea regular log does not contain rcon 15:18 < ws-client> there is console dump but it is not live 15:18 < bridge> Getting data outside the project is only possible via requests 15:18 < bridge> @alex0006 didnt u just want chat? xd 15:18 < bridge> I need chat data 15:18 < bridge> so no need for rcon right? 15:18 < bridge> I need ips 15:18 < bridge> lmao 15:19 < ws-client> @Jupstar ✪ no need for flush its pretty live 15:19 < bridge> isnt there a e-con? 15:19 < bridge> yeah but you on the master race linux 15:19 < ws-client> o 15:19 < bridge> There is but it's not enabled on ddnet servers and it wouldn't really be available to mods anyway 15:19 < bridge> makes sense 15:19 < bridge> Idk what a 0.7 server is. 15:19 < ws-client> whats the ip of the server 15:20 < ws-client> i can tell you 15:20 < bridge> He wants to use it on ddnet servers 15:20 < bridge> Official ddnet servers 15:20 < ws-client> they have 0.7 support 15:20 < ws-client> so you can use the ruby lib 15:20 < bridge> the ip is 127.0.0.1 15:20 < bridge> So ur ruby lib is a client easy to modify? 15:21 < ws-client> yea 15:21 < ws-client> lemme quikcly test if it can really join ddnet 15:21 < ws-client> or just vanilla 15:22 < bridge> Well ill just send the data from ur ruby client to my display frontend via http then. Figuring that out shouldn’t be hard 15:23 < bridge> In worst case ill let chatgpt do the coding 15:23 < ws-client> yea works 15:23 < bridge> Nice 15:23 < ws-client> i can also write the boilerplate code for u sec 15:24 < bridge> Im at work and i come late home, no rush 🙂 But ty 15:30 < ws-client> https://paste.zillyhuhn.com/hH 15:30 < ws-client> here u go 15:30 < ws-client> i realized it is a bit bugged and gets chat messages multiple times <:justatest:572499997178986510> 15:30 < ws-client> if you really start using that i will investigate that and fix my lib :) 15:32 < bridge> Ty if its that easy I’ll probably use it 15:32 < ws-client> yea ruby is really easy to use. The code makes sense does it? 15:32 < bridge> I can understand it 15:32 < ws-client> poggies 15:33 < bridge> For syntax ill have to look a bit but it looks very doable 15:33 < ws-client> thats where chatgpt will help 15:33 < bridge> Y 15:33 < ws-client> also feel free to ask me. You are the first user of that lib im still motivated to give support hehe 15:34 < bridge> Ill make the whole mod team use it if it has all i want 🙂 15:35 < bridge> The first frontend as backend to frontend application 15:35 < bridge> Lol 15:36 < bridge> just be careful to make it secure then xd 15:39 < bridge> The whole thing will be running only locally 15:39 < bridge> i c 15:39 < bridge> No Security needed 15:40 < bridge> If my poc work ill try something properly 15:42 < ws-client> If you want this client to talk with a front end this might be interesting for you too https://github.com/ChillerDragon/teeworlds_rest_client 15:43 < ws-client> its the same client but now with a rest api 15:43 < ws-client> but you would have to extend it your self to have also rcon endpoints 15:45 < bridge> Thats a whole client?! 15:45 < ws-client> the link i sent you is a webserver that uses the same library under the hood i showed you earlier 15:45 < ws-client> so if you start the webserver you can access api endpoints to get chat messages or make it move in game 15:49 < bridge> That webserver would be all i need 15:49 < bridge> Ill look at all of it when im home 15:50 < ws-client> i have to warn you i quickly hacked it together and it was the first test run of the underlying tw network lib and its all a bit wonkey 15:50 < ws-client> and you have to write some code for it also to expose the rcon stuff in the api but then yea it will be super close to what you need 15:51 < bridge> Once i get the data i need to develop the frontend. It should take a while. 15:52 < bridge> Like months 15:53 < bridge> In the meantime a lot can happen/ change 15:53 < ws-client> you mean i have a lot of time to fix the lib? :D 15:53 < bridge> And if you don’t touch ill i will try my luck. Thats not a lot of code 15:53 < bridge> If you want to 🙂 15:54 < bridge> Having someone on my project will be nice:D 15:54 < ws-client> yea the http thing is not a lot of code because all the teeworlds procotol is abstracted away by the other tw network lib 15:54 < bridge> Smart 15:55 < bridge> It’s fascinating how those dependency chains work somehow 16:03 < ws-client> lerato so i can use ``std::launder`` to fix ub? sounds pog 16:14 < bridge> not on windows 16:15 < bridge> got any evidence to the contrary? 16:16 < bridge> it doens't follow you can do everything the hardware supports with them 16:16 < bridge> brainfuck is also turing complete 16:17 < bridge> sounds like zig or so 16:17 < bridge> I posted something about 1-2 days ago, I think. it's extendable 16:18 < bridge> rustdoc 16:19 < bridge> link? 16:20 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1184152681284108328/image.png?ex=658aef1f&is=65787a1f&hm=296468336010ecd9909c1538d4a6b9233d53c5111b19411de46db22e54deba3e& 16:20 < bridge> I don't see an overhead. 16:21 < bridge> it depends on the program size anyway. the compiler can also optimize away heap allocations completely 16:21 < bridge> and if not program size, then other parameters 16:21 < bridge> https://firedbg.sea-ql.org/blog/2023-12-12-introducing-firedbg/ 16:26 < bridge> just to clarify: I don't care if there would be a small overhead, because 1. don't do premature optimization and 2. I avoid using `unique_ptr` anyway 16:26 < bridge> it's just wrong ^^ 16:26 < bridge> 1. i understand that 16:26 < bridge> 2. what is the alternative? 16:27 < bridge> micro optimizations are often waste of time. 16:27 < bridge> if your product isn't already almost perfect, they won't be the biggest bottleneck 16:28 < bridge> in bigger software it's usually some algorithms that are slow, or design flaws that prevent parallelizm 16:28 < bridge> i dont understand their example, but generally sounds funny. but also not very useful for complex programs xdd 16:30 < bridge> @jupeyy_keks references wherever possible, `shared_ptr` where it's semantically correct, or raw pointer where I can't avoid them. The problem with `unique_ptr` is, that STL containers expect their `::value_type` to be copy constructible, so you cannot use `unique_ptr` there 16:32 < bridge> yeah 16:32 < bridge> say it 16:32 < bridge> SAY IT 16:32 < bridge> 😄 16:32 < bridge> i want to state that i am indeed trolling a bit the c++ users out there xd 16:32 < bridge> but at the end rust box is the truly zero cost 😬 16:33 < bridge> fearless concurrency 16:33 < bridge> YEAH 16:33 < bridge> xd 16:34 < bridge> actually rust provides better value here 16:34 < bridge> due to the protection against data races 16:34 < bridge> zZz 16:34 < bridge> but we all know fussel is pro like learath and can do concurrency without an issue 16:34 < bridge> 😬 16:35 < bridge> did even write my own mutexes because i needed some with at most 1 byte in size 16:35 < bridge> @jupeyy_keks clang tooling itself shows the need for it, with their tsan 16:35 < bridge> so yes, concurrency isn't that difficult 16:35 < bridge> wait 3 seconds and u get 20 crates that do the same 16:35 < bridge> lmao 16:35 < bridge> i wrote my own kernel in rust, so what 16:36 < bridge> 😬 16:36 < bridge> he said it!! 16:36 < bridge> even in rust concurrency is hard 16:36 < bridge> fearless, but very hard 16:36 < bridge> its among the biggest programming hurdles 16:36 < bridge> yes 16:37 < bridge> same for async 16:37 < bridge> even rust 16:37 < bridge> doesnt protect for this https://en.wikipedia.org/wiki/ABA_problem 16:37 < bridge> and more 16:37 < bridge> ok async is kind of concurrency 16:37 < bridge> 16:37 < bridge> but i assume you meant multi threading 16:37 < bridge> just so many problems come out of multithreading 16:37 < bridge> but its not that hard 16:37 < bridge> kek 16:38 < bridge> https://github.com/ddnet/ddnet/issues?q=segfault+ 16:38 < bridge> @jupeyy_keks 16:38 < bridge> 😬 16:39 < bridge> lm ao 16:39 < bridge> https://github.com/ddnet/ddnet/issues/3326 16:39 < bridge> https://github.com/ddnet/ddnet/issues/1131 16:40 < bridge> bcs concurrency is hard 16:40 < bridge> 😛 16:40 < bridge> 🤭 16:40 < bridge> so many problems come out of using pointers, as long as you don't do it right 16:40 < bridge> where is the point? 16:40 < bridge> the point is with safe rust u cant get that problem (segfaults) 16:41 < bridge> but imo that's also not directly comparable 16:41 < bridge> multi threading is so much 16:41 < bridge> 16:41 < bridge> let alone some stupid dead lock 16:41 < bridge> but also the borrow checker itself with the exclusive mutability protects already u in mt 16:41 < bridge> u easily extend the lifetime of stuff, which can lead to leaks etc. 16:41 < bridge> it doesnt protect from deadlockes 16:42 < bridge> timing stuff 16:42 < bridge> just so hard 16:42 < bridge> @ryozuki there is a programming language to solve the problem of programmers not proper formatting code. It's one python's key feature to ›solve‹ a problem, a language should not try to solve. 16:42 < bridge> @jupeyy_keks did u ever check https://github.com/tokio-rs/loom 16:43 < bridge> @ryozuki there is a programming language to solve the problem of programmers not properly formatting code. It's one python's key feature to ›solve‹ a problem, a language should not try to solve. 16:43 < bridge> not really, but i like that 16:43 < bridge> same goes with java, and rust too: solving problems a language should not solve … 16:43 < bridge> uh 16:43 < bridge> i dislike that argument, its like saying no to progress xd 16:43 < bridge> i cant rebate that 16:44 < bridge> if u dont like progress thats it 16:44 < bridge> the python syntax sucks, bcs i have a formatter that formats my code 😛 16:44 < bridge> the problems rust solves are among the most important in the field 16:44 < bridge> I don't like haskell. but I readily admit it's something useful 16:44 < bridge> so python syntax only forces the code to have few less keywords as `;` 16:44 < bridge> for me c++ is not useful 16:44 < bridge> rust is 16:44 < bridge> also for me haskell isnt rly useful 16:45 < bridge> In matters of ›progress‹ not of ›personal taste‹ 16:45 < bridge> python is useful as a scripting lang, rust is useful for safe systems, c++ is useful to get segfaults to test ur kernel page protection 16:45 < bridge> 😬 16:45 < bridge> but what if u write a rust interpreter 16:45 < bridge> 😏 16:45 < bridge> xd 16:46 < bridge> c++ offers you facilities to easily avoid segfault. so if you get one, it's your fault ^^ 16:46 < bridge> in matters of progress, rust is the biggest in language progress 16:46 < bridge> its hilarious to deny that 16:46 < bridge> anyway, one thing in this discussion is important. 16:46 < bridge> 16:46 < bridge> Rust at least partially tries to fight against/solve problems of c++. 16:47 < bridge> 16:47 < bridge> it does not really try to solve problems of python etc. 16:47 < bridge> sry @ryozuki didn't want to shit in your bible 😦 16:47 < bridge> ??? xd 16:47 < bridge> what bible 16:47 < bridge> its a fact 16:48 < bridge> wait i give u the paper 16:48 < bridge> https://plv.mpi-sws.org/rustbelt/stacked-borrows/paper.pdf 16:48 < bridge> good read 16:49 < bridge> @jupeyy_keks we got a c++ supremacist on chat 16:49 < bridge> we got competence now 16:49 < bridge> you are right. but once you use these components you kinda force yourself into an ecosystem anyway. 16:49 < bridge> 16:49 < bridge> Rust is higher level than cpp. just is cpp STL higher level than coding in c directly 16:49 < bridge> cpp can offer all the new facilities, but always have those old ones 16:49 < bridge> and many c++ code is old using those 16:49 < bridge> so u have to adapt to it 16:50 < bridge> If we are pedantic, yes. But I thought it was obvious that neither language would allow anything the hardware doesn't allow 16:52 < bridge> tbh my point there was that rust can also be used in the fields where c++ is used 16:52 < bridge> well its where it should be used most 16:53 < bridge> Immediately after that I illustrated the overhead in question. Which was summarily dismissed for some reason 😄 16:54 < bridge> ye he is ignoring the godbolt link 16:54 < bridge> i resent it actually xd 16:55 < bridge> also from a economical standpoint, at corpo level, rust would be a safer bet than c++ 16:55 < bridge> No matter how you look at it Rust is indeed a good replacement to C++ 16:55 < bridge> u cant expect all ur engineers to have a master level in c++ where they know wont do ub ever ever 16:56 < bridge> like our chatters here 16:56 < bridge> To C is a bit more doubtful. Embedded Rust didn't look very ergonomic last I took a look at it 16:56 < bridge> its getting a bit better 16:56 < bridge> u can follow the embedded rust newsletter 16:56 < bridge> xD 16:56 < bridge> our prophet has spoken 16:57 < bridge> ok maybe its in TWIR 16:57 < bridge> i read from time to in in rust reddit 16:57 < bridge> https://github.com/rust-embedded/wg 16:58 < bridge> i think the kernel is helping rust become a doable replacement 16:58 < bridge> for example the try api for allocating 16:58 < bridge> on some places 16:58 < bridge> i forgor 16:59 < bridge> https://github.com/rust-lang/rfcs/pull/2116 17:01 < bridge> futex/waitonaddress? Any other way to achieve this without kernel help can't have very nice properties under contention I imagine 17:01 < bridge> `std::atomic`s 17:01 < bridge> <_voxeldoesart> post ddnet code in it and go "ugh.. too much c++ 🥱" and see if some madlad actually rewrites 300 files and over 8000 lines of code in rust 17:02 < bridge> <_voxeldoesart> post ddnet code in it and go "ugh.. too much c++ yawning_face" and see if some madlad actually rewrites 300 files and over 8000 lines of code in rust 17:02 < bridge> <_voxeldoesart> (wrong reply) 17:02 < bridge> xd 17:02 < bridge> there have been rust madlads 17:02 < bridge> https://tenor.com/view/programming-rust-c-lang-cpp-cplusplus-gif-26743262 17:02 < bridge> <_voxeldoesart> if someone actually does that i would finally have respect 17:03 < bridge> https://doc.rust-lang.org/std/sync/atomic/ 17:04 < bridge> In C++20 you can just wait on them, and that is implemented by futex/waitonaddress and if neither are available it'll poll with some backoff. Polling with backoff has very meh behaviour under contention. That's why I was curious 17:05 < bridge> would you join that guy in a team as graphic designer if it were about teeworlds? 17:05 < bridge> <_voxeldoesart> i mean if it doesnt have to rely on backwards compat then maybe 17:05 < bridge> epic 17:05 < bridge> <_voxeldoesart> ddnet is pretty much a fish out of water now 17:06 < bridge> best language is assembly without libc 17:07 < bridge> Only on processors with no pipelining, no reordering 17:07 < bridge> speaking about critical sections: 17:07 < bridge> i saw a blog about this benchmark 17:07 < bridge> https://github.com/matklad/lock-bench 17:07 < bridge> 17:07 < bridge> and then tested it on my pc: 17:07 < bridge> ``` 17:07 < bridge> std::sync::Mutex avg 15.508196ms min 11.315727ms max 16.916332ms 17:07 < bridge> parking_lot::Mutex avg 172.935745ms min 161.698901ms max 182.067695ms 17:07 < bridge> spin::Mutex avg 15.546313ms min 11.218683ms max 37.585821ms 17:07 < bridge> AmdSpinlock avg 14.614385ms min 12.399496ms max 18.728032ms 17:07 < bridge> 17:07 < bridge> std::sync::Mutex avg 15.30766ms min 12.545613ms max 16.991576ms 17:08 < bridge> parking_lot::Mutex avg 168.617568ms min 144.948258ms max 178.966609ms 17:08 < bridge> spin::Mutex avg 15.319146ms min 12.435505ms max 26.911885ms 17:08 < bridge> AmdSpinlock avg 14.980674ms min 12.09597ms max 20.006563ms 17:08 < bridge> ``` 17:08 < bridge> 17:08 < bridge> 1. it's interesting that his spin locks are so insanely slow 17:08 < bridge> 2. WTF is happening with parking_lot on my pc 17:08 < bridge> my results are just completely different than his lmao 17:08 < bridge> ^ above is extreme contention btw 17:09 < bridge> i am only interesting in light contention, but wanted to test all out 17:09 < bridge> 127ms waiting on a spin damn. Could it be an OS thing? 17:10 < bridge> yeah very probably, but i once read that linux is actually not the best OS when it comes to spin, bcs of the thread schedular 17:10 < bridge> bcs it cannot cleanly assume that a spinning thread can be paused 17:10 < bridge> but i am on linux.. and it's super fast 17:10 < bridge> 😬 17:10 < bridge> I remember a chromium bug that happened because the NT Kernel would preempt a thread right as it was about to start waiting on an uncontested mutex 17:11 < bridge> i think they explained somewhere 17:11 < bridge> but on recent rust std uses the futexes 17:11 < bridge> 1.62 17:13 < bridge> @learath2 u can change the scheduler when compiling kernel right 17:13 < bridge> > New scheduler in Linux 6.6 will boost performance 17:13 < bridge> > 17:13 < bridge> > A core element of any operating system are the scheduling systems, which organize and schedule how different operations will execute and in what order. 17:13 < bridge> > 17:13 < bridge> > The Linux 6.6 kernel introduces the new Earliest Eligible Virtual Deadline First (EEVDF) scheduler that will replace the existing Completely Fair Scheduler (CFS) that has been the primary CPU scheduler since 2007. 17:13 < bridge> > 17:14 < bridge> > EEVDF aims to improve on CFS in areas like latency handling to boost overall performance. EEVDF calculates a lag value for each process representing the difference between its allocated CPU time and how much it has actually received. Processes with positive lag are deemed “eligible” to run. It also calculates a virtual deadline for each process based on its lag and assigned time slice. The scheduler runs the process with the earliest virtual 17:14 < bridge> > 17:14 < bridge> > By assigning smaller time slices to latency-sensitive processes, EEVDF can prioritize giving them quick access to the CPU when needed. 17:14 < bridge> > 17:14 < bridge> > “It completely reworks the base scheduler, placement, preemption, picking — everything,” Kernel developer Peter Zijlstra wrote in a Linux kernel mailing list message comparing EEVDF to CFS. “The only thing they have in common is that they’re both a virtual time-based scheduler.” 17:14 < bridge> anyway, spin locks are still unbeatable if you don't expect contention on my PC. 17:14 < bridge> 17:14 < bridge> parking_lot is very close. 17:14 < bridge> 17:14 < bridge> so i guess i can live with using parking_lot in most my projects 17:14 < bridge> 17:14 < bridge> 😏 17:15 < bridge> I have a bizarre issue for years now. My computer only on linux will sometimes just randomly get huge iowait numbers on a device and stagger 17:15 < bridge> I couldn't figure it out for the life of me. I have a feeling it's something about the io scheduler, but no idea what 17:16 < bridge> I had the need of many (hundrets to thousands) independent mutexes, but I had to save memory wherever I can in this class. `std::mutex` is 40 bytes iirc, that was way too much 17:16 < bridge> Well ofc. Exactly why pthread mutexes will actually spin a couple times before yielding in most implementations 17:16 < bridge> true, but rust std mutices/mutexes do that, apparently simply for a too short time (?) 17:16 < bridge> bcs they are the worst of all 4 in the benchmark 17:17 < bridge> Hm, I never looked into rust mutexes ngl 17:17 < bridge> or they have other overhead 😄 17:17 < bridge> what are iowait numbers? could this be due to ur old hdds? 17:18 < bridge> It's an ssd that's having the huge iowait. But it is an old ssd so maybe. But under windows it never hangs like that 17:18 < bridge> do u have noatime in ur fstab btw 17:19 < bridge> https://wiki.gentoo.org/wiki/SSD 17:19 < bridge> iowait is the amount of time the cpu is spending on waiting for io 17:19 < bridge> what u done, if i may ask? 17:20 < bridge> I should but I'll double check 17:20 < bridge> i just want to know a use case of these amount of mutexes 😄 17:20 < bridge> > For rootfs it is usually recommended to periodically use fstrim utility. Using the discard mount option results in continuous discard that could potentially cause degradation of older or poor-quality SSDs[5]. 17:21 < bridge> @jupeyy_keks i had many, well, lets call it nodes of a graph (it's a possibility to view it), which got processed, while processing one usually lead to processing others. this all done multithreaded, so every node needed his own mutex 17:22 < bridge> @jupeyy_keks i had many, well, lets call it nodes of a graph (it's a possibility to view it), which got processed, while processing one usually lead to processing others. this all done multithreaded, so every node needed its own mutex 17:22 < bridge> i c 17:22 < bridge> @learath2 are compiler intrinsics smth in the standard in c and c++? 17:23 < bridge> Ofc not 17:23 < bridge> but can u expect smth portable across the same arch but different compilers 17:24 < bridge> clang and gcc share some, but at the end of the day there is no guarantee for anything 17:24 < bridge> If you want to support a compiler you'll need to add an ifdef for it 17:26 < bridge> Compiler intrinsics are well extremely compiler specific 😄 17:28 < bridge> Cool C++ feature of the day: `std::valarray` 17:28 < bridge> lol 17:28 < bridge> It's very very unused, buuut both clang and llvm will vectorize it if it's a suitable size 17:29 < bridge> both clang and gcc* 17:29 < bridge> Cool C++ misfeature of the day@ `std::vector` 17:29 < bridge> is this different than a slice in || rust || ? 17:29 < bridge> Cool C++ misfeature of the day: `std::vector` 17:29 < bridge> valarray 17:29 < bridge> Yes, it has nothing to do with it 17:30 < bridge> Slices in rust would maybe be like ranges in C++20 17:30 < bridge> Valarrays are real vectors in the sense of vectors of linear algebra 17:30 < bridge> You can add them, subtract them 17:30 < bridge> ah i see 17:31 < bridge> Who thought this was a good idea I wonder 17:32 < bridge> "The problem is that the specialised version of std::vector provided by the Standard Library does not fulfil the requirements of a Standard Library container, and so is not guaranteed to work properly with the Standard Library algorithms." 17:32 < bridge> quick google 17:33 < bridge> is this whats this about 17:33 < bridge> Yes, in C++98 someone decided it was a great idea to specialize vector so bools are stored in a bitset instead 17:34 < bridge> ```cpp 17:34 < bridge> struct Bool 17:34 < bridge> { 17:34 < bridge> bool v; 17:34 < bridge> } cool_bool; 17:34 < bridge> ``` 17:34 < bridge> :troll: 17:34 < bridge> But that breaks a lot of the promises containers make, so `std::vector` isn't eveb a standard container 😄 17:35 < bridge> I wonder if this actually works. I doubt the compiler is allowed to see through your struct 17:35 < bridge> better delete, before the overhead gang roasts you 17:35 < bridge> This should be 0 overhead, worey not 17:35 < bridge> Worry* 17:35 < bridge> 😬 17:35 < bridge> lmao 17:35 < bridge> he actually deleted 17:36 < bridge> https://mlir.llvm.org/docs/Dialects/Vector/ 17:36 < bridge> something cool 17:36 < bridge> i missed it 17:37 < bridge> who posted? xd 17:37 < bridge> secret 17:37 < bridge> but he dared to add 3 bytes padding to a bool 17:38 < bridge> It shouldn't get padded methinks 17:38 < bridge> without packing? 17:39 < bridge> A single member in a struct shouldn't get padded ever iirc 17:39 < bridge> they thought it would be smart to pack the bools into bits. on first glance it's an idea … 17:39 < bridge> not the member, but the whole struct, bcs of alignment requirements 17:40 < bridge> The alignment requirement of a struct with one member is the members alignment requirement, no? 17:40 < bridge> i dunno would be news to me 17:40 < bridge> i'd have thought it's 4. bcs in c there is no bool and all other types have no size guarantee 17:40 < bridge> or smth 17:41 < bridge> on x86 17:41 < bridge> but if not, then i learned smth new about cpp today 17:41 < bridge> 😬 17:42 < bridge> it should 17:42 < bridge> @learath2 do you check? else i do xd 17:42 < bridge> yes ^^ 17:42 < bridge> but my mouse partially broken 17:42 < bridge> that's annoying 17:42 < bridge> i have g502 hero 17:42 < bridge> rustler mouse 17:43 < bridge> i have that too tomorrow 17:43 < bridge> nice 17:43 < bridge> but i'll miss my old 17:43 < bridge> razor viper v2 flex 17:43 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1184173657061335200/71g60fx8csL.png?ex=658b02a8&is=65788da8&hm=7571679175378c3a2c1fb3a6eee8e6c8a7405b4492fdb7701476dc98c0d3b886& 17:43 < bridge> white looks cool 17:43 < bridge> this is kda special 17:43 < bridge> ew league 17:43 < bridge> @jupeyy_keks will finally be good at gores :poggers: 17:43 < bridge> i waited for this day for so long 17:44 < bridge> closed source gores* 17:44 < bridge> looks fancy 17:44 < bridge> but doesnt fit my setup 17:44 < bridge> yeah u right 17:44 < bridge> interesting 17:44 < bridge> and weird 17:44 < bridge> razer viper v2 flex 17:44 < bridge> why weird 17:44 < bridge> @jupeyy_keks did u ever check the rust Layout struct 17:44 < bridge> add 2 bools 17:44 < bridge> to the struct 17:44 < bridge> it has lot of fancy utilities 17:44 < bridge> I checked too but I was on phone so too slow 😄 17:44 < bridge> https://doc.rust-lang.org/std/alloc/struct.Layout.html 17:45 < bridge> It still shouldn't tm get padded 17:45 < bridge> add 1 bool and a short 17:45 < bridge> https://www.razer.com/de-de/gaming-mice/razer-viper-v2-pro 17:45 < bridge> Now that'll get padded 17:45 < bridge> https://www.razer.com/en-en/gaming-mice/razer-viper-v2-pro 17:45 < bridge> https://www.razer.com/gb-en/gaming-mice/razer-viper-v2-pro 17:46 < bridge> https://www.razer.com/us-en/gaming-mice/razer-viper-v2-pro 17:46 < bridge> https://www.razer.com/gb-en/gaming-mice/razer-viper-v2-pro 17:46 < bridge> and that is nice? 17:46 < bridge> very 17:47 < bridge> have no trouble at all with this. i got it about 1y ago 17:47 < bridge> very light very gud 17:47 < bridge> even though 100€ 17:48 < bridge> now i need a >60hz display and ill be top10 in gores 17:48 < bridge> mine has adjustable weight 17:48 < bridge> i lost the weights tho 17:48 < bridge> but i never used em 17:48 < bridge> gj 17:48 < bridge> I always use my mouse at max weight 17:48 < bridge> bro is training 17:48 < bridge> thats why u so bad at ddnet (jk) 17:49 < bridge> I started playing games on an old wireless mouse that had two massive batteries in it that made it heavy asf 17:49 < bridge> Now I need to mimic that same feeling to play 😄 17:49 < bridge> quiz time 17:49 < bridge> ```c++ 17:49 < bridge> struct s { 17:49 < bridge> bool a; 17:49 < bridge> short b; 17:49 < bridge> bool c; 17:49 < bridge> }; 17:49 < bridge> 17:49 < bridge> struct t { 17:49 < bridge> s d; 17:49 < bridge> bool e; 17:49 < bridge> }; 17:49 < bridge> ``` 17:49 < bridge> 17:49 < bridge> you have 10 seconds to answer 17:49 < bridge> sizeof of struct 17:49 < bridge> Which struct? S or t or both? 17:49 < bridge> well t ofc 17:49 < bridge> but u can also say both 17:50 < bridge> I'd say sizeof t == ||6|| 17:50 < bridge> 5 🙂 17:50 < bridge> 1 + 1(padding) + 2 +1 17:50 < bridge> Wher spooler? 17:50 < bridge> ||8|| 17:50 < bridge> answer is: 6 17:51 < bridge> for t? yes 17:51 < bridge> ye 6 makes sense 17:51 < bridge> I have a strong mental compiler 17:51 < bridge> i spoke about s ^^ 17:51 < bridge> hmmmm 17:51 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1184175660906852392/image.png?ex=658b0486&is=65788f86&hm=981f66fe286985b10e27205e54158c4e97295207e705b4b561cdd2636a7f1b1a& 17:51 < bridge> So you tried cheating :hmm: 17:51 < bridge> ok now same question, but only for RUST, but in rust: 17:51 < bridge> ```rs 17:51 < bridge> struct s { 17:51 < bridge> a: bool, 17:51 < bridge> b: i16, 17:51 < bridge> c: bool, 17:51 < bridge> } 17:51 < bridge> ``` 17:51 < bridge> 17:52 < bridge> @learath2 @ryozuki 17:52 < bridge> it was after!! 17:52 < bridge> Only Allah knows how Rust lays out structs 17:52 < bridge> easy: just 1 MOV 17:52 < bridge> s is also 6 btw 17:52 < bridge> bcs of alignment 17:52 < bridge> for x86 with current rust compiler 17:53 < bridge> I still maintain my position 😄 17:53 < bridge> 3 17:53 < bridge> 2 17:53 < bridge> 1 17:53 < bridge> answer is: 4 17:53 < bridge> sry i was in bath 17:53 < bridge> rust is allowed to reorder 17:53 < bridge> Yeah that would make sense. Rust doesnt mind reordering 17:53 < bridge> room 17:53 < bridge> rust ordering is not stable btw 17:54 < bridge> it can change between compiler versions 17:54 < bridge> it's ok, for our quiz it was stable 17:54 < bridge> 😏 17:54 < bridge> xd 17:54 < bridge> Is there a way to force a certain order? 17:55 < bridge> repr C 17:55 < bridge> You sometimes want a specific order for it to be cache friendly 17:55 < bridge> repr C 17:55 < bridge> xd 17:55 < bridge> https://doc.rust-lang.org/nomicon/other-reprs.html 17:55 < bridge> you are the winner btw but psst 17:55 < bridge> > This is the most important repr. It has fairly simple intent: do what C does. The order, size, and alignment of fields is exactly what you would expect from C or C++. Any type you expect to pass through an FFI boundary should have repr(C), as C is the lingua-franca of the programming world. This is also necessary to soundly do more elaborate tricks with data layout such as reinterpreting values as a different type. 17:56 < bridge> answer is: 6 for s, 8 for t 17:56 < bridge> there is also repr(align(n)) 17:57 < bridge> Fwiw I don't really understand this one actually 17:57 < bridge> @learath2 can you explain why t is not allowed to optimize it? 17:58 < bridge> Oh actually I do understand it nvm 😄 17:58 < bridge> My brain just miscompiled it 17:59 < bridge> It can't optimize because s has already been padded and you can access t by using a pointer to s due to the common initial sequence rule 18:00 < bridge> will rust optimize the size or not? 18:00 < bridge> 18:00 < bridge> ```rs 18:00 < bridge> struct s { 18:00 < bridge> a: bool, 18:00 < bridge> b: i16, 18:00 < bridge> } 18:00 < bridge> 18:00 < bridge> struct t { 18:01 < bridge> a: s, 18:01 < bridge> c: bool, 18:01 < bridge> } 18:01 < bridge> ``` 18:01 < bridge> s was previously 4, when c was in s 18:01 < bridge> is t: 18:01 < bridge> - still 4 18:01 < bridge> - 6 18:03 < bridge> @ryozuki you answer, ur the rust guy 18:03 < bridge> it will reorder s probs 18:04 < bridge> b -> a 18:04 < bridge> idk 18:04 < bridge> xd 18:04 < bridge> my compiler says: 6 18:04 < bridge> I would say 6 aswell 18:04 < bridge> ok one last about cpp again 18:04 < bridge> ```cpp 18:04 < bridge> #pragma pack(1) 18:04 < bridge> struct s { 18:04 < bridge> short a; 18:04 < bridge> bool b; 18:04 < bridge> }; 18:05 < bridge> 18:05 < bridge> struct t { 18:05 < bridge> s mystruct; 18:05 < bridge> bool c; 18:05 < bridge> }; 18:05 < bridge> ``` 18:05 < bridge> 18:05 < bridge> size of t AND s 18:05 < bridge> 3 and 4 18:05 < bridge> 3 and 4 too 18:05 < bridge> xd 18:05 < bridge> ||3 and 4|| 18:05 < bridge> ez, correct answer 18:05 < bridge> Noooo I forgor spoolers 18:05 < bridge> is pragma pack standard 18:05 < bridge> Nope 18:06 < bridge> @jupeyy_keks rust has packed too 18:06 < bridge> where rust shines is in niche optimizations 18:06 < bridge> specially in enums 18:06 < bridge> So on a compiler that doesnt support it it's 4 and 8? 18:07 < bridge> size of `Option>` 18:07 < bridge> troll 18:07 < bridge> 4 and 6 actually, 6 is enough 18:07 < bridge> NonZeroU64? 18:07 < bridge> its pointer sized 18:07 < bridge> ah true 18:07 < bridge> u wrote box 18:07 < bridge> lmao 18:07 < bridge> none uses the nullptr value 18:07 < bridge> that box can never have 18:07 < bridge> yeah 18:07 < bridge> 32bit or 64bit 18:07 < bridge> 😏 18:07 < bridge> so it has no tag 18:08 < bridge> the enum 18:08 < bridge> Is this optimization available to users of the language? 18:08 < bridge> @jupeyy_keks thats why i said pointer sized 18:08 < bridge> in Rust, when specifying dependencies: should I always use the lowest possible SemVer-compatible version? 18:08 < bridge> imo it would make sense, since you have all the features you need yourself and get maximum compatibilty with other libraries with the same dependency 18:08 < bridge> yes, through NonZero types 18:08 < bridge> Or is it something only compiler black magic can accomplish? 18:08 < bridge> Ah cool 18:08 < bridge> mno, its done by the compiler through builtin types 18:08 < bridge> nonzore is builtin ye 18:08 < bridge> zero 18:08 < bridge> cant type 18:08 < bridge> NonNull exists for pointers too 18:08 < bridge> box would be props a NonNull 18:08 < bridge> Oh, so can't you implement a NonZero type yourself? 18:09 < bridge> https://doc.rust-lang.org/std/ptr/struct.NonNull.html 18:09 < bridge> no sadly 18:09 < bridge> soon u will 18:09 < bridge> that would be insane 18:09 < bridge> its a nightly feature 18:09 < bridge> range types 18:09 < bridge> 0 overhead Options for all 18:09 < bridge> ada has this btw! 18:10 < bridge> curious but true, I was never interested in trailing paddings ^^ 18:10 < bridge> I don't understand, what kind of type would you want to implement? 18:10 < bridge> i mean u could say that's why cargo.lock exists? 18:10 < bridge> or do i get your question wrong 18:11 < bridge> `MyCoolNonZeroBigInteger` e.g. 18:12 < bridge> u always want to purposely use lower version, so cargo can decide to use a newer one if a dep has a newer one? 18:12 < bridge> ok maybe i am too confused 18:14 < bridge> Another cool thing could be to let me have the option bool inside my own struct, like an intrusive option 18:14 < bridge> @learath2 if ur interested in the optimizations rust does check out https://research.checkpoint.com/2023/rust-binary-analysis-feature-by-feature/ 18:14 < bridge> E.g. I have a nonzero value at the start of my struct, you can use the zero of that and I save a byte or 4 depending on alignment 18:14 < bridge> it shows a lot of them 18:15 < bridge> its a rly interesting blog 18:15 < bridge> > You attempt to analyze a binary file compiled in the Rust programming language. You open the file in your favorite disassembler. Twenty minutes later you wish you had never been born. 18:15 < bridge> > 18:15 < bridge> > You’ve trained yourself to think like g++ and msvc: Here’s a loop, there’s a vtable, that’s a global variable, a library function, an exception. Now you need to think like the Rust compiler. Maybe you’ve heard about “sum types” and “generics” and “iterators”, maybe you haven’t, and in both cases you are going to have an exceptionally bad time. 18:16 < bridge> Or even 7/15 bytes in the worst case 18:17 < bridge> u can do that in cpp right? 18:17 < bridge> 18:17 < bridge> if you mean that 18:17 < bridge> https://en.cppreference.com/w/cpp/language/bit_field 18:17 < bridge> I meant as in zero storage cost wrapping my struct in an `Option` 18:18 < bridge> ah yeah, but this sounded like it 18:18 < bridge> u kinda would reserve the space 18:18 < bridge> xd 18:18 < bridge> An extra 17 bytes just to add a bool could actually be very meh for the cache depending on the size of the struct 18:18 < bridge> i dunno how you would imagine that feature, but sounds interesting 18:18 < bridge> 15* 18:18 < bridge> (was distracted for a few mins) oooh, your own types which can be wrapped into bools with no size changes. I thought that this is something Rust already does, by giving you no specifications about your struct layout and taking freedoms such as this one. 18:18 < bridge> e.g. if you have a non-zero member in your struct, I would've assumed Rust will optimize your Option of that struct by itself. (not just Option but any other enums) 18:19 < bridge> Idk maybe the compiler can optimize to use any NonZero value inside the struct? 18:20 < bridge> I'm not very familiar with the very low levels of Rust but it would be nice to have these sorts of things especially when layout is crucial 18:20 < bridge> but when do u ever need the layout of option 18:21 < bridge> I think `Cargo.lock` was just to record the very specific dependency list for the last successful build 18:21 < bridge> (was distracted for a few mins) oooh, your own types which can be wrapped into Options with no size changes. I thought that this is something Rust already does, by giving you no specifications about your struct layout and taking freedoms such as this one. 18:21 < bridge> e.g. if you have a non-zero member in your struct, I would've assumed Rust will optimize your Option of that struct by itself. (not just Option but any other enums) 18:21 < bridge> edit: bool -> Option 18:21 < bridge> but why can u then do cargo update 18:21 < bridge> i think it's simply for shared deps version control 18:22 < bridge> as in: everyone who uses your project will have the same deps 18:22 < bridge> I'm not sure. My current understanding is, that it gives you less compatibility with other libs 18:22 < bridge> some day you should show me an example for a struct that has more than 1 member 18:22 < bridge> maybe i understand it then 18:22 < bridge> generally sounds useful, but cannot really imagine what exactly you meant 😄 18:22 < bridge> since when you specify `1.2.3`, you are no longer compatible with `1.2.2` 18:23 < bridge> `Option>>` whats the size of this 18:23 < bridge> 9 18:23 < bridge> ||9|| 18:23 < bridge> well cannot answer it then. i thought patch versions dont matter? 18:23 < bridge> 18:23 < bridge> at least cargo upgrade simply upgrades them without any flag 18:24 < bridge> it doesnt define those as breaking changes 18:24 < bridge> and `Option>>>` 18:24 < bridge> result: || both are 16 || 18:24 < bridge> you scare me ||I'd still say 9|| 18:24 < bridge> huh 18:24 < bridge> a, fair 18:24 < bridge> 16 or 12 18:24 < bridge> xd 18:24 < bridge> but 16 18:24 < bridge> bcs algin 18:24 < bridge> bcs align 18:24 < bridge> yea, I forgot align 18:24 < bridge> btw Option is 16 too 18:25 < bridge> You know how `Option>` has the same size as `Box`? I was just curious if one could have a similar thing for any type `K` 18:25 < bridge> @ryozuki try to do the same for NonZeroU64 18:25 < bridge> 18:25 < bridge> and additionally add so many Option< until it breaks the compiler 18:25 < bridge> into thinking it has overhead 18:26 < bridge> in the `Cargo.toml` you specify the minimum depency like that 18:26 < bridge> 16 18:26 < bridge> 8 if 1 option 18:26 < bridge> yeah, but i'd like to see the syntax for how to define it for K. 18:26 < bridge> 18:26 < bridge> It sounds useful, but for a struct with many members, it kinda sounds non trivial 18:26 < bridge> just curious 18:26 < bridge> OH 18:26 < bridge> that's indeed interesting 18:26 < bridge> @learath2 also interesting for you 😬 18:27 < bridge> https://github.com/BenH11235/rust-re-tour/blob/main/other_sample_programs/truly_pathological_sum_types/src/main.rs 18:27 < bridge> check this out 18:27 < bridge> do all libs generally do that? 😄 18:27 < bridge> Any NonZero member no matter how deeply nested could be a candidate for the presence flag 18:27 < bridge> what is a lib requires the patch version of another @patiga 😄 18:27 < bridge> xd 18:28 < bridge> ah i see 18:28 < bridge> intersting 18:28 < bridge> kind of automatic 18:28 < bridge> I've had cargo pull in multiple versions of a lib. That is rather annoying behaviour 18:29 < bridge> do you even speak about a binary, or about a lib? 18:30 < bridge> given 18:30 < bridge> ```rust 18:30 < bridge> pub struct String { 18:30 < bridge> vec: Vec, 18:30 < bridge> } 18:30 < bridge> ``` which has a size of 24 18:30 < bridge> its option is also 2 18:30 < bridge> 24 18:30 < bridge> OH, how does this one happen? 18:31 < bridge> the string ptr 18:31 < bridge> the vec ptr 18:31 < bridge> * 18:31 < bridge> ```rust 18:31 < bridge> pub(crate) struct RawVec { 18:31 < bridge> ptr: Unique, 18:31 < bridge> cap: usize, 18:31 < bridge> alloc: A, 18:31 < bridge> } 18:31 < bridge> ``` 18:31 < bridge> i think for binaries i'd use latest semver 18:31 < bridge> for libs maybe caret 18:31 < bridge> ```rust 18:31 < bridge> pub struct Vec { 18:31 < bridge> buf: RawVec, 18:31 < bridge> len: usize, 18:31 < bridge> } 18:31 < bridge> ``` 18:31 < bridge> don't trust me tho 18:31 < bridge> trust @ryozuki 18:31 < bridge> he knows anything 18:32 < bridge> So there is some magic in the compiler that can do the optimization I was curious about? 18:32 < bridge> yes 18:32 < bridge> lib 18:32 < bridge> That's cute. I wonder what the requirements are 18:32 < bridge> yes 18:33 < bridge> mh ok 18:33 < bridge> the build system tries to find a compatible version with semver versioning 18:34 < bridge> yeah but like: what if you lib doesn't work with some unpatched version 18:34 < bridge> ```rust 18:34 < bridge> enum SumType2 { 18:34 < bridge> OneOption(i64), 18:34 < bridge> AnotherOption(String) 18:34 < bridge> } 18:34 < bridge> ``` 18:34 < bridge> size of this? 18:34 < bridge> given string is 24 18:34 < bridge> || > What’s happened here is that the compiler, in its quest for memory efficiency, has decided that it’s not going to do with 4 fields what it can do with 3. Instead of keeping a separate tag field, the compiler figured that it can piggyback off the String structure’s buf pointer. In case of AnotherOption, this pointer can’t be 0 (Rust doesn’t support that “feature”), so the possible value 0 is instead appropriated to signify”this 18:34 < bridge> || its 24 || 18:35 < bridge> what is a unpatched version? 18:35 < bridge> i would say no and heinrich agrees with this iirc 18:35 < bridge> unless u want compat with old rust compilers 18:35 < bridge> ah, so my mental image was correct after all ^^ 18:35 < bridge> well lets say you use library `a` and in version 1.0.0 the library crashes for you 18:35 < bridge> 18:35 < bridge> but in 1.0.1 it's fixed 18:35 < bridge> 18:35 < bridge> i'd write "^1.0.1" 18:35 < bridge> and break compability 18:35 < bridge> eh 18:37 < bridge> really? 18:37 < bridge> heinrich agrees with that? 18:37 < bridge> wow 18:37 < bridge> i'd really not expect that 18:37 < bridge> for what reason? 18:37 < bridge> that would be out of his character 😂 18:38 < bridge> hm I'd hope that the dependency resolution choosea the highest version 18:38 < bridge> why should it 18:39 < bridge> or differently: 18:39 < bridge> why should it without cargo update 18:39 < bridge> coz it should be compatible and higher version = good ^^ 18:39 < bridge> and does it do that everytime u add a library, for all libraries? 18:40 < bridge> what if two libs use a 18:40 < bridge> so a is already in cargo.lock 18:40 < bridge> cargo.lock has no say over the version afiak 18:40 < bridge> it's a funny problem, i never thought about it lmao 18:40 < bridge> no but if it's already in as version 1.0.0 18:40 < bridge> 18:40 < bridge> what updates it? 18:41 < bridge> cargo add yourlib? 18:41 < bridge> it does 18:41 < bridge> you specify stuff in cargo.toml, cargo.lock ist just kind of a log 18:41 < bridge> actually no 18:41 < bridge> if lock says X version it will use that 18:41 < bridge> u need to cargo update 18:41 < bridge> to update the lock 18:42 < bridge> maybe cargo clean is enough? ^^ 18:42 < bridge> lock is only modified by cargo build if cargo toml version is totally incompatible 18:42 < bridge> it isnt 18:42 < bridge> cargo.lock stays between cleans 18:42 < bridge> huh, interesting 18:42 < bridge> a clean cargo build uses lockfile 18:42 < bridge> use cargo update to truly update 18:42 < bridge> cargo.lock generally is smth you also upload to repos, isnt it? 18:42 < bridge> yes 18:42 < bridge> if u want reproducible builds (idk if totally reproducible) 18:42 < bridge> but at least other libs depending on you don't care about cargo.lock afaik 18:42 < bridge> no for libs it isnt 18:43 < bridge> is only for final bins 18:43 < bridge> yea 18:43 < bridge> and it can be annoying if two maintainers do cargo update 😬 18:43 < bridge> cargo new --lib gitignores the lock 18:43 < bridge> but that's a different problem xDD 18:43 < bridge> i had it once 18:43 < bridge> tho u may want the lockfile in a lib 18:43 < bridge> sry I don't understand your question 18:43 < bridge> to have reliable ci 18:43 < bridge> if `a` is in cargo.lock as version 1.0.0 18:43 < bridge> 18:43 < bridge> and you add your lib 18:44 < bridge> cargo add yourlib 18:44 < bridge> thats why I don't get why you should cargo update 18:44 < bridge> do you think `a` in cargo.lock gets updated in this moment 18:44 < bridge> well everything is a trade 18:44 < bridge> reproducable builds = same behavior 18:44 < bridge> i guess most ppl prefer that 18:44 < bridge> over a patched library 18:45 < bridge> over a patched/up-to-date library 18:45 < bridge> @deen what rooms were you talking about 🤔 18:45 < bridge> if I have a as 1.0.0 and someone depends on my crate, they might have a= 1.9.15 in their cargo.lock I think 18:46 < bridge> yes but what if not 18:46 < bridge> and your lib crashes on 1.0.0 18:46 < bridge> then it crashes 18:46 < bridge> lmao 18:47 < bridge> thats why I hope that it chooses the highest available version 18:47 < bridge> i personally would always use a version i tested with tbh 18:47 < bridge> but I guess if ryo looked it up, it uses the lowest compatible ine 18:47 < bridge> *one 18:48 < bridge> i dunno what cargo's behavior is, but if your lib uses 1.0.2 18:48 < bridge> and another 1.0.1 18:48 < bridge> 18:48 < bridge> why should it not use 1.0.2 for the other too anyway following your argumentation? 18:48 < bridge> in worse case you'd have updated the cargo.toml of someone else 18:49 < bridge> that is exactly what the dependency resolution does 18:49 < bridge> but true 18:49 < bridge> I didn't see the symmetry 18:50 < bridge> the highest version should be just as compatible as the lowest version 18:50 < bridge> yeah 😄 18:50 < bridge> 18:50 < bridge> but still interesting question 18:51 < bridge> i never really thought about it 18:51 < bridge> guess i'd be a bad lib maintainer xdd 18:52 < bridge> xd 18:53 < bridge> no, it uses highest compat one without a pre existing lockfile 18:53 < bridge> then it writes lockfile with it 18:54 < bridge> im in mobile rn and frustrated typing here xd 18:54 < bridge> 👍 thats sensible behavior 18:54 < bridge> same :p 18:54 < bridge> i have no working mouse, does that count too? 18:54 < bridge> with pre existing lockfile it will only update if carg toml has a version higher 18:55 < bridge> and write to lockfile 18:55 < bridge> no slacking allowed here, go grab your mobile 19:48 < bridge> @_voxeldoesart https://future.mozilla.org/blog/introducing-memorycache/ 19:48 < bridge> > Augmenting Local AI with Browser Data: Introducing MemoryCache 19:49 < bridge> https://www.phoronix.com/news/FFmpeg-CLI-MT-Merged 19:55 < bridge> s is 6 btw 20:15 < bridge> <_voxeldoesart> wait so what even is the usecase?? 20:16 < bridge> <_voxeldoesart> is firefox just making a "haha we know your browser history" extension 20:16 < bridge> no it doesnt share history data 20:16 < bridge> its a local ai 20:16 < bridge> local on ur device 20:17 < bridge> > MemoryCache is an early exploration project from the Mozilla Innovation Ecosystem team that augments an on-device, personal model with local files saved from the browser to reflect a more personalized and tailored experience through the lens of privacy and agency. 20:17 < bridge> > oday, MemoryCache is a set of scripts and simple tools to augment a local copy of privateGPT. The project contains: 20:17 < bridge> > 20:17 < bridge> > A Firefox extension that acts as a simple "printer" to save pages to a subdirectory in your /Downloads/ folder, and includes the ability to quickly save notes and information from your browser to your local machine 20:17 < bridge> > A shell script that listens for changes in the /Downloads/MemoryCache directory and runs the privateGPT ingest.py script 20:17 < bridge> > Code to (optionally) update the Firefox SaveAsPDF API on a local build of Firefox to enable a flag that silently saves webpages as PDF for easier human readability (by default, pages need to be saved as HTML in Firefox) 20:17 < bridge> <_voxeldoesart> i dont need a personalized browser that doesnt even know me 20:18 < bridge> i would like it 20:18 < bridge> for example to ask 20:18 < bridge> "that blog about rust in the past about niche optimizations" 20:18 < bridge> and it finds it for me in my history 20:19 < bridge> <_voxeldoesart> i mean you can just 20:19 < bridge> <_voxeldoesart> use your brain 20:19 < bridge> :pepeW: 20:20 < bridge> <_voxeldoesart> that has to be the most useless executive flytrap idea yet 20:20 < bridge> <_voxeldoesart> ai browser history 20:21 < bridge> lol 20:23 < bridge> <_voxeldoesart> if people actually need a machine to refind something for them then we're doomed as a society 20:32 < bridge> Like using bookmarks instead of remember the full URLs? Or using the search function instead of scrolling through the whole history manually to find something? What's so different about using "AI" to perform a fuzzy search of your history instead of doing a keyword based search? 20:33 < bridge> you can sell the AI thing to the AI enjoyers 20:34 < bridge> while the other is boring 20:34 < bridge> you can sell the other to voxel, bcs it's no AI 20:34 < bridge> That's why I asked, he said needing a machine is bad, but I doubt he doesn't use bookmarks 20:35 < bridge> i use no bookmarks xdd 20:35 < bridge> <_voxeldoesart> because at least with bookmarks you're actually in control of what you want to save. the ai is just going to think its helping but it could very well be a gateway to advertizing 20:36 < bridge> Do you have 1000 tabs open or search your history every time? :justatest: 20:36 < bridge> <_voxeldoesart> id rather be boring than not used by copper and wires 20:36 < bridge> in fact i use anonym tab most of the time, bcs google gives worse results when i already searched something 20:36 < bridge> so i dont even have a huge browser history 20:37 < bridge> How do you refind something that you looks at earlier? 20:37 < bridge> How do you refind something that you looked at earlier? 20:37 < bridge> i look in my brain 20:37 < bridge> 😬 20:37 < bridge> :pepeW: 20:37 < bridge> <_voxeldoesart> at max i have 20 tabs open but i get overwhelmed by that amount and close the entire session and reopen to a blank slate 20:38 < bridge> i also often do that xD 20:38 < bridge> i hate many tabs 20:38 < bridge> <_voxeldoesart> same 20:38 < bridge> <_voxeldoesart> mostly by remembering 20:38 < bridge> i also rarely reread stuff, or delay reading stuff 20:38 < bridge> 20:38 < bridge> either i read it, or idc xD 20:40 < bridge> I often have bookmark folders for info about various games that I sometimes start playing again, I don't really remember all the links otherwise if I don't play regularly 20:40 < bridge> i wish i could be that organized xD 20:40 < bridge> i am way to lazy for that 20:41 < bridge> It's still a mess, but an organized one 20:41 < bridge> The difference is Voxel hates AI 20:42 < bridge> at least he makes us think so 20:42 < bridge> I regularly abuse google as that browser history ai so I welcome the addition 20:43 < bridge> explain how a local ai that helps u search ur history leads to advertising 20:43 < bridge> I usually remember only keywords about blogposts I've read. E.g. ETW, chromium, nt kernel, bug, asciirandom 20:44 < bridge> I guess it could have secret bias towards companies that pay more, idk if that's possible given it's probably open source 20:45 < bridge> <_voxeldoesart> biased results towards mozilla afilliated links?? idk 20:46 < bridge> <_voxeldoesart> no, i Know so, because you guys are a slap in the face as to why i should be against it 20:47 < bridge> it's ok honey, you already admited to me that you like AI 20:47 < bridge> u even showed me some tool that uses AI 20:47 < bridge> what's the url of the ddnet http master server for fetching the json data? 20:47 < bridge> same 20:47 < bridge> <_voxeldoesart> which was that again 20:47 < bridge> i also have a big bookmark folder with manga 20:47 < bridge> <_voxeldoesart> oh yea 20:47 < bridge> the music thing 20:47 < bridge> cant remember exactly 20:47 < bridge> :NekoEvil: 20:48 < bridge> <_voxeldoesart> difference was i was in control 20:48 < bridge> https://master1.ddnet.org/ddnet/15/servers.json and https://info.ddnet.org/info 20:48 < bridge> thanks 20:48 < bridge> fine by me 😄 20:48 < bridge> :danger: dont bookmark it :danger: 20:49 < bridge> what's the difference? 20:49 < bridge> one being official ddnet servers? 20:49 < bridge> other the rest? 20:49 < bridge> the funny thing is, i sometimes google them bcs i forget the URL xD 20:49 < bridge> ill bookmark them all 20:49 < bridge> ok, one has player info 20:49 < bridge> Depends on what you need, one is the list of servers with all the server info, the other is the ddnet info json 20:50 < bridge> like no one ever was 20:50 < bridge> all servers with playercount is what I need 20:51 < bridge> servers.json is server list 20:51 < bridge> (Y) 20:51 < bridge> https://publicdomainreview.org/features/entering-the-public-domain/2024/ 20:52 < bridge> ddnet 20:52 < bridge> 😏 20:52 < bridge> 😏 20:52 < bridge> @learath2 @jupeyy_keks 20:52 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1184221347283488828/image.png?ex=658b2f12&is=6578ba12&hm=b9b79c555f7348f4ad7d4da57ee7ae7430111853047e89483c92837a01b0b1d0& 20:52 < bridge> this will be 20:52 < bridge> public domain 20:53 < bridge> epic 20:54 < bridge> unfortunately only that single film 20:54 < bridge> directly watch on youtube 20:56 < bridge> NOOOOO won't somebody think of the shareholders??? 20:57 < bridge> This is communism 20:59 < bridge> i wait for the day when dragonball goes public domain 20:59 < bridge> then i quit my job 21:00 < bridge> code a good db game, and show konami the middle finger 21:00 < bridge> then i can die in peace 21:01 < bridge> it's sad that they don't also have to release the project files 21:01 < bridge> like in programming the source code 21:01 < bridge> would be kinda cool 21:48 < bridge> https://www.youtube.com/watch?v=rHIkrotSwcc there's a talk about there being overhead. I guess you want me to unpack it, since you don't want to watch a video? 21:50 < bridge> just like C, trying to shove everyone into the concept of functions etc. 21:51 < bridge> not helpful. huge projects like chromium get segfaults despite competent programmers being involved 21:55 < bridge> `sizeof(struct s) == 6`, `sizeof(struct t) == 8`? 21:56 < bridge> 4 21:57 < bridge> t: 8 21:57 < bridge> eh, 6, I mean 21:57 < bridge> 3, 4 21:58 < bridge> depends on whether you want to track that down or not 21:58 < bridge> it's hard to ensure that it keeps working though, there's some work on -Z minimal-versions IIRC 21:58 < bridge> for cargo 21:58 < bridge> source? 21:59 < bridge> rewind time everybody 21:59 < bridge> rust already does that 22:00 < bridge> correct 22:00 < bridge> yes 22:00 < bridge> only everyone using your project directly. if they have your project as a dependency, your Cargo.lock will be ignored 22:00 < bridge> 16 22:01 < bridge> 16 22:01 < bridge> it is 22:01 < bridge> it's called "niche" in rust, I think 22:02 < bridge> yep, that 22:02 < bridge> yes 22:02 < bridge> hmmmm. not really. it's used for people directly compiling your crate 22:04 < bridge> if people actually need a machine to help them look up definitions, we're doomed. oh wait, wikipedia 22:04 < bridge> that you can use different words. but a fuzzy search over the content would already be nice 22:05 < bridge> you could say that about any software. everything produced by mozilla could be biased towards mozilla. what's special about "AI" aka LLMs? 22:06 < bridge> hi o/ 22:08 < bridge> hai 22:09 < bridge> I already demonstrated the exact example from this talk in a godbolt 22:10 < bridge> ah, here. @Fussel 22:14 < bridge> is it possible to compile ddnet for linux on windows? 22:15 < bridge> native windows? 22:15 < bridge> or is WSL allowed? 22:15 < bridge> native 22:15 < bridge> i mean theoretically possible yes, but never heard of a toolchain tbh 22:15 < bridge> you probably mean "possible" as in "can you give me a manual"? 22:17 < bridge> yeah i mean like is there a way easier than just cloning source and recompiling on linux 22:17 < bridge> run the windows version in wine? 😄 22:18 < bridge> :justatest: 22:18 < bridge> else very probably not easier 22:18 < bridge> bcs compiling on windows IMO is not ez 22:20 < bridge> no. compiling on the target system will be the easiest 22:20 < bridge> cross-compiling unfortunately seems to be always harder than getting the target OS directly (in a VM or directly on hardware) and compiling there 22:22 < bridge> wasnt there a yt vid like that in old times 22:22 < bridge> pewdiepie? xd 22:22 < bridge> yeah my brain thinks in quotes 22:22 < bridge> oficial 22:24 < bridge> https://youtu.be/By_Cn5ixYLg?si=RkLBBRBaYOl0LKes&t=29 22:24 < bridge> found it xdd 22:25 < bridge> xd 23:58 < ChillerDragon> can someone explain me why ddnet compiles 23:58 < ChillerDragon> https://github.com/ddnet/ddnet/blob/bcc92fa0fb0486dd598657cfa881d5e1ffcd08de/src/engine/shared/config_variables.h#L14 23:58 < ChillerDragon> this mf is using the enum ``CFGFLAG_CLIENT`` 23:59 < ChillerDragon> https://github.com/ddnet/ddnet/blob/bcc92fa0fb0486dd598657cfa881d5e1ffcd08de/src/engine/shared/config.h#L45 23:59 < ChillerDragon> it is defined here 23:59 < ChillerDragon> which is below the include 23:59 < ChillerDragon> https://github.com/ddnet/ddnet/blob/bcc92fa0fb0486dd598657cfa881d5e1ffcd08de/src/engine/shared/config.h#L34 23:59 < ChillerDragon> C++ hoisting momemnt