New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LuaJIT FFI Bindings for CoolProp High-level API #438
Comments
|
Great, thanks for contributing! Would you like to keep things separated or would you be interested in integrating your code as a new wrapper? Lua would be in good company there, see http://coolprop.sourceforge.net/coolprop/wrappers/index.html Do people that use Lua know how to use your code or would some documentation be helpful? Is there anything we can do to support your efforts? |
|
Hi, I think it would be nice if this could be integrated in CoolProp wrappers. Do you want me to make a pull request here: https://github.com/CoolProp/CoolProp/tree/master/wrappers I think that correct name for this wrapper is LuaJIT (as for PUC Lua (the normal one) you need a different kind of wrapper that uses the Lua C API, and not LuaJIT's FFI. I may look at implementing Lua C API as well, but right now I got this LuaJIT FFI wrapper working. I think that the code is quite alright, and the API is easy to use from client Lua code. I will do some more testing, and check if there is something missing. I think that if we could integrate this code in your CoolProp repository I will drop that resty-prefix, so that you could use it something like this: local coolprop = require "coolprop"I think that we could also integrate the normal Lua C-api in this Lua wrapper so that it will automatically select either LuaJIT FFI-bindings or Lua C API bindings depending on the runtime where it is executed. But let's start with LuaJIT, maybe somebody will join the efforts and write Lua C-API bindings as well (that is C-coded wrapper). |
|
That sounds like a plan. Is there anything that needs compilation? Do you use a static or a shared library? Does LuaJIT run on all major platforms? It would be very helpful if you also added a description here: https://github.com/CoolProp/CoolProp/tree/master/Web/coolprop/wrappers . Have a look at the other pages for how to use internal variables for links to the download repositories if needed. |
|
This binding is using shared-library (I can probably include a check if the CoolProp lib has been linked statically so that it works on both cases), and doesn't need any compilation. LuaJIT runs on many platforms: |
|
OK, great. To me it sound like LuaJIT is somewhat similar to Julia, maybe it helps to look at the docs for the Julia wrapper. I do not have Windows, so I cannot be your tester, but I am sure that we find someone to run your code. Maybe @ibell is interested... |
|
I quickly took a look at your wrapper, and I only have one small comment. Compiling all this stuff together shouldn't be too bad, assuming Lua @jowr is right about checking the Julia wrapper, I think it is structured On Wed, Jan 28, 2015 at 2:44 PM, Jorrit Wronski notifications@github.com
|
|
Let's move the discussion here: |
I have implemented LuaJIT bindings for CoolProp High-level API here:
https://github.com/bungle/lua-resty-coolprop
You can also find the library from LuaRocks:
https://rocks.moonscript.org/modules/bungle/lua-resty-coolprop
The text was updated successfully, but these errors were encountered: