# Here I collect some interesting links. ## cargo environment Currently I always build all dependencies within th projects own .cargo subdir by setting the environment variable CARGO_HOME. export CARGO_HOME=./.cargo Actually I am quite unsure if that is really a good idea because this results in a lot of rebuilds for each new project. ## Implement Monads with rust. Which is currently difficult through impossible, but might be feasible with some small additions to the rust type system, namely «(generic) associated traits.» [Read here](https://varkor.github.io/blog/2019/03/28/idiomatic-monads-in-rust.html) ### Is impl Trait what we needed? A new language feature which sounded a bit like the needed one for above is: [impl Trait](https://medium.com/@iopguy/impl-trait-in-rust-explanation-efde0d94946a) Crossreading it a bit seems to indicate that this is not like the above needed language feature. ## WASM ... on gentoo ... Right now rust is not really a first class citizen within the gentoo eco system. For that reason at least when compiling rust with the `system-llvm` use flag some manual preparations are needed. ### general informations about Wasm from MDN ... [WebAssembly](https://developer.mozilla.org/en-US/docs/WebAssembly) ### rustwasm tutorial [rustwasm](https://rustwasm.github.io/book/introduction.html) ### location of rustlib ... `wasm-pack` expects the wasm runtime under /usr/lib/rustlib/ but a gentoo installation puts it under /usr/lib/rust-1.39.0/rustlib/. To come around this issue I just created a symlink. Maybe it would be best to send a patch for also settings this symlink to upstream eselect-rust. ### Missing lld Again `wasm-pack` searches for llvm-lld or rust-lld for the link phase. This is currently not a dependency for llvm with WASM support, so I installed it manually. Finally you have to tell rustc to use lld as linker via this environment variable: export RUSTFLAGS="-C linker=lld" ## Traits when, how & why A slightly old but still worthwhile post about rusts standard traits. [About traits](https://llogiq.github.io/2015/07/30/traits.html) # Side note... 3d math [3d math primer](https://www.3dgep.com/3d-math-primer-for-game-programmers-vector-operations/) [basic 3d math](https://matrix44.net/cms/notes/opengl-3d-graphics/basic-3d-math-vectors/) [vector calculator](https://www.mathportal.org/calculators/matrices-calculators/vector-calculator.php) [3d vector mathematics](https://vvvv.org/documentation/3d-vector-mathematics) [sin appr. with fractions](https://dsp.stackexchange.com/questions/46629/finding-polynomial-approximations-of-a-sine-wave) # transformations within a coordinate system. [migenius](https://www.migenius.com/articles/3d-transformations-part1-matrices) [tutorialspoint](https://www.tutorialspoint.com/computer_graphics/3d_transformation.htm) # more math... A whole lot of interesting stuff about continued fractions: [continues fractions](http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/cfINTRO.html)