Doppl is a new programming language that aims providing a natural syntax for implementing parallel algorithms, designing data structures for shared memory applications and automated message passing among multiple tasks. The name is an abbreviation of `data oriented parallel programming language`.
AWS Community Day CPH - Three problems of Terraform
Doppl development iteration #1
1. DOPPL
Data Oriented Parallel Programming Language
Development Diary
Iteration #1
Covered Concepts:
Task Definitions, State Definitions, Grammar
Diego PERINI
Department of Computer Engineering
Istanbul Technical University, Turkey
2013-05-06
1
2. Abstract
This paper stands for Doppl language development iteration #1. In this paper, the most common
computation structure, a task will be introduced. In order to complete a valid HelloWorld program, a
string literal, a halt command and standard output is also defined.
1. Rationale
A task is the smallest and only executable entity in Doppl ecosystem. They are cloneable,
forkable and controllable according to programmers' needs. Cloned and forked tasks appear to be
executed concurrently. They can only be synchronized on transition points. Between each state transition,
programmer is able to create new bindings, do arithmetic or logic operations and check conditions for
branching before a transition.
2. Task Structure and Grammar
Each task is defined by the template below. Italic sections are user defined names and will be
explained in detail. Indentation is mandatory and each line can only include one expression. White spaces
can be replaced by tabs as long as they satisfy the template below.
#This is a line comment and below is a simple, empty task
task(range) MyTask {
#Below is a state
init: {
#Init operations
}
#Another state
state1: {
#State1 operations
}
#...
}
range: Range is a special type of interval definition which is used to constrain number of forks
or clones for defined task type. Inside of range can only be filled by literal values due to static typing.
○ An empty range value () means "as many as required" number of task can be created.
○ A single integer value (N) means "exactly N" number of tasks should be created.
○ Two integers separated with a white space (M N) means "at least M, at most N" number
of tasks can be created. M should always be less than N.
2
3. ○ ~ character is a valid integer literal that means "maximum amount allowed by the
environment" which is a theoretical infinity.
MyTask: This field is a user defined name for the declared task. It can only contain alpha
numeric values and underscores. It must start with a letter, preferably uppercase by convention.
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.
state1: This field is a user defined state name for the declared task. It can only contain alpha
numeric values and underscores. It must start with a letter preferably lowercase by convention and must
end with a colon ':' character.
{ }: Curly braces define blocks. There are two types of blocks, a task block and a state block. A
task block can contain member declarations (will be introduced in later iterations) and states. State blocks
can contain bindings and computation related operations. They must contain at least one state transition
rule (will be introduced) or a halt command (read further). Curly braces are likely to be removed in the
final language proposal to reduce code complexity. Their replacement are likely to be line indentations.
#: Hash character defines line comments. Line comments are ignored by the compiler until they
meet an endline character. They are used to explain code pieces and are useful to indicate state meanings.
3. Hello World and Standard Output
A valid HelloWorld program in Doppl requires two more concepts in order to be completed,
string literals and standard output.
A string literal is a character sequence enclosed between double quotes (will be improved in next
iterations). A string literal can contain special characters such as n for newline or t for tab. Further
explanation will be given when primitive types are explained in detail.
Standard output is a special binding which can be accessed by any task, named as output. Any
assignment made to output (by '=' operator) is directly rendered by system console. It can be perceived
as a special variable which outputs its content on change. Its entity type by language means will be
explained in further iterations.
Below is a valid HelloWorld program written in Doppl.
#Outputs "Hello World!" to standard output
task(1) HelloWorld {
#Init state
3
4. init: {
output = "Hello World!"
finish
}
}
finish: Finish (all characters lowercase) is a reserved language construct which points to a
location (current state) that can be considered as a final state. When an instance or an instance group
(cloned set) of a task meet with its or their final state and execute finish, any binding made by that
instance group can no longer be accessed.
4. Pseudo Compilation
Previous introduction lacks one concept in order to execute the written Doppl program. No entry
point is defined in the source. Iteration #1 proposes that entry points of Doppl programs should be given
as compiler parameters and they can only be task names. Tasks must specify their range values as 1 in
order to be considered as valid entry points. A pseudo compilation command of a Doppl program is given
below.
doppl helloworld.doppl HelloWorld
5. Conclusion
Iteration #1 provides a first look to what a Doppl program look like. It introduces stateful tasks,
main computation units of Doppl and proposes a few language constructs to manipulate standard output.
Strictly indented typing in Doppl predicts that Doppl source codes are likely to avoid code obfuscation
caused by bad practice or dirty programming. A pseudo compilation command is also proposed in this
iteration. Finally iteration #1 enforces tasks which are designed to be entry points to exist as singleton in
memory.
6. Future Concepts
Below are the concepts that are likely to be introduced in next iterations.
●
●
●
●
●
●
●
●
Primitive data types
Task members
Literals
Shared members
Assignment operator (more)
Arithmetic operators
State transition operators
if conditional
7. License
4