| I've used Cello for a few side projects, and it doesn't even really feel like C in the end. Just a few off the top of my head: * No need to specify type. Use var. * Simpler for loops * Inbuilt types for Hash Tables * File types, making file reading much easier * Function types, making it easier to pass functions around * Doctype access * Threads & Mutexes * Format strings * GC (with ability to turn C-types into Cello-types for GCing.) It is fundamentally syntax-sugar, but enough that what you end up with doesn't necessarily look like C at the end. with(f in new(File, $S("test.txt"), $S("r"))) {
var k = new(String); resize(k, 100);
var v = new(Int, $I(0));
foreach (i in range($I(2))) {
scan_from(f, 0, "%$ is %$ ", k, v);
show(k); show(v);
}
}
(From: http://libcello.org/learn/file) |
I see types everywhere; they appear to just have been moved from the left-hand side to the right-hand side? eg: