joka ~main

A nogc utility library.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

🃏 Joka

A nogc utility library for the D programming language. Joka provides data structures and functions that can work without garbage collection, offering precise memory control. It is designed to complement the D standard library, not replace it.

Why Joka

  • Minimalistic: Avoids abstractions
  • Focused: Doesn't try to support every use case
  • Simple: Uses a single global allocator, set at compile time
  • Friendly: Memory-safety features and many examples

WebAssembly Support

WebAssembly is supported with the betterC flag, but a tool like Emscripten is required. In case of errors, the i flag may help. The combination -betterC -i works in most cases.

Modules

  • joka.algo: Range utilities
  • joka.ascii: ASCII string utilities
  • joka.cli: Command-line parsing utilities
  • joka.containers: General-purpose containers
  • joka.interpolation: IES support
  • joka.io: Input and output functions
  • joka.math: Mathematical data structures and functions
  • joka.memory: Functions for dealing with memory
  • joka.types: Common type definitions
  • joka.stdc: C standard library functions

Versions

  • JokaCustomMemory: Allows the declaration of custom memory allocation functions
  • JokaGcMemory: Like JokaCustomMemory, but preconfigured to use the D garbage collector

Documentation

Start with the examples folder for a quick overview.

Frequently Asked Questions

Does Joka have an allocator API?

No. Joka is designed to feel a bit like the C standard library because that's easier for most people to understand and keeps the library simple.

Will Joka get a global context like Jai?

No. A public global context tends to make generic low-level APIs fragile. That doesn't mean it's a bad idea. It can be useful for libraries with a specific purpose, such as UI frameworks.

Why aren't some functions @nogc?

Because the D garbage collector can be used to allocate memory with the JokaGcMemory version.

Why are you supporting the D garbage collector?

It's another tool for memory management. Joka normally uses a tracking allocator in debug builds to help identify mistakes, but the JokaGcMemory version exists for people who prioritize safety. This approach is similar to the one used in Fil-C.

What is Joka used for?

It's primarily used for Parin, a game engine.

Authors:
  • Alexandros F. G. Kapretsos
Dependencies:
none
Versions:
0.1.3 2025-Dec-05
0.1.2 2025-Dec-03
0.1.1 2025-Dec-02
0.1.0 2025-Oct-26
0.0.42 2025-Sep-28
Show all 47 versions
Download Stats:
  • 0 downloads today

  • 8 downloads this week

  • 37 downloads this month

  • 374 downloads total

Score:
1.4
Short URL:
joka.dub.pm