Full Width [alt+shift+f] Shortcuts [alt+shift+k]
Sign Up [alt+shift+s] Log In [alt+shift+l]
45
There are two conflicting forces in play in setting up your computer environment: It’s common to find people get stuck at the extreme ends of the spectrum; some programmers refuse to configure or learn their tools at all, while others get stuck re-configuring their setups constantly without any productivity gains to show for it. Finding a balance can be tricky. With regards to terminals I’ve been using alacritty for many years. It gets the job done but I don’t know if I’m missing out on anything? I’ve been meaning to look at alternatives like wezterm and kitty but I never got far enough to try them out. On one hand it’s just a terminal, what difference could it make? Enter Ghostty, a terminal so hyped up it made me drop any useful things I was working on and see what the fuzz was about. I don’t quite get why people hype up a terminal of all things but here we are. Ghostty didn’t revolutionize my setup or anything but I admit that Ghostty is quite nice and it has replaced alacritty as...
a month ago

Improve your reading experience

Logged in users get linked directly to articles resulting in a better reading experience. Please login for free, it takes less than 1 minute.

More from Jonas Hietala

I'll give up Neovim when you pry it from my cold, dead hands

I recently came upon a horror story where a developer was forced to switch editor from Neovim to Cursor and I felt I had to write a little to cleanse myself of the disgust I felt. Two different ways of approaching an editor I think that there’s two opposing ways of thinking about the tool that is an editor: Refuse to personalize anything and only use the basic features “An editor is a simple tool I use to get the job done.” Get stuck in configuration hell and spend tons of time tweaking minor things “An editor is a highly personalized tool that works the way I want.” These are the extreme ends of the spectrum to make a point and most developers will fall somewhere in between. It’s not a static proposition; I’ve had periods in my life where I’ve used the same Vim configuration for years and other times I’ve spent more time rewriting my Neovim config than doing useful things. I don’t differentiate between text editors and IDEs as I don’t find the distinction very meaningful. They’re all just editors. Freedom of choice is important Freedom of choice is more to be treasured than any possession earth can give. David O. McKay Some developers want zero configuration while others want to configure their editor so it’s just right. Either way is fine and I’ve met excellent developers from both sides. But removing the power of choice is a horrible idea as you’re forcing developers to work in a way they’re not comfortable with, not productive with, or simply don’t like. You’re bound to make some of the developers miserable or see them leave (usually the best ones who can easily find another job). To explain how important an editor might be to some people, I give you this story about Stephen Hendry—one of the most successful Snooker players ever—and how important his cue was to him: In all the years I’ve been playing I’ve never considered changing my cue. It was the first cue I ever bought, aged 13, picked from a cabinet in a Dunfermline snooker centre just because I liked the Rex Williams signature on it. I saved £40 to buy it. It’s a cheap bit of wood and it’s been the butt of other players’ jokes for ages. Alex Higgins said it was ‘only good for holdin’ up f*g tomatoes!’ But I insist on sticking with it. And I’ve won a lot of silverware, including seven World Championship trophies, with it. It’s a one-piece which I carry in a wooden, leather-bound case that’s much more expensive than the cue it houses. But in 2003, at Glasgow airport after a flight from Bangkok, it emerges through the rubber flaps on the carousel and even at twenty yards I can see that both case and cue are broken. Snapped almost clean in two, the whole thing now resembling some form of shepherd’s crook. The cue comes to where I’m standing, and I pick it up, the broken end dangling down forlornly. I could weep. Instead, I laugh. ‘Well,’ I say to my stunned-looking friend John, ‘that’s my career over.’ Stephen Hendry, The Mirror Small improvements leads to large long-term gains Kaizen isn’t about massive overhauls or overnight success. Instead, it focuses on small, continuous improvements that add up to significant long-term gains. What is Kaizen? A Guide to Continuous Improvement I firmly believe that even small improvements are worth it as they add up over time (also see compound interest and how it relates to financial investments). An editor is a great example where even small improvements may have a big effect for the simple reason that you spend so much time in your editor. I’ve spent hours almost every day inside (neo)vim since I started using it 15+ years ago. Even simple things like quickly changing text inside brackets (ci[) instead of selecting text with your mouse might save hundreds of hours during a programming career—and that’s just one example. Naturally, as a developer you can find small but worthwhile improvements in other areas too, for instance: Learning the programming languages and libraries you use a little better Customizing your keyboard and keyboard layout This is more for comfort and health than speed but that makes it even more important, not less. Increasing your typing speed Some people dismiss typing speed as they say they’re limited by their thinking, not typing. But the benefit of typing faster (and more fluidly) isn’t really the overall time spent typing vs thinking; it’s so you can continue thinking with as little interruption as possible. On some level you want to reduce the time typing in this chain: think… edit, think… edit, think… It’s also why the Vim way of editing is so good—it’s based on making small edits and to return quickly to normal (thinking) mode. Some people ask how can you afford to spend time practicing Vim commands or to configure your editor as it takes away time from work? But I ask you: with a programming career of several decades and tens of thousands of hours to spend in front of your computer, how can you afford not to? Neovim is versatile During the years I’ve done different things: Switched keyboard and keyboard layout multiple times. Been blogging and wrote a book. The one constant through all of this has been Neovim. Neovim may not have the best language specific integrations but it does everything well and the benefit of having the same setup for everything you do is not to be underestimated. It pairs nicely with the idea of adding up small improvements over time; every small improvement that I add to my Neovim workflow will stay with me no matter what I work with. I did use Emacs at work for years because their proprietary language only had an Emacs integration and I didn’t have the time nor energy to create one for Neovim. While Evil made the experience survivable I realized then that I absolutely hate having my work setup be different from my setup at home. People weren’t overjoyed with being unable to choose their own editor and I’ve heard rumors that there’s now an extension for Visual Studio. Neovim is easily extensible Neovim: a Personalized Development Environment TJ DeVries A different take on editing code I’ve always felt that Vimscript is the worst part of Vim. Maybe that’s a weird statement as the scriptability of Vim is one if it’s strengths; and to be fair, simple things are very nice: nnoremap j gj set expandtab But writing complex things in Vimscript is simply not a great experience. One of the major benefits of Neovim is the addition of Lua as a first-class scripting language. Yes, Lua isn’t perfect and it’s often too verbose but it’s so much better than Vimscript. Lua is the main reason that the Neovim plugin ecosystem is currently a lot more vibrant than in Vim. Making it easier to write plugins is of course a boon, but the real benefit is in how it makes it even easier to make more complex customization for yourself. Just plop down some Lua in the configuration files you already have and you’re done. (Emacs worked this out to an even greater extent decades ago.) One way I use this customizability is to help me when I’m blogging: Maybe you don’t need to create something this big but even small things such as disabling autoformat for certain file types in specific folders can be incredibly useful. Approachability should not be underestimated. While plugins in Lua is understandably the focus today, Neovim can still use plugins written in Vimscript and 99% of your old Vim configuration will still work in Neovim. Neovim won’t go anywhere The old is expected to stay longer than the young in proportion to their age. Nassim Nicholas Taleb, “Antifragile” The last big benefit with Neovim I’ll highlight—and why I feel fine with investing even more time into Neovim—is that Neovim will most likely continue to exist and thrive for years if not decades to come. While Vim has—after an impressive 30 years of development—recently entered maintenance mode, activity in Neovim has steadily increased since the fork from Vim more than a decade ago. The amount of high quality plugins, interest in Google trends, and GitHub activity have all been trending upwards. Neovim was also the most desired editor according to the latest Stackoverflow developer survey and the overall buzz and excitement in the community is at an all-time high. With the self-reinforced behavior and benefits of investing into a versatile and flexible editor with a huge plugin ecosystem such as Neovim I see no reason for the trend to taper off anytime soon. Neovim will probably never be as popular as something like VSCode but as an open source project backed by excited developers, Neovim will probably be around long after VSCode has been discontinued for The Next Big Thing.

3 days ago 7 votes
Securing my partner's digital life

I’ve been with Veronica for over a decade now and I think I’m starting to know her fairly well. Yet she still manages to surprise me. For instance, a couple of weeks ago she came and asked me about email security: I worry that my email password is too weak. Can you help me change email address and make it secure? It was completely unexpected—but I’m all for it. The action plan All heroic journeys needs a plan; here’s mine: .com surname was available). Migrate her email to Fastmail. Setup Bitwarden as a password manager. Use a YubiKey to secure the important services. Why a domain? If you ever want (or need) to change email providers it’s very nice to have your own domain. For instance, Veronica has a hotmail.com address but she can’t bring that with her if she moves to Fastmail. Worse, what if she gets locked out of her Outlook account for some reason? It might happen if you forget your password, someone breaks into your account, or even by accident. For example, Apple users recently got locked out of their Apple IDs without any apparent reason and Gmail has been notorious about locking out users for no reason. Some providers may be better but this is a systemic problem that can happen at any service. In almost all cases, your email is your key to the rest of your digital life. The email address is your username and to reset your password you use your email. If you lose access to your email you lose everything. When you control your domain, you can point the domain to a new email provider and continue with your life. Why pay for email? One of the first things Veronica told me when I proposed that she’d change providers was that she didn’t want to pay. It’s a common sentiment online that email must be cheap (or even free). I don’t think that email is the area where cost should be the most significant factor. As I argued for in why you should own your email’s domain, your email is your most important digital asset. If email is so important, why try to be cheap about it? You should spend your money on the important things and shouldn’t spend money on the unimportant things. Paying for email gives you a couple of nice things: Human support. It’s all too easy to get shafted by algorithms where you might get banned because you triggered some edge case (such as resetting your password outside your usual IP address). Ability to use your own domain. Having a custom domain is a paid feature at most email providers. A long-term viable business. How do you run an email company if you don’t charge for it? (You sell out your users or you close your business.) Why a password manager? The best thing you can do security wise is to adopt a password manager. Then you don’t have to try to remember dozens of passwords (leading to easy-to-remember and duplicate passwords) and can focus on remembering a single (stronger) password, confident that the password manager will remember all the rest. “Putting all your passwords in one basket” is a concern of course but I think the pros outweigh the cons. Why a YubiKey? To take digital security to the next level you should use two-factor authentication (2FA). 2FA is an extra “thing” in addition to your password you need to be able to login. It could be a code sent to your phone over SMS (insecure), to your email (slightly better), a code from a 2FA app on your phone such as Aegis Authenticator (good), or from a hardware token (most secure). It’s easy to think that I went with a YubiKey because it’s the most secure option; but the biggest reason is that a YubiKey is more convenient than a 2FA app. With a 2FA app you have to whip out your phone, open the 2FA app, locate the correct site, and then copy the TOTP code into the website (quickly, before the code changes). It’s honestly not that convenient, even for someone like me who’s used this setup for years. With a YubiKey you plug it into a USB port and press it when it flashes. Or on the phone you can use NFC. NFC is slightly more annoying compared to plugging it in as you need to move/hold it in a specific spot, yet it’s still preferable to having to jump between apps on the phone. There are hardware keys other than YubiKey of course. I’ve used YubiKey for years and have a good experience. Don’t fix what isn’t broken. The setup Here’s a few quick notes on how I setup her new accounts: Password management with Bitwarden The first thing we did was setup Bitwarden as the password manager for her. I chose the family plan so I can handle the billing. To give her access I installed Bitwarden as: I gave her a YubiKey and registered it with Bitwarden for additional security. As a backup I also registered my own YubiKeys on her account; if she loses her key we still have others she can use. Although it was a bit confusing for her I think she appreciates not having to remember a dozen different passwords and can simply remember one (stronger) password. We can also share passwords easily via Bitwarden (for news papers, Spotify, etc). The YubiKey itself is very user friendly and she hasn’t run into any usability issues. Email on Fastmail With the core security up and running the next step was to change her email: Gave her an email address on Fastmail with her own domain (<firstname>@<lastname>.com). She has a basic account that I manage (there’s a Duo plan that I couldn’t migrate to at this time). I secured the account with our YubiKeys and a generated password stored in Bitwarden. We bolstered the security of her old Hotmail account by generating a new password and registering our YubiKeys. Forward all email from her old Hotmail address to her new address. With this done she has a secure email account with an email address that she owns. As is proper she’s been changing her contact information and changing email address in her other services. It’s a slow process but I can’t be too critical—I still have a few services that use my old Gmail address even though I migrated to my own domain more than a decade ago. Notes on recovery and redundancy It’s great to worry about weak phishing, weak passwords, and getting hacked. But for most people the much bigger risk is to forget your password or lose your second factor auth, and get locked out that way. To reduce the risk of losing access to her accounts we have: YubiKeys for all accounts. The recovery codes for all accounts are written down and secured. My own accounts can recover her Bitwarden and Fastmail accounts via their built-in recovery functionality. Perfect is the enemy of good Some go further than we’ve done here, others do less, and I think that’s fine. It’s important to not compare yourself with others too much; even small security measures makes a big difference in practice. Not doing anything at all because you feel overwhelmed is worse than doing something, even something simple as making sure you’re using a strong password for your email account.

