Why RUST?

if one is viewing this site using Firefox or Gecko-Engine… one is running RUST already.

At the beginning – one was big fan of Java – Java was/still is all the rage – theoretically write once – run anywhere linux, osx and (thanks to Google) on mobile and even on the closed source OS who’s name shall not be mentioned, nobody knows what the Java Virtual Machine does besides running bytecode, Java on slow ARM CPUs is kind of a burden.

Here comes RUST.

About RUST: it’s a lengthy talk so take some time… or go into parts.

how to keep a good culture at Open Source:

pros:

+ rust promises the same and even more cross os compatibility than java (even ARM and RISCV! (OSX not officially supported but it seems someone cross compiled OSX binaries via Ubuntu))

+ faster than Java, almost as fast as C (binaries are larger than those of C or C++)

+ safer than C and C++

+ cargo and crates: comes with online colaboration and code sharing tool

cons:

– rust programs can not use a GUI yet

– unsexy naming problems: 1) why would one name a language after corroded (oxidized) metal? 2) crab in German is Krebs and the general name for cancer.

getting started:

assume one has already installed rust.

cd; # change to one's home dir
rustc --version; # show current version
rustc 1.37.0 (eae3437df 2019-08-13)

# will download 1-200MBytes
update rust; # update rust
rustc --version; # show current version

  stable-x86_64-unknown-linux-gnu updated - rustc 1.39.0 (4560ea788 2019-11-04)

rustc --version; # again check current version
rustc 1.39.0 (4560ea788 2019-11-04)

# point browser to offline docs
rustup docs --book

offline documentation can be found here:

file:///home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/book/ch00-00-introduction.html

hello world:

let’s create one’s first program:

# create a folder to hold all projects (workspace)
mkdir /projects;

cd /projects;

# create new folder for project "hello world"
mkdir hello_world;
cd hello_world;

# optional, but recommended because it makes
# colorful source code is much more pleasant to look at :)

apt install git; # install git
# enable rust compatible syntax highlighting in vim
git clone https://github.com/rust-lang/rust.vim ~/.vim/pack/plugins/start/rust.vim
# create first source file
vim hello_world.rs

# fill with
fn main()
	{
		println!("Hello World!");
	}
:wq # write and quit
# compile it!
rustc hello_world.rs

# check results:
ll

# run it
./hello_world
Hello World!
# HURRAY! :)
# now why is it 2.4MBytes in size?
# because it has a lot of debug symbols in it
strip ./hello_world
# strip removes those and binary now 10% 215KBytes

would recommend the online documentary:
https://doc.rust-lang.org/stable/book/ch01-02-hello-world.html

is vim a bad ide?

it even can do auto complete, type part of a word, hit Ctrl+P

Links:

official website: https://www.rust-lang.org/

official forum: https://users.rust-lang.org/

rfs: https://github.com/rust-lang/rfcs

https://github.com/edunham

Her Blog: https://edunham.net/

https://en.wikipedia.org/wiki/Rust_(programming_language)

Tweets:

straight from the creator:

probably the right dunham?

admin