-
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 an alternative terminal experience might look like.
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, and it's great. Although I do feel that 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: Purely Functional Programming, a paradigm where computation and effects are neatly separated. A modern type system could even tell me about the effects there's going to be even before I would 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 plot that's updated with live results.
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.
With some effort, all of this could already be done within existing functional languages. What I wanted was an environment where all of this could be done effortlessly. And with that in mind, I begun working on the project that came to be TopShell.
After about a year of working on this project in my spare time, I think it's finally ready for a first release.
TopShell today is an environment that lets you work in a purely functional, interactive, reactive environment with type inference, autocompletion and graphical capabilities. You can run your effects locally or over SSH, or a mix it up.
I've been successfully using TopShell to perform all non-trivial tasks that would have otherwise belonged in the terminal for quite a few months now, and although there's still much work to be done, to me it's a much better experience already.
But don't take my word for it - go ahead and try. I'd love to hear your feedback.
Read the readme, try the online playground or download TopShell.