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

Social Control Media is Bots (Fake Traffic, Fake 'Engagement')
As per FORTUNE, 76% of Twitter is alleged to be bots now
"Major [IBM] Reductions Will Take Place Soon in Rochester MN"
Maybe that's just the latest office gossip
 
Links 23/12/2025: That ‘Satisfying Click’ and Security Lapses, Car Bomb Kills Russian Lieutenant General Fanil Sarvarov
Links for the day
Gemini Links 23/12/2025: Hydraulic Pressure Balance amd mercury://
Links for the day
Links 23/12/2025: GNU Taler 1.3, US Regime Censors Television Again
Links for the day
Valve Can Bring More Users to GNU/Linux, But It Won't Bring Freedom
Steam is DRM
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, December 22, 2025
IRC logs for Monday, December 22, 2025
Techrights as 'Regulator' Against Runaway Trains
"Runaway trains" never scared us because we know that they, unlike us, don't think rationally
How the Slop (So-called 'AI') Bubble Will Burst Next Year
There are already talks about mass layoffs in January
"Generative AI Bubble Has Begun to Pop", Nvidia Rides “Circular Financing... a Strategy That Hearkens Back to the Dot-com Crisis”
For companies like Microsoft this may mean another 30,000+ layoffs next year
Microsoft-Connected Media Talking About XBox Division "Profit Margins" is Distraction From XBox Sales Collapsing 70% in One Year
The simple fact is, Microsoft's console is dead in the water
The Reality is "Vibe Code" (Slop) is That It's Worthless
“Confidently Wrong”
British Web Developers Can Probably Ignore Firefox Users (Based on US Standards)
Mozilla has managed to piss off enough people
On the 'Digital Gulag' of 'Secure Boot' and Microsoft Disguising Its Attacks on Users as "Security"
Dr. Andy Farnell has this new article
Slopfarms Can Only Survive in Google News, Which is Still Promoting Them
Google News promoted only 3 slopfarms today
Gemini Links 22/12/2025: Films, Creativity vs. Consumption, Slop in YouTube
Links for the day
Microsoft XBox Losing Money, Layoffs and Studio Shutdowns (As Well as Price Hikes) Not the Solution
Microsoft does not quite talk about profits
Links 22/12/2025: Data Breaches, deterioration in Politics, and Geminispace
Links for the day
Links 22/12/2025: North Korean Applicants Target GAFAM (Amazon), ‘Orwellian Climate of Fear’ of CPC (Even Outside China)
Links for the day
More IBM Layoffs in India
It's not as simple as "laid off to be replaced by an Indian"
GAFAM Deeply Connected to Jeffrey Epstein, Richard Stallman (RMS) in No Way Connected to Jeffrey Epstein
people who hoarded all the capital get to decide what people think and say
Linus Torvalds Has a Birthday This Coming Weekend, Thankfully He Still Controls His Main Project
GNU and Linux should remain under their control as long as they live
Mozilla is Getting Attention for All the Wrong Reasons, Take a Look at LibreWolf
Just last week Mozilla added a new top-level manager who (as usual) came from a "tech giant"
When Conformism Means Capitulation and Defeat
In an age of injustices like these, we all have some kind of moral obligation not to be conformist.
Text is Still King
But the so-called 'industry' insists that we should download 10 MB of objects from multiple domains... even just to read 5-10 paragraphs of text
Links 22/12/2025: Facebook "Testing $14.99 Monthly Subscription Fee to Post Links" and "Middle East Petrostates as American Media Owners"
Links for the day
Beyond the World Wide Web (WWW)
We continue to treat Gemini Protocol as a first-class citizen
Serbia: GNU/Linux Rises, Windows Down to All-Time Lows
According to statCounter
"Wrestling With Pigs"
"Never wrestle with a pig. You both get dirty, and the pig likes it."
Productive Year and Better Access to Techrights' Archives Going Back to 2006
we've long needed and wanted native, local, independent search facilities
Linux Abandoned by Linux Foundation
It speaks for Microsoft and for so-called 'AI' companies
Microsoft Has Practically Given Up on XBox Already
Expect many XBox related layoffs when 2026 starts (Q1)
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, December 21, 2025
IRC logs for Sunday, December 21, 2025
"Today's [Red Hat] is run by a cabal of vultures."
it seems safe to assume Red Hat too will languish away
Microsoft Layoffs in 2026 Can be Bigger Than 2025 Microsoft Layoffs (30,000+ Workers Laid Off)
"Is there going to be any reorg or Microsoft layoffs?"
Gemini Links 21/12/2025: Solstice, Chaos of CSS, and Program Interpreter Fun
Links for the day
The Free Software Foundation (FSF) Represents People, Not Corporations
FSF isn't in the "business" of appeasing oligarchs
Why?
Why write articles?
Microsoft-Connected Publisher Spinning XBox's Death Spiral (It's Dying Fast) as a Strength and Something Deliberate
"Microsoft’s big gaming pivot"
Slop is Rare by Now
A year ago slop was so abundant that we did a whole series about it, and it was daily
Links 21/12/2025: U.S. Strikes in Syria, "Epstein Files Photos Disappear From Government Website"
Links for the day
Gemini Links 21/12/2025: Labrador Retriever of Lagrange's Developer Dies From Cancer, Political Philosophy, and "Getting to Inbox Zero"
Links for the day
IBM: We Can't Make 'AI' (Voice Recognition) Do the Work of a McDonald's Teenager, So Let's Try the Same on Saudi Planes
IBM is lost. It's truly lost.
Microsoft is Becoming Irrelevant: The Case of Georgia
Not Georgia Tech
Sirius Open Source is Now Imminently Dead (Struck Off)
compulsory strike-off
Dr. Richard Stallman, Invited by LibreTech Collective, is Giving a Public Talk in Georgia Tech Next Month (Scheller College of Business)
They can probably squeeze about 400 people into this room
25 Years of Activism for GNU/Linux
My passion for GNU/Linux brought a lot of contentment
Africa, Where Microsoft Used De Facto Slaves to Pretend to be "AI", Chatbots Usage is 0.2% of Measured Online Traffic
Judging by recent trends in Africa, many "Windows PCs" are being converted into GNU/Linux computers
New Drone Footage Shows IBM is Dead (Parts of It)
The people who participated in IBM when IBM actually mattered probably have boasting rights, unlike people who work for IBM today
Michael Larabel Adds Slop Category to Phoronix, Quickly Realises That It's Worthless
Phoronix nowadays gets carried away; it made a new category to talk about slop and it decided to call it "intelligence" with some caricature of a brain (that's misleading)Phoronix nowadays gets carried away; it made a new category to talk about slop and it decided to call it "intelligence" with some caricature of a brain (that's misleading)
After 35 Years the World Wide Web, HTML, and HTTP Are Proprietary
HTTP/2 added a lot of complexity (it's just a Google protocol, based on SPDY originally), many image formats are proprietary and patented, HTML got 'replaced' by Java-Scripts [sic], and many URLs (the URL system was created in the early 90s) are just long strings for proprietary 'webapps'
The General Public License (GPL) Inspired the Web's Original Openness/Freedom, According to Tim Berners-Lee
"During the preceding year I had been trying to get CERN to release the intellectual property rights to the Web code under the General Public License (GPL) so that others could use it."
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, December 20, 2025
IRC logs for Saturday, December 20, 2025