plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.

Please take a moment to read the platform’s guidelines before you get started!

question

StevenPearce avatar image
StevenPearce asked snek commented

Support JavaScript/Typescript for WASM modules

The only advantage to C++ in the context of WASM modules is supporting legacy code. For everything else, it's the wrong choice of language. Javascript would lower the barrier to entry for new developers, and massively speed up development for existing developers.

wasm
10 comments
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

You can technically already use whatever language you want that compiles to WASM. Over at FlyByWire we are using rust instead of c++. JavaScript (and by proxy typescript) is an interpreted language and cannot be compiled to WASM but you might find AssemblyScript, a typed subset of JavaScript which targets WASM, to be interesting.

2 Likes 2 ·

Is there a reason why you would want a JS WASM target specifically for this? It is already possible to use JS in the sim via the Coherent framework, which powers the default avionics.

-Matt | Working Title

0 Likes 0 ·

@mattnischan; Yes, the performance hit with coherent is unacceptable. Even the "low" setting for glass cockpit refresh rate has a large impact, thus I imagine running an update every frame would completely kill performance. That said, Coherent could possibly be a workable solution for logic instead of just UI/panels if it were to run on a separate thread

0 Likes 0 ·

You'll have to take my word for it that isn't a function of the Coherent framework and is instead just not very well optimized code. Properly optimized code using the correct performance techniques is near native speed. As an example our upcoming G1000 NXi PFD runs the entire PFD in about 1ms.

Coherent already runs mostly on a separate thread, but coming in an update it will be separated more or less completely.

-Matt | Working Title

4 Likes 4 ·
Show more comments

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.