1
0
Fork 0
mirror of https://github.com/imjasonh/nescript synced 2026-07-08 08:55:38 +00:00
nescript/Cargo.toml
Claude 65a63f9a68
tooling: add --no-opt CLI flag and criterion compile benchmarks
Adds two items from the "Code quality / tooling" section of
docs/future-work.md. Both make it easier to chase regressions
without touching codegen.

- `nescript build --no-opt` skips the IR optimizer pass so
  optimizer-introduced miscompiles can be bisected against the
  unoptimized output. Threaded through CompileOptions and gated
  at the single optimizer call site in src/main.rs. Covered by a
  new integration test that compiles the same program twice
  (opt on / opt off) and asserts both outputs are valid iNES
  ROMs with matching headers and reset vectors.

- A criterion-based `benches/compile.rs` harness that times the
  full parse -> analyze -> lower -> optimize -> codegen -> link
  pipeline on every examples/*.ne file. Sources are pre-read
  into memory so file I/O stays off the hot loop, and each
  example gets its own Criterion group for easy regression
  spotting.

Committed ROM bytes under examples/*.nes are unchanged; the
emulator goldens under tests/emulator/goldens/ are untouched.
2026-04-14 01:43:51 +00:00

60 lines
1.4 KiB
TOML

[package]
name = "nescript"
version = "0.1.0"
edition = "2021"
description = "A statically-typed compiler for NES game development"
license = "MIT"
default-run = "nescript"
[[bin]]
name = "nescript"
path = "src/main.rs"
# One-shot tile / nametable generator for examples/platformer.ne. Kept in-tree
# (rather than as a Python script) so the repo stays single-language.
[[bin]]
name = "gen_platformer_tiles"
path = "scripts/gen_platformer_tiles.rs"
[dependencies]
clap = { version = "4", features = ["derive"] }
ariadne = "0.4"
image = { version = "0.25", default-features = false, features = ["png"] }
[dev-dependencies]
pretty_assertions = "1"
criterion = "0.5"
[[bench]]
name = "compile"
harness = false
[profile.release]
lto = true
strip = true
[lints.rust]
unsafe_code = "forbid"
[lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
# Allow patterns common in compiler code
module_name_repetitions = "allow"
must_use_candidate = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
cast_possible_truncation = "allow"
wildcard_imports = "allow"
option_if_let_else = "allow"
match_same_arms = "allow"
unnested_or_patterns = "allow"
missing_const_for_fn = "allow"
too_many_lines = "allow"
single_match_else = "allow"
unnecessary_wraps = "allow"
unused_self = "allow"
enum_glob_use = "allow"
manual_assert = "allow"
vec_init_then_push = "allow"
struct_field_names = "allow"