Giter VIP home page Giter VIP logo

cauldron's Introduction

cauldron

A collection of single-file C libraries and tools with the goal to be portable and modifiable.

Tests

Libraries

library description language
arena-allocator.h drop in arena allocator C
arg.h POSIX compliant argument parser based on plan9's arg(3) C/C++
bench.h micro benchmarking framework C/C++
random.h literate random number library and tutorial (related talk) C/C++
stretchy-buffer.h generic dynamic array C
test.h minimal unit testing C/C++

Tools

Bithacks

Random

Similar projects

Licensing

For all files without a integrated license LICENSE applies.

cauldron's People

Contributors

camel-cdr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cauldron's Issues

Switch random.h to a hybrid stb style header only library

This recent reddit post outlined some problems with header only libraries in c.

TLDR: Static functions will get omitted in every translation unit separately.

I still want to maintain the header only part though, especially for random.h, as splitting it up would break the literate programming style.
Ideally I'd use a hybrid stb style, where the longer functions, like most the distributions, are only implemented if RANDOM_H_IMPLEMENTATION is defined and all the other smaller functions are still static inline.

This would either require a header of forward declarations, which could be merged with the API overview chapter, but this would require about tree to four time more lines for the chapter.
Or the RANDOM_H_IMPLEMENTATION guard could also be used on a per function/chapter basis. If I choose this solution I'll probably also remove some *_AVAILABLE guards that check for uintN_t and the floating point format and combine the checks into one that does #error if the features aren't available.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.