Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2023-12-12 00:00:00Z and 2023-12-13 00:00:00Z
Avatar
bac3670 Don't scale TargetXY when in spectator - furo321 e4c97e5 Merge pull request #7574 from furo321/remove-telecursor - heinrich5991
Avatar
Avatar
Ryozuki
@Jupstar ✪ chatgpt is depressed on december
winter depression is a serious illness!
Avatar
Avatar
Ryozuki
@Jupstar ✪ chatgpt is depressed on december
good
troll 1
Avatar
We’re pleased to share that we’ve worked with the Rust community to add LLVM CFI and cross-language LLVM CFI (and LLVM KCFI and cross-language LLVM KCFI) to the Rust compiler as part of our work in the Rust Exploit Mitigations Project Group. Check out details in this post!
Avatar
0aca090 Use WasCursorChanged() when rendering lineinput in CUI::DoEditBox - archimede67 be53d83 Remove #include <system.h> from one more header - heinrich5991 3cb510a Merge pull request #7637 from heinrich5991/pr_ddnet_even_less_system_h - edg-l 082c448 Merge pull request #7635 from archimede67/fix-escape-key-lineinput - edg-l
Avatar
Choo Choo
11:25
a4cbe94 Separate the extract_servers function from the server_link function - murpii d89648b Tickets: Notify the user that they cannot close the ticket if it does not belong to them - murpii f99a9a1 Ticket Inactivity task: Fix race condition error, remove unncessary code - murpii 161a123 Closing: Added try-except blocks for debug purposes - murpii 9a65a6b Use ddnet.org/connect-to/ as workaround because discord can't fix their shit, remove comment - murpii d1c4dfc helpcmds: Remove very long registration command, link to their discord server instead - murpii aac8f2c Merge pull request #67 from murpii/master - murpii
Avatar
Hello ! I have a little problem, my hook ingame have a delay. It's not anti-ping, i also try to off/on my pc and is not working :/ I have a delay of 200 ms on my hook ...
Avatar
turn off vsync
12:17
i have a problem
12:17
so i refreshed DDNet and i have so low fps idk why
Avatar
Avatar
ProuD
so i refreshed DDNet and i have so low fps idk why
how low?
Avatar
i had 200FPS before
12:18
20FPS
Avatar
Avatar
ProuD
i had 200FPS before
do you know nightly builds?
Avatar
and its locked so it stucks at 20 max
Avatar
Avatar
Jupstar ✪
do you know nightly builds?
no
Avatar
Avatar
Jupstar ✪
turn off vsync
The vsync is off
Avatar
Avatar
badoumed
The vsync is off
was the delay always there?
12:19
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
Avatar
mh dunno, reset config maybe
12:20
rename ddnet in %appdata% for that
12:20
else look in your mouse settings
Avatar
wow i have 340FPS thx
Avatar
Тимофей 2023-12-12 12:51:41Z
Windows 10
Avatar
chad windows 10 user
Avatar
Тимофей 2023-12-12 12:55:50Z
help pls ❤️
Avatar
Avatar
Тимофей
Windows 10
that's a warning not an error
12:59
if you dont show the error nobody here can help
Avatar
someone really ought to go through and find all inappropriate c style casts and replace them
13:03
there is very very very rarely an instance where you need a c cast
Avatar
c style casts are simpler to type
13:06
i rarely ever used c++ casts
Avatar
c++ casts make it easier to avoid errors, and they more clearly state the intent (edited)
Avatar
@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
13:14
i wonder if llvm jit has some docs on this
Avatar
Avatar
Fussel
c++ casts make it easier to avoid errors, and they more clearly state the intent (edited)
i dunno, i'd not agree with that tbh 😄
Avatar
@Jupstar ✪ best casts are pointer method casts in rust
13:15
they are type checked
13:15
i mean .cast() ans .const_cast()
Avatar
Avatar
Ryozuki
@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
Hm, I have no idea on how llvm jit works. You'll have to dig around it's docs
13:16
Modern C++ casts look so ugly and are so annoying to type, but they are better in every other aspect
Avatar
Avatar
Learath2
Modern C++ casts look so ugly and are so annoying to type, but they are better in every other aspect
my grip is there are lot of types of casts and they have long names
13:16
and also ub
Avatar
Avatar
Learath2
Modern C++ casts look so ugly and are so annoying to type, but they are better in every other aspect
i dislike dynamic cast, bcs it's simply overhead. const_cast is basically c cast and reinterpret cast should be avoided anyway
13:17
or static cast
Avatar
isnt const cast for constness?
13:18
i forgot
Avatar
does it even exist?
Avatar
oh u mean rust?
13:18
its named cast_const xd
13:18
*mut to *const
13:18
*mut A to *const T (edited)
Avatar
Avatar
Ryozuki
my grip is there are lot of types of casts and they have long names
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
Avatar
@Learath2 do u think its sensible to expect the jit malloc and rust libc dep to be same
13:19
and would a malloc from inside jit be ok with free from rust with libc
Avatar
Oh and when you hate that the type system doesn't have nice sane const, you use const_cast 😄
Avatar
Avatar
Ryozuki
@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
evil answer: garbage collected
Avatar
Avatar
Learath2
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
polymorphism fan vs opaque datatype enjoyer
Avatar
Avatar
Jupstar ✪
i dislike dynamic cast, bcs it's simply overhead. const_cast is basically c cast and reinterpret cast should be avoided anyway
mmh where you hear that
Avatar
funny how fast one can forget c++ 😬
13:20
i used too much rust lately
Avatar
Avatar
Ryozuki
@Learath2 do u think its sensible to expect the jit malloc and rust libc dep to be same
Uhh, this is something I have no idea about. If they really both use dynamically linked libc and the same libc, yes
Avatar
Avatar
Ewan
mmh where you hear that
hear what?
Avatar
Avatar
Learath2
Oh and when you hate that the type system doesn't have nice sane const, you use const_cast 😄
i think const cast is used when u face a badly designed api not using const
Avatar
Avatar
Jupstar ✪
funny how fast one can forget c++ 😬
same bro
Avatar
Avatar
Ryozuki
i think const cast is used when u face a badly designed api not using const
Problem is due to how const and overrides work some apis just cant be const correct
Avatar
Avatar
Ewan
evil answer: garbage collected
actually implementing garbage collection can be orders of magnitude harder
13:21
specially if u want a competitive gc
Avatar
Overloads*
Avatar
Avatar
Ryozuki
isnt const cast for constness?
const T *const_ptr; auto ptr = const_cast<T *>(const_ptr);
Avatar
ill probs just refcount mallocs or smth
Avatar
Avatar
Ryozuki
actually implementing garbage collection can be orders of magnitude harder
Implement mark and sweep gc, go
Avatar
at my free time i started a weird project
13:22
im implementing pascal in mlir
13:22
cuz im bad at designing a language
13:22
i picked a easy one
Avatar
Avatar
Jupstar ✪
hear what?
avoid reinterpret and static cast
13:22
those are the 2 safest
Avatar
avoid c++
13:23
thats the safest
Avatar
shut up pls
Avatar
Avatar
Ewan
avoid reinterpret and static cast
reinterpret
13:23
the word alone is unsafe xD
Avatar
There are a scant few legit uses of reinterpret cast
13:24
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
Avatar
You almost always want a static_cast
Avatar
e.g. every object oriented system
Avatar
Avatar
Ewan
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
that sounds more like dynamic cast
Avatar
you are casting the ptrs
Avatar
and dynamic casts have:
  • overhead
  • can return null ptrs (kinda bcs of above)
