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

IBM Layoffs Definitely Still Happening
Contrary to what some apologists try to say
Don't Use the Future Tense to Discuss the Slop Bubble
Wall Street does not react to reality; it reacts to panic, which is related to expectations
The Broken Window Industry and Its Ongoing Desires to Make Technology Less Dependable
Reliable computing is becoming harder to find
New XBox CEO Typecast in Social Control Media
Microsoft apologists will fall back on (or shuffle between) the "racist" and "sexist" angle
Sites Without JavaScript Deserve Your Visits
We're not arguing that the Web should be as simple or barebones like Gemini Protocol/GemText
EPO Strikes Are Already Working
Campinos is already going "into hiding"
 
First speech of Chanellor Hitler, Andreas Tille & Debian denounce Branden Robinson
Reprinted with permission from Daniel Pocock
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, February 22, 2026
IRC logs for Sunday, February 22, 2026
More and More Projects Quit Microsoft GitHub This Year, XBox Will See the Same
Microsoft GitHub's embrace of slop as "strategic" gives us a clue of what'll happen to XBox very soon
Google "Intelligence": Despite Slam-Dunk or "Smoking Gun" Proof, Drug Abuse in EPO Leadership is "Unverified Allegations"
Google's slop (so-called 'AI') lacks intelligence
8,000 Pages/Articles Per Year
We're eager to maintain a good production/publication pace and illuminate the sinister attempts to interfere with Freedom of the Press in the UK
Gemini Links 22/02/2026: Okonomiyaki and Midcrunch Crisis
Links for the day
Freedom Means Accepting He or She Who is Different
In the Debian community we're sadly seeing some authoritarian overreach this month
Microsoft Windows Falls to Another New All-Time Low in Guatemala, It is a Bottomless Pit
Maybe users come to realise that Windows means back doors and those doors are open to a regime that ought not be trusted
"XBox" Will Become Slop After Mass Layoffs
When all else fails, "AI it"
Links 22/02/2026: Hardware Price Hikes Across the Board, "Microsoft Issues Statement on Potential Layoffs"
Links for the day
Microsoft "Layoffs Incoming"
This transition isn't about promoting games; it's about canning the console
Links 22/02/2026: "Bloat of Modern Fitness Apps" and Wikipedia Deprecates Archive.today
Links for the day
Our IRC 5-Year Anniversary (for Self-Hosted) is Fast Approaching
A week from now it's March already
Gemini Links 22/02/2026: Dream Job Gone and Slop in Taskwarrior
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, February 21, 2026
IRC logs for Saturday, February 21, 2026
GNU/Linux Grew a Lot in Nicaragua
We've not noticed until today
Techrights Has Over 1,000 Good Articles 'in the Tank'
Drafts, notes, and lengthy documents
New Article Challenges Solicitors Regulation Authority (SRA) for Choosing the Wrong SLAPP Cases to Investigate
The one point we can agree on is that SRA does not know how to correctly select the worst culprits/offenders
The Brand 'Watsonx' is a Terrible Name for IBM 'Hey Hi' (Chatbots) Because Watson Agreed With Adolf Hitler
Almost a century has passed and IBM still believes that selling "intelligence", chatbots in particular, should be done under the name "Watson"
Why IBM is Still Scary and Dangerous
Keep a distance from "Big Blue" Bully
Measuring the Growth of Our Mission and Community
Something between experiment and prototype
Richard Stallman in the United States - Part III - Georgia Tech Did a Fine Job Upholding Free Speech Principles
The real problem was social control media (toxic)
Debian's Master is Deleting Criticism of SystemD and Other Things (On-Topic and Published by Debian Developers), Resorts to the Excuse Messages Are "Too Long"
Censorship serves nobody except the masters that control this censorship
Digg's Latest Incarnation Already Failed, It's Infested With LLM Slop
Many submissions go to slopfarms and some get summarised by slop
Gemini Links 21/02/2026: Veganism and DeskPi RackMate T0
Links for the day
On The Web, XBox Already a Dying Breed
Down to about 0.05% on large machines, based on statCounter [...] Microsoft will never publicly admit or say how many billions it lost on the XBox
2026 a Year of 'Top-Down' Microsoft Layoffs (Management First)
Stay tuned for what comes next
Your "Likes" Aren't Yours and They're Mostly "Worthless Clicks"
Social hermits are not popular, irrespective of how many "Facebook friends" or "likes" they get
Waggener Edstrom/Frank Shaw Lied, There Are Definitely Microsoft Layoffs
Microsoft never issued a formal statement, it made allusions by proxy
Microsoft-Controlled Media With Embargo and Press Operatives
This won't be the last example of media manipulation for narrative control or face-saving "damage control"
Slop Hype Makes Our Core Technology Less Reliable and Far Less Resilient (We Pay for the Catastrophe That Follows)
Only slop-free projects can be trusted
Going for 1,000 (Days of Uptime)
universal records are vastly better
Firefox is No-Go in China, Not Even 1% "Market Share" Anymore
Given Mozilla's utterly rubbish marketing these days (politics over technical aspects), set aside the cheerleading for slop, there's hardly a chance of Mozilla Firefox reaching or exceeding 10% again
EPO "Cocaine Communication Manager" - Part III - It's in His Eyes
Workers are free to draw their own conclusions
Links 21/02/2026: Tensions Over Iran and Illegal Cheeto Tariffs, Presidential Approval Sags
Links for the day
Links 21/02/2026: "Moving Away From Cloudflare", Many Layoffs or Shutdowns in Games (Including XBox/Microsoft)
Links for the day
GNU Linux-libre is a Grown-Up Today
"before that, every distro that wanted to respect its users' freedom had to remove itself all of the binary blobs that were distributed as part of the kernel Linux's so-called sources"
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, February 20, 2026
IRC logs for Friday, February 20, 2026
Gemini Links 21/02/2026: "The Evil of Action" and Slop Bots Causing Great Harm Online (Not Just the Web)
Links for the day