Changes

Jump to: navigation, search

GPU621/The Chapel Programming Language

709 bytes added, 13:39, 20 November 2020
Language Basics
//https://chapel-lang.org/docs/primers/
=== Language Basics ===
Variables are declared with the '''var''' keyword. Variable declarations must have a type, initializer, or both.
 
<code>
var myVariable1: int;
</code>
 
'''const''' and '''param''' can be used to declare runtime constants and compile-time constants respectively. A '''const''' must be initialized in place, but can have its value generated at runtime. A '''param''' must be known at compile time.
 
<code> const myConst: real = sqrt(myVariable2);<br>
param myParam = 3.14; </code>
 
All three variable kinds can be qualified by the '''config''' keyword. This allows the initial value to be overridden on the command line.
 
<code>
config var myVariable2: bool = false; //./variable --myVariable=true
</code>
 
=== Iterators ===
=== Task Parallelism ===
25
edits

Navigation menu