Ezhil | |
Paradigm: | interpreted, imperative, structured |
Year: | 2007 |
Designer: | Muthiah Annamalai [1] at Google scholar |
Developer: | Independent/Freelance |
Latest Release Version: | version 0.99[2] [3] |
Latest Test Version: | version 10rc0 |
Typing: | strong, dynamic |
Implementations: | Ezhil-Lang |
Influenced By: | Logo, BASIC, Python |
License: | GPLv3 |
File Ext: | .n |
Ezhil, in Tamil language script (in Tamil pronounced as /eɻil̪/), is a compact, open source, interpreted, programming language, originally designed to enable native-Tamil speaking students, K-12 age-group to learn computer programming, and enable learning numeracy and computing, outside of linguistic expertise in predominately English language-based computer systems.
In the Ezhil programming language, Tamil keywords and language-grammar are chosen to easily enable the native Tamil speaker write programs in the Ezhil system. Ezhil allows easy representation of computer program closer to the Tamil language logical constructs equivalent to the conditional, branch and loop statements in modern English based programming languages. Ezhil is the first freely available programming language in the Tamil language and one of many known non-English-based programming languages. The language was officially announced in July 2009, while it has been developed since late 2007.
The syntax of Ezhil is broadly similar to that of BASIC: blocks of code are run in sequential order, or via functions definitions, in a common control flow structures include [[while loop|while]]
, and [[conditional (programming)|if]]
. The termination of function block and statement blocks should have the termination keyword, similar to END in BASIC. Declarations are not necessary as Ezhil is a dynamic typed language, though type conversions must be made explicitly. Ezhil has built-in types for Numbers, Strings, Logicals and Lists.
Conditional Statements are modeled after the IF-ELSEIF-ELSE statement . Loop control statements deriving from the WHILE statements are chosen. The function declaration syntax is kept simple. Details include the print statement, and the flow control statements below.
Ezhil has four basic types, for Numbers, Strings, Logicals and Lists. It does not allow creation of new types, being a procedural language without structures or objects.
Standard language grammar for control structures for Ezhil language is given below,
Standard logical operators, equality "
'
Ezhil supports only call-by-value, and copies all data structures on function invocations. Globals are not supported. Recursion is supported and functions invocation copies variables.
Current Ezhil implementation[4] is tightly integrated with the Python runtime. Ezhil interpreter is based on a readline-like CLI, while it can also be run in a batch mode. The interactive mode consumes programs as UTF-8 encoded text and builds a tree, using a compiler front-end, to build an AST, and executes it using the Python objects build from this AST.
The following is a Hello world program in Ezhil:
பதிப்பி "வணக்கம் Vijay!"பதிப்பி "உலகே வணக்கம்"பதிப்பி "******* நன்றி!. *******"exit
The following is a guessing game with 10-chances to guess a number between [1-100].
seed(1729 + 500*random)எண் = randint(1,100)
வாய்ப்பு = 0
@(வாய்ப்பு < 10) வரை பதிப்பி "நான் என் இதயத்தில் எண் [1-100] ஒன்று நினைக்கிறேன்" பதிப்பி "நான் என்ன நினைக்கிறேன் என்று தெரியுமா?" guess = உள்ளீடு ("Guess/யூகிக்க >>") வாய்ப்பு = வாய்ப்பு + 1 #பதிப்பி (எண்
guess) ஆனால் பதிப்பி "வாழ்த்துக்கள்! சரியான பதில்" exit(0) முடி
@(எண் < guess) ஆனால் பதிப்பி "உங்கள் உள்ளீடு அதிகமாக உள்ளது" இல்லை பதிப்பி "உங்கள் உள்ளீடு குறைத்து உள்ளது" முடி
பதிப்பி "இன்னும் " பதிப்பி (10 - வாய்ப்பு) பதிப்பி "வாய்ப்புக்குள் மீதமுள்ளன முடி"முடி
பதிப்பி "மன்னிக்கவும் : 10 வாய்ப்பு முடிக்க முடியவில்லை!"exit(-1)
fp = கோப்பை_திற("names.txt","w")
எ = ["இந்த","ஒரு","எழில்","தமிழ்","நிரலாக்க","மொழி","உதாரணம்"]இ = 0@(இ < len(எ)) வரை # நாம் ஒவ்வொரு வரியும் ஒரு எண் மற்றும் வார்த்தை சேர்க்க முடியும் வரி = str(இ) +" = "+ எடு(எ, இ) + " \n" பதிப்பி வரி கோப்பை_எழுது(fp,வரி) இ = இ + 1முடி
கோப்பை_மூடு(fp)
fp = கோப்பை_திற("names.txt")
வரிகள் = கோப்பை_படி(fp)
பதிப்பி வரிகள்
கோப்பை_மூடு(fp)
The following is a Turtle graphics based example to draw the Yin-Yang symbols.
நிரல்பாகம் main #turtle_reset yin(200, "white", "black") yin(200, "black", "white") turtle_ht pause("Done! Hit enter to quit", 5)முடி
main