Questions tagged [ballerina]

For questions about the Ballerina programming language

Ballerina (sometimes referred to as "Ballerina lang" or “Ballerinalang”) is an open-source programming language for the cloud that makes it easier to use, combine, and create network services. Ballerina is designed and developed by WSO2 together with the open-source community.

Type system

Ballerina is a statically typed, concurrent programming language focusing on network interactions and structured data. It has all the general-purpose functionality expected of a modern programming language, but several distinctive aspects make it particularly suitable for its intended purpose.

Ballerina provides language constructs specifically for consuming and delivering network services. Its abstractions and syntax for concurrency and network interaction have been designed to closely correspond with sequence diagrams. This enables a bidirectional mapping for any Ballerina function between its textual representation in the syntax and its graphical representation as a sequence diagram.

Ballerina has a structural type system that is more flexible and allows for looser coupling than traditional statically typed languages. Ballerina's data types are designed to work particularly well with structured data over network interactions by providing first-class support for JSON, XML, tabular data, etc.

Ballerina platform

The Ballerina language has been designed in conjunction with the Ballerina platform, which provides comprehensive support for a module-based software development model, including versioning, dependency management, testing, documentation, building, and sharing.

Code to Cloud

Ballerina Code to Cloud is designed to allow developers to write code without thinking about the deployment platform. This dramatically simplifies the experience of developing and deploying Ballerina code in the cloud.

Ballerina compiler can read configuration files and other first-class cloud-related constructs in the source code and generate artifacts to deploy the code into different clouds. These artifacts can be Dockerfile, Docker image, Kubernetes YAML's, or serverless functions required to deploy the code into different clouds.

Library

The Ballerina language includes a lang library, which provides fundamental operations on the data types defined by the language. The Ballerina platform includes an extensive standard library, which consists of the usual low-level, general-purpose functionality and support for a wide variety of network protocols, interface standards, data formats, authentication/authorization standards, etc. It makes writing secure and resilient distributed applications significantly easier than with other languages.

Ballerina reference documentation

Get started tutorials

Other resources

469 questions
-1
votes
0 answers

Parse uncommon date strings in Ballerina

I need to parse a simple date string like Jan 1, 2000 into the Ballerina record time:Civil. How do I do that effectively in Ballerina?
-1
votes
1 answer

How can I properly set the "ballerina.home" path in VS Code? VS Code keeps saying it cannot detect ballerina

I have ballerina installed but for some reason it is not detected in my VS Code environment. I tried uninstalling and reinstalling both ballerina and the ballerina extensions in VS Code to no avail. What is the "ballerina.home" path on MacBook? I…
-1
votes
2 answers

ballerinax/java.jdbc error invalid remote method call: expected a client object, but found

I am trying to setup a simple JDBC client to talk with a database in Ballerina. However the "compile" ( VSCode ) error that is shown says: invalid remote method call: expected a client object, but found…
Dmitry K
  • 7
  • 2
-1
votes
2 answers

How to do indentation in json file?

I trying to write to the jsong file. I want my json file should be written with indentation. But It has only one line. It is possible in python. How to do it in ballerina. [ { "employeeId": 2413, "odometerReading": 4089, "gallons":…
-1
votes
1 answer

How to start working with ballerina language?

I have downloaded windows visual studio and the I installed Ballerina extension but whenever I try to open the ballerina extension it shows a message " Ballerina Swan Lake is not a legitimate application or plug in". Can someone please guid me how…
-1
votes
1 answer

Ballerina pdf library

I am a newbie in using Ballerina and like to generate pdf files on server side for providing it to the client. Is there a library or a smart way to do that in Ballerina?
-1
votes
1 answer

Is there any negation logics for expressions in ballerina?

I want to know whether it is possible to negate the expression in ballerina like (not expression) or (!expression)
Inthirakumaaran
  • 369
  • 1
  • 8
-1
votes
1 answer

How to print a string with a variable in Ballerina?

An exception occurred with the following code block string text = "foo" string responseText = "print: " + text; io:println(responseText); Error: mismatched input 'string'. expecting {'but', ';', '?', '+', '-', '*', '/', '%', '==', '!=', '>', '<',…
-1
votes
2 answers

Where to find different endpoint properties in ballerina

Is there a location to find which properties are supported for different endpoint types? For example to figure out the properties supported for a mysql:Client endpoint.
user2894296
  • 590
  • 1
  • 10
  • 20
-2
votes
1 answer

How to decode a byte[] using Base64 in Ballerina?

I am passing an encoded file as a http:Request request for a ballerina REST service. I need to decode the binary payload of the request using Base64 in order to upload it to a file server. I was unable to find a way to decode a byte[] using Base64.…
shayanmalinda
  • 1,925
  • 3
  • 12
  • 23
-2
votes
1 answer

Trying to use Ballerina extension -Error: DeprecateWarning:Buffer() is deprecated due to security and usability issues -

[Error on checking the Visual studio log] I am not able to use the properties and methods of the library, the extension is not working properly, I have tried everything but nothing is working. Can somebody tell me where I need to change & what I…
-2
votes
1 answer

Undefined function in ballerina

I'm new to Ballerina. When I try to execute "ballerina run MainService.bal" I'm getting an error saying undefined function retreiveAllPatientDetails. This function is defined in another ballerina file which is in the same module as the…
-2
votes
1 answer

Ballerina: extraneous input 'S' expecting {, '','','',''} error appear once read a config using ballerina/config

The following error appears once I read a config file using ballerina/config. The error is not descriptive enough to correct the issue.
-2
votes
1 answer

How can we unpack a JSON file from an HTTP request

[{"EmployeeID":1,"Name":"Alice","Age":20,"SSN":123456789}] This is JSON file returned from a SQL query. I want to extract the name from this JSON file
-3
votes
1 answer

`io:fileReadCsv` gives cannot be cast to class `CCE` exception

Check the following code: string[][] readCsv = check io:fileReadCsv(inputCSV); it gives, error: java.lang.ClassCastException {"message":"class io.ballerina.runtime.internal.values.ErrorValue cannot be cast to class…
Joy Rathnayake
  • 485
  • 4
  • 8
1 2 3
27
28