SlideShare a Scribd company logo
1 of 9
Download to read offline
Exploring Programming Paradigms
Through Educational Programming
Languages Development
Designed and Developed by
Computer Science BSc
Saturday, May 11, 13
Aims and objectives
Aim
To develop a suite of experimental programming
languages to support language courses
Objectives
Implement several languages to illustrate different
programming paradigms: Imperative, Procedure,
OOP, Functional, Prototype
Implement languages in different techniques to
demonstrate principles and implementations of
compiler/interpreter which including: parsing
techniques, semantic translation, code generation
and HLLVM.
Saturday, May 11, 13
Products
Nya - A multi-paradigm script language
Sukimoe - A tiny Scheme interpreter
Ghostree - A high level language
virtual machine
class Nya {}
hello = Nya.new;
hello[“say”]= (name){print “Hello:”; print name;};
hello.say;
(define hello (lambda n (print n)))
(hello “Hello World!”)
/
/  / |
/ /  / |
/ / /  |
/ /  / |
/ / /  |
/ /  |
/ / /  /  |
/ / /   / /   /  |
/ / /  |
/ / / 
| / / /  / /    |
/ /  /  | / / /  / 
 / |'
*
*
*
*
*
*
*
*
Saturday, May 11, 13
Nya
Procedure
Similar to natural languages
OOP
Class inheritance
Polymorphism
Class reopen
i.will go unless it.rains;
class Animal{
def cry{
print “Animal cry”;
}
}
Class Dog << Animal{
print cry{
print “woof“;
}
}
Class Cat << Animal{}
Class Bird << Animal{}
dog = Dog.new
cat = Cat.new
Bird = Bird.new
#Polymorphism
dog.cry # ”woof”
cat.cry # “Animal cry”
bird.cry # “Animal cry”
#Class reopen
Class Cat {
print cry{
print “mew“;
}
}
cat.cry # “mew”
Saturday, May 11, 13
Nya
Prototype
Slots accessing
Message dispatching
Lambda expression
Closure
DO NOT support lazy evaluation
def gen_hello(name){
return (n){print “hello: ”;print name};
}
hello = gen_hello(“Nyaruko”);
hello(); #”hello nNyaruko”
bird[“@cry”] = “twitter”;
bird[“cry”] = {print @cry};
bird.cry(); # “twitter”
bird.dummy(); # Run time error
Saturday, May 11, 13
Nya -Implementation
Front end
CFG(LALR(1)) VS PEG
Static parsing VS Dynamic parsing
Back end
Syntax directed translation
Top down interpreting
Program
Expressions Expression
Literal CallAssign
......
Saturday, May 11, 13
Sukimoe
Language features
Partial evaluation(Currying)
Lazy evaluation
Implementation
PEG
List-lisp style translation
(define add (lambda x (lambda y (+
x y))))
(define add4 (add 4))
(print (add4 1)) ;;;5
(print (add4 1))
;;;(print add 4 1)
;;;(print lambda 4( +1 y))
;;;(print + 4 1)
Saturday, May 11, 13
Ghostree
Stack based VM
Fancy assembler
Complete Compiler
/
/ |
/ | /
/ | / /
/ | /' /
/ / | /
/ | / /
/  /  | /
/ | /' /
/ | / /
/  / | / /
/  / | / /
/ | / /
/ | /' /  `| / /
/ | / + / / /| /
/ | / / / /  ^ /
/ | / / / / / /'
**
**
**
**
**
**
**
**
**
ruby ghostree.rb fib.gt
1st:1
2nd:2
size:10
1 2 3 5 8 13 21 34 55
Source
code
2/3+10*2
Assembler Byte code
/ /  / / 
| push 10
push 2
multiply
...
20
Interpreting
Saturday, May 11, 13
Conclusion and Future
worksConclusion
A suite of teaching purpose programming languages have been
produced. I believe they can make a decent programming language
course.
A lot about academic research and software development process
have been learned.
Improvements for Nya
Native compilation
Type inferencing
Runtime configurable grammar
Better error messaging
Saturday, May 11, 13

More Related Content

What's hot

Introduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem AnsariIntroduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem Ansari
Tech
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof language
nicky_walters
 

