-
Notifications
You must be signed in to change notification settings - Fork 284
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
Rust Language Binding #305
Comments
Current repository. I'm essentially duplicating the pkl-go repository and translating to rust. |
Inded pkl-go is a good example for you to base your implementation on. |
Interested in contributing. I'll take a look. |
As far as I know @jackkleeman was looking at this also, but I don't know whether he made a start anywhere. |
Go for it - not started anything. Translating the go repo is a solid strategy |
Do we need to encode the field names in the message passing standard? I am assuming yes, since it would be hard for pkl to guess positional arguments in something like
For context, I'm attempting to use the rmp_serde package to serialize the messages, but I'm not sure how to force it to encode field names, so if anyone has any ideas or experience that would be mighty helpful. |
https://pkl-lang.org/main/current/bindings-specification/index.html might be some info here? |
That's the page that prompts my question, I'm going to assume messages need to be formatted more or less exactly the same as what's shown unless there is evidence to suggest otherwise. |
Including for posterity sake that I managed to figure it out. See the corresponding issue in my repo. |
Does anyone know if there is a way to get the |
I think it just reads stdin, but you should be able to exec the process using any file as stdin, including a fifo? |
If any references are still needed for this, I have a rust binding https://github.com/z-jxy/rpkl |
I don't think that is public |
Sorry link didn't paste right, should work now |
Alright, so I think I'm going to try to pull your codegen into my repo. Hecktic couple weeks, so sorry for the absence of activity. Currently I am working on making the binding documentation a bit more robust and refining the API so that everything works well. @z-jxy what's your plan with your repo? I'm very open to the suggestion that my binding is a bit over-engineered for the moment, so I'm open to switching the bulk of the work to yours to make everything work there. I also made a repo for illustrative purposes that uses my bindings here (I'll pin the version in the cargo). |
@Sir-NoChill I was planning to publish the crate after adding some more documentation and reorganizing some of the modules. Also wanted to focus on improving the codegen since it doesn't provide much flexibility at the moment. For example, there's no way to specify derive attributes for generated structs. All attributes have to be added manually which could be time consuming for larger modules. I made an issue for this here. |
I'm looking to contribute a rust language binding for PKL, I was wondering if anyone had already started on one after finding this discussion.
The text was updated successfully, but these errors were encountered: