Howto:From JavaScript to Nasal in 30 Minutes

From FlightGear wiki
Jump to: navigation, search
This article is a stub. You can help the wiki by expanding it.

Nasal is heavily based on concepts borrowed from ECMAScript/JavaScript - given the plethora of JavaScript code and libraries/frameworks readily available online, this similiarity provides a great opportunity to easily adapt/port JavaScript snippets and turn those into code that can be reused in FlightGear.

For instance, Nasalis close enough to JavaScript to "port" ANNs (artificial neural networks) from JavaScript to Nasal within a few minutes of search/replace: Howto:Neural networks in Nasal[1]

Equally, Richard's Emesary framework has been ported to Nasal, too: Emesary.



Variables

Vectors

Hashes

Functions

function foo() {
}
var foo = func() {
};

Classes

Objects

Inheritance

References

References