Avatar
@Learath2 is there a way to "try to free" a pointer but not segfault if u cant?
Avatar
bcs they do type checks
Avatar
dynamic casts arw 100% runtime overhead avoid them
Avatar
Avatar
Ewan
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
You mean upcasting?
Avatar
Static casts work just fine there if you already know for sure the type
Avatar
Avatar
Ewan
shut up pls
Someone: »today I made me a toast hawaii« Ryozuki: »but in rust …«
Avatar
And a dynamic cast just uses rtti to make sure the type is correct if you dont have another mechanism to figure it out
Avatar
i mean if the roaster would write "software written in rust" i'd buy it just for that
13:27
ngl xd
13:27
would be insanely funny
Avatar
Avatar
Ryozuki
@Learath2 is there a way to "try to free" a pointer but not segfault if u cant?
Nope
Avatar
rusty toaster
Avatar
funniest rust advocate
Avatar
Avatar
Learath2
Nope
that's why when freeing a pointer you should set it to nullptr afterwards (edited)
Avatar
The issue with c style casts is the fallback behaviour that no one really knows off the top of their head
Avatar
or simply use unique_ptr
Avatar
Avatar
Fussel
Someone: »today I made me a toast hawaii« Ryozuki: »but in rust …«
welcome to #developer home of rust
Avatar
Avatar
Jupstar ✪
or simply use unique_ptr
non zero cost 😬
Avatar
ddnet is still 90% cpp
Avatar
Avatar
Ryozuki
non zero cost 😬
debugging ptr stuff is also not zero cost
13:29
😏
13:30
rust
Avatar
omg learath i wanted to surround it with faces
Avatar
Nooo bad timing
Avatar
@Learath2 please delete your message
Avatar
Avatar
Ryozuki
non zero cost 😬
repeating it over and over again does not make it right, you know
Avatar
xd
Avatar
Fixed
Avatar
@Learath2 lmao
Avatar
Avatar
Fussel
repeating it over and over again does not make it right, you know
we shown u its right tho
Avatar
Avatar
Fussel
repeating it over and over again does not make it right, you know
Avatar
i mean tbf, when using LTO, i am not sure
13:31
it might or might not be zero cost, depends on how the compiler performs
Avatar
Avatar
Voxel
ddnet is still 90% cpp
super low %
Avatar
Avatar
Jupstar ✪
i mean tbf, when using LTO, i am not sure
It's still not 0 cost but it's like 0.00000001 cost 😄
Avatar
Avatar
Learath2
It's still not 0 cost but it's like 0.00000001 cost 😄
i see
Avatar
You get unlucky with caching and it's even 0.000001 cost
Avatar
Avatar
Ryozuki
we shown u its right tho
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
Avatar
If you also are still running ancient dram modules it might even be 0.1 cost
Avatar
Avatar
Ewan
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
idc i use it on my holy fight for rust
13:32
NekoEvil
Avatar
guys be silent im going to become funny to ddnet devs
Avatar
i like rust but people behaving the way you are is what makes people dislike it
this 3
13:32
that alone
Avatar
is what gives the lang a bad rep
Avatar
what even is 100 cost
Avatar
im trolling a bit but ok
Avatar
😂 😂 windows : 😂 😂 😂 😂
Avatar
ill fix it for you
13:33
c++ best lang
13:33
thank god we code in c++
Avatar
Avatar
Ewan
i like rust but people behaving the way you are is what makes people dislike it
i see it more as comedy
Avatar
cpp isn’t usually the best choice
13:33
just be realistic
13:33
you can’t do rust everything
Avatar
Avatar
Jupstar ✪
i see it more as comedy
comedy involves it being funny
Avatar
Avatar
Voxel
😂 😂 windows : 😂 😂 😂 😂
At the scale of cost we are talking about with unique_ptr windows would be like TREE(3) cost
Avatar
Avatar
Voxel
comedy involves it being funny
you don't find it funny, how brainwashed he is?
Avatar
@Learath2 realloc moving the ptr to a new addr doesnt mean i got to free the old addr right
13:34
ur my libc docs now
Avatar
Avatar
Jupstar ✪
you don't find it funny, how brainwashed he is?
me when i dont find the same joke told 2763 times funny
Avatar
Avatar
Ryozuki
@Learath2 realloc moving the ptr to a new addr doesnt mean i got to free the old addr right
No, if realloc gives you a new addr that's the one ur responsible with freeing
Avatar
pointer points to same spot
Avatar
Avatar
Voxel
me when i dont find the same joke told 2763 times funny
it's like in animes.. the joke was never funny. it will still be done 50000 more times
Avatar
Avatar
Ewan
you can’t do rust everything
thats the neat part, u can do rust everywhere u do c++
Avatar
you can’t
Avatar
only limitation is maybe gcc on a weird platform
13:35
that no one uses
13:35
but soon thats fixed
13:35
with the rust gcc
Avatar
or maybe existing code and standards and knowledge and experience and unit tests and other infrastructure
13:35
you can’t just “”use rust”” anywhere
Avatar
ah u mean legally bound? i give u that
13:36
technically rust can be used everywhere c++ is used
13:36
depending upon the revision
Avatar
thats what i meant
13:36
u should learn rust already
Avatar
i like cpp better
Avatar
jupstar was rly pro cpp
13:36
i remember
Avatar
bad memory
Avatar
100%
Avatar
Well Rust and C++ are both turing complete. You can technically do everything with them
Avatar
ryo u ask rudimentary cpp questions so i think your perception of pro cpp is a bit different
Avatar
Avatar
Ewan
i like cpp better
you better dip asap every second you're around them they're just gonna poke at you (edited)
Avatar
It's just that the cost of migrating 2 decades of legacy code is extremely prohibitive
Avatar
Avatar
Ewan
ryo u ask rudimentary cpp questions so i think your perception of pro cpp is a bit different
im asking this basic stuff cuz i havent used libc for long xd and im lazy to check
Avatar
just saying
Avatar
Avatar
Ewan
ryo u ask rudimentary cpp questions so i think your perception of pro cpp is a bit different
He used to be good. Then he got enlightened by the rust tree and deleted his knowledge of other inferior languages
Avatar
u rly think my definition of someone pro at a programming lang is knowing library functions
Avatar
i think u misunderstood what i said
13:38
but i am too tired to repeat myself
13:39
i will hardly have advanced cpp questions because i literally dont use cpp
13:39
and dont want to anymore
13:39
advanced rust is more fun
Avatar
i looked into reinterpret cast and i suppose it’s only uniquely good for opaque data types like incomplete types or void ptrs
13:39
but otherwise equivalent to static cast
Avatar
Avatar
Ewan
i looked into reinterpret cast and i suppose it’s only uniquely good for opaque data types like incomplete types or void ptrs
void ptrs are safe to cast from/to with static too. So only opaque data types and some very niche tricks
Avatar
i suppose
13:41
i don’t see the harm anyway
13:41
i feel like in some circumstances casting between void ptrs can get you in trouble with more pedantic compiler settings
13:42
strict aliasing?
Avatar
that reminds me of something but ppl will get too mad
Avatar
ryo knowing limits? crazy
Avatar
@Ewan do u know about pointer provenance
13:43
"quick google"
Avatar
yea idk the term lol
Avatar
Some time ago, I wrote a blog post about how there’s more to a pointer than meets the eye. One key point I was trying to make is that just because two pointers point to the same address...
Avatar
is this just about ptr arithmetic
Avatar
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
Avatar
Avatar
Ewan
is this just about ptr arithmetic
Pointer provenance is arcane black magic that you will almost never have to care about. I wouldn't even read about it
13:44
Especially in C++
Avatar
isn’t it just like uint8_t * != uint16_t * because sizeof() for each is different?
Avatar
It only ever is an issue if you use a placement new
Avatar
placement new is bonkers stuff that nobody in their right mind should use
Avatar
Avatar
Ryozuki
😬
use your words
13:46
I’m not reading this blog post
Avatar
Avatar
Ewan
placement new is bonkers stuff that nobody in their right mind should use
except for the time I recommended it be used for the ddnet kernel object or something
Avatar
Avatar
Ewan
placement new is bonkers stuff that nobody in their right mind should use
If you are tight on memory there are some uses to it 😄
Avatar
Pointer provenance becomes an issue if you construct a new object of a different type in place of another
Avatar
provenance distingishes different pointers to the same address, its cuz due to optimizations u can get unexpected results
13:48
so it’s basically what i said
Avatar
this one is a rust definition
13:48
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 binary (but provenance can influence how the compiler translates the program).
Avatar
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
Avatar
Avatar
Ewan
so it’s basically what i said
no not exactly
13:50
char p[1], q[1] = {0}; uintptr_t ip = (uintptr_t)(p+1); uintptr_t iq = (uintptr_t)q; if (iq == ip) { *(char*)iq = 10; print(q[0]); }
13:50
this is the example from the blog
Avatar
Avatar
Learath2
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
i see
Avatar
As far as C++ is concerned it's about a way to break strict aliasing without invoking UB
Avatar
preposterous
13:50
any way of circumventing optimizations may as well be IB
13:51
ub
Avatar
i think i read about it
Avatar
novice cpp
13:51
😬
Avatar
what are you talking about
Avatar
nothing
13:52
Sticker
Avatar
Avatar
Ryozuki
no 😬
you know what is funny. All concepts i now use in rust, were ideas i had long before i've ever touched rust: https://discord.com/channels/252358080522747904/293493549758939136/994267418220306462 https://discord.com/channels/252358080522747904/293493549758939136/966359790672556144 https://discord.com/channels/252358080522747904/293493549758939136/997967609863602207 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. I'd need a language that is preventing logic errors to be as fanboy as you are about rust 😬 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
13:52
@Ryozuki thanks for reading my ted talk
13:52
😬
Avatar
i also always said if a lang with better borrow checker or same idea comes
Avatar
My 3 favourite things about rust are:
  • Sum types/Error handling
  • Traits
  • proc_macros
Avatar
ill be first to switch
13:53
trur
13:53
tsur*
Avatar
I'm not a huge fan of the whole fearless concurrency and automatic memory management. I'm an old man
Avatar
tsur > rust
Avatar
invent tsur
Avatar
Send + Sync, borrowck too smart for me
Avatar
i just like how it makes so much sense
😂 1
Avatar
i leave since it seems ryo is just trying to troll
13:54
xd
Avatar
get someone’s goat. not sure whose
13:54
good night 🌙
Avatar
Avatar
Learath2
My 3 favourite things about rust are:
  • Sum types/Error handling
  • Traits
  • proc_macros
If I were to make a language it'd take these 3 and transplant it into a clean version of C
Avatar
Avatar
Ewan
i leave since it seems ryo is just trying to troll
i was just making a snark remark at u for the pro cpp thing
😂 1
13:55
good night!
Avatar
Avatar
Learath2
My 3 favourite things about rust are:
  • Sum types/Error handling
  • Traits
  • proc_macros
what do you like about traits, if i may ask?
Avatar
I'd also steal namespaces from C++
Avatar
Avatar
Jupstar ✪
what do you like about traits, if i may ask?
I like the idea of methods acting on objects. I don't enjoy polymorphism that much though
13:56
Traits are a nice compromise
Avatar
yeah i agree, i still try to generally minimize using them, except for containers or other "global" structures
Avatar
It gives me methods and a way to define shared behaviour
13:58
I probably would also omit the automatic dereferencing in my language. It's just too much to think about for me
Avatar
Avatar
Learath2
I'd also steal namespaces from C++
uh why
13:58
i find modules on rust best
Avatar
i think my top 3 are:
  • enum structs (and ofc the resulting pattern matching)
  • proc macros
  • easier ecosystem (e.g. adding deps etc.)
Avatar
actually includes in c c++ are thing of past
Avatar
Avatar
Ryozuki
i find modules on rust best
well headers are from hell
13:58
lets face it
Avatar
Avatar
Ryozuki
uh why
I could take Rust modules too yeah. I need some way to group things together the one namespace in C is so dirty
Avatar
i never in my life thought: oh now write the shit in headers is so much fun
Avatar
its harder to parse a header than anything else
Avatar
Avatar
Jupstar ✪
i think my top 3 are:
  • enum structs (and ofc the resulting pattern matching)
  • proc macros
  • easier ecosystem (e.g. adding deps etc.)
