Chi Programming Language
Chi is a modern, intuitive programming language inspired by Chichewa with seamless Python interoperability. It makes programming accessible using familiar Chichewa keywords while maintaining full programming capabilities.
Features
🌍 Chichewa-Inspired Syntax - Programming keywords in Chichewa
🐍 Python Interoperability - Seamless integration with Python ecosystem
🚀 Modern Language Features - Functions, exception handling, data structures
📚 Rich Examples - Comprehensive example library included
🔧 Multiple Interfaces - CLI, REPL, Python import, and web interface
🎯 Educational Focus - Perfect for learning programming concepts
Quick Start
Installation
pip install chi-lang
Your First Chi Program
Create a file hello.chi:
onetsa("Moni, dziko!") # Hello, world!
Run it:
chi run hello.chi
Usage
Command Line Interface
# Run a Chi program
chi run program.chi
# Interactive REPL
chi repl
# Execute Chi code directly
chi exec 'onetsa("Hello from command line!")'
# View example code
chi run --see hello_world
# Run built-in examples
chi run --example hello_world
chi run --list-examples
# Translate between Chi and Python
chi translate hello.chi --to python
chi translate hello.py --from python --to chi
Python Integration
# Import and run examples
from chi.examples import hello_world
hello_world.run()
# Access example source code
print(hello_world.content)
hello_world.show()
# List all examples
from chi import examples
examples.help()
# Execute Chi code from Python
from chi import run_code
run_code('onetsa("Hello from Python!")')
Interactive REPL
$ chi repl
Chi Programming Language REPL 1.0.0
Author: Duncan Masiye
Type 'exit()', 'quit()', 'help()' or press Ctrl+C to quit.
Commands: 'examples()', 'clear()', 'version()'
chi> ika name = "Chi"
chi> onetsa("Welcome to", name)
Welcome to Chi
chi> help()
Language Syntax
Variables and Data Types
# Variables (ika = "put/place")
ika name = "Jakesh"
ika age = 25
ika height = 5.8
ika is_student = zoona # true
ika empty = palibe # null
# Lists
ika fruits = ndandanda("apple", "banana", "orange")
# Dictionaries
ika person = kaundula("name", "Alice", "age", 20)
Control Flow
# If statements (ngati = "if", sizoona = "else")
ngati age wafananitsa 18:
onetsa("Adult")
sizoona:
onetsa("Minor")
# Loops (yesani = "while", bwereza = "for")
ika i = 0
yesani i wachepetsedwa 5:
onetsa("Count:", i)
ika i = i + 1
bwereza fruit mu fruits:
onetsa("Fruit:", fruit)
Functions
# Function definition (panga = "make/create")
panga greet(name):
onetsa("Moni", name + "!")
bweza "Hello " + name
# Function call
ika greeting = greet("World")
Built-in Functions
# I/O Functions
onetsa("Output") # Print
ika input = funsani("Enter text: ") # Input
# Type Functions
ika type = mtundu(42) # Get type
ika length = kukula("text") # Get length
# Math Functions
ika power = mphamvu(2, 3) # 2^3 = 8
ika root = muzu(16) # Square root = 4
ika sum = phatikiza(1, 2, 3, 4) # Sum = 10
Examples
Chi comes with comprehensive examples covering all language features:
Basic Examples
hello_world- Simple hello worldsimple_data_types- Variable types and declarationssimple_math- Mathematical operationsoperators_demo- All operators (arithmetic, comparison, logical)
Data Structures
simple_lists- List operationsdictionary_operations_demo- Dictionary methodsstring_methods_demo- String manipulation
Advanced Features
control_structures_demo- If/else, loops, control flowfunctions_demo- Function definition and usageexception_handling_demo- Try/catch error handlingfile_operations_demo- File I/O operations
Real-World Applications
real_world_app_demo- Student grade management system
Run any example:
chi run --example control_structures_demo
chi run --see functions_demo # View source code
Development
Local Development
# Clone repository (will be available soon)
# git clone https://github.com/chi-lang/chi.git
# cd chi
# For now, install from source or pip
pip install chi-lang
# Install in development mode (if you have source)
pip install -e .
# Format code (optional)
black chi/
Contributing
We welcome contributions! Please contact us at duncanmasiye16@gmail.com to get involved.
- Email your interest and ideas
- We'll help you get started
- GitHub repository coming soon for collaborative development
- Documentation and contribution guidelines will be available online
Language Reference
Keywords
ika- Variable assignmentonetsa()- Print/output functionngati/sizoona- If/else statementsyesani- While loopsbwereza/mu- For loopspanga/bweza- Function definition/returnkuyesera/zakanika- Try/except
Operators
- Arithmetic:
+,-,*,/,**,% - Comparison:
wafanana(==),wasiyana(!=),wapambana(>), etc. - Logical:
komanso(AND),kapena(OR),osati(NOT)
Data Types
mawu- Stringsmanambala- Float numbersmanambala_olekeza- Integer numbersyankho- Booleans (zoona/zabodza)ndandanda- Listskaundula- Dictionariespalibe- Null values
License
MIT License - see LICENSE file for details.
Author
Duncan Masiye - duncanmasiye16@gmail.com
Support & Contact
- 📧 Email: duncanmasiye16@gmail.com
- 🐛 Bug Reports: Please email with detailed description
- 💡 Feature Requests: Email your suggestions
- 📚 Documentation: Coming soon - check back for updates
- 🌐 Online Resources: GitHub repository and documentation will be available soon
Chi Programming Language - Making programming accessible in Chichewa!
Metadata
Release files for chi-lang 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| chi_lang-1.0.0.tar.gz | 128.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chi_lang-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 299.3 kB
Release files / chi_lang-1.0.0.tar.gz
| Download URL | chi_lang-1.0.0.tar.gz |
|---|---|
| Size | 128.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a8410c0e60fdcbe98cbb846caa7b824db602ba8162df1ad276be2dd1601a747
|
|
BLAKE2b-256 checksum How to use checksums |
a354d426be5ac8a3f44dfbcae985e9159319d62e0f24e5ea48d0cfccbd6b1c35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / chi_lang-1.0.0-py3-none-any.whl
| Download URL | chi_lang-1.0.0-py3-none-any.whl |
|---|---|
| Size | 171.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2abe56ac7dacc60e82df7ad3465edbd875860ac54fb35007c72486b983a319c0
|
|
BLAKE2b-256 checksum How to use checksums |
a2975326669a2747bf43785adec49ddad3efa8811d1d17e5f901cb536db2f7cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|