216 results for "":
oocdoc, Part 1 — NaturalDocs
Documentation in ooc land has sucked for quite some time. The standard response is pretty much: “use the code, Luke!” — which is fine when doing small projects that don’t matter much, but not so when you want to get serious.
So when a newcomer, beoran, asked how to generate documentation, and later told us he got NaturalDocs to work, naturally, I had to see for myself how well it worked.
The curse of strong typing
It happened when I least expected it.
Someone, somewhere (above me, presumably) made a decision. “From now on”, they declared, “all our new stuff must be written in Rust”.
I’m not sure where they got that idea from. Maybe they’ve been reading propaganda. Maybe they fell prey to some confident asshole, and convinced themselves that Rust was the answer to their problems.
Efficient game updates
A little while ago, I wrote an article on things that can go wrong when downloading, it listed a series of reasons, from network problems to invalid content to imperfect hardware that may occur when initially installing a game.
This article discusses what methods we can use to upgrade a game to a later version, when an older version has been successfully installed.
Things that can go wrong when downloading
When I get a little bit too emotional about my current baby, the itch.io app, there’s always a timely support ticket reminding me that it is currently, still a glorified game downloader.
However true that is, that doesn’t mean it’s easy! In the past year, I’ve had to account for a bunch of failure conditions that can happen, some of which I didn’t realize were even possible. Let’s review them, for fun!
Deploying catscii to fly.io
Disclaimer:
Because I used to work for fly.io, I still benefit from an employee discount at the time of this writing: I don’t have to pay for anything deployed there for now.
fly.io is still sponsoring me for developing hring, but this isn’t a sponsored post. It’s just a good fit for what we’re doing here, with a generous free tier.
In the previous chapter, we’ve written a Dockerfile
to build the
catscii
service inside Docker. The result is a container image that can be
pushed to production!
Async fn in trait, for real this time
async_trait
’s one weird type ascription trick
Now that I got the Log in with GitHub feature working, let’s explore
what this would’ve looked like with the async_trait
crate.
First up, the trait definition:
/// Something that can refresh credentials
#[async_trait::async_trait]
pub trait CredentialsRefresher {
async fn refresh(&self, creds: &FutileCredentials) -> eyre::Result<FutileCredentials>;
}
Cracking Electron apps open
I use the draw.io desktop app to
make diagrams for my website. I run it on an actual desktop, like Windows or
macOS, but the asset pipeline that converts .drawio
files, to .pdf
, to
.svg
, and then to .svg
again (but smaller) runs on Linux.
So I have a Rust program somewhere that opens headless chromium, and loads just the HTML/JS/CSS part of draw.io I need to render my diagrams, and then use Chromium’s “print to PDF” functionality to save a PDF.
rock 0.9.6 is on the loose!
Just 8 days after the last release, rock 0.9.6 is out.
To update, run git pull && make rescue
as usual. To install from scratch,
clone the repo, cd into it, and run make rescue
from there - it’ll download the latest bootstrap, compile itself from
C, then recompile itself from ooc.
Running rock -V
should give you something like this:
rock 0.9.6 codename loki, built on Wed Feb 20 15:09:08 2013
Everything but ELF
And we’re back!
In the last article, we thanked our old code and bade it adieu, for it did not spark joy. And then we made a new, solid foundation, on which we planned to actually make an executable packer.
As part of this endeavor, we’ve made a crate called encore
, which only
depends on libcore
, and provides some of the things libstd
would give us,
but which we cannot have, because we do not want to rely on a libc.
Cross-compilation notes
I’ll keep updating this article as I go, just to put stuff in all the same place.
Platforms
Cross-compiling for Linux
I’m pretty sure it’s possible to cross-compile for Linux on other OSes, seeing as everything is open-source, but I have never done it - and why would I want to? Linux is the friendliest to build on, so it’s better to use it as a build environment.