Skip to content

Releases: Eng-AliKazemi/Rustcript

v1.0

15 Dec 22:54

Choose a tag to compare

Rustcript v1.0: Initial Public Release

We are thrilled to announce the first public release of Rustcript, a secure, embeddable scripting language designed to bring dynamic flexibility to the world of high-performance Rust applications.

This initial release marks a major milestone, offering a stable and feature-rich interpreter ready for integration. Rustcript was born from the need to decouple dynamic logic, like business rules, configurations, and event handlers, from the compiled core of an application. It empowers developers to adopt an "Engine vs. Brain" architecture, where the Rust "engine" handles heavy lifting, and the Rustcript "brain" can be updated on-the-fly without a single recompilation.

What is Rustcript?

Rustcript is a library-first scripting language with a clean, readable syntax. It allows you to execute external .rc script files from within your Rust application. Instead of hardcoding rules that change frequently, you can express them in simple scripts that can be modified and deployed independently, dramatically accelerating development cycles.

Key Features in v1.0

This release includes a comprehensive set of features to provide a powerful and complete scripting experience:

  • Flexible & Intuitive Syntax: A simple, statement-based syntax with natural assignment (x = 10), modern block-based control flow (if condition [...]), and clear command structures.
  • Rich Type System: Full support for integers, floats, booleans, strings, tuples, vectors, and hashmaps.
  • Modern Control Flow: Includes if/else_if/else, match/case, while, for, foreach, and try/catch for robust logic.
  • First-Class Functions: Functions can be stored in variables, passed as arguments, and returned from other functions, enabling advanced programming patterns.
  • Seamless Rust Interoperability: The cornerstone feature. The RustcriptObject trait allows you to safely expose your native Rust structs and their methods directly to the script, creating a powerful and type-safe bridge.
  • Modular by Design: Organize your code with import '...' and prevent naming collisions with namespaced imports (import '...' as MyModule).
  • Comprehensive Standard Library: Built-in static modules (math, rand, json, os, io) and methods for core types provide extensive functionality out of the box.
  • Detailed Error Reporting: Runtime errors report the exact source line number, making debugging scripts straightforward.

A Focus on Security

Security is not an afterthought; it is a core design principle of Rustcript.

  • Compile-Time Safety: Potentially dangerous features like OS command execution (os_access) and file system access (file_io) are disabled by default via Cargo.toml feature flags.
  • Sandboxed Execution: When the file_io feature is enabled, all file operations are confined to a secure sandbox directory, with built-in protection against path traversal attacks.
  • Execution Limiter: A configurable instruction counter prevents infinite loops or computationally expensive scripts from freezing the host application.

Getting Started

  1. Clone the repository:
    git clone https://github.com/Eng-AliKazemi/Rustcript.git
    cd Rustcript
  2. Build the interpreter (with all features):
    cargo build --release --features "os_access file_io"
  3. Run an example script:
    ./target/release/rustcript examples/01_basics.rc

For detailed integration instructions and a full language reference, please see the Language Manual (MANUAL.md).

What's Included in this Release

  • The Rustcript interpreter library and the command-line binary.
  • A suite of 24 example scripts in the /examples directory, covering every feature of the language.
  • An end-to-end test runner script (tests/test_runner.rc) that validates the interpreter's functionality.
  • Comprehensive documentation, including the README.md, MANUAL.md, and a dedicated AI_INSTRUCTIONS.md for AI-powered development.

The Future is Community-Driven

This v1.0 release is a stable foundation, but it's just the beginning. The future development of Rustcript will be shaped by its users. We encourage you to share your ideas, use cases, and feedback.

Thank you for your interest in Rustcript. We can't wait to see what you build with it