Help me understand what luvi does

141 views
Skip to first unread message

Tristan Kohl

unread,
Apr 1, 2019, 8:29:29 AM4/1/19
to luvit
Hey guys,

I am quite used to the Nodejs world and was super excited when I learned that the language I learned programming with - and found new love in recent times - has something that combines it with Node's awesome API. I would take Lua 10/10 times for my stuff if I had a choice.

However reading and toying around I did not quite get what luvi does in particular. Here is what I (think) I know:
  1. luv: low level bindings to libuv
  2. lit: some package manager/builder
  3. luvit: Binary containing LuaJIT + luv, pretty much Nodejs
Github description talks about luvi as "A project in-between luv and luvit" but that does not explain what exactly it does or what it adds. Hope someone more seasoned can jump up and bring light to me.

Cheers,
Tristan

Ryan Phillips

unread,
Apr 1, 2019, 12:06:59 PM4/1/19
to lu...@googlegroups.com, Tristan Kohl
Hey Tristan,

Welcome! :)

luvi is a binary that supports lua script embedding (within the binary). Luvi also includes luv and other libraries (openssl, zlib, pcre) to add more functionality to enable various components we enjoy (tls, compression, and regexes). Luvit is written entirely in Lua, and just calls into the APIs that we have included within Luvi. Some people use Luvi with the coro libraries (more Lua like using coroutines), and others use Luvit which is more like NodeJS.

There is a discord (https://discord.gg/luvit) or IRC channel. See you around.

Regards,
Ryan

--
You received this message because you are subscribed to the Google Groups "luvit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to luvit+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tristan Kohl

unread,
Apr 2, 2019, 8:23:47 AM4/2/19
to luvit
Hi Ryan,

thank you for your answer. So if I understand you correctly luvi does the heavy lifting and luvit is "syntactic sugar" on top to enable NodeJS like programming?

That makes sense to me, thanks again for clarifying this.

Cheers,
Tristan

P.S. I tried to join the IRC but Thunderbird does not connect to it even though a bunch of other channels on freenode work just fine.
To unsubscribe from this group and stop receiving emails from it, send an email to lu...@googlegroups.com.

Tim Caswell

unread,
Apr 2, 2019, 8:42:43 AM4/2/19
to lu...@googlegroups.com
Sort of.  Luvi is all the parts that have to be implemented in native C code and not much more.   There is some fairly heavyweight code in Lua, such as the HTTP stack (luvi just exposes libuv tcp and TLS from openssl, but no HTTP or websocket code)

Also luvi has the bootstrap code that knows how to read Lua from a zip file.  So a luvi based app is the static luvi binary literally concatenated with a zip file containing all the needed Lua code for the app.

Lit is a luvi app as is luvit.  lit is the package manager and a toolkit for building luvi based apps.  Luvit is a nodejs clone with similar apis built in implemented in Lua and node style APIs.

Personally I don't use luvit much anymore and tend to write my apps directly as luvi based programs using lit to manage deps and package it.

To unsubscribe from this group and stop receiving emails from it, send an email to luvit+un...@googlegroups.com.

Tristan Kohl

unread,
Apr 3, 2019, 4:04:32 PM4/3/19
to luvit
Hi Tim,

thanks for elaborating further, I think I get it slowly. I got curious by your last sentence and wet my feet a little with "pure luv", it was a real pleasure I did not expect. Plus I do not even need a "real" HTTP server for my project but rather a custom TCP server.

However I could not find any API documentation for it so I had to rely on examples I could find in the luv repository. Is there any resource I missed other than libuv documentation which is linked from luv README?

Btw: thank you for this awesome piece of software :)

Cheers,
Tristan

Tim Caswell

unread,
Apr 3, 2019, 11:19:28 PM4/3/19
to lu...@googlegroups.com
I'm afraid there aren't many docs.  When I forget the APIs I wrote, I tend to read the C code in luv and match it against the libuv docs.  Not ideal I know.  Also the various lua libraries such as coro-net inside of lit provide good examples.

To unsubscribe from this group and stop receiving emails from it, send an email to luvit+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages