This year I've written a fdisk replacement in perl, to make hybrid MBR+GPT for bootable media.
First, I wanted to check how they were made, but then I decided I wanted to programmatically write hybrid MBR in a way that's easier than gdisk and that offers more control that xorriso.
It's not complete yet, but the partition reading feature was already very helpful to understand the ins and out of the mfg59 layout that's so popular for optical media, and the final gpt tweaks should only take a few more days.
perl allowed me to write it very quickly and to make sure it will work reliably for the years to come.