Closed BurningWitness closed 11 months ago
That looks like it covers quite a lot - this answers several of the open issues noted in the README, which saves me a good bit of time and work. Your effort is most appreciated!
I must digest / ponder some of the decisions you have made, may / may not make some changes or additions after comparing them with the intended hierarchy since I wish for there to be some level of structural parity between the lower and higher libraries, and so this would reflect on them as well. I'm going to have to think about exactly how and what to merge in - but I find myself already agreeing with it substantially already.
These changes have been manually merged in as best fit. 👍
Features:
botan-3.0.0
;capi
;Foreign.C.ConstPtr
is used, versions before that fall back toPtr
.Choices:
Every function is
safe
by default. As per the User's Guide,unsafe
calls block garbage collection and as such should only be used if you can prove a given call takes a small amount of time. It makes more sense to create unsafe copies of functions as you need them, appending_unsafe
to the name of the original.Basically no documentation. The header file holds all the useful information already, duplicating it is a waste of time. The
README
for the package should point this out;Since I was rewriting it from scratch I changed the module structure a bit. This PR as such most certainly breaks some code down the line.
Downsides:
ConstPtr
is going to be a mild nuisance as you can't simplycastPtr
from it, you need tocastPtr . coerce
. Developing under GHC 9.6+ is advisable.This PR does not cover linking, as that part is both completely separate from the code and hilariously arcane: there is no way to specify C library dependencies as static or dynamic, instead the system links static only if it can find the source to compile. I do not know if there exists any way to interface C library building either, that part is a wild jungle with seemingly no guidelines whatsoever. For now dynamic linking should be more than enough.