The Crow Programming Language

Controlling Resources

Parallelism defaults to all cores; two builtins adjust it when you need to:

1
2
3
cpu[8]      --- cap the next loops at 8 threads
cpu[1]      --- one core: every loop in order
gpu[]       --- enable GPU execution for tensor work

Running a program as several processes is the launch's, not the program's: crow launch 4 train.co runs four, and each reads its rank with env['CROW_RANK', '0'].

That's the entire concurrency API. There are no threads to spawn, no futures to await, no locks to take — the scope rule (chapter 4) plus the read/write analysis make the safe thing the only thing.

Next: what happens when an operation fails — Crow's other big idea.