Ocsigen

OCaml 製の、Kahuaといってもいいか?

Main features

  • Continuation-based Web programming
  • Static checking of XHTML
  • Automatic management of sessions
  • Concise and modular programming
  • Web server, implemented with cooperative threads

副作用を持ったページ生成(カウンターとか)はこう書ける!

Page generation may have side-effects:

let compt = 
  let next =
    let c = ref 0 in
      (fun () -> c := !c + 1; !c)
  in
  register_new_service 
    ~url:["compt"]
    ~get_params:unit
    (fun _ () () ->  return
      (html
       (head (title (pcdata "counter")) [])
       (body [p [pcdata (string_of_int (next ()))]])))

id:Gemma:20061224 で望んだものと一致してる。