Abstraction as a Service

There's this neat software projected called Termible which creates terminal apps that you can add to your website. Just a little bit of JavaScript is all you need to get started. The application of such an application is quite fascinating:

[Termible allows users to] instantly interact with your product (a CLI tool, REST API, programming language, etc.) from the terminal without installation or even leaving the page.

A software terminal is already a bit of an abstraction. Scott Hanselman does a great job of explaining this:

The word Terminal comes from terminate, indicating that it's the terminating end or “terminal” end of a communications process. You'll often hear “dumb terminal” when referring to a text-based environment where the computer you are sitting next to is just taking input and showing text while the real work happens at the other end in a mainframe or large computer.

TTY or “teletypewriter” was the first kind of terminal. Rather than a screen you'd have a literal typewriter in front of you. When you type on it, you're seeing the text on a piece of paper AND inputing that text into a computer. When that computer replies, you'll see the typewriter automatically type on the same paper.

When we refer to a Terminal in the software sense, we're referring to a literal software version of a TTY or Terminal. The Windows Terminal is that. It's really good at displaying textual output. It can take input and pass it on. But the Terminal isn't smart. It doesn't actually process your input, it doesn't look at your files or think.

If a terminal displays textual output back, what's really doing the heavy lifting? As Hanselman further explains, it's the shell:

A shell is the program that the terminal sends user input to. The shell generates output and passes it back to the terminal for display.

How do I find out what shell my terminal is using? Apparently it's an environmental variable I can call upon.

echo $SHELL

If you run that above command on the Termible terminal on their home page, for example, it'll return that the terminal is using a bash shell. So we have a software terminal using a software shell.

And how does that terminal/shell pairing run on a browser in the first place? How does it become so easy that you can just add JavaScript to your site? Through the power of another abstraction called Docker. As Wikipedia explains (because I couldn't do it justice),

Docker is a set of platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels. Because all of the containers share the services of a single operating system kernel, they use fewer resources than virtual machines.

And that abstraction is probably hosted by a cloud provider, yet another abstraction, so that one can add some JavaScript fairy dust (an abstraction) to have a virtual terminal sitting on their website.

These layers of nested abstractions never cease to leave me utterly dumbfounded in wonder. It's no wonder then that someone who likes to have his head in the clouds wants to engineer them as a profession.