From ab441dfb0c912ea1fc4c0bc7e5b05457779147fe Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Wed, 2 Mar 2016 15:00:06 -0500 Subject: [PATCH 1/2] 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 From 2d0e7329a501433bacc6dfda569a6f7062b4d06b Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Wed, 2 Mar 2016 15:08:35 -0500 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a17fbe7a..b556500d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ if true { ``` ```Rust -var x = 10 +var x = 10; while x > 0 { print(x); } @@ -86,7 +86,7 @@ fn main() { # Example 4: Working with custom types and methods -Here's an example of working with Rust. First, the full example, and then we'll break it down: +Here's an more complete example of working with Rust. First the example, then we'll break it into parts: ```Rust #[derive(Debug, Clone)]