Ballerina (programming language): Difference between revisions

Content deleted Content added
MOS:HEAD
m Grammar
 
(17 intermediate revisions by 14 users not shown)
Line 1:
{{Short description|Programming language}}
{{Infobox programming language
| name = Ballerina
| logo = Official_Ballerina_Programming_Language_LogoOfficial Ballerina Programming Language Logo.png
| logo_altlogo alt = Ballerina Language
| logo_size = 200px
| designer = [[Sanjiva Weerawarana]], [[James Clark (programmer)|James Clark]], Sameera Jayasoma, Hasitha Aravinda, Srinath Perera, [[Frank Leymann]] and [[WSO2]]<ref>{{cite web |url=https://ballerina.io/spec/lang/master/ |publisher=WSO2 |title=Ballerina Language Specification |access-date=2020-04-24 |archive-date=2020-08-11 |archive-url=https://web.archive.org/web/20200811095205/https://ballerina.io/spec/lang/master/ |url-status=dead}}</ref>
| logo_alt = Ballerina Language
| released = {{Start date and age|2017}}
| designer = [[Sanjiva Weerawarana]], [[James Clark (programmer)|James Clark]], Sameera Jayasoma, Hasitha Aravinda, Srinath Perera, [[Frank Leymann]] and [[WSO2]]<ref>{{cite web|url=https://ballerina.io/spec/ |publisher=WSO2 |title=Ballerina Language Specification}}</ref>
| developer = [[WSO2]]
| released = {{Start date and age|20172019|09|10}}
| typing = [[structural typing|Structural]], [[strong typing|strong]], [[static typing|static]], [[type inference|inferred]]
| latest release version = 2201.12.3 (Swan Lake Update 12)
| influenced by = [[Java (programming language)|Java]], [[Javascript (programming language)|Javascript]], [[Go (programming language)|Go]], [[Rust (programming language)|Rust]], [[C Sharp (programming language)|C#<ref>{{cite journal |title=Ballerina, A modern programming language focused on integration |pages=15 |url=https://opensource.ellak.gr/wp-content/uploads/sites/5/2018/06/2018-06-Ballerina-GFOSS.pdf}}</ref>]]
| latest release date = {{Start date and age|2025|04|10}}
| programming language = Java, Ballerina, TypeScript<ref name="sourcecode" />
| typing = [[structuralStructural typing|Structural]], [[strongStrong and weak typing|strong]], [[static typing|static]], [[type inference|inferred]]
| platform =
| influenced by = [[Java (programming language)|Java]], [[Javascript (programming language)|JavascriptJavaScript]], [[Go (programming language)|Go]], [[Rust (programming language)|Rust]], [[C Sharp (programming language)|C#]]<ref>{{cite journalweb |title=Ballerina, A modern programming language focused on integration |pages=15 |url=https://opensource.ellak.gr/wp-content/uploads/sites/5/2018/06/2018-06-Ballerina-GFOSS.pdf}}</ref>]]
| operating_system = [[Cross-platform]]
| programming language = [[Java (programming language)|Java]], Ballerina, [[TypeScript]]<ref name="sourcecode" />
| license = [[Apache License]] 2.0<ref name="license">{{cite web
| platform = [[x86-64]]
| url = https://github.com/ballerina-platform/ballerina-lang/blob/master/LICENSE
| operating system = [[Cross-platform software|Cross-platform]]: [[Microsoft Windows|Windows]], [[Linux]], [[macOS]]
| title = WSO2 / LICENSE
| license = [[Apache License|Apache]] 2.0<ref name="license">{{cite web
| date = 2017-03-08 | access-date = 2018-03-01
| url = https://github.com/ballerina-platform/ballerina-lang/blob/master/LICENSE
| website = github.com | publisher = [[WSO2]]
| title = WSO2 / LICENSE
| date = 2017-03-08 | access-date = 2018-03-01
| website = github.com | publisher = [[WSO2]]
}}</ref>
| website = {{URL|http://ballerina.io/}}
}}
'''Ballerina''' is an [[Open-source model|open source]]a general-purpose [[programming language]] designed by [[WSO2]] for cloud-era application [[programmers]].<ref name="sourcecode">{{cite web |url=https://github.com/ballerina-platform/ballerina-lang |title=Ballerina source code |author=((Open Source Contributors)) |date=18 June 2019 |publisher=[[GitHub]]}}</ref> It is [[free and open-source software]] released under [[Apache License]] 2.
 
The project started in 2015 by architects from [[WSO2]] as a code-based alternative to the configuration-based integration tools such as [[Enterpriseenterprise application integration|EAI]] (EAI), [[Enterpriseenterprise service bus|ESB]] (ESB), and workflow products.<ref>{{Cite web|url=https://www.infoq.com/articles/ballerina-microservices-language-part-1|title=Ballerina Microservices Programming Language: Introducing the Latest Release and "Ballerina Central"|website=InfoQ|access-date=2018-06-07}}</ref><ref>{{Cite news|url=https://searchmicroservices.techtarget.com/tip/How-does-Ballerina-stack-up-as-a-cloud-native-programming-language|title=How does Ballerina stack up as a cloud-native programming language?|first=Alan|last=Earls|date=2019-03-01|access-date=2019-07-23}}</ref>
 
It has various constructs geared toward cloud-native development including support for various data formats and protocols, reliability, distributed transactions, [[Applicationapplication programming interface|APIsinterfaces ([[API]]s), and event streams.<ref>{{Cite news|url=https://searchapparchitecture.techtarget.com/tip/10-of-the-best-programming-languages-to-learn-in-2020|title=10 of the best programming languages to learn in 2020|last=Doyle|first=Kerry|access-date=2020-09-16|language=en-GB}}</ref><ref>{{cite web|url=https://www.youtube.com/watch?v=rRrJKM0BAAo|title=Evolution of Integration and Microservices with Service Mesh and Ballerina|last=Posta|first=Christian|website=[[YouTube]] |access-date=2019-07-24|language=en-GB}}</ref><ref>{{Cite news|url=https://www.techworld.com/picture-gallery/careers/up-coming-programming-languages-for-developers-get-grips-with-3621455/|title=Top programming languages you should try|author=Techworld staff|work=Techworld|access-date=2018-06-07|language=en-GB}}</ref>
 
== History ==
Line 30 ⟶ 32:
 
== Design ==
Ballerina is a general-purpose language with a familiar syntax along with a direct graphical representation of the code in the form of sequence diagrams. It has fundamental abstractions designed to make integration problems easier to program.<ref>{{cite web |last1=Ratnayake |first1=Dakshitha |title=Ballerina Swan Lake: 10 Compelling Language Characteristics for Cloud Native Programming |url=https://www.infoq.com/articles/ballerina-cloud-native-programming/ |website=InfoQ |publisher=InfoQ |access-date=1 March 2022}}</ref> Ballerina was designed by WSO2 to improve productivity for application developers that have to work with [[distributed computing]]. It is easy to write and modify and is suitable for application programmers.<ref>{{Cite news|url=https://thenewstack.io/ballerina-an-api-first-programming-language/|title=Ballerina: An API-First Programming Language|last=Jackson|first=Joab|work=The New Stack|access-date=2018-06-11|language=en-US}}</ref><ref>{{Cite news|url=https://www.zdnet.com/article/ballerina-a-language-of-integration-of-technology-and-the-arts/|title=Technology and the Arts: Celebrating Ballerina, a computer language of integration|first=Tom|last=Foremski|date=2019-03-01|access-date=2019-07-14}}</ref><ref>{{Cite news|url=https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/Ballerina-language-promises-to-improve-app-integration|title=Ballerina language promises to improve app integration|first=George|last=Lawton|date=2018-11-01|access-date=2019-07-23}}</ref>
 
The designers, who provided [[enterprise integration]] products for over 10 years, used their knowledge of the industry when designing the language,<ref>{{Cite news|url=https://blog.jclark.com/2019/09/ballerina-programming-language-part-0.html|title=Ballerina Programming Language Part 0 - Context|last=Clark|first=James|access-date=2020-09-16|language=en-GB}}</ref><ref>{{Cite news|url=https://blog.jclark.com/2019/09/ballerina-programming-language-part-1.html|title=Ballerina Programming Language Part 1 - Concepts|last=Clark|first=James|access-date=2020-09-16|language=en-GB}}</ref> says WSO2 director and Ballerina founder James Clark.
Line 54 ⟶ 56:
 
The service version of the Hello World program:
<syntaxhighlight lang="texttypescript">
import ballerina/http;
 
Line 71 ⟶ 73:
</syntaxhighlight>
 
<ref name="example1">{{cite web |url=https://ballerina.io/learn/by-example/hello-world-service.html |title= Hello world service |author=Ballerina Team |date=16 September 2020 |publisher=ballerina.io |access-date=16 September 2020 |archive-date=16 September 2020 |archive-url=https://web.archive.org/web/20200916185848/https://ballerina.io/learn/by-example/hello-world-service.html |url-status=dead}}</ref>
 
=== REST API ===
Line 168 ⟶ 170:
 
=== Code to cloud ===
Docker and Kubernetes artifacts required for deploying the code to the cloud can be generated when building the code. Values required for these artifacts are derived from the code. Additionally, one can override these values as well using the <code>Cloud.toml</code> file. To enable generation of the cloud artifacts, the users can use the <code>cloud</code> build option in the <code>Ballerina.toml</code> file. Use <code>docker</code> to generate just the Docker image and the Dockerfile and use <code>k8s</code> to generate Kubernetes artifacts as well. Minimal sample config [[TOML]] files would look something like the following:
 
<code>Ballerina.toml</code> file:
Line 252 ⟶ 254:
 
== External links ==
* {{Official website|ballerina.io}}
* {{GitHub|ballerina-platform}}
 
* https://ballerina.io
* https://github.com/ballerina-platform/ballerina-lang GitHub repository.
{{Programming languages}}
 
Line 266 ⟶ 268:
[[Category:Free software projects]]
[[Category:Cross-platform free software]]
<!-- Hidden categories below -->
[[Category:Articles with example code]]