The way I'd implement it is exposing the compiler/build tooling as a library and then a command line front end on top of it. So any tooling that can exec a CLI would be able to build for the language, but you could also compose a script that imports the tools as a library. The hairy ness is that you probably don't want arbitrary code execution in the build scripts themselves, I know there was the idea of executing the pre build scripts for rust projects by compiling to WASM and executing in wasmer or another sandboxed runtime to deal with that problem.
But in my ideal language you'd probably have a repl or virtual machine that could be sandboxed and used to execute the build scripts, including invoking the compiler as a library.
Comments
The way I'd implement it is exposing the compiler/build tooling as a library and then a command line front end on top of it. So any tooling that can exec a CLI would be able to build for the language, but you could also compose a script that imports the tools as a library. The hairy ness is that you probably don't want arbitrary code execution in the build scripts themselves, I know there was the idea of executing the pre build scripts for rust projects by compiling to WASM and executing in wasmer or another sandboxed runtime to deal with that problem.
But in my ideal language you'd probably have a repl or virtual machine that could be sandboxed and used to execute the build scripts, including invoking the compiler as a library.