What you did
Run bun bend2/main.ts omega.bend --check-only on the file below.
What happened
The command consumes a CPU core indefinitely and produces no output. I confirmed that it was still running after 20 seconds and had to interrupt it. The same command on ordinary invalid files returns immediately with a diagnostic.
The term is invalid and should be rejected quickly: the lambda parameter is self-applied and used twice. This is therefore a frontend/checker denial of service from a four-line source file, rather than accepted nontermination.
The file
type Empty is Data:
def boom() -> Empty:
(x => x(x))(x => x(x))
Cause
term_higher eagerly beta-reduces an App whenever its elaborated function is a Lam: bend.ts:781-787. For Ω, substituting the right lambda into x(x) reconstructs the same application, so term_higher recurses forever before term_check can reject the non-inferrable or affine-invalid lambda.
I have not derived a checked nonterminating term or an inhabitant of Empty; the observed issue is nontermination while processing invalid input.
Version / system
Bend 2.0.25 (a49524265bdf), Bun 1.4.2, Darwin arm64 27.0.
What you did
Run
bun bend2/main.ts omega.bend --check-onlyon the file below.What happened
The command consumes a CPU core indefinitely and produces no output. I confirmed that it was still running after 20 seconds and had to interrupt it. The same command on ordinary invalid files returns immediately with a diagnostic.
The term is invalid and should be rejected quickly: the lambda parameter is self-applied and used twice. This is therefore a frontend/checker denial of service from a four-line source file, rather than accepted nontermination.
The file
Cause
term_highereagerly beta-reduces anAppwhenever its elaborated function is aLam: bend.ts:781-787. For Ω, substituting the right lambda intox(x)reconstructs the same application, soterm_higherrecurses forever beforeterm_checkcan reject the non-inferrable or affine-invalid lambda.I have not derived a checked nonterminating term or an inhabitant of
Empty; the observed issue is nontermination while processing invalid input.Version / system
Bend 2.0.25(a49524265bdf), Bun 1.4.2, Darwin arm64 27.0.