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

Development Diary
Iteration #5

Covered Concepts:
Arithmetic, Relational and Binary Operators

Diego PERINI
Department of Computer Engineering
Istanbul Technical University, Turkey
2013-07-26

1
Abstract
This paper stands for Doppl language development iteration #5. In this paper, basic operators
to execute arithmetics, relations and binary operations (i.e shifting, bitwise logic) will be introduced.
Previously introduced data types is used in the example source code.

1. Rationale
As a high level language, Doppl uses arithmetic, relational and binary operators to compute low
level calculations. These operators look nearly same with their other counterparts with a few exceptions.
Each exception is explained in detail.

2. Arithmetic Operators
To start with, Doppl makes use of six arithmetic operators to work with integers, floats and bytes.

keyword

meaning

+

addition

-

subtraction

*

multiplication

//

division with integer/byte result (floored)

/

division with float result

%

modulo

+, -, *, % operators can operate on any pair of the same type and generate a result of the same
type.
// division operator on the other hand do only work on integers or bytes and generate a result of
the same type. If the value generated cannot be represented as an integer, the value is floored.
/ operator always returns a float.
% operator only works with integers and bytes.

#Arithmetic operations
task(1) Arithmetics {
data a_byte = byte

2
data an_int = int
data a_float = float
data another_int = int #will not be initialized
#Examples
init: {
a_byte = 12 + 13
a_byte = 12 - 13
an_int = 12 * 13
an_int = 25 // 2
a_float = 25 / 2
an_int = 13 % 12

#25
#-1 which is converted into 0xFF
#156
#12 floored from 12.5
#12.5
#1

#Below are invalid
a_float = 25 // 2 #Calculation returns int or byte
an_int = 12.0 + 13.0 #Type mismatch, see operator info
an_int = a_float + a_byte #Type mismatch, see operator info
an_int = another_int + 1 #Null data, value mismatch
}
}

3. Relational Operators
Relational operators are special expressions that generate bool results that can be used to
initialize boolean members as well as conditionally branch in a task (will be introduced later).

keyword

meaning

<

less than

>

greater than

==

equals

!=

not equal

<=

less than or equal

>=

greater than or equal

Implicit conversions are not allowed and each of these operators can only work with same type of
parameters. Non-integral (i.e string) type behavior is not defined.

3
#Relational operations
task(1) Relations {
data a_bool = bool
#Examples
init: {
a_bool
a_bool
a_bool
a_bool
a_bool
a_bool

=
=
=
=
=
=

2 < 3
2.5 > 0
1 == 1
1 != 1
15 >= 15
15 <= 14

#True
#True
#True
#False
#True
#False

a_bool = 1 == 1.0 #error, type mismatch
}
}

4. Binary Operators
Binary operators are used to manipulate specific bits of values injectively. Below are the binary
operators ordered by their precedence descendingly.

keyword

meaning

&

and

|

or

^

xor

!

prefix not

Like arithmetic operators, binary operators can only work on integral types. Unlike previously
introduced operators, cross type usage is considered undefined behavior and should be avoided.
#Binary operations
task(1) Binary {
data an_int = int
data a_byte = byte
#Examples
init: {

4
an_int
an_int
a_byte
a_byte

=
=
=
=

0 | 0x00FF
#0x00FF
1 & 0x00FF
#0x00FF
0b00011111 ^ 0b11111000 #0b11100111
!0b00000001
#0b11111110

an_int = a_byte & an_int #error, undefined behavior
}
}
It should be noted that there is no implicit type casting in Doppl therefore prefix not (!) does not
yield a false when used on an integral value.

5. Conclusion
Iteration #5 defines new operators to do arithmetic, relational and binary operations. Each of
these operations can make use of parentheses to manipulate their order of precedence.

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

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
Exception states

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

5

Contenu connexe

Tendances (20)

Lecture03(c expressions & operators)
Lecture03(c expressions & operators)Lecture03(c expressions & operators)
Lecture03(c expressions & operators)
 
