SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
PANINI FOR IT PRO-S
Vasu Srinivasan
Samskrita Bharati
Audience
You are a software programmer
You write code in atleast one programming language
You may or may not have written a sort() method, named
after yourself
You know basics of programming concepts and theories
You may or may not be familiar with Samskritam, but
may or may not know at least one Indian language
You are interested in learning Samskritam
but neither found time, resources nor patience
you got bored of watching kolaveri for 87th time and found
time to watch this video
About
Software professional, working with computers since 8085
assembler
MS Computer Science, Russia
Twitter/Facebook: vasya10
Blogs:
vagartham.blogspot.com (samskritam)
vasya10.wordpress.com (technical)
Project: http://github.com/vasya10/samskritam-dsl
Samskrita Bharati USA volunteer since 2008
What to expect?
First, as a programmer, you should have a broader interest in programming theories,
instead of arguing about better languages or frameworks
Next, this presentation may kindle your latent interest in Samskritam, provide a
different perspective of programming, re-align your interests and/or increase your
scope of understanding languages in general
Above all, it may simply excite you for coming into contact with the thought process of
someone who lived 2500+ years ago.
PANINI
An aphoristic introduction
pANini – who, where, what, how?
He is not named after the Italian sandwich
The Italian sandwich is not named after him
Conclusion: He is neither a sandwich nor an
Italian
He fits into what we likely call a “grammarian”
A grammarian is very unlike a librarian
You go to a librarian and ask for a new book
You do not go to a grammarian and ask for a new “word”
pANini – who, where, what, how?
lived in gAndhAra (part of bhArata, but today’s Afghanistan)
lived around 500 BC
his other name is dAkShAyaNaH
was killed by a tiger
invented C before Dennis Ritchie did
All of the above are speculations and inferences from other materials rather than his own admission.
Some inferences are less accurate than others.
Some speculations are actually wild unscientific guesses in the name of South East Asian studies, headed by
people who pretend to know Samskritam.
pANini – who, where, what, how?
pANini created a work called aShTAdhyAyI (8-Chapters)
This presentations aims to gloss over what he did and how his ideas are
directly and indirectly applicable to modern programming theories
Serious aShTAdhyAyI and related studies could take a lifetime
Sometimes multiple lifetimes depending on your karma.
pANini – who, where, what, how?
How did he “write” aShTAdhyAyI ?
Was there a script by his time?
Did people just memorize everything that he wrote?
There is no correct answer to any of the above
We are focusing on what he did, rather than how he did it
The Script
Question
Why do you say “pANini” and not “Panini” ?
Answer
And that begins our journey into the fascinating world of
aShTAdhyAyI…
Pause and Think moment #1
Is Samskritam
difficult?
The world of phonetics – 1/3
In English, and in many western
languages, the script (roman or latin)
is tied to the language
You can hardly think of English
without the letters A,B,C etc.
English is not a phonetic language.
That is, script vs sound is always a
variant
In other words, the alphabets you
learn to pronounce is not necessarily
what you pronounce to learn the
words
The world of phonetics – 2/3
Samskritam, on the other hand, is based on phonemes
Script (lipi) is only a means of expressing the sounds in written form: eg. devanAgarI is very
popular script now
Few hundred years before, the granthA script was popular; in fact a lot of Samskritam works are
found in granthA, telugu, kannada, malayalam, tulu and several North Indian scripts, like shArada
and modi.
There are not enough alphabets in English to phonetically spell Samskritam
So scholars have come up schemes to map English alphabets cleverly to spell Samskritam words
Thus,
a = (short अ); A = (long आ) etc.
N = (ण)
पाणणनि: = pANiniH
The world of phonetics – 3/3
In Samskritam, any script is only a visual expression of the “predefined constant sound
form”
In English, the pronunciation has to be memorized for each and every word, for each
and every dialect and sometimes also based on a context
In Samskritam you have to learn only the sound forms
Once you learn a script, you can read any text ... …without any guess work
Is Samskritam difficult?
To answer this, we must first agree to define difficult
In terms of learning how to pronounce, majority of the English words are
case-by-case basis
(n-1) words of -tion are pronounced “-shun”.
bastion is not bashun, but bas-t-i-o-n
In Samskritam, you are productive about prounciation and reading from day 1
Not just you, it is easy to teach machines to pronounce words too
So, what did pANini do?
Say True or False
discovered and/or invented Samskritam
is the first Samskritam grammarian
is the only grammarian
did not know about Vedas
ashTAdhyAyI is the only book he wrote
divided Samskritam into classical Samskritam and Vedic
Samskritam
All are False
what pANini actually did…
described Samskritam as it was spoken in his times
defined rules that allows to generate and validate Samskritam words and
sentences
covers the classic as well as vedic Samskritam
was only a branch in a tree of Samskritam grammar tradition
mentions about 10 predecessor/contemporary grammarians in his work
a huge number of grammarians followed him, specifically classified as
“pANinIyAH” = “belonging to pANini school”
so much, that the elite say “apANinIyam na prayunjyete” (meaning, non-paninian
constructs are prohibhited)
Pause and Think moment #2
So Panini did this,
Panini did that,
whatever dude !
OK,
Great!
What was the
problem he was
trying to solve ?
The M’ dollar question
450 BCE, Greece
Archimedes, lying in his
bathtub, was pondering the
question
How to find the volume of an
irregularly shaped object?
The 10,00,000 dollar question
500 BCE (dates
arbitrary), takshashila
Maharshi pANini, lying in his
kusha grass, was pondering the
question
How to generate an infinite
number of sentences in a language
using a finite set of formal rules?
Panini’s work
aShTAdhyAyI (8 chaptered)
unparalleled in terms of covering a grammar of a language comprehensively in so few rules
(just 4000 rules)
left a legacy of grammarians from kAtyAyana (200 BCE) to nAgesha bhatta (1600 CE),
including some of the greatest minds – patanjali, bhartruhari, bhattoji dikshita and more.
academicians, scholars still pondering over understanding pANini’s work in completeness
laid the basics of modern western linguistics (India had a very mature and refined linguistics
field by the time bhartruhari itself ~ 600 CE)
influenced pretty much everything about classical Samskritam, including interpretation of
upanishads, vedas etc by various aachaaryaa-s
so much influence, that we only “hear” about other grammar works, much less studied
RULES AND SCHEMES
Panini’s rules and schemes
The Rules
If Panini wrote grammar for English
But
Cut
Gut
Hut
Nut
Rut
Rule: when u is followed by t, pronounce as a
except when preceded by p
Another example: i after e, except after c
Put
What about OUT? 
The Schemes - Introduction
In order to define a formal language, one has to define the “symbols” of the medium
In math, symbols like ∑,Ω, ∆, ∂, ∏ all mean something
In classical physics Ω means ohm, but in particle physics it is used for Omega baryons
In math, expressions like f(x), y(x), a2 mean something – no comprehendo scheme, no
comprehendo nothing!
𝑥 + 𝑎 𝑛 =
𝑛
𝑘
𝑥 𝑘 𝑎 𝑛−𝑘
𝑛
𝑘=0
Panini’s Schemes
A scheme, in Panini’s terms, is a set of algorithms applied to
transform a source entity to a desired target entity
Panini has several innovative schemes to his credit
the first and one of the most strikingly brilliant schemes – is
called mAheshvara sUtrANi
Pause and Think moment #3
How did you all
learn A,B,C?
How is A,B,C
arranged?
Scheme: mAheshvara sutrANi
IAST Devanāgarī
1. a i u ṇ
2. ṛ ḷ k
3. e o ṅ
4. ai au c
5. ha ya va ra ṭ
6. la ṇ
7. ña ma ṅa ṇa na ṃ
8. jha bha ñ
9. gha ḍha dha ṣ
10. ja ba ga ḍa da ś
11. kha pha cha ṭha tha ca ṭa ta v
12. ka pa y
13. śa ṣa sa ṛ
14. ha ḹ
१. अ इ उ ण् |
२. ऋ ऌ क् |
३. ए ओ ङ् |
४. ऐ औ च् |
५. ह य व र ट् |
६. ल ण् |
७. ञ म ङ ण ि म ् |
८. झ भ ञ् |
९. घ ढ ध ष् |
१०. ज ब ग ड द श ् |
११. ख फ छ ठ थ च ट त व् |
१२. क प य् |
१३. श ष स र् |
१४. ह ल ् |
mAhesvara sUtrANi: Non-inclusive upper-bound sets
The last letter of each line is called ‘it’ (इत्)
1. Cannot start a set with an (इत्) letter
2. Start from any letter from any line
3. You can stop only at an (इत्)
4. Skip all intermediate (इत्) letters
5. For the “value-set”, skip that (इत्) letter also
pANini’s 2 in-your-face rules for creating a set:
1. aadirantyena sahetA
2. tasya lopaH
Examples of NIUB sets
• अण् = अ इ उ ण्
• अक् = अ इ उ ऋ ऌ क्
• इक् = इ उ ऋ ऌ क्
• अच् = अ इ उ ऋ ऌ ए ओ ऐ औ च्
• हल ् = ह य व र ल ञ म ङ ण ि झ भ घ ढ ध ज ब ग ड द
ख फ छ च ट त क प श स (ह) ल्
• चय् = च ट त क प य्(the first vertical in क ख ग घ
scheme)
• These are called pratyAhAra
Scheme: Types of Aphorisms (sUtram)
Six types of sUtram
Definition (samjna)
Interpreting (paribhASha)
Rule (vidhiH)
Restriction (niyama)
Extension (atidesha)
Header (adhikAra)
There are other sub types, but this is the major classification
These 6+ types of sUtram-s cover a majority of the known concepts of
modern programming
Programming concepts and sUtram types
Type of sUtra Programming equivalent
Definition Define a function, variable or a value
#define, final static, const
Interpreting Meta rules, Annotations
(@Column, @Id in Hibernate)
DOCTYPE, <META> tags in html, MIME types (pdf, jpg etc.) in
contents
Rules if-then-else condition (or select-case)
If (this condition) then action1 else action2
Restriction Scoping (Restrict or narrow scope of other rules)
Natural numbers start from 1;
Odd numbers are those when divided by 2 yield 1 as remainder
Extension,
Casting
Applying one “concept” to something else
Like Scala traits, “apply a behaviour” to another class
Class casting (Like integer to double, integer to boolean etc.)
Header Constitute a topic
package, namespace
Negation Negation of given general rule in specific circumstances
Pause and Think moment #4
• What is a language?
• Set of sentences
• Sentence = Set of words
• Word = Set of letters
• Letter = A form of sound
• Sound = Vibration of air
molecules as perceived by ears
Scheme: Word Generation
Panini’s only formula for word generation
word = prefix0..n + root/stem + affix0..n + suffix
Scheme: Application of Affixes
Affixes is an innovative scheme used by pANini (very likely his predecessors
too)
Just like the modifiers in a programming language, but way more functional
and versatile
For eg, you have primitive types like int, double etc. but you modify its
characterstics with const, final, static, transient etc.
Affixes also have a similarity to Hungarian-notation syntax (iIndex, dPrice,
sText, dtToday); Here the prefix indicates the type of variable, while Panini-s
indicators indicate a specific function in a specific context
The Affix and the Marker
pANini defines a separate set of “it-s” (markers) for the affixes
scheme
Some examples of affix markers:
any consonant at the end of an affix
ञञ टु डु when in the beginning of an affix
च छ ज झ ञ ट ठ ड ढ ण
the letters ल श क ख ग घ ङ in non derivative compound related affixes
The marker’s functionality is to provide a modification indicator
and then disappear
The Panini Affix Markup Language
For IT pro-s, the marker functionality should have rung a striking similarity with
something they work everyday (HTML! and XML!)
In a markup-languge, the tags like body, head, title, etc. tell the browser what to do
with the content, but the tags themselves are not displayed by the browser
Similarly, the affix delivers a certain content enclosed in the “it” tags, indicates what to
do with the content, but those tags don’t serve any purpose thereafter, and disappear
Each affix also acts like a functional programming closure – it provides a specific
function based on the content
Examples of Affixes
As stand-alone words, affixes do not make any sense and feel arbitrary
But in Panini’s technical terms they are extremely well defined, purely
technical and fully functional
Each affix can find a parallel to one or more programming principle
Examples: क्त्वा ल्यप् नतङ् सुप् शतृि् शािच् णणच् घञ्
pANini defines over~500 with various functional characterstics
Scheme: Functional abstraction of affixes
Let us take some affixes: लुप ् आप ् छाप ् टाप ् डाप ् ल्यप ्
What is common in all of this? प ्
Lets write a simple script to get all the affixes with letter ‘p’
List affixes = [lup, aap, chaap, taap, daap, lyap, dak, tuk, shatrun … ]
p-affixes = affixes.collect { it.contains(‘p’) }
assert p_affixes = [lup, aap, chaap, taap, daap, lyap]
So how does Panini express this?
पित्(pit)
प ् इत् यस्य तत्
similarly ककत् ङङत् णणत् शशत् etc.
Scheme: Rules
Procedural programming
def ticketPrice = 50
if (age < 2) ticketPrice = 0
else if (age < 12) ticketPrice = ticketPrice / 2
Functional programming
get_ticket_price (function c, ticketPrice, discount) {
if (c.evalute() == true) return ticketPrice * discount
}
get_ticket_price((age < 2), ticketPrice, 0)
get_ticket_price((age < 12), ticketPrice, 0.5)
value = f(g(age), price, discount)
Scheme: Panini’s rules
For all the sandhi rules, Panini uses a general formula:
z = f(x,[y0 | y1]), where
z = 1st vibhakti
x = 6th vibhakti
y0 = 7th vibhakti
y1 = 3rd vibhakti
When y0 follows, x = z
When y1 follows or precedes, x = z
Scheme: Technical Terms
ashTAdhyAyI is full of “technical terms” like the affixes, defintions and rules, which in
normal Samskritam do not mean anything
For eg. the word “guNa” has several meanings in Samskritam: virtue, quality,
character, strings, efficiency, tendency, kind, times
But none of them are used here. In Panini’s world guNa means transformation of a to
a, i to e, u to o, r to ar. That’s it!
So Panini defines a set of technical terms exclusive for his own domain. Those who
know the domain, have the key.
Do you follow where I am getting at?
Panini created a DSL – Domain Specific Language
Scheme: Anuvrtti (“Borrow-over”)
• at beach
• people
• while lifeguards watching
• playing while on sand
• volleyball etc. are games
• also bands
• for the kids
• ice-cream etc. from shop
• not babies
• in summer only
Imagine a scenario at a beach:
Scheme: Anuvrtti
One word used only once, the following sUtram-s borrow from
the previous sUtram appropriately
Hmm, where have we heard this before?
Scheme: Anuvrtti (contd)
DRY !
Don’t Repeat Yourself !
Panini establishes himself as “Reuse Specialist” and “Supreme kanjoos
commander of the universe” !
What is considered a best programming practice in modern days is
implicit in Panini’s work end-to-end.
So much so that, Patanjali – another extra-ordinary genius says
There is not a single extra letter in ashtadhyayI, what to say about a whole sUtram?
Scheme: Casting
In OOP you have heard about casting one object to another
Double temperature = 25.20
Integer temp = (Integer) temperature
//now temp behaves like an integer object, not double
By casting, we transposed the properties of one object to another
Panini uses an affix “वत्” to do such transformations
लोटो शलङवत्means all affixes लोट् behave like शलङ् under certain
conditions
Summary
Affixes form the central part in Panini’s algorithmic approach to solving his
problems
More than 500 affixes and several of them are a parallel to modern
programming theories and principles
Functions of several affixes or approaches do not even find a parallel in
programming
For eg. the last 3 sections of aShTAdhyAyI contains rules in such a way that
“each rule thinks that it is the last rule”, so once applied, further rules wont
apply.
Well, obviously…
So it kinda looks like we are retrofitting modern theories back
into Panini’s approach and claim that all this was already done by
Panini. That does not sound fair!
Yes, we mapped only a few functions.
What if some of the techniques used by Panini could radically
change how we write programs? What if they could deliver
maximum benefit with minimum effort?
Research on Panini
Discovery of Panini and his successors’ works by Western academicians has
laid to the fundamentals of modern linguistics (Noam Chomsky etc)
It spawned many modern theories and institutions; In fact there are
proposals that Norman-Backus form must be renamed to Norman-Backus-
Panini form
Just search for Panini in academics or in your local University library, there are
all kinds of theories and thesis on ashTAdhyAyI and similar works
Entire books have been written focusing on just one pratyaya of Panini alone
Research on Panini has been happening ever since he did his work – and it is
still fresh!
धन्यवाद:
Thank you for your time !

