typelisp 0.2.0

A statically typed Lisp with an interpreter and a compiler to native executables (LLVM)
[package]
name = "typelisp"
description = "A statically typed Lisp with an interpreter and a compiler to native executables (LLVM)"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme = "README_JP.md"
keywords = ["lisp", "language", "compiler", "interpreter", "static-typing"]
categories = ["compilers", "command-line-utilities"]
# What goes into the package published to crates.io: the sources this crate
# builds from, and nothing the repository keeps for its own development
# (docs, examples, editor support, tests, scripts).
include = ["/src/**", "/build.rs", "/Cargo.toml", "/Cargo.lock", "/README_JP.md", "/LICENSE-APACHE", "/LICENSE-MIT", "/LICENSE-EXCEPTION"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[workspace]
members = ["crates/typelisp-abi", "crates/typelisp-front", "crates/typelisp-mem", "crates/typelisp-print", "crates/typelisp-read", "crates/typelisp-rt"]
# Plain `cargo build`/`cargo test` (no `-p`) only builds the root package by
# default in a non-virtual workspace like this one — that's not enough to
# produce `typelisp-rt`'s `staticlib` artifact, since the root package only
# needs its `rlib` to link against. Listing every member here makes them
# explicit build targets too, the same as passing `-p typelisp-rt` — see
# `aot.rs`'s `link_archive` doc comment for why that artifact has to exist
# before any AOT test runs.
default-members = [".", "crates/typelisp-abi", "crates/typelisp-front", "crates/typelisp-mem", "crates/typelisp-print", "crates/typelisp-read", "crates/typelisp-rt"]

# One version for every crate here: they are built and released together, and
# `typl --version` and `(lisp-implementation-version)` report it.
[workspace.package]
version = "0.2.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/JunSuzukiJapan/typelisp"

# The crates of this workspace as dependencies of one another. `version` is
# what crates.io resolves them by once published; `path` is what a build from
# this tree uses.
[workspace.dependencies]
typelisp-abi = { path = "crates/typelisp-abi", version = "0.2.0" }
typelisp-front = { path = "crates/typelisp-front", version = "0.2.0" }
typelisp-mem = { path = "crates/typelisp-mem", version = "0.2.0" }
typelisp-print = { path = "crates/typelisp-print", version = "0.2.0" }
typelisp-read = { path = "crates/typelisp-read", version = "0.2.0" }
typelisp-rt = { path = "crates/typelisp-rt", version = "0.2.0" }

[dependencies]
once_cell = "1.8.0"
num-bigint = "0.4"
num-rational = "0.4"
num-traits = "0.2"
num-integer = "0.1"
rustyline = "18"
inkwell = { version = "0.9", features = ["llvm22-1"] }
typelisp-abi.workspace = true
typelisp-front.workspace = true
typelisp-mem.workspace = true
typelisp-print.workspace = true
typelisp-read.workspace = true
typelisp-rt.workspace = true
lsp-server = "0.8"
lsp-types = "0.97"
# `lsp-types` requires `serde`; the LSP transport speaks JSON.
serde = { version = "1", features = ["derive"] }
serde_json = "1"

# The executables that only matter to someone working on typelisp itself —
# the two regenerators and the prelude benchmark below. Off by default so that
# `cargo install` puts only `typl` and `typl-lsp` on a user's PATH; the scripts
# that run them turn it on.
[features]
dev-tools = []

[[bin]]
name = "typl"
path = "src/main.rs"

[[bin]]
name = "typl-lsp"
path = "src/bin/lsp.rs"

# Regenerates the committed compiler-island AOT artifact
# (src/compiler_island.bc). Run via scripts/regen-compiler-island.sh
# whenever compiler.rs's SOURCE changes; the island_artifacts_are_fresh test
# fails until it is re-run. Interp-closure removal Stage 3.
[[bin]]
name = "typl-bootstrap-island"
path = "src/bin/bootstrap_island.rs"
required-features = ["dev-tools"]

# Regenerates the committed precompiled-prelude artifact
# (src/prelude_compiled.bc). Run via scripts/regen-prelude-bitcode.sh whenever
# prelude.rs's SOURCE changes — or the island does, since the island compiles
# it; the prelude_artifacts_* tests fail until it is re-run.
[[bin]]
name = "typl-bootstrap-prelude"
path = "src/bin/bootstrap_prelude.rs"
required-features = ["dev-tools"]

# Writes a new ABI version (docs/dev/api_version/) when what compiled code
# assumes about the runtime archive has changed. Run via
# scripts/regen-abi-version.sh; abi_version_test fails until it is re-run.
[[bin]]
name = "typl-regen-abi-version"
path = "src/bin/regen_abi_version.rs"
required-features = ["dev-tools"]

# Measures what the precompiled prelude is worth: the same workloads against a
# compiled and an interpreted prelude, in one process. Run via
# scripts/bench-prelude.sh.
[[bin]]
name = "typl-bench-prelude"
path = "src/bin/bench_prelude.rs"
required-features = ["dev-tools"]

# rustc shares generic instantiations across crates at opt-level 0 and 1, and
# a shared instantiation is a *reference*: with it, `typelisp-rt`'s own objects
# name symbols that live in these crates' objects, and the linker pulls those
# members into every executable — undoing the split these crates exist for.
# Measured on `(defun main () i32 42)`: 4,083,736 bytes and 237 printer symbols
# at opt-level 0, 3,510,608 and none at opt-level 2. Release builds do not
# share generics, so this only restores there what release already had.
#
# Needed *here* and not for every split-out crate: sharing runs downstream, so
# only a crate that something already-linked sits below can be dragged in this
# way. `typelisp-print` and `typelisp-read` are below `typelisp-rt`, whose
# shims every executable links. `typelisp-front` is above it and nothing
# references it unless the program calls `eval`, so it needs no entry —
# measured at 0 front symbols either way, and building it unoptimised takes
# 26s against 4m27s.
[profile.dev.package.typelisp-print]
opt-level = 2

[profile.dev.package.typelisp-read]
opt-level = 2

# `tests/net_test.rs` makes the certificate its TLS server presents; see
# crates/typelisp-rt/Cargo.toml for why it is generated and not a fixture.
[dev-dependencies]
rcgen = { version = "0.14", default-features = false, features = ["ring", "pem", "crypto"] }