Opa (programming language) Programming language for developing scalable web applications
Opa Paradigms multi-paradigm : functional , imperative Developer MLstate First appeared 2011; 15 years ago (2011 ) Stable release 1.1.1 (stable)
/ March
8, 2014
; 12 years ago (2014-03-08 )[ 1] [ 2]
Typing discipline static , strong , inferred Scope lexical Implementation language OCaml , Opa, JavaScript , Shell ,C , Standard ML OS Linux , macOS , Windows License AGPLv3 , MIT Website opalang .org 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.[ 3] [ 4] 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,[ 5] and the source code was released on
GitHub [ 6]
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.[ 7] 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 .[ 8]
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.[ 9] Opa shares motivations with web frameworks , but takes a different approach.[ 10]
Its designers assert that this helps Opa to avoid many security issues, like SQL injections or cross-site scripting (XSS) attacks.[ 11]
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 [ 12] and parsers , based on parsing expression grammars .[ 13] Because of this adhesion between the language and web-related concepts, Opa is not intended for non-web applications (for instance desktop applications ).[ 14]
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 .[ 15]
The 1.1.0 release in February 2013 also added support for PostgreSQL , paving the way for the support of several SQL databases.
See also
Ur – a functional language for web development
Dart – a JavaScript alternative for web apps
Haxe – a similar language for web apps
CoffeeScript – a language transcompiled to JavaScript for web apps
Dark – a language integrating development and deployment of serverless services