Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
91 lines (78 loc) · 3.05 KB
/
Copy pathCargo.toml
File metadata and controls
91 lines (78 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
[package]
name = "edge-python"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Single-pass SSA bytecode compiler and threaded-code stack VM for a sandboxed Python subset. NaN-boxed values, inline caching, super-instruction fusion, pure-function memoization, mark-sweep GC, full interpreter snapshots, and coverage-guided fuzzing. Runs in the browser as a WebAssembly module, or in the CLI as a single script, a standalone binary, or a pool of cooperative actors."
readme = "README.md"
autotests = false
autobins = false
# `cargo wasm` builds compiler.wasm as a cdylib, so a crate depending on this one links a plain rlib.
[lib]
name = "compiler"
doctest = false
[[test]]
name = "tests"
path = "tests/main.rs"
# Its own binary, since it counts every allocation through a global allocator.
[[test]]
name = "memory"
path = "tests/memory.rs"
[features]
default = ["std"]
std = []
# Records each instruction a run executes for `VM::ran`, method calls left unfused so every ip is the compiler's own.
coverage = []
# Recounts every slot at each collection and fails a vm.json case whose running memory count drifted.
memcheck = []
# The wrapper that makes compiler.wasm, its exports, host imports, allocator and panic handler.
runtime = []
[dependencies]
wasm-abi = { workspace = true }
hashbrown = { workspace = true }
itoa = { workspace = true }
libm = { workspace = true }
# WASM-only global allocator, host builds use std's and treat compiler.wasm as a library artifact.
[target.'cfg(target_arch = "wasm32")'.dependencies]
dlmalloc = { version = "0.2", default-features = false, features = ["global"] }
# Test-only deps for the JSON-driven test runner. None of these are pulled into the release `compiler.wasm`.
[dev-dependencies]
hashbrown = { workspace = true, features = ["serde"] }
serde = { workspace = true }
serde_json = { workspace = true }
[workspace]
members = ["abi", "pdk", "pdk/macros", "pdk/example", "skill", "lang", "bench"]
# `pdk/example` is wasm-only, in `members` for the lockfile but out of `default-members`, build it with `-p slugify-mod`.
default-members = [".", "abi", "pdk", "pdk/macros", "skill", "lang"]
resolver = "2"
[workspace.package]
version = "0.8.0"
edition = "2024"
license = "Apache-2.0"
repository = "https://github.com/dylan-sutton-chavez/edge-python/"
# One source for dependency versions, a bump touches one line and the lockfile never splits versions.
[workspace.dependencies]
wasm-abi = { path = "abi" }
hashbrown = { version = "0.17", default-features = false }
itoa = "1"
libm = "0.2"
lol_alloc = "0.4"
proc-macro2 = "1"
quote = "1"
syn = { version = "3.0.3", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true
# Released CLIs embed this build of compiler.wasm, precompiled to native code, so speed beats size.
[profile.cli]
inherits = "release"
opt-level = 3
# The VM corpora run the interpreter, unoptimized they take seventeen times longer.
[profile.dev]
opt-level = 2