# Nim

> Nim systems programming with Python-like syntax. Use for .nim files. Use when this capability is needed.

- Skill: `tomevault-io/nim` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/nim`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/nim/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/nim

---


# Nim

Nim v2.0 (2023/2024) made **ORC** (Deterministic Memory Management) the default. It compiles to C/C++/JS and offers Python-like syntax with C-like speeds.

## When to Use

- **Game Development**: Hot reloading and performance.
- **Embedded**: Compiles to small C code requiring no runtime.
- **Scripting**: Compiles so fast it feels like a script (`nim r`).

## Core Concepts

### Metaprogramming

First-class support. You can rewrite the AST to create DSLs.

### ORC

Cycle-collecting ARC. Automatic memory management without pauses.

### Backends

Can compile to C, C++, Objective-C, or JavaScript.

## Best Practices (2025)

**Do**:

- **Use `ARC/ORC`**: The default in v2.0. Clean up is deterministic (destructors).
- **Use `f-strings`**: `fmt"Hello {name}"`.
- **Use `karax`**: For frontend (compiling Nim to JS).

**Don't**:

- **Don't mix styles**: Choose PascalCase or camelCase (Nim is style-insensitive but consistency matters).

## References

- [Nim Lang](https://nim-lang.org/)

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/g1joshi) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-15 -->

