
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
@flybywiresim/rnp
Advanced tools
RNP is a language which compiles to [RPN][], a scripting language used by MSFS.
RNP is a language which compiles to RPN, a scripting language used by MSFS.
RNP provides a familiar and expressive environment with strict types. In the future it may also perform optimization.
const { Type, translate } = require('@flybywiresim/rnp');
// function to resolve imports
function getSource(
referrer, // specifier of importing module
specifier, // specifier of module to be imported
) {
// return `null` if module can't be resolved.
return {
source, // source of imported module
specifier, // resolved specifier, e.g. `dirname(referrer).join(specifier)`
};
}
const {
output, // string RPN output
messages, // [{ level, message, location }]
} = translate(source, {
specifier, // defaults to '(anonymous)'
returnType, // defaults to `Type.VOID`
getSource, // defaults to resolution error
});
boolean - true or false.number - IEEE-754 double precision floating point number.string - A string type.any - Used for unknown types. No builtin in the language allows this type,
but some expressions may be valid with it, for example (L:X) = (L:Y).void - The absence of a value. An example of an expression which produces
void is if true {}.Comment out a single line.
// this is a line comment
Comment out multiple lines. Nesting is allowed.
/* this
comment
is
longer
*/
/*
/*
comment doesn't end here
*/
comment ends here
*/
Declare a local.
let a = 1;
SimVars can be aliased to local names.
alias x = (L:X, bool);
x = true; // set L:X to true
if x { // if L:X is true
}
Declare a macro. Macros may be exported using export. Macros are "hygienic",
meaning that identifiers may not be implicitly leaked into or out of a macro
scope. Macros parameters use $ to avoid being confused with normal variables.
macro add($a, $b) {
$a + $b
}
export macro sub($a, $b) {
$a - $b
}
macro assign($a) {
$a = 1;
}
let b = 0;
// does not break hygiene rules because `b` was explicitly passed
assign(b);
Macros can be imported from other files using import.
import { sub } from './file.rnp';
Assign a value to a local.
a = 1;
Assign a value to a SimVar.
(X:Y) = 1;
(X:Y, unit) = 1;
// booleans
true;
false;
// numbers
1.0;
0x10;
0b101010;
// strings
'hello';
Reference a local.
a
Reference a SimVar.
(X:Y)
(X:Y, unit)
Allows XML substitutions. Expressions must be typed.
let x = #X, bool#;
#Y#;
Expand a macro.
add(1, 2);
{
1
}
Conditional evaluation, may be used as an expression.
if x {
}
if x {
} else {
}
if x {
} else if y {
} else {
}
let a = if x { 1 } else { 2 };
Mathematical and relational operations.
1 + 1;
1 / 1;
'hello' == 'hello';
// etc...
!true
~1
// etc...
RPN provides several standard operations. These operations are available in RNP as method-ish syntax.
8.log(2);
'hello'.toUpperCase();
FAQs
RNP is a language which compiles to [RPN][], a scripting language used by MSFS.
The npm package @flybywiresim/rnp receives a total of 213 weekly downloads. As such, @flybywiresim/rnp popularity was classified as not popular.
We found that @flybywiresim/rnp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.