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

Go-lang wrapper for nickel #1929

Open
olorin37 opened this issue May 28, 2024 · 1 comment
Open

Go-lang wrapper for nickel #1929

olorin37 opened this issue May 28, 2024 · 1 comment

Comments

@olorin37
Copy link
Contributor

Problem

Multiple or almost most of DevOps tools are written in go, let's name terraform for instance. In its case a provider for reading nickel files to native terraform structures could be written, although providers can be written in any language only go is officially supported. Regarding it, I think the best is to stick to go, but to evaluate nickel with from go it would be required to have nickel library exporting its capabilities to C ABI and then it would be possible to execute it with using cgo. In scope of this project such go package could be prepared similarly to pyckel. (I know about opposite approach where terraform code is defined in nickel and then exported to json which terraform loads, I mean something different). And mind, terraform is just an example.

Solution

This project could contain go package implementation which would import nickel library with cgo usage, in turn rust code needs to be exported to library with C ABI.

cgo is considered as not performant, but it for described use case it will be absolutely enough.

@yannham
Copy link
Member

yannham commented May 29, 2024

I agree that a C-compatible facade would be useful in general. The first step is to have first a Rust facade, because as discussed in various channels, nickel-lang-core is mostly an internal library provided "as it is" and isn't very user-friendly (although it's not too bad either). So how I see it, we should:

  1. Create a nickel-lang-rs library which asbtract the details of nickel-lang-core, exposing a smaller, simpler, and more stable API
  2. Just make a C compatible wrapper out of 1.
  3. Make a Go wrapper (or really any language out there with C FFI) out of 2.

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

No branches or pull requests

2 participants