from/prod
← All companies

THE COMPANY INDEX TRACKED BLOG

Romes' Musings

Ideas, decisions, and lessons from the team.

alt-romes.github.io (opens on the source site)
16Posts tracked
6 months agoLatest publication
0.3Posts / month over the last 12 months

Latest writing

16 of 16 posts

Running out of Disk Space in Production (opens on the source site)

Last night I put up a simple server which allowed customers to download the digital Kanjideck files. This server is hosted on a small Hetzner machine running NixOS, at 4GB of RAM and 40GB of disk space. One of these downloadable files weights 2.2GB. The matter at hand boils down to a simple Haskell program which serves static files (with some extra steps regarding authorization) plus an nginx reverse proxy which proxies requests to a certain “virtual host” to the Haskell program. Fig 1. Simplified server architecture 1 First, Panic Not even minutes after I announced that the files were…

Read at the source

How I turned my Anki side project into a Kickstarter: A Walkthrough (opens on the source site)

Contents 1 The initial idea (August 2024) 1.1 What if ? 2 Manufacturing physical cards (September 2024) 3 Starting a Company in the U.S. (October 2024) 3.1 Accounting and Taxes 4 Spreadsheets and Pricing (November 2024) 5 Digital Infrastructure (December 2024) 6 Marketing and Ads (January 2025) 7 Burn-out (March 2025) 8 Reaching out for help (October 2025) 9 Launching on Kickstarter (January 2026) 9.1 Murphy’s Law 10 Conclusion I think this is my first non-Haskell related post on this blog! This time, I want to walk through how I successfully launched Kanjideck on Kickstarter starting from…

Read at the source

Haskell Debugger for GHC 9.14 (opens on the source site)

This post was first published inline to the Haskell Discourse, where there was some discussion about the debugger: 1 The Haskell Debugger for GHC 9.14 The Haskell Debugger is ready to use with GHC-9.14! The installation, configuration, and talks can be found in the official website. The tl;dr first step is installing the debugger: $ ghc --version # MUST BE GHC 9.14 The Glorious Glasgow Haskell Compilation System, version 9.14.1 $ cabal install haskell-debugger \ --allow-newer=base,time,containers,ghc,ghc-bignum,template-haskell \ --enable-executable-dynamic # ON WINDOWS, DO NOT PASS…

Read at the source

Lazy Linearity for a Core Functional Language (POPL 2026) (opens on the source site)

I’m very proud to announce that Lazy Linearity for a Core Functional Language, a paper by myself and Bernardo Toninho, will be published at POPL 26! [DOI, ACM]. The extended version of the paper, which includes all proofs, is available here [arXiv, PDF, DOI]. The short-ish story: In 2023, for my Master’s thesis, I reached out to Arnaud Spiwack to discuss how Linear Types had been implemented in GHC. I wanted to research compiler optimisations made possible by linearity. Arnaud was quick to tell me: “Well yes, but you can’t!“ “Even though Haskell is linearly typed, Core isn’t!”1 Linearity is…

Read at the source

Automatically Packaging a Haskell Library as a Swift Binary XCFramework (opens on the source site)

Contents 1 Announcing: xcframework 1.1 XCFrameworks 1.2 How to install xcframework 1.3 How to use the XCFramework in XCode 1.4 Building simple Swift package 1.5 Must use Cabal Foreign Library stanza 1.6 Conclusion I’ve written about Haskell x Swift interoperability before. Calling Haskell from Swift is about marshalling and the foreign function interface. But Creating a macOS app with Haskell and Swift tells the much messier tale of hijacking XCode to vodoo together the Haskell library, its headers, and two handfuls of other magic ingredients into one buildable SwiftUI application. Stop!…

Read at the source

Implementing Unsure Calculator in 100 lines of Haskell (opens on the source site)

