-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat(dlang): Add a D host SDK #412
Conversation
Wow, @chances - this is awesome! Thank you 🙏 we will review asap and get back to you with any questions. |
Nice! As far as I can tell this code makes sense, but I don't really know D and didn't see any tests or anything to run. Definitely curious to try it out! As part of our push toward Extism 1.0 (see #42) we're looking to move the SDKs into their own repos, it might be a good idea to start this off in its own repo to begin with? |
(Emphasis added) I totally plan to add unit tests (D lets you define them inline 🎉), but I haven't made time for this step yet. I've added a TODO list to the PR description. |
Is there an extant repo or an example you can point me to so I can try this out without flailing in the dark? What is the procedure for getting a new repo added to the @extism org? |
We haven't fully discussed that process yet, but I think we could create the I'll bring this up at our team meeting on Monday! |
@zshipko Were y'all able to discuss the SDKs-in-separate-repos issue this week? |
Ah yes, sorry! We decided that since the process of extracting the SDKs into their own repos would happen gradually it would still make sense to merge this into the current repo. We are also hoping to make all the new SDK repos have a common interface for building/testing. Since this doesn't exist yet we don't want to hold you up! Also, none of us are D users (yet?) so we will probably need some additional help with understanding D package management and how to setup github actions for testing/releases. |
@zshipko Thank you. D has a standard package manager (Dub) and a common repo of packages: code.dlang.org. Either I or one of your administrators will login to the package repo and register this repo as a D package once the PR is merged. I am setting up a D continuous integration script as we speak. |
The example fails at runtime:
|
When I try to run the example on Linux using
Could I be on the wrong version of |
These symbols are defined in This issue does not occur in CI. @mhmd-azeez What OS are you testing on? |
Yes.
I am using WSL, probably windows and linux binaries are mixed. Will try it out on pure linux later on |
An issue has been raised (dlang/dub#2700) to address the linting issues with intermediate targets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These symbols are undefined in the latest release (v0.5.0):
Those symbols aren't available in any release yet, I think it makes sense to target the main branch for now.
I was able to run the example successfully on Linux, and the code looks good!
What do you think is needed for this to be considered ready?
I am unable to successfully run the example on my macOS machine because the cargo package fails to compile. Is there a specific version of rust I ought be using?
I suppose we can iterate on the unit tests. In lieu of that:
|
We would definitely appreciate your help with this! I will look into the process a little more.
We are very close to opening up to docs website for contributions, so if you are up to it we would be happy to have someone familiar with the language help with the docs. But working toward 1.0 we are trying to move all the docs closer to the actual code. So if D has a specific way of handling documentation it would be best to use that for now, especially if it's something that can be checked automatically when running the tests. Since the goal is to move the D code to it's own repo, we could even have an Action to publish the docs if needed. |
@zshipko I have the example working locally after I upgraded my rust installation. |
Hi @chances -- sorry for hijacking this PR thread, but I have a tangential question for you! When doing the FFI work for this SDK, did you happen to reference this page of docs? https://extism.org/docs/concepts/runtime-apis Asking as we are in the process of revamping the documentation and considering moving these docs somewhere else. Thanks! |
Yes, I referenced that page extensively, especially with relation to the doc comments in the D bindings. |
This is looking good to merge to me. Here is what I suggest we do:
We do have one change we'd like to get in before doing that as mentioned here: #511, But also i don't want to block this PR any further. @chances, what do you think? Would you be able to help with the breaking change after we merge? |
@bhelx Yes, that sounds good to me! Regarding your question, which breaking change in the linked PR are you referring to? I can certainly help with changes to the D SDK, regardless. |
Okay i'm gonna merge this today and move it over to d-sdk repo. Will report back when it's done. |
Alright, this repo along with commits has been moved to https://github.com/extism/d-sdk |
@chances Thanks! I'll make an issue on the new repo. I'll also drop any other items I think we'll need for 1.0. |
BTW, thanks again this is very cool to see! I've created a #d-sdk channel in our Discord as well https://discord.com/channels/1011124058408112148/1166121366920118424 Discord invite: https://discord.gg/q4vJjtbg |
Just following up here, zach already grabbed the namespace change (the breaking change) we were referring to so I think it's good extism/d-sdk#1 |
See dlang.org.
SDK Coverage: ~91.30% (21/23)
Issues
These symbols are undefined in the latest release (v0.5.2):
Using
libextism
compiled from source does not have this issue.dub lint
reads many intermediate targets files:dub lint
should only lint source files (excluding ignored ones) dlang/dub#2700Todo List
ExtismFunctionType
See
FunctionType
alias.extism_plugin_id
extism_plugin_new_error_free
extism_plugin_error