Skip to main content

Tharun++(Tharunpp) is a programming language based on the famous comedy dialogues of Tamil cinema industry.

Project description

Tharunpp

A programming language powered by Tamil cinema comedy dialogues.

Badges

PyPI version Python versions MIT License CI Status

Installation

pip install tharunpp

Usage

# Run a Tharun++ program
tharunpp run-file program.tpp

# Start interactive shell
tharunpp shell

# Tokenize and show parse tree
tharunpp tokenize program.tpp

# Show version
tharunpp version

Program Structure

Every Tharun++ program must begin with VANAKKAM DA MAPLA and end with NANDRI VANNAKAM.

Hello World Example:

VANAKKAM DA MAPLA

SOLLU "Hello, World!" ;

NANDRI VANNAKAM

Full Keyword Reference

Purpose Keyword Example
Program Structure
Program start VANAKKAM DA MAPLA VANAKKAM DA MAPLA
Program end NANDRI VANNAKAM NANDRI VANNAKAM
Variables
Declare variable VAA VAA x = 10 ;
Output
Print output SOLLU SOLLU "Hello" ;
Debug output KALAAI KALAAI x ;
Warning output IRUNGH BHAII IRUNGH BHAII "Warning" ;
Boolean Values
True SARI VAA flag = SARI ;
False THAPPU VAA flag = THAPPU ;
Null ONNUMEY ILLA VAA x = ONNUMEY ILLA ;
Logical Operators
AND MATUM ADHAVUDHU x > 5 MATUM y < 10:
OR ILLA ADHAVUDHU x == 0 ILLA y == 0:
NOT VENDAM ADHAVUDHU VENDAM flag:
Control Flow
If condition ADHAVUDHU ADHAVUDHU x > 5:
Else if ILLA ADHAVUDHU ILLA ADHAVUDHU x > 0:
Else ILLAATI ILLAATI:
Block end DA DA
While loop TICKTOCK TICKTOCK TICKTOCK TICKTOCK x < 10:
For loop start FIRST_LA FIRST_LA i IRUNDHU 1 VARAI 5:
For range start IRUNDHU (see above)
For range end VARAI (see above)
Break EZHUNDHIRI EZHUNDHIRI ;
Continue ADUTHADUTHU ADUTHADUTHU ;
Functions
Declare function ENDRA SHANMUGHAM ENDRA SHANMUGHAM greet:
Call function VAA MA MINNAL VAA MA MINNAL greet() ;
Function end VELI JOWW VELI JOWW
Return INDHAA LEY PATHUKO INDHAA LEY PATHUKO 42 ;
Lambda VINVELI NAYAGAN (future feature)
Error Handling
Try block PAAKALAM PAAKALAM:
Catch block PUDRA IVANA PUDRA IVANA err:
Throw error AIYAYO AIYAYO "Error!" ;
Assert NIL GAVANI SEL NIL GAVANI SEL x > 0 ;
Lists
Create list PATTI POTTU VAA nums = PATTI POTTU [1, 2, 3] ;
Append to list ULLAYE POD ULLAYE POD nums 4 ;
Get from list EDUTHU KO VAA x = EDUTHU KO nums [0] ;
List length YEVLO IRUKU SOLLU YEVLO IRUKU nums ;
Other
Pass/No-op THALA_OK THALA_OK ;
Import MASS MASS "module" ;
Comment COMMENT PANDRAN COMMENT PANDRAN This is a comment

Code Examples

1. Hello World

VANAKKAM DA MAPLA

SOLLU "Vanakkam da! Welcome to Tharun++" ;

NANDRI VANNAKAM

2. Variables and Arithmetic

VANAKKAM DA MAPLA

VAA x = 10 ;
VAA y = 20 ;
VAA sum = x + y ;
VAA diff = y - x ;
VAA product = x * y ;
VAA quotient = y / x ;

SOLLU "Sum:", sum ;
SOLLU "Difference:", diff ;
SOLLU "Product:", product ;
SOLLU "Quotient:", quotient ;

NANDRI VANNAKAM

3. If / Else If / Else

VANAKKAM DA MAPLA

VAA score = 85 ;

ADHAVUDHU score >= 90:
    SOLLU "Grade: A" ;
ILLA ADHAVUDHU score >= 80:
    SOLLU "Grade: B" ;
ILLA ADHAVUDHU score >= 70:
    SOLLU "Grade: C" ;
ILLAATI:
    SOLLU "Grade: F" ;
DA

NANDRI VANNAKAM

4. Functions with Return

VANAKKAM DA MAPLA

ENDRA SHANMUGHAM calculate_area:
    VAA length = 10 ;
    VAA width = 5 ;
    VAA area = length * width ;
    INDHAA LEY PATHUKO area ;
VELI JOWW

VAA result = VAA MA MINNAL calculate_area() ;
SOLLU "Area is:", result ;

NANDRI VANNAKAM

5. Error Handling with Try/Catch

VANAKKAM DA MAPLA

PAAKALAM:
    SOLLU "Attempting division..." ;
    VAA x = 10 ;
    VAA y = 0 ;
    ADHAVUDHU y == 0:
        AIYAYO "Cannot divide by zero!" ;
    DA
    VAA result = x / y ;
PUDRA IVANA err:
    SOLLU "Caught error:", err ;
DA

SOLLU "Program continues..." ;

NANDRI VANNAKAM

Error Messages

Tharun++ provides clear error messages for common issues:

TharunppTypeError

Expected list, got int

Raised when a value of the wrong type is used (e.g., trying to append to a non-list).

TharunppNameError

Variable 'x' is not defined

Raised when accessing a variable that hasn't been declared.

TharunppZeroDivisionError

Cannot divide by zero

Raised when attempting division by zero.

TharunppSyntaxError

Unexpected token at line 5

Raised when the code has invalid syntax.

License

MIT License - see LICENSE file for details.

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

tharunpp-1.0.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

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

tharunpp-1.0.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file tharunpp-1.0.0.tar.gz.

File metadata

  • Download URL: tharunpp-1.0.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for tharunpp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 18f69beba3ec04ed15c3bf444bccd0b0215158604298f5e94abadb2dcf93e1d9
MD5 7bf2551bfed0238c4f8d99de6d31ef38
BLAKE2b-256 36f3a296b89bd607565e76efc4b91e67a9b7ed38c274a533d88671a5b47ecf74

See more details on using hashes here.

File details

Details for the file tharunpp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tharunpp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for tharunpp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef5b3a8cfe4173d528ff3d98828f66f57be3cb13c1adaa043d10bc99f74bd13f
MD5 190d96ea14211019826581ae8b7d003b
BLAKE2b-256 9c226b4b19ac250f53806fa9b3b830dbe99638bcddb1a0d0eac37037e3f041d2

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