Contenu connexe

Tendances

Must read if u r indian
Must read if u r indianMust read if u r indian
Must read if u r indian
q1w2e3r4t
 

Tendances (20)

The Vedas
The VedasThe Vedas
The Vedas
 
Ancient Indian sciene and technology
Ancient Indian sciene and technology Ancient Indian sciene and technology
Ancient Indian sciene and technology
 
Ancient Indian astronomical tradition: Characteristics and accomplishments
Ancient Indian astronomical tradition:  Characteristics and accomplishmentsAncient Indian astronomical tradition:  Characteristics and accomplishments
Ancient Indian astronomical tradition: Characteristics and accomplishments
 
Ramayana and its management lesson
Ramayana and its management lessonRamayana and its management lesson
Ramayana and its management lesson
 
Vedic Literature
Vedic LiteratureVedic Literature
Vedic Literature
 
Ancient scripts, their decipherment and palaeography of India, 29 January 2017
Ancient scripts, their decipherment and palaeography of India, 29 January 2017Ancient scripts, their decipherment and palaeography of India, 29 January 2017
Ancient scripts, their decipherment and palaeography of India, 29 January 2017
 
PAnchang
PAnchangPAnchang
PAnchang
 
Ppt sanskrit
Ppt sanskritPpt sanskrit
Ppt sanskrit
 
