Bonum Certa Men Certa

Guest Post: Why I Wrote Fig (the Computer Language That Helps Techrights Operations)

By figosdev

Fig project



Summary: Fig project introduced; its developer wrote some code for Techrights and has just decided to explain why he uses his own programming language

SOME helper code we recently published for the site [1, 2] had been written in Fig, whose developer explained the language as follows.






Since Techrights is now publishing Fig code, I thought it best to write a couple of articles about it -- one explaining how to use it, and the other explaining why.

Stallman didn't start the GNU project just to have another operating system, and I didn't write Fig just to have another language. Rather I grew up with fun languages like Basic and Logo, and wanted to use them to teach coding to friends and others.

Logo lives on in modern adaptations, and so does Basic. A lot of people think Basic is bad for you, but that's due to stuff written about the versions of Basic in the 1960s and 70s, before it gained better commands for structural programming. Both Linus Torvalds and I first learned Basic as our introduction to programming. It's a fun, simple language when it's done right.

"Both Linus Torvalds and I first learned Basic as our introduction to programming. It's a fun, simple language when it's done right."Python is a good language for beginners, and it has modern advantages that even the most modern versions of Basic do not -- it's also a good shell language, a decent language for making games, as well as applications. But Python is definitely not as simple as Basic, and I wanted to create an even simpler language if possible.

A simple language benefits from having few rules, but it does not need to be completely consistent. If your language only has 2 rules, it will be very consistent but it could be tedious to work within that level of consistency. Fig tries to find a balance between having as few rules as possible, and having enough to be friendly.

The original Basic had very few commands, which made it trivial to learn "the whole thing." Fig was not my first attempt to create a fun, simple language -- in fact it is named after the logo for a previous language project of mine -- originally fig was called "Fig Basic". Like its predecessor, Fig was a experiment in lightweight syntax.

I had a couple of rules for developing Fig -- one, punctuation would only be added as needed, within reason. This produced a language that uses "quotes for strings" and # hashes for comments. Decimal points work the same way in fig that they do in Python and Basic.

"Since Fig compiles to Python code, and has an inline Python feature, it was (and remains) possible to cheat and just use Python pretty much wherever it is needed."As with punctuation for syntax, the other rule was to only add new statements or functions as needed, when it became too tedious to do without them. This resulted in a language with fewer than 100 commands.

Since Fig compiles to Python code, and has an inline Python feature, it was (and remains) possible to cheat and just use Python pretty much wherever it is needed. You can create a Fig function that is just a wrapper around a Python import, and that's pretty nice. Then you can call that function using Fig's lightweight syntax.

Fig can also do shell code, so it can interact with other programs on the computer. But I wrote an extensive (20 short chapters) tutorial for Basic more than 12 years ago, started adapting it to Python, and eventually decided to teach coding in terms of the following near-standard features:

1. variables 2. input 3. output 4. basic math 5. loops 6. conditionals 7. functions

I realise that in Python, "functions" are really method calls, but that's not very important to most people learning programming for the first time. I see a lot of people working their way up to "rock paper scissors" programs when first learning Python, and that's typical of how they taught Basic as well.

"While Python is case-sensitive and indented, Fig uses Basic-like (Pascal-like, Bash-like) command pairs and is case-insensitive."I started creating simple Python tutorials aimed at Basic coders, and those gradually turned into a simple library of Basic-like Python routines, which eventually turned into Fig Basic. And Fig Basic is different than most dialects of Basic, because it took into account a lot of things I learned while trying to teach Basic and Python -- namely, the things people had the most problems with in terms of syntax.

While Python is case-sensitive and indented, Fig uses Basic-like (Pascal-like, Bash-like) command pairs and is case-insensitive. Today even most versions of Basic are case-sensitive, but during its peak as a language it was not.

Fig is not parenthetical and has no operator order, other than left to right. It inherits Python's (and QBasic's) conventions about newlines -- after an if statement, you start a newline (QBasic had a cheat about that, but Fig is consistent.)

So for example, a for loop from 10 to 2 with a step of -1 might look like this:

    for p = (10, 2, -2) 
        now = p ; print
        next


Many things about this are optional -- both equals signs, the parentheses, the commas and the indentation. Here is the code with those removed:

    for p 10 2 -2 
    now p print
    next


