Abstraction Programming with LiveCode and Strict English Code Generation

Introduction

In modern software development, managing complexity and bridging the gap between human intent and machine execution remain fundamental challenges. Traditional programming languages require precise syntax that often imposes a significant cognitive load on developers. To address this, we explored an innovative approach centered on abstraction programming integrated with LiveCode and an emerging language called Strict English.

What is Abstraction Programming?

Abstraction programming focuses on describing high-level conceptual models—abstractions—which represent data structures, behaviors, and system components independent of their underlying implementation details. The intent is to communicate what the system should do, rather than how it should perform those tasks in low-level code.

For example, a chessboard can be abstracted as an 8x8 grid of squares, each square either occupied or unoccupied by a chess piece, with rules defining how pieces move and capture opponents.

By clearly defining these abstractions, programmers can reduce complexity and make their intentions explicit and machine-readable.

Using LiveCode as a Base Language

LiveCode is an event-driven, high-level scripting language featuring an English-like syntax that simplifies coding and testing. It provides rapid development capabilities where code can be run seamlessly in its IDE.

Leveraging LiveCode as the base programming language allows developers to build and run applications with lower effort, while supporting essential programmatic control.

Introducing Strict English: A Natural Syntax Layer on LiveCode

To further lower cognitive overhead and improve code clarity, we introduced Strict English—a novel programming language that maps one-to-one with LiveCode’s syntax but presents code in natural, precise English syntax.

Strict English syntax rearranges keywords and expressions to read like formal English statements, making code more self-explanatory and accessible.

Strict English and LiveCode: A Case Study with the Answer Command

While much of Strict English syntax closely maps to LiveCode, some constructs exhibit more natural and readable forms—we see this clearly in the `answer` command.

The native LiveCode syntax might be:

answer with information icon filesProcessed and "files were exported."

This can be a bit terse and relies on keyword positioning that is non-intuitive for newcomers.

Strict English reorders and clarifies the command into:

say prompt using icon information with buttons titled "Export Status"

Here, the phrasing reads more like natural English, making the code's intent immediately clear.

This example showcases how Strict English can reduce cognitive load and make complex commands more approachable, providing substantial benefits over traditional scripting syntax.

Abstraction Prompts as Self-Documenting Code

One of the central ideas is to treat abstraction prompts as both:

  • Self-documenting comments precisely describing program abstractions.

  • Code generation inputs that produce LiveCode and Strict English syntax.

This reverses the traditional model where comments describe code. Instead, abstraction prompts are the documentation and the source for multi-language code generation.

Concrete Example: Chessboard Abstraction

Abstraction prompt:

Create a chessboard comprised of a grid of 8x8 squares. Each square can be occupied or remain unoccupied. If occupied, it will contain one of the chess pieces. Chess pieces can move based on their type. When moving to an occupied square, the occupying piece is taken (removed from play).

Auto-generated comment:

-- This code represents a chessboard as an 8x8 grid where squares can be empty or occupied by chess pieces.

-- Pieces move based on type and capture opposing pieces upon moving to occupied squares.

LiveCode script snippet:

constant BOARD_SIZE = 8

local tChessBoard

put empty into tChessBoard

repeat with i = 1 to BOARD_SIZE

repeat with j = 1 to BOARD_SIZE

put empty into tChessBoard[i][j]

end repeat

end repeat

command movePiece pFromRow, pFromCol, pToRow, pToCol

local tPiece

put tChessBoard[pFromRow][pFromCol] into tPiece

if pToRow < 1 or pToRow > BOARD_SIZE or pToCol < 1 or pToCol > BOARD_SIZE then

answer "Move out of bounds."

exit movePiece

end if

if tPiece is empty then

answer "No piece to move."

exit movePiece

end if

if tChessBoard[pToRow][pToCol] is not empty then

put empty into tChessBoard[pToRow][pToCol] -- capture

end if

put empty into tChessBoard[pFromRow][pFromCol]

put tPiece into tChessBoard[pToRow][pToCol]

end movePiece

LiveCode script snippet (Note the comments are potential strict-english syntax equivalents to the livecode syntax)

constant BOARD_SIZE = 8

//local array tChessBoard

local tChessBoard

//make all values in tChessBoard null //Here I have changed put to make as I think that it makes the intent

clear

put empty into tChessBoard

//repeat from 1 to BOARD_SIZE

repeat with i = 1 to BOARD_SIZE

//repeat from 1 to BOARD_SIZE

repeat with j = 1 to BOARD_SIZE

‍ ‍

//put null into tChessBoard[i][j] //initialise all values in tChessBoard to null <- Sometimes a comment is

required to make things explicit

put empty into tChessBoard[i][j]

end repeat

end repeat

//function movePiece that takes an initial row and column start values and end row and column values for moving a piece from one square to another

command movePiece pFromRow, pFromCol, pToRow, pToCol

//local array tPiece

local tPiece

put tChessBoard[pFromRow][pFromCol] into tPiece

//if pToRow less than 1 or pToRow greater than BOARD_SIZE or pToCol less than 1 or pToCol greater

than BOARD_SIZE then

if pToRow < 1 or pToRow > BOARD_SIZE or pToCol < 1 or pToCol > BOARD_SIZE then

answer "Move out of bounds."

exit movePiece

end if

if tPiece is empty then

answer "No piece to move."

exit movePiece

end if

if tChessBoard[pToRow][pToCol] is not empty then //if square not empty

put empty into tChessBoard[pToRow][pToCol] -- capture

end if

put empty into tChessBoard[pFromRow][pFromCol] //square piece moved from becomes vacant

put tPiece into tChessBoard[pToRow][pToCol] //piece at new position on board

end movePiece

Bidirectional Editing and Example Generation

To facilitate language evolution and improve usability:

  • Syntax definitions and example usages are bidirectionally linked.

  • Editing syntax updates examples, and editing examples updates syntax.

  • This dynamic approach fosters iteration and clarity in language design.

Future Vision: AI-Driven Development with VSCode, LiveCode IDE, and Replit Integration

The longer-term goal is a fully agentic development environment integrating:

  • VSCode as a powerful script editor

  • LiveCode IDE as the runtime and debugging environment

  • AI agents like Cline, Replit, and Hermes orchestrating development via prompts and scripts

This ecosystem supports programming by abstraction with automatic code generation, synchronization, and self-documenting source code.