flow icon indicating copy to clipboard operation
flow copied to clipboard

Create some code generation around supplied functions, so a developer just writes a bare function

Open andrewdavidmackenzie opened this issue 7 years ago • 1 comments

Read a function and generate the .toml from it, from the name, the number and name of inputs

? how to name outputs ?

  • simple output --> "out"
  • typles/struct --> use the name of the variable that's returned.

then either generate the Implementation code around it when we copy across to the rust project, or have them include!() code, or somehow from the type of function (FlowFunction) the boilerplate is generated.

andrewdavidmackenzie avatar Feb 23 '18 13:02 andrewdavidmackenzie

For library projects that are then packaged and published, it might need to be a command that generates the .toml spec and code from a raw function from the developer....based on an existing function.

That could potentially be used to wrap rust std lib functions directly?

What about the compiler taking a reference to a function in a raw rust lib (like std lib) and generating the .toml from that when compiling (or inferring internally, just as the toml generation would have to do)... and generating the boilerplate code on the fly.

Then flows could just refer directly to existing library functions?

Maybe try and do that for local functions first, and then later see if I can do for lib functions - as would need to use cargo to find the source etc...

andrewdavidmackenzie avatar Feb 23 '18 14:02 andrewdavidmackenzie