few newbie questions -- luaforge/kepler website, REST, bindings etc.

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

few newbie questions -- luaforge/kepler website, REST, bindings etc.

Jayanth Acharya
Hello,

Complete newbie to lua but definitely not to programming. Have started
reading up on Lua since yesterday. Have gone through the FAQs (3
sets), and the Libraries/bindings page, and gone through the tutorial.
My might search might not be exhaustive, so kindly point gently.

Q1. Unable to reach luaforge.net & keplerproject.org ! Any idea as to
when they might come back, or they are not being maintained anymore
(don't seem to be so though) ?

Q2. Found one instance of OpenCV binding for Lua, work done. It
apparently it is a Ruby gem that uses the OpenCV source and doxygen's
c/c++ parsing functionality, that automatically generated the Lua
bindings. Does anyone have an update on how well it works ?

Q3. Anyone using Lua for some REST based webservice project ? Would
appreciate pointers ? Is it well suited for this purpose ?

Q4. Anyone aware of existing Lua bindings for ffmpeg / mplayer projects ?

thanks,
Jay

Reply | Threaded
Open this post in threaded view
|

Re: few newbie questions -- luaforge/kepler website, REST, bindings etc.

steve donovan
On Thu, Mar 3, 2011 at 8:25 AM, Jayanth Acharya <[hidden email]> wrote:
> Q2. Found one instance of OpenCV binding for Lua, work done.

I would also be interested in the current state of OpenCV bindings.

(May be yet another opportunity for LuaJIT/FFI since computer vision
can be algorithm-heavy)

On the subject of REST, I believe LuaSpore is the way forward.
Alexander Gladysh recently released an Amazon S3 binding based on it
(which he funded with his own development money, so it is a generous
contribution!)

steve d.

Reply | Threaded
Open this post in threaded view
|

Re: few newbie questions -- luaforge/kepler website, REST, bindings etc.

Chris Babcock
In reply to this post by Jayanth Acharya
On Wed, Mar 2, 2011 at 11:25 PM, Jayanth Acharya <[hidden email]> wrote:
> Q1. Unable to reach luaforge.net & keplerproject.org ! Any idea as to
> when they might come back, or they are not being maintained anymore
> (don't seem to be so though) ?

It's temporary.

> Q3. Anyone using Lua for some REST based webservice project ? Would
> appreciate pointers ? Is it well suited for this purpose ?

As a REST client - https://github.com/SPORE
As a dispatcher - http://keplerproject.github.com/copas/

Lua is a good tool. It's fast, light and easy to code. If you need a
big web framework or a lot of choices in libraries then there may be
better choices for you, but Lua 5.x has been stable for a long time.
That does a lot to leverage the talent of the community and, while
it's still a trifle naive to say "if there's a C library for then
there's a Lua library for it" it's not quite as naive as saying the
same thing about Python. ;)

Chris
--
Yippee-ki-yay, coffee maker.

Reply | Threaded
Open this post in threaded view
|

Re: few newbie questions -- luaforge/kepler website, REST, bindings etc.

Michal Kottman
In reply to this post by steve donovan
On Thu, 2011-03-03 at 08:35 +0200, steve donovan wrote:
> On Thu, Mar 3, 2011 at 8:25 AM, Jayanth Acharya <[hidden email]> wrote:
> > Q2. Found one instance of OpenCV binding for Lua, work done.
>
> I would also be interested in the current state of OpenCV bindings.
>
> (May be yet another opportunity for LuaJIT/FFI since computer vision
> can be algorithm-heavy)

Yes, I was planning to do that, however, what interests me more is the
new C++ interface (mainly the features2d module, on which I'm doing
research). As Mike already said, C++ is not on the TODO list right now
(and may never be), so we have to resort to traditional bindings to work
with the new interface. I have not yet tried FFI on the traditional C
interface.



Reply | Threaded
Open this post in threaded view
|

Re: few newbie questions -- luaforge/kepler website, REST, bindings etc.

Michal Kottman
In reply to this post by Jayanth Acharya
On Thu, 2011-03-03 at 11:55 +0530, Jayanth Acharya wrote:

> Q4. Anyone aware of existing Lua bindings for ffmpeg / mplayer projects ?

Technically not a binding, but after the release of LuaJIT FFI, I was
experimenting with ffmpeg libraries (libavcodec, libavformat). I wrote a
simple program [1] that uses libavcodec to decode a file containing
audio into a raw array of samples (and it's pretty fast). I want to try
some signal processing on that later.

You should be able to work with video the same way (video processing in
Lua? Crazy :)

[1] https://github.com/mkottman/ffi_fun/blob/master/ffmpeg_audio.lua


Reply | Threaded
Open this post in threaded view
|

Re: few newbie questions -- luaforge/kepler website, REST, bindings etc.

Jayanth Acharya
In reply to this post by steve donovan
On Thu, Mar 3, 2011 at 12:05 PM, steve donovan
<[hidden email]> wrote:

> On Thu, Mar 3, 2011 at 8:25 AM, Jayanth Acharya <[hidden email]> wrote:
>> Q2. Found one instance of OpenCV binding for Lua, work done.
>
> I would also be interested in the current state of OpenCV bindings.
>
> (May be yet another opportunity for LuaJIT/FFI since computer vision
> can be algorithm-heavy)
>
> On the subject of REST, I believe LuaSpore is the way forward.
> Alexander Gladysh recently released an Amazon S3 binding based on it
> (which he funded with his own development money, so it is a generous
> contribution!)
>

Thanks Steve. LuaSpore seems interesting, and it does address fair bit
of what I was aiming to find out. The other part was to find out some
kind of framework that makes making REST based webservice possible on
server side. Was trying to draw a parallel with Webmachine in Erlang
world. I am guessing that "Kepler" might help there.

regards,
Jay

Reply | Threaded
Open this post in threaded view
|

Re: few newbie questions -- luaforge/kepler website, REST, bindings etc.

Jayanth Acharya
In reply to this post by Chris Babcock
On Thu, Mar 3, 2011 at 1:47 PM, Chris Babcock <[hidden email]> wrote:

> On Wed, Mar 2, 2011 at 11:25 PM, Jayanth Acharya <[hidden email]> wrote:
>> Q1. Unable to reach luaforge.net & keplerproject.org ! Any idea as to
>> when they might come back, or they are not being maintained anymore
>> (don't seem to be so though) ?
>
> It's temporary.
>
>> Q3. Anyone using Lua for some REST based webservice project ? Would
>> appreciate pointers ? Is it well suited for this purpose ?
>
> As a REST client - https://github.com/SPORE
> As a dispatcher - http://keplerproject.github.com/copas/
>
> Lua is a good tool. It's fast, light and easy to code. If you need a
> big web framework or a lot of choices in libraries then there may be
> better choices for you, but Lua 5.x has been stable for a long time.
> That does a lot to leverage the talent of the community and, while
> it's still a trifle naive to say "if there's a C library for then
> there's a Lua library for it" it's not quite as naive as saying the
> same thing about Python. ;)
>

Thanks Chris. Had a look at kepler, and my first impression is, it
looks a bit complicated to use. However that is quite likely to an
incorrect impression due to my lack of familiarity with Lua itself.
Will explore it further, and particularly Copas.

Was attracted to Lua simply due to it's fast, lightweight, and
familiar feel (has a bit of Erlang, bit of Python, tiny bit of Java
and lot of C appeal to it). I agree that probably expecting
heavy-weight CMS'ish frameworks might not be quite right, but I was
looking for something that really eases development, helps minimize
lines-of-code. At the outset Lua looks very simple, and elegant, so I
am eager to learn more.

regards,
Jay

Reply | Threaded
Open this post in threaded view
|

Re: few newbie questions -- luaforge/kepler website, REST, bindings etc.

Jayanth Acharya
In reply to this post by Michal Kottman
On Thu, Mar 3, 2011 at 2:18 PM, Michal Kottman <[hidden email]> wrote:
> On Thu, 2011-03-03 at 11:55 +0530, Jayanth Acharya wrote:
>
>> Q4. Anyone aware of existing Lua bindings for ffmpeg / mplayer projects ?
>
> Technically not a binding, but after the release of LuaJIT FFI, I was
> experimenting with ffmpeg libraries (libavcodec, libavformat). I wrote a
> simple program [1] that uses libavcodec to decode a file containing
> audio into a raw array of samples (and it's pretty fast). I want to try
> some signal processing on that later.

Just read up a little about LuaJIT FFI, and at the outset seems like a
wonderful approach.
I'd have to dig deeper for a better grasp, but I am guessing that it
allows one a deterministic access to things like constants as well
(i.e. if I know the constant / literal's name, I'd know how to refer
to it in Lua as well).

BTW, other than lack of LuaJIT's availability on certain target
architectures/platforms, is there any reason why people may not want
to use it, but stick to Lua VM ?

> You should be able to work with video the same way (video processing in
> Lua? Crazy :)

Probably, I am :-). My intention of working with ffmpeg isn't in the
context of extremely CPU intensive codecs like h264/vp8 etc., but much
simpler codecs, and basic containers, so I am guessing that the perf.
hit I take wouldn't be crippling.

> [1] https://github.com/mkottman/ffi_fun/blob/master/ffmpeg_audio.lua

Reply | Threaded
Open this post in threaded view
|

Re: few newbie questions -- luaforge/kepler website, REST, bindings etc.

Chris Babcock
In reply to this post by Jayanth Acharya
On Thu, Mar 3, 2011 at 5:31 AM, Jayanth Acharya <[hidden email]> wrote:
> Thanks Chris. Had a look at kepler, and my first impression is, it
> looks a bit complicated to use. However that is quite likely to an
> incorrect impression due to my lack of familiarity with Lua itself.
> Will explore it further, and particularly Copas.

My impression, Looking at Lua after exploring Python-based frameworks,
was that Kepler was building tools at those abstraction levels between
WSGI and frameworks like Pylons or CherryPy. There's nothing
full-stack MVC like TurboGears (whatever it's called now) or Django in
the Lua world, but you can do a good approximation of it with
Versium/Saci, Cosmo and Copas... and enjoy stable APIs as a bonus. If
you want that stack in a CMS, Sputnik is power and joy. Object storage
beats ORM for flexibility, ease of implementation and ease of
maintenance 8 days a week. Well, that reflects my current bias that
ORM is a curious anti-pattern.

For something lighter than REST, consider Reactive Server Pages. A
full REST implementation is great for transaction safety and
portability, e.g. if you want a shopper to be able to bookmark his
shopping list and send it to mom to pay for or to expose an API to
third parties. RSP will be more responsive for short-lived state, like
a game session.

In other words, if your data is processed as objects or tables then
normalizing and de-normalizing the data and retrieving it from storage
with blocking I/O is the fail whale dance. You can lose the ORM and
memcached layers of a full stack web framework by playing to Lua's
strengths as a Data Description Language and using a key-value store
for persistence. Then look at the transaction profile of the app and
build your own stack (or extend Sputnik)  on top of WSAPI depending on
whether your transactions tend towards atomicity and long-lived state
or cluster in related transactions.

> Was attracted to Lua simply due to it's fast, lightweight, and
> familiar feel (has a bit of Erlang, bit of Python, tiny bit of Java
> and lot of C appeal to it). I agree that probably expecting
> heavy-weight CMS'ish frameworks might not be quite right, but I was
> looking for something that really eases development, helps minimize
> lines-of-code.

Whether a Python web framework has five thousand or five millions LoCs
depends on how you count dependencies. ;)

> At the outset Lua looks very simple, and elegant, so I
> am eager to learn more.

It's easy to look at Lua and think "If only..." That's a trap. I went
for it. You won't be the last. Java has a strong culture of code
reuse. Python, less so. Lua, even less than Python. There's probably a
good reason there that doesn't have anything to do with Java making it
any easier to share code than any other language.

I still think Lua is as good as anything else available for rapid
prototyping. Its real strengths don't come into play unless you've got
legacy code or otherwise want to operate in a mixed environment with C
or another language, but it's still competitive even if that isn't
your frame of reference.

Chris
--
Yippee-ki-yay, coffee maker.

PS - Feel free to take this off-list.

Reply | Threaded
Open this post in threaded view
|

Re: few newbie questions -- luaforge/kepler website, REST, bindings etc.

Pierre Chapuis
In reply to this post by Jayanth Acharya
 On Thu, 3 Mar 2011 11:55:04 +0530, Jayanth Acharya wrote:

> Q3. Anyone using Lua for some REST based webservice project ? Would
> appreciate pointers ? Is it well suited for this purpose ?

 If you're trying to write a REST API, you might want to take a look
 at https://github.com/nrk/mercury, which is inspired by Sinatra.

--
 Pierre 'catwell' Chapuis

Reply | Threaded
Open this post in threaded view
|

Re: few newbie questions -- luaforge/kepler website, REST, bindings etc.

Javier Guerra Giraldez
In reply to this post by Chris Babcock
On Fri, Mar 4, 2011 at 1:54 AM, Chris Babcock <[hidden email]> wrote:
> Java has a strong culture of code
> reuse. Python, less so. Lua, even less than Python. There's probably a
> good reason there that doesn't have anything to do with Java making it
> any easier to share code than any other language.

My take on this:

On Java, being an enterprise-endorsed language, there are committees
busy creating huge standards for almost any functionality imaginable,
often _before_ an implementation of such functionality (JSR xxx
anyone?).  Then, there appears a few big projects that implement the
standard.  Since the standards are so big, a complete implementation
is also a big project on itself.  Later, application developers find
that they need a little of that functionality.  Being (in big
proportion) also 'enterprisey' teams, they reach to documented
standards and find that it's an enormous task to reimplement.  The
only reasonable solution is to reuse an existing project, even if the
standardized API wasn't the simplest solution, it looks SO much easier
to adapt to the standard than to reimplement even a part of it.

On Python, things are a lot more informal.  even so, PEPs fill the
same role as JSRs, but they're far smaller and purposely leave parts
of functionality undefined.  With a dynamic language and duck typing,
interoperability isn't impaired with undefined parts, if well chosen.
Still, PEPs are well respected, and if there's one for your library,
better follow it.  If not, a popular library might 'seed' one.

On Lua, there are few standards; and those that exist are typically
just common idioms for you to implement things.  reusability is low
apart from popular C libraries (LuaSocket, LuaExpat).  Not only
because of the lack of standards but because making APIs 'comfortable'
is highly valued, but everybody has a slightly different idea of
comfort.  Finally, reimplementing is fun in Lua!  just see the
informal 'snippet contests' that appear here from time to time.  :-)

--
Javier