The Unison ecosystem has been a hive of activity lately! After the launch ofUnison projects,we've seen a number of new libraries materialize. Naturally, we took this as an opportunity to make fun things! Check out the demos and code snippets below. We hope this ecosystem synopsis inspires you to do the same.
Inspiration struck Unison contributor@dfreemanin the form of an offhand feature request in Unison's community slack. The nerd-sniping worked and now we have a library for live-updating Unison code as it's running. 🤯 It might have been a speculative idea at the time, but the result isHotswap:a library that enables you to record "placeholder" values in your program and then update them live during the program's runtime.
The docs for this library arefantastic🤌 so you can follow along with how the library was implemented, understand the caveats for using hot-swapping, and dream up new use cases.
Thanks to community member@chuwy,Unison has a libray that canmodel,derive,andvalidateJson Schemas. For folks who have never used Json Schemas, they're a way to describe the shape of a Json document andwhew... the schema specification isvast😅!We're very grateful to have@chuwy'sexpertise at work in authoring this library. 📚
Unison has a new abilities-based library for defining server routes. As you're writing Unison web apps, you can use theRouteslibrary to define how your application should respond if a given route is matched.
Here's what defining routes looks like:
At the edge of your program, you can combine all of your routes together and serve them on a port.
Take a look at the ever expanding universe that isAlvaro's project list,and you'll find a new library calledSequencerfor interacting withthe MIDI protocol.Sequencer enables you to write Unison programs for playing music on Midi devices.
You know what that means...
Runar's terminal library is going to radically increase the amount of time you spend playing command line games while your non-Unison code compiles.
Terminus provides a set of functions for interacting with the terminal, including the ability to write text to the screen, read input from the user, and store, move, or reset the cursor at different screen locations.
TLS primitives have existed in Unison's standard lib for a while, but@runaroramarecently added a library that makes it easier to send encrypted messages over a secure channel in Unison. The TLS library is build atop a new TCP server library, also authored by Runar. Rather than managing TCP sockets yourself, you can use more ergonomic functions like
Tree-sitteris an open-source parsing library that can be used to build syntax highlighting, code folding, and other code editing features. If you've ever wished that your IDE could be "smarter" or more syntactically aware about its suggestions, tree-sitter exists to help languages support those features. Many programming languages publish tree-sitter grammars
Unison's tree-sitter grammar, written by community memberKyle Goetzis animpressivefeat. Unison's grammar is complex and Kyle dove into the Haskell code, combed through our language guide and documentation, and we can only imagine spent many hours working to support all of Unison's unique language features.
We can't wait to incorporate this grammar into our IDE's. Thanks Kyle!
Unison contributor@danfreemanhas released a library for working with web sockets in Unison. Web sockets enable both the client and server to send and receive information in a two-way data stream. If you've always wondered how web-sockets work, check out thewebsockets.servefunction to see how http requests are upgraded to web-socket connections.
The ecosystem is filling out with fundamental protocol libraries like this one. They're easy to take for granted if you've worked in older languages, so it's nice to be able to see their foundations in Unison.
For your web-scraping needs,@runaroramahas added theSouplibrary for parsing and querying XML documents. It's nestled inside of a larger UnisonXMLlibrary, but
Soupis a user friendly interface for traversing through XML so its worth callling out separately.
Fun fact: The Unison blog itself publishes an Atom XML feed: https://www.unison-lang.org/feed.xml. You can use the Soup library to parse and query the feed. Maybe it's time for a Unison RSS reader project? 🤔
Unison's tooling for making beautiful charts and graphs is getting off the ground thanks toAlvaro's plotter library.
😄 Thank you to our contributors and community
We're constantly wowed by the the ways that folks are using Unison's unique features to build new tools and libraries. Give our library author's a round of applause, or better yet, use their contributions to make something awesome. Happy coding!