Skip to content

Commit 1746d8c

Browse files
chrisethgzanittigeorgwiese
authored
PIL -> rust compiler (#1416)
This is a (yet unused) component that takes an `Analyzed` and a list of names and turns these names into `fn(u64) -> u64` to be called directly. Not all syntax is supported yet (and no built-in functions). The first goal is not be able to compile all constant functions. The benchmarks show that `sqrt` is roughly 10 times faster than the evaluator. --------- Co-authored-by: Gastón Zanitti <[email protected]> Co-authored-by: Georg Wiese <[email protected]>
1 parent fffb653 commit 1746d8c

File tree

8 files changed

+695
-16
lines changed

8 files changed

+695
-16
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ members = [
1010
"cli",
1111
"cli-rs",
1212
"executor",
13+
"jit-compiler",
1314
"riscv",
1415
"parser-util",
1516
"pil-analyzer",
@@ -48,6 +49,7 @@ powdr-analysis = { path = "./analysis", version = "0.1.0-alpha.2" }
4849
powdr-backend = { path = "./backend", version = "0.1.0-alpha.2" }
4950
powdr-executor = { path = "./executor", version = "0.1.0-alpha.2" }
5051
powdr-importer = { path = "./importer", version = "0.1.0-alpha.2" }
52+
powdr-jit-compiler = { path = "./jit-compiler", version = "0.1.0-alpha.2" }
5153
powdr-linker = { path = "./linker", version = "0.1.0-alpha.2" }
5254
powdr-number = { path = "./number", version = "0.1.0-alpha.2" }
5355
powdr-parser = { path = "./parser", version = "0.1.0-alpha.2" }

jit-compiler/Cargo.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[package]
2+
name = "powdr-jit-compiler"
3+
description = "powdr just-in-time compiler"
4+
version = { workspace = true }
5+
edition = { workspace = true }
6+
license = { workspace = true }
7+
homepage = { workspace = true }
8+
repository = { workspace = true }
9+
10+
[dependencies]
11+
powdr-ast.workspace = true
12+
powdr-number.workspace = true
13+
powdr-parser.workspace = true
14+
15+
log = "0.4.18"
16+
mktemp = "0.5.0"
17+
itertools = "0.13"
18+
libloading = "0.8"
19+
20+
[dev-dependencies]
21+
powdr-pil-analyzer.workspace = true
22+
pretty_assertions = "1.4.0"
23+
test-log = "0.2.12"
24+
env_logger = "0.10.0"
25+
26+
[lints.clippy]
27+
uninlined_format_args = "deny"

0 commit comments

Comments
 (0)