Crow
This readme describes how to contribute to Crow.
For information about the language itself, visit the website.
Setup
To work on Crow, you'll need these tools:
git
: Used to get this repository.hg
: Used to clone thedyncall
library.ldc
: Used to compilebin/crow
.- Don't use the Visual D installer as it uses an older compiler. Download the latest release instead.
node.js
: Used for tests of the WASM module- Also install dependencies listed on the download page.
- On Windows, use the "x64 Native Tools Command Prompt for VS 20__" (fill in the year) when running build commands.
Then run:
git clone https://github.com/andy-hanson/crow.git
cd crow
make all
This will build bin/crow
(or bin\crow.exe
on Windows), test, then serve the website on localhost
.
Testing
make test
runs all tests. (Before any PR, you should run make all
to lint as well.)
There are 2 kinds of tests:
- Unit tests in
src/test
.make unit-test
runs these. - End-to-end tests in the
test
directory.make end-to-end-test
runs these.- If adding or changing tests, run
make end-to-end-test-overwrite
.
- If adding or changing tests, run
Debugging
crow
itself (compiler or interpreter)
Debugging Use make debug
.
Debugging Crow code
Currently, Crow has no debugger of its own, so you'll have to compile to C and debug that. By default, crow compiles the C code with debug symbols.
For example:
crow build a.crow
gdb a
rbreak throw
run
Testing compiler/interpreter performance
Linux
make bin/crow-fast-debug
mkdir perf && cd perf
valgrind --tool=callgrind -v --dump-every-bb=10000000 ../bin/crow-fast-debug run some-program.crow --interpret
kcachegrind .
Windows
Haven't tested this yet.