The Opa Framework for JavaScript

Rapid & Secure Web Development

vagrant init mlstate/opa

Just write a few lines of Opa code with your favorite text editor

Opa Code

Compile and run your Opa application with a single command line

opa hello.opa --

Test your Opa application immediately at http://localhost:8080

Opa Test

Top 10 Reasons to Develop with Opa

1. One Language to Rule Them All

Write simultaneously the frontend and backend code, in the same language, within the same module. Even better: the Opa Slicer automates the calls between client and server. No more manually written AJAX calls or value serialization!

And when auto is not enough, add hints to the code to enforce client or server-side, privacy, synchronous or asynchronous.

Slicer

2. Access All JavaScript Libraries

Opa generates and is fully compatible with standard JavaScript code.

Reuse tons of existing JavaScript libraries and frameworks, such as JQuery which is by default part of the standard library.

JavaScript on the client

3. Robust Runtime

Opa generates JavaScript on the server too, using Node.js and MongoDB.

Applications built with Opa can be deployed in most cloud straightforwardly and scaled up or down easily.

JavaScript on the server

4. Database Automation

Database queries are also written directly with Opa.

Opa currently supports both the SQL database PostgreSQL and NoSQL databases MongoDB and CouchDB. More databases are planned for future releases.

Opa provides many unique advanced operators and automates the database queries for maximal productivity.

Database Automation

5. Typechecker

Opa unique feature is its advanced typechecker that automatically verifies your application code, looking for bugs and inconsistencies, and crunching debugging time.

The Opa Type Checker was designed to bring static verifications to dynamic programming experience. Type checking is incredibly fast and features type inference: Application code stays lean and clean.

Typechecker

6. Truly Non-Blocking

Modern applications use a lot of asynchronous calls. Dealing with callbacks manually can be painful, and failing to do so properly blocks the application runtime.

To make asynchronous programming easy without blocking the application, Opa-generated JavaScript code uses smart continuations.

In the following example the Opa compiler automatically takes care of everything.

Truly Non-Blocking

7. MVC Support

Opa support MVC (Model-View-Controller) programming and provides a scaffolding mechanism to get started instantly.

Just minutes away from creating a real application.

MVC Support

8. HTML5 Native Support

Opa is built for the modern web. HTML5 fragments can be inserted directly. No more messing with single and double quotes!

CSS(3) elements including selectors are also easier than ever to use.

HTML5 Native Support

9. Powerful Syntax

Opa is JavaScript on steroids with many syntax and feature enhancements.

Database, types, pointers, autoclose, higher-order functions, etc. The list is way too long to fit here. Find it on the reference card.

Powerful syntax

10. Power Rows

The core of Opa uses Power Rows: A powerful, statically-typed, extension of JavaScript objects.

Power Rows is one of the features that makes Opa safe and fun at the same time.

Power Rows

About Opa

Static typing [of Opa] helps catch most bugs at compile time rather than a stack trace at run time.

Vimalkumar Jeyakumar
Vimalkumar Jeyakumar
Computer Science PhD student at Stanford University

Opa's type checking is simply amazing. [...] I think Opa will greatly change the future of web development.

Tristan Sloughter
Tristan Sloughter
Routing Infrastructure Developer, Heroku

Writing in Opa is super quick and fun! I don't think I could have written things as quickly in any other framework.

Alok Menghrajani
Alok Menghrajani
Security engineer at Facebook

What Next?

Start your new project in Opa

Discuss it

Contribute to Opa

Spread the word

  • Tweet about Opa.
  • Give a talk about Opa at your local meetup or organize a hackathon.