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`.
Axa Assurance Maroc - Insurer Innovation Award 2024
Doppl development iteration #2
1. DOPPL
Data Oriented Parallel Programming Language
Development Diary
Iteration #2
Covered Concepts:
Literals, Primitive Data Types, Task Members
Diego PERINI
Department of Computer Engineering
Istanbul Technical University, Turkey
2013-07-11
1
2. Abstract
This paper stands for Doppl language development iteration #2. In this paper, literals, primitive
data types and task members will be introduced. An example program running only one thread of a task
type for code explanations is prefered for simplicity.
1. Rationale
Doppl ecosystem enforces the programmer to declare variables via only member attributes. There
is no temporary variables as such mechanism do also imply temporary task initiations which can be done
via new task declarations. Task members are statically typed and error checked during compile time.
Initialization of these members can be done during init state of a task if required. This iteration will only
introduce member initialization via literals.
2. Primitive Data Types, Task Members and Basic Literals
Each task member is defined and initialized by the template below. Italic sections are user defined
names, bold names are primitive types and literals are highlighted.
#This is an example task with members of primitive types
task(1) Types {
data a_byte = byte
data an_integer = int
data a_string = string
data a_float = float
#Construction
init: {
a_byte =
a_byte =
a_byte =
a_byte =
a_byte =
a_byte =
127
0x7f
0x7F
0o177
0b01111111
'a'
an_integer
an_integer
an_integer
an_integer
an_integer
=
=
=
=
=
#decimal
#same as
#same as
#same as
#same as
#decimal
1234
0x1234
0o1234
0b10101
-1234
a_float = 0.23
a_float = -0.23
a_float = .23
127
decimal
decimal
decimal
decimal
97
127,
127,
127,
127,
hex form
hex form
octal form
binary form
#decimal 1234
#not same as decimal 1234
#not same as decimal and hex 1234
#a completely different number
#decimal -1234
#a regular float
#a negative float
#zero can be omitted
2
3. a_float
a_float
a_float
a_float
a_float
=
=
=
=
=
-.23
1.23456
-1.23456
1
-1
#negative zero can be omitted
#a regular non-zero float
#a negative non-zero float
#trailing zeros can be omitted
#same as above
a_string = "My name is Johnn" #a string with an endline
}
}
Member initialization is quite easy and self explanatory. They start with an optional access
modifier (different from regular object oriented languages) followed by an entity type which is in this
case the keyword data. A binding name is given followed by an equals sign and a type. A member
declaration can be read as "A data named a_byte is a byte". However, there are some constraints that need
to be noted before usage.
Bytes are 8 bit values and can only contain unsigned numbers between 0 and 255. Any value
beyond 255 is prone to errors due to bit overflow, least significant 8 bits are prefered in such cases. Any
value below 0 is converted from 2's complement representation to satisfy border constraints and least
significant 8 bits are prefered after conversion for large values.
Integers are signed 32 bit values with a range of -2147483648 to 2147483647 represented in
2's complement method internally. Unsigned representations will be introduced in the next iterations. '-'
(negative sign, dash) character whenever used as a prefix (without any whitespaces) converts any numeric
literal into its negative form automatically.
Floats are signed 32 bit values with an approximate range of ±3.4x10±7. Initialization with
exponents notation will be supported later. Unsigned representations will be introduced in the next
iterations.
Strings are primitives types as well and must not be confused with byte arrays. Strings are types
that has their own kind of operations and initialized by enclosed double quotes. Collection types such as
arrays and lists are subject to another iteration. Conversion methods for strings into these structures will
be introduced later. There is no character type defined in Doppl.
3. Special Literals
Null: Any kind of variable without initialization assigned the value of Null (case sensitive).
Null does not correspond to any numeric and string value, it has its own properties and handled with care
internally. Assigning a member with another uninitialized member is not an error and results in Null.
"": Empty string
3
4. Below are escape sequences for special characters and can be used in both string and byte
initializations. To initialize a byte with a character, use single commas to enclose the character.
my_byte = 'f'
char
meaning
n
newline
r
carriage return
t
tab
"
double quote (")
backslash ()
4. Conclusion
Iteration #2 introduces task members and some primitive types to play with. Properties of these
types and how they are initialized via literals are also explained in this iteration. Null, empty string and
special characters are introduced.
5. Future Concepts
Below are the concepts that are likely to be introduced in next iterations.
●
●
●
●
●
●
●
●
Shared members and more access modifiers
Assignment operator (more)
Arithmetic, relational and binary operators
State transition operators
A boolean type and trueness
if conditional
Collections
Provision operators
6. License
CC BY-SA 3.0
http://creativecommons.org/licenses/by-sa/3.0/
4