It runs! (Again.)
Not well. And not much. But not nothing!
There’s been a dearth of postings around here since (checks notes), February. Not ideal, and not consistent with my aspirations of more frequent posting. C’est la vie.
What happened was, back in February, after months of working on other things, I was inspired to pick up“Pick up” is doing a lot of work in that sentence: you rewrote it all in Kotlin. —ed my XProc 3.0 implementation again. I set myself a goal of having something ready for a public beta before XML Prague (2024!).
And I almost made it. By the last week of May, I was passing about 90% of the
test suite. Then I started investigating the tests related to
p:import-functions
. (Narrator voice: it did not go well.)
In order to pass those tests, you have to be able to run different sets of
extension functions in different steps…in the same pipeline. That’s a
problem because I’d copied the design of my 1.0 implementation in a critical
way: I was sharing a single Saxon Processor
object across all of the steps.
That’s convenient because it means they all share the same name pool and other
configuration features. Unfortunately, it also means they all share the same set of
extension functions.
Well, [expletive]!
It’s fixable. You can have different processors that share the necessary parts of the underlying configuration to work together. But it wasn’t going to be an easy refactor. I thought about pushing out a beta first, but I decided it was just going to do too much violence to the design. And the XML Prague deadline was self imposed after all.
So I took it to bits.
And I worked out a plausible design for sharing a configuration across steps in a way that allowed each step to have its own processor (and consequently its own set of extension functions).
And I started putting it back together again.
In principle, all the big pieces are the same and they do the same thing and they ought to fit back together again. But they don’t. Not exactly. Maybe they could, but some things would have to be forced and you’d probably have to file some parts down and…
So it took longer than I hoped. And the design has changedDon’t say “changed”, say “improved”, —ed in a few places. But the point is, I ran a pipeline again today for the first time since May. It compiled, and it ran, and it produced the right answer!
I’m not within a country mile of being done yet (well, maybe within a country mile) and I haven’t actually tested function imports. Heck, I haven’t got back to a place where I can practically run the test suite! But it feels a lot nicer to have something that runs! Even badly.