Holochain Dev Pulse 01

Rust Preview Release!

This first Holochain Dev Pulse is predominately a recap to the recent blog post by one of our core devs, Nicolas Luck, “Holochain Developer Preview Release.” However, we also have some extra updates to share. We will be providing regular Holochain development updates moving forward.

We have been hard at work on the Holochain Rust Refactor and core functionality set, dramatically simplifying app development, releasing the Rust HDK, testing powerful macros, improving code development experience, focusing on spec driven development, and introducing a modular framework.

Developer Preview Release Highlights:

· Holochain Rust Developer Preview released

· Persistence to the file system enabled

· Application code development has been simplified dramatically

· Introduced a modular framework

· Introduced a new entity called “Containers”

Other Highlights this Week:

· DevCamp Alpha hosted

· DevCamp Highlight!

· Published a Rust app-building tutorial for the developer preview release

· Improved our internal processes for pull requests

· Completed more “behind the scenes” work (bug fixes, reduction of tech debt, etc.)

· Published Holochain Book and crate-based API documentation

Dev Preview Release Highlights (Detailed)

Holochain Rust Developer Preview released

We completed what we’re defining as the core set of functionality that is required to read and write data, both to and from, your local chain. This includes everything to do with committing, writing, and reading back data, as well as the creation of links and retrieval of links. They are available in the Rust HDK as of the end of two weeks ago (October 27th). More information on HDKs below.

Persistence to the file system enabled

A basic implementation of file system persistence also landed recently. Prior to this week you could start your Holochain instance and then kill it, getting nothing back from what you had previously written and saved. Now state changes to your source chain will be persisted to flat files. Other persistence implementations are coming soon!

Application code development has been simplified dramatically

The new Rust version introduces a JSON package file format, which holds everything related to your DNA (even your compiled zome code). We’ve also retired some languages (JavaScript and Lisp) and introduced WebAssembly as a build target.

These two decisions are better in the long run, because we can support more languages for free, and running zome code will be much faster. But it comes with some tradeoffs. Zome functions are more low-level and require a bit of pointer-slinging.

But we’ve also introduced the Rust HDK (Holochain Developer Kit), which dramatically simplifies application code development when you’re writing zome code in Rust. Not only does it hide all the complexity of the low-level API, but it also comes with a build tool which generates all your zome metadata automatically from code. Previously in Holochain-proto, you had to write this metadata by hand. This is great news — you no longer need to define much of your application code in JSON! Goodbye to duplication, spelling mistakes, and context shifts. And don’t worry; the build pipeline will also compile your code to WebAssembly for you and combine it with the metadata into the package file.

Introduced a modular framework

The new stack is exponentially more modular than the initial alpha. We rebuilt it this way so we can enable all sorts of new possibilities — new target platforms/architectures/OSes, different storage backends, pluggable GUIs, encrypted network layers, etc. (We’ve already tested Android compilation!) But it also enables so many other possibilities and community-driven innovations.

There are so many different places that people can plug in. For example, we have a flexible persistence API, which means that you can use any number of different backends to store the source chain and DHT shard. Someone could write an implementation that uses PostgreSQL; someone else could write an implementation in MongoDB. Right now we write to the file system, which is the most basic implementation. Though this came together recently, it was the result of many months of careful architectural decisions that are already starting to pay dividends.

Monthly pulse — https://github.com/holochain/holochain-rust/pulse/monthly

Introduced a new entity called “Containers”

Here’s a new thing! We have a new entity in the world of Holochain that we call a Container. It knits together all your Holochain apps and data into one whole, and presents it to the world in a cohesive interface. Different containers can have different purposes; here are two that are already available:

holochain-cmd is a command-line container that activates, builds, and tests applications. It’s what you’ll use to build your zome code into a package, and it comes with a JavaScript runtime that lets you run tests written in your favorite JS-based testing framework.

Holosqape is a proof of concept of an end user facing tool into which you can load apps. It is not particularly polished or user-friendly; you need to know what you’re doing to use it. However, it’s exciting because it’s where things finally hit people beyond the developers. If someone were to send you an app and you wanted to install and run it, it is possible now! This is part of the Rust developer preview release. This is so important for us!!

The first official version of the Holochain Rust release created

