lua-capnproto icon indicating copy to clipboard operation
lua-capnproto copied to clipboard

Effort to port Lua Capnproto to Lua 5.1 for a Big Endian system

Open wdicarlo opened this issue 11 years ago • 1 comments
trafficstars

Hi, I am quite new to Lua world and to capnproto. So, it is difficult for me to make an estimation of the effort needed to port your code to standard Lua 5.1 (no Luajit) for a Big Endian system (PPC). Any hint would be appreciated.

Thank you Walter

wdicarlo avatar May 11 '14 22:05 wdicarlo

Hi wdicarlo,

Thanks for your interest. There are a few things you need to do if you want to port it to Lua 5.1:

  1. For performance reasons, I use LuaJIT's FFI extension to manage string buffers. There is a FFI port for Lua https://github.com/jmckaskill/luaffi. I've done something to lua-capnproto using this library, but haven't finished yet. You can check this library out.
  2. I also use LuaJIT's 64 bit number extension: "0LL', "0ULL". See "Extensions to the Lua Parser" section of http://luajit.org/ext_ffi_api.html#literals. This is a big problem when you are porting. Because there is no convenient way to describe 64 bit number in Lua 5.1 AFAIK. You may need to use something else to represent 64bit integer numbers.
  3. Endianness. Now some bit operation functions (like "fix_float64_default") depends on little endian. You need to modify them to work on big endian environment.

These things are what I can think of for now. If you have any questions, feel free to ask me.

calio avatar May 12 '14 20:05 calio