https://github.com/jac3km4/redscript
Compiler/decompiler toolkit for redscript
https://github.com/jac3km4/redscript
compiler cyberpunk2077 decompiler language modding
Last synced: about 2 months ago
JSON representation
Compiler/decompiler toolkit for redscript
- Host: GitHub
- URL: https://github.com/jac3km4/redscript
- Owner: jac3km4
- License: mit
- Created: 2020-12-30T03:28:01.000Z (over 4 years ago)
- Default Branch: 1.0.x
- Last Pushed: 2025-04-30T21:38:09.000Z (2 months ago)
- Last Synced: 2025-04-30T22:33:54.951Z (2 months ago)
- Topics: compiler, cyberpunk2077, decompiler, language, modding
- Language: Rust
- Homepage:
- Size: 1.98 MB
- Stars: 441
- Watchers: 20
- Forks: 38
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cyberpunk - Redscript - Compiler/decompiler toolkit for redscript. (Modding resources / Frameworks)
README
![]()
REDscript
REDscript is a statically-typed, object-oriented programming language designed for developing scripts for the REDengine, CD Projekt's game engine used in Cyberpunk 2077. If you want to learn more about the language, visit the [official wiki](https://wiki.redmodding.org/redscript).
## Installation
To compile your scripts automatically on game startup, follow these steps:
- Download the `redscript-mod-{version}.zip` archive from the [latest release](https://github.com/jac3km4/redscript/releases/latest).
- Extract it into the main `Cyberpunk 2077` directory.
- When you start the game, successful setup can be confirmed with logs appearing in `Cyberpunk 2077/r6/logs/redscript_rCURRENT.log`.## Editor Support
REDscript provides extensive editor tooling, including a language server and a debugger that integrate with many popular editors such as VSCode, neovim, IntelliJ IDEA, Zed, and Helix. For detailed setup instructions, check out the [REDscript IDE repository](https://github.com/jac3km4/redscript-ide).
## Project Structure
This project includes various tools for working with REDscript, such as a compiler, a decompiler, and a formatter. These are organized as modular Rust crates located in the `crates` directory:
- **`cli`** - Exposes a command-line interface serving as the entry point for all tools in this project.
- **`compiler/frontend`** - Performs static analysis on REDscript syntax, lowering it to an intermediate representation.
- **`compiler/backend`** - Generates bytecode from the intermediate representation and handles monomorphization for generic functions and types.
- **`compiler/api`** - Provides a high-level API for interacting seamlessly with the compiler.
- **`decompiler`** - Decompiles bytecode back into REDscript source code.
- **`io`** - Reads and writes binary files in the native REDengine format.
- **`scc/cli`** - Exposes a CLI that acts as a drop-in replacement for the original compiler made by CD Projekt.
- **`scc/capi`** - Exposes a C API with an interface similar to the `scc` CLI, but with some additional capabilities like source mapping.
- **`scc/shared`** - Contains common code used across the scc C API and CLI.
- **`syntax/ast`** - Defines the Abstract Syntax Tree (AST) for REDscript.
- **`syntax/formatter`** - Formats REDscript source code according to configuration.
- **`syntax/parser`** - Parses REDscript source code into the AST.
- **`dotfile`** - Parses the configuration `.redscript` file.### Component Diagram
![]()