https://github.com/redttgmoss/moos-sdk
A moos sdk for developing plugins with moonbit
https://github.com/redttgmoss/moos-sdk
extism moonbit moonbit-lang moss
Last synced: 3 months ago
JSON representation
A moos sdk for developing plugins with moonbit
- Host: GitHub
- URL: https://github.com/redttgmoss/moos-sdk
- Owner: RedTTGMoss
- License: apache-2.0
- Created: 2025-03-08T14:35:34.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-09T12:52:13.000Z (3 months ago)
- Last Synced: 2025-03-09T13:18:57.133Z (3 months ago)
- Topics: extism, moonbit, moonbit-lang, moss
- Language: MoonBit
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# moos-sdk
[](https://modsurfer.dylibso.com/module?hash=fa39db232381e9de32a6e5b863edf5dc1552dc0e63682ad655cc72c2e042f9fa)
[](https://www.gnu.org/licenses/gpl-3.0)A sdk to build moss extensions easily with moonbit
# Getting Started
1. Create a new project with `moon new`
2. Add moos as dependency `moon add furesoft/moos-sdk`
3. Create those functions
```moonbit
pub fn moss_extension_register() -> Int {
let extensionInfo: @moss.ExtensionInfo = {
files: []
}@host.output_json_value(extensionInfo.to_json())
0
}pub fn moss_extension_loop() -> Int {
0
}pub fn moss_extension_unregister() -> Int {
0
}
```
4. import the moos-sdk and export those functions in the moon.pkg.json
```json
{
"import": [
"gmlewis/moonbit-pdk/pdk",
"gmlewis/moonbit-pdk/pdk/host",
{"path": "furesoft/moos-sdk/lib", "alias": "moss"}
],
"link": {
"wasm": {
"exports": [
"moss_extension_register",
"moss_extension_unregister",
"moss_extension_loop"
],
"export-memory-name": "memory"
}
}
}
```
5. Build it with `moon build --target wasm`