LynxScript is an experimental CatWeb scripting language implemented in Rust. It provides a way for more advanced CatWeb site developers to write code without the blocks and only text.
- Custom Scripting Language: Defines its own syntax and semantics for expressive scripting.
- High Performance: Built with Rust for efficiency and speed, suitable for various scripting tasks.
- Friendly Error Diagnostics: Utilizes
ariadneto produce clear, colored, and helpful error messages for syntax and runtime issues, enhancing the developer experience. - Robust Parsing: Employs the
chumskyparser combinator library for flexible and powerful language parsing capabilities. - Command-Line Interface: Offers an easy-to-use CLI for executing LynxScript files directly from your terminal with no extra setup needed.
- Rust Toolchain: You need to have the Rust programming language installed on your system. This includes
rustcandcargo.
-
Clone the repository Begin by cloning the LynxScript repository to your local machine:
git clone https://github.com/gaxolotl/LynxScript.git cd LynxScript -
Build the project Compile the project. This command will create a debug executable.
cargo build
The compiled executable will be located at
./target/debug/lynxscript. -
Install the CLI tool (optional, for global access) To make
lynxscriptglobally available on your system's PATH, you can install it using Cargo:cargo install --path .After this, you can run
lynxscriptfrom any directory in your terminal.
Once LynxScript is built or installed, you can use the lynxscript command to execute your .lynx script files. Use the lynxscript --help command for all available commands.
To run a LynxScript file:
# If installed globally via `cargo install --path .`:
lynxscript <path-to-your-script>.lynx
# If running from the repository directory (after `cargo build`):
./target/debug/lynxscript <path-to-your-script>.lynx(TODO: provide more examples as the codebase grows)
# Example 1: Running a basic script
# Assuming you have a file named `hello.lynx` with simple LynxScript code:
# print("Hello, LynxScript!");
lynxscript hello.lynx
# Expected output (demonstrative): Hello, LynxScript!
# Example 2: Inspecting a script (conceptual)
# If LynxScript includes a subcommand for syntax checking or linting:
# lynxscript check my_complex_script.lynx
# Expected output: (Diagnostic messages or success indication)To compile the project for development:
cargo buildFor an optimized, production-ready build:
cargo build --releaseThe release executable can be found at ./target/release/lynxscript.
If the project includes unit or integration tests (common in Rust projects), you can execute them with Cargo:
cargo testThis project is licensed under the MIT License - see the LICENSE file for full details.
- Original author and creator of LynxScript: pickaxe828
- Built with the blazing fast Rust
- Command-line interface parsing powered by clap library
- Language parsing logic made possible by chumsky parser combinator library
- Enhanced error reporting thanks to the diagnostics provided by ariadne
⭐ Star this repo if you find it helpful!
Made with ❤️ by pickaxe828 and the contributors