Introduction to Ballerina

What is Ballerina?

  • Ballerina is a general-purpose, open-source programming language.
  • It specializes in solving integration/API integration/network interactions & cloud-based problems by providing the right level of language abstractions and tools.
  • Ballerina is NOT a JVM language.
  • Ballerina is a programming language which is
    • compiled : (Compiled languages are converted directly into machine code that the processor can execute. C, C++, Rust, Go are examples. In interpreted Languages, interpreters run through a program line by line and execute each command. PHP, Ruby, Python are examples. )
    • type safe :
    • concurrent :
  • Ballerina is neither an object oriented language nor a functional one.
    • While the language has objects, the development methods are not completely OOP-based.
    • Both objects and functions are first class concepts, giving developers the ability to choose the best option based on their requirements.
  • It has two implementations.
    • jBallerina - written in java to run on top of JVM. This is the first implementation to prove the language.
    • nBallerina - Compiled using LLVM, directly to the platform architecture.

What are the unique features of Ballerina?

  • Data-oriented - Ballerina makes it easy for the user to transfer, declare, manipulate, process and query the data.
  • Network oriented - Ballerina has language constructs/concepts which capture network primitives. (E.g., type system concepts to easily bind data coming via network to language types, service types, client types, etc.)
  • Graphical representation - Can easily explain network interactions via sequence diagrams. Each program has both a textual syntax and an equivalent graphical form based on sequence diagrams
  • Enterprise-grade application development - Built-in concurrency, Explicit error handling, transactions, full life cycle management concepts including testing, documenting, configurability, dependency management & versioning
  • Cloud-Native - Reduces the gap between development to deployment and makes it easier for the developer to write the application and instruct how it should be deployed in the cloud.