Hi all,
Alain and Sebastien have both mentioned in various threads here regarding Lua that the Lua interpreter was never intended to be used for complex scripting. I completely respect that assertion and understand that while developing this great system, Orthanc, complex Lua support likely falls on the low end of their priorities. Further, complex Lua support is really tangential to their aims and after all, ultimately provides hooks into the same API we could call from external programs.
All that said, I thought I would explain why I find complex Lua scripts so useful and why I have focused a lot of my work with Orthanc there. I wanted to see what others thought about complex Lua scripting and maybe whether anyone has insights or encouragement for moving to either plugin development or external (ex. python) based interactions with Orthanc.
Probably the main reason I have developed complex Lua scripts has been that they leverage the “server” aspect of Orthanc.
My background is in medical imaging research. I’ve done lots of programming over my career in many languages on multiple platforms, but have for the most part focused on data analysis with data management subservient to analysis. I tend to avoid developing sophisticated GUIs and/or service-like applications because they are mostly outside my experience and the effort required overwhelms any gains I might make in the data analysis.
I think of GUIs and services as involving a lot of asynchronous event handling, something that requires a different mindset than the more linear flow of data analysis.
Because the embedded Lua hooks into the Orthanc server by way of the “stable” age parameters and incominghttprequest filters, I find it more attractive to use Lua directly rather than the implement an event driven service elsewhere that would interact with the Orthanc.
Ignoring the plugin approach, if I were to use the restful API from an external application, wouldn’t I need to essentially develop an event driven service? One that would periodically check Orthanc for changes and then act accordingly?
This has been the attraction of using the embedded Lua interpreter - not having to design my own event driven service to accomplish the same thing. It’s the same reason I’ve been quite happy with the stock Explorer web interface - not having to write a GUI/server app for my users (fellow medical image researchers).
I admit that some day I may need to switch to an external app using the API or develop a plugin, but I thought I’d offer some insight into why this particular medical researcher went the direction of complicated Lua scripts. In a way, the Orthanc developers have made it almost too easy for a non GUI/service coder like myself.
I’d be interested in anyone else’s thoughts.
Cheers,
John.