Ballerina (programming language)
Ballerina is a general-purpose programming language with features optimized for distributed computing applications. It is easy to write and modify and is suitable for application programmers.[4][5][6]
![]() | |
Designed by | Sanjiva Weerawarana, James Clark, Sameera Jayasoma, Hasitha Aravinda, Srinath Perera, Frank Leymann and WSO2[1] |
---|---|
Developer | WSO2 |
First appeared | 2017 |
Typing discipline | Structural, strong, static, inferred |
OS | Cross-platform |
License | Apache License 2.0[2] |
Website | ballerina |
Influenced by | |
Java, Javascript, Go, Rust, C#[3] |
It is an open source project [7] started in 2015 by architects from WSO2 as code-based alternative to the configuration-based integration tools such as EAI, ESB, and workflow products.[8][9]
Ballerina has various constructs geared toward cloud-native development including support for modern data formats and protocols, reliability, distributed transactions, APIs, and event streams.[10][11]
Examples
A simple hello world service is depicted below.
// To start the service, navigate to the directory that contains the
// `.bal` file and execute the `ballerina run` command.
import ballerina/http;
import ballerina/log;
service hello on new http:Listener(9090) {
resource function sayHello(http:Caller caller, http:Request req) {
var result = caller->respond("Hello, World!");
if (result is error) {
log:printError("Error sending response", err = result);
}
}
}
Print “Hello, World!” in parallel using workers
import ballerina/io;
public function main() {
worker w1 {
io:println("Hello, World! #m");
}
worker w2 {
io:println("Hello, World! #n");
}
worker w3 {
io:println("Hello, World! #k");
}
}
References
- "Ballerina Language Specification". WSO2.
- "WSO2 / LICENSE". github.com. WSO2. 2017-03-08. Retrieved 2018-03-01.
- "Ballerina, A modern programming language focused on integration" (PDF): 15. Cite journal requires
|journal=
(help) - Jackson, Joab. "Ballerina: An API-First Programming Language". The New Stack. Retrieved 2018-06-11.
- Foremski, Tom (2019-03-01). "Technology and the Arts: Celebrating Ballerina, a computer language of integration". Retrieved 2019-07-14.
- Lawton, George (2018-11-01). "Ballerina language promises to improve app integration". Retrieved 2019-07-23.
- Open Source Contributors (18 June 2019). "Ballerina source code". GitHub.
- "Ballerina Microservices Programming Language: Introducing the Latest Release and "Ballerina Central"". InfoQ. Retrieved 2018-06-07.
- Earls, Alan (2019-03-01). "How does Ballerina stack up as a cloud-native programming language?". Retrieved 2019-07-23.
- Posta, Christian. "Evolution of Integration and Microservices with Service Mesh and Ballerina". Retrieved 2019-07-24.
- staff, Techworld. "Top programming languages you should try". Techworld. Retrieved 2018-06-07.
- Ballerina Team (18 June 2019). "Using workers". ballerina.io.
Further reading
- Fernando, Anjana, Warusawithana, Lakmal (2020) Beginning Ballerina Programming, Apress (part of Springer Nature)
External links
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.