Skip to content
greycat-c logo

GreyCat SDK - C API & Standard Library

greycat-c

GreyCat C API and GCL Standard Library reference. Use for: (1) Native C development with gc_machine_t context, tensors, objects, memory management, HTTP, crypto, I/O; (2) GCL Standard Library modules - std::core (Date/Time/Tuple/geospatial types), std::runtime (Scheduler/Task/Logger/User/Security...

SKILL.md

Full skill instructions

GreyCat SDK - C API & Standard Library

Comprehensive reference for GreyCat native development (C API) and the GCL Standard Library.

Contents

  1. C API - Native function implementation, tensor operations, object manipulation
  2. Standard Library (std) - GCL runtime features, I/​O, collections, and utilities

GreyCat C API

Core Concepts

gc_machine_t - Execution context passed to all native functions. Use to get parameters, set results, report errors, and create objects.

gc_slot_t - Universal value container (union type) holding any GreyCat value: integers, floats, bools, objects, etc.

gc_type_t - Type system enum defining all GreyCat types (null, bool, int, float, str, object, static_field, etc.).

Common Operations

Parameter handling:

gc_slot_t param = gc_machine__get_param(ctx, offset);
gc_type_t type = gc_machine__get_param_type(ctx, offset);

Object field access:

gc_slot_t value = gc_object__get_at(obj, field_offset, &type, ctx);

Tensor operations:

gc_core_tensor_t *tensor = gc_core_tensor__create(ctx);
gc_core_tensor__init_2d(tensor, rows, cols, gc_core_TensorType_f32, ctx);
f32_t val = gc_core_tensor__get_2d_f32(tensor, row, col, ctx);

Memory management:

char *temp = (char *)gc_gnu_malloc(size);      // Per-worker allocator
double *shared = (double *)gc_global_gnu_malloc(size);  // Global allocator

Detailed Reference

File: references/​api_reference.md (1,461 lines)

Load when implementing:

  • Native C functions with gc_machine_t
  • Tensor operations (multi-dimensional arrays)
  • Object/​field manipulation, type introspection
  • Buffer building, string operations
  • HTTP client, cryptography, I/​O operations

Contains: Complete function signatures, real production examples, and documentation for Machine API, Object API, Tensor API, Array/​Table APIs, Buffer/​String APIs, Memory Allocation, Program/​Type System, HTTP Client, Cryptography, and I/​O.


GreyCat Standard Library (std)

Module Organization

  • std::core - Fundamental types (Date, Time, Duration, Tuple, Error, geospatial types, enumerations)
  • std::runtime - Scheduler, Task, Job, Logger, User/​Security, System, ChildProcess, License, OpenAPI, MCP
  • std::io - Text/​Binary I/​O, CSV, JSON, XML, HTTP client, Email/​SMTP, FileWalker
  • std::util - Collections (Queue, Stack, SlidingWindow, TimeWindow), Statistics (Gaussian, Histogram), Quantizers, Assert, ProgressTracker, Crypto, Random, Plot

Detailed Reference

File: references/​standard_library.md (957 lines)

Load when working with:

  • Task scheduling and automation (Scheduler with periodicities)
  • File I/​O operations (CSV, JSON, XML, binary files)
  • HTTP integration and REST APIs
  • Statistical analysis and data processing
  • Security, authentication, and user management
  • System operations and logging

Contains: Complete documentation for all four standard library modules with code examples, usage patterns, and best practices.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View