Ballerina Apr 2026

[container.image] repository = "myorg/myapi" name = "myapi" tag = "v1.0" Ballerina includes a built-in test framework.

Cloud.toml :

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 ).

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

Run:

Ballerina has powerful query expressions and type casts .

Call:

int res1 = wait f1; string res2 = wait f2;

public function main() future<int> f1 = start task1(); future<string> f2 = start task2();

Here’s a comprehensive guide to , a modern, open-source programming language designed for cloud-native application integration and microservices development. 1. What is Ballerina? Ballerina is a graph-oriented, compiled language that treats distributed system integration as a first-class concern. It provides built-in support for network interactions, data transformations, and service resilience, making it ideal for APIs, integrations, and microservices. [container

Run tests:

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