HackerTrans
トップ新着トレンドコメント過去質問紹介求人

quadrophenia

no profile record

投稿

Rust the Process

amalbansode.com
55 ポイント·投稿者 quadrophenia·7 か月前·12 コメント

Show HN: I made a Rust Terminal UI for OpenSnitch, a Linux application firewall

github.com
6 ポイント·投稿者 quadrophenia·8 か月前·0 コメント

コメント

quadrophenia
·7 か月前·議論
Thank you for the context!
quadrophenia
·7 か月前·議論
OP here - thank you for your explanations! My writing got a little messy in this section, but I think my intended focus here was on struct alignment. I've only had to care about alignment in some very niche cases dealing with C, so I don't think it's something that'll come up in my typical non-high performance software work. I agree that `repr` would likely be the way to go.

I do appreciate that the act of copying or allocating something nontrivial in Rust requires verbosity. Your list of typical heap containers is great and I'll do my best to internalize that. I'd just add that some primitives like sync::Mutex [1] in Rust's standard library (which to my knowledge don't exist in the same flavor in C++'s STL) require some additional gymnastics to wrap my head around. The wrapper is super useful though :)

[1] https://doc.rust-lang.org/std/sync/struct.Mutex.html