
Opa replaces Javascript, HTML, CSS, PHP, and SQL with one unified language. - bobrenjc93
http://www.opalang.org/
======
georgemcbay
Opa is neat, but the two license options of AGPL or "talk to us for a price"
basically ensure it will never achieve anything close to mainstream usage.

~~~
tluyben2
Agreed. This 'but we wanna make millions with a dual license as that 0.000001%
of open source products do' attitude is definitely the largest barrier for
this. And it's incredibly short sighted; just open up (L)GPL and do services +
support. All big companies WILL buy support as that's what they do. AGPL is
crap and will stop your growth; you have an uphill battle already, so don't do
stupid things like that.

~~~
wavephorm

      All big companies WILL buy support as that's what they do.
    

No they won't. MIT license lets them use the software for free. Why woukd
anyone pay anything if it can be used freely?

~~~
speg
Because big companies are marred by red tape and bureaucratic policies which
require them to spend money on support rather than figuring it out themselves.

~~~
jspiral
Most projects eventually encounter thorny issues. If your only recourse is to
let someone smart go into a deep dive while everyone waits, a lot of bad
things can happen. You might not even have anyone with the wits and drive to
fix it, or you might get a terrible hack that becomes a maintenance black
hole. Meanwhile, your schedule becomes a question mark, naysayers against the
technology form cliques, etc.

Small teams of motivated people can make just about anything work. For
everyone else, support makes project schedules more predictable and can avert
certain painful scenarios.

------
adam-f
I actually tried to run one of the featured projects on github: OPAcman.

This was my experience:

1\. install OPA. Get surprised by the AGPL license because the main page
mentions that it can be used to develop closed source apps.

2\. git clone OPAcman.

3\. run make, fail. Read error message (in color, with a little unicode "flag"
symbol right where the error is!)

4\. change makefile to use --parser classic, also fails

5\. hack off score.opa because --parser classic database directives are
irrevocably broken and I can't be arsed to figure out the new syntax, also
patch opacman.opa with a stubbed out Score object.

6\. Run make, get ocaml errors: Error: This expression has type Bsl_init_.CR.t
= QmlClosureRuntime.t but an expression was expected of type
QmlFlatServerLib.record = ServerLib.ty_record

7\. Take a look at some of the ml code generated

let _v686_const = ((Obj.magic) (((QmlFlatServerLib.unsafe_init_static) ([|
(((Obj.repr) (( (* ["label" ; "ty"] _) Link_opacman_001._v5_shared_vtable))))
; (((Obj.repr) (None))) ; (((Obj.repr) (Link_opacman_002._v226_const))) ;
(((Obj.repr) (_v685_const))) |])))) let _v687_const = ((Obj.magic)
(((QmlFlatServerLib.unsafe_init_static) ([| (((Obj.repr) (( (_ ["hd" ; "tl"]
*) Link_opacman_001._v6_shared_vtable)))) ; (((Obj.repr) (None))) ;
(((Obj.repr) (_v686_const))) ; (((Obj.repr) (Link_opacman_001._v8_const)))
|]))))

8\. Run AWAY.

------
nilliams
If you look at the docs you'll see it's not trying to replace CSS and HTML
(thankfully). CSS and HTML are still used. There just appears to be some extra
sugar around HTML templating (and it checks your HTML at compile-time).

The 'one unified language' therefore just refers to using a single language on
client and server, and as it happens it's a JavaScript like language, so
simply in terms of languages used it's not all that different to using JS on
the client and server.

The main selling point of this appears to be strong static typing.

Edit: Also yes, glad they are rethinking the licensing.

~~~
jebblue
If we go to one language, I'd prefer to take the GWT approach which uses Java
on the client and the server.

------
gosub

        Opa however extends the classical syntax with advanced features specific to the web.
        HTML fragments can be inserted directly without quotes:
    
        line = <div id="foo">bar</div>;
    

I'm not sure that this helps readability, feels like reverse php (html inside
code, vs code inside html).

