00:16 < bridge> furo recommended a nice tool called https://phind.com - its AI that links the source it spits out to you, so if in doubt you can check that source for yourself - can be helpful sometimes 01:47 < bridge> @ryozuki look what I just found 01:47 < bridge> https://anime-girls-holding-programming-books.netlify.app/ 01:49 < bridge> @ryozuki 01:49 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1207851271718174760/image0.png?ex=65e12627&is=65ceb127&hm=cd3446d2c0c59f8581fe969c42e43f7bf74fcb43b2a8ba86448aee2b18161478& 01:50 < bridge> 😂😂😂 02:11 < bridge> this me 02:11 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1207856773126553670/Himegoto_Casting_Malloc-cce222d18598ea57f7aed68f5f9d8626.png?ex=65e12b47&is=65ceb647&hm=edcd2e3600d1c7b150302b8a25b3e3679a7855c2f200714876711c652341f2bf& 02:12 < bridge> gcc is forcing me to cast to (char*) ;( 02:12 < bridge> Not in superior C 02:12 < bridge> xD 02:14 < bridge> Today I wrote some templates so cursed I just deleted them, they truly are the source of all evil 02:14 < bridge> A very task-specific reimplementation of `std::bind` 02:19 < bridge> you mean templates as a type in cpp or template as a base construct you built in C to lay more C over? 02:19 < bridge> I can't talk 02:20 < bridge> Neither can I correctly explain anything I'm thinking with written language 02:21 < bridge> Gn 04:04 < bridge> It’s not GCC, it’s C++ 04:05 < bridge> interesting 04:54 < bridge> Hello guys, I'm really struggling trying to code a snap single chunk. Can someone help me decode it? 04:54 < bridge> 04:54 < bridge> ``` 04:54 < bridge> "\x08\x0e\x0f\xae\x0b\xaf\x0b\xda\xf9\xfc\xd6\x0c\x82\x02\x00\x07" \ 04:54 < bridge> "\x00\x04\x0a\x90\x02\xb0\x0a\x02\x03\x04\x04\x90\x04\xb0\x06\x02" \ 04:54 < bridge> "\x02\x04\x02\xb0\x01\xb0\x04\x01\x00\x04\x01\xb0\x01\xb0\x03\x01" \ 04:54 < bridge> "\x00\x06\x00\x00\x00\x00\x00\x14\x00\x00\x01\x0b\x00\xcc\xcc\x80" \ 04:54 < bridge> "\xd1\x03\xcd\xf8\x88\x81\x02\xff\xfd\xfb\x87\x02\xff\xff\xfb\xf7" \ 04:54 < bridge> "\x0f\xff\xfd\xfb\xf7\x0f\xff\xfd\xfb\xf7\x0f\xff\xff\xfb\xf7\x0f" \ 04:54 < bridge> "\x8c\x01\xd2\xc8\xf0\xc1\x03\xff\xfd\xfb\x87\x02\xff\xfd\xfb\xf7" \ 04:54 < bridge> "\x0f\xff\xfd\xfb\xf7\x0f\xff\xfd\xfb\xf7\x0f\xff\xff\xfb\xf7\x0f" \ 04:54 < bridge> "\x00\x86\xe3\xd3\x0b\xa0\xfc\x80\x01\x0a\x00\x01\x00\x00\x00\x00" 04:54 < bridge> ``` 04:55 < bridge> This is the first snap after I enter a dm1 game. I already know how to decode: 04:55 < bridge> 04:55 < bridge> flags: 0 04:55 < bridge> size: 142 bytes 04:55 < bridge> message: 7 (snap single) 04:55 < bridge> 04:55 < bridge> tick: 750 04:55 < bridge> delta tick: 751 04:55 < bridge> crc: -1701813851 04:56 < bridge> but how do I decode the snap data XD? 04:59 < bridge> WTF js 05:01 < bridge> snap data starts at \x82\x02 (first line) 05:01 < bridge> It’s all ints 05:01 < bridge> Call getInt() until you consumed all 05:02 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1207899661063553034/ima_27f506d.jpeg?ex=65e15338&is=65cede38&hm=96a1c165f2651a54b8512eede91b41d92fd1c2cb186d935973f7d4eed7be6a69& 05:02 < bridge> First three ints are removed num zero 05:02 < bridge> Then the next int is the item type 05:02 < bridge> Then it’s id 05:03 < bridge> Then lookup its size in your table and consume as many ints as this type is big 05:03 < bridge> Then another item starts 05:03 < bridge> @miguilim: what are you working on? 05:05 < bridge> what decoder is this? 05:06 < bridge> What are you working on dude? 05:06 < bridge> You ignored my question since days I’m seriously curious 05:06 < bridge> re-implementation of teeworlds server on a high level language as a framework for mods 05:07 < bridge> TeeFrame 05:07 < bridge> Frame from framewrok xd 05:07 < bridge> Frame from framework xd 05:07 < bridge> tee from teeworlds xdddddddddd 05:07 < bridge> Which language 05:07 < bridge> php + swoole 05:07 < bridge> So you reimplement the server from scratch? 05:07 < bridge> Woah php that’s new 05:08 < bridge> yes 05:08 < bridge> https://chillerdragon.github.io/teeworlds-protocol/07/snap_items.html 05:08 < bridge> 05:08 < bridge> Ye so it’s my ruby lib it’s linked here 05:09 < bridge> The item types and sizes changed in 0.7 but the concept is the exact same 05:09 < bridge> respecting the protocol, but logic is completely different 05:09 < bridge> What do you mean by different logic? 05:10 < bridge> but it works for 0.6 xd? 05:11 < bridge> ? 05:11 < bridge> Parse the stuff as I explained it and it will work yes 05:11 < bridge> I will not copy how the things works and how they are structured 05:12 < bridge> So it’s not 1:1 the c++ code in php yes that makes sense 05:19 < bridge> how do I run this XD I never messed with ruby 05:19 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1207903989710983168/image.png?ex=65e15740&is=65cee240&hm=0988a4e02cdc0bbd3281e662e8195a825ad875cd2f9415ffde9e3807f8889d95& 05:23 < bridge> do the 0.6 protocol have unknown size snap items? 05:27 < bridge> 🤯 05:38 < bridge> its not working XD 05:38 < bridge> not exactly 05:39 < bridge> I'm trying to extract first snap item (it seems to be obj_pickup) 05:39 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1207909081302442004/image.png?ex=65e15bfe&is=65cee6fe&hm=fdfa67434f5cf2d23c7d73670140258450c538f52a3f6e952f496ca14bc8f3f6& 05:39 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1207909124617273344/image.png?ex=65e15c09&is=65cee709&hm=1044f7d01f8430c02c873c405f61a17ff689fea9c2a32a205792e2db39252baa& 05:39 < bridge> but what is this 10 XDDDDDDDDDDDDDDDDDD 05:40 < bridge> ohhhhhhhhhhhh 05:40 < bridge> its the ID 05:40 < bridge> now everything makes sense 05:41 < bridge> :poggers2: 05:43 < bridge> if the snap single contains multiple obj items, what do snap do? 06:10 < bridge> gem install huffman\_tw 06:10 < bridge> Idk I forgot. I think it’s just deltas and not full snaps or something like that. 06:11 < bridge> Don’t think so. But ddnet added their own snap items. 07:37 < bridge> hi chillah 07:40 < bridge> If I were to compile it by hand I wouldn't get that error so gcc fault 07:54 < bridge> In C++ it would be `new` and no casts. Here we have `malloc()` => it is C (or a fishy legacy C++). 07:54 < bridge> what 07:55 < bridge> in a perfect world sure 07:55 < bridge> im just saying c++ requires explicit casting of void pointer types like returned from malloc 08:29 < bridge> now getting this :cammo: 08:29 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1207951845755195402/image.png?ex=65e183d2&is=65cf0ed2&hm=6f679cb235f13a6c639402c1b988dfb3f47721968be91f9ee3e271f2569d27e2& 09:04 < bridge> malloc is usinh a function not C 09:05 < bridge> using malloc is using a function not C 09:05 < bridge> using new is using a c++ feature 09:05 < bridge> that said, use rust 09:05 < bridge> :owo: 09:06 < bridge> ffr 09:29 < bridge> Epyc 09:53 < bridge> php8+? 09:54 < bridge> and how does msg.header.size work, it’s just that for some reason it doesn’t send messages at all when I enter the message length 09:54 < bridge> how does msg.header.size work, it’s just that for some reason it doesn’t send messages at all when I enter the message length 10:12 < bridge> That usually doesn't happen unless you had some incorrect code 10:13 < bridge> And what is "when you enter the message length"? 10:15 < bridge> well the value to msg.header.size with the length of the message 10:43 < bridge> It is technically part of libc, so kinda C 😄 10:43 < bridge> i dont think using a library means using a language xd 10:44 < bridge> I guess that's fair 10:44 < bridge> https://astral.sh/blog/uv 10:44 < bridge> made in rust 10:45 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1207985991948705854/image.png?ex=65e1a39f&is=65cf2e9f&hm=6b23d57e48c66e0b9804c48e9f5dca834738aaec077592ede270d22b9436a819& 10:45 < bridge> @learath2 i need to do the same for portage 10:45 < bridge> i always keep leaving it for later 10:45 < bridge> i wonder how complex it is 10:45 < bridge> portage is slow 10:47 < bridge> U share lot of pyson related stuff lately. Stay on our side, the dark side ( insert your cat emoji here ) 10:47 < bridge> Look at it, gorgus 10:47 < bridge> idk its just news xd 10:47 < bridge> i dont rly do python 10:47 < bridge> i do edlang 10:49 < bridge> It's mostly graph operations 10:49 < bridge> Yeah at least it's written in rust 😏 10:50 < bridge> i saw it here https://this-week-in-rust.org/blog/2024/02/14/this-week-in-rust-534/ 10:50 < bridge> If you share a rust compiler written in pyson. Then I know the world is doomed 10:50 < bridge> Replacing portage/emerge with a rust application is probably unfeasible though. You'd need to start shipping a rust compiler in stage3, it would probably be unpopular 10:51 < bridge> https://blog.cocl2.com/posts/rust-ref-stable-collection/ 11:03 < bridge> https://github.com/orgs/wapm-packages/repositories 11:04 < bridge> Llvm compiled to wasm xD 12:31 < bridge> damn 12:31 < bridge> the llvm optimizer makes my factorial recursive function into a non recursive 12:37 < bridge> When use ai for optimizations xd 12:37 < bridge> Could probably work to detect certain patterns. Just hard to make it reliable 12:38 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1208014593578770452/message.txt?ex=65e1be42&is=65cf4942&hm=e826e856091447e5904e01073c3411ee041f90d1d20771e04ab4debb8b04084f& 12:38 < bridge> look this wizardry 12:39 < bridge> ```rust 12:39 < bridge> mod Main { 12:39 < bridge> pub fn main() -> i32 { 12:39 < bridge> let b: i32 = factorial(4); 12:39 < bridge> return b; 12:39 < bridge> } 12:39 < bridge> 12:39 < bridge> pub fn factorial(n: i32) -> i32 { 12:39 < bridge> if n == 1 { 12:39 < bridge> return n; 12:39 < bridge> } else { 12:39 < bridge> return n * factorial(n - 1); 12:39 < bridge> } 12:39 < bridge> } 12:39 < bridge> } 12:39 < bridge> 12:39 < bridge> ``` 12:39 < bridge> this is my code btw 12:40 < bridge> ```llvm 12:40 < bridge> define i32 @main() local_unnamed_addr #1 !dbg !19 { 12:40 < bridge> entry: 12:40 < bridge> call void @llvm.dbg.value(metadata i32 24, metadata !23, metadata !DIExpression()), !dbg !25 12:40 < bridge> call void @llvm.dbg.value(metadata i32 24, metadata !23, metadata !DIExpression()), !dbg !26 12:40 < bridge> ret i32 24, !dbg !27 12:40 < bridge> } 12:40 < bridge> ``` 12:40 < bridge> main gets inlined tho xd 12:53 < bridge> That’s odd I would have to take a look 12:54 < bridge> You need the length of the entire message not the chat message. Just wait for me to fix it. I should get to it within the end of next week 12:55 < bridge> Is that not a classic case of tail recursion optimization? 12:55 < bridge> yes 12:55 < bridge> im just amazed cuz im seeing the ir 12:56 < bridge> making my own lang 12:56 < bridge> but i thought most is about removing the stack usage 12:56 < bridge> not recursion (?) 12:58 < bridge> Problem is probably to not change the behaviour of the code 12:58 < bridge> Well "tail recursion optimization" is basically "tail call optimization" getting rid of the stack usage. But after that there is another pass (I don't remember the name) that optimizes further because the target is the same subroutine so it can be treated as a loop 13:21 < bridge> @learath2 do u bet i can make edlang faster than c or not 13:22 < bridge> No bet. You control IL generation directly. Ofc you can get it faster, especially for specific tasks 13:24 < bridge> :owo: 13:39 < bridge> https://reddit.app.link/gdTXHAxIeHb 13:39 < bridge> 😂😂 15:01 < bridge> considering im getting bullied by a check atm - is there any way to run a build test locally without having to push each of my attempts to the PR ? XD 15:01 < bridge> 15:01 < bridge> https://github.com/ddnet/ddnet/pull/7886 15:01 < bridge> considering im getting bullied by a check atm - is there any way to run a build test locally without having to push each of my attempts to the PR ? XD 15:01 < bridge> 15:01 < bridge> #7886 15:01 < bridge> considering im getting bullied by a check atm - is there any way to run a build test locally without having to push each of my attempts to the PR ? XD 15:01 < bridge> https://github.com/ddnet/ddnet/pull/7886 15:10 < bridge> *no* 15:10 < bridge> :OHNOOOO: 15:11 < bridge> You could probably just run the command locally yeah 15:12 < bridge> For the checks that fail 15:15 < bridge> the check is running on ubuntu 20.04 which would require me to downgrade my cmake version to test that accurately i assume? 15:15 < bridge> Maybe you can use docker to build with a specific environment 15:16 < bridge> @reitw time to teach me docker properly! 15:16 < bridge> 15:17 < bridge> Or use something to run GitHub actions locally 15:17 < bridge> https://github.com/nektos/act 15:27 < bridge> cant seem to get it running on my system - sadge 15:41 < bridge> Why don't you just enable actions for your fork and push to a branch that isn't your PR? 17:46 < bridge> https://twitter.com/duborges/status/1758201294743875911 17:46 < bridge> video 17:50 < bridge> https://factorio.com/blog/post/fff-398 20:59 < bridge> I was going to delete this since it turned out so unwieldy but I think I'll show everyone before I do, https://paste.pr0.tips/CNp 20:59 < bridge> Observe this template abomination 20:59 < bridge> It's a reimplementation of `std::bind` just for this usecase, it just to avoid typing the out type of the vulkan functions 21:54 < bridge> a struct that has information both about type and name of the value 21:54 < bridge> They really should add a constexpr unordered_map constructor and getter 22:03 < bridge> as people say: just use boost 22:03 < bridge> :pepeW: 22:04 < bridge> you mean to have custom perfect hash functions? 22:04 < bridge> afaik unordered_map is a general catch all 22:04 < bridge> but can't you pass your own hash function anyway 22:04 < bridge> or is memory allocation also inefficient 22:08 < bridge> It has to be structured in a certain way to provide the complexity guarantees in the standard. So `unordered_map` is stuck as a closed adressing hashmap 22:11 < bridge> interesting, I see 22:11 < bridge> closed causes overhead and performance degrades as load factor grows it says 22:11 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1208158623495364669/image.png?ex=65e24466&is=65cfcf66&hm=64010a550326e22316589c28416c4181fa28a68f349d93ba835e59fad34c2492& 22:11 < bridge> https://abseil.io/about/design/swisstables 22:11 < bridge> 22:11 < bridge> And the cppcon talk about it are very nice if you are interested 22:12 < bridge> cool thanks 22:12 < bridge> huh chinese mods are always out of view https://github.com/landmineHQ/ddnet-hidden 23:38 < bridge> How do I calculate the delta value of a snapshot. I though it was the amount of snap items on it. But its not working 23:39 < bridge> My client stuck here 23:39 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1208180943744016445/image.png?ex=65e2592f&is=65cfe42f&hm=92022c07a103cc591b237705ec161b5b210a610fc0f232a7b14d82888c245295&