Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Cloud Open Source Programming News

Announcing Opa: Making Web Programming Transparent 253

phy_si_kal writes "Opa, a new open source programming language aiming to make web development transparent, has been publicly launched. Opa automatically generates client-side JavaScript, and handles communication and session control. The ultimate goal of this project is to allow writing distributed web applications using a single programming language to code application logic, database queries and user interfaces. Among existing applications already developed in Opa, some are worth a look. Best place to start is the project homepage which contains extensive documentation, while the code of the technology is on GitHub. A programming challenge ends October 17th."
This discussion has been archived. No new comments can be posted.

Announcing Opa: Making Web Programming Transparent

Comments Filter:
  • by Tumbleweed ( 3706 ) * on Saturday August 27, 2011 @05:33PM (#37230650)

    Every time you do something in Opa that is successful, you have to break a plate. Opa simply isn't economical to scale.

    • Hehehe... and in Dutch, it means "grandfather".

      "Yeah, I wrote this program in grandfather and..." (voice trails off under whithering stare of boss)

      This is why commercial entities do a namecheck before choosing names :)

      • Re: (Score:2, Interesting)

        by Anonymous Coward

        In German too. So Germany, Austria, half of Switzerland and Luxemburg are already going WTF or laughing before they even check if itâ(TM)s useful.

        (It's not. There is a reason there are different languages: The right tool for the right job. Trying to auto-translate e.g. JavaScript into SQL or regular expressions, is bound to result in a horrible frankenstein monster [which luckily is as slow as a glacier]. And for those languages where itâ(TM)s easy, like PHP, Python, Java, C++, it's not worth it s

        • I agree. This makes me think of stuff like Linq. SQL is a much nicer language for representing this stuff. Now, they could have added support for some kind of inline sql that could work on objects. Instead, they tried to shoehorn the functionality of SQL into C#/VB.Net syntax, creating something that is just more difficult to use. It's not that hard to learn 3 languages to do web development. Most web developers already know at least 3, languages such as SQL, PHP, and Javascript. Most serious web de
        • You do realize that we could use the exact same reasoning to pretend that, say, compiling C++ to assembly language is pointless, just because both languages are so different, do you?
        • Grandfather isn't even the right translation. "Grampa" would come closer. LOL

      • This is why commercial entities do a namecheck before choosing names :)

        aka The Chevy Nova Effect

        • by Pikoro ( 844299 )

          Along these same lines, There is a Toyota van here in Japan called a HOMY. In the local language (Okinawan), it means.. ahem.. female genitalia. Even so, the van sells fairly well.

        • AKA the urban legend effect?

          "Nova" and "no va" mean two entirely different things in Spanish. Try both in your favorite translation software to see.

          With so many confirmed international naming issues, it's odd that what must have started out as a joke is the one most people cite. "Nova" in Spanish, BTW, translates in English to... "nova".

          Now, go to Snopes and check out Coca-Cola, Sting, the Rolls Royce Silver Mist, the slogan "Nothing sucks like an Electrolux"...

      • Hehehe... and in Dutch, it means "grandfather".

        "Yeah, I wrote this program in grandfather and..." (voice trails off under whithering stare of boss)

        This is why commercial entities do a namecheck before choosing names :)

        But if the name was chosen before the checking policy was instituted, then they get to keep it. I think there's even a word for this practice...

      • And in (south american) Spanish it means "stupid", "idiot".

      • by pmontra ( 738736 )
        OPA is the Italian acronym for a takeover bid. The Opa language looks good for finance! :-)
  • by Cyberax ( 705495 ) on Saturday August 27, 2011 @05:41PM (#37230694)

    How is it different from, say, Wicket or ZK, or even GWT?

    I can write complete AJAX-y webapps in Wicket or ZK, including database. They both store state of pages on server side, so AJAX becomes trivial (just rerender the page and send the difference in DOM trees using JSON).

    Then there's GWT which compiles static Java code into JavaScript.

    • How is it different from, say, Wicket or ZK, or even GWT?

      Not having to use Java?

      • Check the documentation, Opa runs on Java....

        • *I understand you were talking about the language, just pointing out we're not free form the clutches of Java on this one.

        • Nope, it doesn't (note: I'm the architect-in-chief for Opa). Java is used only in the compilation process to run the Google Closure Compiler as a sanity check on our JavaScript libraries. Thanks for the great work by the Google team, by the way, this saved us literally months of JS debugging.
          • Oops, sorry for misunderstanding that and thank you for taking the time to clarify.

            I'm thinking of something to make to try out Opa by the way. I looked through some samples and I must admit I like how it handles things like Canvas and "live" apps.

    • by mellon ( 7048 )

      It's an integrated solution. You write one piece of code, and the compiler manages the AJAX interface. So you don't have to write your app in two languages and deal with communication between the server side and client side: the language hides that.

      It seems like a good deal in a number of ways, and I think for a new application it might be a good choice. However, there are some problems—they have chosen to define a new language, rather than extending an existing language, so you have to learn and be c

      • by mellon ( 7048 )

        That was 3 < 4, not Rule 34, in case anyone was wondering...

      • You write one piece of code, and the compiler manages the AJAX interface. So you don't have to write your app in two languages

        Sounds like CGI.pm to me! I never went for that. With a code generator you have to be thinking about what it generates all the time, or else restrict yourself to the lowest common denominator... on every feature. And still have a brittle result.

        Template systems for the dynamic parts win for a reason. And it isn't because of any shortcoming of Perl, Ruby, or that Aelfinn one.

    • It's different in that network communication is more or less transparent - you write a single program, not two clearly separated client and server parts (and then those in different languages).

      Simply put, it's a lot like Volta [wikipedia.org], except that, apparently, didn't get anywhere - even though the CTP was neat (it even let you do integrated debugging, like "step in" on client and it would get you into the corresponding server entrypoint). I think there's something like that for Java also. So this isn't exactly new,

      • Why yet another language, though, I don't understand. We already have plenty that could be readily used for something like that (C# 5 with "async" feature would be very handy, for example), or you could take one and add some minor extensions.

        Well, that's simple: when we started working on Opa, most the languages available today and that could be used to achieve similar features were simply not available. For the automated and secured client-server distribution scheme, we needed some advanced static checking, which ruled out Erlang — or which would have required us to largely reinvent that language. For client-server distribution and for handling many clients, we needed some advanced concurrency mechanisms, which ruled out most other lang

        • Well, looking through the docs more closely (rather than just the chat example), it sure does look a lot like a dialect of ML to me now, so my earlier comment on "taking an existing language and adding extensions" was redundant. Well, thank God it's statically typed - I'm a bit tired of all the dynamic typing around lately, esp. when its evangelists bring forth arguments which made sense with Java, but don't anymore when you have pervasive type inference.

          One thing there that made me wary is the built-in dat

          • One thing there that made me wary is the built-in database. So far as I can see, it is essentially just a hierarchy of typed key/value stores?

            Well, it is a bit more sophisticated than that. The database is a (typed) graph, so wherever a relational database or a key/value store would store keys as references, the database can store pointers, for instance. This is very powerful and this covers most cases. We also have plans for multi-field look-ups, joins, etc., much of which is actually implemented (but not activated in the released binaries/default config), but finalizing it will have to wait until we find some time and manpower.

            it seems that you don't have an IDE yet, for example?

            Actually, we h

  • I don't know about you but I've never really liked the look of programming languages that use colons. Semi-colons are OK but two dots, one on top of the other? That's just craziness! And "do" statements remind me of BASIC... yuck.

    • by deniable ( 76198 )
      Actually, the colons give me a Pascal vibe. The indents remind me of Python. So, I've got a language that looks a bit like Pascal and Python, runs in Java and generates HTML + JavaScript. The documentation must be a fun read.
  • Obigtory..... (Score:3, Insightful)

    by Anonymous Coward on Saturday August 27, 2011 @05:44PM (#37230714)

    This [xkcd.com] seems to be getting some use lately.....

  • by 93 Escort Wagon ( 326346 ) on Saturday August 27, 2011 @05:46PM (#37230732)

    If I write a web application using Opa, and the server end accesses a database - am I required to release the sql username and password?

    • Re: (Score:3, Informative)

      by ludwigf ( 1208730 )
      AGPL 3

      Probably the most important implication of AGPL is that it requires you to provide a way for your users to download the sources of the application. In fact Opa facilitates that by automatically enriching the server (in release mode) to serve the source code of the application at a special /_internal_/src_code URL.

      But this is not the end of the story. We believe in free software (hence the AGPL license) but we also understand that it may not be very suitable for commercial users of Opa. Such users will be able to obtain a private license (paid). This will allow them to keep their sources closed if they wish to do so and will provide us with funds to further develop and improve Opa — win-win situation :). If you are interested in more details about obtaining such a license, do not hesitate to contact sales@mlstate.com, where we will try to answer all your questions (including pricing).

      http://blog.opalang.org/2011/08/opa-license-contributions.html [opalang.org]

      • Probably the most important implication of AGPL is that it requires you to provide a way for your users to download the sources of the application. In fact Opa facilitates that by automatically enriching the server (in release mode) to serve the source code of the application at a special /_internal_/src_code URL. ... We believe in free software (hence the AGPL license) but we also understand that it may not be very suitable for commercial users of Opa.

        Whether I'm a commercial user or not... why would I - or anyone - ever want web visitors to be able to grab the SQL username and password I'm using in the back end?

        • Whether I'm a commercial user or not... why would I - or anyone - ever want web visitors to be able to grab the SQL username and password I'm using in the back end?

          Are saying that people actually write username and password in the source code ?

          Thats a no no.

          Use a configuration file containing secret information so you can protect it. Don't hardcode parameters that might change.
          Put the SQL information needed in a configuration file that you read before opening the database. Then its easy to change
          database,

        • Whether I'm a commercial user or not... why would I - or anyone - ever want web visitors to be able to grab the SQL username and password I'm using in the back end?

          You are doing it wrong. Please turn your geek card. Seriously. This is one of the stupidest things I've ever seen, typically done only within the bowels of them most incompetently written software ever. Configuration parameters of any kind are never, ever, ever, ever put in code. It's like Jesus Christ man, this is shit that is taught in in freaking sophomore-level programming classes (seriously.)

          Poor unexpected victims the ones who pay crappy, shit-flinging code monkeys for developing their software afte

      • I think the concept of Opa is neat. Other projects may have tried and failed at this, but maybe the Opa authors could make it work.

        However, the choice of license completely precludes me from even trying it. Sure, I release source code for some of the stuff I make (even though nobody looks at it). Here's why:

        Let's say I try out Opa, make some side projects with it, fall in love with it, and I get good at it.

        Now, either at my day job, or on my own, I come up with super awesome project X that I want to buil

  • by Anonymous Coward on Saturday August 27, 2011 @05:58PM (#37230816)

    this language seems to be obsolete from the beginning.

  • Am I the only one scared by the new trend of "languages that compile to Javascript"?

    Coffeescript, Opa, there were some more.

    I understand first compiling to Asembler and only then to machine code. I understand early C++ compiling to C. Various languages to bytecode...
    But really, while I love Javascript for many features it provides, creating yet another layer of indirection on top of it seems to serve only one purpose: boost sales of faster hardware...

    • There are guys doing this at my company, and the reasoning for it is that web developers know JavaScript. They don't necessarily know the back end language that is used to generate web pages (Perl, Java, PHP, etc...).

      Rather than have web developers spend time learning the back end, they display a blank div and use AJAX to request the data that they want. Then they can create the web page in JavaScript. I am not sure that this will be good way to go, but I do understand why the business wants to explore t

      • I think you missed what the parent was talking about. He didn't mean implementing more things in Javascript, he meant allowing developers to use non-Javascript languages to generate Javascript. It's so people don't have to use Javascript or learn it, not the other way around.

        What you mention, the pattern of generating pages using AJAX, is still fairly new. I use it a lot for data that is updated in real time, and some websites are using it for static data as well. I very much like it for cleanly separat
      • I think you have thisbackwards... This is another language that generates JS, rather than JS being leveraged more... For that, Node + Mongo are a great pair of options.
    • It depends on how cleanly it maps to Javascript's concepts. I don't really see almost anything in the core Opa language [opalang.org] that doesn't map reasonably well to JS. It shouldn't be particularly slower than JS by itself.

      • OTOH, I've seen one line of Coffeescript create a dozen of JS lines. Sure it means writing faster. But the problem with writing faster is that you spend the same amount of effort to create the same amount of lines of source, and suddenly you have five times as much of actual runtime code.

  • Integrating everything into one thing seems like a poor idea. Sure, it makes it a little easier for the dev, but in the end, you are just learning 5 times the amount of Opa when you could learn each thing. Not only that, but can one thing really do all those tasks the other things do, and do it as well? Even if it can, it's harder to keep all of those on a level, you can't replace those parts if you find something better. It just seems to me that splitting things down into the parts seems like something we should be doing, not reversing. I also really don't like the whole compiling to JavaScript behaviour. Maybe just because I don't like JavaScript.
    • Re: (Score:3, Interesting)

      by Seferino ( 837142 )

      Integrating everything into one thing seems like a poor idea. Sure, it makes it a little easier for the dev, but in the end, you are just learning 5 times the amount of Opa when you could learn each thing.

      Well, that's not quite true. Having the same language for database manipulation and for in-memory manipulation is a huge time-saver. Having the same language (indeed, the same piece of code) for server-side validation and for client-side validation is more efficient and less bug-prone. And you have only learnt one thing.

      Not only that, but can one thing really do all those tasks the other things do, and do it as well? Even if it can, it's harder to keep all of those on a level, you can't replace those parts if you find something better. It just seems to me that splitting things down into the parts seems like something we should be doing, not reversing.

      Ok, on this, you may have a point.

      I also really don't like the whole compiling to JavaScript behaviour. Maybe just because I don't like JavaScript.

      Well, that's part of the point: with Opa, you do not need to write any JavaScript.

      Caveat I'm part of the Opa team. Well, worse than that, I'm the archite

  • by moonbender ( 547943 ) <moonbender@gUUUm ... inus threevowels> on Saturday August 27, 2011 @06:37PM (#37231036)

    No idea whether it's viable long-term, but I thought it's really interesting. It does way more than GWT does, for example. It's also statically typed, yay.

    Here's some example code from the tutorial [opalang.org]. This is a chat room [opalang.org]. Apart from CSS, this is the entire soure code required to create the chat room server. Yikes. Had to get rid of the comments to appease the spam filter, unfortunately.

    type message = {author: string /**The name of the author (arbitrary string)*/
                  ; text: string /**Content entered by the user*/}
     
    @publish room = Network.cloud("room"): Network.network(message)
     
    user_update(x: message) =
      line = <div class="line">
                <div class="user">{x.author}:</div>
                <div class="message">{x.text}</div>
            </div>
      do Dom.transform([#conversation +<- line ])
      Dom.scroll_to_bottom(#conversation)
     
    broadcast(author) =
      do Network.broadcast({~author text=Dom.get_value(#entry)}, room)
      Dom.clear_value(#entry)
     
    start() =
      author = Random.string(8)
      <div id=#header><div id=#logo></div></div>
      <div id=#conversation onready={_ -> Network.add_callback(user_update, room)}></div>
      <div id=#footer>
            <input id=#entry onnewline={_ -> broadcast(author)}/>
            <div class="button" onclick={_ -> broadcast(author)}>Post</div>
      </div>
     
    /* Main entry point. */
    server = Server.one_page_bundle("Chat",
          [@static_resource_directory("resources")],
          ["resources/css.css"], start)

  • Wt (Score:4, Interesting)

    by paugq ( 443696 ) <pgquiles@elpauer . o rg> on Saturday August 27, 2011 @07:23PM (#37231288) Homepage

    Why is a new programming language required to "make web development transparent"?

    Opa automatically generates client-side Javascript and handles communication and session control. The ultimate goal of this project is to allow writing distributed web applications using a single programming language to code application logics, database queries and user interfaces

    Wt [webtoolkit.eu] does exactly the same but in C++. You develop webapps like desktop apps: widgets, ORM, etc. No need to care about Javascript, HTML, etc. Compilers available on all platforms. The result is a single binary which includes an embedded HTTP(S) server.

    While I agree with what Opa wants to achieve, inventing a new programming language for that end is unnecessary and, in fact, will become a burden: they will need to maintain both the language and the library. But actually the value lies in the library, which is the one that needs to deal with HTTP, Javascript, AJAX, etc

    • Re: (Score:3, Informative)

      by phy_si_kal ( 729421 )
      You're the debian packager for Wt, so you must know Wt much better than I do. However, both projects are very different and you should probably have a real look at Opa before popping up on every story about Opa (followed by another comment by someone else saying the link was useful, history repeats ;). Opa is high-level language for writing web apps. Wt is a toolkit for writing web components in C++. There is an order of magnitude between the length of application code in Opa and in Wt. Wt handles everythi
      • by paugq ( 443696 )
        Wt is also for writing webapps. My main gripe with Opa (which I have looked into :-) ) is the need to write HTML, XHTML, CSS, etc With Wt, I do not need to care about that. I do not even need to care about the browser supporting AJAX, SVG, or whatever. Wt takes care of everything.
  • Opa automatically generates client-side JavaScript

    Just what we need, more sites spewing out poorly-designed client-side script badly rendered by any number of JS browser implementations. Like many others, I do everything possible to block JS...why does anyone think the future lies in more client-side code?

  • by drgroove ( 631550 ) on Saturday August 27, 2011 @11:12PM (#37232110)
    Dear Creators of Opa - Honestly, what were you thinking? Opa is basically another crack at the same approach that ColdFusion tried years ago, and failed at. Opa isn't Object Oriented, meaning that developers working in an OOP language (Java, .NET, Python, PHP, Ruby, Perl, etc) will have a tougher time making the transition - it also means that Opa can't implement or support standard Design Patterns, which is a huge mistake IMnsHO. The sample code on the Opa site shows a mix of Opa functions, database interaction, markup language, CSS, Javascript... what a mess. Haven't we all learned that clean separation of functional application concerns is the only way to write scalable, enterprise-class programs yet? Opa doesn't appear to support any database beyond it's own build-in, slightly obfuscated one, meaning it will gain no enterprise/business traction. As much as I like to see new programming languages succeed, I have to agree w/ a lot of the other posters on /. - Opa is dead on arrival.
    • Re: (Score:3, Informative)

      by Seferino ( 837142 )

      Dear drgroove,

      Thank you for your considerate feedback.<sarcasm mode="off"/>. While we understand very well the drawbacks of Opa not being Object-Oriented (at least not in the usual meaning of the term), there are several reasons for this choice. The first and most important of these reasons is that experience from 15+ years of experienced developers writing scalable systems with Object Oriented Programming Languages, and concluding that OO is not the right paradigm for the task, and that other paradi

  • So they're targeting javascript. This is going to be, uhm, not the most efficient approach.

    What should happen, imho, is for W3C to develop a (non-garbage collected, as in no garbage collection) low level language, which can serve as a platform for other languages, like this one. Current compiler and virtualization technology can easily and efficiently translate such low level language into something native. And as a result, we could have a much richer web environment, and we'd not be dependent on that one s

  • by LunaticLeo ( 3949 ) on Sunday August 28, 2011 @08:08AM (#37233198) Homepage

    I don't mind making any and all my code available to others. And I understand the "give-back" qualities of GPL. But a GPL language that makes every program written in it have the GPL License?!? Good grief. I am laid back about the whole License Wars, but AGPL gives me pause.

    I probably won't even bother learning a little bit of this language to understand it's good qualities. Plus I've never cared for indentation defining blocks.

  • How does opa handle multiple threads of execution? Any decent server nowadays just needs to have multiple threads of execution, sometimes even thousands of them to work in a non-blocking way. Opa seems to be "non-blocking" (I read from the tutorial), but you have non-blocking and non-blocking... One version simply uses one thread and an event-loop (aka non-preemptive multitasking). This is not truly non-blocking, as large I/O operations in one task still prevent other tasks from working. And does opa allow

If all else fails, lower your standards.

Working...