DEV Community

Cover image for Run Ballerina in Your Browser!
Pramitha Jayasooriya
Pramitha Jayasooriya

Posted on

Run Ballerina in Your Browser!

⚑ Instant Access, Powerful Engine

The Ballerina Online Playground eliminates the setup barrier. With a single click, you get a secure, sandboxed environment ready to write, compile, and execute Ballerina code.

Compiler

πŸ‘‰ Launch the Playground Here
https://ballerina-online-playground.pages.dev/

https://ballerina-online-playground.pages.dev/

Core workflow:

  • Code Editor (Left Panel): Write or paste your Ballerina code
  • Run Code: Click Run Code or press Ctrl + Enter
  • Output Panel (Right Panel): View compilation and execution output in real time
  • Editor Tools:

    • Reset β†’ load sample code
    • Clear β†’ start fresh

πŸ€– The Ballerina AI Assistant: Your Intelligent Co-Pilot

Ballerina AI

What sets this Playground apart is the integrated AI Assistant, powered by Google Gemini and OpenAI.

This is more than a chatbot β€” it’s a real-time Ballerina expert, making learning and debugging fast and intuitive.

Quick Actions:

  • Explain Code: Detailed, line-by-line explanations of your Ballerina logic
  • Fix Errors: Suggestions to resolve compilation/runtime errors
  • Optimize: Professional tips for performance and best practices
  • Help: Ask about syntax, modules, error handling, or any Ballerina concept

You can click the quick-action buttons or ask custom questions in chat.
AI-suggested code can be inserted directly into the editor with Insert Code, providing a seamless workflow.

πŸ“Œ AI is fully context-aware and trained using ballerina.io documentation.


🧹 Real-Time Code Quality with Ballerina Lint

balarina lint

Maintaining high code quality is crucial.
The Playground integrates a Best Practices Checker inspired by the Ballerina Lint VS Code Extension.

As you type, the linter provides real-time feedback on:

  • Code quality
  • Ballerina best practices
  • Recommended conventions

VS Code Extension:
πŸ‘‰ https://marketplace.visualstudio.com/items?itemName=Pramitha.ballerina-lint


πŸ—οΈ Comprehensive Version Support (26 Ballerina Versions!)

Unlike simple online compilers, the Playground gives you full control over your execution environment.

You can switch between 26 Ballerina versions:

  • From 2201.3.0 (Swan Lake Update 3)
  • Up to 2201.12.0 (Swan Lake Update 12)
  • Including the Latest Development Build

Use Cases:

  • Testing compatibility
  • Reproducing version-specific issues
  • Educational purposes
  • Trying out older or newer runtime behaviors

πŸ“ Monaco Editor Integration

Built using the same engine as VS Code, the Monaco Editor provides:

  • Syntax highlighting
  • Auto-completion
  • IntelliSense
  • Advanced editing features

⌨️ Supported Features & Keyboard Shortcuts

The Playground supports all core language features so you can focus on learning Ballerina efficiently.

Keyboard shortcut


πŸ”’ Security and Limitations

The Playground is built with strict sandboxing:

  • No internet access
  • Isolated environment
  • Limited resources
  • Read-only file system

Disabled for security reasons:

  • HTTP clients
  • WebSockets
  • External APIs
  • Database connections
  • File system access
  • Services/listeners

This ensures a safe and stable environment for execution.


πŸš€ Ready to Start Coding?

Experience the best way to learn and prototype with Ballerina today.

πŸ‘‰ Start coding with the Ballerina Online Playground
https://ballerina-online-playground.pages.dev/


~ By Pramitha Jayasooriya

πŸ“¬ Contact Details

LinkedIn: Pramitha Jayasooriya
GitHub: PramithaMJ
X (Twitter): PramithaMJ
Personal Website: PramithaMJ.live
Email: lpramithamj@gmail.com

Looking forward to connecting with you!

Top comments (0)