v1.2.5 - Coco Loco
// Sweet and simple! ☕
fn greet(name) {
return "Hello, #{name}!";
}
let message = greet("World");
print message;
// Lambdas are smooth
let double = |x| => { return x * 2; };
print double(21);
// Pattern matching like a boss
match day {
case 1 => { print "Monday"; }
case 5 => { print "Friday"; }
default => { print "Weekend!"; }
}
Clean, expressive syntax with lambdas, pattern matching, and closures
File I/O, string manipulation, math functions, and array operations built-in
Build beautiful desktop applications with native GUI bindings
Interactive shell for rapid prototyping and experimentation
Elegant control flow with match/case statements
Beginner-friendly with clear error messages and intuitive design
Cocoa includes GTK4 bindings for creating native desktop applications with ease!
// Build GUIs with ease! 🎨
gui_init("com.myapp.demo");
let window = gui_window("Cocoa App", 400, 300);
let box = gui_box("vertical", 10);
let button = gui_button("Click me!");
let label = gui_label("Hello Cocoa!");
gui_add(window, box);
gui_add(box, label);
gui_add(box, button);
fn on_click() {
gui_set_text(label, "Button clicked!");
}
gui_on(button, "clicked", "on_click");
gui_show(window);
gui_run();
Turn your Cocoa scripts into standalone executables with the built-in compiler:
# Compile your Cocoa app
choco compile myapp.choco
# Specify output name
choco compile myapp.choco -o myprogram
# Compile without GUI support
choco compile myapp.choco --no-gui