Opa is an open source programming language for web applications. Opa comprises a web server, a database and distributed execution engine. Code written in Opa is compiled to native code on the server side and to JavaScript using jQuery for cross-browser compatibility on the client side.[1] Opa shares motivations with web frameworks, but takes a more radical approach.[2]
Opa | |
---|---|
Paradigm | multi-paradigm: imperative, functional |
Developer | MLstate |
First appeared | 2011 |
Stable release | S3.5
/ September 2, 2011 |
Typing discipline | static, strong, inferred |
OS | Linux, Mac OS X |
License | AGPL |
Website | [1] |
Influenced by | |
OCaml, Erlang |
The core language is functional, and enjoys a static type system with type inference. Opa also provides sessions which encapsulate an imperative state and communicate using message passing, similarly to Erlang processes. Opa provides first-class parsers based on Parsing Expression Grammars.[3]
The language was first officially presented at the OWASP conference in 2010[4], and the source code was released on GitHub[5] in June 2011, under a GNU Affero General Public License.
Examples
Hello world
The traditional Hello world program can be written in Opa in the following way[6]:
server = one_page_server("Hello", -> <>Hello, web!</>)
It can be compiled to a stand-alone executable binary with:
opa hello_web.opa
Running the resulting binary launches the web application:
./hello_web.exe
Opa is packaged with the opa-cloud tool to help deployment on several instances. The following command launches the application, configures load balancing and makes servers share information automatically:
opa-cloud hello_web.exe --host localhost --host my@my_server1 --host my@my_server2
References
- ^ "Interview: François-Régis Sinot on Opa, a Web Development Platform". 7 September 2011.
- ^ "InfoWorld article about emerging web technologies, including Opa". 12 May 2010.
- ^ Koprowski, Binsztok (2011). "TRX: A Formally Verified Parser Interpreter". Logical Methods in Computer Science. doi:10.2168.
{{cite web}}
: Check|doi=
value (help) - ^ "OPA: Language Support for a Sane, Safe and Secure Web, at OWASP 2010". June 2010.
- ^ "GitHub repository".
- ^ "Opa, the cloud language – a test drive". 26 July 2011.
External links
- Homepage of Opa
- Auch Opa ist für Cloud-Anwendungen article on Heise.
- Opa, un nouveau langage pour le développement d’applications Web article on linuxfr.
- Opa - a unified approach to web programming article on i-Programmer.
- Opa – The Scalable Open Source Cloud Language article on WebAppers.