2023-08-28 14:58:24 -07:00
|
|
|
[package]
|
2023-08-29 12:35:45 -07:00
|
|
|
name = "kcl-lib"
|
2023-11-15 11:41:12 -06:00
|
|
|
description = "KittyCAD Language implementation and tools"
|
2023-11-28 15:20:59 -08:00
|
|
|
version = "0.1.40"
|
2023-08-28 14:58:24 -07:00
|
|
|
edition = "2021"
|
2023-08-29 12:35:45 -07:00
|
|
|
license = "MIT"
|
2023-10-31 18:24:19 -05:00
|
|
|
repository = "https://github.com/KittyCAD/modeling-app"
|
2023-11-09 11:01:52 -06:00
|
|
|
rust-version = "1.73"
|
2023-11-15 11:41:12 -06:00
|
|
|
authors = ["Jess Frazelle", "Adam Chalmers", "KittyCAD, Inc"]
|
|
|
|
|
keywords = ["kcl", "KittyCAD", "CAD"]
|
2023-08-28 14:58:24 -07:00
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
|
|
|
|
|
|
[dependencies]
|
2024-02-11 19:50:46 +00:00
|
|
|
anyhow = { version = "1.0.79", features = ["backtrace"] }
|
2023-09-20 18:27:08 -07:00
|
|
|
async-recursion = "1.0.5"
|
2024-02-11 19:50:42 +00:00
|
|
|
async-trait = "0.1.77"
|
2024-02-11 11:09:03 -08:00
|
|
|
clap = { version = "4.5.0", features = ["cargo", "derive", "env", "unicode"], optional = true }
|
2023-09-05 16:02:27 -07:00
|
|
|
dashmap = "5.5.3"
|
2023-11-20 11:16:01 -06:00
|
|
|
databake = { version = "0.1.7", features = ["derive"] }
|
2023-12-19 11:24:44 -06:00
|
|
|
derive-docs = { version = "0.1.5" }
|
|
|
|
|
# derive-docs = { path = "../derive-docs" }
|
2023-10-24 13:49:06 -07:00
|
|
|
kittycad = { workspace = true }
|
Grackle (KCL to EP compiler) (#1270)
* Start Grackle (KCL-to-EP compiler)
This begins work on a second, different executor. The old executor is a tree-walk interpreter, this executor compiles the KCL programs into the Execution Plan virtual machine defined in its [own crate](https://github.com/KittyCAD/modeling-api/tree/main/execution-plan). This executor is called "Grackle", after an Austin bird, and it's got its own module in wasm-lib so that I can keep merging small PRs and developing incrementally, rather than building a complete executor which replaces the old executor in one PR.
Grackle's "Planner" walks the AST, like the tree-walk executor. But it doesn't actually execute code. Instead, as it walks each AST node, it outputs a sequence of Execution Plan instructions which, when run, can compute that node's value. It also notes which Execution Plan virtual machine address will eventually contain each KCL variable.
Done:
- Storing KCL variables
- Computing primitives, literals, binary expressions
- Calling native (i.e. Rust) functions from KCL
- Storing arrays
Todo:
- KCL functions (i.e. user-defined functions)
- Member expressions
- Port over existing executor's native funtions (e.g. `lineTo`, `extrude` and `startSketchAt`)
2024-01-11 09:25:10 -06:00
|
|
|
kittycad-execution-plan-macros = { workspace = true }
|
|
|
|
|
kittycad-execution-plan-traits = { workspace = true }
|
2023-08-28 14:58:24 -07:00
|
|
|
lazy_static = "1.4.0"
|
2024-02-11 12:09:50 -08:00
|
|
|
parse-display = "0.9.0"
|
2023-11-15 11:41:12 -06:00
|
|
|
schemars = { version = "0.8.16", features = ["impl_json_schema", "url", "uuid1"] }
|
2023-11-22 16:33:03 +00:00
|
|
|
serde = { version = "1.0.193", features = ["derive"] }
|
2023-10-31 06:50:07 -04:00
|
|
|
serde_json = "1.0.108"
|
2024-02-11 19:30:34 +00:00
|
|
|
thiserror = "1.0.57"
|
2024-02-11 12:59:00 +11:00
|
|
|
ts-rs = { version = "7.1.1", features = ["uuid-impl"] }
|
2024-02-11 12:10:08 -08:00
|
|
|
uuid = { version = "1.7.0", features = ["v4", "js", "serde"] }
|
2024-02-11 19:40:19 +00:00
|
|
|
winnow = "0.5.39"
|
2023-08-28 14:58:24 -07:00
|
|
|
|
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
2024-02-11 11:21:51 -08:00
|
|
|
js-sys = { version = "0.3.68" }
|
2023-09-05 16:02:27 -07:00
|
|
|
tower-lsp = { version = "0.20.0", default-features = false, features = ["runtime-agnostic"] }
|
2024-02-11 11:10:52 -08:00
|
|
|
wasm-bindgen = "0.2.91"
|
2024-02-11 12:09:40 -08:00
|
|
|
wasm-bindgen-futures = "0.4.41"
|
2024-02-11 19:39:53 +00:00
|
|
|
web-sys = { version = "0.3.68", features = ["console"] }
|
2023-08-28 14:58:24 -07:00
|
|
|
|
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
2024-02-11 12:59:00 +11:00
|
|
|
approx = "0.5"
|
2024-02-11 19:40:26 +00:00
|
|
|
bson = { version = "2.9.0", features = ["uuid-1", "chrono"] }
|
2024-02-11 19:54:02 +00:00
|
|
|
futures = { version = "0.3.30" }
|
2024-02-11 19:40:06 +00:00
|
|
|
reqwest = { version = "0.11.24", default-features = false }
|
2024-02-11 12:10:17 -08:00
|
|
|
tokio = { version = "1.36.0", features = ["full"] }
|
2024-02-11 19:19:37 +00:00
|
|
|
tokio-tungstenite = { version = "0.21.0", features = ["rustls-tls-native-roots"] }
|
2023-09-05 16:02:27 -07:00
|
|
|
tower-lsp = { version = "0.20.0", features = ["proposed"] }
|
2023-08-28 14:58:24 -07:00
|
|
|
|
2023-08-31 22:19:23 -07:00
|
|
|
[features]
|
|
|
|
|
default = ["engine"]
|
2023-09-18 20:38:40 -06:00
|
|
|
cli = ["dep:clap"]
|
2023-08-31 22:19:23 -07:00
|
|
|
engine = []
|
|
|
|
|
|
2023-08-28 14:58:24 -07:00
|
|
|
[profile.release]
|
|
|
|
|
panic = "abort"
|
|
|
|
|
debug = true
|
|
|
|
|
|
2023-10-31 14:16:18 -05:00
|
|
|
[profile.bench]
|
|
|
|
|
debug = true # Flamegraphs of benchmarks require accurate debug symbols
|
|
|
|
|
|
2023-08-28 14:58:24 -07:00
|
|
|
[dev-dependencies]
|
2023-09-20 13:15:28 -05:00
|
|
|
criterion = "0.5.1"
|
2023-09-27 08:39:16 -07:00
|
|
|
expectorate = "1.1.0"
|
2023-11-01 12:40:40 -05:00
|
|
|
insta = { version = "1.34.0", features = ["json"] }
|
2024-02-11 11:22:48 -08:00
|
|
|
itertools = "0.12.1"
|
2023-08-28 14:58:24 -07:00
|
|
|
pretty_assertions = "1.4.0"
|
2024-02-11 12:10:17 -08:00
|
|
|
tokio = { version = "1.36.0", features = ["rt-multi-thread", "macros", "time"] }
|
2023-09-20 13:15:28 -05:00
|
|
|
|
|
|
|
|
[[bench]]
|
|
|
|
|
name = "compiler_benchmark"
|
|
|
|
|
harness = false
|