Otherwise rust-sdl2 is batteries included, there may be more ceremony than html5 canvas but it's easy to hide behind a simple interface. It has many simple examples.
But, like with C++, as long as the language doesn't come with a standard graphics library, I doubt the "official" books can really use graphics apps as a learning tool.
Easy to hide behind a simple interface if you already know the programming language. My suggestion is that someone perhaps should do just that so that beginners don't have to learn how to construct a simple interface at the same time as they are learning the language.
The MiniFB code does seem to be a good starting point for this sort of thing.
Yeah, I was just echoing your comment that you provide a small library for HTML5 canvas-based teaching. If I was going to teach someone Rust, I would definitely do that, but of course I (the teacher) would need to know enough to build it in the first place.
I absolutely advocate using graphics and games as the hook to keep people interested in learning. [1] "The immediacy of many 8-bit computers was awesome. Instant boot to a graphics-ready command line and program editor. I was instantly hooked". And that's why, despite the really bad fit, I support the addition of a 2d std library to C++, and would do likewise for Go, Rust, etc.
Otherwise rust-sdl2 is batteries included, there may be more ceremony than html5 canvas but it's easy to hide behind a simple interface. It has many simple examples.
But, like with C++, as long as the language doesn't come with a standard graphics library, I doubt the "official" books can really use graphics apps as a learning tool.