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.
In[1]:=1

✖
Out[1]=1

Create WebAssembly code for makeOdd using FunctionCompileExportString.
In[2]:=2

✖
Out[2]=2

Create a WebAssembly object file using FunctionCompileExport.
In[3]:=3

✖
Out[3]=3

The contents of the object file can be created in memory using FunctionCompileExportByteArray.
In[4]:=4

✖
Out[4]=4

Verify that the ByteArray has the same contents as the object file.
In[5]:=5

✖
Out[5]=5
