cloudalion.org is an open-source project with a mission to provide purely-declarative programming stack of scalable & responsive Web applications. It is an umbrella project that hosts the entire ecosystem of the Cedalion programming language.
It consists of three sub-projects:
Nodalion: An npm module allowing Cedalion programs to run and interact with Node.JS. The core project is accompanied by driver projects for connecting to express, mongoDB, Redis, RabbitMQ and pkgcloud (an abstraction layer for connecting to Amazon S3, Google Cloud Storage and other object stores).
Cloudlog1 (temporary name): A NoDatalog database, implementing the Cloudlog data language as a Cedalion DSL. It provides a RESTful API (JSON over HTTP) and supports serving static files. It is intended to be used as a Web server.
There are a lot of ways to develop Web applications. Some are purely imperative (e.g., implementing your own server over bare Node.JS or writing a CGI script), and some are moderately declarative (e.g., by using a Web framework providing DSLs for templates, URL mappings, data modeling, etc).
Why do they go through all this trouble? Why not stay with imperative UI generation or imperative data handling?Declarative programming allows us to write less, and focus more on the end result. On the way, we get less room for error. It’s much easier to tell a computer what we want (and get it right), than to give a step-by-step recipe and hope the end result matches our desire.If declarative programming is such a great thing, why does it exist today only in limited parts of Web applications?The reason is that it is hard to express the business-logic of an application declaratively. Why? Because business-logic is mostly about manipulating state, and state is imperative. Declarative languages (think SQL, HTML, CSS…) have no notion of state, and are therefore not your first choice for state manipulation.What makes things even worse is the industry’s move towards NoSQL databases. They give us less declarative power (no fancy queries), and instead relies more on the (imperative) business logic to arrange things nicely in the database so that queries will be efficient and correct.So how can we support full-stack declarative Web application programming?The Cloudalion Way
Our approach is to store the business-logic along with the data in the database, and have the database apply it to the data. For this, we need a special kind of database, one we call NoDatalog. Such a database allows user data to be stored as facts, and business-logic to be stored as declarative logic rules.
Our NoDatalog database, working-title: Cloudlog1, Implements the Cloudlog data language. This is a Turing-complete language that allows the entire business-logic of an application to be implemented as a set of rules, stored in the database alongside the facts representing user data. Cloudlog supports two kinds of rules, dubbed top-down and bottom-up rules, giving developers a choice between working at query time and at update time, respectively. With this choice developers can make space/time trade-off decisions and have their business-logic scale to any size. All this, while keeping their code declarative.
The Cedalion Stack
The cloudalion project is also the ecosystem of the Cedalion programming language. Think of Cedalion as your Ruby and cloudalion as your Rails. Just like Ruby did not gain much popularity until Rails came along, Cedalion was not very useful before Cloudlog was developed. The cloudalion project provides two programming models for Cedalion addressing two different types of software:
- Cloudlog: supports the realization of Web applications by specifying the business logic as a set of declarative rules.
Nodalion was developed as the platform for implementing Cloudlog.
Most development on the Cedalion Workbench was done during the 2006-2011 time-frame. Some development was done recently, but nothing significant. It works and with some practice a developer can be productive with it, but a lot of bugs still exist.
Cloudlog1 is still a proof of concept. It is a partial implementation of Cloudlog. This subset is enough to build scalable applications declaratively, but cannot authenticate users or enforce access control.
Coding Standards and Documentation
With the exception of the Cedalion project that was developed years ago, the Cloudalion projects were all developed following BDD principles. This means:
- All code developed for Nodalion and Cloudlog1 was developed “test-first”.
- This results in good test coverage for the entire code-base.
- Tests and behavior descriptions provide up-to-date documentation.
- In-code documentation is used sparingly, due to its tendency to become obsolete.
For the Cedalion project some external documentation exist. I will provide it upon request.
If you are interested in collaborating and do not know where to start, please contact us and we’ll be happy to help.