SlideShare une entreprise Scribd logo
1  sur  5
Télécharger pour lire hors ligne
DOPPL
Data Oriented Parallel Programming Language

Development Diary
Iteration #7

Covered Concepts:
Standard Input and Output, once Access Modifier

Diego PERINI
Department of Computer Engineering
Istanbul Technical University, Turkey
2013-08-20

1
Abstract
This paper stands for Doppl language development iteration #7. In this paper, standard input and
output bindings and will be introduced. Formatting rules for primitive types will be also be set in this
iteration.

1. Rationale
Doppl ecosystem handles standard input and output by creating predefined bindings as shared
members which respectively represent console input and output. Any defined task is allowed to reach
console via assignment operations on bindings. Since Doppl tasks are parallel by definition, these shared
bindings are also mutually exclusive like any other shared members in nature. Avoiding multiple inputs
and outputs of the same value can easily be implemented via shared bool members used with mutex
markers (introduced in the future) as well as access modifiers. This iteration will only introduce a method
which uses access modifiers to prevent multiple executions.

2. Standard Input in a Single Task
Standard input binding is named as input. Its type is string and it can only be used on the right
hand side of assignment operator. Assignment operation which uses input on the right hand side are
blocking and waits for the user to enter a string to system console. Below is a single task which uses
input to initialize a string member.
#Standard input
task(1) Stdin {
data a_string = string
#Examples
init: {
a_string = input
#This task is blocked here until
#user enters a text to console
}
}

3. Standard Output in a Single Task
Standard output binding is named as output. Its type is string and it can only be used on the left
hand side of assignment operator. Assignment operations which use output on the left hand side acts as
printing function. Values are on the right hand side are directly printed on the console output. Below is a
single task which redirects given input directly to output.

#Standard output
task(1) Stdout {

2
#Examples
init: {
output = input
}
}

4. Standard Input and Output in Multiple Tasks of the Same Task Group
Multiple tasks of the same task group wait each other when concurrent access on input and
output initiated. This occurs because these members are defined as shared. Using input and output
simultaneously may rise various problems listed below.
1. Assigning a value retrieved from input to a shared member can cause a data race if multiple
tasks reads standard input at the same time.
2. Assigning a shared member to output can cause repeated printing of the same value.
3. Accessing input and output in a crowded task group may cause too many blocks.
Next section introduces a new access modifier for members to solve these problems efficiently.

4. Instruction Bypassing via once Access Modifier
Doppl introduces a new concept inherited from `Monads` in functional languages to work around
previously mentioned issue in a native way. It is called Instruction Bypassing, a way to automatically
skip execution of race expressions via automatic Null checks. Members marked as once behave
differently and have the privilege to drop the whole expression they belong to whenever necessary. There
are two types of usages which are able to cover all possible scenarios.
1. Using a once member on the Left Hand Side (LHS) of assignment operator. (Write case)
2. Using a once member on the Right Hand Side (RHS) of assignment operator. (Read
case)
LHS once members execute NOP (no operation) if their values are not Null. In other words, it
is not possible to overwrite value of a once member unless its value is Null.

RHS once members execute NOP if their values are Null. Moreover, any read operation on a
RHS once member nullifies its value at the end of expression. In other words, it is not possible to read a
once member twice.
Combining RHS and LHS once members on a single expression behaves like an OR statement.
At least one valid NOP condition guarantees the bypass and behaves like a short circuit.

3
#once Members
task(10) Examples {
once foo = string
once shared bar = string
#Examples
init: {
foo = "Hello" #foo is now 'Hello'
foo = "Hola" #foo is 'Hello', this expression is skipped
output = foo #'Hello' is printed, foo is now Null
#10 of 10 tasks will execute whole previous
#lines
bar = input
output = bar

bar = "Hi"
bar = Null

#bar is initialized
#9 of 10 tasks will
#bar is printed and
#9 of 10 tasks will

from stdin
skip this line
is now Null
skip this line

#bar is now 'Hi'
#bar is now Null

foo = "Ciao" #foo is now 'Ciao'
bar = "Hallo" #bar is now 'Hallo'
foo = bar
#Short circuit, each keep their values
}
}
The example above demonstrates usage of once members in conjunction with shared members to
avoid previously mentioned race conditions as well as repeated executions of the same expressions.

5. Conclusion
Iteration #7 defines standard input and output bindings as members to work with device consoles
in a convenient fashion. In order to avoid possible race conditions that may arise due to parallel nature
of Doppl, a new kind of member access modifier is introduced. These newly introduced once members
behave like special temporaries which are able to bypass their instructions to avoid repeated executions.

6. Future Concepts
Below are the concepts that are likely to be introduced in next iterations.
●
●
●

State members (local variables)
Target language of Doppl compilation
State transition operators
4
●
●
●
●
●
●
●
●
●
●
●
●

if conditional, trueness and anonymous states
Booths (mutex markers)
Primitive Collections and basic collection operators
Provision operators
Predefined task members
Tasks as members
Task and data traits
Custom data types and defining traits
Built-in traits for primitive data types
Formatted input and output
Message passing
Exception states

