Lean 4 is both a proof assistant and general-purpose programming language, with built-in native code generation.
# use pinned version of the Lake package manager via `elan`
$ lake +leanprover/lean4:v4.0.0-m3 init hello
$ cat Main.lean
import Hello
def main : IO Unit :=
IO.println s!"Hello, {hello}!"
$ lake build
> LEAN_PATH=./build/lib /home/sebastian/.elan/toolchains/leanprover--lean4---nightly/bin/lean ././Hello.lean -R ./. -o ./build/lib/Hello.olean -i ./build/lib/Hello.ilean -c ./build/ir/Hello.c
> /home/sebastian/.elan/toolchains/leanprover--lean4---nightly/bin/leanc -c -o ./build/ir/Hello.o ./build/ir/Hello.c -O3 -DNDEBUG
> LEAN_PATH=./build/lib /home/sebastian/.elan/toolchains/leanprover--lean4---nightly/bin/lean ././Main.lean -R ./. -o ./build/lib/Main.olean -i ./build/lib/Main.ilean -c ./build/ir/Main.c
> /home/sebastian/.elan/toolchains/leanprover--lean4---nightly/bin/leanc -c -o ./build/ir/Main.o ./build/ir/Main.c -O3 -DNDEBUG
> /home/sebastian/.elan/toolchains/leanprover--lean4---nightly/bin/leanc -o ./build/bin/hello ./build/ir/Main.o ./build/ir/Hello.o
$ file ./build/bin/hello
./build/bin/hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/41dj1v3qz9a5kjncpkxhmq50yg9r24dn-glibc-2.33-62/lib/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, with debug_info, not stripped
$ ./build/bin/hello
Hello, world!
Note, however, that currently there are no formal guarantees about the code generation.