Revise docs.

This commit is contained in:
Stephen Chung
2020-10-12 23:17:22 +08:00
parent a0d5249c4d
commit e6667a3996
8 changed files with 46 additions and 22 deletions

View File

@@ -17,6 +17,8 @@ Easy
* Very few additional dependencies - right now only [`smallvec`](https://crates.io/crates/smallvec/) plus crates for procedural macros;
for [`no-std`] and `WASM` builds, a number of additional dependencies are pulled in to provide for missing functionalities.
* [Plugins] system powered by procedural macros simplifies custom API development.
Fast
----
@@ -41,6 +43,8 @@ Dynamic
* Some support for [object-oriented programming (OOP)][OOP].
* Hook into variables access via [variable resolver].
Safe
----
@@ -66,9 +70,6 @@ Flexible
* Supports [most build targets](targets.md) including `no-std` and [WASM].
* [Plugins] system powered by procedural macros simplifies custom API development.
* Surgically [disable keywords and operators] to restrict the language.
* Use as a [DSL] by [disabling keywords/operators][disable keywords and operators], [custom operators]
and extending the language with [custom syntax].
* Use as a [DSL] by defining [custom operators] and/or extending the language with [custom syntax].

View File

@@ -10,7 +10,7 @@ It doesn't attempt to be a new language. For example:
* No traits... so it is also not Rust. Do your Rusty stuff in Rust.
* No structures/records - define your types in Rust instead; Rhai can seamlessly work with _any Rust type_.
* No structures/records/tuples - define your types in Rust instead; Rhai can seamlessly work with _any Rust type_.
There is, however, a built-in [object map] type which is adequate for most uses.
It is possible to simulate [object-oriented programming (OOP)][OOP] by storing [function pointers]
@@ -32,7 +32,7 @@ It doesn't attempt to be a new language. For example:
integrate with native Rust applications.
* No formal language grammar - Rhai uses a hand-coded lexer, a hand-coded top-down recursive-descent parser
for statements and a Pratt parser for expressions.
for statements, and a hand-coded Pratt parser for expressions.
This lack of formalism allows the parser itself to be exposed as a service in order to support
[disabling keywords/operators][disable keywords and operators], adding [custom operators],
@@ -43,8 +43,8 @@ Do Not Write The Next 4D VR Game in Rhai
---------------------------------------
Due to this intended usage, Rhai deliberately keeps the language simple and small by omitting
advanced language features such as classes, inheritance, first-class functions, closures,
concurrency, byte-codes VM, JIT etc.
advanced language features such as classes, inheritance, interfaces, generics,
first-class functions/closures, pattern matching, concurrency, byte-codes VM, JIT etc.
Avoid the temptation to write full-fledge application logic entirely in Rhai -
that use case is best fulfilled by more complete languages such as JavaScript or Lua.