#tweag — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #tweag, aggregated by home.social.
-
A faster path to container images in Bazel
https://www.tweag.io/blog/2025-12-18-rules_img/
#HackerNews #Bazel #Container #Images #Faster #Path #Tweag #DevOps
-
Topiary; Channel Your Inner Tweag
Mixing it up a bit due to the chaos that is my new “normal”. Along with a mission (at the end), you also get a new resource to play with!
Time to dig into today’s assignment.
Type your email…
Subscribe
Topiary
Photo by Yelena Odintsova on Pexels.comTopiary is a Rust-based universal source formatter that is a member of the Tree-sitter ecosystem and aims to be a uniform formatter for simple languages. It’s named after the art of shaping plants into pleasing forms, and just like its namesake (i.e., Topiary shapes your code into a more readable and aesthetically pleasing form).
By leveraging Tree-sitter, Topiary can format code by understanding its syntax tree. This means it’s not just blindly applying text transformations; it deliberately reshapes code based on syntactic structure.
You don’t even have to install it to use it! Try the online playground before polluting your pristine system with yet-another binary.
Channeling Your Inner Tweag
Photo by MART PRODUCTION on Pexels.comBack in Q3 of 2023, Tweag blogged about their revamping of the UX of the Topiary CLI. Yes, CLI tools 100% have UX concerns, and Topiary’s UX was as mundane and sub-par as many tools you likely use on the regular.
In the article, they discuss the challenges and improvements. Some core issues prior to the revamp include:
- Simplicity: Common tasks were difficult to perform due to the combinatorial explosion of flags, options, and modifiers.
- Memorability: It was difficult to remember all the different options.
- Discoverability: The CLI did not effectively guide users towards the full range of possible actions.
- Familiarity: Users had to resort to guessing due to the lack of common idioms.
- Clarity: The output was not always clear, making it difficult to understand the results.
To address these issues, the following improvements were made:
- Make illegal states un-representable: Using Rust’s type system and the
claplibrary, the CLI was redesigned to forbid invalid input. - Separate modes of operation: Formatting and visualization were separated into distinct sub-commands, making the CLI more intuitive.
- Make use of familiar idioms: The CLI was updated to follow common behaviors and idioms found in other CLI tools.
- Make common tasks easy and unsurprising: The CLI was designed to make common tasks simple and predictable, while still allowing for customization.
- Don’t paint yourself into a corner: The CLI was designed to be flexible and not limit future development or user expectations.
These changes were implemented in Topiary v0.3.
Please digest the linked article as they explain things quite well, especially when emphasizing the “why”.
Your Mission
Photo by Monstera Production on Pexels.comWe’ve asked you to make some CLIs over these ~400 Drops, and you likely have your own, personal tools you maintain.
Use the principles provided by Tweag — and many of the articles we’ve read on command-line completion, CLI argument parsing, and manual page building — to level-up at least one CLI tool of yours over the weekend. Your future self will look back fondly on this time well spent.
Type your email…
Subscribe
FIN
Remember, you can follow and interact with the full text of The Daily Drop’s free posts on Mastodon via
@[email protected]☮️https://dailydrop.hrbrmstr.dev/2024/01/12/drop-404-2024-01-12-weekend-project-edition/
-
Tweag is a software innovation laboratory that focuses on combining effective consultancy with visible open-source contributions. The company assists deep tech startups in scaling their engineering performance and executing high-risk, high-reward projects. Thanks for supporting #NixCon as a Gold Partner, #Tweag!
https://2023.nixcon.org -
Following along video tutorials usually takes me longer than figuring it out myself, so I try to avoid them. But I actually do really enjoy streams like #Tweag's #Nix hour, or @screwtape's LISP y gopher show, where I don't really have to follow along to pick up interesting bits along the way while I'm working.
-
#Topiary, the open source universal code formatter I've been working on at #Tweag, is currently top 10 on #HackerNews 🚀😀 #rust #rustlang
-
What's this? Tweag doing templating--to-Terraform using Nix + Rust? 👀
Not sure I'm ready to pick up ANOTHER templating language, but Tweag people are usually pretty switched-on.
-
The project I've worked on this autumn at #Tweag has just gone open-source: #Topiary, a general code formatter for many languages, based on #TreeSitter and implemented in #Rust #RustLang.
Contributions are welcome!