Opa (programming language)

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

Opa is a 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
Paradigmmulti-paradigm: imperative, functional
DeveloperMLstate
First appeared1996
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

It can be compared with web frameworks[2].

Opa is open source, released under a dual license: GNU Affero General Public License and a proprietary license.

The language was first officially presented at the OWASP conference in 2010[3], and the source code was released on GitHub[4] in June 2011.

Examples

Hello world

The traditional Hello world program can be written in Opa as:[5]

server = one_page_server("Hello", -> <>Hello, web!</>)

To compare this to other programming languages see the list of hello world program examples.

This is the full source code of the application, which is compiled by invoking the Opa compiler.

opa hello_web.opa

The compiler produces a stand-alone executable binary, containing everything required for execution, including database management, compiled requests, server code, client code, user interface and everything that may be needed to connect them or to handle malicious connections or inputs.

Running the resulting binary launches the web application.

./hello_web.exe

To deploy on several instances at once, Opa provides the opa-cloud command. This 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".
  2. ^ "InfoWorld article about emerging web technologies, including Opa".
  3. ^ "OPA: Language Support for a Sane, Safe and Secure Web, at OWASP 2010".
  4. ^ "GitHub repository".
  5. ^ "Opa, the cloud language – a test drive".


Category:Programming languages