Programming in C- Introduction
Programming in C- IntroductionProgramming in C- Introduction
Programming in C- Introduction
 
Operators and Expressions in C#
Operators and Expressions in C#Operators and Expressions in C#
Operators and Expressions in C#
 
C Token’s
C Token’sC Token’s
C Token’s
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
2nd PUC Computer science chapter 5 review of c++
2nd PUC Computer science chapter 5   review of c++2nd PUC Computer science chapter 5   review of c++
2nd PUC Computer science chapter 5 review of c++
 
Fundamentals of Computing and C Programming - Part 1
Fundamentals of Computing and C Programming - Part 1Fundamentals of Computing and C Programming - Part 1
Fundamentals of Computing and C Programming - Part 1
 
C language
C languageC language
C language
 
Getting Started with C++
Getting Started with C++Getting Started with C++
Getting Started with C++
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 
C Tokens
C TokensC Tokens
C Tokens
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 
Methods in C#
Methods in C#Methods in C#
Methods in C#
 
Literals,variables,datatype in C#
Literals,variables,datatype in C#Literals,variables,datatype in C#
Literals,variables,datatype in C#
 
Parametricity
ParametricityParametricity
Parametricity
 
Fundamentals of Computing and C Programming - Part 2
Fundamentals of Computing and C Programming - Part 2Fundamentals of Computing and C Programming - Part 2
Fundamentals of Computing and C Programming - Part 2
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Assignment5
Assignment5Assignment5
Assignment5
 
C operators
C operatorsC operators
C operators
 
Mycasestudy
MycasestudyMycasestudy
Mycasestudy
 

En vedette

Presentation2
Presentation2Presentation2
Presentation2soulla8
 
How to Write Academically
How to Write AcademicallyHow to Write Academically
How to Write Academicallyrossmartian
 
Doppl development iteration #2
Doppl development   iteration #2Doppl development   iteration #2
Doppl development iteration #2Diego Perini
 
Body Fat Stripping
Body Fat StrippingBody Fat Stripping
Body Fat Strippingphaythgoydas
 
Redes de informàtica
Redes de informàticaRedes de informàtica
Redes de informàticajhongil03
 
Richard Watson Portfolio Fall 2013
Richard Watson Portfolio Fall 2013Richard Watson Portfolio Fall 2013
Richard Watson Portfolio Fall 2013Richard Watson
 
Doppl development iteration #9
Doppl development   iteration #9Doppl development   iteration #9
Doppl development iteration #9Diego Perini
 
Doppl development iteration #10
Doppl development   iteration #10Doppl development   iteration #10
Doppl development iteration #10Diego Perini
 
My secret diary
My secret diary My secret diary
My secret diary Elvire1842
 
Random things
Random thingsRandom things
Random thingslschwan
 
Google keyword planner (1)
Google keyword planner (1)Google keyword planner (1)
Google keyword planner (1)Martin Roche
 
Teens problems
Teens problemsTeens problems
Teens problemsElvire1842
 
My dream house
My dream houseMy dream house
My dream houseElvire1842
 

En vedette (15)

Presentation2
Presentation2Presentation2
Presentation2
 
How to Write Academically
How to Write AcademicallyHow to Write Academically
How to Write Academically
 
Doppl development iteration #2
Doppl development   iteration #2Doppl development   iteration #2
Doppl development iteration #2
 
My tea4er is
My tea4er isMy tea4er is
My tea4er is
 
Body Fat Stripping
Body Fat StrippingBody Fat Stripping
Body Fat Stripping
 
Redes de informàtica
Redes de informàticaRedes de informàtica
Redes de informàtica
 
Richard Watson Portfolio Fall 2013
Richard Watson Portfolio Fall 2013Richard Watson Portfolio Fall 2013
Richard Watson Portfolio Fall 2013
 
Doppl development iteration #9
Doppl development   iteration #9Doppl development   iteration #9
Doppl development iteration #9
 
