# teguh02/indonesiaku-lang architecture

> Architecture diagram of the GitHub repository teguh02/indonesiaku-lang, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/teguh02/indonesiaku-lang
- Repository: https://github.com/teguh02/indonesiaku-lang

## Overview

Indonesiaku is an Indonesian-syntax programming language implemented as a C bytecode virtual machine. Its principal workflow is source input through scanning and compilation, then bytecode execution with values, objects, and native-library support. The repository also includes a VS Code language/debugging experience and a web playground. The graph reflects the sampled files and SOURCE INDEX; several documented standard-library capabilities are grouped because their implementation details were not sampled.

Main entry points: [`src/vm.c`](https://github.com/teguh02/indonesiaku-lang/blob/main/src/vm.c) (Virtual machine), [`editors/vscode-indonesiaku/extension.js`](https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/extension.js) (VS Code extension), [`src/main.c`](https://github.com/teguh02/indonesiaku-lang/blob/main/src/main.c) (CLI and REPL), [`src/compiler.c`](https://github.com/teguh02/indonesiaku-lang/blob/main/src/compiler.c) (Bytecode compiler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Language runtime"]
  node_cli["CLI and REPL<br/>[main.c]"]
  node_scanner["Source scanner<br/>[scanner.c]"]
  node_compiler["Bytecode compiler<br/>[compiler.c]"]
  node_chunk["Bytecode chunks<br/>[chunk.c]"]
  node_vm["Virtual machine<br/>[vm.c]"]
  node_values["Values and objects<br/>[value.c]"]
  node_memory["Memory and GC<br/>[memory.h]"]
end

subgraph group_stdlib["Standard library"]
  node_natives["Native functions<br/>[native.c]"]
  node_system["OS and files<br/>[sistem.c]"]
  node_database["SQLite support<br/>[db.c]"]
  node_patterns["Pattern matching<br/>[pola.c]"]
  node_crypto["Hash and crypto<br/>[kripto.c]"]
  node_archives["Archive support<br/>[arsip.c]"]
  node_compression["Compression<br/>[kompres.c]"]
end

subgraph group_editor["VS Code tooling"]
  node_extension["VS Code extension<br/>[extension.js]"]
  node_language["Language data<br/>[language-data.js]"]
  node_formatter["Formatter and source tools<br/>[awakutu-sumber.js]"]
  node_lsp["Language server<br/>[server.js]"]
  node_dap["Debug adapter<br/>[debug-adapter.js]"]
  node_debugprocess["Debugger process client<br/>[awakutu-proses.js]"]
end

subgraph group_playground["Web playground"]
  node_playground["Playground server<br/>[server.py]"]
end

node_programmer(("Programmer"))
node_source["Indonesiaku source"]
node_editoruser(("VS Code user"))
node_playuser(("Playground user"))

node_programmer -->|"writes"| node_source
node_source -->|"runs"| node_cli
node_cli -->|"compiles"| node_compiler
node_compiler -->|"scans"| node_scanner
node_compiler -->|"emits bytecode"| node_chunk
node_cli -->|"executes"| node_vm
node_vm -->|"reads bytecode"| node_chunk
node_vm -->|"operates on"| node_values
node_values -.->|"allocates through"| node_memory
node_vm -->|"dispatches natives"| node_natives
node_natives -.->|"uses OS services"| node_system
node_vm -->|"uses"| node_patterns
node_vm -->|"uses"| node_crypto
node_vm -->|"uses"| node_archives
node_vm -->|"uses"| node_compression
node_source -.->|"can use SQLite"| node_database
node_editoruser -->|"edits and debugs"| node_extension
node_extension -->|"hosts adapter"| node_dap
node_dap -->|"controls process"| node_debugprocess
node_extension -.->|"provides source tools"| node_formatter
node_formatter -->|"uses language data"| node_language
node_extension -.->|"uses language server"| node_lsp
node_lsp -->|"uses language data"| node_language
node_playuser -.->|"submits programs"| node_playground
node_playground -.->|"runs sandboxed"| node_cli

click node_cli "https://github.com/teguh02/indonesiaku-lang/blob/main/src/main.c"
click node_scanner "https://github.com/teguh02/indonesiaku-lang/blob/main/src/scanner.c"
click node_compiler "https://github.com/teguh02/indonesiaku-lang/blob/main/src/compiler.c"
click node_chunk "https://github.com/teguh02/indonesiaku-lang/blob/main/src/chunk.c"
click node_vm "https://github.com/teguh02/indonesiaku-lang/blob/main/src/vm.c"
click node_values "https://github.com/teguh02/indonesiaku-lang/blob/main/src/value.c"
click node_memory "https://github.com/teguh02/indonesiaku-lang/blob/main/src/memory.h"
click node_natives "https://github.com/teguh02/indonesiaku-lang/blob/main/src/native.c"
click node_system "https://github.com/teguh02/indonesiaku-lang/blob/main/src/sistem.c"
click node_database "https://github.com/teguh02/indonesiaku-lang/blob/main/src/db.c"
click node_patterns "https://github.com/teguh02/indonesiaku-lang/blob/main/src/pola.c"
click node_crypto "https://github.com/teguh02/indonesiaku-lang/blob/main/src/kripto.c"
click node_archives "https://github.com/teguh02/indonesiaku-lang/blob/main/src/arsip.c"
click node_compression "https://github.com/teguh02/indonesiaku-lang/blob/main/src/kompres.c"
click node_extension "https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/extension.js"
click node_language "https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/language-data.js"
click node_formatter "https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/awakutu-sumber.js"
click node_lsp "https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/server.js"
click node_dap "https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/debug-adapter.js"
click node_debugprocess "https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/awakutu-proses.js"
click node_playground "https://github.com/teguh02/indonesiaku-lang/blob/main/docker/playground/server.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_scanner,node_compiler,node_chunk,node_vm,node_values,node_memory,node_editoruser,node_playuser toneBlue
class node_natives,node_system,node_database,node_patterns,node_crypto,node_archives,node_compression toneAmber
class node_extension,node_language,node_formatter,node_lsp,node_dap,node_debugprocess toneMint
class node_playground toneRose
class node_programmer,node_source toneIndigo
```

## Components

### Language runtime

- [CLI and REPL](https://github.com/teguh02/indonesiaku-lang/blob/main/src/main.c): `src/main.c`
- [Source scanner](https://github.com/teguh02/indonesiaku-lang/blob/main/src/scanner.c): `src/scanner.c`
- [Bytecode compiler](https://github.com/teguh02/indonesiaku-lang/blob/main/src/compiler.c): `src/compiler.c`
- [Bytecode chunks](https://github.com/teguh02/indonesiaku-lang/blob/main/src/chunk.c): `src/chunk.c`
- [Virtual machine](https://github.com/teguh02/indonesiaku-lang/blob/main/src/vm.c): `src/vm.c`
- [Values and objects](https://github.com/teguh02/indonesiaku-lang/blob/main/src/value.c): `src/value.c`
- [Memory and GC](https://github.com/teguh02/indonesiaku-lang/blob/main/src/memory.h): `src/memory.h`

### Standard library

- [Native functions](https://github.com/teguh02/indonesiaku-lang/blob/main/src/native.c): `src/native.c`
- [OS and files](https://github.com/teguh02/indonesiaku-lang/blob/main/src/sistem.c): `src/sistem.c`
- [SQLite support](https://github.com/teguh02/indonesiaku-lang/blob/main/src/db.c): `src/db.c`
- [Pattern matching](https://github.com/teguh02/indonesiaku-lang/blob/main/src/pola.c): `src/pola.c`
- [Hash and crypto](https://github.com/teguh02/indonesiaku-lang/blob/main/src/kripto.c): `src/kripto.c`
- [Archive support](https://github.com/teguh02/indonesiaku-lang/blob/main/src/arsip.c): `src/arsip.c`
- [Compression](https://github.com/teguh02/indonesiaku-lang/blob/main/src/kompres.c): `src/kompres.c`

### VS Code tooling

- [VS Code extension](https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/extension.js): `editors/vscode-indonesiaku/extension.js`
- [Language data](https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/language-data.js): `editors/vscode-indonesiaku/language-data.js`
- [Formatter and source tools](https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/awakutu-sumber.js): `editors/vscode-indonesiaku/awakutu-sumber.js`
- [Language server](https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/server.js): `editors/vscode-indonesiaku/server.js`
- [Debug adapter](https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/debug-adapter.js): `editors/vscode-indonesiaku/debug-adapter.js`
- [Debugger process client](https://github.com/teguh02/indonesiaku-lang/blob/main/editors/vscode-indonesiaku/awakutu-proses.js): `editors/vscode-indonesiaku/awakutu-proses.js`

### Web playground

- [Playground server](https://github.com/teguh02/indonesiaku-lang/blob/main/docker/playground/server.py): `docker/playground/server.py`

### Other components

- **Programmer**
- **Indonesiaku source**
- **VS Code user**
- **Playground user**

## Connections

- Programmer → Indonesiaku source: writes
- Indonesiaku source → CLI and REPL: runs
- CLI and REPL → Bytecode compiler: compiles (evidence: `src/main.c`)
- Bytecode compiler → Source scanner: scans (evidence: `src/compiler.c`)
- Bytecode compiler → Bytecode chunks: emits bytecode (evidence: `src/compiler.c`)
- CLI and REPL → Virtual machine: executes (evidence: `src/main.c`)
- Virtual machine → Bytecode chunks: reads bytecode (evidence: `src/vm.c`)
- Virtual machine → Values and objects: operates on (evidence: `src/vm.c`)
- Values and objects → Memory and GC: allocates through (evidence: `src/value.c`)
- Virtual machine → Native functions: dispatches natives (evidence: `src/vm.c`)
- Native functions → OS and files: uses OS services
- Virtual machine → Pattern matching: uses (evidence: `src/vm.c`)
- Virtual machine → Hash and crypto: uses (evidence: `src/vm.c`)
- Virtual machine → Archive support: uses (evidence: `src/vm.c`)
- Virtual machine → Compression: uses (evidence: `src/vm.c`)
- Indonesiaku source → SQLite support: can use SQLite
- VS Code user → VS Code extension: edits and debugs
- VS Code extension → Debug adapter: hosts adapter (evidence: `editors/vscode-indonesiaku/extension.js`)
- Debug adapter → Debugger process client: controls process (evidence: `editors/vscode-indonesiaku/debug-adapter.js`)
- VS Code extension → Formatter and source tools: provides source tools
- Formatter and source tools → Language data: uses language data (evidence: `editors/vscode-indonesiaku/awakutu-sumber.js`)
- VS Code extension → Language server: uses language server
- Language server → Language data: uses language data (evidence: `editors/vscode-indonesiaku/server.js`)
- Playground user → Playground server: submits programs
- Playground server → CLI and REPL: runs sandboxed
