- Opa (programming language)
-
Opa Paradigm(s) multi-paradigm: imperative, functional Appeared in 2011 Developer MLstate Stable release S3.5 (build 687) (October 4, 2011 )Typing discipline static, strong, inferred Influenced by OCaml, Erlang OS Linux, Mac OS X License AGPL Website opalang.org Opa is an open source programming language for web applications.
The language was first officially presented at the OWASP conference in 2010[1], and the source code was released on GitHub[2] in June 2011, under a GNU Affero General Public License.
Contents
Design and features
Opa comprises a web server, a database and distributed execution engine.[3] 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.[4] The advantage of the approach compared to Rich Internet Application (RIA) platforms is that users are not required to install a plugin in their browser.[5] Opa shares motivations with web frameworks, but takes a different approach.[6] This helps Opa to avoid many security issues, like SQL injections or XSS attacks.[7]
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 many structures or functions that are common in web development, as first-class objects, for instance HTML[8] and parsers, based on Parsing Expression Grammars.[9] Because of this adhesion between the language and web-related concepts, Opa is not indicated for non-web applications (for instance desktop applications). [10]
Examples
Hello world
The traditional Hello world program can be written in Opa as: [11]
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
- ^ "OPA: Language Support for a Sane, Safe and Secure Web, at OWASP 2010". OWASP. June 2010. https://www.owasp.org/index.php/OWASP_AppSec_Research_2010_-_Stockholm,_Sweden#OPA:_Language_Support_for_a_Sane.2C_Safe_and_Secure_Web.
- ^ "GitHub repository". https://github.com/MLstate/opalang.
- ^ "Opa – The Scalable Open Source Cloud Language". WebAppers. 22 July 2011. http://www.webappers.com/2011/07/22/opa-the-scalable-open-source-cloud-language/.
- ^ "Interview: François-Régis Sinot on Opa, a Web Development Platform". InfoQ. 7 September 2011. http://www.infoq.com/articles/Opa.
- ^ Neil McAllister (8 September 2011). "Introducing Opa, a Web dev language to rule them all". InfoWorld. http://www.infoworld.com/d/application-development/introducing-opa-web-dev-language-rule-them-all-172060.
- ^ "InfoWorld article about emerging web technologies, including Opa". InfoWorld. 12 May 2010. http://www.infoworld.com/d/developer-world/infoworld-review-tools-rapid-web-development-297.
- ^ "Auch Opa ist für Cloud-Anwendungen". Heise. 29 July 2011. http://www.heise.de/developer/meldung/Auch-Opa-ist-fuer-Cloud-Anwendungen-1288588.html.
- ^ "Opa - a unified approach to web programming". i-Programmer. 28 August 2011. http://www.i-programmer.info/news/98-languages/2961-opa-a-unified-approach-to-web-programming.html.
- ^ Koprowski, Binsztok (2011). "TRX: A Formally Verified Parser Interpreter". Logical Methods in Computer Science. doi:10.2168. http://www.lmcs-online.org/ojs/viewarticle.php?id=708&layout=abstract.
- ^ "Opa, un nouveau langage pour le développement d’applications Web". LinuxFr. 22 June 2011. http://linuxfr.org/news/opa-un-nouveau-langage-pour-le-d%C3%A9veloppement-d%E2%80%99applications-web.
- ^ Alastair Aitken (26 July 2011). "Opa, the cloud language – a test drive". Morgan Hill. http://www.morganhill.co.uk/cloud/opa-the-cloud-language-test-drive/.
See also
- Dart - similar programming language for web apps
- HaXe - another similar programming language for web apps
External links
Categories:- Programming languages
Wikimedia Foundation. 2010.