Programming Leftovers
-
Cole ☛ Don't prefill config files
The biggest design mistake I made with Amfora, my first community open source project, was autogenerating config files. On startup, the application looks for a config file, and creates one if it doesn’t exist, full of all the application defaults. At the time, I thought this was great, as it documents all the existing options, and makes them very visible to the user in case they want to change them. In the end, this decision created a lot of headaches and is not something I’d ever do again.
-
Jonathan Y Chan ☛ Statically linking an Elixir command-line application using Burrito
I wanted to jot down some notes from my experience compiling a command-line application written in Elixir to a statically-linked binary on macOS. So far the experience has been great! I remember trying to do the same thing with OCaml a few years ago and it being a nightmare. Here are some gotchas I’ve run into, coming from a C++/TypeScript/Java background: [...]
-
Python
-
University of Toronto ☛ Our Django application is now using Python 3 and a modern Django
We have a long standing Django web application to handle the process of people requesting Unix accounts here and having the official sponsor of their account approve it. For a long time, this web app was stuck on Python 2 and Django 1.10 after a failed attempt to upgrade to Django 1.11 in 2019. Our reliance on Python 2 was obviously a problem, and with the not so far off end of life of Ubuntu 20.04 it was getting more acute (we use Apache's mod_wsgi, and Ubuntu 22.04 and later don't have a Python 2 version of that for obvious reasons). Recently I decided I had to slog through the process of moving to Python 3 and a modern Django (one that is actually supported) and it was better to start early. To my pleasant surprise the process of bringing it up under Python 3 and Django 4.2 was much less work than I expected, and recently we migrated the production version. At this point it's been running long enough (and has done enough) that I'm calling this upgrade a success.
-
LWN ☛ Microdot: a web framework for microcontrollers
Microdot was created by Miguel Grinberg, who also created the well-known Flask Mega-Tutorial that has served as the introduction to the Flask web framework for many people. While Flask is considered to be a microframework, it still requires a full CPython environment to run; another Python microframework described alongside Flask in a 2019 LWN article, Bottle, has similar needs. Microdot came about because Grinberg wanted a framework for MicroPython and did not find anything usable back in 2019.
-