I'd like to suggest one refinement to your idea. Being able to write the entire build process in your language is great. Having to write it in your language may be not so great. Allow the option of using alternate build systems without the build process being crippled.
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
I'd like to suggest one refinement to your idea. Being able to write the entire build process in your language is great. Having to write it in your language may be not so great. Allow the option of using alternate build systems without the build process being crippled.
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.