I was recently trying to track down a book I thought I'd bought as part of a Humble Bundle, so I read it in the last 10 years, probably closer to 5-6 years ago. The book was more didactic than story-based, with each chapter introducing a programming concept. More parable than fairy tale. It was short, less than 50 pages. I don't remember illustrations, but I feel like there would have had to have been. I thought the name was "Alice in Computerland" or something like that, but my searches on that name have turned up a number of nonmatching items such as Alicia's Miasadventures in Computer Land. I'm going to keep poking around my Humble library, but 10 years of purchases, and a somewhat outdated interface, means the page keeps locking up on me.
The Hello Ruby series was suggested to me, but does not look like a match, as it's set in the real world with tasks rather than someone in a fantasy world. In my book, it is a fantasy world, and I think that the protagonist female specifically talks to characters like the Mock Turtle, with concepts like loops and branching being explained by the conversation and activities of the characters.
I also don't believe it is micro:bit in Wonderland as I don't remember it involving hardware, and it was more of a "knock off" Wonderland than a straight usage of Carroll's setting and characters.