|
| 1 | +--- |
| 2 | +slug: /installation |
| 3 | +--- |
| 4 | + |
| 5 | +import Tabs from '@theme/Tabs'; |
| 6 | +import TabItem from '@theme/TabItem'; |
| 7 | + |
| 8 | +# Installation |
| 9 | + |
| 10 | +:::warning |
| 11 | +Rue is currently in alpha. Please use it with caution and report any bugs you find in doing so. |
| 12 | +::: |
| 13 | + |
| 14 | +First, you will need to install the [Rust toolchain](https://rustup.rs). |
| 15 | + |
| 16 | +You can install the Rue CLI with this command: |
| 17 | + |
| 18 | +```bash |
| 19 | +cargo install rue-cli |
| 20 | +``` |
| 21 | + |
| 22 | +It's also useful to install [clvm_tools_rs](https://github.com/Chia-Network/clvm_tools_rs): |
| 23 | + |
| 24 | +```bash |
| 25 | +cargo install clvm_tools_rs |
| 26 | +``` |
| 27 | + |
| 28 | +## Editor Support |
| 29 | + |
| 30 | +<Tabs> |
| 31 | +<TabItem value="vscode" label="VSCode" default> |
| 32 | + |
| 33 | +You will need to install [Visual Studio Code](https://code.visualstudio.com). |
| 34 | + |
| 35 | +Then, you can install the [Rue extension](https://marketplace.visualstudio.com/items?itemName=Rigidity.rue-language) on the VSCode marketplace. It provides syntax highlighting and LSP integration. |
| 36 | + |
| 37 | +You can install the Rue language server with this command: |
| 38 | + |
| 39 | +```bash |
| 40 | +cargo install rue-lsp |
| 41 | +``` |
| 42 | + |
| 43 | +This should automatically work with the extension. |
| 44 | + |
| 45 | +</TabItem> |
| 46 | +<TabItem value="cursor" label="Cursor"> |
| 47 | + |
| 48 | +You will need to install [Cursor](https://cursor.com/). |
| 49 | + |
| 50 | +Then, you can install the [Rue extension](https://open-vsx.org/extension/Rigidity/rue-language) on the Open VSX marketplace. It provides syntax highlighting and LSP integration. |
| 51 | + |
| 52 | +You can install the Rue language server with this command: |
| 53 | + |
| 54 | +```bash |
| 55 | +cargo install rue-lsp |
| 56 | +``` |
| 57 | + |
| 58 | +This should automatically work with the extension. |
| 59 | + |
| 60 | +</TabItem> |
| 61 | +</Tabs> |
| 62 | + |
| 63 | +:::tip |
| 64 | +Any editor that supports Open VSX and VSCode extensions will likely support this. |
| 65 | +::: |
| 66 | + |
| 67 | +## Hello World |
| 68 | + |
| 69 | +The simplest example of a program in Rue is the classic hello world example. |
| 70 | + |
| 71 | +Write the following program in a file named `hello.rue`: |
| 72 | + |
| 73 | +```rue title="hello.rue" |
| 74 | +fn main() -> Bytes { |
| 75 | + "Hello, world!" |
| 76 | +} |
| 77 | +``` |
| 78 | + |
| 79 | +Now, run the following command to run the file: |
| 80 | + |
| 81 | +```bash |
| 82 | +rue build hello.rue |
| 83 | +``` |
| 84 | + |
| 85 | +The output should be `(q . "Hello, world!)"`, which when run with CLVM outputs the string on its own. |
0 commit comments