Skip to content

Releases: t3dotgg/lust-lang

lust 0.2.0

Choose a tag to compare

@t3dotgg t3dotgg released this 17 Oct 22:11

lust 0.2.0: ts-rust v0.7.0 checks, builds and runs with lust, and a cold check of a large crate is now faster than cargo check.

Rule zero: every program lust accepts is valid Rust (rustc 1.99, edition 2024) and gives the same output. When lust cannot match rustc, it rejects the program with an error code.

What works

  • ts-rust v0.7.0 (upstream pingdotgg/ts-rust 780dc512d plus 6 small commits on the fork branch lust-v0.7b): 18/18 targets check, 11/11 build. The lust-built bins match the Cargo-built ones on 540/540 fixture runs (stdout, stderr, exit code, every written file), the 7 integration test bins, and 12/12 tool runs. 683/683 unit tests give the same result. The fork's own cargo test passes (2,025 tests).
  • The ts-rust PR branch (fork branch lust-v0.7d, 7459613a7): all 18 lib and bin targets check with this package on a fresh machine.
  • The older pinned fork (ts-rust at Oct 9) still checks 17/17 and builds 11/11.

Speed and memory

ts-rust v0.7.0 PR tree (lust-v0.7d), measured on a fresh 16 vCPU, 32 GB Linux box with this package. cargo check ran on the same box (rustc 1.97.1, incremental, the same features as lust's dev check):

Step lust cargo check
Cold check of ts_goport, no daemon 11.9 s (1.45 GB peak) 24.1 s (deps included)
Daemon first check 14.7 s -
No change 0.01 s 0.02 s
Change one function body (3 edits) 0.01 to 0.02 s 1.6 to 1.8 s
A body edit with a type error 0.01 s 1.4 s

In 0.1.0, the cold check of ts_goport (pinned fork) took 70.5 s, 2x slower than cargo check.

More numbers:

  • Edits on the unpruned ts_goport crate of the pinned fork (warm daemon, 6 seeds of mixed edits): every edit kind has a median of 13 to 90 ms, 78x to 441x faster than cargo check. The p95 is 25 to 38 ms for body, macro body, generic, infer and obligation edits, and 113 to 224 ms for signature, impl Trait return and derive edits. In 0.1.0 these edits took about 0.6 s at the median and up to 98 s at p95.
  • Body edits on the ts-rust v0.7.0 tree (12 edits in ts_goport and goport_core): median 28 ms, worst 48 ms. Before this release, half of these edits took 4.9 to 5.6 s.
  • Memory: the daemon uses 6.7 GB after the first check of ts_goport on the v0.7.0 tree. On the pinned fork it uses 4.8 GB after the first check and 5.7 GB at peak over 300 mixed edits. In 0.1.0 it used 14.5 GB after the first check and up to 20 GB. A 16 GB machine is now enough for ts-rust.

Known limits

  • Linux x86_64 only, glibc 2.38 or newer (Ubuntu 24.04, Debian 13, Fedora 39 and newer; not Ubuntu 22.04 or Debian 12).
  • Some cases are still slow. An edit that makes an impl Trait return type fail takes about 2 s to reject. The first check through a new daemon is a full check (14.7 s on ts_goport).
  • Single-file lust build and lust run use panic=abort, but plain rustc uses unwind. A program that catches a panic or joins a panicking thread can print different output. Use -C panic=unwind for such programs. Builds of a Cargo project follow its Cargo profile (unwind unless the profile asks for abort).
  • Built programs run slower than rustc debug builds, because tcc does not optimize. Use Cargo for release builds.
  • lust port is not in the package.

Install

tar xzf lust-0.2.0-x86_64-linux.tar.gz
export PATH="$PWD/lust-0.2.0-x86_64-linux/bin:$PATH"
lust --version

sha256: 1d986427654e8d58ae759c84f6542653b725f2a8497fb37f956d44b4c3c29330

MIT license. The bundled tcc keeps its LGPL 2.1 license.

lust 0.1.0

Choose a tag to compare

@t3dotgg t3dotgg released this 17 Oct 08:37
3e76159

First public release of lust: a compiler for a subset of Rust with a warm daemon for fast dev checks.

Rule zero: every program lust accepts is valid Rust (rustc 1.99, edition 2024) and gives the same output. When lust cannot match rustc, it rejects the program with an error code.

What works

  • The whole ts-rust fork (pingdotgg/ts-rust at Oct 9, pinned in this repo): 17/17 targets check, 11/11 build, and the lust-built bins match the Cargo-built ones on 350/350 fixture runs, the 7 integration test bins, and 479/479 unit tests.
  • Body edits through the warm daemon are very fast: a few ms on ts-rust slices, hundreds of times faster than cargo check.

Known limits

  • Linux x86_64 only, glibc 2.38 or newer.
  • A cold check of a large crate is slower than cargo check (ts_goport: 70.5 s vs 37.9 s). The daemon needs 15 to 20 GB for ts_goport; use a 32 GB machine.
  • Edits outside function bodies (signatures, types, derives) on a large crate are much slower than body edits, and an edit right after a rejected one can fall back to a full check. Work on this is in progress.
  • Built programs run slower than rustc debug builds (tcc does not optimize). Use Cargo for release builds.
  • Newer ts-rust main (v0.7.0) does not check yet; work is in progress.

Install

tar xzf lust-0.1.0-x86_64-linux.tar.gz
export PATH="$PWD/lust-0.1.0-x86_64-linux/bin:$PATH"
lust --version

sha256: 423e86bc9679531c96a9636d3951e2557fd688ce66963044c93be3ac631d42b4

MIT license. The bundled tcc keeps its LGPL 2.1 license.