ChatGPT generated code for eval_string alternative

Thanks for those answers!

As a general design idea, I am thinking about how to dynamically load/run code on a general purpose engine thats easy to scale up.

  • user writes a function in phoenix frontend (using a custom SDK)
  • function code is stored in spec file as string or file is saved on shared disk somewhere
  • engine dynamically loads spec file or imports disk file and runs code

ChatGPT also suggested Code.require_file/2 or Code.require_file/3 for dynamic imports