Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/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-04-11 00:00:00Z and 2023-04-12 00:00:00Z
Avatar
thats why its bad xd, explicit > implicit
05:22
i was struggling like for a week when started learning cpp and tw code base together
05:22
also it makes cserver unreusable
05:23
btw with Chairn mem_zero implementation it works all good
brownbear 1
05:23
same pool but implicit + templatr based
05:23
template*
05:27
template<typename T> inline void mem_zero(T *block, std::size_t size) { typedef typename std::remove_all_extents<T>::type BaseT; if constexpr(std::is_pointer<T>::value || std::is_pointer<BaseT>::value) { // pointer of pointer, just memset it std::memset(block, 0, size); } else if constexpr(std::is_array<T>::value) { // pointer to array...
05:29
ah xd
05:30
should pass m_Pool[ObjectId] as ObjectType*, mem_zero will not recognize it xd
Avatar
Avatar
gerdoe
thats why its bad xd, explicit > implicit
That’s an opinion and you are entitled to it
Avatar
go to work giga_chad
Avatar
If I wanted to replace it, I would probably just use a std::array<std::optional<T>, N> Pool
Avatar
i would use [Option<T>; N] because cpp is unholy
06:21
good morning
Avatar
Or if you are concerned about the iterator performance maybe a minimal wrapper struct Pool { std::bitset<N> m_Used; std::array<T, N> m_Storage;}
Avatar
Avatar
Ryozuki
i would use [Option<T>; N] because cpp is unholy
looks like Rust extend your keyboard EoL giga_chad they should mention it (edited)
Avatar
I would definitely not write my own bitset, nor would I mess around with a char array
06:26
I guess we do want to placement new it though, so maybe a char array is fine
Avatar
Anyway, I don’t see it being prettier than what we have. So if you’d like to see a change you’ll have to implement it and make a PR
Avatar
Avatar
Ryozuki
i would use [Option<T>; N] because cpp is unholy
good morning fellow rustacean troll
10:26
how are you about new rust foundation draft troll
Avatar
Avatar
gerdoe
how are you about new rust foundation draft troll
wat
Avatar
Avatar
Learath2
I would definitely not write my own bitset, nor would I mess around with a char array
forgot about std::bitset so theres no need to use own bitset anyway
Avatar
Avatar
Ryozuki
wat
ah yea people seems to complain about all the stuff
11:30
til
Avatar
Rip
11:31
But not uncommon
11:31
Vulkan is a royalty free API. Still it's logo is copyrighted
Avatar
yeah thats bad
11:32
but it still hasnt passed
11:32
i hope they dont
Avatar
Avatar
Jupstar ✪
Vulkan is a royalty free API. Still it's logo is copyrighted
its common to have this
11:32
the problem is its too restrictive
11:33
they require u dont use a modified logo
11:33
the reddit logo is modified
11:33
the rust web itself uses a modified logo for favicon xd
11:33
the foundation is entirely disconnected to what the community wants at this point
11:33
i hope they retract
Avatar
Avatar
Learath2
Anyway, I don’t see it being prettier than what we have. So if you’d like to see a change you’ll have to implement it and make a PR
its not just prettier, i was trying to reuse cserver instances with one exec and they had shared ccharacter/cplayer pools xd
Avatar
is there a f1 command to show the bind of a key? ik i can look at my config
Avatar
Avatar
gerdoe
its not just prettier, i was trying to reuse cserver instances with one exec and they had shared ccharacter/cplayer pools xd
Yep sucks
Avatar
dump_binds key
Avatar
I generally dislike global or thread vars
11:53
Thread local
Avatar
@Learath2 i should use realloc in the scenario of implementing a dynamic array right
12:01
vs free, copy and malloc
12:01
according to benchmarks realloc is more efficient i think
12:01
a growable array*
12:01
vector
12:01
xd
12:02
It's faster to realloc down, and might be faster to realloc up if there's room to grow in place. Otherwise, it translates to a malloc/copy/free.
12:03
actually realloc is a jack of all trades
12:04
The realloc() function changes the size of the memory block pointed to by ptr to size bytes. The contents will be unchanged in the range from the start of the region up to the minimum of the old and new sizes. If the new size is larger than the old size, the added memory will not be initialized. If ptr is NULL, then the call is equivalent to malloc(size), for all values of size; if size is equal to zero, and ptr is not NULL, then the call is equivalent to free(ptr). Unless ptr is NULL, it must have been returned by an earlier call to malloc(), calloc() or realloc(). If the area pointed to was moved, a free(ptr) is done.
Avatar
Avatar
Ryozuki
the problem is its too restrictive
Read a bit of it now. Seems to suck indeed xd
12:06
The logo is ugly af. So why make such restrictions xD
Avatar
Avatar
Ryozuki
@Learath2 i should use realloc in the scenario of implementing a dynamic array right
Definitely, if there is space, realloc won’t involve a memcpy
Avatar
realloc() knows more about the situation than the malloc() user so it can behave more efficiently
13:37
9f4c5f3 Update frontpage video - murpii cbda23f Merge pull request #248 from murpii/patch-3 - def-
Avatar
hmm thinking about doing a pop from the front, just a memcopy? xD
14:29
does memcopy allow memory overlap
Avatar
memmove allows overlap, memcopy doesnt
Avatar
for overlapping i need memmove i think
14:30
The memmove() function copies n bytes from memory area src to memory area dest. The memory areas may overlap: copying takes place as though the bytes in src are first copied into a temporary array that does not overlap src or dest, and the bytes are then copied from the temporary array to dest.
14:30
yeah thanks
Avatar
Ryozuki gives me my daily dose of low level function learning
Avatar
Avatar
Jupstar ✪
Ryozuki gives me my daily dose of low level function learning
arent u c dev
15:03
or u just use new
15:03
xd
Avatar
I am no c dev. I know the standard API to some extend since with cpp98 u often still use it. With cpp11 i didn't use it anymore. But i think I know pitfalls of memory alignment, raw memory copying etc to some extend since GPUs obv face the same problem ^^
15:12
And cpp still has no standard network API. So there u'll probably face it too if u don't use a lib
15:12
Weak cpp xd
15:13
rust has a simple low level api
15:13
Avatar
Are u currently writing the compiler for exactly this?
15:14
Or does rust implement it with libc anyway
Avatar
im not writing a compiler for rust xd
Avatar
Oh thought u write allvm backend
Avatar
but the language has a builtin growable array type
15:15
so i need to implement it
15:15
i am writing a llvm backend
15:15
well pedantically
15:15
its a compiler frontend
15:15
well no
15:15
its a backend
15:15
nevermind me xd
15:15
(a backend that uses llvm)
Avatar
Lel
15:15
So it's not a backend for llvm
15:15
That rust might call xd
Avatar
i dont understand
15:16
u know what llvm does right
Avatar
I mean like llvm to anything compiler
15:16
The llvm language
Avatar
i write a backend as in a program that takes a input program and outputs LLVM IR
15:16
like rust does
Avatar
Ah I c
Avatar
llvm is a framework for codegen
Avatar
So u writing a compiler that compiles to llvm ir
15:17
like most modern compilers do
15:17
xD
Avatar
In rust?
Avatar
Ez
15:17
Html compiler
Avatar
actually not as ez as in cpp, cuz in cpp u have the fancy cpp api from llvm
15:17
in rust u gotta use the C api
Avatar
Ez
Avatar
or deal with cpp stuff
Avatar
Use wrapper
Avatar
there isnt
Avatar
I saw one last time we talked about it
Avatar
inkwell
15:18
yeah
15:18
but im using MLIR not just llvm
15:18
so its another api
Avatar
Ok I'm not so much in topic
15:19
But just fix llvm while u at it
Avatar
mlir is like another layer on top of llvm ir
15:19
what is there to fix xd
Avatar
Graphic drivers broken and llvm err xd
Avatar
i wanted to maybe contribute in extending the C api but im lazy
15:20
and im sure its a long process to contribute
Avatar
Do it
15:20
Would be super amazing
Avatar
i would go to twitter and say im a llvm dev
15:20
clout please
15:20
and then get a hot goth gf
Avatar
It's like me contributing to VK API xd
15:20
u did?
15:21
i kinda wanna do it
Avatar
No. But i defs have ideas to improve 2d stuff.. but i doubt Nvidia cares about me xdd
Avatar
i nfact ill probs contribute
15:21
i also can get clout at my work
15:21
hello boss, im a llvm dev now
15:21
use me to flex in ur meetings thanks
Avatar
Ez xd
15:21
I know real llvm dev
Avatar
its not really that hard
Avatar
Wtf is llvm
Avatar
its just a closed world
Avatar
Would be response
Avatar
like its hard to get into
15:22
cuz docs about inner workings arent there
15:22
but well i already llooked at llvm source code due to lack of docs
Avatar
Ez
Avatar
patiga is spying 👁
Avatar
How can u tell
Avatar
i saw him type
Avatar
Fbi
Avatar
fbi open up
15:25
@Jupstar ✪ u need disk space tho xd
15:25
the fcking repo takes gb
Avatar
I once compiled it. Took quite long xd
Avatar
i did several times
15:28
xd
Avatar
We asked the Rust Foundation to update the old Rust trademark policy. They proposed a first draft and are asking us all to submit our feedback. Rest assured that the Rust project will only accept something that we can stand behind and addresses the concerns that have been raised.
Likes
302
16:15
some assurance3 for now
Avatar
Hey, I think it'd be great to have a timeline on mappers' profile
16:46
Something like that :
16:46
Avatar
chillerdragon BOT 2023-04-11 17:29:20Z
Nice graphic. Make a issue on the web repo otherwise it probably gets lost
Avatar
Hey, it'd be great to have a timeline on mappers' profile. Something like that : !timeline
Avatar
no trademark is the real trademark
Avatar
i dunno how these organizations play together but defs weird, they should simply say "ok fuck it april fool bye"
Avatar
at the end capitalism always corrodes
Avatar
@Ryozuki can trust = can't rust
18:41
can i trust you?
Avatar
but it wont be accepted as it is
Avatar
Avatar
Chairn
can i trust you?
no
18:41
u shouldnt even trust urself
Avatar
can you rust?
Avatar
ur brain senses can lie to you
Avatar
you cant spell trust without rust
Avatar
Avatar
Chairn
can you rust?
u can trust its more safe than cpp
18:42
cant wait for the next gen language
Avatar
i can't rust cuz it's more safe than cpp
18:42
as a hardware designer, i often do some unsafe c/cpp, true
Avatar
u cant trust hardware
18:42
thus u cant trust software
Avatar
can you pin a variable to a specific address in rust?
Avatar
unsafe {} (edited)
Avatar
Avatar
Chairn
can you pin a variable to a specific address in rust?
in safe rust or unsafe rust? xd
Avatar
u can maybe even in both
Avatar
can you inline assembly in rust?
Avatar
even nasa has failures
Avatar
Avatar
Chairn
can you inline assembly in rust?
ye
Avatar
but u can only dereference in unsafe
Avatar
this seems generic
Avatar
in unsafe rust u can do pretty much everything bcs pointers
18:44
u can even trick the borrow checker with it
Avatar
too bad that x86 SIMD assembly will trigger segfault everywhere
Avatar
Avatar
Ewan
this seems generic
what does this mean
Avatar
can u do arch specific instructions
Avatar
Avatar
Chairn
too bad that x86 SIMD assembly will trigger segfault everywhere
portable simd support is in nightly
Avatar
Avatar
Ewan
can u do arch specific instructions
yeah its assembly
Avatar
actually u dont need assembly for that
Avatar
intrinsics aside
Avatar
rust most probs has intrinsics for those targets
18:46
i made ryoos with rust
18:46
u can do low level
18:46
idk why u think not
18:46
its stupid misconception
Avatar
can i define constraint on unsafe code?
Avatar
like cpp constraint?
Avatar
like, tell compiler input/output
18:46
so that it can still optimizes around
Avatar
unsafe code allows a small list of things
18:47
Dereference raw pointers Call unsafe functions (including C functions, compiler intrinsics, and the raw allocator) Implement unsafe traits Mutate statics Access fields of unions
Avatar
or give him referenced address in memory so that memory fence may be needed
Avatar
mr compiler
Avatar
Avatar
Chairn
like, tell compiler input/output
from the asm?
18:50
for*
18:50
did u even look at my links
Avatar
but he should infer the memory fence by itself if i give it correct constraints
Avatar
Avatar
Ryozuki
did u even look at my links
not yet
18:52
i have no reason to continue discussing
18:52
rust fan extremly mad xD
Avatar
who is not mad at this lmao
18:53
i tell u things and u dont care
18:53
idk why i even answer in the first place
Avatar
he uses you as gpt u have to read the link and answer all questions
Avatar
well, i ask questions because i thought about these now, but i dont have time to delve into it right now
Avatar
im mad and there is nothing u can do about it
19:20
i wont breathe now
Avatar
A thrice-weekly webcomic written and illustrated by Reza Farazmand. New comics every Monday, Wednesday, and Friday.
Avatar
hi who broke vertical alignment
19:51
my symmetric brain doesnt like this
Avatar
Where are those buttons? Maybe you can take a look at the text render and identify what's causing this. I assume somewhere the text height calculation is wrong or inconsistent with the actual rending. Otherwise the icon would be correctly vertically centered.
Avatar
its the search filters
20:08
but it was never like this, tho i ddint play for like a week
20:08
stable release
Avatar
I recently overhauled vertical alignment in the UI, so if some alignment is wrong it's probably from that. But those changes are not in stable yet. And for me those buttons look correct also with current master.
Avatar
probably resolution dependent
20:21
TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT); these were removed for example
20:22
they are important bcs some letters have bearings to look normal in latin text. but if you want to pixel perfect align u dont want it
Avatar
i think those functions use labels which have auto font size capability
20:24
could be broken
Avatar
Avatar
Jupstar ✪
TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT); these were removed for example
But for vertical centering you only need the correct total height of the text to align it? Or does this also change the offset somehow?
Avatar
Ligatures will make the height misleading
20:25
I think it's Y bearing
Avatar
yeah the offset is probably part of the height
Avatar
looks like the compiler guesses which memory is touched, i don't see you can give him variable names directly touched by the assembly code
Avatar
mr compiler
Avatar
he is mr hardware
20:38
ryo is mr compiler
Avatar
Ryo is mr rust* (edited)
Avatar
Avatar
Mʎɹ シ
Ryo is mr rust* (edited)
pay 1$ for mentioning that thing (edited)
22:39
troll
Exported 272 message(s)