07/21: Rust: early impressions
I compiled a rust hello world program and compared with a c hello world program.
$ cat hello-1.rs fn main() { println!("Hello World!"); } $ cat hello-1.c #include <stdio.h> int main() { printf("Hello World!"); } $
The results:
$ ls -la hello-1 a.out-1 -rwxrwx--- 1 bjb bjb 16608 Jul 18 13:34 a.out-1 -rwxrwx--- 1 bjb bjb 6965408 Jul 18 13:34 hello-1 $ ldd a.out-1 hello-1 a.out-1: linux-vdso.so.1 (0x00007ffd825c7000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2b11bc5000) /lib64/ld-linux-x86-64.so.2 (0x00007f2b11dce000) hello-1: linux-vdso.so.1 (0x00007ffcd7d7d000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7531eed000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7531ee3000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7531ec2000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7531ea8000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7531ce7000) /lib64/ld-linux-x86-64.so.2 (0x00007f7531f69000) $
Hmm.
The second thing is that when I tried to build something, it complained that my rust compiler is too old. Ok — so look for the way to get a new rust. They want you to download a file sight unseen into a shell interpreter.
https://www.rust-lang.org/tools/install curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
A bit scary. My first preference would be to package it in a distro packaging system. (That was how I installed the older rust.) Second would be a plain old tarball.
Well, maybe I’ll look at it further some other day. I will need to audit the 600+ lines of shell script … lucky me.
More upcoming adventures … instead of makefiles — they use “crates” and “cargo” instead of Makefiles and maybe shared libraries. But, I’m not that far ahead yet.
UPDATE: they do offer tarballs — phew. https://forge.rust-lang.org/infra/other-installation-methods.html