Showing
1 changed file
with
53 additions
and
0 deletions
interesting.md
0 → 100644
| 1 | +# Here I collect some interesting links. | ||
| 2 | + | ||
| 3 | +## cargo environment | ||
| 4 | + | ||
| 5 | +Currently I always build all dependencies within th projects own .cargo subdir | ||
| 6 | +by setting the environment variable CARGO_HOME. | ||
| 7 | + | ||
| 8 | + export CARGO_HOME=./.cargo | ||
| 9 | + | ||
| 10 | +Actually I am quite unsure if that is really a good idea because this results | ||
| 11 | +in a lot of rebuilds for each new project. | ||
| 12 | + | ||
| 13 | +## Implement Monads with rust. | ||
| 14 | + | ||
| 15 | +Which is currently difficult through impossible, but might be feasible with | ||
| 16 | +some small additions to the rust type system, namely | ||
| 17 | +«(generic) associated traits.» | ||
| 18 | + | ||
| 19 | +[Read here](https://varkor.github.io/blog/2019/03/28/idiomatic-monads-in-rust.html) | ||
| 20 | + | ||
| 21 | +### Is impl Trait what we needed? | ||
| 22 | + | ||
| 23 | +A new language feature which sounded a bit like the needed one for above is: | ||
| 24 | + | ||
| 25 | +[impl Trait](https://medium.com/@iopguy/impl-trait-in-rust-explanation-efde0d94946a) | ||
| 26 | + | ||
| 27 | +Crossreading it a bit seems to indicate that this is not like the above needed | ||
| 28 | +language feature. | ||
| 29 | + | ||
| 30 | +## WASM ... on gentoo ... | ||
| 31 | + | ||
| 32 | +Right now rust is not really a first class citizen within the gentoo eco | ||
| 33 | +system. For that reason at least when compiling rust with the `system-llvm` | ||
| 34 | +use flag some manual preparations are needed. | ||
| 35 | + | ||
| 36 | +### rustwasm tutorial | ||
| 37 | + | ||
| 38 | +[rustwasm](https://rustwasm.github.io/book/introduction.html) | ||
| 39 | + | ||
| 40 | +### location of rustlib ... | ||
| 41 | + | ||
| 42 | +`wasm-pack` expects the wasm runtime under /usr/lib/rustlib/ but a gentoo | ||
| 43 | +installation puts it under /usr/lib/rust-1.39.0/rustlib/. To come around this | ||
| 44 | +issue I just created a symlink. | ||
| 45 | + | ||
| 46 | +### Missing lld | ||
| 47 | + | ||
| 48 | +Again `wasm-pack` searches for llvm-lld or rust-lld for the link phase. This | ||
| 49 | +is currently not a dependency for llvm with WASM support, so I installed it | ||
| 50 | +manually. Finally you have to tell rustc to use lld as linker via this | ||
| 51 | +environment variable: | ||
| 52 | + | ||
| 53 | + export RUSTFLAGS="-C linker=lld" |
Please
register
or
login
to post a comment