a month ago 31 votes
2024 in review

It’s time for my 15th yearly review. Nerdy things I enjoyed I read a lot of fantasy books this year! My favorite new series were The Kingkiller Chronicle, Gentlemen Bastards series, and The Stormlight Archive. If you’re curious about Sanderson’s books but a little apprehensive about jumping into a massive series such as The Stormlight Archive then I’ll recommend The Emperor’s Soul as an excellent little introduction. The standalone book Warbreaker is also fantastic (available for free on Brandon’s website). Customizing Neovim was fun and rewarding. It’s amazing I got anything productive done this year… I really enjoy working with Rust in my own hobby projects. Types are coming to Elixir and I’m loving it. (I recently migrated some small projects to v1.18 and found a bunch of errors.) The Gleam programming language shows a lot of promise. My one gripe is the pain of manually encoding/decoding JSON (even with the various libraries). Compared to for example Elixir dynamic encoding or Rust’s #[derive(Deserialize)] it just feels so bad that I’ve avoided Gleam for some projects. Shame on me? CSS is alive and better than ever. Things I accomplished I quit my job and started my own company. At the moment I’m focusing on consulting but maybe something else can grow from it one day? I wrote 26 blog posts—it was quite a productive blogging year for me. I built a custom keyboard together with a custom keyboard layout. Made the eBook for Why Cryptocurrencies? freely available and finally finished the How I wrote ‘Why Cryptocurrencies?’ series. I wrote a Tree-sitter grammar for Djot. I need to be more active maintaining it… But it’s hard to get motivated as I’ve got so many other interesting things I’d like to work on. Managing an open source project is not for the faint of heart (or the easily distracted). Finished the blog series about building my first 3D printer. I’m up to over 2100 printing hours with the machine so it’s safe to say I’ve been using it, not only playing around with. Rewrote my lighting home automation from Python to Elixir. I realized that meta-blogging is a great way to get virtual points on Hacker News. Tentative plans/goals/wishes for 2025 For some reason the idea of writing a fantasy novel got stuck in my head. I had a stint where I listened to dozens of hours of advice for aspiring writers and started planning a series. The excitement tapered off a bit during the Christmas holidays and I don’t know if this was just a temporary sidetrack or if it’s something I’ll actually end up doing. Design a one-handed keyboard layout. Again, this was just something my brain got stuck thinking about and I’m not sure if it’s just a fleeting idea or something I need to do so I can stop thinking about it. (Sometimes just a little planning plus solving the most difficult problems are enough—I don’t have to finish all the crazy/dumb ideas I get for my mind to consider them “done”.) Complete my second 3D printer. There’s no point in having a single printer; what if I break it and I can no longer print replacement parts for it? Develop my home automation system more. I’ve got a ton of things I’d like to improve (or play around with). For instance, yesterday I received the Home Assistant Voice Preview Edition that I hope works as well as advertised.