What's hot (20)

introduction to C programming (C)
introduction to C programming (C)introduction to C programming (C)
introduction to C programming (C)
 
An Overview of Programming C
An Overview of Programming CAn Overview of Programming C
An Overview of Programming C
 
Basic Computer Programming
Basic Computer ProgrammingBasic Computer Programming
Basic Computer Programming
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Introduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem AnsariIntroduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem Ansari
 
C PROGRAMMING
C PROGRAMMINGC PROGRAMMING
C PROGRAMMING
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
C++ language
C++ languageC++ language
C++ language
 
Cw1
Cw1Cw1
Cw1
 
C intro
C introC intro
C intro
 
The Basics of programming
The Basics of programmingThe Basics of programming
The Basics of programming
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof language
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overview
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Programming assignment-help at myassignmenthelp.net
Programming assignment-help at myassignmenthelp.netProgramming assignment-help at myassignmenthelp.net
Programming assignment-help at myassignmenthelp.net
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
A brief introduction to C Language
A brief introduction to C LanguageA brief introduction to C Language
A brief introduction to C Language
 
C Programming Language Step by Step Part 1
C Programming Language Step by Step Part 1C Programming Language Step by Step Part 1
C Programming Language Step by Step Part 1
 

Viewers also liked (14)

Parazitologie: febrele hemoragice
Parazitologie: febrele hemoragiceParazitologie: febrele hemoragice
Parazitologie: febrele hemoragice
 
Productos k tek 1
Productos k tek 1Productos k tek 1
Productos k tek 1
 
Children in media world natasa m. kejzar
Children in media world natasa m. kejzarChildren in media world natasa m. kejzar
Children in media world natasa m. kejzar
 
سیر تطور اندیشه های مدیریت
سیر تطور اندیشه های مدیریتسیر تطور اندیشه های مدیریت
سیر تطور اندیشه های مدیریت
 
Catalog autumn 2012
Catalog autumn 2012Catalog autumn 2012
Catalog autumn 2012
 
Keek web account
Keek web accountKeek web account
Keek web account
 
Poster feedback
Poster feedbackPoster feedback
Poster feedback
 
Magazine templates
Magazine templatesMagazine templates
Magazine templates
 
Keek view videos online
Keek view videos onlineKeek view videos online
Keek view videos online
 
Tcdb104 bong da cb 2
Tcdb104 bong da cb 2Tcdb104 bong da cb 2
Tcdb104 bong da cb 2
 
Finalanylisis
FinalanylisisFinalanylisis
Finalanylisis
 
Pro sourcing licitaciones - abril 2016
Pro sourcing   licitaciones - abril 2016Pro sourcing   licitaciones - abril 2016
Pro sourcing licitaciones - abril 2016
 
천로역정 2.소개
천로역정 2.소개천로역정 2.소개
천로역정 2.소개
 
Keek video filters
Keek video filtersKeek video filters
Keek video filters
 

Similar to 233

An introduction on language processing
An introduction on language processingAn introduction on language processing
An introduction on language processing
Ralf Laemmel
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific Languages
Eelco Visser
 

Similar to 233 (20)

An introduction on language processing
An introduction on language processingAn introduction on language processing
An introduction on language processing
 
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija SiskoTrivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
 
Programming
ProgrammingProgramming
Programming
 
Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
 
Introduction to perl_ a scripting language
Introduction to perl_ a scripting languageIntroduction to perl_ a scripting language
Introduction to perl_ a scripting language
 
Women Who Code Functional Programming - 9/26/2016
Women Who Code   Functional Programming - 9/26/2016Women Who Code   Functional Programming - 9/26/2016
Women Who Code Functional Programming - 9/26/2016
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
 
Perl 101
Perl 101Perl 101
Perl 101
 
Discover Dart - Meetup 15/02/2017
Discover Dart - Meetup 15/02/2017Discover Dart - Meetup 15/02/2017
Discover Dart - Meetup 15/02/2017
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 
Discover Dart(lang) - Meetup 07/12/2016
Discover Dart(lang) - Meetup 07/12/2016Discover Dart(lang) - Meetup 07/12/2016
Discover Dart(lang) - Meetup 07/12/2016
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific Languages
 
