Standard library
Core
- BasicThe everyday toolbox: printing, strings and string builders, dynamic arrays, allocation and temporary storage, assert, logging, time, and a...
- Deep_CopyDeep copies of values and the data they point to, with Deep_Copy.
- ReflectionHelpers for working with type information at run time: integer ranges, struct members, enum names and values, and setting a value from text.
- Relative_PointersPointers stored as a small offset from their own address, so a block of memory that holds them can be written to a file or moved and still...
- Remap_ContextTurns a context built by another program into this program's #Context: remap_context returns it, Remap_Context() installs it for the rest...
- Runtime_Support
- Runtime_Support_Crash_Handler
- SoaFixed-size arrays of structs stored as one array per member: Soa(T, N).
Math and numbers
- Bit_OperationsByte swapping, bit scans and population count for integers of any size.
- Color_InterpolationFills an array with colors blended between keyframes, in RGB, HSV or Oklab.
- Float16The 16-bit IEEE half-precision storage format, with conversions to and from float32 and the Math vector and matrix types.
- MathVectors, quaternions, matrices, planes and the scalar math functions they build on.
- PCGA small 32-bit-output permuted congruential generator (XSH-RR) over a 64-bit state.
- RandomA fast 128-bit multiplicative generator for non-cryptographic random numbers.
- SIMDFixed-width vectors of lanes with lane-wise arithmetic, comparison, min/max and memory access.
- Sloppy_MathApproximate float comparison and the numeric limits of a type.
- SrgbConversion between sRGB-encoded and linear-light color values.
Memory and allocators
- Default_AllocatorThe general-purpose heap allocator behind context.allocator. It is thread safe, can create separate heaps, and tells you whether it owns a...
- Flat_PoolA bump allocator over one contiguous range of reserved address space.
- MemoryByte-copying helpers. copy is the one to use.
- Overwriting_AllocatorA debugging allocator that fills memory with a recognizable byte on allocation and on free.
- PoolA bump allocator over blocks of memory that are reused or freed all together.
- Unmapping_AllocatorA debugging allocator that turns use-after-free and buffer overruns into immediate crashes by giving each allocation its own pages.
- rpmalloc
Data structures and sorting
- Bit_ArrayA fixed-length sequence of bits packed into words.
- Bucket_ArrayA collection with stable element addresses, grown a fixed-size bucket at a time.
- Hash_TableTable(Key, Value) maps keys to values.
- IntroSortThe comparator sorts that Sort is built from, for callers that want a specific algorithm: intro_sort for general use, insertion_sort for...
- RadixSortRanks u32, u64 and float data by radix sorting, without moving it: sort fills a RadixSort, rank says which input element comes next, and...
- SortIn-place sorting of arrays by a comparator or a key, and ready-made comparators.
- XarA growable array whose elements never move, so pointers to them stay valid while you add more.
Text and formats
- Base64Base64 encoding and decoding, in the standard alphabet and the URL-safe one.
- Print_ColorColored text on the console. print_color prints with a color, with_console_color colors a block of code, and set_console_color with...
- StringSearching, comparing, splitting, trimming and scanning strings, and working with file paths.
- Subtitles
- Text_File_HandlerA line reader for simple text and configuration files.
- UnicodeDecoding and encoding UTF-8 text, one character at a time.
Files and OS
- Clipboard
- Command_LineReads the command line into a struct: declare the options as fields and call parse_arguments.
- FileOpening, reading, writing and managing files and directories by path.
- File_UtilitiesAsking about files, walking and copying folders, and taking paths apart.
- File_WatcherBeing told when files in a folder are created, changed, moved or removed.
- ProcessStarting programs, feeding them input and collecting their output and exit status.
- Simple_Package
- SystemAsks the operating system about the machine, the user and the running program.
Threads and concurrency
- AtomicsLock-free reads and updates of a shared integer, pointer or bool.
- Shared_Memory_ChannelA one-way message queue between two programs (or two parts of one) over shared memory.
- ThreadThreads and what they need to cooperate: Thread to run a procedure on its own thread, Mutex, Condition_Variable and Semaphore to...
Networking
Graphics and windows
- GLOpenGL bindings with a loader.
- GamepadThe state of the first connected game controller, read through SDL.
- SDL_Input_MapParses SDL game controller mapping strings, the guid,name,a:b0,leftx:a0,... lines of the SDL controller database.
- GetRect
- GetRect_LeftHanded
- Ico_File
- Icon
- ImGui
- InputKeyboard, mouse, touch and window events for windows made with Window_Creation.
- KeymapKey bindings that you can load from a text file.
- SDL
- SimpA small 2D renderer on OpenGL: coloured shapes, textures, text and render targets, drawn through immediate-mode calls.
- Window_CreationOpens native windows (Cocoa, Win32 or X11) with an OpenGL surface.
- Window_Type
Audio and video
Compression and hashing
- CrcA 64-bit CRC checksum: crc64 for detecting corrupted data.
- HashHash functions for strings, bytes and scalars: get_hash for general use, fnv1a_hash and sdbm_hash for bytes, djb2_hash for strings.
- Zip_File_Directory
- lz4
- md5MD5 digests as hex strings: md5 for checksums and legacy formats.
- meow_hash
- xxHashBindings to the xxHash library: fast non-cryptographic 32- and 64-bit hashes of a buffer (native_XXH32, native_XXH64), or of data fed in...
Debugging, profiling and testing
- Debug
- Debug_InfoReads the debug information in a compiled program: DWARF (Linux and macOS) and CodeView in PDB files (Windows).
- IprofA frame profiler with a text report and an optional overlay.
- Performance_Report
- Print_VarsPrints the source text, value and type of expressions: print_vars(x, y) writes one line per variable, like x = 7 (s32). print_vars_to...
- Protocol_For_Memory_Visualization
- Treemap
- telemetry3
Compiler and metaprogramming
- Autorun
- Bindings_Generator
- BuildCpp
- CheckA build plugin that catches mistakes common in code ported from C: fixed arrays used as pointers, and small integers added without a cast.
- Code_VisitWalks the nodes of a Compiler.Code_Node tree.
- CodexRecords facts about a build in a .codex file: the modules and files it loaded, and per-procedure code metrics such as call counts and loop...
- CompilerThe metaprogramming API: create and drive builds ("workspaces") from compile-time code, read and edit the program as syntax trees, and...
- Default_Metaprogram
- Example_Plugin
- Generate_C_Header
- Jai_LexerTurns Jai source text into tokens, with their types, values and positions.
- MacOS_Bundler
- Machine_X64
- Metaprogram_Plugins
- Minimal_Metaprogram
- Program_PrintTurns compiler code nodes back into Jai source text.
- Project_Generator
- Rewrite
- executable_formats
- linux_build
Platform bindings
- Android
- AAudio
- EGL
- Toolchain
- Linux
- Metal
- MojoShader
- Objective_C
- AppKit
- POSIX
- Vulkan
- Wasi_Numeric_Runtime
- Windows
- Windows_Registry
- Windows_Resources
- Windows_Utf8
- X11
- d3d11
- d3d12
- d3d_compiler
- dxc_compiler
- dxgi
- freetype
- iOS
- macOS
- meshoptimizer
- nvidia_aftermath
- nvtt
- stb_image
- stb_image_resize
- stb_image_write
Extensions
Core
Math and numbers
Data structures and sorting
Text and formats
- Byte_SearchextensionFast searches for bytes and substrings, with vector instructions.
- Jai_FormatextensionA source formatter for Jai: indentation, spacing, brace placement and blank lines. It is text in, text out, with no file access of its own....
- JsonextensionJSON to and from your own types. to_json encodes a value and from_json decodes text into a type; both are generated from the type at...
- RegexextensionRegular expressions with full Unicode support, whose patterns can be compiled while your program compiles. compile builds one at run time;...
- String_LiteralexperimentalextensionWhere a byte of a string literal's value sits in the source.
- Text_BufferexperimentalextensionAn editable UTF-8 text buffer with undo, for editors.
Files and OS
- ArgsextensionCommand-line parsing from a struct: each field is an option, notes like @short=c refine it. parse handles --help, --version and bad input...
- AssetsextensionLoad a file a program ships with (a texture, a sound, a level) by a relative path, from disk natively and over fetch() in the browser...
- EnvironmentextensionReading the variables the program was started with.
Threads and concurrency
Networking
Graphics and windows
- ImageextensionDecodes, encodes and transforms raster images (PNG, JPEG, QOI, BMP and PNM) in plain Jai, on every target including wasm.
- SDL3extension
- UIexperimentalextensionA native user interface library for jaic programs.
- WebGPUexperimentalextensionWebGPU through the standard C API (webgpu.h). Natively the calls go to wgpu-native; in the browser playground they go to the page's WebGPU.
Compression and hashing
Debugging, profiling and testing
- FuzzexperimentalextensionBuilds random arguments from a type's layout and runs fuzz cases over them. gen makes a value from a seeded Rng, favouring the edge cases...
- TestingextensionA test framework. A test is a procedure with a @test note, found at compile time and run by jacket test. The expect* checks report a...
- DiscoveryextensionThe metaprogram plugin behind jacket test: jaic tests.jai +Extensions/Testing/Discovery. It collects the program's procedures with a @test...