what u mean b enums is ADT algebraic data types
Avatar
when remove header files
Avatar
In computer programming, especially functional programming and type theory, an algebraic data type (ADT) is a kind of composite type, i.e., a type formed by combining other types. Two common classes of algebraic types are product types (i.e., tuples and records) and sum types (i.e., tagged or disjoint unions, coproduct types or variant types).Th...
14:00
this should be basis for any new lang
Avatar
yep, but e.g. in typescript it completely sucks
14:00
without pattern matching it's kinda useless
14:00
pattern matching is important
14:01
strong typing
Avatar
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
Avatar
ts has a ez escape hatch from type system
14:01
as any (edited)
Avatar
Avatar
Learath2
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
true, sometimes reading the functions of a class in headers is easier 😄
Avatar
Avatar
Learath2
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
rust is also more grepable than c
14:01
grep fn
Avatar
but not smth an editor could not do
Avatar
to list functions
Avatar
Avatar
Ryozuki
grep fn
I might steal the modern function declaration syntax too, but I also don't really want to break "declaration follows use"
Avatar
i also like i64
14:05
vs int
Avatar
I can also takes lambdas from C++. I'll also need to patch together an async system. Something less fearless
14:08
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
14:09
Some sort of coroutines would also be cool but it's a bit difficult to do
Avatar
Avatar
Learath2
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
do es6 promises finally add yield?
14:10
i die without it
Avatar
No yield still
Avatar
i mean i only have like 3-4 use cases
Avatar
Wait which sort of yield are you talking about?
14:11
Like yielding a value?
Avatar
it just hard without a notifier/notify system
14:12
since js also doesnt have this
14:12
i could live with a yield
Avatar
Are Observables perhaps what you are looking for?
14:13
They are pretty enjoyable to use
Avatar
Avatar
Learath2
Are Observables perhaps what you are looking for?
i'll look into it
Avatar
is nodejs thread safe?
Avatar
Avatar
Ryozuki
is nodejs thread safe?
well webworkers have only limited functionality
14:14
so you dont really have multi threading i'd say
Avatar
Avatar
Ryozuki
is nodejs thread safe?
What does it mean for a js runtime to be thread safe?
Avatar
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)
Avatar
Avatar
Bota
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)
You really might have an easier time just building a client that does this
Avatar
Learning c++ from scratch is easier?
Avatar
Avatar
Bota
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)
the problem already is: js / ts have no udp support
14:15
i dunno if nodejs has modules for it... maybe
14:15
then you could maybe built ddnet to wasm
14:15
and use it with js xd
Avatar
ws-client BOT 2023-12-12 14:15:58Z
<ChillerDragon> @Bota yea as jopsti said if it is in the browser it wont work. Are you doing it in the frontend or backend?
14:16
<ChillerDragon> @Bota also nudel said he did not add rcon so it might not work
Avatar
Avatar
Bota
Learning c++ from scratch is easier?
Ah, I thought you knew C++. Then that's a no go
Avatar
ws-client BOT 2023-12-12 14:16:40Z
<ChillerDragon> @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?
Avatar
@Bota have you ever checked how often log.txt is written by the client? i bet u can just add a flush somewhere and read from it live
Avatar
then u almost have to not alter the client
Avatar
Avatar
Jupstar ✪
@Bota have you ever checked how often log.txt is written by the client? i bet u can just add a flush somewhere and read from it live
Log probably doesnt contain rcon though
Avatar
I have a web framework for displaying
Avatar
ws-client BOT 2023-12-12 14:18:12Z
<ChillerDragon> yea regular log does not contain rcon
14:18
<ChillerDragon> there is console dump but it is not live
Avatar
Getting data outside the project is only possible via requests
Avatar
@Bota didnt u just want chat? xd
Avatar
Avatar
Jupstar ✪
@Bota didnt u just want chat? xd
I need chat data
Avatar
so no need for rcon right?
Avatar
I need ips
Avatar
lmao
Avatar
ws-client BOT 2023-12-12 14:19:00Z
<ChillerDragon> @Jupstar ✪ no need for flush its pretty live
Avatar
isnt there a e-con?
Avatar
Avatar
ws-client
<ChillerDragon> @Jupstar ✪ no need for flush its pretty live
yeah but you on the master race linux
Avatar
ws-client BOT 2023-12-12 14:19:29Z
<ChillerDragon> o
Avatar
Avatar
Jupstar ✪
isnt there a e-con?
There is but it's not enabled on ddnet servers and it wouldn't really be available to mods anyway
Avatar
Avatar
Learath2
There is but it's not enabled on ddnet servers and it wouldn't really be available to mods anyway
makes sense
Avatar
Avatar
ws-client
<ChillerDragon> @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?
Idk what a 0.7 server is.
Avatar
ws-client BOT 2023-12-12 14:19:56Z
<ChillerDragon> whats the ip of the server
14:20
<ChillerDragon> i can tell you
Avatar
He wants to use it on ddnet servers
Avatar
Official ddnet servers
Avatar
ws-client BOT 2023-12-12 14:20:21Z
<ChillerDragon> they have 0.7 support
14:20
<ChillerDragon> so you can use the ruby lib
Avatar
the ip is 127.0.0.1
Avatar
So ur ruby lib is a client easy to modify?
Avatar
ws-client BOT 2023-12-12 14:21:16Z
<ChillerDragon> yea
14:21
<ChillerDragon> lemme quikcly test if it can really join ddnet
14:21
<ChillerDragon> or just vanilla
Avatar
Well ill just send the data from ur ruby client to my display frontend via http then. Figuring that out shouldn’t be hard
14:23
In worst case ill let chatgpt do the coding
Avatar
ws-client BOT 2023-12-12 14:23:35Z
<ChillerDragon> yea works
Avatar
ws-client BOT 2023-12-12 14:23:51Z
<ChillerDragon> i can also write the boilerplate code for u sec
Avatar
Im at work and i come late home, no rush 🙂 But ty
14:30
<ChillerDragon> here u go
14:30
<ChillerDragon> i realized it is a bit bugged and gets chat messages multiple times justatest
14:30
<ChillerDragon> if you really start using that i will investigate that and fix my lib :)
Avatar
Ty if its that easy I’ll probably use it
Avatar
ws-client BOT 2023-12-12 14:32:27Z
<ChillerDragon> yea ruby is really easy to use. The code makes sense does it?
Avatar
I can understand it
Avatar
ws-client BOT 2023-12-12 14:32:43Z
<ChillerDragon> poggies
Avatar
For syntax ill have to look a bit but it looks very doable
Avatar
ws-client BOT 2023-12-12 14:33:23Z
<ChillerDragon> thats where chatgpt will help
Avatar
ws-client BOT 2023-12-12 14:33:59Z
<ChillerDragon> also feel free to ask me. You are the first user of that lib im still motivated to give support hehe
Avatar
Ill make the whole mod team use it if it has all i want 🙂
14:35
The first frontend as backend to frontend application
14:35
Lol
Avatar
just be careful to make it secure then xd
Avatar
The whole thing will be running only locally
Avatar
i c
Avatar
No Security needed
14:40
If my poc work ill try something properly
Avatar
ws-client BOT 2023-12-12 14:42:54Z
<ChillerDragon> 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
Headless teeworlds 0.7 client with http rest api server - GitHub - ChillerDragon/teeworlds_rest_client: Headless teeworlds 0.7 client with http rest api server
14:43
<ChillerDragon> its the same client but now with a rest api
14:43
<ChillerDragon> but you would have to extend it your self to have also rcon endpoints
Avatar
Thats a whole client?!
Avatar
ws-client BOT 2023-12-12 14:45:25Z
<ChillerDragon> the link i sent you is a webserver that uses the same library under the hood i showed you earlier
14:45
<ChillerDragon> so if you start the webserver you can access api endpoints to get chat messages or make it move in game
Avatar
That webserver would be all i need
14:49
Ill look at all of it when im home
Avatar
ws-client BOT 2023-12-12 14:50:11Z
<ChillerDragon> 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
14:50
<ChillerDragon> 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
Avatar
Once i get the data i need to develop the frontend. It should take a while.
14:52
Like months
14:53
In the meantime a lot can happen/ change
Avatar
ws-client BOT 2023-12-12 14:53:28Z
<ChillerDragon> you mean i have a lot of time to fix the lib? :D
Avatar
And if you don’t touch ill i will try my luck. Thats not a lot of code
14:53
If you want to 🙂
14:54
Having someone on my project will be nice:D
Avatar
ws-client BOT 2023-12-12 14:54:19Z
<ChillerDragon> yea the http thing is not a lot of code because all the teeworlds procotol is abstracted away by the other tw network lib
14:55
It’s fascinating how those dependency chains work somehow
Avatar
ws-client BOT 2023-12-12 15:03:49Z
<ChillerDragon> lerato so i can use std::launder to fix ub? sounds pog
Avatar
Avatar
Learath2
Uhh, this is something I have no idea about. If they really both use dynamically linked libc and the same libc, yes
not on windows
Avatar
Avatar
Fussel
repeating it over and over again does not make it right, you know
got any evidence to the contrary?
Avatar
Avatar
Learath2
Well Rust and C++ are both turing complete. You can technically do everything with them
it doens't follow you can do everything the hardware supports with them
Avatar
Avatar
Learath2
Well Rust and C++ are both turing complete. You can technically do everything with them
brainfuck is also turing complete
Avatar
Avatar
Learath2
If I were to make a language it'd take these 3 and transplant it into a clean version of C
sounds like zig or so
Avatar
Avatar
heinrich5991
got any evidence to the contrary?
I posted something about 1-2 days ago, I think. it's extendable
Avatar
Avatar
Learath2
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
rustdoc
Avatar
Avatar
Fussel
I posted something about 1-2 days ago, I think. it's extendable
link?
15:20
I don't see an overhead.
Avatar
it depends on the program size anyway. the compiler can also optimize away heap allocations completely
15:21
and if not program size, then other parameters
Avatar
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
15:26
it's just wrong ^^
Avatar
1. i understand that 2. what is the alternative?
15:27
micro optimizations are often waste of time. if your product isn't already almost perfect, they won't be the biggest bottleneck
15:28
in bigger software it's usually some algorithms that are slow, or design flaws that prevent parallelizm
Avatar
i dont understand their example, but generally sounds funny. but also not very useful for complex programs xdd
Avatar
@Jupstar ✪ 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
Avatar
Avatar
Jupstar ✪
in bigger software it's usually some algorithms that are slow, or design flaws that prevent parallelizm
yeah
Avatar
Avatar
Ryozuki
yeah
say it
15:32
SAY IT
15:32
😄
Avatar
i want to state that i am indeed trolling a bit the c++ users out there xd
15:32
but at the end rust box is the truly zero cost 😬
Avatar
Avatar
Jupstar ✪
SAY IT
fearless concurrency
Avatar
YEAH
Avatar
Avatar
Jupstar ✪
in bigger software it's usually some algorithms that are slow, or design flaws that prevent parallelizm
actually rust provides better value here
15:34
due to the protection against data races
Avatar
but we all know fussel is pro like learath and can do concurrency without an issue
15:34
😬
Avatar
did even write my own mutexes because i needed some with at most 1 byte in size
Avatar
@Jupstar ✪ clang tooling itself shows the need for it, with their tsan
Avatar
so yes, concurrency isn't that difficult
Avatar
Avatar
Fussel
did even write my own mutexes because i needed some with at most 1 byte in size
wait 3 seconds and u get 20 crates that do the same
Avatar
Avatar
Fussel
so yes, concurrency isn't that difficult
lmao
Avatar
Avatar
Fussel
did even write my own mutexes because i needed some with at most 1 byte in size
i wrote my own kernel in rust, so what
15:36
😬
Avatar
Avatar
Jupstar ✪
lmao
he said it!!
Avatar
even in rust concurrency is hard
15:36
fearless, but very hard
Avatar
its among the biggest programming hurdles
Avatar
yes
15:37
same for async
Avatar
even rust
15:37
In multithreaded computing, the ABA problem occurs during synchronization, when a location is read twice, has the same value for both reads, and the read value being the same twice is used to conclude that nothing has happened in the interim; however, another thread can execute between the two reads and change the value, do other work, then cha...
15:37
and more
Avatar
ok async is kind of concurrency but i assume you meant multi threading
Avatar
just so many problems come out of multithreading
15:37
but its not that hard
15:37
kek
15:38
@Jupstar ✪
15:38
😬
Avatar
lm ao
Avatar
Thread 3 "DDNet" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffeec21640 (LWP 360916)] CUpdaterFetchTask::OnProgress (this=0x5555578ccc90) at src/engine/client/up...
15:39
(gdb) bt #0 0x00007fe2bc001140 in ?? () #1 0x000056106a94b91b in CSqlServer::Connect (this=this@entry=0x56106b4a7240) at /home/teeworlds/src/master/src/engine/server/sql_server.cpp:118 #2 0x0000561...
Avatar
bcs concurrency is hard
15:40
😛
Avatar
Avatar
Ryozuki
just so many problems come out of multithreading
so many problems come out of using pointers, as long as you don't do it right
15:40
where is the point?
Avatar
the point is with safe rust u cant get that problem (segfaults)
Avatar
but imo that's also not directly comparable
15:41
multi threading is so much let alone some stupid dead lock
Avatar
but also the borrow checker itself with the exclusive mutability protects already u in mt
Avatar
u easily extend the lifetime of stuff, which can lead to leaks etc.
Avatar
it doesnt protect from deadlockes
Avatar
timing stuff
15:42
just so hard
Avatar
@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. (edited)
Avatar
@Jupstar ✪ did u ever check https://github.com/tokio-rs/loom
Concurrency permutation testing tool for Rust. Contribute to tokio-rs/loom development by creating an account on GitHub.
Avatar
Avatar
Ryozuki
@Jupstar ✪ did u ever check https://github.com/tokio-rs/loom
not really, but i like that
Avatar
same goes with java, and rust too: solving problems a language should not solve …
15:43
i dislike that argument, its like saying no to progress xd
15:43
i cant rebate that
15:44
if u dont like progress thats it
Avatar
the python syntax sucks, bcs i have a formatter that formats my code 😛
Avatar
the problems rust solves are among the most important in the field
Avatar
Avatar
Ryozuki
i dislike that argument, its like saying no to progress xd
I don't like haskell. but I readily admit it's something useful
Avatar
so python syntax only forces the code to have few less keywords as ;
Avatar
for me c++ is not useful
15:44
rust is
15:44
also for me haskell isnt rly useful
Avatar
In matters of ›progress‹ not of ›personal taste‹
Avatar
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
15:45
😬
Avatar
Avatar
Ryozuki
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
but what if u write a rust interpreter
15:45
😏
Avatar
c++ offers you facilities to easily avoid segfault. so if you get one, it's your fault ^^
Avatar
Avatar
Fussel
In matters of ›progress‹ not of ›personal taste‹
in matters of progress, rust is the biggest in language progress
15:46
its hilarious to deny that
Avatar
Avatar
Fussel
In matters of ›progress‹ not of ›personal taste‹
anyway, one thing in this discussion is important. Rust at least partially tries to fight against/solve problems of c++. it does not really try to solve problems of python etc.
Avatar
sry @Ryozuki didn't want to shit in your bible 😦
Avatar
??? xd
15:47
what bible
15:47
its a fact
15:48
wait i give u the paper
15:48
good read
15:49
@Jupstar ✪ we got a c++ supremacist on chat
15:49
we got competence now
Avatar
Avatar
Fussel
c++ offers you facilities to easily avoid segfault. so if you get one, it's your fault ^^
you are right. but once you use these components you kinda force yourself into an ecosystem anyway. Rust is higher level than cpp. just is cpp STL higher level than coding in c directly
Avatar
cpp can offer all the new facilities, but always have those old ones
15:49
and many c++ code is old using those
15:49
so u have to adapt to it
Avatar
Avatar
heinrich5991
it doens't follow you can do everything the hardware supports with them
If we are pedantic, yes. But I thought it was obvious that neither language would allow anything the hardware doesn't allow
Avatar
Avatar
Learath2
If we are pedantic, yes. But I thought it was obvious that neither language would allow anything the hardware doesn't allow
tbh my point there was that rust can also be used in the fields where c++ is used
15:52
well its where it should be used most
Avatar
Avatar
heinrich5991
link?
Immediately after that I illustrated the overhead in question. Which was summarily dismissed for some reason 😄
Avatar
ye he is ignoring the godbolt link
15:54
i resent it actually xd
15:55
also from a economical standpoint, at corpo level, rust would be a safer bet than c++
Avatar
Avatar
Ryozuki
tbh my point there was that rust can also be used in the fields where c++ is used
No matter how you look at it Rust is indeed a good replacement to C++
Avatar
u cant expect all ur engineers to have a master level in c++ where they know wont do ub ever ever
15:56
like our chatters here
Avatar
To C is a bit more doubtful. Embedded Rust didn't look very ergonomic last I took a look at it
Avatar
Avatar
Learath2
To C is a bit more doubtful. Embedded Rust didn't look very ergonomic last I took a look at it
its getting a bit better
15:56
u can follow the embedded rust newsletter
Avatar
xD
15:56
our prophet has spoken
Avatar
ok maybe its in TWIR
15:57
i read from time to in in rust reddit
15:57
Coordination repository of the embedded devices Working Group - GitHub - rust-embedded/wg: Coordination repository of the embedded devices Working Group
Avatar
Avatar
Learath2
To C is a bit more doubtful. Embedded Rust didn't look very ergonomic last I took a look at it
i think the kernel is helping rust become a doable replacement
15:58
for example the try api for allocating
15:58
on some places
15:58
i forgor
15:59
Add minimal support for fallible allocations to the standard collection APIs. This is done in two ways: For users with unwinding, an oom=panic configuration is added to make global allocators pani...
Avatar
Avatar
Fussel
did even write my own mutexes because i needed some with at most 1 byte in size
futex/waitonaddress? Any other way to achieve this without kernel help can't have very nice properties under contention I imagine
Avatar
std::atomics
Avatar
Avatar
Ryozuki
i read from time to in in rust reddit
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
16:02
(wrong reply)
Avatar
Avatar
Voxel
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
there have been rust madlads
16:02
😹 1
Avatar
if someone actually does that i would finally have respect
Avatar
Avatar
Fussel
std::atomics
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
Avatar
Avatar
Voxel
if someone actually does that i would finally have respect
would you join that guy in a team as graphic designer if it were about teeworlds?
Avatar
Avatar
Jupstar ✪
would you join that guy in a team as graphic designer if it were about teeworlds?
i mean if it doesnt have to rely on backwards compat then maybe
Avatar
Avatar
Voxel
i mean if it doesnt have to rely on backwards compat then maybe
epic
Avatar
ddnet is pretty much a fish out of water now
Avatar
best language is assembly without libc
Avatar
Avatar
Ryozuki
best language is assembly without libc
Only on processors with no pipelining, no reordering
Avatar
speaking about critical sections: i saw a blog about this benchmark https://github.com/matklad/lock-bench and then tested it on my pc: std::sync::Mutex avg 15.508196ms min 11.315727ms max 16.916332ms parking_lot::Mutex avg 172.935745ms min 161.698901ms max 182.067695ms spin::Mutex avg 15.546313ms min 11.218683ms max 37.585821ms AmdSpinlock avg 14.614385ms min 12.399496ms max 18.728032ms std::sync::Mutex avg 15.30766ms min 12.545613ms max 16.991576ms parking_lot::Mutex avg 168.617568ms min 144.948258ms max 178.966609ms spin::Mutex avg 15.319146ms min 12.435505ms max 26.911885ms AmdSpinlock avg 14.980674ms min 12.09597ms max 20.006563ms 1. it's interesting that his spin locks are so insanely slow 2. WTF is happening with parking_lot on my pc
16:07
my results are just completely different than his lmao
16:08
^ above is extreme contention btw
16:09
i am only interesting in light contention, but wanted to test all out
Avatar
127ms waiting on a spin damn. Could it be an OS thing?
Avatar
Avatar
Learath2
127ms waiting on a spin damn. Could it be an OS thing?
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
16:10
bcs it cannot cleanly assume that a spinning thread can be paused
16:10
but i am on linux.. and it's super fast
16:10
😬
Avatar
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
Avatar
i think they explained somewhere
16:11
but on recent rust std uses the futexes
16:11
1.62
Avatar
Avatar
Jupstar ✪
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
@Learath2 u can change the scheduler when compiling kernel right
16:13
New scheduler in Linux 6.6 will boost performance A core element of any operating system are the scheduling systems, which organize and schedule how different operations will execute and in what order. 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. 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 deadline first. By assigning smaller time slices to latency-sensitive processes, EEVDF can prioritize giving them quick access to the CPU when needed. “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.”
Avatar
Avatar
Jupstar ✪
speaking about critical sections: i saw a blog about this benchmark https://github.com/matklad/lock-bench and then tested it on my pc: std::sync::Mutex avg 15.508196ms min 11.315727ms max 16.916332ms parking_lot::Mutex avg 172.935745ms min 161.698901ms max 182.067695ms spin::Mutex avg 15.546313ms min 11.218683ms max 37.585821ms AmdSpinlock avg 14.614385ms min 12.399496ms max 18.728032ms std::sync::Mutex avg 15.30766ms min 12.545613ms max 16.991576ms parking_lot::Mutex avg 168.617568ms min 144.948258ms max 178.966609ms spin::Mutex avg 15.319146ms min 12.435505ms max 26.911885ms AmdSpinlock avg 14.980674ms min 12.09597ms max 20.006563ms 1. it's interesting that his spin locks are so insanely slow 2. WTF is happening with parking_lot on my pc
anyway, spin locks are still unbeatable if you don't expect contention on my PC. parking_lot is very close. so i guess i can live with using parking_lot in most my projects 😏
Avatar
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
16:15
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
Avatar
Avatar
Learath2
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
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
Avatar
Avatar
Jupstar ✪
anyway, spin locks are still unbeatable if you don't expect contention on my PC. parking_lot is very close. so i guess i can live with using parking_lot in most my projects 😏
Well ofc. Exactly why pthread mutexes will actually spin a couple times before yielding in most implementations
Avatar
Avatar
Learath2
Well ofc. Exactly why pthread mutexes will actually spin a couple times before yielding in most implementations
true, but rust std mutices/mutexes do that, apparently simply for a too short time (?)
16:16
bcs they are the worst of all 4 in the benchmark
Avatar
Hm, I never looked into rust mutexes ngl
Avatar
or they have other overhead 😄
Avatar
Avatar
Learath2
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
what are iowait numbers? could this be due to ur old hdds?
Avatar
Avatar
Ryozuki
what are iowait numbers? could this be due to ur old hdds?
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
Avatar
do u have noatime in ur fstab btw
Avatar
Avatar
Ryozuki
what are iowait numbers? could this be due to ur old hdds?
iowait is the amount of time the cpu is spending on waiting for io
Avatar
Avatar
Fussel
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
what u done, if i may ask?
Avatar
Avatar
Ryozuki
do u have noatime in ur fstab btw
I should but I'll double check
Avatar
i just want to know a use case of these amount of mutexes 😄
Avatar
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].
Avatar
@Jupstar ✪ 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 (edited)
Avatar
i c
Avatar
@Learath2 are compiler intrinsics smth in the standard in c and c++?
Avatar
Ofc not
Avatar
but can u expect smth portable across the same arch but different compilers
Avatar
clang and gcc share some, but at the end of the day there is no guarantee for anything
16:24
If you want to support a compiler you'll need to add an ifdef for it
16:26
Compiler intrinsics are well extremely compiler specific 😄
16:28
Cool C++ feature of the day: std::valarray
Avatar
It's very very unused, buuut both clang and llvm will vectorize it if it's a suitable size
16:29
both clang and gcc*
Avatar
Cool C++ misfeature of the day: std::vector<bool> (edited)
Avatar
is this different than a slice in rust ?
16:29
valarray
Avatar
Avatar
Ryozuki
is this different than a slice in rust ?
Yes, it has nothing to do with it
16:30
Slices in rust would maybe be like ranges in C++20
16:30
Valarrays are real vectors in the sense of vectors of linear algebra
16:30
You can add them, subtract them
Avatar
ah i see
Avatar
Avatar
Fussel
Cool C++ misfeature of the day: std::vector<bool> (edited)
Who thought this was a good idea I wonder
Avatar
"The problem is that the specialised version of std::vector<bool> 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."
16:32
quick google
16:33
is this whats this about
Avatar
Yes, in C++98 someone decided it was a great idea to specialize vector so bools are stored in a bitset instead
16:34
But that breaks a lot of the promises containers make, so std::vector<bool> isn't eveb a standard container 😄
Avatar
Original message was deleted or could not be loaded.
I wonder if this actually works. I doubt the compiler is allowed to see through your struct
Avatar
Original message was deleted or could not be loaded.
better delete, before the overhead gang roasts you
Avatar
Avatar
Jupstar ✪
better delete, before the overhead gang roasts you
This should be 0 overhead, worey not
16:35
Worry*
16:35
lmao
16:35
he actually deleted
16:36
something cool
Avatar
Avatar
Jupstar ✪
better delete, before the overhead gang roasts you
i missed it
16:37
who posted? xd
Avatar
secret
16:37
but he dared to add 3 bytes padding to a bool
Avatar
Avatar
Jupstar ✪
but he dared to add 3 bytes padding to a bool
It shouldn't get padded methinks
Avatar
Avatar
Learath2
It shouldn't get padded methinks
without packing?
Avatar
A single member in a struct shouldn't get padded ever iirc
Avatar
Avatar
Learath2
Who thought this was a good idea I wonder
they thought it would be smart to pack the bools into bits. on first glance it's an idea …
Avatar
Avatar
Learath2
A single member in a struct shouldn't get padded ever iirc
not the member, but the whole struct, bcs of alignment requirements
Avatar
Avatar
Jupstar ✪
not the member, but the whole struct, bcs of alignment requirements
The alignment requirement of a struct with one member is the members alignment requirement, no?
Avatar
Avatar
Learath2
The alignment requirement of a struct with one member is the members alignment requirement, no?
i dunno would be news to me
16:40
i'd have thought it's 4. bcs in c there is no bool and all other types have no size guarantee
16:40
or smth
16:40
on x86
16:41
but if not, then i learned smth new about cpp today
16:41
😬
Avatar
Avatar
Learath2
The alignment requirement of a struct with one member is the members alignment requirement, no?
it should
Avatar
@Learath2 do you check? else i do xd
Avatar
Avatar
Learath2
The alignment requirement of a struct with one member is the members alignment requirement, no?
yes ^^
Avatar
but my mouse partially broken
16:42
that's annoying
Avatar
i have g502 hero
16:42
rustler mouse
Avatar
i have that too tomorrow
Avatar
but i'll miss my old
Avatar
razer viper v2 flex (edited)
16:43
white looks cool
16:43
this is kda special
16:43
ew league
Avatar
@Jupstar ✪ will finally be good at gores poggers
Avatar
Avatar
Teero
@Jupstar ✪ will finally be good at gores poggers
i waited for this day for so long
Avatar
closed source gores*
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
looks fancy
16:44
but doesnt fit my setup
Avatar
Avatar
Learath2
The alignment requirement of a struct with one member is the members alignment requirement, no?
yeah u right
16:44
interesting
16:44
and weird
Avatar
why weird
16:44
@Jupstar ✪ did u ever check the rust Layout struct
Avatar
add 2 bools
16:44
to the struct
Avatar
it has lot of fancy utilities
Avatar
Avatar
Jupstar ✪
@Learath2 do you check? else i do xd
I checked too but I was on phone so too slow 😄
Avatar
Avatar
Jupstar ✪
add 2 bools
It still shouldn't tm get padded
Avatar
Avatar
Ryozuki
why weird
add 1 bool and a short
Avatar
An Esports gaming mouse featuring ultra-lightweight design, Razer™ Optical Mouse Switches Gen-3, and the Razer™ HyperSpeed Wireless connection.
Avatar
Now that'll get padded
16:47
have no trouble at all with this. i got it about 1y ago
16:47
very light very gud
16:47
even though 100€
16:48
now i need a >60hz display and ill be top10 in gores
Avatar
mine has adjustable weight
16:48
i lost the weights tho
16:48
but i never used em
Avatar
I always use my mouse at max weight
💀 2
Avatar
bro is training
Avatar
thats why u so bad at ddnet (jk)
Avatar
I started playing games on an old wireless mouse that had two massive batteries in it that made it heavy asf
16:49
Now I need to mimic that same feeling to play 😄
Avatar
Avatar
Ryozuki
why weird
quiz time c++ struct s { bool a; short b; bool c; }; struct t { s d; bool e; }; you have 10 seconds to answer
16:49
sizeof of struct
Avatar
Which struct? S or t or both?
Avatar
well t ofc
16:49
but u can also say both
Avatar
I'd say sizeof t == 6
16:50
1 + 1(padding) + 2 +1
Avatar
Wher spooler?
Avatar
answer is: 6 for s, 8 for t (edited)
Avatar
for t? yes
Avatar
ye 6 makes sense
Avatar
I have a strong mental compiler
Avatar
i spoke about s ^^
Avatar
Avatar
Teero
hmmmm
So you tried cheating hmm
Avatar
ok now same question, but only for RUST, but in rust: struct s { a: bool, b: i16, c: bool, } @Learath2 @Ryozuki
Avatar
Avatar
Learath2
So you tried cheating hmm
it was after!!
Avatar
Avatar
Jupstar ✪
ok now same question, but only for RUST, but in rust: struct s { a: bool, b: i16, c: bool, } @Learath2 @Ryozuki
Only Allah knows how Rust lays out structs
f3 1
Avatar
Avatar
Jupstar ✪
ok now same question, but only for RUST, but in rust: struct s { a: bool, b: i16, c: bool, } @Learath2 @Ryozuki
easy: just 1 MOV
Avatar
Avatar
Fussel
i spoke about s ^^
s is 6 btw (edited)
16:52
bcs of alignment
Avatar
Avatar
Learath2
Only Allah knows how Rust lays out structs
for x86 with current rust compiler
Avatar
Avatar
Jupstar ✪
for x86 with current rust compiler
I still maintain my position 😄
16:53
2
16:53
1
16:53
answer is: 4
Avatar
sry i was in bath
Avatar
rust is allowed to reorder
Avatar
Yeah that would make sense. Rust doesnt mind reordering
16:53
rust ordering is not stable btw
16:54
it can change between compiler versions
Avatar
it's ok, for our quiz it was stable
16:54
😏
Avatar
Is there a way to force a certain order?
Avatar
repr C
Avatar
You sometimes want a specific order for it to be cache friendly
Avatar
repr C
16:55
xd
16:55
Avatar
Avatar
Teero
hmmmm
you are the winner btw but psst
Avatar
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.
16:56
there is also repr(align(n))
Avatar
Avatar
Teero
hmmmm
Fwiw I don't really understand this one actually
Avatar
Avatar
Jupstar ✪
quiz time c++ struct s { bool a; short b; bool c; }; struct t { s d; bool e; }; you have 10 seconds to answer
@Learath2 can you explain why t is not allowed to optimize it?
Avatar
Oh actually I do understand it nvm 😄
16:58
My brain just miscompiled it
16:59
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
Avatar
will rust optimize the size or not? struct s { a: bool, b: i16, } struct t { a: s, c: bool, }
17:01
s was previously 4, when c was in s
17:01
is t:
  • still 4
  • 6
