2020-06-20 06:06:17 +02:00
Features
========
{{#include ../links.md}}
Easy
----
2020-06-22 16:02:49 +02:00
* Easy-to-use language similar to JavaScript+Rust with dynamic typing.
2020-06-20 06:06:17 +02:00
2020-06-29 17:55:28 +02:00
* Tight integration with native Rust [functions] and [types][custom types], including [getters/setters], [methods][custom type] and [indexers].
2020-06-20 06:06:17 +02:00
* Freely pass Rust variables/constants into a script via an external [`Scope`].
2020-06-20 09:57:15 +02:00
* Easily [call a script-defined function ]({{rootUrl}}/engine/call-fn.md ) from Rust.
2020-06-20 06:06:17 +02:00
2020-08-23 05:16:08 +02:00
* Very few additional dependencies (right now only [`smallvec` ](https://crates.io/crates/smallvec/ ));
2020-06-20 06:06:17 +02:00
for [`no-std`] builds, a number of additional dependencies are pulled in to provide for functionalities that used to be in `std` .
Fast
----
* Fairly low compile-time overhead.
2020-07-04 16:53:00 +02:00
* Fairly efficient evaluation (1 million iterations in 0.3 sec on a single core, 2.3 GHz Linux VM).
2020-06-20 06:06:17 +02:00
2020-06-27 04:43:57 +02:00
* Scripts are [optimized][script optimization] (useful for template-based machine-generated scripts) for repeated evaluations.
2020-06-20 06:06:17 +02:00
Dynamic
-------
2020-06-20 09:57:15 +02:00
* [Function overloading ]({{rootUrl}}/language/overload.md ).
2020-06-20 06:06:17 +02:00
2020-06-20 09:57:15 +02:00
* [Operator overloading ]({{rootUrl}}/rust/operators.md ).
2020-06-20 06:06:17 +02:00
* Organize code base with dynamically-loadable [modules].
2020-07-28 04:25:57 +02:00
* Dynamic dispatch via [function pointers] with additional support for [currying].
2020-06-25 12:07:57 +02:00
2020-08-04 10:27:55 +02:00
* Closures via [automatic currying] with capturing shared variables from the external scope.
2020-06-27 11:34:39 +02:00
* Some support for [object-oriented programming (OOP)][OOP].
2020-06-26 04:39:18 +02:00
2020-06-20 06:06:17 +02:00
Safe
----
2020-07-28 04:25:57 +02:00
* Relatively little `unsafe` code (yes there are some for performance reasons).
2020-08-07 12:40:31 +02:00
* Sand-boxed - the scripting [`Engine`], if declared immutable, cannot mutate the containing environment unless [explicitly permitted ]({{rootUrl}}/patterns/control.md ).
2020-06-20 06:06:17 +02:00
Rugged
------
2020-06-27 04:43:57 +02:00
* Protected against malicious attacks (such as [stack-overflow][maximum call stack depth], [over-sized data][maximum length of strings], and [runaway scripts][maximum number of operations] etc.) that may come from untrusted third-party user-land scripts.
2020-06-20 06:06:17 +02:00
* Track script evaluation [progress] and manually terminate a script run.
Flexible
--------
* Re-entrant scripting [`Engine`] can be made `Send + Sync` (via the [`sync`] feature).
2020-07-28 04:25:57 +02:00
* Serialization/deserialization support via [`serde` ](https://crates.io/crates/serde ).
2020-06-20 06:06:17 +02:00
* Support for [minimal builds] by excluding unneeded language [features].
* Supports [most build targets ](targets.md ) including `no-std` and [WASM].
2020-07-05 09:23:51 +02:00
* Surgically [disable keywords and operators] to restrict the language.
2020-07-05 11:41:45 +02:00
2020-07-10 16:01:47 +02:00
* Use as a [DSL] by [disabling keywords/operators][disable keywords and operators], [custom operators]
and extending the language with [custom syntax].