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-07-12 00:00:00Z and 2023-07-13 00:00:00Z
Avatar
@Learath2
Avatar
Avatar
Ewan
that makes the whole setup process p much install msys -> install a few pkgs -> cmake -> win
if you're familiar with it, maybe you could write a guide
09:19
I don’t really want to write a forum post, is there somewhere else I should do it
Avatar
you could add a section to the readme.md
Avatar
wiki
⬆️ 1
Avatar
Ok remind me later i'm doing awesome wave stuff
09:39
@heinrich5991 have u xp compiling rust?
09:39
i know they use x.py
09:39
but it doesnt work for me
09:39
rust on  master via 🐍 v3.11.4 via 🦀 v1.70.0 ❯ ./x check Traceback (most recent call last): File "/data1/edgar/rust/x.py", line 50, in <module> bootstrap.main() File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 1113, in main bootstrap(args) File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 1070, in bootstrap build = RustBuild(config_toml, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 505, in __init__ self.build = args.build or self.build_triple() ^^^^^^^^^^^^^^^^^^^ File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 976, in build_triple return config or default_build_triple(self.verbose) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 259, in default_build_triple kernel, cputype, processor = uname.decode(default_encoding).split() ^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: too many values to unpack (expected 3)
09:39
xd
09:39
is it cuz python 3.11?
Avatar
sounds like your target triple is wrong
Avatar
❯ uname -a Linux gentoo 6.1.38-gentoo #1 SMP PREEMPT_DYNAMIC Mon Jul 10 08:28:17 CEST 2023 x86_64 AMD Ryzen 7 5800X 8-Core Processor AuthenticAMD GNU/Linux
Avatar
Avatar
heinrich5991
sounds like your target triple is wrong
how to check it
Avatar
try uname -smp
Avatar
❯ uname -smp Linux x86_64 AMD Ryzen 7 5800X 8-Core Processor
Avatar
$ uname -smp Linux x86_64 unknown
09:41
the line with the exception expects 3 words separated by spaces
09:42
I suppose that's where the problem comes from?
Avatar
i guess
09:42
@Learath2 is this some gentoo thing? i remember something about uname
Avatar
change the line to .split(maxsplit=2)
09:42
and make a pull request
09:43
epic
09:43
im rust contributor
09:43
-p, --processor print the processor type (non-portable)
09:43
it says non portable
09:43
so i would say my -p is ok
09:44
my system i mean
Avatar
it's only used on freebsd, anyway, according to the source
09:44
so .split(maxsplit=2) should not cause problems
Avatar
seems to work
09:45
gotta fork rust
Avatar
there's lots of pull requests you can send to rust-lang/rust
09:45
do it every time you find something lacking in the docs, e.g. 🙂
Avatar
what does e.g smile mean?
09:46
confused xD
09:46
actually i never rly searched what e.g means
09:46
"for example"
09:46
ah ok
Avatar
e.g. = for example (for weird latin reasons) (edited)
09:46
i.e. = that is (for weird latin reasons)
Avatar
The x.py script fails with ValueError: too many values to unpack (expected 3) when uname -smp gives more than 3 words The error I got: ❯ ./x check Traceback (most recent call last): File "/d...
09:57
justatest
10:01
damn their ci is fast
10:01
AMD EPYC 7763 64-Core Processor
10:01
XD
Avatar
ws-client BOT 2023-07-12 10:03:07Z
<Jupstar> your first contribution to rust is python
10:03
wow rust compiled in 2 mins
10:03
i think
10:03
x build
Avatar
ws-client BOT 2023-07-12 10:04:09Z
<Jupstar> now say the same about llvm xd
10:05
its amazing
10:05
the x tool
10:05
they setup env for either compiler library tools etc
10:05
and it asks if u want a configured vscode settings
10:06
@Jupstar ✪ when epyc server for ddnet CI
Avatar
ws-client BOT 2023-07-12 10:07:31Z
<Jupstar> sounds good, only annoying thing is that u have to setup vm or smth for security
10:10
i guess i didnt need to compile llvm 16
10:10
since i got it already
Avatar
ws-client BOT 2023-07-12 10:10:54Z
<Jupstar> pff llvm16
10:10
<Jupstar> non-hipster
10:11
arch linux is on 15 still
Avatar
ws-client BOT 2023-07-12 10:11:22Z
<Jupstar> i am on 17 since like a month
Avatar
i think arch linux lacks slots
10:11
gentoo portage slots
10:11
u can have 15 and 16 side by side
10:11
with proper deps
Avatar
can’t u do that on nix as well
10:12
i love wave
Avatar
ws-client BOT 2023-07-12 10:16:09Z
<Jupstar> thanks for destroying my ears
Avatar
you are welcome
10:16
anyone know of a list of known ddnet spammers/ddossers/bots
10:17
ppl to blacklist
10:17
just banned one from unique usa and wondering if there's a list i can ban all of
Avatar
Ask noby
Avatar
he was on fastcap and his name was green i thought we were gonna be buddies
Avatar
He has lists
Avatar
names to blacklist?
Avatar
sounds futile, unfortunately
10:17
ah
Avatar
ok i ask noby
10:26
10:26
lmfao?????
Avatar
Cool map idea
Avatar
anyone know what happened
10:30
i think i have to tell timakro his instagib server is broken
Avatar
Avatar
Ewan
i think i have to tell timakro his instagib server is broken
zCatch?
10:32
it was unique
10:32
in germany
10:32
i was getting rid of the spammers
Avatar
instagib isn't exactly a game mode I think, but rather a gametype
10:35
deen recently found a zcatch related crash, so maybe it's that
Avatar
ws-client BOT 2023-07-12 10:35:21Z
<Jupstar> isnt that simply unused entities?
Avatar
maybe. idk what are u talking about murpi, your words make sense but idk how they pertain to this
Avatar
ws-client BOT 2023-07-12 10:35:53Z
<Jupstar> is the design also broken?
Avatar
that bug in my screenshot happened on the unique instagib server in germany. not ddnet affiliated (edited)
10:36
or related to zcatch
Avatar
You said timakro's instagib server is broken. Instagib is a type of game, not a game mode. You can play instagib in zCatch or iCTF. Does that make sense?
Avatar
probably ictf
10:39
idk why u are talking about a crash rn
10:40
which i think is related to loading the game after ninja is voted in anyway. and probably on a different version of the game
Avatar
Ah, I see the confusion. I didn't see the screenshot, only your message saying that x is broken.
Avatar
idk what that crash was but if it's the one i reported a day or 2 ago i think i had it before as well
10:45
but only recalled after and mistook it for a crash on the vanilla server. to which deen said there were no recent crashes or logs when i asked
10:45
that would explain a bunch
Avatar
Avatar
Ewan
Click to see attachment 🖼️
the map got corrupted
Avatar
well yeah
10:55
i think maps should be hashed before they are loaded tho
Avatar
ws-client BOT 2023-07-12 10:59:26Z
<Jupstar> maps have a hash
10:59
<Jupstar> or what do you mean
Avatar
ws-client BOT 2023-07-12 11:00:29Z
<Jupstar> if the hash is wrong, then thats a problem after downloading a map, not when loading a map
Avatar
the only reason i can see it being corrupted is network issues
Avatar
ws-client BOT 2023-07-12 11:02:04Z
<Jupstar> mh i doubt that
Avatar
which would be checked after downloading. which is before they are loaded
11:02
lol
Avatar
ws-client BOT 2023-07-12 11:02:12Z
<Jupstar> it must be broken on the server already
11:02
<Jupstar> does the prediction also think the map is broken ? :D
Avatar
idk im not there anymore
Avatar
Avatar
ws-client
<Jupstar> does the prediction also think the map is broken ? :D
yeah i think prediction makes u fall through the floor
Avatar
ws-client BOT 2023-07-12 11:11:19Z
<Jupstar> but the server resets your position?
Avatar
i was in bed all day
11:13
My first time taking a leave to just chilling and napping
11:13
Didn't feel good tho lmao
Avatar
yeah don't do that
11:13
bad for you
Avatar
ws-client BOT 2023-07-12 11:14:14Z
<Jupstar> yeah better continue working 18h a day
Avatar
that's also bad
Avatar
It's a paid leave so it was at least worth it
11:19
kek
11:19
I just forgot to stop working till 4am last night and i have trouble sleeping so i just requested a day off in the morning
Avatar
Avatar
TsFreddie
I just forgot to stop working till 4am last night and i have trouble sleeping so i just requested a day off in the morning
how one forgets to stop working?
Avatar
Because unity sucks and i have to make my own emoji atlas and hack my way through a fake font format and when I'm done it's already 4
11:48
Also ADHD probably
11:52
only work on work hours
11:52
if it takes longer it takes longer
11:53
or the company hires more
11:53
also if u dont get paid for those hours i find it stupid, and i dont think its cuz u need that job cuz living in a poor region
11:53
but its bad for u health ultimately
11:54
11:54
inspirational quote
11:54
#instagram
11:55
#lifestyle
11:55
justatest
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
im 14 and this is deep
12:11
but its true
Avatar
Avatar
Ryozuki
only work on work hours
i get bored at home
Avatar
then become unbored
12:24
Avatar
Avatar
Ryozuki
@Learath2
Me fr
Avatar
ddnet is too laggy with my new internet
Avatar
skill issue
Avatar
since when did SDL3 is a thing
Avatar
a few months
13:10
it's still preview
13:10
very unstable
Avatar
interesting
13:18
i bought a game on steam which is SDL3
13:18
so i was confused
13:18
Avatar
wow that is a bad idea
Avatar
That's hipster
13:22
I like
13:23
As if any sdl2 was ever stable xd
Avatar
there are degrees to everything
13:23
lol
Avatar
like how i have a master degree
Avatar
weird flex but ok
Avatar
and it is 37 degrees outside even though it is 9 in the evening
13:25
that's 99 degrees for you americans btw
Avatar
Avatar
Ewan
very unstable
where did u hear very unstable
Avatar
i experienced it
13:27
libinput is completely broke on windows
13:27
build system and conflicts
Avatar
ah windows
13:27
on linux?
13:27
the only one and only
Avatar
skill issue
Avatar
windows is a platform they target and it doesn't work on there so it's an SDL issue (edited)
13:27
words
Avatar
skill issue
Avatar
excels and powerpoints
Avatar
@heinrich5991 regarding the rust pr i made
13:28
im very confused
13:28
apparently another did the same fix
13:28
but mine was accepted
13:28
The x.py script fails with ValueError: too many values to unpack (expected 3) when uname -smp gives more than 3 words The error I got: ❯ ./x check Traceback (most recent call last): File "/d...
13:28
i guess cuz theirs failed ci, but for unrelated reasons
Avatar
you're just better
13:30
i do wonder how the guy feels tho, it's exactly the same change.
Avatar
ryo’s has a real description
13:32
that’s prob ig
13:32
it
13:32
words
Avatar
Avatar
TsFreddie
i do wonder how the guy feels tho, it's exactly the same change.
the other person is a contributor already, they'll be fine
Avatar
my guess is that was the decision (edited)
13:36
or maybe simply they dont want to rerun ci
13:36
xd
Avatar
I don't think there was a conscious decision
13:44
these were separate reviewers
13:44
yours just got in faster, then the other was obsolete
13:49
new rust drama blog post incoming
13:49
"pr approved over another pr" (edited)
13:49
kek
13:50
god i cant type
13:51
i also joined zulip
13:51
the open source slack
13:51
looks great
13:51
a bit confusing at first
Avatar
yea, I also liked it
13:51
I wondered whether it'd be a good fit for ddnet
13:51
but I guess github issues is good enough
13:52
i wondered if it could replace discord
13:52
but discord is too easy and used byeveryone
Avatar
it'd be nice if the discord could be mirrored to some open platform
Avatar
ohh sweet
Avatar
but I haven't really found a solution for that
Avatar
open source slack sounds awesome
Avatar
not sure if it's slack tbh
Avatar
is it the same API-wise or is it just similar
Avatar
it sounded more like a replacement for forums
Avatar
Avatar
Ewan
is it the same API-wise or is it just similar
definitely not API-wise
Avatar
well i heard people say its like the open source slack
Avatar
so like a self-hosted discord?
Avatar
self hosted slack
13:54
Avatar
this doesn't look like slack to me
13:54
but it serves the same function
Avatar
in slack you have a normal chat with optional threads
13:55
this is chat divided by topics
Avatar
i wonder if zulip has it
Avatar
idk
Avatar
or its just how rust does things
Avatar
Avatar
Ryozuki
i wondered if it could replace discord
it wont
14:26
discord is too big to be replacrd
Avatar
it'll be replaced at one point
14:27
all these proprietrary systems are
Avatar
look at twitter
Avatar
where are the mastodon gang
Avatar
Avatar
Ryozuki
look at twitter
i barely see a difference with twitter threads is a completely different demographic
Avatar
is it bad to take melatonin every day
Avatar
ask ur doctor
Avatar
Avatar
Voxel
i barely see a difference with twitter threads is a completely different demographic
twitter won't be gone for a couple of years
14:41
it's just so huge
Avatar
Signs of melatonin overdose include excessive sleepiness, vomiting and trouble breathing. Other side effects of both low and high doses of melatonin can include headaches, excessive sleepiness, blood pressure changes, gastrointestinal problems, changes in other hormone levels and mood problems, McCall says
14:41
since u can get overdose i guess yes
14:41
it can be bad
Avatar
sleeping is too hard
Avatar
go to gym
14:43
im no doctor but i guess sleeping can be bad if u simply have a unhealthy lifestyle xd
14:43
eat bad
14:43
do nothing
14:43
etc
14:43
overwork
Avatar
I walk 30 minutes to work does that count
Avatar
18h - 30min or + ? Xd
Avatar
Avatar
Jupstar ✪
18h - 30min or + ? Xd
if i work 18h i probably was sleeping at work
14:55
or just didn't go home that day
Avatar
this looks absolutely boring LOL
Avatar
Avatar
Jupstar ✪
18h - 30min or + ? Xd
also it was 30 minutes one way so probably an hour in total for commute
Avatar
idk i think id stick with discord
Avatar
some gifs are too big to be fun
Avatar
@Jupstar ✪
Avatar
Avatar
Ryozuki
@Jupstar ✪
😬
Avatar
Replace CEditor::m_EditBoxActive which only works with editboxes created from the editor with CLineInput::GetActiveInput which also works for editboxes which are created by generic UI functions, e.g. the value selector editboxes of color pickers.

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 int...
Avatar
Avatar
Ryozuki
@Jupstar ✪
texas sharpshooter fallacy troll
Avatar
Sometimes working with rust fills me with such primal rage, why on gods green earth am I not allowed an empty array without an Option being involved?
18:03
I mean I know why, but still pisses me off
18:07
let me have my uninitialized memory please aaaaaaaa
Avatar
Avatar
Learath2
let me have my uninitialized memory please aaaaaaaa
? u can
18:10
maybeuninit
18:10
Avatar
it's unsafe, meaning if you use it you'll get lynched
18:11
specially for this use case
18:11
initializing a array
18:11
its well known
18:11
but option is safer
18:11
and usually no overhead
18:11
depends on the type
Avatar
Avatar
Learath2
Sometimes working with rust fills me with such primal rage, why on gods green earth am I not allowed an empty array without an Option being involved?
use case?
18:15
the use case I encounter often is a byte buffer for the read trait
Avatar
good to know ur using rust instead of C tho
Avatar
Something far simpler https://docs.rs/twilight-http/latest/twilight_http/request/channel/message/create_message/struct.CreateMessage.html#method.attachments I want to create a message inside a closure but I return it outside, so the backing storage for the attachments must be on the outside scope
Avatar
coming to the light
Avatar
Avatar
Ryozuki
good to know ur using rust instead of C tho
Every second I use this language I miss the flexibility of C and C++
Avatar
rly? i dont
18:17
that feeling of safety
18:17
cutestare
Avatar
@Learath2 basically you're trying to initialize an array using a closure?
Avatar
Avatar
Ryozuki
that feeling of safety
I honestly hate it, it feels like there is this drill sergeant constantly watching over me. I know when I've initialized my variables I'm not an invertebrate
Avatar
std::array::from_fn
Avatar
Avatar
Learath2
I honestly hate it, it feels like there is this drill sergeant constantly watching over me. I know when I've initialized my variables I'm not an invertebrate
yes yes ur a god
Avatar
Avatar
heinrich5991
@Learath2 basically you're trying to initialize an array using a closure?
Yes but the array must be declared on the outside scope
Avatar
Avatar
Ryozuki
std::array::from_fn
oh, cool, I didn't know stdlib had this already
18:18
I think @Ryozuki posted the solution
Avatar
Avatar
Ryozuki
yes yes ur a god
Don't need to be anything beyond simple human to lift your head from the line you are looking at to a couple lines above and see if you initialized something
18:19
But thanks
Avatar
Avatar
heinrich5991
oh, cool, I didn't know stdlib had this already
this is how i init [x; N] arrays
18:19
thagt are not copy
Avatar
back in my day™ we didn't have these fancy const generics :p
18:19
that's why I don't know these well yet
Avatar
oh i see
18:19
well rust is getting better
18:19
and learath is learning it
18:19
its 2023
18:19
gigachad
Avatar
Avatar
heinrich5991
I think @Ryozuki posted the solution
This helps initialize an array using a closure, I need to initialize and use the array inside the closure and return a CreateMessage<...> instead
18:20
It's just that the backing storage for the array needs to live the same duration as the CreateMessage<...> so they need to be declared in the same scope
Avatar
ah
Avatar
but I can't yet initialize it because I don't know if a) I'll need it b) it's contents
Avatar
you want to have a struct that has two fields, one pointing into the other? (edited)
Avatar
CreateMessage<...> holds a reference to an &[Attachment]
Avatar
yes
Avatar
what else
Avatar
Let me write a simple snippet so we can talk over that instead
18:27
@heinrich5991 from_fn is from 1.63.0 (edited)
18:28
so pretty recent
18:28
we cant use it in ddnet code kek
Avatar
double irc ping poggers
Avatar
tbf we're not using a lot of rust in ddnet yet
18:28
the only thing we do currently is the mastersrv, unfortunately
18:29
I'm working on doing more in rust 🙂
18:29
quic!
18:29
i want to code more in ddnet but idk lazyiness
18:29
and doing stuff in rust is more work cuz there is not a lot of cxx layer built yet
Avatar
yes
18:30
maybe the cxx approach was the wrong one :/
Avatar
https://ideone.com/h1I1a7 this is the idea, as you can see this doesn't quite work as the array created on line 12 is a temporary that is dropped too early
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows to compile and run code online in more than 40 programming languages.
18:31
I recreated it with a match statement, but closures suffer from the exact same issue
18:32
My inferior C brain immediately tells me that this issue is solved by allocating the backing storage before the block along with the msg, filling it in the match/closure, and then using that
Avatar
maybe you can do a let attachments; in the beginning
Avatar
https://ideone.com/1g0ZJB this is the best I could come up with
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows to compile and run code online in more than 40 programming languages.
Avatar
and then in the match, you do attachments = [your_attachment];
18:35
and then pass &attachments to the function (edited)
18:35
that should work
Avatar
Aha, that does work, what is this magic called?
Avatar
it's no magic :p
18:37
it's basically doing what you wanted to do, having an uninit variable
Avatar
attachments would be immutable no?
Avatar
yes, you can only assign it once
Avatar
as long as u init the let in every branch it works
Avatar
I did not know you were allowed an assignment later huh
Avatar
Avatar
Ryozuki
as long as u init the let in every branch it works
no, that's not necessary
18:38
you only have to init it before you use it
Avatar
everywhere where u use it*
18:38
ye
Avatar
Avatar
Learath2
I did not know you were allowed an assignment later huh
its initialization
18:38
iirc
Avatar
It isn't mentioned in the book and I don't read enough rust code I guess
18:39
Nice to know
Avatar
I don't know how I learned that
18:40
perhaps just like this
Avatar
let else is the best thing to happen in a while
Avatar
let else is indeed nice
18:42
haven't used it yet though. so who am I to judge that ^^
Avatar
i also never used it
18:42
if let else yes
18:43
let is super powered
18:43
its one of the things that makes me hate old langs
18:43
pattern matching
18:43
The pattern is most commonly a single variable, which means no pattern matching is done and the expression given is bound to the variable. Apart from that, patterns used in let bindings can be as complicated as needed, given that the pattern is exhaustive. See the Rust book for more information on pattern matching. The type of the pattern is optionally given afterwards, but if left blank is automatically inferred by the compiler if possible.
Avatar
If y'all enjoy the usual rule of never having early returns it's normal that you don't use it
Avatar
i use early returns sometimes
18:44
actually many times if u count ?
18:45
let (Ok(i) | Err(i)) = [1, 2, 3].binary_search(&2);
18:45
fn f((Ok(i) | Err(i)): Result<i32, i32>) {}
Avatar
The else block has to diverge, so it kinda only has a use for guards and stuff
Avatar
match value { Some(p @ 2 | 3 | 5 | 7) => println!("{p} is a prime"), Some(sq @ 0 | 1 | 4 | 9) => println!("{sq} is a square"), None => println!("nothing"), Some(n) => println!("{n} is something else"), }
18:45
binary_search is funny cuz it returns a result
18:46
Result<i32,32>
18:46
If the value is found then Result::Ok is returned, containing the index of the matching element. If there are multiple matches, then any one of the matches could be returned. The index is chosen deterministically, but is subject to change in future versions of Rust. If the value is not found then Result::Err is returned, containing the index where a matching element could be inserted while maintaining sorted order.
Avatar
This bot is so bad, I'm ashamed of having written it 😄
18:48
what bot
18:48
im interested
18:48
i made RyoChan
18:48
but it just has 1 command
Avatar
ah right tomorrow last exam
18:49
for learath
18:49
then bot release 😬
Avatar
Avatar
Learath2
This bot is so bad, I'm ashamed of having written it 😄
no open source?
18:49
aPES3_CursedDemon
18:50
Avatar
Avatar
Learath2
If y'all enjoy the usual rule of never having early returns it's normal that you don't use it
I like early returns
Avatar
Avatar
Ryozuki
no open source?
it is open source
Avatar
Successful merges: #113353 (Implement selection for Unsize for better coercion behavior) #113553 (Make Placeholder, GeneratorWitness*, Infer and Error unreachable on SMIR rustc_ty_to_ty) #113598 (...
18:52
rollup of my pr
18:52
im rust contributor now
18:52
worrywhat
Avatar
https://github.com/Learath2/discordbot don't look at it though, it's actually embarrasing code
Contribute to Learath2/discordbot development by creating an account on GitHub.
Avatar
@Learath2 in my book if it doesnt pass clippy with pedantic its embarrasing
18:53
so ye the bar is high
Avatar
and the commit I'm about to push, don't judge me for it, I just need to fix the bug mods are complaining about before they kill me
Avatar
that's a stupid rule IMO
18:53
anyone can push new clippy lints
Avatar
#![deny(missing_docs)] #![deny(warnings)] #![deny(clippy::nursery)] #![deny(clippy::pedantic)] #![deny(clippy::all)]
18:53
add this
Avatar
Avatar
Ryozuki
so ye the bar is high
I have warnings even without clippy 😄
Avatar
@heinrich5991 i knew u would say this, but i dont care
18:53
and im half joking
18:53
pedantic is a lot
18:53
but atleast make clippy pass
Avatar
and they only get reverted once enough people announce that the lint is actually not improving stuff
Avatar
(i unjokingly enable pedantic in my projects tho)
18:54
so far the only annoying ones i found is too complex types and too many arguments (edited)
Avatar
whys it called clippy
Avatar
cuz windows clippy
18:54
its a linter
18:55
the cult of anti windows praises the windows mascot
18:55
justatest
Avatar
many rust users use windows
18:55
its a separate cult
18:55
actually im not 100% sure its cuz windows tho
Avatar
i always saw them as the same tbh
Avatar
wasn't clippy ms office, not windows?
18:55
is that a matrix bot gone wrong?
Avatar
Avatar
Voxel
i always saw them as the same tbh
idk what u say, the only rust community u seen is us here xd
Avatar
Avatar
heinrich5991
wasn't clippy ms office, not windows?
windows xp?
Avatar
not AFAIK
Avatar
i saw that
Avatar
i missed it
Avatar
Avatar
Ryozuki
idk what u say, the only rust community u seen is us here xd
fair but i like it this way
Avatar
Avatar
Ryozuki
but atleast make clippy pass
e.g. check this wonderful lint that introduced bugs in people's projects: https://github.com/rust-lang/rust-clippy/pull/9484
Fixes #9477 Fixes #6751 Identifies common patterns where usage of the clamp function would be more succinct and clear, and suggests using the clamp function instead. changelog: [manual_clamp]: Impl...
Avatar
@Learath2 atleast u using sqlx
Avatar
Avatar
heinrich5991
e.g. check this wonderful lint that introduced bugs in people's projects: https://github.com/rust-lang/rust-clippy/pull/9484
if a buggy lint got into pedantic its a misrelease by them, iirc the experimental lints are on nursery
18:58
some may have false trues in stable but its ok
Avatar
this was a warn-by-default lint
Avatar
i dont see the relation
Avatar
this is a case where blindly following clippy's suggestions introduced bugs in people's code
Avatar
ok but i still dont see the problem
Avatar
with clippy's default settings
Avatar
software can have bugs
Avatar
okay
Avatar
also many ppl use clippy check
19:00
on ci
Avatar
I just want to say that you should critically evaluate the lints
Avatar
instead of a bare check
19:00
i do
19:00
so far they make lot of sense
Avatar
if even bugs can get through, surely bad suggestions can also get through
Avatar
i think u should be more leniant
Avatar
I thought I was being more lenient than you are on this
19:01
you're suggesting a "you need to fix all clippy warnings" policy (edited)
Avatar
i always seen u as a anti clippy guy
19:01
yes, so far it worked good for me
Avatar
and I'm providing a counterpoint
19:01
why fixing all clippy warnings is not always a good idea
19:01
as it even introduced bugs in the past
19:02
code linting tools are good, clippy is one of them
Avatar
which get fixed and is fine
19:02
99% of cases are good to fix
Avatar
please don't make up percentages 😦
19:02
most of the cases are good to fix
19:02
I agree
19:02
but you should still think while doing so
19:02
if a suggestion doesn't make something better, don't do it
Avatar
i was about to make a joke but better not xd
19:04
i aproach these tools like this: im certainly they will in most if not all cases now better than me, obv i also check if they make sense, and i read many lints descriptions
19:04
and i find them reasonable
Avatar
I also read lint descriptions
19:04
and when I don't find them reasonable, I don't apply them
19:04
seems like what you're doing, too. except we have different levels of what we deem sensible
Avatar
but I wouldn't exactly call my stance "more extreme" than yours ^^
Avatar
lol i saw that
Avatar
matrix spam?
19:05
briefly xD
Avatar
how do I check if I'm compiling for windows, in meson?
Avatar
never rly used meson
19:06
host_machine.system()
19:06
i think
Avatar
thanks
Avatar
that was 1 quick google tho
19:08
what u doing with meson?
19:08
porting ddnet?
Avatar
hmm, don't wanna reveal other identities
19:08
no
Avatar
typical need to define NOMINMAX
19:09
on windows
19:10
because the windows.h header thinks it's a good idea ot define min/max macros, breaking the c++ stdlib, among others
Avatar
Avatar
Ryozuki
@Learath2 atleast u using sqlx
fwiw I only used it because I was interested in it's Any interface, turns out it's not so good and it really isn't even a great idea to pursue that
Avatar
i never liked multi sql support
19:19
its better to focus on one
19:19
and use its neat features
19:19
mainly psql
Avatar
Avatar
Learath2
fwiw I only used it because I was interested in it's Any interface, turns out it's not so good and it really isn't even a great idea to pursue that
do you know anyhow btw? (edited)
Avatar
Next time I might try tokio_postgres
Avatar
color_eyre*
Avatar
Avatar
Learath2
Next time I might try tokio_postgres
noo just use sqlx with postgres
Avatar
would make code like this easier to write: let Ok(msg) = msg else { return Err(Error("CME")); }
Avatar
compile time checked queries
Avatar
Avatar
heinrich5991
do you know anyhow btw? (edited)
Yeah, I use it in newer stuff I do, that bot is left from the very early times when I was learning Rust. So I also used it as a playground where I messed around with doing errors on my own without anyhow
Avatar
color_eyre is a fork of anyhow with better end user errors
19:21
An error report handler for panics and the eyre crate for colorful, consistent, and well formatted error reports for all kinds of errors.
Avatar
in what way "better end user errors"?
Avatar
Avatar
Ryozuki
compile time checked queries
I never quite figured out how best to package that for a project btw, I just set DATABASE_URL and call it a day
19:22
I think there is a way to generate a json file with the schema
Avatar
Avatar
Learath2
I never quite figured out how best to package that for a project btw, I just set DATABASE_URL and call it a day
ye thats how i do it too but u can also do the json
19:22
u need to install the sqlx cli tool
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
I also saw the documentation, it's not clear to me why this is "better end user errors"
Avatar
which btw, its a rly good tool to manage migrations
Avatar
I was hoping for some small summary
Avatar
Avatar
heinrich5991
I also saw the documentation, it's not clear to me why this is "better end user errors"
It looks pretty? idk
Avatar
u need the tool with the feature enabled
Avatar
eyre adds backtraces, I'm guessing color_eyre adds colors to eyre 😄
19:23
backtrace full looks pretty
19:23
beware tho
19:23
in some scenarios due to eyre adding backtraces, there is a issue with lifetimes
Avatar
I can imagine backtrace full looking extremely ugly in async programs 😄
Avatar
i found this in some async contexts
19:23
returning some errors
19:23
i forgot what i did
Avatar
is ddnet async
Avatar
it does some stuff in threads
19:24
but it doesnt have a async runtime
Avatar
it's doing manual async
Avatar
Avatar
Voxel
is ddnet async
tokio, a async runtime and executor, uses a work stealing scheduler to run ur routines
19:24
tasks*
19:25
learning to make ur async runtime can be fun
19:25
i have to do it
19:25
i only dabbled into it when i was doing ryoOS
Avatar
Async usually implies a runtime making guesses about where best to run your tasks. It'll start a bunch of threads and as you submit tasks it'll assign them to threads
Avatar
In this post, we explore cooperative multitasking and the async/await feature of Rust. We take a detailed look at how async/await works in Rust, inclu…
Avatar
Avatar
Learath2
Async usually implies a runtime making guesses about where best to run your tasks. It'll start a bunch of threads and as you submit tasks it'll assign them to threads
the neat part is spawning a task is cheap compared to spawning a thread
Avatar
I'm still very skeptical about how good of an idea this async thing is, it does make writing async code trivial but how can it be as performant idk
Avatar
isnt tokio pretty perfomant
19:27
it beats go which is designed for this, in some areas
Avatar
Locality principle is extremely useful in squeezing out performance, but if my task moves from core to core I might get hundreds of cache misses for no reason
Avatar
I think postgresql also wanted to move to some async model
Avatar
i forgot the blog post
Avatar
Activating VS 17.6.3 — why does this take >1 second?
Avatar
Avatar
Learath2
Locality principle is extremely useful in squeezing out performance, but if my task moves from core to core I might get hundreds of cache misses for no reason
i think u can spawn a non movable task iirc
Avatar
what exactly needs 4'000'000'000 clock cycles there?
Avatar
Avatar
Ryozuki
isnt tokio pretty perfomant
I'm talking about async runtimes in general versus manually threading your application thinking about where a thread is useful
Avatar
Avatar
Learath2
I'm talking about async runtimes in general versus manually threading your application thinking about where a thread is useful
postgresql is thinking about it
Avatar
Avatar
heinrich5991
Activating VS 17.6.3 — why does this take >1 second?
What is this?
Avatar
Avatar
heinrich5991
postgresql is thinking about it
Is there some discussion somewhere I can read? In their case performance is critical so they might have some of the concerns I have and there might be some answers
Avatar
Avatar
Learath2
Is there some discussion somewhere I can read? In their case performance is critical so they might have some of the concerns I have and there might be some answers
lwn
Avatar
Avatar
Learath2
What is this?
meson getting the cl compiler and link linker from the environment
Avatar
is meson made in python
Avatar
yes
Avatar
@Jupstar ✪ justatest
19:30
when something like meson in rust
Avatar
build systems are an annoying problem
19:31
soo many different platforms
Avatar
yesterday i found this neat crate https://crates.io/crates/dll-syringe
19:31
wanted to try if i can port a mod platform from c# to rust
19:31
for ffxiv
Avatar
Avatar
Ryozuki
when something like meson in rust
build systems have to be slow, so better use the slowest language available
Avatar
Avatar
heinrich5991
meson getting the cl compiler and link linker from the environment
Maybe it's trying the compiler out? Most build systems check if it can create an executable and stuff
Avatar
yo the spammer is back
Avatar
I'd guess it's an extremely slow batch file from msvs
Avatar
wrong server sry
Avatar
but I guess I'll debug this for a minute now
Avatar
i thought heinrich was in a asian timezone
19:38
but maybe he is american
19:38
in*
19:38
idk why i thought asian
Avatar
it's VC/Auxiliary/Build/vcvars64.bat
19:38
that's taking >1 s to execute
Avatar
r u on windows?
Avatar
Avatar
heinrich5991
typical need to define NOMINMAX
.
19:39
I have a windows VM
19:39
to check that stuff compiles on windows
19:39
well one could also think @Learath2 is in a american timezone given his active hours
19:39
justatest
19:40
hi deen
👋 1
19:40
wen c++20
19:41
ive seen some news around c++23
Avatar
Avatar
Ryozuki
i thought heinrich was in a asian timezone
heinrich is on the space station, that explains his always changing timezone
Avatar
i failed to get it working
sadSnail 1
Avatar
Avatar
cyberFighter
wrong server sry
i mean i guess itw as the right server? the rainbow with random generated names guys
19:42
joined our srv
Avatar
@deen this reminds me, u soon wont be here at all right?
19:43
can heinrich or learath make releases
19:43
multiview looks pog
heartw 1
19:44
Hello Windows Insiders, today we are releasing Windows 11 Insider Preview Build 25905 to the Canary Channel. We are releasing ISOs for this build – they can be downloaded here. Starting with to
19:45
Rust in the Windows Kernel
>
Rust offers advantages in reliability and security over traditional programs written in C/C++. This preview shipped with an early implementation of critical kernel features in safe Rust. Specifically, win32kbase_rs.sys contains a new implementation of GDI region. While this is a small trial, we will continue to increase the usage of Rust in the kernel. Stay tuned!
>
[We are beginning to roll this out, so the experience isn’t available to all Insiders in the Canary Channel just yet as we plan to monitor feedback and see how it lands before pushing it out to everyone.]
19:46
im dying of heat
19:46
it says it rains but its fake
Avatar
With rust this bug wouldnt have happened
Avatar
Avatar
Ryozuki
can heinrich or learath make releases
no, not right now
19:48
i.e. we don't have deen's setup
Avatar
We could technically make a release I guess, it would just take a lot of effort since we don't have it set up
Avatar
i think for ddnet future proof sake
19:49
we need to standarize this
Avatar
We have access to everything needed
Avatar
i want to be able to do a release on my server (for myself for example)
Avatar
Avatar
Ryozuki
we need to standarize this
There is a release script if you want to do it yourself
Avatar
it has many hardcoded paths iirc
Avatar
where is deen going?
Avatar
he isnt going anywhere
Avatar
(It might be nice to do this in docker actually, I did attempt it once but then it was way too much work)
Avatar
he will just be busy
19:50
xd
19:50
he mentioned it on this channel but idk if i should repeat it
Avatar
u can link to it
19:50
or i can just scroll
Avatar
that would be the same as repeating
19:50
i meant it more as in privacy
19:51
why did u delete
Avatar
old screenshot
19:51
fulscren bug
Avatar
pro racer
Avatar
so pro he does 2 at once
Avatar
why dummy on race tho
19:52
maybe he is testing
Avatar
it's just Green with their name changed LMFAO
19:52
the spammer
Avatar
Malicious
Avatar
Avatar
Ryozuki
we need to standarize this
I think that's "only" a question of effort. I don't think anyone would be against it
Avatar
ws-client BOT 2023-07-12 20:40:42Z
<ChillerDragon> when finally open source ddnet scripts
20:41
<ChillerDragon> not this half baked some scripts copied over into a git repo
Avatar
Avatar
heinrich5991
i.e. we don't have deen's setup
Maybe you can make CI scripts (GitHub Actions and/or GitLab CI) producing suitable packages? I see it won't cover everything (e.g. Steam) but maybe the way to overcome this is a better (and more accessible) automation?
Avatar
Avatar
Ryozuki
@deen this reminds me, u soon wont be here at all right?
it's not like I'm dying 😄
Avatar
help math // samplerate is 48000, can be any positive number tho double running = 5; // (0, 5) const double growthConstant = 1. + (1. / (samplerate / 3)); // (1, 5 * growthConstant); (2, (5 * growthConstant) * growthConstant) for (int i = 0; i < samplerate; i++) { // Test every X between 0 and 48000 audiodata[i] = running; running *= -growthConstant; }
21:44
why does this create a curve where f(x) = 100 (edited)
21:44
what's special about 3 and 5 in this case
Avatar
I don't see f(x) = x in that image
21:48
where do you plug in the 3, the 5?
Avatar
i've been kinda trying to turn this into an equation but the whole growthconstant thing eludes me
21:51
5 is the y intercept, 3 is the divisor for the growth value (edited)
21:53
sry i forgot it's not f(x) = x it's f(x) = 100
Avatar
I also do not see the constant function f(x) = 100
Avatar
Top of the 'graph' is 100
Avatar
>>> (16001/16000)**48000 * 5 100.41827035443303
21:56
>>> (1 + 1 / (48000 / 3))**48000 * 5 100.41827035443303
Avatar
wouldn't that be 100 if not for imprecision
21:57
idk
Avatar
that's not exactly 100, no
Avatar
so this is just a coincidence
Avatar
yes
Avatar
ah
21:59
you're approximating 5 * e**3 with this formula btw
22:00
(1 / 1 + (high_number / x))**high_number tends to e^x as high_number tends to infinity
22:02
i wonder how i would write it to make it not an approximation
Avatar
short answer: 2.718281828459045
22:14
long answer: you can't represent e exactly, e is an irrational number
Avatar
@Learath2 are empty compilation units forbidden by the C standard?
23:14
why is C2183 a thing and why is it only being thrown when you disable MS extensions?
Avatar
an empty file? It should be fine iirc
23:15
Atleast in c99
23:18
Well let me clarify, atleast I don't remember reading anything that forbids it
23:21
thanks, ms?
Avatar
MS is very well known for their non compliant C compiler, no?
Avatar
I need to enable /Za for stdlib.h not to define min/max macros
23:21
/Za means "turn on standard compliance"
23:21
but /Za also turns on this error
23:21
very funny
Avatar
Huh, interesting, maybe I remember wrong, let me take a look at the standard
Avatar
why can’t you define NOMINMAX before including Windows.h?
Avatar
Avatar
heinrich5991
/Za means "turn on standard compliance"
Yeah I don't see any issue, 5.1.1.2 even has a mention about "A source file that is not empty" implying if it is empty it's fine (IMO)
Avatar
Avatar
Ewan
why can’t you define NOMINMAX before including Windows.h?
it comes from stdlib.h, not windows.h for whatever reason
23:26
took me quite some time to debug where this stupid macro is coming from
Avatar
Avatar
heinrich5991
it comes from stdlib.h, not windows.h for whatever reason
gcc -E?
23:26
msvs should have something similar
Avatar
what if you just -D?
Avatar
In a header file I have the following code which gives me the error in the title, while trying to link. #ifndef BOOLEAN_H #define BOOLEAN_H #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define
Avatar
Avatar
Learath2
gcc -E?
doesn't help, that strips all macros
Avatar
Avatar
Ewan
what if you just -D?
-D what?
Avatar
Avatar
heinrich5991
doesn't help, that strips all macros
but it should show where includes start
Avatar
Avatar
heinrich5991
-D what?
NOMINMAX
Avatar
Avatar
Learath2
but it should show where includes start
doesn't in cl.exe
23:27
the equivalent flag
Avatar
sry, gcc -D. dunno what it is in cl
Avatar
Avatar
Ewan
NOMINMAX
stdlib.h doesn't check for NOMINMAX
Avatar
also -D//D
Avatar
it's just /D on cl?
Avatar
-D also works
23:28
yes
Avatar
@Learath2 gcc apparently also thinks so; seems like this might actually be something
Avatar
Avatar
heinrich5991
-D also works
they are the same
Avatar
da2da7b Fix editor hotkeys triggering while some editboxes are active - Robyt3 6cfdbd9 Handle editor input events in OnUpdate instead of OnRender - Robyt3 573d9ca Merge #6837 - bors[bot]
Avatar
Avatar
heinrich5991
@Learath2 gcc apparently also thinks so; seems like this might actually be something
I actually don't see it, weird
23:46
Maybe it's an indirect result of another rule because I took a look at all the sections that I think governs translation
Exported 734 message(s)