luv design decision - why lua C binding and not LuaLIT FFI?

116 views
Skip to first unread message

Kamil Witecki

unread,
May 26, 2017, 3:57:58 PM5/26/17
to luvit
Hello,
I really appreciate luvit. I want to understand better what stands behind design decisions. I thought about integration libuv with Lua myself some time ago (before I discovered that luv does that). Though my idea was to use LuaJIT and its FFI. I did a simple proof of concept (integrated libuv timers and tested these). Did not push more effort into it. Though I wonder if there is point in revisiting the topic. I would like to understand what caused luv to be written in C. You must have analyzed the task deeply, so I am eager to learn the reason.

Pozdrawiam,
Kamil Witecki

Tim Caswell

unread,
May 27, 2017, 7:55:03 PM5/27/17
to lu...@googlegroups.com
When I started, luajit ffi didn't support C callbacks.  It was later added, but performance is bad and Mike advises against using them.

I've since wished for a non-callback interface to libuv, but nobody ever had time to write it.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kamil Witecki

unread,
May 28, 2017, 3:51:18 PM5/28/17
to lu...@googlegroups.com
Thank you! I haven't considered that one. By non-callback interface you refer to, for example, coroutine based?


Pozdrawiam,
Kamil Witecki.

--
You received this message because you are subscribed to a topic in the Google Groups "luvit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/luvit/dqjDWfH1VPw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to luvit+unsubscribe@googlegroups.com.

Tim Caswell

unread,
May 29, 2017, 11:38:00 AM5/29/17
to lu...@googlegroups.com
C doesn't have native coroutines, but I mean something with a more poll style interface.

Instead of a blocking `uv_run()` which then blocks and calls various callbacks in C, I'd want a `uv_next_event()` or something that returns the next event in a giant union which I have to manually route to the handlers myself.
Reply all
Reply to author
Forward
0 new messages