Python in FlightGear

From FlightGear wiki
Revision as of 21:59, 28 December 2015 by Hooray (talk | contribs)
Jump to navigation Jump to search
This article is a stub. You can help the wiki by expanding it.

Background

Cquote1.png This is a follow up of a discussion that I have with one of the devs at fg weekend 2015.

My propose is that we include python 3 as an alternative for nasal. This mean not that nasal is bad, but I can writing code in python faster than nasal. (this is only my opinion and experience)

Another plus for python re can create a standalone interface that connect to fgfs or play a flight from an recode session for cockpit building or testing new code. What is your considers about Python as an nasal alternative?

Sorry this is short post, more in the future.
Cquote2.png

Status

RFC

Objective

Motivation

Cquote1.png Python support would be a great feature I think. It is used in many products (e.g. in Blender) and that is a plus. However it's not guaranteed that it is free of such problems until you port all current Nasal scripts to Python and test it. What I am thinking about is a possibility to convert Nasal scripts to C or C++ and compile them as shared objects (.so .dll). Then we could load them dynamically at fgfs runtime. So in the end we get raw C/C++ performance to our modules. Is this possible or am I dreaming of something impossible here? What do you think?
— Robert (Mar 26th, 2011). Re: [Flightgear-devel] Stuttering at 1 Hz rate.
(powered by Instant-Cquotes)
Cquote2.png

Open Issues

Garbage Collection

Cquote1.png Does anybody of you know how garbage collectors of Java and Python and other GPL'd script engines compare to each other? (atomic step character)
Cquote2.png
Cquote1.png Reference counting doesn't provide a strong performance advantage over conventional garbage collection, and a reference-counting scheme can take an unbounded amount of time. Reference counting schemes that do have real-time or bounded behavior are very complicated. I don't know much about our Nasal implementation, but I suspect that the garbage collector could be changed to trace only a portion of Nasal's heap at each invocation, at the risk of increased memory use.
— Tim Moore (Mar 26th, 2011). Re: [Flightgear-devel] Stuttering at 1 Hz rate.
(powered by Instant-Cquotes)
Cquote2.png