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 2022-05-12 00:00:00Z and 2022-05-13 00:00:00Z
Avatar
You probably need a null check somewhere
Avatar
who's the god of antlr that will help me
Avatar
suggested in https://github.com/ddnet/ddnet/issues/5057 works for player and dummy !image

Checklist

  • [x] Tested the change ingame
  • [x] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test if it works standalone, system.c especially
  • [ ] Considered possible null pointers and out of...
Avatar
just an idea for the new hud, but maybe it's not worth it:: an indicator which weapon you have selected while you're frozen (edited)
Avatar
Written this for #5032, might be helpful for others :)

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test if it works standalone, system.c especially
  • [ ] 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](htt...
Avatar
Avatar
Ryozuki
@Jupstar ✪ lol
yeah its just funny that the first issue is directly a meme xd
14:32
now they get the real pros xd
14:33
lmao completly useless changes tho xd
14:34
who tried to cheat code lines here xDD
14:35
99% "fix typos" prs xdd
14:35
they all want their early contribution
Avatar
xD probably automatically added by a bot for the case CONFIG_I2C is not defined (edited)
Avatar
30f6757 Output corresponding array to EXPECTED in teehistorian test cases - Zwelf 32340e3 Merge #5090 - bors[bot]
Avatar
can sb. tell me where the ddnet client looks for sounds on my system? I am on windows
Avatar
%appdata%/teeworlds/audio/ if you mean the soundpack
Avatar
ah under mapres
14:45
no i mean for mapping
14:45
but thank you 😄
Avatar
does someone have the Clang-Tidy extension on vs-code up and running for ddnet code? I can not figure out how to configure it correct xD (edited)
Avatar
yes
15:13
i use clangd
15:14
Visual Studio Code extension for clangd. Contribute to clangd/vscode-clangd development by creating an account on GitHub.
Avatar
clang-tidy is really slow, I don't even run it locally
Avatar
(this extension just directly tells u where the clang tidy issues are)
15:15
they dont get auto fixed
15:15
but u'll still directly see problems
Avatar
mh the Clang-Tidy extension runs fast 😄 but it does not use the cmake command json so it does not find the imports
15:16
I will try clangd
Avatar
can confirm clangd works very well on most projects. With cmake it uses the compile_commands.json to figure out exactly how the project is built so it knows about your dependencies etc.
Avatar
Clang-Tidy can also use the compile_commands.json xD but I can not get it to work xD ^^
🤷 1
Avatar
rustfmt runs pretty fast
15:23
another reason to use rust
15:23
monkalaugh
15:23
but ye
15:23
clang tidy (or the script) is unusually slow
15:23
like painfully slow
Avatar
Avatar
Ryozuki
rustfmt runs pretty fast
yeah but rust-analyzer tough not so fast
Avatar
bcs the script also fixes, so it has to run single threaded
15:24
else it destroys the headers
15:24
u can also run clang-tidy mt
Avatar
Avatar
k2d222
yeah but rust-analyzer tough not so fast
well rust-analyzer does way way more than clangd does
15:24
and rust is a more complex language to analyze
15:24
did u know rust-analyzer is seen as a top notch language server among the language servers
Avatar
Avatar
k2d222
can confirm clangd works very well on most projects. With cmake it uses the compile_commands.json to figure out exactly how the project is built so it knows about your dependencies etc.
so I have now clangd running instead of clang-tidy. How do I tell it the correct compile_commands.json
Avatar
the github says it uses .clang-tidy file directly for clang-tidy
Avatar
i tried clangd with vscode and it sucked, but i think its more a vscode thing, clangd with neovim worked flawlessly
Avatar
"Most clang-tidy checks are supported (these can be enabled using a .clang-tidy file)."
15:26
so it should just work in ddnet
Avatar
Avatar
c0d3d3v
so I have now clangd running instead of clang-tidy. How do I tell it the correct compile_commands.json
make a symlink to the root dir
15:26
aka the dir where .git is located
Avatar
Avatar
Ryozuki
i tried clangd with vscode and it sucked, but i think its more a vscode thing, clangd with neovim worked flawlessly
what sucks about it?
15:26
i use it since years
15:26
never had any problem
Avatar
@Jupstar ✪ idk it didnt work well
15:26
so i just used the microsoft bullshit
15:26
but i mostly use neovim for c++
Avatar
Avatar
Ryozuki
make a symlink to the root dir
xD a symlink from where to where?
15:27
to the compile_commands.json
15:27
?
15:28
in ur build folder
15:28
compile_commands.json -> build/compale_commands.json
Avatar
@Ryozuki clang-tidy is more like clippy
15:30
clang-format is like rustfmt
Avatar
i also use tree-sitter for enhanced syntax highlight
15:30
but sometimes it goes bonkers
Avatar
Avatar
heinrich5991
@Ryozuki clang-tidy is more like clippy
ah ok
15:30
well clang-format is rly slow too
15:30
from my experience running the script on ddnet
Avatar
but why would u run the script that checks all files
Avatar
why not?
Avatar
ofc its slow
15:31
to check all files
Avatar
on rust i run cargo fmt and its super fast
15:31
and it formats all files
Avatar
Avatar
Ryozuki
from my experience running the script on ddnet
but that script run it on all files... you only have to run it on the file you just edit (edited)
Avatar
it probs saves what is formatted or smth
Avatar
same stuff
15:31
cargo fmt is run on all files too
Avatar
c++ parsing is hard, you can't get the syntax tree without type checking
15:31
rust parsing is easy in comparison
Avatar
that may be it
15:32
i heard parsing c++ headers is like the abomination
Avatar
clang-tidy does way more than just parsing, clang-format only parses and that's fast enough
15:33
sometimes i think this is more a toy project to them than something serious
15:34
why are there so many newlines
Avatar
Avatar
Ryozuki
compile_commands.json -> build/compale_commands.json
still does not work
Avatar
u called cmake with the json output right
Avatar
tbh i think they used their 1970 code base that they used for linux even if linux wasnt invented, and now they enjoy linux ppl clean it up good move nvidia xd
Avatar
@c0d3d3v just setup neovim
15:35
ezpz
Avatar
Avatar
c0d3d3v
still does not work
what are u even trying to do
15:36
just use the cmake extension
15:36
and let that handle everything
Avatar
neovim advantages: low ram, no electron bloat, you look cool while using it, enhanced productivity if u learn enough
Avatar
no mouse?
Avatar
yeah mouse is bloat
Avatar
without mouse coding sucks
Avatar
Avatar
Ryozuki
neovim advantages: low ram, no electron bloat, you look cool while using it, enhanced productivity if u learn enough
who needs low ram if he has 1tb swap
Avatar
also learn to use vim macros
Avatar
its like playing teeworlds without cursor
Avatar
record macros etc
15:37
u can rly save a lot of time
Avatar
Avatar
Jupstar ✪
its like playing teeworlds without cursor
nah
Avatar
speed is the only argument against vscode tho once it runs u wont notice xd
Avatar
u rly dont need the mouse
Avatar
u dont need, but u want
15:38
i can also use no keyboard
15:38
xd
Avatar
Avatar
Jupstar ✪
i can also use no keyboard
ye im waiting the day i can code mentally
Avatar
ok that would be amazing ngl
15:38
then i can code in my bed
Avatar
i could code if for some reason i become paralized
15:39
idk why i always think, what would i do if i become paralized
15:39
it would be so boring
15:39
xd
Avatar
@heinrich5991 any idea what's wrong with #5069?
Avatar
Avatar
Ryozuki
idk why i always think, what would i do if i become paralized
hard question xd
Avatar
Avatar
Jupstar ✪
just use the cmake extension
rofl, after installing the cmake extension (edited)
Avatar
guess u change mentally with your body change
Avatar
my build chain is broken
Avatar
Avatar
Jupstar ✪
hard question xd
the same as if someday i become blind lol
15:39
thats terrifying actually
Avatar
cmake insists ENGINE_SHARED is not alphabetically sorted, it wasn't I sorted it, it still doesn't like it. It also insists it doesn't contain all the files, but ls -la confirms it does
15:40
I'm at a bit of a loss
Avatar
idk, I'll check locally
Avatar
Avatar
c0d3d3v
rofl, after installing the cmake extension (edited)
these are my plugins delete build dir use a clean dir close vs code restart just works™️
Avatar
should I fix it? didn't dare touch the branch because I asked you to base your branch off of it
Avatar
Avatar
Jupstar ✪
these are my plugins delete build dir use a clean dir close vs code restart just works™️
imagine using a debuger
15:41
print goes brr
15:41
dbg_msg ftw
Avatar
xd
15:42
lldb is best but sometimes it also sucks comared to gdb
Avatar
Avatar
heinrich5991
should I fix it? didn't dare touch the branch because I asked you to base your branch off of it
You can also tell me what's wrong with it and I can do it too 😄
Avatar
@Learath2 works locally when I sort it
15:43
can you send me the new error?
Avatar
is there something like this https://github.com/tokio-rs/loom but for c++?
Concurrency permutation testing tool for Rust. Contribute to tokio-rs/loom development by creating an account on GitHub.
15:43
Loom is a testing tool for concurrent Rust code. It runs a test many times, permuting the possible concurrent executions of that test under the C11 memory model. It uses state reduction techniques to avoid combinatorial explosion.
Avatar
@Learath2 would you be available in the evening to brainstorm the game server masterserver selection algorithm?
Avatar
that's one of the few things still missing from the http masters PR
Avatar
Avatar
Jupstar ✪
these are my plugins delete build dir use a clean dir close vs code restart just works™️
why would you use CodeLLDB instead of default gdb?
Avatar
Avatar
heinrich5991
can you send me the new error?
15:46
I wonder if I'm sorting it "wrong" or maybe a locale issue
Avatar
it's supposed to be sorted by ASCII order probably
15:46
can you send the list as well?
Avatar
Avatar
c0d3d3v
why would you use CodeLLDB instead of default gdb?
bcs it prints variables more pritty and generally has better handling jump to a next instruction (e.g. in a for loop) instead full line dunno maybe there is a plugin that works better for gdb, but i mostly use clang for dev anyway
Avatar
Avatar
heinrich5991
can you send the list as well?
15:47
I guess vscode is using a different kind of sort :/
Avatar
network.cpp goes above the network_* stuff
Avatar
Yeah, apparently vscode uses localeCompare so not ascii order
Avatar
Avatar
Jupstar ✪
bcs it prints variables more pritty and generally has better handling jump to a next instruction (e.g. in a for loop) instead full line dunno maybe there is a plugin that works better for gdb, but i mostly use clang for dev anyway
i think there are gdb plugins for that stuff
Avatar
anyway like all llvm tools they copy the behavior of the GNU tools mostly anyway
15:50
@c0d3d3v if u try it out make sure to set the launch: expressions to native instead of simple tho dunno who thought this is a sane default value xd
Avatar
sort it with vim
Avatar
@heinrich5991 getting it in the proper order indeed fixes it, is it a cmake quirk that it's also reporting files are missing totally when they are just out of order?
Avatar
Avatar
Jupstar ✪
@c0d3d3v if u try it out make sure to set the launch: expressions to native instead of simple tho dunno who thought this is a sane default value xd
how does your launch.json look like? With these extension my do not work anymore
Avatar
@Learath2 this is a "heinrich5991's implementation quirk" (edited)
Avatar
"configurations": [ { "type": "lldb", "request": "launch", "name": "Launch", "program": "${workspaceFolder}/build/DDNet", "args": [ "dbg_gfx 0" ], "cwd": "${workspaceFolder}/build" }, { "type": "lldb", "request": "launch", "name": "Launch server", "program": "${workspaceFolder}/build/DDNet-Server", "args": [ "dbg_gfx 0" ], "cwd": "${workspaceFolder}/build" }, { "name": "(gdb) Starten", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/build/DDNet", "args": [ "dbg_gfx 0" ], "stopAtEntry": false, "cwd": "${workspaceFolder}/build", //"environment": [ { "name":"VK_INSTANCE_LAYERS", "value":"VK_LAYER_MESA_overlay"} ], "externalConsole": false, "MIMode": "gdb", "setupCommands": [ { "description": "Automatische Strukturierung und Einrückung für \"gdb\" aktivieren", "text": "-enable-pretty-printing", "ignoreFailures": true } ] }, { "type": "cppdbg", "request": "launch", "name": "Attach to wine gdbserver", "program": "${workspaceFolder}/build_win/DDNet.exe", "miDebuggerServerAddress": "localhost:55555", "cwd": "${workspaceFolder}/build_win/", "MIMode": "gdb", "setupCommands": [ { "description": "Automatische Strukturierung und Einrückung für \"gdb\" aktivieren", "text": "-enable-pretty-printing", "ignoreFailures": true } ] }
15:52
rip irc
Avatar
ircdead
Avatar
first two are lldb
15:52
then one older gdb
15:52
then attach to wine debugger
Avatar
@Jupstar ✪ please post these long snippets elsewhere, destroys the flow of the chat
Avatar
Why does en_US.utf8 even have a different order for _ and . anyway? :/
Avatar
it probably skips these instead @Learath2
15:53
treats them as the same
Avatar
Avatar
heinrich5991
@Jupstar ✪ please post these long snippets elsewhere, destroys the flow of the chat
are u always mad to me btw?
Avatar
oh drama 🍿
Popcorn 1
Avatar
Avatar
Jupstar ✪
"configurations": [ { "type": "lldb", "request": "launch", "name": "Launch", "program": "${workspaceFolder}/build/DDNet", "args": [ "dbg_gfx 0" ], "cwd": "${workspaceFolder}/build" }, { "type": "lldb", "request": "launch", "name": "Launch server", "program": "${workspaceFolder}/build/DDNet-Server", "args": [ "dbg_gfx 0" ], "cwd": "${workspaceFolder}/build" }, { "name": "(gdb) Starten", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/build/DDNet", "args": [ "dbg_gfx 0" ], "stopAtEntry": false, "cwd": "${workspaceFolder}/build", //"environment": [ { "name":"VK_INSTANCE_LAYERS", "value":"VK_LAYER_MESA_overlay"} ], "externalConsole": false, "MIMode": "gdb", "setupCommands": [ { "description": "Automatische Strukturierung und Einrückung für \"gdb\" aktivieren", "text": "-enable-pretty-printing", "ignoreFailures": true } ] }, { "type": "cppdbg", "request": "launch", "name": "Attach to wine gdbserver", "program": "${workspaceFolder}/build_win/DDNet.exe", "miDebuggerServerAddress": "localhost:55555", "cwd": "${workspaceFolder}/build_win/", "MIMode": "gdb", "setupCommands": [ { "description": "Automatische Strukturierung und Einrückung für \"gdb\" aktivieren", "text": "-enable-pretty-printing", "ignoreFailures": true } ] }
wait you use it only to run the debugger? and how do you start the build task? I used "preLaunchTask": "compile DDNET" but that does not get triggerd anymore
Avatar
if u have the cmake extension
15:54
ctrl-shift-p
15:54
then compile
Avatar
if u dont want to run just build just press F7
Avatar
Avatar
Jupstar ✪
are u always mad to me btw?
no, I would have told anyone else as well
Avatar
its 20 lines thats nothing
Avatar
it was my whole screen
Avatar
just block me then u dont see it
Avatar
why would I block you?
15:56
I want to read what you're saying ^^
15:56
it was just basically as "clear page" for the chat for me, it takes more than a screen in my discord
15:56
and I had to scroll around to see the discussion
Avatar
Avatar
Jupstar ✪
if u dont want to run just build just press F7
xD In most cases I want both ^^ build and then run
16:02
at least clangd seems to be happy (edited)
16:05
thank you for your help ^^ I guess it works now, And I found out how to build and the run.
Avatar
curl documentation is really meh, curl_multi_poll returns a CURLMcode ,doesn't tell you what codes it can return, nor does it tell you which are fatal
Avatar
curlmcode is listed here, the link is just not linking to a subheading I think: https://curl.se/libcurl/c/libcurl-errors.html
16:16
so it can return all the curlm_*
Avatar
Is it ok that I change the name for the hud.png to ddnet.png or do someone have a better (maybe more neutral) idea? https://github.com/ddnet/ddnet/blob/fa2ac1bb64749c413419443cd06abc1de7d1ac9c/data/hud.png (edited)
DDraceNetwork, a cooperative racing mod of Teeworlds - ddnet/hud.png at fa2ac1bb64749c413419443cd06abc1de7d1ac9c · ddnet/ddnet
Avatar
did u add assets support for the hug?
🫂 1
16:26
hud*
Avatar
hud_default.png
16:26
ddnet.png says nothing imo
Avatar
but the idea was that we also add the textures for new ddnet entities like the new shields to it
16:27
so we do not need to have hud.png and ddnet.png
16:28
or would you prefer a separate png for new ddnet entities/features (edited)
Avatar
Avatar
c0d3d3v
Is it ok that I change the name for the hud.png to ddnet.png or do someone have a better (maybe more neutral) idea? https://github.com/ddnet/ddnet/blob/fa2ac1bb64749c413419443cd06abc1de7d1ac9c/data/hud.png (edited)
i'd like to see it working like entities per mod there it uses directories as names and inside the dir its ddnet.png for ddnet, fng.png for fng etc
Avatar
Avatar
Ryozuki
hud_default.png
so you would like to put the HUD stuff just like it is now in a hud.png And the new shields in the game.png https://github.com/ddnet/ddnet/blob/fa2ac1bb64749c413419443cd06abc1de7d1ac9c/data/game.png in a new ddnet-game.png ?
DDraceNetwork, a cooperative racing mod of Teeworlds - ddnet/game.png at fa2ac1bb64749c413419443cd06abc1de7d1ac9c · ddnet/ddnet
Avatar
looks fine
Avatar
Avatar
Jupstar ✪
i'd like to see it working like entities per mod there it uses directories as names and inside the dir its ddnet.png for ddnet, fng.png for fng etc
xD that sounds like a lot of work
16:37
the idea was to keep the game.png clean, so we get no conflicts with other mods
16:37
especially vanilla
Avatar
aren't those shields breaking compatibility anyway?
Avatar
Avatar
c0d3d3v
the idea was to keep the game.png clean, so we get no conflicts with other mods
yeah thats fine
16:48
hud.png is maybe better from intuition, but ddnet.png makes clear its for ddnet xdd maybe still put it into a dir hud and name it ddnet.png
16:49
the reason why I'd prefer making it clean is, that in 2 years when everyone uses customized huds and someone wants to add hud for another mod everything breaks again xd
Avatar
Does anyone know where I can post a server feature suggestion? Banning blockers in crowded DDNet servers heavily rely on whether a moderator is online and bothered to take action. I rarely see 30 yesses on a vote call – I can't recall the last time. My suggestion would be weighted votes. You can use a pathfinding algorithm to determine the distance between the call-voted player and any player that votes yes or no. The closer a player, the more weight their vote carries. Example: within 100 tiles tripled, within 250 tiles doubled. This may sound unbalanced but so does kicking a player for 5 minutes only when 30 players who probably are elsewhere in the map are bothered to vote yes. Edit: blockers = team 0 DDRace blockers, past the noob filter. (edited)
Avatar
We are on C++17 now, right?
Avatar
yes
17:12
since a weak even on full c++17
17:12
week
Avatar
Avatar
Kruimeldief
Does anyone know where I can post a server feature suggestion? Banning blockers in crowded DDNet servers heavily rely on whether a moderator is online and bothered to take action. I rarely see 30 yesses on a vote call – I can't recall the last time. My suggestion would be weighted votes. You can use a pathfinding algorithm to determine the distance between the call-voted player and any player that votes yes or no. The closer a player, the more weight their vote carries. Example: within 100 tiles tripled, within 250 tiles doubled. This may sound unbalanced but so does kicking a player for 5 minutes only when 30 players who probably are elsewhere in the map are bothered to vote yes. Edit: blockers = team 0 DDRace blockers, past the noob filter. (edited)
DDraceNetwork, a cooperative racing mod of Teeworlds - Issues · ddnet/ddnet
👍 1
Avatar
@heinrich5991 do you think I can safely get rid of the CURLSH stuff. I think multi handles share things without a need for that
Avatar
yea, I think it works without CURLSH
17:33
@Learath2 ^
17:33
CURLM_OUT_OF_MEMORY (3)
>
You are doomed.
Avatar
I did google around a bit but I couldn't figure out if TLS Session Ids are shared by default :/
Avatar
I mean if connections are shared, the TLS sessions are necessarily shared, no?
17:40
hm, this suggests that you should still keep using CURLSH @Learath2
Avatar
I guess I can get rid of the locking, since all handles are only in one thread now, and just keep the share
Avatar
• TR; DL Use a pathfinding algorithm to determine the distance between the call-voted player and any player that votes yes or no. The closer a player, the more weight their vote carries. • Why? Banning blockers¹ in crowded DDNet servers² heavily relies on whether a moderator is online in the server and bothered to take any action. When there's no moderator action, a blocker is rarely kicked/banned because it's hard to accumulate 30 yes votes on a call-vote. Using weighted votes, ...
Avatar
C++20s std::atomic::wait is so cute, when c++20? 😄
18:23
Or std::latch :3
Avatar
xD no shit, Sherlock ^^ "Enables rendering of maps with more details." but yes it is hard to explain what the function of the option is. Would it be useful to make tooltips multiline for explanations that are helpful?
Avatar
Avatar
Learath2
C++20s std::atomic::wait is so cute, when c++20? 😄
yes is nice
18:31
less struggle with signals reentrance
Avatar
Avatar
c0d3d3v
xD no shit, Sherlock ^^ "Enables rendering of maps with more details." but yes it is hard to explain what the function of the option is. Would it be useful to make tooltips multiline for explanations that are helpful?
yes
18:32
would be more useful
18:32
can also change this specific message
Avatar
I'm a little stuck here @heinrich5991 now that all requests are technically asynchronous, I have to come up with a replacement to IEngine::RunBlocking
18:33
I want to do CHttpRequest::Wait() but to do that properly I need a lock on CHttpRequest::m_State, which means all requests have to incur the cost of the lock eventho only some of them use it
Avatar
uncontended locks are just atomics AFAIK
18:34
at least on linux
Avatar
I guess it wouldn't be too costly, but there is a cost associated with it
Avatar
m_State would need to be a atomic integer otherwise, no?
Avatar
m_State is already an atomic integer
18:37
Eh, I'll add the lock, we can talk about it in the PR
Avatar
ah, it's probably an atomic swap or so, so indeed more expensive than an atomic store
18:37
but probably doesn't matter in the context of http requests
Avatar
will the servers be allowed to add extension data? and if, how much headroom is there?
Avatar
in the http masterserver info?
Avatar
yes
Avatar
yes, servers provide a free-form info
18:48
if it contains at least the keys the client expects, it gets shown in the serverbrowser
18:51
I estimate a full server to take about 5 KB of JSON
18:51
I think the current maximum is 16 KB, so you have some headroom
Avatar
i want skininfo for every tee so shouldnt be too much
Avatar
I have a question about the map datafile format: when parsing layer names (132string), some of them are null strings when there are not in teeworld's map editor. There is the same issue with @Patiga 's twmap lib. Is there a peculiarity not documented in https://github.com/heinrich5991/libtw2/blob/master/doc/map.md ?
Avatar
what do you mean by null strings?
18:53
of zero length?
Avatar
no, I mean it is parsed as an empty string
Avatar
so they're shown as some non-empty string in the map editor, but become the empty string when read by Patiga's library?
Avatar
I guess the best course of action is to wait for @Patiga to answer
Avatar
ok thx 🙂
19:01
hmm nevermind, they have actually no name but the teeworlds editor shows the image name instead
👍 1
Avatar
It builds \o/
19:38
Let's see how badly I broke the client now 😄
19:39
A small emerge -avt gdb break
Avatar
\o/
Avatar
Did you know we can't have conditional member variables?
19:41
not even in C++20 with concepts
Avatar
what are conditional member variables?
19:41
ah, not preprocessor ones
19:42
I don't like the way C++ templates work
Avatar
Member variables that are added when a template condition is met.
Avatar
the fewer templates the better IMO ^^
Avatar
I briefly considered CHttpRequest<bool Blocking> before I learned that
19:42
Or s/Blocking/Waitable/
Avatar
Avatar
heinrich5991
the fewer templates the better IMO ^^
what is wrong with templates? genuinely asking
Avatar
code bloat, every template instantiation generates separate code
19:44
weird language
Avatar
Hm, isn't it sort of intended that each instantiation generates separate code? That's kinda how generic code works
Avatar
somehow just a search-and-replace for types, this might be better with concepts (see SFINAE before)
Avatar
My main complaint with C++ templates would be the way SFINAE leads to a mess
Avatar
Avatar
Learath2
My main complaint with C++ templates would be the way SFINAE leads to a mess
but cpp20 concepts solves the issue i think
Avatar
not that of code bloat though
Avatar
you mean inflating the executable ?
Avatar
yes
Avatar
@heinrich5991 what is the alternative though? The way rust does generics is a bit of a lie, it's technically doing polymorphism
Avatar
no, rust also does this code bloat thing
Avatar
hmm never really experienced this issue but yeah I see your point when I learned templates I was thinking what the f is this hack
Avatar
Oh my god, I got it first try
19:47
I compile, I run, http requests aren't broken
Avatar
but yes, polymorphism can lead to smaller code
Avatar
Avatar
Learath2
Oh my god, I got it first try
We love coding for those rare moments 🥰
Avatar
It's even more of a surprise because I haven't coded anything in almost 6 months straight
😮 1
Avatar
show code or it didn't happen 😛
😂 1
Avatar
Avatar
Learath2
It's even more of a surprise because I haven't coded anything in almost 6 months straight
its like in teeworlds, u take a break and come back better than before
Avatar
I'm not very pleased with the way I did things in serverbrowser_http. I need to figure out what to do with errors at the start of CHttp::Run and I thiiink I might need a destructor for CHttp but other than that it all works
19:54
I'm also unsure about not having a IHttp it just breaks symmetry in code 😄
Avatar
what would you think about a global variable? ^^
Avatar
I thiiink the diff isn't too bad for what it is?
Avatar
Avatar
heinrich5991
what would you think about a global variable? ^^
For what? The errors or CHttp itself?
Avatar
CHttp
Avatar
It'd break symmetry even further, we already have a kernel to store our singletons in. I really think it belongs in there :/
Avatar
the diff actually looks quite small
19:57
if we don't get anything out of it, I'd argue against using Kernel
Avatar
Oh, I'm missing a bit of code there, how did it even work when my Wait is completely wrong 😄
Avatar
but yea, the diff looks good 🙂
Avatar
Avatar
heinrich5991
if we don't get anything out of it, I'd argue against using Kernel
I mean, you could argue the kernel is completely useless
19:57
For all components
Avatar
well, not all components are as global as this
19:58
e.g. you can reasonably have more than one map open at the same time
19:59
or even multiple Console() if you were to run server and client in the same process
19:59
but multiple http clients? there seems to be just downsides to it
Avatar
Hm, actually don't know if this statelock is a good idea :/
19:59
It's making such a mess of all the pretty code
20:00
I need locking every time I access m_State
Avatar
what do you need the unordered_map for?
Avatar
curl-multi reports info by curl-easy handles
20:01
I need to map those back to CHttpRequests
Avatar
#include <curl/curl.h> also that isn't quite nice in the header
20:01
I think you can store userdata in curl easy handles
Avatar
Avatar
heinrich5991
#include <curl/curl.h> also that isn't quite nice in the header
I need CURL_ERROR_SIZE CURL and CURLM in the header, not quite sure how else to get it
Avatar
Avatar
heinrich5991
I think you can store userdata in curl easy handles
Let me take a look, that'd be nice
20:03
CURL_ERROR_SIZE is 256, one could statically assert in the cpp if need be
20:03
can't be changed without requiring an incompatible change
20:04
the other stuff is always behind a pointer
Avatar
Actually I'm not sure if this will work, this is a shared_ptr
Avatar
you could store a pointer to a shared_ptr, would that work?
Avatar
Avatar
heinrich5991
no, rust also does this code bloat thing
doesn't Monomorphization and static dispatch allow for better optimizations tho?
20:05
anyway i havent seen yet any unrealistically big executable
20:05
and you can always opt in to dynamic dispatch
20:05
i think both sides have bad things
Avatar
depends, code bloat leads to cache misses, also bad
Avatar
so u gotta pick tradeofs
Avatar
and no, you can't really opt into dynamic dispatch because the whole ecosystem doesn't use it
20:06
unless you want to write all libraries yourself
Avatar
i would rly like to see some kind of study
20:06
on this
20:07
is the code bloat big enough to be a problem most of the time, no yes, when why
20:07
i expect this only to be a problem in embedded
Avatar
cache misses are a real problem not only for embedded
20:07
if you wanna go fast you must optimize for caches
Avatar
how long does it take to register a new private ddnet server on the master teeworlds server normaly?
Avatar
wdym?
20:09
old-style mastersrv?
20:09
seconds, I think
Avatar
so that it is listed in the internet tab of the 16.03 client
Avatar
ah
20:09
should be done in a minute unless packets get dropped
Avatar
Avatar
heinrich5991
cache misses are a real problem not only for embedded
have you good sources regarding that
20:12
the only thing i found is a hn comment
20:12
scottlamb
Conversely, more sophisticated algorithms, and particularly monomorphization, may bloat the code size, causing icache, L2/L3 cache, and TLB misses. (Also slows compilation.) I think this is under-appreciated because it doesn't show in microbenchmarks. (I wish I knew of an easy way to measure how much cache pressure you're causing from a microben...
20:12
why is there so little talk about this
20:12
or my google sucks
Avatar
ask anyone who does optimizations, it's always about caches these days
Avatar
Avatar
heinrich5991
should be done in a minute unless packets get dropped
mh worked for me xD the guy who asked me why its not working, must have done something wrong
20:13
would it posible to register ipv6?
Avatar
yes, it's possible, specify bindaddr as [::] perhaps
👍 1
20:13
or ::
20:14
@Ryozuki I guess that means I don't have a reference, let me try to look for one
Avatar
Why does std::list::emplace_back return a reference and not an iterator ? :/
Avatar
In programming languages, monomorphization is a compile-time process where polymorphic functions are replaced by many monomorphic functions for each unique instantiation.[1] This transformation is desirable, since then the output intermediate representation (IR) will have concrete types and can be optimized better. Furthermore, most IRs are designed to be low-level and do not support polymorphism. Code generated this way is typically faster than boxed types, but may compile slower and take more space due to duplicating the function body.[2][3][4][5][6][7]
Avatar
@Ryozuki there is alot about caches that can cost performance https://en.cppreference.com/w/cpp/thread/hardware_destructive_interference_size c++17 adds a way to avoid cache syncs, if u go tryhard xd
20:17
"The program uses two threads that write (atomically) to the data members of the given global objects. The first object fits in one cache line, which results in "hardware interference". The second object keeps its data members on separate cache lines, so possible "cache synchronization" after thread writes is avoided."
Avatar
i only see sources talk about using monomorphomiszation to improve perfomance
20:18
ah no
20:19
well
Avatar
Avatar
Jupstar ✪
@Ryozuki there is alot about caches that can cost performance https://en.cppreference.com/w/cpp/thread/hardware_destructive_interference_size c++17 adds a way to avoid cache syncs, if u go tryhard xd
just write assembly
20:19
like the fizzbuzz guy
Avatar
idc about cpu performance a lot anyway
20:19
GPUs are biggest bottleneck xd
Avatar
well usually for most apps is the internet
20:20
but ye for games i guess
20:20
internet or i/o
20:20
well im talking out of my as
Avatar
but i agree with learath or whoever said that that in future there will be a time where we might consider faster code again
Avatar
but thats what i would guess xd
Avatar
instead of javascripting everything
Avatar
we can rustify everything
Avatar
but can a javascript dev use rust? no or not so ez
20:21
so it will take time
Avatar
honestly the only hope to stop javascript is the massive success of webassembly
Avatar
there are probs less devs at some point again
Avatar
so u can use any language you like
Avatar
rn pretty much everyone is a dev xdd
Avatar
but rn to modify the DOM u have to go through js
Avatar
Avatar
Jupstar ✪
rn pretty much everyone is a dev xdd
not rly
20:22
u just live in a bubble
Avatar
depends on what u call dev probably
20:22
i dont mean system level devs
20:22
but tools for whatever is needed
Avatar
most devs are web devs i guess
Avatar
this will probs go away if we have more automization in economy again
20:23
yes
20:23
and web dev is rather ez
Avatar
isn't it the devs writing the automatisation?
Avatar
ah maybe little missconception
20:23
there are devs that write tools for humans
20:23
and devs that write machines that replace humans
Avatar
the no code stuff
Avatar
i mean the 1st
Avatar
or "low code"
20:24
i also laugh at the serverless word
20:24
well programming is so full of buzzwords
Avatar
or the devs that stay are the 2nd
Avatar
@Learath2 are you currently available for http mastersrv brainstorming? or currently writing http stuff?
Avatar
SOLID DRY clean code, YAGNI, cloud based, serverless, KISS, ML, AI, blockchain
20:25
fuckyousnail
Avatar
you forgot machine learning
Avatar
damn people using acronyms again
Avatar
thats the devs that replace humans i guess
Avatar
@Chairn its always acronyms
20:25
otherwise its not cool
Avatar
blockchain
Avatar
it's so useless
Avatar
i hate them all
Avatar
you loose more time explaining the acronyms than writing it in full directly
Avatar
xd
20:26
its like math
20:26
every prof has its own notations
Avatar
i always gotta search the SOLID one
20:26
promoted by American software engineer and instructor Robert C. Martin,[1][2][3] first introduced in his 2000 paper Design Principles and Design Patterns.[2][4]
>
The SOLID ideas are
>
The single-responsibility principle: "There should never be more than one reason for a class to change."[5] In other words, every class should have only one responsibility.[6] The open–closed principle: "Software entities ... should be open for extension, but closed for modification."[7] The Liskov substitution principle: "Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it."[8] See also design by contract.[8] The interface segregation principle: "Many client-specific interfaces are better than one general-purpose interface."[9][4] The dependency inversion principle: "Depend upon abstractions, [not] concretions."[10][4]
20:26
ah yes
20:26
thanks for the info
Avatar
Mh, I actually liked that unordered_map there 😦
20:54
Now I have to write a linked list
Avatar
Avatar
Ryozuki
SOLID DRY clean code, YAGNI, cloud based, serverless, KISS, ML, AI, blockchain
x)
Avatar
Avatar
Ryozuki
SOLID DRY clean code, YAGNI, cloud based, serverless, KISS, ML, AI, blockchain
i still can't get the main idea of clouds, like are they really needed for every web app
22:28
It'd look better with boost::intrusive::list, but still :/
Avatar
what's wrong with unordered_map?
23:07
it has better performance than list in general
Avatar
Well, this way it's guaranteed O(1) instead of on average O(1)
23:10
Technically with how small our unordered_map is, it's very unlikely to not be O(1)
Avatar
This PR tries to rework the http interface to utilize the curl-multi interface. In the process we lost the IJob interface. I experimented with getting rid of the std::unordered_map using CURLOPT_PRIVATE here. I don't really like the end result, it might look a little better with boost::intrusive::list if we want boost or maybe if I tread the list through CHttpRequest itself. Remaining concerns...
Exported 449 message(s)