> Though it seems like the language misses on popular nowadays generators, lambdas and coroutines. So I would say give it a plus on language design, and there is a space to grow.
Lambdas are actually the only way to define functions.
const f = {args
/* do stuff */
}
is just assigning a lambda literal to 'f'. You can also just pass them around, if you want: use std
const main = {
var value = 42
thread.spawn({; std.put("hi from a thread. I captured {}", value)})
}
Coroutines are possible to implement as a library, and generators don't fit well -- there are iterators, though: use iter
const main = {
var v = [1,2,3,4]
for p : iter.byperm(v[:], std.numcmp)
/* use permutation p */
;;
}
> What I think could be done better: compiler infrastructure / FFI.You can already link to C, but writing the function definitons function definitions are painful. There's ongoing work to take Andrew Chambers' C compiler implementation, and extend it so that it can automatically generate the glue code.
We had a Summer of Cod[1] person working on it, but they dropped out due to lack of time.