feat: parallel type checking #42

Merged
gk1623 merged 4 commits from parallel-type-checking into master 2025-03-14 06:11:54 +00:00
5 changed files with 326 additions and 289 deletions
Showing only changes of commit 084081de7e - Show all commits

View File

@@ -104,7 +104,9 @@ def compile(
val asmLines = backend(typedProg) val asmLines = backend(typedProg)
val backendEnd = System.nanoTime() val backendEnd = System.nanoTime()
writer.writeTo(asmLines, outputPath) *> writer.writeTo(asmLines, outputPath) *>
logAction(s"Backend time (${filePath.toRealPath()}): ${(backendEnd - backendStart).toFloat / 1e6} ms") *> logAction(
s"Backend time (${filePath.toRealPath()}): ${(backendEnd - backendStart).toFloat / 1e6} ms"
) *>
IO.blocking(println(s"Success: ${outputPath.toRealPath()}")) IO.blocking(println(s"Success: ${outputPath.toRealPath()}"))
def processProgram(contents: String, file: File, outDir: Path): IO[Int] = def processProgram(contents: String, file: File, outDir: Path): IO[Int] =
@@ -112,7 +114,9 @@ def compile(
for { for {
frontendResult <- frontend(contents, file) frontendResult <- frontend(contents, file)
frontendEnd = System.nanoTime() frontendEnd = System.nanoTime()
_ <- logAction(s"Frontend time (${filePath.toRealPath()}): ${(frontendEnd - frontendStart).toFloat / 1e6} ms") _ <- logAction(
s"Frontend time (${filePath.toRealPath()}): ${(frontendEnd - frontendStart).toFloat / 1e6} ms"
)
res <- frontendResult match { res <- frontendResult match {
case Left(errors) => case Left(errors) =>
val code = errors.map(err => err.exitCode).toList.min val code = errors.map(err => err.exitCode).toList.min

View File

@@ -8,7 +8,6 @@ import cats.data.Chain
import cats.data.NonEmptyList import cats.data.NonEmptyList
import parsley.{Failure, Success} import parsley.{Failure, Success}
object renamer { object renamer {
import ast._ import ast._
import types._ import types._