WeakLang Playground

See Github
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Weak is a programming language created by Russel Arbore, Tony Helsel,
# Chris Sapinski, and Ryan Ziegler, for our CS128 final project. It's 
# an interpreted language designed to make you more productive, with 
# simple keywords like "f", "p", or "w" instead of cumbersome, time-consuming
# ones like "for", "print", or "while". And, when using Weak on your computer
# (not browser), we provide high-performance matrix computations with the
# BLAS library. We hope you enjoy writing Weak as much as we did creating it.
# We've included a sample program below, and you can find complete language
# documentation on our GitHub (https://github.com/rzig/weaklang).
# Program prompt: https://adventofcode.com/2021/day/1
f dim(mat) {
    r (s (s mat))[0];
}
f len(list) {
    v dim(list) == 1;
    r (s list)[0];
}
f part_one(depths) {
    v dim(depths) == 1;
    a len = len(depths);
    v len >= 1;
    a j = 1;
Enter to Rename, Shift+Enter to Preview
1
Enter to Rename, Shift+Enter to Preview