Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Standard JPEG library
#include <jpeglib.h>
// Your local PDFium headers
#include "pdfium/include/fpdfview.h"
#include "pdfium/include/fpdf_text.h"
import std/[algorithm, monotimes, strformat]
import ../magiccontainer/src/magiccontainer
import ../sparseset/sparseset
type Payload = object
value: int
type PhaseTimes = object
insertNs: int64
lookupNs: int64
import std/tables
import jsonx
import jsonx/parsejson
type
ArchitectureKind = enum
akGlm4Moe
akGlm4MoeLite
akNemotronH
import vulkan, vulkan_wrapper, vulkan_functions, vulkan_shaderc,
std/math, chroma, pixie/fileformats/qoi
const
Width = 1024
Height = 1024
type
WorkgroupSize = object
x, y: uint32
#
#
# Nim's Runtime Library
# (c) Copyright 2010 Andreas Rumpf
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
#
## The `parsecfg` module implements a high performance configuration file

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