Skip to content

C17-based extended standard library, cross-language type system, and unit testing framework targeting Sega Dreamcast, Sony PSVita, Windows, Mac, Linux, Android, iOS, and WebAssembly.

License

Notifications You must be signed in to change notification settings

AaronGlazer/libgimbal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


libGimbal

libGimbal

C17-Based Extended Standard Library and Object-Oriented Type System
Explore the docs »

Cross-Platform · Cross-Language · High Performance

Overview

libGimbal aims to bring the high-level constructs and niceties of modern languages and their standard libraries to low-level C, where they can be implemented with a focus on performance for embedded devices and game consoles. libGimbal includes features typically found in core application frameworks such as Foundation, QtCore, or GLib, or in languages such as C# or Java. At its core, libGimbal utilizes an object-oriented dynamic type system, which allows C to transcend its own language limitations and provides a flexible avenue for interoperability with other languages.

Features

libGimbal is split into a series of APIs, featuring:

  • Containers and Data Structures
  • Generic Algorithms
  • Custom Allocators
  • Specialized Strings
  • Standard Library Utilities
  • Preprocessor Programming
  • Dynamic Type System
  • Threading and Concurrency
  • Unit Test Framework

Platforms

libGimbal is being actively tested in CI on the following targets:

  • Windows
  • MacOS
  • Linux
  • Sega Dreamcast
  • Sony PSVita
  • WebAssembly
  • iOS
  • Android

Compilers

libGimbal is being built in CI with the following compilers:

  • Microsoft Visual Studio
  • GCC
  • Clang
  • MinGW-w64
  • Emscripten

Building

Building is done with standard CMake, and all generators and mainstream compilers should be supported. You should be able to open CMakeLists.txt directly as a project file in most IDEs such as MSVC, XCode, Qt Creator, CLion, etc if you wish to build from a UI.

First, ensure submodules are installed with:

git submodule update --init --recursive

To build the project and its unit tests from the command-line, you can do the following:

mkdir build
cd build
cmake -DGBL_ENABLE_TESTS=ON ..
cmake --build . 

Bindings

LibGimbal was specifically written with language interoperability in mind. As such, we will be happy to support and feature bindings to your favorite language. The following is a list of libraries which offer bindings between libGimbal and other languages:

Library Language Status
Jimbal Jai Nearly complete, lacking bindings for inline functions
Gimbalsaurus Objective-C Just getting off the ground
libGimbal C++ First-party within source-tree. Just starting, WIP.

APIs

The following is a closer look at the contents of each API:

Core Framework

  • platform-specific macros and utilities
  • error and exception handling
  • debug and verification utilities
  • structured logging with filtering
  • object-oriented threading and concurrency model

Strings

  • specialized, optimized custom string types
  • interned strings
  • reference-counted strings
  • string builders
  • implicitly shared string lists
  • pattern matching, regular expressions

Containers

  • STL-style abstract data types with both C and C++ APIs
  • dynamic arrays, lists, ring buffers
  • sets, trees, hash tables, byte arrays
  • support for custom allocators

Algorithms

  • hashing algorithms (Murmur, Sip, Fnv1, SuperFast)
  • sorting algorithms, searching algorithms
  • random data generators and utilities
  • CRC, parity, LCM, GCD, prime numbers

Allocators

  • allocation trackers with leak detection
  • paged arena allocators with state rewinding
  • stack-based scope allocator with destructor chains
  • efficient pool-based, arena-backed allocator

Preprocessor

  • function overloading support for C
  • macro compositon, variadic argument handling
  • cross-language C/C++ generic selection
  • meta macro programming constructs

Meta Type System

  • cross-language, extensible object-oriented type system
  • generic, polymorphic variant types with type conversions
  • virtual functions, inheritance, private members for C
  • mixins, interfaces, abstract classes
  • generic FFI with cross-language closures and marshals
  • property system
  • Qt/GTk style signal system
  • object hierarchy management, parenting, traversals
  • event handling, filtering, propagation
  • plugin and module system

Utilities

  • generic reference-counted types
  • command-line option and argument parsing
  • version, UUID, date-time utilities

Unit Testing Framework

  • cross-platform object-oriented C-based unit test framework
  • test scenarios, suites, cases
  • generic verification macros with source context capture
  • automatic timing and performance measurements
  • memory utilization and leak detection
  • dynamic/run-time test-plan construction and management

Credits

Author

Falco Girgis

Dependencies

About

C17-based extended standard library, cross-language type system, and unit testing framework targeting Sega Dreamcast, Sony PSVita, Windows, Mac, Linux, Android, iOS, and WebAssembly.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 92.5%
  • C++ 6.6%
  • CMake 0.9%