15 ms·
Opa replaces Javascript, HTML, CSS, PHP, and SQL with one unified language.
- nateware 14y agoYay! Repost: http://news.ycombinator.com/item?id=2925609 http://news.ycombinator.com/item?id=2925609
- maratd 14y agoMy Daddy always taught me, if you try to sit on two chairs, you'll fall in between them.
- jrockway 14y agoMy daddy taught me not to set up chairs on ice rinks.
- stephengillie 14y agohttp://xkcd.com/927/ http://xkcd.com/927/
- pyrotechnick 14y agoNow we can finally get rid of all those pesky DSLs once and for all...
- georgemcbay 14y agoOpa 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.
- hbbio 14y agoThanks for your comment. You raise insightful questions and we are aware that our current licensing must change. Expect to read about this soon!
- Egregore 14y agoCan you please tell me why you changed you syntax to JS-like syntax? The previous syntax was good enough, at least from my point of view.
- georgemcbay 14y agoI don't work on or speak for the Opa team, but I assume they adopted JS-like syntax for the same reason Dart did -- familiarity is important when it comes to language adoption. 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.
- Egregore 14y agoChanging syntax for marketing reasons seems bad from my point of view, I like pythonish syntaxes, like in haml, CoffeScript etc. So changing to JS was a back step.
- saiko-chriskun 14y agoyeah really didn't like the switch to js
- tluyben2 14y agoAgreed. 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 14y agoIt'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.
- gmac 14y agoIMHO the CoffeScript analogy is a poor one. CoffeeScript actually abstracts very little from the JS base, being mainly about a lighter-weight, more productive, more enjoyable syntax. Opa is far more ambitious in its abstraction.
- chc 14y agoBy 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 14y agoI 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.
- candeira 14y agoI 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 14y agoYou are probably referring to this article http://blog.opalang.org/2012/04/one-web-app-one-language.html http://blog.opalang.org/2012/04/one-web-app-one-language.htm... "[Opa] automatically determine where the code should run..." And some previous discussion: http://news.ycombinator.com/item?id=3858838 http://news.ycombinator.com/item?id=3858838
- ben0x539 14y agoAt the very least it seems to replace HTML with XHTML. ;)
- gosub 14y agoOpa 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 14y agoIt'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.
- nilliams 14y agoEdit: Oops didn't notice you were a developer. 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!
- TazeTSchnitzel 14y agoOh 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 14y agoAh but you should never have to write code that looks like that. Use a templating language like Mustache (http://mustache.github.com/ http://mustache.github.com/). Or simply use string interpolation, which most dynamic languages have baked in: http://en.wikipedia.org/wiki/String_interpolation http://en.wikipedia.org/wiki/String_interpolation
- ryanpetrich 14y agoI count four bugs.
- pygorex 14y agoChrist 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 14y agoComputers don't understand HTML, or CSS, or JavaScript. They only understand opcodes.
- pbhjpbhj 14y agoComputers don't understand.
- voxx 14y agoI also don't understand.
- jrockway 14y agoOpcodes!? Real programmers carefully etch silicon into a shape that exploits the various physical properties of flowing electrons to perform computations. Logic gates and opcodes are just an ultra-high-level lossy abstraction above this. Kids today...
- michaelmior 14y agoI feel like an xkcd reference is mandatory here http://xkcd.com/378/ http://xkcd.com/378/
- deleted 14y ago[deleted]
- Yarnage 14y ago
- pepijndevos 14y agoSo this is the new Personal Home Page Script?
- jahewson 14y agoReminds me of Links http://groups.inf.ed.ac.uk/links/ http://groups.inf.ed.ac.uk/links/
- Sharlin 14y agoSooo... 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?
- tluyben2 14y agoYou can separate in this language as you can in PHP and this language is a lot better than PHP ever will be. Not saying it's perfect, but these people didn't just throw a bunch of perl regexes in a basket and call it a programming language.
- jules 14y agoWith Opa you use standard programming language features to abstract presentation, business and data logic. For example you can define one function that gets the data from the database, and passes it to another function that builds up the HTML.
- Avshalom 14y agoThat separation can be made without using 5 different languages.
- ErikD 14y agoOpa means Grandpa in Dutch.
- ben0x539 14y agoThey got you covered: http://www.opalang.org/faq.xmlt http://www.opalang.org/faq.xmlt "What does Opa mean?"
- Egregore 14y agoFor 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 14y agoNow you can contribute if you want ;)
- pjmlp 14y agoI lost fate on Opa when they decided to drop OCaml and jump on the JavaScript bandwagon.
- hbbio 14y agoWe won't drop OCaml! We love it ;) We are adding new backends to Opa - for glorious benefit of other people.
- sovok 14y agoLooks quite similar to Curl (http://en.wikipedia.org/wiki/Curl_(programming_language) 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 14y ago{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}}
- pbhjpbhj 14y agohttp://doc.opalang.org/manual/A-tour-of-Opa 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.
- rjzzleep 14y agoone size fits all, eh? maybe when everyone's obese by default. rings the alarm bells immediately here
- nilliams 14y agoIf 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 14y agoIf we go to one language, I'd prefer to take the GWT approach which uses Java on the client and the server.
- Tloewald 14y agoManual is impossible to read when zoomed to fit (won't scroll) on iPad.
- anuraj 14y agoWhy 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!
- kawera 14y agoThe Links programming language is another project that tried this approach: http://groups.inf.ed.ac.uk/links/ http://groups.inf.ed.ac.uk/links/
- gouranga 14y agoIt'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.
- jrockway 14y agoIsn't this GWT, essentially?
- yxhuvud 14y agoHaving HTML as a native type in a language is something I could get behind. Otherwise, no thanks - I prefer specialized tools and languages.
- joe_the_user 14y agoWhen 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/ http://www.getrailo.org/
- hk__2 14y agoHTML/CSS are NOT programming language, Opa cannot replace them.
- adam-f 14y agoI 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.
- bioli 14y agoI am curious to know how this re-re-re-re-post has always managed to get to the front page.
- beefsack 14y agoAbstraction is not a bad thing.