r/ProgrammingLanguages • Futhark • Jan 20 '26

Why not tail recursion?

https://futhark-lang.org/blog/2026-01-20-why-not-tail-recursion.html
62 Upvotes

34 comments sorted by

View all comments

Show parent comment

3

u/tsanderdev Jan 21 '26

What languages have actual formal specifications with formally verified compilers anyways?

That's also not what you usually mean with "it doesn't mean anything" btw.

The meaning for a language without a spec is defined by the reference implementation. And it may very well be the case that semantics change in unpredictable or non-obvious ways on a compiler version change. But so long as the compiler itself doesn't have memory unsafety or race conditions, the translation is within a range of possibilities. The fact you can't easily enumerate the possibilities or determine them without compiling doesn't change that.

2

u/jsshapiro Jan 21 '26

Here's a partial list of languages with formal specifications: Standard ML, Scheme, Ada/SPARK (heavily used in avionics), CompCert C (heavily used in automotive), Algol 68, Idris, Agda, and F*. There are others.

Microsoft has done some great work with Rust. I'm not sure what their embedding language was, but it's worth having a look at their Project Everest as well. This stuff is a lot closer to practical at scale than it used to be.