daScript  by GaijinEntertainment

Statically typed scripting language for games and real-time systems

Created 7 years ago
1,119 stars

Top 34.0% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

Daslang (formerly daScript) is a high-performance, statically typed scripting language engineered by Gaijin Entertainment to address the critical interop overhead between C++ and traditional scripting languages in game development. It targets game developers and real-time application engineers seeking faster iteration cycles and reduced runtime costs, offering near-zero cost C++ integration by maintaining a compatible data layout.

How It Works

Daslang employs a multi-tiered execution strategy: a fast tree-based interpreter for rapid development, Ahead-of-Time (AOT) compilation to C++ for native performance and console deployment, and Just-In-Time (JIT) compilation via LLVM. Its core design emphasizes explicitness, avoiding hidden type conversions or allocations, and provides pragmatic safety, eliminating common C++ pitfalls without Rust-level strictness. Manual memory management options are available to reduce garbage collection pressure, and a compile-time macro system allows libraries to reshape syntax for domain-specific expressiveness. A hybrid mode enables hot-fixing unchanged functions via AOT while recompiling modified ones with the interpreter.

Quick Start & Requirements

  • Installation: Clone the repository (git clone https://github.com/GaijinEntertainment/daScript.git daslang) and initialize submodules (git submodule update --init --recursive).
  • Build: Use CMake: cmake -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo followed by cmake --build build --target daslang --config RelWithDebInfo.
  • Prerequisites: CMake, C++ compiler, and LLVM 16.0.6 shared library (lib/LLVM.dll) specifically for JIT compilation.
  • Usage: AOT compilation involves generating C++ stubs (./bin/daslang -aot main.das aot_main.cpp) and linking them with a host application. JIT compilation requires the LLVM library (./bin/daslang -jit main.das).
  • Links: Documentation, AOT Tutorial, JIT Readme, CMake Integration Demo.

Highlighted Details

  • Near-zero cost C++ interop achieved through matching data layout.
  • Rapid iteration speeds with full production game recompiles in ~5 seconds and built-in hot reload.
  • AOT compilation to C++ enables native performance and cross-platform deployment, including consoles.
  • JIT compilation via LLVM provides dynamic execution capabilities.
  • A compile-time macro system facilitates domain-specific language (DSL) creation.
  • An integrated MCP server exposes compiler diagnostics, type inspection, and other features to AI coding assistants.
  • A tree-sitter grammar is automatically built, supporting syntax highlighting and parse-aware code analysis in editors.

Maintenance & Community

The project is developed by Gaijin Entertainment. No specific community channels (e.g., Discord, Slack) or external contributor information are detailed in the provided README.

Licensing & Compatibility

The license type is not specified in the provided README content. This absence represents a significant adoption blocker, preventing clear assessment of commercial use or linking compatibility.

Limitations & Caveats

The language aims for pragmatic safety ("99% safe"), implying potential for certain C++-like bugs remains. JIT compilation is dependent on a specific LLVM shared library version and naming convention (16.0.6, LLVM.dll), which could introduce fragility. AOT compilation requires integrating generated C++ code into the host application's build system. The lack of a stated license is a critical omission for due diligence.

Health Check
Last Commit

5 hours ago

Responsiveness

Inactive

Pull Requests (30d)
124
Issues (30d)
15
Star History
9 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.