Tamil
TamilTamil
Tamil
 
INDIAN KNOWLEDGE SYSTEMS -Bharateeya Vijnana Parampara.pdf
INDIAN KNOWLEDGE SYSTEMS -Bharateeya Vijnana Parampara.pdfINDIAN KNOWLEDGE SYSTEMS -Bharateeya Vijnana Parampara.pdf
INDIAN KNOWLEDGE SYSTEMS -Bharateeya Vijnana Parampara.pdf
 
Ancient indian astronomy and mathematics
Ancient indian astronomy and mathematicsAncient indian astronomy and mathematics
Ancient indian astronomy and mathematics
 
Must read if u r indian
Must read if u r indianMust read if u r indian
Must read if u r indian
 
Evolution and History of Programming Languages - Software/Hardware/System
Evolution and History of Programming Languages - Software/Hardware/SystemEvolution and History of Programming Languages - Software/Hardware/System
Evolution and History of Programming Languages - Software/Hardware/System
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
 
Ramayana 2 AYODHYA KANDA Part-A .THE INNER MEANING
Ramayana 2  AYODHYA KANDA Part-A .THE INNER MEANINGRamayana 2  AYODHYA KANDA Part-A .THE INNER MEANING
Ramayana 2 AYODHYA KANDA Part-A .THE INNER MEANING
 
