Speculative: Rust for base system components
Johannes Lundberg
johalun0 at gmail.com
Wed Jan 2 11:40:56 UTC 2019
On 1/2/19 11:28 AM, Garance A Drosehn wrote:
> On 2 Jan 2019, at 6:06, Johannes Lundberg wrote:
>
>> On 1/2/19 12:35 AM, Conrad Meyer wrote:
>>> All are dynamically linked and stripped amd64 binaries. Ripgrep
>>> (Rust) is 48x the binary size of ag and 37x that of grep(1). Like
>>> grep(1), 'ag' is written in C.
>> Rust by default statically link everything in executable binaries.
>> This is comparable to statically link in libc and all other
>> dependencies in your C program. You can have Rust programs link
>> against shared rust libraries (std, etc) and get the size down
>> to basically same as C.
>>
>> If Rust is used in base and everything is built at the same time,
>> with same version compiler, it would make sense to link dynamically
>> I think.
>>
>> Switching topic a bit. Just wanted to also add my contribution,
>> a simple sysctl Rust library
>> https://github.com/johalun/sysctl-rs .
> Personally I think it's interesting and helpful to see some more
> projects like this, so we can get a better understanding of how
> well the language works for systems-level programs. I'm going to
> take a look at this, just for my own curiosity. Thanks!
>
You're welcome! Oh, I forgot my most recent tool:
https://github.com/johalun/pperf
It's similar to iperf and useful for simulating many clients making
short connections to ranges of IP addresses. The source code is
ridiculously short and simple, showing how powerful Rust is when writing
(safe and bug free) multi-threaded programs (of course with the use of
some 3rd party crates).
More information about the freebsd-hackers
mailing list