This is based on the inspiration Fig takes from logo (specifically turtle graphics) which tends to require less punctuation in its syntax than almost any popular language -- certainly among the educational languages.

The inline Python feature naturally requires indentation.

"The inline Python feature naturally requires indentation."But I've created languages before and since, and Fig is only the best of those. What I really want is for people to learn programming and for people to learn how to create simple programming languages. The latter is something I've taught as a sort of "next step" after coding basics.

I strongly feel that we need a more computer-literate society, and code is really the shortest route to computer literacy. A programming language is basically a text-based interface to the computer itself (built on a number of abstractions... so is a command line, but a command line works like a programming language all on its own.) We need to make it easy for teachers to learn, so they can make it easy for students to learn.

A more computer-literate society would be better able to make political decisions regarding computers, and it would be better able to contribute to Free software, so creating more tools to teach coding to everyone would help immensely in my opinion.

"I strongly feel that we need a more computer-literate society, and code is really the shortest route to computer literacy."And I feel if more people worked to create their own language, we would learn a lot more about what sorts of features (and omissions) would best suit the task of creating an educational language for everyone. Sure, Basic did very well and Logo has done very well; Python is doing well. As to whether we can make it so fewer people struggle, or explaining what makes coding truly easy or truly difficult in the initial steps, there is only so much data we have on this. We could have a lot more.

Years ago, I wanted to create a piece of software as a "kit" for making it much, much easier to design your own language. Instead of creating a formal specification and writing/generating a parser, you would choose a parser based on the style of your language and tweak it to your needs. There would be a giant collection of features, and a way of turning that into a catalog, from which you would "select" the routines you wanted your language to have.

Meanwhile, Fig is possible to take apart and change. version 4.6 is a single 58k Python script, with 1,154 unique lines of code. This includes a simple help system, which allows you to search for any command by name (even part of the name) and that gives you the syntax and a quick description of the command and what it does.

I would be just as happy for people to adapt Fig or be inspired to create their own version or own language, as I would be for them to adopt Fig for their own use. I would still like to make it easier to teach coding, so that more people are capable, earlier on, with less intimation -- just like in the days when Logo was really, really simple.

"I would be just as happy for people to adapt Fig or be inspired to create their own version or own language, as I would be for them to adopt Fig for their own use."I now use Fig for most tasks, and let me apologise for the code that Roy has published so far. I wrote that as code for internal use and took every shortcut, and he was totally free to publish it, but I don't use the same care (recommended with good reason) when naming variables that I do when naming commands for a programming language. I actually put a lot of thought into that sort of thing -- but when I name variables, I'm very sloppy. It's a beginner's mistake, and I still do that more than a quarter of a century later.

I will write a simple Fig tutorial or two next, but I will try to use better variable names. One convention I use a lot though -- is if I need a "throwaway" variable, I will just use "p" or "now." If the variable is going to be referenced a lot, these are definitely not good variables names at all. Writing Fig has made me a better coder and designing a language will make you a better coder too, but the variable names thing -- sorry about that.

Fig puts almost 100% of variables on the left of each line (almost like creating a named pipe) so they're easy to find. For loops and Forin loops put the variable a little more to the right, but every "standard" command in Fig begins with a variable:

    howmuch = 2
    p = "hello" ; left howmuch ; ucase ; len ; print ; print ; print


You can download the latest version of fig (4.6 is very stable!) here from PyGame. You can also find the language featured in the first issue of DistroWatch Weekly of the new 2017 year:

[download fig 4.6] SHA256: 4762871cf854cc8c1b35304a26d7e22c5f73b19a223b699d7946accea98d2783

Whatever language you love most, happy coding!

Licence: Creative Commons cc0 1.0 (public domain)

Recent Techrights' Posts