The vedas
The vedasThe vedas
The vedas
 
INDIA'S GIFT TO THE WORLD
INDIA'S GIFT TO THE WORLDINDIA'S GIFT TO THE WORLD
INDIA'S GIFT TO THE WORLD
 
The vedas
The vedasThe vedas
The vedas
 
Natural language processing and sanskrit
Natural language processing and sanskritNatural language processing and sanskrit
Natural language processing and sanskrit
 
Ramayana.ppt
Ramayana.pptRamayana.ppt
Ramayana.ppt
 

Similaire à Panini for IT professionals

Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing
Mustafa Jarrar
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
IJERD Editor
 
History Strategies for Active Learning
History Strategies for Active LearningHistory Strategies for Active Learning
History Strategies for Active Learning
EdTechTeacher.org
 
Professor Michael Hoey: The hidden similarities across languages - some good ...
Professor Michael Hoey: The hidden similarities across languages - some good ...Professor Michael Hoey: The hidden similarities across languages - some good ...
Professor Michael Hoey: The hidden similarities across languages - some good ...
eaquals
 
Multiple intelligences2011 12
Multiple intelligences2011 12Multiple intelligences2011 12
Multiple intelligences2011 12
Lama Albabtain
 
Syntax & Stylistics 2
Syntax & Stylistics 2Syntax & Stylistics 2
Syntax & Stylistics 2
Rick McKinnon
 

