Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2024-02-03 00:00:00Z and 2024-02-04 00:00:00Z
Avatar
As suggested here, https://github.com/ddnet/ddnet/issues/7905#issuecomment-1924670295. I believe a toggle button makes more sense, as they are easier to hit and fits in more with the editor UI. Before !image After !image

Checklist

  • [x] Tested the change ingame
  • [x] Provided screenshots if it is a v...
Avatar
Avatar
meloƞ
INDEED 5€ ? i live in a town with 20K citizens, i pay almost 8
well, turkey kebab
01:23
gigachad
01:23
they built different fr
Avatar
chillerdragon BOT 2024-02-03 01:45:51Z
@MilkeeyCat: ddnet does not appreciate your insane coding skills. Don‘t worry they will get to know you. We the discord-irc team thank you for your amazing services! We could not have done it without you.
Avatar
ws-client BOT 2024-02-03 04:41:43Z
<ChillerDragon> htoprc is the greatest thing in the world
Avatar
ChillerDragon: is there any updated version of the ddnet 0.7 client besides the headless one? I've been using the 17.2.1 release to play vanilla as a usa player with eu players but I can't see votes, which I see is now crossed off on the list of bugs.
Avatar
ws-client BOT 2024-02-03 07:47:16Z
<ChillerDragon> woah @Krimp i did not expect anybody to actually use that how did you even hear of it :D
Avatar
e466ef5 Version 18.0 - def- d093c31 Update translations for upcoming DDNet 18.0 - def- 55e82e2 Update German translations - def- 8a5d164 Fix multiple editor undo/redo issues - archimede67 ed7b013 Update Swedish translations for 18.0 - furo321 f612688 Update russian.txt - gerdoe-jr 49ffdfe Update brazilian_portuguese.txt - rffontenelle e633bdb Update traditional_chinese.txt - By622 68a1bbb Update simplified_chinese.txt - By622 bda0855 Fix warning title being uninitialized in some cases - Robyt3 c3835dc Divide /tp into /tpxy and /tpto - gerdoe-jr c6537e7 /tpto -> /tp and /teleport - gerdoe-jr ce7060e Fix style - def- 6888f75 Update config_variables.h - k-i-o 0aa2e9f Update spanish.txt - n0Ketchp 0cba5c5 Fix countries/types filters excluding all servers - Robyt3 a5c8941 Version 18.0.1 - def- 3594eb4 Fix updater issue. Close #7867 - Learath2 5b83405 Version 18.0.2 - def- c750351 Scale angles using MousePos with zoom - furo321 90178f5 Fix client/server updates - Learath2 75934e1 Version 18.0.3 - def-
07:53
Avatar
I saw a vid you did of how to make a server dummy n make them do things n then saw the ddnet7 download thing after looking on github for a bit, its very helpful
Avatar
ws-client BOT 2024-02-03 08:05:17Z
<ChillerDragon> common github stalking W
08:05
<ChillerDragon> @Krimp windows user i assume?
08:07
<ChillerDragon> I made a new release extra for you heartw @Krimp
Avatar
chillerdragon thx 🥹
08:13
e141231 Scale angles using MousePos with zoom - furo321 f6d0939 Use toggle button instead of checkbox for "Sync envelope button". - furo321 739e104 Merge pull request #7863 from furo321/hookcoll-inaccurate - def- f7ceae5 Merge pull request #7910 from furo321/editor-sync-toggle - def-
Avatar
oh yeah windows user, thank u very much!!!
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
mmm
09:10
09:10
@TsFreddie take notes of ur weird lang
Avatar
old news
Avatar
A Simple, No Nonsense, Cross-Platform, Graphical User Interface for Neovim
09:20
it has cursor animations
09:20
which are impossible in a normal terminal
09:21
cuz terminals dont rly know what a cursor is
09:21
it makes following vim motions nice
Avatar
Avatar
Ryozuki
cuz terminals dont rly know what a cursor is
wdym? Terminals definitely know what a cursor is :O
10:04
I'm sure you could port that animated cursor to Alacritty or Kitty if you really wanted
Avatar
ws-client BOT 2024-02-03 10:09:27Z
<ChillerDragon> Yea implementing a shell and a terminal emulator is on my bucket list for sure. To fully understand who is responsible for what.
Avatar
რილია 2024-02-03 10:09:58Z
i made a function to convert hsla to int, but i think it's broken o_O this is the function int CSkyb::HSLAToInt(std::uint8_t H, std::uint8_t S, std::uint8_t L, std::uint8_t A)//convert hsla color to int { std::uint32_t color = 0; color += H; color += S * 0Xff; color += L * 0Xffff; color += A * 0Xffffff; return static_cast<int>(color); } it's giving me rainbow kinda effect when i call it this way. pPlayer->m_TeeInfos.m_ColorFeet = skyb.HSLAToInt(0,255, snum++, 0); note: sum goes 0 to 255 in loop.
10:10
can someone help ?
Avatar
We literally already have this in the code
Avatar
looks like you're not correctly scaling it (edited)
Avatar
Use ColorHSLA and the Pack function
Avatar
oh wait this is for ddnet - ah gg
Avatar
You also have the components all in the wrong places. Iirc we have our A on the MSB
10:16
Oh wait. Those are multiplications
Avatar
Avatar
რილია
i made a function to convert hsla to int, but i think it's broken o_O this is the function int CSkyb::HSLAToInt(std::uint8_t H, std::uint8_t S, std::uint8_t L, std::uint8_t A)//convert hsla color to int { std::uint32_t color = 0; color += H; color += S * 0Xff; color += L * 0Xffff; color += A * 0Xffffff; return static_cast<int>(color); } it's giving me rainbow kinda effect when i call it this way. pPlayer->m_TeeInfos.m_ColorFeet = skyb.HSLAToInt(0,255, snum++, 0); note: sum goes 0 to 255 in loop.
hm
10:17
I remember that
Avatar
Seems buggy because A * 0Xffffff is promoted to signed int, which can overflow. It should be A * 0Xffffffu to avoid any signed types in the calculation
Avatar
there is a mod do this
Avatar
Just use ColorHSLA::Pack, we already figured all this out for you 😄
Avatar
Avatar
Robyt3
Use ColorHSLA and the Pack function
რილია 2024-02-03 10:18:53Z
i couldn't get rgb effect with ColorHSLA and Pack, can some one give me the exact code ?
Avatar
Colors values are between 0.0f and 1.0f with our color functions
10:19
Not between 0-255
Avatar
Avatar
Robyt3
Colors values are between 0.0f and 1.0f with our color functions
რილია 2024-02-03 10:22:06Z
o_O
10:22
colors looks complicated
Avatar
Avatar
Robyt3
Colors values are between 0.0f and 1.0f with our color functions
But these are skin colors
Avatar
Avatar
Bamcane
But these are skin colors
For those he should use the Pack function
10:23
But he likely initializes the ColorHSLA with 0-255 values, which are out of range
Avatar
Avatar
Bamcane
here is a HSLAtoInt (for 0.7, but also be able to use for 0.6) (edited)
რილია 2024-02-03 10:24:09Z
by 0.6 you mean teeworlds and 0.7 DDNet ?
10:25
Teeworlds 0.7
Avatar
Avatar
Bamcane
Teeworlds 0.7
რილია 2024-02-03 10:26:10Z
is the page you gave me works with DDNet ?
Avatar
Avatar
რილია
is the page you gave me works with DDNet ?
Yes (only for player skin) (edited)
10:27
Those colors are in 0-255 values
10:29
What's the CNetMsg_Sv_CommandInfoGroupStart use for?
10:29
I only see it send on server
10:30
Did it just a way to tell developer "There is a group command"?
Avatar
This allows custom clients to understand when a list is complete, instead of relying on heuristics such as timeouts.
10:31
#7764
Avatar
This allows custom clients to understand when a list is complete, instead of relying on heuristics such as timeouts. Checklist Tested the change ingame Provided screenshots if it is a visual cha...
Avatar
Avatar
Robyt3
This allows custom clients to understand when a list is complete, instead of relying on heuristics such as timeouts.
But there isn't any things client to do
Avatar
Avatar
Scrumplex
wdym? Terminals definitely know what a cursor is :O
i dont think so i read it somewhere
Avatar
freebsd terminal has mouse support
10:52
epic
Avatar
hmm i read somewhere that making the motions neovide does is hard on a classic terminal
Avatar
Avatar
Jupstar ✪
freebsd terminal has mouse support
any terminal has mouse
10:52
oh wait
10:53
well vim has mouse support so most terms do
Avatar
Avatar
Ryozuki
any terminal has mouse
i mean the tty
Avatar
i dont have mouse support there
Avatar
kuhl
10:54
welcome to 2024
10:55
i hate smooth scrolling btw xd
10:55
on 240hz it's useless
Avatar
smooth scrolling here means its not line based
Avatar
ah ok
Avatar
i think its better than line based
10:56
u can follow lines easier
Avatar
i thought it scrolls smooth from line to line ^^
10:57
@Ryozuki have u ever written a custom serde serializer?
Avatar
yeah but nothing fully
10:57
why
Avatar
is it hard?
Avatar
shouldnt be hard as long as u can map well to the serde data model
Avatar
i kinda want to try out xd
10:57
do it
10:57
its fun
Avatar
Avatar
Robyt3
Seems buggy because A * 0Xffffff is promoted to signed int, which can overflow. It should be A * 0Xffffffu to avoid any signed types in the calculation
why im finding out you can add u literal to hex on ddnet discord, i never seen it mentioned on any resource i read 😭 (edited)
11:07
epic edlang ir
11:08
mod Main { fn main(argc: i32) -> i32 { let mut x: i32 = 2; x = 4; let y: i32 = other(2); return x; } fn other(a: i32) -> i32 { return a; } }
11:08
this is the program
Avatar
this looks even less readable than rustpepeW
Avatar
Avatar
Anime.pdf
this looks even less readable than rustpepeW
dude its a IR its not mean to be readable
11:08
its meant to be made so its easy to use on the codegen
Avatar
what IR stands for
Avatar
intermediate representation?
Avatar
will read okSanya
Avatar
Avatar
MilkeeyCat
intermediate representation?
yes
11:10
An intermediate representation (IR) is the data structure or code used internally by a compiler or virtual machine to represent source code. An IR is designed to be conducive to further processing, such as optimization and translation. A "good" IR must be accurate – capable of representing the source code without loss of information – and indepe...
11:10
a complex compiler goes like
11:11
source code -> lex / parse -> AST -> IR (there can be like diferent levels of ir, for instance, rust has THIR, HIR, MIR) -> codegen
11:12
Avatar
Avatar
Ryozuki
mod Main { fn main(argc: i32) -> i32 { let mut x: i32 = 2; x = 4; let y: i32 = other(2); return x; } fn other(a: i32) -> i32 { return a; } }
Rust but not rust
Avatar
@Learath2 yeah xd
11:13
when i got smth more solid ill deviate from this
Avatar
Bro is so addicted to rust his own language looks like rust
Avatar
dis website is so cool https://astexplorer.net/
An online AST explorer.
Avatar
Avatar
Ryozuki
i dont think so i read it somewhere
I use Kitty and if I go to insert mode, the cursor switches from a block to a line
11:15
It should be part of the xterm "standard"
11:15
all my code is free software u can find it here
11:15
agpl
11:16
the repo is a bit mess cuz im transitioning from ast -> codegen to ast -> ir -> codegen
11:16
11:16
totally not copying rustc structure
Avatar
Kitty neovim cursor stuff
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
when someone asks for ur homework and you tell them make it different so it doesnt look the same
Avatar
I just remembered that it also uses underline in replace mode (edited)
Avatar
Avatar
Scrumplex
Kitty neovim cursor stuff
i use alacritty
11:18
is kitty made with rust? no
11:19
thats the answer
11:19
gigachad
Avatar
Kitty has some nice features that Alacritty still doesnt have
Avatar
i hope alacritty uses vulkan someday
Avatar
like a proper image protocol and ligatures
11:19
i dont use em
11:19
xD
11:19
i dont even use alacritty vim mode
Avatar
Avatar
Scrumplex
like a proper image protocol and ligatures
I love ligatures though :O
Avatar
i dont
11:21
i like seeing exactly
11:21
what i type
11:21
its confusing af xd
Avatar
I'm not a ligature enjoyer either
Avatar
for rust they should add a fish
11:21
for ::<>
11:22
@Learath2 btw rust turbofish is made to avoid c++ mistake
Avatar
Who is a turbofish?
Avatar
c++ uses Vec<T>::xx
Avatar
rust requires
11:23
Vec::<T>::new()
11:24
The Vec<T>:: syntax is what C++ uses. why doesn't that work with Rust and requires such odd syntax (Vec::<T>::) ?
Avatar
Avatar
Scrumplex
Click to see attachment 🖼️
Images in terminal? What kinda blasphemy?
11:24
Because it means that the meaning of < depends on whether the preceding symbol refers to a template, or not, which requires either: A complex parsing algorithm, such as GLR. A parsing algorithm which mixes parsing and symbol look-up.
Avatar
Avatar
Learath2
Images in terminal? What kinda blasphemy?
The goal of this specification is to create a flexible and performant protocol that allows the program running in the terminal, hereafter called the client, to render arbitrary pixel (raster) graph...
Avatar
This isn't Kitty exclusive either. WezTerm and I think KDE's Konsole also support the protocol
Avatar
// check-pass // Bastion of the Turbofish // ------------------------ // Beware travellers, lest you venture into waters callous and unforgiving, // where hope must be abandoned, ere it is cruelly torn from you. For here // stands the bastion of the Turbofish: an impenetrable fortress holding // unshaking against those who would dare suggest the supererogation of the // Turbofish. // // Once I was young and foolish and had the impudence to imagine that I could // shake free from the coils by which that creature had us tightly bound. I // dared to suggest that there was a better way: a brighter future, in which // Rustaceans both new and old could be rid of that vile beast. But alas! In // my foolhardiness my ignorance was unveiled and my dreams were dashed // unforgivingly against the rock of syntactic ambiguity. // // This humble program, small and insignificant though it might seem, // demonstrates that to which we had previously cast a blind eye: an ambiguity // in permitting generic arguments to be provided without the consent of the // Great Turbofish. Should you be so naïve as to try to revolt against its // mighty clutches, here shall its wrath be indomitably displayed. This // program must pass for all eternity: forever watched by the guardian angel // which gave this beast its name, and stands fundamentally at odds with the // impetuous rebellion against the Turbofish. // // My heart aches in sorrow, for I know I am defeated. Let this be a warning // to all those who come after: for they too must overcome the impassible // hurdle of defeating the great beast, championed by a resolute winged // guardian. // // Here stands the Bastion of the Turbofish, a memorial to Anna Harren, // Guardian Angel of these Hallowed Grounds. <3 // See https://github.com/rust-lang/rust/pull/53562 // and https://github.com/rust-lang/rfcs/pull/2527 // and https://web.archive.org/web/20211010063452/https://twitter.com/garblefart/status/1393236602856611843 // for context. fn main() { let (the, guardian, stands, resolute) = ("the", "Turbofish", "remains", "undefeated"); let _: (bool, bool) = (the<guardian, stands>(resolute)); }
11:25
this is a rustc test
Avatar
Avatar
Ryozuki
Because it means that the meaning of < depends on whether the preceding symbol refers to a template, or not, which requires either: A complex parsing algorithm, such as GLR. A parsing algorithm which mixes parsing and symbol look-up.
Hm, what is the other meaning of <T> in C++?
Avatar
any type
11:28
its using a templated type
11:28
or wahtever
11:28
like u got a generic class
Avatar
Oh, I just saw it in the reddit post, it can be interpreted as less than T greater than ...
Avatar
I was wondering what the parsing ambiguity was
Avatar
in c++ to solve this
11:28
they do like complex af parsing
11:28
and symbol lookup
11:28
iirc
11:29
A GLR parser (generalized left-to-right rightmost derivation parser) is an extension of an LR parser algorithm to handle non-deterministic and ambiguous grammars. The theoretical foundation was provided in a 1974 paper by Bernard Lang (along with other general Context-Free parsers such as GLL). It describes a systematic way to produce such algor...
11:29
A complex parsing algorithm, such as GLR. A parsing algorithm which mixes parsing and symbol look-up.
Avatar
Is rust even parsable by just an LR parser?
Avatar
iirc yes
11:30
hm i wonder xd
11:31
rust-analyzer uses a hand-written recursive descent / Pratt parser
(edited)
Avatar
So it is LR huh cool
Avatar
An operator-precedence parser is a simple shift-reduce parser that is capable of parsing a subset of LR(1) grammars. More precisely, the operator-precedence parser can parse all LR(1) grammars where two consecutive nonterminals and epsilon never appear in the right-hand side of any rule.
Avatar
Actually I remember rust-analyzer having some trouble with some rust. I wonder if they use an LR parser but the language as defined isn't LR
11:41
In other news I'll be trying out C++20 coroutines today
Avatar
i just updated client to latest and instantly regretted
Avatar
rip Konsti
Avatar
how do i find servers that are neither kog or ddnet now?
Avatar
its all under the globe, you disable the filters on the right, at the left tab | on update, the DDRaceNetwork community filter is on by default (edited)
Avatar
Include "None" in your community filter
Avatar
xd thanks i found it
12:33
unfair to check that by default
Avatar
well it IS the ddracenetwork client, so i find it okay either way to have it automatically checked tbh
12:36
but it can be confusing as to why you dont see other servers on startup - true
Avatar
"None" is disabled by default?
Avatar
e5ad570 Add 100 € funding for ddnet.org by archimede67 - def-
poggers2 5
poggers 5
Avatar
@archimede67 Thanks! ^
owo 1
Avatar
Quads do not snap to the correct grid point at the lowest grid size. This only happens along the y-axis but not the x-axis. !2024-02-03 13-57-27
Avatar
AAAAAA coroutines are soo cool
13:08
They just need some STL support for them to be very usable, but even by hand they are not too bad, and so flexible too
13:08
I hope the performance isn't god awful
13:12
should i implement short circuit for ifs etc
13:12
sounds pain
13:14
i see it puts and and or in a diferent way at the ast level
Avatar
Avatar
Ryozuki
should i implement short circuit for ifs etc
you have to, it would be very meh without
Avatar
ws-client BOT 2024-02-03 13:32:08Z
<ChillerDragon> Konsti still here?
Avatar
ChillerDragon BOT 2024-02-03 13:32:27Z
ah rip rat gone
Avatar
Avatar
Ryozuki
shouldnt be hard as long as u can map well to the serde data model
unfortunately the serde data model lacks fixed-size byte arrays: https://github.com/serde-rs/serde/issues/2120
Summary Add new methods to Serializer, Deserializer, and Visitor to support cases where a binary format can take advantage of the fact that a byte slice has a fixed size. Background uuid-rs/uuid#55...
Avatar
Avatar
GitHub
Click to see attachment 🖼️
@archimede67 WTF
wtf 1
Avatar
the meat is the gen_steps function?
13:54
the rest is helper code?
Avatar
Avatar
Learath2
does the compiler to a transform into a state machine?
Avatar
Avatar
heinrich5991
the meat is the gen_steps function?
Yes, the rest is just boilerplate only because the stl doesn't come with helpers yet, easily can be made generic
Avatar
Avatar
heinrich5991
does the compiler to a transform into a state machine?
Hm, I don't think that's the case with this kind of stackless coroutine
Avatar
yea, seems like a lot of overhead right now
Avatar
Avatar
Learath2
Hm, I don't think that's the case with this kind of stackless coroutine
is there a different option?
14:04
I think rust/C# compile stuff like that into state machines
Avatar
Oh, I just took a look at what's generated and yeah it does seem to be a state machine
14:10
C++23 is bringing std::generator the first stl template that wraps coroutines, with that you'll just have to do std::generator<int> gen_steps(int start, int end, int stride = 1) { for(int i = start; i < end; i += stride) co_yield i; }
Avatar
that looks like dynamic dispatch
14:11
is it?
Avatar
Huh, why?
Avatar
std::generator<int>
14:11
there's nothing unique about this type
14:12
like std::function is also dynamic dispatch
Avatar
There is no type erasure here though, why would there be dynamic dispatch?
14:13
Specialized on int it'd look about exactly like what I wrote with an implementation for std::generator<T>::iterator so you can use range based for loops
Avatar
Avatar
Learath2
There is no type erasure here though, why would there be dynamic dispatch?
how can there be no type erasure?
14:14
the type std::generator<int> mentions nothing about this particular function
14:14
i.e. it looks like it's the same type for all generators returning int
14:14
am I missing something?
Avatar
Oh, yep it's exactly the same for every generator that returns int
14:15
but why does that imply dynamic dispatch anywhere?
Avatar
sooo, it needs to have a function pointer to advance to the next element?
Avatar
rust async can do static dispatch right?
Avatar
making it dynamic dispatch
Avatar
Avatar
Ryozuki
rust async can do static dispatch right?
yes
Avatar
iirc it requires object safe
14:16
whivh is why u need to box some stugg
14:16
stuff
14:16
omg mobile
Avatar
dynamic dispatch needs object safety
Avatar
good morning
14:17
try cppcoro
Avatar
try edlang
14:17
available soon
Avatar
Avatar
heinrich5991
sooo, it needs to have a function pointer to advance to the next element?
Would that even really be considered dynamic dispatch? Which implementation of resume() gets called is completely determined at compile time
Avatar
with short circuit
Avatar
Avatar
Ewan
try cppcoro
Yeah already saw it, I wanted to see what Core is capable of for now
Avatar
i feel sick but idk why
Avatar
Avatar
Learath2
Would that even really be considered dynamic dispatch? Which implementation of resume() gets called is completely determined at compile time
every time a function pointer is involved, it's dynamic dispatch, no?
14:20
for performance considerations
Avatar
I am unsure, idk if there is an official definition we can refer to, but for me picking which function to call at runtime is the characteristic of dynamic dispatch
Avatar
I see
14:21
I wanted to say that this is as much dynamic dispatch as passing an std::function, even if it's a constant
Avatar
but I was wrong about there being no type erasure to begin with, generators hold a std::coroutine_handle<> erasing the promise type
14:25
I wonder how well current compilers can see through this to optimize, what I wrote should be optimized out to just a for loop
14:30
https://godbolt.org/z/ef8xj87cb atleast clang is pretty good at it 😄
struct CT { struct promise_type; using handle_type = std::coroutine_handle<promise_type>; struct promise_type { int m_Value; CT get_return_object() { return CT{ handle_type::from_promise(*this) }; } std::suspend_never initial_suspend() { return {}; } std::suspend_always final_suspend() noexcept { return {}; } std::suspend_always ...
14:30
Though I did have to suggest inline to it
Avatar
Avatar
Learath2
I am unsure, idk if there is an official definition we can refer to, but for me picking which function to call at runtime is the characteristic of dynamic dispatch
my oficial def is if the llvm call is indirect or not
Avatar
gcc is godawful at it
Avatar
llvm ir
Avatar
It has been a while since I've seen gcc fumble so badly against clang
Avatar
im at gym owo
14:36
this basement looking thing has no Internet and no wifi
14:36
u gotta go to a spot to get better Signal
14:36
xd
Avatar
MSVC is even worse, I guess until they both improve using coroutines in anything serious is out of question
14:40
tldr: use rust
Avatar
one day
14:43
if u wanna do async u almodt
14:43
almost always
14:44
wanna use erlang or elixir
Avatar
Anyway, enough messing around, it is time to learn some vulkan
Avatar
or gleam
14:44
gleam uses BEAM too but is rust like
14:44
i need to learn it
Avatar
I wonder what performance and the ecosystem is like for these more exotic languages
Avatar
they literally made for async
14:45
the lang itself is a actor system
Avatar
One of the biggest charms of using C++, Rust, Java, JS, Python is that the performance characteristics are very well known
Avatar
its fault tolerant
14:45
whatsapp uses erlang
14:46
u should learn it
14:46
i need to too
Avatar
It at the very least sounds cool
Avatar
my company uses erlang elixir for distributed, and to call cpu bound programs made in rust (edited)
14:46
and rust for making VMs and cpu bound stuff
14:47
also BEAM allows full introspection
14:47
to memory, tasks etc
Avatar
I wonder if gleam has erlang ffi seeing as they run on the same vm
Avatar
and u can kill stugg
14:47
stuff
14:47
since its preemptive
14:47
and update live code
Avatar
Avatar
Ryozuki
also BEAM allows full introspection
e.g. this would make me worry about performance characteristics of the language
Avatar
this is why u dont use it for cpu bound dtut
14:48
stuff
Avatar
Introspective capabilities usually come with a medium to large performance hit
Avatar
its for managinh tasks
14:48
high level async
Avatar
Avatar
Ryozuki
its for managinh tasks
Hm, and if a task needs to be highly performant you just spawn something native to take care of it?
14:49
for most apps
14:49
the bottleneck is internet
14:49
not cpu
14:49
i/o
14:49
beam world across computers
14:50
its a shared vm
14:50
works
14:50
my phonenis so broken
Avatar
Avatar
Learath2
Hm, and if a task needs to be highly performant you just spawn something native to take care of it?
yes
14:50
my company made a game engine backend in elixir
Avatar
It does sound interesting, I might check it out later
Avatar
it calls rust for some stugf
14:50
like physixs
14:50
server side i mean
Avatar
Avatar
Ryozuki
my company made a game engine backend in elixir
What does a game engine backend imply?
Avatar
managinh lobbies and each lobby itself
14:51
scoreboards
Avatar
ok, it's vk time, cya
Avatar
obligatory "anyone else at FOSDEM?" ^^
14:53
@Ryozuki lots of gpl enjoyers here
Avatar
@Patiga idk if fossdem but probs ccc
14:54
what time is fossdem
Avatar
fosdem is rn and tomorrow
Avatar
ah rip
14:55
@Patiga check the llvm talks
14:55
poggers2
Avatar
you wanna find co-workers? :p
14:56
im just interested in llvm itself
14:56
i got a nice project idea
Avatar
a llvm ir bitcode builder in rust
14:56
so u dont need to use llvm until u wanna convert the bitcode
14:57
but its a rly bit project
14:57
stallman is not at fosdem right?
14:57
i have a coworker who is into gpl too
14:57
he met stallman
😃 1
14:57
and has a pic
Avatar
ryo ur company stuff sounds rly cool
Avatar
Avatar
Ryozuki
and has a pic
when send pic
Avatar
this coworker is my tech lead
15:00
xd
15:01
he is in the rust-lang github team
15:01
(which is big tho)
15:04
NekoDrink
🎉 6
Avatar
are u gonna do it
15:26
based on only the 2 sentences
15:26
gotta know more
15:27
i like my current place but if i do same stuff and better pay i may think it
Avatar
Avatar
Ryozuki
NekoDrink
ryochad
Avatar
Avatar
Ryozuki
he met stallman
poor kid
Avatar
რილია 2024-02-03 16:20:31Z
i just tried ddnet editor after one year, it was awesome, nice job whoever done it
Avatar
today is a good day
Avatar
რილია 2024-02-03 16:25:46Z
where is the code that when you are freeze, game gives you ninja skin ? can i change it ?
16:27
i seen it somewhere but i can't remember
Avatar
Avatar
რილია
where is the code that when you are freeze, game gives you ninja skin ? can i change it ?
რილია 2024-02-03 16:33:29Z
btw, i only want to change server side stuff not client side
Avatar
I've noticed RAII is kinda annoying to do when you have exceptionphobia like me
Avatar
in what way?
16:35
haven't noticed it in rust, at least
Avatar
c++ exceptions kek
Avatar
Failing in a constructor or a destructor is um impossible-ish
Avatar
Avatar
Learath2
Failing in a constructor or a destructor is um impossible-ish
do it like in rust. never do work in a constructor. do the work in a static member function
Avatar
well in rust a drop cant return a result but u can panic
Avatar
Avatar
რილია
where is the code that when you are freeze, game gives you ninja skin ? can i change it ?
რილია 2024-02-03 16:36:40Z
never mind i found it
Avatar
and resources failing to clean up is really something
Avatar
5378fdc Set correct size of name column in SQL table - furo321 78bd497 Merge pull request #7909 from furo321/set-correct-name-size - heinrich5991
Avatar
Avatar
heinrich5991
do it like in rust. never do work in a constructor. do the work in a static member function
Well, problem is what would I return if I failed?
Avatar
damn debug info asking for taxes
16:37
kek
Avatar
Avatar
Learath2
Well, problem is what would I return if I failed?
you can either use std::variant or use the C++ pattern where every object has an empty state
Avatar
I could have a bool Init like I would in C
Avatar
you kinda need to have that C++ pattern anyway because of move constructors
16:38
I find that really bad 😦
Avatar
Anyway, I've avoided exceptions for far too long, I'll just try to make peace with them 😄
Avatar
I don't like that exceptions are essentially untyped
Avatar
dwarfsourcelanguage
16:39
what should i put here for my language lol
Avatar
edlang?
16:39
its a static enum
16:40
unfair
Avatar
I don't like code-as-picture
16:40
can you send a link? 🙂
Avatar
Avatar
heinrich5991
I don't like that exceptions are essentially untyped
I don't like exceptions in general, too heavy
16:40
here
Avatar
if I was allowed to take only one thing from rust for a hypothetical language I'd take Result
Avatar
I guess you could just choose a new value? @Ryozuki
Avatar
the builder accepts the enum
16:41
i guess ill just use rust
Avatar
could also check what nim does
Avatar
or maybe i should do c17
16:41
does nim use llvm?
Avatar
Avatar
Ryozuki
does nim use llvm?
doesn't nim generate C?
Avatar
ah. apparently nim compiles to C/C++/JS
16:43
Note: Issue 210419.1 introduced a way to separately specify languages and versions, which is expected to be adopted for DWARF Version 6. See DWARF Version 6 Languages and Version Codes for the new codes.
Avatar
g.dcu = d.dIBuilderCreateCompileUnit( DWARFSourceLanguageC99, df, "nlvm", 4, isOptimized, flags, flags.len.csize_t, runtimeVer, "", 0, DWARFEmissionFull, 0, False, False, nil, 0, nil, 0) (edited)
16:44
there is a nim compileri n llvm
16:44
they use c99
16:44
ill put c17 xd
Avatar
Avatar
Ryozuki
u gotta go to a spot to get better Signal
u gotta gym in the gym and discord at home 🙂
Avatar
what does it affect?
Avatar
Avatar
Chairn
u gotta gym in the gym and discord at home 🙂
i check discord when i rest
Avatar
Avatar
heinrich5991
what does it affect?
i wonder idk
Avatar
does it affect what syntax gdb uses for print etc commands?
16:45
if so, rust would probably be better
16:46
since your language looks like rust (edited)
Avatar
Avatar
Ryozuki
NekoDrink
is that on discord 😄 ?
Avatar
Avatar
Chairn
is that on discord 😄 ?
linkedin
Avatar
I still don't have a linkedin account
16:48
maybe one should
Avatar
someone kows what dwo_id is
Avatar
even @Ryozuki has one 😮
Avatar
in dwarf
16:48
@heinrich5991 ofc i have one
16:48
its how i found my job
Avatar
Avatar
Ryozuki
i check discord when i rest
rest at home then, you gotta optimize your workout 😛
Avatar
``` src/game/client/components/infomessages.h:25:9: runtime error: load of value 3051338992, which is not a valid value for type 'EType' #0 0x55fec3dd1edd in CInfoMessages::CInfoMsg::CInfoMsg(CInfoMessages::CInfoMsg const&) src/game/client/components/infomessages.h:25 #1 0x55fec3dbc262 in CInfoMessages::OnMessage(int, void) src/game/client/components/infomessages.cpp:352 #2 0x55fec4368f1a in CGameClient::OnMessage(int, CUnpacker, int, bool) src/game/client/gameclient.cpp:850...
Avatar
The value in the dwo_id field of the unit header for this unit is the same as the6 value in the dwo_id field of the unit header of the corresponding full7 compilation unit (see Section 7.5.1 on page 199).8 The means of determining a compilation unit ID does not need to be similar or related9 to the means of determining a type unit signature. However, it should be suitable for10 detecting file version skew or other kinds of mismatched files and for looking up a full11 split unit in a DWARF package file (see Section 7.3.5 on page 190).
Avatar
Avatar
Chairn
rest at home then, you gotta optimize your workout 😛
i mean the 1 min rest between sets xd
Avatar
i don't know, i don't go to gym
Avatar
Avatar
Chairn
i don't know, i don't go to gym
u can do strenous exercise for a bit but then u gotta rest, 1 min is kind of the standard
Avatar
Avatar
Ryozuki
u can do strenous exercise for a bit but then u gotta rest, 1 min is kind of the standard
I Rest until my Body feels fit enough to Continue, im still resting from my Set from over 3 years ago
Avatar
Avatar
Ryozuki
@heinrich5991 ofc i have one
should I also get one?
Avatar
its nice having a "this is me" page ngl
Avatar
Avatar
heinrich5991
should I also get one?
i would say yes if u wanna find a job, or maybe with a local german job website its enough
17:15
but specially if u want a international company to find u
17:15
i think in europe job hunting is mostly done in linkedin
17:15
that said
17:15
its a big privacy loss
Avatar
@TsFreddie when u in the photoshoot mode and u shoot a sg it will do sg color laser for 1 frame then it turns laser/rifle color
Avatar
Avatar
meloƞ
its nice having a "this is me" page ngl
My personal website.
Avatar
Avatar
meloƞ
its nice having a "this is me" page ngl
this is me btw
Avatar
i've read through this one!
17:16
i didnt understand 80% of it!
Avatar
which one
Avatar
intro to LLVM and MLIR with Rust and Melior
Avatar
Avatar
Ewan
@TsFreddie when u in the photoshoot mode and u shoot a sg it will do sg color laser for 1 frame then it turns laser/rifle color
i forgot to add video
Avatar
looks cool
Avatar
does look pretty cool
Avatar
quick question, is there a reason we are still defaulting cl_skin_download_url to https://skins.ddnet.org/skin ? there are proxy's that either include more custom skins by default, or query skins from multiple db's (taking Scrumplex's proxy as an example: https://skins.Scrumplex.net/skin (edited)
18:18
or is it more of a "this one works for certain so we are using this" ?
Avatar
Avatar
meloƞ
quick question, is there a reason we are still defaulting cl_skin_download_url to https://skins.ddnet.org/skin ? there are proxy's that either include more custom skins by default, or query skins from multiple db's (taking Scrumplex's proxy as an example: https://skins.Scrumplex.net/skin (edited)
Quality over quantity
Avatar
Avatar
meloƞ
quick question, is there a reason we are still defaulting cl_skin_download_url to https://skins.ddnet.org/skin ? there are proxy's that either include more custom skins by default, or query skins from multiple db's (taking Scrumplex's proxy as an example: https://skins.Scrumplex.net/skin (edited)
the default is intentionally limited/curated
Avatar
ah okay - thanks
Avatar
there's a skins proxy monkaSmonkaS
18:25
wanted that for so long
18:25
didnt know it was real
18:25
is scrumplex's gonna be slow
Avatar
Avatar
meloƞ
or is it more of a "this one works for certain so we are using this" ?
i think it's intended that you use cl_skin_community_download_url for that
Avatar
tfw can't get a move_iterator out of istream_iterator pepeW
Avatar
why would u
Avatar
Because it won't optimize properly, copy elision isn't enough it seems
Avatar
Suggested by Arrow on Discord. This would be more convenient than using the chat or opening a separate website to view the ranks. I don't think it needs a HUD that's shown while playing. A ...
19:08
time flies
19:08
i decided to just use llvm and not mlir for edlang
Avatar
@-StormAx your time to shine
Avatar
Avatar
Ryozuki
i decided to just use llvm and not mlir for edlang
why
Avatar
@Ewan so i do it different from work
19:08
xd
Avatar
Avatar
meloƞ
@-StormAx your time to shine
How you want me to do?
Avatar
; ModuleID = 'Main' source_filename = "simple.ed" target triple = "x86_64-unknown-linux-gnu" define private i32 @main(i32 %0) { entry: %"0" = alloca i32, align 4 %"1" = alloca i32, align 4 store i32 %0, ptr %"1", align 4 %"2" = alloca i32, align 4 br label %block_0 block_0: ; preds = %entry store i32 2, ptr %"2", align 4 store i32 4, ptr %"2", align 4 %1 = load i32, ptr %"2", align 4 store i32 %1, ptr %"0", align 4 %2 = load i32, ptr %"0", align 4 ret i32 %2 } !llvm.dbg.cu = !{!0} !0 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !1, producer: "edlang", isOptimized: true, runtimeVersion: 1, emissionKind: FullDebug, splitDebugInlining: false, sdk: "edlang-sdk") !1 = !DIFile(filename: "simple.ed", directory: "programs")
Avatar
remake stats page but do it dedicated
Avatar
mod Main { fn main(argc: i32) -> i32 { let mut x: i32 = 2; x = 4; return x; } }
19:09
my program xd
19:09
.text .file "simple.ed" .p2align 4, 0x90 .type .Lmain,@function .Lmain: .Lfunc_begin0: .cfi_startproc movl $4, %eax movl %edi, -8(%rsp) movl $4, -12(%rsp) movl $4, -4(%rsp) retq .Lfunc_end0: .size .Lmain, .Lfunc_end0-.Lmain .cfi_endproc .section ".note.GNU-stack","",@progbits
19:09
the assembly :o
Avatar
Avatar
meloƞ
remake stats page but do it dedicated
Currently working on different things
Avatar
Avatar
Ryozuki
@Ewan so i do it different from work
free will is cool
19:11
ah ye
19:14
edlang on  master [$✘!] via 🦀 v1.75.0 ❯ ./target_ed/simple edlang on  master [$✘!] via 🦀 v1.75.0 ❯ echo $? 4
19:14
epic
19:15
the ir made codegen so stupidly simple
19:15
but well the meat is in the lowering
19:15
the what
19:15
lowering
19:15
when u go from ast to ir
19:15
its called lowering
Avatar
r u on linux?
19:18
well u need llvm 17
19:19
git clone git@github.com:edg-l/edlang.git cd edlang cargo r -- programs/simple.ed ./target_ed/simple
Avatar
Avatar
-StormAx
How you want me to do?
the rank table
19:20
i have the scripts
19:20
just need to be adapted to ddnet
19:21
Well, i would try
Avatar
Avatar
-StormAx
Ooof
ill send it to you
Avatar
Avatar
Ryozuki
r u on linux?
i am not
19:59
i was reconsidering doing it again last night tho
19:59
i see people's riced out i3 desktops and i get weak at the knees
19:59
i just hate that linux and windows are so polarizing (at least for desktop)
Avatar
you might hang out in the wrong circles
20:00
for most people I know, the choice of the OS is not polarizing
20:01
I guess it's different on this discord :/
Avatar
this is the only place i get shit for running windows
20:02
idk why we are harboring toxic mentality when it comes to software
20:02
i notice ppl are generally very uppity about proprietary software
20:02
in this channel
20:03
that sort of mindset is exactly why many of the few who are anti-OSS are the way they are
20:03
they hate the preachy elitist mentality
Avatar
that seems weird as well
Avatar
astonishing how such a great idea can have a bad stigma
Avatar
not liking OSS because people have too strong opinions on it
Avatar
Avatar
Ewan
that sort of mindset is exactly why many of the few who are anti-OSS are the way they are
no, they deciding to be anti oss because they dont care about foss
Avatar
Avatar
Ewan
astonishing how such a great idea can have a bad stigma
I haven't heard it having a stigma tbh. is that a US thing?
Avatar
it's a some people thing
20:04
also high expectations for code maintenance is a big turn off
Avatar
Avatar
Ewan
astonishing how such a great idea can have a bad stigma
its more that windows ppl hate linux without even trying, and say windows is better without even trying
20:04
so u grow annoyed of such ignorance
Avatar
cool but i don't remember expressing anything like that a single time in here
20:05
and i still get shit for it
Avatar
Avatar
Ewan
also high expectations for code maintenance is a big turn off
hm? I think you're generally allowed to dump your code as OSS without maintenance being expected
Avatar
Avatar
Ewan
that sort of mindset is exactly why many of the few who are anti-OSS are the way they are
im kinda anti OSS too, im pro FOSS
Avatar
well from what i remember reading one of the big reasons avo won't go oss is not because there's anything super valuable to them that they want to keep private in their code, it's that he thinks there is an expectation of maintenance
20:06
also have heard this from another dev directly
20:06
i doubt it's an uncommon sentiment
Avatar
Avatar
Ryozuki
im kinda anti OSS too, im pro FOSS
you know we are talking about the same thing
Avatar
Avatar
Ewan
well from what i remember reading one of the big reasons avo won't go oss is not because there's anything super valuable to them that they want to keep private in their code, it's that he thinks there is an expectation of maintenance
its just an excuse imho
20:06
i like to quote this again
Avatar
Avatar
Ryozuki
im kinda anti OSS too, im pro FOSS
open-source is the same as FOSS
Avatar
Avatar
heinrich5991
open-source is the same as FOSS
no it isnt
Avatar
technically speaking no but for the sake of this convo yes
Avatar
yes. they literally created the term open-source to say exactly what GNU says on that website
Avatar
Not all of the users and developers of free software agreed with the goals of the free software movement. In 1998, a part of the free software community splintered off and began campaigning in the name of “open source.” The term was originally proposed to avoid a possible misunderstanding of the term “free software,” but it soon became associated with philosophical views quite different from those of the free software movement. Some of the supporters of open source considered the term a “marketing campaign for free software,” which would appeal to business executives by highlighting the software's practical benefits, while not raising issues of right and wrong that they might not like to hear. Other supporters flatly rejected the free software movement's ethical and social values. Whichever their views, when campaigning for open source, they neither cited nor advocated those values. The term “open source” quickly became associated with ideas and arguments based only on practical values, such as making or having powerful, reliable software. Most of the supporters of open source have come to it since then, and they make the same association. Most discussion of “open source” pays no attention to right and wrong, only to popularity and success; here's a typical example. A minority of supporters of open source do nowadays say freedom is part of the issue, but they are not very visible among the many that don't. The two now describe almost the same category of software, but they stand for views based on fundamentally different values. For the free software movement, free software is an ethical imperative, essential respect for the users' freedom. By contrast, the philosophy of open source considers issues in terms of how to make software “better”—in a practical sense only. It says that nonfree software is an inferior solution to the practical problem at hand.
Avatar
we are all familiar with the difference between oss and foss
20:08
the thing is we do not care
Avatar
i care
20:08
so im posting it again
20:08
im not breaking any rule
Avatar
Avatar
Ryozuki
im not breaking any rule
it's always a bad sign when you think that posting this message makes things better
Avatar
Avatar
heinrich5991
it's always a bad sign when you think that posting this message makes things better
ok, i dont care
Avatar
as far as i understand this sort of strictness in terms is only a thing because the FSF made it different term just to promote and exemplify what they do
20:09
created solely to promote elitism
Avatar
Avatar
Ewan
created solely to promote elitism
no it promotes a ideal, open source doesnt
20:09
its the main difference
Avatar
I'll move to DMs with @Ryozuki about this so that it doesn't derail the actual discussion
Avatar
i also dislike how u will say anything is elitism now
20:10
its like a argument u can simply not argue, because u can always say its elitism
Avatar
Avatar
Ewan
as far as i understand this sort of strictness in terms is only a thing because the FSF made it different term just to promote and exemplify what they do
strictness in terms is necessary to not confuse people when discussing highly controversial and/or technical stuff
Avatar
ive thought that i can just move file here and there make new configs and everything will work as before. oh boy how wrong was i
Avatar
there is people who care about free software that upholds user rights and use licenses such as gpl then therei s people who make code with the source code available and say: do anything u want
20:12
its the difference
Avatar
Avatar
MilkeeyCat
ive thought that i can just move file here and there make new configs and everything will work as before. oh boy how wrong was i
context? xD
Avatar
Hello, can you tell me how I can get clientId for my dummy?
Avatar
Avatar
Ryozuki
context? xD
i opened that bitch 10 times in rust project
20:13
its not in da mood to work
Avatar
Avatar
MilkeeyCat
ive thought that i can just move file here and there make new configs and everything will work as before. oh boy how wrong was i
i think ur rust analyzer is broken or smth
Avatar
i dont think its good justatest
Avatar
Avatar
MilkeeyCat
i dont think its good justatest
you should only have either rustup or a distro rust installed
Avatar
Avatar
heinrich5991
you should only have either rustup or a distro rust installed
i know
20:14
but it worked before xD
Avatar
you should probably uninstall the distro one
Avatar
hein u use fish right
Avatar
Avatar
TheNofis
for
it's in m_aLocalIDs, I think
Avatar
Avatar
TheNofis
Hello, can you tell me how I can get clientId for my dummy?
You can use m_aLocalIDs[!g_Config.m_ClDummy], remember to also check if you're dummy connected before doing this otherwise you will get a segfault I think.
Avatar
Avatar
MilkeeyCat
i dont think its good justatest
i just add some shit to path and it works :clueless:
Avatar
Avatar
MilkeeyCat
i just add some shit to path and it works :clueless:
it works now, ez clap. didnt even take few weeks
Avatar
Avatar
furo
You can use m_aLocalIDs[!g_Config.m_ClDummy], remember to also check if you're dummy connected before doing this otherwise you will get a segfault I think.
ty <3
Avatar
Support adding up to three communities as favorites in the server browser. Favorites can be changed with favorite buttons which are shown in the community filter on the Internet and Favorites tabs. The commands add_favorite_community and remove_favorite_community are added to change the favorite communities via the console and for saving the favorite communities to the config file. For the favorite communities, additional tabs using the communities' icons are shown in the server browser n...
Avatar
Avatar
TheNofis
for
Snap will cut dummy position info when you will be too far
Avatar
Previously the labels would get squished even though a lot of space was available. Before: !before After: !after

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 te...
Avatar
There is no simple way to read a file into an std::vector<char> without the stl forcing you to zero initialize the entire vector
22:14
I'm starting to remember why I was sticking to C
Avatar
is this an update that caused the switch numbers to be so absurdly small?
Avatar
what is your cl_text_entities_size
22:15
i dont think i ever changed that
Avatar
default is 100
Avatar
ohh thanks
22:16
i dont know how it got changed
Avatar
Avatar
Learath2
There is no simple way to read a file into an std::vector<char> without the stl forcing you to zero initialize the entire vector
probably don't do a vector of chars then
22:18
use another flexible buffer
22:18
or an stl type which wraps a raw buffer
22:18
std data
Avatar
Avatar
Ewan
use another flexible buffer
You'd have to write your own as the stl doesn't contain any other dynamic array
Avatar
well why would you want to use it this way
22:19
i think sane ppl would create an intermediate buffer
Avatar
And add an extra copy for the lulz?
Avatar
I love how the new generation treats code
Avatar
use std::mem::MaybeUninit; // Create an uninitialized array of `MaybeUninit`. The `assume_init` is // safe because the type we are claiming to have initialized here is a // bunch of `MaybeUninit`s, which do not require initialization. let mut data: [MaybeUninit<String>; 1000] = unsafe { MaybeUninit::uninit().assume_init() }; // Count the number of elements we have assigned. let mut data_len: usize = 0; for elem in &mut data[0..500] { elem.write(String::from("hello")); data_len += 1; } // For each item in the array, drop if we allocated it. for elem in &mut data[0..data_len] { unsafe { elem.assume_init_drop(); } } with rust ucan have partially initialized arrays
Avatar
The correct argument to be made there was that IO dwarfs the zero initialization anyway, that's what the rust people do, you should learn from them
Avatar
Avatar
Learath2
The correct argument to be made there was that IO dwarfs the zero initialization anyway, that's what the rust people do, you should learn from them
well, it is kind of true
22:23
most stuff is io bound
Avatar
It's definitely true, doesn't mean I'm not annoyed at seeing 0s written just to be overwritten immediately 😄
22:25
edlang will have it easy
22:25
gigachad
22:25
but no C strings
22:25
i have em
22:25
but on the other hand it makes C interop harder
22:25
but meh
Avatar
I wonder if rust can do it with a Vec of maybeuninit
Avatar
Avatar
Learath2
I wonder if rust can do it with a Vec of maybeuninit
i think u can
22:26
vec has a "reserve"
22:26
wait
Avatar
Avatar
Ryozuki
but on the other hand it makes C interop harder
Do the nim compromise, have both the length and zero termination
Avatar
does it make sense to use a Vec of maybeuninit?
22:26
vec internally keeps track of a capacity
22:26
and the unpushed values are uninit
22:26
u mean Array right
Avatar
Avatar
Learath2
Do the nim compromise, have both the length and zero termination
no because i get to ensure zero termination which is what i dislike
Avatar
Oh true, so the only issue is having to push the characters one by one, even if it doesn't allocate it's far less efficient than copying in blocks like memcpy
22:28
Honestly a non issue, but something so simple in C being very annoying to get right in these languages is quite entertaining
Avatar
Avatar
Learath2
Oh true, so the only issue is having to push the characters one by one, even if it doesn't allocate it's far less efficient than copying in blocks like memcpy
i htink u can mimic that
22:29
with the Write trait
22:29
and WriteBuffer
22:29
use a Cursor
22:29
A Cursor wraps an in-memory buffer and provides it with a Seek implementation.
22:29
cursor + bufwriter
22:29
the inner buffer can be a vec
Avatar
Write is implemented for Vec<u8> by appending to the vector. The vector will grow as needed. oh this is cute
Avatar
rust is nice
Avatar
Rust 1, C++ 0
Avatar
Avatar
Learath2
Write is implemented for Vec<u8> by appending to the vector. The vector will grow as needed. oh this is cute
where is this doc from
Avatar
Well you can technically do it in C++ too but you need to pass a custom allocator that blocks the value initialization
Avatar
Avatar
Ryozuki
where is this doc from
A contiguous growable array type, written as Vec, short for ‘vector’.
22:31
self.extend_from_slice(buf);
22:31
it does this internally
22:31
A contiguous growable array type, written as Vec, short for ‘vector’.
Avatar
Avatar
Ryozuki
it does this internally
Clones and appends all elements in a slice to the Vec. Iterates over the slice other, clones each element, and then appends it to this Vec.
nvm, uncool
Avatar
Avatar
Learath2
Clones and appends all elements in a slice to the Vec. Iterates over the slice other, clones each element, and then appends it to this Vec.
nvm, uncool
this is the specialization for slices
22:32
u want to use .extend for non cloning i guess
22:33
it cant take ownership of a slice values
22:33
#[inline] fn write(&mut self, buf: &[u8]) -> io::Result<usize> { self.extend_from_slice(buf); Ok(buf.len()) }
22:33
cloning a u8 is nothing
22:33
its a copy
Avatar
Cloning them one by one is not the best, I guess as long as the optimizer is smart enough to notice it's dozens of small copies in a row it's fine
22:36
Anyway, if I really cared I'd just map it into memory and call it a day, I just found it interesting that it's not all that simple to get the "optimal" behaviour
Avatar
i think it does some smart thing
22:36
because it looks rtly close tied to compiler
22:36
xd
22:37
Source of the Rust file library/alloc/src/vec/spec_extend.rs.
22:37
something here
22:37
but idk
Avatar
ab46ce5 Add 71 € funding for DDNet POL by Teelevision - def-
Avatar
Teelevision
23:20
poggers2
23:20
tv at home:
Avatar
7177938 allocate more space for DoLine_ColorPicker label - dobrykafe e41b57f Merge pull request #7916 from dobrykafe/pr-colorpicker-label - def-
23:25
7d0e9e8 Extract CMenus::DoButton_Favorite function - Robyt3 a8f3b56 Fix undefined behavior on loading empty PNG files - Robyt3 7c9b1fb Add tabs for favorite communities, separate country/type filters - Robyt3 f0da0aa Merge pull request #7915 from Robyt3/Browser-Community-Tabs - def-
23:31
why do i laugh at such stupid things
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
50/50, either he finishes or he doesnt
23:32
easy!
Avatar
50/50, either I finish it or don't
23:32
😄
23:32
MY JOKE
Avatar
two idiots, one thought
Exported 698 message(s)