-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: user-defined functions #405
Labels
Comments
@jdidion what do you think of the Discussions forum for this & your other? (I just added mine there for good measure :) |
Sure - added both proposals there. We'll see where they get more traction. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cross-posted from #405
Also see discussions here:
Currently, the WDL specification provides a small library of functions that meet the needs of many use-cases, but certainly not all of them. The ability to define new functions has been requested several times in the past. This proposal aims for an idiomatic specification of UDFs.
Example:
The signature of the above function is:
String read_yaml(File, String?)
User-defined functions are similar to
tasks
, with the following differences:func
keyword.input
parameters matters - the (left-to-right) function signature is the set of input parameters ordered from top-to-bottom.Similar to
struct
s,func
s exist in a common namespace (regardless of in which WDL file they are defined); however,func
s cannot be aliased, so there must not be any name collisions betweenfunc
s defined in different WDL files in the import tree.Once defined, a
func
may be used by its (unqualified) name in any command block.In conjunction with the proposed addition of the
interpreter
runtime attribute, users will be able to write functions in a variety of programming languages. This raises the question of how to support functions written in different languages, or a function written in a different language than the command block. There are a few possible solutions:docker compose
ordocker run --link
to enable the commands to access executables across containers. This means that each function would need to specify its container, and the runtime would be required to dynamically compose the container of the task and all functions used by that task.The text was updated successfully, but these errors were encountered: