Get the output of a Julia function called from C

Okay, the following works:

#include <julia.h>
#include <stdio.h>
JULIA_DEFINE_FAST_TLS
int main(int argc, char *argv[]) {
  jl_init();
  jl_array_t *z = (jl_array_t*)jl_eval_string("rand(8)");
  double *z_data = (double*)jl_array_data(z);
  printf("%g\n", z_data[0]);
  jl_atexit_hook(0);
  return 0;
}