Published on: 2021-05-20
It's been 10 days since I started working on Starfish: a Gemini browser for elementary OS. So I guess an update is in order.
I've got the app rendering Gemini pages, so that's good 😁️. It can survive majority of the famous Gemini client torture test:
gemini://gemini.conman.org:1965/test/torture/
I still have some core architecture issues to iron out. At first I thought I'd read server response line by line and render them as I go. For as of yet unknown reason this leads to connection closing before I am done reading the entire response. I switched to reading the entire response upfront and just rendering it line by line. I'd still like to figure out the problem with "streaming approach" and fix it.
There's also more work on some core classes, such as URL parser, and general error handling through the app. Right now I'm reusing my Gemini response model to signal client side errors (such as unresolved domain, unexpectedly closed connection etc.). This is not ideal, as it forced me to make up error codes that aren't in the spec. Also, I'd like to extend test coverage to at least all of the core logic classes.
And then there's the complete lack of any user facing / UI features such as tabs, bookmarks, gemlog subscriptions or user configurable theming. The issue that pains me the most right now is missing history / back button. I'd like to solve the core stuff first, but I might sneak the back button in before all of core is done.
So far I'm happy with my learning pace. I started by following the Getting Started¹ guide on elementary OS docs. They are nicely laid out and cover the basics such as desktop related meta-data, meson build system and setting up translations support. On pure language / syntax side, I found the Vala for Java Programmers² article super helpful. Other than that the "main" Vala Tutorial³ answered all in-depth questions I've had.
1: Getting Started guide on elementary OS docs
I'm also getting used to looking up APIs on Valadoc. Coming from Java world I'm a bit spoiled by autocomplete features of heavy duty IDEs used in those circles. For the Starfish project I decided to use elementary's Code text editor. I know there's Vala language server integration for Visual Studio Code, but I wanted a simpler setup. I want to have as little indirection between me and the Vala compiler. This way I get errors straight from the horse’s mouth and don't have to wounder if it's my fault or if IDE's build pipeline broke. As a downside I had to get used to constantly checking stuff on Valadoc site. This bothers me less and less.
Seeing my Gemini capsule rendered in Starfish felt really good. Progress so far was quick and rewarding. However, I've already started taking shortcuts and making compromises in the code. So I'd like to stand back for a while and improve the quality of the code; get a tick-tock dynamic going.
I'd also like to spin off some of the solutions I settled on into standalone tutorial-like posts. For example I did struggle a bit with rendering links in the Gtk TextView. I ended up referencing a PHP-GTK2 tutorial series from the 2015:
https://www.kksou.com/php-gtk2/category/sample-codes/Page-3.php
I could find a ton of lower level API documentation for Gtk covering multiple languages (including an excellent coverage on Valadoc itself). But I do miss articles on higher level concepts that discuss how to deliver more complex features. Also, I found relatively little community content for Vala. Writing some tutorials with examples and followup code project in Vala might be genuinely helpful for someone getting started with the language.
Lastly, I need to check Starfish into a git repo and publish it to GitHub. And I need to do this before I mess it all up in some wild refactoring effort that inevitably breaks everything.