There are five repositories that span this new release, and we have tagged the same version number across all of them. The ones that can be compiled to a binary for people to download will be placed into the Holochain/app-spec-rust repository under the “releases” tab. These are binaries from different repositories that are in sync with each other. We want to say, “Hey developers! Check this out. This is our developer preview, install these items, try it out, and start building. Please let us know your experience.”

Framing and Expectations

The Holochain Rust Developer Preview contains the core set of functionality and the developer tooling without the low-level network functionality that we promised. This release is focused on developers and getting their feedback. We have listed the constraints in the readme of the release.

The official Holochain Rust Alpha 2 release is planned; we’ll let you and rest of our community know as we get closer to the release date.

Other Highlights this Week

DevCamp Alpha Hosted

We wrapped up DevCamp #1 on Monday 10/29 and it was a success! We created a tutorial video for DevCamp intended for developers. This video includes a walkthrough of the new Holochain API and the Rust HDK, and an example of a to-do app being built. In the video, the sample app is focused on the Holochain DNA and does not connect to a UI. We wanted to offer examples of a few useful things and show people that it’s easy to build your app even at this early stage. A link to the video will be shared when its available.

At DevCamp, participants learned about Holochain Proto, Holochain Rust and key Holochain concepts.

DevCamp Alpha

DevCamp Highlight!

We saw a dev recreate the Holo World tutorial app in Rust during DevCamp. It was exciting for them to get the app working within just a day.

We got a lot of good feedback about the Holochain installation process. Going forward, the installation process is a simplified process with access to prebuilt binaries. We have updated and re-formulated the READMEs and added links in key places to point to the prebuilt binaries documentation. This will ensure the quickest path to installing Holochain. In summary, it’s easy to install Holochain now, and in the future it will be even easier.

Completed more “behind the scenes” work (bug fixes, reduction of tech debt, etc.)

We made some small bug fixes (i.e. connection to the WebSocket ports got fixed) based on DevCamp feedback.

This week the development team was focused on code cleanup, attending to a backlog of items, small bug fixes, and in-depth (and more time consuming) behind-the-scenes work.

Published a Rust app-building tutorial for the developer preview release

We had people who learned Holochain Proto at a broad strokes level this week. Learning proto is a core part of the curriculum. We also introduced a Holochain Rust stream, the release for those who were more interested in Rust and less concerned with completing an app by the end of DevCamp. Some people just wanted to get a hold of Holochain Rust and write code with the latest version. Other people chose to do both. Some folks worked on the social app aspect of the curriculum, while others’ objective was to learn Holochain and get exposure to the code. Some focused on Holochain concepts. We had a real mix of people accomplishing different parts of the curriculum in the closing circle of DevCamp.

Improved our internal processes for pull requests

We are working to improve our internal processes and handling pull requests (PR) and the follow-up so the PRs don’t stagnate. It’s inefficient to have to pull requests that are not getting merged, sitting idle, and falling behind. To address this we focused on process level work this week. The dev team is working to improve the process so that it is streamlined for other developers to contribute to the code and documentation. Our goal is to have an improved process for pull requests so there is a good follow-up between the team and all code contributors.

Published Holochain Book and crate-based API documentation

The Holochain book documentation includes example codes which are very important for developers. Seeing the inline examples along with the API reference will help immensely in the app development process. All the functions that are in the developer preview are documented in the API Reference (Rust-API links). This type of documentation was not available prior to this week.

Holochain Book Links

HDK: https://holochain.github.io/rust-api/0.0.1/hdk/

Zomes: https://holochain.github.io/rust-api/0.0.1/hdk/macro.define_zome.html

Rust: https://holochain.github.io/holochain-rust/

Note: On the developer portal, you will notice a new banner at the top calling out key items. https://developer.holochain.org/

Contribute to Documentation

There is a deep commitment on the Holochain dev team to cultivate a culture of contributions and to make it relatively easy to participate. We would like to invite developers to contribute to the documentation. Therefore, we added some “suggest an edit” buttons to make it easier to contribute to certain sections of the documentation.

If you are interested in contributing to the code, a good starting point is to help with documentation. We feel it’s the best way to get a good understanding of Holochain’s architecture and codebase, and contribute to our project at the same time.

Developer Questions?

You can also find answers to many frequently asked questions.

Join us on Mattermost to discuss these updates! Be sure to join the Holochain / Tech Q&A channel.