Contents 1 Unsure Calculator 1.1 Sampling it up 1.2 Calculator Expressions 1.3 Showing up 1.4 Conclusion 1 Unsure Calculator The recently trendy Unsure Calculator makes reasoning about numbers with some uncertainty just as easy as calculating with specific numbers. The key idea is to add a new “range” operator (written ~) to the vocabulary of a standard calculator. The range x~y denotes that a real value is uncertain, but we are 95% sure that it falls between x and y1. Reading the notation is easy: when you see 10~15, you say: “ten to fifteen”. Arithmetic operations and friends (e.g. sin, or…

Read at the source

Planning Weekly Workouts in 100 lines of Haskell (opens on the source site)

Contents 1 A workout planner in 100 lines of Haskell I have recently started doing some outdoors bodyweight workouts. I also want to start running again, but I’m recovering from a minor knee injury until the start of next month. Tonight I decided to put together a weekly schedule to start following next month. The first pen and paper versions were fine, but I wasn’t completely satisfied. The next logical step was to write a quick program to see what possible plans I was missing. The schedule must satisfy a few constraints, but the core of it is that I should do, every week, on one axis, one…

Read at the source

Calling Haskell from Swift (opens on the source site)

Contents 1 Introduction 2 Marshaling Inputs and Outputs 2.1 Haskell’s Perspective 2.2 Swift’s Perspective 3 Metaprogramming at the boundaries 3.1 Haskell’s perspective 3.2 Swift’s perspective 4 Remarks This is the second installment of the in-depth series of blog-posts on developing native macOS and iOS applications using both Haskell and Swift/SwiftUI. This post covers how to call (non-trivial) Haskell functions from Swift by using a foreign function calling-convention strategy similar to that described by Calling Purgatory from Heaven: Binding to Rust in Haskell that requires argument and…

Read at the source

Computed Properties for Haskell Records (opens on the source site)

Contents 1 Records in Haskell 1.1 Overloaded Record Dot 1.2 Named Field Puns 2 Computed Properties 3 Conclusion 1 Records in Haskell Haskell has so-called record types, which are also commonly known as structs, for instance, in C, Swift, and Rust. To define a square, one would write: data Point = Point { x :: Int , y :: Int } data Square = Square { topLeft :: Point , bottomRight :: Point } mySquare = Square{ topLeft = Point{x = 0, y = 0} , bottomRight = Point{x = 2, y = 2} } mySquareWidth = x (bottomRight mySquare) - x (topLeft mySquare) In Haskell record types are just syntactic sugar for…

Read at the source

Creating a macOS app with Haskell and Swift (opens on the source site)

Contents 1 Hello, Swift, it’s Haskell! 1.1 Setting up the SwiftUI app 1.2 Setting up a Haskell foreign library 1.3 Linking the Haskell library with the executable 1.4 The RTS must be initialized 2 Remarks 2.1 Further Reading This is the first part of an in-depth guide into developing a native applications for Apple platforms (macOS, iOS, etc.) using Haskell with Swift and SwiftUI. This is the first in a series of blog posts – covering the set-up required to call Haskell functions from Swift in an XCode project using SwiftUI. In future installements of the series, I intend to at least discuss…

Read at the source

Writing prettier Haskell with Unicode Syntax and Vim (opens on the source site)

Contents 1 Haskell’s Unicode Syntax Extension 2 Digraphs in Vim 3 Conclusion 1 Haskell’s Unicode Syntax Extension Haskell (well, GHC Haskell) features an extension called UnicodeSyntax. When enabled, this extension allows the use of certain unicode symbols in place of their corresponding keywords. A great example is the forall keyword being equivalent to the unicode symbol ∀, the two of which can be used interchangebly when UnicodeSyntax is enabled. Furthermore, with Haskell being a unicode-friendly language, one can define common Haskell functions, operators or type variables using unicode…

Read at the source

Equality Saturation in Haskell, a tutorial (opens on the source site)

Contents 1 Symbolic Maths in E-graphs 1.1 Syntax 1.2 Language 1.3 Analysis 2 Equality saturation on symbolic expressions 2.1 Cost function 2.2 Rewrite rules 2.3 Equality saturation, finally hegg is a Haskell-native library providing fast e-graphs and equality saturation, based on egg: Fast and Extensible Equality Saturation and Relational E-matching. Suggested material on equality saturation and e-graphs for beginners egg: Fast and Extensible Equality Saturation in a 5m video egg’s users guide To get a feel for how we can use hegg and do equality saturation in Haskell, we’ll write a simple…

Read at the source

Graphical Applications in Haskell with FRP and Reflex (opens on the source site)

Contents 1 Functional Reactive Programming 1.1 Behaviours 1.2 Events 2 Reflex 2.1 Building UIs with Reflex-Dom 2.2 Reflex Combinators 3 Example: 101companies reflex library, and using them to create DOM-based graphical --> reflex-dom library... --> 1 Functional Reactive Programming Functional reactive programming is a general paradigm well suited to programming real-time systems in a high-level and functional way. Real-time systems or reactive systems are those that handle continuous time-varying values, discrete events in real time, and react accordingly. A good example of these systems is a…

Read at the source

Graphical Applications in Haskell with MVC and Gloss (opens on the source site)

Contents 1 MVC 2 Functional MVC: Gloss 2.1 Picture 2.2 Event 2.3 Gloss 1 MVC Model–view–controller (MVC) is a software architectural pattern commonly used for developing user interfaces that divide the related program logic into three interconnected elements. MVC says that an interactive application should consist roughly of three main parts – Model, View, and Controller. The Model is the data and state that we need to keep track of to model our application. If you’re programming a Chess game, the model could consist of the state of the board (which pieces are where), the time passed since…

Read at the source

Haskell 102 Lecture Notes (opens on the source site)

Contents 1 Functions Types, Currying, Partial application, Higher-order functions 2 Laziness 3 Recursion: Inductive Method 4 Recursive data structures 5 Type Classes 6 Type Classes Kinds, Constraints 1 Functions Types, Currying, Partial application, Higher-order functions All functions have a type, the function type: length :: [a] -> Int length [] = 0 length (x:xs) = 1 + length xs The same way we think about the Either type constructor, and about the tuple type constructor (,), we can think about the function type type constructor (the arrow ->). They are all type constructors that take two…

Read at the source

Haskell 101 Lecture Notes (opens on the source site)

Contents 1 Functions, Computations: Abstraction and application 2 Expressions, Values, Types 3 ADTs, Construction, Deconstruction 4 Polymorphism 5 Non-nullary type constructors, Kinds 1 Functions, Computations: Abstraction and application What is a function? f(x) = 4x + 2? And what’s function application? f(x) = 4x + 2 f(5) = ? In mathematics, function application is the act of applying a function to an argument from its domain so as to obtain the corresponding value from its range. In this sense, function application can be thought of as the opposite of function abstraction. In functional…

Read at the source

Privacy choices

Reading never requires analytics. These choices last 90 days on this browser.

Essential sign-in and security storage always stays on. Read the privacy notice.