[liblouis-liblouisxml] Re: Performance Question

  • From: Aaron Cannon <cannona@xxxxxxxxxxxxxxxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Sat, 26 Oct 2013 22:07:23 -0500

You are right that the Python API has been made easier to work with,
thanks to third-party libraries.  However the Boost library, unless
there's been a major change, is exclusively a C++ library, and C++ may
not be the best option for maximum compatibility on embedded systems:
http://stackoverflow.com/questions/2065456/developing-embedded-software-library-c-or-c/2066175#2066175

Also, I stand by my assertion that Python is not simple to compile on
embedded hardware, as it has many system dependencies.  Lua, on the
other hand, requires only an ANSI C compiler.

Again, I would love to use Python, but I think it limits the
situations in which the library can be used far to much.

Aaron


On 10/26/13, Ken Perry <kperry@xxxxxxx> wrote:
> I would also dispute the part about python not being easy to embe compile on
> other plaforms and hard to embed. You really should take a look at the boost
> libraries if you think that is the case.
>
> Ken
>
> -----Original Message-----
> From: liblouis-liblouisxml-bounce@xxxxxxxxxxxxx
> [mailto:liblouis-liblouisxml-bounce@xxxxxxxxxxxxx] On Behalf Of Michael
> Whapples
> Sent: Saturday, October 26, 2013 3:19 PM
> To: liblouis-liblouisxml@xxxxxxxxxxxxx
> Subject: [liblouis-liblouisxml] Re: Performance Question
>
> The only thing I would dispute is that you say the C API of Python is not as
> simple as it could be. This is where Cython steps in, making it very easy to
> create C extensions for Python. Also if Cython is not to your taste then I
> believe there are other tools, eg. boost has a library for writing Python
> extensions, swig, ctypes, etc.
>
> Michael Whapples
> On 26/10/2013 19:57, Aaron Cannon wrote:
>> I am also very much in favor of using Lua, barring any better
>> suggestions.  Here are the pros and cons of Lua, Python, and
>> JavaScript:
>>
>> JavaScript:
>> V8 is a fast moving target, is not small, and has an extremely complex
>> C/C++ api, which is still very much in flux.  JavaScripts Unicode
>> support is also a bit sketchy.
>>
>> Python, although it is my favorite language by far, is likely not
>> suitable for what we need.  It is quite large, not simple to compile
>> on embedded hardware, and the C API is not as simple as it could be.
>> On the other hand, it's a great language, has a lot of great batteries
>> included, including excellent Unicode support, and a lot of people can
>> program in it.
>>
>> Finally, Lua, which I believe to be the best option in this situation,
>> is very light-weight, (less than 100K for the Lua core (at least 10-40
>> times smaller than Python, depending on how you count)), is designed
>> to be highly portable and has been shown to compile on several
>> different embedded platforms, and offers a simple, flexible and easily
>> learned language.  Independent enchmarking tests generally have good
>> things to say about its performance.
>>
>> I could see us easily using Lua for prototyping various solutions, and
>> then either leaving them in Lua, or once they were considered
>> reasonably stable, converting them to C functions exposed in Lua, for
>> greater speed.  Thanks to the simplicity of the C API, this is not
>> nearly as difficult as it could be.
>>
>> The major drawback is that Lua doesn't support Unicode with some of
>> its string functions.  Lua strings can store UTF-8 data with no
>> problem, it's just that some of the library string methods don't
>> support UTF-8.  However, I think that this can be overcome by simply
>> building a wrapper for a good Unicode library, such as UIC.
>>
>> Lua has been used as the scripting language in countless games, such
>> as World of Warcraft, in the NGnX web server, and the Redis database,
>> just to name a few.
>>
>> Just my $0.02.
>>
>> Thanks.
>>
>> Aaron
>> For a description of the software, to download it and links to project
>> pages go to http://www.abilitiessoft.com
>
> For a description of the software, to download it and links to project pages
> go to http://www.abilitiessoft.com
> For a description of the software, to download it and links to
> project pages go to http://www.abilitiessoft.com
>
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: