Documente Academic
Documente Profesional
Documente Cultură
Abstract
This paper presents the design and implementation issues of a computer programming language U,
having the Urdu-like dialect in contrast to English-like dialect used by mostly available computer
programming languages. An account of basic data types supported by U like (integer),
(real/float) and (char) is presented. Arithmetic, relational, logical and bit-wise operators of U
are presented and there functionality is described. Selection statements of U and and
iterative statements such as and are described. The grammar of U language
and details of the built-in library functions provided by U is also presented.
1. INTRODUCTION
It is the age of Information Technology and the benefits from the Information Technology
(IT) revolution cannot be reaped unless masses use it, which is not possible unless computing is
possible in a language that is understood by the masses[4]. Major spoken languages of Pakistan are:
Punjabi, Sariaki, Sindhi, Pashto, Urdu, Balochi, Hindko and Brahui. Of these, only Urdu, Sindhi, and
Pashto have a standardized alphabet and for rest of the languages, there are a few written works
available. However, the alphabets of Pashto, Urdu and Sindhi, the three major languages of the
Pakistan, are fully represented in Unicode [3].
According to the Article 251(1) of the constitution: “The National Language of Pakistan is
Urdu and arrangements shall be made for its being used as official and other purposes within fifteen
years from the commencing day”. For the purpose the National Language Authority (NLA) was
constituted, which has proposed the standards for Urdu letters, Urdu Code Page and Urdu
Keyboards[7].
Most of the work under the umbrella of Urdu computing addresses the problems like
standardization and development of coding in Urdu [6][7], desktop publishing, Text-to-Speech
Systems, English-to-Urdu Translation Systems, etc. but no conceivable work can be found to
develop programming tools for Urdu which can be used to create other applications[3].
The U programming language has been developed to provide a programming tool in Urdu,
keeping in mind that Urdu is the National Language of the Pakistan and the most of the population
can read and write in Urdu and that the Nations like Japan, China, Turkey, etc. are providing the
education in their native languages.
In order to incorporate the user defined data types, the keyword has been provided.
For example, the following program fragment declares a structure and depicts its usage:
>=! -
A @=! - 2 ?"
A C0 - BA= 7 / , ,)
D
A FG E @=! - C0 -
A: H = 7 / C0 - E = 7 / C0 -
D
2.2 Assignment and Arithmetic Operators
The U supports various types of arithmetic, and assignment operators which are shown in the
table-3.
Table 3: Table Showing Various Operators Supported By U
Op. Example Meanings
+ Adds and
- Subtracts from
* Multiplies I and
/ Divides by
- Negates
% ! Gives the remainder when ! is divided by
= " Assigns value of to
" #" Add 2 to
=- " Subtracts from
" #" Multiply by 2
" " Divides by i.e is equivalent to "
"J "J Calculates I J K and stores back result in K
++ Increment by 1 and use it
Use old value of and then increment it by 1
Decrement by 1 and use it
-- Use old value of and then decrement it by 1
2.4 Arrays
U also supports arrays and the following program fragment declares a one dimensional array
of integers and initializes its elements to 0:
D
APFGO NI 2 ?"
D
SIHHAFGRIAGEIQ
AGEPIO
Similarly, the following program fragment declares three matrices , and and then
calculates the product of matrices and and stores the resultant product into matrix :
A NPTOPTOINPTOPTOKNPTOPTO , ,)
AUNVNW 2 ?"
D
D
>SWHHATRWAGEWQ
AG E
SVHH ATRVAGEVQ
SUHH AT RUAGEUQ
APVOPUOKXPUOPWO EH
BA E PVOPWOI
D
2.5 Control Statements
U provides control statements like to complement C’s “if”, < @ in contrast to “if -
else” statement and < @ < @ in place of “if-else if- else” statement. The syntax of
various forms of is listed as under:
SYZ 1Q SYZ 1Q SYZ 1Q
U [ -[ U [ -[ U [ -[
< SYZ 1Q <
U [ -[< U [ -[ [<
SYZ 1Q <
U [ -[ [<
<
U [ -[<
for the C’s equivalent of “for” statement, and having the syntax:
S< A YZ 1 A< Q
U [ -[
for the pre-condition “while” loop having the syntax of the form:
SYZ 1Q
U [ -[
The statement @ is the post-condition loop that tests the condition at the end of the body
of the loop and having the syntax:
U [ -[
SYZ 1Q
2.7 Functions
Like other programming languages, U also provides built-in mathematical functions and also
allows programmers to define, their own functions. Table VI shows some of the built in functions
and the following program fragment declares two functions, one returning an integer value and the
other returning no value and there usage in a the program:
SV 2 ?"Q] " 2 ?"
>
AVXV :;
B
S 4QV ^ ; 4
>
AS`Ub a5 -V ;`Q&?_
B
SQV ;
>
AFG E K 2 ?"
ASKQ] " E I
D
ASQV ^ ;
D
Table 6: Some Mathematical Functions of U
(sin) (cos) c (tan) c SdefQ + SghdQ + SdeghdQ
i (asin) i (acos) ci (atan) ci SdefQ +i SghdQ +i SdeghdQ
i (sinh) i (cosh) i c (tanh) i c SdefQ i + SghdQ i + SdeghdQ
j (sqrt) _ (log) &+ (exp) k a" (abs)
To provide the editing facilities in Urdu, an editor namely UrduPad has also been developed.
An integrated environment for U is also under development. Further, the U has been designed in
AG E t 7 /
ASu 1 n s. & Q E
A Ht 7/Et 7/
ASu 1 n s. & Q EH t 7 / sl ? &?_ & s$0 ; 3 W " Xb
bX
B
ASt 7 / ` E t 7 / 2q *q w "i " v `Q l?_
B
4. CONCLUSION
Like other programming languages, U can be used as a Urdu programming tool to develop
applications, an instructional tool to teach the concepts of computer programming to the masses who
do not know English but have the knowledge of Urdu reading and writing, and to the students of
lower classes where the medium of instruction is Urdu.
5. REFERENCES