Lessons

lesson 13 / 15

Why exec is different in the browser

The native interpreter can receive an execution hook that runs a command in a project-controlled environment. A browser has no safe way to spawn a host process, so this page does not execute exec.

kongue
main {
    exec "echo this command is not run"
    print "The script continues after the explanation"
}

The example prints an informative browser limitation message. In a native embedding, the host can install an exec hook and give the command a sandbox, package root, or other project-specific behavior.