113 releases

new 0.2.49 Mar 12, 2025
0.2.44 Feb 28, 2025
0.2.29 Dec 14, 2024
0.2.26 Nov 25, 2024
0.1.40 Nov 28, 2023

#76 in Math

Download history 330/week @ 2024-11-20 370/week @ 2024-11-27 2051/week @ 2024-12-04 1476/week @ 2024-12-11 497/week @ 2024-12-18 137/week @ 2024-12-25 556/week @ 2025-01-01 408/week @ 2025-01-08 82/week @ 2025-01-15 200/week @ 2025-01-22 770/week @ 2025-01-29 507/week @ 2025-02-05 302/week @ 2025-02-12 386/week @ 2025-02-19 1344/week @ 2025-02-26 487/week @ 2025-03-05

2,679 downloads per month
Used in kcl-test-server

MIT license

2MB
47K SLoC

kcl-lib

Our language for defining geometry and working with our Geometry Engine efficiently. Short for KittyCAD Language, named after our Design API.

Contributing a standard library function

We've built a lot of tooling to make contributing to KCL easier. If you are interested in contributing a new standard library function to KCL, here is the rough process:

  1. Open just the folder in your editor of choice. VS Code, for example, struggles to run rust-analyzer on the entire modeling-app directory because it's such a turducken of TS and Rust code.
  2. Find the definition for similar standard library functions in ./kcl/src/std and place your new one near it or in the same category file.
  3. Add your new code. A new standard library function consists of:
  4. A pub async of the actual standard library function in Rust
  5. A doc comment block containing at least one example using your new standard library function (the Rust compiler will error if you don't provide an example our teammates are dope)
  6. A stdlib macro providing the name that will need to be written by KCL users to use the function (this is usually a camelCase version of your Rust implementation, which is named with snake_case)
  7. An inner function that is published only to the crate
  8. Add your new standard library function to the long list of CORE_FNS in mod.rs
  9. Get a production Zoo dev token and run export KITTYCAD_API_TOKEN=your-token-here in a terminal
  10. Run TWENTY_TWENTY=overwrite cargo nextest run --workspace --no-fail-fast to take snapshot tests of your example code running in the engine
  11. Run just redo-kcl-stdlib-docs to generate new Markdown documentation for your function that will be used to generate docs on our website.
  12. Create a PR in GitHub.

Bumping the version

If you bump the version of kcl-lib and push it to crates, be sure to update the repos we own that use it as well. These are:

Dependencies

~42–59MB
~757K SLoC