-
Notifications
You must be signed in to change notification settings - Fork 9
TopShell: Reimagined Terminal and Shell
I was never comfortable in Bash. Doing anything that didn't fit in one line filled me with doubt. Did this piece of Bash do what I thought it would do?
It almost never did. Forgivingly, Bash let me use undefined variables. Bash let me continue executing dangerous commands even after an error had put my script in a broken state. The simplest of calculations I often got wrong. Anything interesting required learning some arcane language like sed
and awk
. Not to mention literally hundreds of tiny, faulty parsers I've written over the years to deal with one-of-a-kind textual output from commands.
So I started to imagine what a terminal might look like, if freed from the constraints of the 1970'ies.
Programmatic, interactive access to the operating system is a great achievement of Unix, and something that I rely on completely in my daily interaction with computers.
I do a lot of remote server administration using the very same interface, via SSH. I wouldn't want to be stuck without that.
The ability to compose commands together with pipes is what lets you solve certain things quickly in Bash. I feel composition could be emphasized even more.
I/O is the main thing I do in a terminal. There's a well researched tool that can tame the messy world of I/O, and that tool is called purely functional programming. Computation and effects are neatly separated, so that there are no unpleasant surprises. A modern type system can even tell us about the effects there's going to be even before we run the script.
Like the terminal and shell, there's a need for a user interface that lets us write small pieces of code and see their results immediately. But today, those results needn't be textual - it might as well be an image or indeed an animation.
Composing programs can be done with asynchronous tasks and reactive streams, the modern version of processes and pipes. And pure computation can be done in a straightforward way within a functional programming language.
All of this can be done within such languages today, but it takes quite a bit of effort. What I wanted was an environment where all this could be done easily.
Read the readme, try the online playground or download TopShell.