Avatar
@Ryozuki you answer, ur the rust guy
Avatar
it will reorder s probs
17:04
b -> a
17:04
idk
17:04
xd
Avatar
my compiler says: 6
Avatar
I would say 6 aswell
Avatar
ok one last about cpp again
17:04
#pragma pack(1) struct s { short a; bool b; }; struct t { s mystruct; bool c; }; size of t AND s
Avatar
3 and 4 (edited)
Avatar
3 and 4 too
17:05
xd
Avatar
ez, correct answer
Avatar
Noooo I forgor spoolers
Avatar
is pragma pack standard
Avatar
@Jupstar ✪ rust has packed too
17:06
where rust shines is in niche optimizations
17:06
specially in enums
Avatar
So on a compiler that doesnt support it it's 4 and 8?
Avatar
size of Option<Box<T>>
Avatar
troll
Avatar
4 and 6 actually, 6 is enough
Avatar
Avatar
Ryozuki
size of Option<Box<T>>
NonZeroU64?
Avatar
its pointer sized
Avatar
Avatar
Ryozuki
its pointer sized
ah true
17:07
u wrote box
17:07
lmao
Avatar
none uses the nullptr value
17:07
that box can never have
Avatar
yeah
17:07
32bit or 64bit
17:07
😏
Avatar
so it has no tag
17:07
the enum
Avatar
Avatar
Ryozuki
none uses the nullptr value
Is this optimization available to users of the language?
Avatar
@Jupstar ✪ thats why i said pointer sized
Avatar
in Rust, when specifying dependencies: should I always use the lowest possible SemVer-compatible version? 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
Avatar
Avatar
Learath2
Is this optimization available to users of the language?
yes, through NonZero types
Avatar
Or is it something only compiler black magic can accomplish?
17:08
Ah cool
Avatar
Avatar
Learath2
Is this optimization available to users of the language?
mno, its done by the compiler through builtin types
17:08
nonzore is builtin ye
17:08
zero
17:08
cant type
17:08
NonNull exists for pointers too
17:08
box would be props a NonNull
Avatar
Oh, so can't you implement a NonZero type yourself?
Avatar
Avatar
Learath2
Oh, so can't you implement a NonZero type yourself?
no sadly
17:09
soon u will
Avatar
Avatar
Learath2
Oh, so can't you implement a NonZero type yourself?
that would be insane
Avatar
its a nightly feature
17:09
range types
Avatar
0 overhead Options for all
Avatar
ada has this btw!
Avatar
Avatar
Jupstar ✪
s is 6 btw (edited)
curious but true, I was never interested in trailing paddings ^^
Avatar
Avatar
Learath2
Oh, so can't you implement a NonZero type yourself?
I don't understand, what kind of type would you want to implement?
Avatar
Avatar
Patiga
in Rust, when specifying dependencies: should I always use the lowest possible SemVer-compatible version? 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
i mean u could say that's why cargo.lock exists?
17:10
or do i get your question wrong
Avatar
Avatar
Patiga
I don't understand, what kind of type would you want to implement?
MyCoolNonZeroBigInteger e.g.
Avatar
u always want to purposely use lower version, so cargo can decide to use a newer one if a dep has a newer one?
17:12
ok maybe i am too confused
Avatar
Another cool thing could be to let me have the option bool inside my own struct, like an intrusive option
Avatar
@Learath2 if ur interested in the optimizations rust does check out https://research.checkpoint.com/2023/rust-binary-analysis-feature-by-feature/
Problem Statement 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. 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. ...
Avatar
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
Avatar
it shows a lot of them
17:15
its a rly interesting blog
17:15
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. 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.
Avatar
Avatar
Learath2
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
Or even 7/15 bytes in the worst case
Avatar
Avatar
Learath2
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
u can do that in cpp right? if you mean that https://en.cppreference.com/w/cpp/language/bit_field
Avatar
Avatar
Jupstar ✪
u can do that in cpp right? if you mean that https://en.cppreference.com/w/cpp/language/bit_field
I meant as in zero storage cost wrapping my struct in an Option
Avatar
Avatar
Learath2
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
ah yeah, but this sounded like it
17:18
u kinda would reserve the space
17:18
xd
Avatar
An extra 17 bytes just to add a bool could actually be very meh for the cache depending on the size of the struct
Avatar
i dunno how you would imagine that feature, but sounds interesting
Avatar
Avatar
Learath2
MyCoolNonZeroBigInteger e.g.
(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. 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) edit: bool -> Option (edited)
Avatar
Avatar
Jupstar ✪
i dunno how you would imagine that feature, but sounds interesting
Idk maybe the compiler can optimize to use any NonZero value inside the struct?
17:20
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
Avatar
but when do u ever need the layout of option
Avatar
Avatar
Jupstar ✪
i mean u could say that's why cargo.lock exists?
I think Cargo.lock was just to record the very specific dependency list for the last successful build
Avatar
Avatar
Patiga
I think Cargo.lock was just to record the very specific dependency list for the last successful build
but why can u then do cargo update
17:21
i think it's simply for shared deps version control
17:22
as in: everyone who uses your project will have the same deps
Avatar
Avatar
Jupstar ✪
but why can u then do cargo update
I'm not sure. My current understanding is, that it gives you less compatibility with other libs
Avatar
Avatar
Learath2
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
some day you should show me an example for a struct that has more than 1 member
17:22
maybe i understand it then
17:22
generally sounds useful, but cannot really imagine what exactly you meant 😄
Avatar
since when you specify 1.2.3, you are no longer compatible with 1.2.2
Avatar
Option<Option<Option<i64>>> whats the size of this
Avatar
9 (edited)
Avatar
Avatar
Patiga
since when you specify 1.2.3, you are no longer compatible with 1.2.2
well cannot answer it then. i thought patch versions dont matter? at least cargo upgrade simply upgrades them without any flag
17:24
it doesnt define those as breaking changes
Avatar
and Option<Option<Option<Option<i64>>>>
17:24
result: both are 16
Avatar
Avatar
Ryozuki
and Option<Option<Option<Option<i64>>>>
you scare me I'd still say 9
17:24
huh
17:24
a, fair
Avatar
Avatar
Ryozuki
and Option<Option<Option<Option<i64>>>>
16 or 12
17:24
xd
17:24
but 16
17:24
bcs align (edited)
Avatar
yea, I forgot align
Avatar
btw Option<i64> is 16 too
Avatar
Avatar
Jupstar ✪
generally sounds useful, but cannot really imagine what exactly you meant 😄
You know how Option<Box<T>> has the same size as Box<T>? I was just curious if one could have a similar thing for any type K
Avatar
@Ryozuki try to do the same for NonZeroU64 and additionally add so many Option< until it breaks the compiler
17:25
into thinking it has overhead
Avatar
Avatar
Jupstar ✪
well cannot answer it then. i thought patch versions dont matter? at least cargo upgrade simply upgrades them without any flag
in the Cargo.toml you specify the minimum depency like that
Avatar
Avatar
Jupstar ✪
@Ryozuki try to do the same for NonZeroU64 and additionally add so many Option< until it breaks the compiler
16
17:26
8 if 1 option
Avatar
Avatar
Learath2
You know how Option<Box<T>> has the same size as Box<T>? I was just curious if one could have a similar thing for any type K
yeah, but i'd like to see the syntax for how to define it for K. It sounds useful, but for a struct with many members, it kinda sounds non trivial
17:26
just curious
Avatar
Avatar
Ryozuki
16
OH
17:26
that's indeed interesting
Avatar
Avatar
Ryozuki
16
@Learath2 also interesting for you 😬
Avatar
Avatar
Patiga
in the Cargo.toml you specify the minimum depency like that
do all libs generally do that? 😄
Avatar
Avatar
Jupstar ✪
yeah, but i'd like to see the syntax for how to define it for K. It sounds useful, but for a struct with many members, it kinda sounds non trivial
Any NonZero member no matter how deeply nested could be a candidate for the presence flag
Avatar
what is a lib requires the patch version of another @Patiga 😄
Avatar
Avatar
Learath2
Any NonZero member no matter how deeply nested could be a candidate for the presence flag
ah i see
17:28
intersting
17:28
kind of automatic
Avatar
I've had cargo pull in multiple versions of a lib. That is rather annoying behaviour
Avatar
Avatar
Patiga
in Rust, when specifying dependencies: should I always use the lowest possible SemVer-compatible version? 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
do you even speak about a binary, or about a lib?
17:30
pub struct String { vec: Vec<u8>, } which has a size of 24
17:30
its option<string> is also 2
17:30
24
Avatar
Avatar
Ryozuki
pub struct String { vec: Vec<u8>, } which has a size of 24
OH, how does this one happen?
Avatar
the string ptr
17:31
the vec ptr
17:31
*
17:31
pub(crate) struct RawVec<T, A: Allocator = Global> { ptr: Unique<T>, cap: usize, alloc: A, }
Avatar
Avatar
Patiga
in Rust, when specifying dependencies: should I always use the lowest possible SemVer-compatible version? 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
i think for binaries i'd use latest semver for libs maybe caret
Avatar
pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> { buf: RawVec<T, A>, len: usize, }
Avatar
don't trust me tho
17:31
trust @Ryozuki
17:31
he knows anything
Avatar
So there is some magic in the compiler that can do the optimization I was curious about?
Avatar
Avatar
Jupstar ✪
do you even speak about a binary, or about a lib?
lib
Avatar
That's cute. I wonder what the requirements are
Avatar
Avatar
Jupstar ✪
do all libs generally do that? 😄
yes
Avatar
Avatar
Patiga
yes
mh ok
Avatar
Avatar
Jupstar ✪
what is a lib requires the patch version of another @Patiga 😄
the build system tries to find a compatible version with semver versioning
Avatar
Avatar
Patiga
the build system tries to find a compatible version with semver versioning
yeah but like: what if you lib doesn't work with some unpatched version
Avatar
enum SumType2 { OneOption(i64), AnotherOption(String) }
17:34
size of this?
17:34
given string is 24
17:34
> 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 is a OneOption instance”. Essentially a SumType2 is represented by these two possible structs:
17:34
its 24
Avatar
Avatar
Jupstar ✪
yeah but like: what if you lib doesn't work with some unpatched version
what is a unpatched version?
Avatar
Avatar
Patiga
in Rust, when specifying dependencies: should I always use the lowest possible SemVer-compatible version? 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
i would say no and heinrich agrees with this iirc
17:35
unless u want compat with old rust compilers
Avatar
Avatar
Learath2
So there is some magic in the compiler that can do the optimization I was curious about?
ah, so my mental image was correct after all ^^
Avatar
Avatar
Patiga
what is a unpatched version?
well lets say you use library a and in version 1.0.0 the library crashes for you but in 1.0.1 it's fixed i'd write "^1.0.1"
Avatar
Avatar
Ryozuki
i would say no and heinrich agrees with this iirc
really?
17:37
heinrich agrees with that?
17:37
wow
17:37
i'd really not expect that
Avatar
Avatar
Ryozuki
i would say no and heinrich agrees with this iirc
for what reason?
Avatar
that would be out of his character 😂
Avatar
Avatar
Jupstar ✪
well lets say you use library a and in version 1.0.0 the library crashes for you but in 1.0.1 it's fixed i'd write "^1.0.1"
hm I'd hope that the dependency resolution choosea the highest version
Avatar
Avatar
Patiga
hm I'd hope that the dependency resolution choosea the highest version
why should it
17:39
or differently: why should it without cargo update
Avatar
coz it should be compatible and higher version = good ^^
Avatar
and does it do that everytime u add a library, for all libraries?
17:40
what if two libs use a
17:40
so a is already in cargo.lock
Avatar
cargo.lock has no say over the version afiak
Avatar
it's a funny problem, i never thought about it lmao
Avatar
Avatar
Patiga
cargo.lock has no say over the version afiak
no but if it's already in as version 1.0.0 what updates it?
17:41
cargo add yourlib?
Avatar
Avatar
Patiga
hm I'd hope that the dependency resolution choosea the highest version
it does
Avatar
you specify stuff in cargo.toml, cargo.lock ist just kind of a log
Avatar
actually no
17:41
if lock says X version it will use that
17:41
u need to cargo update
17:41
to update the lock
Avatar
maybe cargo clean is enough? ^^
Avatar
lock is only modified by cargo build if cargo toml version is totally incompatible
17:42
it isnt
17:42
cargo.lock stays between cleans
Avatar
huh, interesting
Avatar
a clean cargo build uses lockfile
17:42
use cargo update to truly update
Avatar
cargo.lock generally is smth you also upload to repos, isnt it?
17:42
if u want reproducible builds (idk if totally reproducible)
Avatar
but at least other libs depending on you don't care about cargo.lock afaik
Avatar
no for libs it isnt
17:43
is only for final bins
Avatar
Avatar
Ryozuki
if u want reproducible builds (idk if totally reproducible)
and it can be annoying if two maintainers do cargo update 😬
Avatar
cargo new --lib gitignores the lock
Avatar
but that's a different problem xDD
17:43
i had it once
Avatar
tho u may want the lockfile in a lib
Avatar
Avatar
Jupstar ✪
no but if it's already in as version 1.0.0 what updates it?
sry I don't understand your question
Avatar
to have reliable ci
Avatar
Avatar
Patiga
sry I don't understand your question
if a is in cargo.lock as version 1.0.0 and you add your lib cargo add yourlib
Avatar
Avatar
Jupstar ✪
and it can be annoying if two maintainers do cargo update 😬
thats why I don't get why you should cargo update
Avatar
do you think a in cargo.lock gets updated in this moment
Avatar
Avatar
Patiga
thats why I don't get why you should cargo update
well everything is a trade
17:44
reproducable builds = same behavior
17:44
i guess most ppl prefer that
17:44
over a patched/up-to-date library (edited)
Avatar
@deen what rooms were you talking about 🤔
Avatar
Avatar
Jupstar ✪
if a is in cargo.lock as version 1.0.0 and you add your lib cargo add yourlib
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
Avatar
Avatar
Patiga
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
yes but what if not
17:46
and your lib crashes on 1.0.0
Avatar
then it crashes
Avatar
lmao
Avatar
thats why I hope that it chooses the highest available version
Avatar
i personally would always use a version i tested with tbh
Avatar
but I guess if ryo looked it up, it uses the lowest compatible ine
17:47
*one
Avatar
Avatar
Patiga
thats why I hope that it chooses the highest available version
i dunno what cargo's behavior is, but if your lib uses 1.0.2 and another 1.0.1 why should it not use 1.0.2 for the other too anyway following your argumentation?
17:48
in worse case you'd have updated the cargo.toml of someone else
Avatar
that is exactly what the dependency resolution does
17:49
but true
17:49
I didn't see the symmetry
17:50
the highest version should be just as compatible as the lowest version
Avatar
yeah 😄 but still interesting question
17:51
i never really thought about it
17:51
guess i'd be a bad lib maintainer xdd
Avatar
Avatar
Patiga
but I guess if ryo looked it up, it uses the lowest compatible ine
no, it uses highest compat one without a pre existing lockfile
17:53
then it writes lockfile with it
17:54
im in mobile rn and frustrated typing here xd
Avatar
👍 thats sensible behavior
17:54
same :p
Avatar
i have no working mouse, does that count too?
Avatar
with pre existing lockfile it will only update if carg toml has a version higher
17:55
and write to lockfile
Avatar
Avatar
Jupstar ✪
i have no working mouse, does that count too?
no slacking allowed here, go grab your mobile
18:48
Augmenting Local AI with Browser Data: Introducing MemoryCache
18:49
The long-in-development work for a fully-functional multi-threaded FFmpeg command line has been merged! The FFmpeg CLI with multi-threaded transcoding pipelines is now merged to FFmpeg Git ahead of FFmpeg 7.0 releasing early next year
Avatar
wait so what even is the usecase??
19:16
is firefox just making a "haha we know your browser history" extension
Avatar
Avatar
Voxel
is firefox just making a "haha we know your browser history" extension
no it doesnt share history data
19:16
its a local ai
19:16
local on ur device
19:17
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.
19:17
oday, MemoryCache is a set of scripts and simple tools to augment a local copy of privateGPT. The project contains: 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 A shell script that listens for changes in the /Downloads/MemoryCache directory and runs the privateGPT ingest.py script 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)
Avatar
i dont need a personalized browser that doesnt even know me
Avatar
i would like it
19:18
for example to ask
19:18
"that blog about rust in the past about niche optimizations"
19:18
and it finds it for me in my history
Avatar
i mean you can just use your brain
Avatar
that has to be the most useless executive flytrap idea yet ai browser history
Avatar
lol
Avatar
if people actually need a machine to refind something for them then we're doomed as a society
Avatar
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?
Avatar
you can sell the AI thing to the AI enjoyers
19:34
while the other is boring
19:34
you can sell the other to voxel, bcs it's no AI
Avatar

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addres...
Avatar
That's why I asked, he said needing a machine is bad, but I doubt he doesn't use bookmarks
Avatar
i use no bookmarks xdd
Avatar
Avatar
Robyt3
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?
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
Avatar
Avatar
Jupstar ✪
i use no bookmarks xdd
Do you have 1000 tabs open or search your history every time? justatest
Avatar
Avatar
Jupstar ✪
while the other is boring
id rather be boring than not used by copper and wires
Avatar
Avatar
Robyt3
Do you have 1000 tabs open or search your history every time? justatest
in fact i use anonym tab most of the time, bcs google gives worse results when i already searched something
19:36
so i dont even have a huge browser history
Avatar
How do you refind something that you looked at earlier? (edited)
Avatar
i look in my brain
19:37
😬
Avatar
Avatar
Robyt3
Do you have 1000 tabs open or search your history every time? justatest
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
Avatar
Avatar
Voxel
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
i also often do that xD
19:38
i hate many tabs
Avatar
Avatar
Robyt3
How do you refind something that you looked at earlier? (edited)
mostly by remembering
Avatar
Avatar
Robyt3
How do you refind something that you looked at earlier? (edited)
i also rarely reread stuff, or delay reading stuff either i read it, or idc xD
Avatar
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
Avatar
i wish i could be that organized xD
19:40
i am way to lazy for that
Avatar
It's still a mess, but an organized one
Avatar
Avatar
Robyt3
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?
The difference is Voxel hates AI
Avatar
at least he makes us think so
Avatar
I regularly abuse google as that browser history ai so I welcome the addition
Avatar
Avatar
Voxel
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
explain how a local ai that helps u search ur history leads to advertising
Avatar
I usually remember only keywords about blogposts I've read. E.g. ETW, chromium, nt kernel, bug, asciirandom
Avatar
Avatar
louis
explain how a local ai that helps u search ur history leads to advertising
I guess it could have secret bias towards companies that pay more, idk if that's possible given it's probably open source
Avatar
Avatar
louis
explain how a local ai that helps u search ur history leads to advertising
biased results towards mozilla afilliated links?? idk
Avatar
Avatar
Jupstar ✪
at least he makes us think so
no, i Know so, because you guys are a slap in the face as to why i should be against it
Avatar
Avatar
Voxel
no, i Know so, because you guys are a slap in the face as to why i should be against it
it's ok honey, you already admited to me that you like AI
19:47
u even showed me some tool that uses AI
Avatar
what's the url of the ddnet http master server for fetching the json data?
Avatar
Avatar
Robyt3
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
same
Avatar
Avatar
Jupstar ✪
u even showed me some tool that uses AI
which was that again
Avatar
i also have a big bookmark folder with manga
Avatar
Avatar
Voxel
which was that again
the music thing
19:47
cant remember exactly
Avatar
difference was i was in control
Avatar
Avatar
jxsl13
what's the url of the ddnet http master server for fetching the json data?
Avatar
Avatar
Voxel
difference was i was in control
fine by me 😄
Avatar
what's the difference?
19:49
one being official ddnet servers?
19:49
other the rest?
Avatar
Avatar
Ryozuki
danger dont bookmark it danger
the funny thing is, i sometimes google them bcs i forget the URL xD
Avatar
ill bookmark them all
Avatar
ok, one has player info
Avatar
Depends on what you need, one is the list of servers with all the server info, the other is the ddnet info json
Avatar
Avatar
cyberFighter
ill bookmark them all
like no one ever was
Avatar
all servers with playercount is what I need
Avatar
servers.json is server list
Avatar
At the start of each year, on January 1st, a new crop of works enter the public domain. Find our highlights of what lies in store for 2024 here.
19:52
😏
19:52
@Learath2 @Jupstar ✪
19:52
this will be
19:52
public domain
Avatar
epic
Avatar
unfortunately only that single film
Avatar
directly watch on youtube
Avatar
Avatar
Ryozuki
@Learath2 @Jupstar ✪
NOOOOO won't somebody think of the shareholders???
19:57
This is communism
Avatar
i wait for the day when dragonball goes public domain
19:59
then i quit my job
20:00
code a good db game, and show konami the middle finger
20:00
then i can die in peace
Avatar
Avatar
Ryozuki
@Learath2 @Jupstar ✪
it's sad that they don't also have to release the project files
20:01
like in programming the source code
20:01
would be kinda cool
Avatar
10b486a Remove unnecessary use of GetCompletePath - Robyt3 187120d Ensure network log files are closed when shutting down engine - Robyt3 bcc92fa Merge pull request #7638 from Robyt3/Engine-Refactoring - def-
Avatar
Avatar
Fussel
Click to see attachment 🖼️
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?
Avatar
Avatar
Fussel
same goes with java, and rust too: solving problems a language should not solve …
just like C, trying to shove everyone into the concept of functions etc.
Avatar
Avatar
Fussel
c++ offers you facilities to easily avoid segfault. so if you get one, it's your fault ^^
not helpful. huge projects like chromium get segfaults despite competent programmers being involved
Avatar
Avatar
Jupstar ✪
quiz time c++ struct s { bool a; short b; bool c; }; struct t { s d; bool e; }; you have 10 seconds to answer
sizeof(struct s) == 6, sizeof(struct t) == 8?
Avatar
Avatar
Jupstar ✪
ok now same question, but only for RUST, but in rust: struct s { a: bool, b: i16, c: bool, } @Learath2 @Ryozuki
4
Avatar
Avatar
Jupstar ✪
will rust optimize the size or not? struct s { a: bool, b: i16, } struct t { a: s, c: bool, }
t: 8
20:57
eh, 6, I mean
Avatar
Avatar
Jupstar ✪
#pragma pack(1) struct s { short a; bool b; }; struct t { s mystruct; bool c; }; size of t AND s
3, 4
Avatar
Avatar
Patiga
in Rust, when specifying dependencies: should I always use the lowest possible SemVer-compatible version? 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
depends on whether you want to track that down or not
20:58
it's hard to ensure that it keeps working though, there's some work on -Z minimal-versions IIRC
20:58
for cargo
Avatar
Avatar
Ryozuki
soon u will
source?
Avatar
rewind time everybody
Avatar
Original message was deleted or could not be loaded.
rust already does that
Avatar
Original message was deleted or could not be loaded.
correct
Avatar
Original message was deleted or could not be loaded.
yes
Avatar
Original message was deleted or could not be loaded.
only everyone using your project directly. if they have your project as a dependency, your Cargo.lock will be ignored
Avatar
Original message was deleted or could not be loaded.
16
Avatar
Original message was deleted or could not be loaded.
16
Avatar
Original message was deleted or could not be loaded.
it is
Avatar
Original message was deleted or could not be loaded.
it's called "niche" in rust, I think
Avatar
Original message was deleted or could not be loaded.
yep, that
Avatar
Original message was deleted or could not be loaded.
yes
Avatar
Original message was deleted or could not be loaded.
hmmmm. not really. it's used for people directly compiling your crate
Avatar
Original message was deleted or could not be loaded.
if people actually need a machine to help them look up definitions, we're doomed. oh wait, wikipedia
Avatar
Original message was deleted or could not be loaded.
that you can use different words. but a fuzzy search over the content would already be nice
Avatar
Original message was deleted or could not be loaded.
you could say that about any software. everything produced by mozilla could be biased towards mozilla. what's special about "AI" aka LLMs?
Avatar
Avatar
Jupstar ✪
rewind time everybody
hi o/
Avatar
hai
Avatar
Avatar
heinrich5991
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?
I already demonstrated the exact example from this talk in a godbolt
Avatar
Original message was deleted or could not be loaded.
ah, here. @Fussel
Avatar
is it possible to compile ddnet for linux on windows?
Avatar
Avatar
louis
is it possible to compile ddnet for linux on windows?
native windows?
21:15
or is WSL allowed?
Avatar
i mean theoretically possible yes, but never heard of a toolchain tbh
Avatar
you probably mean "possible" as in "can you give me a manual"?
Avatar
yeah i mean like is there a way easier than just cloning source and recompiling on linux
Avatar
Avatar
louis
yeah i mean like is there a way easier than just cloning source and recompiling on linux
run the windows version in wine? 😄
Avatar
else very probably not easier
21:18
bcs compiling on windows IMO is not ez
Avatar
Avatar
louis
yeah i mean like is there a way easier than just cloning source and recompiling on linux
no. compiling on the target system will be the easiest
21:20
cross-compiling unfortunately seems to be always harder than getting the target OS directly (in a VM or directly on hardware) and compiling there
Avatar
Avatar
Jupstar ✪
rewind time everybody
wasnt there a yt vid like that in old times
Avatar
Avatar
Ryozuki
wasnt there a yt vid like that in old times
pewdiepie? xd
21:22
yeah my brain thinks in quotes
Avatar
oficial
21:24
found it xdd
Avatar
Now CGameContext now longer assumes the IGameController declined the team join due to slots. This enables custom gametypes to disallow joining the game if the player died, an active tournament is running or the player is not logged in yet. And then the controller can print the correct error message accordingly.

Checklist

  • [x] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
...
Avatar
ChillerDragon BOT 2023-12-12 22:58:02Z
can someone explain me why ddnet compiles
22:58
22:58
this mf is using the enum CFGFLAG_CLIENT
22:59
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
22:59
it is defined here
22:59
which is below the include
22:59
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
22:59
C++ hoisting momemnt
23:01
clearly a bug in the c++ compiler
23:01
ryo pls fix
23:02
@louis whats the problem with WSL?
Avatar
ChillerDragon: idk im on native windows
Avatar
ChillerDragon BOT 2023-12-12 23:16:20Z
so?
23:16
go to ms store get WSL for free and you have a linux shell in 1 min
23:17
while being on native windows
23:22
@louis did it work?
Avatar
i mean i already cloned on my linux vps 😅
Avatar
ChillerDragon BOT 2023-12-12 23:22:45Z
so you build there now?
23:22
yea that works too
Exported 1,182 message(s)