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 2020-06-05 00:00:00Z and 2020-06-06 00:00:00Z
Avatar
Would be nice if we could opt into a mode where other players' shoe colors are ignored. That way we can tell whether our teammates have used dj or not. Currently you have to memorized your teammates shoe colors lol?? Worse, some players choose dark grey and it looks like they never have dj.
Avatar
Ownership makes me want to throw the laptop through a window
Avatar
you should stop seeing it as an enemy 😛
Avatar
no amount of safety is worth developing an alcohol addiction
Avatar
ᶰ°Konͧsti 2020-06-05 10:45:21Z
there should really be a feature like show bright feet or something xd I hate skins with dark feet
Avatar
the crates are making me miss good old dynamic libraries
10:48
no matter what people said, they just worked, you include your headers, you link your library and it just works
Avatar
is that not true of crates?
Avatar
a downside of rust is compiling everything, but right now is needed for traits or smth like that
Avatar
ᶰ°Konͧsti 2020-06-05 10:48:22Z
Ryozoozki
Avatar
I've been trying to add this damn crate for the last 10 minutes now
Avatar
adding a crate is rly ez
10:48
whats ur problem?
Avatar
okay, that is just inexperience with the build system, lol
10:48
try getting a C++ newbie to link a library in a crossplatform manner with cmake
10:49
this took me ages
Avatar
The problem is that it's really "easy"
Avatar
c++ dep management is the worst
Avatar
There is no way to debug this shit
10:49
It just doesn't work
10:49
what am I supposed to adjust when it just won't find the library?
Avatar
did u do cargo update?
Avatar
why does heinreich not have admin role
Avatar
I don't know if there is a caching issue, idk if there is a linkage issue, idk if the damn crate is building
Avatar
cargo update
Avatar
can you give us your build output
Avatar
error[E0432]: unresolved import 'hex'
Avatar
can u show more
Avatar
and your Cargo.toml?
Avatar
can compete with C++ on the most obsecure error message of the year
10:51
hex = "0.4.2" in the dependencies section of every cargo.toml I could think could be relevant
Avatar
how is that obscure
10:51
did u do cargo update
Avatar
you might need extern crate hex in the top level
10:52
extern crate in the main file
10:52
also u usually want to just add "0.4"
10:52
so minor versions get updated
Avatar
they also get updated like this @Ryozuki
10:52
it just means >=0.4.2, which is sensible
Avatar
@Learath2 "might" because I don't know what they updated and what not. libtw2 compiles with legacy rust2015 😉
Avatar
extern crate
10:54
greenthing
Avatar
I should have just split the demo file at the correct place and just inserted the damn sha by hand
10:54
would have been done 50 times by now
Avatar
@Learath2 did it work
Avatar
I think it did, waiting for it to compile with my puny laptop
Avatar
u panic to fast
10:55
btw
10:55
patience is key to a programmer
Avatar
you could also write a script that renames your name_crc_sha.map to name_crc.map
Avatar
nope didn't work
10:55
Patience can only be expected when there is an actual solution to try next
Avatar
without patience you wont find the solution
Avatar
next step seems to be to disassemble cargo to check the fuck it's smoking
Avatar
you always go to extremes lol
10:56
its rly hard to know what ur missing cuz we have nothing to see
Avatar
Step1 clone libtw2, Step2 add hex to Cargo.toml, Step3 add extern crate to tools/lib.rs, Step4 compile
Avatar
Step5 break your keyboard in half
Avatar
which cargo.toml?
10:57
the one of tools?
Avatar
I have it in every single one at this point
10:58
it should be in the one of tools/Cargo.toml
Avatar
I gradually added it to more and more hoping if everything linked to it it would "just work"
Avatar
wait
10:58
where do you need the hex?
Avatar
ah ofc this is in a separate crate
10:59
should have added it to teehistorians lib.rs
Avatar
@heinrich5991 "..." range patterns are deprecated
10:59
use ..=
10:59
aparently
10:59
xd
Avatar
and so is ?
10:59
yes, I know
Avatar
is ? deprecated?
11:00
i thought it wass new
Avatar
ehm, I mean try!
11:00
I'll do that once I feel like it and after I checked that it'll still compile with rust 1.34
11:00
@Ryozuki
Avatar
They should make package managers illegal
Avatar
now I only need to get through the mess of ownership and this will work
Avatar
it's impossible to please learath
11:02
🥺
Avatar
you know what would please me? if people would stop fucking with syntax for no reason
Avatar
oh shit, here we go again
Avatar
xD you know what would look cool, if we moved the return type to after the declaration hehehe
Avatar
that kinda makes sense though
11:03
makes it easier for grepping, e.g.
Avatar
All dem C coders will feel so out of place, not like we want those nasty people in our enlightened community anyway
Avatar
@Learath2 yesterday i saw ppl saying posix c is not c code
11:03
and more stuff
Avatar
POSIX C is not standard C
Avatar
and if its not standard C
11:04
then its hell
Avatar
Eh if you don't care much for windows it's not that bad
Avatar
with the awesome windows c89 compiler
11:04
😊
Avatar
Microsoft with all their infinite wisdom fucked up implementing their CRT so bad that it's posix compatibility layer is actually not even posix compliant
11:05
because they just knew better
Avatar
windows should adopt posix
11:05
they should even change their filesystem
11:05
to be like unix
Avatar
all these years of standardising posix spent by thousands of developers, through constant change
Avatar
and adopt bash
11:05
then it would be good for me
Avatar
rust works quite well on windows 😉
Avatar
But microsoft just knew better then the thousands working on posix
Avatar
including handling of non-ascii file paths
Avatar
@heinrich5991 how much time did it take to make libtw2?
Avatar
I also love how rust has like 50 different ways of storing an array of things
11:07
  • the 50 different ways to own/reference it
