Powered-Up Command Lines, UI Accessibility, and Rust Pinning
Back to working alone again after a great week discussing product strategy and figuring out the future with my cofounder. This means more time to read new things, so here we go!
Recommended Reading and Videos
Improving Shell Workflows with Fzf
fzf is a "general purpose command-line fuzzy finder" utility. While it's commonly used for interactively finding files or searching command-line history, the tool can take any list of strings and help you search through them.
This blog post covers a few advanced cases. The lobster.rs and Hacker News threads for the blog post have a lot of additional scripts and use cases in the comments.
My favorite idea from all of this is to pass an empty string to fzf, and instead just it for the live preview functionality. With a command like
echo '' | fzf \
--print-query --preview-window wrap \
--preview "cat '$1' |& jq -C {q}"
you can build a jq
query interactively on a JSON file and see the output update in real time. It's a great time saver to put commands like these in scripts to have them at your fingertips.
A Complete Guide To Accessible Front-End Components
Accessibility can be a complicated topic for those not well-versed in the field, and this guide from Smashing Magazine is a great help. With plenty of descriptions, images, and links to extra detail about a lot of different topics, this should be a page you return to many times if you're doing front-end design.
Pin and suffering
I've been diving into asynchronous Rust programming recently, and Amos from fasterthanlime wrote this well-timed article that explores pinning in great detail. This is one of the more confusing concepts about Rust async code, and so this article is well worth a read.
It's a long post, but also very readable and Amos continues to succeed at making complicated concepts accessible through his trial-and-error exploration writing style. If you've ever looked at Rust async code and wondered "why does pinning a Box
It also turns out that the Rust documentation for the std:pin
module has a lot of good content and suggested idioms as well, and succinctly describes how to create structures where some of the fields need to be pinned and others might not.
What I'm Working On
Still hacking on Ergo in my spare time. There's now a basic state machine implementation and a lot of the initial underlying code for handling events and spawning actions is set up. Spent a lot of time figuring out Pin
and all that related Rust async stuff too, hence the links above.
In writing this, I've come to an interesting realization about no-code vs. low-code tooling. While low-code has been increasingly popular recently for giving the users a lot of extra flexibility compared to the strictly-defined feature set of no-code tools, I think it also makes development a lot easier.
One of the features I implemented this week was the ability to take data from an event, a context object, and some constants, and combine them into a payload for an action. This isn't so complicated, but managing structure definitions that do this requires somewhat more complex code in the backend, and significantly more complex UI in order to enable putting all these options together. In a low-code environment, you mostly just reuse the same editor component that you have throughout the application and then on the backend, just run the script with the relevant data injected. I'll write something about this later as I implement more and get a better conception of the relative difficulty.
If you enjoyed this, I'd love if you share it with a friend (sign up here) or just reply to this email with your thoughts. Thanks for reading!