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

The Register MS Sponsored to Hype Up "Datacenters" and "AI" (Bubble, Pyramid Scheme)
"Sponsored by Cisco" with "AI" 26 times in this page
World Mental Health Day is Tomorrow and EPO Staff Talks About What the Job Does to Workers
In recent years we've written a great deal about mental health consideration in relation to work, with a focus on "IT"
You Definitely Do NOT Wish to Live Close to a Datacentre
put aside for a moment the noise, the pollution...
GGG Pot Calls the Kettle Black
"It means a situation in which somebody accuses someone else of a fault which the accuser shares, and therefore is an example of psychological projection, or hypocrisy. Use of the expression to discredit or deflect a claim of wrongdoing by attacking the originator of the claim for their own similar behaviour (rather than acknowledging the guilt of both) is the tu quoque logical fallacy."
The Microsoft Ban Should Go Further (Telecommunications Cybersecurity and Resilience Act Incompatible With Back Doors)
it's not difficult to see where to start
 
Links 09/10/2026: Stranded Busan Shark Still a 'Circus', Endangered Monkey Rescued, BBC Shells Out Money
Links for the day
Gemini Links 09/10/2026: Manifesto, Slop, Geminispace, and "Cryptography of the Internet"
Links for the day
Betanews is Still a Slopfarm, Articles About "Linux" Are Fake and Plagiarism by LLMs
Cheaters and plagiarists aren't journalists; they're people who rip off and harm journalists
James Bottomley Has Promoted Microsoft-Controlled Restricted ('Secure') Boot, His Blog Has Just Been Cracked
Does this meet IBM's and Microsoft's standards for "distinguished" (in security)?
Links 09/10/2026: "Internet Archive to Demo Wayback Machine at Friday’s Uniqlo Street Festival", France Wages Censorship War via DNS
Links for the day
Controlled Opposition
The underlying concept is hardly new
More Stallmans
We need more Stallmans, we don't need to change Stallman
SUEPO Munich (EPO Staff Union in the Main Headquarters) Opposes Monarchy ('Cocaine King' Campinos), Plans Online Meeting Next Week
They may have about 1,000 workers joining in
GNU/Linux Flirts With 20% "Market Share" in North America Overnight
Who should we trust on GNU/Linux? Microsofters on an armchair or Cloudflare Radar?
New Site Makes the Case Against Adoption of Omarchy, But Focuses Almost Entirely on Politics
Let's examine what the page says and what points it focuses on
Brigading Against Women - Part XXIV - Nobody's Name is Unspeakable
Names are not sacred
Microsoft is in Trouble (With the Regime It Sponsored)
It seems like Microsoft paying the existing regime/dictatorship wasn't enough
In the United Kingdom, Rising Cost of Hardware Benefits GNU/Linux
GNU/Linux rose from about 4% to almost 6% in one year
Japanese Targets of Cyber Breaches or Insider Threats
Japanese government bureau and major firms experience data breaches
Gemini Links 09/10/2026: Optimism, Stargazing, and Solar MiniServer
Links for the day
When Americans Export a 'Suicide Mission' to Other Continents
I worry that this culture of debt-taking and overconsumption is being spread from the US to Europe
The Register MS: "AI" Several Times in Same Headline, 31 Times in Page. The Register MS Was Paid to Do This.
The phenomenon is commercial (paid media), not scientific
The Outcome of Microsoft Ban Was Predictable
told you so
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, October 08, 2026
IRC logs for Thursday, October 08, 2026
Gemini Links 08/10/2026: Economical Thrashing, How I Killed the Earth, and Thoughts on Gemini
Links for the day
Links 08/10/2026: Wikimedia Bemoans Chaffbot Slop (Bots Sold as 'Agents') That Sabotage It, ICC's Taliban Warrants
Links for the day
Links 08/10/2026: Slop Scammers (Pushers) Inflate Hosting Bills and "YouTube Testing Everything"
Links for the day
The Register MS Helps Prove the "AI" Frenzy in the Media is Evidence of Compromised Media, Not Legitimate "Revolution"
Ignore the hype and carry on
London Became Synonymous With the Royal Courts of Justice
London used to be a place where we go on holiday/retreat/break; nowadays we have only one destination there
Microsoft Insiders on "Effectively Being Silently Laid Off From Microsoft"
People are laid off by the thousands without the media uttering a word or the companies confirming anything
Brigading Against Women - Part XXIII - Extremism in the Mix and Getting the Police Involved
In 2012 I was getting heckled a lot for opposing back doors in Linux; it has not stopped since
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, October 07, 2026
IRC logs for Wednesday, October 07, 2026
Microsoft's XBox CEO Asha Sharma Tells Staff That Many Thousands of Layoffs Are in Fact "Return to Growth"
Get it? Layoffs are "growth".
Gemini Links 07/10/2026: On Feeling Guilty Leaving the US, Multinet, and Limiting Net Usage
Links for the day
The Cyber Show Explains the Concept of "Data Rape"
a metaphor some might find crude
FREE BEER is Still Online, But Barely Active
25 years ago or even 20 years ago many spoke of open/free beer (or "COLA")
Syria: GNU/Linux Has Surged to 8% "Market Share"
I don't have a convincing explanation for this
IBM Dimming Down the Lights on IBM Consulting, No Knowledge or Experience Required
They just "ride" the (old) brand, that's all
Statement on American SLAPP
Crossposted from schestowitz.com
Today The Register MS Published "SPONSORED FEATURE" and "SPONSORED POST" With "AI" 31 Times in Them
This isn't a "Reality" or "Era of AI", it's a paid-for spam campaign
Gemini Links 07/10/2026: Nostalgia, Neutral Map, and Shorthanding
Links for the day
Links 07/10/2026: Unrest in France and Rumours of Plague in Russia
Links for the day
Brigading Against Women - Part XXII - The Lozza Problem (in Length)
Garrett's case was a waste of the Court's money
JavaScript in Richard Stallman's Web Site
For search he is using CGI, not JavaScript
EPO's Local Staff Committee The Hague (LSCTH) Plans Presentation Next Week (Coinciding With Apparent Coronation of 'Cocaine King' Campinos)
They've outsourced this session to the dictator's spying eye
The GNOME Foundation's Code of Conduct Has Been Misused to Hide Corruption
People who value free speech and freedom of expression won't touch social control media with a 10-foot bargepole
Voting for Freedom of the Press
American elections happen every 4 years
What Brett Wilson LLP and Matt Garrett Don't Want People to See/Read
Book-burning is counterproductive
Book-Burning Mindset Does Not Work
It makes the suppressed voices more widely known
Microsoft's XBox in 'Freefall'
XBox is practically finished
Slop is Plagiarism
Plagiarism is not "theft" and copyright infringement is not "piracy"
IBM is Almost Defunct
IBM is doomed. It just tries to test how much more patience the shareholders have.
Criminalisation of Journalism
"Journalist Derya Okatan arrested in Turkey for allegedly possessing classified material"
Brigading Against Women - Part XXI - Hiding Behind the Veil of "Privacy" After Telling Nazi Things in IRC Channels of Techrights and Physically Threatening People
To merely explain an abuse (or crime) requires naming people; that's a fundamental tenet of reporting
Links 07/10/2026: Quitting Smartphone and "Meta's Muse Is Spying on All Your Friends and Family"
Links for the day
Gemini Links 07/10/2026: Greed, In Praise of Zotero, and The de-Google Path
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, October 06, 2026
IRC logs for Tuesday, October 06, 2026