2016-10-06 20:11:38 +03:00
These are commands that will likely be useful during development.
2018-04-17 23:01:37 +03:00
## Scala
Launch `sbt` in `runtime-jvm` directory, then here are various useful commands:
* `main/test:run` - runs all the tests
* `main/test:run compilation` - runs tests prefixed by `"compilation"`
* `main/test:run 102932 compilation.let3` - runs tests prefixed by `"compilation.let3"` with the random seed 102932
* `benchmark/run` - presents menu of benchmarks to run
* `;clean;coverage;main/test:run;coverageReport` followed optionally by `;coverageOff` - generates test coverage report
2018-06-26 02:13:05 +03:00
* `main/compile` - builds the interpreter
* `main/run` - builds and runs the interpreter
2018-06-18 18:20:03 +03:00
The runtime doesn't build with JDK 10 at the moment, but this will work:
```bash
JAVA_HOME=`/usr/libexec/java_home -v 9` sbt < commands . . . >
```
2018-04-17 23:01:37 +03:00
2018-06-26 02:13:05 +03:00
To run the built interpreter without booting sbt:
```bash
scala -cp main/target/scala-2.12/classes org.unisonweb.Bootstrap test.ub
```
or from the project root directory:
```bash
scala -cp runtime-jvm/main/target/scala-2.12/classes org.unisonweb.Bootstrap test.ub
```
2018-04-17 23:01:37 +03:00
## Haskell
2016-10-06 20:11:38 +03:00
For doing compilation you can do:
2018-05-17 01:20:27 +03:00
stack repl unison-parser-typechecker
2016-10-06 20:11:38 +03:00
2018-05-17 01:20:27 +03:00
From here, do `Main.main` to run the tests and `:r` for rapid recompile.
2016-10-06 20:11:38 +03:00
2017-04-04 19:31:44 +03:00
You can also do:
2018-05-17 01:20:27 +03:00
stack build unison-parser-typechecker
2017-04-04 19:31:44 +03:00
If you want to run the tests outside the REPL.
2016-10-06 20:11:38 +03:00
What if you want a profiled build? Do:
2018-05-17 01:20:27 +03:00
stack build --executable-profiling --library-profiling --ghc-options="-fprof-auto -rtsopts" unison-parser-typechecker
2016-10-06 20:11:38 +03:00
2018-05-17 01:20:27 +03:00
Again you can leave off the flag. To run an executable with profiling enabled, do:
2016-10-06 20:11:38 +03:00
2018-05-17 01:20:27 +03:00
stack exec -- < executable-name > +RTS -p
2016-10-06 20:11:38 +03:00
2018-05-17 01:20:27 +03:00
That will generate a `<executable-name>.prof` plain text file with profiling data. [More info on profiling ](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html ).