feat: parallelised compilation #39

Merged
gk1623 merged 18 commits from gleb/parallelisation into master 2025-03-13 01:08:58 +00:00
3 changed files with 167 additions and 155 deletions
Showing only changes of commit d214723f35 - Show all commits

View File

@@ -16,11 +16,6 @@ import com.monovore.decline.Argument
import assemblyIR as asm import assemblyIR as asm
case class CliConfig(
file: File = new File(".")
)
given Argument[File] = Argument.from("file") { str => given Argument[File] = Argument.from("file") { str =>
val file = File(str) val file = File(str)
( (
@@ -94,11 +89,14 @@ object Main
version = "1.0" version = "1.0"
) { ) {
def main: Opts[IO[ExitCode]] = def main: Opts[IO[ExitCode]] =
Opts.argument[File]("file").map { file => Opts.arguments[File]("files").map { files =>
compile( files
file.getAbsolutePath, .parTraverse_ { file =>
outFile = Some(File(".", file.getName.stripSuffix(".wacc") + ".s")) compile(
).map(ExitCode(_)) // turn the int into exit code for compatibility with commandioapp file.getAbsolutePath,
// https://ben.kirw.in/decline/effect.html outFile = Some(File(".", file.getName.stripSuffix(".wacc") + ".s"))
)
}
.as(ExitCode.Success)
} }
} }