lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi all,

(Long background: skip to the next paragraph for the real question.) I’m
a big fan of David Parsons’s discount[1], a command-line Markdown to HTML
parser and accompanying C library, so naturally I went looking for Lua
bindings. There are two rocks in LuaRocks that provide this, and both
projects are called lua-discount.[2][3] (Though in LuaRocks the newer of
the two is named just discount.) Neither has been updated in some time. The
more popular one (by far-nearly 10,000 downloads versus just over 400
downloads) hasn’t been updated since 2008, and the newer one hasn’t been
updated for about two years. (The far more outdated one may be more popular
because it became a dependency for several other projects.) I’ve submitted
a patch to update the one that is closer to current, and I’m waiting to
hear about that, but one difference between them has given me a more
general question.

When people write C bindings for a library like discount that is not
a standard system library (i.e., you wouldn’t expect users already to have
it installed), do people generally prefer to bundle a version of the
C library with the Lua bindings or to leave that to the user?

In this case, the older lua-discount[2], has imported a version of the
C library files and builds against those specifically. It’s effectively
pinned to that specific version of discount until someone updates the
C files imported into lua-discount. The newer lua-discount[3], however,
leaves it to the user to have discount’s C library installed and in their
INCLUDE path. Thus, people can keep using the newer lua-discount with
different versions of the C library, provided that the C library doesn’t
change it’s most basic API. Bottom line: I can see pros and cons to both
approaches.

I’m wondering what people think is better practice here since I may end up
writing a third lua-discount, (only if I never hear back from either of the
two authors, I promise)!

Thanks, Peter

[1]: http://www.pell.portland.or.us/~orc/Code/discount/
[2]: https://github.com/asb/lua-discount/
[3]: https://github.com/craigbarnes/lua-discount
-- 
We have not been faced with the need to satisfy someone else's
requirements, and for this freedom we are grateful.
    Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System