[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [ANN] Orbiter - a personal http app server
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 7 Feb 2011 19:17:30 +0200
Hi all,
Since new Lua web frameworks have become mildly fashionable again with
Zed Shaw's Tir, I thought this is was as good a time as any. To be
precise, I don't see Orbiter[1] as a really new framework, since it is
heavily inspired by Orbit. Orbiter has two legs, of uneven lengths.
The first is a dinky little HTTP Orbit-style app server in 500 lines
of Lua that just needs LuaSocket [2], which is meant for embedding in
applications which want to expose a _local_ web interface.[3]
The second leg is HTML generation from LOM [4] document trees. Orbiter
supports a similar style to Orbit htmlification, except that it
involves explicitly declaring the tags used, and these tag
constructors actually create LOM elements, which are later
pretty-printed into HTML output. It provides some higher-order
functions for generating common HTML elements, and there is an
experimental auto-form generator.
(Do note that this functionality works fine with Orbit as well.)
There is some jQuery integration, e.g. stuff like this:
jq.button('Click me!',function()
return jq "#content" : find 'p'
: eq(0) : html 'no more strings!'
: _end()
: eq(1) : html 'ditto!'
end),
This creates a button element which causes the Lua callback to fire
through some backroom ajax, and then returns a jQuery expression built
from chained Lua calls. (This is arguably insane language-overloading,
so I'm not stuck on this feature)
This is still early days, but the vision is a straightforward
high-level way for apps to create local browser interfaces. (Since I
have the design sense of a concussed tree sloth, it will need design
input to make it a thing of beauty.)
steve d.
[1] https://github.com/stevedonovan/Orbiter/tree/v0,2
(The big Download button has a v0,2 tag available)
(Just copy the orbiter directory onto your Lua path)
[2] to be precise, only the socket.core module. This is
straightforward to compile into Lua.
[3] generally, the world already has enough industrial-strength HTTP servers
[4] LOM is Lua Object Model, as defined by the LuaExpat project; a
semi-standard representation of XML in Lua.