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

Proposal: Pluggable Interpreter #2231

Closed
nikolay opened this issue Nov 28, 2024 · 2 comments
Closed

Proposal: Pluggable Interpreter #2231

nikolay opened this issue Nov 28, 2024 · 2 comments
Labels
enhancement New feature or request pending-decision This issue has not been accepted for implementation nor rejected. It's still open to discussion.

Comments

@nikolay
Copy link

nikolay commented Nov 28, 2024

OpenTofu Version

N/A

The problem in your OpenTofu project

Sometimes validation with a single expression or comprehensions becomes unreadable.

Attempted Solutions

https://registry.terraform.io/providers/apparentlymart/javascript

Proposal

Although there's a convenient and established Go interpreter by Traefik called Yaegi, many may not like the idea of having to use Go-like language. So OpenTofu may have a standardized provider, which implements an interpreter interface and this way multiple languages can be implemented.

provider "yaegi" {
  source = "src/go"
}

locals {
  c = provider::yaegi::custom_function("a", "b")
}

References

No response

@nikolay nikolay added enhancement New feature or request pending-decision This issue has not been accepted for implementation nor rejected. It's still open to discussion. labels Nov 28, 2024
@abstractionfactory
Copy link
Contributor

Hi @nikolay have you tried the experimental Go and Lua providers for OpenTofu yet? Wouldn't these fill the need?

@nikolay
Copy link
Author

nikolay commented Nov 29, 2024

@abstractionfactory The Go provider is exactly what I envisioned and it's using Yaegi, too. Thank you!

@nikolay nikolay closed this as completed Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pending-decision This issue has not been accepted for implementation nor rejected. It's still open to discussion.
Projects
None yet
Development

No branches or pull requests

2 participants