How does Ballerina differ from other languages?

Does Ballerina an interpreted language?

Ballerina is compiled and then interpreted.

How to build Ballerina programs? Do we need to set Ballerina Home or any other system variables?

You can use a text editor that you prefer or some IDEs (currently baallerina supports vim,IDEA,sublime Text3,VCS and atom) to write you ballerina program. When you have the source bal file. You can either package that as an archive (library, service or main) or simply run the single bal file. e.g. ballerina run main <path to bal path> (or you can give the path to archive) or ballerina run service <path to archibe (or you can give the path to archive .bsz)>

You don't have to set Ballerina home. It will be set by the ballerina itself. But you need to set the JAVA_HOME

How Ballerina supports dependency management? Are there any recommended build tools?

It is pretty much similar to Go language, refer the documentation for more info.

What kind of tasks are recommended to do with Ballerina? Is it only suitable to do a specific task such as integration of various system?

If your program contains about 80% or more of integration scenarios, then Ballerina would be a great candidate to try. But if the integration portion is pretty much less (< 20%) then you can think of something else. If the portion vary then you can decide based on your use case.

Where can I find language specification and what are the types supported in Ballerina?

Please refer Github location and Ballerinalang for more information.


  1. Is Ballerina an interpreted language?

Ballerina is a compiled programming language. It compiles to a platform-neutral binary form which is then interpreted by the Ballerina runtime.

  1. How to build Ballerina programs? Do we need to set Ballerina Home or any other system variables?

There is no system variable concept when it comes to Ballerina. Download and install the OS-specific installer from https://ballerina.io/downloads/

Running Ballerina programs

Use ballerina run command to compile and run Ballerina programs.

$ ballerina run hello.bal
Hello, World!

Use ballerina build command to produce a statically-linked executable binary with the extension "balx". Then use ballerina run command to run the program.

$ ballerina build hello.bal
$ ls 
hello.bal hello.balx
$ ballerina run hello.balx
Hello, World!
  1. How Ballerina supports dependency management? Are there any recommended build tools?

A Ballerina program usually consists of multiple Ballerina packages. A package is a collection of source files. It defines a namespace and the symbols in all the source files in the package belong to that namespace. If you want to refer to a symbol defined in another package, you need to first import that package, then you can refer to the symbol with the package name.

When you want to execute or build a Ballerina program, Ballerina resolves all your import packages using your program directory, built-in repository (Ballerina distribution contains all the core library package as well as some third-party connector packages ), or the Ballerina repository directory. Ballerina repository is the local repository available in your machine.

We will develop tools for you to manage the Ballerina repository in the future.