Similaire à Panini for IT professionals (20)

Maths magazine
Maths magazine Maths magazine
Maths magazine
 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
History Strategies for Active Learning
History Strategies for Active LearningHistory Strategies for Active Learning
History Strategies for Active Learning
 
RW_LESSON 2_THE WRITING PROCESS.pptx WITH GRAPHIC ORGANIZERS
RW_LESSON 2_THE WRITING PROCESS.pptx WITH GRAPHIC ORGANIZERSRW_LESSON 2_THE WRITING PROCESS.pptx WITH GRAPHIC ORGANIZERS
RW_LESSON 2_THE WRITING PROCESS.pptx WITH GRAPHIC ORGANIZERS
 
Parallelism Experiments & Results
Parallelism Experiments & Results Parallelism Experiments & Results
Parallelism Experiments & Results
 
Learning Sanskrit: The Easy and Practical Way - Workbook 1
Learning Sanskrit: The Easy and Practical Way -  Workbook 1Learning Sanskrit: The Easy and Practical Way -  Workbook 1
Learning Sanskrit: The Easy and Practical Way - Workbook 1
 
Professor Michael Hoey: The hidden similarities across languages - some good ...
Professor Michael Hoey: The hidden similarities across languages - some good ...Professor Michael Hoey: The hidden similarities across languages - some good ...
Professor Michael Hoey: The hidden similarities across languages - some good ...
 
Study skills
Study skillsStudy skills
Study skills
 
Note-Taking
Note-TakingNote-Taking
Note-Taking
 
Multiple intelligences2011 12
Multiple intelligences2011 12Multiple intelligences2011 12
Multiple intelligences2011 12
 
Syntax & Stylistics 2
Syntax & Stylistics 2Syntax & Stylistics 2
Syntax & Stylistics 2
 
Unidad Didáctica
Unidad DidácticaUnidad Didáctica
Unidad Didáctica
 
Study less , Gain more
Study less , Gain moreStudy less , Gain more
Study less , Gain more
 
Lecture Notes-Are Natural Languages Regular.pdf
Lecture Notes-Are Natural Languages Regular.pdfLecture Notes-Are Natural Languages Regular.pdf
Lecture Notes-Are Natural Languages Regular.pdf
 
Cognitive strategies
Cognitive strategiesCognitive strategies
Cognitive strategies
 
AMIS 2016 2, Music Math Coding
AMIS 2016 2, Music Math CodingAMIS 2016 2, Music Math Coding
AMIS 2016 2, Music Math Coding
 
Day 9 - Observation Assignment, Pathways Ch. 2, Word Stress Intro
Day 9 - Observation Assignment, Pathways Ch. 2, Word Stress IntroDay 9 - Observation Assignment, Pathways Ch. 2, Word Stress Intro
Day 9 - Observation Assignment, Pathways Ch. 2, Word Stress Intro
 
Genre_Discourse Study
Genre_Discourse StudyGenre_Discourse Study
Genre_Discourse Study
 