a month ago 40 votes
A type checking error in Elixir 1.18

Although I’m a big Elixir fan, the lack of static typing has always been my biggest annoyance (and why I think Gleam is so cool). I think static typing helps catch bugs earlier and in an automated way, leading to less buggy software and saves time in the long run. To my great joy Elixir is working on a new type system that will hopefully give us the early type checking errors I’ve been craving for. The system has been rolled out in steps since v1.17 and when I migrated to v1.18 I found my first type checking warning that I wanted to highlight. Comparison with structs This is the offending code with the corresponding warning: def get_surrounding_events_as_dt(events, now = %DateTime{}) do time = DateTime.to_time(now) next_i = Enum.find_index(events, fn {_, event_time} -> time < event_time end) || 0 warning: comparison with structs found: time given types: dynamic(%Time{}) where "event_time" was given the type: # type: dynamic() # from: lib/haex/sun.ex {_, event_time} where "time" was given the type: # type: dynamic(%Time{}) # from: lib/haex/sun.ex:88:10 time = DateTime.to_time(now) Comparison operators (>, =, Comparing with a struct won't give meaningful results. Structs that can be compared typically define a compare/2 function within their modules that can be used for semantic comparison. typing violation found at: │ │ next_i = Enum.find_index(events, fn {_, event_time} -> time │ ~ (The type checker cannot yet resolve event_time to the Time struct, leaving it as dynamic() in the text above.) The issue here as that < isn’t overloaded for the Time struct (like it would be in for instance Rust) and will instead perform structural comparison. You should use Time.before? instead of < (and DateTime.before for DateTime etc). As it happens for Time this doesn’t seem to be an issue as the structure happens to perform the comparisons in the same order as Time.before?, which this test verifies: test "check_times" do times = Enum.zip([0..23, 0..59, 0..59]) |> Enum.map(fn {h, m, s} -> Time.new!(h, m, s) end) for a <- times do for b <- times do assert a < b == Time.before?(a, b) end end end This is not the case for DateTime, which did cause a production bug in my home automation system, that my spouse complained about… Remember this when you think about types: type checking saves relationships. My hope for the future I’ve always disliked matching against atoms in Elixir as it’s so easy to make a mistake, for example like this: case Supervisor.start_child(supervisor, child_spec) do {:error, {:already_stated, pid}} -> Logger.info("Got pid: #{inspect(pid)}") (There’s a missing r in :already_stated.) At the moment this doesn’t produce an error but I really hope we’ll reach this point sooner rather than later as I make these kinds of mistakes all the time. I think I catch most of these with tests but I’m sure some slip through. I hope this isn’t that far away as the v1.18 type checker manages to catch a simpler case like this: def num_to_descr(num) do case num do 1 -> :one 2 -> :two _ -> :many end end def print(num) do case num_to_descr(num) do :zero -> IO.puts("zero") x -> IO.puts("Other: #{x}") end end warning: the following clause will never match: :zero because it attempts to match on the result of: num_to_descr(num) which has type: dynamic(:many or :one or :two) typing violation found at: │ 41 │ :zero -> IO.puts("zero") │ ~~~~~~~~~~~~~~~~~~~~~~~~