~~~
hbbio
It's much more readable than complex combinations of " and '. Furthermore,
with the static typing, all your structures are checked at compile time: Try
it, you'll see how helpful it is.

~~~
TazeTSchnitzel
Oh yes. The mess of " and '. I'd love to be able to avoid that. Especially for
stuff like this:

    
    
        '<img src="' + image.url + '" alt="' + image.title + '" title='" + image.title + '" />'
    

Did you notice the bug?

EDIT: Whoops, I made some other bug accidentally.

~~~
nilliams
Ah but you should never have to write code that looks like that.

Use a templating language like Mustache (<http://mustache.github.com/>). Or
simply use string interpolation, which most dynamic languages have baked in:
<http://en.wikipedia.org/wiki/String_interpolation>

------
maratd
My Daddy always taught me, if you try to sit on two chairs, you'll fall in
between them.

~~~
jrockway
My daddy taught me not to set up chairs on ice rinks.

------
joe_the_user
When I looked for sample code, it automatically transfered me to the tour,
which then failed to load.

Anyway, the language seems to support all the constructs of the languages it
claims to replace - which could easily mean it would be even more confusing
than using those languages.

Also, I think Cold Fusion is an effort to do a similar thing and has about
fifteen years of history. Railo seems to be an open source clone of CFML:
<http://www.getrailo.org/>

------
pygorex
Christ on a cracker. Web browsers don't understand Opa. They understand HTML.
They understand CSS. They understand JavaScript.

Who do you want on your team? Someone who understands Opa? Or someone who
knows what browsers know, in detail?

If I know only Opa I'm limited to what the Opa developers know about these
technologies. I'm limited by what they know. By mastering these technologies
I'm only limited by what I can imagine.

Opa is a barrier on my imagination.

~~~
lmm
Computers don't understand HTML, or CSS, or JavaScript. They only understand
opcodes.

~~~
pbhjpbhj
Computers don't understand.

~~~
voxx
I also don't understand.

------
stephengillie
<http://xkcd.com/927/>

~~~
solox3
And because they are competing standards, they also reduce in numbers over
time.

------
Sharlin
Sooo... Just as people have finally mostly learned that mixing presentation,
business and data logic is mostly a Bad Idea, we get a new language that
encourages just that, worse than PHP ever did?

~~~
Avshalom
That separation can be made without using 5 different languages.

------
Egregore
For long time I was planning to develop a similar language, I'm happy that
they did it. Probably they did some things differently than I imagined, but
abstracting away the client-server communication is a good thing.

For those complaining that it's not MVC - you can build a MVC framework on top
of it.

~~~
yefrederic
Now you can contribute if you want ;)

