Hard Traits registry for Ethos.
Use Forge to install native C/C++/Rust extensions. Hosted on Cloudflare Pages.
Important: Every Hard Trait must support all platforms — Linux, macOS, Windows, and Termux. If yours does not support then first open a issue otherwise your pr would be rejected.
Search:
forge foundry search mathInstall:
forge foundry get mymathList what you have:
forge list nativeThen in Ethos:
bring in mymath.
set result to run mymath.add with 10, 5.
say result.
- You write a Hard Trait using one of the template repos (C, C++, or Rust).
- The template has GitHub Actions that build binaries for all 8 platforms automatically (Linux x86_64, Linux ARM64, macOS Intel, macOS Apple Silicon, Windows arm64, windows x86_64, Termux ARM64, Termux ARMv7).
- You tag a release → binaries go to GitHub Releases.
- Open a PR to foundry → You must open a pr to foundry for each version bump also, you can find manifest.json in releases use that for PR as that is different.
- I review it. If it looks good, I merge it. Done.
Note: Traits that don't support all platforms will not be accepted. This ensures every user can use every trait, no matter their device. Or else open a issue first else PR would be rejected.
Step 1 — Fork a template
Pick your language:
- C: https://github.com/AmanCode22/ethos-trait-c-template (maintained by me)
- C++: https://github.com/AmanCode22/ethos-trait-cpp-template (maintained by me)
- Rust: https://github.com/AmanCode22/ethos-trait-rust-template (maintained by me)
If you wanna contribute by making API for other languages then open an issue with the repo link containing the API similar to above and I would put them here!
These repos have starter code, build config, and CI workflows. They compile for all 8 platforms automatically when you tag a release. You don't need to build anything locally.
Step 2 — Build and release
Write your code. Push. Tag a release like v1.0.0. The workflows build binaries for all platforms and upload them to GitHub Releases automatically.
Step 3 — Open PR
Github workflow auto creates manifest.json for pr you just need to use that and done.
Step 4 — Review and merge
I review the PR personally. If it passes, I merge it. Your trait goes live on Foundry.
When you release a new version:
- Update your trait repo and tag a new release (e.g.,
v2.0.0). - The CI builds new binaries for all platforms and uploads them.
3.You opens a PR to this repo with the updated
manifest.json. - I review and merge. Users get the latest version when they run
forge foundry get.
You don't need to do anything extra. Just tag a release and open a PR.
Required:
name— must match your folder name exactlyversion— semver like1.0.0or0.5.0-betadescription— one line about what it doesauthor— your name or handlerepository— link to your trait's source repolicense— MIT, Apache-2.0, etc.platforms— object with all 8 platform entries (see below)platforms.<os>.url— direct link to the binary on GitHub Releasesplatforms.<os>.checksum—sha256:<hash>of that binaryfunctions— list of functions Ethos can callfunctions.<name>.return— return type (see supported types below)functions.<name>.args— list of argument types
Optional:
tags— keywords like["math", "crypto"]for searchverified— leavefalse; I set it totrueafter I review your code
Supported types for return and args:
char, unsigned char, wchar_t
short, unsigned short
int, unsigned int
long, unsigned long
long long, unsigned long long
int8_t, uint8_t, int16_t, uint16_t
float, double, long double
char *, wchar_t *, void *
pointer_to_int, size_t, ssize_t
bool, void
- Folder name must equal
manifest.name - All 8 platforms must be supported — no partial support, or else open a issue first else PR would be rejected
- No binaries in this repo — use GitHub Releases
- All URLs must be public
- Checksums are mandatory (SHA256)
Every trait must include binaries for all of these:
| Tag | OS | Arch | Extension |
|---|---|---|---|
| linux-x86_64 | Linux | x86_64 | .so |
| linux-aarch64 | Linux | ARM64 | .so |
| macos-arm64 | macOS | Apple Silicon | .dylib |
| macos-x86_64 | macOS | Intel | .dylib |
| windows | Windows | x86_64 | .dll |
| windows-arm64 | Windows | arm64 | .dll |
| termux-aarch64 | Android/Termux | ARM64 | .so |
| termux-armv7 | Android/Termux | ARMv7 | .so |
If your trait can't build on one of these, open issue first then submit.
- Ethos docs: https://github.com/AmanCode22/ethos-lang/blob/main/DOCS.md
- Forge: https://github.com/AmanCode22/forge
- C template: https://github.com/AmanCode22/ethos-trait-c
- C++ template: https://github.com/AmanCode22/ethos-trait-cpp
- Rust template: https://github.com/AmanCode22/ethos-trait-rust
- Building Ethos: https://github.com/AmanCode22/ethos-lang/blob/main/BUILDING.md
MIT. Free to use, free to contribute.
Built by Aman (Class 9, India). Solo project. I review every PR myself. Questions? Open an issue.