DEV Community

Cover image for 🐠 Fish — The Language Where Code Swims in Four Directions
Pʀᴀɴᴀᴠ
Pʀᴀɴᴀᴠ

Posted on

🐠 Fish — The Language Where Code Swims in Four Directions

What is Fish?

Fish (often written as “><>”) is an esoteric programming language created by Jonathan Todd Ross. It’s similar to Befunge, meaning the program exists on a 2D grid and execution moves in multiple directions instead of top-to-bottom. The twist: the syntax is minimal, symbolic, and looks like random punctuation — making code appear like ASCII fish bones.

Fish is stack-based, concise, and intentionally chaotic. Characters change execution direction, manipulate the stack, loop, and produce output. Because instructions are single characters, even meaningful programs are cryptic strings of symbols.


Specs

Language Type: Esoteric / 2D grid execution

Creator: Jonathan Todd Ross

Execution Model: Stack-based, pointer moves like a fish swimming

Syntax: Single-character opcodes

Purpose: Code-golf style minimal chaos


CODE EXAMPLE (Hello World)

A Fish “Hello World” program is typically short and symbolic. One example:

"Hello, World!"\
Enter fullscreen mode Exit fullscreen mode

In Fish:

  • Strings automatically push ASCII values
  • \ prints a character and pops it from the stack

That single line outputs:
Hello, World!


How It Works

  • Execution moves across the grid.
  • Arrows control direction:
    • > → right
    • < → left
    • ^ → up
    • v → down
  • Numbers push values.
  • Symbols perform operations like:
    • + - * / % arithmetic
    • \ output char
    • _ reflect or bounce execution
    • ? choose random direction

Like a maze, execution can cross paths, loop around, and interact with code visually rather than linearly.


Strengths

  • Compact and extremely expressive.
  • Great for code golf and puzzle-style programming.
  • Fun visual execution model similar to Befunge but smaller and more consistent.
  • Surprisingly powerful for its tiny syntax.

Weaknesses

  • Hard to read unless familiar with the instruction set.
  • Debugging is tricky because execution can bounce or loop visually.
  • Programs easily become symbolic noise with no readable structure.
  • Limited tooling and minimal community resources.

Where to Run

Fish interpreters exist on:

  • TIO.run
  • GitHub repositories
  • Esolang community websites
  • Minimal browser-based stacks with pointer visualization

Some interpreters animate the pointer “swimming” through the code.


Should You Learn It?

For real programming: No

For code golf and esolang exploration: Yes

For learning unconventional control flow: Definitely

For readable code: Absolutely not


Summary

Fish embraces chaotic minimalism by combining a 2D execution model with tiny symbolic instructions. The result is a language that looks like random punctuation but executes structured logic. While completely impractical, Fish remains a cult favorite in the esolang world — fast, cryptic, stack-driven, and surprisingly elegant for those willing to understand its weird rhythm.

Top comments (0)