百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

daScript

> 编程语言
开源

daslang - 高性能的静态强类型脚本语言

1.1K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

daslang - 高性能的静态强类型脚本语言

Daslang

Daslang (formerly daScript) is a high-performance, statically typed programming language built for games and real-time applications. Getting Started * Website * Documentation * Blog * Try Online

Why Daslang?

Daslang was created at Gaijin Entertainment to solve a real problem: interop overhead between scripting languages and C++ was eating the frame budget in their ECS game engine. Lua (via LuaJIT) and Squirrel both hit the same wall - marshaling data back and forth was too expensive.

Daslang's data layout matches C++. There is no marshaling, no boxing, no conversion - scriptC++ calls are near-zero cost.

Core principles:

  • Iteration speed is king - a full production game recompiles in ~5 seconds; hot reload is built in
  • Explicit, not implicit - no hidden type conversions, no silent allocations; options log shows exactly what the compiler produces
  • 99% safe, not 100% - eliminates real-world C++ bugs pragmatically, without Rust-level restrictions
  • If it gets slow, you can fix it - manual delete to reduce GC pressure, AOT to C++ for native speed
  • The language reflects the problem - a compile-time macro system lets libraries reshape syntax to match the domain

Three execution tiers (all planned from day one): fast tree-based interpreter -> AOT compilation to C++ (required for consoles) -> JIT via LLVM. Hybrid mode uses semantic hashing: unchanged functions stay AOT, changed ones fall back to the interpreter - ship a hotfix without a full rebuild.

See the design philosophy for the full story.

Installation

git clone https://github.com/GaijinEntertainment/daScript.git daslang
cd daslang
git submodule update --init --recursive

Building

cmake -Bbuild -DCMAKE_BUILD_TYPE=Release
cmake --build build --target daslang --config Release

AOT usage

AOT compiles daslang scripts to C++ for native performance. Generate the C++ stub, then compile and link it with your host application:

./bin/daslang -aot main.das aot_main.cpp
clang++ host.cpp aot_main.cpp -Iinclude lib/liblibDaScript.a lib/liblibUriParser.a -o app

For a complete walkthrough, see the AOT tutorial and integration_cpp_13.cpp.

JIT usage

To use JIT, you need the LLVM 16.0.6 shared library at the path lib/LLVM.dll, this name is fixed because of dynamic bindings.

Once you have LLVM.dll, all you need is:

./bin/daslang -jit main.das

For more details on how JIT works and what can be configured, see the JIT Readme.

Embedding into cmake

To embed daslang into your CMake application, simply call find_package(DAS). This will provide the targets libDaScript and libDaScriptDyn. For an example of using daslang as an external project (including usage for dynamic modules) see this demo.

Package manager (daspkg)

A built-in package manager in utils/daspkg/ handles installing, updating, and building daslang packages - both pure-daslang and C++ native modules.

# Install a package from the index
./bin/daslang utils/daspkg/main.das -- install das-claude

# Install from a git URL
./bin/daslang utils/daspkg/main.das -- install github.com/user/repo

# Search the package index
./bin/daslang utils/daspkg/main.das -- search json

See utils/daspkg/README.md for the full command reference and package authoring guide.

VS Code extensions

  • daScript - syntax highlighting for .das files
  • daScript language support - language server, linting, debugging, and snippets

MCP server (AI tool integration)

An MCP server in utils/mcp/ exposes 29 compiler-backed tools to AI coding assistants (Claude Code, etc.): compilation diagnostics, type inspection, go-to-definition, find-references, AST dump, AOT generation, expression evaluation, parse-aware grep, package management, and more.

No extra build dependencies (stdio transport). See utils/mcp/README.md for setup and configuration.

Tree-sitter grammar

A full tree-sitter grammar for daslang lives in tree-sitter-daslang/. It parses 99.4% of the codebase (all valid files) and is built automatically by CMake as a shared library.

Use it for:

  • Syntax highlighting - queries/highlights.scm included, works in editors that support tree-sitter (Neovim, Helix, Zed)
  • Parse-aware search - via ast-grep (sg) for structural code search across .das files
  • Editor extensions - tree-sitter-daslang/zed-daslang/ includes a Zed extension

Build the grammar:

cmake --build build --target tree_sitter_daslang

License

daslang is licensed under the BSD 3-Clause License. Vendored third-party components keep their own licenses; each installs with the SDK beside the code that uses it (*.LICENSE files at the bundle root).

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Cgame-developmentinterpreterprogramming-languagescripting-language

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言