See part 1 of this series for an introduction to FORTRAN and a basic overview of the f2rust compiler. This part dives into an assortment of interesting or weird or annoying parts of FORTRAN, and discusses how f2rust approaches them. Memory allocation FORTRAN is designed to work on systems with no dynamic memory allocation. Notably that doesn’t just mean no heap, it means no stack either. The…
Background A while ago I got interested in the Voyager space probes, and specifically the image processing that produced pretty pictures of the planets. I thought it would be fun to learn about and reimplement their processing pipeline. Voyager launched in 1977 and much of their code was written in FORTRAN – a sensible choice at the time. But now it’s the 2020s and I’d much rather use Rust. One…
On Windows, Rust programs can have surprisingly poor performance when running in VS Code with CodeLLDB, and in some other IDEs. This particularly affects programs that use allocation-heavy containers like HashMap<String, _> . Even a few megabytes of small allocations can lead to terrible performance when the container is deallocated. There is an easy fix: set the environment variable…
Some of the more interesting or notable articles from the 1960s space scrapbooks : Yuri Gagarin’s spaceflight : The Voice From Space said yesterday: “The sky is very, very dark, and the Earth is a light blue. Everything can be seen very clearly.” It was the voice of Yuri Alexeyevitch Gagarin, the young Russian who, a few minutes before, had been hurled skywards into the greatest adventure ever…
I inherited a couple of scrapbooks full of newspaper clippings from the Space Race of the 1960s, mostly from British newspapers (including the Evening Standard, Daily Mail, Daily Mirror, and Daily Sketch). Unfortunately they are suffering from some physical deterioration — in particular the sixty-year-old sticky tape holding most of the clippings onto the pages has turned into unsticky tape, which…
To understand memory barriers in Vulkan, it is helpful to understand the typical GPU memory architecture and why they need these barriers. Unfortunately there seems to be a lack of public documentation of how any of this works. This document is an attempt to describe and explain the memory architecture and how Vulkan’s memory model maps onto it. I’m not an expert and it may be full of mistakes (in…
Update from the future I wrote this back in 2011, so it’s hopelessly obsolete. Do not confuse this extension with the officially documented, and nowadays more widely supported, GL_INTEL_performance_query . Introduction There are a number of OpenGL extensions related to GPU timing and performance: GL_ARB_timer_query , ( supported by modern NVIDIA and ATI/AMD drivers on Windows and Linux for most of…
Pre-introduction This article assumes some understanding of bytes and characters and Unicode and encodings. (See the absolute minimum … ) Introduction Consider a trivial CGI script called echo.cgi : # !/usr/bin/perl -T use strict ; use warnings ; use CGI :: Simple ; my $ cgi = new CGI :: Simple ; my $ name = $ cgi -> param ( ' name ' ) ; my $ name_escaped = $ cgi -> escapeHTML ( $ name ) ; print "…
This page is an extension of this post on aliasing. In particular, that thread includes several suggestions of code that is undefined according to the standards, which can cause real errors (at least in GCC). The following example includes various ways of converting a float’s bytes into an int: #include < cstdio > #include < cstring > inline int float_to_int ( float f ) { #if NUM == 1 return * (…