From ab441dfb0c912ea1fc4c0bc7e5b05457779147fe Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Wed, 2 Mar 2016 15:00:06 -0500 Subject: [PATCH] Update README.md --- README.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dcaceedb..a17fbe7a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,41 @@ # Rhai - embedded scripting for Rust -Rhai is a simple embedded scripting language for Rust. Thou that doesn't use any additional dependencies, unsafe code, or a set of APIs outside of what you provide in your program. This allows you to have rich control over the functionality exposed to the scripting context. +Rhai is an embedded scripting language for Rust. It is meant to be a safe drop-in for your own projects and doesn't use any additional dependencies, unsafe code, or APIs outside of the ones you provide in your program. This allows you to have rich control over the functionality exposed to the scripting context. +# Features +**Note:** Currently, it's pre-0.1, and is likely to change a bit before it stabilizes enough for a crates.io release. -Currently, it's pre-0.1, and is likely to change a bit before it stabilizes enough for a crates.io release. +## Variables + +```Rust +var x = 3; +``` + +## Control blocks + +```Rust +if true { + print("it's true!"); +} +``` + +```Rust +var x = 10 +while x > 0 { + print(x); +} +``` + +## Functions + +```Rust +fn add(x, y) { + x + y +} + +print(add(2, 3)) +``` # Example 1: Hello world