View Language Specification [Pdf]

View Language Specification [Pdf]

Chapel Language Specification Version 0.984 Cray Inc 901 Fifth Avenue, Suite 1000 Seattle, WA 98164 October 5, 2017 c 2017 Cray Inc. Contents 1 Scope 13 2 Notation 14 3 Organization 16 4 Acknowledgments 18 5 Language Overview 19 5.1 Guiding Principles . 19 5.1.1 General Parallel Programming . 19 5.1.2 Locality-Aware Programming . 20 5.1.3 Object-Oriented Programming . 20 5.1.4 Generic Programming . 21 5.2 Getting Started . 21 6 Lexical Structure 22 6.1 Comments . 22 6.2 White Space . 22 6.3 Case Sensitivity . 22 6.4 Tokens . 22 6.4.1 Identifiers . 23 6.4.2 Keywords . 23 6.4.3 Literals . 24 6.4.4 Operators and Punctuation . 26 6.4.5 Grouping Tokens . 27 7 Types 28 7.1 Primitive Types . 28 7.1.1 The Void Type . 29 7.1.2 The Bool Type . 29 7.1.3 Signed and Unsigned Integral Types . 29 7.1.4 Real Types . 30 7.1.5 Imaginary Types . 30 7.1.6 Complex Types . 30 7.1.7 The String Type . 30 7.2 Enumerated Types . 31 7.3 Structured Types . 32 7.3.1 Class Types . 32 7.3.2 Record Types . 32 7.3.3 Union Types . 32 7.3.4 Tuple Types . 32 7.4 Data Parallel Types . 33 7.4.1 Range Types . 33 7.4.2 Domain, Array, and Index Types . 33 7.5 Synchronization Types . 33 3 Chapel Language Specification 4 7.6 Type Aliases . 34 8 Variables 35 8.1 Variable Declarations . 35 8.1.1 Default Initialization . 36 8.1.2 Deferred Initialization . 37 8.1.3 Local Type Inference . 37 8.1.4 Multiple Variable Declarations . 37 8.2 Module Level Variables . 38 8.3 Local Variables . 39 8.4 Constants . 39 8.4.1 Compile-Time Constants . 39 8.4.2 Runtime Constants . 40 8.5 Configuration Variables . 40 8.6 Ref Variables . 40 9 Conversions 42 9.1 Implicit Conversions . 42 9.1.1 Implicit Numeric, Bool and Enumeration Conversions . 43 9.1.2 Implicit Compile-Time Constant Conversions . 44 9.1.3 Implicit Statement Bool Conversions . 44 9.2 Explicit Conversions . 44 9.2.1 Explicit Numeric Conversions . 44 9.2.2 Explicit Tuple to Complex Conversion . 45 9.2.3 Explicit Enumeration Conversions . 45 9.2.4 Explicit Class Conversions . 46 9.2.5 Explicit Record Conversions . 46 9.2.6 Explicit Range Conversions . 46 9.2.7 Explicit Domain Conversions . 46 9.2.8 Explicit Type to String Conversions . 47 10 Expressions 48 10.1 Literal Expressions . 49 10.2 Variable Expressions . 49 10.3 Enumeration Constant Expression . 49 10.4 Parenthesized Expressions . 49 10.5 Call Expressions . 50 10.6 Indexing Expressions . 50 10.7 Member Access Expressions . 50 10.8 The Query Expression . 50 10.9 Casts . 51 10.10 LValue Expressions . 51 10.11 Precedence and Associativity . 52 10.12 Operator Expressions . 54 10.13 Arithmetic Operators . 54 10.13.1 Unary Plus Operators . 55 10.13.2 Unary Minus Operators . 55 10.13.3 Addition Operators . 56 10.13.4 Subtraction Operators . 57 10.13.5 Multiplication Operators . ..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    293 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us