ANN: Ur/Web: Statically-typed metaprogramming for the web

I'd like to announce the first alpha release of a compiler for the Ur/Web programming language, available with an interactive demo at:

http://www.impredicative.com/ur/

Ur is a programming language designed to introduce richer type system features into functional programming in the tradition of ML and Haskell. Ur is functional, pure, statically-typed, and strict. Ur supports a powerful kind of metaprogramming based on row types.

Ur/Web is Ur plus a special standard library and associated hints for parsing, type inference, and optimization. Ur/Web supports construction of dynamic web applications backed by SQL databases. The signature of the standard library is such that well-typed Ur/Web programs "don't go wrong" in a very broad sense. 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
  • Attempt invalid SQL queries
  • Use improper marshaling or unmarshaling in communication with SQL databases

This type safety is just the foundation of the Ur/Web methodology. It is also possible to use metaprogramming to build significant application pieces by analysis of type structure. For instance, the demo includes an ML-style functor for building an admin interface for an arbitrary SQL table. The type system guarantees that the admin interface sub-application that comes out will always be free of the above-listed bugs, no matter which well-typed table description is given as input.

The Ur/Web compiler also produces very efficient object code that does not use garbage collection. These compiled programs will often be even more efficient than what most programmers would bother to write in C. For example, the standalone web server generated for the demo uses less RAM than the bash shell.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Broken links in demo

The demo has links like this one that result in "Service Temporarily Unavailable."

Fixed, thanks

See subject. :-)

Or maybe not...

I just encountered the same error.

It won't be that surprising

It won't be that surprising if the error keeps recurring and I keep fixing it. It just means that the application server is down at the time. I think I've now fixed the bug that brought it down both times so far.

Row Types?

Can someone provide some info/links on row types?

Row polymorphism?

Previous discussion on row polymorphism is probably the place to look.

Integer overflow

It looks like you get 64-bit signed integer overflow if you increment this counter. That's probably something you should check for in a demo. Related question: do you have an infinite-precision integer type?