kostya / benchmarks

Some benchmarks of different languages
MIT License
2.8k stars 253 forks source link

Add staged Scala variant #461

Closed philnguyen closed 11 months ago

philnguyen commented 1 year ago

This one starts from the main Scala variant, adops Scala 3's preferred quiet syntax, then uses Scala's multi-stage programming to apply the same technique in the Racket (Syntax Objects) variant. And the JVM is wicked fast!!

Unfortunately I couldn't figure out the more lightweight way to get it to work with just the compiler directly (i.e. scalac -with-compiler -d out Main.scala as they suggest in their docs), so I have to use sbt.

The commands I use to build and run are currently as follow:

$ cd scala-staged
$ sbt "run ../bench.b"
nuald commented 11 months ago

The test has been embedded into the suite in #472 . Required minor modifications to make it compatible with the test suite, but it's only about main object, logic hasn't been changed.