Glossary

racer
    Rust Code Completion utility

    http://siciarz.net/24-days-of-rust-racer/

flamegraph
    The proportion of a program’s runtime that
    occurs in a routine is proportional to the
    width of the bar for that routine.

    https://ngoldbaum.github.io/posts/python-vs-rust-nn/

Language references

Syntax

https://cheats.rs/

Rosetta: rust vs swift vs scala

http://hyperpolyglot.org/rust

Installation

curl https://sh.rustup.rs -sSf | sh

Reading

Rust by example

Introduction - Rust By Example

A little bit of functional programming

https://hoverbear.org/2015/05/02/a-journey-into-iterators/

std::mem::drop

https://blog.jabid.in/2019/10/11/drop.html

An simple example project

Why I Ripped The Same CD 300 Times

Josef “Jeff” Sipek Rust Pointers for C Programmers

Koans / interactive tutorial

https://github.com/crazymykl/rust-koans

Set up racer for emacs / vim

http://siciarz.net/24-days-of-rust-racer/

Maintenance

Rustup

rustup uninstall stable
rustup install stable
rustup show
rustup component add rls
rustup component add rls rust-analysis rust-src
rustup component add rls-preview
rustup self update
RUST_LOG=debug rustup self update

# for rustic emacs
# https://github.com/brotzeit/rustic#clippy
rustup component add --toolchain nightly clippy

Setup experience

Rusti needs this particular version of the toolchain to compile

rustup install nightly-2016-08-01

This is how you compile from github

rustup run nightly-2016-08-01 cargo install --git https://github.com/murarth/rusti
  • But if you do that, you also need to run the program with rustup
```sh
rustup run nightly-2016-08-01 /home/shane/.cargo/bin/rusti
```

This way, I was unable to compile racer

Install rust

agi rustc rust-src rust-gdb rust-doc

# Appeared to not work
agi rust-lldb

Install racer

http://siciarz.net/24-days-of-rust-racer/

Rust Code Completion utility

  • What would ya know, its the exact command
```sh
cargo install racer
```
  • Failed
Why the **\*\*** does everything I try to install on ubuntu fail while building.

<cargo racer build failed>

Reverted

agr rustc rust-src rust-gdb rust-doc

Rustup

Install rust and cargo

curl https://sh.rustup.rs -sSf | sh

Install racer

cargo install racer

This failed again. Still having [different] compilation problems with racer.

Install nightly

rustup install nightly
rustup default nightly

Install rust sources so racer autocomplete can work in emacs

rustup component add rust-src

An LSP setup for emacs

(progn
  ;; Rust settings
  (require 'rust-mode)
  (with-eval-after-load 'rust-mode
    ;; Rust Formatter. Run rustfmt before saving rust buffers
    (setq rust-format-on-save t))

  (require 'lsp-mode) ;; language server protocol
  (with-eval-after-load 'lsp-mode
    (add-hook 'rust-mode-hook #'lsp))
  ;; (add-hook 'rust-mode-hook #'flycheck-mode))

  ;; excessive UI feedback for light reading between coding
  (require 'lsp-ui)
  (with-eval-after-load 'lsp-ui
    (add-hook 'lsp-mode-hook 'lsp-ui-mode))

  ;; autocompletions for lsp (available with melpa enabled)
  (require 'company-lsp)
  (push 'company-lsp company-backends)

  ;; tell company to complete on tabs instead of sitting there like a moron
  (define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common))