Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
666 views
in Technique[技术] by (71.8m points)

wso2 - How does Ballerina differ from other languages?

Ballerina is a general purpose, concurrent and strongly typed programming language with both textual and graphical syntaxes for better integration

  1. Is Ballerina an interpreted language?
  2. How to build Ballerina programs? Do we need to set Ballerina Home or any other system variables?
  3. How Ballerina supports dependency management? Are there any recommended build tools?
  4. 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?
  5. Where can I find language specification and what are the supported types in Ballerina?
question from:https://stackoverflow.com/questions/42358521/how-does-ballerina-differ-from-other-languages

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...