website/content/blog/lightweight-dev-tools.md
James Harton 68d297ef61
All checks were successful
continuous-integration/drone/push Build is passing
feat: import contents of dev.to blog.
2023-08-16 14:53:37 +12:00

63 lines
6.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Lightweight dev tools.
published: true
description: Learning to live small.
date: 2023-08-10
tags: programming, productivity, developer
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y9k1z2do7k5qlfieemzy.jpg
---
Ive been forcing myself to use a barely usable laptop for any couch coding I do because I have a puppy who likes to jump into my lap - regardless of whether theres already something in it.
Usually I'd use a 15" MacBook Pro, but since both I and [my employer](https://alembic.com.au) would be pretty upset if it was damaged I've been using something with [a little lower stakes](https://laptoping.com/specs/product/lenovo-ideapad-100s-11/) that has been sitting unused on a shelf in my garage for quite a while.
Its a bit of an interesting challenge and has forced me to re-examine some of my tool usage. I started by a minimal install of [Debian “bookworm”](https://www.debian.org/releases/bookworm/) with the [XFCE Desktop Environment](https://xfce.org/) which chews through much fewer resources than the default [GNOME 43 based environment](https://www.gnome.org/) (although more than [LXDE](https://www.lxde.org/) - but there still has to be room for aesthetics).
This is already a bit of a change because when I'm not using the MacBook Pro, I am using my desktop which has [Pop!\_OS 22.04](https://pop.system76.com/) installed.
## Terminal emulator
I did find that XFCEs terminal emulator was pretty slow, so I installed [Alacritty](https://alacritty.org/) - a lightweight terminal written in Rust.
Alacritty doesnt yet support ligatures, tabs or split panes - so be warned if thats a show stopper for you. It does happily render [Nerd Font](https://www.nerdfonts.com/) symbols though. Alacritty is so fast I also decided to make the switch from [iTerm2](https://iterm2.com/) on my mac.
## Shell environment
Ive been using [oh-my-zsh](https://ohmyz.sh/) for years but over time more and more has been added to it (both by me and upstream) resulting in a great - but slow - experience. Running it on a machine with so few resources was definitely not an option.
After a little research I came across [starship](https://starship.rs/) (also written in Rust) which is a “blazing-fast, and infinitely customizable prompt for any shell”. I deleted almost all of my `.zshrc` and replaced it with `eval "$(starship init zsh)"`. I also had to manually add hooks for [`asdf`](https://asdf-vm.com/), [`direnv`](https://direnv.net/) and a couple of other tools that I had been relying on oh-my-zsh plugins for.
The result? Well Im speechless. I had forgotten what it was like to have a near-instantaneous shell prompt. Ive switched my profile on all my machines to starship.
## Programming environment
I used to be a pretty heavy [Vim](https://www.vim.org/) user ([RIP Bram](https://groups.google.com/g/vim_announce/c/tWahca9zkt4?pli=1)), but when I started doing a lot of remote pairing with less experienced devs I realised that they were sometimes having trouble following along when I was driving. Their experience was basically "click click click" _some text whizzes around the screen_.
So I made the switch to [Code](https://code.visualstudio.com/). I came for the accessibility and stayed for devcontainers, remote development and the language server protocol. Again though, Code is a great tool but is built using web technologies and [Electron](https://www.electronjs.org/) and when loaded down with a full-suite of extensions it can feel sluggish on the most powerful of machines.
Here comes [Lapce](https://lapce.dev/); a "Lightning-fast and Powerful Code Editor" written in Rust (are you seeing a theme here?). When they say "lightning-fast" they're not kidding. Despite the website saying it's "pre-alpha" it has a surprisingly full feature set:
- Tree-sitter based syntax highlighting
- Remote development
- Language server protocol
- WASI-based plugin system
What's missing is mainly docs and plugins (and docs on how to write plugins).
The first codebase I opened was a Rust project and it's support for Rust is nothing short of incredible. I guess it would be given that's where it originates. It seemlessly integrated with `rust-analyser`, `cargo fmt`, etc and felt like a very mature offering.
Sadly, this isn't true for all languages. I spend most of my days working on and with the [Ash project](https://ash-hq.org/) in [Elixir](https://elixir-lang.org/). Whilst Lapce has syntax highlighting for Elixir there is [no language server plugin available yet](https://plugins.lapce.dev/search/elixir). There are [at least](https://github.com/mayel/lapce-elixir-ls) [two](https://github.com/wingyplus/lapce-elixir) plugins in development, but given I can't figure out how to install them in my local editor to test them I can't speak to their quality.
I decided I can live without [elixir-ls](https://github.com/elixir-lsp/elixir-ls) when couching in return for having a usable editor. When the plugin ecosystem and documentation matures I can see myself switching to using Lapce for my primary editor.
## Browser
For better or worse, I spend a lot of my time on the web. Having a quick web browser is kind of important, but since I also seem to mostly write web applications I also need one that renders things in a conventional way.
This immediately rules out a bunch of lightweight browser options like [lynx](https://lynx.browser.org/) or [Dillo](https://www.dillo.org/).
I usually use [Firefox](https://www.mozilla.org/en-GB/firefox/new/) for general browsing and [Chromium](https://www.chromium.org/Home/) when I need the good dev tools. I think I have to live with having Chromium installed for when I need it, but Firefox is just too weighty for this little machine. I settled on [Falkon](https://apps.kde.org/falkon/) which is a nice balance between performance and standards. It uses the Chromium renderer under the hood, so webpages usually look how I expect them to. It is thankfully missing some much loved browser "features" such as submitting "http://localhost:4000" to a search engine rather than loading the page.
## Summary
Thanks for coming along on this little tour of lightweight dev tools. I hope in my struggles to use a dumb old computer you have found something useful to speed up your computing life.