7. License
CC BY-SA 3.0
http://creativecommons.org/licenses/by-sa/3.0/

5

Contenu connexe

Tendances

Embedded SW Interview Questions
Embedded SW Interview Questions Embedded SW Interview Questions
Embedded SW Interview Questions
PiTechnologies
 

Tendances (18)

Introduction To Programming with Python Lecture 2
Introduction To Programming with Python Lecture 2Introduction To Programming with Python Lecture 2
Introduction To Programming with Python Lecture 2
 
Lecture 2 keyword of C Programming Language
Lecture 2 keyword of C Programming LanguageLecture 2 keyword of C Programming Language
Lecture 2 keyword of C Programming Language
 
Csharp4 basics
Csharp4 basicsCsharp4 basics
Csharp4 basics
 
Survelaine murillo ppt
Survelaine murillo pptSurvelaine murillo ppt
Survelaine murillo ppt
 
Top C Language Interview Questions and Answer
Top C Language Interview Questions and AnswerTop C Language Interview Questions and Answer
Top C Language Interview Questions and Answer
 
Embedded SW Interview Questions
Embedded SW Interview Questions Embedded SW Interview Questions
Embedded SW Interview Questions
 
FUNDAMENTAL OF C
FUNDAMENTAL OF CFUNDAMENTAL OF C
FUNDAMENTAL OF C
 
Review Python
Review PythonReview Python
Review Python
 
Introduction To Programming with Python-1
Introduction To Programming with Python-1Introduction To Programming with Python-1
Introduction To Programming with Python-1
 
C variables and constants
C variables and constantsC variables and constants
C variables and constants
 
Learn To Code: Introduction to c
Learn To Code: Introduction to cLearn To Code: Introduction to c
Learn To Code: Introduction to c
 
Get started python programming part 1
Get started python programming   part 1Get started python programming   part 1
Get started python programming part 1
 
Lesson 3 php numbers
Lesson 3  php numbersLesson 3  php numbers
Lesson 3 php numbers
 
Basic Concepts in Python
Basic Concepts in PythonBasic Concepts in Python
Basic Concepts in Python
 
LVEE 2014: Text parsing with Python and PLY
LVEE 2014: Text parsing with Python and PLYLVEE 2014: Text parsing with Python and PLY
LVEE 2014: Text parsing with Python and PLY
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
Computational model language and grammar bnf
Computational model language and grammar bnfComputational model language and grammar bnf
Computational model language and grammar bnf
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questions
 

Similaire à Doppl development iteration #7

CS 107 – Introduction to Computing and Programming – Spring 20.docx
CS 107 – Introduction to Computing and Programming – Spring 20.docxCS 107 – Introduction to Computing and Programming – Spring 20.docx
CS 107 – Introduction to Computing and Programming – Spring 20.docx
faithxdunce63732
 

Similaire à Doppl development iteration #7 (20)

Doppl development iteration #9
Doppl development   iteration #9Doppl development   iteration #9
Doppl development iteration #9
 
Erlang, an overview
Erlang, an overviewErlang, an overview
Erlang, an overview
 
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
 
name name2 n
name name2 nname name2 n
name name2 n
 
ppt17
ppt17ppt17
ppt17
 
ppt30
ppt30ppt30
ppt30
 
name name2 n2.ppt
name name2 n2.pptname name2 n2.ppt
name name2 n2.ppt
 
ppt18
ppt18ppt18
ppt18
 
Ruby for Perl Programmers
Ruby for Perl ProgrammersRuby for Perl Programmers
Ruby for Perl Programmers
 
ppt9
ppt9ppt9
ppt9
 
COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis: COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis:
 
CS 107 – Introduction to Computing and Programming – Spring 20.docx
CS 107 – Introduction to Computing and Programming – Spring 20.docxCS 107 – Introduction to Computing and Programming – Spring 20.docx
CS 107 – Introduction to Computing and Programming – Spring 20.docx
 
python and perl
python and perlpython and perl
python and perl
 
LANGUAGE PROCESSOR
LANGUAGE PROCESSORLANGUAGE PROCESSOR
LANGUAGE PROCESSOR
 

Plus de Diego Perini

Plus de Diego Perini (7)

Doppl development iteration #10
Doppl development   iteration #10Doppl development   iteration #10
Doppl development iteration #10
 
Doppl development iteration #8
Doppl development   iteration #8Doppl development   iteration #8
Doppl development iteration #8
 
Doppl development iteration #6
Doppl development   iteration #6Doppl development   iteration #6
Doppl development iteration #6
 
Doppl development iteration #5
Doppl development   iteration #5Doppl development   iteration #5
Doppl development iteration #5
 
Doppl development iteration #3
Doppl development   iteration #3Doppl development   iteration #3
Doppl development iteration #3
 
Doppl development iteration #2
Doppl development   iteration #2Doppl development   iteration #2
Doppl development iteration #2
 
