Ad Astra — A New Rust Embedded Scripting Language

Greetings!

I would like to show you my project, Ad Astra.

Ad Astra is a dynamically typed scripting language designed for controlling Rust programs' execution through exported Rust APIs.

This project belongs to the same category as languages like Rhai and Rune, where developers expose powerful functionality implemented in Rust to a dynamic scripting environment, enabling a quick edit-compile-run cycle.

Script users can utilize the exported API to manage the host platform in real-time, without the need to rebuild the entire Rust application.

One common use case for such systems is a plugin platform based on scripts, for example, in video games.

Ad Astra is designed with usability in mind, both for developers of the scripting environment and for script users.

For Developers

  1. The language is built with a minimal set of built-in features, but most language constructs are configurable to meet the needs of various domains.

  2. Developers can export Rust APIs by annotating Rust items (functions, types, and their impl blocks) with a unified #[export] attribute macro. In many cases, this macro can automatically analyze and export Rust code as it is, without requiring an additional abstraction layer between static Rust code and the dynamic scripting environment.

  3. Ad Astra supports Rust functions that take data by reference and return result objects with lifetimes tied to the arguments. The script runtime dynamically and transparently emulates Rust's borrowing rules for the script user.

For Script Users

  1. The syntax of the language visually resembles Rust, but its semantics are closer to JavaScript. A typical script consists of anonymous functions and structural objects that form the structure of the program.

  2. Ad Astra provides a built-in LSP language server that can analyze the syntax and semantics of script source code and offer real-time diagnostics. Users of text editors can take advantage of a full-featured language extension with capabilities such as code completion, highlighting related symbols, refactoring, navigating to declarations and definitions, and more. The language server assists users in exploring the host system's API during script development.

showcase

You can try out the features of the Ad Astra language in the interactive Playground on the project's website.

I would appreciate your feedback and reviews, and I'm happy to answer any questions you may have.

Best regards,
Ilya

8 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.