TINN RebootPosted: January 14, 2015
I always dread writing posts that start with “it’s been a long time since…”, but here it is.
It’s been a long time since I did anything with TINN. I didn’t actually abandon it, I just put it on the back burner as I was writing a bunch of code in C/C++ over the past year. I did do quite a lot of experimental stuff in TINN, adding new interfaces, trying out new classes, creating a better coroutine experience.
The thing with software is, a lot of testing is required to ensure things actually work as expected and fail gracefully when they don’t. Some things I took from the ‘experimental’ category are:
fun.lua – A library of functional routines specifically built for LuaJIT and it’s great handling of tail recursion.
msiterators.lua – Some handy iterators that split out some very MS specific string types
Now that msiterators is part of the core, it makes it much easier to do things like query the system registry and get the list of devices, or batteries, or whatever, in a simple table form. That opens up some of the other little experiments, like enumerating batteries, monitors, and whatnot, which I can add in later.
There are not earth shattering, and don’t represent a year’s worth of waiting, but soon enough I’ll create a new package with new goodness in it. This begs the question, what is TINN useful for? I originally created it for the purpose of doing network programming, like you could do with node. Then it turned into a way of doing Windows programming in general. Since TINN provides scripted access to almost all the interesting low level APIs that are in Windows, it’s very handy for trying out how an API works, and whether it is good for a particular need.
In addition to just giving ready access to low level Windows APIs, it serves as a form of documentation as well. When I look at a Windows API, it’s not obvious how to handle all the parameters. Which ones do I allocate, which ones come from the system, which special function do I call when I’m done. Since I read the docs when I create the interface, the wrapper code encapsulates that reading of the documentation, and thus acts as an encapsulated source of knowledge that’s sitting right there with the code. Quite handy.
At any rate, TINN is not dead, long live TINN!