Slashdot Mirror


MIT Unifies Web Development In Single, Speedy New Language

itwbennett writes: A new programming language out of MIT, called Ur/Web, provides a way for developers to write pages as self-contained programs. It incorporates many of the most widely-used web technologies, freeing developers from working with each language individually. Ur/Web's author, Adam Chlipala, an MIT computer science assistant professor, will present his work next month at the Association for Computing Machinery's Symposium on Principles of Programming Languages. He says, "In Ur/Web, everything is based on transactions, where a single client request is handled by what looks like an uninterrupted execution of a single function. The language implementation has optimizations in it to support running many requests in parallel, on real servers. But the programmer can pretend everything is a transaction and think in a simpler concurrency model."

13 of 194 comments (clear)

  1. Finally! A single language! by Anonymous Coward · · Score: 5, Funny
  2. The bigger question IMHO by popo · · Score: 4, Interesting

    Ur/Web is a Functional Programming language like Haskell, F# and the like. The performance gains are real -- both in numbers of coders and execution, but the larger questions remain:

    Do we want compiled web languages? Why exactly? Not only does this introduce a compilation layer to the development workflow, but it introduces millions of "black boxes" into a once open and readable landscape. While there may be gains in code protection, there will also likely be losses in flexibility.

    And of course, is it all worth the effort?

    --
    ------ The best brain training is now totally free : )
  3. Re:Is it a Node.js replacement? by Anonymous Coward · · Score: 5, Funny

    HR people are just waking up. By the end of the day, you'll see some looking for 5 years Ur/Web experience.

  4. Ooh, I Have An Idea! by Greyfox · · Score: 4, Insightful

    What if, instead of doing that, we came up with a language that you could use to build your program without a browser? Now stay with me here, I know this sounds crazy, but it could work! Since you're not working with a fundamentally stateless protocol, this language wouldn't need to maintain state externally to itself! All its variables and state would be self-contained! But since you might want to pull data in from the network or a database or something, you could add interfaces to that functionality to your language! Wouldn't that be something? I know, I know, this suggestion has been made, like 12648430 times before, but I think it's a really good idea that could work!

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  5. Well thank goodness by DrXym · · Score: 5, Insightful

    I always thought that the one thing web programming needed was YET ANOTHER PROGRAMMING LANGUAGE. One that seems to reinvent cgi programming combining business logic and structure into a single file and tosses the lot into a functional programming blender so nobody has a fucking clue what's going on.

  6. Frames in 2014 by Lobo42 · · Score: 4, Informative

    The demo site uses frames. FRAMES. I think this is unlikely to catch on.

  7. Re:"Ur" by CaseCrash · · Score: 4, Informative

    Are you being stupid on purpose or what?

    "Ur" is a fairly common way to represent an origin or prototypical item of a set, as in a "ur-language" would be the mother tongue from which other languages spring. It seem to be being used in this context to mean more "all-encompassing", or a back to roots type thing, but the meaning still applies.

    Why am I responding to an AC troll....

    --
    No, that link you posted to a web comic we've all seen a hundred times is not "obligatory."
  8. speed is good by e**(i+pi)-1 · · Score: 4, Interesting

    having on the server side fast and efficient code is nice but there are a plethora of webserver technologies out there and they can interact with virtually any programming language in the background having various technologies working together and having them developed indpendently has lots of advantages. Why bake everything together? Having sepearte entities (server, authoring language, scripting languages, databases) allows more flexibility. Efficiency and simplicity is nice but one can also overdo it. I learned real programming in Pascal, but Wirth soon started to develop the more efficient Modula, then Oberon flavors. Pascal started to stall. Oberon was great, everything, the compiler, operating system, everything fitted on one floppy. From the application and developer point of view it is a disaster to know that the shelf life of a programming language is only a few years, until the developer loses interest finds a better way to rewite the entire thing. This is especially the case for creative guys like Wirth. At one point, (oberon I) he even thought it would be nicer to have no FOR loop, as FOR loops leads to bad programs. Well, he had to reintroduce it in Oberon II. Academic elegance and theory not always goes parallel with the real world.

  9. Cures whatever ails ya by Marginal+Coward · · Score: 4, Funny

    From TFA:

    Not only do they not crash during particular page generations, but they also may not:

    - Suffer from any kinds of code-injection attacks
    - Return invalid HTML
    - Contain dead intra-application links
    - Have mismatches between HTML forms and the fields expected by their handlers
    - Include client-side code that makes incorrect assumptions about the "AJAX"-style services that the remote web server provides
    - Attempt invalid SQL queries
    - Use improper marshaling or unmarshaling in communication with SQL databases or between browsers and web servers

    Cures whatever ails ya. Works even better than snake oil! But wait, there's more. For just $19.95, we'll design two new web programming languages. Just pay separate shipping and processing.

    1. Re:Cures whatever ails ya by Unknown+Lamer · · Score: 4, Insightful

      The author has worked on SML/NJ internals, has a strong background in type theory, and has written similarish software in the past. I'd say he was able to solve those problems. Those problems are not even particularly complicated to solve once you have an expressive type system.

      --

      HAL 7000, fewer features than the HAL 9000, but just as homicidal!
  10. Anyone here qualified to comment? by Chelloveck · · Score: 5, Interesting

    I'd really like to hear from someone outside of academia who thinks this is useful. I've been programming in C-like languages ever since I graduated college 25 years ago, but my degree is in EE, not CS. The language definition is complete gibberish to me, containing solid pages of a mathematical notation that I've never before seen. Likewise, I have a very hard time following the demo code. I don't really feel qualified to evaluate it.

    I do see some red flags, though. First, since the language spec is given in such an abstract notation I have a feeling that it's going to be very difficult for code monkeys like me to refer back to. I normally reach for the language spec or the official docs when I have a question, but neither are going to do me any good here. Similarly, the tutorial starts out by describing the similarities and differences between Ur and ML or Haskell. That'd be a lot more useful if I'd ever used either of those two languages. The tutorial is incomplete, and what's there never describes Ur on its own without comparing it to the other languages.

    Second, the trivial demos look like some PHP variant, while the complicated demos are, well... Complicated. "Hello, World" simply returns a chunk of what appears to be free-form XML; some others return a chunk of XML with a few embedded Ur statements, similar to PHP. The SQL demos show embedded SQL statements. Are the XML and SQL chunks syntactically part of the Ur language thus checked for well-formedness, or are they just free-form text which get minimally processed to substitute variables before they're emitted? Or is there something else fundamental going on here that I'm missing completely due to my lack of familiarity with functional programming?

    Third, the official web site looks like something out of 1995. That's not necessarily a bad thing. It is clean and functional, just really, really utilitarian. I assume the site is done in Ur/Web, and it's clear that the author of the language learned HTML back when Mosaic was the hot new browser. Is the utilitarian look just how the author or site designer does things, or is it baked into the language? How hard would it be to implement something that looks modern? In the same vein it looks like Ur/Web produces xhtml as its output, and it looks like Ur/Web pretty much relies on well-formed XML embedded in the Ur source code. Will it have access to any of the new goodies in HTML5? Or is it going to be obsolete before the first Dummies book can be written?

    So if there's anyone here who does real-world web development and has the academic chops to evaluate Ur/Web for what it is, would you please post a summary for us code-troglodytes?

    --
    Chelloveck
    I give up on debugging. From now on, SIGSEGV is a feature.
  11. Death by Manual by fhage · · Score: 5, Insightful
    This language/framework has all the signs of an academic exercise.

    As someone who's been programming since the 1970's, I find it pretty hard to get past this statement in the Manual' "We give the Ur language definition in LATEX math mode, since that is prettier than monospaced ASCII".

    The author's choice precludes anyone cutting and pasting difficult syntax from the reference manual into their program. Look at page 26. Does any programmer find this useful? Scanning down to the more practical bits, I find;

    "The Ur/Web compiler is unconventional in that it relies on a kind of heuristic compilation. Not all valid programs will compile successfully. Informally, programs fail to compile when they are “too higher order.” Compiler phases do their best to eliminate different kinds of higher order-ness, but some programs just won’t compile."

    Really? Valid programs may not compile. I wouldn't spend a second learning any programming framework with this fatal flaw.

  12. PHP = Powerfully Horrendous Programming by MrBigInThePants · · Score: 5, Interesting

    If it is then it is DOA. ;) Sorry all you php fans, but seriously?!

    But seriously seriously: I don't believe that is the approach he is talking about. PHP is a very different beast.

    Their choice of a functional programming language is an eyebrow raiser but I understand the reasons why and can even applaud the sentiment for high volume transactional websites. (speaking as an architect with experience of such in the CC industry) I do sort of lament the lack of any OO framework within this (my assumption from article) but perhaps it is not needed as much since most data is from a relational DB. The incongruence between relational data and OO design has always caused problems anyway - obvious in the complexity of frameworks like "hibernate" etc.
    And for those that think that OO and functional languages cannot mix need to do a course on multi-paradigm programming like I did. ;)

    The CONCEPT has real potential and it will be interesting if and how these (assumedly MIT-smart) researchers deal with the main problem that any "do lots for you behind the scenes" (I am inventing a new architectural pattern here!) frameworks: Sacrificing flexibility of solution for ease of use.
    This is where limits are introduced because frameworks are forced to make choices about implementations and those choices have consequences. Implementing an elegant and simple solution with a huge amount of flexibility, easy extension and power is one of those holy grails that I have yet to see ANY framework in existence reach to any degree - there are ALWAYS trade-offs.
    Many of these frameworks start off with the claim of "really simple!!" but over time their lack of forethought and the punishing reality of REAL project development (as opposed to the dreams of researchers) causes the language to either be wholly inadequate or to mutate over time into an absolute nightmare.
    e.g. Auto hot key STILL makes the claim on their website that they are so easy to use, despite what their language has turned into: http://www.autohotkey.com/
    A very good example of this principle in action.

    e.g. VB was very productive (for its time) when all you did was use the out of the box stuff the language was designed for. Go off road (which inevitably happens in real projects) and you could enter VB hell very very quickly. Fixing said problem was usually possible but at the cost of a HUGE increase in skill and knowledge which is beyond many of those who picked it for its easy of use.

    So the questions I would be interested to find out are:
    - How far can you get before the above happens?
    - What percentage of typical advanced web app functionality is covered?
    - How HARD is it to extend (I assume its possible) and what skills are required to do so?

    There are of course thousands of others to answer before I would even consider using this in a real product!