Skip to content

Instantly share code, notes, and snippets.

@runarorama
Created February 2, 2022 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save runarorama/99df507d70652ab3cc04a57c0ecc58ac to your computer and use it in GitHub Desktop.
Save runarorama/99df507d70652ab3cc04a57c0ecc58ac to your computer and use it in GitHub Desktop.

Unison 2021 year in review

2021 was a big year for Unison. We released a new alpha version roughly every other month, and each release came with some serious improvements. In total, we merged more than 600 pull requests, 48 of which were from the open-source community.

Here are some of the highlights.

A beautiful GUI for browsing the Unison codebase

Since a Unison codebase is not stored in text files, it's been a sticking point for developers that they haven't been able to easily browse their code and post it online for others to see. So this summer we rolled out a new user interface for browsing the Unison codebase through a web browser. This comes embedded in the Codebase Manager, so now when you start up ucm it also starts a local web server that lets you browse and search your code in a delightful way.

All the code shown in the UI is hyperlinked to support clicking through to definitions. Documentation (written in Unison! — see below) is beautifully rendered.

We have big plans for this UI, and in time it might become a full-fledged IDE for Unison.

(embed gif of codebase UI here)

Unison Share community hub

We launched a new community hub at share.unison-lang.org where people can share their Unison code for others to see. It also aims to be the place developers go to read API documentation. It already hosts a whole bunch of libraries from the community, as well as the Base libraries.

This site is running a version of the codebase UI, so the experience of browsing your local codebase vs a publicly shared library should be more or less the same.

Computable documentation format

This past summer we rolled out a powerful new computable documentation format which makes it a joy to write deeply interlinked documentation with embedded live examples. Documents are ordinary Unison values, so docs are actually written in Unison.

For an example of this in action, see the documentation for the List data type in the Base library. All the examples are typechecked and evaluated live. Every Unison symbol that appears in the document is hyperlinked to its definition.

See also our recently published article "Spark-like distributed datasets in under 100 lines of Unison". This article is 100% written in Unison. The code for the article is on Unison Share.

Codebases are now SQL databases

The first alpha release of Unison stored the codebase in a directory structure, similar to how e.g. Git stores repositories. Alpha testers quickly ran into the limitations of this format, so last year Unison switched over to using a SQLite database to store the code. Some codebases saw a 99.5% reduction in size as a result of this, UCM uses up to 75x less RAM, and the whole experience of manipulating the codebase is much snappier.

New, faster Unison runtime

That first alpha version of Unison also ran on an inefficient runtime that was more of a proof-of-concept than anything else. We replaced it with an efficient virtual machine that piggybacks on the Haskell VM. It's much faster, and has revamped I/O and concurrency primitives including software transactional memory, and more. The new runtime uses a traditional compiler pipeline which takes the code through several intermediate stages before execution.

Standalone binaries

We also added experimental support for self-contained bytecode files. You can now use a command compile.output main binary from within UCM and it will output a small precompiled file binary.uc that contains your main function and its minimal dependencies. This can be executed from the command line via ucm run.compiled binary.uc, without the overhead of the UCM interactive shell or the Unison compiler.

Developer experience improvements

Together we fixed a lot of bugs and improved the developer experience in lots of little ways this year:

  • We added new builtins and new functionality in the Base libraries.
  • We improved the performance of UCM in several important ways.
  • If you have fzf installed, UCM will now invoke it if you type cd, find, or edit without any arguments.
  • UCM now supports wildcard globbing via the ? symbol. For example edit ?.doc to edit the docs for all the immediate children of the current namespace
  • There's now a command to generate HTML from Unison Docs.
  • Type inference for ability types is vastly improved.

Unison Cloud pilot program

We think distributed cloud computing in Unison is going to knock your socks off. This past year we've been busy building the technology for a futuristic fully-managed platform for distributed Unison execution. We're looking for companies who would like to try this out for real work. Go to unisonweb.org/at-work if you're interested in working with us.

Growing the Unison Computing team and community

We doubled the size of the team at Unison Computing this year! Five new people joined the team, so there are now 10 people working on Unison full time.

This is in addition to lots of people hacking on Unison in their spare time. More than a dozen new people added their efforts to the development of Unison this year. We hosted a Hacktoberfest event in October, during which the community came together to fix a whole bunch of issues.

This year we also started hosting weekly community sessions on Wednesdays on our Discord server. This is like a meetup where usually somebody will stream themselves live-coding something fun in Unison. You should come say hi!

Big plans for 2022

We're working on some very exciting things in the new year!

Unison Cloud beta

The plan is to launch a beta version of Unison Cloud sometime this year. This will be a service that allows you run your Unison code on our managed infrastructure just as easily as running it on your own computer. We're hoping to offer a free tier for Unison enthusiasts.

Codebase hosting designed for Unison

So far, Unison developers have been mainly using GitHub to host their code. But this is not a great fit for Unison, for several reasons. Firstly, Git assumes that code is stored in text files, which is not the case for Unison. Secondly, the Unison codebase has its own internal history, its own notion of branches, and its own pull request mechanism, none of which can take advantage of Git.

This year, all that is going to change. We're building our own codebase hosting specifically designed for Unison. So instead of camping in a tent out by the dumpsters behind GitHub, we'll be able to host Unison codebases and make them browsable via a beautiful interface like share.unison-lang.org.

Native compilation

Unison currently compiles to a kind of bytecode which gets interpreted by a virtual machine that runs on top of the Haskell runtime. The plan this year is to get Unison compiling to fast native code.

New Unison website

We're working on totally revamping our website. But it's not just a change in content or look-and-feel. No, no. We're rewriting the website in Unison! That's right, the whole site will be a Unison data structure (of the Doc type), demonstrating how you can author rich computable content in the language.

The first ever Unison conference

We're planning a fully online free-to-attend Unison conference this spring. Stay tuned for details!

Join our community

We're very excited to be bringing Unison into existence, and we want you to be a part of it!

Stop by the Unison Slack. We're friendly and welcoming.

Install Unison and try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment