Speculative: Rust for base system components

Charlie Li ml at vishwin.info
Wed Jan 2 02:57:11 UTC 2019


On 01/01/2019 19:35, Conrad Meyer wrote:
> The binary sizes are interesting:
> 
> -r-xr-xr-x 3 root wheel  113640 Nov  4 15:47 /usr/bin/grep*
> -r-xr-xr-x 1 root wheel   89104 Oct 28 14:24 /usr/local/bin/ag*
> -rwxr-xr-x 1 root wheel 4284416 Oct 29 05:12 /usr/local/bin/rg*
> 
> 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.
> 
By default, the dynamic linking in rust binaries are limited to crt
unless a non-default flag is passed to rustc. Thus, this is effectively
static linking, albeit at an earlier stage like llvm-link(1). Rust is
not alone; golang is almost identical in this regard, by default.

ag also has next to no external dependencies at all, compared to
ripgrep's laundry list of crates it uses.

-- 
Charlie Li
Can't think of a witty .sigline today…

(This email address is for mailing list use only; replace local-part
with vishwin for off-list communication)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20190101/314dfbc8/attachment.sig>


More information about the freebsd-hackers mailing list