Opa replaces Javascript, HTML, CSS, PHP, and SQL with one unified language.
opalang.org
opalang.org
Regardless of whether or not you think this is a good thing or whether programmers worry too much about superficial syntax issues, this is a practical issue you have to worry about if doing PL design for the real world.
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?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.
Previous reply;
You haven't worked with big companies before then; they pay for support (and licenses if needed). It's how it works as it is a liability thing; if you pay for something it's better than free as free doesn't exist. And that's kind of true; for free open source you need highly skilled employees to maintain it while you can also buy support from the company who actually built it. TL;DR big companies buy your support if they use your open source.
https://en.wikipedia.org/wiki/Curl_%28programming_language%2...
but AGPL for a language is a deal breaker. i accept AGPL for an application, but not for our language (we will make sites for our clients that dont want their stuff open source, and we dont want to be back in license-hell)
on tip for opa: pick a license that is common for languages.
besides the license i think the language looks _very_ useful (more compile time checks, pretty syntax, same user created data types on both client and server).
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.
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.
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).I think comparing to complex combinations of ' and "" is a bit of a straw man, as JavaScript developers use templating languages like Handlebars/Mustache so that really isn't an issue!
I see why you're doing it the way you are for the static HTML checking though!
'<img src="' + image.url + '" alt="' + image.title + '" title='" + image.title + '" />'
Did you notice the bug?EDIT: Whoops, I made some other bug accidentally.
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
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/
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.
Yeah, that was my first reaction as well.
For those complaining that it's not MVC - you can build a MVC framework on top of it.
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.
{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}}One tool for all jobs never works.
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.
And some previous discussion: http://news.ycombinator.com/item?id=3858838
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.
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?
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.
I'm skeptical of anything that tries to present a grand unified model. GWT is another example of where this strategy fails IMO.
As noted below, CoffeeScript is a different case that illustrates the point. It seems moderately successful (I haven't used it) precisely because it's a such a modest abstraction. It aims to be a 1-to-1 with JavaScript, and keeps the semantics of JavaScript, rather than imposing its own semantics which are inevitably at odds with what browsers/servers are really doing.
The problem with this argument is that it applies just as much in the two above examples as it does in this one, and it's clear that C has really taken off. Making good abstractions is damn hard, and the law of leaky abstractions is brutal, but the success of C, and even Java (a virtual machine on top of a compiler on top of a assembler on top of the machine!) shows that it can be done.
I'm pretty happy I can write code in C and can't imagine worrying about things like different instruction sets, registers, L1/L2 caches, etc. just for a basic "hello world". Perhaps in the future, people will think it equally crazy that we had to worry about details like what database we use, how we serialize data over the wire, manually creating ajax endpoints, etc.. Perhaps they'll let the compiler do all this work and only dive into manually fiddle with this stuff when they need to squeeze the last 10% performance out of the system, just as C programmers sometimes drop into ASM today.
"Abstraction is layering ignorance on top of reality" -- Richard Gabriel
My opinion is that anything which tries to abstract network communication and make it "transparent" is going to run in to problems at scale. For some reason there is this endless desire of programmers to extend their type system across the wire. It's been tried so many times.
The goal of Opa appears to be "transparency" as discussed here -- making distributed computing look like single-machine computing. This was also the goal of GWT.
http://scholar.google.com/scholar?cluster=700969849916494972...
Also related:
http://scholar.google.com/scholar?cluster=170119098329023261...
I disagree that anything trying to abstract away network communications will fail; I doubt that every engineer at google is a full-stack expert who single-handedly sets up a massive-scale service every day by hand. More likely, they have developed a set of somewhat-reusable abstractions that they can build upon for a variety of services. Hadoop is another example where the whole network thing is abstracted away. Amazon S3/Cloudfront is yet another. Difficult, but not impossible.
Perhaps Opa is trying to be the minimal portable abstraction over a full-stack service. I know GWT tried to be the same thing and failed, but one failure doesn't mean you give up, and I'm glad they're still trying.
I think this is an important point -- systems that last have to start really simple.
The Web was laughably simple at first. HTTP 1.0 was roughly: open a TCP connection, send a URL, get the document back, close the connection. It was WAY simpler than many contemporary hypertext solutions.
Unix was also WAY simpler than its contemporaries. Linux is old and hairy now, but that's just how things age without falling apart. They have to accomodate many different people's (sometimes broken) mental models under one roof. A system like Opa seems like it can only accomodate the mental model of its creators, and thus won't age gracefully.
C++ despite being huge has some modesty: it respected people's existing C code and didn't "cover it up". Plenty of people write C with classes still and that's actually a feature. Opa seems like it "covers up" what's underneath.
Java is kind of an exception to the adoption curve because it had huge marketing behind it like no other language did. But I think Java 1.0 was still pretty darn simple. It was a very small language. I'll grant that Java did try to cover up the OS. I think this limited its widespread application, but it's admittedly still massively popular for certain things. You couldn't do async I/O in Java for awhile, nor could you do things like make a Windows shortcut on the desktop.
Hadoop, being based on the MapReduce abstraction, does indeed pretty successfully allow the programmer to ignore the network. The fairly large restriction of being able to write 2 pure functions -- map and reduce -- is what allows this (it allows retries without affecting correctness, etc.). In a way this proves the point. You can't write arbitrary procedural/stateful code (in Opa or any other language) and distribute it over the network at scale. I'll go as far as to claim that this problem is unsolvable in a fundamental sense, like the halting problem is unsolvable.
Now maybe Opa introduces some restrictions in their model that help with distribution that I don't know about, but in general I am skeptical of the "write all your code in this one clean language with our nice model and we'll figure out the rest automatically with our hyper-optimized advanced technology". We've heard it before.
I honestly don't know why as a programmer you would want to ignore the distinction of code running on the client or the server. I'm all for sharing (some) code, as Node.js allows, but it should be obvious in any application whether a code path is running on the client or the server, and you shouldn't need a compiler to figure it out. That kind of coupling is crazy.