Doppl Development Introduction
Doppl Development IntroductionDoppl Development Introduction
Doppl Development Introduction
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Dernier (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Doppl development iteration #7

  • 1. DOPPL Data Oriented Parallel Programming Language Development Diary Iteration #7 Covered Concepts: Standard Input and Output, once Access Modifier Diego PERINI Department of Computer Engineering Istanbul Technical University, Turkey 2013-08-20 1
  • 2. Abstract This paper stands for Doppl language development iteration #7. In this paper, standard input and output bindings and will be introduced. Formatting rules for primitive types will be also be set in this iteration. 1. Rationale Doppl ecosystem handles standard input and output by creating predefined bindings as shared members which respectively represent console input and output. Any defined task is allowed to reach console via assignment operations on bindings. Since Doppl tasks are parallel by definition, these shared bindings are also mutually exclusive like any other shared members in nature. Avoiding multiple inputs and outputs of the same value can easily be implemented via shared bool members used with mutex markers (introduced in the future) as well as access modifiers. This iteration will only introduce a method which uses access modifiers to prevent multiple executions. 2. Standard Input in a Single Task Standard input binding is named as input. Its type is string and it can only be used on the right hand side of assignment operator. Assignment operation which uses input on the right hand side are blocking and waits for the user to enter a string to system console. Below is a single task which uses input to initialize a string member. #Standard input task(1) Stdin { data a_string = string #Examples init: { a_string = input #This task is blocked here until #user enters a text to console } } 3. Standard Output in a Single Task Standard output binding is named as output. Its type is string and it can only be used on the left hand side of assignment operator. Assignment operations which use output on the left hand side acts as printing function. Values are on the right hand side are directly printed on the console output. Below is a single task which redirects given input directly to output. #Standard output task(1) Stdout { 2
  • 3. #Examples init: { output = input } } 4. Standard Input and Output in Multiple Tasks of the Same Task Group Multiple tasks of the same task group wait each other when concurrent access on input and output initiated. This occurs because these members are defined as shared. Using input and output simultaneously may rise various problems listed below. 1. Assigning a value retrieved from input to a shared member can cause a data race if multiple tasks reads standard input at the same time. 2. Assigning a shared member to output can cause repeated printing of the same value. 3. Accessing input and output in a crowded task group may cause too many blocks. Next section introduces a new access modifier for members to solve these problems efficiently. 4. Instruction Bypassing via once Access Modifier Doppl introduces a new concept inherited from `Monads` in functional languages to work around previously mentioned issue in a native way. It is called Instruction Bypassing, a way to automatically skip execution of race expressions via automatic Null checks. Members marked as once behave differently and have the privilege to drop the whole expression they belong to whenever necessary. There are two types of usages which are able to cover all possible scenarios. 1. Using a once member on the Left Hand Side (LHS) of assignment operator. (Write case) 2. Using a once member on the Right Hand Side (RHS) of assignment operator. (Read case) LHS once members execute NOP (no operation) if their values are not Null. In other words, it is not possible to overwrite value of a once member unless its value is Null. RHS once members execute NOP if their values are Null. Moreover, any read operation on a RHS once member nullifies its value at the end of expression. In other words, it is not possible to read a once member twice. Combining RHS and LHS once members on a single expression behaves like an OR statement. At least one valid NOP condition guarantees the bypass and behaves like a short circuit. 3
  • 4. #once Members task(10) Examples { once foo = string once shared bar = string #Examples init: { foo = "Hello" #foo is now 'Hello' foo = "Hola" #foo is 'Hello', this expression is skipped output = foo #'Hello' is printed, foo is now Null #10 of 10 tasks will execute whole previous #lines bar = input output = bar bar = "Hi" bar = Null #bar is initialized #9 of 10 tasks will #bar is printed and #9 of 10 tasks will from stdin skip this line is now Null skip this line #bar is now 'Hi' #bar is now Null foo = "Ciao" #foo is now 'Ciao' bar = "Hallo" #bar is now 'Hallo' foo = bar #Short circuit, each keep their values } } The example above demonstrates usage of once members in conjunction with shared members to avoid previously mentioned race conditions as well as repeated executions of the same expressions. 5. Conclusion Iteration #7 defines standard input and output bindings as members to work with device consoles in a convenient fashion. In order to avoid possible race conditions that may arise due to parallel nature of Doppl, a new kind of member access modifier is introduced. These newly introduced once members behave like special temporaries which are able to bypass their instructions to avoid repeated executions. 6. Future Concepts Below are the concepts that are likely to be introduced in next iterations. ● ● ● State members (local variables) Target language of Doppl compilation State transition operators 4
  • 5. ● ● ● ● ● ● ● ● ● ● ● ● if conditional, trueness and anonymous states Booths (mutex markers) Primitive Collections and basic collection operators Provision operators Predefined task members Tasks as members Task and data traits Custom data types and defining traits Built-in traits for primitive data types Formatted input and output Message passing Exception states 7. License CC BY-SA 3.0 http://creativecommons.org/licenses/by-sa/3.0/ 5