Ballerina (programming language)
| 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] | |
Search Ballerina (programming language) on Amazon.
Ballerina is a general-purpose programming language with features optimized for network distributed applications. It is easy to write and modify and is suitable for application programmers.[4][5][6]
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]
Features
- Services: First-class language constructs for providing and consuming services
- Sequence diagrams: The structure of functions and programs allows them to be viewed as sequence diagrams showing the interactions between concurrently executing parts
- Structural typing: Allows for looser coupling between distributed components and eliminates the friction of data binding
- Metadata: Extensible metadata enables easy integration of Ballerina programs with cloud platforms
- Batteries included: Not just a language but a complete ecosystem, including a standard library, module repository, testing framework, and documentation system
- Familiar: Designed to feel familiar to anybody with experience in popular C-family languages such as C/C++, C#, Java or JavaScript
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" (PDF). WSO2. 2018-05-01. Archived from the original (PDF) on 2018-05-04. Retrieved 2018-05-03.
- ↑ "WSO2 / LICENSE". github.com. WSO2. 2017-03-08. Retrieved 2018-03-01.
- ↑ "Ballerina, A modern programming language focused on integration" (PDF): 15.
- ↑ 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.
External links
This article "Ballerina (programming language)" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Ballerina (programming language). Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.
| This page exists already on Wikipedia. |