ppt7
ppt7ppt7
ppt7
 
ppt2
ppt2ppt2
ppt2
 
name name2 n
name name2 nname name2 n
name name2 n
 
name name2 n2
name name2 n2name name2 n2
name name2 n2
 
test ppt
test ppttest ppt
test ppt
 
name name2 n
name name2 nname name2 n
name name2 n
 
ppt21
ppt21ppt21
ppt21
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

233

  • 1. Exploring Programming Paradigms Through Educational Programming Languages Development Designed and Developed by Computer Science BSc Saturday, May 11, 13
  • 2. Aims and objectives Aim To develop a suite of experimental programming languages to support language courses Objectives Implement several languages to illustrate different programming paradigms: Imperative, Procedure, OOP, Functional, Prototype Implement languages in different techniques to demonstrate principles and implementations of compiler/interpreter which including: parsing techniques, semantic translation, code generation and HLLVM. Saturday, May 11, 13
  • 3. Products Nya - A multi-paradigm script language Sukimoe - A tiny Scheme interpreter Ghostree - A high level language virtual machine class Nya {} hello = Nya.new; hello[“say”]= (name){print “Hello:”; print name;}; hello.say; (define hello (lambda n (print n))) (hello “Hello World!”) / / / | / / / | / / / | / / / | / / / | / / | / / / / | / / / / / / | / / / | / / / | / / / / / | / / / | / / / / / |' * * * * * * * * Saturday, May 11, 13
  • 4. Nya Procedure Similar to natural languages OOP Class inheritance Polymorphism Class reopen i.will go unless it.rains; class Animal{ def cry{ print “Animal cry”; } } Class Dog << Animal{ print cry{ print “woof“; } } Class Cat << Animal{} Class Bird << Animal{} dog = Dog.new cat = Cat.new Bird = Bird.new #Polymorphism dog.cry # ”woof” cat.cry # “Animal cry” bird.cry # “Animal cry” #Class reopen Class Cat { print cry{ print “mew“; } } cat.cry # “mew” Saturday, May 11, 13
  • 5. Nya Prototype Slots accessing Message dispatching Lambda expression Closure DO NOT support lazy evaluation def gen_hello(name){ return (n){print “hello: ”;print name}; } hello = gen_hello(“Nyaruko”); hello(); #”hello nNyaruko” bird[“@cry”] = “twitter”; bird[“cry”] = {print @cry}; bird.cry(); # “twitter” bird.dummy(); # Run time error Saturday, May 11, 13
  • 6. Nya -Implementation Front end CFG(LALR(1)) VS PEG Static parsing VS Dynamic parsing Back end Syntax directed translation Top down interpreting Program Expressions Expression Literal CallAssign ...... Saturday, May 11, 13
  • 7. Sukimoe Language features Partial evaluation(Currying) Lazy evaluation Implementation PEG List-lisp style translation (define add (lambda x (lambda y (+ x y)))) (define add4 (add 4)) (print (add4 1)) ;;;5 (print (add4 1)) ;;;(print add 4 1) ;;;(print lambda 4( +1 y)) ;;;(print + 4 1) Saturday, May 11, 13
  • 8. Ghostree Stack based VM Fancy assembler Complete Compiler / / | / | / / | / / / | /' / / / | / / | / / / / | / / | /' / / | / / / / | / / / / | / / / | / / / | /' / `| / / / | / + / / /| / / | / / / / ^ / / | / / / / / /' ** ** ** ** ** ** ** ** ** ruby ghostree.rb fib.gt 1st:1 2nd:2 size:10 1 2 3 5 8 13 21 34 55 Source code 2/3+10*2 Assembler Byte code / / / / | push 10 push 2 multiply ... 20 Interpreting Saturday, May 11, 13
  • 9. Conclusion and Future worksConclusion A suite of teaching purpose programming languages have been produced. I believe they can make a decent programming language course. A lot about academic research and software development process have been learned. Improvements for Nya Native compilation Type inferencing Runtime configurable grammar Better error messaging Saturday, May 11, 13