11:07
very fun thinking about all this when just a damn pointer would have worked juuuust fine
Avatar
@Ryozuki I don't really know. "not too long, teeworlds netcode isn't that complex"
11:08
I started with a python version, then a C version and then discussed it with matricks and went with rust
11:08
but that was many years ago
11:08
he said he was eyeing rust as a language that teeworlds might be written in if he were to write it today
Avatar
@Ryozuki you could ask @Patiga btw, he said he's writing another map parser right now
Avatar
Okay I don't have it in me to wrestle with this anymore
11:14
can you just spoonfeed me a safeish way to get from a std::vec::Vec to a [u8; 32]
Avatar
you can't really
Avatar
amazing
Avatar
but you could go to a &[u8] if that would be fine
11:15
well, you can loop over the vector
11:15
result.copy_from_slice(&vec)
Avatar
how am I even supposed to copy the &[u8] into my [u8; 32]
Avatar
should work
11:15
API documentation for the Rust slice primitive in crate std.
Avatar
well can't really use that in an assignment
11:17
yeah I guess this'll be even uglier then anticipated
Avatar
you could do let sha256 = [0; 32]; sha256.copy_from_slice(&vec); and then use sha256
Avatar
doesnt try_into work? might include some allocation tho
Avatar
oh yea, this is some new stuff
Avatar
i think i used it once from slice to array
Avatar
and since we only need it for 32, it might actually work
Avatar
I thought I'd never say this in a million years, I miss java
11:21
How am I even supposed to get a reference to this temporary to copy from
Avatar
&
Avatar
oh great, now the Cow is an issue
11:23
obviously
Avatar
I think one issue might be that you expect rust to work exactly like C
11:24
it is something new to learn, it is not exactly like C
Avatar
@Ryozuki also not sure how to estimate how much time i spent on that project that far. repository is public tho if you want to try to estimate time by changed lines of code or smth https://gitlab.com/Patiga/twmap
Map parsing library
Avatar
This is why I give up on learning rust every time, it's like the language hates it's user
11:25
like every time you think you start getting a grip on it, it brings out a sledgehammer and hits you
Avatar
it makes the user write obviously safe code
Avatar
yeah, no thanks, I'll stick to my unsafe code with opt-in safety
Avatar
as was discussed at length already, this does not seem to work (if you want safe code)
Avatar
it works for me
Avatar
I doubt it
Avatar
I don't quite care if other people can't be assed actually following good practices in their code
Avatar
well users seem to love rust
Avatar
look at any large C/C++ code base, even if the company has financial incentive to keep their code secure
11:27
like google
11:27
and I wouldn't be willing to bet that I've never introduced a memory safety bug into teeworlds/ddnet
Avatar
There is no way rust meets the performance requirements of things like facebooks infra
Avatar
what?
Avatar
These people are looking for 1% improvements, there is no way they would move over to rust, so there is no way we get a good test of rust at that scale
Avatar
I don't know where you live, but we see people writing faster and safer code in rust
11:28
simply because they can write code that they wouldn't try otherwise
11:29
because they wouldn't believe in the thread-safety etc. of it
Avatar
ye rust aims to be faster than c
Avatar
see e.g. ripgrep
Avatar
I see people coding slower and walking a tightrope trying to please an overbearing compiler to have some safety
Avatar
I could also write C like a retard to get it to perform worse
Avatar
then write C better to make it perform better
11:30
you can send programs there
11:30
I doubt it's just a lack of good programmers
Avatar
It's like that one test where the guy used a better compiler to get C++ classes performing better then raw C structs
Avatar
you can't be the only one that thinks "why is C performing worse on this benchmark"
Avatar
There is absolutely no way you couldn't get C performing as good as rust on the exact same compiler
Avatar
yes
11:31
just like with rust
Avatar
There is no LLVM IR you can't reach from C
Avatar
but this is irrelevant
11:31
and this is probably false
11:31
(without inline assembly)
11:31
yea, can give you an example already
Avatar
Yeah you can't get some clang frontend constructs and you can't get some invariant marks
Avatar
fn a(b: &mut i32, c: &mut i32)
11:32
this marks both parameters as unique
11:32
you can't get that in C
11:32
ah wait, you can probably, with restrict
Avatar
anyway, do you really believe you can reach all llvm constructs you can reach with standard rust also in standard C?
11:33
willing to bet that you can't
Avatar
I do believe that yes
Avatar
k, wanna bet?
Avatar
I'd be very surprised if you could come up with one
11:34
Besides who cares, if it's a pain to code in a language, it's a pain
Avatar
subjective
Avatar
yea, just like if it's studied that 70% of bugs are memory safety bugs in C, and it's less than that in rust, then that's also an objective measurement
11:35
the programmer who never makes mistakes does not exist
11:35
so we try to reduce the impact
Avatar
we have learath
11:35
the perfect dev
11:35
monkaS
Avatar
does learath2 really claim that he has never introduced a memory safety bug into a project they contributed to?
11:36
Atleast I delivered code instead of wrestling with a compiler
Avatar
yes, that's an argument that you can make
11:37
if the future shows that you can be productive in rust though, then that would probably become irrelevant
Avatar
Some constructs just cant be safe, please show me how you'd code a "safe" linked list
Avatar
you can confine the unsafety
11:37
that's one big point in rust
Avatar
When you pull that one off, try a Rb-tree with parent pointers or a augmented interval bst
Avatar
you can point at one module and say: the memory unsafety is in there
11:38
and not "it's in some module using that rb tree"
Avatar
So then there are bugs in those
Avatar
yes
11:39
and we know where they are. that's great
Avatar
Congratulations, you moved bugs from the most abused part to most abused part
11:40
These bugs are only exploitable at the looowest levels of your code anyway
Avatar
no
11:40
in C code they're exploitable anywhere
Avatar
Well I'm sure firefox has a dozen of them atleast, have at it
Avatar
and suppose I can find some scientific evidence that rust fares better than C, would that change your mind about it?
11:41
also, how did I manage to get into a flamewar again 😦
Avatar
fares in what way? What's the point if I'm not delivering any code if it would perform better?
11:41
Code that doesn't exist is infinitely slower then any implementation
Avatar
e.g. compare whether you rather want to have a rust dependency or a C dependency
11:42
say my hypothesis is: I have a C library and a Rust library performing the same task. which should I choose, given that I know nothing else about it (except maybe that it's the best one of each language)
Avatar
Depends on the task the libraries are doing
Avatar
implementing a network protocol
11:43
security is a goal of yours, in this scenario
Avatar
I mean it's an insane scenario but sure, pick the rust one it's probably safer
Avatar
k
Avatar
In the real world though I'd pick the C library that has been around for 4 decades and been extensively audited
Avatar
well, suppose you are a http library and want to add support for quic
11:44
there are rust libraries and there are c libraries
Avatar
Depends on my performance goals, security goals, deadlines, the libraries track records, the maintainers response time, the support requirements, the space requirements
11:45
Despite how you all like to talk about me I'm not some fanatic going around deciding about things like choosing a football team to cheer on
Avatar
we're not either, don't worry 😉
Avatar
There are dozens of factors when deciding things like these, and it rarely comes down to language
Avatar
but language can help decide
Avatar
Yes if you remove every other factor, rust is a better choice
Avatar
because we can see that rust libraries in practice have less memory safety vulnerabilites
Avatar
come back to me when rust has been around for a decade and has a track record beside a couple toy projects and a PR stunt by mozilla
Avatar
there are e.g. quic libraries in rust 😉
11:47
that's more than a toy proejct or PR stund by mozilla
11:47
there's ripgrep, although probably not security relevant
Avatar
A simple, fast and user-friendly alternative to 'find' - sharkdp/fd
11:48
fd to replace find
11:48
xd
Avatar
and yes, I agree that while I still name examples of software written in rust, it's still
11:48
young
Avatar
Also there is the community of the language walking around like modern day missionaries
Avatar
what would the world look like if a language actually had better properties? 😉
Avatar
Have you heard of the language with 0er then 0 cost abstractions and absolute safety
Avatar
would that also look like "missionaries walking around"?
Avatar
@Learath2 one day u will have to move on from C
11:50
i would love to be there and see how u react
Avatar
okay, looking into the wikipedia article for rust:
11:50
Discord - chat service targeted towards gamers that uses Rust for portions of its backend, as well as client-side video encoding
>
Magic Pocket – Dropbox's file system that powers their Diskotech petabyte storage machines
Avatar
The day clang drops C support, I'll eat my own shit
Avatar
https://github.com/firecracker-microvm/firecracker?files=1 Just as an example for high performance requirements... Aws Lambda is based on this rust software
Secure and fast microVMs for serverless computing. - firecracker-microvm/firecracker
Avatar
But I do use many other languages, with compilers that don't hate you
Avatar
rust compiler doesnt hate you tho
Avatar
we also use other languages 😉
Avatar
Yeah it just knows better then you on every other aspect
Avatar
i use many languages
11:51
too
Avatar
There are no sufficiently smart compilers, except the rust one, that's 1000iq
Avatar
no
Avatar
C C++ Python Javascript Typescript Golang PHP Java
11:52
among them
Avatar
it makes you write obviously safe code
11:52
that makes it not very smart
11:52
because you have to write obviously safe code
11:52
and not just safe cdoe
Avatar
it makes you want to just mark your code unsafe
Avatar
not what happens in practice. the safety record of popular rust libraries is better than that of popular C libraries
Avatar
because it existed for about 10 seconds, cmon
11:53
the sample size is not even comparable
Avatar
okay, suppose we find two similar projects, e.g. two quic libraries
Avatar
10 years = 10 seconds
Avatar
they have existed for a similar time
11:53
would you think that the safety record of rust there is the same as the one in C?
Avatar
A sample size of 1 is not good either
Avatar
okay, then I find another, what do you want?
Avatar
Besides, considering there is a class of bugs that's just IMPOSSIBLE in one language is just cheating
Avatar
you make it look like you want to ignore evidence
11:54
but this is the cheating we want
Avatar
At a cost we don't want
Avatar
we want to get rid of memory safety
11:54
that might well be true
11:55
lol, memory safety bugs
Avatar
The problem isn't me ignoring evidence, the problem is that the evidence can't possibly exist
Avatar
why not?
11:55
fuzz a couple of popular C libraries and a couple of rust libraries
11:55
and see what happens
Avatar
because give it 40 years maybe the rust project will also accumulate the same amount of severe bugs
Avatar
okay, then what about new C projects?
Avatar
Openssl has been around since before I was born
Avatar
should we fuzz them instead?
11:56
I mean we can literally look at evidence
11:56
but you seem to refuse to
Avatar
I don't think the evidence even exists, what is fuzzing showing issues even proving?
Avatar
I'm trying to be scientific about it, but you don't seem to want it
11:57
I'm off for now, sorry
Avatar
That your fuzzing methodology made to look for bugs in C programs doesn't apply well to rust programs?
11:57
Yeah as always
11:58
As long as you believe in something, it doesn't really matter what the methodology is
11:59
I could run Scala with valgrind and tell you it leaks much less on average then C programs on average
12:00
Not only would my methodology would be wrong, the result I get that "Scala is better than C" wouldn't even be the actual result
12:00
You can't just say "X is better than Y", in what aspect at what cost
12:02
And you can't just accuse someone of "ignoring evidence" and hop off, the only piece of evidence provided here was @Ryozuki's performance metric, which could be due to like a billion things
12:03
but sure ignore that part and just assume the guys methodology is flawless and proves the claim HE made
Avatar
I want to look at evidence, but you only say that it cannot exist.
12:05
I haven't even started looking at it due to that
Avatar
The sample size isn't the same, how could it? It's not like it doesn't exist because I don't want it to exist
12:06
I don't need proof that memory safety issues happen less in rust, I know that for a fact because it's how the language is built, but it comes at a price that I personally am not willing to pay
12:06
So the memory safety isn't persuading me to use rust
12:08
I doubt any performance difference could possibly exist as I think you can generate any LLVM IR rust generates with C++ or C, you could find me a construct that I can't the frontend to emit that could allow better optimisation, not like I'll just ignore it
12:09
.s/I can't/I can't get/
12:10
I also agree that if you could not consider any other metric a library written in rust is safer then one written in C
12:11
Oh, e.g. take a look at those performance metrics, that fast execution sometimes seems to come at the cost of memory, it's not a cost that you can always bear
12:17
It's very important to use the language that's correctly suited for your context, the fortran solutions come at a small performance penalty for an incredible boost in memory usage, the haskell solutions sometimes optimise brilliantly because of the way the language is constructed, Java solutions usually come with both a performance and memory hit yet that could be what you want because you only have the JVM to run things on
12:18
I guess in a context where safety is a concern and you have very experienced rust programmers that the ownership semantics don't even phase, you could indeed use rust
12:20
What an absolute waste of time arguing with thin air, I'll go bake something, respond if you want, don't respond if you don't want w/e
Avatar
there is no point in arguing with a wall
Avatar
@jao here you go, you'll have to compile libtw2 though and I'm not going to maintain this at all
13:09
Don't kid yourselves, both of you went into this discussion not even considering to change your minds, I was completely willing to accept any evidence, just not in the manner you hoped without even just questioning it
13:10
I finished it up because I promised I'd finish it, now I'll go bake some coffee cake
Avatar
" you went into this discussion not even considering to change your minds" this is how i felt about you tbh
Avatar
The trick is to put a little bit of cinnamon in your cookie dough, the cinnamaldehyde creates a serotonin response and is very volatile, it's just like taking pure happiness out of the oven
14:27
Oh and an hour in the fridge will do you wonders, especially with getting consistent results in summer
Avatar
what in the fridge? the cookie dough?
14:28
prevents overspreading in summer when the butter would be more runny
14:31
@deen https://github.com/ddnet/ddnet/issues/2105 any idea why this happens?
I think it's because the server isn't sending player info for players off screen when /showall is disabled? idk though
14:32
Do we optimize out the positions of tees that are outside of a radius?
14:34
we do
14:35
we could say we always send at least the closest tee from any distance 😄
14:35
or do the command server-side
Avatar
Where does the client think these optimized out tees are?
14:35
no chars for them i guess
Avatar
The closest tee isn't really that cheap to find, but I guess we can
Avatar
6b0726a Add onionly .me' back to mods - def-
14:42
fishy fishy
14:43
add it from the backdoor
14:43
where no one can notice
Avatar
Yeah, very secret 😄
Avatar
@Learath2 it shows a lot warnings
15:57
thread 'main' has overflowed its stack
Avatar
the warnings aren't learath2's fault
Avatar
and the overflow?
Avatar
I don't know about that one, but my first guess would be the change
16:03
but tbf I don't see any critical change
16:03
can you run it with RUST_BACKTRACE=1?
16:05
set that env variable (I don't know how to do it on windows, on mac/linux it's env RUST_BACKTRACE=1 ./teehistorian2demo
Avatar
idk either
Avatar
I want to make a backup with PostGreSQL pg_dump command with command line like : "<c:\Program Files\PostgreSQL\9.6\bin\pg_dump>" -h localhost -p 5432 -d test_backup_bat -U user -f D:\
Avatar
and after that?
Avatar
call the program again, with the demo
16:17
set RUST_BACKTRACE=1
Avatar
same as before
16:23
which th file are you trying, maybe I can reproduce it on my computer
Avatar
oh yea, that might help
Avatar
c484972c-f1e8-42f6-a624-3eafb7bcb618
Avatar
hm works just fine for me
16:26
oh could it be that you didn't change MAX_CLIENTS?
Avatar
stack overflow is still a weird error
Avatar
where do i need to change?
Avatar
gamenet/src/enums.rs
Avatar
set to 64?
Avatar
yes
Avatar
also does it work without my patch? maybe you just really have a small stack? 😄
Avatar
same error without the patch 😆
Avatar
can you compile a hello world program?
16:30
what rust version do you have?
Avatar
maybe one of the warnings is relevant but I didn't really see anything wrong there
Avatar
can you compile a hello-world-program? (edited)
Avatar
the plot thiccens
16:39
can you have stack canaries in rust?
16:40
Well I guess there is a stack canary that's detecting this, but it doesn't output a backtrace for some reason
16:42
hm, maybe run it with gdb and hope it also causes a crash? 🙂
Avatar
do you have gdb installed?
Avatar
I'm all out of ideas
16:51
I can compile a copy of it on ddnet.tw and you can use that, I guess not very convenient but it'd work
Avatar
videorecorder should record map sounds?
Avatar
I don't think that works yet
Avatar
sound in general or map sounds @Learath2 ?
Avatar
obs should record map sounds
Avatar
sound in general
16:57
I think there was some issue getting the tracks to synchronise, but don't really remember if the guy ever figured it out
Avatar
@Learath2 at least u tried 😁
17:29
♥
Avatar
I have a bonus idea, try compiling the debug version, maybe its some too aggressive optimuzation on the stack size
Avatar
[quakenet] Delon BOT 2020-06-05 18:20:28Z
Hi @deen
Avatar
@Learath2 when fix master 4
20:13
its annoying
20:14
ur better just deleting it than keeping it running
Avatar
what's wrong wit hit?
Avatar
it never works
Avatar
on my ovh server ive had to iptables block the master server in range 31.186.0.0/16 or else it doesnt register properly
20:45
didnt have this issue with my digitalocean server
20:45
never really tried to look into it further since doing the firewall fixed it
Avatar
@ZombieToad thanks for the report, should work again
Avatar
did u change something
Avatar
removed some filters we had
Avatar
server list just went from 240 to 380 lmao
20:48
wow
20:48
yes it did
Avatar
yeah, sorry about that. had to install some filters because the dos attacks kept downing our server :/
20:49
and I guess we forgot about them after the attacks stopped
Avatar
might not wanna say it here if the attacker can read this chat lol
Avatar
maybe we need to choose a better preset for the videorecorder
22:13
5676e88 Improve quality default, persist video recorder settings when running other DDNet client - def- cf069c0 Merge #2251 - bors[bot]
Avatar
This is a simple idea that I think would be useful. When you are frozen (or deep-frozen) your crosshair should represent the weapon you are currently holding, instead of showing the ninja crosshair. Here's a little mockup: !mockup_crosshairs
Exported 431 message(s)