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

Development Diary
Iteration #9

Covered Concepts:
States in Detail, State Transition Operators

Diego PERINI
Department of Computer Engineering
Istanbul Technical University, Turkey
2013-09-15

1
Abstract
This paper stands for Doppl language development iteration #9. In this paper, the meaning
of "state" as a Doppl entity will be explained in detail. State transition operators and common usage
scenarios of states will be introduced. Conditional, unconditional and synchronized branching will be
demonstrated with examples.

1. Rationale
Current status of Doppl lacks proper language constructs to achieve branching in a single task as
well as declare synchronization points for a concurrently running task group. The way Doppl ecosystem
handles looping, synchronization and branching gave birth the idea of states, a kind of pipeline system to
create work breakdown structures.

2. States
A state is a special marker in a task body which can be used to jump to another instruction.
The word state in Doppl has nothing to do with application context as it can easily be seen that each
instruction in a state body is able to change it freely. Doppl tasks which belong to same task group are
able to wait each other using these markers.
A state is declared by typing a name followed by a colon and curly braces block.
init: This field is a language reserved state name and declares the initial state for its task. Any
branching for a newly spawned task is decided in this state block. There is no way for a task to bypass this
state. Initial state name must end with a colon ':' character like any other state declaration. (Iteration #1)
Below is an example pseudo program which loads some data to memory. It then computes some
calculations on the data to output some graphics to the screen.

#States explained
task(10) States {
#some members here
#Init task, must be declared in every task body
init: {
#init state used it to initialize tasks
#branch to load
}

flush_and_load: {
#load data to memory
#branch to process
}

2
process: {
#calculate some extra data for render
#wait until each task is ready to branch to render
}
render: {
#render only once using previously calculated data
#branch to process to create an infinite render loop
}
}
Each state is obligated to provide at least one state transition expression or a finish clause at the
last line of their block. States that lack such expressions imply a finish operation at the end of their
state block.
finish clause is a blocking synchronization expression that when each task of the same task
group meet at finish, the whole group halts simultaneously.

3. State Transition Operators
There are two operators to jump between states. They behave almost the same with the exception
of one's implying a task barrier line.
Non blocking transition: Operator keyword is '-->' without single quotes. Any task executing a
non blocking transition directly jumps to the state specified without waiting other tasks in the task group
it belongs.
Blocking transition: Operator keyword is '->' without single quotes. Any task executing a
blocking transition is obligated to wait other tasks in its task group to continue. In other words, tasks of
the same task groups always jump simultaneously when this operator is used.
State transition operators come with two forms, prefix and infix. Below is the syntax explanation
of these usages. Prefix usage can be achieved by omitting the first parameter.
any_valid_line_expression --> state_name #infix non blocking
any_valid_line_expression -> state_name

#infix blocking

--> state_name #prefix non blocking
-> state_name

#prefix blocking

3
Having an infix form grants these operators the ability to be used with instruction bypassing. If
the expression on the left hand side of the transition operator is discarded by a once member short circuit,
branching is discarded as well. Instruction bypassing therefore becomes a way to conditionally branch in
Doppl as well. Previously demonstrated pseudo program can now be implemented with only a few lines
of code.
#States explained
task(10) States {
once shared data output_data = string
shared data
temp_data
= string
data
input_data = string
init: {
output = "I am ready!n"
->load #Everyone waits the load
}
flush_and_load: {
input_data = 0
shared_data = ""
output_data = Null
input_data = input
-->process #The one who loads may continue
}
process: {
temp_data = temp_data ++ input_data #Calculation
->render #Everyone waits till completion
}
render: {
output_data = temp_data
output = output_data #only printed once
-->flush_and_load
}
}
This program highly resembles a double buffered rendering loop in graphic libraries such as
OpenGL and DirectX. In fact the parallel nature of Doppl imitates GPU cores to achieve same effect by
using task groups. The main design principle behind Doppl aims that such mechanisms should be easy
to implement and should take fewer lines of code when compared to other general purpose programming
languages. This ability also suggest that Doppl programs can become GPU friendly if they suffice some

4
limitations. Observation of this claim is beyond these iterations and can be subject to a future research.

4. States Within States
It is possible to define new state blocks inside of states as long as the proper naming convention is
used for branching. In order to branch to a new state within a state, the state name should be prefixed with
parent state name followed by a period '.' character. There is no limit for nesting levels. Name collision
for states will be explained in the next section.
mystate: {
#valid
mystate.foo: {
->foo
->mystate.bar
->zip
->mystate.zip
}

#same as mystate.foo
#same as bar
#valid but discouraged
#better than above

#valid
mystate.bar: {
#some calculation
}
#valid but same as mystate.zip and discouraged
zip: {
#some calculation
}
}
Since state block beginnings do not imply any state transition, it is possible to put a state block
anywhere inside another block. Expressions skip state declarations during runtime as they have no
significant meaning in terms of an operation, therefore it is considered good practice to isolate these
declarations from other expressions of the same state during formatting.

5. Scope
Scope rules in Doppl highly resembles scopes in common programming languages with a few
additions to work with state transition properly. Any declared member in a block can always be accessed
by inner blocks but the opposite is restricted. This rule does also apply to states. Name collisions are
handled by latest overridden rule. Below are the results of these rules for each scenario.
1. Any block can access any member and state that it declared.
5
2. If an inner block wants to access a member outside of its declaration, it can only do so by
navigating outwards block by block until it meets the parent task. If the member found
during the navigation, it can be accessed.
3. A state can jump to another state if and only if the jumped state can be accesses by the
navigation method given above.
4. Name collisions during member accesses can be prevented by prefixing member names
with parent states followed by a period character. If the collided member is a task
member, task name followed by a period character can be used as a prefix.

#Scope demonstration
task Scopes(1) {
data mybyte = byte
#init is omitted for demonstration purposes
mystate: {
data mybyte = byte
mystate.foo: {
mybyte
= 0xFF
mystate.mybyte = 0xFF
Scopes.mybyte = 0xFF
otherstate.mybyte = 0xFF
}

mystate.bar: {
->mystate.foo
->mystate
->otherstate
->otherstate.foo
}

#means mystate.mybyte, valid
#same as above, valid
#not the same as above, valid
#invalid

#valid
#valid
#valid
#invalid

}
otherstate: {
data mybyte = byte
otherstate.foo: {
#some calculation
}
}
}

6
6. Conclusion
Iteration #9 explains states, a special entity type which can contain executed code as well as their
own declarations. Synchronization, branching and loops are implemented via transitions between states
which has its own kind of operators. Blocking transitions act like barriers which synchronizes tasks of the
same task group at a specific point. Non blocking transitions are used of branching within a single task.

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

Target language of Doppl compilation
Parameterized branching, states as member type, anonymous states
if conditional, trueness
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

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

7

Contenu connexe

Tendances

Python Interview questions 2020
Python Interview questions 2020Python Interview questions 2020
Python Interview questions 2020VigneshVijay21
 
Unit 1 question and answer
Unit 1 question and answerUnit 1 question and answer
Unit 1 question and answerVasuki Ramasamy
 
Database Management System( Normalization)
Database Management System( Normalization)Database Management System( Normalization)
Database Management System( Normalization)kiran Patel
 
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 AnswerVineet Kumar Saini
 
C language by Dr. D. R. Gholkar
C language by Dr. D. R. GholkarC language by Dr. D. R. Gholkar
C language by Dr. D. R. GholkarPRAVIN GHOLKAR
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1ReKruiTIn.com
 
Learn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & LoopsLearn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & LoopsEng Teong Cheah
 
Top interview questions in c
Top interview questions in cTop interview questions in c
Top interview questions in cAvinash Seth
 
C++ questions and answers
C++ questions and answersC++ questions and answers
C++ questions and answersDeepak Singh
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questionsadarshynl
 
The GO programming language
The GO programming languageThe GO programming language
The GO programming languageMarco Sabatini
 

Tendances (20)

Function overloading ppt
Function overloading pptFunction overloading ppt
Function overloading ppt
 
Python Interview questions 2020
Python Interview questions 2020Python Interview questions 2020
Python Interview questions 2020
 
Unit 1 question and answer
Unit 1 question and answerUnit 1 question and answer
Unit 1 question and answer
 
Database Management System( Normalization)
Database Management System( Normalization)Database Management System( Normalization)
Database Management System( Normalization)
 
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
 
C language by Dr. D. R. Gholkar
C language by Dr. D. R. GholkarC language by Dr. D. R. Gholkar
C language by Dr. D. R. Gholkar
 
Database Presentation
Database PresentationDatabase Presentation
Database Presentation
 
C++ interview question
C++ interview questionC++ interview question
C++ interview question
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1
 
C++ Interview Questions
C++ Interview QuestionsC++ Interview Questions
C++ Interview Questions
 
Learn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & LoopsLearn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & Loops
 
Csharp4 basics
Csharp4 basicsCsharp4 basics
Csharp4 basics
 
Top interview questions in c
Top interview questions in cTop interview questions in c
Top interview questions in c
 
C++
C++C++
C++
 
C++ questions and answers
C++ questions and answersC++ questions and answers
C++ questions and answers
 
Pcd question bank
Pcd question bank Pcd question bank
Pcd question bank
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questions
 
RegexCat
RegexCatRegexCat
RegexCat
 
The GO programming language
The GO programming languageThe GO programming language
The GO programming language
 

Similaire à Doppl development iteration #9

Doppl development iteration #7
Doppl development   iteration #7Doppl development   iteration #7
Doppl development iteration #7Diego Perini
 
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYC UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYRajeshkumar Reddy
 
Functional programming in TypeScript
Functional programming in TypeScriptFunctional programming in TypeScript
Functional programming in TypeScriptbinDebug WorkSpace
 
GUI Programming in JAVA (Using Netbeans) - A Review
GUI Programming in JAVA (Using Netbeans) -  A ReviewGUI Programming in JAVA (Using Netbeans) -  A Review
GUI Programming in JAVA (Using Netbeans) - A ReviewFernando Torres
 
Introduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John LadoIntroduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John LadoMark John Lado, MIT
 
Basic construction of c
Basic construction of cBasic construction of c
Basic construction of ckinish kumar
 
Dbms important questions and answers
Dbms important questions and answersDbms important questions and answers
Dbms important questions and answersLakshmiSarvani6
 
OOPS USING C++(UNIT 2)
OOPS USING C++(UNIT 2)OOPS USING C++(UNIT 2)
OOPS USING C++(UNIT 2)SURBHI SAROHA
 
Buffer overflow tutorial
Buffer overflow tutorialBuffer overflow tutorial
Buffer overflow tutorialhughpearse
 
Bt0067 c programming and data structures 1
Bt0067 c programming and data structures 1Bt0067 c programming and data structures 1
Bt0067 c programming and data structures 1Techglyphs
 
Handout # 4 functions + scopes
Handout # 4   functions + scopes Handout # 4   functions + scopes
Handout # 4 functions + scopes NUST Stuff
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programmingnmahi96
 
Decision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, StringsDecision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, StringsPrabu U
 

Similaire à Doppl development iteration #9 (20)

Doppl development iteration #7
Doppl development   iteration #7Doppl development   iteration #7
Doppl development iteration #7
 
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYC UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
 
C interview questions
C interview  questionsC interview  questions
C interview questions
 
Function in C++
Function in C++Function in C++
Function in C++
 
Functional programming in TypeScript
Functional programming in TypeScriptFunctional programming in TypeScript
Functional programming in TypeScript
 
Data services-functions
Data services-functionsData services-functions
Data services-functions
 
GUI Programming in JAVA (Using Netbeans) - A Review
GUI Programming in JAVA (Using Netbeans) -  A ReviewGUI Programming in JAVA (Using Netbeans) -  A Review
GUI Programming in JAVA (Using Netbeans) - A Review
 
Introduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John LadoIntroduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John Lado
 
Basic construction of c
Basic construction of cBasic construction of c
Basic construction of c
 
Dbms important questions and answers
Dbms important questions and answersDbms important questions and answers
Dbms important questions and answers
 
Notes on c++
Notes on c++Notes on c++
Notes on c++
 
OOPS USING C++(UNIT 2)
OOPS USING C++(UNIT 2)OOPS USING C++(UNIT 2)
OOPS USING C++(UNIT 2)
 
Buffer overflow tutorial
Buffer overflow tutorialBuffer overflow tutorial
Buffer overflow tutorial
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
Final requirement
Final requirementFinal requirement
Final requirement
 
Bt0067 c programming and data structures 1
Bt0067 c programming and data structures 1Bt0067 c programming and data structures 1
Bt0067 c programming and data structures 1
 
Handout # 4 functions + scopes
Handout # 4   functions + scopes Handout # 4   functions + scopes
Handout # 4 functions + scopes
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programming
 
3 Function Overloading
3 Function Overloading3 Function Overloading
3 Function Overloading
 
Decision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, StringsDecision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, Strings
 

Plus de Diego Perini

Doppl development iteration #10
Doppl development   iteration #10Doppl development   iteration #10
Doppl development iteration #10Diego Perini
 
Doppl development iteration #6
Doppl development   iteration #6Doppl development   iteration #6
Doppl development iteration #6Diego Perini
 
Doppl development iteration #5
Doppl development   iteration #5Doppl development   iteration #5
Doppl development iteration #5Diego Perini
 
Doppl development iteration #4
Doppl development   iteration #4Doppl development   iteration #4
Doppl development iteration #4Diego Perini
 
Doppl development iteration #3
Doppl development   iteration #3Doppl development   iteration #3
Doppl development iteration #3Diego Perini
 
Doppl Development Introduction
Doppl Development IntroductionDoppl Development Introduction
Doppl Development IntroductionDiego Perini
 

Plus de Diego Perini (6)

Doppl development iteration #10
Doppl development   iteration #10Doppl development   iteration #10
Doppl development iteration #10
 
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 #4
Doppl development   iteration #4Doppl development   iteration #4
Doppl development iteration #4
 
Doppl development iteration #3
Doppl development   iteration #3Doppl development   iteration #3
Doppl development iteration #3
 
Doppl Development Introduction
Doppl Development IntroductionDoppl Development Introduction
Doppl Development Introduction
 

Dernier

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
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 REVIEWERMadyBayot
 
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, Adobeapidays
 
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 TerraformAndrey Devyatkin
 
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 FresherRemote DBA Services
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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 DiscoveryTrustArc
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
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.pptxRemote DBA Services
 
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 educationjfdjdjcjdnsjd
 
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 Pakistandanishmna97
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
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 SavingEdi Saputra
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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 Takeoffsammart93
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 

Dernier (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
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
 
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
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
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
 
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
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 

Doppl development iteration #9

  • 1. DOPPL Data Oriented Parallel Programming Language Development Diary Iteration #9 Covered Concepts: States in Detail, State Transition Operators Diego PERINI Department of Computer Engineering Istanbul Technical University, Turkey 2013-09-15 1
  • 2. Abstract This paper stands for Doppl language development iteration #9. In this paper, the meaning of "state" as a Doppl entity will be explained in detail. State transition operators and common usage scenarios of states will be introduced. Conditional, unconditional and synchronized branching will be demonstrated with examples. 1. Rationale Current status of Doppl lacks proper language constructs to achieve branching in a single task as well as declare synchronization points for a concurrently running task group. The way Doppl ecosystem handles looping, synchronization and branching gave birth the idea of states, a kind of pipeline system to create work breakdown structures. 2. States A state is a special marker in a task body which can be used to jump to another instruction. The word state in Doppl has nothing to do with application context as it can easily be seen that each instruction in a state body is able to change it freely. Doppl tasks which belong to same task group are able to wait each other using these markers. A state is declared by typing a name followed by a colon and curly braces block. init: This field is a language reserved state name and declares the initial state for its task. Any branching for a newly spawned task is decided in this state block. There is no way for a task to bypass this state. Initial state name must end with a colon ':' character like any other state declaration. (Iteration #1) Below is an example pseudo program which loads some data to memory. It then computes some calculations on the data to output some graphics to the screen. #States explained task(10) States { #some members here #Init task, must be declared in every task body init: { #init state used it to initialize tasks #branch to load } flush_and_load: { #load data to memory #branch to process } 2
  • 3. process: { #calculate some extra data for render #wait until each task is ready to branch to render } render: { #render only once using previously calculated data #branch to process to create an infinite render loop } } Each state is obligated to provide at least one state transition expression or a finish clause at the last line of their block. States that lack such expressions imply a finish operation at the end of their state block. finish clause is a blocking synchronization expression that when each task of the same task group meet at finish, the whole group halts simultaneously. 3. State Transition Operators There are two operators to jump between states. They behave almost the same with the exception of one's implying a task barrier line. Non blocking transition: Operator keyword is '-->' without single quotes. Any task executing a non blocking transition directly jumps to the state specified without waiting other tasks in the task group it belongs. Blocking transition: Operator keyword is '->' without single quotes. Any task executing a blocking transition is obligated to wait other tasks in its task group to continue. In other words, tasks of the same task groups always jump simultaneously when this operator is used. State transition operators come with two forms, prefix and infix. Below is the syntax explanation of these usages. Prefix usage can be achieved by omitting the first parameter. any_valid_line_expression --> state_name #infix non blocking any_valid_line_expression -> state_name #infix blocking --> state_name #prefix non blocking -> state_name #prefix blocking 3
  • 4. Having an infix form grants these operators the ability to be used with instruction bypassing. If the expression on the left hand side of the transition operator is discarded by a once member short circuit, branching is discarded as well. Instruction bypassing therefore becomes a way to conditionally branch in Doppl as well. Previously demonstrated pseudo program can now be implemented with only a few lines of code. #States explained task(10) States { once shared data output_data = string shared data temp_data = string data input_data = string init: { output = "I am ready!n" ->load #Everyone waits the load } flush_and_load: { input_data = 0 shared_data = "" output_data = Null input_data = input -->process #The one who loads may continue } process: { temp_data = temp_data ++ input_data #Calculation ->render #Everyone waits till completion } render: { output_data = temp_data output = output_data #only printed once -->flush_and_load } } This program highly resembles a double buffered rendering loop in graphic libraries such as OpenGL and DirectX. In fact the parallel nature of Doppl imitates GPU cores to achieve same effect by using task groups. The main design principle behind Doppl aims that such mechanisms should be easy to implement and should take fewer lines of code when compared to other general purpose programming languages. This ability also suggest that Doppl programs can become GPU friendly if they suffice some 4
  • 5. limitations. Observation of this claim is beyond these iterations and can be subject to a future research. 4. States Within States It is possible to define new state blocks inside of states as long as the proper naming convention is used for branching. In order to branch to a new state within a state, the state name should be prefixed with parent state name followed by a period '.' character. There is no limit for nesting levels. Name collision for states will be explained in the next section. mystate: { #valid mystate.foo: { ->foo ->mystate.bar ->zip ->mystate.zip } #same as mystate.foo #same as bar #valid but discouraged #better than above #valid mystate.bar: { #some calculation } #valid but same as mystate.zip and discouraged zip: { #some calculation } } Since state block beginnings do not imply any state transition, it is possible to put a state block anywhere inside another block. Expressions skip state declarations during runtime as they have no significant meaning in terms of an operation, therefore it is considered good practice to isolate these declarations from other expressions of the same state during formatting. 5. Scope Scope rules in Doppl highly resembles scopes in common programming languages with a few additions to work with state transition properly. Any declared member in a block can always be accessed by inner blocks but the opposite is restricted. This rule does also apply to states. Name collisions are handled by latest overridden rule. Below are the results of these rules for each scenario. 1. Any block can access any member and state that it declared. 5
  • 6. 2. If an inner block wants to access a member outside of its declaration, it can only do so by navigating outwards block by block until it meets the parent task. If the member found during the navigation, it can be accessed. 3. A state can jump to another state if and only if the jumped state can be accesses by the navigation method given above. 4. Name collisions during member accesses can be prevented by prefixing member names with parent states followed by a period character. If the collided member is a task member, task name followed by a period character can be used as a prefix. #Scope demonstration task Scopes(1) { data mybyte = byte #init is omitted for demonstration purposes mystate: { data mybyte = byte mystate.foo: { mybyte = 0xFF mystate.mybyte = 0xFF Scopes.mybyte = 0xFF otherstate.mybyte = 0xFF } mystate.bar: { ->mystate.foo ->mystate ->otherstate ->otherstate.foo } #means mystate.mybyte, valid #same as above, valid #not the same as above, valid #invalid #valid #valid #valid #invalid } otherstate: { data mybyte = byte otherstate.foo: { #some calculation } } } 6
  • 7. 6. Conclusion Iteration #9 explains states, a special entity type which can contain executed code as well as their own declarations. Synchronization, branching and loops are implemented via transitions between states which has its own kind of operators. Blocking transitions act like barriers which synchronizes tasks of the same task group at a specific point. Non blocking transitions are used of branching within a single task. 7. Future Concepts Below are the concepts that are likely to be introduced in next iterations. ● ● ● ● ● ● ● ● ● ● ● ● ● ● Target language of Doppl compilation Parameterized branching, states as member type, anonymous states if conditional, trueness 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 8. License CC BY-SA 3.0 http://creativecommons.org/licenses/by-sa/3.0/ 7