Halloween
HalloweenHalloween
Halloween
 
Doppl development iteration #10
Doppl development   iteration #10Doppl development   iteration #10
Doppl development iteration #10
 
My secret diary
My secret diary My secret diary
My secret diary
 
Random things
Random thingsRandom things
Random things
 
Google keyword planner (1)
Google keyword planner (1)Google keyword planner (1)
Google keyword planner (1)
 
Teens problems
Teens problemsTeens problems
Teens problems
 
My dream house
My dream houseMy dream house
My dream house
 

Similaire à Doppl development iteration #5

03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressionsmaznabili
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++sanya6900
 
C programming session 02
C programming session 02C programming session 02
C programming session 02Dushmanta Nath
 
Operators and Expressions in C#
Operators and Expressions in C#Operators and Expressions in C#
Operators and Expressions in C#Simplilearn
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteTushar B Kute
 
03. operators and-expressions
03. operators and-expressions03. operators and-expressions
03. operators and-expressionsStoian Kirov
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01Abdul Samee
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01Abdul Samee
 
Verilog operators.pptx
Verilog  operators.pptxVerilog  operators.pptx
Verilog operators.pptxVandanaPagar1
 
4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.pptRithwikRanjan
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statementsCtOlaf
 

Similaire à Doppl development iteration #5 (20)

Lecture 05.pptx
Lecture 05.pptxLecture 05.pptx
Lecture 05.pptx
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressions
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++
 
C program
C programC program
C program
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
 
Operators and Expressions in C#
Operators and Expressions in C#Operators and Expressions in C#
Operators and Expressions in C#
 
Types of Operators in C
Types of Operators in CTypes of Operators in C
Types of Operators in C
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B Kute
 
03. operators and-expressions
03. operators and-expressions03. operators and-expressions
03. operators and-expressions
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01
 
Verilog operators.pptx
Verilog  operators.pptxVerilog  operators.pptx
Verilog operators.pptx
 
Basics of c++
Basics of c++ Basics of c++
Basics of c++
 
fundamentals of c
fundamentals of cfundamentals of c
fundamentals of c
 
4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
 
Java unit 3
Java unit 3Java unit 3
Java unit 3
 
Operators1.pptx
Operators1.pptxOperators1.pptx
Operators1.pptx
 
Welcome to python workshop
Welcome to python workshopWelcome to python workshop
Welcome to python workshop
 
Report on c
Report on cReport on c
Report on c
 

Plus de Diego Perini

Doppl development iteration #8
Doppl development   iteration #8Doppl development   iteration #8
Doppl development iteration #8Diego Perini
 
Doppl development iteration #7
Doppl development   iteration #7Doppl development   iteration #7
Doppl development iteration #7Diego Perini
 
Doppl development iteration #6
Doppl development   iteration #6Doppl development   iteration #6
Doppl development iteration #6Diego 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 iteration #1
Doppl development   iteration #1Doppl development   iteration #1
Doppl development iteration #1Diego Perini
 
Doppl Development Introduction
Doppl Development IntroductionDoppl Development Introduction
Doppl Development IntroductionDiego Perini
 

Plus de Diego Perini (7)

Doppl development iteration #8
Doppl development   iteration #8Doppl development   iteration #8
Doppl development iteration #8
 
Doppl development iteration #7
Doppl development   iteration #7Doppl development   iteration #7
Doppl development iteration #7
 
Doppl development iteration #6
Doppl development   iteration #6Doppl development   iteration #6
Doppl development iteration #6
 
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 iteration #1
Doppl development   iteration #1Doppl development   iteration #1
Doppl development iteration #1
 
Doppl Development Introduction
Doppl Development IntroductionDoppl Development Introduction
Doppl Development Introduction
 

