# Ballerina — Cloud-Native Integration Programming Language > A programming language purpose-built for writing integrations, microservices, and APIs with native cloud deployment support. ## Install Save as a script file and run: # Ballerina — Cloud-Native Integration Programming Language ## Quick Use ```bash # Install on macOS brew install ballerina # Create and run a simple HTTP service bal new hello_service && cd hello_service cat > main.bal << 'BALEOF' import ballerina/http; service / on new http:Listener(8080) { resource function get hello() returns string { return "Hello, World!"; } } BALEOF bal run ``` ## Introduction Ballerina is an open-source programming language designed specifically for cloud-native integration development. Unlike general-purpose languages that require heavy frameworks to build APIs and integrations, Ballerina provides first-class language constructs for network services, structured data types like JSON and XML, and built-in concurrency. It compiles to native executables and can generate Docker and Kubernetes deployment artifacts directly from source code. ## What Ballerina Does - Provides a purpose-built language for writing APIs, microservices, and integrations - Offers native support for JSON, XML, and other structured data types at the language level - Generates Docker images and Kubernetes manifests directly from source code - Includes built-in concurrency primitives for handling parallel service interactions - Supports visual and textual coding with a seamless low-code/pro-code workflow ## Architecture Overview Ballerina compiles to Java bytecode running on the JVM, giving it access to the Java ecosystem while providing its own type system and runtime. The compiler frontend parses Ballerina source into an AST, performs type checking with structural typing, and generates BIR (Ballerina Intermediate Representation). The backend compiles BIR to JVM bytecode. The standard library includes connectors for HTTP, gRPC, GraphQL, Kafka, databases, and cloud services. The language server powers IDE features in VS Code. ## Self-Hosting & Configuration - Install via Homebrew, the official installer, or download from ballerina.io - Use `bal new` to scaffold projects with standard directory layout - Configure dependencies in `Ballerina.toml` (similar to Cargo.toml or go.mod) - Deploy with `bal build --cloud=docker` to generate container images automatically - VS Code extension provides syntax highlighting, auto-complete, and live diagnostics ## Key Features - Structural typing enables loose coupling between distributed components - Network-aware type system with built-in error handling for service interactions - Native Docker and Kubernetes artifact generation from annotations in source - GraphQL, gRPC, HTTP, and WebSocket service support without external frameworks - Visual sequence diagram generation from code for documentation ## Comparison with Similar Tools - **Go** — excellent for infrastructure; Ballerina is optimized for integration logic - **Node.js/TypeScript** — general-purpose with frameworks; Ballerina has native service constructs - **Java + Spring** — powerful but verbose; Ballerina reduces boilerplate for API development - **Python + FastAPI** — quick to prototype; Ballerina adds compile-time type safety and cloud deployment - **Rust** — systems-level performance; Ballerina targets integration and API workloads ## FAQ **Q: Does Ballerina require the JVM?** A: Yes. Ballerina compiles to JVM bytecode and requires a Java runtime. The installer bundles a compatible JDK. **Q: Can I use existing Java libraries?** A: Yes. Ballerina provides interop capabilities to call Java classes and use Java libraries from Ballerina code. **Q: Is Ballerina suitable for general-purpose programming?** A: It is optimized for integration and API workloads. For general-purpose tasks, languages like Go or Python may be more appropriate. **Q: Who maintains Ballerina?** A: Ballerina is developed and maintained by WSO2, with contributions from the open-source community. ## Sources - https://github.com/ballerina-platform/ballerina-lang - https://ballerina.io --- Source: https://tokrepo.com/en/workflows/asset-8960d242 Author: Script Depot