Bonum Certa Men Certa

GitHub-Free: Why fig No Longer Supports Pygame

Article by figosdev

fig 4.9



Summary: "I don't love the idea of trying maybe Tk instead. But Tk is at least responsible enough not to keep selling themselves to an aggressive monopoly that hates software freedom."

This story is more about GitHub than it is about fig, but I use fig more than anything else I've ever written -- it's basically my reference implementation of a language for teaching.



Because of this, I like it to set an example for all my other projects; whether they follow the example or not.

Fig goes back to version 0.4, it was always based on CPython, the standard and most conventional implementation of Python -- for fig 3.x it switched to Python 3.

"I hate when languages break a lot of things, as if nothing made previously with them matters."Each stage of fig was an experiment, though I rely on it and I've tried to keep it as stable as possible. I hate when languages break a lot of things, as if nothing made previously with them matters. In an industry, that makes enough sense. For hobbyists, that really sucks sometimes.

I use fig for both serious purposes (at the moment I've got a fig program running for 48 hours on a dedicated machine, processing over a million files) and for fun. I've enjoyed tinkering with graphics since I was a kid. Fig is what I use for that.

But for dealing with various kinds of files, Python 2 suits my purposes. After years of checking on options and tricks, I did my utmost to make fig Python-3 compatible, as an experiment. Fig really leans on the way that strings are expected to work in Python. I've gone through many tutorials, run 2to3, maybe you can make a language based on fig that uses Python 3. Have fun with that.

I have fig 3.x a serious chance -- I used it almost exclusively for half a year. After that I was working on a serious project and fig 3 started mishandling a file, I ran it with Python 2 instead and it worked better for my purposes.

"I use fig for both serious purposes (at the moment I've got a fig program running for 48 hours on a dedicated machine, processing over a million files) and for fun."That's why fig jumped right ahead to 4.x, the most recent version of which (until today) was from late 2017.

If Pygame is not installed, fig falls back on escape sequences -- it draws in the term instead. It's designed specifically to have fewer than 100 commands; I created an experimental (quite nice) "figplus" to try some new things. I'm still very happy with standard fig; the main features figplus adds are extra Pygame features and some neat handling of Python dictionaries. Both allow inline Python in fig programs, so you can define fig functions that access dictionaries as well.

Years ago I created a simple hack with inline Python to access the 16-colour palette (fig uses foreground/background 0-15/0-15, based on the CGA palette) and allow fig to do 24-bit colour without adding commands. I decided for many reasons I preferred this hack to making it a feature of fig -- but I made it a native feature in figplus:

function rgbcolor r g b
python
    figcgapal[0] = (r, g, b)
    fig
    fig


This changes colour 0, so the next time you draw it will use whatever RGB settings you like. You can change it back to 0, 0, 0 after that if you want.

I made four changes to the stable version of fig for the latest, and each change is related to GitHub:

1. Pygame is gone, even as an optional feature. This is a protest, if someone wants to fork fig to keep Pygame I'd be happy to help them do it. It's simple enough that they probably won't need it. The change is backward compatible -- commands that only did something when Pygame was installed, now do nothing even when it is. No code changes should be needed.

2. PyPy 2 is now used instead of CPython. This was likely to happen anyway, because the Python Foundation wants to force a language I don't care about. I knew a guy that worked at Nokia who felt the same way, but there are plenty of sound technical treatises on why strings are broken in Python 3. Don't agree? Then use what the Python Foundation tries to shovel at you -- most people do.

"...not only am I not interested in Python 3, it is also developed on Microsoft GitHub."However the reason is two-fold; not only am I not interested in Python 3, it is also developed on Microsoft GitHub. PyPy is not, and I hope it never will be. People who have Python 2 installed on the GNU operating system that want to continue to use it with fig only need to make a symlink; I'm not judging. If you have trouble with a symlink, copying your Python executable to something called pypy2 may help.

3. The arropen command already worked in both CPython and PyPy. However, PyPy doesn't close files read with .read() as I think it ought to, which means that after reading about 1000 or so files with arropen, PyPy complains about too many open files. It shouldn't be necessary, but fig 4.9 caters to PyPy by opening and closing files even when arropen uses .read(). As I said, the command works in both implementations. What's changed is that arropen should now work more reliably when under heavy use in PyPy.

4. I didn't just remove Pygame support, I tried to add something to make the GitHub boycott a little more fun. The hack that allows 24-bit colour in Pygame is now supported in text mode. If you don't include the hack in your program, figcgapal doesn't get modified (it can only be modified with inline Python; fig doesn't support identifiers that start with "fig") and fig does escape output the way it did before, with esc[0 or 1;(30 or 40 plus f)m.

"The screencap is also a jpeg, even though png would be better for this purpose. The reason is symbolic; png relies on zlib1g, which is on GitHub."If you use the hack, it changes the contents of figcgapal and fig uses esc[38;2;r;g;bm instead. This is designed to be compatible with existing code that uses the hack; fig now checks figcgapal against a copy that's made when the original is set. This was done in haste, and 4.8 is GitHub-free but the 24-bit feature didn't work until it was fixed (along with arropen) in 4.9, maybe 30 minutes later.

The screencap has fig 4.9 doing 24-bit output based on unmodified code, but I haven't tried it with a lot of code yet. The screencap is also a jpeg, even though png would be better for this purpose. The reason is symbolic; png relies on zlib1g, which is on GitHub.

Very few people have any idea just how much everybody is relying on GitHub right now. Although it may not be possible to get away from it (or Microsoft) completely, and removing Pygame from my favourite programming language may seem ridiculous, I don't think it's nearly as ridiculous as putting all our free software eggs in Microsoft's giant basket. We need to Delete GitHub. If it turns out that we can't do it entirely, we should at least consider our options. I'd rather sacrifice Pygame than use a canvas that Microsoft controls.

"Very few people have any idea just how much everybody is relying on GitHub right now. Although it may not be possible to get away from it (or Microsoft) completely, and removing Pygame from my favourite programming language may seem ridiculous, I don't think it's nearly as ridiculous as putting all our free software eggs in Microsoft's giant basket."To the Pygame devs: I love SDL (I love DOSBox! Which probably still uses SDL, but did when I created fig). I never preferred to use anything other than Pygame for fig graphics. I don't love the idea of trying maybe Tk instead. But Tk is at least responsible enough not to keep selling themselves to an aggressive monopoly that hates software freedom. I figure any graphics will likely pull in libffi (GitHub) though you're developing there directly. Please reconsider your reasons for this! Don't sell out your users to the GIAFAM trap.

Long Live Stallman, and happy hacking.

Licence: Creative Commons CC0 1.0 (public domain)

Recent Techrights' Posts

European Patent Office (EPO) Series: London Calling...
EPO Vice-President in charge of the "Patent Granting Process" is likely to have been a pay-off for the support which the UK gave to Campinos in 2017
Faking Productivity With Slop and Wasting Money on Faking 'Productivity': A Microsoft Story
If the quality of everything at Microsoft goes down
Wikipedia - Like Some Free Software Projects Infiltrated and Bribed - Bans Its Own Founder
Over the years we've named (not shamed) some projects and organisations that got corrupted by money and ended up banning their own founders
The “Aktion T4” at the European Patent Office (EPO) Saves Money for the President's Own Purse
Call for parents of children with special needs
SLAPP Censorship - Part 116 Out of 200: 5 Years of Multiparty Lawfare Against Techrights, Funded by Americans and Also by Third Parties (Including Microsoft Salaries)
The public and our government will be informed in full
 
While Thousands at IBM Lose Their Jobs ("Silent Layoffs") IBM's CEO Goes Begging the Dictator for Bailouts, Based on Deliberate Lies About "Quantum"
Many who claim to be retiring are only in their 40s and 50s. They're too proud to publicly admit what IBM did to them.
IBM Sends Workers 'Packing', Sometimes With the "Low Performer" Label That Imperils Their Future
To many people out there, IBM correlates with deceit
Links 24/06/2026: Four-Day Workweeks, GM Cut 1,000 Workers at Its EV Plant, 21,000+ Oracle Layoffs
Links for the day
A Step in the Right Direction (EU) in the Fight Against LLM Slop From GAFAM (US)
We've already mentioned this in Daily Links, but let's discuss this a little further
SLAPP Censorship - Part 117 Out of 200: Libel Tourism or Defamation Forum-Shopping in the United Kingdom Condemned by the European Union (EU)
Last week we reminded readers that the EU had criticised UK defamation law
Demonstration Next Week at the European Patent Office (EPO), Administrative Council Seen as Complicit
Corruption in Europe hurts all of us
IBM is Now Hinged on False Accounting and False Promises
This is the legacy of the current CEO
"PARTNER CONTENT" or 'Content Farms' That Promote Slop and Misinformation (The Register MS)
The Register MS represents a big part of the problem we all face
Turn Off the Slop, It's Wasting Energy and Destroying the Planet (the Only Planet We Have)
Right now we see lots of headlines about energy shortages and drained-up reserves
Lessons From Almost 30 Years of Site-Building Activities
We still strive to become faster and lighter
Do Not Outsource (the Seductive Mirage)
Abandoning so-called 'conventional wisdom'
Media Complicit in IBM Fraud Meant to Prop Up the Share Price Based on Lies, Fabrications
Even IBM insiders are fuming at this
In Some Countries, Windows Has Lost Its Monopoly
Windows fell to an all-time low globally this month
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, June 23, 2026
IRC logs for Tuesday, June 23, 2026
Gemini Links 24/06/2026: Motivation, PostScript Printer, and Why Hyperscalers and the Smolnet are Compatible
Links for the day
The Media's "Satya Says" Syndrome Distracts From Grim Reality
how insiders see Microsoft slop
Oracle's Collapse Has Nothing to do With Slop, It's About Its Debt Exploding by Almost 50% in Just 12 Months
How are people meant to trust the media?
Now... a Word From Our Sponsor
Powerade
Links 23/06/2026: Microsoft Studio Closures and Journalism Subjected to Further Cuts
Links for the day
Gemini Links 23/06/2026: Gardens, Basketball, Blocking Hyperscaler, and New Commodore Phone
Links for the day
Links 23/06/2026: Apple Price Hikes and Technical Debt in Slop
Links for the day
After IBM's Shares Collapsed the CEO is Trying the "Quantum" Trick Again, Bolstered by a Demented Dictator in the White House
from what we can gather IBM's CEO is trying to get the US government to participate in the scam
Greece Ought to Curb the Threat of Social Control Media
its national discourse seems to be run by an American company called Facebook
State of the GNU/Linux Desktop (and Laptop)
The time to advocate GNU/Linux is now
The 'XBox Narrative' Distracts From Destructive Cuts Across the Whole of Microsoft
Microsoft is preparing to lay off a likely record-breaking number of people [...] this isn't just an XBox problem
SLAPP Censorship - Part 115 Out of 200: Spending the Next Decade Writing About SLAPPs and Trying to Fix the System
It's the same industry that got paid by corrupt EPO officials to try to cover up the corruption
Microsoft's Stock Fell Nearly $200, But the Real Problems Are Just About to Begin
if they dump slop, what will they tell shareholders?
The Cyber Show on Starmer and Software Freedom
The Cyber Show's Andy has just explained why our departing national leader wasn't all bad
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, June 22, 2026
IRC logs for Monday, June 22, 2026
Gemini Links 23/06/2026: Girlrotting, Homeworlds at BGA, Slop Ruins Sites
Links for the day
A Lifetime of Whistleblowing
Ellsberg did not have an easy life, but it was a rewarding life with a rich legacy focusing on justice
European Patent Office (EPO) Series: A Man With Many Missions...
Campinos – accompanied by Gilles Requena and Patrice Pellegrino
Links 22/06/2026: Ubisoft Co-founder Dies, Americans Have Turned Against Slop
Links for the day
Links 22/06/2026: "The Sycophancy Machine" and "Port 22 Open for 54 Days"
Links for the day
When People Who Make the Most Money Are the Best "Boot Lickers" (Sucking Up to Jeffrey Epstein's Circle and the Dictator)
Sucking up to rich people may pay off
The Aim is Not Fame
Reposted from schestowitz.com
"Internally Important, Externally Irrelevant": IBM in a Nutshell
Right now its debt spins out of control and its stock spirals down the drain
SLAPP Censorship - Part 114 Out of 200: Thousands of Long Articles to Come, Properly Covering the SLAPP Industry in the UK and Its Modus Operandi
"Stowell described SLAPPs as ‘a stain on our legal system’."
Finding a Way to Get Paid to Improve LibreJS
So now we have more people resurrecting LibreJS and improving it
Microsoft Can't Even Wait Until July, Shutdowns and Layoffs Already Happening
Mashable speak of "a grim picture for the state of Xbox."
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, June 21, 2026
IRC logs for Sunday, June 21, 2026
Gemini Links 22/06/2026: Appreciating Simple Things, Perfect Summer Evening, IRIX, Vim and so
Links for the day