A detailed comparison of two novel approaches to developing web apps : Node.js and Opa. Both technologies are open source, allow writing “Hello world” web app in just a few lines and both focus on the Web rather than on generic programming. However, Opa seems to be much more concise, is strongly typed and by design makes most popular security threats void.
Beware: The author (who submitted this “news” to OSNews) works for MLState, the company behind Opa.
This information is not disclosed in the article, you have to click on the author’s name to discover it. And the article really does feel Biased!
Maybe it’s all true, but how can I trust it?
Edited 2012-03-02 04:24 UTC
What I find great about Opa is that it is another ML based product that is getting mainstream attention.
With the attention functional programming languages are having lately, eventually FP will be as natural as OO in most enterprises, in some years from now.
Now regarding the node.js vs Opa, it is just another article to read and get back to real work.
I am long enough in the IT industry to reckognise the pop culture of languages, frameworks and tools, where the cool kid of today is tomorrow’s legacy code.
What I think is strange is to compare node.js to Opa, Opa is a whole framework instead of a platform like node.js. You could make a similair framework for node.js
It might even perform better too.
And indeed, using Opa as a framework for Node.js makes sense!
The article is about the state of the art, so about what is available today, not about what could happen, as such speculation rarely makes sense.
Having said that: indeed there are frameworks for node.js (express.js) and indeed it would make sense to compare with them and I do hope to get around to doing that.
That depends, the state of the art of what is available now might be important if you want to build something now.
But you also have to look at the future.
If you are a new webdeveloper, would you spend time on learning Flash, because some people consider that the current state of the art of “HTML5” ?
Yes. Quite ugly to try to hide the fact that the reviewer is working at the OPA company.
greelgorke:
“….Well, it’s a bit unfair to compare that way. Opa is a full-stack WebApp runtime, Node.js is not. Node.js is not “a framework for writing Web servers”, http, tcp modules are part of standard library of node, bu you can also easy write console line apps. If you want to make it fair, check express.js, which is “a framework for writing Web servers” on top of node, or even rails clones for node on top of express. in real life, no one would write html in js on node, but in a template file…”
I will say basically what I replied to you in the comment below the article. I never tried to hide that I work for MLstate (it’s in my bio!) and I tried to write an unbiased article. If I failed — be sure people will point that out in the comments. Whether you want to trust the article or not, that’s of course up to you, but why don’t you just test it for yourself? Finally: the code of the running example in Node.js and Opa is easily available and linked to in the article so you don’t have to trust me, you easily verify most of the claims I made in the article on your own.
Edited 2012-03-03 10:31 UTC
You might claim so, you might even be convinced in succeeding at it, genuinely believe you are impartial, and it might even appear so when glancing over the article …but that’s extremely hard to do, if not virtually impossible – just how our brains are wired, how we work (ho through a list of cognitive biases, this is our primary mode of operation; and the best & “crazy” part with, say, confirmation bias – research clearly shows that we are actually more susceptible to do it when we are aware of its possibility …only careful methodology can eliminate such)
Most importantly, some side note in a bio doesn’t change how, pushing such articles can filter down (or that’s “up” in the ~management chains, I guess) / decisions are made.
And it’s curious how the link to Node.js is broken – yeah, an innocent mistake I’m sure, and supposedly won’t influence anything …but, such things do tend to influence us – it conceivably could tend to give bad initial impression, attitude (we can even hardly really feel more than one emotion at a time, and it can “bleed in”)
Edited 2012-03-09 00:03 UTC
If doing something new on the server side I think I would be more tempted by Google’s Go than either of these.
http://shootout.alioth.debian.org/u64/benchmark.php?test=all&lang=v…
I think a [Server-side Go / MySQL + Client-Side GWT] project sounds fun
+ No javascript! (written), unlike node.js…
+ I don’t need a commercial license from Opa*…
+ All strongly typed
+ Should be fast to run and develop!
But this is coming from a person who’s web projects are ASP.NET, JSF and PHP and really likes C.
* Firstly, “if I’m using AGPL Opa to develop an app does it need to be AGPL, too?”. Long story short — yes, it does. http://blog.opalang.org/2011/08/opa-license-contributions.html
Comparing with ML, Go is just too primitive as it is basically C + Interfaces + Modules + GC.
Lacking many of the nowadays abstractions:
– enums
– generic types
– exception handling
– functional programming concepts
The oversold channels feature can be easily done with message queues in any current mainstream language.
My opinion of course:
– enums
Superfluous
– generic types
Interfaces with go’s loose binding is good enough most of the time. You are right, this would be nice.
– exception handling
Go’s take is better IMHO. C style programming by contract + panic/recover/defer leads to better code (for OK/competent and better coders).
– functional programming concepts
When I want this I will invoke my Haskell program… Most of the time this stuffis marketing/buzzword fluff, again IMHO.
Actually this is only so in simple use cases, in many situations panic/recover/defer might turn into horrible spaghetti code, as I have already seen.
My personal take on Go, is that it is a good replacement for C as a safer programming language targeting systems programming.
For the typical application development tasks, there are better languages already available.
I don’t agree with what’s written on the Opa blog.
Basically, the AGPL license allows you to mix it with GPL code.
So, applications written in Opa can be GPL licensed, which means that for instance you can host the applications online without providing the source code to users. Or am I wrong?