>>27You don't write a lib to make the lib itself easier to write, you write libs so the users can get their fucking work done.
This really needs to be emphasized more. There's a certain amount of complexity you need in order to make it useful beyond the most trivial use cases.
For example, the libzahl interface doesn't make it possible to reset the error jmp_buf once setup, nor can you chain error handlers together. And without the ability to specify your own allocators, recovering from an error is difficult because you then need to keep references to all of your integer objects in some global or top-level data structure allowing you to get at them to recover memory.
With custom allocators, generally you have a function that lets you reset the allocator to its initial state in a single fast function call, invalidating everything that was allocated from it. It ends up being a much simpler design for people to use.
Why is this important? Imagine you're writing another library that uses libzahl, and you want to play nicely with programs or other libraries that use your library and libzahl directly.
I do think using setjmp/longjmp and/or error callbacks is the right design now though. Error return codes was a mistake I ended up regretting in hebimath. Mattias showed me the light.
>>28Yay
! Just wait until this[1] is ready
![1]
https://github.com/suiginsoft/hebimath/tree/wip