Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lean 4 export Code into another languages

Is it possible to export the Lean language (from Lean 4) into an other language, like Isabelle does is to Haskell or Scala with a code-generation?

Didn't find it in the documentation.

like image 762
bk-ay Avatar asked Apr 29 '26 14:04

bk-ay


1 Answers

No, and doing so would in general be a bad idea. Lean's run-time performance, especially for primitive types such as Array, fundamentally relies on the "functional but in-place" technique. Languages implemented using tracing garbage collectors usually cannot implement this run-time optimization and so would have to fall back to conservative copying when e.g. modifying arrays.

A better approach is to recognize Lean as a general-purpose language in itself and to use its foreign-function interface (which, yes, is not quite finished and stable as of this writing, but has been used successfully by some people) to interface with code written in other languages.

like image 97
Sebastian Ullrich Avatar answered May 02 '26 17:05

Sebastian Ullrich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!