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`.
1. DOPPL
Data Oriented Parallel Programming Language
Development Diary
Iteration #4
Covered Concepts:
Boolean Type, Boolean Literals, Logic Operators
Diego PERINI
Department of Computer Engineering
Istanbul Technical University, Turkey
2013-07-22
1
2. Abstract
This paper stands for Doppl language development iteration #4. In this paper, a new primitive
data type for logic operations will be introduced. Common logic operators such as and, or, xor and not are
also defined in this iteration.
1. Rationale
Like any other high level programming language, Doppl offers a primitive type of bool to execute
logic operations in a native manner. A bool can only have values of true or false. Assigning any other
value is prohibited to enforce a unified methodology.
2. bool Type, Boolean Literals and Operations
Doppl bool is a primitive type like int and string which can easily be used for task members.
Bool members are initialized with Null by default like any other primitive type. Boolean types can only
store True or False as values (case sensitive), any other assignment is likely to yield a syntax error.
Implied typecasting will be explained in the iteration that introduces data traits.
Below are logical operators that can be used with boolean members, ordered by precedence
descendingly.
keyword
meaning
!
prefix not
and
logical and
nand
not(logical and)
or
logical or
nor
not(logical or)
xor
exclusive or
Boolean operations can make use of parentheses to manipulate order of execution.
2
3. Code example:
#An example task group of 2 tasks
task(1) BoolTypes {
data a_private_bool = bool
shared data a_shared_bool = bool
data my_bool = bool
#Examples
init: {
a_private_string = True
a_shared_string = False
my_bool
my_bool
my_bool
my_bool
my_bool
my_bool
=
=
=
=
=
=
True and False
True or False
True xor False
!True
True nand False
True nor False
#False
#True
#True
#false
#True
#False
my_bool = True and !False nor True and (True xor True)
#translates into
#((True and !(False)) nor (True and (True xor True)))
#((True and True) nor (True and False))
#(True nor False)
#!True
#False
}
}
It must be noted that Null is not False and boolean operators always yield syntax errors
whenever used with Null values.
3. Conclusion
Iteration #4 defines a new type called bool which is a simple boolean value of True or
False. Common boolean operations of and, nand, or, nor, xor and not can easily be conducted via
corresponding operators. Order of precedence is manipulated via regular parentheses. Using Null with
boolean operators is forbidden.
3
4. 4. Future Concepts
Below are the concepts that are likely to be introduced in next iterations.
●
●
●
●
●
●
●
●
●
●
●
●
Arithmetic, relational and binary operators
String Concatenation
Standard input and output
if conditional and trueness
State transition operators
Primitive Collections and basic collection operators
Provision operators
Tasks as members
Task and data traits
Custom data types and defining traits
Built-in traits for primitive data types
Message passing
5. License
CC BY-SA 3.0
http://creativecommons.org/licenses/by-sa/3.0/
4