four months of coastal living: coastML at four months

Today marks four months of coastal living; let’s checkout the running burndown chart:

Wow have we fixed a lot of bugs this month, and there’s a few new forms that work nicely. The various pervasives such as array-iter now rewrite to nicely-compact Python forms, and some issues around their usage has been fixed. I’m tracking their usage in the extra/ folder, as a demo of how they should work:

% ./carpet.py load extra/basis-examples.coast
main ['./carpet.py', 'load', 'extra/basis-examples.coast']
loading: extra/basis-examples.coast
[CoastAST(a is function[int int int] = fn x y {
    x + y
}), CoastAST(adder is function[int int] = fn x {
    x + x
}), CoastAST(l is function[int unit] = fn x {
    print "x is: " x;
}), CoastAST(ll = fn idx value {
    print "x at offset " idx " is " value;
}), CoastAST(s is function[char unit] = fn x {
    print "x is: " x;
}), CoastAST(b is int = 10), CoastAST(g = array-make 10 0;), CoastAST(h = array-init 10 adder;), CoastAST(m = array-make-matrix 5 6 0;), CoastAST(f = array-map adder h;), CoastAST(j = array-map-index a h;), CoastAST(array-iter l f;), CoastAST(array-iter-index ll f;), CoastAST(string-iter s "hello, world";), CoastAST(a-i-func = fn l f {
    array-iter l f;
}), CoastAST(a-i-func l f;)]
% ./carpet.py python extra/basis-examples.coast
main ['./carpet.py', 'python', 'extra/basis-examples.coast']
pythonizing: extra/basis-examples.coast
def a(x, y):
    return (x + y)

def adder(x):
    return (x + x)

def l(x):
    return print("x is: ", x)

def ll(idx, value):
    return print("x at offset ", idx, " is ", value)

def s(x):
    return print("x is: ", x)

b = 10
g = [0 for _ in range(0, 10)]
h = [adder(x0) for x0 in range(0, 10)]
m = [[0 for _ in range(0, 5)] for _ in range(0, 6)]
f = [adder(x1) for x1 in h]
j = [a(idx2, h[idx2]) for idx2 in range(0, len(h))]
for x3 in f:
    l(x3)

for idx4 in range(0, len(f)):
    x5 = f[idx4]
    ll(idx4, x5)

for x6 in "hello, world":
    s(x6)

def a_i_func(l, f):
    for x7 in f:
        l(x7)


a_i_func(l, f)