Encoding/decoding arrays of floats
Hello! I am exploring the use of Futhark to do computationally intensive tasks on behalf of an Elm client. The kind of computation involves 2D arrays of float32’s. Call such an array
a. Then a typical computation has the form
a -> f(a). Futhark is a typed functional language that compiles code for the GPU. It can compute
f(a) very quickly.
I’ve rigged up a Python server which hosts the Futhark code and maintains the array
a as part of its state. When the server receives a GET request, it sends a string representation of
a (bad) and then updates
f. See this GitHub repo for code and a detailed README.
What is needed next is a fast way to send arrays of f32’s back and forth between Elm and Python. Once this is done, the client can give a visual display of the array. See this Example for a pure Elm version (press the ‘Step’ or ‘Ready’ buttons to advance the state).
To summarize: what is needed for this project to proceed is a way to send arrays of float32s back and forth between Elm and Python.