Getting started
Before you can run Dyon programs, you need to do the following:
- Install Rust.
- Open up the Terminal window
- Type
cargo new --bin <project name>
Open up "Cargo.toml" and add the following:
[dependencies]
dyon = "0.36.0"
Open up "src/main.rs" and type:
extern crate dyon; use dyon::{error, run}; fn main() { error(run("src/main.dyon")); }
Hello World example
Source code: examples/hello_world
Put this in "src/main.dyon":
fn main() { println("Hello world!") }
In the terminal window, go to the "hello_world" folder and type:
$ cargo run
This should print out:
Hello world!
Comments
You might have noticed:
- Dyon has no ";" at the end of lines
- The "fn" keyword is used by both Rust and Dyon
- The "main" function is called when running the program
- Double quotes "" are used for text
Some things you can try:
- Put your name inside the text!
- Add a new line where you print out something else!
- Change "println" to "print" and see what happens!