0:0040:18

Ballerina: Cloud-Native Middleware as a Programming Language

Anupama Pathirage 40:18 2022

A language where the sequence diagram and the code are the same thing

Change the code and the sequence diagram redraws itself; edit the diagram and the code rewrites. That is one of the bets behind Ballerina, an open source language WSO2 built for integration-heavy, cloud-bound services. Anupama Pathirage, a Director of Engineering at WSO2 who has worked on its compiler and runtime, live-codes a book search service against real APIs. Can a language really absorb the plumbing developers now write by hand?

Watch a live build of a REST service, from network calls to generated Docker and Kubernetes files

Watch on YouTube

In short

Anupama Pathirage, Director of Engineering at WSO2, explains why integration-heavy, cloud-bound applications call for a language with network concepts built in, and introduces Ballerina's design and key features. She then live-codes a REST service that calls external APIs, maps JSON to typed records, renders a sequence diagram and generates Docker and Kubernetes artifacts.

“So cloud development is not something that we can avoid.”
“That means if you edit the code, diagram will be auto-generated. And if you edit the diagram, code will be generated.”

What you will learn

  • Explain why integration-heavy cloud applications need network abstractions, a network-aware type system and built-in concurrency support.
  • Build and call HTTP APIs with Ballerina clients, services and resource functions.
  • Handle network errors with union types, type narrowing and the check keyword instead of exceptions.
  • Apply open records to incoming data, closed records to responses, and query syntax to transform data.
  • Generate Docker and Kubernetes artifacts from code and keep code and sequence diagrams in sync.

Key takeaways from the speaker

  • Latest trends in integration and cloud native development
  • Open source development and its importance
  • Art of programming language development

Details

Level
Intermediate
Format
Tech talk
Technical depth
Practitioner
For
Early career, Mid-career, Senior individual contributor
Length
40:18
Published
July 2022

Questions this talk answers

Why did WSO2 build a new programming language?

Modern applications are integration heavy and need network abstractions, a network-aware type system, protocol support, concurrency, cloud friendliness and visualization in one platform. Without that, developers rely on third-party tools.

Is Ballerina a JVM language?

No. jBallerina is written in Java, runs on the JVM and is production ready, while nBallerina compiles natively with LLVM and was still in progress.

How does Ballerina handle errors from network calls?

Instead of throwing exceptions, functions return errors as part of union types. The check keyword passes errors up, and an HTTP listener turns a returned error into an HTTP 500 or relevant error.

How does Ballerina help move code into the cloud?

Building with a cloud option such as Kubernetes generates the Dockerfile and Kubernetes YAML descriptors automatically, with optional configuration in a Cloud.toml file.

How can developers get involved with Ballerina?

Through its Slack and Google group, and by contributing to the free, open source code on GitHub.

About this talk

Ballerina is a cloud-native open source programming language tailored for network awareness and microservices development. The language is uniquely positioned in the cloud-native domain and focuses on boosting developer productivity in highly disaggregated architectures.

With the traditional programming languages, solving Integration problems and dealing with the complexities of distributed programming models is not that easy. The inherently complex nature of integration problems and infrastructure requirements of cloud-era applications can challenge the success of digital transformation projects.

Ballerina is an attempt to build a modern, industrial-grade, general-purpose language optimized for integrating and writing network services and applications. One of its key objectives is to simplify micro-services and integration-heavy programming by offering network primitives within the language. The network-aware type system, first-class support for network services and resources, distributed transactions, stream processing, cloud support, sequence diagrammatic syntax, etc., in Ballerina, simplifies building and deploying cloud-native applications. Also, Ballerina has built-in support for various technologies and protocols such as HTTP, gRPC, GraphQL, WebSockets, NATS, Kafka, OpenAPI, etc. This makes it a much more intuitive experience for the developer.

Ballerina Swan Lake version, which was released in February 2022, has introduced significant language features. This talk will focus on the key traits of the language with a live coding session on real-world examples of how it can boost developer productivity.

Topics

Related talks

Browse the library