A natural programming language with conversational syntax
Convo is a programming language that reads like natural English, making programming accessible to everyone. Create real applications, Discord bots, games, and more with intuitive, conversational syntax.
Accessibility First: Programming shouldn't require memorizing cryptic symbols. Convo lets you write code that anyone can read and understand.
Traditional Python:
def calculate_grade(score):
if score >= 90:
return "A"
elif score >= 80:
return "B"
else:
return "F"Convo:
Define calculate_grade with score:
If score greater equal 90 then:
Return "A"
Else if score greater equal 80 then:
Return "B"
Else:
Return "F"
- Lexical Analysis - Professional tokenization
- Parsing - Full AST generation with error recovery
- Interpretation - Robust execution engine
- Type System - Dynamic typing with runtime safety
- Discord Bots - 43 built-in functions for bot development
- Games & Interactive Programs - Full control flow and state management
- Data Processing - Lists, dictionaries, and comprehensions
- Educational Tools - Perfect for teaching programming concepts
- Functions & Closures - First-class function support
- Object-Oriented Programming - Classes and inheritance
- Control Flow - If/else, loops (for, while), try/catch
- Collections - Lists, dictionaries with built-in methods
- List Comprehensions - Functional programming constructs
- Module System - Import/export functionality
- Error Handling - Comprehensive exception management
- 100% Test Coverage - 104 passing tests ensuring reliability
- VS Code Integration - Syntax highlighting and debugging
- Interactive REPL - Live code testing and exploration
- Comprehensive Documentation - Examples and guides
- Production Examples - Real applications you can run today
# Install Convo directly from GitHub
pip install git+https://github.com/DreadHeadHippy/Convo.git
# Or install with Discord bot support
pip install "git+https://github.com/DreadHeadHippy/Convo.git#egg=convo-lang[discord]"git clone https://github.com/DreadHeadHippy/Convo.git
cd Convo
pip install -e .
# Or with Discord support
pip install -e ".[discord]"# Test the installation
convo --version
# Test Discord module (if installed with discord extras)
python -c "from convo.modules.discord_bot import DiscordModule; print('Discord ready!')"Create a file called hello.convo:
Say "Hello, World!"
Let name be "Alice"
Say "Welcome to Convo, " + name + "!"
Define greet with person:
Say "Nice to meet you, " + person + "!"
Call greet with name
Run it:
python main.py hello.convopython -m convoNow that you know the syntax, explore these working example programs:
- ๐ Hello World (
hello_world.convo) - Your first Convo program - ๐ Variables (
variables.convo) - Data types and variable assignment - ๐ง Functions (
functions.convo) - Function definitions and calls - ๐ Control Flow (
control_flow.convo) - If statements, loops, and logic
- ๐ญ Classes & Objects (
classes_and_objects.convo) - Object-oriented programming - ๐ Lists Demo (
lists_demo.convo) - List operations and methods - ๐ Dictionaries Demo (
dictionaries_demo.convo) - Dictionary manipulation โ ๏ธ Error Handling (error_handling.convo) - Try/catch and exception management
- ๐ฏ Game Demo (
game_demo.convo) - Complete RPG-style combat game - ๐ฆ Banking Demo (
banking_demo.convo) - Financial calculations and eligibility checks - ๐ Grade Calculator (
grade_calculator.convo) - Student grade management system - ๐ค๏ธ Weather App (
weather_app.convo) - Weather advisory system - ๐ง Enhanced Demo (
enhanced_demo.convo) - Comprehensive language feature showcase
- ๐ Discord Setup Guide (
discord_setup_guide.convo) - Complete bot setup tutorial - ๐ค Discord Bot Basic (
discord_bot_basic.convo) - Simple bot with commands - ๐ค Discord Bot Advanced (
discord_bot_advanced.convo) - Complex bot with games and moderation - ๐ฅ Discord Bot Modern (
discord_bot_modern.convo) - Modern slash commands example - ๐ Discord Slash Commands Guide (
discord_slash_commands_guide.convo) - Complete slash commands tutorial - ๐ฎ Discord Bot UI Complete (
discord_bot_ui_complete.convo) - Interactive buttons, modals, menus - ๐ Discord UI Complete Guide (
discord_ui_complete_guide.convo) - Comprehensive UI components tutorial - ๐ก๏ธ Discord Moderation Bot (
discord_moderation_bot.convo) - Full-featured moderation system
Try any example:
python main.py examples/game_demo.convo
python main.py examples/enhanced_demo.convo
python main.py examples/discord_setup_guide.convoLet name be "Alice"
Let age be 25
Let is_student be true
Let result be 5 + 3 * 2
Let comparison be age greater than 18
Define greet with name:
Say "Hello, " + name + "!"
Say "Nice to meet you!"
Call greet with "World"
If age greater than 18 then:
Say "You're an adult!"
Else:
Say "You're a minor"
While count less than 5 do:
Say "Count: " + count
Let count be count + 1
# Import modules to extend functionality
Import discord
# Now Discord functions are available
Call create_discord_bot with "YOUR_BOT_TOKEN", "!"
Call start_discord_bot
Define calculate_grade with score:
If score greater than 90 then:
Say "Grade: A"
Else:
If score greater than 80 then:
Say "Grade: B"
Else:
Say "Grade: C"
# Nested functions and complex logic
Define weather_system with temp, is_raining:
If temp greater than 25 and not is_raining then:
Say "Perfect weather!"
Else:
Say "Stay inside!"
Try:
Let result be risky_operation()
Say "Success: " + result
Catch error:
Say "Error occurred: " + error
convo/
โโโ lexer.py # Tokenizes Convo source code
โโโ parser.py # Parses tokens into AST
โโโ interpreter.py # Executes the parsed code
โโโ ast_nodes.py # Abstract Syntax Tree definitions
โโโ builtins.py # Built-in functions and constants
โโโ __main__.py # Entry point for the interpreter
examples/ # Example Convo programs
tests/ # Comprehensive test suite (104 tests)
main.py # Command-line interface
python -m pytest tests/ -v- Run Convo Program: Execute any
.convofile - Run Convo Interactive: Start the REPL
- Run Tests: Execute the test suite
- Add tokens to
lexer.py - Update parser rules in
parser.py - Add AST nodes in
ast_nodes.py - Implement execution in
interpreter.py - Write tests in
tests/ - Add new libraries or modules using the import system
Convo is a real programming language - when you write Discord bots in Convo, you're writing in pure Convo syntax, not Python! The Convo interpreter handles all the Python complexity internally.
- You write: Natural Convo language (
Call create_discord_bot with "TOKEN") - You DON'T write: Complex Python (
@bot.command,async def,await ctx.send()) - Convo handles: All Discord API complexity, async/await, error handling
# Import Discord functionality
Import discord
# Create a Discord bot
Call create_discord_bot with "YOUR_BOT_TOKEN", "!"
# Modern slash commands (global - work in all servers)
Define ping_command with interaction:
Let user be get_interaction_user(interaction)
Return "๐ Pong! Hello " + user + "!"
Call create_global_slash_command with "ping", "Check if bot is alive", ping_command
Define info_command with interaction:
Let guild be get_interaction_guild(interaction)
Return "๐ค I'm a bot written in Convo running in " + guild + "!"
Call create_global_slash_command with "info", "Get bot info", info_command
# Server-specific slash command (replace with your guild ID)
Define admin_command with interaction:
Let user be get_interaction_user(interaction)
Return "๐ง Admin tools accessed by " + user
Call create_guild_slash_command with "admin", "Admin tools", admin_command, 123456789
# Sync commands with Discord
Call sync_global_commands
# Legacy message listener for backward compatibility
Define handle_hello with message:
Let username be get_user_name(message)
Return "Hello " + username + "! Try using /ping instead!"
Call listen_for_message with "contains \"hello\"", handle_hello
# Start the bot
Call start_discord_bot
Basic Functions:
create_discord_bot(token, prefix)- Create bot instancelisten_for_message(condition, handler)- Listen for specific messagesadd_discord_command(name, description, handler)- Add traditional prefix commandsstart_discord_bot()- Start the botget_user_name(message)- Get username from messageget_message_content(message)- Get message text
Modern Slash Commands:
create_global_slash_command(name, description, handler)- Global slash commands (all servers)create_guild_slash_command(name, description, handler, guild_id)- Server-specific commandscreate_slash_command(name, description, handler)- Create global slash command (legacy)sync_global_commands()- Sync global commands with Discordsync_guild_commands(guild_id)- Sync server-specific commandssync_discord_commands(guild_id?)- Sync commands (global or guild)
Interaction Helpers:
get_interaction_user(interaction)- Get user from slash commandget_interaction_guild(interaction)- Get server from slash commandget_interaction_channel(interaction)- Get channel from slash command
๐ฏ Interactive UI Components:
create_button(label, style, custom_id, emoji, disabled)- Interactive buttonscreate_select_menu(placeholder, options, custom_id, min_vals, max_vals)- Dropdown menuscreate_modal_input(label, placeholder, required, min_len, max_len, style)- Form inputscreate_modal(title, custom_id, inputs)- Modal dialogs (forms)create_view(timeout)- Component container with timeoutsend_message_with_components(channel, content, embed, view)- Send messages with UIcreate_embed_with_components(title, desc, color, buttons, menu)- Rich embeds with UIshow_modal(interaction, modal)- Display modal dialog
๐ฑ๏ธ Context Menus & Advanced:
create_context_menu_user(name)- Right-click user commandscreate_context_menu_message(name)- Right-click message commandscreate_autocomplete_choices(choices)- Static autocomplete optionscreate_dynamic_autocomplete(function)- Dynamic autocomplete options
Advanced Functions:
send_embed()- Rich embedded messagesadd_reaction()- React to messagessend_file()- File uploads/downloadsjoin_voice_channel()- Voice chat integrationplay_audio()- Music/audio playback
Error Handling & Utilities:
handle_discord_error()- Error managementvalidate_discord_config()- Configuration validationget_discord_help()- Built-in help systemdebug_discord_environment()- Debugging tools
- ๐ก๏ธ Moderation Bots - Auto-moderation, warnings, bans, raid protection with interactive appeals
- ๐ฎ Game Bots - Interactive games with buttons, trivia with select menus, RPG systems with modals
- ๐ง Utility Bots - Server management with UI forms, polls with buttons, reminders with interactive setup
- ๐ต Music Bots - Audio playback controls via buttons, playlist management with dropdowns
- ๐ Analytics Bots - Interactive dashboards with buttons, user surveys with modal forms
- ๐ผ Business Bots - Support ticket systems with modal forms, application processes with step-by-step UI
- ๐ Educational Bots - Interactive quizzes with buttons, learning paths with select menus, progress tracking
- Education - Teaching programming concepts with natural language
- Discord Bots - Create interactive Discord bots with conversational syntax
- Prototyping - Quick scripting with readable syntax
- Domain-Specific Languages - Building readable automation scripts
- Accessibility - Programming for users who prefer natural language
- Game Development - Simple game logic and interactive experiences
We welcome contributions! Please feel free to:
- ๐ Report bugs
- ๐ก Suggest new features
- ๐ง Submit pull requests
- ๐ Improve documentation
Apache License 2.0 - see LICENSE file for details.
If you enjoy Convo or want to support its development, you can buy me a coffee:
Made with โค๏ธ for accessible programming