Opa (programming language)

Programming language for developing scalable web applications


title: "Opa (programming language)" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["functional-languages", "web-programming", "cross-platform-free-software", "programming-languages-created-in-2011", "software-using-the-gnu-affero-general-public-license", "software-using-the-mit-license", "2011-software", "articles-with-example-code", "statically-typed-programming-languages"] description: "Programming language for developing scalable web applications" topic_path: "technology/programming-languages" source: "https://en.wikipedia.org/wiki/Opa_(programming_language)" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary Programming language for developing scalable web applications ::

::data[format=table title="Infobox programming language"]

FieldValue
nameOpa
logoOpa logo cloud.png
paradigmsmulti-paradigm: functional, imperative
typingstatic, strong, inferred
scopelexical
developerMLstate
year
latest release version1.1.1 (stable)
latest release date
operating systemLinux, macOS, Windows
programming languageOCaml, Opa, JavaScript, Shell,C, Standard ML
licenseAGPLv3, MIT
website
influenced byOCaml, Erlang, JavaScript
::

| name = Opa | logo = Opa logo cloud.png | paradigms = multi-paradigm: functional, imperative | typing = static, strong, inferred | scope = lexical | developer = MLstate | year = | latest release version = 1.1.1 (stable) | latest release date = | operating system = Linux, macOS, Windows | programming language = OCaml, Opa, JavaScript, Shell,C, Standard ML | license = AGPLv3, MIT | website = | influenced by = OCaml, Erlang, JavaScript

Opa is a programming language for developing scalable web applications. It is free and open-source software released under a GNU Affero General Public License (AGPLv3), and an MIT License.

It can be used for both client-side and server-side scripting, where complete programs are written in Opa and subsequently compiled to Node.js on a server and JavaScript on a client, with the compiler automating all communication between the two. Opa implements strong, static typing, which can be helpful in protecting against security issues such as SQL injections and cross-site scripting attacks.

The language was first officially presented at the Open Worldwide Application Security Project (OWASP) conference in 2010,{{cite web |date=June 2010 |publisher=OWASP |url=https://www.owasp.org/index.php/OWASP_AppSec_Research_2010_-_Stockholm,_Sweden#OPA:_Language_Support_for_a_Sane.2C_Safe_and_Secure_Web |title=OPA: Language Support for a Sane, Safe and Secure Web, at OWASP 2010}} and the source code was released on GitHub in June 2011, under a GNU Affero General Public License (AGPL). Later, the license changed to the MIT License for the software framework part (the library) and AGPL for the compiler, so that applications written in Opa can be released under any software license, proprietary or open source.

Design and features

Opa consists of a web server, a database and distributed execution engine. Code written in Opa is compiled to JavaScript using Node.js on the server side and to JavaScript using jQuery for cross-browser compatibility on the client side. The advantage of the approach compared to certain Rich Internet Application (RIA) platforms is that users are not required to install a plugin in their browser. Opa shares motivations with web frameworks, but takes a different approach. Its designers assert that this helps Opa to avoid many security issues, like SQL injections or cross-site scripting (XSS) attacks.

The core language is functional and has a static type system with type inference. Opa also provides sessions which encapsulate an imperative state and communicate using message passing, similar to Erlang processes. Opa provides many structures or functions that are common in web development, as first-class citizen objects, for instance HTML and parsers, based on parsing expression grammars. Because of this adhesion between the language and web-related concepts, Opa is not intended for non-web applications (for instance desktop applications).

The 0.9.0 release in February 2012 introduced database mapping technology for the non-relational, document-oriented database MongoDB, similar to object-relational mapping. The 1.1.0 release in February 2013 also added support for PostgreSQL, paving the way for the support of several SQL databases.

References

Bibliography

References

  1. "Release 1.1.1: MLstate/opalang".
  2. "Some great news on Opa".
  3. (24 February 2012). "Node.js vs. Opa: Web Framework Showdown". developer.com.
  4. Opa supports various server-side backends, Nodejs being the most popular one.
  5. (April 2020). "Static Enforcement of Web Application Integrity Through Strong Typing". SSYM'09 Proceedings of the 18th Conference on USENIX Security Symposium}}{{Dead link.
  6. "GitHub repository".
  7. (22 July 2011). "Opa – The Scalable Open Source Cloud Language". WebAppers.
  8. (7 September 2011). "Interview: François-Régis Sinot on Opa, a Web Development Platform". InfoQ.
  9. Neil McAllister. (8 September 2011). "Introducing Opa, a Web dev language to rule them all". InfoWorld.
  10. (12 May 2010). "InfoWorld review: Tools for rapid Web development". [[InfoWorld]].
  11. (29 July 2011). "Auch Opa ist für Cloud-Anwendungen". [[Heise Online]].
  12. (28 August 2011). "Opa – a unified approach to web programming". i-Programmer.
  13. (2011). "TRX: A Formally Verified Parser Interpreter". Logical Methods in Computer Science.
  14. (22 June 2011). "Opa, un nouveau langage pour le développement d'applications Web". LinuxFr.
  15. (1 February 2012). "Programming Opa: Web development, reimagined". [[Computerworld]].

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

functional-languagesweb-programmingcross-platform-free-softwareprogramming-languages-created-in-2011software-using-the-gnu-affero-general-public-licensesoftware-using-the-mit-license2011-softwarearticles-with-example-codestatically-typed-programming-languages