Dernier

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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...Martijn de Jong
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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 organizationRadu Cotescu
 
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 Processorsdebabhi2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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 interpreternaman860154
 
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.pptxEarley Information Science
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
[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.pdfhans926745
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
[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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Doppl development iteration #5

  • 1. DOPPL Data Oriented Parallel Programming Language Development Diary Iteration #5 Covered Concepts: Arithmetic, Relational and Binary Operators Diego PERINI Department of Computer Engineering Istanbul Technical University, Turkey 2013-07-26 1
  • 2. Abstract This paper stands for Doppl language development iteration #5. In this paper, basic operators to execute arithmetics, relations and binary operations (i.e shifting, bitwise logic) will be introduced. Previously introduced data types is used in the example source code. 1. Rationale As a high level language, Doppl uses arithmetic, relational and binary operators to compute low level calculations. These operators look nearly same with their other counterparts with a few exceptions. Each exception is explained in detail. 2. Arithmetic Operators To start with, Doppl makes use of six arithmetic operators to work with integers, floats and bytes. keyword meaning + addition - subtraction * multiplication // division with integer/byte result (floored) / division with float result % modulo +, -, *, % operators can operate on any pair of the same type and generate a result of the same type. // division operator on the other hand do only work on integers or bytes and generate a result of the same type. If the value generated cannot be represented as an integer, the value is floored. / operator always returns a float. % operator only works with integers and bytes. #Arithmetic operations task(1) Arithmetics { data a_byte = byte 2
  • 3. data an_int = int data a_float = float data another_int = int #will not be initialized #Examples init: { a_byte = 12 + 13 a_byte = 12 - 13 an_int = 12 * 13 an_int = 25 // 2 a_float = 25 / 2 an_int = 13 % 12 #25 #-1 which is converted into 0xFF #156 #12 floored from 12.5 #12.5 #1 #Below are invalid a_float = 25 // 2 #Calculation returns int or byte an_int = 12.0 + 13.0 #Type mismatch, see operator info an_int = a_float + a_byte #Type mismatch, see operator info an_int = another_int + 1 #Null data, value mismatch } } 3. Relational Operators Relational operators are special expressions that generate bool results that can be used to initialize boolean members as well as conditionally branch in a task (will be introduced later). keyword meaning < less than > greater than == equals != not equal <= less than or equal >= greater than or equal Implicit conversions are not allowed and each of these operators can only work with same type of parameters. Non-integral (i.e string) type behavior is not defined. 3
  • 4. #Relational operations task(1) Relations { data a_bool = bool #Examples init: { a_bool a_bool a_bool a_bool a_bool a_bool = = = = = = 2 < 3 2.5 > 0 1 == 1 1 != 1 15 >= 15 15 <= 14 #True #True #True #False #True #False a_bool = 1 == 1.0 #error, type mismatch } } 4. Binary Operators Binary operators are used to manipulate specific bits of values injectively. Below are the binary operators ordered by their precedence descendingly. keyword meaning & and | or ^ xor ! prefix not Like arithmetic operators, binary operators can only work on integral types. Unlike previously introduced operators, cross type usage is considered undefined behavior and should be avoided. #Binary operations task(1) Binary { data an_int = int data a_byte = byte #Examples init: { 4
  • 5. an_int an_int a_byte a_byte = = = = 0 | 0x00FF #0x00FF 1 & 0x00FF #0x00FF 0b00011111 ^ 0b11111000 #0b11100111 !0b00000001 #0b11111110 an_int = a_byte & an_int #error, undefined behavior } } It should be noted that there is no implicit type casting in Doppl therefore prefix not (!) does not yield a false when used on an integral value. 5. Conclusion Iteration #5 defines new operators to do arithmetic, relational and binary operations. Each of these operations can make use of parentheses to manipulate their order of precedence. 6. Future Concepts Below are the concepts that are likely to be introduced in next iterations. ● ● ● ● ● ● ● ● ● ● ● ● 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 Exception states 7. License CC BY-SA 3.0 http://creativecommons.org/licenses/by-sa/3.0/ 5