Skip to content
Joakim Ahnfelt-Rønne edited this page Jul 22, 2019 · 28 revisions

Is TopShell a shell?

TopShell is not a traditional Unix shell. The experience is much closer Jupyter, ObservableHQ or Matlab than eg. Bash. However, according to Wikipedia, it might just be a shell in the more general sense:

In computing, a shell is a user interface for access to an operating system's services. In general, operating system shells use either a command-line interface (CLI) or graphical user interface (GUI), depending on a computer's role and particular operation. It is named a shell because it is the outermost layer around the operating system kernel.

Regardless, it's perhaps better to think of it as a purely functional scripting language and environment.

Why are the binaries so big?

The TopShell binary is a single exectuable file that includes a virtual machine, a standard library, a compiler, a web server, a code editor, and assets, in about 40 mb. Pretty big.

To put that into perspective - the recommended way of running Jupyter is to run a 500+ mb installer.

Compared to most language distributions, TopShell is actually rather slim. Consider the following downloads: Go (~120 mb), GCC (~120 mb) and Java (~150 mb).

And this is as it should be, considering that TopShell is still a young project.

Why does TopShell run in a browser?

The browser contains the only cross-platform UI framework that's preinstalled on practically all desktop systems, and one of the most widely implemented virtual machines. It's quite common to have a browser running all day long. In that light, running in a browser tab is quite lightweight.

Is TopShell written in JavaScript?

The compiler is written in Scala and compiled to JavaScript using Scala.js. TopShell itself also compiles to JavaScript, and there's a simple FFI for exposing JavaScript functions to TopShell in a statically typed manner.