Opa (programming language)

This is an old revision of this page, as edited by Opadikt (talk | contribs) at 20:36, 8 September 2011 (Hello world). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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
Paradigmmulti-paradigm: imperative, functional
DeveloperMLstate
First appeared2011
Stable release
S3.5 / September 2, 2011; 14 years ago (2011-09-02)
Typing disciplinestatic, strong, inferred
OSLinux, Mac OS X
LicenseAGPL
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

  1. ^ "Interview: François-Régis Sinot on Opa, a Web Development Platform". 7 September 2011.
  2. ^ "InfoWorld article about emerging web technologies, including Opa". 12 May 2010.
  3. ^ Koprowski, Binsztok (2011). "TRX: A Formally Verified Parser Interpreter". Logical Methods in Computer Science. doi:10.2168. {{cite web}}: Check |doi= value (help)
  4. ^ "OPA: Language Support for a Sane, Safe and Secure Web, at OWASP 2010". June 2010.
  5. ^ "GitHub repository".
  6. ^ "Opa, the cloud language – a test drive". 26 July 2011.

Category:Programming languages