Skip to content

Instantly share code, notes, and snippets.

You are an autonomous coding agent.

Inputs

  1. SPEC.md — the complete product specification (must be read in full).
  2. All API documentation files located in @docs/*.md (read every file in full).

Task After fully reading and understanding all provided materials:

C→Nim Manual Wrapping Skills

1. Purpose

A C→Nim wrapper exposes a C library to Nim while preserving ABI correctness and offering an idiomatic Nim API. The goals are:

  • ABI correctness: exact layouts, calling conventions, and signatures.
  • Nim ergonomics: safer, clearer, and more “Nim-like” usage.

Recommended two-layer design:

Nim ↔ C Bindings — Operational Rules

Scope

  • This is a prescriptive rulebook for building Nim bindings to C libraries across Linux, macOS, and Windows.
  • Use it as a checklist for reliable CI builds and portable runtime behavior.

Core Workflow (Binding + Build)

  • Use importc with callconv: cdecl for C APIs unless the library explicitly uses a different calling convention.
  • Represent opaque C handles as distinct pointer types in Nim.
  • For partial or opaque C structs, use incompleteStruct to avoid size/layout mismatches.
@planetis-m
planetis-m / fedora_guide.md
Created January 29, 2026 19:01 — forked from yokoffing/fedora_guide.md
Fedora setup

Fedora GNOME setup

Mostly to help me keep track of my doings in Linux Fedora.

Context

             .',;::::;,'.                 yokoffing@my-fedora
         .';:cccccccccccc:;,.             -------------------
      .;cccccccccccccccccccccc;.          OS: Fedora Linux 40 (Workstation)
    .:cccccccccccccccccccccccccc:.        Host: 2020 XPS 15 9500

Engineering Specification: KDEAI Translation System

Version: 1.0
Status: Implementation Ready
Runtime: Python 3.12+
Storage: SQLite
Key libraries: polib, portalocker, spaCy, sqlite-vector


Raspberry Pi Headless Setup Guide

Prerequisites

  • Raspberry Pi (tested on Pi 3A+)
  • MicroSD card (minimum 8GB recommended)
  • SD card reader
  • Linux computer for setup
  • WiFi network (2.4GHz for Pi 3A+)

Nimony + raylib Tic-Tac-Toe

A minimal, single-file Tic-Tac-Toe game in Nim using raylib. It demonstrates a multi-threaded setup with a custom FFI wrapper for the shared library.

Prerequisites

  • Nimony compiler
  • A C compiler and raylib development libraries. See the official raylib wiki for platform-specific setup instructions.

Build & Run

Nimony + raylib Tic-Tac-Toe

A minimal, single-file Tic-Tac-Toe game in Nim using raylib. It demonstrates a multi-threaded setup with a custom FFI wrapper for the shared library.

Prerequisites

  • Nimony compiler
  • A C compiler and raylib development libraries. See the official raylib wiki for platform-specific setup instructions.

Build & Run

@planetis-m
planetis-m / MakeExamples.md
Created October 28, 2025 14:39
Prompts for Nimony release announcement

Prompt: Demonstration Example Generator

You are an AI assistant tasked with writing a demonstration code example showcasing the currently working features of the Nimony toolchain and standard library ports. This example is aimed at experienced programmers who prefer clarity and grounded demonstrations over hype.

Important: You must only use features and modules that are confirmed working in the implementation state described in the extracted feature list. Do not assume or invent features.

I will provide:

  1. A feature list of constructs currently working
@planetis-m
planetis-m / example1.nim
Last active October 30, 2025 20:28
Demonstration examples for nimony
import std / [syncio, tables, hashes, intsets, assertions]
type
Point = object
x, y: int
Drawable = concept
proc draw(p: Self)
proc draw(p: Point) =