Complex instruments: still Lua scripting only ?

Let Sim Innovations know about your Air Manager experience and let us know about your dream feature addition

Moderators: russ, Ralph

Post Reply
Message
Author
chrstphd
Posts: 3
Joined: Wed Mar 01, 2017 1:16 pm

Complex instruments: still Lua scripting only ?

#1 Post by chrstphd »

Hi Ralph, Corjan,

I just install beta3 to update my ARCDU and test the new features.
I'm wondering if it's still impossible to use plain Java instead of Lua ?

Your core engine is still in Java and if Lua is great for small instruments (like any scripting in fact), it could be a pain when it becomes to have a lot of code.
I don't say it's impossible to write complex instruments, some guys in this community already did it with great result but it lacks of readability, modularity, tooling, ... which is, well, subjective.

I guess that we could have to start around c.s.a.a.o.AMBaseInstrument but don't want to start to try unless to have your advice to avoid any blocking stuff later.

Thanks :)

User avatar
Ralph
Posts: 7921
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Complex instruments: still Lua scripting only ?

#2 Post by Ralph »

With 3.0 there's only Java for the GUI. And it would become a mess when you can mix two languages.

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: Complex instruments: still Lua scripting only ?

#3 Post by Corjan »

Ralph is right, the backend code executing the lua code is now written in C. This is done to improve portability to different platforms.

So you won't be able to execute any java functions from lua from AM 3.0 and up.

There are ways to further improve instrument structure, even in lua.
Biggest improvement can be to create multiple lua files, and store those is the 'lib' directory.

The lua files in the lib directory will be executed before the logic.lua is executed.


Corjan

chrstphd
Posts: 3
Joined: Wed Mar 01, 2017 1:16 pm

Re: Complex instruments: still Lua scripting only ?

#4 Post by chrstphd »

OK.

Should we have a lib/ folder per instrument to avoid any problem between instruments ?

User avatar
Ralph
Posts: 7921
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Complex instruments: still Lua scripting only ?

#5 Post by Ralph »

Each instrument has its own lib folder.

JackZ
Posts: 2267
Joined: Mon Feb 22, 2016 1:02 pm

Re: Complex instruments: still Lua scripting only ?

#6 Post by JackZ »

Corjan wrote: Sat Sep 02, 2017 7:21 pm Ralph is right, the backend code executing the lua code is now written in C. This is done to improve portability to different platforms.

So you won't be able to execute any java functions from lua from AM 3.0 and up.

There are ways to further improve instrument structure, even in lua.
Biggest improvement can be to create multiple lua files, and store those is the 'lib' directory.

The lua files in the lib directory will be executed before the logic.lua is executed.


Corjan
Hmm... does that mean we can include C code snippets right into AM Lua, as it is already a native feature in Lua?

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

chrstphd
Posts: 3
Joined: Wed Mar 01, 2017 1:16 pm

Re: Complex instruments: still Lua scripting only ?

#7 Post by chrstphd »

Ralph wrote: Sun Sep 03, 2017 12:38 pm Each instrument has its own lib folder.
Great, thanks !

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: Complex instruments: still Lua scripting only ?

#8 Post by Corjan »

JackZ wrote: Sun Sep 03, 2017 3:43 pm Hmm... does that mean we can include C code snippets right into AM Lua, as it is already a native feature in Lua?

Jacques
I'm afraid that will be quite complicated. It might be that it is possible though.
Downside is that it won't be truly platform independent anymore, since you would have to build the extension for multiple architectures aswell (x86, x64, ARM etc.)

JackZ
Posts: 2267
Joined: Mon Feb 22, 2016 1:02 pm

Re: Complex instruments: still Lua scripting only ?

#9 Post by JackZ »

Thanks Corjan
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

Post Reply