Paul Krill
Editor at Large

Ballerina revamps RESTful services support

news
Feb 11, 20222 mins

Programming language designed for building cloud-native applications adds ‘first class’ support for data-oriented protocols such as GraphQL and RPC-style protocols such as gRPC.

flexible ballerina graceful ballet agile
Credit: Thinkstock

Ballerina 2201.0.0, aka “Swan Lake,” is now available in a production-ready, General Availability version. Swan Lake was announced February 1, following six beta releases. 

A “major overhaul” of the cloud-geared programming language, the Swan Lake release adds language features and platform tools that make it easier to build programs that deal with network interactions, data, and concurrency, and that are easy to maintain, the Ballerina team said.

Developed by WS02, Ballerina can be downloaded from ballerina.io. The new features and improvements in Swan Lake:

  • Ballerina services have been redesigned to support RESTful services in a “first-class” way. Services have become service objects that work uniformly with client objects. Service objects can have both remote methods, supporting RPC-style protocols, or resource methods, supporting data-oriented protocols such as HTTP or GraphQL.
  • Objects work in a more familiar and ergonomic way, through the introduction of class definitions.
  • Distinct types provide functionality similar to nominal types but within the framework of the Ballerina structural type system. Distinct types work with objects and errors.
  • The table type has been redesigned to work consistently with structural types.
  • Enum declarations provide a more convenient and familiar syntax for working with unions of strong constants.
  • An isolated qualifier has been added to enable compile-time concurrency safety.
  • A read-only type enables the type system to offer immutability guarantees.
  • Error handling has been improved. Ballerina’s developers have built on distinct types to rework how error types are defined. Also, on-fail clauses have been added, allowing control over the effect of check expressions.
  • The Ballerina Central UI has been refreshed to support packages and enhance the user experience.
  • Standard library APIs have been redesigned by leveraging the latest language features.
  • bal shell, an interactive command-line tool to prototype Ballerina code, makes its debut.
  • The Ballerina Visual Studio Code extension was revamped to improve the editing experience.

Since the Ballerina 1.0 release in 2019, integration features have been added such as querying, transactions, streams, table support, and database integration. JSON and XML support also have been included.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author