W is a custom interpreted programming language. It is designed to be a simple language for various applications.
- Hand-written Lexer and Parser: A custom-built lexer and a recursive descent parser provide full control over the language syntax.
- Tree-walk Interpreter: The Abstract Syntax Tree (AST) is traversed by a tree-walk interpreter to execute the code.
- Advanced Error Handling: A robust, dual-system approach to error management. User-facing errors (e.g., syntax mistakes) are collected by the lexer and parser into
LexerCrashandParserCrashobjects, allowing the system to report multiple issues in a single pass.
For more detailed information about the language, its architecture, and how to use it, please refer to the most important documentation:
Here is the rest of the documentation:
- Error Handling
- Keywords
- Native Types
- Type System
- Creating Structures
- Creating Modules
- Logging
- Interpreter
- Parser
- Lexer
W-lang is officially supported and continuously tested on the following platforms:
- macOS (latest) with Apple Clang
- Linux (Ubuntu latest) with GCC-14
You can download a pre-built binary for your operating system directly from the GitHub Releases page.
- Download the
.tar.gzfile for your platform (macOS or Linux). - Extract the archive:
tar -xzf w-lang-*.tar.gz - (Optional) Move the binary to a directory included in your
$PATH(e.g.,~/.local/bin) so you can run it from anywhere:mkdir -p ~/.local/bin mv wlang ~/.local/bin/
To build and install the W-lang interpreter from source, you'll need a C++23 compatible compiler. An easy, interactive installation script is provided.
-
Clone the repository:
git clone https://github.com/ralphy127/W-lang cd W-lang -
Run the install script:
./install.sh
The script will automatically build the project using CMake, install the wlang executable to $HOME/.local/bin, and optionally add the directory to your PATH for easy execution.
Once you have installed the project (and $HOME/.local/bin is in your PATH), you can execute a script anywhere:
wlang path/to/your/script.weirdIf you chose not to add it to your PATH, you can use the absolute path:
~/.local/bin/wlang path/to/your/script.weirdThe project uses CTest and GoogleTest for unit and integration testing. To run the test suite, navigate to the build directory and run ctest:
cd build
ctestW-lang uses GitHub Actions for continuous integration and deployment:
- Automated Testing (
ci.yaml): Every push tomainand active development branches triggers a build and test run across all supported platforms to ensure stability. - Automated Releases (
release.yml): Pushing a new version tag (e.g.,v*) automatically compiles the project in Release mode without any caching overhead and attaches the properly packaged binaries to a new GitHub Release.