Skip to content
pwl edited this page Mar 4, 2012 · 10 revisions

Use Lua for configuration/restart files instead of XML?

Pros:

  • Scripting language, can perform dynamic initial data creation, declare functions to be called from Fortran code etc.
  • luac (compiled lua code)
  • lua itself can call c and fortran code
  • lua supports arbitrary precision numbers
  • lua has ISO C API, accessible from Fortran
Several ready to use interfaces are available. Example in C: Printing tables: Passing around C structures: Long double in Lua: I managed to compile Lua using __float128 as LUA_NUMBER with only minor modifications. The result should be posted on github soon. The __float128 type is compatible with _Quad and should work with REAL(16) compiled with ifort.

WARNING: lua libraries "io" and "math" are not yet compatible with __float128.

Clone this wiki locally