©2019 Cray Inc.
[Scope]
Chapel is a new parallel programming language that is under development at Cray Inc. in the context of the DARPA High Productivity Computing Systems initiative.
class Chapel < Formula | |
desc "Programming language for productive parallel computing at scale" | |
homepage "https://chapel-lang.org/" | |
url "https://github.com/chapel-lang/chapel/releases/download/1.25.1/chapel-1.25.1.tar.gz" | |
sha256 "0c13d7da5892d0b6642267af605d808eb7dd5d4970766f262f38b94fa2405113" | |
license "Apache-2.0" | |
revision 1 | |
bottle do | |
sha256 arm64_monterey: "e11d484b8dbeb19649b46ebadb1ff063e79a3fa7c3e1befc258c6fd28a4712a2" |
/* | |
Program to demonstrate managing total timeout across many | |
event_add calls. | |
It accepts input on stdin for 2 seconds and demonstrates running | |
for 2 seconds whether there is input or not. | |
*/ | |
#include <errno.h> |
# Install gpg helper tools | |
sudo apt-get install gnupg-agent pinentry-curses | |
# Fix permission on the included git-credential-netrc | |
sudo chmod a+x /usr/share/doc/git/contrib/credential/netrc/git-credential-netrc | |
# create a GitHub access token for this | |
# Go to Settings -> Developer Settings -> Personal access tokens -> Generate new token | |
# We will save the token in an encrypted .netrc file below | |
# create a gpg key (if you do not have one already on the machine) |
// shows program modified to avoid array views in inner loops | |
class AbstractKernel { | |
// assumes x[xfirst, ..] and y[yfirst, ..] have shape 1..p | |
proc kernel(x, xfirst: int, y: [?D] ?T, yfirst: int, p: int): T | |
{ | |
return x[xfirst, 0]; // out of bounds (intentionally?) | |
} | |
} |
module OtherMSBRadix { | |
use Shell; | |
use Time; | |
/* Sorting criterion has a method: | |
(key:uint,done:bool) = criterion.keyBits(record, startbit) | |
(cmp=-1,0,1,nsamebits) = criterion.prefixCompare(recordA, recordB) | |
cmp=-1,0,1 = criterion.compare(recordA, recordB) |
class Fighter { | |
var subclass:string; | |
var level:int; | |
} | |
var mem = openmem(); | |
var writer = mem.writer().write('{"subclass":"ninja", "level":3}'); | |
var reader = mem.reader(); | |
// This works |
proc testOnBegin() { | |
sync { | |
on Locales[numLocales-1] do begin { | |
writeln("HERE"); | |
} | |
} | |
} | |
testOnBegin(); |
proc bar() { | |
writeln("in bar"); | |
} | |
module Bug { | |
proc foo() { | |
writeln("in foo"); | |
} | |
} |
#include <stdio.h> | |
void setit(int* ptr) { | |
*ptr = 200; | |
} | |
void f(int x) { | |
printf("%i\n", x); | |
} |