Create Machine Code for Exotic Architectures

The Wolfram Compiler can generate output in a variety of native machine code formats, including formats for which the Wolfram system has not been supported. In this example, WebAssembly code is generated.

Define a simple function that returns an odd number.

Create WebAssembly code for makeOdd using FunctionCompileExportString.

Create a WebAssembly object file using FunctionCompileExport.

The contents of the object file can be created in memory using FunctionCompileExportByteArray.

Verify that the ByteArray has the same contents as the object file.

Related Examples

de es fr ja ko pt-br zh