After getting sherlocked last year, it became clear cross-platform support for @astropad was make or break.

16 months later we've nearly completely rewritten our apps to support Mac AND Windows.

Here's what we've learned.

A thread 👇🏻
1/

It's best to avoid a full rewrite of your code. Rewrites are incredibly time-consuming and it will nearly halt improvements for existing customers during that time.

But sometimes it's unavoidable. We tried to use Objective-C on Windows, it didn’t work.
2/

Once we committed to a rewrite we knew Objective-C wasn't going to cut it. And none of us were excited about using C++ or plain C. Now what?

Enter Rust. Fast, safe, cross-platform and fun.
3/

Rust has been a GREAT choice for cross-platform work. Our core engine is in Rust and we use language bindings to C# (Windows) and Objective-C (Mac/iPad) for the UI.

It's worked well. Most of our crashes now come from the C/C++ code that's still present 😉
4/

Since we're working in a new language (Rust) on a new platform (Windows) a small team is key.

We started with one person breaking trail and as architecture was defined we added more people but kept it small at 4 people.
5/

When doing a rewrite it's going to take much longer than you think. I'd multiply your estimates by 2x, maybe even 3x.

This is especially true when you're adding a new platform and using a new language.
6/

Keep the number of code architecture changes to a minimum.

While a rewrite may seem like a great time to clean things up, I'd suggest only addressing the most egregious areas. You've already got you're work cut out just porting as is.
7/

Break the things up into clean modules and give people ownership. Ideally, you can then rewrite those modules in pieces.

It's also important to have something runnable at all times, you don't want to wait 6 months to integrate everything.
8/

It's going to be really hard at times. We had to rewrite tens of thousands of lines of code.

As you rewrite, celebrate those wins! You need those milestones otherwise it will feel insurmountable
9/

Porting a codebase that's been around a while is hard. You've accumulated a lot of features and improvements. It's a lot like moving out of an old house, you'll be surprised how much stuff there is!

So don't hold off, start porting now!
10/

Now after a lot of hard work we've got our core LIQUID engine running on both MacOS and Windows and it feels great.

The team has done a phenomenal job. Many other engineering orgs would have collapsed under the task 💪🏻
11/

There's a huge opportunity outside of the Mac ecosystem. There are literally 10x as many Windows users as there are Mac users!

So we are super excited about the opportunity in front of us.
12/

If you want to see the fruits of our labor, check out our Kickstarter that we launched today.

This small, bootstrapped team would love your support 🙏🏻 https://www.kickstarter.com/projects/767721702/luna-display-for-windows
You can follow @mronge.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: