Skip to content

Commit

Permalink
Add first draft of instrumented virtual machine (#713)
Browse files Browse the repository at this point in the history
In this PR I develop a tracing virtual machine for Core. This will allow
us to:

- check whether optimizations actually optimize things
- measure different aspects of the evaluation as part of CI and make
sure that changes do not invalidate optimizations
- implement a debugger / visualizer in the long run
  • Loading branch information
b-studios authored Jan 7, 2025
1 parent b179d1f commit 4a71622
Show file tree
Hide file tree
Showing 15 changed files with 1,788 additions and 23 deletions.
20 changes: 10 additions & 10 deletions effekt/jvm/src/test/scala/effekt/EffektTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,19 @@ trait EffektTests extends munit.FunSuite {
case f if f.isDirectory && !ignored.contains(f) =>
f.listFiles.foreach(foreachFileIn(_)(test))
case f if f.getName.endsWith(".effekt") || f.getName.endsWith(".effekt.md") =>
val path = f.getParentFile
val baseName = f.getName.stripSuffix(".md").stripSuffix(".effekt")

if (ignored.contains(f)) {
ignored.contains(f)
} else {
val checkfile = path / (baseName + ".check")
val expected = if checkfile.exists() then Some(IO.read(checkfile)) else None

test(f, expected)
if (!ignored.contains(f)) {
test(f, expectedResultFor(f))
}
case _ => ()
}

runTests()
}

def expectedResultFor(f: File): Option[String] = {
val path = f.getParentFile
val baseName = f.getName.stripSuffix(".md").stripSuffix(".effekt")
val checkfile = path / (baseName + ".check")
if checkfile.exists() then Some(IO.read(checkfile)) else None
}

Loading

0 comments on commit 4a71622

Please sign in to comment.