Skip to content
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

Protocol for defining small functions in external binaries #1026

Open
andychu opened this issue Nov 28, 2021 · 1 comment
Open

Protocol for defining small functions in external binaries #1026

andychu opened this issue Nov 28, 2021 · 1 comment

Comments

@andychu
Copy link
Contributor

andychu commented Nov 28, 2021

This could be things like a "split" algorithm, uppercase, base64, crypto, etc.

Sort of related to #848 which is about external processes, coprocesses, VMs, containers

Basically we are laying the logical concept of functions on top of external processes

I think it will be a QTT protocol over stdin / stdout, with args as columns of stdin, and return values as columns of stdout. Depends on #827

Now that we have #984 proc signatures, we should make something sort of consistent? Or maybe it will depend on #631 so there is a DSL but no func keyword

define sha256 {
  command = %(myprog.py sha256)
  args {
     ...
  }
  returns {
    ...
  }
}
  • then such functions can be used inline like
echo $sha256('foo')
var x = sha256('foo')

and maybe

echo ${myvar|sha256}

for escapers. Related to string safety

And in vectorized form

ls --qtt | cols (sha256 = sha256(foo))

related to #827 as well

@andychu
Copy link
Contributor Author

andychu commented Nov 28, 2021

This feels a little related to the "standard standard library" problem, i.e. where every language has slightly different string functions

Although JS and Python have sort of converted, with .startsWith and .endsWith etc.

Also related to #950

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant