TodoMVC in Opa
Edit: I just learned that dotcloud supports Opa! So I’ve pushed OpaDo and you can see a demo here http://opado-tristan.sloughter.dotcloud.com/
I wanted something quick and simple to do in Opa to give it a try so I decided to implement the TodoMVC example that has been redone in almost all Javascript frameworks, https://github.com/addyosmani/todomvc.
The code can be found on GitHub here: https://github.com/tsloughter/OpaDo
Opa is unique in that it is not only a new language but also a new web server and database. While Opa’s page pushes the idea that its for the cloud and its easy distribution, I found the nicest part being the static typing and no need for Javascript.
The functions below handle interactions with the Todo items. It somewhat reminds me of Lift but taken even farther.
It is unique in combining the HTML into the language itself. Some have argued against this but when it works well it makes perfect sense. I don’t want to have to convert a designers HTML into some other representation! And being able to have type checked dynamic functionality within the HTML is a boon. Even with just this simple program, I found the usefulness of the type checker outstanding.
Next we have the main outline of the page and the entry part for the program.
It won’t be able to replace my use of Erlang for the backend and Coffeescript for the frontend, but it looks very promising.
I’ll be extending this example to include persistence, sessions and users and will add posts as I complete those.