Ballerina ⇒

function externalCall() returns string|error return error("Network failure");

int[] highSalaries = from var e in employees where e.salary > 5500 select e.salary; Generate Docker and Kubernetes artifacts using bal build .

Call:

bal run hello.bal Variables & Types int age = 30; string name = "Alice"; boolean active = true; float pi = 3.14; decimal precise = 10.0d; byte[] data = [1, 2, 3]; json j = "name": "Bob" ; xml x = `<person>John</person>`; Optional Types & Error Handling Ballerina uses optional types ( T? ) and error union types ( T|error ).

return a / b;

Cloud.toml :

brew install ballerina

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

© An Tran - 2025