a month ago 44 votes

More in technology

The Review

Interior of a low-rise office park.

17 hours ago 5 votes
IC Necklace

[Misc] Setting silicon

9 hours ago 3 votes
Your brain doesn’t want you to work out

Dean Burnett writing for Science Focus: Your Brain Is Hard-Wired to Avoid Exercise. Here's Why So why, even though we’ve evolved to do it, doesn't everyone enjoy exercise? The baffling complexity of the human brain is to blame. Evolving an ability doesn’t

an hour ago 1 votes
Jorge’s Wager: Why AI Needs Information Architecture

One of the most common questions I’m asked is, “is information architecture still relevant now that we have AI?” Of course, not everyone puts it like that. Instead, they’ll say things like “we won’t need navigation if we have chat” or “AI will organize the website” or “in a world with smart agents, we won’t need UI” or something like that. The gist is the same: Do we need structured information in a world with AI? My unequivocal answer is yes. But given my pivot, you might think this is self-serving. So I’d better explain my reasoning. What Information Does Let’s start here: what is information? A surprisingly tricky question! “Information” is one of those squishy words we use without fully grasping its meaning. Over years, I’ve narrowed it down to a pithy (and hopefully, practical) definition: Information is a means for skillful decision-making. Imagine you reach a fork in the road. A sign points left to Buenas Peras (750 km) and right to Pelotillehue (650 km). If you want to go to Pelotillehue and trust the sign, you go right. The sign gives you what you need to make a choice. That’s information. Note a few things: Information must be understandable. To make a choice, the actor must understand the options. You’ll know this firsthand if you’ve tried to drive in a country where you can’t read the local language. Informing happens in context. The sign only makes sense at that particular junction and is only useful to an actor trying to get to either destination. (And with the means to do so: a pedestrian is unlikely to care about a destination 650 km away.) The decider needn’t be human. Nothing about this definition says the choice must be made by a person: it could be an autonomous vehicle driving to Pelotillehue; the “sign” could be data in its software. Whether human or artificial, the decider needs information. While information may be derived algorithmically, it’s not arbitrary. The distinction on the sign is relevant and understandable to particular drivers on particular journeys. The sign isn’t at some random point in the road, but at the fork. Someone (something?) must decide what should be shown for the right actor to choose at the right time and place. That’s the essence of information architecture. I’ll argue that current AIs can’t yet do this on their own. But before I do, let’s dive a bit deeper into the practice of IA and what it entails. What Information Architecture Does Few people have heard the phrase “information architecture” at all. Of those who have, many misunderstand what it does. At best, they think IA is about setting rigid top-down categorization schemes for information systems. At worse, they think it’s about drawing site maps. While these things are outcomes of information architecture, they’re not what IA is about. I’ve boiled down IA to three basic activities: Organize information. Set the context. Plan for change. Let’s unpack them: Organize information. People only understand things relative to other things they already understand. We make distinctions between things (Buenas Peras/Pelotillehue) and group others (vehicles, cities, roads, signs.) We grok concepts through clustering and contrasting. Set the context. We don’t experience information in a void. Choices only make sense in particular contexts. Moreover, sets of choices create particular contexts. IA isn’t just about organizing information, but defining contexts that influence how we perceive where we are and what’s on offer. Plan for change. The idea that IA traffics in “static” information structures is misguided. There are no static information structures – only structures that change at different paces. IA enables changes to happen without compromising intended meaning. Basically, this means governance. Taken together, these activities differentiate IA from other disciplines. And although AI changes how they’re done (and experienced), it doesn’t make them obsolete. At least not yet. What Artificial Intelligence Does (and Does Not) For non-human systems to independently organize information, set the context, and plan for change, they’ll need capabilities current AI systems don’t provide. That’s not to say they never will. But I don’t see how current architectures get us there anytime soon. Yes, AI vendors are promising that AGI (artificial general intelligence) is imminent. I’m skeptical. The more I work in the space, the more convinced I am that current architectures won’t scale to AGI. It only seems they might because LLMs are so effective at languaging. ChatGPT is vastly more capable, useful, and sophisticated than ELIZA. But at their core, both work by matching patterns in language rather than developing real-world understanding – a prerequisite for the skills needed to architect information: empathy, planning, goal-oriented behavior, learning and adapting, and improvising when needed. Not to mention embodiment, which is essential for true contextual understanding. AFAIK, current AI systems aren’t close to acquiring these abilities. (But there’s much I don’t know; I’m going by my real-world experience.) This isn’t to say these systems aren’t useful. Far from it! I wouldn’t be betting my career on the technology if I didn’t believe these systems have incredible potential. But I also think expectations that they can effectively organize information, set contexts, and manage change in ways that are truly useful for humans (or even other AIs) are wildly optimistic, if not outright magical thinking. At least with the current technology – which of course, might change. Bottom Line: Play for Today If AGI ever arrives in the way many imagine — fully autonomous systems that reason, plan, and adapt like humans — then yes, we might no longer need human information architects. But that’s an if, not a when. We’re certainly not there yet. So I’m keeping my mind open and learning as much as I can. But I also understand that organizations want to deliver better products and experiences now. Current technologies can help. But they won’t do it on their own. For the foreseeable future, they’ll need guidance. That’s why I’m pivoting to architecting structures that allow organizations to use these systems more effectively. Taking a page from Pascal, you can think of it as “Jorge’s wager”: AGI may be imminent, but we may as well act as if it isn’t. When (if) it arrives, we’ll have bigger issues to deal with. For now, we have amazing systems that can take us a long way – with human architects guiding them.

12 hours ago 1 votes
Software engineering job openings hit five-year low?

There are 35% fewer software developer job listings on Indeed today, than five years ago. Compared to other industries, job listings for software engineers grew much more in 2021-2022, but have declined much faster since. A look into possible reasons for this, and what could come next.

yesterday 6 votes