encyclopegia.org

Ur (programming language)

Ur, also called Ur/Web, is a multi-paradigm, high-level, pure, strict, functional programming language. It is a dialect of the language ML, designed for web development, created by Adam Chlipala at the Massachusetts Institute of Technology that one program can emit code for a server, web browser client, and SQL specific to a given database backend. The full implementation is free and open-source software released under an MIT License. Ur has its start and roots in a superseded progenitor language named Laconic/Web, in 2006.

Ur, also called Ur/Web, is a multi-paradigm, high-level, pure, strict, functional programming language. It is a dialect of the language ML, designed for web development, created by Adam Chlipala at the Massachusetts Institute of Technology that one program can emit code for a server, web browser client, and SQL specific to a given database backend. The full implementation is free and open-source software released under an MIT License. Ur has its start and roots in a superseded progenitor language named Laconic/Web, in 2006. (* the environment monad is called transaction, corresponds to Haskell's IO monad *) val main : unit -> transaction page Implementation file (.ur extension): datatype list t = Nil | Cons of t * list t table t : { Id : int, A : string } PRIMARY KEY Id (* server side database access, called through AJAX XmlHttpRequest encapsulated as rpc function (remote procedure call) *) fun add id s = (* sql dml template with {[expression]} *) dml (INSERT INTO t (Id, A) VALUES ({[id]}, {[s]})) fun del id = dml (DELETE FROM t WHERE t.Id = {[id]}) fun lookup id = (* haskell style monadic code *) ro return None (* return is the monad lifting function *) | Some r => return (Some r.T.A) (* check called by client side onClick event handler, so it will be compiled to JavaScript as page embedded client script *) fun check ls = case ls of Nil => return () | Cons (id, ls') => ao "Nada" | Some a => a ); check ls' fun main () = idAdd let val mylist = 1 :: 2 :: 3 :: [] in check mylist end }/> id id Project file (.urp extension), must contain an optional directive list followed by a listing of project modules: # hash prefixed line comments rewrite url Module1/main # set root URL to Module1/main function exe myexename database dbname=test # database attrib. and parameters sql noisy.sql $/list # stdlib modules prefixed with "$/" module2 # if used by module1 it must precede it module1 # main module server side, page retrieving functions with no side effects (http GET method) are accessible through a URL as ; they should have type (unit -> transaction page). To export a page which may cause side effects, accessible only via HTTP POST, include one argument of the page handler of type Basis.postBody. Compile: urweb module1 # looks for module1.urp Execute as a web server (other modes are CGI, FastCGI, ...): ./module1.exe -p 8081 # -h : RTS options help datatype mystruc k v = Empty | Node of {Key: k, Value: v} fun setKey [k][v] (* type polymorphism *) (_: ord k) (* implicit instance of class ord *) (callerErrNote: string) (k1: k) (my: mystruc k v) : mystruc k v = if k1 setKey: illegal k1 {[callerErrNote]} else case my of Node r => Node (r -- #Key ++ {Key = k1}) | _ => error setKey: not a Node {[callerErrNote]} corresponding signature (kind annotations (:::) implicit; (::) explicit): con mystruc :: Type -> Type -> Type (* two param. type constructor *) val setKey : k ::: Type -> v ::: Type -> ord k -> string -> k -> mystruc k v -> mystruc k v Record fields ellipsis case my of Node {Key = k, ...} => doWhatever k | _ => .... Error "Substitution in constructor is blocked by a too-deep unification variable" This error happens with types of arity > 0 in nested case or let clauses and disappears by type annotating the variables in the nested clauses.

References

No reference rows published for this article.

Cite this article

MLA

"Ur (programming language)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/ur-programming-language. Accessed 24 November 2026.

Chicago

"Ur (programming language)." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/ur-programming-language.

APA

encyclopegia.org. (2026). Ur (programming language). Retrieved November 24, 2026, from https://encyclopegia.org/wiki/ur-programming-language

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Ur

stub · references available

official language

stub · references available

pan-Slavic language

stub · references available

Hawaiʻi Sign Language

stub · references available

Taiwanese Sign Language

stub · references available

Category:Programming languages

stub · references available

International Mother Language Day

stub · references available

polysynthetic language

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1371832582 · 0.5 · snapshot enwiki-001371832582

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.