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

Links 16/05/2026: Climate Issues, Free Speech, and Monopolies/Monopsonies
Links for the day
 
Links 16/05/2026: Cuba Plunges Into Darkness (Energy Wasted by Nonsense), Googlebooks as Slop Nonsense (Energy Waste and Time Wasted)
Links for the day
Gemini Links 16/05/2026: Retreat and Devuan Manuals
Links for the day
SLAPP Censorship - Part 78 Out of 200: Slandering Me for Saying the Truth About Graveley and Garrett's Abuse of Processes, Stacking Dockets
These are the sorts of things British taxpayers ought to talk about
"AI" Became a New Name or Placeholder for Debt
Because they will only ever lose money for this thing with "tokens" or "potential"
"Microsoft Goodwill and Intangible Assets" Down Two Years in a Row, According to Microsoft
Microsoft cannot sell these, so what is their real relevance?
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, May 15, 2026
IRC logs for Friday, May 15, 2026
IBM: Shares Down 30%, Mass Layoffs, IBM Says "Goodwill" Grew by 10% to Over a Third of the Company's Total "Worth"
According to IBM
Microsoft LinkedIn Layoffs "Very Likely Higher" Than 1,000 People
Microsoft is bleeding
The Corrupt Lecture the Non-Corrupt - Part XXIV - Luis Berenguer Giménez at the EPO (European Patent Office) Became the Punchline of EPO Staff
"the fact that Luis was caught with cocaine causes laughter. The use of cocaine in itself is not the real shocking bit."
IBM Keeps Culling Essential Linux, Fedora, GNOME, and GTK Staff
Over a month ago IBM laid off over 400 Red Hat engineers
Cisco Cuts Nearly 4,000 Jobs Because of Debt, Nothing to Do With Slop
The media keeps talking about revenue, not profits
Gemini Links 15/05/2026: UDP Game Forwarding Over SSH, Avoiding LLMs, and Alhena 5.5.9
Links for the day
Links 15/05/2026: Electric Company Shuns Entire Town to Prioritise Only Data Centres, Saudi Arabia and U.A.E. Carried Out Secret Attacks in Iran
Links for the day
LLM Slop is Not Reliable, Constitutes No Process of 'Thinking'; There's No Thought Process at All, No Grasp or Understanding, Let Alone Context
Lies have become the "business model" [...] More people ought to talk about it and explain to other people what LLMs really are
Not a Security Expert If You Cannot Manage to Keep Online a Simple Two-User Mastodon Instance Somebody Else Built
From uptime of ~99% to maybe 80%
Microsoft Has All the Symptoms of a Dying Company (Mass Layoffs of the People Who Built the Company)
the company's debt is going through the ceiling
Focus is Important, Focus is Everything
We are still running 6 multi-part series in tandem
For Effective 'Finlandisation' (Not Digital Sovereignty) to Be Replaced by Autonomy Finland Needs to Think Like GNU (Software Freedom), Not Linux (Openwashing Source, Plus LLM Slop and Killswitches)
What is 'Finlandisation'?
Guest Post on False Marketing and PR Blitzes by Anthropic
A lot of people my age are just tired of the nonsense
Links 15/05/2026: UK antitrust regulator is officially investigating Microsoft Office, Anthropic’s Fraudulent Lies About Mythoslop Don't Withstand Scrutiny
Links for the day
IBM's Kyndryl in Trouble: Mass Layoffs, Payroll Problems, Buybacks (in Company Whose Debt is Almost Twice Its Total Value), and Soon $9 Per Share (Down Over 80%)
Kyndryl is done. Stick a fork in it.
ICYMI: GNU/Linux Did Not Start in Finland
If we're honest/true to ourselves, we need to recognise history for what it is, not what some corporations (like GAFAM) want it to be
IBM is Googlebombing the Media With Fake Numbers to Promote Fake Technology
a classic example of why much of today's media cannot be trusted (anymore)
Up to 10,000 Microsoft Layoffs in a Couple of Months
Many ways to skin a cat
Truth Hurts. People Hurt by Truth Aren't Entitled to Compensation.
Family members aren't exempt
SLAPP Censorship - Part 77 Out of 200: They Never Knew How to Handle Women (Except to Attack Them)
The case against us was really quite simple
Update on Sirius Open Source in 2026 (When Your Former Employer Commits Crimes and Nobody is Held Accountable)
I did not envision myself spending several years (even 4 years after leaving that company) challenging the system for tolerating and even covering up corruption
Codecs and Software Patents - Part VII - Entering Phase II, the Battle Against Companies That Normalise Taxed (by Patents on Mathematics) Codecs
In the next few part we'll deal with the impact on Free software, including the GNU Project
The Corrupt Lecture the Non-Corrupt - Part XXIII - Cocaine Use at the EPO's Top-Level Management "Adds Up" and Worsens Things "Over Time"
"cocaine use knocks the IQ down permanently a tiny bit with each use. Over time that adds up."
Gemini Links 15/05/2026: Slop Fatigue and Banning LLM Use
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, May 14, 2026
IRC logs for Thursday, May 14, 2026
Links 14/05/2026: Health Science, Cheeto Meets Pooh, and Facebook Staff Loathing the CEO
Links for the day
Gemini Links 14/05/2026: Early Morning Practice and Number to Roman Numeral Converter
Links for the day
FSF Advertises the Father of Software Freedom Giving a Talk in Germany (a Digital Sovereignty Interest Hub, Sponsor of Free Software)
Free Software vs malware and the need for reverse engineering
Cybershow (UK) Shaping Up to be a Neat and Very Large Gemini Capsule
If only more platforms did the same, plenty of energy would be spared, "old" machines would be totally suitable (even with 20 tabs open), as we'd focus on substance, not bells and whistles
SLAPP Censorship - Part 76 Out of 200: The Problem With the United Kingdom Allowing Americans to File Lawsuits by Proxy (Relayed by "Hired Guns")
Solicitors in UK warned not to act as ‘hired guns’ to silence critics of super-rich
When Microsoft's LinkedIn Goes Offline All Your Fake Friends/Connections and Manufactured 'Status' Will be Gone
Many people quit social control media because they recognise it for what it truly is
Major Setback for IBM in the Courtroom, the Demolition of IBM is Proving Costly
Kyndryl is a sign of how IBM ("mother ship") is run and where IBM is heading
Links 14/05/2026: Willful Ignorance and Mass Layoffs at Microsoft
Links for the day
Gemini Links 14/05/2026: Rewatching V for Vendetta, JPEG XL, and Platform Migrations
Links for the day
The Corrupt Lecture the Non-Corrupt - Part XXII - What the Science Says About Cocaine in the Workplace (EPO President, Mr. Campinos, Please Take Note)
What the science says
European Patent Office (EPO) President, Mr. Campinos, Ignoring Its Staff While Protecting His Friends
the President is covering up cocaine use while ignoring his own workers
Slop Cannot Replace Everybody (the Story of Perl and Universities)
Quantity where abundance exists is without merit; quality is what people opt for as they have limited time and patience
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, May 13, 2026
IRC logs for Wednesday, May 13, 2026