IBM Spammers With LLM Slop Discourage Discussion About IBM Problems and Layoffs
they would likely not bother had those discussions not hurt IBM's management [...] There is a similar problem this year in IRC
Pop the Slop Bubble, Don't Ask When It'll Pop or Expect Others to Pop It for You
It has all along been sold on a lie and it relied a great deal on corrupted (captured) media which played along with deliberate lies because it got paid to do this [...] The slop bubble is similar to the fake-coins bubble
SLAPP Censorship - Part 68 Out of 200: Based on Their Particulars of Claims, Microsoft's Graveley and Garrett Seem Like the Same Person (Exactly Same Words Used, Sloppily Recycled)
almost identical (even a description of who they are and how they feel)
Gartner Group Paid The Register MS. And Now The Register MS is a "Gartner Says" Rag.
Follow the money
Microsoft's XBox Exodus Carries on: Corporate VP of Gaming Ecosystem Organization and Corporate VP of XBox Devices and Ecosystem Both Leave Microsoft
Don't expect what's left of the media to properly report the true scale of the XBox cuts and executive-level departures
 
The Register MS Does "Microsoft Says", Fails to Accept XBox is Dying and Slop is a Failure
The real news today isn't some tweets from Microsoft
IBM Seems to be Imitating the European Patent Office's "Young Professionals" (YPs) With Client Innovation Center (CIC), Which is About Mass-Hiring Inexperienced People on Very Low Salaries (Sometimes Unlivable)
So the future of IBM now is college students without experiences?
The Register MS is All About MS After the Site Overhaul, Now They Are a Platform of "Microsoft Says"
They rewrite history for sponsors [...] Microsoft says. Hence, it must be true!
The Operating Systems statCounter Cannot Identify or Classify
Is it possible that statCounter just cannot properly decipher and classify systems brought by and controlled by eastern Asia as opposed to Europe and North America?
IBM Allegedly Used Apptio to Target and Sack (RA) Productive or 'Expensive' Employees, Are Apptio Staff Now Subjected to Layoffs?
Apptio is one of several companies that IBM buys only to sink together with the IBM boat, RMS Watson
Gemini Links 06/05/2026: "Who Knows That You Blog?" and New Official Antenna by Michael Nordmeyer
Links for the day
Links 06/05/2026: Apple Accepts That It Misled People on Slop and Begins Blocking Software/Games Made With Slop
Links for the day
Codecs and Software Patents - Part II - AV1 and HEVC Not Really Safe
We are, in effect, looking at a sort of cartel (like the one which came out of Germany with MP3)
The Corrupt Lecture the Non-Corrupt - Part XIV - Antisemitism Inside the EPO
A sensitive topic for the European Patent Office (EPO)
Gemini Links 06/05/2026: Childhood Memories, Intense People, and Natural Web Exploration
Links for the day
Links 06/05/2026: Narges Mohammadi in Critical Condition and Copyright Infringement Rampant in Reddit
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, May 05, 2026
IRC logs for Tuesday, May 05, 2026
Ubuntu is Run by "N00bs" (and It Shows)
GNU/Linux users are not a small niche anymore
Gemini Links 05/05/2026: Bad Health, Pomera DM250 On Linux, and Children Using DO
Links for the day
Why Chatbots Based on LLMs Cannot Be Improved Even If More Energy (Money) Gets Wasted on Them
nobody can do it well
Reading Closely What Microsoft Put in the Report, Expect Many More Layoffs Later This Year
The only thing that they grow rapidly is their debt
IBM is Collapsing, the People Responsible for the Collapse Aren't the Victims
IBM management has plenty of things to distract from right now
Media: Let's Repeat the Lie About Mass Layoffs Being a Win for a Buzzword
This says so much about the state of today's media
The Generations of CS Are Coming to 'End of Life'
Nowadays everything that is a computer is somehow called "hey hi"
Links 05/05/2026: Live Nation Problems, Growing Tensions in the Gulf Again (Energy Crisis)
Links for the day
Gartner Pays The Register MS and the Effect is Visible (IBM Promotion; IBM Also a Sponsor, of Both!)
Follow the money
The Register MS Published Fake Article That Mentioned "AI" Almost a Dozen Times. It Got Paid to Do This.
If you keep seeing the term "AI" quite a lot in the media, be sure to check who pays for it
Links 05/05/2026: Germany, Depression, and Control of Online Discourse in Geminispace
Links for the day
Links 05/05/2026: "Republicans Made Children More Expensive" and "Internet Blackouts" Cripple Economies
Links for the day
Microsoft Lunduke Has a Serious Problem: He's Fronting for Sites That Insist on Exposing Children to Pornography
He's even contradicting himself a lot
What "Age Verification" Laws Are About
We know based on experience (even predating the Web) that kids will find workarounds, so such restrictions are difficult to enforce
Unsustainable 'Tech' (Debt) Giants Rely on US Taxpayers for Bailouts and Subsidies
In the past 6 months Oracle and Amazon alone borrowed over 100 billion dollars
Future-Proofing Techrights
2 days from now this site turns exactly 19.5 (years)
Microsoft is Waning Like IBM
There will be lots of "ex Softies" or "former Microsofters" out there
Chatbots Are Not Replacing Web Search, But They Contaminate Results
People still value pages written and curated by humans; they use search engines to find these
SLAPP Censorship - Part 67 Out of 200: Graveley and Garrett Claims Against My Wife and I Assert 'Distress', But It Was Just a Copy-Pasted Template (Mechanical Crocodile Tears)
Can barristers charge 10,000-15,000 US dollars (about $1,000-1,500 per page!) to do such shoddy, sloppy work?
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, May 04, 2026
IRC logs for Monday, May 04, 2026
Links 05/05/2026: Energy Crises, Data Breaches, and Journalists Murdered
Links for the day
The Corrupt Lecture the Non-Corrupt - Part XIII - Health and Safety With Cocaine
That they are trying to approach us (the President's own family) is a sign of weakness
Codecs and Software Patents - Part I - The 2026 Status Quo
It's frustrating to see how little (almost none) media coverage exists for these sorts of matters
Gemini Links 05/05/2026: ASCII Chessboard Without HTML and Ongoing Antenna Migration
Links for the day
Links 04/05/2026: Economics of Slop Discredited, Democrat and Republican Voters Want Cuts to Data Centres
Links for the day
IBM's "FutureNow" is the Rebranding of the Client Innovation Center (CIC), for Lobbying Purposes by IBM While Halving People's Salaries
So says a new comment
Libera.​Chat Openly and Publicly Admits It Has an LLM Slop Problem (Chatbots in Its Channels)
If there's a policy that bans chatbots (not humans), there's even a moral imperative for it
Microsoft: Yes, We Are Losing Windows Users and Yes, We Have Problems With Payroll (So We Lay Off Essential Workers)
From what we can gather, "hey hi" is now the name of everything at Microsoft
Ubuntu.com While Ubuntu.com is Under DDoS Attack and Intermittently Offline Due to Windows Botnets: Don't Use Ubuntu, Use Windows Instead
Unbelievable, as this is their advice when Windows zombies hammer away at their Web site and general infrastructure
Links 04/05/2026: "DNC Covering Up Its 2024 Autopsy" and Rudy Giuliani in Critical Condition
Links for the day
Linux Kernel Tainted by Software Patents That Make Linux Worse and the 'Linux' Foundation is Compiling Bribes to Enable This (Promotion of Monopolies and Tolerance of Software Patenting)
Why you need to reboot when a serious bug is found in Linux? "Licencing"...
ChromeOS and GNU/Linux Exceed 5% in New Zealand
Can we expect New Zealand and Australia to divest from GAFAM?
Links 04/05/2026: Energy Shortages Become More Visible, Germans Reject Military Service, Merz Says US 'Humiliated' Over Iran
Links for the day
KDE's Cornelius Schumacher Explains Why You Should be Slop-Free
Output is not measured by quantity of words
The Real News is Botnets (e.g. Windows With Back Doors), Not Iran
Let's focus on the botnets [...] Microsoft's aim is the opposite of security
SLAPP Censorship - Part 66 Out of 200: Alex Graveley Did Illegal Things, Then Asserted Mentioning Those Illegal Things is Privacy Violation
Alex Graveley "has suffered damage and distress" when the public found out he told women to kill themselves
The Corrupt Lecture the Non-Corrupt - Part XII - Outsourcing Everything to Microsoft, Which is Illegal
Today's EPO isn't about technology or law
Melissa Chan on Why Press Freedom Matters to Everyone, Not Just Journalists
dispelling a myth
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, May 03, 2026
IRC logs for Sunday, May 03, 2026
Gemini Links 04/05/2026: Another Old Web Pillar Gone and Simple Lobsters Mirror for Gemini
Links for the day