Jump to content
The simFlight Network Forums

Lua vs C/C++


Recommended Posts

What are the relative merits of using Lua and C/C++ with FS, specially for those who have a good understanding of C/C++ programming?

If you mean Lua for FSUIPC plug-ins rather than as a free-standing program-making language, then, just that, really. A small Lua plug-in can be knocked up in no time and run inside FS using the FSUIPC facilities, and developed by editing and reloading all within the one FS session. And for things only wanting a little intimate access within FS they are efficient because they are actually in-process.

C/C++ programs on the other hand are many many times faster, and are ideal for larger externally run projects. What they lose in closeness to FS they gain in the speed of their own operations.

Same really for gauges or DLLs running inside FS -- those written in C/C++ will beat anything in Lua for performance.

Lua plug-ins are intended to allow easy user expansion of FSUIPC facilities. I added the interpreter specifically to avoid my having to continually program new features into FSUIPC itself. Really, from that point of view you can't compare them to proper C/C++ programs.

You could make use of Lua for trying ideas out, ( "prototyping") before embarking on a proper C/C++ program. I did exactly this recently, running quite an extensive Lua plug-in to drive my hardware 737 multi-USB overhead, before writing a proper C driver for it.

Regards

Pete

Link to comment
Share on other sites

Thanks for your helpful reply. I did mean Lua with FSUIPC.

I think I'll stick with what I know on the old dogs/new tricks principle. I use Borland C++ Builder and creatde a component that encapsulates the published FSUIPC code. This means I can simply drag&drop the component onto a windowed application, or create in on-the-fly with a single line for a non-windowed one. I can use the normal Borland debug facilities to check my application running with Flight Simulator and to make changes while it's still running.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.