Skip to content

Latest commit

 

History

History
106 lines (82 loc) · 3.36 KB

File metadata and controls

106 lines (82 loc) · 3.36 KB

Getting started with Daslang

Build the compiler, run a program, and wire in editor and AI-assistant tooling. The full version of this guide lives in the online documentation (Getting Started, on the title page); this file is the short repo-side copy.

Prerequisites

git, CMake, and a C++ compiler for your platform (MSVC, clang, or gcc).

Build the compiler

git clone https://github.com/GaijinEntertainment/daScript
cd daScript
cmake -B build
cmake --build build --config Release -j

The compiler lands at bin/Release/daslang.exe (Windows / MSVC), or bin/daslang / build/daslang (Make and Ninja layouts). Add it to your PATH or alias it - the rest of this guide writes daslang.

Compile a small program

// File: hello_world.das
// Run:  daslang hello_world.das
options gen2

[export]
def main() {
    print("hello, world\n")
}

[export] makes main callable from outside the compiled context - entry points need it. options gen2 selects the current syntax generation; all documentation and new code use it.

From here, the tutorials are the fastest tour of the language (also in-repo under tutorials/).

Set up VSCode

The best supported editor is VSCode with the daScript language support extension - language server, linting, debugging, and snippets. If autocompletion seems unresponsive, raise dascript.server.connectTimeout to 10 (or 20 for a Debug-build compiler).

AI assistants: MCP server

The daslang MCP server (utils/mcp/) gives AI coding assistants compiler-backed tools - compile checks, navigation, parse-aware grep, test running, live-reload control. Configure in .mcp.json at the project root:

{
  "mcpServers": {
    "daslang": {
      "command": "bin/daslang",
      "args": ["utils/mcp/main.das"],
      "defer_loading": false
    }
  }
}

(point command at your binary - bin/Release/daslang.exe in a Windows MSVC source build), or via CLI: claude mcp add daslang -- bin/daslang utils/mcp/main.das. Details: utils/mcp/README.md.

AI assistants: LSP server

The daslang LSP server (utils/lsp/) adds push diagnostics - after every edit the compiler and lint report into the assistant's context automatically - plus definition/references/hover/symbols/call hierarchy/implementation. It needs only the daslang binary and Python 3.

Claude Code sessions started at the daslang repo root (or at an installed SDK root) load it automatically via the checked-in .claude/skills/daslang-lsp/ plugin manifest. From any other directory, register it explicitly:

claude --plugin-dir /abs/path/to/daScript/utils/lsp/plugin

Any stdio LSP client can spawn bin/watchdog --lsp directly. Details: utils/lsp/README.md.

AI assistants: the language skill

skills/daslang/ is a standalone, self-contained daslang language reference in the Claude-skill format - SKILL.md plus per-topic references (types, functions, memory, macros, strings, JSON, ...), every example verified against the compiler. An agent session started at the SDK root picks it up automatically (it is mirrored at .claude/skills/daslang); for any other project, copy or link that directory into the project's .claude/skills/. The rest of skills/ covers task-specific ground - CLAUDE.md's table says when to read which.