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."
I'm really sick of languages that are going to solve all our so-called problems. We can't even get web developers to properly adhere to W3C standards. Now, you expect developers to implement stuff in the browser that's effectively a massive JavaScript runtime? The problem with web development isn't the languages we use, it's the way in which they're used. People are trying to hijack the browser to be an application delivery platform and failing to adhere to the W3C specifications. This breaks the open, semantic web. Get back to me when they come up with a "language" that lets me turn off JavaScript, cookies, and plug-ins in my browser and still have useful, dynamic content that can be understood by computers and machines.
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 : )
0 job postings for a new language is fine. I bet that if you go back far enough, you'll find a time with 0 job postings for Node.js. You could probably go back and find 0 postings for C# at some point. They all started somewhere.
The issue, imo, isn't the start... it's the "one stop shop" that is some how going to "Magically" going to combine at a minimum layers: Database, server, html, css, javascript.
I'd like to see how they handle Chrome vs IE and other incompatibility issues.
Oblig KXCD: http://xkcd.com/927/
GUI programming sucks. HTML GUIs are far easier to implement than any other language I have worked with thus far. And I have run into so many quirks with other GUI's that it just isn't funny(looks one way here another way here and just sloppy). HTML provides a relatively stable GUI. However I like your idea why don't we work with a good open source browser dissect it and create our own binary both ends. We could use the new http protocal for binary traffic and ride that on an ssl layer. This could be done.
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.
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.
Ur/Web isn't easy to use. It's a huge pain to get any program past the type-checker, not just because the compilation errors are hard to understand (though this is a fixable problem, and one that Prof. Chlipala has been working on since I used it, if I'm not mistaken), but because it's always going to be an order of magnitude harder to develop in Ur/Web than in a dynamic language like Ruby etc., especially when you need to use stuff like higher-order polymorphism and functors and other concepts from type theory which I confess I don't understand.
So what's the benefit? The point is "provable correctness". In C, if you write outside the bounds of a buffer, you get no help from the language in preventing bad things from happening. In Ruby, if you try the same then the language catches the error at runtime, but you have the overhead of an array-bounds check on every write. In Ur/Web, you get the best of both worlds: since the compiler /proves/ that no buffer overflows can occur, then there need be no checks at runtime, so you get better performance.
And the same concept applies to pretty much any concept of "correctness" you'd like to express. Ur/Web has an entire SQL type, rather than representing SQL as strings, so that the compiler can prove that no SQL injection attacks are possible. (It's not possible to accidentally coerce a string to SQL---you'd have to really try.) It's possible, in principle, to express any kind of invariant you'd like using a type system like Ur/Web's. (Ur/Web doesn't include some constructs, e.g. dependent types, for reasons of language simplicity, but you can envision a similar language which would). In a dynamic language, you have to create more and more complicated (and slower) tests in order to show that your program has the same properties---and of course, your tests could always miss an edge case.
So who should use Ur/Web? Anyone for whom security is a bigger concern than ease-of-coding: banks, the military, hospitals, etc. If you want to whip up a quick web app, then Ur/Web is probably not for you. But if you need security, and you need to be certain you have it, then you should consider Ur/Web.
With that said, I disagree with this:
Why shouldn't a language solve the problem of concurrency and distributed applications?
Because this can only be effectively answered by the application?
An application can only effectively address such challenges when using the appropriate levels of abstraction. And by *appropriate* we mean not just appropriate in the level of high (or low) level features, but also in the amount of resources that are required to construct a system with the right synergies between application and supporting (underlying) platforms.
For instance, having an actor model supported as a language feature help application domain developers exploit (or create) the necessary abstractions for concurrency far more economically than using an actor model developed from scratch (or as an add-on framework)... at least for applications whose concurrency requirements are best served with an actor model over more low-level constructs (locks and shared resources)
Or think fault-tolerance. A language that has concepts such as a valves as actual language or run-time features is far more valuable for developing certain classes of fault tolerance systems than languages or runtimes that do not have any (a reason why most systems are not equipped with any means of throttling to cope with partial failures.)
Language does not enable non-trivial problems to scale out... application architecture enables this and concurrency is of the same coin.
Resource-efficient realization of an application architecture into a design and implementation are highly dependent on the language and run-times of choice.
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!