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

SLAPP Censorship - Part 148 Out of 200: The Manosphere
Those people don't just threaten our national sovereignty, press, democracy etc. They also endanger women everywhere.
GNU/Linux Reaches 10% "Market Share" in statCounter
As of this morning
Voluntary' Layoffs and 'Proper' Layoffs at IBM This Year
When will IBM management confess that 15% of staff is already marked for potential removal?
The Register MS Has Just Published Slop Spam for NVIDIA and HP, It Says "AI" 43 Times
As usual, The Register MS ought to be ashamed of itself for participating in it
The Slop Debt (Trillions of Dollars, Money That Does Not Exist) is Causing the Collapse of GAFAM et al
This slop hype will end up like "metaverse", except "metaverse" never ended up justifying trillions of dollars in "investment"
Social Control Media is the Opposite of Information
That says a lot about social control media
 
'Cancel Culture' Isn't About Empathy, It's About Making Good People Homeless
Seeing what they did to RMS, remember that those "concern trolls" are about everything other than ethics and morals
Daniel Pocock in The Nerve
Lots of publicity owning to the enrollment
Why Support Daniel Pocock
Our readers who come from IBM and the EPO are certainly familiar with the tactics of censorship and what that sort of censorship leads to
Gemini Links 13/08/2026: Health, Partial Eclipse Sketches, and Guilelessness
Links for the day
15% of IBM Marked for Potential Termination, PIPs are the "New Layoffs" (or RAs) at IBM
IBM is a dying company, but it does not want the press to say this or for people to understand that
Links 13/08/2026: "The Rise of the Measles-Industrial Complex" and Spotify Curbs Slop
Links for the day
Daniel Pocock on Australia's 9News (Nine Entertainment)
This gives visibility to software and technology issues
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, August 12, 2026
IRC logs for Wednesday, August 12, 2026
Gemini Links 12/08/2026: Losing a Child, "The OpenWeb Needs Diversity", and Gmail Woes
Links for the day
Links 12/08/2026: Trouble in Proprietary Chaffbot Company 'Open' 'AI' and Slop "Investors Are Suddenly Quaking in Their Boots"
Links for the day
Daniel Pocock in National News in Australia the Day of the Election
"Posted 20m ago" (Thursday in Australia), it's timed nicely to help illuminate Pocock and give him last-minute exposure
Simpler Means More Reliable
The simple old way of local storage and local backups is still the best
Clownflare and statCounter See GNU/Linux at ~8% in Norway
Norway has long championed GNU/Linux compared to the rest of Europe
Clacton manifesto: Reform UK hacking, leaks, raw sewage & 8GB Swiss Archive
Reprinted with permission from Daniel Pocock
statCounter Today: ChromeOS + GNU/Linux Measured at 10.98% Globally (Desktops and Laptops)
Clownflare does not quite refute this
The Register MS Has Just Published Fake Article About Replacing Linux With Proprietary Google System, "Sponsored by ASUS."
All of those things are proprietary GAFAMware
Links 12/08/2026: "X’s Advertising Business Continues to Tank", "Stop Feeding the Billionaires"
Links for the day
Lack of Empathy Rampant in the Sector
Sociopaths are sociopaths. They cannot help themselves
Before the "Big Tech" (That Almost Everybody is Forced to Use) Was Controlled by Men Who Hate Women
Such rejection and even hatred of women qualifies/enshrines oneself as an "incel"- a dangerous and violent online cult
In Defence of Hoarding CDs, More So When Digital Restrictions (DRM) Come to More 'Content' and Even Offline/Physical Media Won't Work When Some Remote Server Says "No" (or Goes Offline)
made to serve and entertain owners, not to allow companies like Sony and Microsoft subjugate owners
Clownflare: In Finland, Birthplace of Linux Kernel, GNU/Linux Now Bigger Than Apple's MacOS
It's not just in Finland where we see such trends
More Mass Layoffs Due to Monumental Debt Excused as "Investment" (in Slop)
They're maxing up the private debt and their country is already insolvent
METRO Interviews Daniel Pocock a Day Before Election
The article is behind a wall that blocks people who block ads
Enshittification More Than a Century Ago
Is enshittification more than a century old?
GNU in 1991 (35 Years Ago): Compiler and Lots More Ready, Linux Now Becoming 'Vibe Heap' (Slop Replaces Real Code)
Without curbs in place, many Linux developers will flee
Company-Wide 'Reorg' ('Redundancies') at IBM, Mark October 1st 2026 in the Calendar
Is Oct 1 the new Apr 1?
SLAPP Censorship - Part 147 Out of 200: The SLAPP Series is 'Slow' Because Timing Matters
It is important to stress that after this series is finished there will be many more series, with some of them showing raw evidence of what we've been illuminating and telling
Even ZDNet Accepts That "Market Share" of GNU/Linux May Have Doubled on Desktops and Laptops
GNU/Linux is definitely growing, and quite quickly in fact
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, August 11, 2026
IRC logs for Tuesday, August 11, 2026
Microsoft Layoffs and Shutdowns Continue This August, Morale Low, Employees Set Up Giant Inflatable Rat to Protest Against CEO
nothing demonstrates their anger better than what they did to the CEO
Gemini Links 12/08/2026: Sophomore Slump, Mandatory Phone Addiction, and Vintage Web Game Gallery
Links for the day
Summer Layoffs and 'Redundancies' (Cost-Cutting) at Microsoft and IBM
IBM is merely buying its revenue - an unsustainable strategy that aims to hide the company's rapid decline
Links 11/08/2026: Tensions South of China and Stingy "YouTube Doubles the Eligibility Requirements" (to Get Paid)
Links for the day
The Independent (UK) Today: "Independent candidate Daniel Pocock is concerned about media issues."
Let's see what results say around Friday
Gemini Links 11/08/2026: Stargate, Stargazer, Air-gapped Environments, and SystemVerilog Simulator
Links for the day
The Slop ('Linux') Foundation Celebrates 35 'Linux' Years a Week After GNU/Linux Turns 43
they'll keep on trying to change history
Keumars Afifi-Sabet Produces Useful, Informative Coverage Regarding Privacy
And it's good for Richard Stallman
Confirmed: Microsoft Layoffs in August 2026, Entire Operations Shut Down Too
Microsoft is just bleeding
Paying With Cash in 2026
Cash isn't going away. Not any time soon.
Blocking Tor Is Not a Solution, It's Paranoia
Tor is not a crime
Oligarchs and Their Footsoldiers Are Most Enthusiastically Loud About the Things They're Attacking
Like "Microsoft loves Linux"
FOSSY (SFC) Platforming GAFAM, Sells Endorsement
Houston, we have a problem here
Not Allowing Misogyny and Misogynists to Run the World
We stand with (and for) equality, justice, and freedom
"SPONSORED EXPLAINER" at The Register MS is Just More SPAM "Sponsored by HPE."
This is a great example of crap 'journalism'
IBM Won't Hire (or Hardly Hire) This Year
IBM is bluffing with buzzwords while shrinking out of existence and reducing salaries
SLAPP Censorship - Part 146 Out of 200: An Industry of Plagiarism, 'Normalised'
they pursue personal enrichment by stealing from Free software developers
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, August 10, 2026
IRC logs for Monday, August 10, 2026
5.1k Capsules Known to Lupa, Gemini Protocol Crawler
If no limits (e.g. 10k max per capsule) were imposed on crawling, there would likely be millions of pages in the database
Gemini Links 11/08/2026: Waking Up Earlier, Whining About LLMs as Destructive Plagiarism
Links for the day
Links 11/08/2026: "The Enemy Is the Platform" and 'Vibe' 'Coding' Shown to be Little But Plagiarism
Links for the day