Skip to main content

Experimental interpreter based on Lu Wilson's (TodePond) Gulf of Mexico conceptual design - featuring probabilistic variables, negative indexing, and temporal lifetimes

Project description

GOM - Gulf of Mexico Programming Language

Python 3.8+ License: MIT What's New

The perfect programming language - Based on the conceptual design by Lu Wilson (TodePond) (original repo)

๐Ÿ“– Quick Links

Note (Nov 2025): Internal GOM test programs used for designing/debugging the language were removed. Use user-facing examples in programs/examples/, demos in programs/demos/, compiler examples in compiler/examples/, and Python unit tests in tests/.

๐Ÿš€ Two Implementations

Python Interpreter โญ (Recommended)

  • Full-featured REPL with graphical IDE
  • Complete language support with all features
  • Language Construction Set - Create custom language variants
  • Plugin system for extensibility
  • Rich debugging and interactive development
  • Production-ready and fully tested

C++ Compiler โš ๏ธ (Experimental)

  • Research project - not production-ready
  • Compiles to C++ and native executables
  • Subset of features (no satirical keywords, limited functions)
  • Does NOT support Language Construction Set customization
  • Use Python interpreter for full features
  • See compiler/EXPERIMENTAL_STATUS.md for details

๐ŸŽฏ Installation

# Clone repository
git clone https://github.com/James-HoneyBadger/GulfOfMexico.git
cd GulfOfMexico

# Install Python interpreter
pip install -e .

# Optional: Build C++ compiler (experimental)
cd compiler/build
cmake ..
make -j4

For detailed installation instructions, see docs/guides/INSTALL_GUIDE.md.

โšก Quick Start

Run Your First Program

# Create a file: hello.gom
echo 'print("Hello, Gulf of Mexico!")!' > hello.gom

# Run it
python -m gulfofmexico hello.gom

Interactive REPL

# Start REPL
python -m gulfofmexico

# Or use the graphical IDE
python -m gulfofmexico.ide

Try Examples

# Run example programs
python -m gulfofmexico programs/examples/01_hello_world.gom
python -m gulfofmexico programs/examples/02_variables.gom

# Run feature demonstrations
python -m gulfofmexico programs/demos/feature_showcase.gom

๐ŸŽจ Language Construction Set โœจ NEW!

Create your own programming language by customizing Gulf of Mexico!

What Can You Customize?

  • โœ… Keywords - Rename any keyword (ifโ†’si, functionโ†’defun)
  • โœ… Functions - Add, remove, or rename built-in functions
  • โœ… Syntax - Array indexing, comments, delimiters
  • โœ… Parsing - Block syntax, separators, operators
  • โœ… Features - Enable/disable satirical keywords, quantum features

Quick Examples

# Use Python-like syntax
python -m gulfofmexico --preset python_like myprogram.gom

# Spanish keywords
python -m gulfofmexico --preset spanish programa.gom

# Minimal teaching mode
python -m gulfofmexico --preset minimal script.gom

# Load custom configuration
python -m gulfofmexico --config my_language.json script.gom

Create Language Variants

# See what's possible
python demo_create_new_languages.py

# This creates:
# - GulfLisp (Lisp-like)
# - GulfTurtle (Logo/Turtle graphics)
# - GulfQL (SQL-like)
# - GulfASM (Assembly-like)
# Plus demonstrates CRUD operations!

CLI Configuration Tool

# Create from preset
python gomconfig.py create --preset python_like --output my_lang.json

# Interactive creation
python gomconfig.py create --interactive

# Update configuration
python gomconfig.py update my_lang.json --set metadata.author "Your Name"

# Delete elements
python gomconfig.py delete my_lang.json --keyword synergize --function blockchain

# Merge configurations
python gomconfig.py update config1.json --merge config2.json

# Compare configurations
python gomconfig.py diff config1.json config2.json

# Validate
python gomconfig.py validate my_lang.json

# Show info
python gomconfig.py info my_lang.json