------
sovok
Looks quite similar to Curl
(<http://en.wikipedia.org/wiki/Curl_(programming_language)>), although Curl
only runs on the client and needs a plugin. It got a lot of press ten years
ago but is now mostly forgotten.

Opa runs on the client and server and compiles to JS, so it got that advantage
over Curl. But it's still a kitchen sink wrapper around existing technology,
from a single vendor. Those seem to never work out that well.

~~~
franze

      {paragraph
        paragraph-left-indent=0.5in,
         {text color = "red", font-size = 12pt,
           I actually learned and coded some CURL, 10 years ago}
         {text color = "green", font-size = 12pt,
           Said that, I'm happy it is gone, it made my dev live much more complicated instead of easier}}

------
gouranga
It's like a Gerber multi tool. You get half a knife, half a pair of pliers and
half a screwdriver.

One tool for all jobs never works.

------
kawera
The Links programming language is another project that tried this approach:
<http://groups.inf.ed.ac.uk/links/>

------
candeira
I don't see how it replaces HTML. At most it manages HTML.

Also a question: can anybody knowledgeable tell us how Opa compares with
Meteor? Both of them seem to follow the approach that any piece of code can
run in either the server or the client, either with the system choosing
automagically or with the code specifying a 'server' or 'client' directive.

~~~
cedrics
You are probably referring to this article
[http://blog.opalang.org/2012/04/one-web-app-one-
language.htm...](http://blog.opalang.org/2012/04/one-web-app-one-
language.html) "[Opa] automatically determine where the code should run..."

And some previous discussion: <http://news.ycombinator.com/item?id=3858838>

------
nateware
Yay! Repost: <http://news.ycombinator.com/item?id=2925609>

------
yxhuvud
Having HTML as a native type in a language is something I could get behind.
Otherwise, no thanks - I prefer specialized tools and languages.

------
jahewson
Reminds me of Links <http://groups.inf.ed.ac.uk/links/>

------
Tloewald
Manual is impossible to read when zoomed to fit (won't scroll) on iPad.

~~~
ben0x539
There's also a number of problems in it that look like escaping issues. I'm
not sure whether it's worth noting them down individually or whether it's a
higher-level problem with what they use to generate it (both html and pdf
version have problems).

------
pbhjpbhj
<http://doc.opalang.org/manual/A-tour-of-Opa>

The tour page above is fubared for me on Opera Mobile 12. The right pane won't
scroll and is obscured by a large semi-opaque overlay.

------
anuraj
Why only HTML, CSS, JS, PHP? It should be replacing also the recent fads Ruby,
Python, Haskell, Clojure and god knows what else. It is high time we have
single, elegant solutions. Stacks are so yesterday!

------
pepijndevos
So this is the new Personal Home Page Script?

------
beefsack
Abstraction is not a bad thing.

------
jrockway
Isn't this GWT, essentially?

------
ErikD
Opa means Grandpa in Dutch.

~~~
ben0x539
They got you covered: <http://www.opalang.org/faq.xmlt> "What does Opa mean?"

------
pjmlp
I lost fate on Opa when they decided to drop OCaml and jump on the JavaScript
bandwagon.

~~~
hbbio
We won't drop OCaml! We love it ;) We are adding new backends to Opa - for
glorious benefit of other people.

------
hk__2
HTML/CSS are NOT programming language, Opa cannot replace them.

------
rjzzleep
one size fits all, eh? maybe when everyone's obese by default. rings the alarm
bells immediately here

------
wavephorm
It's a herculean effort. I heard about Opa about a year or two ago, amazed
he's still at it. Kind of like Haxe. I doubt they will go anywhere, like
Coffescript, because any language that simply abstracts another is just cruft
and doomed to be obsoleted.

~~~
chc
By that logic, Ruby and Python are just as doomed because they're ultimately
just elaborate abstractions on top of C (or at least their reference
implementations are). The implementation language and output target of a
programming language are not material to the language itself. C targets a wide
array of machine codes, but you'd be remiss in saying it's "just an
abstraction on top of x86," and thus doomed to fail. Likewise, Java can target
JVM bytecode or Dalvik, but it is not "just an abstraction" on top of either
of those. Clojure can target a dizzying array of output languages — JVM, CLR,
JavaScript, Scheme, Lua, Python…

It just boggles my mind that because a language compiles to JavaScript, it's
"just an abstraction on top of JavaScript" or "just sugar" or whatever. Like
if you took the same language with the same semantics but didn't target
JavaScript as your object code, the language would become more legitimate. How
is that in any way a useful view of the world? Is Clojure also just an
abstraction on top of JavaScript because it can target JavaScript?

~~~
ma2rten
I would go so far to say that any programming language is an abstraction over
another language and/or hardware instructions. Also any API is an abstraction
over another API and/or hardware instructions.

EDIT: I realized that technically my first statement is not correct: Any
Turing complete language can be language can be compiled to any other Turning
complete programming language. So it not an abstraction, but equivalent.

------
pyrotechnick
Now we can finally get rid of all those pesky DSLs once and for all...

------
bioli
I am curious to know how this re-re-re-re-post has always managed to get to
the front page.

