Console #116 - An Interview With Hanno About Fornjot - A Rust Based CAD Program
Featuring Gum, Comcast, and Decompiler Explorer.
If you or someone you know is interested in sponsoring the newsletter, please reach out at email@example.com
Gum provides highly configurable, ready-to-use utilities to help you write useful shell scripts and dotfiles aliases with just a few lines of code
language: Go, stars: 4100, issues: 8, last commit: July 31, 2022
Comcast is a tool designed to simulate common network problems like latency, bandwidth restrictions, and dropped/reordered/corrupted packets, so you can build better systems.
language: Go, stars: 9300, issues: 22, last commit: April 23, 2022
Decompiler Explorer is a web front-end to a number of decompilers. This web service lets you compare the output of different decompilers on small executables. In other words: It's Compiler Explorer, but in reverse.
language: Python, stars: 751, issues: 36, last commit: July 25, 2022
Fornjot is an early-stage project to create a next-generation, code-first computer-aided design (CAD) application.
Not subscribed to Console? Join thousands of engineers, VCs, and early-stage CTOs in subscribing to a weekly roundup of the latest in open-source software, curated by an ex-Amazon engineer
Hey Hanno! Thanks for joining us! Let us start with your background. Where have you worked in the past, where are you from, how did you learn to program, and what languages or frameworks do you like?
I'm from Germany, more specifically the Odenwald, which is a rural and hilly area in Germany's southern half. I found that I like this kind of environment better than major cities, so that's where I also live today.
My first contact with programming was back in school, probably when I was around 14-15 years old. It wasn't part of the curriculum, but there was a math teacher who offered a voluntary course, and that set me on my path. I've had some kind of programming side project ever since (closing in on 40 now; that's age, not the number of projects).
I actually never had a real job. The closest I came was working part-time as a programmer while I was at university (I got a bachelor’s in computer science). After that, I was always self-employed in one form or another.
For many years, I tried to be an independent game developer. I never managed to make a living from that, and it didn't work out in the end. That whole experience left me pretty disillusioned.
Partly as a reaction to that, I developed an interest in things I considered more useful than games. Electronics, 3D printing, CNC machines, woodworking, and more. I also recognized that I needed to take my freelancing business, which had kept me afloat all those years, more seriously. That was around 2016.
I had already been using Rust for my game projects by that point and liked it a lot. I decided to focus on embedded software using Rust and did that for a few years. Eventually, I decided that client work wasn't for me and started exploring other options. That led to my current work on Fornjot.
What’s your most controversial programming opinion?
I don't know if it's controversial, but I live my programming life by one iron rule: that it's always okay to make a mess, but it’s never okay to build on top of one.
In the past, I struggled to find a balance between doing it the right way (and never getting anything done) or doing whatever it takes (and having your code collapse under its own weight at some point).
If you don't know how to do something the right way, you can either spend a lot of time thinking, struggling, and procrastinating (and maybe just give up in the end), or you can just figure out how to do it in the most stupid way that somehow works. That can be very freeing.
Yes, it would be better if people could actually work with your code, but as long as the messiness is limited in scope, it's usually okay. The real problem comes, when you start building on top of that messy code. Then it starts infecting the new code with its stupidity.
Fortunately, by the time you have to do that, you'll be in a much better position to do it right. You have the experience of having written the code, of having used it, and you probably had a chance to think about it in the back of your mind. So go clean it up, before using it as a foundation for your next masterpiece.
It's a process, of course. There's no clear delineation between good and bad code. You won't automatically be able to write perfect code the second time around. So you might have to revisit a problematic piece many times, as you extend it and build more stuff around it. But following this rule to guide my work has done wonders for my productivity.
What is your favorite software tool?
I don't know, probably Rust? The first few years I was using Rust, it really excited me, but that excitement mostly disappeared. I still don't want to use anything else (it fits me and my work so much better than any other language I know), but my thinking about these things shifted over the years. I care less about the tools themselves, and more about what I can do with them.
If I gave you $10 million to invest in one thing right now, where would you put it?
That's way too much money! I've never spent nearly as much on anything, and lacking that kind of experience, I'd probably waste most of it.
I don't say that to dodge the question. Investing in Fornjot would be an obvious answer. But I've never hired people before, so even if I had that kind of money, I'd start small. Maybe with one part-time freelancer, then work my way up as I get more comfortable.
What are you currently learning?
The vast majority of the work I do stretches my abilities in some way, so I'm always learning something. The most obvious case right now is probably a side project I'm working on, designing and building a CNC mill.
I'm still in the research phase, and I have been learning a lot about the components required. Reading data sheets for ball screws and such. My research notes are public, in case anyone's interested.
What have you been listening to lately?
Podcasts. Lots of them! Mostly about making physical things and business. My current favorites are Making It, The Business of Machining, and Within Tolerance, which are kind of at the intersection of those two topics.
I think podcasts, especially those with multiple people having a conversation, are great tools for immersing yourself in a new topic, even change the way you think. We are all influenced by the people that are close to us, and my theory is that by listening to a conversational podcast, you can trick your brain into thinking you are hanging out with friends.
This can be really useful, if your actual friends aren't interested in the topics that you'd like to get into. I've used this to get into more of a business mindset in the past, and right now I'm using it to get more exposure to making physical products, which is something I'm interested in.
Why was Fornjot started?
As I said earlier, I developed this interest in making physical things a few years ago. Going down that road, sooner or later you run into the need to design something on a computer, which is what CAD software is for.
As a software developer, the approach of using code to define your 3D geometry made sense to me, so I started using OpenSCAD. I don't mean to put down OpenSCAD. It's a great tool for many people, but it also has its oddities and limitations. Being the way I am, I started experimenting with my own alternative pretty much immediately.
What were some of these oddities/limitations that made you consider building something from scratch?
OpenSCAD uses a custom language for defining CAD models. This language is lacking many features that general-purpose languages typically have. Structs/classes is one omission that stands out.
OpenSCAD's big limitation though is that you can't refer back to geometry you have generated. It is essentially write-only. You can't, for example, say stuff like "round the edges of that cube I just created", or "place this next shape on top of the previous one". This makes a lot of tasks very tedious.
To be clear, Fornjot can't do any of those things either. It's still early days. I'm working on it!
Where did the name for Fornjot come from?
I'm not good at naming things. I just went to Wikipedia's list of moons and kept reading until I found a name I liked, and that didn't seem to be used by some other project already. It stuck.
Are there any overarching goals of Fornjot that drive design or implementation? If so, what trade-offs have been made in Fornjot as a consequence of these goals?
A CAD application, especially one with a custom CAD kernel, is a huge project. The primary goal was always to make that manageable somehow. Making Fornjot code-first is an element of that. A decent API is easier to design and maintain than a decent GUI (at least for me).
Using Rust as the language to define CAD models is another trade-off. It's certainly not the ideal choice for that, but using the same language for both models and the rest of the project is easier, so there we go (for now; there are long-term plans for supporting a multi-language ecosystem).
And there are many more examples. Sometimes contributors come along with great ideas for how things could be, but I always have to weigh how much work that would be, and who's going to be available to maintain it.
To be clear, we have two different use cases for Rust within Fornjot: First is the language the project itself is written in. Second is the language that users of Fornjot use to define define CAD models.
Rust is a great for the first use case, writing the project itself. I'm not aware of any language that would clearly be a better choice. And since I'm the one working on the project, there's no competition, given my own skills and preferences.
For the second use case, defining CAD models, which is what OpenSCAD uses a custom language for, Rust is an interesting choice. Maybe good for some niche cases, but certainly not best overall. A scripting language would be better. Something lightweight, that allows for quick iteration without compile times, and is easier to approach.
What is the release process like for Fornjot?
It's horrible! At some point, I decide that it's been too long since the last one. Then I take some more weeks to finish what I'm currently working on. After that, I'm left with summarizing 2+ months worth of work into a changelog and release announcement.
I just went through that again and decided, no more. From now on, I'm doing weekly releases. I already publish a weekly dev log. My plan is to use that as the weekly release announcement, and also reuse parts of it for the changelog.
Working in smaller increments is just so much easier to handle.
Is Fornjot intended to eventually be monetized if it isn’t monetized already?
I've been working on it full-time since the start of 2022 and started monetizing it shortly after. For the last few months, I've been making enough to cover my living costs. I live modestly, so it doesn't take a lot.
My main (and currently only) source of revenue are sponsors, most of them through GitHub Sponsors. I'm also open to offer custom development, training, and coaching related to Fornjot, if it fits with my priorities for the project. So far that hasn't materialized, which at the current stage of the project isn't surprising.
How do you balance your work on open-source with your day job and other responsibilities?
The trick is to have no such responsibilities. I don't have a day job, no wife, no kids, no house, no car, no debt. Those are deliberate choices.
I'm interested in creating, and in building a business that enables me to work on my own terms. I've made the life choices to support these priorities.
What is the best way for a new developer to contribute to Fornjot?
Pick an issue and start working on it! I label some issues as good first issue, and make an extra effort to point people in the right direction with those. If you need more guidance, reply to the issue (if you have a specific one in mind), or join us on Matrix or GitHub Discussions for more general questions.
If you plan to continue developing Fornjot, where do you see the project heading next?
Fornjot already implements an end-to-end use case, meaning you can create a model, export it to an STL or 3MF file, and use that to 3D-print the model. But the modeling aspect is so basic, it's not really useful yet for anything realistic. The current priority is to change that and achieve a basic level of usefulness, by implementing boolean operations (union/difference/intersection of two shapes).
After that, I expect to put some time into usability and user-facing documentation. After that, probably either support for embedding Fornjot models into websites, or the next round of CAD modeling features (like better support for more complex shapes, better support for 2D CAD, chamfers, or drawing sketches on existing faces).
I have no plans to stop. If I can make it work financially, I'm in this for the long term.
What motivates you to continue contributing to Fornjot?
Motivation is great. I try to make good use of it when I have it, but it's too fickle to depend on. At least for me. I prefer to build habits, by having a consistent routine.
But why do I decide to continue? I sincerely believe that the world needs another CAD program. I want to have it for myself, and the feedback (and sponsorship!) I get from other people tells me that I might be on to something.
Are there any other projects besides Fornjot that you’re working on?
While Fornjot is my main thing, I always have side projects going on. The most notable one right now is the CNC mill I mentioned earlier. I have a hard time focusing on just one thing, and overall, I'm much more productive when working on multiple projects in parallel.
I've made the mistake of becoming obsessed with a single project in the past, and my mood ended up depending too much on how that project was going. These ups and downs aren't healthy. It's much easier to feel good consistently, if I'm always making progress somewhere.
Do you have any other project ideas that you haven’t started?
Constantly. If I had infinite time, I'd probably re-invent every single thing I've ever used.
How about the top 3?
Hard to come up with a definite top 3, but here are some highlights:
1. A static website generator. I want one that's fully programmable. Basically, a custom build pipeline that allows me to seamlessly combine pre-made components (like Markdown -> HTML conversion) with custom code.
2. A modular sensor platform. Like, I want to connect the temperature sensor module to the Wi-Fi module and the e-ink screen module, and end up with an IoT sensor that I can just put down somewhere with minimal configuration. Basically Lego, but the bricks being sensors, screens, and wireless interfaces.
3. Despite my past failures, I still can't seem to let go of that idea, of developing some big MMO-like game set in space. Basically EVE Online, but made so that people who just want to play with their friends once a week can actually understand what's going on.
Do you have any suggestions for someone trying to make their first contribution to an open-source project?
Starting is often the hardest part. Figure out your next step and focus on doing that. If you don't know the next step, then figuring it out is the next step.
If you feel overwhelmed, your next step is too big. Split it into smaller steps, and focus on the first of those. Keep doing that until you have a next step that seems manageable, even if it's as modest as sitting down at your desk.
Once you've taken a step, start again at the beginning.
That advice applies to more than just open source, so maybe the answer is no, I don't have any suggestions for that specifically.
Want to join the conversation about one of the projects featured this week? Drop a comment, or see what others are saying!