HackerTrans
TopNewTrendsCommentsPastAskShowJobs

quadrophenia

no profile record

Submissions

Rust the Process

amalbansode.com
55 points·by quadrophenia·7 เดือนที่ผ่านมา·12 comments

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

github.com
6 points·by quadrophenia·8 เดือนที่ผ่านมา·0 comments

comments

quadrophenia
·7 เดือนที่ผ่านมา·discuss
Thank you for the context!
quadrophenia
·7 เดือนที่ผ่านมา·discuss
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