Today work has focused on finishing up my digging thorugh of the sighandler_t stuff and reporting on it, starting new work on reviews I got, and continuing work on the compiler.
The sighandler_t matters seem to only be solvable through the plan described in yesterday’s report. Basically, we keep two untagged variants in a disjoint union representing one of a raw value or a tagged disjoint union. The latter consists itself of the product between the unit and some function pointer.
This is far from ideal but it gets the job done just fine until (if) we get raw function pointers. The difference with prior approaches to this is that we keep a larger part of the interface private, and only choose to expose the raw function pointer polyfill that contains the overarching union.
I posted my findings as well as a link to a proposed use in Godbolt with constants of type sighandler_t that needed raw values and the null value. Then I got a bunch of new reviews on PRs, which I’m mostly done with.
The netlink PR is almost done. I pushed back on two things from last time’s review, one of which has derived into what I may potentially be focusing on once I’m done with all reviews. The other I got pushed back on again, and just yield, because it’s an unimportant detail about the way we structure our module tree.
The PR handling padding fields (the original one that got refactored into only changing private and already deprecated fields) has been merged. The other one that stemmed from this one (addressing public fields that will break fairly popular types) has also received feedback but I have yet to look through it.
The Linux uClibc LFS PR that asked for target maintainer approval has been dead for a month, and the only known active maintainer has been pinged again. I also got a little review on a tiny (and idiotic) mistake I made while setting up the unstable feature flag against which to expose the LFS functionality.
In terms of compiler work, I’m almost done with the refactor I started yesterday to allow constraining the expected expressions in a bunch of places. I also expanded the way I handle this particular usecase by creating new types that are known to encapsulate all expressions that can yield a given base expression (or literal.)
This I initially attempted to implement by using a set of sum types that took into consideration both a concrete set of expressions that only yield the base expression that the type represents, and a set of expressions that yield a more diverse array of expressions, one of which could be the target base expression.
But this was getting quite repetitive, so I instead decided to opt for a module functor that would automatically produce each type provided solely with the base specification of expressions that only yield the base expression. This took a bit of thinking to get right, because module types and module implementations can’t be nested as part of the same type recursive group in which the entire type infrastructure had been so far built upon.
So I read again through the OCaml reference manual, and remembered that I could potentially use an extensible generalized algebraic data type as part of the type recursive group, while only expanding on its variants later on once the modules were defined through applications of the module functor.
This seems to work out quite well because the type constructor used in the recursive binding group need not know of the variants of the type, so I just slap in there a polymorphic variant in place of the anonymous type variables of the above GADT.
I also wrote a bunch of documentation for some of the less obvious to understand types. There were also a bunch of refactors to make stuff like operators more precise in the types of expressions that can even be used as informal parameters to the data constructors. Now everything is more cohesive, and I think I can make some stuff in the dumb pattern binding validator more obvious to the external reader with these new constraints.
None.
I expect to be done with the reviews by tomorrow. Granted, something huge could come up with the latest ones, but I think I can do it. I don’t think I’ll be capable of moving on to the next thing I plan on. The goal would then be to extend ctest (our test harness) to allow selecting only a subset of Rust modules to test from the entire library.
The compiler work is progressing nicely. I’m not yet done with the refactor but I believe I should be done once I finish touching up the operator type. That I can probably end tomorrow, which sets us up for the rest of the week to see how the refactor works with our current pattern binding validator.