December Monthly update
It has been difficult to write this month, in part due to the holidays, and being ill for a few weeks, and then I had the bittersweet duties of hosting an early Christmas potluck for a dear friend before helping them move.
I have been busy working the fine details of a sizable update pending to the memalloc thread - this of course is where most of my energy has gone. It involves a rather careful peeling apart of the concepts of memory and arrays, which will get us closer to replacing ByteArrayAccess ba with something like MemoryAccess mem Byte allowing us to generalize to Bit, Byte, Word, and so on. Nomenclature is rather sticky* but I’ve done a great deal of disambiguation, and even have some examples now of ways that memory / addresses / allocations can break common expectations.
*Much like describing the generalized concept that collects handles, references, pointers, and arrays, without saying that they handle, refer to, point to, or arrange something, which is very easy to say colloquially eg “this handle points to something” even though only pointers should “point”, a handle “handles” something but my prose-ometer violently rejects such phrasing
In particular I’ve taken a good deal of influence taken from the Ix and Data.Array.IArray classes - in fact, there is now an Addr class that corresponds to a weaker notion in between Eq and Ix- it turns out that addresses are in general not orderable, not even partially orderable, but rather only pre-orderable because it is possible that a < a - as a concrete albeit historical example, the i8086 address space and its segmented pointers. Never have I needed a PreOrd class until now!
I have also been working on a pre-proposal to split up Data.Bits into a more structured hierarchy, because doing so has actually been helpful to achieve the above, and relates to MemoryAccess mem Bit as well. The proposal has both a simple proposed hierarchy of Boolean => Bitwise => Bitfield neé Bits, and an alternative extended hierarchy that goes as far as Boolean => Bitwise => Bitfield => IntegralBitfield => SignedIntegralBitfield => TwosComplementBitfield, which pairs nicely with Num* and fromInteger, and does things like eg disambiguate logical and arithmetic shifts.
* Since it effectively defines signOf / signNum and fromInteger / toIntegralBitfield, it could even be related to / placed underneath Num leaving it to be even more ring-ish except that would force every number-like thing to talk about binary representations which would be terrible.
Regardless of any acceptance of such proposal, the resulting typeclasses should have significant utility for eg low-level memory encoding and cryptography. Once I have finished the process of editing, I’ll be publishing the update to the memalloc thread as well.
Meeting Notes 12/8/25
Leo
- Out sick half of the week, still recovering
- Working on an update to
memalloc
- Working on a response to Jack’s questions am glad for the interest
- Looking at how to integrate / pull some allocation convenience functions from botan-low’s C FFI hook generator functions, so we can start using memalloc
- Focusing on integration, so providing a better surface API (eg botan)
Joris
- Working on hs-bindgen, its working
- Improvin it
- Inspirtion from rust bindings
- Same author as the C++ library
- Has a custom setup that configures botan bindings on the fly
- Relies on pkg-cfg for now, but almost ready with other options
- Example: rust bindings use pkgcfg or you can give a directory
- Also potential for vending the source directly
- Solves the problem of how to vend / surface botan while allowing the user to configure it
Jose
Meeting Notes 12/15/25
Joris
- Will be away next week because of holidays
- After the holidays will be working in a reduced capacity
- Continued improving the setup hooks script for botan bindings
- Supports using extra-include-dirs
- Work is mostly complete, waiting on hs-bindgen release
Leo
- Was sick w/ bad migraines (weather), little to report
Jose
Meeting Notes 12/22/25
Recovering , just me and Jose today , mostly just talked with Jose about what I’ve been looking at / working on
Leo
- Binary representations
- Looking at ‘array’ package for inspiration
- Breaking apart Data.Bits
- Creating a proper binary hierarchy
- All useful for cryptography / botan because BitString and stuff
- can use eg newtype MagnitudeBits a = Mk a to ‘pick’ out a specialized subset of bits to talk about, which is very useful
- Is-a vs has-a problems
- Eg is an allocator a memory space, or does it have a memory space
- Tried with DFs, FDs, indicates its my hierarchy thats the problem
- Studying Array a i e for inspiration, maybe Allocator alr lay aln
- Want to separate eg allocation vs address vs pointer
- Maybe decouple allocation from address - then allocation can have or can be
- Address vs eg additional allocation data eg refcount
- Trying to split up addressing, finding (suitable) addresses, storing at an address, reading from an address, registering that address, and releasing it
- Because an address space only cares about addresses, a memory space stores and loads at addresses so it is an address space but it doesn’t necessarily care about registering addresses its just putting a thing into the memory units according to a given layout - it says nothing about the memory space tracking what is where - and the allocator cares about vending objects which MAY involve registering addresses, if the allocation is an address and not a value being passed around
- Still trying to figure out how where to stitch / cross the threshold of ‘addr’ to ‘aln a’ to wrapping it again ‘bs = (ptr u8, int)’
- We’re basically taking a concrete type ‘Addr’, adding a phantom type by wrapping it as a ‘Ptr a’, then wrapping a concretized version of that as a ByteString = (Ptr Word8, Int)
- allocative functors between monofunctors and functors (constrained by size not type)
- haskell’s implicit allocator, every lifted value is a pointer which inverts things syntactically (we have ‘Int’ instead of ‘Lifted Int’) which makes things problematic
- Haskell modeled as an infinite register machine
- Problems of constraining allocation types - monomorphic
- How Storable is reallly about producing a Layout
- How Addr is between Ord and Ix (if we say Ord => Addr)
Jose
- Jose will be out next week for the holidays
Meeting Notes 12/29/25
No meeting / no notes (I would be the only one attending)
Leo
- Is working on this update / out for the holiday
Jose
Joris
- Is out for the holiday / working in a reduced capacity (but has continued to make commits - I see them!)