Ballerina May 2026

worker w1 returns int return 10;

string? maybeName = "Jane"; maybeName = (); // nil function divide(int a, int b) returns int|error if b == 0 return error("Division by zero"); ballerina

int|error result = divide(10, 0); if result is error io:println("Error: ", result.message()); worker w1 returns int return 10; string

public function main() future<int> f1 = start task1(); future<string> f2 = start task2(); worker w1 returns int return 10

curl http://localhost:9090/api/greeting/John Call external services using built-in clients.

Ballerina has powerful query expressions and type casts .