The Research Paper
The Research PaperThe Research Paper
The Research Paper
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Panini for IT professionals

  • 1. PANINI FOR IT PRO-S Vasu Srinivasan Samskrita Bharati
  • 2. Audience You are a software programmer You write code in atleast one programming language You may or may not have written a sort() method, named after yourself You know basics of programming concepts and theories You may or may not be familiar with Samskritam, but may or may not know at least one Indian language You are interested in learning Samskritam but neither found time, resources nor patience you got bored of watching kolaveri for 87th time and found time to watch this video
  • 3. About Software professional, working with computers since 8085 assembler MS Computer Science, Russia Twitter/Facebook: vasya10 Blogs: vagartham.blogspot.com (samskritam) vasya10.wordpress.com (technical) Project: http://github.com/vasya10/samskritam-dsl Samskrita Bharati USA volunteer since 2008
  • 4. What to expect? First, as a programmer, you should have a broader interest in programming theories, instead of arguing about better languages or frameworks Next, this presentation may kindle your latent interest in Samskritam, provide a different perspective of programming, re-align your interests and/or increase your scope of understanding languages in general Above all, it may simply excite you for coming into contact with the thought process of someone who lived 2500+ years ago.
  • 6. pANini – who, where, what, how? He is not named after the Italian sandwich The Italian sandwich is not named after him Conclusion: He is neither a sandwich nor an Italian He fits into what we likely call a “grammarian” A grammarian is very unlike a librarian You go to a librarian and ask for a new book You do not go to a grammarian and ask for a new “word”
  • 7. pANini – who, where, what, how? lived in gAndhAra (part of bhArata, but today’s Afghanistan) lived around 500 BC his other name is dAkShAyaNaH was killed by a tiger invented C before Dennis Ritchie did All of the above are speculations and inferences from other materials rather than his own admission. Some inferences are less accurate than others. Some speculations are actually wild unscientific guesses in the name of South East Asian studies, headed by people who pretend to know Samskritam.
  • 8. pANini – who, where, what, how? pANini created a work called aShTAdhyAyI (8-Chapters) This presentations aims to gloss over what he did and how his ideas are directly and indirectly applicable to modern programming theories Serious aShTAdhyAyI and related studies could take a lifetime Sometimes multiple lifetimes depending on your karma.
  • 9. pANini – who, where, what, how? How did he “write” aShTAdhyAyI ? Was there a script by his time? Did people just memorize everything that he wrote? There is no correct answer to any of the above We are focusing on what he did, rather than how he did it
  • 10. The Script Question Why do you say “pANini” and not “Panini” ? Answer And that begins our journey into the fascinating world of aShTAdhyAyI…
  • 11. Pause and Think moment #1 Is Samskritam difficult?
  • 12. The world of phonetics – 1/3 In English, and in many western languages, the script (roman or latin) is tied to the language You can hardly think of English without the letters A,B,C etc. English is not a phonetic language. That is, script vs sound is always a variant In other words, the alphabets you learn to pronounce is not necessarily what you pronounce to learn the words
  • 13. The world of phonetics – 2/3 Samskritam, on the other hand, is based on phonemes Script (lipi) is only a means of expressing the sounds in written form: eg. devanAgarI is very popular script now Few hundred years before, the granthA script was popular; in fact a lot of Samskritam works are found in granthA, telugu, kannada, malayalam, tulu and several North Indian scripts, like shArada and modi. There are not enough alphabets in English to phonetically spell Samskritam So scholars have come up schemes to map English alphabets cleverly to spell Samskritam words Thus, a = (short अ); A = (long आ) etc. N = (ण) पाणणनि: = pANiniH
  • 14. The world of phonetics – 3/3 In Samskritam, any script is only a visual expression of the “predefined constant sound form” In English, the pronunciation has to be memorized for each and every word, for each and every dialect and sometimes also based on a context In Samskritam you have to learn only the sound forms Once you learn a script, you can read any text ... …without any guess work
  • 15. Is Samskritam difficult? To answer this, we must first agree to define difficult In terms of learning how to pronounce, majority of the English words are case-by-case basis (n-1) words of -tion are pronounced “-shun”. bastion is not bashun, but bas-t-i-o-n In Samskritam, you are productive about prounciation and reading from day 1 Not just you, it is easy to teach machines to pronounce words too
  • 16. So, what did pANini do? Say True or False discovered and/or invented Samskritam is the first Samskritam grammarian is the only grammarian did not know about Vedas ashTAdhyAyI is the only book he wrote divided Samskritam into classical Samskritam and Vedic Samskritam All are False
  • 17. what pANini actually did… described Samskritam as it was spoken in his times defined rules that allows to generate and validate Samskritam words and sentences covers the classic as well as vedic Samskritam was only a branch in a tree of Samskritam grammar tradition mentions about 10 predecessor/contemporary grammarians in his work a huge number of grammarians followed him, specifically classified as “pANinIyAH” = “belonging to pANini school” so much, that the elite say “apANinIyam na prayunjyete” (meaning, non-paninian constructs are prohibhited)
  • 18. Pause and Think moment #2 So Panini did this, Panini did that, whatever dude ! OK, Great! What was the problem he was trying to solve ?
  • 19. The M’ dollar question 450 BCE, Greece Archimedes, lying in his bathtub, was pondering the question How to find the volume of an irregularly shaped object?
  • 20. The 10,00,000 dollar question 500 BCE (dates arbitrary), takshashila Maharshi pANini, lying in his kusha grass, was pondering the question How to generate an infinite number of sentences in a language using a finite set of formal rules?
  • 21. Panini’s work aShTAdhyAyI (8 chaptered) unparalleled in terms of covering a grammar of a language comprehensively in so few rules (just 4000 rules) left a legacy of grammarians from kAtyAyana (200 BCE) to nAgesha bhatta (1600 CE), including some of the greatest minds – patanjali, bhartruhari, bhattoji dikshita and more. academicians, scholars still pondering over understanding pANini’s work in completeness laid the basics of modern western linguistics (India had a very mature and refined linguistics field by the time bhartruhari itself ~ 600 CE) influenced pretty much everything about classical Samskritam, including interpretation of upanishads, vedas etc by various aachaaryaa-s so much influence, that we only “hear” about other grammar works, much less studied
  • 22. RULES AND SCHEMES Panini’s rules and schemes
  • 23. The Rules If Panini wrote grammar for English But Cut Gut Hut Nut Rut Rule: when u is followed by t, pronounce as a except when preceded by p Another example: i after e, except after c Put What about OUT? 
  • 24. The Schemes - Introduction In order to define a formal language, one has to define the “symbols” of the medium In math, symbols like ∑,Ω, ∆, ∂, ∏ all mean something In classical physics Ω means ohm, but in particle physics it is used for Omega baryons In math, expressions like f(x), y(x), a2 mean something – no comprehendo scheme, no comprehendo nothing! 𝑥 + 𝑎 𝑛 = 𝑛 𝑘 𝑥 𝑘 𝑎 𝑛−𝑘 𝑛 𝑘=0
  • 25. Panini’s Schemes A scheme, in Panini’s terms, is a set of algorithms applied to transform a source entity to a desired target entity Panini has several innovative schemes to his credit the first and one of the most strikingly brilliant schemes – is called mAheshvara sUtrANi
  • 26. Pause and Think moment #3 How did you all learn A,B,C? How is A,B,C arranged?
  • 27. Scheme: mAheshvara sutrANi IAST Devanāgarī 1. a i u ṇ 2. ṛ ḷ k 3. e o ṅ 4. ai au c 5. ha ya va ra ṭ 6. la ṇ 7. ña ma ṅa ṇa na ṃ 8. jha bha ñ 9. gha ḍha dha ṣ 10. ja ba ga ḍa da ś 11. kha pha cha ṭha tha ca ṭa ta v 12. ka pa y 13. śa ṣa sa ṛ 14. ha ḹ १. अ इ उ ण् | २. ऋ ऌ क् | ३. ए ओ ङ् | ४. ऐ औ च् | ५. ह य व र ट् | ६. ल ण् | ७. ञ म ङ ण ि म ् | ८. झ भ ञ् | ९. घ ढ ध ष् | १०. ज ब ग ड द श ् | ११. ख फ छ ठ थ च ट त व् | १२. क प य् | १३. श ष स र् | १४. ह ल ् |
  • 28. mAhesvara sUtrANi: Non-inclusive upper-bound sets The last letter of each line is called ‘it’ (इत्) 1. Cannot start a set with an (इत्) letter 2. Start from any letter from any line 3. You can stop only at an (इत्) 4. Skip all intermediate (इत्) letters 5. For the “value-set”, skip that (इत्) letter also pANini’s 2 in-your-face rules for creating a set: 1. aadirantyena sahetA 2. tasya lopaH
  • 29. Examples of NIUB sets • अण् = अ इ उ ण् • अक् = अ इ उ ऋ ऌ क् • इक् = इ उ ऋ ऌ क् • अच् = अ इ उ ऋ ऌ ए ओ ऐ औ च् • हल ् = ह य व र ल ञ म ङ ण ि झ भ घ ढ ध ज ब ग ड द ख फ छ च ट त क प श स (ह) ल् • चय् = च ट त क प य्(the first vertical in क ख ग घ scheme) • These are called pratyAhAra
  • 30. Scheme: Types of Aphorisms (sUtram) Six types of sUtram Definition (samjna) Interpreting (paribhASha) Rule (vidhiH) Restriction (niyama) Extension (atidesha) Header (adhikAra) There are other sub types, but this is the major classification These 6+ types of sUtram-s cover a majority of the known concepts of modern programming
  • 31. Programming concepts and sUtram types Type of sUtra Programming equivalent Definition Define a function, variable or a value #define, final static, const Interpreting Meta rules, Annotations (@Column, @Id in Hibernate) DOCTYPE, <META> tags in html, MIME types (pdf, jpg etc.) in contents Rules if-then-else condition (or select-case) If (this condition) then action1 else action2 Restriction Scoping (Restrict or narrow scope of other rules) Natural numbers start from 1; Odd numbers are those when divided by 2 yield 1 as remainder Extension, Casting Applying one “concept” to something else Like Scala traits, “apply a behaviour” to another class Class casting (Like integer to double, integer to boolean etc.) Header Constitute a topic package, namespace Negation Negation of given general rule in specific circumstances
  • 32. Pause and Think moment #4 • What is a language? • Set of sentences • Sentence = Set of words • Word = Set of letters • Letter = A form of sound • Sound = Vibration of air molecules as perceived by ears
  • 33. Scheme: Word Generation Panini’s only formula for word generation word = prefix0..n + root/stem + affix0..n + suffix
  • 34. Scheme: Application of Affixes Affixes is an innovative scheme used by pANini (very likely his predecessors too) Just like the modifiers in a programming language, but way more functional and versatile For eg, you have primitive types like int, double etc. but you modify its characterstics with const, final, static, transient etc. Affixes also have a similarity to Hungarian-notation syntax (iIndex, dPrice, sText, dtToday); Here the prefix indicates the type of variable, while Panini-s indicators indicate a specific function in a specific context
  • 35. The Affix and the Marker pANini defines a separate set of “it-s” (markers) for the affixes scheme Some examples of affix markers: any consonant at the end of an affix ञञ टु डु when in the beginning of an affix च छ ज झ ञ ट ठ ड ढ ण the letters ल श क ख ग घ ङ in non derivative compound related affixes The marker’s functionality is to provide a modification indicator and then disappear
  • 36. The Panini Affix Markup Language For IT pro-s, the marker functionality should have rung a striking similarity with something they work everyday (HTML! and XML!) In a markup-languge, the tags like body, head, title, etc. tell the browser what to do with the content, but the tags themselves are not displayed by the browser Similarly, the affix delivers a certain content enclosed in the “it” tags, indicates what to do with the content, but those tags don’t serve any purpose thereafter, and disappear Each affix also acts like a functional programming closure – it provides a specific function based on the content
  • 37. Examples of Affixes As stand-alone words, affixes do not make any sense and feel arbitrary But in Panini’s technical terms they are extremely well defined, purely technical and fully functional Each affix can find a parallel to one or more programming principle Examples: क्त्वा ल्यप् नतङ् सुप् शतृि् शािच् णणच् घञ् pANini defines over~500 with various functional characterstics
  • 38. Scheme: Functional abstraction of affixes Let us take some affixes: लुप ् आप ् छाप ् टाप ् डाप ् ल्यप ् What is common in all of this? प ् Lets write a simple script to get all the affixes with letter ‘p’ List affixes = [lup, aap, chaap, taap, daap, lyap, dak, tuk, shatrun … ] p-affixes = affixes.collect { it.contains(‘p’) } assert p_affixes = [lup, aap, chaap, taap, daap, lyap] So how does Panini express this? पित्(pit) प ् इत् यस्य तत् similarly ककत् ङङत् णणत् शशत् etc.
  • 39. Scheme: Rules Procedural programming def ticketPrice = 50 if (age < 2) ticketPrice = 0 else if (age < 12) ticketPrice = ticketPrice / 2 Functional programming get_ticket_price (function c, ticketPrice, discount) { if (c.evalute() == true) return ticketPrice * discount } get_ticket_price((age < 2), ticketPrice, 0) get_ticket_price((age < 12), ticketPrice, 0.5) value = f(g(age), price, discount)
  • 40. Scheme: Panini’s rules For all the sandhi rules, Panini uses a general formula: z = f(x,[y0 | y1]), where z = 1st vibhakti x = 6th vibhakti y0 = 7th vibhakti y1 = 3rd vibhakti When y0 follows, x = z When y1 follows or precedes, x = z
  • 41. Scheme: Technical Terms ashTAdhyAyI is full of “technical terms” like the affixes, defintions and rules, which in normal Samskritam do not mean anything For eg. the word “guNa” has several meanings in Samskritam: virtue, quality, character, strings, efficiency, tendency, kind, times But none of them are used here. In Panini’s world guNa means transformation of a to a, i to e, u to o, r to ar. That’s it! So Panini defines a set of technical terms exclusive for his own domain. Those who know the domain, have the key. Do you follow where I am getting at? Panini created a DSL – Domain Specific Language
  • 42. Scheme: Anuvrtti (“Borrow-over”) • at beach • people • while lifeguards watching • playing while on sand • volleyball etc. are games • also bands • for the kids • ice-cream etc. from shop • not babies • in summer only Imagine a scenario at a beach:
  • 43. Scheme: Anuvrtti One word used only once, the following sUtram-s borrow from the previous sUtram appropriately Hmm, where have we heard this before?
  • 44. Scheme: Anuvrtti (contd) DRY ! Don’t Repeat Yourself ! Panini establishes himself as “Reuse Specialist” and “Supreme kanjoos commander of the universe” ! What is considered a best programming practice in modern days is implicit in Panini’s work end-to-end. So much so that, Patanjali – another extra-ordinary genius says There is not a single extra letter in ashtadhyayI, what to say about a whole sUtram?
  • 45. Scheme: Casting In OOP you have heard about casting one object to another Double temperature = 25.20 Integer temp = (Integer) temperature //now temp behaves like an integer object, not double By casting, we transposed the properties of one object to another Panini uses an affix “वत्” to do such transformations लोटो शलङवत्means all affixes लोट् behave like शलङ् under certain conditions
  • 46. Summary Affixes form the central part in Panini’s algorithmic approach to solving his problems More than 500 affixes and several of them are a parallel to modern programming theories and principles Functions of several affixes or approaches do not even find a parallel in programming For eg. the last 3 sections of aShTAdhyAyI contains rules in such a way that “each rule thinks that it is the last rule”, so once applied, further rules wont apply.
  • 47. Well, obviously… So it kinda looks like we are retrofitting modern theories back into Panini’s approach and claim that all this was already done by Panini. That does not sound fair! Yes, we mapped only a few functions. What if some of the techniques used by Panini could radically change how we write programs? What if they could deliver maximum benefit with minimum effort?
  • 48. Research on Panini Discovery of Panini and his successors’ works by Western academicians has laid to the fundamentals of modern linguistics (Noam Chomsky etc) It spawned many modern theories and institutions; In fact there are proposals that Norman-Backus form must be renamed to Norman-Backus- Panini form Just search for Panini in academics or in your local University library, there are all kinds of theories and thesis on ashTAdhyAyI and similar works Entire books have been written focusing on just one pratyaya of Panini alone Research on Panini has been happening ever since he did his work – and it is still fresh!