README.md 1.36 KB
Newer Older
Kai Brandes's avatar
Kai Brandes committed
1
# adventofcode-2017
Kai Brandes's avatar
Kai Brandes committed
2 3
Learning [Rust](https://www.rust-lang.org) by solving [adventofcode-2017](https://adventofcode.com).   
The solutions are compiled to WebAssembly ([Wasm](https://webassembly.org/)) and can be tested (see Starting the Wasm-application).
Kai Brandes's avatar
Kai Brandes committed
4

Kai Brandes's avatar
Kai Brandes committed
5 6 7 8 9 10
> WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable target for compilation of high-level languages like C/C++/Rust, enabling deployment on the web for client and server applications.   
>    
See https://webassembly.org/


## Starting the Wasm-application
Kai Brandes's avatar
Kai Brandes committed
11 12

```
Kai Brandes's avatar
Kai Brandes committed
13
./runWeb.sh
Kai Brandes's avatar
Kai Brandes committed
14
```
Kai Brandes's avatar
Kai Brandes committed
15 16 17 18 19 20 21 22 23 24 25 26 27
*BUT* to be able to run this, you need to install a couple of things first:


* **Rust (>= 1.30)**    
```curl https://sh.rustup.rs -sSf | sh``` [more Info](https://www.rust-lang.org/en-US/install.html)    
```rustup default beta``` switch to rust beta-branch until 1.30 is not released

* **wasm-pack**   
A tool which helps us to compile rust to WASM.    
Install it from [here](https://rustwasm.github.io/wasm-pack/installer/)
* **npm**   
The package-manager for JavaScript we are using.   
Install it with ```npm install npm@latest -g```
Kai Brandes's avatar
Kai Brandes committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47


## Cargo commands

#### Running tests
```
cargo test
```

#### Checking the code
```
cargo check
```

#### Running the code
```
cargo run
```


Kai Brandes's avatar
Kai Brandes committed
48 49 50 51 52 53 54 55 56 57 58 59
## Tools
A good plugin for IntelliJ: https://intellij-rust.github.io/





   
# 
Kai Brandes