This is the third part of a series of three articles on modelling actor-like systems 1 2 using PLT Redex . (The first sketch of this part of the series was written in August 2016, a day after the other two. Ten years later, I’m finally getting around to finishing it off!) Part I: The Functional Fragment: ISWIM in Redex Part II: The Communicating Fragment: Actors in Redex Part III: Efficiency vs.…
Back in 2002/2003, Ian Piumarta wrote an “essentially complete” VT102 terminal emulator for Squeak Smalltalk . 1 Here are his unmodified original changesets, encoded using the MacRoman character set; these do not load directly into current Squeak images as-is: PseudoTTY-3.2-4.st (MacRoman, not loadable) telnet.301.cs (MacRoman, not loadable) The problem is not just that they’re encoded using…
Smalltalk programs strictly alternate between data and behaviour. Messages (the only kind of data in Smalltalk) are implicit , constructed fresh at each point in the program method call syntax is used, and are shallow , meaning that the slots in each message object always contain references to objects , never other messages. 1 This is in contrast to most other languages with true data, where (for…
Usually, method lookup results in a single body to execute. This is analogous to the way pattern matching usually tries patterns in order, selecting just one continuation to execute. What if, instead, we allowed all matching patterns from a bunch of alternatives to execute? (Or, in object-oriented terms: executed all methods potentially matching a given method call.) Pattern alternatives do not…
A fantasy abstract is a short piece of writing in the style of the abstract of an academic paper presenting the outline of a piece of research that has not (yet) been done. It acts as inspiration, as a means of communicating an idea, and as a place to nucleate further thinking on the topic, perhaps eventually kicking off the desired research. It’s something I started doing during my PhD studies to…
I always forget how to do this, so I’m writing it here in part as a reminder for myself next time I need to do this. These instructions are for using daemontools and daemontools-run packages on Debian. Create a directory /etc/service/tonyg-services Create a file /etc/service/tonyg-services/run containing #!/bin/sh exec setuidgid tonyg svscan /home/tonyg/services Replace setuidgid with sudo -u if…
Small experiments in the use of libliftoff to try out the modern Linux graphics stack drove home quite how slow DRM “dumb buffers” can be, but also that it’s reading that’s slow, not writing . Reading from a “dumb buffer” on my AMD GPU is orders of magnitude slower than reading from RAM. It can take seconds to read out a full 4k frame. It’s roughly a thousand times slower than reading RAM. 1 2…
“ Erlang supports change of code in a running system. ” However, the details are a bit fiddly. Here’s a cheat-sheet I used recently for a simple TCP service written using Erlang. My program was a single module, running outside of any OTP application context. The instructions here need minor emendation to either explicitly list modules to purge and reload or to discover all modules within a single…
Back in June, I made a quick-and-dirty attempt to get the big-bang model of functional UI running in Processing 4 . Unfortunately Processing uses a dialect of Java predating introduction of Java Records (JEP395) , so I, er, creatively broke out m4 as a preprocessor. The resulting macros turn this: _record ( Rect extends Pict , {{ float x , float y , float w , float h }}, {{ public void render () {…
I had a small insight yesterday while building a component for a small web app: the user interface for editing an incomplete value of sum type A + B needs to remember a product of input 2× A × B from the user: A + B ⟿ 2 × A × B This allows the user to ergonomically change their mind about whether they’re building an A or a B without losing partially constructed values. More precisely, the UI for a…
I noticed a bug in Guile 3.0.9 ’s aarch64 atomics handling, and found a couple of apparent solutions ( 1 , 2 ), but one of them is weird enough for me to write this post. ( ETA: Nonstory. The problem was that the mov instruction isn’t idempotent! Hat tip to Andy Wingo for figuring out what the issue was. I’ve updated the rest of the article, and I’ll leave it here for posterity.) Long story short,…
As is well-known , JavaScript’s Promise is not a monad. It will happily treat Promise<Promise<T>> as if it was Promise<T> : > [ 123 , await Promise . resolve ( 123 ), await Promise . resolve ( Promise . resolve ( 123 ))] [ 123 , 123 , 123 ] This can bite you in unexpected ways. Imagine you have a CSP-like Channel<T> class for sending T s back and forth. Channel<T> might have a method like this:…
Python 3.13 will, for inscrutable reasons, remove the crypt module from the standard library. The excuses given in PEP 0594 boil down to “here are some good reasons why new code shouldn’t use this module.” What about existing code? Ah well. So anyway, for those of us who need some way of generating $6$ SHAcrypt SHA-512 shadow-password-database entries from Python, stick the following module into…
direnv works fine on Windows 11, but if an .envrc tries to set the PATH , the result will be a path in Windows format, not Unix format. 1 Instead of adding eval $(direnv hook bash) to your .bashrc , try the following snippet: export _unmangle_direnv_names = 'PATH' _unmangle_direnv_paths () { for k in $_unmangle_direnv_names ; do eval " $k = \"\$ (/usr/bin/cygpath -p \"\$ $k \" ) \" " done } eval "…
Trusting Signal and/or WhatsApp and/or Android (google) and/or iOS (apple) with your precious photos, videos, and chats is a huge mistake. All the photos, videos and chat history on my mother’s phone are now completely inaccessible to us, despite having recent backups and all the necessary keys and passphrases. Signal Can I transfer Signal backups directly from android to iphone? No. Can I make a…
I’ve just updated the Preserves spec to version 0.990.0. I feel like a 1.0-rc is approaching! The main change since spec version 0.7.1 has been to simplify the binary syntax for Preserves Value s : Both “short” and “medium” SignedInteger representations (starting with tags 0x9x / 0xAx ) were removed. They weren’t pulling their weight. Every SignedInteger now has tag 0xB0 . Float and Double are now…
I’ve been working with Markdown tables a lot recently. The lovely markdown-mode for Emacs makes this easy and pleasant. However, I find myself treating the tables a little like CSV, and started wanting to run joins on tables often enough that I hacked together my first little Emacs package, markdown-join . Here’s a demo: The code is a single file, markdown-join.el . I’ve submitted it to MELPA.
uxn is a delightful virtual-machine specification (with lots of implementations ) supporting 16-bit operation. At present, it is a “real mode” machine, and there is no support for running virtual uxn machines under an uxn hypervisor. It’d be neat to have a virtualizable uxn system: you could write a full operating system, with memory protection and multi-tasking, entirely in uxntal, and existing…
This is the story of a one-afternoon hack that turned into a one-weekend hack. I woke up on Saturday with a silly idea: what would it be like to use content-defined chunking (CDC) and serve the chunks over DNS? DNS caching could make scaleout and incremental updates quite efficient, at least in theory. Strong hashing gives robust download integrity. DNS replication gives you a kind of high…
I’ve just spent a few hours writing documentation for the Python preserves package , which implements Preserves for Python 3.x. You can find the latest version of the docs at https://preserves.dev/python/latest/ , or click the screenshot below:
Happy New Year! From time to time I need to expose a development web site or web service to the world. In the past, I’ve used ngrok for that, and of course long ago I built ReverseHTTP which is somewhere in the same ballpark, but I recently got fed up with the state of affairs and decided to see whether there was something simple I could run myself to do the job. I found Anders Pitman’s SirTunnel…
Apparently Peter Henderson’s 1982 paper “Purely Functional Operating Systems” is hard to find online. Some years ago, during my PhD research, I scanned the paper from a physical copy in the university library. Here’s the scan I made . Henderson, Peter. “Purely Functional Operating Systems.” In Functional Programming and Its Applications, edited by J. Darlington, P. Henderson, and D. Turner,…
I’ve recently been using cargo-flamegraph to profile syndicate-server . The tool is great, but it uses perf to record and analyze profile data, and perf on Debian has a performance problem : when not linked against libbfd , it shells out to addr2line for every address it needs to look up. Thousands and thousands and thousands of incredibly short-lived processes. Michał Sidor suggests building…
Part of a series: #squeak-phone I’m proud to announce a new project on using the Syndicated Actor model and dataspaces to implement a system layer . https://syndicate-lang.org/projects/2021/system-layer/ The project will be investigating the question Could dataspaces be a suitable system layer foundation, perhaps replacing software like systemd and D-Bus? Concretely, it will produce a prototype…
I’ve just published a completely revamped and massively expanded Syndicate project website : https://syndicate-lang.org/ Hooray! A big part of the change is to fix the confusing terminology used in the project. From now on, I’ll try to stick to the following: Syndicated actors , and the Syndicated Actor model : Like regular actors, but with replicated state, i.e. assertions connecting peers rather…
Part of a series: #squeak-phone Back in October 2020, I built an on-screen keyboard for Squeak Smalltalk. It ended up being about 230 lines of code (!) in total. I’ve been using Smalltalk as the primary UI for my experimental cellphone software stack, and I needed a way to type input. Using VNC to develop on the phone works fine, but to work on the device itself - both for day-to-day phone tasks…
UPDATE: Full code available at this gist (also embedded below). Say you have the following TypeScript interface I that you want to invoke remotely by passing messages of type M ; or that you receive messages of type M and want to handle them using an object of type I : interface I { m1 ( a : string , b : number ): boolean ; m2 (): void ; m3 ( n : number ): void ; m4 ( x : [ string , string ]): { k…
Recently on HN , rbanffy brought up a form of the old chestnut about crashing the image by simply executing true become: false . It turns out it’s no longer true! In the latest Squeak, True := False . doesn’t work – the compiler complains that you can’t assign into a read-only variable. So let’s try this: Smalltalk at: #True put: False . But now the metaprogramming system complains you’re trying…
Part of a series: #squeak-phone One lovely thing about working in Smalltalk is the effortlessness of development. I started off developing the code on my desktop machine, and occasionally testing it on the phone itself. I just rsync the image and changes files back and forth. This lets me pick up exactly where I left off on the other device each time I move over. However, developing on the phone…
Part of a series: #squeak-phone Hand-written binary parsing/unparsing sucks As I’ve been working on a mobile Smalltalk system , I’ve found myself needing to decode and encode a number of complex telephony packet formats 1 such as the following, an incoming SMS delivery message containing an SMS-DELIVER TPDU in GSM 03.40 format, containing seven-bit (!) GSM 03.38 -encoded text: 02 01 ffff 01 28…