opalang - Rapid & Secure Web Development
Syllabus Brief History of Web Development Ideas and Goals The Language itself Community Reason for Development Services and Apps written in OPA Future of OPA OPA vs (OCaml vs. Ruby) Roundup and Conclusion
History of Web Development 1989 HTTP by Roy Fielding and Tim Berners-Lee 1992 the HyperText Markup Language was developed by the World Wide Web-consortium 1993 the Cascading Style Sheet (CSS) was defined for styling and for separating design and content 1995 Brendan Eich released the first Version of Javascript, the first client side scripting language for the Netscape Browser 1998 XML-RPC which progression led to SOAP Between 2000 and 2015 the so called browser-wars took place. new Versions CSS/HTML and Javascript many other improvements and protocols added to browsers
Idea and Goals
solve various problems in web development What do we want? security scalability flexibility
If I were to say what is the biggest problem of the web development today, I would answer without much thinking: a bunch of technologies piled on top of one another ( ), that you need to harness to work together (sometimes against their will).. - Adam Koprowski a core Developer opalang
The Idea choose technologies which work together use only technologies with the same attributes one language for everything (for the developer) flexibility, scalability and safety as main goal
Components of an OPA Application OPA is a full-stack application: server (backend) programming (NodeJS) client (frontend) programming (JavaScript) database programming (MongoDB)
The Language Itself functional static type system type inference pattern matching message passing
Lexical Conventions C/C++/Java/JavaScript-style
Simple Datatypes
Defining Functions
Partial applications Modules
Typing OPA is a statically and strong typed checked language. Expression has one unique type Can only be used as this Return values can be a result or also data-types.
Type Inference solution has the type of [int] because 42 is an Integer (bool, int, int) -> int
Polymorphism well known in functional programming languages Key feature OCaml, Haskell, R even in Ruby 2 Types of Polymorphism in OPA Ad-hoc Polymorphism Parametric polymorphism
Example Polymorphism ( a -> a) a is an type variable if x would be a boolean the a will be instantiate with bool
Pattern & Patternmatching The expression expr is matched against each pattern in sequence
How does it work? Calm down: IT s Demo Time
Community and Surrounding
3 main communities in web development PHP Ruby on Rails Django Server and Client - Javascript (slow?) Hard to Switch old communities - old behaviours
License Problem main criticism was not technology but licensing OPA was released under the Affero GPL (AGPL) license ensures that improvements are also for community every program written in OPA, that links to the runtime, enforces developers to release the source code.
The Solution GPL license with the so-called ClassPath exception, like Java you can link GLP code with any code opening the door to license your application under any license
Alternatives
Reasons for Development web development was not really fun most tutorials and examples are in PHP PHP has an very sluggish development PHP doesn t have the best security history new programming paradigm added (too) late
Reasons for Development Ruby on Rails and Django: good for rapid and agile web development two or more languages to handle (JS, Ruby, Python, CSS, HTML) hard to setup the full-stack (database, application) have to know about MongoDB/ngnix/Apache/Unicorn secure the communication between each layer
after much time and outbursts of anger: Is it flexible? Does it scale? Is it secure? Have we tested it? (no)
Services Written in OPA Hard to detect, end product is Node.js and JavaScript A good way to find projects is Github One example: RiskyBird Online RegEx Editor
OPA vs. OCaml OPA OCAML FUNCTIONAL PATTERN MATCHING TYPER INFERCE POLYMORPH -ISM MODULES TAIL RECURSION AUTO GARBAGE COLLECTION
OPA vs. Ruby OPA RUBY FUNCTIONAL (can be used) PATTERN MATCHING TYPER INFERCE (other Typing System) POLYMORPH -ISM MODULES TAIL RECURSION (but you can do it) AUTO GARBAGE COLLECTION (coming in 2.1)
Future of OPA No informations are given on the web Developer did not answer my e-mail :( we can only guess - hopefully it will be developed further
Roundup OPA - functional language, developed to make web development easy and (more) secure. Single language compiles code to NodeJS, MongoDB and JavaScript Result is a full-stack web application flexible, scalable and secure not community friendly, but functional
Conclusion a new and developer friendly way for web developing robust runtime and perfect cooperation between all layers powerful language (keyword: tail recursion) Focus on your application not the technology