Available Presets

  • python_like - Python-style (def, 0-based arrays, # comments)
  • js_like - JavaScript-style (semicolons, 0-based)
  • serious - No satirical features
  • minimal - Teaching mode (6 keywords, 5 functions)
  • spanish - Spanish keywords
  • french - French keywords

Documentation

See examples in examples/configs/ - includes Lisp, SQL, Logo, and Assembly variants!

๐ŸŒŸ Core Language Features

Arrays Start at -1

var items = ["first", "second", "third"]
print(items[-1])!  // Prints "first"
print(items[0])!   // Prints "second"
print(items[1])!   // Prints "third"

Flexible String Syntax

var message = "Hello World"!          // Double quotes
var name = 'Alice'!                   // Single quotes
var multiline = """
  This is a
  multi-line string
"""!                                  // Triple quotes

Three-Valued Logic

var answer = maybe!  // true, false, or maybe

Functions

function greet(name) {
  print("Hello, " + name)!
  return "Greetings sent"!
}

var result = greet("World")!

Satirical Keywords

// Procrastination scheduling
later {
  print("I'll do this eventually")!
}

// Corporate synergy
synergize data with analytics!

// Quantum computing
quantum_compute {
  // Exists in multiple states simultaneously
}

More Features

  • Classes and Objects - OOP support
  • Async/Await - Asynchronous programming
  • Pattern Matching - Advanced control flow
  • Time Travel - Temporal variable lifetimes
  • Graphics - Built-in turtle graphics and image manipulation
  • Plugin System - Extend the language

See docs/guides/PROGRAMMING_GUIDE.md for complete language documentation.

๐Ÿ“š Documentation

Essential Reading

Language Customization

Reference

Compiler

๐Ÿ”ง Advanced Usage

Debugging

# Show internal debug messages
python -m gulfofmexico --debug script.gom

# Show completion messages
python -m gulfofmexico --verbose script.gom

# Launch IDE with debug output
python -m gulfofmexico.ide --debug

# Or use environment variables
GULFOFMEXICO_DEBUG=1 python -m gulfofmexico script.gom

REPL Commands

:load programs/examples/01_hello_world.gom   # Load and run a file
:vars                                         # Show all variables
:history 10                                   # Show last 10 commands
:run 5                                        # Re-run command #5
:reset                                        # Clear all state
:quit                                         # Exit REPL

Custom Configuration

from gulfofmexico.language_config import LanguageConfig

# Create custom language
config = LanguageConfig(name="MyLanguage")

# Customize keywords
config.rename_keyword("if", "cuando")
config.rename_keyword("function", "funciรณn")

# Customize functions  
config.rename_function("print", "imprimir")

# Disable satirical features
config.disable_satirical_keywords()

# Save
config.save("my_language.json")

# Use it
# python -m gulfofmexico --config my_language.json script.gom

๐Ÿ“ Project Structure

GulfOfMexico/
โ”œโ”€โ”€ gulfofmexico/              # Python interpreter (main implementation)
โ”‚   โ”œโ”€โ”€ language_config.py     # Language Construction Set
โ”‚   โ”œโ”€โ”€ language_runtime.py    # Runtime integration
โ”‚   โ”œโ”€โ”€ interpreter.py          # Main interpreter
โ”‚   โ”œโ”€โ”€ builtin.py             # Built-in functions
โ”‚   โ””โ”€โ”€ ...
โ”‚
โ”œโ”€โ”€ compiler/                   # C++ compiler (experimental)
โ”‚   โ”œโ”€โ”€ EXPERIMENTAL_STATUS.md # โš ๏ธ Read this first!
โ”‚   โ””โ”€โ”€ ...
โ”‚
โ”œโ”€โ”€ docs/                       # All documentation
โ”‚   โ”œโ”€โ”€ guides/                # User guides
โ”‚   โ”œโ”€โ”€ language/              # Language Construction Set docs
โ”‚   โ”œโ”€โ”€ reference/             # Technical reference
โ”‚   โ””โ”€โ”€ compiler/              # Compiler documentation
โ”‚
โ”œโ”€โ”€ programs/                   # Example programs (user-facing)
โ”‚   โ”œโ”€โ”€ examples/              # Learning examples
โ”‚   โ””โ”€โ”€ demos/                 # Feature demonstrations
โ”‚
โ”œโ”€โ”€ examples/configs/           # Demo language configurations
โ”‚   โ”œโ”€โ”€ demo_gulplisp.json     # Lisp-like language
โ”‚   โ”œโ”€โ”€ demo_gulfturtle.json   # Turtle graphics
โ”‚   โ”œโ”€โ”€ demo_gulfql.json       # SQL-like language
โ”‚   โ””โ”€โ”€ demo_gulfasm.json      # Assembly-like
โ”‚
โ”œโ”€โ”€ configs/                    # Language presets
โ”‚   โ”œโ”€โ”€ python_like.yaml       # Python-style
โ”‚   โ”œโ”€โ”€ minimal.json           # Teaching mode
โ”‚   โ””โ”€โ”€ README.md
โ”‚
โ”œโ”€โ”€ gomconfig.py               # CLI configuration tool
โ”œโ”€โ”€ demo_create_new_languages.py  # Advanced demos
โ””โ”€โ”€ README.md                  # This file

๐ŸŽ“ Examples

Hello World

print("Hello, World")!

Variables and Arrays

var name = "Alice"!
var numbers = [10, 20, 30]!
var first = numbers[-1]!  // -1 indexing!

Functions

function factorial(n) {
  if n < 2 {
    return 1!
  }
  return n * factorial(n - 1)!
}

print(factorial(5))!  // 120

Classes

class Person {
  function __init__(name, age) {
    this.name = name!
    this.age = age!
  }
  
  function greet() {
    print("Hello, I'm " + this.name)!
  }
}

var alice = Person("Alice", 30)!
alice.greet()!

Async/Await

async function fetchData(url) {
  var result = await http.get(url)!
  return result!
}

var data = await fetchData("https://api.example.com/data")!

See programs/examples/ for 50+ example programs!

๐Ÿšฆ Language Construction Set Examples

Create a Lisp-Like Language

from gulfofmexico.language_config import LanguageConfig, ParsingConfig

config = LanguageConfig(name="GulfLisp")

# Lisp-style syntax
config.parsing_config = ParsingConfig(
    block_start="(",
    block_end=")",
    list_start="(",
    list_end=")",
)

# Lisp keywords
config.rename_keyword("function", "defun")
config.rename_keyword("var", "let")

config.save("gulplisp.json")

Create a Teaching Language

config = LanguageConfig(name="TeachingGOM")

# Keep only essentials
config.disable_satirical_keywords()
config.update({"syntax_options": {"array_start_index": 0}}, merge=True)

# Remove advanced features
config.delete_keyword("quantum_compute")
config.delete_keyword("time_travel")

config.save("teaching.json")

Run the comprehensive demo:

python demo_create_new_languages.py

This creates 5 complete language variants:

  • GulfLisp - Lisp-like with parentheses
  • GulfTurtle - Logo/Turtle graphics
  • GulfQL - SQL-like query language
  • GulfASM - Minimal assembly-like
  • Plus CRUD operations demonstration!

โš ๏ธ Important: Interpreter vs Compiler

Feature Python Interpreter C++ Compiler
Status โœ… Production-ready โš ๏ธ Experimental
Language Construction Set โœ… Full support โŒ Not supported
All Features โœ… Complete โŒ Subset only
Satirical Keywords โœ… Yes โŒ No
Plugin System โœ… Yes โŒ No
Customization โœ… Full โŒ None
Use For Development, production Research, experiments

Recommendation: Use the Python interpreter for all development and production use.

See compiler/EXPERIMENTAL_STATUS.md for detailed comparison.

๐Ÿค Contributing

Contributions are welcome! Please:

  1. Read CODE_OF_CONDUCT.md
  2. Check docs/reference/TECHNICAL_REFERENCE.md
  3. Submit pull requests with tests
  4. Follow the existing code style

๐Ÿ“Š Statistics

  • Programming Language: Gulf of Mexico
  • Implementations: Python interpreter (stable) + C++ compiler (experimental)
  • Language Construction Set: 5 comprehensive docs, CLI tool, working demos
  • Example Programs: 50+ programs in programs/
  • Demo Configurations: 11+ language variants in examples/configs/
  • Documentation: 25+ organized documents in docs/
  • Built-in Functions: 35+ functions (interpreter)
  • Presets: 6 language presets ready to use

๐ŸŽฏ Use Cases

  • Learning: Great for teaching programming concepts
  • Prototyping: Quick experimentation with satirical features
  • Language Design: Create custom language variants
  • DSL Creation: Build domain-specific languages
  • Research: Experiment with novel language features

๐Ÿ“„ License

MIT License - See LICENSE for details

๐Ÿ™ Credits

๐Ÿ“ž Links


Get Started: python -m gulfofmexico

Customize: python demo_create_new_languages.py

Learn More: DOCUMENTATION.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gulfofmexico-0.1.4.tar.gz (130.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gulfofmexico-0.1.4-py3-none-any.whl (147.1 kB view details)

Uploaded Python 3

File details

Details for the file gulfofmexico-0.1.4.tar.gz.

File metadata

  • Download URL: gulfofmexico-0.1.4.tar.gz
  • Upload date:
  • Size: 130.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for gulfofmexico-0.1.4.tar.gz
Algorithm Hash digest
SHA256 160be6afda1e9cd47c18eafcbd00c10279553de5212372ab35eae23daf2d3531
MD5 6a49021fc58dbc22e951f1c562ab42f2
BLAKE2b-256 ab0828ab417f2a85ed098b43dc7aaea90dcd16772158a7dbe7466c6f0e87ed5b

See more details on using hashes here.

File details

Details for the file gulfofmexico-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: gulfofmexico-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 147.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for gulfofmexico-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ef4fd8a5ab2de44daa16b9eb7c5869ec7107179d1ef002b7a814e41e5d9c8238
MD5 8336b8e96a1095015c9477b3378ffc47
BLAKE2b-256 aad14695d28b56faacb9b82755374211aab4019f4f1782e592f24510309232f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page