Thank you for considering contributing to this project! We welcome all contributions, whether it's bug reports, feature requests, documentation improvements, or code contributions.
- Getting Started
- Configuring Java Options
- How to Build Locally
- How to Open a Pull Request
- How to Claim a Bounty
- LLM Use Guide
- Code Style Guide
Before you begin, make sure you have the following installed:
- Java 21
- Scala
- Node
- sbt (Scala Build Tool)
- Git
-
Fork the Repository
- Navigate to the kyo repository and click the Fork button.
-
Clone Your Fork
git clone https://github.com/your-username/kyo.git cd your-repo -
Set Up Upstream Remote
git remote add upstream https://github.com/original-author/your-repo.git
Java options (JAVA_OPTS and JVM_OPTS) define how much memory and resources the JVM should use when running the project. Setting these options correctly ensures stable performance and prevents out-of-memory errors.
To configure Java options, run the following commands in your terminal:
export JAVA_OPTS="-Xms3G -Xmx4G -Xss10M -XX:MaxMetaspaceSize=512M -XX:ReservedCodeCacheSize=128M -Dfile.encoding=UTF-8"
export JVM_OPTS="-Xms3G -Xmx4G -Xss10M -XX:MaxMetaspaceSize=512M -XX:ReservedCodeCacheSize=128M -Dfile.encoding=UTF-8"-Xms2G: Sets the initial heap size to 3GB.-Xmx3G: Sets the maximum heap size to 4GB.-Xss10M: Sets the stack size to 10MB.-XX:MaxMetaspaceSize=512M: Limits the maximum metaspace size to 512MB.-XX:ReservedCodeCacheSize=128M: Reserves 128MB for compiled code caching.-Dfile.encoding=UTF-8: Ensures file encoding is set to UTF-8.
If you experience memory issues or your system has more resources, you can increase these values. For example, if you have 16GB RAM, you might set:
export JAVA_OPTS="-Xms4G -Xmx8G -Xss10M -XX:MaxMetaspaceSize=1G -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8"
export JVM_OPTS="-Xms4G -Xmx8G -Xss10M -XX:MaxMetaspaceSize=1G -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8"You can also add these lines to your .bashrc or .zshrc file for persistent settings.
Run the following commands to build and test the project locally:
sbt '+kyoJVM/test' # Runs JVM tests
sbt '+kyoJS/test' # Runs JS tests
sbt '+kyoNative/Test/compile' # Compiles Native code-
Create a New Branch
git checkout -b feature-branch
-
Make Your Changes
- Ensure your code follows project guidelines.
- Include tests if applicable.
-
Commit Your Changes
git add . git commit -m "Describe your changes"
-
Push to Your Fork
git push origin feature-branch
-
Create a Pull Request
- Navigate to your repository on GitHub.
- Click on Compare & pull request.
- Provide a clear title and description of your changes.
- Fill out the PR template where necessary.
- Submit the pull request for review.
- Check the list of available bounties in the Issues section with the
💎 Bountylabel or just cllick here. - Comment on the issue expressing your interest in working on it.
- Follow the contribution guidelines and submit a PR.
- Upon successful review and merge, you will receive the bounty reward.
We encourage contributors to leverage Large Language Models (LLMs) responsibly:
- Do not submit low-effort, AI-generated code without review.
- If you use AI assistance, ensure that the submission is well-tested and meets our standards.
- Automated PRs without human oversight may be closed.
- Follow the project's existing coding style.
- Run formatting checks before submitting a PR:
sbt "scalafmtCheckAll"
If you want to contribute a new method like S.newMethod or s.newMethod, feel free to:
- Open an issue
- Discuss on Discord: https://discord.gg/afch62vKaW
- Share design examples:
- Use cases
- Equivalent in
ZIOorCats Effect - Other motivating patterns
| Subproject | Use For |
|---|---|
kyo-data |
Data structures (Chunk, Maybe, Result, etc.) |
kyo-prelude |
Effect types without Sync (Abort, Env, Var, etc.) |
kyo-core |
Methods requiring Sync, Async, or Scope |
kyo-combinators |
Extensions or composition helpers |
Add corresponding tests in the same subproject.
Example:
A new Stream.fromSomething method:
- If it uses
Sync: place it inkyo-core/shared/src/main/scala/kyo/StreamCoreExtensions.scala - If it doesn't: place it in
kyo-prelude/shared/src/main/scala/kyo/Stream.scala
-
Prefer
call-by-name(body: => A < S) for deferred evaluation when lifting to Sync. This works becauseSyncis the final effect to be handled, allowing proper suspension of side effects. This does not apply to other effects. -
Use
inlineonly when beneficial in performance-sensitive APIs. Excessive use may increase compilation times. -
Keep
Sopen: use[S] => A < (S & SomeEffect)instead ofA < SomeEffectto support effect composition.